@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,34 +0,0 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
|
|
3
|
-
export const simpleLauncherStyles = css`
|
|
4
|
-
.chat-launcher {
|
|
5
|
-
position: fixed;
|
|
6
|
-
}
|
|
7
|
-
.close-chat-bttn,
|
|
8
|
-
.open-chat-bttn {
|
|
9
|
-
width: 48px;
|
|
10
|
-
height: 48px;
|
|
11
|
-
border-radius: 100%;
|
|
12
|
-
background: linear-gradient(
|
|
13
|
-
180deg,
|
|
14
|
-
rgba(96, 50, 230, 1) 29%,
|
|
15
|
-
rgba(140, 88, 229, 1) 63%
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
|
|
22
|
-
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
|
|
23
|
-
transition: all 0.2s ease-in-out;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.close-chat-bttn,
|
|
27
|
-
.open-chat-bttn {
|
|
28
|
-
border: none;
|
|
29
|
-
&:hover {
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
filter: brightness(1.1);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { html, LitElement, TemplateResult } from "lit";
|
|
2
|
-
import { customElement, property } from "lit/decorators.js";
|
|
3
|
-
import { styleMap } from "lit/directives/style-map.js";
|
|
4
|
-
import { isMobile } from "../../utils";
|
|
5
|
-
import { simpleLauncherStyles } from "./simple-launcher-styles";
|
|
6
|
-
|
|
7
|
-
@customElement("simple-launcher")
|
|
8
|
-
export class SimpleLauncher extends LitElement {
|
|
9
|
-
static styles = [simpleLauncherStyles];
|
|
10
|
-
|
|
11
|
-
@property({ type: Number })
|
|
12
|
-
private right = 0;
|
|
13
|
-
|
|
14
|
-
@property({ type: Number })
|
|
15
|
-
private bottom = 0;
|
|
16
|
-
|
|
17
|
-
@property({ type: Number })
|
|
18
|
-
private top = 0;
|
|
19
|
-
|
|
20
|
-
@property({ type: Number })
|
|
21
|
-
private left = 0;
|
|
22
|
-
|
|
23
|
-
@property({ attribute: true })
|
|
24
|
-
isChatOpen = false;
|
|
25
|
-
|
|
26
|
-
@property({ attribute: true })
|
|
27
|
-
onClickCloseChat: () => void = () => ({});
|
|
28
|
-
|
|
29
|
-
@property({ attribute: true })
|
|
30
|
-
onClickOpenChat: () => void = () => ({});
|
|
31
|
-
|
|
32
|
-
render(): TemplateResult {
|
|
33
|
-
if (this.isChatOpen) {
|
|
34
|
-
return html`
|
|
35
|
-
<div
|
|
36
|
-
class="chat-launcher"
|
|
37
|
-
style=${styleMap({
|
|
38
|
-
top:
|
|
39
|
-
!isMobile() && !isNaN(this.top)
|
|
40
|
-
? `${this.top + 432}px`
|
|
41
|
-
: undefined,
|
|
42
|
-
bottom:
|
|
43
|
-
!isMobile() && !isNaN(this.bottom)
|
|
44
|
-
? `${this.bottom - 60}px`
|
|
45
|
-
: "72px",
|
|
46
|
-
left:
|
|
47
|
-
!isMobile() && !isNaN(this.left) ? `${this.left}px` : undefined,
|
|
48
|
-
right:
|
|
49
|
-
!isMobile() && !isNaN(this.right) ? `${this.right}px` : "18px",
|
|
50
|
-
})}
|
|
51
|
-
>
|
|
52
|
-
<button class="close-chat-bttn" @click=${this.onClickCloseChat}>
|
|
53
|
-
<svg
|
|
54
|
-
width="16"
|
|
55
|
-
height="10"
|
|
56
|
-
viewBox="0 0 16 10"
|
|
57
|
-
fill="none"
|
|
58
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
59
|
-
>
|
|
60
|
-
<path
|
|
61
|
-
d="M2 2L8 8L14 2"
|
|
62
|
-
stroke="white"
|
|
63
|
-
stroke-width="1.5"
|
|
64
|
-
stroke-linecap="square"
|
|
65
|
-
/>
|
|
66
|
-
</svg>
|
|
67
|
-
</button>
|
|
68
|
-
</div>
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
return html` <div
|
|
72
|
-
class="chat-launcher"
|
|
73
|
-
style=${styleMap({
|
|
74
|
-
top:
|
|
75
|
-
!isMobile() && !isNaN(this.top) ? `${this.top + 432}px` : undefined,
|
|
76
|
-
bottom:
|
|
77
|
-
!isMobile() && !isNaN(this.bottom) ? `${this.bottom - 60}px` : "72px",
|
|
78
|
-
left: !isMobile() && !isNaN(this.left) ? `${this.left}px` : undefined,
|
|
79
|
-
right: !isMobile() && !isNaN(this.right) ? `${this.right}px` : "18px",
|
|
80
|
-
})}
|
|
81
|
-
>
|
|
82
|
-
<button class="open-chat-bttn" @click=${this.onClickOpenChat}>
|
|
83
|
-
<svg
|
|
84
|
-
width="24"
|
|
85
|
-
height="24"
|
|
86
|
-
viewBox="0 0 24 24"
|
|
87
|
-
fill="none"
|
|
88
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
89
|
-
>
|
|
90
|
-
<path
|
|
91
|
-
fill-rule="evenodd"
|
|
92
|
-
clip-rule="evenodd"
|
|
93
|
-
d="M11.9955 2.40005C17.2974 2.40005 21.5955 6.69812 21.5955 12.0001C21.5955 17.302 17.2974 21.6001 11.9955 21.6001C10.2662 21.6001 8.64362 21.1428 7.24219 20.3426C7.15808 20.2946 7.05854 20.2806 6.96499 20.3056L3.09414 21.3428C2.82646 21.4146 2.58151 21.1696 2.65324 20.9019L3.69036 17.0313C3.71543 16.9378 3.70145 16.8382 3.65341 16.7541C2.85293 15.3525 2.39551 13.7297 2.39551 12.0001C2.39551 6.69812 6.69357 2.40005 11.9955 2.40005ZM8.20315 13.0047C8.73335 13.0047 9.16315 12.5749 9.16315 12.0447C9.16315 11.5146 8.73335 11.0848 8.20315 11.0848C7.67296 11.0848 7.24315 11.5146 7.24315 12.0447C7.24315 12.5749 7.67296 13.0047 8.20315 13.0047ZM13.0033 12.0447C13.0033 12.5749 12.5735 13.0047 12.0433 13.0047C11.5131 13.0047 11.0833 12.5749 11.0833 12.0447C11.0833 11.5146 11.5131 11.0848 12.0433 11.0848C12.5735 11.0848 13.0033 11.5146 13.0033 12.0447ZM15.8822 13.0046C16.4124 13.0046 16.8422 12.5749 16.8422 12.0447C16.8422 11.5145 16.4124 11.0848 15.8822 11.0848C15.352 11.0848 14.9222 11.5145 14.9222 12.0447C14.9222 12.5749 15.352 13.0046 15.8822 13.0046Z"
|
|
94
|
-
fill="white"
|
|
95
|
-
/>
|
|
96
|
-
</svg>
|
|
97
|
-
</button>
|
|
98
|
-
</div>`;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
3
|
-
import { createRef, Ref } from "lit/directives/ref.js";
|
|
4
|
-
import { Launcher } from "./launcher/Launcher";
|
|
5
|
-
import "./Scheduler/tour-scheduler";
|
|
6
|
-
import { installLauncher } from "./launcher/Launcher";
|
|
7
|
-
|
|
8
|
-
import "./MEChat.css";
|
|
9
|
-
import MyPubnub from "../MyPubnub";
|
|
10
|
-
|
|
11
|
-
import "./actions/minimize-expand-button";
|
|
12
|
-
import "./launcher/mobile-launcher";
|
|
13
|
-
import "./pubnub-chat";
|
|
14
|
-
import {
|
|
15
|
-
clearChatStorageKey,
|
|
16
|
-
createChatStorageKey,
|
|
17
|
-
getChatStorageKey,
|
|
18
|
-
isChatKeyValid,
|
|
19
|
-
} from "../handleChatId";
|
|
20
|
-
import { isMobile } from "../utils";
|
|
21
|
-
import "./simple-launcher/simple-launcher";
|
|
22
|
-
import { WidgetType } from "../main/MEChat";
|
|
23
|
-
import { fetchFeatureFlagShowUtilities } from "../fetchFeatureFlag";
|
|
24
|
-
|
|
25
|
-
@customElement("utilities-chat")
|
|
26
|
-
export class UtilitiesChat extends LitElement {
|
|
27
|
-
static styles = css`
|
|
28
|
-
:host {
|
|
29
|
-
all: initial;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
#__talkjs_launcher:not(.shouldBeVisible) {
|
|
33
|
-
display: none;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.launcherContainer.launcher__mobile {
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: 100px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
#typeMobile-bttn {
|
|
42
|
-
position: fixed;
|
|
43
|
-
right: 24px;
|
|
44
|
-
bottom: 24px;
|
|
45
|
-
width: 80px;
|
|
46
|
-
height: 80px;
|
|
47
|
-
|
|
48
|
-
border: 2px solid #f3f6fc;
|
|
49
|
-
border-radius: 1000px;
|
|
50
|
-
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
margin-right: 40px;
|
|
55
|
-
}
|
|
56
|
-
#typeMobile-bttn:hover > #typeMobile-inner {
|
|
57
|
-
background: #eaecf4;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
}
|
|
60
|
-
#typeMobile-bttn > #typeMobile-inner {
|
|
61
|
-
width: 72px;
|
|
62
|
-
height: 72px;
|
|
63
|
-
|
|
64
|
-
background: #ffffff;
|
|
65
|
-
border: 2px solid #f3f6fc;
|
|
66
|
-
border-radius: 1000px;
|
|
67
|
-
|
|
68
|
-
display: flex;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
align-items: center;
|
|
71
|
-
gap: 4px;
|
|
72
|
-
}
|
|
73
|
-
#typeMobile-txt {
|
|
74
|
-
font-family: Poppins, "Open Sans", "Helvetica", sans-serif;
|
|
75
|
-
box-sizing: border-box;
|
|
76
|
-
font-weight: 300;
|
|
77
|
-
line-height: 150%;
|
|
78
|
-
font-size: 16px;
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
|
|
82
|
-
@property({ type: String })
|
|
83
|
-
private orgSlug = "";
|
|
84
|
-
|
|
85
|
-
@property({ type: Number })
|
|
86
|
-
private right = undefined;
|
|
87
|
-
|
|
88
|
-
@property({ type: Number })
|
|
89
|
-
private bottom = undefined;
|
|
90
|
-
|
|
91
|
-
@property({ type: Number })
|
|
92
|
-
private top = undefined;
|
|
93
|
-
|
|
94
|
-
@property({ type: Number })
|
|
95
|
-
private left = undefined;
|
|
96
|
-
|
|
97
|
-
@state()
|
|
98
|
-
private launcher: HTMLElement | null = null;
|
|
99
|
-
|
|
100
|
-
@state()
|
|
101
|
-
private currentLeadSource: string | null = null;
|
|
102
|
-
|
|
103
|
-
@state()
|
|
104
|
-
private displayPubnubChat = false;
|
|
105
|
-
|
|
106
|
-
@state()
|
|
107
|
-
private myPubnub: MyPubnub | null = null;
|
|
108
|
-
|
|
109
|
-
@state()
|
|
110
|
-
private requiresConsent = false;
|
|
111
|
-
|
|
112
|
-
@state()
|
|
113
|
-
private privacyPolicyUrl = "http://bit.ly/me_privacy_policy";
|
|
114
|
-
|
|
115
|
-
@state()
|
|
116
|
-
private isLoading = true;
|
|
117
|
-
|
|
118
|
-
launcherRef: Ref<Launcher> = createRef();
|
|
119
|
-
|
|
120
|
-
firstUpdated = async (): Promise<void> => {
|
|
121
|
-
const showShouldUtilities = await fetchFeatureFlagShowUtilities(
|
|
122
|
-
this.orgSlug
|
|
123
|
-
);
|
|
124
|
-
if (!showShouldUtilities && !location.href.includes("demo/utilities")) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
await this.initializeChatVariables();
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
private initializeChatVariables = async (): Promise<void> => {
|
|
131
|
-
this.isLoading = true;
|
|
132
|
-
|
|
133
|
-
// important to distinguish between a user who has never opened the chat and a user who has opened the chat but closed it
|
|
134
|
-
const currentChatStorageKey = getChatStorageKey(this.orgSlug);
|
|
135
|
-
const updatedChatStorageKey = isChatKeyValid(
|
|
136
|
-
this.orgSlug,
|
|
137
|
-
currentChatStorageKey
|
|
138
|
-
)
|
|
139
|
-
? currentChatStorageKey
|
|
140
|
-
: createChatStorageKey(this.orgSlug, false);
|
|
141
|
-
|
|
142
|
-
if (!updatedChatStorageKey.leadId) {
|
|
143
|
-
throw new Error("Lead ID is null");
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
this.myPubnub = new MyPubnub(
|
|
147
|
-
this.orgSlug,
|
|
148
|
-
null,
|
|
149
|
-
this.orgSlug,
|
|
150
|
-
this.currentLeadSource,
|
|
151
|
-
updatedChatStorageKey.leadId,
|
|
152
|
-
null,
|
|
153
|
-
WidgetType.Utilities
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
if (updatedChatStorageKey.initiatedChat) {
|
|
157
|
-
await this.myPubnub.initializePubnub(currentChatStorageKey);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (!isMobile()) {
|
|
161
|
-
this.displayPubnubChat = true;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
this.attachOnClickToLauncher();
|
|
165
|
-
|
|
166
|
-
this.isLoading = false;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
public async restartConversation(): Promise<void> {
|
|
170
|
-
this.myPubnub?.handleDisconnect();
|
|
171
|
-
clearChatStorageKey(this.orgSlug);
|
|
172
|
-
this.myPubnub = null;
|
|
173
|
-
this.displayPubnubChat = false;
|
|
174
|
-
await this.initializeChatVariables();
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/** Show the chat button on the screen if it was previously hidden. */
|
|
178
|
-
show(): void {
|
|
179
|
-
if (!this.launcher) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
this.launcher.style.display = "";
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** Hide the chat button from the screen (but don't remove from the DOM). */
|
|
186
|
-
hide(): void {
|
|
187
|
-
if (!this.launcher) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
this.launcher.style.display = "none";
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
disconnectedCallback(): void {
|
|
194
|
-
this.myPubnub?.handleDisconnect();
|
|
195
|
-
super.disconnectedCallback();
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
private attachOnClickToLauncher = () => {
|
|
199
|
-
const launcher = this.launcherRef.value;
|
|
200
|
-
if (!launcher) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
launcher.onChatTapped = async () => {
|
|
204
|
-
this.displayPubnubChat = true;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
render(): TemplateResult {
|
|
209
|
-
installLauncher();
|
|
210
|
-
|
|
211
|
-
if (this.isLoading) return html``;
|
|
212
|
-
return html`
|
|
213
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
214
|
-
<div id="aria-describe-info" style="display: none;">
|
|
215
|
-
EliseAI widget that allows you to chat with a virtual assistant, book
|
|
216
|
-
a tour, contact the leasing office, and more.
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
${
|
|
221
|
-
this.displayPubnubChat
|
|
222
|
-
? html`
|
|
223
|
-
<pubnub-chat
|
|
224
|
-
id="pubnub-chat"
|
|
225
|
-
.channel=${this.myPubnub?.channel}
|
|
226
|
-
.widgetType=${WidgetType.Utilities}
|
|
227
|
-
.myPubnub=${this.myPubnub}
|
|
228
|
-
.buildingSlug=${this.orgSlug}
|
|
229
|
-
.onClickExit=${() => {
|
|
230
|
-
this.displayPubnubChat = false;
|
|
231
|
-
}}
|
|
232
|
-
.requiresConsent=${this.requiresConsent}
|
|
233
|
-
.privacyPolicyUrl=${this.privacyPolicyUrl}
|
|
234
|
-
.top=${this.top}
|
|
235
|
-
.bottom=${this.bottom}
|
|
236
|
-
.left=${this.left}
|
|
237
|
-
.right=${this.right}
|
|
238
|
-
></pubnub-chat>
|
|
239
|
-
`
|
|
240
|
-
: html``
|
|
241
|
-
}
|
|
242
|
-
<simple-launcher
|
|
243
|
-
id="healthcare-launcher"
|
|
244
|
-
.top=${this.top}
|
|
245
|
-
.bottom=${this.bottom}
|
|
246
|
-
.left=${this.left}
|
|
247
|
-
.right=${this.right}
|
|
248
|
-
.isChatOpen=${this.displayPubnubChat}
|
|
249
|
-
.onClickCloseChat=${() => {
|
|
250
|
-
this.displayPubnubChat = false;
|
|
251
|
-
}}
|
|
252
|
-
.onClickOpenChat=${() => {
|
|
253
|
-
this.displayPubnubChat = true;
|
|
254
|
-
}}
|
|
255
|
-
|
|
256
|
-
></simple-launcher>
|
|
257
|
-
</meta>
|
|
258
|
-
`;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
declare global {
|
|
263
|
-
interface HTMLElementTagNameMap {
|
|
264
|
-
"utilities-chat": UtilitiesChat;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
interface Window {
|
|
268
|
-
RCTPCampaign?: { CampaignDetails: { Source: string } };
|
|
269
|
-
}
|
|
270
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
2
|
-
|
|
3
|
-
export const utiltiesChatStyles = css`
|
|
4
|
-
#utilities-container {
|
|
5
|
-
position: fixed;
|
|
6
|
-
|
|
7
|
-
z-index: 100001;
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
overflow: hidden;
|
|
14
|
-
box-shadow: -10px 60px 60px 0px #bfbfbf4d;
|
|
15
|
-
|
|
16
|
-
box-shadow: 0px 1px 24px 0px #0000001a;
|
|
17
|
-
|
|
18
|
-
font-family: Poppins, "Open Sans", "Helvetica", sans-serif;
|
|
19
|
-
}
|
|
20
|
-
.utilities-container__desktop {
|
|
21
|
-
width: 500px;
|
|
22
|
-
height: min(700px, calc(100vh - 200px));
|
|
23
|
-
border-radius: 10px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
#utilities-header {
|
|
27
|
-
height: 60px;
|
|
28
|
-
width: 100%;
|
|
29
|
-
background: white;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
|
|
32
|
-
box-sizing: border-box;
|
|
33
|
-
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
padding: 24px 16px;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.utilities-conversation-body-backdrop {
|
|
41
|
-
background: #f1f2f4;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
@media screen and (max-width: 767px) {
|
|
45
|
-
#conversation-body {
|
|
46
|
-
background: #efefef;
|
|
47
|
-
backdrop-filter: none;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.utilities-disclaimer-inner {
|
|
52
|
-
margin: 0 auto;
|
|
53
|
-
}
|
|
54
|
-
.utilities-disclaimer-message {
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
color: #737373;
|
|
57
|
-
line-height: 12px;
|
|
58
|
-
font-weight: 400;
|
|
59
|
-
text-align: left;
|
|
60
|
-
align-self: flex-start;
|
|
61
|
-
}
|
|
62
|
-
.utilities-disclaimer-inner > a {
|
|
63
|
-
color: #737373;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
#utilities-footer {
|
|
67
|
-
min-height: 60px;
|
|
68
|
-
width: 100%;
|
|
69
|
-
background: white;
|
|
70
|
-
z-index: 100001;
|
|
71
|
-
}
|
|
72
|
-
#utilities-inner-footer {
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: space-between;
|
|
76
|
-
box-sizing: border-box;
|
|
77
|
-
padding: 16px;
|
|
78
|
-
gap: 0px;
|
|
79
|
-
}
|
|
80
|
-
#utilities-inner-footer > #message-input {
|
|
81
|
-
width: 100%;
|
|
82
|
-
max-height: 100px;
|
|
83
|
-
overflowy: auto;
|
|
84
|
-
|
|
85
|
-
font-family: inherit;
|
|
86
|
-
box-sizing: border-box;
|
|
87
|
-
font-weight: light;
|
|
88
|
-
border: none;
|
|
89
|
-
color: black;
|
|
90
|
-
background: none;
|
|
91
|
-
|
|
92
|
-
padding-right: 6px; /* width of the scrollbar */
|
|
93
|
-
box-sizing: border-box;
|
|
94
|
-
z-index: 1000000000000000000000000001;
|
|
95
|
-
font-size: 14px;
|
|
96
|
-
}
|
|
97
|
-
#utilities-inner-footer > #message-input:focus {
|
|
98
|
-
outline: none;
|
|
99
|
-
-webkit-box-shadow: none;
|
|
100
|
-
box-shadow: none;
|
|
101
|
-
}
|
|
102
|
-
#utilities-send-message-bttn {
|
|
103
|
-
background: none;
|
|
104
|
-
border: none;
|
|
105
|
-
cursor: pointer;
|
|
106
|
-
}
|
|
107
|
-
.health-bttn-allow-access {
|
|
108
|
-
padding-right: 28px;
|
|
109
|
-
}
|
|
110
|
-
`;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/** Pass in the year and the 0-indexed number of the month. E.g., for January 2022,
|
|
2
|
-
* `getDaysInMonth(2022, 0)`.
|
|
3
|
-
*/
|
|
4
|
-
export const getDaysInMonth = (year: number, month: number): number => {
|
|
5
|
-
// In the Date constructor, day 0 is the last day of the
|
|
6
|
-
// previous month. We get the date of next month's day 0
|
|
7
|
-
// to find out how many days this month has.
|
|
8
|
-
return new Date(year, month + 1, 0).getDate();
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/** Pass in the year and the 0-indexed number of the month. E.g., for January 2022,
|
|
12
|
-
* `getDaysInMonth(2022, 0)`. Returns the 0-indexed day of the week of the first
|
|
13
|
-
* day of the month, e.g. `0` for Sunday.
|
|
14
|
-
*/
|
|
15
|
-
export const getMonthStartDay = (year: number, month: number): number =>
|
|
16
|
-
new Date(year, month, 1).getDay();
|
|
17
|
-
|
|
18
|
-
/** Pass in the year and the 0-indexed number of the month. E.g., for January 2022,
|
|
19
|
-
* `getDaysInMonth(2022, 0)`. Returns the 0-indexed day of the week of the last day
|
|
20
|
-
* of the month, e.g. `0` for Sunday.
|
|
21
|
-
*/
|
|
22
|
-
export const getMonthEndDay = (year: number, month: number): number => {
|
|
23
|
-
const monthStartDay = getMonthStartDay(year, month);
|
|
24
|
-
const daysInMonth = getDaysInMonth(year, month);
|
|
25
|
-
return (monthStartDay + (daysInMonth % 7) - 1) % 7;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** Takes a 0-indexed month and returns the previous month.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* getPreviousMonth(5) -> 4 // June -> May
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* getPreviousMonth(0) -> 11 // January -> December
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
export const getPreviousMonth = (month: number): number =>
|
|
38
|
-
month > 0 ? month - 1 : 11;
|
|
39
|
-
|
|
40
|
-
/** Pass in the year and the 0-indexed number of the month. E.g., for January 2022,
|
|
41
|
-
* `getDaysInMonth(2022, 0)`. Returns the 0-indexed day of the week, e.g. `0` for Sunday.
|
|
42
|
-
*/
|
|
43
|
-
export const getDaysInPreviousMonth = (year: number, month: number): number =>
|
|
44
|
-
getDaysInMonth(month > 0 ? year : year - 1, getPreviousMonth(month));
|
|
45
|
-
|
|
46
|
-
export const dayNames = [
|
|
47
|
-
"Sunday",
|
|
48
|
-
"Monday",
|
|
49
|
-
"Tuesday",
|
|
50
|
-
"Wednesday",
|
|
51
|
-
"Thursday",
|
|
52
|
-
"Friday",
|
|
53
|
-
"Saturday",
|
|
54
|
-
];
|
|
55
|
-
export const monthNames = [
|
|
56
|
-
"January",
|
|
57
|
-
"February",
|
|
58
|
-
"March",
|
|
59
|
-
"April",
|
|
60
|
-
"May",
|
|
61
|
-
"June",
|
|
62
|
-
"July",
|
|
63
|
-
"August",
|
|
64
|
-
"September",
|
|
65
|
-
"October",
|
|
66
|
-
"November",
|
|
67
|
-
"December",
|
|
68
|
-
];
|
|
69
|
-
|
|
70
|
-
export type Month =
|
|
71
|
-
| "January"
|
|
72
|
-
| "February"
|
|
73
|
-
| "March"
|
|
74
|
-
| "April"
|
|
75
|
-
| "May"
|
|
76
|
-
| "June"
|
|
77
|
-
| "July"
|
|
78
|
-
| "August"
|
|
79
|
-
| "September"
|
|
80
|
-
| "October"
|
|
81
|
-
| "November"
|
|
82
|
-
| "December";
|