@meetelise/chat 1.25.1 → 1.25.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.
Files changed (209) hide show
  1. package/coverage/lcov-report/index.html +1 -1
  2. package/coverage/lcov-report/index.js.html +1 -1
  3. package/package.json +1 -1
  4. package/.prettierignore +0 -2
  5. package/dist/src/MyPubnub.d.ts +0 -116
  6. package/dist/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.d.ts +0 -2
  7. package/dist/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.d.ts +0 -20
  8. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.d.ts +0 -2
  9. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +0 -14
  10. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.d.ts +0 -2
  11. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +0 -17
  12. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +0 -3
  13. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.d.ts +0 -2
  14. package/dist/src/WebComponent/FeeCalculator/components/promo-card/promo-card.d.ts +0 -13
  15. package/dist/src/WebComponent/FeeCalculator/fee-calculator-styles.d.ts +0 -1
  16. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +0 -31
  17. package/dist/src/WebComponent/FeeCalculator/index.d.ts +0 -2
  18. package/dist/src/WebComponent/FeeCalculator/model/building-fee.d.ts +0 -75
  19. package/dist/src/WebComponent/FeeCalculator/model/transaction-category.d.ts +0 -23
  20. package/dist/src/WebComponent/LeadSourceClient.d.ts +0 -46
  21. package/dist/src/WebComponent/OfficeHours.d.ts +0 -21
  22. package/dist/src/WebComponent/Scheduler/date-picker.d.ts +0 -28
  23. package/dist/src/WebComponent/Scheduler/time-picker.d.ts +0 -14
  24. package/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +0 -99
  25. package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +0 -13
  26. package/dist/src/WebComponent/Scheduler/tourSchedulerStyles.d.ts +0 -1
  27. package/dist/src/WebComponent/actions/InputStyles.d.ts +0 -1
  28. package/dist/src/WebComponent/actions/action-confirm-button.d.ts +0 -13
  29. package/dist/src/WebComponent/actions/call-us-window.d.ts +0 -37
  30. package/dist/src/WebComponent/actions/collapse-expand-button.d.ts +0 -8
  31. package/dist/src/WebComponent/actions/details-window.d.ts +0 -14
  32. package/dist/src/WebComponent/actions/email-us-window.d.ts +0 -46
  33. package/dist/src/WebComponent/actions/formatPhoneNumber.d.ts +0 -17
  34. package/dist/src/WebComponent/actions/minimize-expand-button.d.ts +0 -8
  35. package/dist/src/WebComponent/chat-additional-actions.d.ts +0 -28
  36. package/dist/src/WebComponent/health-chat.d.ts +0 -47
  37. package/dist/src/WebComponent/healthchat-styles.d.ts +0 -1
  38. package/dist/src/WebComponent/icons/ApplyOutlineIcon.d.ts +0 -2
  39. package/dist/src/WebComponent/icons/BookTourOutlineIcon.d.ts +0 -2
  40. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +0 -2
  41. package/dist/src/WebComponent/icons/ChatOutlineIcon.d.ts +0 -2
  42. package/dist/src/WebComponent/icons/ChevronLeftIcon.d.ts +0 -2
  43. package/dist/src/WebComponent/icons/ChevronRightIcon.d.ts +0 -2
  44. package/dist/src/WebComponent/icons/ContactResidentIcon.d.ts +0 -2
  45. package/dist/src/WebComponent/icons/DollarOutlineIcon.d.ts +0 -3
  46. package/dist/src/WebComponent/icons/EmailOutlineIcon.d.ts +0 -2
  47. package/dist/src/WebComponent/icons/HeyThereEmojiIcon.d.ts +0 -2
  48. package/dist/src/WebComponent/icons/PhoneOutlineIcon.d.ts +0 -2
  49. package/dist/src/WebComponent/icons/SendMessageIcon.d.ts +0 -3
  50. package/dist/src/WebComponent/icons/TourSelfGuidedIcon.d.ts +0 -2
  51. package/dist/src/WebComponent/icons/TourVirtuallyIcon.d.ts +0 -2
  52. package/dist/src/WebComponent/icons/TourWithAgentIcon.d.ts +0 -2
  53. package/dist/src/WebComponent/icons/XOutlineIcon.d.ts +0 -2
  54. package/dist/src/WebComponent/index.d.ts +0 -2
  55. package/dist/src/WebComponent/launcher/Launcher.d.ts +0 -98
  56. package/dist/src/WebComponent/launcher/launcherStyles.d.ts +0 -1
  57. package/dist/src/WebComponent/launcher/mobile-launcher.d.ts +0 -26
  58. package/dist/src/WebComponent/launcher/typeEmojiStyles.d.ts +0 -1
  59. package/dist/src/WebComponent/launcher/typeMiniStyles.d.ts +0 -1
  60. package/dist/src/WebComponent/launcher/typeMobileStyles.d.ts +0 -1
  61. package/dist/src/WebComponent/leasing-chat-styles.d.ts +0 -1
  62. package/dist/src/WebComponent/me-chat.d.ts +0 -91
  63. package/dist/src/WebComponent/me-select.d.ts +0 -24
  64. package/dist/src/WebComponent/mini-loader.d.ts +0 -5
  65. package/dist/src/WebComponent/pubnub-chat-styles.d.ts +0 -1
  66. package/dist/src/WebComponent/pubnub-chat.d.ts +0 -49
  67. package/dist/src/WebComponent/pubnub-media.d.ts +0 -14
  68. package/dist/src/WebComponent/pubnub-message-styles.d.ts +0 -1
  69. package/dist/src/WebComponent/pubnub-message.d.ts +0 -39
  70. package/dist/src/WebComponent/simple-launcher/simple-launcher-styles.d.ts +0 -1
  71. package/dist/src/WebComponent/simple-launcher/simple-launcher.d.ts +0 -12
  72. package/dist/src/WebComponent/utilities-chat.d.ts +0 -47
  73. package/dist/src/WebComponent/utilities-styles.d.ts +0 -1
  74. package/dist/src/WebComponent/utils.d.ts +0 -31
  75. package/dist/src/analytics.d.ts +0 -64
  76. package/dist/src/disclaimers.d.ts +0 -8
  77. package/dist/src/fetchBuildingABTestType.d.ts +0 -8
  78. package/dist/src/fetchBuildingInfo.d.ts +0 -57
  79. package/dist/src/fetchBuildingWebchatView.d.ts +0 -122
  80. package/dist/src/fetchFeatureFlag.d.ts +0 -14
  81. package/dist/src/fetchLeadSources.d.ts +0 -4
  82. package/dist/src/fetchPhoneNumberFromSource.d.ts +0 -6
  83. package/dist/src/getAvailabilities.d.ts +0 -44
  84. package/dist/src/getBuildingPhoneNumber.d.ts +0 -1
  85. package/dist/src/getShouldAllowScheduling.d.ts +0 -1
  86. package/dist/src/getShouldShowWebchat.d.ts +0 -3
  87. package/dist/src/getTimezoneString.d.ts +0 -1
  88. package/dist/src/globals.d.ts +0 -1
  89. package/dist/src/gtm.d.ts +0 -6
  90. package/dist/src/handleChatId.d.ts +0 -11
  91. package/dist/src/insertDNIIntoWebsite.d.ts +0 -5
  92. package/dist/src/insertLeadSourceIntoSchedulerLinks.d.ts +0 -4
  93. package/dist/src/main/MEChat.d.ts +0 -74
  94. package/dist/src/main/utils.d.ts +0 -2
  95. package/dist/src/postLeadSources.d.ts +0 -3
  96. package/dist/src/rentgrata.d.ts +0 -4
  97. package/dist/src/replaceSelectButtonsWithNewLink.d.ts +0 -5
  98. package/dist/src/services/fees/fetchBuildingFees.d.ts +0 -3
  99. package/dist/src/svgIcons.d.ts +0 -5
  100. package/dist/src/themes.d.ts +0 -5
  101. package/dist/src/types/rest-sdk.types.d.ts +0 -11
  102. package/dist/src/types/webchat-no-show-reason.d.ts +0 -1
  103. package/dist/src/utils.d.ts +0 -13
  104. package/public/demo/index.html +0 -347
  105. package/public/demo/secret.html +0 -63
  106. package/src/MyPubnub.ts +0 -792
  107. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section-styles.ts +0 -86
  108. package/src/WebComponent/FeeCalculator/components/collapsible-fee-section/collapsible-fee-section.ts +0 -94
  109. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item-styles.ts +0 -47
  110. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +0 -50
  111. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -46
  112. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +0 -70
  113. package/src/WebComponent/FeeCalculator/components/index.ts +0 -3
  114. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card-styles.ts +0 -39
  115. package/src/WebComponent/FeeCalculator/components/promo-card/promo-card.ts +0 -39
  116. package/src/WebComponent/FeeCalculator/fee-calculator-styles.ts +0 -280
  117. package/src/WebComponent/FeeCalculator/fee-calculator.ts +0 -256
  118. package/src/WebComponent/FeeCalculator/index.ts +0 -4
  119. package/src/WebComponent/FeeCalculator/model/building-fee.ts +0 -83
  120. package/src/WebComponent/FeeCalculator/model/transaction-category.ts +0 -23
  121. package/src/WebComponent/LeadSourceClient.ts +0 -332
  122. package/src/WebComponent/MEChat.css +0 -5
  123. package/src/WebComponent/OfficeHours.ts +0 -73
  124. package/src/WebComponent/Scheduler/date-picker.ts +0 -405
  125. package/src/WebComponent/Scheduler/time-picker.ts +0 -190
  126. package/src/WebComponent/Scheduler/tour-scheduler.ts +0 -1352
  127. package/src/WebComponent/Scheduler/tour-type-option.ts +0 -112
  128. package/src/WebComponent/Scheduler/tourSchedulerStyles.ts +0 -418
  129. package/src/WebComponent/actions/InputStyles.ts +0 -57
  130. package/src/WebComponent/actions/action-confirm-button.ts +0 -125
  131. package/src/WebComponent/actions/call-us-window.ts +0 -445
  132. package/src/WebComponent/actions/collapse-expand-button.ts +0 -65
  133. package/src/WebComponent/actions/details-window.ts +0 -150
  134. package/src/WebComponent/actions/email-us-window.ts +0 -555
  135. package/src/WebComponent/actions/formatPhoneNumber.ts +0 -72
  136. package/src/WebComponent/actions/minimize-expand-button.ts +0 -93
  137. package/src/WebComponent/chat-additional-actions.ts +0 -135
  138. package/src/WebComponent/health-chat.ts +0 -270
  139. package/src/WebComponent/healthchat-styles.ts +0 -119
  140. package/src/WebComponent/icons/ApplyOutlineIcon.ts +0 -22
  141. package/src/WebComponent/icons/BookTourOutlineIcon.ts +0 -13
  142. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +0 -22
  143. package/src/WebComponent/icons/ChatOutlineIcon.ts +0 -10
  144. package/src/WebComponent/icons/ChevronLeftIcon.ts +0 -7
  145. package/src/WebComponent/icons/ChevronRightIcon.ts +0 -7
  146. package/src/WebComponent/icons/ContactResidentIcon.ts +0 -9
  147. package/src/WebComponent/icons/DollarOutlineIcon.ts +0 -18
  148. package/src/WebComponent/icons/EmailOutlineIcon.ts +0 -7
  149. package/src/WebComponent/icons/HeyThereEmojiIcon.ts +0 -12
  150. package/src/WebComponent/icons/PhoneOutlineIcon.ts +0 -7
  151. package/src/WebComponent/icons/SendMessageIcon.ts +0 -17
  152. package/src/WebComponent/icons/TourSelfGuidedIcon.ts +0 -17
  153. package/src/WebComponent/icons/TourVirtuallyIcon.ts +0 -17
  154. package/src/WebComponent/icons/TourWithAgentIcon.ts +0 -17
  155. package/src/WebComponent/icons/XOutlineIcon.ts +0 -8
  156. package/src/WebComponent/index.ts +0 -2
  157. package/src/WebComponent/launcher/Launcher.ts +0 -1193
  158. package/src/WebComponent/launcher/launcherStyles.ts +0 -500
  159. package/src/WebComponent/launcher/mobile-launcher.ts +0 -159
  160. package/src/WebComponent/launcher/typeEmojiStyles.ts +0 -161
  161. package/src/WebComponent/launcher/typeMiniStyles.ts +0 -60
  162. package/src/WebComponent/launcher/typeMobileStyles.ts +0 -50
  163. package/src/WebComponent/leasing-chat-styles.ts +0 -114
  164. package/src/WebComponent/me-chat.ts +0 -1257
  165. package/src/WebComponent/me-select.ts +0 -322
  166. package/src/WebComponent/mini-loader.ts +0 -28
  167. package/src/WebComponent/pubnub-chat-styles.ts +0 -204
  168. package/src/WebComponent/pubnub-chat.ts +0 -928
  169. package/src/WebComponent/pubnub-media.ts +0 -208
  170. package/src/WebComponent/pubnub-message-styles.ts +0 -54
  171. package/src/WebComponent/pubnub-message.ts +0 -431
  172. package/src/WebComponent/simple-launcher/simple-launcher-styles.ts +0 -34
  173. package/src/WebComponent/simple-launcher/simple-launcher.ts +0 -100
  174. package/src/WebComponent/utilities-chat.ts +0 -270
  175. package/src/WebComponent/utilities-styles.ts +0 -110
  176. package/src/WebComponent/utils.ts +0 -82
  177. package/src/analytics.ts +0 -217
  178. package/src/assetUrls.ts +0 -6
  179. package/src/disclaimers.ts +0 -58
  180. package/src/fetchBuildingABTestType.ts +0 -21
  181. package/src/fetchBuildingInfo.ts +0 -87
  182. package/src/fetchBuildingWebchatView.ts +0 -154
  183. package/src/fetchFeatureFlag.ts +0 -250
  184. package/src/fetchLeadSources.ts +0 -98
  185. package/src/fetchPhoneNumberFromSource.ts +0 -31
  186. package/src/fetchWebchatPreferences.ts +0 -54
  187. package/src/getAvailabilities.ts +0 -174
  188. package/src/getBuildingPhoneNumber.ts +0 -26
  189. package/src/getShouldAllowScheduling.ts +0 -16
  190. package/src/getShouldShowWebchat.ts +0 -114
  191. package/src/getTimezoneString.ts +0 -39
  192. package/src/globals.ts +0 -1
  193. package/src/gtm.ts +0 -17
  194. package/src/handleChatId.ts +0 -101
  195. package/src/insertDNIIntoWebsite.ts +0 -146
  196. package/src/insertLeadSourceIntoSchedulerLinks.ts +0 -71
  197. package/src/main/MEChat.test.ts +0 -110
  198. package/src/main/MEChat.ts +0 -404
  199. package/src/main/utils.ts +0 -70
  200. package/src/postLeadSources.ts +0 -44
  201. package/src/rentgrata.ts +0 -74
  202. package/src/replaceSelectButtonsWithNewLink.ts +0 -68
  203. package/src/services/fees/fetchBuildingFees.ts +0 -28
  204. package/src/svgIcons.ts +0 -14
  205. package/src/themes.ts +0 -65
  206. package/src/types/rest-sdk.types.ts +0 -13
  207. package/src/types/webchat-no-show-reason.ts +0 -6
  208. package/src/utils.ts +0 -121
  209. package/tsconfig.json +0 -84
