@meetelise/chat 1.35.0 → 1.35.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/MyPubnub.d.ts +116 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +28 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +22 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +46 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +21 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +34 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/constants.d.ts +3 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +55 -0
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +41 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +82 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +5 -0
- package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +6 -0
- package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +4 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +18 -0
- package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +8 -0
- package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +13 -0
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +10 -0
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -0
- package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +31 -0
- package/dist/src/WebComponent/LeadSourceClient.d.ts +46 -0
- package/dist/src/WebComponent/OfficeHours.d.ts +21 -0
- package/dist/src/WebComponent/Scheduler/date-picker.d.ts +28 -0
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +16 -0
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +102 -0
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +13 -0
- package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/InputStyles.d.ts +1 -0
- package/dist/src/WebComponent/actions/action-confirm-button.d.ts +13 -0
- package/dist/src/WebComponent/actions/call-us-window.d.ts +37 -0
- package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/actions/details-window.d.ts +14 -0
- package/dist/src/WebComponent/actions/email-us-window.d.ts +46 -0
- package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +17 -0
- package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +8 -0
- package/dist/src/WebComponent/chat-additional-actions.d.ts +28 -0
- package/dist/src/WebComponent/health-chat.d.ts +47 -0
- package/dist/src/WebComponent/healthchat-styles.d.ts +1 -0
- package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +7 -0
- package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +3 -0
- package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +2 -0
- package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +2 -0
- package/dist/src/WebComponent/index.d.ts +2 -0
- package/dist/src/WebComponent/launcher/Launcher.d.ts +99 -0
- package/dist/src/WebComponent/launcher/launcherStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +27 -0
- package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +1 -0
- package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +1 -0
- package/dist/src/WebComponent/leasing-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/loaders/index.d.ts +4 -0
- package/dist/src/WebComponent/loaders/mega-loader.d.ts +7 -0
- package/dist/src/WebComponent/loaders/skeleton-card.d.ts +12 -0
- package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +3 -0
- package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +13 -0
- package/dist/src/WebComponent/me-chat.d.ts +91 -0
- package/dist/src/WebComponent/me-select.d.ts +24 -0
- package/dist/src/WebComponent/mini-loader.d.ts +5 -0
- package/dist/src/WebComponent/pubnub-chat-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-chat.d.ts +48 -0
- package/dist/src/WebComponent/pubnub-media.d.ts +14 -0
- package/dist/src/WebComponent/pubnub-message-styles.d.ts +1 -0
- package/dist/src/WebComponent/pubnub-message.d.ts +39 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +1 -0
- package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +12 -0
- package/dist/src/WebComponent/utilities-chat.d.ts +47 -0
- package/dist/src/WebComponent/utilities-styles.d.ts +1 -0
- package/dist/src/WebComponent/utils.d.ts +31 -0
- package/dist/src/analytics.d.ts +64 -0
- package/dist/src/disclaimers.d.ts +16 -0
- package/dist/src/fetchBuildingABTestType.d.ts +8 -0
- package/dist/src/fetchBuildingInfo.d.ts +58 -0
- package/dist/src/fetchBuildingWebchatView.d.ts +124 -0
- package/dist/src/fetchFeatureFlag.d.ts +14 -0
- package/dist/src/fetchLeadSources.d.ts +4 -0
- package/dist/src/fetchPhoneNumberFromSource.d.ts +6 -0
- package/dist/src/getAvailabilities.d.ts +46 -0
- package/dist/src/getBuildingPhoneNumber.d.ts +1 -0
- package/dist/src/getShouldAllowScheduling.d.ts +1 -0
- package/dist/src/getShouldShowWebchat.d.ts +3 -0
- package/dist/src/getTimezoneString.d.ts +1 -0
- package/dist/src/globals.d.ts +2 -0
- package/dist/src/gtm.d.ts +6 -0
- package/dist/src/handleChatId.d.ts +11 -0
- package/dist/src/insertDNIIntoWebsite.d.ts +5 -0
- package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +4 -0
- package/dist/src/main/MEChat.d.ts +74 -0
- package/dist/src/main/utils.d.ts +2 -0
- package/dist/src/postLeadSources.d.ts +3 -0
- package/dist/src/rentgrata.d.ts +4 -0
- package/dist/src/replaceSelectButtonsWithNewLink.d.ts +5 -0
- package/dist/src/services/fees/calculateQuote.d.ts +14 -0
- package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +10 -0
- package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
- package/dist/src/services/fees/utils.d.ts +1 -0
- package/dist/src/svgIcons.d.ts +5 -0
- package/dist/src/themes.d.ts +5 -0
- package/dist/src/types/incentive-v2.d.ts +23 -0
- package/dist/src/types/rest-sdk.types.d.ts +11 -0
- package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
- package/dist/src/utils/getWidgetOverrides.d.ts +39 -0
- package/dist/src/utils/queryParamBuilder.d.ts +8 -0
- package/dist/src/utils.d.ts +13 -0
- package/package.json +1 -1
- package/public/dist/index.js +250 -164
- package/src/MyPubnub.ts +792 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +206 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +6 -0
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +101 -0
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +98 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +9 -0
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +136 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +151 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +261 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +65 -0
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +91 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +44 -0
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +38 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +149 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +247 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +82 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +76 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +40 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +43 -0
- package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +1 -0
- package/src/WebComponent/FeeCalculator/components/index.ts +5 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +39 -0
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +39 -0
- package/src/WebComponent/FeeCalculator/constants.ts +5 -0
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +310 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +341 -0
- package/src/WebComponent/FeeCalculator/index.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +84 -0
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +126 -0
- package/src/WebComponent/FeeCalculator/model/desired-addon.ts +6 -0
- package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/index.ts +13 -0
- package/src/WebComponent/FeeCalculator/model/item-combination.ts +16 -0
- package/src/WebComponent/FeeCalculator/model/item-quantity.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +45 -0
- package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +9 -0
- package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +1 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +34 -0
- package/src/WebComponent/FeeCalculator/model/rentable-item.ts +21 -0
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -0
- package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +54 -0
- package/src/WebComponent/LeadSourceClient.ts +332 -0
- package/src/WebComponent/MEChat.css +5 -0
- package/src/WebComponent/OfficeHours.ts +73 -0
- package/src/WebComponent/Scheduler/date-picker.ts +405 -0
- package/src/WebComponent/Scheduler/time-picker.ts +195 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +1430 -0
- package/src/WebComponent/Scheduler/tour-type-option.ts +112 -0
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
- package/src/WebComponent/actions/InputStyles.ts +57 -0
- package/src/WebComponent/actions/action-confirm-button.ts +125 -0
- package/src/WebComponent/actions/call-us-window.ts +467 -0
- package/src/WebComponent/actions/collapse-expand-button.ts +65 -0
- package/src/WebComponent/actions/details-window.ts +150 -0
- package/src/WebComponent/actions/email-us-window.ts +556 -0
- package/src/WebComponent/actions/formatPhoneNumber.ts +72 -0
- package/src/WebComponent/actions/minimize-expand-button.ts +93 -0
- package/src/WebComponent/chat-additional-actions.ts +135 -0
- package/src/WebComponent/health-chat.ts +270 -0
- package/src/WebComponent/healthchat-styles.ts +119 -0
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +22 -0
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +13 -0
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +80 -0
- package/src/WebComponent/icons/ChatOutlineIcon.ts +10 -0
- package/src/WebComponent/icons/ChevronLeftIcon.ts +7 -0
- package/src/WebComponent/icons/ChevronRightIcon.ts +7 -0
- package/src/WebComponent/icons/ContactResidentIcon.ts +9 -0
- package/src/WebComponent/icons/DollarOutlineIcon.ts +26 -0
- package/src/WebComponent/icons/EmailOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +12 -0
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +7 -0
- package/src/WebComponent/icons/SendMessageIcon.ts +17 -0
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +17 -0
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +17 -0
- package/src/WebComponent/icons/TourWithAgentIcon.ts +17 -0
- package/src/WebComponent/icons/XOutlineIcon.ts +8 -0
- package/src/WebComponent/index.ts +2 -0
- package/src/WebComponent/launcher/Launcher.ts +1284 -0
- package/src/WebComponent/launcher/launcherStyles.ts +500 -0
- package/src/WebComponent/launcher/mobile-launcher.ts +162 -0
- package/src/WebComponent/launcher/typeEmojiStyles.ts +161 -0
- package/src/WebComponent/launcher/typeMiniStyles.ts +60 -0
- package/src/WebComponent/launcher/typeMobileStyles.ts +50 -0
- package/src/WebComponent/leasing-chat-styles.ts +114 -0
- package/src/WebComponent/loaders/index.ts +7 -0
- package/src/WebComponent/loaders/mega-loader.ts +36 -0
- package/src/WebComponent/loaders/skeleton-card.ts +31 -0
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +112 -0
- package/src/WebComponent/loaders/skeleton-loader.ts +34 -0
- package/src/WebComponent/me-chat.ts +1264 -0
- package/src/WebComponent/me-select.ts +322 -0
- package/src/WebComponent/mini-loader.ts +28 -0
- package/src/WebComponent/pubnub-chat-styles.ts +204 -0
- package/src/WebComponent/pubnub-chat.ts +771 -0
- package/src/WebComponent/pubnub-media.ts +208 -0
- package/src/WebComponent/pubnub-message-styles.ts +54 -0
- package/src/WebComponent/pubnub-message.ts +431 -0
- package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +34 -0
- package/src/WebComponent/simple-launcher/simple-launcher.ts +100 -0
- package/src/WebComponent/utilities-chat.ts +270 -0
- package/src/WebComponent/utilities-styles.ts +110 -0
- package/src/WebComponent/utils.ts +82 -0
- package/src/analytics.ts +217 -0
- package/src/assetUrls.ts +6 -0
- package/src/disclaimers.ts +301 -0
- package/src/fetchBuildingABTestType.ts +21 -0
- package/src/fetchBuildingInfo.ts +88 -0
- package/src/fetchBuildingWebchatView.ts +176 -0
- package/src/fetchFeatureFlag.ts +250 -0
- package/src/fetchLeadSources.ts +98 -0
- package/src/fetchPhoneNumberFromSource.ts +31 -0
- package/src/fetchWebchatPreferences.ts +54 -0
- package/src/getAvailabilities.ts +189 -0
- package/src/getBuildingPhoneNumber.ts +26 -0
- package/src/getShouldAllowScheduling.ts +16 -0
- package/src/getShouldShowWebchat.ts +114 -0
- package/src/getTimezoneString.ts +40 -0
- package/src/globals.ts +3 -0
- package/src/gtm.ts +17 -0
- package/src/handleChatId.ts +101 -0
- package/src/insertDNIIntoWebsite.ts +146 -0
- package/src/insertLeadSourceIntoSchedulerLinks.ts +71 -0
- package/src/main/MEChat.test.ts +110 -0
- package/src/main/MEChat.ts +404 -0
- package/src/main/utils.ts +70 -0
- package/src/postLeadSources.ts +44 -0
- package/src/rentgrata.ts +74 -0
- package/src/replaceSelectButtonsWithNewLink.ts +91 -0
- package/src/services/fees/calculateQuote.ts +74 -0
- package/src/services/fees/fetchBuildingFees.ts +50 -0
- package/src/services/fees/fetchBuildingFeesV2.ts +59 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
- package/src/services/fees/fetchBuildingUnits.ts +86 -0
- package/src/services/fees/utils.ts +4 -0
- package/src/svgIcons.ts +14 -0
- package/src/themes.ts +65 -0
- package/src/types/incentive-v2.ts +24 -0
- package/src/types/rest-sdk.types.ts +13 -0
- package/src/types/webchat-no-show-reason.ts +6 -0
- package/src/utils/getWidgetOverrides.ts +91 -0
- package/src/utils/queryParamBuilder.ts +28 -0
- package/src/utils.ts +121 -0
package/src/rentgrata.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
export const openRengrataWidget = (): void => {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const rentgrata = (window as any).rentgrata;
|
|
6
|
+
if (!rentgrata) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const rentgrataWidget = rentgrata.Widget;
|
|
10
|
+
if (!rentgrataWidget) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!rentgrataWidget.openWidget) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
rentgrataWidget.openWidget();
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const closeRengrataWidget = (): void => {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
const rentgrata = (window as any).rentgrata;
|
|
22
|
+
if (!rentgrata) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const rentgrataWidget = rentgrata.Widget;
|
|
26
|
+
if (!rentgrataWidget) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!rentgrataWidget.openWidget) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
rentgrataWidget.close();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const hasRentgrata = (): boolean => {
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
return !!(window as any).rentgrata;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const updateRentgrataToken = async (
|
|
41
|
+
buildingSlug: string,
|
|
42
|
+
orgSlug: string
|
|
43
|
+
): Promise<void> => {
|
|
44
|
+
const host = "https://app.meetelise.com";
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
const rentgrata = (window as any).rentgrata;
|
|
47
|
+
if (!rentgrata) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const rentgrataWidget = rentgrata.Widget;
|
|
51
|
+
if (!rentgrataWidget) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const rentgrataConfig = rentgrataWidget.config;
|
|
55
|
+
if (!rentgrataConfig) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const widgetKey = rentgrataConfig.widgetKey;
|
|
60
|
+
if (!widgetKey) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
await axios.post(
|
|
64
|
+
`${host}/platformApi/webchat/rentgrata?token=${widgetKey}`,
|
|
65
|
+
{},
|
|
66
|
+
{
|
|
67
|
+
headers: {
|
|
68
|
+
"Content-Type": "application/json",
|
|
69
|
+
"building-slug": buildingSlug ?? "",
|
|
70
|
+
"org-slug": orgSlug ?? "",
|
|
71
|
+
},
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script to find all application links/buttons on a page and replace them with a
|
|
3
|
+
* new elise application link.
|
|
4
|
+
*/
|
|
5
|
+
import { LogType, sendLoggingEvent } from "./analytics";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Script to find all "Select" buttons with specific URL patterns and replace them with a
|
|
9
|
+
* new application link.
|
|
10
|
+
*/
|
|
11
|
+
export const replaceSelectButtonsWithNewLink = (
|
|
12
|
+
newApplicationLink: string,
|
|
13
|
+
orgSlug: string,
|
|
14
|
+
buildingSlug?: string
|
|
15
|
+
): number => {
|
|
16
|
+
const urlPatterns = [
|
|
17
|
+
/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,
|
|
18
|
+
/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,
|
|
19
|
+
/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,
|
|
20
|
+
/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,
|
|
21
|
+
/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const allElements = document.body.getElementsByTagName("a");
|
|
25
|
+
|
|
26
|
+
let totalReplacements = 0;
|
|
27
|
+
|
|
28
|
+
for (let i = 0; i < allElements.length; i++) {
|
|
29
|
+
const element = allElements[i] as HTMLAnchorElement;
|
|
30
|
+
if (element.nodeType !== Node.ELEMENT_NODE) continue;
|
|
31
|
+
|
|
32
|
+
const matchesUrlPattern = urlPatterns.some((pattern) =>
|
|
33
|
+
pattern.test(element.href)
|
|
34
|
+
);
|
|
35
|
+
const isSelectButtonWithUrl = matchesUrlPattern;
|
|
36
|
+
|
|
37
|
+
if (isSelectButtonWithUrl) {
|
|
38
|
+
const oldHref = element.getAttribute("href");
|
|
39
|
+
|
|
40
|
+
const buttonText = element.textContent?.toLowerCase() || "";
|
|
41
|
+
// Check if button text contains variations of "floor plan" (case insensitive)
|
|
42
|
+
const finalLink = getMutatedApplicationLink(
|
|
43
|
+
buttonText,
|
|
44
|
+
newApplicationLink
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
element.setAttribute("href", finalLink);
|
|
48
|
+
totalReplacements++;
|
|
49
|
+
|
|
50
|
+
sendLoggingEvent({
|
|
51
|
+
logTitle: "SELECT_BUTTON_LINK_REPLACEMENT",
|
|
52
|
+
logData: {
|
|
53
|
+
type: "link-replacement",
|
|
54
|
+
oldHref,
|
|
55
|
+
newHref: finalLink,
|
|
56
|
+
website: window.location.href,
|
|
57
|
+
},
|
|
58
|
+
logType: LogType.info,
|
|
59
|
+
buildingSlug,
|
|
60
|
+
orgSlug,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (totalReplacements === 0) {
|
|
66
|
+
sendLoggingEvent({
|
|
67
|
+
logTitle: "SELECT_BUTTON_LINK_REPLACEMENT",
|
|
68
|
+
logData: {
|
|
69
|
+
type: "no-select-buttons-found",
|
|
70
|
+
website: window.location.href,
|
|
71
|
+
},
|
|
72
|
+
logType: LogType.warn,
|
|
73
|
+
buildingSlug,
|
|
74
|
+
orgSlug,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return totalReplacements;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const getMutatedApplicationLink = (
|
|
82
|
+
buttonText: string,
|
|
83
|
+
newApplicationLink: string
|
|
84
|
+
) => {
|
|
85
|
+
const relevantText = ["floor plan", "floorplan", "floor plans", "floorplans"];
|
|
86
|
+
if (relevantText.some((t) => buttonText.toLowerCase().includes(t))) {
|
|
87
|
+
return `${newApplicationLink}/units`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return newApplicationLink;
|
|
91
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
|
|
3
|
+
import { LogType, sendLoggingEvent } from "../../analytics";
|
|
4
|
+
import { camelize, snakify } from "../../utils";
|
|
5
|
+
import {
|
|
6
|
+
DesiredAddon,
|
|
7
|
+
DesiredRentableItem,
|
|
8
|
+
UnitFeeBundle,
|
|
9
|
+
} from "../../WebComponent/FeeCalculator/model";
|
|
10
|
+
import { FeeEstimate } from "../../WebComponent/FeeCalculator/model/unit-fee-bundle";
|
|
11
|
+
import { BASE_DOMAIN } from "../../globals";
|
|
12
|
+
|
|
13
|
+
type CalculateQuoteRequest = {
|
|
14
|
+
buildingSlug: string;
|
|
15
|
+
unitId: number;
|
|
16
|
+
addons: DesiredAddon[];
|
|
17
|
+
rentableItems: DesiredRentableItem[];
|
|
18
|
+
leaseTerm: number;
|
|
19
|
+
moveInDate: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type CalculateQuoteResponse = {
|
|
23
|
+
units: UnitFeeBundle[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const BASE_URL = BASE_DOMAIN;
|
|
27
|
+
|
|
28
|
+
export const calculateQuote = async ({
|
|
29
|
+
buildingSlug,
|
|
30
|
+
unitId,
|
|
31
|
+
addons,
|
|
32
|
+
rentableItems,
|
|
33
|
+
leaseTerm,
|
|
34
|
+
moveInDate,
|
|
35
|
+
}: CalculateQuoteRequest): Promise<CalculateQuoteResponse> => {
|
|
36
|
+
try {
|
|
37
|
+
const feesResponse = await axios.post(
|
|
38
|
+
`${BASE_URL}/platformApi/webchat/${buildingSlug}/fees/calculate`,
|
|
39
|
+
snakify({
|
|
40
|
+
unitId,
|
|
41
|
+
addons,
|
|
42
|
+
rentableItems,
|
|
43
|
+
leaseTerm,
|
|
44
|
+
moveInDate,
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
if (feesResponse.data) {
|
|
49
|
+
const data = camelize<CalculateQuoteResponse>(feesResponse.data);
|
|
50
|
+
return {
|
|
51
|
+
...data,
|
|
52
|
+
units: data.units.map((unit) => ({
|
|
53
|
+
...unit,
|
|
54
|
+
fees: unit.fees.map(toFeeEstimateClass),
|
|
55
|
+
})),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
} catch (error) {
|
|
59
|
+
sendLoggingEvent({
|
|
60
|
+
logType: LogType.error,
|
|
61
|
+
buildingSlug,
|
|
62
|
+
logTitle: "[ERROR_CALCULATING_QUOTE]",
|
|
63
|
+
logData: { error },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
units: [],
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const toFeeEstimateClass = (fee: FeeEstimate) => new FeeEstimate(fee);
|
|
73
|
+
|
|
74
|
+
export default calculateQuote;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { LogType, sendLoggingEvent } from "../../analytics";
|
|
3
|
+
import { BuildingFee } from "../../WebComponent/FeeCalculator/model/building-fee";
|
|
4
|
+
import { camelize } from "../../utils";
|
|
5
|
+
import { IncentiveV2 } from "../../types/incentive-v2";
|
|
6
|
+
import { RentableItemSummary } from "../../WebComponent/FeeCalculator/model/rentable-item-summary";
|
|
7
|
+
import { BASE_DOMAIN } from "../../globals";
|
|
8
|
+
|
|
9
|
+
const BASE_URL = BASE_DOMAIN;
|
|
10
|
+
|
|
11
|
+
type BuildingFeeResponse = {
|
|
12
|
+
fees: BuildingFee[];
|
|
13
|
+
rentableItems: RentableItemSummary[];
|
|
14
|
+
buildingIncentives: IncentiveV2[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const fetchBuildingFees = async (
|
|
18
|
+
buildingSlug: string
|
|
19
|
+
): Promise<BuildingFeeResponse> => {
|
|
20
|
+
try {
|
|
21
|
+
const feesResponse = await axios.get(
|
|
22
|
+
`${BASE_URL}/platformApi/webchat/${buildingSlug}/fees`
|
|
23
|
+
);
|
|
24
|
+
if (feesResponse.data) {
|
|
25
|
+
const data = camelize<BuildingFeeResponse>(feesResponse.data);
|
|
26
|
+
return {
|
|
27
|
+
fees: data.fees.map(toBuildingFeeClass),
|
|
28
|
+
rentableItems: data.rentableItems,
|
|
29
|
+
buildingIncentives: data.buildingIncentives,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
} catch (error) {
|
|
33
|
+
sendLoggingEvent({
|
|
34
|
+
logType: LogType.error,
|
|
35
|
+
buildingSlug,
|
|
36
|
+
logTitle: "[ERROR_GETTING_FEES]",
|
|
37
|
+
logData: { error },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
fees: [],
|
|
43
|
+
rentableItems: [],
|
|
44
|
+
buildingIncentives: [],
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const toBuildingFeeClass = (fee: BuildingFee) => new BuildingFee(fee);
|
|
49
|
+
|
|
50
|
+
export default fetchBuildingFees;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { LogType, sendLoggingEvent } from "../../analytics";
|
|
3
|
+
import { BASE_DOMAIN } from "../../globals";
|
|
4
|
+
import { camelize } from "../../utils";
|
|
5
|
+
import { IncentiveV2 } from "../../types/incentive-v2";
|
|
6
|
+
import { RentableItemSummary } from "../../WebComponent/FeeCalculator/model/rentable-item-summary";
|
|
7
|
+
import { BuildingFeeView } from "../../WebComponent/FeeCalculator/model/building-fee-view";
|
|
8
|
+
import QueryParamBuilder from "../../utils/queryParamBuilder";
|
|
9
|
+
|
|
10
|
+
const BASE_URL = BASE_DOMAIN;
|
|
11
|
+
|
|
12
|
+
type BuildingFeeResponse = {
|
|
13
|
+
fees: BuildingFeeView[];
|
|
14
|
+
rentableItems: RentableItemSummary[];
|
|
15
|
+
buildingIncentives: IncentiveV2[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const fetchBuildingFeesV2 = async (
|
|
19
|
+
buildingSlug: string,
|
|
20
|
+
layoutIds?: number[]
|
|
21
|
+
): Promise<BuildingFeeResponse> => {
|
|
22
|
+
try {
|
|
23
|
+
const params = new QueryParamBuilder().addArray(
|
|
24
|
+
"layout_ids",
|
|
25
|
+
layoutIds?.map((id) => id.toString())
|
|
26
|
+
);
|
|
27
|
+
const feesResponse = await axios.get(
|
|
28
|
+
`${BASE_URL}/platformApi/webchat/${buildingSlug}/fees?${params.build()}`
|
|
29
|
+
);
|
|
30
|
+
if (feesResponse.data) {
|
|
31
|
+
const data = camelize<BuildingFeeResponse>(feesResponse.data);
|
|
32
|
+
return {
|
|
33
|
+
fees: data.fees.map(toBuildingFeeClass),
|
|
34
|
+
rentableItems: data.rentableItems.map(toRentableItemSummary),
|
|
35
|
+
buildingIncentives: data.buildingIncentives,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
sendLoggingEvent({
|
|
40
|
+
logType: LogType.error,
|
|
41
|
+
buildingSlug,
|
|
42
|
+
logTitle: "[ERROR_GETTING_FEES]",
|
|
43
|
+
logData: { error },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
fees: [],
|
|
49
|
+
rentableItems: [],
|
|
50
|
+
buildingIncentives: [],
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const toBuildingFeeClass = (fee: BuildingFeeView) => new BuildingFeeView(fee);
|
|
55
|
+
|
|
56
|
+
const toRentableItemSummary = (item: RentableItemSummary) =>
|
|
57
|
+
new RentableItemSummary(item);
|
|
58
|
+
|
|
59
|
+
export default fetchBuildingFeesV2;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { LogType, sendLoggingEvent } from "../../analytics";
|
|
3
|
+
import { BASE_DOMAIN } from "../../globals";
|
|
4
|
+
import { camelize } from "../../utils";
|
|
5
|
+
|
|
6
|
+
export type Floorplan = {
|
|
7
|
+
unitId: number;
|
|
8
|
+
name: string;
|
|
9
|
+
bedrooms: number;
|
|
10
|
+
bathrooms: number;
|
|
11
|
+
numAvailable: number;
|
|
12
|
+
startingPrice: number;
|
|
13
|
+
maxPrice: number;
|
|
14
|
+
earliestAvailable: string;
|
|
15
|
+
latestAvailable: string;
|
|
16
|
+
squareFeet: number;
|
|
17
|
+
url: string | null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type FetchFloorplansParams = {
|
|
21
|
+
buildingSlug: string;
|
|
22
|
+
numBedrooms?: number;
|
|
23
|
+
moveInDateEarliest?: Date;
|
|
24
|
+
moveInDateLatest?: Date;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const fetchBuildingFloorplans = async ({
|
|
28
|
+
buildingSlug,
|
|
29
|
+
numBedrooms,
|
|
30
|
+
moveInDateEarliest,
|
|
31
|
+
moveInDateLatest,
|
|
32
|
+
}: FetchFloorplansParams): Promise<Floorplan[]> => {
|
|
33
|
+
try {
|
|
34
|
+
const params = new URLSearchParams();
|
|
35
|
+
if (numBedrooms) {
|
|
36
|
+
params.append("num_bedrooms", numBedrooms.toString());
|
|
37
|
+
}
|
|
38
|
+
if (moveInDateEarliest) {
|
|
39
|
+
params.append(
|
|
40
|
+
"move_in_date_earliest",
|
|
41
|
+
moveInDateEarliest.toISOString().split("T")[0]
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
if (moveInDateLatest) {
|
|
45
|
+
params.append(
|
|
46
|
+
"move_in_date_latest",
|
|
47
|
+
moveInDateLatest.toISOString().split("T")[0]
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const queryString = params.toString() ? `?${params.toString()}` : "";
|
|
52
|
+
const floorplansResponse = await axios.get(
|
|
53
|
+
`${BASE_DOMAIN}/platformApi/webchat/${buildingSlug}/floorplans${queryString}`
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
if (floorplansResponse.data) {
|
|
57
|
+
return camelize<Floorplan[]>(floorplansResponse.data);
|
|
58
|
+
}
|
|
59
|
+
} catch (error) {
|
|
60
|
+
sendLoggingEvent({
|
|
61
|
+
logType: LogType.error,
|
|
62
|
+
buildingSlug,
|
|
63
|
+
logTitle: "[ERROR_GETTING_FLOORPLANS]",
|
|
64
|
+
logData: {
|
|
65
|
+
error,
|
|
66
|
+
params: { numBedrooms, moveInDateEarliest, moveInDateLatest },
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return [];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default fetchBuildingFloorplans;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { LogType, sendLoggingEvent } from "../../analytics";
|
|
3
|
+
import { BASE_DOMAIN } from "../../globals";
|
|
4
|
+
import { camelize } from "../../utils";
|
|
5
|
+
import QueryParamBuilder from "../../utils/queryParamBuilder";
|
|
6
|
+
|
|
7
|
+
const BASE_URL = BASE_DOMAIN;
|
|
8
|
+
|
|
9
|
+
export type Unit = {
|
|
10
|
+
/**
|
|
11
|
+
* ID comes back in the format "u1234567890" - we strip the "u"
|
|
12
|
+
*/
|
|
13
|
+
id: number;
|
|
14
|
+
unitNumber: string;
|
|
15
|
+
layout: number;
|
|
16
|
+
externalFloorPlanDescriptionId: string;
|
|
17
|
+
numberOfBedrooms: number;
|
|
18
|
+
numberOfBathrooms: number;
|
|
19
|
+
squareFootage: number;
|
|
20
|
+
floor: number;
|
|
21
|
+
floorplanName: string;
|
|
22
|
+
floorplanUrl: string;
|
|
23
|
+
availabilityStage: string;
|
|
24
|
+
earliestAvailable: string;
|
|
25
|
+
latestAvailable: string;
|
|
26
|
+
startingPrice: number;
|
|
27
|
+
maxPrice: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type FetchPropertyUnitsParams = {
|
|
31
|
+
buildingSlug: string;
|
|
32
|
+
numBedrooms?: number;
|
|
33
|
+
moveInDateEarliest?: Date;
|
|
34
|
+
moveInDateLatest?: Date;
|
|
35
|
+
leaseTermMin?: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const fetchBuildingUnits = async ({
|
|
39
|
+
buildingSlug,
|
|
40
|
+
numBedrooms,
|
|
41
|
+
moveInDateEarliest,
|
|
42
|
+
moveInDateLatest,
|
|
43
|
+
leaseTermMin,
|
|
44
|
+
}: FetchPropertyUnitsParams): Promise<Unit[]> => {
|
|
45
|
+
try {
|
|
46
|
+
const queryParamBuilder = new QueryParamBuilder();
|
|
47
|
+
queryParamBuilder
|
|
48
|
+
.addSingle("num_bedrooms", numBedrooms?.toString())
|
|
49
|
+
.addSingle(
|
|
50
|
+
"move_in_date_earliest",
|
|
51
|
+
moveInDateEarliest?.toISOString().split("T")[0]
|
|
52
|
+
)
|
|
53
|
+
.addSingle(
|
|
54
|
+
"move_in_date_latest",
|
|
55
|
+
moveInDateLatest?.toISOString().split("T")[0]
|
|
56
|
+
)
|
|
57
|
+
.addSingle("lease_term_min", leaseTermMin?.toString());
|
|
58
|
+
|
|
59
|
+
const queryString = queryParamBuilder.build();
|
|
60
|
+
const propertyUnitsResponse = await axios.get(
|
|
61
|
+
`${BASE_URL}/platformApi/webchat/${buildingSlug}/units${queryString}`
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (propertyUnitsResponse.data) {
|
|
65
|
+
const camelizedUnits = camelize<Unit[]>(propertyUnitsResponse.data);
|
|
66
|
+
return camelizedUnits.map((unit) => ({
|
|
67
|
+
...unit,
|
|
68
|
+
id: parseInt(unit.id.toString().substring(1)),
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
} catch (error) {
|
|
72
|
+
sendLoggingEvent({
|
|
73
|
+
logType: LogType.error,
|
|
74
|
+
buildingSlug,
|
|
75
|
+
logTitle: "[ERROR_GETTING_UNITS]",
|
|
76
|
+
logData: {
|
|
77
|
+
error,
|
|
78
|
+
params: { numBedrooms, moveInDateEarliest, moveInDateLatest },
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return [];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export default fetchBuildingUnits;
|
package/src/svgIcons.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { svg } from "lit";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* TODO(erol): PLEASE MOVE INTO EACH OWN ICON FILE UNDER /ICONS
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const CheckboxEmpty = svg`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8
|
+
<rect x="1" y="1" width="22" height="22" stroke="black" stroke-width="2" rx="2"/>
|
|
9
|
+
</svg>
|
|
10
|
+
`;
|
|
11
|
+
export const CheckboxChecked = svg`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
|
|
12
|
+
<rect y="0.09375" width="16" height="16" rx="2" fill="#4719CD"/>
|
|
13
|
+
<path d="M12 5.09375L6.5 10.5938L4 8.09375" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
|
+
</svg>`;
|
package/src/themes.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export const defaultPrimaryColor = "#646987"; // we have a brand color defined in the BE too, but this is a fallback
|
|
2
|
+
export const defaultBackgroundColor = "#ffffff"; // default background color for the chat widget
|
|
3
|
+
|
|
4
|
+
export const tintColor = (
|
|
5
|
+
originalColor: string,
|
|
6
|
+
tintOpacity: number
|
|
7
|
+
): string => {
|
|
8
|
+
const originalRgb = hexToRgb(originalColor);
|
|
9
|
+
const tintRgb = { r: 0, g: 0, b: 0 };
|
|
10
|
+
|
|
11
|
+
const newRgb = {
|
|
12
|
+
r: originalRgb.r + Math.round((tintRgb.r - originalRgb.r) * tintOpacity),
|
|
13
|
+
g: originalRgb.g + Math.round((tintRgb.g - originalRgb.g) * tintOpacity),
|
|
14
|
+
b: originalRgb.b + Math.round((tintRgb.b - originalRgb.b) * tintOpacity),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const hexToRgb = (hex: string): { r: number; g: number; b: number } => {
|
|
21
|
+
const r = parseInt(hex.substring(1, 3), 16);
|
|
22
|
+
const g = parseInt(hex.substring(3, 5), 16);
|
|
23
|
+
const b = parseInt(hex.substring(5, 7), 16);
|
|
24
|
+
return { r, g, b };
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const rgbToHex = (r: number, g: number, b: number): string => {
|
|
28
|
+
return (
|
|
29
|
+
"#" +
|
|
30
|
+
[r, g, b]
|
|
31
|
+
.map((c) => {
|
|
32
|
+
const hex = c.toString(16);
|
|
33
|
+
return hex.length === 1 ? "0" + hex : hex;
|
|
34
|
+
})
|
|
35
|
+
.join("")
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const hexToAlmostWhite = (hexColor: string, ratio: number): string => {
|
|
40
|
+
let r = parseInt(hexColor.substr(1, 2), 16);
|
|
41
|
+
let g = parseInt(hexColor.substr(3, 2), 16);
|
|
42
|
+
let b = parseInt(hexColor.substr(5, 2), 16);
|
|
43
|
+
|
|
44
|
+
// the ratio of white to add (1 = white, 0 = no change)
|
|
45
|
+
r = Math.round(r * (1 - ratio) + 255 * ratio);
|
|
46
|
+
g = Math.round(g * (1 - ratio) + 255 * ratio);
|
|
47
|
+
b = Math.round(b * (1 - ratio) + 255 * ratio);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
"#" +
|
|
51
|
+
r.toString(16).padStart(2, "0") +
|
|
52
|
+
g.toString(16).padStart(2, "0") +
|
|
53
|
+
b.toString(16).padStart(2, "0")
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const shouldUsePrimaryColorForChatFooter = (
|
|
58
|
+
orgId: number,
|
|
59
|
+
buildingId: number
|
|
60
|
+
): boolean => {
|
|
61
|
+
// Some clients are complaining that we are NOT ADA compliant with our black, default chat footer
|
|
62
|
+
// So we are temporarily adding this flag to allow them to use their brand color for the chat footer
|
|
63
|
+
// Don't want to suddenly change it for our clients so added this flag
|
|
64
|
+
return orgId === 2 || buildingId === 70392;
|
|
65
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type UnitData = {
|
|
2
|
+
unitIds: number[];
|
|
3
|
+
unitNumbers: string[];
|
|
4
|
+
layouts: number[];
|
|
5
|
+
floorplanNames: string[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type IncentiveV2 = {
|
|
9
|
+
id: number;
|
|
10
|
+
originalIncentiveString: string;
|
|
11
|
+
startDate: Date;
|
|
12
|
+
endDate: Date;
|
|
13
|
+
incentiveStatus: string;
|
|
14
|
+
source: string;
|
|
15
|
+
timeCreated: Date;
|
|
16
|
+
nofee: boolean;
|
|
17
|
+
numberOfFreeMonths: number;
|
|
18
|
+
leaseLength: number;
|
|
19
|
+
typeOfCustomerItAppliesTo: number;
|
|
20
|
+
typeOfIncentive: number;
|
|
21
|
+
numberOfMonthsOwnerPays: number;
|
|
22
|
+
unitData: UnitData;
|
|
23
|
+
qualifier: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redeclare enum from rest-sdk to avoid pulling in entire module.
|
|
3
|
+
*/
|
|
4
|
+
export enum TourAvailabilityResponseRankOrderedSupportedTourTypesEnum {
|
|
5
|
+
Unknown = "UNKNOWN",
|
|
6
|
+
SelfGuided = "SELF_GUIDED",
|
|
7
|
+
VirtualShowing = "VIRTUAL_SHOWING",
|
|
8
|
+
WithAgent = "WITH_AGENT",
|
|
9
|
+
MediaTour = "MEDIA_TOUR",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Types are safe to re-export as they are not included in runtime code.
|
|
13
|
+
export type { TourAvailabilityResponse } from "@meetelise/rest-sdk";
|