@meetelise/chat 1.30.0 → 1.30.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/addon-item/addon-item-styles.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/components/addon-item/addon-item.d.ts +22 -0
- package/dist/src/WebComponent/FeeCalculator/components/addon-item/index.d.ts +1 -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 +34 -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 +33 -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/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 +2 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +1 -0
- package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +59 -0
- package/dist/src/WebComponent/FeeCalculator/index.d.ts +2 -0
- package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +80 -0
- package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +23 -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 +14 -0
- package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +100 -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 +3 -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 +98 -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/me-chat.d.ts +91 -0
- package/dist/src/WebComponent/me-select.d.ts +24 -0
- package/dist/src/WebComponent/mega-loader.d.ts +7 -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 +49 -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 +8 -0
- package/dist/src/fetchBuildingABTestType.d.ts +8 -0
- package/dist/src/fetchBuildingInfo.d.ts +57 -0
- package/dist/src/fetchBuildingWebchatView.d.ts +123 -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 +45 -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 +1 -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 +53 -0
- package/dist/src/services/fees/fetchBuildingFees.d.ts +24 -0
- package/dist/src/services/fees/fetchBuildingFloorplans.d.ts +21 -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/rest-sdk.types.d.ts +11 -0
- package/dist/src/types/webchat-no-show-reason.d.ts +1 -0
- package/dist/src/utils.d.ts +13 -0
- package/package.json +1 -1
- package/public/dist/index.js +2 -3
- package/src/MyPubnub.ts +792 -0
- package/src/WebComponent/FeeCalculator/components/addon-item/addon-item-styles.ts +79 -0
- package/src/WebComponent/FeeCalculator/components/addon-item/addon-item.ts +121 -0
- package/src/WebComponent/FeeCalculator/components/addon-item/index.ts +1 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +126 -0
- package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +205 -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 +144 -0
- package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +241 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles.ts +74 -0
- package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +72 -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 +3 -0
- package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +334 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +369 -0
- package/src/WebComponent/FeeCalculator/index.ts +4 -0
- package/src/WebComponent/FeeCalculator/model/building-fee.ts +124 -0
- package/src/WebComponent/FeeCalculator/model/transaction-category.ts +23 -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 +190 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +1373 -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 +445 -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 +555 -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 +22 -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 +18 -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 +1282 -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/me-chat.ts +1262 -0
- package/src/WebComponent/me-select.ts +322 -0
- package/src/WebComponent/mega-loader.ts +36 -0
- package/src/WebComponent/mini-loader.ts +28 -0
- package/src/WebComponent/pubnub-chat-styles.ts +204 -0
- package/src/WebComponent/pubnub-chat.ts +928 -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 +58 -0
- package/src/fetchBuildingABTestType.ts +21 -0
- package/src/fetchBuildingInfo.ts +87 -0
- package/src/fetchBuildingWebchatView.ts +156 -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 +179 -0
- package/src/getBuildingPhoneNumber.ts +26 -0
- package/src/getShouldAllowScheduling.ts +16 -0
- package/src/getShouldShowWebchat.ts +114 -0
- package/src/getTimezoneString.ts +39 -0
- package/src/globals.ts +1 -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 +69 -0
- package/src/services/fees/calculateQuote.ts +136 -0
- package/src/services/fees/fetchBuildingFees.ts +63 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +74 -0
- package/src/services/fees/utils.ts +4 -0
- package/src/svgIcons.ts +14 -0
- package/src/themes.ts +65 -0
- package/src/types/rest-sdk.types.ts +13 -0
- package/src/types/webchat-no-show-reason.ts +6 -0
- package/src/utils.ts +121 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { LitElement, html, TemplateResult, css } from "lit";
|
|
2
|
+
import { property, state, query, customElement } from "lit/decorators.js";
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import { isMobile } from "../utils";
|
|
5
|
+
import { InputStyles } from "./actions/InputStyles";
|
|
6
|
+
|
|
7
|
+
type MeSelectOption = {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
@customElement("me-select")
|
|
13
|
+
export class MESelect extends LitElement {
|
|
14
|
+
@property({ attribute: false })
|
|
15
|
+
options: MeSelectOption[] = [];
|
|
16
|
+
|
|
17
|
+
@property({ type: String })
|
|
18
|
+
placeholder?: string = "Select";
|
|
19
|
+
|
|
20
|
+
@property({ type: String })
|
|
21
|
+
value?: string;
|
|
22
|
+
|
|
23
|
+
@state()
|
|
24
|
+
private activeOption: MeSelectOption | null = null;
|
|
25
|
+
|
|
26
|
+
@state()
|
|
27
|
+
private isOpen?: boolean = false;
|
|
28
|
+
|
|
29
|
+
@state()
|
|
30
|
+
private activeOptionIndex: number | null = null;
|
|
31
|
+
|
|
32
|
+
@query("#select", true)
|
|
33
|
+
meSelect!: HTMLDivElement;
|
|
34
|
+
|
|
35
|
+
focus = (): void => {
|
|
36
|
+
this.meSelect.focus();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
toggleSelect = (): void => {
|
|
40
|
+
if (this.isOpen) {
|
|
41
|
+
this.activeOption = null;
|
|
42
|
+
}
|
|
43
|
+
this.isOpen = !this.isOpen;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
setSelectedOption = (option: MeSelectOption, closeSelect = true): void => {
|
|
47
|
+
if (this.value !== option.value) {
|
|
48
|
+
this.value = option.value;
|
|
49
|
+
} else {
|
|
50
|
+
this.value = undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (closeSelect) {
|
|
54
|
+
this.isOpen = !this.isOpen;
|
|
55
|
+
this.activeOption = null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!this.value) {
|
|
59
|
+
this.meSelect.style.color = "rgba(32, 32, 32, 0.5)";
|
|
60
|
+
} else {
|
|
61
|
+
this.meSelect.style.color = "rgba(32, 32, 32, 1)";
|
|
62
|
+
}
|
|
63
|
+
this.dispatchEvent(new Event("change", { bubbles: true, composed: true }));
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
handleKeydown = (
|
|
67
|
+
keyOrKeys: string | string[],
|
|
68
|
+
callback: () => void
|
|
69
|
+
): ((event: KeyboardEvent) => void) => {
|
|
70
|
+
return (e: KeyboardEvent) => {
|
|
71
|
+
if (typeof keyOrKeys === "string" && e.key === keyOrKeys) {
|
|
72
|
+
callback();
|
|
73
|
+
} else if (typeof keyOrKeys === "object" && keyOrKeys.includes(e.key)) {
|
|
74
|
+
callback();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
private adjustScrollToActiveOption(): void {
|
|
80
|
+
if (this.activeOptionIndex != null) {
|
|
81
|
+
const optionElements = this.renderRoot.querySelectorAll(".option");
|
|
82
|
+
const activeOptionElement = optionElements[this.activeOptionIndex];
|
|
83
|
+
if (activeOptionElement) {
|
|
84
|
+
activeOptionElement.scrollIntoView({ block: "nearest" });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
constructor() {
|
|
90
|
+
super();
|
|
91
|
+
// TODO: the current thing works, but want to investigate more. why doesn't it work with `this`?
|
|
92
|
+
// https://lamplightdev.com/blog/2021/04/10/how-to-detect-clicks-outside-of-a-web-component/
|
|
93
|
+
// TODO: "If your component adds an event listener to anything except itself or its templated DOM
|
|
94
|
+
// – for example, to Window, Document, or some element in the main DOM – you should add the
|
|
95
|
+
// listener in connectedCallback and remove it in disconnectedCallback." (https://lit.dev/docs/components/events/)
|
|
96
|
+
document.addEventListener("click", (event: MouseEvent) => {
|
|
97
|
+
if (!event.composedPath().includes(this.meSelect)) {
|
|
98
|
+
this.isOpen = false;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static styles = [
|
|
104
|
+
css`
|
|
105
|
+
:host {
|
|
106
|
+
--light-grey: #e3e3e3;
|
|
107
|
+
--active-option-color: #f5f7f9;
|
|
108
|
+
--light-border: 1px solid $light-border-color;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
#selectText {
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
border: none;
|
|
114
|
+
outline: none;
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
line-height: 14px;
|
|
117
|
+
font-family: "Helvetica Neue", Arial;
|
|
118
|
+
width: 100%;
|
|
119
|
+
padding: 0;
|
|
120
|
+
height: 14px;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
ul {
|
|
126
|
+
padding-left: 0;
|
|
127
|
+
margin-bottom: 0;
|
|
128
|
+
max-height: 140px;
|
|
129
|
+
overflow-y: scroll;
|
|
130
|
+
position: absolute;
|
|
131
|
+
min-height: 40px;
|
|
132
|
+
min-width: 144px;
|
|
133
|
+
max-width: 400px;
|
|
134
|
+
width: max-content;
|
|
135
|
+
background-color: white;
|
|
136
|
+
z-index: 20;
|
|
137
|
+
margin-top: 4px;
|
|
138
|
+
border: var(--light-border);
|
|
139
|
+
box-sizing: border-box;
|
|
140
|
+
box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.15);
|
|
141
|
+
border-radius: 10px;
|
|
142
|
+
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
line-height: 14px;
|
|
145
|
+
font-family: "Helvetica Neue", Arial;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#outer-select-container {
|
|
149
|
+
position: relative;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
#select {
|
|
153
|
+
width: -webkit-fill-available;
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
justify-content: space-between;
|
|
157
|
+
color: rgba(32, 32, 32, 0.5);
|
|
158
|
+
white-space: nowrap;
|
|
159
|
+
overflow: hidden;
|
|
160
|
+
text-overflow: ellipsis;
|
|
161
|
+
height: 30px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
::-webkit-scrollbar {
|
|
165
|
+
-webkit-appearance: none;
|
|
166
|
+
width: 8px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
::-webkit-scrollbar-thumb {
|
|
170
|
+
border-radius: 10px;
|
|
171
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
172
|
+
-webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.option {
|
|
176
|
+
list-style: none;
|
|
177
|
+
padding: 10px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.option:first-child {
|
|
181
|
+
border-top-left-radius: 10px;
|
|
182
|
+
border-top-right-radius: 10px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.option:last-child {
|
|
186
|
+
border-bottom-left-radius: 10px;
|
|
187
|
+
border-bottom-right-radius: 10px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* TODO: why two diff ones? copied from EWA but don't understand */
|
|
191
|
+
.option:active {
|
|
192
|
+
background-color: var(--light-grey);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.option.active {
|
|
196
|
+
background-color: var(--active-option-color);
|
|
197
|
+
}
|
|
198
|
+
`,
|
|
199
|
+
InputStyles,
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
firstUpdated = (): void => {
|
|
203
|
+
if (this.value && this.meSelect) {
|
|
204
|
+
this.meSelect.style.color = "rgba(32, 32, 32, 1)";
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
render(): TemplateResult {
|
|
208
|
+
return html`
|
|
209
|
+
<div id="outer-select-container">
|
|
210
|
+
<div
|
|
211
|
+
id="select"
|
|
212
|
+
class=${classMap({
|
|
213
|
+
["webchat-input"]: true,
|
|
214
|
+
["webchat-font__desktop"]: !isMobile(),
|
|
215
|
+
["webchat-font__mobile"]: isMobile(),
|
|
216
|
+
})}
|
|
217
|
+
tabindex="0"
|
|
218
|
+
@click=${() => (this.isOpen = !this.isOpen)}
|
|
219
|
+
@keydown="${(e: KeyboardEvent) => {
|
|
220
|
+
switch (e.key) {
|
|
221
|
+
case "Enter":
|
|
222
|
+
case " ":
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
if (this.isOpen && this.activeOption) {
|
|
225
|
+
this.setSelectedOption(this.activeOption);
|
|
226
|
+
} else {
|
|
227
|
+
this.toggleSelect();
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case "Escape":
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
this.isOpen = false;
|
|
233
|
+
break;
|
|
234
|
+
case "Tab":
|
|
235
|
+
if (this.isOpen) {
|
|
236
|
+
e.preventDefault();
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
case "ArrowUp":
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
if (this.isOpen && this.activeOptionIndex != null) {
|
|
242
|
+
this.activeOptionIndex = Math.max(
|
|
243
|
+
0,
|
|
244
|
+
this.activeOptionIndex - 1
|
|
245
|
+
);
|
|
246
|
+
this.activeOption = this.options[this.activeOptionIndex];
|
|
247
|
+
this.adjustScrollToActiveOption();
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
|
|
251
|
+
case "ArrowDown":
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
if (this.isOpen) {
|
|
254
|
+
if (this.activeOptionIndex == null) {
|
|
255
|
+
this.activeOptionIndex = 0;
|
|
256
|
+
} else if (this.activeOptionIndex < this.options.length - 1) {
|
|
257
|
+
this.activeOptionIndex++;
|
|
258
|
+
}
|
|
259
|
+
this.activeOption = this.options[this.activeOptionIndex];
|
|
260
|
+
this.adjustScrollToActiveOption();
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
}}"
|
|
265
|
+
>
|
|
266
|
+
${this.options.find((o) => o.value === this.value)?.label
|
|
267
|
+
? html` <span id="selectText"
|
|
268
|
+
>${this.options.find((o) => o.value === this.value)?.label ??
|
|
269
|
+
this.placeholder}</span
|
|
270
|
+
>`
|
|
271
|
+
: html` <input
|
|
272
|
+
readonly
|
|
273
|
+
placeholder="${this.placeholder}"
|
|
274
|
+
.value="${this.options.find((o) => o.value === this.value)
|
|
275
|
+
?.label ||
|
|
276
|
+
this.value ||
|
|
277
|
+
""}"
|
|
278
|
+
id="selectText"
|
|
279
|
+
/>`}
|
|
280
|
+
|
|
281
|
+
<svg
|
|
282
|
+
width="10"
|
|
283
|
+
height="6"
|
|
284
|
+
viewBox="0 0 10 6"
|
|
285
|
+
fill="none"
|
|
286
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
287
|
+
>
|
|
288
|
+
<path
|
|
289
|
+
d="M0.189941 1.25439L1.35369 0.0906372L4.84494 3.58189L8.33619 0.0906372L9.49994 1.25439L4.84494 5.90939L0.189941 1.25439Z"
|
|
290
|
+
fill="#83818E"
|
|
291
|
+
/>
|
|
292
|
+
</svg>
|
|
293
|
+
</div>
|
|
294
|
+
${this.isOpen
|
|
295
|
+
? html`<ul>
|
|
296
|
+
${this.options.map(
|
|
297
|
+
(option) =>
|
|
298
|
+
html`<li
|
|
299
|
+
@click="${() => this.setSelectedOption(option)}"
|
|
300
|
+
@keydown="${this.handleKeydown(["Enter", " "], () =>
|
|
301
|
+
this.setSelectedOption(option)
|
|
302
|
+
)}"
|
|
303
|
+
@mousemove="${() => {
|
|
304
|
+
this.activeOption = option;
|
|
305
|
+
}}"
|
|
306
|
+
@mouseleave="${() => {
|
|
307
|
+
this.activeOption = null;
|
|
308
|
+
}}"
|
|
309
|
+
class="option ${classMap({
|
|
310
|
+
active: this.activeOption === option,
|
|
311
|
+
})}"
|
|
312
|
+
tabindex="0"
|
|
313
|
+
>
|
|
314
|
+
${option.label}
|
|
315
|
+
</li>`
|
|
316
|
+
)}
|
|
317
|
+
</ul>`
|
|
318
|
+
: ""}
|
|
319
|
+
</div>
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
|
|
4
|
+
@customElement("mega-loader")
|
|
5
|
+
export class MegaLoader extends LitElement {
|
|
6
|
+
static styles = css`
|
|
7
|
+
.spinner {
|
|
8
|
+
border: 4px solid rgba(0, 0, 0, 0.2);
|
|
9
|
+
border-top: 4px solid var(--primary-color, #c057ff);
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
width: var(--mega-loader-size, 64px);
|
|
12
|
+
height: var(--mega-loader-size, 64px);
|
|
13
|
+
animation: spin 0.8s linear infinite;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes spin {
|
|
17
|
+
0% {
|
|
18
|
+
transform: rotate(0deg);
|
|
19
|
+
}
|
|
20
|
+
100% {
|
|
21
|
+
transform: rotate(360deg);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
@property({ type: Number })
|
|
27
|
+
size = 64;
|
|
28
|
+
|
|
29
|
+
updated(): void {
|
|
30
|
+
this.style.setProperty("--mega-loader-size", `${this.size}px`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
render(): TemplateResult {
|
|
34
|
+
return html`<div class="spinner"></div>`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { css, html, LitElement, TemplateResult } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
@customElement("mini-loader")
|
|
4
|
+
export class MiniLoader extends LitElement {
|
|
5
|
+
static styles = css`
|
|
6
|
+
.spinner {
|
|
7
|
+
border: 2px solid rgba(0, 0, 0, 0.2);
|
|
8
|
+
border-top: 2px solid #c057ff;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
width: 6px;
|
|
11
|
+
height: 6px;
|
|
12
|
+
animation: spin 0.4s linear infinite;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@keyframes spin {
|
|
16
|
+
0% {
|
|
17
|
+
transform: rotate(0deg);
|
|
18
|
+
}
|
|
19
|
+
100% {
|
|
20
|
+
transform: rotate(360deg);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
render(): TemplateResult {
|
|
26
|
+
return html`<div class="spinner"></div>`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
|
|
3
|
+
export const pubnubChatStyles = css`
|
|
4
|
+
#header-text {
|
|
5
|
+
font-size: 12px;
|
|
6
|
+
font-weight: 700;
|
|
7
|
+
line-height: 18px;
|
|
8
|
+
letter-spacing: 0em;
|
|
9
|
+
text-align: left;
|
|
10
|
+
}
|
|
11
|
+
#header-subtext {
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
font-weight: light;
|
|
14
|
+
line-height: 18px;
|
|
15
|
+
letter-spacing: 0em;
|
|
16
|
+
text-align: left;
|
|
17
|
+
color: #737373;
|
|
18
|
+
}
|
|
19
|
+
#exit-chat-bttn {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
background: none;
|
|
24
|
+
border: none;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
#conversation-body {
|
|
28
|
+
flex: 1;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
overflow-y: scroll;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#message-thread-list {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
position: relative;
|
|
38
|
+
padding: 0px 16px;
|
|
39
|
+
gap: 12px;
|
|
40
|
+
list-style: none;
|
|
41
|
+
}
|
|
42
|
+
.lead-message {
|
|
43
|
+
background: black;
|
|
44
|
+
border-radius: 8px 8px 0px 8px;
|
|
45
|
+
|
|
46
|
+
align-self: flex-end;
|
|
47
|
+
color: white;
|
|
48
|
+
|
|
49
|
+
box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
|
|
50
|
+
box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
|
|
51
|
+
}
|
|
52
|
+
.message-container {
|
|
53
|
+
display: flex;
|
|
54
|
+
padding: 6px;
|
|
55
|
+
width: fit-content;
|
|
56
|
+
max-width: calc(100% - 60px);
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
}
|
|
59
|
+
.ai-message {
|
|
60
|
+
background: white;
|
|
61
|
+
border-radius: 10px 10px 10px 0px;
|
|
62
|
+
color: black;
|
|
63
|
+
box-shadow: 0px 18.048254013061523px 75.2010498046875px 0px #d9d9d91a;
|
|
64
|
+
box-shadow: 0px 1.7331933975219727px 2.599790096282959px 0px #0000000a;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.with-box-shadow {
|
|
68
|
+
box-shadow: 0px 8px 10px 0px rgba(0, 0, 0, 0.05);
|
|
69
|
+
}
|
|
70
|
+
.message-text {
|
|
71
|
+
word-break: break-word;
|
|
72
|
+
margin: 0;
|
|
73
|
+
padding: 6px 12px;
|
|
74
|
+
line-height: 130%;
|
|
75
|
+
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
font-weight: 400;
|
|
78
|
+
line-height: 17px;
|
|
79
|
+
letter-spacing: 0em;
|
|
80
|
+
text-align: left;
|
|
81
|
+
}
|
|
82
|
+
.message-text-large {
|
|
83
|
+
word-break: break-word;
|
|
84
|
+
margin: 0;
|
|
85
|
+
padding: 4px 8px;
|
|
86
|
+
line-height: 130%;
|
|
87
|
+
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
font-weight: 400;
|
|
90
|
+
line-height: 18px;
|
|
91
|
+
letter-spacing: 0em;
|
|
92
|
+
text-align: left;
|
|
93
|
+
}
|
|
94
|
+
.displayed-message-image {
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
max-height: 300px;
|
|
97
|
+
width: auto;
|
|
98
|
+
height: auto;
|
|
99
|
+
}
|
|
100
|
+
.displayed-message-image-error {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
.redirect-link {
|
|
104
|
+
color: inherit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#loading-message {
|
|
108
|
+
padding: 12px;
|
|
109
|
+
}
|
|
110
|
+
.loading-dot {
|
|
111
|
+
width: 4px;
|
|
112
|
+
height: 4px;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
margin: 5px;
|
|
115
|
+
animation: pulse 4s linear infinite;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.dot-1 {
|
|
119
|
+
background-color: #7d7d7d;
|
|
120
|
+
animation-delay: 0s;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.dot-2 {
|
|
124
|
+
background-color: #7d7d7d;
|
|
125
|
+
animation-delay: 1s;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dot-3 {
|
|
129
|
+
background-color: #7d7d7d;
|
|
130
|
+
animation-delay: 2s;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@keyframes pulse {
|
|
134
|
+
0% {
|
|
135
|
+
background-color: #7d7d7d;
|
|
136
|
+
transform: scale(1);
|
|
137
|
+
}
|
|
138
|
+
50% {
|
|
139
|
+
background-color: #c7c7c7;
|
|
140
|
+
transform: scale(2);
|
|
141
|
+
}
|
|
142
|
+
100% {
|
|
143
|
+
background-color: #7d7d7d;
|
|
144
|
+
transform: scale(1);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.hidden {
|
|
149
|
+
display: none !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.legal-confirmation-container {
|
|
153
|
+
display: flex;
|
|
154
|
+
flex-direction: column;
|
|
155
|
+
gap: 16px;
|
|
156
|
+
font-size: 14px;
|
|
157
|
+
line-height: 22px;
|
|
158
|
+
flex: 1;
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 100%;
|
|
161
|
+
background: #f5f5f5;
|
|
162
|
+
overflow-y: scroll;
|
|
163
|
+
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
|
164
|
+
border-bottom: 6px solid black;
|
|
165
|
+
|
|
166
|
+
padding: 12px;
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.legal-confirmation-inner-container {
|
|
171
|
+
margin: 0 16px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.privacy-policy-link {
|
|
175
|
+
color: blue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.agreeButton {
|
|
179
|
+
background: #000;
|
|
180
|
+
border-radius: 20px;
|
|
181
|
+
color: #fff;
|
|
182
|
+
padding: 8px 16px;
|
|
183
|
+
border: none;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
width: fit-content;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.confirmation-with-checkbox {
|
|
189
|
+
display: flex;
|
|
190
|
+
align: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
gap: 12px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.checkbox {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
}
|
|
201
|
+
.checkbox:hover {
|
|
202
|
+
opacity: 0.5;
|
|
203
|
+
}
|
|
204
|
+
`;
|