@@ -1,445 +0,0 @@
1
- import axios from "axios";
2
- import { css, html, LitElement, TemplateResult } from "lit";
3
- import { customElement, property, state } from "lit/decorators.js";
4
- import { classMap } from "lit/directives/class-map.js";
5
- import { createRef, ref, Ref } from "lit/directives/ref.js";
6
- import { pushGtmEvent } from "../../gtm";
7
- import { isMobile } from "../../utils";
8
- import { PhoneOutlineIcon } from "../icons/PhoneOutlineIcon";
9
- import LeadSourceClient, {
10
- getDefaultLeadSourceAttribution,
11
- } from "../LeadSourceClient";
12
-
13
- import { getOfficeHourText } from "../OfficeHours";
14
- import {
15
- formatToPhoneInput,
16
- isModifierKey,
17
- isNumericInput,
18
- } from "./formatPhoneNumber";
19
- import { InputStyles } from "./InputStyles";
20
-
21
- @customElement("call-us-window")
22
- export class CallUsWindow extends LitElement {
23
- static styles = [
24
- InputStyles,
25
- css`
26
- #call-us-window__content-wrapper {
27
- font-family: "Helvetica Neue", Arial;
28
- font-style: normal;
29
- color: 11ee1e;
30
- font-size: 14px;
31
- }
32
- .call-us-window__header {
33
- font-family: "Helvetica Neue", Arial;
34
- font-style: normal;
35
- font-weight: 700;
36
- line-height: 140%;
37
- font-size: 14px;
38
- margin: 0;
39
- }
40
-
41
- .call-us-window__call-us-text {
42
- margin: 0 0 10px;
43
- }
44
-
45
- .call-us-window__phone-redirect {
46
- display: flex;
47
- justify-content: flex-start;
48
- align-items: center;
49
- margin-bottom: 28px;
50
- gap: 8px;
51
-
52
- color: #202020;
53
- font-size: 18px;
54
- line-height: 24px;
55
- }
56
- .call-us-window__phone-redirect > a {
57
- color: unset;
58
- text-decoration: underline;
59
- }
60
-
61
- .call-us-window__office-hours-wrapper {
62
- margin: 0 0 16px;
63
- }
64
-
65
- .call-us-window__oh-header {
66
- line-height: 32px;
67
- font-weight: 400;
68
- }
69
- .call-us-window__day-of-week-wrapper {
70
- font-weight: 400;
71
- line-height: 22px;
72
- color: #202020;
73
- }
74
-
75
- .call-us-window__day-of-week {
76
- width: 100px;
77
- text-transform: Capitalize;
78
- }
79
-
80
- .call-us-window__day-of-week-wrapper {
81
- display: flex;
82
- align-items: center;
83
- margin-bottom: 5px;
84
- }
85
-
86
- .call-us-window__open-times {
87
- width: 123px;
88
- text-transform: lowercase;
89
- text-align: right;
90
- }
91
-
92
- .text-us-wrapper {
93
- color: #202020;
94
- }
95
- .text-us-window__header {
96
- font-family: "Helvetica Neue", Arial;
97
- font-style: normal;
98
- font-weight: 700;
99
- line-height: 140%;
100
- font-size: 14px;
101
- margin: 0;
102
- }
103
-
104
- .text-us-window__input-container {
105
- margin-top: 8px;
106
- margin-bottom: 8px;
107
- width: -webkit-fill-available;
108
- position: relative;
109
- }
110
- .text-us-window__submit-text {
111
- position: absolute;
112
- top: 14px;
113
- right: 6px;
114
- }
115
- .text-us-window__vertical-spacer {
116
- height: 20px;
117
- }
118
- .text-us-window__description,
119
- .text-us-window__error {
120
- font-family: "Helvetica Neue", Arial;
121
- font-style: normal;
122
- font-weight: 400;
123
- font-size: 10px;
124
- line-height: 14px;
125
- }
126
-
127
- .text-us-window__error {
128
- color: rgb(255, 49, 3);
129
- }
130
- `,
131
- ];
132
-
133
- @property({ attribute: true })
134
- buildingSlug = "";
135
- @property({ attribute: true })
136
- orgSlug = "";
137
-
138
- @property({ attribute: false })
139
- onCloseClicked?: (e: MouseEvent) => void;
140
-
141
- @property()
142
- phoneNumberToCall = "";
143
-
144
- @property()
145
- phoneNumberToText = "";
146
-
147
- @property({ attribute: false })
148
- buildingId = 0;
149
- @property({ attribute: false })
150
- buildingName = "";
151
- @property({ attribute: true })
152
- chatCallUsHeader = "";
153
-
154
- @property({ attribute: true })
155
- hasCallUsEnabled = "";
156
-
157
- @property({ attribute: true })
158
- hasTextUsEnabled = "";
159
-
160
- @property({ attribute: true })
161
- currentLeadSource = "";
162
-
163
- @property({ attribute: true })
164
- orgLegalName = "";
165
-
166
- @property({ attribute: true })
167
- private leadSourceClient: LeadSourceClient | null = null;
168
-
169
- phoneNumberInputRef: Ref<HTMLInputElement> = createRef();
170
-
171
- @state()
172
- hasSubmittedForm = false;
173
- @state()
174
- hasPhoneNumberError = false;
175
- @state()
176
- hasSubmissionError = false;
177
-
178
- @state()
179
- submittingTextUsOption = false;
180
-
181
- @property({ attribute: false })
182
- officeHoursTextInfo: (
183
- | string
184
- | { dayOfWeek: string; startTime: string; endTime: string }
185
- )[] = [];
186
-
187
- firstUpdated = async (): Promise<void> => {
188
- if (!this.buildingId || !this.hasCallUsEnabled) return;
189
- this.officeHoursTextInfo = await getOfficeHourText(this.buildingId);
190
- };
191
-
192
- getCallLink = (phoneNumber: string): TemplateResult => {
193
- const rawNumber = (phoneNumber.match(/\d+/g) || []).join("");
194
- const rawInternationalNumber =
195
- rawNumber.length < 11 ? `1${rawNumber}` : rawNumber;
196
- const formattedInternationalNumber = `+${
197
- rawInternationalNumber[0]
198
- }-${rawInternationalNumber.slice(1, 4)}-${rawInternationalNumber.slice(
199
- 4,
200
- 7
201
- )}-${rawInternationalNumber.slice(7)}`;
202
- return html`<a href="tel:${formattedInternationalNumber}"
203
- >${phoneNumber}</a
204
- >`;
205
- };
206
-
207
- enforcePhoneFormat = (e: KeyboardEvent): void => {
208
- if (!isNumericInput(e) && !isModifierKey(e)) {
209
- e.preventDefault();
210
- }
211
- };
212
- onSubmitTextUs = async (): Promise<void> => {
213
- this.hasPhoneNumberError = false;
214
- this.hasSubmissionError = false;
215
- if (!this.phoneNumberToText || this.phoneNumberToText.length !== 14) {
216
- this.hasPhoneNumberError = true;
217
- }
218
- if (this.hasPhoneNumberError) {
219
- return;
220
- }
221
- try {
222
- this.submittingTextUsOption = true;
223
- await createTextWithUs(
224
- this.phoneNumberToText,
225
- this.buildingId,
226
- this.orgSlug,
227
- this.buildingSlug,
228
- [
229
- ...new Set(
230
- this.currentLeadSource
231
- ? [
232
- this.currentLeadSource,
233
- getDefaultLeadSourceAttribution(this.orgSlug),
234
- ]
235
- : [getDefaultLeadSourceAttribution(this.orgSlug)]
236
- ),
237
- ],
238
- this.leadSourceClient?.chatId
239
- );
240
- this.leadSourceClient?.checkAndHandleForLogLeadSource({
241
- webchatAction: "text-us",
242
- stateId: null,
243
- });
244
- this.hasSubmittedForm = true;
245
- this.submittingTextUsOption = false;
246
- } catch (e) {
247
- this.submittingTextUsOption = false;
248
- this.hasSubmissionError = true;
249
- }
250
- };
251
-
252
- onChangePhoneNumber = (e: Event): void => {
253
- if (!e.target || !this.phoneNumberInputRef.value) {
254
- return;
255
- }
256
- if (isModifierKey(e as KeyboardEvent)) {
257
- return;
258
- }
259
- const inputElement = e.target as HTMLInputElement;
260
-
261
- this.phoneNumberToText = formatToPhoneInput(inputElement.value);
262
-
263
- this.phoneNumberInputRef.value.value = this.phoneNumberToText;
264
- };
265
-
266
- private renderFormTextUsOption = (): TemplateResult => {
267
- return html` <div class="text-us-wrapper">
268
- <h1 class="text-us-window__header">Send Us a Text</h1>
269
- <div class="text-us-window__input-container">
270
- <input
271
- ${ref(this.phoneNumberInputRef)}
272
- maxlength="14"
273
- type="text"
274
- placeholder="Enter phone"
275
- inputmode="tel"
276
- class=${classMap({
277
- ["webchat-input"]: true,
278
- ["text-us-window__input-container"]: true,
279
- ["webchat-font__desktop"]: !isMobile(),
280
- ["webchat-font__mobile"]: isMobile(),
281
- })}
282
- .value=${this.phoneNumberToText}
283
- @keydown=${this.enforcePhoneFormat}
284
- @keyup=${this.onChangePhoneNumber}
285
- />
286
- <div class="text-us-window__submit-text">
287
- <action-confirm-button
288
- .onClick=${this.onSubmitTextUs}
289
- .isLoading=${this.submittingTextUsOption}
290
- text="SEND"
291
- ></action-confirm-button>
292
- </div>
293
- ${this.hasPhoneNumberError
294
- ? html`
295
- <div class="text-us-window__error">
296
- Enter a valid phone number
297
- </div>
298
- `
299
- : ""}
300
- </div>
301
-
302
- <div class="text-us-window__description">
303
- By providing your number and clicking send, you consent to receive
304
- recurring marketing calls and voice and text messages from or on behalf
305
- of ${this.orgLegalName} at this number using artificial voice or an
306
- autodialer system. Messages may be AI or human generated. This consent
307
- is not required to lease at this property. Msg & Data rates may apply.
308
- You consent to this
309
- <a target="_blank" href="http://bit.ly/me_privacy_policy"
310
- >privacy policy</a
311
- >, including having your number and communications recorded and used by
312
- a third party.
313
- </div>
314
- </div>`;
315
- };
316
-
317
- private renderSubmittedTextUsOption = (): TemplateResult => {
318
- return html`
319
- <div id="text-us-container-focus" class="text-us-wrapper">
320
- <div class="text-us-window__vertical-spacer"></div>
321
- <svg
322
- width="20"
323
- height="20"
324
- viewBox="0 0 20 20"
325
- fill="none"
326
- xmlns="http://www.w3.org/2000/svg"
327
- >
328
- <path
329
- d="M4.455 16L0 19.5V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H19C19.2652 0 19.5196 0.105357 19.7071 0.292893C19.8946 0.48043 20 0.734784 20 1V15C20 15.2652 19.8946 15.5196 19.7071 15.7071C19.5196 15.8946 19.2652 16 19 16H4.455ZM2 15.385L3.763 14H18V2H2V15.385ZM10 7V4L14 8L10 12V9H6V7H10Z"
330
- fill="#202020"
331
- />
332
- </svg>
333
- <div class="text-us-window__description">
334
- Thank you!<br />Look for a text message from our team. We can answer
335
- questions and help you book a tour through text.
336
- </div>
337
- <div class="text-us-window__description">
338
- Opt out at anytime by texting “Stop”
339
- </div>
340
- </div>
341
- `;
342
- };
343
-
344
- render = (): TemplateResult => {
345
- return html`
346
- <details-window
347
- id="details-window"
348
- height=${this.hasTextUsEnabled ? "600px" : "443px"}
349
- .onCloseClick=${this.onCloseClicked}
350
- >
351
- ${this.hasCallUsEnabled
352
- ? html` <div id="call-us-window__content-wrapper">
353
- <h1 class="call-us-window__call-us-text call-us-window__header">
354
- Contact Our Leasing Team
355
- </h1>
356
- <div class="call-us-window__phone-redirect">
357
- ${PhoneOutlineIcon("black")}
358
- ${this.getCallLink(this.phoneNumberToCall)}
359
- </div>
360
- <div class="call-us-window__office-hours-wrapper">
361
- <h1 class="call-us-window__oh-header call-us-window__header">
362
- Office Hours
363
- </h1>
364
- ${this.officeHoursTextInfo.map((oh) => {
365
- if (typeof oh === "string") {
366
- return html`
367
- <div class="call-us-window__day-of-week-wrapper">
368
- <div class="call-us-window__day-of-week">${oh}</div>
369
- <div class="call-us-window__closed">Closed</div>
370
- </div>
371
- `;
372
- }
373
- return html`
374
- <div class="call-us-window__day-of-week-wrapper">
375
- <div class="call-us-window__day-of-week">
376
- ${oh.dayOfWeek}
377
- </div>
378
- <div class="call-us-window__open-times">
379
- ${oh.startTime}&nbsp;&ndash;&nbsp;${oh.endTime}
380
- </div>
381
- </div>
382
- `;
383
- })}
384
- </div>
385
- </div>`
386
- : ""}
387
- ${this.hasTextUsEnabled
388
- ? this.hasSubmittedForm
389
- ? this.renderSubmittedTextUsOption()
390
- : this.renderFormTextUsOption()
391
- : ""}
392
- </details-window>
393
- `;
394
- };
395
- }
396
-
397
- export const installCallUsWindow = (): void => {
398
- if (!window.customElements.get("call-us-window")) {
399
- window.customElements.define("call-us-window", CallUsWindow);
400
- }
401
- };
402
-
403
- const createTextWithUs = async (
404
- rawPhoneNumber: string,
405
- buildingId: number,
406
- orgSlug: string,
407
- buildingSlug: string,
408
- leadSources: string[],
409
- chatId?: string | null
410
- ) => {
411
- const formattedPhoneNumber =
412
- "+1" +
413
- rawPhoneNumber
414
- .replace("(", "")
415
- .replace(")", "")
416
- .replace(" ", "")
417
- .replace("-", "");
418
- const queryParams = new URLSearchParams(window.location.search);
419
- const requestBody = {
420
- building_id: buildingId,
421
- lead_sources: leadSources,
422
- phone_number: formattedPhoneNumber,
423
- referrer: document.referrer,
424
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
425
- // @ts-ignore
426
- query_params: Object.fromEntries(queryParams.entries()),
427
- conversation_tracking_id: chatId,
428
- };
429
- pushGtmEvent("textUsSubmitted", {
430
- phone: formattedPhoneNumber,
431
- originatingSource:
432
- leadSources.find((i) => i !== "property-website") || null,
433
- });
434
- await axios.post(
435
- "https://app.meetelise.com/platformApi/state/create/textMe",
436
- requestBody,
437
- {
438
- headers: {
439
- ["building-slug"]: buildingSlug,
440
- ["org-slug"]: orgSlug,
441
- ["X-SecurityKey"]: "JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG",
442
- },
443
- }
444
- );
445
- };
@@ -1,65 +0,0 @@
1
- import { css, html, LitElement, TemplateResult } from "lit";
2
- import { customElement, property } from "lit/decorators.js";
3
- import { styleMap } from "lit/directives/style-map.js";
4
- import { defaultPrimaryColor } from "../../themes";
5
- import { ChevronLeftIcon } from "../icons/ChevronLeftIcon";
6
- import { ChevronRightIcon } from "../icons/ChevronRightIcon";
7
-
8
- @customElement("collapse-expand-button")
9
- export class CollapseExpandButton extends LitElement {
10
- static styles = [
11
- css`
12
- .button-container {
13
- width: 36px;
14
- height: 36px;
15
- background: #ffffff;
16
- border: 1px solid rgba(95, 95, 95, 0.2);
17
- border-radius: 1000px;
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
- cursor: pointer;
22
- }
23
- .inner-container {
24
- width: 30px;
25
- height: 30px;
26
- border-radius: 1000px;
27
- border: 1px solid rgba(255, 255, 255, 0.7);
28
- display: flex;
29
- justify-content: center;
30
- align-items: center;
31
- }
32
- .button-container:hover {
33
- filter: brightness(90%);
34
- }
35
- `,
36
- ];
37
-
38
- @property({ attribute: true })
39
- onClick: () => void = () => {
40
- return;
41
- };
42
-
43
- @property({ attribute: true })
44
- primaryColor: string = defaultPrimaryColor;
45
-
46
- @property({ attribute: true })
47
- toExpand = false;
48
-
49
- render(): TemplateResult {
50
- return html`
51
- <div class=${"button-container"} @click=${this.onClick}>
52
- <div
53
- class="inner-container"
54
- style=${styleMap({
55
- background: this.primaryColor,
56
- })}
57
- >
58
- ${this.toExpand
59
- ? ChevronRightIcon("black")
60
- : ChevronLeftIcon("black")}
61
- </div>
62
- </div>
63
- `;
64
- }
65
- }
@@ -1,150 +0,0 @@
1
- import { css, html, LitElement, TemplateResult } from "lit";
2
- import { customElement, property, state } from "lit/decorators.js";
3
- import { styleMap } from "lit/directives/style-map.js";
4
- import { isMobile } from "../../utils";
5
-
6
- @customElement("details-window")
7
- export class DetailsWindow extends LitElement {
8
- static styles = css`
9
- .details-window-wrapper {
10
- background: rgba(255, 255, 255, 0.9);
11
- box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
12
- backdrop-filter: blur(5px);
13
- /* Note: backdrop-filter has minimal browser support */
14
-
15
- border-radius: 10px 0px 0px 10px;
16
- padding: 49px 18px 24px;
17
- }
18
-
19
- .close-window-button {
20
- position: absolute;
21
- top: 22px;
22
- right: 20px;
23
- cursor: pointer;
24
- width: 20px;
25
- height: 20px;
26
- }
27
- .close-window-button:hover {
28
- filter: brightness(90%);
29
- }
30
-
31
- .gradient-window-wrapper {
32
- background: rgba(0, 0, 0 0.75);
33
- border-width: 3px 0px 3px 3px;
34
- border-style: solid;
35
- border-color: #ffffff;
36
- box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
37
- border-radius: 10px 0px 0px 10px;
38
- padding: 16px;
39
- display: block;
40
- background: linear-gradient(
41
- 154.34deg,
42
- rgba(255, 255, 255, 1) 0.55%,
43
- rgba(0, 0, 0, 1) 160.1%
44
- );
45
- }
46
- .details-window-header {
47
- display: flex;
48
- justify-content: space-between;
49
- }
50
- .header-text {
51
- font-weight: 700;
52
- font-size: 14px;
53
- line-height: 22px;
54
-
55
- font-family: "Helvetica", Arial;
56
- font-style: normal;
57
- font-weight: 700;
58
- font-size: 14px;
59
- line-height: 140%;
60
-
61
- color: #202020;
62
- margin-bottom: 14px;
63
- }
64
-
65
- @media screen and (max-width: 767px) {
66
- .details-window-wrapper {
67
- border-radius: 0px 0px 0px 0px;
68
- }
69
- }
70
- `;
71
- @property({ type: String })
72
- height = "425px";
73
-
74
- @property({ type: String })
75
- width = "326px";
76
-
77
- @property({ type: Boolean })
78
- useRoundedBorders = true;
79
-
80
- @property({ type: String })
81
- headerText = "";
82
-
83
- @property({ attribute: false })
84
- onCloseClick?: (e: MouseEvent) => void;
85
-
86
- @state()
87
- isMobileSized = false;
88
-
89
- @property({ attribute: true })
90
- useGradientDesign = false;
91
-
92
- async firstUpdated(): Promise<void> {
93
- // Give the browser a chance to paint
94
- await new Promise((resolve) => setTimeout(resolve, 0));
95
- this.isMobileSized = isMobile();
96
- window.addEventListener("resize", () => {
97
- this.isMobileSized = isMobile();
98
- });
99
- }
100
-
101
- render(): TemplateResult {
102
- return html`
103
- <div
104
- id="details-window-inner"
105
- class="details-window-wrapper"
106
- style=${styleMap({
107
- width: this.isMobileSized ? "-webkit-fill-available" : this.width,
108
- })}
109
- >
110
- <div class="details-window-header">
111
- ${this.headerText
112
- ? html` <div class="header-text">${this.headerText}</div>`
113
- : ""}
114
- ${this.onCloseClick
115
- ? html`<div @click=${this.onCloseClick} class="close-window-button">
116
- <svg
117
- width="19"
118
- height="19"
119
- viewBox="0 0 19 19"
120
- fill="none"
121
- xmlns="http://www.w3.org/2000/svg"
122
- >
123
- <line
124
- x1="0.986863"
125
- y1="18.2746"
126
- x2="18.2929"
127
- y2="0.968589"
128
- stroke="#202020"
129
- stroke-width="2"
130
- />
131
- <path
132
- d="M1.01394 0.999974L18.0103 18.0242"
133
- stroke="#202020"
134
- stroke-width="2"
135
- />
136
- </svg>
137
- </div>`
138
- : ""}
139
- </div>
140
- <slot class="details-window__slot-content"></slot>
141
- </div>
142
- `;
143
- }
144
- }
145
-
146
- export const installDetailsWindow = (): void => {
147
- if (!window.customElements.get("details-window")) {
148
- window.customElements.define("details-window", DetailsWindow);
149
- }
150
- };