@roomstay/frontend 2.9.1 → 2.10.1-0

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 (140) hide show
  1. package/dist/177.bundle.js +1 -1
  2. package/dist/219.bundle.js +2 -0
  3. package/dist/288.bundle.js +1 -1
  4. package/dist/291.bundle.js +1 -0
  5. package/dist/446.bundle.js +1 -1
  6. package/dist/449.bundle.js +1 -1
  7. package/dist/537.bundle.js +1 -1
  8. package/dist/596.bundle.js +1 -1
  9. package/dist/625.bundle.js +1 -1
  10. package/dist/836.bundle.js +1 -1
  11. package/dist/main.bundle.js +1 -1
  12. package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js +6 -0
  13. package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/BookingWizardBottomSheet.js.map +1 -1
  14. package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/ShadowDomBottomSheet.d.ts +22 -0
  15. package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/ShadowDomBottomSheet.js +131 -0
  16. package/dist/src/components/generic/BookingWizard/BookingWizardBottomSheet/ShadowDomBottomSheet.js.map +1 -0
  17. package/dist/src/components/generic/HotelPerkVisual.d.ts +7 -0
  18. package/dist/src/components/generic/HotelPerkVisual.js +29 -0
  19. package/dist/src/components/generic/HotelPerkVisual.js.map +1 -0
  20. package/dist/src/components/generic/Portal/Portal.js +5 -1
  21. package/dist/src/components/generic/Portal/Portal.js.map +1 -1
  22. package/dist/src/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField.d.ts +2 -2
  23. package/dist/src/components/generic/custom/EnhancedPhoneNumberField/EnhancedPhoneNumberField.js.map +1 -1
  24. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.d.ts +4 -0
  25. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.js +105 -30
  26. package/dist/src/components/members/SignInModal/EmailAndFullnameMemberModal.js.map +1 -1
  27. package/dist/src/components/members/SignInModal/ExternalMemberModal.d.ts +9 -3
  28. package/dist/src/components/members/SignInModal/ExternalMemberModal.js +45 -6
  29. package/dist/src/components/members/SignInModal/ExternalMemberModal.js.map +1 -1
  30. package/dist/src/components/steps/date/BEPeoplePickerBlock.js +3 -1
  31. package/dist/src/components/steps/date/BEPeoplePickerBlock.js.map +1 -1
  32. package/dist/src/components/steps/hotel/HotelCard.js +3 -3
  33. package/dist/src/components/steps/hotel/HotelCard.js.map +1 -1
  34. package/dist/src/components/steps/hotel/HotelCardModal.js +3 -3
  35. package/dist/src/components/steps/hotel/HotelCardModal.js.map +1 -1
  36. package/dist/src/components/steps/hotel/HotelInfoPerksRow.js +3 -3
  37. package/dist/src/components/steps/hotel/HotelInfoPerksRow.js.map +1 -1
  38. package/dist/src/components/steps/room/LargeRoomCard.js +3 -3
  39. package/dist/src/components/steps/room/LargeRoomCard.js.map +1 -1
  40. package/dist/src/components/steps/room/RoomModalPerkRow.js +3 -3
  41. package/dist/src/components/steps/room/RoomModalPerkRow.js.map +1 -1
  42. package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js +2 -0
  43. package/dist/src/components/steps/room/roomBuilderProgress/RoomBuilderProgressRow.js.map +1 -1
  44. package/dist/src/components/steps/room/roomDetails/RoomDetails.d.ts +1 -0
  45. package/dist/src/components/steps/room/roomDetails/RoomDetails.js +18 -4
  46. package/dist/src/components/steps/room/roomDetails/RoomDetails.js.map +1 -1
  47. package/dist/src/components/steps/room/roomDetails/RoomDetailsPerkBlock.js +3 -3
  48. package/dist/src/components/steps/room/roomDetails/RoomDetailsPerkBlock.js.map +1 -1
  49. package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.d.ts +1 -0
  50. package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.js +1 -1
  51. package/dist/src/components/steps/room/roomDetails/roomRates/BookNowButton.js.map +1 -1
  52. package/dist/src/components/summary/BESummaryPerkBlock.js +3 -3
  53. package/dist/src/components/summary/BESummaryPerkBlock.js.map +1 -1
  54. package/dist/src/components/summary/BESummaryRoomRow.js.map +1 -1
  55. package/dist/src/contexts/BasketContext/BasketContextWrapper.js +1 -1
  56. package/dist/src/contexts/BasketContext/BasketContextWrapper.js.map +1 -1
  57. package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js +1 -0
  58. package/dist/src/contexts/CompanyContext/CompanyContextWrapper.js.map +1 -1
  59. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js +1 -0
  60. package/dist/src/contexts/ConfirmationStepContext/ConfirmationStepContextWrapper.js.map +1 -1
  61. package/dist/src/contexts/HotelOverridesContext.js +4 -0
  62. package/dist/src/contexts/HotelOverridesContext.js.map +1 -1
  63. package/dist/src/contexts/ShadowDomContext/ShadowDomContext.d.ts +10 -0
  64. package/dist/src/contexts/ShadowDomContext/ShadowDomContext.js +12 -0
  65. package/dist/src/contexts/ShadowDomContext/ShadowDomContext.js.map +1 -0
  66. package/dist/src/contexts/ShadowDomContext/ShadowDomContextProvider.d.ts +8 -0
  67. package/dist/src/contexts/ShadowDomContext/ShadowDomContextProvider.js +13 -0
  68. package/dist/src/contexts/ShadowDomContext/ShadowDomContextProvider.js.map +1 -0
  69. package/dist/src/contexts/index.d.ts +2 -0
  70. package/dist/src/contexts/index.js +2 -0
  71. package/dist/src/contexts/index.js.map +1 -1
  72. package/dist/src/engines/BaseEngine.d.ts +13 -0
  73. package/dist/src/engines/BaseEngine.js +32 -0
  74. package/dist/src/engines/BaseEngine.js.map +1 -1
  75. package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js +1 -0
  76. package/dist/src/engines/BookingWizardEngine/BookingWizardEngine.js.map +1 -1
  77. package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js +3 -1
  78. package/dist/src/engines/BookingWizardEngine/BookingWizardEngineElement.js.map +1 -1
  79. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.js +1 -0
  80. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngine.js.map +1 -1
  81. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js +12 -10
  82. package/dist/src/engines/InlineRoomMiniEngine/InlineRoomMiniEngineElement.js.map +1 -1
  83. package/dist/src/engines/MemberPortalWidget/MemberPortalWidget.js +1 -0
  84. package/dist/src/engines/MemberPortalWidget/MemberPortalWidget.js.map +1 -1
  85. package/dist/src/engines/MemberPortalWidget/MemberPortalWidgetElement.js +11 -9
  86. package/dist/src/engines/MemberPortalWidget/MemberPortalWidgetElement.js.map +1 -1
  87. package/dist/src/engines/RecentSearchesEngine/RecentSearchesEngine.js +1 -0
  88. package/dist/src/engines/RecentSearchesEngine/RecentSearchesEngine.js.map +1 -1
  89. package/dist/src/engines/RecentSearchesEngine/RecentSearchesEngineElement.js +4 -2
  90. package/dist/src/engines/RecentSearchesEngine/RecentSearchesEngineElement.js.map +1 -1
  91. package/dist/src/handlers/membership/SalesforceMemberHandler.js +1 -1
  92. package/dist/src/handlers/membership/SalesforceMemberHandler.js.map +1 -1
  93. package/dist/src/hooks/BodyClickHook.d.ts +2 -2
  94. package/dist/src/hooks/BodyClickHook.js +7 -3
  95. package/dist/src/hooks/BodyClickHook.js.map +1 -1
  96. package/dist/src/index.d.ts +1 -0
  97. package/dist/src/index.js +4 -2
  98. package/dist/src/index.js.map +1 -1
  99. package/dist/src/models/Api/HotelDTO.d.ts +2 -0
  100. package/dist/src/models/Api/HotelDTO.js.map +1 -1
  101. package/dist/src/models/Api/HotelOverrideDTO.d.ts +1 -0
  102. package/dist/src/models/Api/HotelOverrideDTO.js.map +1 -1
  103. package/dist/src/models/Client/Hotel/Hotel.d.ts +2 -0
  104. package/dist/src/models/Client/Hotel/Hotel.js.map +1 -1
  105. package/dist/src/pages/findReservation/FindReservationResults.js +1 -1
  106. package/dist/src/pages/findReservation/FindReservationResults.js.map +1 -1
  107. package/dist/src/pages/findReservation/ReservationRow.js +10 -9
  108. package/dist/src/pages/findReservation/ReservationRow.js.map +1 -1
  109. package/dist/src/pages/hotel/HotelInfo.js +7 -6
  110. package/dist/src/pages/hotel/HotelInfo.js.map +1 -1
  111. package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js +7 -1
  112. package/dist/src/pages/steps/StepConfirmation/StepConfirmationComponent.js.map +1 -1
  113. package/dist/src/providers/RoomstayThemeEngine.js +7 -2
  114. package/dist/src/providers/RoomstayThemeEngine.js.map +1 -1
  115. package/dist/src/providers/ShadowDomManager.d.ts +21 -0
  116. package/dist/src/providers/ShadowDomManager.js +55 -0
  117. package/dist/src/providers/ShadowDomManager.js.map +1 -0
  118. package/dist/src/providers/StyleInjector.d.ts +42 -0
  119. package/dist/src/providers/StyleInjector.js +118 -0
  120. package/dist/src/providers/StyleInjector.js.map +1 -0
  121. package/dist/src/providers/storage/SessionProvider.js.map +1 -1
  122. package/dist/src/stories/EnhancedPhoneNumberField.stories.d.ts +1 -1
  123. package/dist/src/translations/Translation.d.ts +3 -0
  124. package/dist/src/translations/Translation.js +3 -0
  125. package/dist/src/translations/Translation.js.map +1 -1
  126. package/dist/src/translations/languages/en-gb.js +3 -0
  127. package/dist/src/translations/languages/en-gb.js.map +1 -1
  128. package/dist/src/util/Analytics/Analytics.js +1 -0
  129. package/dist/src/util/Analytics/Analytics.js.map +1 -1
  130. package/dist/test.bundle.js +1 -1
  131. package/dist/tests/offline/entry/config/hotelSpecDefault.js +13 -43
  132. package/dist/tests/offline/entry/config/hotelSpecDefault.js.map +1 -1
  133. package/dist/vendors.bundle.js +1 -1
  134. package/package.json +2 -2
  135. package/dist/326.bundle.js +0 -2
  136. package/dist/686.bundle.js +0 -1
  137. package/dist/src/util/HotelPerkHelper.d.ts +0 -3
  138. package/dist/src/util/HotelPerkHelper.js +0 -56
  139. package/dist/src/util/HotelPerkHelper.js.map +0 -1
  140. /package/dist/{326.bundle.js.LICENSE.txt → 219.bundle.js.LICENSE.txt} +0 -0
