@roomstay/frontend 2.1.21 → 2.1.23
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/dist/760.bundle.js +1 -1
- package/dist/main.bundle.js +1 -1
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js +13 -11
- package/dist/src/components/steps/confirmation/StepConfirmationForm.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/test.bundle.js +1 -1
- package/package.json +1 -1
|
@@ -155,21 +155,23 @@ function StepConfirmationForm() {
|
|
|
155
155
|
yield handleBook(paymentMethod, (resData) => __awaiter(this, void 0, void 0, function* () { return commitReservation === null || commitReservation === void 0 ? void 0 : commitReservation(resData); }));
|
|
156
156
|
return false;
|
|
157
157
|
});
|
|
158
|
+
const validateConfirmationPolicy = () => {
|
|
159
|
+
var _a;
|
|
160
|
+
return !ConfirmationVerifyFeature_1.default.isActive() || !!((_a = confirmationPolicy === null || confirmationPolicy === void 0 ? void 0 : confirmationPolicy.current) === null || _a === void 0 ? void 0 : _a.checked);
|
|
161
|
+
};
|
|
162
|
+
const validateCustomFields = () => {
|
|
163
|
+
const adhocValid = formContext === null || formContext === void 0 ? void 0 : formContext.errorChecks.every((check) => check().validate());
|
|
164
|
+
return adhocValid === undefined ? true : adhocValid;
|
|
165
|
+
};
|
|
166
|
+
const isDisabledPlanpay = !validateConfirmationPolicy() || !validateCustomFields() || !methods.formState.isValid;
|
|
158
167
|
const handleBook = (paymentMethod, onSuccess) => __awaiter(this, void 0, void 0, function* () {
|
|
159
168
|
var _b;
|
|
160
169
|
yield (book === null || book === void 0 ? void 0 : book(() => __awaiter(this, void 0, void 0, function* () { return toPaymentPayload(paymentMethod); }), (_b = commentTextbox.current) === null || _b === void 0 ? void 0 : _b.value, () => __awaiter(this, void 0, void 0, function* () {
|
|
161
|
-
|
|
162
|
-
if (ConfirmationVerifyFeature_1.default.isActive() && !((_c = confirmationPolicy === null || confirmationPolicy === void 0 ? void 0 : confirmationPolicy.current) === null || _c === void 0 ? void 0 : _c.checked)) {
|
|
170
|
+
if (!validateConfirmationPolicy()) {
|
|
163
171
|
setConfirmationPolicyError(true);
|
|
164
172
|
return false;
|
|
165
173
|
}
|
|
166
|
-
|
|
167
|
-
formContext === null || formContext === void 0 ? void 0 : formContext.errorChecks.forEach((check) => {
|
|
168
|
-
if (!check().validate()) {
|
|
169
|
-
adhocValid = false;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
if (!adhocValid) {
|
|
174
|
+
if (!validateCustomFields()) {
|
|
173
175
|
return false;
|
|
174
176
|
}
|
|
175
177
|
try {
|
|
@@ -256,8 +258,8 @@ function StepConfirmationForm() {
|
|
|
256
258
|
} },
|
|
257
259
|
react_1.default.createElement(Icon_1.default, { color: Color_1.Color.DarkGrey, icon: Icon_1.IconType.Info, className: "u-marg-right--lighter u-marg-left--light" }),
|
|
258
260
|
t(Translation_1.Translation.Step.Confirmation.PlanpayHelperText))))),
|
|
259
|
-
disabled:
|
|
260
|
-
disabledReason:
|
|
261
|
+
disabled: isDisabledPlanpay,
|
|
262
|
+
disabledReason: isDisabledPlanpay ? 'You must fill all the above details before proceeding with Planpay' : '',
|
|
261
263
|
renderContent: () => react_1.default.createElement(PlanpayPaymentMethod_1.PlanpayPaymentMethod, null),
|
|
262
264
|
},
|
|
263
265
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources":["src/components/steps/confirmation/StepConfirmationForm.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuE;AACvE,6EAAqD;AACrD,0DAAuD;AACvD,kEAA2D;AAC3D,wCAAqC;AACrC,qDAA6D;AAC7D,4GAAoF;AACpF,+EAAuD;AACvD,sIAA8G;AAC9G,iGAAyE;AACzE,iDAA+C;AAC/C,iDAA0F;AAC1F,u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/components/generic/Headline';\nimport { Translation } from 'translations/Translation';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { Color } from '@/util/Color';\nimport { Controller, useFormContext } from 'react-hook-form';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport LineBreak from '@/components/generic/LineBreak';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport NextStepButton from '@/components/generic/buttons/NextStepButton';\nimport { useTranslation } from 'react-i18next';\nimport { ConfirmationFormContext, useBasket, useBookingEngine } from '@frontend/contexts';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport StepConfirmationCheckoutDifferencesModal from '@/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal';\nimport { useHistory } from 'react-router-dom';\nimport ErrorModal from '@/components/generic/modal/ErrorModal';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\n\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport BEButton from '@/components/generic/BEButton';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport StepConfirmation from '@/pages/steps/StepConfirmation/StepConfirmation';\nimport StepRoom from '@/pages/steps/StepRoom/StepRoom';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport TextBox from '@/components/generic/TextBox';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { PlanpayPaymentMethod } from './PlanpayPaymentMethod';\nimport { ConfirmationFormValues, FBookSuccessCallback } from '@/models/Confirmation';\nimport { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport BasketRowDifferences from '../../../models/BasketRowDifferences';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport StepConfirmationPaymentDetails from './PaymentDetails/StepConfirmationPaymentDetails';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\nimport RadioButtonGroup from '@/components/generic/RadioButtonGroup/RadioButtonGroup';\nimport AcceptablePaymentCard from '@/components/steps/confirmation/PaymentDetails/AcceptablePaymentCard';\nimport RoomstayThemeEngine from '@/providers/RoomstayThemeEngine';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport dayjs from 'dayjs';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\n\nexport default function StepConfirmationForm() {\n const [differenceWarning, setDifferenceWarning] = useState<{\n differences: BasketRowDifferences[];\n warnings: string[];\n }>({\n differences: [],\n warnings: [],\n });\n const formContext = useContext(ConfirmationFormContext);\n const [source, setSource] = useState('');\n const [confirmationPolicyError, setConfirmationPolicyError] = useState(false);\n const confirmationPolicy = useRef<HTMLInputElement | null>(null);\n const commentTextbox = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n const { t } = useTranslation();\n const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = useConfirmationQuery();\n const context = useBookingEngine();\n const methods = useFormContext<ConfirmationFormValues>();\n const { isBackFromPlanpay, isLoading, apiErrors, clearApiErrors, book, rollbackReservation, commitReservation } = useConfirmationStep();\n const basketContext = useBasket();\n const tokenizerRef = useRef<any | null>(null);\n const history = useHistory();\n const { hotel } = useCurrentHotel();\n\n const toPaymentPayload = async (paymentMethod: EBookingPaymentMethod): Promise<IBookingPayment> => {\n let payment: IBookingPayment;\n switch (paymentMethod) {\n case EBookingPaymentMethod.Planpay: {\n const params = new URLSearchParams(window.location.search);\n params.set('roomstayId', '{{rsId}}');\n params.set('session', context.sessionProvider.getCurrentSessionID().toString());\n params.set('paymentMethod', EBookingPaymentMethod.Planpay);\n const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;\n payment = {\n Method: EBookingPaymentMethod.Planpay,\n PlanpayCheckoutId: queryPlanpayCheckoutId || undefined,\n RedirectUrl: redirectURL,\n };\n break;\n }\n default:\n payment = {\n Method: EBookingPaymentMethod.Card,\n PaymentCard: await tokenizerRef.current?.getTokenizedCode(),\n };\n }\n\n return payment;\n };\n\n useEffect(() => {\n const validatedPaymentMethod = Object.values(EBookingPaymentMethod).includes(queryPaymentMethod as EBookingPaymentMethod)\n ? (queryPaymentMethod as EBookingPaymentMethod)\n : EBookingPaymentMethod.Card;\n methods.setValue('paymentMethod', validatedPaymentMethod);\n handleChangePaymentMethod(validatedPaymentMethod);\n if (isBackFromPlanpay) {\n if (queryRoomstayId === basketContext.reservationData?.roomstayId) {\n onPlaypayCallback(validatedPaymentMethod);\n } else {\n rollbackReservation?.();\n }\n }\n return () => {\n if (!isBackFromPlanpay) rollbackReservation?.();\n };\n }, []);\n\n const onPlaypayCallback = async (paymentMethod: EBookingPaymentMethod) => {\n await commitReservation?.(basketContext.reservationData);\n };\n\n const paymentMethod = methods.watch('paymentMethod');\n\n context.engine\n .getSessionProvider()\n .getSession()\n .then((session) => {\n setSource(session.source);\n });\n\n const returnToPickRooms = async () => {\n // TODO: What if StepRoom doesn't exist?\n history.push(StepRoom.getStepUrl());\n };\n\n const onNextStepClicked = async () => {\n await handleBook(paymentMethod, async (resData) => commitReservation?.(resData));\n return false;\n };\n\n const handleBook = async (paymentMethod: EBookingPaymentMethod, onSuccess?: FBookSuccessCallback): Promise<void> => {\n await book?.(\n async () => toPaymentPayload(paymentMethod),\n commentTextbox.current?.value,\n async (): Promise<boolean> => {\n if (ConfirmationVerifyFeature.isActive() && !confirmationPolicy?.current?.checked) {\n setConfirmationPolicyError(true);\n return false;\n }\n let adhocValid = true;\n formContext?.errorChecks.forEach((check) => {\n if (!check().validate()) {\n adhocValid = false;\n }\n });\n if (!adhocValid) {\n return false;\n }\n try {\n if (paymentMethod === EBookingPaymentMethod.Card) await tokenizerRef.current.getTokenizedCode();\n return true;\n } catch (e) {\n return false;\n }\n },\n (validationResult) => {\n if (validationResult) {\n setDifferenceWarning(validationResult);\n }\n },\n onSuccess\n );\n };\n\n const handleChangePaymentMethod = async (paymentMethod: EBookingPaymentMethod) => {\n if (paymentMethod !== EBookingPaymentMethod.Planpay) {\n await rollbackReservation?.();\n }\n };\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {source === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>Travel Agent</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent inputRef={commentTextbox} />\n <LineBreak />\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.PaymentInformation)}</Headline>\n </div>\n <Controller\n control={methods.control}\n name=\"paymentMethod\"\n render={({ field: { onChange, value } }) => {\n return (\n <>\n <div>\n <RadioButtonGroup<EBookingPaymentMethod>\n options={[\n {\n value: EBookingPaymentMethod.Card,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div className=\"u-marg-right--light\">{t(Translation.Step.Confirmation.CardLabel)}</div>\n <AcceptablePaymentCard\n isDefault={(cardKey: any) => {\n return true;\n }}\n style={{\n height: 16,\n width: 24,\n borderRadius: 2.5,\n border: '0.5px solid #DFE1E5',\n marginRight: 4,\n }}\n />\n </div>\n ),\n renderContent: () => <StepConfirmationPaymentDetails ref={tokenizerRef} />,\n },\n {\n value: EBookingPaymentMethod.Planpay,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div>{t(Translation.Step.Confirmation.PlanpayLabel)}</div>\n <div\n className=\"u-flex u-flex-align-center u-marg-left--light\"\n style={{\n borderRadius: '24px',\n overflow: 'hidden',\n }}\n >\n <img height={16} src={RoomstayThemeEngine.getImageAssetUrl('planpay-logo-small.svg')} alt=\"\" />\n </div>\n {!methods.formState.isValid && (\n <Text\n color={Color.Graphite}\n className=\"u-flex u-flex-align-center\"\n style={{\n color: '#313131',\n fontSize: 10,\n }}\n >\n <Icon color={Color.DarkGrey} icon={IconType.Info} className=\"u-marg-right--lighter u-marg-left--light\" />\n {t(Translation.Step.Confirmation.PlanpayHelperText)}\n </Text>\n )}\n </div>\n ),\n disabled: !methods.formState.isValid,\n disabledReason: !methods.formState.isValid ? 'You must fill all the above details before proceeding with Planpay' : '',\n renderContent: () => <PlanpayPaymentMethod />,\n },\n ]\n .filter(({ value }) => hotel?.paymentMethods?.includes(value))\n .filter(\n ({ value }) =>\n value !== EBookingPaymentMethod.Planpay ||\n (hotel?.planpay?.minDaysShowPlanpay &&\n dayjs(basketContext.startDate).diff(dayjs(), 'day') > hotel?.planpay?.minDaysShowPlanpay)\n )}\n value={value}\n onChange={async (code: EBookingPaymentMethod) => {\n onChange(code);\n await handleChangePaymentMethod(code);\n if (code === EBookingPaymentMethod.Planpay) {\n await handleBook(code);\n }\n }}\n />\n </div>\n </>\n );\n }}\n />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>Secured</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement ref={confirmationPolicy} confirmationPolicyError={confirmationPolicyError} />\n </div>\n </>\n )}\n <div className=\"u-flex u-marg-top--heavy justify-content-end\">\n <NextStepButton\n disabled={paymentMethod === EBookingPaymentMethod.Planpay || isLoading}\n text={t(Translation.Step.Confirmation.ConfirmReservation)}\n history={null}\n isLoading={isLoading}\n currentStep={StepConfirmation}\n onClick={onNextStepClicked}\n />\n </div>\n </>\n )}\n\n <ErrorModal open={!!apiErrors} onClose={clearApiErrors}>\n <Text>{apiErrors}</Text>\n </ErrorModal>\n <StepConfirmationCheckoutDifferencesModal\n differences={differenceWarning.differences}\n warnings={differenceWarning.warnings}\n isLoading={isLoading}\n onClose={async () => {\n await rollbackReservation?.();\n history.push(StepRoom.getStepUrl());\n }}\n onProceed={async () => {\n if (paymentMethod === EBookingPaymentMethod.Planpay) {\n setDifferenceWarning({\n differences: [],\n warnings: [],\n });\n } else {\n await commitReservation?.(basketContext.reservationData);\n }\n }}\n />\n </form>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StepConfirmationForm.js","sourceRoot":"/","sources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AAmB,EAAI,CAAA,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,kBAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YACxC,CAAC,CAAA,EACD,SAAS,EAAE,GAAS,EAAE;gBAClB,IAAI,aAAa,KAAK,4BAAqB,CAAC,OAAO,EAAE;oBACjD,oBAAoB,CAAC;wBACjB,WAAW,EAAE,EAAE;wBACf,QAAQ,EAAE,EAAE;qBACf,CAAC,CAAC;iBACN;qBAAM;oBACH,MAAM,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,aAAa,CAAC,eAAe,CAAC,CAAA,CAAC;iBAC5D;YACL,CAAC,CAAA,GACH,CACC,CACV,CAAC;AACN,CAAC;AAtVD,uCAsVC","sourcesContent":["import React, { useContext, useEffect, useRef, useState } from 'react';\nimport Headline from '@/components/generic/Headline';\nimport { Translation } from 'translations/Translation';\nimport Text, { TextType } from '@/components/generic/Text';\nimport { Color } from '@/util/Color';\nimport { Controller, useFormContext } from 'react-hook-form';\nimport RoomContactDetails from '@/components/steps/confirmation/RoomContactDetails';\nimport LineBreak from '@/components/generic/LineBreak';\nimport StepConfirmationPoliciesSection from '@/components/steps/confirmation/StepConfirmationPoliciesSection';\nimport NextStepButton from '@/components/generic/buttons/NextStepButton';\nimport { useTranslation } from 'react-i18next';\nimport { ConfirmationFormContext, useBasket, useBookingEngine } from '@frontend/contexts';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport SSLSecureBadge from '@/components/generic/badging/SSLSecureBadge';\nimport StepConfirmationCheckoutDifferencesModal from '@/components/steps/confirmation/StepConfirmationCheckoutDifferencesModal';\nimport { useHistory } from 'react-router-dom';\nimport ErrorModal from '@/components/generic/modal/ErrorModal';\nimport StepConfirmationPolicyBlock from '@/components/steps/confirmation/StepConfirmationPolicyBlock';\n\nimport StepConfirmationAcknowledgement from '@/components/steps/confirmation/StepConfirmationAcknowledgement';\nimport BEButton from '@/components/generic/BEButton';\nimport Alert, { AlertType } from '@/components/generic/Alert';\nimport StepConfirmation from '@/pages/steps/StepConfirmation/StepConfirmation';\nimport StepRoom from '@/pages/steps/StepRoom/StepRoom';\nimport ConfirmationVerifyFeature from '@/providers/feature/ConfirmationVerifyFeature';\nimport TextBox from '@/components/generic/TextBox';\nimport ShowIATANumberOnCheckoutFeature from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nimport { PlanpayPaymentMethod } from './PlanpayPaymentMethod';\nimport { ConfirmationFormValues, FBookSuccessCallback } from '@/models/Confirmation';\nimport { useConfirmationStep } from 'contexts/ConfirmationStepContext/ConfirmationStepContext';\nimport { useConfirmationQuery } from '@/hooks/ConfirmationQuery';\nimport BasketRowDifferences from '../../../models/BasketRowDifferences';\nimport LargeLoader from '@/components/generic/loader/LargeLoader';\nimport StepConfirmationPaymentDetails from './PaymentDetails/StepConfirmationPaymentDetails';\nimport { EBookingPaymentMethod, IBookingPayment } from '@roomstay/core';\nimport RadioButtonGroup from '@/components/generic/RadioButtonGroup/RadioButtonGroup';\nimport AcceptablePaymentCard from '@/components/steps/confirmation/PaymentDetails/AcceptablePaymentCard';\nimport RoomstayThemeEngine from '@/providers/RoomstayThemeEngine';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport dayjs from 'dayjs';\nimport { StepConfirmationCommentsComponent } from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\n\nexport default function StepConfirmationForm() {\n const [differenceWarning, setDifferenceWarning] = useState<{\n differences: BasketRowDifferences[];\n warnings: string[];\n }>({\n differences: [],\n warnings: [],\n });\n const formContext = useContext(ConfirmationFormContext);\n const [source, setSource] = useState('');\n const [confirmationPolicyError, setConfirmationPolicyError] = useState(false);\n const confirmationPolicy = useRef<HTMLInputElement | null>(null);\n const commentTextbox = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n const { t } = useTranslation();\n const { queryPaymentMethod, queryRoomstayId, queryPlanpayCheckoutId } = useConfirmationQuery();\n const context = useBookingEngine();\n const methods = useFormContext<ConfirmationFormValues>();\n const { isBackFromPlanpay, isLoading, apiErrors, clearApiErrors, book, rollbackReservation, commitReservation } = useConfirmationStep();\n const basketContext = useBasket();\n const tokenizerRef = useRef<any | null>(null);\n const history = useHistory();\n const { hotel } = useCurrentHotel();\n\n const toPaymentPayload = async (paymentMethod: EBookingPaymentMethod): Promise<IBookingPayment> => {\n let payment: IBookingPayment;\n switch (paymentMethod) {\n case EBookingPaymentMethod.Planpay: {\n const params = new URLSearchParams(window.location.search);\n params.set('roomstayId', '{{rsId}}');\n params.set('session', context.sessionProvider.getCurrentSessionID().toString());\n params.set('paymentMethod', EBookingPaymentMethod.Planpay);\n const redirectURL = `${window.location.origin}${window.location.pathname}${window.location.search}#/step/confirmation/?${params}`;\n payment = {\n Method: EBookingPaymentMethod.Planpay,\n PlanpayCheckoutId: queryPlanpayCheckoutId || undefined,\n RedirectUrl: redirectURL,\n };\n break;\n }\n default:\n payment = {\n Method: EBookingPaymentMethod.Card,\n PaymentCard: await tokenizerRef.current?.getTokenizedCode(),\n };\n }\n\n return payment;\n };\n\n useEffect(() => {\n const validatedPaymentMethod = Object.values(EBookingPaymentMethod).includes(queryPaymentMethod as EBookingPaymentMethod)\n ? (queryPaymentMethod as EBookingPaymentMethod)\n : EBookingPaymentMethod.Card;\n methods.setValue('paymentMethod', validatedPaymentMethod);\n handleChangePaymentMethod(validatedPaymentMethod);\n if (isBackFromPlanpay) {\n if (queryRoomstayId === basketContext.reservationData?.roomstayId) {\n onPlaypayCallback(validatedPaymentMethod);\n } else {\n rollbackReservation?.();\n }\n }\n return () => {\n if (!isBackFromPlanpay) rollbackReservation?.();\n };\n }, []);\n\n const onPlaypayCallback = async (paymentMethod: EBookingPaymentMethod) => {\n await commitReservation?.(basketContext.reservationData);\n };\n\n const paymentMethod = methods.watch('paymentMethod');\n\n context.engine\n .getSessionProvider()\n .getSession()\n .then((session) => {\n setSource(session.source);\n });\n\n const returnToPickRooms = async () => {\n // TODO: What if StepRoom doesn't exist?\n history.push(StepRoom.getStepUrl());\n };\n\n const onNextStepClicked = async () => {\n await handleBook(paymentMethod, async (resData) => commitReservation?.(resData));\n return false;\n };\n\n const validateConfirmationPolicy = (): boolean => {\n return !ConfirmationVerifyFeature.isActive() || !!confirmationPolicy?.current?.checked;\n };\n\n const validateCustomFields = (): boolean => {\n const adhocValid = formContext?.errorChecks.every((check) => check().validate());\n return adhocValid === undefined ? true : adhocValid;\n };\n\n const isDisabledPlanpay = !validateConfirmationPolicy() || !validateCustomFields() || !methods.formState.isValid;\n\n const handleBook = async (paymentMethod: EBookingPaymentMethod, onSuccess?: FBookSuccessCallback): Promise<void> => {\n await book?.(\n async () => toPaymentPayload(paymentMethod),\n commentTextbox.current?.value,\n async (): Promise<boolean> => {\n if (!validateConfirmationPolicy()) {\n setConfirmationPolicyError(true);\n return false;\n }\n if (!validateCustomFields()) {\n return false;\n }\n try {\n if (paymentMethod === EBookingPaymentMethod.Card) await tokenizerRef.current.getTokenizedCode();\n return true;\n } catch (e) {\n return false;\n }\n },\n (validationResult) => {\n if (validationResult) {\n setDifferenceWarning(validationResult);\n }\n },\n onSuccess\n );\n };\n\n const handleChangePaymentMethod = async (paymentMethod: EBookingPaymentMethod) => {\n if (paymentMethod !== EBookingPaymentMethod.Planpay) {\n await rollbackReservation?.();\n }\n };\n\n return (\n <form>\n {isBackFromPlanpay ? (\n <LargeLoader />\n ) : (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--light\">\n <Headline bold>{t(Translation.Step.Confirmation.GuestDetails)}</Headline>\n </div>\n <Text type={TextType.Small} color={Color.Success}>\n <strong>{t(Translation.Step.Confirmation.AlmostDone, { required: '*' })}</strong>\n </Text>\n </div>\n <RoomContactDetails />\n {source === 'inline' ? (\n <Alert type={AlertType.Accent2} heavyPadding>\n <div className=\"u-flex u-w-100 flex-wrap flex-xl-nowrap\">\n <div>\n <Text color={Color.Accent} bold>\n {t(Translation.Step.Confirmation.WantMoreRooms)}\n </Text>\n <Text color={Color.Navy}>{t(Translation.Step.Confirmation.YouCanAddAndEditRooms)}</Text>\n </div>\n <div className=\"d-flex align-items-center u-marg-top@xl-\">\n <BEButton filled primary icon={IconType.Add} iconPosition=\"left\" onClick={returnToPickRooms}>\n {t(Translation.Step.Confirmation.AddMoreRooms)}\n </BEButton>\n </div>\n </div>\n </Alert>\n ) : (\n <></>\n )}\n {ShowIATANumberOnCheckoutFeature.isActive() && (\n <>\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>Travel Agent</Headline>\n </div>\n\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Confirmation.Inputs.IATANumber)}</strong>\n </Text>\n </div>\n <div className=\"u-marg-bottom--light\">\n <Text type={TextType.Small}>{t(Translation.Step.Confirmation.Inputs.IATANumberGuide)}</Text>\n </div>\n <TextBox placeholder={t(Translation.Step.Confirmation.Inputs.IATANumber)} wide {...methods.register('IATANumber')} />\n </div>\n <LineBreak />\n </>\n )}\n <StepConfirmationCommentsComponent inputRef={commentTextbox} />\n <LineBreak />\n <div className=\"u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom\">\n <Headline bold>{t(Translation.Step.Confirmation.PaymentInformation)}</Headline>\n </div>\n <Controller\n control={methods.control}\n name=\"paymentMethod\"\n render={({ field: { onChange, value } }) => {\n return (\n <>\n <div>\n <RadioButtonGroup<EBookingPaymentMethod>\n options={[\n {\n value: EBookingPaymentMethod.Card,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div className=\"u-marg-right--light\">{t(Translation.Step.Confirmation.CardLabel)}</div>\n <AcceptablePaymentCard\n isDefault={(cardKey: any) => {\n return true;\n }}\n style={{\n height: 16,\n width: 24,\n borderRadius: 2.5,\n border: '0.5px solid #DFE1E5',\n marginRight: 4,\n }}\n />\n </div>\n ),\n renderContent: () => <StepConfirmationPaymentDetails ref={tokenizerRef} />,\n },\n {\n value: EBookingPaymentMethod.Planpay,\n label: (\n <div className=\"u-flex u-flex-align-center\">\n <div>{t(Translation.Step.Confirmation.PlanpayLabel)}</div>\n <div\n className=\"u-flex u-flex-align-center u-marg-left--light\"\n style={{\n borderRadius: '24px',\n overflow: 'hidden',\n }}\n >\n <img height={16} src={RoomstayThemeEngine.getImageAssetUrl('planpay-logo-small.svg')} alt=\"\" />\n </div>\n {!methods.formState.isValid && (\n <Text\n color={Color.Graphite}\n className=\"u-flex u-flex-align-center\"\n style={{\n color: '#313131',\n fontSize: 10,\n }}\n >\n <Icon color={Color.DarkGrey} icon={IconType.Info} className=\"u-marg-right--lighter u-marg-left--light\" />\n {t(Translation.Step.Confirmation.PlanpayHelperText)}\n </Text>\n )}\n </div>\n ),\n disabled: isDisabledPlanpay,\n disabledReason: isDisabledPlanpay ? 'You must fill all the above details before proceeding with Planpay' : '',\n renderContent: () => <PlanpayPaymentMethod />,\n },\n ]\n .filter(({ value }) => hotel?.paymentMethods?.includes(value))\n .filter(\n ({ value }) =>\n value !== EBookingPaymentMethod.Planpay ||\n (hotel?.planpay?.minDaysShowPlanpay &&\n dayjs(basketContext.startDate).diff(dayjs(), 'day') > hotel?.planpay?.minDaysShowPlanpay)\n )}\n value={value}\n onChange={async (code: EBookingPaymentMethod) => {\n onChange(code);\n await handleChangePaymentMethod(code);\n if (code === EBookingPaymentMethod.Planpay) {\n await handleBook(code);\n }\n }}\n />\n </div>\n </>\n );\n }}\n />\n <div className=\"u-marg-top u-flex align-items-center\">\n <div className=\"u-flex align-items-center justify-content-start\">\n <Icon icon={IconType.Lock} color={Color.Success} />\n <div className=\"u-marg-left--light\">\n <Text type={TextType.Small} color={Color.Success}>\n <strong>Secured</strong>\n </Text>\n </div>\n </div>\n <SSLSecureBadge />\n </div>\n </div>\n <LineBreak />\n <StepConfirmationPoliciesSection />\n <div className=\"u-pad-top--light u-marg-bottom\">\n <StepConfirmationPolicyBlock />\n </div>\n {ConfirmationVerifyFeature.isActive() && (\n <>\n <LineBreak />\n <div>\n <StepConfirmationAcknowledgement ref={confirmationPolicy} confirmationPolicyError={confirmationPolicyError} />\n </div>\n </>\n )}\n <div className=\"u-flex u-marg-top--heavy justify-content-end\">\n <NextStepButton\n disabled={paymentMethod === EBookingPaymentMethod.Planpay || isLoading}\n text={t(Translation.Step.Confirmation.ConfirmReservation)}\n history={null}\n isLoading={isLoading}\n currentStep={StepConfirmation}\n onClick={onNextStepClicked}\n />\n </div>\n </>\n )}\n\n <ErrorModal open={!!apiErrors} onClose={clearApiErrors}>\n <Text>{apiErrors}</Text>\n </ErrorModal>\n <StepConfirmationCheckoutDifferencesModal\n differences={differenceWarning.differences}\n warnings={differenceWarning.warnings}\n isLoading={isLoading}\n onClose={async () => {\n await rollbackReservation?.();\n history.push(StepRoom.getStepUrl());\n }}\n onProceed={async () => {\n if (paymentMethod === EBookingPaymentMethod.Planpay) {\n setDifferenceWarning({\n differences: [],\n warnings: [],\n });\n } else {\n await commitReservation?.(basketContext.reservationData);\n }\n }}\n />\n </form>\n );\n}\n"]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { default as ShowIATANumberOnCheckoutFeature } from './providers/feature/
|
|
|
46
46
|
export { default as E164PhoneNumberFieldFeature } from './providers/feature/E164PhoneNumberFieldFeature';
|
|
47
47
|
export { default as FullPageEngineSmallSpacingFeature } from './providers/feature/FullPageEngineSmallSpacingFeature';
|
|
48
48
|
export * from './contexts/index.js';
|
|
49
|
+
export { useFormContext } from 'react-hook-form';
|
|
49
50
|
export { default as SessionProvider } from './providers/SessionProvider';
|
|
50
51
|
export * from './providers/RoomstayThemeEngine';
|
|
51
52
|
export { default as RoomstayThemeEngine } from './providers/RoomstayThemeEngine';
|
package/dist/src/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Version = exports.events = exports.RoomstayEventManager = exports.StepThanks = exports.StepRoom = exports.StepHotel = exports.StepConfirmation = exports.StepDate = exports.StepAddon = exports.StepManager = exports.API = exports.DataLayer = exports.withDI = exports.registerReplacement = exports.RoomstayThemeEngine = exports.SessionProvider = exports.FullPageEngineSmallSpacingFeature = exports.E164PhoneNumberFieldFeature = exports.ShowIATANumberOnCheckoutFeature = exports.RoomUpsellFeature = exports.InlineAddonStepFeature = exports.FeaturedPromoFeature = exports.DatePickerTypeFeature = exports.ConfirmationVerifyFeature = exports.RatePillProvider = exports.FeatureProvider = exports.CurrencyProvider = exports.SmallSpinner = exports.StepNoRoomBestRateAlert = exports.StepConfirmationCountrySelector = exports.NoRoomsFoundBlock = exports.BE_NO_ROOMS_FOUND_BLOCK = exports.BEButton = exports.Alert = exports.Headline = exports.AutoAutoHeight = exports.LineBreak = exports.Checkbox = exports.RadioFields = exports.InputGroup = exports.TextArea = exports.TextBox = exports.Icon = exports.Link = exports.useTranslation = exports.react = void 0;
|
|
20
|
+
exports.Version = exports.events = exports.RoomstayEventManager = exports.StepThanks = exports.StepRoom = exports.StepHotel = exports.StepConfirmation = exports.StepDate = exports.StepAddon = exports.StepManager = exports.API = exports.DataLayer = exports.withDI = exports.registerReplacement = exports.RoomstayThemeEngine = exports.SessionProvider = exports.useFormContext = exports.FullPageEngineSmallSpacingFeature = exports.E164PhoneNumberFieldFeature = exports.ShowIATANumberOnCheckoutFeature = exports.RoomUpsellFeature = exports.InlineAddonStepFeature = exports.FeaturedPromoFeature = exports.DatePickerTypeFeature = exports.ConfirmationVerifyFeature = exports.RatePillProvider = exports.FeatureProvider = exports.CurrencyProvider = exports.SmallSpinner = exports.StepNoRoomBestRateAlert = exports.StepConfirmationCountrySelector = exports.NoRoomsFoundBlock = exports.BE_NO_ROOMS_FOUND_BLOCK = exports.BEButton = exports.Alert = exports.Headline = exports.AutoAutoHeight = exports.LineBreak = exports.Checkbox = exports.RadioFields = exports.InputGroup = exports.TextArea = exports.TextBox = exports.Icon = exports.Link = exports.useTranslation = exports.react = void 0;
|
|
21
21
|
const StepConfirmation_1 = __importDefault(require("./pages/steps/StepConfirmation/StepConfirmation"));
|
|
22
22
|
const StepDate_1 = __importDefault(require("./pages/steps/StepDate/StepDate"));
|
|
23
23
|
const StepRoom_1 = __importDefault(require("./pages/steps/StepRoom/StepRoom"));
|
|
@@ -107,6 +107,8 @@ var FullPageEngineSmallSpacingFeature_1 = require("./providers/feature/FullPageE
|
|
|
107
107
|
Object.defineProperty(exports, "FullPageEngineSmallSpacingFeature", { enumerable: true, get: function () { return __importDefault(FullPageEngineSmallSpacingFeature_1).default; } });
|
|
108
108
|
// Contexts
|
|
109
109
|
__exportStar(require("./contexts/index.js"), exports);
|
|
110
|
+
var react_hook_form_1 = require("react-hook-form");
|
|
111
|
+
Object.defineProperty(exports, "useFormContext", { enumerable: true, get: function () { return react_hook_form_1.useFormContext; } });
|
|
110
112
|
var SessionProvider_1 = require("./providers/SessionProvider");
|
|
111
113
|
Object.defineProperty(exports, "SessionProvider", { enumerable: true, get: function () { return __importDefault(SessionProvider_1).default; } });
|
|
112
114
|
__exportStar(require("./providers/RoomstayThemeEngine"), exports);
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uGAA+E;AAC/E,+EAAuD;AACvD,+EAAuD;AACvD,qFAA6D;AAC7D,qEAA6C;AAE7C,kCAAkC;AAClC,kDAA6B;AAC7B,yFAAiE;AAEpD,QAAA,KAAK,GAAG,eAAQ,CAAC;AAE9B,+CAA+C;AAAtC,+GAAA,cAAc,OAAA;AACvB,qDAAwC;AAA/B,wGAAA,IAAI,OAAA;AAEb,aAAa;AACb,wFAAsE;AACtE,sFAAoE;AACpE,sFAAoE;AACpE,oFAAkE;AAClE,sEAAoD;AAEpD,uDAAiE;AAAxD,6GAAA,OAAO,OAAQ;AACxB,iE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;AAAhE,uHAAA,OAAO,OAAa;AAC7B,4DAAsE;AAA7D,qHAAA,OAAO,OAAY;AAC5B,kEAA4E;AAAnE,yHAAA,OAAO,OAAc;AAE9B,6DAA2C;AAE3C,OAAO;AAEP,+CAA6B;AAE7B,QAAQ;AAER,2DAAyC;AACzC,oDAAkC;AAElC,iDAA+B;AAE/B,gDAAgD;AAChD,sEAAgF;AAAvE,6IAAA,OAAO,OAAwB;AAE3B,QAAA,MAAM,GAAG;IAClB,EAAE,EAAE,8BAAoB,CAAC,QAAQ;IACjC,KAAK,EAAE,8BAAoB,CAAC,KAAK;CACpC,CAAC;AAGW,QAAA,OAAO,GAAG,UAAU,CAAC;AAElC,qBAAW,CAAC,YAAY,GAAG;IACvB,CAAC,EAAE,kBAAQ;IACX,EAAE,EAAE,kBAAQ;IACZ,EAAE,EAAE,0BAAgB;IACpB,EAAE,EAAE,oBAAU;CACjB,CAAC","sourcesContent":["import StepConfirmation from '@/pages/steps/StepConfirmation/StepConfirmation';\nimport StepDate from '@/pages/steps/StepDate/StepDate';\nimport StepRoom from '@/pages/steps/StepRoom/StepRoom';\nimport StepThanks from '@/pages/steps/StepThanks/StepThanks';\nimport StepManager from '@/util/StepManager';\n\n// TODO: Look into resolving this.\nimport ReactRaw from 'react';\nimport RoomstayEventManager from './events/RoomstayEventManager';\n\nexport const react = ReactRaw;\n\nexport { useTranslation } from 'react-i18next';\nexport { Link } from 'react-router-dom';\n\n// Components\nexport * from '@/engines/FullPageBookingEngine/FullPageBookingEngine';\nexport * from '@/engines/InlineRoomMiniEngine/InlineRoomMiniEngine';\nexport * from '@/engines/RecentSearchesEngine/RecentSearchesEngine';\nexport * from '@/engines/BookingWizardEngine/BookingWizardEngine';\nexport * from '@/engines/CustomEngine/CustomEngine';\n\nexport { default as Icon } from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Icon/Icon';\nexport * from '@/components/generic/Text';\nexport * from '@/components/generic/Select/index';\n\nexport { default as TextBox } from '@/components/generic/TextBox';\nexport { default as TextArea } from '@/components/generic/TextArea';\nexport { default as InputGroup } from '@/components/generic/InputGroup/InputGroup';\nexport { default as RadioFields } from '@/components/generic/radio/RadioFields';\nexport { default as Checkbox } from '@/components/generic/Checkbox/Checkbox';\n\nexport { default as LineBreak } from '@/components/generic/LineBreak';\nexport { default as AutoAutoHeight } from '@/animations/AutoAutoHeight';\nexport { default as Headline } from '@/components/generic/Headline';\n\nexport * from '@/components/generic/Alert';\nexport { default as Alert } from '@/components/generic/Alert';\nexport { default as BEButton } from '@/components/generic/BEButton';\n\nexport { BE_NO_ROOMS_FOUND_BLOCK } from '@/components/steps/room/NoRoomsFoundBlock';\nexport { default as NoRoomsFoundBlock } from '@/components/steps/room/NoRoomsFoundBlock';\n\nexport { default as StepConfirmationCountrySelector } from '@/components/steps/confirmation/StepConfirmationCountrySelector';\n\nexport * from '@/components/steps/confirmation/StepConfirmationCommentsComponent';\nexport * from '@/components/summary/BESummaryPerkBlock';\n\nexport * from '@/components/summary/BESummary';\n\nexport * from '@/components/steps/room/StepRoomBestRateAlert';\nexport { default as StepNoRoomBestRateAlert } from '@/components/steps/room/StepRoomBestRateAlert';\n\n// Loaders\nexport { default as SmallSpinner } from '@/components/generic/loader/SmallSpinner';\n\n// Providers\nexport * from '@/providers/LanguageProvider';\nexport * from '@/providers/CurrencyProvider';\nexport { default as CurrencyProvider } from '@/providers/CurrencyProvider';\nexport { default as FeatureProvider } from '@/providers/FeatureProvider';\nexport { default as RatePillProvider } from '@/providers/RatePillProvider';\nexport * from '@/providers/PromotionProvider';\n\n// Features\n\nexport { default as ConfirmationVerifyFeature } from '@/providers/feature/ConfirmationVerifyFeature';\nexport { default as DatePickerTypeFeature } from '@/providers/feature/DatePickerTypeFeature';\nexport { default as FeaturedPromoFeature } from '@/providers/feature/FeaturedPromoFeature';\nexport { default as InlineAddonStepFeature } from '@/providers/feature/InlineAddonStepFeature';\nexport { default as RoomUpsellFeature } from '@/providers/feature/RoomUpsellFeature';\nexport { default as ShowIATANumberOnCheckoutFeature } from '@/providers/feature/ShowIATANumberOnCheckoutFeature';\nexport { default as E164PhoneNumberFieldFeature } from '@/providers/feature/E164PhoneNumberFieldFeature';\nexport { default as FullPageEngineSmallSpacingFeature } from '@/providers/feature/FullPageEngineSmallSpacingFeature';\n\n// Contexts\nexport * from '@frontend/contexts';\nexport { useFormContext } from 'react-hook-form';\n\nexport { default as SessionProvider } from '@/providers/SessionProvider';\nexport * from '@/providers/RoomstayThemeEngine';\nexport { default as RoomstayThemeEngine } from '@/providers/RoomstayThemeEngine';\nexport { registerReplacement, withDI } from '@/providers/DIProvider';\n\nexport { default as DataLayer } from '@/util/DataLayer';\nexport * from '@/util/DataLayer';\n\n// Models\nexport * from '@/models/Client/Hotel/Hotel';\nexport * from '@/models/Client/Hotel/HotelPerk';\n\nexport * from '@/models/Client/Hotel/DistanceUnitType.types';\nexport * from '@/models/Client/Hotel/WeekdayStartsOn.types';\n\nexport * from '@/models/Client/Hotel/Company';\n\nexport { default as API } from '@/api/BookingAPI';\n\n// Steps\nexport { default as StepManager } from '@/util/StepManager';\n\nexport { default as StepAddon } from '@/pages/steps/StepAddon/StepAddon';\nexport { default as StepDate } from '@/pages/steps/StepDate/StepDate';\nexport { default as StepConfirmation } from '@/pages/steps/StepConfirmation/StepConfirmation';\nexport { default as StepHotel } from '@/pages/steps/StepHotel/StepHotel';\nexport { default as StepRoom } from '@/pages/steps/StepRoom/StepRoom';\nexport { default as StepThanks } from '@/pages/steps/StepThanks/StepThanks';\n\nexport * from '@/translations/Translation';\n\n// Util\n\nexport * from '@/util/Color';\n\n// Hooks\n\nexport * from '@/hooks/CurrentHotelHook';\nexport * from '@/hooks/EventHook';\n\nexport * from '@/events/index';\n\n/** @deprecated use `roomstay.events` instead */\nexport { default as RoomstayEventManager } from '@/events/RoomstayEventManager';\n\nexport const events = {\n on: RoomstayEventManager.addEvent,\n raise: RoomstayEventManager.raise,\n};\n\ndeclare const RS_VERSION: string;\nexport const Version = RS_VERSION;\n\nStepManager.currentSteps = {\n 0: StepDate,\n 10: StepRoom,\n 20: StepConfirmation,\n 30: StepThanks,\n};\n"]}
|