@meetelise/chat 1.20.44 → 1.20.46

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.
@@ -405,6 +405,7 @@ export class Launcher extends LitElement {
405
405
  buildingSlug="${this.buildingSlug}"
406
406
  ${ref(this.textUsWindowRef)}
407
407
  .buildingId=${this.buildingId}
408
+ currentLeadSource="${this.currentLeadSource}"
408
409
  ></text-us-window>
409
410
  </div>`
410
411
  : ""}
@@ -436,6 +437,7 @@ export class Launcher extends LitElement {
436
437
  .buildingId=${this.buildingId}
437
438
  chatCallUsHeader="${this.chatCallUsHeader}"
438
439
  hasTextUsEnabled=${this.hasTextUsEnabled ? true : ""}
440
+ currentLeadSource="${this.currentLeadSource}"
439
441
  ></call-us-window>
440
442
  </div>
441
443
  `
@@ -319,16 +319,13 @@ export class TourScheduler extends LitElement {
319
319
  this.phoneNumber.length === 14
320
320
  );
321
321
  },
322
- leadSource: (): boolean =>
323
- this.leadSources.length > 0 ? !!this.selectedLeadSource?.value : true,
324
322
  };
325
323
 
326
324
  formIsValidForSubmission = (): boolean => {
327
325
  const isValid =
328
326
  this.validators.tourType() &&
329
327
  this.validators.dateAndTime() &&
330
- this.validators.leadInfo() &&
331
- this.validators.leadSource();
328
+ this.validators.leadInfo();
332
329
  return isValid;
333
330
  };
334
331
 
@@ -47,16 +47,15 @@ export class ActionConfirmButton extends LitElement {
47
47
  .lds-ring {
48
48
  display: inline-block;
49
49
  position: relative;
50
- width: 48px;
51
- height: 48px;
50
+ width: 28px;
51
+ height: 28px;
52
52
  }
53
53
  .lds-ring div {
54
54
  box-sizing: border-box;
55
55
  display: block;
56
56
  position: absolute;
57
- width: 32px;
58
- height: 32px;
59
- margin: 8px;
57
+ width: 28px;
58
+ height: 28px;
60
59
  border: 8px solid #fff;
61
60
  border-radius: 50%;
62
61
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
@@ -74,6 +74,9 @@ export class CallUsWindow extends LitElement {
74
74
  @property({ attribute: true })
75
75
  hasTextUsEnabled = "";
76
76
 
77
+ @property({ attribute: true })
78
+ currentLeadSource = "";
79
+
77
80
  firstUpdated = async (): Promise<void> => {
78
81
  if (!this.buildingId) {
79
82
  return;
@@ -143,6 +146,7 @@ export class CallUsWindow extends LitElement {
143
146
  ? html` <text-us-window
144
147
  .buildingId=${this.buildingId}
145
148
  inPopup=${!this.hasTextUsEnabled}
149
+ currentLeadSource="${this.currentLeadSource}"
146
150
  ></text-us-window>`
147
151
  : ""}
148
152
  </details-window>
@@ -141,8 +141,6 @@ export class EmailUsWindow extends LitElement {
141
141
  @state()
142
142
  hasMessageError = false;
143
143
  @state()
144
- hasLeadSourceError = false;
145
- @state()
146
144
  hasSubmittedForm = false;
147
145
  @state()
148
146
  windowHeight = 525;
@@ -208,7 +206,6 @@ export class EmailUsWindow extends LitElement {
208
206
  this.hasEmailError = false;
209
207
  this.hasPhoneNumberError = false;
210
208
  this.hasMessageError = false;
211
- this.hasLeadSourceError = false;
212
209
  this.hasSubmissionError = false;
213
210
  if (!this.firstName || !this.lastName) {
214
211
  this.hasNameError = true;
@@ -222,12 +219,6 @@ export class EmailUsWindow extends LitElement {
222
219
  if (!this.message) {
223
220
  this.hasMessageError = true;
224
221
  }
225
- if (
226
- this.leadSources.length > 0 &&
227
- (!this.selectedLeadSource || !this.selectedLeadSource.value)
228
- ) {
229
- this.hasLeadSourceError = true;
230
- }
231
222
  this.windowHeight = 525 + 30 * this.getNumErrors();
232
223
  };
233
224
 
@@ -240,8 +231,7 @@ export class EmailUsWindow extends LitElement {
240
231
  this.hasNameError ||
241
232
  this.hasEmailError ||
242
233
  this.hasPhoneNumberError ||
243
- this.hasMessageError ||
244
- this.hasLeadSourceError
234
+ this.hasMessageError
245
235
  ) {
246
236
  return;
247
237
  }
@@ -290,7 +280,6 @@ export class EmailUsWindow extends LitElement {
290
280
  this.hasEmailError,
291
281
  this.hasPhoneNumberError,
292
282
  this.hasMessageError,
293
- this.hasLeadSourceError,
294
283
  this.hasSubmissionError,
295
284
  ].filter((v) => v).length;
296
285
  };
@@ -423,11 +412,6 @@ export class EmailUsWindow extends LitElement {
423
412
  }}
424
413
  >
425
414
  </me-select>
426
- ${this.hasLeadSourceError
427
- ? html`
428
- <div class="email-us__error-text">Include a source</div>
429
- `
430
- : ""}
431
415
  `
432
416
  : ""}
433
417
  <div class="email-us__vertical-spacer"></div>
@@ -91,6 +91,9 @@ export class TextUsWindow extends LitElement {
91
91
  @state()
92
92
  isSubmitting = false;
93
93
 
94
+ @property({ attribute: true })
95
+ currentLeadSource = "";
96
+
94
97
  onChangePhoneNumber = (e: Event): void => {
95
98
  if (!e.target || !this.phoneNumberInputRef.value) {
96
99
  return;
@@ -130,7 +133,10 @@ export class TextUsWindow extends LitElement {
130
133
  this.phoneNumber,
131
134
  this.buildingId,
132
135
  this.orgSlug,
133
- this.buildingSlug
136
+ this.buildingSlug,
137
+ this.currentLeadSource
138
+ ? [this.currentLeadSource, "property-website"]
139
+ : ["property-website"]
134
140
  );
135
141
  this.hasSubmittedForm = true;
136
142
  this.isSubmitting = false;
@@ -245,7 +251,8 @@ const createTextWithUs = async (
245
251
  rawPhoneNumber: string,
246
252
  buildingId: number,
247
253
  orgSlug: string,
248
- buildingSlug: string
254
+ buildingSlug: string,
255
+ leadSources: string[]
249
256
  ) => {
250
257
  const formattedPhoneNumber =
251
258
  "+1" +
@@ -257,7 +264,7 @@ const createTextWithUs = async (
257
264
  const queryParams = new URLSearchParams(window.location.search);
258
265
  const requestBody = {
259
266
  building_id: buildingId,
260
- lead_sources: ["property-website"],
267
+ lead_sources: leadSources,
261
268
  phone_number: formattedPhoneNumber,
262
269
  referrer: document.referrer,
263
270
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -194,7 +194,7 @@ export const launcherStyles = css`
194
194
  .launcher__mini-launcher-wrapper {
195
195
  position: fixed;
196
196
  right: 0px;
197
- bottom: 40px;
197
+ bottom: 130px;
198
198
  z-index: 100000;
199
199
  display: flex;
200
200
  align-items: center;