@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
package/src/analytics.ts DELETED
@@ -1,217 +0,0 @@
1
- import axios from "axios";
2
- import { getCookieValue } from "./utils";
3
-
4
- declare global {
5
- interface Window {
6
- RCTPCampaign?: { CampaignDetails: { Source: string } };
7
- }
8
- }
9
-
10
- export interface CampaignSources {
11
- entrataCampaignSource: string | null;
12
- yardiCampaignSource: string | null;
13
- realpageCampaignSource: string | null;
14
- utmCampaignSource: string | null;
15
- bozzutoAdSource: string | null;
16
- }
17
-
18
- /**
19
- * A connection to the MeetElise API to send analytics events
20
- */
21
- export default class Analytics {
22
- private org: string;
23
- private building: string;
24
- private featureFlags?: Record<string, boolean>;
25
- public chatId: string;
26
- private incomingProcessedLeadSource: string | null;
27
-
28
- constructor(
29
- org: string,
30
- building: string,
31
- chatId: string,
32
- incomingProcessedLeadSource: string | null
33
- ) {
34
- this.org = org;
35
- this.building = building;
36
- this.chatId = chatId;
37
- this.incomingProcessedLeadSource = incomingProcessedLeadSource;
38
- this.featureFlags = {};
39
- }
40
-
41
- /**
42
- * Store feature flag value(s) on the Analytics object to be sent with future pings. If `featureFlags` object is already present, the argument is merged into it.
43
- */
44
- setFeatureFlags(featureFlags: Record<string, boolean>): void {
45
- this.featureFlags = {
46
- ...this.featureFlags,
47
- ...featureFlags,
48
- };
49
- }
50
-
51
- /**
52
- * Send an event. Takes one argument, the event type name.
53
- */
54
- ping(eventType: string): void {
55
- fetch(
56
- "https://app.meetelise.com/platformApi/connectors/talk_js/analytics",
57
- {
58
- method: "POST",
59
- credentials: "omit", // Necessary for successful CORS
60
- keepalive: true, // Analytics should not abort after browser close
61
- headers: { "content-type": "application/json; charset=UTF-8" },
62
- body: JSON.stringify({
63
- eventType,
64
- chatId: this.chatId,
65
- url: location.href,
66
- org: this.org,
67
- building: this.building,
68
- referrer: document.referrer,
69
- featureFlags: this.featureFlags,
70
- campaignSources: getCampaignSources(),
71
- incomingProcessedLeadSource: this.incomingProcessedLeadSource, // if we already know the lead source, send it along
72
- webchatVersion: process.env.npm_package_version ?? "1.20.155",
73
- }),
74
- }
75
- );
76
- }
77
- }
78
-
79
- export const getCampaignSources = (): CampaignSources => {
80
- try {
81
- const queryParams = new URL(window.location.href).searchParams;
82
- const yardiCampaignSource =
83
- window.RCTPCampaign?.CampaignDetails?.Source ?? null;
84
- const entrataCampaignSource = queryParams.get("switch_cls[id]");
85
- const realpageCampaignSource = queryParams.get("ilm");
86
- const utmCampaignSource = queryParams.get("utm_source");
87
- const bozzutoAdSource = getCookieValue("bozzuto_ad_source");
88
-
89
- return {
90
- entrataCampaignSource,
91
- realpageCampaignSource,
92
- utmCampaignSource,
93
- yardiCampaignSource,
94
- bozzutoAdSource,
95
- };
96
- } catch (e) {
97
- /**
98
- * Some clients have pages that overwrite the `URL` class and turn it into a string. This is a workaround for that.
99
- * Example site: https://ther3.com
100
- */
101
- // eslint-disable-next-line no-console
102
- console.warn(`Couldnt get campaign sources from url, error: ${e}`);
103
- const iframe = document.createElement("iframe");
104
- iframe.style.display = "none";
105
- document.body.appendChild(iframe);
106
- if (!iframe.contentWindow) {
107
- return {
108
- entrataCampaignSource: null,
109
- realpageCampaignSource: null,
110
- utmCampaignSource: null,
111
- yardiCampaignSource: null,
112
- bozzutoAdSource: null,
113
- };
114
- }
115
-
116
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
117
- const OriginalURL = (iframe.contentWindow as any).URL;
118
- if (!OriginalURL) {
119
- return {
120
- entrataCampaignSource: null,
121
- realpageCampaignSource: null,
122
- utmCampaignSource: null,
123
- yardiCampaignSource: null,
124
- bozzutoAdSource: null,
125
- };
126
- }
127
- const queryParams = new OriginalURL(window.location.href).searchParams;
128
- const yardiCampaignSource =
129
- window.RCTPCampaign?.CampaignDetails?.Source ?? null;
130
- const entrataCampaignSource = queryParams.get("switch_cls[id]");
131
- const realpageCampaignSource = queryParams.get("ilm");
132
- const utmCampaignSource = queryParams.get("utm_source");
133
- const bozzutoAdSource = getCookieValue("bozzuto_ad_source");
134
-
135
- return {
136
- entrataCampaignSource,
137
- realpageCampaignSource,
138
- utmCampaignSource,
139
- yardiCampaignSource,
140
- bozzutoAdSource,
141
- };
142
- }
143
- };
144
-
145
- export enum LogType {
146
- error = "error",
147
- info = "info",
148
- warn = "warn",
149
- }
150
-
151
- export const sendLoggingEvent = async ({
152
- logType,
153
- buildingSlug,
154
- orgSlug,
155
- logTitle,
156
- logData,
157
- }: {
158
- logType?: LogType;
159
- buildingSlug?: string;
160
- orgSlug?: string;
161
- logTitle: string;
162
- logData: Record<string, unknown> | null;
163
- }): Promise<void> => {
164
- const host = "https://app.meetelise.com";
165
- await axios.post(
166
- `${host}/platformApi/webchat/logging`,
167
- {
168
- ...logData,
169
- },
170
- {
171
- headers: {
172
- "Content-Type": "application/json",
173
- "building-slug": buildingSlug ?? "",
174
- "org-slug": orgSlug ?? "",
175
- "log-type": logType ?? LogType.error,
176
- "log-title": logTitle.toUpperCase().replace(/\s/g, "_"),
177
- },
178
- }
179
- );
180
- };
181
-
182
- interface SignalLoggerProps {
183
- org_slug: string;
184
- building_slug: string;
185
- chat_id?: string | null;
186
- is_pixel_on_site?: boolean | null;
187
- is_any_webchat_showing?: boolean | null;
188
- is_form_override_success?: boolean | null;
189
- is_dni_insert_override_success?: boolean | null;
190
- is_application_link_replacement_success?: boolean | null;
191
- extra_data?: Record<string, unknown> | null;
192
- }
193
-
194
- export const logSignal = async ({
195
- params,
196
- sampleRate,
197
- }: {
198
- params: SignalLoggerProps;
199
- sampleRate: number; // 0.05 is 5%
200
- }): Promise<void> => {
201
- try {
202
- if (Math.random() >= sampleRate) {
203
- return;
204
- }
205
- await axios.post(
206
- `https://app.meetelise.com/platformApi/webchat/log/signal`,
207
- {
208
- ...params,
209
- website_origin: window.location.origin,
210
- website_search: window.location.search,
211
- }
212
- );
213
- } catch (error) {
214
- // eslint-disable-next-line no-console
215
- console.warn(error);
216
- }
217
- };
package/src/assetUrls.ts DELETED
@@ -1,6 +0,0 @@
1
- export const glowBarMp4 =
2
- "https://eliseusercontent.meetelise.com/webchat/HorizontalBar-Shadow.mp4";
3
- export const glowBarWebm =
4
- "https://eliseusercontent.meetelise.com/webchat/HorizontalBar-Shadow.webm";
5
- export const glowBackgroundMp4 =
6
- "https://eliseusercontent.meetelise.com/webchat/01-EliseAI-Hero_1.mp4";
@@ -1,58 +0,0 @@
1
- import { html, TemplateResult } from "lit";
2
- import { styleMap } from "lit/directives/style-map.js";
3
-
4
- const disclaimerStyles = {
5
- container: {
6
- fontSize: "10px",
7
- paddingTop: "4px",
8
- },
9
- link: {
10
- color: "#4287f5",
11
- },
12
- };
13
-
14
- const disclaimer = ({
15
- phoneNumberInput,
16
- emailInput,
17
- orgLegalName,
18
- }: {
19
- buildingName: string;
20
- phoneNumberInput?: string;
21
- emailInput?: string;
22
- orgLegalName: string;
23
- }): TemplateResult => {
24
- if (phoneNumberInput) {
25
- return html` <div style=${styleMap(disclaimerStyles.container)}>
26
- By providing your number and clicking send, you consent to receive
27
- recurring marketing calls and voice and text messages from or on behalf of
28
- ${orgLegalName} at this number using artificial voice or an autodialer
29
- system. Messages may be AI or human generated. This consent is not
30
- required to lease at this property. Msg & Data rates may apply. You
31
- consent to this
32
- <a
33
- style=${styleMap(disclaimerStyles.link)}
34
- href="http://bit.ly/me_privacy_policy"
35
- target="_blank"
36
- rel="noopener noreferrer"
37
- >privacy policy</a
38
- >, including having your number and communications recorded and used by a
39
- third party.
40
- </div>`;
41
- }
42
- if (emailInput) {
43
- return html` <div style=${styleMap(disclaimerStyles.container)}>
44
- By entering your email and clicking submit, you consent to this
45
- <a
46
- style=${styleMap(disclaimerStyles.link)}
47
- href="http://bit.ly/me_privacy_policy"
48
- target="_blank"
49
- rel="noopener noreferrer"
50
- >privacy policy</a
51
- >, including having your email address and communications collected and
52
- recorded and used by a third party.
53
- </div>`;
54
- }
55
- return html``;
56
- };
57
-
58
- export default disclaimer;
@@ -1,21 +0,0 @@
1
- import axios from "axios";
2
- interface BuildingABType {
3
- abTestType: string;
4
- }
5
- export enum abTestTypes {
6
- "ConceptEmoji" = "Concept 2 (Blue/White)",
7
- }
8
- export default async function fetchBuildingABTestType(
9
- buildingSlug: string
10
- ): Promise<BuildingABType | null> {
11
- const host = "https://app.meetelise.com";
12
- try {
13
- const abTestTypeResponse = await axios.get(
14
- `${host}/platformApi/webchat/${buildingSlug}/ab-test-type`
15
- );
16
- //return { abTestType: "Concept 2 (Blue/White)" };
17
- return abTestTypeResponse.data;
18
- } catch (_) {
19
- return null;
20
- }
21
- }
@@ -1,87 +0,0 @@
1
- import axios from "axios";
2
-
3
- export interface LabeledOption {
4
- label: string;
5
- value: string | number;
6
- }
7
-
8
- /**
9
- * @deprecated Use BuildingWebchatView instead.
10
- * The response from the API.
11
- */
12
- export interface Building {
13
- id: number;
14
- themeId: string;
15
- avatarSrc: string | null;
16
- avatarType: "image" | "initials" | null;
17
- chatSubtitle: string | null;
18
- chatTitle: string | null;
19
- name: string;
20
- userFirstName: string;
21
- userId: number;
22
- welcomeMessage: string | null;
23
- systemWelcomeMessage: string | null;
24
- launchedDateTime: string | null;
25
- orgId: number;
26
- phoneNumber: string;
27
- tourTypeOptions: LabeledOption[];
28
- chatWidgets?: string[] | null;
29
- chatCallUsHeader?: string;
30
- autoOpenChatWidget: boolean;
31
- sgtUrl: string;
32
- escortedToursLink: string;
33
- virtualToursLink: string;
34
- active: number;
35
- usesDynamicScheduling: boolean;
36
- textWithUsPhoneNumber: string | null;
37
- orgLegalName: string;
38
- webchatScopeConfigured: boolean;
39
- virtualTourEnabled: boolean;
40
- escortedTourEnabled: boolean;
41
- selfGuidedTourEnabled: boolean;
42
- escortedToursTypeOffered: string;
43
- virtualToursTypeOffered: string;
44
- selfGuidedToursTypeOffered: string;
45
- }
46
-
47
- export type UnitV2 = {
48
- name: string;
49
- layout: string;
50
- availabilityStage: number;
51
- active: number;
52
- occupied: boolean;
53
- };
54
-
55
- /**
56
- * Load the publicly-available info for a building.
57
- * @deprecated Use fetchBuildingAndConfig instead.
58
- * @param orgSlug - The org slug, e.g. "big-prop-co"
59
- * @param buildingSlug - The buidling slug, e.g. "gravity-falls"
60
- * @returns The building's ID, name, theme, and agent.
61
- */
62
- export default async function fetchBuildingInfo(
63
- orgSlug: string,
64
- buildingSlug: string
65
- ): Promise<Building> {
66
- const host = "https://app.meetelise.com";
67
- const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}`;
68
-
69
- const buildingResponse = await axios.get(buildingUrl);
70
-
71
- const building: Building = buildingResponse.data;
72
- try {
73
- building.welcomeMessage = replaceName(
74
- building.welcomeMessage ?? "",
75
- building.userFirstName
76
- );
77
- } catch (e) {
78
- // eslint-disable-next-line no-console
79
- console.error(e);
80
- }
81
- return building;
82
- }
83
-
84
- const replaceName = (originalText: string, newName: string) => {
85
- const regex = /elise/gi;
86
- return originalText.replace(regex, newName);
87
- };
@@ -1,154 +0,0 @@
1
- import axios from "axios";
2
-
3
- export enum DesignConcepts {
4
- EMOJI = "emoji",
5
- PILLS = "pills",
6
- MINIMIZED = "minimized", // this is also mobile
7
- }
8
-
9
- enum TourType {
10
- UNKNOWN = "UNKNOWN",
11
- SELF_GUIDED = "SELF_GUIDED",
12
- VIRTUAL_SHOWING = "VIRTUAL_SHOWING",
13
- WITH_AGENT = "WITH_AGENT",
14
- MEDIA_TOUR = "MEDIA_TOUR",
15
- OPEN_HOUSE_STUDIO = "OPEN_HOUSE_STUDIO",
16
- OPEN_HOUSE_1BR = "OPEN_HOUSE_1BR",
17
- OPEN_HOUSE_2BR = "OPEN_HOUSE_2BR",
18
- OPEN_HOUSE_3BR = "OPEN_HOUSE_3BR",
19
- OPEN_HOUSE_4BR = "OPEN_HOUSE_4BR",
20
- OPEN_HOUSE_5BR = "OPEN_HOUSE_5BR",
21
- }
22
-
23
- enum TourAccessType {
24
- LINK = "link",
25
- CLIENT_SCHEDULED = "client_scheduled",
26
- SCHEDULED_BY_ME_MANAGED_BY_ME = "scheduled_by_ME_managed_by_ME",
27
- SCHEDULED_BY_ME_MANAGED_BY_CLIENT = "scheduled_by_ME_managed_by_client",
28
- SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE = "scheduled_by_ME_managed_by_concierge",
29
- }
30
-
31
- export interface LayoutOption {
32
- value: number;
33
- label: string;
34
- }
35
-
36
- interface TourTypeOption {
37
- value: TourType;
38
- label: string;
39
- }
40
-
41
- export interface BuildingWebchatView {
42
- id: number;
43
- orgId: number;
44
- name: string;
45
- userId: number | null;
46
- active: number | null;
47
- userFirstName: string;
48
- userLastName: string | null;
49
- primaryColor: string | null;
50
- backgroundColor: string | null;
51
- logoSrc: string | null;
52
- welcomeMessage: string | null;
53
- systemWelcomeMessage: string | null;
54
- chatTitle: string | null;
55
- chatSubtitle: string | null;
56
- bannerColor: string | null;
57
- bannerTextColor: string | null;
58
- messageColor: string | null;
59
- messageTextColor: string | null;
60
- launchButtonColor: string | null;
61
- launchButtonIconColor: string | null;
62
- launchButtonSize: string | null;
63
- avatarType: "image" | "initials" | null;
64
- avatarSrc: string | null;
65
- avatarInitials: string | null;
66
- themeId: string;
67
- chatCallUsHeader?: string;
68
- googleMapsUrl: string | null;
69
- chatWidgets?: string[] | null;
70
- streetAddress: string | null;
71
- postalCode: string | null;
72
- state: string | null;
73
- phoneNumber: string;
74
- textWithUsPhoneNumber: string | null;
75
- layoutOptions: LayoutOption[];
76
- tourTypeOptions: TourTypeOption[];
77
- conversationMaintenanceMode: boolean;
78
- sgtUrl: string;
79
- escortedToursLink: string;
80
- virtualToursLink: string;
81
- isVirtualTourEnabled: boolean;
82
- isEscortedTourEnabled: boolean;
83
- isSelfGuidedTourEnabled: boolean;
84
- escortedToursTypeOffered: TourAccessType;
85
- virtualToursTypeOffered: TourAccessType;
86
- selfGuidedToursTypeOffered: TourAccessType;
87
- usesDynamicScheduling: boolean;
88
- numAvailableUnits: number;
89
- isSchedulingDisabled: boolean;
90
- shouldBuildingScheduleTours: boolean;
91
- orgLegalName: string;
92
- launchedDateTime: Date | null;
93
- webchatScopeConfigured: boolean;
94
- displayStyle: DesignConcepts;
95
- secondaryColor: string | null;
96
- foregroundColorOnPrimaryBackgroundColor: string | null;
97
- foregroundColorOnSecondaryBackgroundColor: string | null;
98
- shouldShowChatDesktop: boolean | null;
99
- shouldShowChatMobile: boolean | null;
100
- shouldShowTextDesktop: boolean | null;
101
- shouldShowTextMobile: boolean | null;
102
- shouldShowPhoneDesktop: boolean | null;
103
- shouldShowPhoneMobile: boolean | null;
104
- shouldShowEmailDesktop: boolean | null;
105
- shouldShowEmailMobile: boolean | null;
106
- shouldShowSstDesktop: boolean | null;
107
- shouldShowSstMobile: boolean | null;
108
- shouldShowApplyNowDesktop: boolean | null;
109
- shouldShowApplyNowMobile: boolean | null;
110
- shouldShowPricingCalculatorDesktop: boolean | null;
111
- shouldShowPricingCalculatorMobile: boolean | null;
112
- applicationLink: string | null;
113
- isLiveOnCollect: boolean | null;
114
- requiresConsentForChat: boolean | null;
115
- privacyPolicyUrlForChat: string | null;
116
- collapseMobileFeatures: boolean | null;
117
- autoOpenChat: boolean | null;
118
- isInheritingFromOrg: boolean | null;
119
- isGlobalDefault: boolean | null;
120
- }
121
-
122
- /**
123
- * Load the publicly-available info for a building.
124
- *
125
- * @param orgSlug - The org slug, e.g. "big-prop-co"
126
- * @param buildingSlug - The buidling slug, e.g. "gravity-falls"
127
- * @returns The building's ID, name, theme, and agent.
128
- */
129
- export default async function fetchBuildingWebchatView(
130
- orgSlug: string,
131
- buildingSlug: string
132
- ): Promise<BuildingWebchatView> {
133
- const host = "https://app.meetelise.com";
134
- const buildingUrl = `${host}/api/pub/v1/organization/${orgSlug}/building/${buildingSlug}/v2`;
135
-
136
- const buildingResponse = await axios.get(buildingUrl);
137
-
138
- const buildingWebchatView: BuildingWebchatView = buildingResponse.data;
139
- try {
140
- buildingWebchatView.welcomeMessage = replaceName(
141
- buildingWebchatView.welcomeMessage ?? "",
142
- buildingWebchatView.userFirstName
143
- );
144
- } catch (e) {
145
- // eslint-disable-next-line no-console
146
- console.error(e);
147
- }
148
- return buildingWebchatView;
149
- }
150
-
151
- const replaceName = (originalText: string, newName: string) => {
152
- const regex = /elise/gi;
153
- return originalText.replace(regex, newName);
154
- };