@meetelise/chat 1.21.0 → 1.21.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/.github/pull_request_template.md +61 -0
- package/.idea/codeStyles/Project.xml +57 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +67 -0
- package/README.md +29 -14
- package/declarations.d.ts +12 -0
- package/package.json +5 -1
- package/public/demo/index.html +62 -4
- package/public/demo/secret.html +63 -0
- package/public/dist/index.js +3184 -1105
- package/public/dist/index.js.LICENSE.txt +19 -9
- package/public/index.html +6 -4
- package/src/MEChat.ts +207 -52
- package/src/MyPubnub.ts +657 -0
- package/src/WebComponent/LeadSourceClient.ts +300 -0
- package/src/WebComponent/Scheduler/date-picker.ts +1 -1
- package/src/WebComponent/Scheduler/time-picker.ts +86 -76
- package/src/WebComponent/Scheduler/tour-scheduler.ts +694 -764
- package/src/WebComponent/Scheduler/tour-type-option.ts +17 -3
- package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +418 -0
- package/src/WebComponent/actions/InputStyles.ts +32 -10
- package/src/WebComponent/actions/action-confirm-button.ts +16 -11
- package/src/WebComponent/actions/call-us-window.ts +341 -58
- package/src/WebComponent/actions/details-window.ts +30 -16
- package/src/WebComponent/actions/email-us-window.ts +89 -58
- package/src/WebComponent/actions/formatPhoneNumber.ts +15 -1
- package/src/WebComponent/actions/minimize-expand-button.ts +92 -0
- package/src/WebComponent/health-chat.ts +267 -0
- package/src/WebComponent/healthcare/healthcare-launcher-styles.ts +34 -0
- package/src/WebComponent/healthcare/healthcare-launcher.ts +100 -0
- package/src/WebComponent/healthchat-styles.ts +119 -0
- package/src/WebComponent/index.ts +1 -1
- package/src/WebComponent/launcher/Launcher.ts +919 -0
- package/src/WebComponent/{launcherStyles.ts → launcher/launcherStyles.ts} +172 -29
- package/src/WebComponent/launcher/mobile-launcher.ts +127 -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 +964 -351
- package/src/WebComponent/me-select.ts +48 -21
- package/src/WebComponent/mini-loader.ts +28 -0
- package/src/WebComponent/pubnub-chat-styles.ts +192 -0
- package/src/WebComponent/pubnub-chat.ts +707 -0
- package/src/WebComponent/pubnub-media.ts +208 -0
- package/src/WebComponent/pubnub-message-styles.ts +54 -0
- package/src/WebComponent/pubnub-message.ts +421 -0
- package/src/analytics.ts +114 -14
- package/src/assetUrls.ts +2 -0
- package/src/disclaimers.ts +56 -0
- package/src/fetchBuildingABTestType.ts +4 -0
- package/src/fetchBuildingInfo.ts +25 -17
- package/src/fetchFeatureFlag.ts +147 -0
- package/src/fetchLeadSources.ts +67 -1
- package/src/fetchPhoneNumberFromSource.ts +31 -0
- package/src/fetchWebchatPreferences.ts +55 -0
- package/src/getAvailabilities.ts +7 -3
- package/src/getBuildingPhoneNumber.ts +26 -0
- package/src/getShouldAllowScheduling.ts +16 -0
- package/src/getTimezoneString.ts +39 -0
- package/src/gtm.ts +17 -0
- package/src/handleChatId.ts +101 -0
- package/src/insertDNIIntoWebsite.ts +136 -0
- package/src/insertLeadSourceIntoSchedulerLinks.ts +50 -0
- package/src/postLeadSources.ts +39 -35
- package/src/svgIcons.ts +62 -53
- package/src/themes.ts +47 -121
- package/src/utils.ts +88 -1
- package/src/WebComponent/Launcher.ts +0 -559
- package/src/WebComponent/actions/text-us-window.ts +0 -279
- package/src/chatID.ts +0 -64
- package/src/createConversation.ts +0 -57
- package/src/fetchCurrentParsedLeadSource.ts +0 -24
- package/src/getRegisteredPhoneNumbers.ts +0 -56
|
@@ -1,559 +0,0 @@
|
|
|
1
|
-
import classnames from "classnames";
|
|
2
|
-
import { html, LitElement, TemplateResult } from "lit";
|
|
3
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
4
|
-
import { createRef, ref, Ref } from "lit/directives/ref.js";
|
|
5
|
-
import { glowBarMp4, glowBarWebm } from "../assetUrls";
|
|
6
|
-
import { launcherStyles } from "./launcherStyles";
|
|
7
|
-
import { EmailUsWindow, installEmailUsWindow } from "./actions/email-us-window";
|
|
8
|
-
import { installTextUsWindow, TextUsWindow } from "./actions/text-us-window";
|
|
9
|
-
import { StyleInfo, styleMap } from "lit/directives/style-map.js";
|
|
10
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
11
|
-
import { installCallUsWindow } from "./actions/call-us-window";
|
|
12
|
-
import { getRegisteredPhoneNumbers } from "../getRegisteredPhoneNumbers";
|
|
13
|
-
import { TourScheduler } from "./Scheduler/tour-scheduler";
|
|
14
|
-
import { LabeledOption, UnitV2 } from "../fetchBuildingInfo";
|
|
15
|
-
import {
|
|
16
|
-
FilledChatIcon,
|
|
17
|
-
FilledEmailIcon,
|
|
18
|
-
FilledPhoneIcon,
|
|
19
|
-
FilledTourIcon,
|
|
20
|
-
OutlinedChatIcon,
|
|
21
|
-
OutlinedEmailIcon,
|
|
22
|
-
OutlinedPhoneIcon,
|
|
23
|
-
OutlinedTourIcon,
|
|
24
|
-
} from "../svgIcons";
|
|
25
|
-
|
|
26
|
-
@customElement("meetelise-launcher")
|
|
27
|
-
export class Launcher extends LitElement {
|
|
28
|
-
static styles = launcherStyles;
|
|
29
|
-
|
|
30
|
-
@property({ type: Boolean })
|
|
31
|
-
isMobile = false;
|
|
32
|
-
|
|
33
|
-
@property({ type: Boolean })
|
|
34
|
-
isFirstMount = false;
|
|
35
|
-
|
|
36
|
-
@property()
|
|
37
|
-
backgroundColor = "rgba(255, 255, 255, 0.75)";
|
|
38
|
-
|
|
39
|
-
@property()
|
|
40
|
-
textColor = "#202020";
|
|
41
|
-
|
|
42
|
-
@property({ type: Boolean })
|
|
43
|
-
isMini = true;
|
|
44
|
-
@property({ attribute: false })
|
|
45
|
-
autoOpenChatWidget = false;
|
|
46
|
-
|
|
47
|
-
@property()
|
|
48
|
-
phoneNumber = "";
|
|
49
|
-
@property({ attribute: true })
|
|
50
|
-
chatId = "";
|
|
51
|
-
@property({ attribute: true })
|
|
52
|
-
chatCallUsHeader = "";
|
|
53
|
-
@property({ attribute: false })
|
|
54
|
-
buildingId = 0;
|
|
55
|
-
@property({ attribute: true })
|
|
56
|
-
buildingSlug = "";
|
|
57
|
-
@property({ attribute: true })
|
|
58
|
-
orgSlug = "";
|
|
59
|
-
@property({ attribute: true })
|
|
60
|
-
sgtUrl = "";
|
|
61
|
-
@property({ attribute: true })
|
|
62
|
-
buildingABTestType = "";
|
|
63
|
-
@property({ attribute: false })
|
|
64
|
-
leadSources: string[] = [];
|
|
65
|
-
@property({ attribute: true })
|
|
66
|
-
currentLeadSource = "";
|
|
67
|
-
@property({ attribute: true })
|
|
68
|
-
escortedToursLink = "";
|
|
69
|
-
@property({ attribute: true })
|
|
70
|
-
virtualToursLink = "";
|
|
71
|
-
@property({ type: Boolean })
|
|
72
|
-
hasCallUsEnabled = false;
|
|
73
|
-
@property({ type: Boolean })
|
|
74
|
-
hasChatEnabled = false;
|
|
75
|
-
@property({ type: Boolean })
|
|
76
|
-
hasEmailEnabled = false;
|
|
77
|
-
@property({ type: Boolean })
|
|
78
|
-
hasSSTEnabled = false;
|
|
79
|
-
@property({ type: Boolean })
|
|
80
|
-
hasTextUsEnabled = false;
|
|
81
|
-
@property({ attribute: false })
|
|
82
|
-
layoutOptions: string[] = [];
|
|
83
|
-
@property({ attribute: false })
|
|
84
|
-
unitOptions: UnitV2[] = [];
|
|
85
|
-
@property({ attribute: false })
|
|
86
|
-
tourTypeOptions: LabeledOption[] = [];
|
|
87
|
-
@property({ attribute: false })
|
|
88
|
-
onChatTapped: () => void = () => {
|
|
89
|
-
return;
|
|
90
|
-
};
|
|
91
|
-
@property({ attribute: false })
|
|
92
|
-
launcherStyles: StyleInfo = {};
|
|
93
|
-
|
|
94
|
-
@state()
|
|
95
|
-
isEmailWindowOpen = false;
|
|
96
|
-
@state()
|
|
97
|
-
isCallUsWindowOpen = false;
|
|
98
|
-
@state()
|
|
99
|
-
isSSTWindowOpen = false;
|
|
100
|
-
@state()
|
|
101
|
-
isTextUsWindowOpen = false;
|
|
102
|
-
|
|
103
|
-
getNumCallToActions = (): number => {
|
|
104
|
-
return [
|
|
105
|
-
this.hasEmailEnabled,
|
|
106
|
-
!!this.phoneNumber && this.hasCallUsEnabled,
|
|
107
|
-
this.hasSSTEnabled,
|
|
108
|
-
this.hasTextUsEnabled,
|
|
109
|
-
].filter((v) => v).length;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
emailUsWindowRef: Ref<EmailUsWindow> = createRef();
|
|
113
|
-
textUsWindowRef: Ref<TextUsWindow> = createRef();
|
|
114
|
-
tourSchedulerRef: Ref<TourScheduler> = createRef();
|
|
115
|
-
|
|
116
|
-
updated = async (): Promise<void> => {
|
|
117
|
-
this.attachOnClickToEmailUsWindow();
|
|
118
|
-
this.attachOnClickToTextUsWindow();
|
|
119
|
-
this.attachOnClickToSSTWindow();
|
|
120
|
-
if (this.buildingId) {
|
|
121
|
-
const registeredPhoneNumbers = await getRegisteredPhoneNumbers(
|
|
122
|
-
this.buildingId
|
|
123
|
-
);
|
|
124
|
-
this.hasTextUsEnabled =
|
|
125
|
-
registeredPhoneNumbers.length > 0 &&
|
|
126
|
-
this.hasTextUsEnabled &&
|
|
127
|
-
this.buildingId !== 4895;
|
|
128
|
-
// TODO: replace this with the real API call once the endpoint exists
|
|
129
|
-
const schedulingIsEnabled = await (async function putApiCallHere(
|
|
130
|
-
buildingId: number
|
|
131
|
-
) {
|
|
132
|
-
return !!buildingId;
|
|
133
|
-
})(this.buildingId);
|
|
134
|
-
if (schedulingIsEnabled && this.hasSSTEnabled) {
|
|
135
|
-
this.hasSSTEnabled = true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
attachOnClickToEmailUsWindow = (): void => {
|
|
141
|
-
const emailUsWindowRef = this.emailUsWindowRef.value;
|
|
142
|
-
if (!emailUsWindowRef) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
emailUsWindowRef.onCloseClicked = this.onCloseEmailWindow;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
attachOnClickToTextUsWindow = (): void => {
|
|
149
|
-
const textUsWindowRef = this.textUsWindowRef.value;
|
|
150
|
-
if (!textUsWindowRef) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
textUsWindowRef.onCloseClicked = this.onCloseTextUsWindow;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
attachOnClickToSSTWindow = (): void => {
|
|
157
|
-
const sstWindowRef = this.tourSchedulerRef.value;
|
|
158
|
-
if (!sstWindowRef) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
sstWindowRef.onCloseClicked = this.onCloseSSTWindow;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
onClickEmailOption = (e: MouseEvent): void => {
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
e.stopPropagation();
|
|
167
|
-
|
|
168
|
-
this.isEmailWindowOpen = true;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
onCloseEmailWindow = (): void => {
|
|
172
|
-
this.isEmailWindowOpen = false;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
renderEmailOption = (): TemplateResult => {
|
|
176
|
-
const text = this.getNumCallToActions() > 2 ? "Email" : "Email us";
|
|
177
|
-
return html`
|
|
178
|
-
<div
|
|
179
|
-
@click=${this.onClickEmailOption}
|
|
180
|
-
class="launcher__call-to-action-option"
|
|
181
|
-
>
|
|
182
|
-
${text}
|
|
183
|
-
</div>
|
|
184
|
-
`;
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
onClickPhoneOption = (e: MouseEvent): void => {
|
|
188
|
-
e.preventDefault();
|
|
189
|
-
e.stopPropagation();
|
|
190
|
-
this.isCallUsWindowOpen = true;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
onClosePhoneWindow = (): void => {
|
|
194
|
-
this.isCallUsWindowOpen = false;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
renderCallUsOption = (): TemplateResult => {
|
|
198
|
-
const text = this.getNumCallToActions() > 2 ? "Phone" : "Hours/Phone";
|
|
199
|
-
return html` <div class="launcher__call-to-action-option">${text}</div> `;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
onClickSSTOption = (e: MouseEvent): void => {
|
|
203
|
-
e.preventDefault();
|
|
204
|
-
e.stopPropagation();
|
|
205
|
-
this.isSSTWindowOpen = true;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
onCloseSSTWindow = (): void => {
|
|
209
|
-
this.isSSTWindowOpen = false;
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
renderSSTOption = (): TemplateResult => {
|
|
213
|
-
const text = this.getNumCallToActions() > 2 ? "Book" : "Book a tour";
|
|
214
|
-
return html`
|
|
215
|
-
<div
|
|
216
|
-
class="launcher__call-to-action-option"
|
|
217
|
-
@click=${this.onClickSSTOption}
|
|
218
|
-
>
|
|
219
|
-
${text}
|
|
220
|
-
</div>
|
|
221
|
-
`;
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
onClickTextUsOption = (e: MouseEvent): void => {
|
|
225
|
-
e.preventDefault();
|
|
226
|
-
e.stopPropagation();
|
|
227
|
-
this.isTextUsWindowOpen = true;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
onCloseTextUsWindow = (): void => {
|
|
231
|
-
this.isTextUsWindowOpen = false;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
renderTextUsOption = (): TemplateResult => {
|
|
235
|
-
return html`
|
|
236
|
-
<div
|
|
237
|
-
@click=${this.onClickTextUsOption}
|
|
238
|
-
class="launcher__call-to-action-option"
|
|
239
|
-
>
|
|
240
|
-
Text us
|
|
241
|
-
</div>
|
|
242
|
-
`;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
renderCallToActions = (): TemplateResult => {
|
|
246
|
-
if (this.getNumCallToActions() === 0) {
|
|
247
|
-
return html``;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return html`
|
|
251
|
-
<div class="launcher__call-to-actions-wrapper">
|
|
252
|
-
${this.hasEmailEnabled ? this.renderEmailOption() : ""}
|
|
253
|
-
${this.phoneNumber && this.hasCallUsEnabled
|
|
254
|
-
? this.renderCallUsOption()
|
|
255
|
-
: ""}
|
|
256
|
-
${this.hasTextUsEnabled ? this.renderTextUsOption() : ""}
|
|
257
|
-
${this.hasSSTEnabled ? this.renderSSTOption() : ""}
|
|
258
|
-
</div>
|
|
259
|
-
`;
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
isCallToActionWindowOpen = (): boolean => {
|
|
263
|
-
return (
|
|
264
|
-
[
|
|
265
|
-
this.isEmailWindowOpen,
|
|
266
|
-
this.isCallUsWindowOpen,
|
|
267
|
-
this.isSSTWindowOpen,
|
|
268
|
-
this.isTextUsWindowOpen,
|
|
269
|
-
].filter((v) => v).length === 1
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
renderMiniOption = (
|
|
274
|
-
content: TemplateResult,
|
|
275
|
-
onClick?: (e: MouseEvent) => void,
|
|
276
|
-
isSecondaryAction?: boolean
|
|
277
|
-
): TemplateResult => {
|
|
278
|
-
return html`
|
|
279
|
-
<div class="launcher__mini-option-wrapper">
|
|
280
|
-
<div
|
|
281
|
-
@click=${onClick}
|
|
282
|
-
class=${classMap({
|
|
283
|
-
["launcher__mini-option"]: true,
|
|
284
|
-
["launcher__secondary-option"]: !!isSecondaryAction,
|
|
285
|
-
})}
|
|
286
|
-
>
|
|
287
|
-
${content}
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
`;
|
|
291
|
-
};
|
|
292
|
-
renderPillVertical = (
|
|
293
|
-
content: TemplateResult,
|
|
294
|
-
onClick: (e: MouseEvent) => void
|
|
295
|
-
): TemplateResult => {
|
|
296
|
-
return html`
|
|
297
|
-
<div @click=${onClick} class="inner-pill-wrapper">${content}</div>
|
|
298
|
-
`;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
renderActionPills = (): TemplateResult => {
|
|
302
|
-
if (this.buildingABTestType === "close") {
|
|
303
|
-
return html` <div class="vertical-pill-list">
|
|
304
|
-
${this.hasEmailEnabled && !this.isCallToActionWindowOpen()
|
|
305
|
-
? this.renderPillVertical(
|
|
306
|
-
html`
|
|
307
|
-
<div class="vertical-pill-icon">${FilledEmailIcon}</div>
|
|
308
|
-
<div class="vertical-pill-title">
|
|
309
|
-
<span class="vertical-pill-bold">Email</span> an agent
|
|
310
|
-
</div>
|
|
311
|
-
`,
|
|
312
|
-
this.onClickEmailOption
|
|
313
|
-
)
|
|
314
|
-
: ""}
|
|
315
|
-
${this.hasChatEnabled && !this.isCallToActionWindowOpen()
|
|
316
|
-
? this.renderPillVertical(
|
|
317
|
-
html`
|
|
318
|
-
<div class="vertical-pill-icon">${FilledChatIcon}</div>
|
|
319
|
-
<div class="vertical-pill-title">
|
|
320
|
-
<span class="vertical-pill-bold">Chat</span> with us
|
|
321
|
-
</div>
|
|
322
|
-
`,
|
|
323
|
-
this.onChatTapped
|
|
324
|
-
)
|
|
325
|
-
: ""}
|
|
326
|
-
${this.hasSSTEnabled && !this.isCallToActionWindowOpen()
|
|
327
|
-
? this.renderPillVertical(
|
|
328
|
-
html`
|
|
329
|
-
<div class="vertical-pill-icon">${FilledTourIcon}</div>
|
|
330
|
-
<div class="vertical-pill-title">
|
|
331
|
-
<span class="vertical-pill-bold">Book</span> a tour
|
|
332
|
-
</div>
|
|
333
|
-
`,
|
|
334
|
-
this.onClickSSTOption
|
|
335
|
-
)
|
|
336
|
-
: ""}
|
|
337
|
-
${this.phoneNumber &&
|
|
338
|
-
this.hasCallUsEnabled &&
|
|
339
|
-
!this.isCallToActionWindowOpen()
|
|
340
|
-
? this.renderPillVertical(
|
|
341
|
-
html`
|
|
342
|
-
<div class="vertical-pill-icon">${FilledPhoneIcon}</div>
|
|
343
|
-
<div class="vertical-pill-title">
|
|
344
|
-
<span class="vertical-pill-bold">Call</span>
|
|
345
|
-
${this.hasTextUsEnabled
|
|
346
|
-
? html`or <span class="vertical-pill-bold">text</span> us`
|
|
347
|
-
: "us"}
|
|
348
|
-
</div>
|
|
349
|
-
`,
|
|
350
|
-
this.onClickPhoneOption
|
|
351
|
-
)
|
|
352
|
-
: ""}
|
|
353
|
-
</div>`;
|
|
354
|
-
}
|
|
355
|
-
return html`
|
|
356
|
-
${this.hasChatEnabled && !this.isCallToActionWindowOpen()
|
|
357
|
-
? this.renderMiniOption(OutlinedChatIcon, this.onChatTapped)
|
|
358
|
-
: ""}
|
|
359
|
-
${this.hasEmailEnabled && !this.isCallToActionWindowOpen()
|
|
360
|
-
? this.renderMiniOption(
|
|
361
|
-
OutlinedEmailIcon,
|
|
362
|
-
this.onClickEmailOption,
|
|
363
|
-
true
|
|
364
|
-
)
|
|
365
|
-
: ""}
|
|
366
|
-
${this.hasSSTEnabled && !this.isCallToActionWindowOpen()
|
|
367
|
-
? this.renderMiniOption(OutlinedTourIcon, this.onClickSSTOption, true)
|
|
368
|
-
: ""}
|
|
369
|
-
${this.phoneNumber &&
|
|
370
|
-
this.hasCallUsEnabled &&
|
|
371
|
-
!this.isCallToActionWindowOpen()
|
|
372
|
-
? this.renderMiniOption(
|
|
373
|
-
OutlinedPhoneIcon,
|
|
374
|
-
this.onClickPhoneOption,
|
|
375
|
-
true
|
|
376
|
-
)
|
|
377
|
-
: ""}
|
|
378
|
-
`;
|
|
379
|
-
};
|
|
380
|
-
|
|
381
|
-
renderMiniLauncher = (): TemplateResult => {
|
|
382
|
-
return html`
|
|
383
|
-
<div
|
|
384
|
-
class="launcher__mini-launcher-wrapper"
|
|
385
|
-
style=${styleMap(this.launcherStyles)}
|
|
386
|
-
>
|
|
387
|
-
${this.isEmailWindowOpen
|
|
388
|
-
? html`<div class="launcher__window-wrapper">
|
|
389
|
-
<email-us-window
|
|
390
|
-
chatId="${this.chatId}"
|
|
391
|
-
.leadSources="${this.leadSources}"
|
|
392
|
-
currentLeadSource="${this.currentLeadSource}"
|
|
393
|
-
orgSlug="${this.orgSlug}"
|
|
394
|
-
buildingSlug="${this.buildingSlug}"
|
|
395
|
-
${ref(this.emailUsWindowRef)}
|
|
396
|
-
.buildingId=${this.buildingId}
|
|
397
|
-
>
|
|
398
|
-
</email-us-window>
|
|
399
|
-
</div>`
|
|
400
|
-
: ""}
|
|
401
|
-
${this.isTextUsWindowOpen
|
|
402
|
-
? html`<div class="launcher__window-wrapper">
|
|
403
|
-
<text-us-window
|
|
404
|
-
orgSlug="${this.orgSlug}"
|
|
405
|
-
buildingSlug="${this.buildingSlug}"
|
|
406
|
-
${ref(this.textUsWindowRef)}
|
|
407
|
-
.buildingId=${this.buildingId}
|
|
408
|
-
></text-us-window>
|
|
409
|
-
</div>`
|
|
410
|
-
: ""}
|
|
411
|
-
${this.isSSTWindowOpen
|
|
412
|
-
? html`<div class="launcher__window-wrapper">
|
|
413
|
-
<tour-scheduler
|
|
414
|
-
chatId="${this.chatId}"
|
|
415
|
-
orgSlug="${this.orgSlug}"
|
|
416
|
-
buildingSlug="${this.buildingSlug}"
|
|
417
|
-
sgtUrl="${this.sgtUrl}"
|
|
418
|
-
escortedToursLink="${this.escortedToursLink}"
|
|
419
|
-
virtualToursLink="${this.virtualToursLink}"
|
|
420
|
-
currentLeadSource="${this.currentLeadSource}"
|
|
421
|
-
.leadSources="${this.leadSources}"
|
|
422
|
-
.layoutOptions=${this.layoutOptions}
|
|
423
|
-
.unitOptions=${this.unitOptions}
|
|
424
|
-
.tourTypeOptions=${this.tourTypeOptions}
|
|
425
|
-
buildingId=${this.buildingId}
|
|
426
|
-
${ref(this.tourSchedulerRef)}
|
|
427
|
-
></tour-scheduler>
|
|
428
|
-
</div>`
|
|
429
|
-
: ""}
|
|
430
|
-
${this.isCallUsWindowOpen
|
|
431
|
-
? html`
|
|
432
|
-
<div class="launcher__window-wrapper">
|
|
433
|
-
<call-us-window
|
|
434
|
-
.onCloseClicked=${this.onClosePhoneWindow}
|
|
435
|
-
phoneNumber="${this.phoneNumber}"
|
|
436
|
-
.buildingId=${this.buildingId}
|
|
437
|
-
chatCallUsHeader="${this.chatCallUsHeader}"
|
|
438
|
-
hasTextUsEnabled=${this.hasTextUsEnabled ? true : ""}
|
|
439
|
-
></call-us-window>
|
|
440
|
-
</div>
|
|
441
|
-
`
|
|
442
|
-
: ""}
|
|
443
|
-
${this.renderActionPills()}
|
|
444
|
-
</div>
|
|
445
|
-
`;
|
|
446
|
-
};
|
|
447
|
-
|
|
448
|
-
render(): TemplateResult {
|
|
449
|
-
installEmailUsWindow();
|
|
450
|
-
installTextUsWindow();
|
|
451
|
-
installCallUsWindow();
|
|
452
|
-
if (this.isMini || this.buildingABTestType === "close") {
|
|
453
|
-
return this.renderMiniLauncher();
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
return html`
|
|
457
|
-
<div>
|
|
458
|
-
${this.isEmailWindowOpen
|
|
459
|
-
? html`<div class="launcher__window-wrapper">
|
|
460
|
-
<email-us-window
|
|
461
|
-
${ref(this.emailUsWindowRef)}
|
|
462
|
-
.buildingId=${this.buildingId}
|
|
463
|
-
>
|
|
464
|
-
</email-us-window>
|
|
465
|
-
</div>`
|
|
466
|
-
: ""}
|
|
467
|
-
${this.isTextUsWindowOpen
|
|
468
|
-
? html`<div class="launcher__window-wrapper">
|
|
469
|
-
<text-us-window
|
|
470
|
-
${ref(this.textUsWindowRef)}
|
|
471
|
-
.buildingId=${this.buildingId}
|
|
472
|
-
></text-us-window>
|
|
473
|
-
</div>`
|
|
474
|
-
: ""}
|
|
475
|
-
${this.isSSTWindowOpen
|
|
476
|
-
? html`<div class="launcher__window-wrapper">
|
|
477
|
-
<tour-scheduler
|
|
478
|
-
.layoutOptions=${this.layoutOptions}
|
|
479
|
-
.tourTypeOptions=${this.tourTypeOptions}
|
|
480
|
-
buildingId=${this.buildingId}
|
|
481
|
-
${ref(this.tourSchedulerRef)}
|
|
482
|
-
></tour-scheduler>
|
|
483
|
-
</div>`
|
|
484
|
-
: ""}
|
|
485
|
-
${this.isCallUsWindowOpen && this.phoneNumber
|
|
486
|
-
? html`
|
|
487
|
-
<div class="launcher__window-wrapper">
|
|
488
|
-
<call-us-window
|
|
489
|
-
.onCloseClicked=${this.onClosePhoneWindow}
|
|
490
|
-
phoneNumber="${this.phoneNumber}"
|
|
491
|
-
.buildingId=${this.buildingId}
|
|
492
|
-
hasTextUsEnabled=${this.hasTextUsEnabled ? true : ""}
|
|
493
|
-
></call-us-window>
|
|
494
|
-
</div>
|
|
495
|
-
`
|
|
496
|
-
: ""}
|
|
497
|
-
${!this.isCallToActionWindowOpen()
|
|
498
|
-
? html`
|
|
499
|
-
<div
|
|
500
|
-
@click=${this.onChatTapped}
|
|
501
|
-
class="${classnames(
|
|
502
|
-
"launcher",
|
|
503
|
-
this.isMobile ? "launcher__mobile" : "launcher__desktop",
|
|
504
|
-
{
|
|
505
|
-
firstMount: this.isFirstMount,
|
|
506
|
-
}
|
|
507
|
-
)}"
|
|
508
|
-
style="background-color: ${this.backgroundColor}; color: ${this
|
|
509
|
-
.textColor};"
|
|
510
|
-
>
|
|
511
|
-
<div
|
|
512
|
-
style=${styleMap({
|
|
513
|
-
position: "absolute",
|
|
514
|
-
})}
|
|
515
|
-
></div>
|
|
516
|
-
<video class="glowBar" autoplay loop muted playsinline>
|
|
517
|
-
<source src="${glowBarWebm}" type="video/webm" />
|
|
518
|
-
<source src="${glowBarMp4}" type="video/mp4" />
|
|
519
|
-
</video>
|
|
520
|
-
<div class="content">
|
|
521
|
-
<div class="launcher__primary-action">
|
|
522
|
-
<div class="launcher__primary-action-text">
|
|
523
|
-
Ask a question
|
|
524
|
-
<svg
|
|
525
|
-
width="21"
|
|
526
|
-
height="20"
|
|
527
|
-
viewBox="0 0 21 20"
|
|
528
|
-
fill="none"
|
|
529
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
530
|
-
>
|
|
531
|
-
<path
|
|
532
|
-
d="M15.0282 7H5.02819C4.76297 7 4.50862 7.10536 4.32108 7.29289C4.13354 7.48043 4.02819 7.73478 4.02819 8C4.02819 8.26522 4.13354 8.51957 4.32108 8.70711C4.50862 8.89464 4.76297 9 5.02819 9H15.0282C15.2934 9 15.5478 8.89464 15.7353 8.70711C15.9228 8.51957 16.0282 8.26522 16.0282 8C16.0282 7.73478 15.9228 7.48043 15.7353 7.29289C15.5478 7.10536 15.2934 7 15.0282 7ZM11.0282 11H5.02819C4.76297 11 4.50862 11.1054 4.32108 11.2929C4.13354 11.4804 4.02819 11.7348 4.02819 12C4.02819 12.2652 4.13354 12.5196 4.32108 12.7071C4.50862 12.8946 4.76297 13 5.02819 13H11.0282C11.2934 13 11.5478 12.8946 11.7353 12.7071C11.9228 12.5196 12.0282 12.2652 12.0282 12C12.0282 11.7348 11.9228 11.4804 11.7353 11.2929C11.5478 11.1054 11.2934 11 11.0282 11ZM10.0282 0C8.71497 0 7.41461 0.258658 6.20135 0.761205C4.9881 1.26375 3.8857 2.00035 2.95712 2.92893C1.08175 4.8043 0.0281864 7.34784 0.0281864 10C0.0194442 12.3091 0.818979 14.5485 2.28819 16.33L0.288186 18.33C0.149429 18.4706 0.0554325 18.6492 0.0180584 18.8432C-0.0193158 19.0372 0.0016069 19.2379 0.0781863 19.42C0.161244 19.5999 0.29589 19.7511 0.465033 19.8544C0.634176 19.9577 0.830187 20.0083 1.02819 20H10.0282C12.6804 20 15.2239 18.9464 17.0993 17.0711C18.9746 15.1957 20.0282 12.6522 20.0282 10C20.0282 7.34784 18.9746 4.8043 17.0993 2.92893C15.2239 1.05357 12.6804 0 10.0282 0ZM10.0282 18H3.43819L4.36819 17.07C4.55444 16.8826 4.65898 16.6292 4.65898 16.365C4.65898 16.1008 4.55444 15.8474 4.36819 15.66C3.05877 14.352 2.24336 12.6305 2.06088 10.7888C1.87839 8.94705 2.34013 7.09901 3.36741 5.55952C4.3947 4.02004 5.92398 2.88436 7.6947 2.34597C9.46543 1.80759 11.368 1.8998 13.0784 2.60691C14.7888 3.31402 16.201 4.59227 17.0746 6.22389C17.9482 7.85551 18.2291 9.73954 17.8693 11.555C17.5096 13.3705 16.5315 15.005 15.1017 16.1802C13.672 17.3554 11.8789 17.9985 10.0282 18Z"
|
|
533
|
-
fill="#1E1E1E"
|
|
534
|
-
/>
|
|
535
|
-
</svg>
|
|
536
|
-
</div>
|
|
537
|
-
<div class="launcher__ask-underline"></div>
|
|
538
|
-
</div>
|
|
539
|
-
${this.getNumCallToActions() === 0
|
|
540
|
-
? html`
|
|
541
|
-
<div class="launcher__filler-text">
|
|
542
|
-
I can also help you schedule a tour
|
|
543
|
-
</div>
|
|
544
|
-
`
|
|
545
|
-
: this.renderCallToActions()}
|
|
546
|
-
</div>
|
|
547
|
-
</div>
|
|
548
|
-
`
|
|
549
|
-
: ""}
|
|
550
|
-
</div>
|
|
551
|
-
`;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
export const installLauncher = (): void => {
|
|
556
|
-
if (!window.customElements.get("meetelise-launcher")) {
|
|
557
|
-
window.customElements.define("meetelise-launcher", Launcher);
|
|
558
|
-
}
|
|
559
|
-
};
|