@meetelise/chat 1.34.2 → 1.34.4
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/package.json +1 -1
- package/public/dist/index.js +1 -1
- package/dist/src/MyPubnub.d.ts +0 -116
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.d.ts +0 -28
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.d.ts +0 -22
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +0 -46
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-card/fee-card.d.ts +0 -21
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +0 -34
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.d.ts +0 -8
- package/dist/src/WebComponent/FeeCalculator/components/incentive-banner/index.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +0 -5
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/constants.d.ts +0 -3
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +0 -55
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +0 -2
- package/dist/src/WebComponent/FeeCalculator/model/building-fee-view.d.ts +0 -41
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +0 -82
- package/dist/src/WebComponent/FeeCalculator/model/desired-addon.d.ts +0 -5
- package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +0 -4
- package/dist/src/WebComponent/FeeCalculator/model/index.d.ts +0 -13
- package/dist/src/WebComponent/FeeCalculator/model/item-combination.d.ts +0 -6
- package/dist/src/WebComponent/FeeCalculator/model/item-quantity.d.ts +0 -4
- package/dist/src/WebComponent/FeeCalculator/model/pricing-matrix.d.ts +0 -18
- package/dist/src/WebComponent/FeeCalculator/model/pricing-rule.d.ts +0 -8
- package/dist/src/WebComponent/FeeCalculator/model/rent-frequency.d.ts +0 -1
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +0 -9
- package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +0 -9
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +0 -23
- package/dist/src/WebComponent/FeeCalculator/model/unit-fee-bundle.d.ts +0 -31
- package/dist/src/WebComponent/LeadSourceClient.d.ts +0 -46
- package/dist/src/WebComponent/OfficeHours.d.ts +0 -21
- package/dist/src/WebComponent/Scheduler/date-picker.d.ts +0 -28
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +0 -14
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +0 -101
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +0 -13
- package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +0 -1
- package/dist/src/WebComponent/actions/InputStyles.d.ts +0 -1
- package/dist/src/WebComponent/actions/action-confirm-button.d.ts +0 -13
- package/dist/src/WebComponent/actions/call-us-window.d.ts +0 -37
- package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +0 -8
- package/dist/src/WebComponent/actions/details-window.d.ts +0 -14
- package/dist/src/WebComponent/actions/email-us-window.d.ts +0 -46
- package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +0 -17
- package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +0 -8
- package/dist/src/WebComponent/chat-additional-actions.d.ts +0 -28
- package/dist/src/WebComponent/health-chat.d.ts +0 -47
- package/dist/src/WebComponent/healthchat-styles.d.ts +0 -1
- package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +0 -7
- package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +0 -3
- package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +0 -2
- package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +0 -2
- package/dist/src/WebComponent/index.d.ts +0 -2
- package/dist/src/WebComponent/launcher/Launcher.d.ts +0 -99
- package/dist/src/WebComponent/launcher/launcherStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +0 -27
- package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +0 -1
- package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +0 -1
- package/dist/src/WebComponent/leasing-chat-styles.d.ts +0 -1
- package/dist/src/WebComponent/loaders/index.d.ts +0 -4
- package/dist/src/WebComponent/loaders/mega-loader.d.ts +0 -7
- package/dist/src/WebComponent/loaders/skeleton-card.d.ts +0 -12
- package/dist/src/WebComponent/loaders/skeleton-loader-styles.d.ts +0 -3
- package/dist/src/WebComponent/loaders/skeleton-loader.d.ts +0 -13
- package/dist/src/WebComponent/me-chat.d.ts +0 -91
- package/dist/src/WebComponent/me-select.d.ts +0 -24
- package/dist/src/WebComponent/mini-loader.d.ts +0 -5
- package/dist/src/WebComponent/pubnub-chat-styles.d.ts +0 -1
- package/dist/src/WebComponent/pubnub-chat.d.ts +0 -49
- package/dist/src/WebComponent/pubnub-media.d.ts +0 -14
- package/dist/src/WebComponent/pubnub-message-styles.d.ts +0 -1
- package/dist/src/WebComponent/pubnub-message.d.ts +0 -39
- package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +0 -1
- package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +0 -12
- package/dist/src/WebComponent/utilities-chat.d.ts +0 -47
- package/dist/src/WebComponent/utilities-styles.d.ts +0 -1
- package/dist/src/WebComponent/utils.d.ts +0 -31
- package/dist/src/analytics.d.ts +0 -64
- package/dist/src/disclaimers.d.ts +0 -9
- package/dist/src/fetchBuildingABTestType.d.ts +0 -8
- package/dist/src/fetchBuildingInfo.d.ts +0 -57
- package/dist/src/fetchBuildingWebchatView.d.ts +0 -124
- package/dist/src/fetchFeatureFlag.d.ts +0 -14
- package/dist/src/fetchLeadSources.d.ts +0 -4
- package/dist/src/fetchPhoneNumberFromSource.d.ts +0 -6
- package/dist/src/getAvailabilities.d.ts +0 -45
- package/dist/src/getBuildingPhoneNumber.d.ts +0 -1
- package/dist/src/getShouldAllowScheduling.d.ts +0 -1
- package/dist/src/getShouldShowWebchat.d.ts +0 -3
- package/dist/src/getTimezoneString.d.ts +0 -1
- package/dist/src/globals.d.ts +0 -2
- package/dist/src/gtm.d.ts +0 -6
- package/dist/src/handleChatId.d.ts +0 -11
- package/dist/src/insertDNIIntoWebsite.d.ts +0 -5
- package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +0 -4
- package/dist/src/main/MEChat.d.ts +0 -74
- package/dist/src/main/utils.d.ts +0 -2
- package/dist/src/postLeadSources.d.ts +0 -3
- package/dist/src/rentgrata.d.ts +0 -4
- package/dist/src/replaceSelectButtonsWithNewLink.d.ts +0 -5
- package/dist/src/services/fees/calculateQuote.d.ts +0 -14
- package/dist/src/services/fees/fetchBuildingFeesV2.d.ts +0 -10
- package/dist/src/services/fees/fetchBuildingUnits.d.ts +0 -29
- package/dist/src/services/fees/utils.d.ts +0 -1
- package/dist/src/svgIcons.d.ts +0 -5
- package/dist/src/themes.d.ts +0 -5
- package/dist/src/types/incentive-v2.d.ts +0 -23
- package/dist/src/types/rest-sdk.types.d.ts +0 -11
- package/dist/src/types/webchat-no-show-reason.d.ts +0 -1
- package/dist/src/utils/queryParamBuilder.d.ts +0 -8
- package/dist/src/utils.d.ts +0 -13
- package/src/MyPubnub.ts +0 -792
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +0 -35
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector.ts +0 -206
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector-styles.ts +0 -6
- package/src/WebComponent/FeeCalculator/components/addons/addon-item-qty-selector/addon-item-qty-selector.ts +0 -101
- package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +0 -82
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector-styles.ts +0 -9
- package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +0 -124
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +0 -142
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +0 -243
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card-styles.ts +0 -65
- package/src/WebComponent/FeeCalculator/components/fee-card/fee-card.ts +0 -91
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -44
- package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -38
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -151
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -248
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +0 -82
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +0 -76
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner-styles.ts +0 -40
- package/src/WebComponent/FeeCalculator/components/incentive-banner/incentive-banner.ts +0 -43
- package/src/WebComponent/FeeCalculator/components/incentive-banner/index.ts +0 -1
- package/src/WebComponent/FeeCalculator/components/index.ts +0 -5
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
- package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
- package/src/WebComponent/FeeCalculator/constants.ts +0 -5
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -310
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -341
- package/src/WebComponent/FeeCalculator/index.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/building-fee-view.ts +0 -84
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -126
- package/src/WebComponent/FeeCalculator/model/desired-addon.ts +0 -6
- package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/index.ts +0 -13
- package/src/WebComponent/FeeCalculator/model/item-combination.ts +0 -16
- package/src/WebComponent/FeeCalculator/model/item-quantity.ts +0 -4
- package/src/WebComponent/FeeCalculator/model/pricing-matrix.ts +0 -45
- package/src/WebComponent/FeeCalculator/model/pricing-rule.ts +0 -9
- package/src/WebComponent/FeeCalculator/model/rent-frequency.ts +0 -1
- package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +0 -10
- package/src/WebComponent/FeeCalculator/model/rentable-item.ts +0 -10
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
- package/src/WebComponent/FeeCalculator/model/unit-fee-bundle.ts +0 -54
- package/src/WebComponent/LeadSourceClient.ts +0 -332
- package/src/WebComponent/MEChat.css +0 -5
- package/src/WebComponent/OfficeHours.ts +0 -73
- package/src/WebComponent/Scheduler/date-picker.ts +0 -405
- package/src/WebComponent/Scheduler/time-picker.ts +0 -190
- package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1416
- package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
- package/src/WebComponent/actions/InputStyles.ts +0 -57
- package/src/WebComponent/actions/action-confirm-button.ts +0 -125
- package/src/WebComponent/actions/call-us-window.ts +0 -467
- package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
- package/src/WebComponent/actions/details-window.ts +0 -150
- package/src/WebComponent/actions/email-us-window.ts +0 -556
- package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
- package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
- package/src/WebComponent/chat-additional-actions.ts +0 -135
- package/src/WebComponent/health-chat.ts +0 -270
- package/src/WebComponent/healthchat-styles.ts +0 -119
- package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
- package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
- package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
- package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
- package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
- package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
- package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
- package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -26
- package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
- package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
- package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
- package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
- package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
- package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
- package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
- package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
- package/src/WebComponent/index.ts +0 -2
- package/src/WebComponent/launcher/Launcher.ts +0 -1284
- package/src/WebComponent/launcher/launcherStyles.ts +0 -500
- package/src/WebComponent/launcher/mobile-launcher.ts +0 -162
- package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
- package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
- package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
- package/src/WebComponent/leasing-chat-styles.ts +0 -114
- package/src/WebComponent/loaders/index.ts +0 -7
- package/src/WebComponent/loaders/mega-loader.ts +0 -36
- package/src/WebComponent/loaders/skeleton-card.ts +0 -31
- package/src/WebComponent/loaders/skeleton-loader-styles.ts +0 -112
- package/src/WebComponent/loaders/skeleton-loader.ts +0 -34
- package/src/WebComponent/me-chat.ts +0 -1261
- package/src/WebComponent/me-select.ts +0 -322
- package/src/WebComponent/mini-loader.ts +0 -28
- package/src/WebComponent/pubnub-chat-styles.ts +0 -204
- package/src/WebComponent/pubnub-chat.ts +0 -928
- package/src/WebComponent/pubnub-media.ts +0 -208
- package/src/WebComponent/pubnub-message-styles.ts +0 -54
- package/src/WebComponent/pubnub-message.ts +0 -431
- package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
- package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
- package/src/WebComponent/utilities-chat.ts +0 -270
- package/src/WebComponent/utilities-styles.ts +0 -110
- package/src/WebComponent/utils.ts +0 -82
- package/src/analytics.ts +0 -217
- package/src/assetUrls.ts +0 -6
- package/src/disclaimers.ts +0 -86
- package/src/fetchBuildingABTestType.ts +0 -21
- package/src/fetchBuildingInfo.ts +0 -87
- package/src/fetchBuildingWebchatView.ts +0 -176
- package/src/fetchFeatureFlag.ts +0 -250
- package/src/fetchLeadSources.ts +0 -98
- package/src/fetchPhoneNumberFromSource.ts +0 -31
- package/src/fetchWebchatPreferences.ts +0 -54
- package/src/getAvailabilities.ts +0 -179
- package/src/getBuildingPhoneNumber.ts +0 -26
- package/src/getShouldAllowScheduling.ts +0 -16
- package/src/getShouldShowWebchat.ts +0 -114
- package/src/getTimezoneString.ts +0 -39
- package/src/globals.ts +0 -3
- package/src/gtm.ts +0 -17
- package/src/handleChatId.ts +0 -101
- package/src/insertDNIIntoWebsite.ts +0 -146
- package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
- package/src/main/MEChat.test.ts +0 -110
- package/src/main/MEChat.ts +0 -404
- package/src/main/utils.ts +0 -70
- package/src/postLeadSources.ts +0 -44
- package/src/rentgrata.ts +0 -74
- package/src/replaceSelectButtonsWithNewLink.ts +0 -90
- package/src/services/fees/calculateQuote.ts +0 -74
- package/src/services/fees/fetchBuildingFees.ts +0 -50
- package/src/services/fees/fetchBuildingFeesV2.ts +0 -56
- package/src/services/fees/fetchBuildingFloorplans.ts +0 -74
- package/src/services/fees/fetchBuildingUnits.ts +0 -86
- package/src/services/fees/utils.ts +0 -4
- package/src/svgIcons.ts +0 -14
- package/src/themes.ts +0 -65
- package/src/types/incentive-v2.ts +0 -24
- package/src/types/rest-sdk.types.ts +0 -13
- package/src/types/webchat-no-show-reason.ts +0 -6
- package/src/utils/queryParamBuilder.ts +0 -28
- package/src/utils.ts +0 -121
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
-
import { customElement, property, query, state } from "lit/decorators.js";
|
|
3
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
-
import { createRef, ref, Ref } from "lit/directives/ref.js";
|
|
5
|
-
import { installActionConfirmButton } from "./action-confirm-button";
|
|
6
|
-
import { installDetailsWindow } from "./details-window";
|
|
7
|
-
import "../me-select.ts";
|
|
8
|
-
import { MESelect } from "../me-select";
|
|
9
|
-
import {
|
|
10
|
-
formatToPhoneInput,
|
|
11
|
-
isModifierKey,
|
|
12
|
-
isNumericInput,
|
|
13
|
-
} from "./formatPhoneNumber";
|
|
14
|
-
import { InputStyles } from "./InputStyles";
|
|
15
|
-
import axios from "axios";
|
|
16
|
-
import { FeatureFlagsShowDropdown } from "../../fetchFeatureFlag";
|
|
17
|
-
import { pushGtmEvent } from "../../gtm";
|
|
18
|
-
import disclaimer from "../../disclaimers";
|
|
19
|
-
import { isMobile } from "../../utils";
|
|
20
|
-
import LeadSourceClient, {
|
|
21
|
-
getDefaultLeadSourceAttribution,
|
|
22
|
-
} from "../LeadSourceClient";
|
|
23
|
-
|
|
24
|
-
@customElement("email-us-window")
|
|
25
|
-
export class EmailUsWindow extends LitElement {
|
|
26
|
-
static styles = [
|
|
27
|
-
css`
|
|
28
|
-
.email-us__name-input,
|
|
29
|
-
.email-us__contact_input,
|
|
30
|
-
.email-us_message-input {
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
text-overflow: ellipsis;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.email-us__name-input {
|
|
37
|
-
width: 50%;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.email-us__name-wrapper {
|
|
41
|
-
display: flex;
|
|
42
|
-
gap: 4px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.email-us__contact-input {
|
|
46
|
-
width: 100%;
|
|
47
|
-
width: -webkit-fill-available;
|
|
48
|
-
width: -moz-available;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.email-us__vertical-spacer {
|
|
52
|
-
margin-top: 8px;
|
|
53
|
-
margin-bottom: 8px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.action-bttn-container {
|
|
57
|
-
margin-top: 19px;
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: flex-end;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.email-us__message-input {
|
|
63
|
-
resize: none;
|
|
64
|
-
width: 100%;
|
|
65
|
-
width: -webkit-fill-available;
|
|
66
|
-
width: -moz-available;
|
|
67
|
-
height: 159px;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.email-us__submitted-info {
|
|
71
|
-
font-size: 18px;
|
|
72
|
-
line-height: 24px;
|
|
73
|
-
color: #202020;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.email-us__error-text {
|
|
77
|
-
margin-top: 4px;
|
|
78
|
-
font-family: "Helvetica", Arial;
|
|
79
|
-
font-style: normal;
|
|
80
|
-
font-weight: 400;
|
|
81
|
-
font-size: 12px;
|
|
82
|
-
line-height: 14px;
|
|
83
|
-
|
|
84
|
-
color: rgb(235, 64, 52);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.email-us__center_icon {
|
|
88
|
-
display: flex;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
@media screen and (max-width: 767px) {
|
|
93
|
-
.email-us__name-input {
|
|
94
|
-
width: 50%;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
`,
|
|
98
|
-
InputStyles,
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
@property({ attribute: false })
|
|
102
|
-
leadSources: string[] = [];
|
|
103
|
-
|
|
104
|
-
@property({ attribute: false })
|
|
105
|
-
onCloseClicked?: (e: MouseEvent) => void;
|
|
106
|
-
|
|
107
|
-
@property({ attribute: true })
|
|
108
|
-
chatId = "";
|
|
109
|
-
@property({ attribute: false })
|
|
110
|
-
buildingId = 0;
|
|
111
|
-
@property({ attribute: true })
|
|
112
|
-
buildingSlug = "";
|
|
113
|
-
@property({ attribute: true })
|
|
114
|
-
orgSlug = "";
|
|
115
|
-
@property({ attribute: true })
|
|
116
|
-
buildingName = "";
|
|
117
|
-
@property({ attribute: true })
|
|
118
|
-
orgLegalName = "";
|
|
119
|
-
|
|
120
|
-
@property({ attribute: true })
|
|
121
|
-
private leadSourceClient: LeadSourceClient | null = null;
|
|
122
|
-
|
|
123
|
-
@property({ attribute: true })
|
|
124
|
-
featureFlagShowDropdown = "";
|
|
125
|
-
|
|
126
|
-
phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
|
|
127
|
-
|
|
128
|
-
@property()
|
|
129
|
-
privatePolicyUrl = "https://www.meetelise.com/privacy";
|
|
130
|
-
@property()
|
|
131
|
-
termsOfServiceUrl = "_blank";
|
|
132
|
-
|
|
133
|
-
@state()
|
|
134
|
-
firstName = "";
|
|
135
|
-
@state()
|
|
136
|
-
lastName = "";
|
|
137
|
-
@state()
|
|
138
|
-
email = "";
|
|
139
|
-
@state()
|
|
140
|
-
phoneNumber = "";
|
|
141
|
-
@state()
|
|
142
|
-
message = "";
|
|
143
|
-
|
|
144
|
-
@query("me-select#leadSource")
|
|
145
|
-
selectedLeadSource!: MESelect;
|
|
146
|
-
|
|
147
|
-
@property({ attribute: true })
|
|
148
|
-
currentLeadSource = ""; // the default lead source based on referrer and query params
|
|
149
|
-
|
|
150
|
-
@state()
|
|
151
|
-
hasNameError = false;
|
|
152
|
-
@state()
|
|
153
|
-
hasEmailError = false;
|
|
154
|
-
@state()
|
|
155
|
-
hasPhoneNumberError = false;
|
|
156
|
-
@state()
|
|
157
|
-
hasMessageError = false;
|
|
158
|
-
@state()
|
|
159
|
-
hasSubmittedForm = false;
|
|
160
|
-
@state()
|
|
161
|
-
windowHeight = 525;
|
|
162
|
-
@state()
|
|
163
|
-
hasSubmissionError = false;
|
|
164
|
-
@state()
|
|
165
|
-
isSubmitting = false;
|
|
166
|
-
|
|
167
|
-
onChangeFirstName = (e: Event): void => {
|
|
168
|
-
if (!e.target) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
this.firstName = (e.target as HTMLInputElement).value;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
onChangeLastName = (e: Event): void => {
|
|
176
|
-
if (!e.target) {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
this.lastName = (e.target as HTMLInputElement).value;
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
onChangeEmail = (e: Event): void => {
|
|
184
|
-
if (!e.target) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
this.email = (e.target as HTMLInputElement).value;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
onChangePhoneNumber = (e: Event): void => {
|
|
192
|
-
if (!e.target || !this.phoneNumberInputRef.value) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (isModifierKey(e as KeyboardEvent)) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
const inputElement = e.target as HTMLInputElement;
|
|
199
|
-
|
|
200
|
-
this.phoneNumber = formatToPhoneInput(inputElement.value);
|
|
201
|
-
|
|
202
|
-
this.phoneNumberInputRef.value.value = this.phoneNumber;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
onChangeMessage = (e: Event): void => {
|
|
206
|
-
if (!e.target) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
this.message = (e.target as HTMLTextAreaElement).value;
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
enforceFormat = (e: KeyboardEvent): void => {
|
|
214
|
-
if (!isNumericInput(e) && !isModifierKey(e)) {
|
|
215
|
-
e.preventDefault();
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
validateFormFields = (): void => {
|
|
220
|
-
this.hasNameError = false;
|
|
221
|
-
this.hasEmailError = false;
|
|
222
|
-
this.hasPhoneNumberError = false;
|
|
223
|
-
this.hasMessageError = false;
|
|
224
|
-
this.hasSubmissionError = false;
|
|
225
|
-
if (!this.firstName || !this.lastName) {
|
|
226
|
-
this.hasNameError = true;
|
|
227
|
-
}
|
|
228
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
229
|
-
if (!this.email || !emailRegex.test(this.email)) {
|
|
230
|
-
this.hasEmailError = true;
|
|
231
|
-
}
|
|
232
|
-
if (!this.phoneNumber || this.phoneNumber.length !== 14) {
|
|
233
|
-
this.hasPhoneNumberError = true;
|
|
234
|
-
}
|
|
235
|
-
this.windowHeight = 525 + 30 * this.getNumErrors();
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
onClick = async (): Promise<void> => {
|
|
239
|
-
if (this.isSubmitting) {
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
this.validateFormFields();
|
|
243
|
-
if (
|
|
244
|
-
this.hasNameError ||
|
|
245
|
-
this.hasEmailError ||
|
|
246
|
-
this.hasPhoneNumberError ||
|
|
247
|
-
this.hasMessageError
|
|
248
|
-
) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
this.isSubmitting = true;
|
|
253
|
-
// Height of the button when it's in the loading state
|
|
254
|
-
this.windowHeight = 525 + 60;
|
|
255
|
-
const parsedLeadSource =
|
|
256
|
-
this.selectedLeadSource && this.selectedLeadSource.value
|
|
257
|
-
? this.selectedLeadSource.value
|
|
258
|
-
: this.currentLeadSource;
|
|
259
|
-
await createEmail(
|
|
260
|
-
this.firstName,
|
|
261
|
-
this.lastName,
|
|
262
|
-
this.email,
|
|
263
|
-
this.phoneNumber,
|
|
264
|
-
this.message,
|
|
265
|
-
this.buildingId,
|
|
266
|
-
this.orgSlug,
|
|
267
|
-
this.buildingSlug,
|
|
268
|
-
[
|
|
269
|
-
...new Set(
|
|
270
|
-
parsedLeadSource
|
|
271
|
-
? [
|
|
272
|
-
parsedLeadSource,
|
|
273
|
-
getDefaultLeadSourceAttribution(this.orgSlug),
|
|
274
|
-
]
|
|
275
|
-
: [getDefaultLeadSourceAttribution(this.orgSlug)]
|
|
276
|
-
),
|
|
277
|
-
],
|
|
278
|
-
this.leadSourceClient?.chatId
|
|
279
|
-
);
|
|
280
|
-
this.leadSourceClient?.checkAndHandleForLogLeadSource({
|
|
281
|
-
webchatAction: "email-us",
|
|
282
|
-
stateId: null,
|
|
283
|
-
});
|
|
284
|
-
this.hasSubmittedForm = true;
|
|
285
|
-
this.isSubmitting = false;
|
|
286
|
-
// Remove the height of the button when it leaves the loading state
|
|
287
|
-
this.windowHeight = 525;
|
|
288
|
-
} catch (e) {
|
|
289
|
-
this.hasSubmissionError = true;
|
|
290
|
-
this.isSubmitting = false;
|
|
291
|
-
// Remove the height of the button when it leaves the loading state
|
|
292
|
-
this.windowHeight = 525;
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
getNumErrors = (): number => {
|
|
297
|
-
return [
|
|
298
|
-
this.hasNameError,
|
|
299
|
-
this.hasEmailError,
|
|
300
|
-
this.hasPhoneNumberError,
|
|
301
|
-
this.hasMessageError,
|
|
302
|
-
this.hasSubmissionError,
|
|
303
|
-
].filter((v) => v).length;
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
render = (): TemplateResult => {
|
|
307
|
-
installDetailsWindow();
|
|
308
|
-
installActionConfirmButton();
|
|
309
|
-
|
|
310
|
-
if (this.hasSubmittedForm) {
|
|
311
|
-
return html`
|
|
312
|
-
<details-window
|
|
313
|
-
id="details-window"
|
|
314
|
-
headerText=""
|
|
315
|
-
useGradientDesign="true"
|
|
316
|
-
.onCloseClick=${this.onCloseClicked}
|
|
317
|
-
>
|
|
318
|
-
<div class="email-us-wrapper">
|
|
319
|
-
<div class="email-us__vertical-spacer"></div>
|
|
320
|
-
<div class="email-us__center_icon">
|
|
321
|
-
<svg
|
|
322
|
-
width="22"
|
|
323
|
-
height="18"
|
|
324
|
-
viewBox="0 0 22 18"
|
|
325
|
-
fill="none"
|
|
326
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
327
|
-
>
|
|
328
|
-
<path
|
|
329
|
-
d="M22 17.007C21.9982 17.2696 21.8931 17.521 21.7075 17.7068C21.5219 17.8926 21.2706 17.9979 21.008 18H2.992C2.72881 17.9997 2.4765 17.895 2.29049 17.7088C2.10448 17.5226 2 17.2702 2 17.007V16H20V4.3L12 11.5L2 2.5V1C2 0.734784 2.10536 0.48043 2.29289 0.292893C2.48043 0.105357 2.73478 0 3 0H21C21.2652 0 21.5196 0.105357 21.7071 0.292893C21.8946 0.48043 22 0.734784 22 1V17.007ZM4.434 2L12 8.81L19.566 2H4.434ZM0 12H8V14H0V12ZM0 7H5V9H0V7Z"
|
|
330
|
-
fill="#202020"
|
|
331
|
-
/>
|
|
332
|
-
</svg>
|
|
333
|
-
</div>
|
|
334
|
-
<div class="email-us__vertical-spacer"></div>
|
|
335
|
-
<div class="email-us__submitted-info">
|
|
336
|
-
Thank you for your message. A member of our leasing team will
|
|
337
|
-
contact you.
|
|
338
|
-
</div>
|
|
339
|
-
</div>
|
|
340
|
-
</details-window>
|
|
341
|
-
`;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
return html`
|
|
345
|
-
<details-window
|
|
346
|
-
id="details-window"
|
|
347
|
-
headerText="Email Our Leasing Team"
|
|
348
|
-
.onCloseClick=${this.onCloseClicked}
|
|
349
|
-
height="${this.windowHeight}px"
|
|
350
|
-
>
|
|
351
|
-
<div class="email-us-wrapper" id="email-us-form">
|
|
352
|
-
<div class="email-us__name-wrapper">
|
|
353
|
-
<input
|
|
354
|
-
type="text"
|
|
355
|
-
class=${classMap({
|
|
356
|
-
["webchat-input"]: true,
|
|
357
|
-
["email-us__name-input"]: true,
|
|
358
|
-
["webchat-font__desktop"]: !isMobile(),
|
|
359
|
-
["webchat-font__mobile"]: isMobile(),
|
|
360
|
-
})}
|
|
361
|
-
placeholder="First name"
|
|
362
|
-
autocomplete="given-name"
|
|
363
|
-
value="${this.firstName}"
|
|
364
|
-
@keyup=${this.onChangeFirstName}
|
|
365
|
-
/>
|
|
366
|
-
<div class="email-us__horizontal-spacer"></div>
|
|
367
|
-
<input
|
|
368
|
-
type="text"
|
|
369
|
-
class=${classMap({
|
|
370
|
-
["webchat-input"]: true,
|
|
371
|
-
["email-us__name-input"]: true,
|
|
372
|
-
["webchat-font__desktop"]: !isMobile(),
|
|
373
|
-
["webchat-font__mobile"]: isMobile(),
|
|
374
|
-
})}
|
|
375
|
-
placeholder="Last name"
|
|
376
|
-
autocomplete="family-name"
|
|
377
|
-
value="${this.lastName}"
|
|
378
|
-
@keyup=${this.onChangeLastName}
|
|
379
|
-
/>
|
|
380
|
-
</div>
|
|
381
|
-
${this.hasNameError
|
|
382
|
-
? html`
|
|
383
|
-
<div class="email-us__error-text">Enter your full name</div>
|
|
384
|
-
`
|
|
385
|
-
: ""}
|
|
386
|
-
<div class="email-us__vertical-spacer"></div>
|
|
387
|
-
<input
|
|
388
|
-
type="email"
|
|
389
|
-
placeholder="Email"
|
|
390
|
-
autocomplete="email"
|
|
391
|
-
class=${classMap({
|
|
392
|
-
["webchat-input"]: true,
|
|
393
|
-
["email-us__contact-input"]: true,
|
|
394
|
-
["webchat-font__desktop"]: !isMobile(),
|
|
395
|
-
["webchat-font__mobile"]: isMobile(),
|
|
396
|
-
})}
|
|
397
|
-
.value=${this.email}
|
|
398
|
-
@keyup=${this.onChangeEmail}
|
|
399
|
-
/>
|
|
400
|
-
${this.hasEmailError
|
|
401
|
-
? html`
|
|
402
|
-
<div class="email-us__error-text">
|
|
403
|
-
Enter valid email address
|
|
404
|
-
</div>
|
|
405
|
-
`
|
|
406
|
-
: ""}
|
|
407
|
-
<div class="email-us__vertical-spacer"></div>
|
|
408
|
-
<input
|
|
409
|
-
${ref(this.phoneNumberInputRef)}
|
|
410
|
-
type="text"
|
|
411
|
-
placeholder="Phone"
|
|
412
|
-
autocomplete="tel-national"
|
|
413
|
-
inputmode="tel"
|
|
414
|
-
class=${classMap({
|
|
415
|
-
["webchat-input"]: true,
|
|
416
|
-
["email-us__contact-input"]: true,
|
|
417
|
-
["webchat-font__desktop"]: !isMobile(),
|
|
418
|
-
["webchat-font__mobile"]: isMobile(),
|
|
419
|
-
})}
|
|
420
|
-
.value=${this.phoneNumber}
|
|
421
|
-
maxlength="14"
|
|
422
|
-
@keydown=${this.enforceFormat}
|
|
423
|
-
@keyup=${this.onChangePhoneNumber}
|
|
424
|
-
/>
|
|
425
|
-
${this.hasPhoneNumberError
|
|
426
|
-
? html`
|
|
427
|
-
<div class="email-us__error-text">
|
|
428
|
-
Enter a valid phone number
|
|
429
|
-
</div>
|
|
430
|
-
`
|
|
431
|
-
: ""}
|
|
432
|
-
<div class="email-us__vertical-spacer"></div>
|
|
433
|
-
${this.leadSources.length > 0 &&
|
|
434
|
-
(this.featureFlagShowDropdown === FeatureFlagsShowDropdown.always ||
|
|
435
|
-
(this.featureFlagShowDropdown ===
|
|
436
|
-
FeatureFlagsShowDropdown.onAttributionFailure &&
|
|
437
|
-
this.currentLeadSource.length === 0))
|
|
438
|
-
? html`
|
|
439
|
-
<me-select
|
|
440
|
-
id="leadSource"
|
|
441
|
-
placeholder="How did you hear about us?"
|
|
442
|
-
value="${this.currentLeadSource}"
|
|
443
|
-
.options="${this.leadSources.map((i) => ({
|
|
444
|
-
label: i,
|
|
445
|
-
value: i,
|
|
446
|
-
}))}"
|
|
447
|
-
@change=${() => {
|
|
448
|
-
this.requestUpdate();
|
|
449
|
-
}}
|
|
450
|
-
>
|
|
451
|
-
</me-select>
|
|
452
|
-
`
|
|
453
|
-
: ""}
|
|
454
|
-
<div class="email-us__vertical-spacer"></div>
|
|
455
|
-
<textarea
|
|
456
|
-
placeholder="Your message..."
|
|
457
|
-
.value=${this.message}
|
|
458
|
-
class=${classMap({
|
|
459
|
-
["email-us__message-input"]: true,
|
|
460
|
-
["webchat-input"]: true,
|
|
461
|
-
["webchat-textarea"]: true,
|
|
462
|
-
["webchat-font__desktop"]: !isMobile(),
|
|
463
|
-
["webchat-font__mobile"]: isMobile(),
|
|
464
|
-
})}
|
|
465
|
-
@keyup=${this.onChangeMessage}
|
|
466
|
-
></textarea>
|
|
467
|
-
${this.hasMessageError
|
|
468
|
-
? html` <div class="email-us__error-text">Include a message</div> `
|
|
469
|
-
: ""}
|
|
470
|
-
<div class="action-bttn-container">
|
|
471
|
-
<action-confirm-button
|
|
472
|
-
.onClick=${this.onClick}
|
|
473
|
-
.isLoading=${this.isSubmitting}
|
|
474
|
-
text="SEND"
|
|
475
|
-
></action-confirm-button>
|
|
476
|
-
</div>
|
|
477
|
-
${this.hasSubmissionError
|
|
478
|
-
? html`
|
|
479
|
-
<div class="email-us__error-text">Error submitting message</div>
|
|
480
|
-
`
|
|
481
|
-
: ""}
|
|
482
|
-
</div>
|
|
483
|
-
|
|
484
|
-
${disclaimer({
|
|
485
|
-
buildingName: this.buildingName,
|
|
486
|
-
phoneNumberInput: this.phoneNumber,
|
|
487
|
-
emailInput: this.email,
|
|
488
|
-
orgLegalName: this.orgLegalName,
|
|
489
|
-
orgSlug: this.orgSlug,
|
|
490
|
-
})}
|
|
491
|
-
</details-window>
|
|
492
|
-
`;
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
export const installEmailUsWindow = (): void => {
|
|
497
|
-
if (!window.customElements.get("email-us-window")) {
|
|
498
|
-
window.customElements.define("email-us-window", EmailUsWindow);
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
const createEmail = async (
|
|
503
|
-
firstName: string,
|
|
504
|
-
lastName: string,
|
|
505
|
-
email: string,
|
|
506
|
-
rawPhoneNumber: string,
|
|
507
|
-
message: string,
|
|
508
|
-
buildingId: number,
|
|
509
|
-
orgSlug: string,
|
|
510
|
-
buildingSlug: string,
|
|
511
|
-
leadSources: string[],
|
|
512
|
-
chatId?: string | null
|
|
513
|
-
) => {
|
|
514
|
-
const formattedPhoneNumber =
|
|
515
|
-
"+1" +
|
|
516
|
-
rawPhoneNumber
|
|
517
|
-
.replace("(", "")
|
|
518
|
-
.replace(")", "")
|
|
519
|
-
.replace(" ", "")
|
|
520
|
-
.replace("-", "");
|
|
521
|
-
const queryParams = new URLSearchParams(window.location.search);
|
|
522
|
-
const requestBody = {
|
|
523
|
-
email_address: email,
|
|
524
|
-
building_id: buildingId,
|
|
525
|
-
lead_sources: leadSources,
|
|
526
|
-
first_message: message,
|
|
527
|
-
first_name: firstName,
|
|
528
|
-
last_name: lastName,
|
|
529
|
-
phone_number: formattedPhoneNumber,
|
|
530
|
-
referrer: document.referrer,
|
|
531
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
532
|
-
// @ts-ignore
|
|
533
|
-
query_params: Object.fromEntries(queryParams.entries()),
|
|
534
|
-
conversation_tracking_id: chatId,
|
|
535
|
-
};
|
|
536
|
-
pushGtmEvent("emailUsSubmitted", {
|
|
537
|
-
firstName,
|
|
538
|
-
lastName,
|
|
539
|
-
email,
|
|
540
|
-
phone: formattedPhoneNumber,
|
|
541
|
-
message,
|
|
542
|
-
originatingSource:
|
|
543
|
-
leadSources.find((i) => i !== "property-website") || null,
|
|
544
|
-
});
|
|
545
|
-
await axios.post(
|
|
546
|
-
"https://app.meetelise.com/platformApi/state/create/emailMe",
|
|
547
|
-
requestBody,
|
|
548
|
-
{
|
|
549
|
-
headers: {
|
|
550
|
-
["building-slug"]: buildingSlug,
|
|
551
|
-
["org-slug"]: orgSlug,
|
|
552
|
-
["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
|
|
553
|
-
},
|
|
554
|
-
}
|
|
555
|
-
);
|
|
556
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* For now, only handles the US phone number case.....
|
|
3
|
-
* Formats into phone number as you type
|
|
4
|
-
*/
|
|
5
|
-
export const formatToPhoneInput = (phoneNumber: string): string => {
|
|
6
|
-
const input = phoneNumber.replace(/\D/g, "").substring(0, 10);
|
|
7
|
-
const areaCode = input.substring(0, 3);
|
|
8
|
-
const middle = input.substring(3, 6);
|
|
9
|
-
const last = input.substring(6, 10);
|
|
10
|
-
|
|
11
|
-
if (input.length > 5) {
|
|
12
|
-
return `(${areaCode}) ${middle}-${last}`;
|
|
13
|
-
}
|
|
14
|
-
if (input.length > 2) {
|
|
15
|
-
return `(${areaCode}) ${middle}`;
|
|
16
|
-
}
|
|
17
|
-
if (input.length > 0) {
|
|
18
|
-
return `(${areaCode}`;
|
|
19
|
-
}
|
|
20
|
-
return "";
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Formats a phone number into a human-readable format.
|
|
25
|
-
*/
|
|
26
|
-
export const formatPhoneNumber = (phoneNumberString: string): string => {
|
|
27
|
-
const cleaned = ("" + phoneNumberString).replace(/\D/g, "");
|
|
28
|
-
const match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/);
|
|
29
|
-
if (match) {
|
|
30
|
-
const intlCode = match[1] ? "+1 " : "";
|
|
31
|
-
return [intlCode, "(", match[2], ") ", match[3], "-", match[4]].join("");
|
|
32
|
-
}
|
|
33
|
-
return phoneNumberString;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const isNumericInput = (event: KeyboardEvent): boolean => {
|
|
37
|
-
const key = event.keyCode;
|
|
38
|
-
return (key >= 48 && key <= 57) || (key >= 96 && key <= 105);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export const isPrintableCharacter = (event: KeyboardEvent): boolean =>
|
|
42
|
-
event.key.length === 1;
|
|
43
|
-
|
|
44
|
-
/** Returns true if any key is pressed whose only function when typing text would be as part of a keyboard shortcut.
|
|
45
|
-
* For example, `Shift` or `f` would not suffice, because these are used for typing text.
|
|
46
|
-
* But `Command` or `Control` would.
|
|
47
|
-
*/
|
|
48
|
-
export const shortcutKeyIsPressed = (event: KeyboardEvent): boolean =>
|
|
49
|
-
event.altKey || event.ctrlKey || event.metaKey;
|
|
50
|
-
|
|
51
|
-
export const isModifierKey = (event: KeyboardEvent): boolean => {
|
|
52
|
-
const key = event.keyCode;
|
|
53
|
-
// TODO: whitelisting specific keyboard shortcuts is brittle (e.g. this is missing Cmd + R to reload)
|
|
54
|
-
// Allow left, up, right, down, Backspace, Tab, Enter, Delete, Ctrl/Command + A,C,L,V,X,Z, Shift, Home, End
|
|
55
|
-
return (
|
|
56
|
-
event.shiftKey ||
|
|
57
|
-
key === 35 ||
|
|
58
|
-
key === 36 || // Allow
|
|
59
|
-
key === 8 ||
|
|
60
|
-
key === 9 ||
|
|
61
|
-
key === 13 ||
|
|
62
|
-
key === 46 ||
|
|
63
|
-
(key > 36 && key < 41) ||
|
|
64
|
-
((event.ctrlKey || event.metaKey) &&
|
|
65
|
-
(key === 65 ||
|
|
66
|
-
key === 67 ||
|
|
67
|
-
key === 76 ||
|
|
68
|
-
key === 86 ||
|
|
69
|
-
key === 88 ||
|
|
70
|
-
key === 90))
|
|
71
|
-
);
|
|
72
|
-
};
|