@@ -47,6 +47,7 @@ const react_i18next_1 = require("react-i18next");
47
47
  const Translation_1 = require("translations/Translation");
48
48
  const BEButton_1 = __importDefault(require("../../components/generic/BEButton"));
49
49
  const Headline_1 = __importDefault(require("../../components/generic/Headline"));
50
+ const HtmlContentViewer_1 = require("../../components/generic/HtmlContentViewer");
50
51
  const Icon_1 = __importStar(require("../../components/generic/Icon/Icon"));
51
52
  const BEHotelLocationMapBlock_1 = __importDefault(require("../../components/generic/map/BEHotelLocationMapBlock"));
52
53
  const PageTitle_1 = require("../../components/generic/PageTitle");
@@ -59,7 +60,7 @@ const Color_1 = require("../../util/Color");
59
60
  const ScreenSize_1 = __importDefault(require("../../util/ScreenSize"));
60
61
  const StepManager_1 = __importDefault(require("../../util/StepManager"));
61
62
  function HotelInfo() {
62
- var _a, _b, _c, _d, _e, _f, _g;
63
+ var _a, _b, _c, _d, _e;
63
64
  const { hotel } = (0, hooks_1.useCurrentHotel)();
64
65
  const historyConsistentPush = (0, HistoryConsistentPush_1.useHistoryConsistentPush)();
65
66
  const { t } = (0, react_i18next_1.useTranslation)();
@@ -154,15 +155,15 @@ function HotelInfo() {
154
155
  react_1.default.createElement("div", { className: "u-marg-bottom u-marg-bottom--heavy" },
155
156
  react_1.default.createElement(Headline_1.default, { className: "rs-hotelinfo-about", bold: true }, t(Translation_1.Translation.Step.Hotel.About))),
156
157
  react_1.default.createElement("div", { className: "u-marg-bottom u-marg-bottom--heavy" },
157
- react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
158
- react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: ((_e = hotel === null || hotel === void 0 ? void 0 : hotel.description) === null || _e === void 0 ? void 0 : _e.replace('\r\n', '<br/><br/>')) || '' } })),
158
+ react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, asDiv: true },
159
+ react_1.default.createElement(HtmlContentViewer_1.HtmlContentViewer, { content: (hotel === null || hotel === void 0 ? void 0 : hotel.description) || '' })),
159
160
  !!(hotel === null || hotel === void 0 ? void 0 : hotel.locationDescription) && (react_1.default.createElement(react_1.default.Fragment, null,
160
161
  react_1.default.createElement("div", { className: "u-marg-top" },
161
162
  react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
162
163
  react_1.default.createElement("strong", null, t(Translation_1.Translation.Step.Hotel.Location)))),
163
- react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
164
- react_1.default.createElement("span", { dangerouslySetInnerHTML: { __html: (_f = hotel === null || hotel === void 0 ? void 0 : hotel.locationDescription) === null || _f === void 0 ? void 0 : _f.replace('\r\n', '<br/><br/>') } }))))),
165
- !!((_g = hotel === null || hotel === void 0 ? void 0 : hotel.perks) === null || _g === void 0 ? void 0 : _g.length) && (react_1.default.createElement(react_1.default.Fragment, null,
164
+ react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small, asDiv: true },
165
+ react_1.default.createElement(HtmlContentViewer_1.HtmlContentViewer, { content: hotel.locationDescription }))))),
166
+ !!((_e = hotel === null || hotel === void 0 ? void 0 : hotel.perks) === null || _e === void 0 ? void 0 : _e.length) && (react_1.default.createElement(react_1.default.Fragment, null,
166
167
  react_1.default.createElement("div", { className: "u-marg-bottom u-marg-bottom--heavy" },
167
168
  react_1.default.createElement(Text_1.default, { type: Text_1.TextType.Small },
168
169
  react_1.default.createElement("strong", { className: "rs-hotelinfo-andyougetall" }, hotel.perkTitle || t(Translation_1.Translation.Step.Hotel.AndYouGetAll)))),
@@ -1 +1 @@
1
- {"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,4BA4QC;AAnSD,6CAA0D;AAC1D,2CAA4D;AAC5D,4DAAoC;AACpC,wEAA0C;AAC1C,uEAAuE;AACvE,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,uEAAgE;AAChE,+GAAuF;AACvF,8DAA2D;AAC3D,kEAA2D;AAC3D,mGA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IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAE/E,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC;QAC3E,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,CACH,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,IACnE,GAAG,IAAI,CACJ,uCACI,GAAG,EAAE,GAAG,EACR,GAAG,EAAC,OAAO,EACX,KAAK,EAAE;YACH,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM;YAC7D,SAAS,EAAE,SAAS,EAAE,6CAA6C;YACnE,OAAO,EAAE,OAAO,EAAE,mCAAmC;YACrD,MAAM,EAAE,QAAQ,EAAE,+BAA+B;SACpD,GACH,CACL,CACC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport BEHotelLocationMapBlock from '@/components/generic/map/BEHotelLocationMapBlock';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelInfoPerkRow from '@/components/steps/hotel/HotelInfoPerksRow';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport { BookingEngineContext } from '@/index';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n const hotelServices = hotel?.hotelServices?.filter(({ name }) => !!name) || [];\n const quoteImage = isMobile ? hotel?.quoteImageMobile : hotel?.quoteImageDesktop;\n\n return (\n <>\n <PageTitle step=\"HotelInfo\" />\n <div\n style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }}\n className={classNames('c-masthead has-tint', 'rs-background-hotel-info', `rs-background-${hotel?.hotelID}`)}\n >\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">\n {hotel?.countryPrefix ?? ''} {hotel?.address?.country}\n </h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy rs-summary-hotel-location-map\" style={{ height: '240px' }}>\n <BEHotelLocationMapBlock />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center rs-hotelinfo-transport-distance u-w-100\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container rs-hotelinfo\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-about\" bold>\n {t(Translation.Step.Hotel.About)}\n </Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.description?.replace('\\r\\n', '<br/><br/>') || '' }} />\n </Text>\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small}>\n <span dangerouslySetInnerHTML={{ __html: hotel?.locationDescription?.replace('\\r\\n', '<br/><br/>') }} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong className=\"rs-hotelinfo-andyougetall\">{hotel.perkTitle || t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n <HotelInfoPerkRow hotel={hotel} />\n </div>\n {hotel?.perksShowDisclaimer && (\n <div className=\"row u-marg-top--lighter\">\n <small className=\"col-12\">{t(Translation.Misc.PerksDisclaimer)}</small>\n </div>\n )}\n </>\n )}\n </div>\n {!!hotelServices.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-hotelamenities\" bold>\n {t(Translation.Step.Hotel.HotelAmenities)}\n </Headline>\n </div>\n <div className=\"row\">\n {hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-policies\" bold>\n {t(Translation.Step.Hotel.Policies)}\n </Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n\n {quoteImage && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <QuoteImage\n isMobile={isMobile}\n className={classNames('u-marg-bottom--heavy rs-hotelinfo-quote-images', {\n '--mobile': isMobile,\n '--desktop': !isMobile,\n })}\n src={quoteImage}\n ></QuoteImage>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-gallery\" bold>\n {t(Translation.Step.Hotel.Gallery)}\n </Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n\nconst QuoteImage = ({ src, className, isMobile }: { src: string; className?: string; isMobile: boolean }) => {\n const [aspectRatio, setAspectRatio] = useState<number | null>(null);\n const [imageHeight, setImageHeight] = useState<number | null>(null);\n\n useEffect(() => {\n if (!src) return;\n\n const img = new Image();\n img.src = src;\n img.onload = () => setAspectRatio(img.width > 0 ? img.height / img.width : 1); // Fallback aspect ratio\n img.onerror = () => {\n console.error('Failed to load image');\n setAspectRatio(1);\n };\n }, [src]);\n\n useEffect(() => {\n if (!isMobile || aspectRatio === null || typeof window === 'undefined') return;\n\n const updateHeight = () => setImageHeight(window.innerWidth * aspectRatio);\n updateHeight();\n\n window.addEventListener('resize', updateHeight);\n return () => window.removeEventListener('resize', updateHeight);\n }, [aspectRatio, isMobile]);\n\n return (\n <div className={className} style={{ width: '100%', textAlign: 'center' }}>\n {src && (\n <img\n src={src}\n alt=\"Quote\"\n style={{\n width: '100%',\n height: isMobile && imageHeight ? `${imageHeight}px` : 'auto',\n objectFit: 'contain', // Ensures full image is visible, no cropping\n display: 'block', // Prevents inline whitespace issue\n margin: '0 auto', // Centers the image in the div\n }}\n />\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"HotelInfo.js","sourceRoot":"/","sources":["src/pages/hotel/HotelInfo.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,4BA6QC;AArSD,6CAA0D;AAC1D,2CAA4D;AAC5D,4DAAoC;AACpC,wEAA0C;AAC1C,uEAAuE;AACvE,+CAA+D;AAC/D,iDAA+C;AAC/C,0DAAuD;AAEvD,6EAAqD;AACrD,6EAAqD;AACrD,8EAA2E;AAC3E,uEAAgE;AA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GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,CAAC;QAC3E,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,CACH,uCAAK,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,IACnE,GAAG,IAAI,CACJ,uCACI,GAAG,EAAE,GAAG,EACR,GAAG,EAAC,OAAO,EACX,KAAK,EAAE;YACH,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,QAAQ,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,CAAC,CAAC,CAAC,MAAM;YAC7D,SAAS,EAAE,SAAS,EAAE,6CAA6C;YACnE,OAAO,EAAE,OAAO,EAAE,mCAAmC;YACrD,MAAM,EAAE,QAAQ,EAAE,+BAA+B;SACpD,GACH,CACL,CACC,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { StepHotelInfoViewEvent } from '@frontend/events';\nimport { useCurrentHotel, useEvent } from '@frontend/hooks';\nimport classNames from 'classnames';\nimport FsLightbox from 'fslightbox-react';\nimport { useHistoryConsistentPush } from 'hooks/HistoryConsistentPush';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Translation } from 'translations/Translation';\n\nimport BEButton from '@/components/generic/BEButton';\nimport Headline from '@/components/generic/Headline';\nimport { HtmlContentViewer } from '@/components/generic/HtmlContentViewer';\nimport Icon, { IconType } from '@/components/generic/Icon/Icon';\nimport BEHotelLocationMapBlock from '@/components/generic/map/BEHotelLocationMapBlock';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport Text, { TextType } from '@/components/generic/Text';\nimport HotelInfoPerkRow from '@/components/steps/hotel/HotelInfoPerksRow';\nimport TransportDistanceFromHotelBlock from '@/components/summary/TransportDistanceFromHotelBlock';\nimport { BookingEngineContext } from '@/index';\nimport ImageProvider, { ImageSize } from '@/providers/ImageProvider';\nimport { Color } from '@/util/Color';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nexport default function HotelInfo() {\n const { hotel } = useCurrentHotel();\n const historyConsistentPush = useHistoryConsistentPush();\n const { t } = useTranslation();\n const context = useContext(BookingEngineContext);\n const isMobile = context.screenSize <= ScreenSize.Large;\n\n const imageUrl = hotel?.heroImage;\n\n const { line1, line2, postalCode, country } = hotel?.address ?? {};\n\n const [lightboxController, setLightboxController] = useState({ toggler: false, slide: 1 });\n const [images, setImages] = useState<string[]>([]);\n\n const openSlider = (slide: number) => {\n setLightboxController((controller) => ({ toggler: !controller.toggler, slide: slide + 1 }));\n };\n const openSliderOnClick = () => {\n openSlider(4);\n };\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepHotelInfoViewEvent();\n raise(event);\n }, []);\n\n useEffect(() => {\n const newImages: string[] = [];\n\n if (hotel?.images?.length) {\n newImages.push(...hotel.images);\n }\n\n if (hotel?.rooms) {\n for (const room of Object.values(hotel?.rooms)) {\n room.images?.forEach((image) => {\n newImages.push(image);\n });\n }\n }\n\n setImages(newImages);\n }, [hotel?.images, hotel?.rooms]);\n\n const onBookNowClick = () => {\n historyConsistentPush(StepManager.getFirstStep().getStepUrl());\n };\n\n const getImage = (index: number) => {\n const openSliderOnClickHandler = () => {\n openSlider(index);\n };\n\n const resizedUrl = ImageProvider.resizeImage(images[index], ImageSize.Small);\n\n return (\n <div\n style={{ backgroundImage: `url('${resizedUrl}')`, paddingTop: '75%' }}\n className=\"c-images u-block u-w-100 u-marg-bottom u-marg-bottom--heavy\"\n onClick={openSliderOnClickHandler}\n />\n );\n };\n\n const hotelServices = hotel?.hotelServices?.filter(({ name }) => !!name) || [];\n const quoteImage = isMobile ? hotel?.quoteImageMobile : hotel?.quoteImageDesktop;\n\n return (\n <>\n <PageTitle step=\"HotelInfo\" />\n <div\n style={{ backgroundImage: `url('${imageUrl && ImageProvider.resizeImage(imageUrl, ImageSize.Original)}')` }}\n className={classNames('c-masthead has-tint', 'rs-background-hotel-info', `rs-background-${hotel?.hotelID}`)}\n >\n <div className=\"container\">\n <div className=\"c-masthead__body u-fill-white u-pad--heavy u-shadow-accent\">\n <h1 className=\"c-masthead__header\">{hotel?.name}</h1>\n <h2 className=\"c-masthead__sub-header\">\n {hotel?.countryPrefix ?? ''} {hotel?.address?.country}\n </h2>\n </div>\n </div>\n </div>\n <div className=\"u-fill-snow u-pad--heavy-med u-pad-top-bottom--heavy@m-\">\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-6 u-flex align-items-center\">\n <ul>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Map} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n {line1}\n <br />\n {line2} {postalCode}, {country}\n </span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Phone} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">{hotel?.phone}</span>\n </li>\n <li className=\"u-flex u-marg-bottom--heavy\">\n <Icon icon={IconType.Hotel2} size=\"1.3em\" color={Color.Accent} />\n <span className=\"u-flex__item u-marg-left\">\n <a href={hotel?.hotelUrl} style={{ color: 'var(--rs-color-accent-1)' }}>\n {hotel?.name}\n </a>\n </span>\n </li>\n <li className=\"u-flex\">\n <BEButton icon={IconType.ArrowRight} primary filled iconPosition=\"right\" onClick={onBookNowClick}>\n {t(Translation.Misc.BookNow)}\n </BEButton>\n </li>\n </ul>\n </div>\n <div className=\"col-md-6\">\n <div className=\"c-overlap\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy u-marg-top u-marg-top--heavy rs-summary-hotel-location-map\" style={{ height: '240px' }}>\n <BEHotelLocationMapBlock />\n </div>\n <div className=\"u-flex u-flex-column justify-content-center rs-hotelinfo-transport-distance u-w-100\">\n <TransportDistanceFromHotelBlock hotel={hotel} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"u-pad u-pad--heavy-plus u-pad-top-bottom--heavy@m-\">\n <div className=\"container rs-hotelinfo\">\n <div className=\"row\">\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-about\" bold>\n {t(Translation.Step.Hotel.About)}\n </Headline>\n </div>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small} asDiv>\n <HtmlContentViewer content={hotel?.description || ''} />\n </Text>\n\n {!!hotel?.locationDescription && (\n <>\n <div className=\"u-marg-top\">\n <Text type={TextType.Small}>\n <strong>{t(Translation.Step.Hotel.Location)}</strong>\n </Text>\n </div>\n <Text type={TextType.Small} asDiv>\n <HtmlContentViewer content={hotel.locationDescription} />\n </Text>\n </>\n )}\n </div>\n {!!hotel?.perks?.length && (\n <>\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Text type={TextType.Small}>\n <strong className=\"rs-hotelinfo-andyougetall\">{hotel.perkTitle || t(Translation.Step.Hotel.AndYouGetAll)}</strong>\n </Text>\n </div>\n <div className=\"row\">\n <HotelInfoPerkRow hotel={hotel} />\n </div>\n {hotel?.perksShowDisclaimer && (\n <div className=\"row u-marg-top--lighter\">\n <small className=\"col-12\">{t(Translation.Misc.PerksDisclaimer)}</small>\n </div>\n )}\n </>\n )}\n </div>\n {!!hotelServices.length && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-hotelamenities\" bold>\n {t(Translation.Step.Hotel.HotelAmenities)}\n </Headline>\n </div>\n <div className=\"row\">\n {hotelServices.map((hotelService, index) => {\n return (\n <div key={index} className=\"col-md-6\">\n <div className=\"u-flex u-marg-bottom\">\n <Icon icon={IconType.Check} color={Color.White} backgroundColor={Color.Accent} borderRadius=\"round\" noPadding size=\"16px\" />\n <span className=\"u-flex__item u-marg-left--light\">\n <Text type={TextType.Small}>{hotelService.name}</Text>\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n )}\n {!!hotel?.policies && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-policies\" bold>\n {t(Translation.Step.Hotel.Policies)}\n </Headline>\n </div>\n <Text type={TextType.Small}>\n <a href={hotel?.policies} target=\"_blank\" style={{ color: hotel?.colors.accent }} rel=\"noreferrer\">\n {hotel?.policies}\n </a>\n </Text>\n </div>\n )}\n\n {quoteImage && (\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <QuoteImage\n isMobile={isMobile}\n className={classNames('u-marg-bottom--heavy rs-hotelinfo-quote-images', {\n '--mobile': isMobile,\n '--desktop': !isMobile,\n })}\n src={quoteImage}\n ></QuoteImage>\n </div>\n )}\n </div>\n <div className=\"col-lg-6\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <div className=\"u-marg-bottom u-marg-bottom--heavy\">\n <Headline className=\"rs-hotelinfo-gallery\" bold>\n {t(Translation.Step.Hotel.Gallery)}\n </Headline>\n </div>\n {images.length >= 1 && getImage(0)}\n <div className=\"row\">\n {[1, 2, 3].map((index) => {\n if (images.length > index) {\n return (\n <div key={index} className=\"col-6\">\n {getImage(index)}\n </div>\n );\n }\n })}\n {images.length > 5 && (\n <div className=\"col-6\">\n <div className=\"c-images c-images--more\" onClick={openSliderOnClick}>\n {getImage(4)}\n <span>+ {images.length - 5}</span>\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {!!images?.length && (\n <FsLightbox\n toggler={lightboxController.toggler}\n slide={lightboxController.slide}\n sources={images.map((image) => ImageProvider.resizeImage(image, ImageSize.Original))}\n type=\"image\"\n />\n )}\n </>\n );\n}\n\nconst QuoteImage = ({ src, className, isMobile }: { src: string; className?: string; isMobile: boolean }) => {\n const [aspectRatio, setAspectRatio] = useState<number | null>(null);\n const [imageHeight, setImageHeight] = useState<number | null>(null);\n\n useEffect(() => {\n if (!src) return;\n\n const img = new Image();\n img.src = src;\n img.onload = () => setAspectRatio(img.width > 0 ? img.height / img.width : 1); // Fallback aspect ratio\n img.onerror = () => {\n console.error('Failed to load image');\n setAspectRatio(1);\n };\n }, [src]);\n\n useEffect(() => {\n if (!isMobile || aspectRatio === null || typeof window === 'undefined') return;\n\n const updateHeight = () => setImageHeight(window.innerWidth * aspectRatio);\n updateHeight();\n\n window.addEventListener('resize', updateHeight);\n return () => window.removeEventListener('resize', updateHeight);\n }, [aspectRatio, isMobile]);\n\n return (\n <div className={className} style={{ width: '100%', textAlign: 'center' }}>\n {src && (\n <img\n src={src}\n alt=\"Quote\"\n style={{\n width: '100%',\n height: isMobile && imageHeight ? `${imageHeight}px` : 'auto',\n objectFit: 'contain', // Ensures full image is visible, no cropping\n display: 'block', // Prevents inline whitespace issue\n margin: '0 auto', // Centers the image in the div\n }}\n />\n )}\n </div>\n );\n};\n"]}
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const contexts_1 = require("../../../contexts/index.js");
40
40
  const events_1 = require("../../../events/index.js");
41
+ const hooks_1 = require("../../../hooks/index.js");
41
42
  const dayjs_1 = __importDefault(require("dayjs"));
42
43
  const react_1 = __importStar(require("react"));
43
44
  const react_i18next_1 = require("react-i18next");
@@ -60,10 +61,15 @@ const ScreenSize_1 = __importDefault(require("../../../util/ScreenSize"));
60
61
  const StepManager_1 = __importDefault(require("../../../util/StepManager"));
61
62
  const StepConfirmationFormProvider_1 = __importDefault(require("../../../components/steps/confirmation/StepConfirmationFormProvider"));
62
63
  function StepConfirmationComponent() {
64
+ var _a;
63
65
  const context = (0, react_1.useContext)(contexts_1.BookingEngineContext);
64
66
  const { currentStep } = (0, react_1.useContext)(contexts_1.FullPageEngineContext);
65
67
  const { currentBasketRows, basketAddonRows } = (0, react_1.useContext)(contexts_1.BasketContext);
68
+ const { hotel } = (0, hooks_1.useCurrentHotel)();
66
69
  const location = (0, react_router_dom_1.useLocation)();
70
+ // Duration (in minutes) of the basket countdown timer. Defaults to 10 when
71
+ // not configured; a value of 0 hides the countdown entirely.
72
+ const basketTimeout = (_a = hotel === null || hotel === void 0 ? void 0 : hotel.basketTimeout) !== null && _a !== void 0 ? _a : 10;
67
73
  const { t } = (0, react_i18next_1.useTranslation)();
68
74
  const { raise } = (0, EventHook_1.useEvent)();
69
75
  (0, react_1.useEffect)(() => {
@@ -95,7 +101,7 @@ function StepConfirmationComponent() {
95
101
  !InlineAddonStepFeature_1.default.isActive() && react_1.default.createElement(AdditionalOffers_1.default, null),
96
102
  react_1.default.createElement(StepConfirmationFormProvider_1.default, null))),
97
103
  context.screenSize > ScreenSize_1.default.Medium && (react_1.default.createElement(StepLayout_1.StepLayoutRightContent, null,
98
- react_1.default.createElement(StepConfirmationLimitedOffer_1.default, { endDate: (0, dayjs_1.default)().add(10, 'minute') }),
104
+ basketTimeout > 0 && react_1.default.createElement(StepConfirmationLimitedOffer_1.default, { endDate: (0, dayjs_1.default)().add(basketTimeout, 'minute') }),
99
105
  react_1.default.createElement(BESummary_1.BESummary, { showImages: true })))))));
100
106
  }
101
107
  exports.default = StepConfirmationComponent;
@@ -1 +1 @@
1
- {"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgI;AAChI,6CAAyD;AACzD,kDAA0B;AAC1B,+CAAqD;AACrD,iDAA+C;AAC/C,u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D,MAAM,EAAE,QAAQ,CAAC,MAAM;6BAC1B;4BAED,8BAAC,oBAAU,OAAG,CACX;wBACP,uCAAK,SAAS,EAAC,wCAAwC;4BACnD,8BAAC,kBAAQ,IAAC,IAAI,UAAE,CAAC,CAAC,yBAAW,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,CAAY,CACtE,CACP,CACN;oBAED,uCAAK,SAAS,EAAC,eAAe;wBAC1B,8BAAC,+BAAqB,OAAG,CACvB,CACc;gBACvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;oBACnB,8BAAC,8BAAoB,OAAG,CACH,CAC5B,CACiB;YACtB,8BAAC,mBAAS,OAAG;YACb,8BAAC,gCAAmB;gBAChB,8BAAC,kCAAqB;oBAClB,uCAAK,SAAS,EAAC,iBAAiB;wBAC3B,CAAC,gCAAsB,CAAC,QAAQ,EAAE,IAAI,8BAAC,0BAAgB,OAAG;wBAC3D,8BAAC,sCAA4B,OAAG,CAC9B,CACc;gBAEvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;oBACnB,8BAAC,sCAA4B,IAAC,OAAO,EAAE,IAAA,eAAK,GAAE,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,GAAI;oBACpE,8BAAC,qBAAS,IAAC,UAAU,SAAG,CACH,CAC5B,CACiB,CACO,CAC/B,CACT,CAAC;AACN,CAAC;AAED,kBAAe,yBAAyB,CAAC","sourcesContent":["import { BasketContext, BookingEngineContext, ConfirmationFormContextWrapper, FullPageEngineContext } from '@frontend/contexts';\nimport { StepCheckoutViewEvent } from '@frontend/events';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link, useLocation } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BackButton from '@/components/generic/BackButton';\nimport Headline from '@/components/generic/Headline';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\nimport LineBreak from '@/components/generic/LineBreak';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport AdditionalOffers from '@/components/steps/confirmation/additionalOffers/AdditionalOffers';\nimport StepConfirmationLimitedOffer from '@/components/steps/confirmation/StepConfirmationLimitedOffer';\nimport StepRoomBestRateAlert from '@/components/steps/room/StepRoomBestRateAlert';\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\nimport { BESummary } from '@/components/summary/BESummary';\nimport { useEvent } from '@/hooks/EventHook';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nimport StepConfirmationFormProvider from '../../../components/steps/confirmation/StepConfirmationFormProvider';\n\nfunction StepConfirmationComponent() {\n const context = useContext(BookingEngineContext);\n const { currentStep } = useContext(FullPageEngineContext);\n const { currentBasketRows, basketAddonRows } = useContext(BasketContext);\n const location = useLocation();\n\n const { t } = useTranslation();\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepCheckoutViewEvent(currentBasketRows, basketAddonRows);\n raise(event);\n }, []);\n\n return (\n <div className=\"container rs-step-confirmation\">\n <PageTitle step=\"Confirmation\" />\n <ConfirmationFormContextWrapper>\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link\n to={{\n pathname: StepManager.getPreviousStepUrl(currentStep),\n search: location.search,\n }}\n >\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Navigation.Steps.Confirmation)}</Headline>\n </div>\n </>\n )}\n\n <div className=\"u-marg-top@m-\">\n <StepRoomBestRateAlert />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n <LineBreak />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <div className=\"block-container\">\n {!InlineAddonStepFeature.isActive() && <AdditionalOffers />}\n <StepConfirmationFormProvider />\n </div>\n </StepLayoutLeftContent>\n\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepConfirmationLimitedOffer endDate={dayjs().add(10, 'minute')} />\n <BESummary showImages />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </ConfirmationFormContextWrapper>\n </div>\n );\n}\n\nexport default StepConfirmationComponent;\n"]}
1
+ {"version":3,"file":"StepConfirmationComponent.js","sourceRoot":"/","sources":["src/pages/steps/StepConfirmation/StepConfirmationComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAgI;AAChI,6CAAyD;AACzD,2CAAkD;AAClD,kDAA0B;AAC1B,+CAAqD;AACrD,iDAA+C;AAC/C,uDAAqD;AACrD,0DAAuD;AAEvD,iFAAyD;AACzD,6EAAqD;AACrD,uEAA4H;AAC5H,+EAAuD;AACvD,8DAA2D;AAC3D,yHAAiG;AACjG,gIAAwG;AACxG,0GAAkF;AAClF,wGAAgF;AAChF,2FAAmE;AACnE,8DAA2D;AAC3D,iDAA6C;AAC7C,wGAAgF;AAChF,mEAA2C;AAC3C,qEAA6C;AAE7C,uIAA+G;AAE/G,SAAS,yBAAyB;;IAC9B,MAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,+BAAoB,CAAC,CAAC;IACjD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,kBAAU,EAAC,gCAAqB,CAAC,CAAC;IAC1D,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAa,CAAC,CAAC;IACzE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAA,uBAAe,GAAE,CAAC;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8BAAC,8BAAoB,OAAG,CACH,CAC5B,CACiB;YACtB,8BAAC,mBAAS,OAAG;YACb,8BAAC,gCAAmB;gBAChB,8BAAC,kCAAqB;oBAClB,uCAAK,SAAS,EAAC,iBAAiB;wBAC3B,CAAC,gCAAsB,CAAC,QAAQ,EAAE,IAAI,8BAAC,0BAAgB,OAAG;wBAC3D,8BAAC,sCAA4B,OAAG,CAC9B,CACc;gBAEvB,OAAO,CAAC,UAAU,GAAG,oBAAU,CAAC,MAAM,IAAI,CACvC,8BAAC,mCAAsB;oBAClB,aAAa,GAAG,CAAC,IAAI,8BAAC,sCAA4B,IAAC,OAAO,EAAE,IAAA,eAAK,GAAE,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAI;oBACrG,8BAAC,qBAAS,IAAC,UAAU,SAAG,CACH,CAC5B,CACiB,CACO,CAC/B,CACT,CAAC;AACN,CAAC;AAED,kBAAe,yBAAyB,CAAC","sourcesContent":["import { BasketContext, BookingEngineContext, ConfirmationFormContextWrapper, FullPageEngineContext } from '@frontend/contexts';\nimport { StepCheckoutViewEvent } from '@frontend/events';\nimport { useCurrentHotel } from '@frontend/hooks';\nimport dayjs from 'dayjs';\nimport React, { useContext, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Link, useLocation } from 'react-router-dom';\nimport { Translation } from 'translations/Translation';\n\nimport BackButton from '@/components/generic/BackButton';\nimport Headline from '@/components/generic/Headline';\nimport { StepLayoutContainer, StepLayoutLeftContent, StepLayoutRightContent } from '@/components/generic/Layout/StepLayout';\nimport LineBreak from '@/components/generic/LineBreak';\nimport { PageTitle } from '@/components/generic/PageTitle';\nimport AdditionalOffers from '@/components/steps/confirmation/additionalOffers/AdditionalOffers';\nimport StepConfirmationLimitedOffer from '@/components/steps/confirmation/StepConfirmationLimitedOffer';\nimport StepRoomBestRateAlert from '@/components/steps/room/StepRoomBestRateAlert';\nimport StepRoomHotelDetails from '@/components/steps/room/StepRoomHotelDetails';\nimport BEMobileSummary from '@/components/summary/BEMobileSummary';\nimport { BESummary } from '@/components/summary/BESummary';\nimport { useEvent } from '@/hooks/EventHook';\nimport InlineAddonStepFeature from '@/providers/feature/InlineAddonStepFeature';\nimport ScreenSize from '@/util/ScreenSize';\nimport StepManager from '@/util/StepManager';\n\nimport StepConfirmationFormProvider from '../../../components/steps/confirmation/StepConfirmationFormProvider';\n\nfunction StepConfirmationComponent() {\n const context = useContext(BookingEngineContext);\n const { currentStep } = useContext(FullPageEngineContext);\n const { currentBasketRows, basketAddonRows } = useContext(BasketContext);\n const { hotel } = useCurrentHotel();\n const location = useLocation();\n\n // Duration (in minutes) of the basket countdown timer. Defaults to 10 when\n // not configured; a value of 0 hides the countdown entirely.\n const basketTimeout = hotel?.basketTimeout ?? 10;\n\n const { t } = useTranslation();\n\n const { raise } = useEvent();\n\n useEffect(() => {\n const event = new StepCheckoutViewEvent(currentBasketRows, basketAddonRows);\n raise(event);\n }, []);\n\n return (\n <div className=\"container rs-step-confirmation\">\n <PageTitle step=\"Confirmation\" />\n <ConfirmationFormContextWrapper>\n <BEMobileSummary />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <>\n <Link\n to={{\n pathname: StepManager.getPreviousStepUrl(currentStep),\n search: location.search,\n }}\n >\n <BackButton />\n </Link>\n <div className=\"u-marg-top--light u-marg-bottom--heavy\">\n <Headline bold>{t(Translation.Navigation.Steps.Confirmation)}</Headline>\n </div>\n </>\n )}\n\n <div className=\"u-marg-top@m-\">\n <StepRoomBestRateAlert />\n </div>\n </StepLayoutLeftContent>\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n <StepRoomHotelDetails />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n <LineBreak />\n <StepLayoutContainer>\n <StepLayoutLeftContent>\n <div className=\"block-container\">\n {!InlineAddonStepFeature.isActive() && <AdditionalOffers />}\n <StepConfirmationFormProvider />\n </div>\n </StepLayoutLeftContent>\n\n {context.screenSize > ScreenSize.Medium && (\n <StepLayoutRightContent>\n {basketTimeout > 0 && <StepConfirmationLimitedOffer endDate={dayjs().add(basketTimeout, 'minute')} />}\n <BESummary showImages />\n </StepLayoutRightContent>\n )}\n </StepLayoutContainer>\n </ConfirmationFormContextWrapper>\n </div>\n );\n}\n\nexport default StepConfirmationComponent;\n"]}
@@ -82,10 +82,14 @@ class RoomstayThemeEngine {
82
82
  this.registerStyles(newCompany.colors);
83
83
  };
84
84
  this.changeTheme = (profile) => __awaiter(this, void 0, void 0, function* () {
85
+ var _a;
85
86
  const styleOverrides = this.createElementOrReuseExisting('style', 'engine-styles');
86
87
  styleOverrides.setAttribute('rel', 'preload');
88
+ // Use :host when inside Shadow DOM, :root for light DOM
89
+ const isInShadowDom = ((_a = this.EngineContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()) instanceof ShadowRoot;
90
+ const selector = isInShadowDom ? ':host' : ':root';
87
91
  styleOverrides.innerHTML = `
88
- :root {
92
+ ${selector} {
89
93
  ${(0, Color_1.getAccentOverrideStyleContent)(profile)}
90
94
  }`;
91
95
  });
@@ -123,7 +127,8 @@ class RoomstayThemeEngine {
123
127
  });
124
128
  this.loadScript = (src, name, alwaysExecute = false, timeout = 5000) => new Promise((resolve, reject) => {
125
129
  var _a;
126
- const container = this.EngineContainer;
130
+ // Always use document.head for scripts — they need document scope (especially in Shadow DOM)
131
+ const container = document.head;
127
132
  const existingScript = container.querySelector(`script[name="roomstay-script-${name}"]`);
128
133
  if (existingScript) {
129
134
  if (alwaysExecute) {
@@ -1 +1 @@
1
- {"version":3,"file":"RoomstayThemeEngine.js","sourceRoot":"/","sources":["src/providers/RoomstayThemeEngine.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA+C;AAE/C,wDAA0C;AAC1C,kDAA0B;AAC1B,iFAAyD;AACzD,+EAAuD;AACvD,iFAAyD;AACzD,sDAA0C;AAC1C,iD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B,CAAC,CAAC;QAnKE,OAAO,CAAC,GAAG,CAAC,yCAAyC,kBAAU,EAAE,CAAC,CAAC;IACvE,CAAC;CAmKJ;AAED,kBAAe,IAAI,mBAAmB,EAAE,CAAC","sourcesContent":["import * as ROP from '@juggle/resize-observer';\nimport { IHotelColorScheme } from '@roomstay/core';\nimport * as Sentry from '@sentry/browser';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\nimport isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\nimport i18n, { TFunction } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport type { Company } from '@/models/Client/Hotel/Company';\nimport { Language, LanguageProvider } from '@/providers/LanguageProvider';\nimport { getAccentOverrideStyleContent } from '@/util/Color';\n\ndeclare global {\n interface Window {\n ResizeObserver: any;\n }\n}\n\ndeclare const ASSET_URL: string;\n\nexport declare const RS_VERSION: string;\n\nif (typeof ResizeObserver === 'undefined') {\n window.ResizeObserver = ROP.ResizeObserver;\n}\n\nexport enum RoomstayTheme {\n Medium = 'medium',\n Light = 'light',\n}\n\nclass RoomstayThemeEngine {\n public currentCompany: Company | null = null;\n\n public EngineContainer!: HTMLElement;\n\n public ScriptContainer: Element | null = null;\n public StyleContainer: Element | null = null;\n\n public selectedLang: Language = Language.en_us;\n\n // TODO This needs to be changed, not ideal to just check for localhost\n public isLocalhost: boolean = location.hostname === 'localhost';\n\n // TODO: This needs to be refactored to not be a fixed string.\n public ThemeType = RoomstayTheme.Light;\n\n public ExternalStyles: string[] = [];\n public ExternalScripts: string[] = ['https://js.verygoodvault.com/vgs-collect/1/AC7dReJwJ6EWF1L9FHdcCw7n.js'];\n\n public translation: TFunction | null = null;\n\n public constructor() {\n console.log(`Initializing Roomstay Booking Engine v${RS_VERSION}`);\n }\n\n public changeCompany = (newCompany: Company) => {\n this.currentCompany = newCompany;\n this.registerStyles(newCompany.colors);\n };\n\n public changeTheme = async (profile: IHotelColorScheme) => {\n const styleOverrides = this.createElementOrReuseExisting('style', 'engine-styles');\n\n styleOverrides.setAttribute('rel', 'preload');\n\n styleOverrides.innerHTML = `\n :root {\n ${getAccentOverrideStyleContent(profile)}\n }`;\n };\n\n public registerStyles = async (profile?: IHotelColorScheme) => {\n console.log('Loading custom Theme Styles');\n if (profile) {\n this.changeTheme(profile);\n }\n\n this.ExternalStyles.forEach((url, index) => {\n const style = this.createElementOrReuseExisting('link', `engine-external-style-${index}`);\n style.setAttribute('rel', 'stylesheet');\n style.setAttribute('href', this.getAssetUrl() + url);\n });\n };\n\n public getAssetUrl = () => {\n return ASSET_URL;\n };\n\n public getImageAssetUrl = (url = '') => {\n return this.getAssetUrl() + 'assets/img/' + url;\n };\n\n /**\n * Detects if URL is absolute, and needs to be\n * @param url string\n */\n public wrapAssetUrl = (url: string) => {\n if (url.match(/^(?:[a-z]+:)?\\/\\//)) {\n return url;\n }\n\n return this.getAssetUrl() + url;\n };\n\n public registerScripts = async () => {\n this.ExternalScripts.forEach((url: string, index) => {\n this.loadScript(url, `legacy-${index}`);\n });\n };\n\n public loadScript = (src: string, name: string, alwaysExecute = false, timeout = 5_000): Promise<void> =>\n new Promise((resolve, reject) => {\n const container = this.EngineContainer;\n const existingScript = container.querySelector(`script[name=\"roomstay-script-${name}\"]`);\n\n if (existingScript) {\n if (alwaysExecute) {\n existingScript.remove();\n } else {\n resolve();\n return;\n }\n }\n\n const cleanup = () => {\n clearTimeout(timer);\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n const onLoad = () => {\n cleanup();\n resolve();\n };\n\n const onError = () => {\n cleanup();\n reject(new Error(`Failed to load script \"${src}\"`));\n };\n\n const script = document.createElement('script');\n script.setAttribute('name', `roomstay-script-${name}`);\n script.setAttribute('src', src);\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n // Guarantee that we won't get stuck here forever\n const timer = setTimeout(onError, timeout);\n\n // Append the script twice for some reason\n container.appendChild(script);\n this.ScriptContainer?.appendChild(script);\n });\n\n public createElementOrReuseExisting = <K extends keyof HTMLElementTagNameMap>(type: K, name: string) => {\n const container = this.EngineContainer;\n const findingElement = container.querySelector(`${type}[name=\"roomstay-${name}\"]`);\n\n if (findingElement) {\n return findingElement;\n } else {\n const target = document.createElement(type);\n target.setAttribute('name', `roomstay-${name}`);\n container.appendChild(target);\n return target;\n }\n };\n\n public init = async () => {\n dayjs.extend(isSameOrBefore);\n dayjs.extend(isSameOrAfter);\n dayjs.extend(advancedFormat);\n\n if (i18n) {\n this.translation = await i18n.use(initReactI18next).init({\n interpolation: { escapeValue: false },\n lng: Language.en_us,\n resources: LanguageProvider.getI18nMappedLanguages(),\n });\n }\n\n if (!this.isLocalhost) {\n Sentry.init({\n dsn: 'https://3bfba949561e48f1862c843ce8254a2d@o398412.ingest.sentry.io/5254086',\n beforeSend: (event, hint) => {\n event.tags = event.tags ?? { logger: '_default_' };\n\n try {\n if (hint?.originalException instanceof Error) {\n if ((hint.originalException.stack?.indexOf('www.googletagmanager.com/gtm.js?id=') as number) > -1) {\n event.tags.logger = 'gtm';\n event.level = Sentry.Severity.Warning;\n }\n }\n } catch (ex) {\n console.log(ex);\n }\n\n return event;\n },\n });\n }\n\n this.reloadScriptAndStyleContainers();\n };\n\n private reloadScriptAndStyleContainers = () => {\n this.StyleContainer = this.createElementOrReuseExisting('div', 'style-container');\n this.ScriptContainer = this.createElementOrReuseExisting('div', 'script-container');\n\n this.ScriptContainer.innerHTML = '';\n this.StyleContainer.innerHTML = '';\n\n this.registerStyles();\n };\n}\n\nexport default new RoomstayThemeEngine();\n"]}
1
+ {"version":3,"file":"RoomstayThemeEngine.js","sourceRoot":"/","sources":["src/providers/RoomstayThemeEngine.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA+C;AAE/C,wDAA0C;AAC1C,kDAA0B;AAC1B,iFAAyD;AACzD,+EAAuD;AACv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AiB,CAAC,CAAC;YAClF,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YAEpF,IAAI,CAAC,eAAe,CAAC,SAAS,GAAG,EAAE,CAAC;YACpC,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,EAAE,CAAC;YAEnC,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1B,CAAC,CAAC;QAxKE,OAAO,CAAC,GAAG,CAAC,yCAAyC,kBAAU,EAAE,CAAC,CAAC;IACvE,CAAC;CAwKJ;AAED,kBAAe,IAAI,mBAAmB,EAAE,CAAC","sourcesContent":["import * as ROP from '@juggle/resize-observer';\nimport { IHotelColorScheme } from '@roomstay/core';\nimport * as Sentry from '@sentry/browser';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat';\nimport isSameOrAfter from 'dayjs/plugin/isSameOrAfter';\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\nimport i18n, { TFunction } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport type { Company } from '@/models/Client/Hotel/Company';\nimport { Language, LanguageProvider } from '@/providers/LanguageProvider';\nimport { getAccentOverrideStyleContent } from '@/util/Color';\n\ndeclare global {\n interface Window {\n ResizeObserver: any;\n }\n}\n\ndeclare const ASSET_URL: string;\n\nexport declare const RS_VERSION: string;\n\nif (typeof ResizeObserver === 'undefined') {\n window.ResizeObserver = ROP.ResizeObserver;\n}\n\nexport enum RoomstayTheme {\n Medium = 'medium',\n Light = 'light',\n}\n\nclass RoomstayThemeEngine {\n public currentCompany: Company | null = null;\n\n public EngineContainer!: HTMLElement;\n\n public ScriptContainer: Element | null = null;\n public StyleContainer: Element | null = null;\n\n public selectedLang: Language = Language.en_us;\n\n // TODO This needs to be changed, not ideal to just check for localhost\n public isLocalhost: boolean = location.hostname === 'localhost';\n\n // TODO: This needs to be refactored to not be a fixed string.\n public ThemeType = RoomstayTheme.Light;\n\n public ExternalStyles: string[] = [];\n public ExternalScripts: string[] = ['https://js.verygoodvault.com/vgs-collect/1/AC7dReJwJ6EWF1L9FHdcCw7n.js'];\n\n public translation: TFunction | null = null;\n\n public constructor() {\n console.log(`Initializing Roomstay Booking Engine v${RS_VERSION}`);\n }\n\n public changeCompany = (newCompany: Company) => {\n this.currentCompany = newCompany;\n this.registerStyles(newCompany.colors);\n };\n\n public changeTheme = async (profile: IHotelColorScheme) => {\n const styleOverrides = this.createElementOrReuseExisting('style', 'engine-styles');\n\n styleOverrides.setAttribute('rel', 'preload');\n\n // Use :host when inside Shadow DOM, :root for light DOM\n const isInShadowDom = this.EngineContainer?.getRootNode() instanceof ShadowRoot;\n const selector = isInShadowDom ? ':host' : ':root';\n\n styleOverrides.innerHTML = `\n ${selector} {\n ${getAccentOverrideStyleContent(profile)}\n }`;\n };\n\n public registerStyles = async (profile?: IHotelColorScheme) => {\n console.log('Loading custom Theme Styles');\n if (profile) {\n this.changeTheme(profile);\n }\n\n this.ExternalStyles.forEach((url, index) => {\n const style = this.createElementOrReuseExisting('link', `engine-external-style-${index}`);\n style.setAttribute('rel', 'stylesheet');\n style.setAttribute('href', this.getAssetUrl() + url);\n });\n };\n\n public getAssetUrl = () => {\n return ASSET_URL;\n };\n\n public getImageAssetUrl = (url = '') => {\n return this.getAssetUrl() + 'assets/img/' + url;\n };\n\n /**\n * Detects if URL is absolute, and needs to be\n * @param url string\n */\n public wrapAssetUrl = (url: string) => {\n if (url.match(/^(?:[a-z]+:)?\\/\\//)) {\n return url;\n }\n\n return this.getAssetUrl() + url;\n };\n\n public registerScripts = async () => {\n this.ExternalScripts.forEach((url: string, index) => {\n this.loadScript(url, `legacy-${index}`);\n });\n };\n\n public loadScript = (src: string, name: string, alwaysExecute = false, timeout = 5_000): Promise<void> =>\n new Promise((resolve, reject) => {\n // Always use document.head for scripts — they need document scope (especially in Shadow DOM)\n const container = document.head;\n const existingScript = container.querySelector(`script[name=\"roomstay-script-${name}\"]`);\n\n if (existingScript) {\n if (alwaysExecute) {\n existingScript.remove();\n } else {\n resolve();\n return;\n }\n }\n\n const cleanup = () => {\n clearTimeout(timer);\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n const onLoad = () => {\n cleanup();\n resolve();\n };\n\n const onError = () => {\n cleanup();\n reject(new Error(`Failed to load script \"${src}\"`));\n };\n\n const script = document.createElement('script');\n script.setAttribute('name', `roomstay-script-${name}`);\n script.setAttribute('src', src);\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n // Guarantee that we won't get stuck here forever\n const timer = setTimeout(onError, timeout);\n\n // Append the script twice for some reason\n container.appendChild(script);\n this.ScriptContainer?.appendChild(script);\n });\n\n public createElementOrReuseExisting = <K extends keyof HTMLElementTagNameMap>(type: K, name: string) => {\n const container = this.EngineContainer;\n const findingElement = container.querySelector(`${type}[name=\"roomstay-${name}\"]`);\n\n if (findingElement) {\n return findingElement;\n } else {\n const target = document.createElement(type);\n target.setAttribute('name', `roomstay-${name}`);\n container.appendChild(target);\n return target;\n }\n };\n\n public init = async () => {\n dayjs.extend(isSameOrBefore);\n dayjs.extend(isSameOrAfter);\n dayjs.extend(advancedFormat);\n\n if (i18n) {\n this.translation = await i18n.use(initReactI18next).init({\n interpolation: { escapeValue: false },\n lng: Language.en_us,\n resources: LanguageProvider.getI18nMappedLanguages(),\n });\n }\n\n if (!this.isLocalhost) {\n Sentry.init({\n dsn: 'https://3bfba949561e48f1862c843ce8254a2d@o398412.ingest.sentry.io/5254086',\n beforeSend: (event, hint) => {\n event.tags = event.tags ?? { logger: '_default_' };\n\n try {\n if (hint?.originalException instanceof Error) {\n if ((hint.originalException.stack?.indexOf('www.googletagmanager.com/gtm.js?id=') as number) > -1) {\n event.tags.logger = 'gtm';\n event.level = Sentry.Severity.Warning;\n }\n }\n } catch (ex) {\n console.log(ex);\n }\n\n return event;\n },\n });\n }\n\n this.reloadScriptAndStyleContainers();\n };\n\n private reloadScriptAndStyleContainers = () => {\n this.StyleContainer = this.createElementOrReuseExisting('div', 'style-container');\n this.ScriptContainer = this.createElementOrReuseExisting('div', 'script-container');\n\n this.ScriptContainer.innerHTML = '';\n this.StyleContainer.innerHTML = '';\n\n this.registerStyles();\n };\n}\n\nexport default new RoomstayThemeEngine();\n"]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Manages Shadow DOM setup for a booking engine instance.
3
+ *
4
+ * Creates a shadow root on the host element with:
5
+ * - An inner container div (.roomstay-booking-container) for React rendering
6
+ * - Style injection via StyleInjector (all cached + future styles are duplicated here)
7
+ */
8
+ export declare class ShadowDomManager {
9
+ private shadowRoot;
10
+ private innerContainer;
11
+ private unregisterStyles;
12
+ constructor(hostElement: HTMLElement);
13
+ /** The shadow root */
14
+ get root(): ShadowRoot;
15
+ /** The inner container div — use as React render target and RoomstayThemeEngine.EngineContainer */
16
+ get container(): HTMLDivElement;
17
+ /** Inject a one-off style into the shadow root */
18
+ injectStyle(cssText: string, id?: string): HTMLStyleElement;
19
+ /** Clean up — unregister from StyleInjector */
20
+ destroy(): void;
21
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShadowDomManager = void 0;
4
+ const StyleInjector_1 = require("./StyleInjector");
5
+ /**
6
+ * Manages Shadow DOM setup for a booking engine instance.
7
+ *
8
+ * Creates a shadow root on the host element with:
9
+ * - An inner container div (.roomstay-booking-container) for React rendering
10
+ * - Style injection via StyleInjector (all cached + future styles are duplicated here)
11
+ */
12
+ class ShadowDomManager {
13
+ constructor(hostElement) {
14
+ this.unregisterStyles = null;
15
+ this.shadowRoot = hostElement.attachShadow({ mode: 'open' });
16
+ // Create the inner container for React rendering
17
+ this.innerContainer = document.createElement('div');
18
+ this.innerContainer.classList.add('roomstay-booking-container');
19
+ this.shadowRoot.appendChild(this.innerContainer);
20
+ // Register this shadow root to receive all style injections
21
+ this.unregisterStyles = StyleInjector_1.StyleInjector.registerShadowRoot(this.shadowRoot);
22
+ }
23
+ /** The shadow root */
24
+ get root() {
25
+ return this.shadowRoot;
26
+ }
27
+ /** The inner container div — use as React render target and RoomstayThemeEngine.EngineContainer */
28
+ get container() {
29
+ return this.innerContainer;
30
+ }
31
+ /** Inject a one-off style into the shadow root */
32
+ injectStyle(cssText, id) {
33
+ if (id) {
34
+ const existing = this.shadowRoot.querySelector(`style[data-rs-id="${id}"]`);
35
+ if (existing) {
36
+ existing.textContent = cssText;
37
+ return existing;
38
+ }
39
+ }
40
+ const style = document.createElement('style');
41
+ if (id)
42
+ style.setAttribute('data-rs-id', id);
43
+ style.textContent = cssText;
44
+ this.shadowRoot.appendChild(style);
45
+ return style;
46
+ }
47
+ /** Clean up — unregister from StyleInjector */
48
+ destroy() {
49
+ var _a;
50
+ (_a = this.unregisterStyles) === null || _a === void 0 ? void 0 : _a.call(this);
51
+ this.unregisterStyles = null;
52
+ }
53
+ }
54
+ exports.ShadowDomManager = ShadowDomManager;
55
+ //# sourceMappingURL=ShadowDomManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShadowDomManager.js","sourceRoot":"/","sources":["src/providers/ShadowDomManager.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAEhD;;;;;;GAMG;AACH,MAAa,gBAAgB;IAKzB,YAAY,WAAwB;QAF5B,qBAAgB,GAAwB,IAAI,CAAC;QAGjD,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAE7D,iDAAiD;QACjD,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAEjD,4DAA4D;QAC5D,IAAI,CAAC,gBAAgB,GAAG,6BAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9E,CAAC;IAED,sBAAsB;IACtB,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,mGAAmG;IACnG,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,kDAAkD;IAClD,WAAW,CAAC,OAAe,EAAE,EAAW;QACpC,IAAI,EAAE,EAAE,CAAC;YACL,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,qBAAqB,EAAE,IAAI,CAAqB,CAAC;YAChG,IAAI,QAAQ,EAAE,CAAC;gBACX,QAAQ,CAAC,WAAW,GAAG,OAAO,CAAC;gBAC/B,OAAO,QAAQ,CAAC;YACpB,CAAC;QACL,CAAC;QACD,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,EAAE;YAAE,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAC7C,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,+CAA+C;IAC/C,OAAO;;QACH,MAAA,IAAI,CAAC,gBAAgB,oDAAI,CAAC;QAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAhDD,4CAgDC","sourcesContent":["import { StyleInjector } from './StyleInjector';\n\n/**\n * Manages Shadow DOM setup for a booking engine instance.\n *\n * Creates a shadow root on the host element with:\n * - An inner container div (.roomstay-booking-container) for React rendering\n * - Style injection via StyleInjector (all cached + future styles are duplicated here)\n */\nexport class ShadowDomManager {\n private shadowRoot: ShadowRoot;\n private innerContainer: HTMLDivElement;\n private unregisterStyles: (() => void) | null = null;\n\n constructor(hostElement: HTMLElement) {\n this.shadowRoot = hostElement.attachShadow({ mode: 'open' });\n\n // Create the inner container for React rendering\n this.innerContainer = document.createElement('div');\n this.innerContainer.classList.add('roomstay-booking-container');\n this.shadowRoot.appendChild(this.innerContainer);\n\n // Register this shadow root to receive all style injections\n this.unregisterStyles = StyleInjector.registerShadowRoot(this.shadowRoot);\n }\n\n /** The shadow root */\n get root(): ShadowRoot {\n return this.shadowRoot;\n }\n\n /** The inner container div — use as React render target and RoomstayThemeEngine.EngineContainer */\n get container(): HTMLDivElement {\n return this.innerContainer;\n }\n\n /** Inject a one-off style into the shadow root */\n injectStyle(cssText: string, id?: string): HTMLStyleElement {\n if (id) {\n const existing = this.shadowRoot.querySelector(`style[data-rs-id=\"${id}\"]`) as HTMLStyleElement;\n if (existing) {\n existing.textContent = cssText;\n return existing;\n }\n }\n const style = document.createElement('style');\n if (id) style.setAttribute('data-rs-id', id);\n style.textContent = cssText;\n this.shadowRoot.appendChild(style);\n return style;\n }\n\n /** Clean up — unregister from StyleInjector */\n destroy(): void {\n this.unregisterStyles?.();\n this.unregisterStyles = null;\n }\n}\n"]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Global registry for Shadow DOM style injection.
3
+ *
4
+ * When style-loader injects a <style> tag, it calls `insertStyle()` which:
5
+ * 1. Appends the style to document.head (for light DOM engines)
6
+ * 2. Observes the element for content changes (style-loader sets content AFTER insert() returns)
7
+ * 3. Clones it into every registered shadow root once content is available
8
+ *
9
+ * When a shadow root registers, all existing <style> tags in document.head
10
+ * (that have our data attribute) are cloned into it — by that time, all styles
11
+ * already have their content set by style-loader.
12
+ *
13
+ * Must be on `window.__roomstayStyleInjector` so style-loader's insert function can access it.
14
+ */
15
+ declare class StyleInjectorClass {
16
+ private shadowRoots;
17
+ private managedStyleIds;
18
+ private styleIdCounter;
19
+ /**
20
+ * Register a shadow root to receive style injections.
21
+ * All existing managed styles in document.head are cloned into the shadow root.
22
+ * Returns an unregister function.
23
+ */
24
+ registerShadowRoot(shadowRoot: ShadowRoot): () => void;
25
+ /**
26
+ * Called by style-loader's custom insert function.
27
+ * Appends the style element to document.head, then observes it for content
28
+ * changes so we can clone into shadow roots once style-loader sets the CSS.
29
+ */
30
+ insertStyle(styleElement: HTMLStyleElement): void;
31
+ /**
32
+ * Watch a style element for content changes. Once content is set,
33
+ * clone it into all registered shadow roots.
34
+ */
35
+ private observeAndClone;
36
+ /**
37
+ * Clone CSS text into all registered shadow roots.
38
+ */
39
+ private cloneToShadowRoots;
40
+ }
41
+ export declare const StyleInjector: StyleInjectorClass;
42
+ export {};
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyleInjector = void 0;
4
+ /**
5
+ * Global registry for Shadow DOM style injection.
6
+ *
7
+ * When style-loader injects a <style> tag, it calls `insertStyle()` which:
8
+ * 1. Appends the style to document.head (for light DOM engines)
9
+ * 2. Observes the element for content changes (style-loader sets content AFTER insert() returns)
10
+ * 3. Clones it into every registered shadow root once content is available
11
+ *
12
+ * When a shadow root registers, all existing <style> tags in document.head
13
+ * (that have our data attribute) are cloned into it — by that time, all styles
14
+ * already have their content set by style-loader.
15
+ *
16
+ * Must be on `window.__roomstayStyleInjector` so style-loader's insert function can access it.
17
+ */
18
+ class StyleInjectorClass {
19
+ constructor() {
20
+ this.shadowRoots = new Set();
21
+ this.managedStyleIds = new Set();
22
+ this.styleIdCounter = 0;
23
+ }
24
+ /**
25
+ * Register a shadow root to receive style injections.
26
+ * All existing managed styles in document.head are cloned into the shadow root.
27
+ * Returns an unregister function.
28
+ */
29
+ registerShadowRoot(shadowRoot) {
30
+ this.shadowRoots.add(shadowRoot);
31
+ // Copy all existing managed styles from document.head.
32
+ // By registration time, style-loader has already set their content.
33
+ const existingStyles = document.head.querySelectorAll('style[data-rs-style]');
34
+ existingStyles.forEach((styleEl) => {
35
+ const cssText = styleEl.textContent || '';
36
+ if (cssText) {
37
+ const clone = document.createElement('style');
38
+ clone.setAttribute('data-rs-style', styleEl.getAttribute('data-rs-style') || '');
39
+ clone.textContent = cssText;
40
+ shadowRoot.appendChild(clone);
41
+ }
42
+ });
43
+ return () => {
44
+ this.shadowRoots.delete(shadowRoot);
45
+ };
46
+ }
47
+ /**
48
+ * Called by style-loader's custom insert function.
49
+ * Appends the style element to document.head, then observes it for content
50
+ * changes so we can clone into shadow roots once style-loader sets the CSS.
51
+ */
52
+ insertStyle(styleElement) {
53
+ const id = `rs-style-${this.styleIdCounter++}`;
54
+ styleElement.setAttribute('data-rs-style', id);
55
+ this.managedStyleIds.add(id);
56
+ // Always inject into document.head for light DOM engines
57
+ document.head.appendChild(styleElement);
58
+ // style-loader sets content AFTER insert() returns.
59
+ // Use MutationObserver to detect when content is set, then clone to shadow roots.
60
+ if (this.shadowRoots.size > 0) {
61
+ this.observeAndClone(styleElement, id);
62
+ }
63
+ else {
64
+ // No shadow roots yet — still observe in case one registers before
65
+ // style-loader sets the content (unlikely but safe)
66
+ this.observeAndClone(styleElement, id);
67
+ }
68
+ }
69
+ /**
70
+ * Watch a style element for content changes. Once content is set,
71
+ * clone it into all registered shadow roots.
72
+ */
73
+ observeAndClone(styleElement, id) {
74
+ // Check if content is already available (e.g. manually created styles)
75
+ const immediateContent = styleElement.textContent || '';
76
+ if (immediateContent) {
77
+ this.cloneToShadowRoots(immediateContent, id);
78
+ return;
79
+ }
80
+ // Observe for childList changes (style-loader adds a text node)
81
+ const observer = new MutationObserver(() => {
82
+ const cssText = styleElement.textContent || '';
83
+ if (cssText) {
84
+ observer.disconnect();
85
+ this.cloneToShadowRoots(cssText, id);
86
+ }
87
+ });
88
+ observer.observe(styleElement, { childList: true, characterData: true, subtree: true });
89
+ // Safety fallback: if MutationObserver doesn't fire (e.g. style-loader uses
90
+ // element.textContent = ... which may not trigger characterData), use a microtask
91
+ Promise.resolve().then(() => {
92
+ const cssText = styleElement.textContent || '';
93
+ if (cssText) {
94
+ observer.disconnect();
95
+ this.cloneToShadowRoots(cssText, id);
96
+ }
97
+ });
98
+ }
99
+ /**
100
+ * Clone CSS text into all registered shadow roots.
101
+ */
102
+ cloneToShadowRoots(cssText, id) {
103
+ this.shadowRoots.forEach((shadowRoot) => {
104
+ // Avoid duplicates — check if this ID already exists in the shadow root
105
+ if (shadowRoot.querySelector(`style[data-rs-style="${id}"]`)) {
106
+ return;
107
+ }
108
+ const clone = document.createElement('style');
109
+ clone.setAttribute('data-rs-style', id);
110
+ clone.textContent = cssText;
111
+ shadowRoot.appendChild(clone);
112
+ });
113
+ }
114
+ }
115
+ // Singleton on window so style-loader's insert function can access it
116
+ window.__roomstayStyleInjector = window.__roomstayStyleInjector || new StyleInjectorClass();
117
+ exports.StyleInjector = window.__roomstayStyleInjector;
118
+ //# sourceMappingURL=StyleInjector.js.map