@meetelise/chat 1.43.25 → 1.43.26

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.
@@ -57,6 +57,7 @@ export declare class Launcher extends LitElement {
57
57
  private left;
58
58
  showTourNextToChat: boolean;
59
59
  onChatTapped: () => void;
60
+ handleChatTapped: () => void;
60
61
  onClickMinimize: (e: MouseEvent) => void;
61
62
  onSstClose: () => void;
62
63
  overrideRentgrata: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.43.25",
3
+ "version": "1.43.26",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",
@@ -256,7 +256,7 @@ var e={2:(e,t,n)=>{var i=n(2199),r=n(4664),o=n(5950);e.exports=function(e){retur
256
256
  .dayNumber:is(.differentMonth, .past, .noAvailabilities) {
257
257
  opacity: 30%;
258
258
  }
259
- `,Wt([ue({attribute:"month",type:String})],Vt.prototype,"defaultMonth",void 0),Wt([ue({attribute:"year",type:Number})],Vt.prototype,"defaultYear",void 0),Wt([ue({attribute:!0})],Vt.prototype,"defaultDate",void 0),Wt([ue({attribute:!1})],Vt.prototype,"availabilities",void 0),Wt([ue({attribute:!1})],Vt.prototype,"selectedDate",null),Wt([ce()],Vt.prototype,"monthShown",null),Wt([ce()],Vt.prototype,"yearShown",void 0),Vt=Wt([se("date-picker")],Vt);const Yt=(e,t)=>{const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n},Kt=e=>{const t=new Date,n=null!=e?e:Intl.DateTimeFormat().resolvedOptions().timeZone,i=(e=>{const t=new Date(e.getFullYear(),0,1),n=new Date(e.getFullYear(),6,1),i=Math.max(t.getTimezoneOffset(),n.getTimezoneOffset());return e.getTimezoneOffset()<i})(t);switch(n){case"America/New_York":case"America/Indiana/Indianapolis":return i?"EDT":"EST";case"America/Chicago":case"America/Indiana/Knox":return i?"CDT":"CST";case"America/Denver":return i?"MDT":"MST";case"America/Los_Angeles":return i?"PDT":"PST";case"America/Anchorage":return i?"AKDT":"AKST";case"America/Honolulu":return"HST";case"America/Phoenix":return"MST";default:return"Unknown"}};var Xt=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};const Zt=(e,t)=>e.reduce(function(e,t){return e[t.displayTimeZoned]=t,e},{})[t];let Jt=class extends oe{constructor(){super(...arguments),this.options=[],this.selectedDateExists=!1,this.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.defaultSelectedTime=null,this.selected=this.defaultSelectedTime}get selectedTime(){return this.selected}updated(e){if(e.has("defaultSelectedTime")){const t=e.get("defaultSelectedTime");if(!this.selected&&this.defaultSelectedTime)return void(this.selected=this.defaultSelectedTime);if(!this.defaultSelectedTime)return void(this.selected=void 0);if(!t||this.defaultSelectedTime.displayTimeZoned!==t.displayTimeZoned)return void(this.selected=this.defaultSelectedTime)}}render(){var e;return 1!==this.options.length||this.selected||(this.selected=Zt(this.options,this.options[0].displayTimeZoned),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),(null===(e=this.options)||void 0===e?void 0:e.length)?B`
259
+ `,Wt([ue({attribute:"month",type:String})],Vt.prototype,"defaultMonth",void 0),Wt([ue({attribute:"year",type:Number})],Vt.prototype,"defaultYear",void 0),Wt([ue({attribute:!0})],Vt.prototype,"defaultDate",void 0),Wt([ue({attribute:!1})],Vt.prototype,"availabilities",void 0),Wt([ue({attribute:!1})],Vt.prototype,"selectedDate",null),Wt([ce()],Vt.prototype,"monthShown",null),Wt([ce()],Vt.prototype,"yearShown",void 0),Vt=Wt([se("date-picker")],Vt);const Yt=(e,t)=>{const n=[];for(let i=0;i<t.length;i+=e)n.push(t.slice(i,i+e));return n},Kt=e=>{const t=new Date,n=null!=e?e:Intl.DateTimeFormat().resolvedOptions().timeZone,i=(e=>{const t=new Date(e.getFullYear(),0,1),n=new Date(e.getFullYear(),6,1),i=Math.max(t.getTimezoneOffset(),n.getTimezoneOffset());return e.getTimezoneOffset()<i})(t);switch(n){case"America/New_York":case"America/Indiana/Indianapolis":return i?"EDT":"EST";case"America/Chicago":case"America/Indiana/Knox":return i?"CDT":"CST";case"America/Denver":return i?"MDT":"MST";case"America/Los_Angeles":return i?"PDT":"PST";case"America/Anchorage":return i?"AKDT":"AKST";case"America/Honolulu":return"HST";case"America/Phoenix":return"MST";default:return"Unknown"}};var Xt=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};const Zt=(e,t)=>e.reduce(function(e,t){return e[t.displayTimeZoned]=t,e},{})[t];let Jt=class extends oe{constructor(){super(...arguments),this.options=[],this.selectedDateExists=!1,this.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.defaultSelectedTime=null,this.selected=this.defaultSelectedTime}get selectedTime(){return this.selected}updated(e){if(e.has("defaultSelectedTime")){const t=e.get("defaultSelectedTime");if(!this.selected&&this.defaultSelectedTime)return void(this.selected=this.defaultSelectedTime);if(!this.defaultSelectedTime)return void(this.selected=void 0);if(!t||this.defaultSelectedTime.displayTimeZoned!==t.displayTimeZoned)return void(this.selected=this.defaultSelectedTime)}}render(){var e,t;return 1!==(null===(e=this.options)||void 0===e?void 0:e.length)||this.selected||(this.selected=Zt(this.options,this.options[0].displayTimeZoned),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),(null===(t=this.options)||void 0===t?void 0:t.length)?B`
260
260
  <div>
261
261
  <div
262
262
  id="optionContainer"
@@ -1185,7 +1185,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
1185
1185
  subtitle="on your own"
1186
1186
  .primaryColor=${this.primaryColor}
1187
1187
  .backgroundColor=${this.backgroundColor}
1188
- @click="${async()=>{this.tourType=mr.Self,this.sgtUrl&&Ii(mr.Self,this.selfGuidedToursTypeOffered)&&window.open(this.sgtUrl,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Self]),this._setDefaultSelectedDateAndTimes(yr[mr.Self])}}"
1188
+ @click="${async()=>{this.tourType=mr.Self,ni("tourTypeSelected",{tourType:mr.Self,buildingId:this.buildingId}),this.sgtUrl&&Ii(mr.Self,this.selfGuidedToursTypeOffered)&&window.open(this.sgtUrl,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Self]),this._setDefaultSelectedDateAndTimes(yr[mr.Self])}}"
1189
1189
  @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=mr.Self)}}"
1190
1190
  ?selected="${this.tourType===mr.Self}"
1191
1191
  >
@@ -1210,7 +1210,7 @@ xmlns="http://www.w3.org/2000/svg"
1210
1210
  .backgroundColor=${this.backgroundColor}
1211
1211
  .foregroundColorOnPrimaryBackgroundColor=${this.foregroundColorOnPrimaryBackgroundColor}
1212
1212
  .foregroundColorOnSecondaryBackgroundColor=${this.foregroundColorOnSecondaryBackgroundColor}
1213
- @click="${async()=>{this.tourType=mr.Guided,this.escortedToursLink&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Guided]),this._setDefaultSelectedDateAndTimes(yr[mr.Guided])}}"
1213
+ @click="${async()=>{this.tourType=mr.Guided,ni("tourTypeSelected",{tourType:mr.Guided,buildingId:this.buildingId}),this.escortedToursLink&&window.open(this.escortedToursLink,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Guided]),this._setDefaultSelectedDateAndTimes(yr[mr.Guided])}}"
1214
1214
  @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=mr.Guided)}}"
1215
1215
  ?selected="${this.tourType===mr.Guided}"
1216
1216
  >
@@ -1233,7 +1233,7 @@ xmlns="http://www.w3.org/2000/svg"
1233
1233
  subtitle="over video"
1234
1234
  .primaryColor=${this.primaryColor}
1235
1235
  .backgroundColor=${this.backgroundColor}
1236
- @click="${async()=>{this.tourType=mr.Virtual,this.virtualToursLink&&Ii(mr.Virtual,this.virtualToursTypeOffered)&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Virtual]),this._setDefaultSelectedDateAndTimes(yr[mr.Virtual])}}"
1236
+ @click="${async()=>{this.tourType=mr.Virtual,ni("tourTypeSelected",{tourType:mr.Virtual,buildingId:this.buildingId}),this.virtualToursLink&&Ii(mr.Virtual,this.virtualToursTypeOffered)&&window.open(this.virtualToursLink,"_blank"),this.availabilitiesGroupedByDay=await Wn(yr[mr.Virtual]),this._setDefaultSelectedDateAndTimes(yr[mr.Virtual])}}"
1237
1237
  @keydown="${e=>{[" ","Enter"].includes(e.key)&&(e.preventDefault(),this.tourType=mr.Virtual)}}"
1238
1238
  ?selected="${this.tourType===mr.Virtual}"
1239
1239
  >
@@ -1265,7 +1265,7 @@ xmlns="http://www.w3.org/2000/svg"
1265
1265
  <date-picker
1266
1266
  .availabilities=${Kn()(this.availabilitiesGroupedByDay,e=>e.map(e=>new Date(e.offset)))}
1267
1267
  .defaultDate=${this.selectedDate}
1268
- @change=${async e=>{if(this.tourType===mr.Self&&this.sgtUrl&&Ii(this.tourType,this.selfGuidedToursTypeOffered))window.open(this.sgtUrl,"_blank");else if(this.tourType===mr.Guided&&this.escortedToursLink)window.open(this.escortedToursLink,"_blank");else if(this.tourType===mr.Virtual&&this.virtualToursLink&&Ii(this.tourType,this.virtualToursTypeOffered))window.open(this.virtualToursLink,"_blank");else if(e.target instanceof Vt){const t=this.selectedDate;if(this.selectedDate=e.target.selectedDate,!this.tourType)return;if(t&&e.target.selectedDate&&qt(t,e.target.selectedDate))return;this._setDefaultSelectedDateAndTimes(yr[this.tourType],e.target.selectedDate)}}}
1268
+ @change=${async e=>{if(this.tourType===mr.Self&&this.sgtUrl&&Ii(this.tourType,this.selfGuidedToursTypeOffered))window.open(this.sgtUrl,"_blank");else if(this.tourType===mr.Guided&&this.escortedToursLink)window.open(this.escortedToursLink,"_blank");else if(this.tourType===mr.Virtual&&this.virtualToursLink&&Ii(this.tourType,this.virtualToursTypeOffered))window.open(this.virtualToursLink,"_blank");else if(e.target instanceof Vt){const t=this.selectedDate;if(this.selectedDate=e.target.selectedDate,!this.tourType)return;if(t&&e.target.selectedDate&&qt(t,e.target.selectedDate))return;e.target.selectedDate&&ni("tourDateSelected",{selectedDate:Ft(e.target.selectedDate,"yyyy-MM-dd"),tourType:this.tourType,buildingId:this.buildingId}),this._setDefaultSelectedDateAndTimes(yr[this.tourType],e.target.selectedDate)}}}
1269
1269
  ></date-picker>
1270
1270
  <div>
1271
1271
  <time-picker
@@ -1273,7 +1273,7 @@ xmlns="http://www.w3.org/2000/svg"
1273
1273
  .timezone=${this.calendarTimeZone}
1274
1274
  .defaultSelectedTime=${this.selectedTime?{dateWithTimeZoneOffset:this.selectedTime,displayTime:Ft(Nn(`${this.selectedTime.datetime}${this.selectedTime.offset}`),"h:mmaaa"),displayTimeZoned:pr(Nn(`${this.selectedTime.datetime}${this.selectedTime.offset}`),this.calendarTimeZone,"h:mmaaa")}:null}
1275
1275
  .options=${this.selectedDate?null===(e=this.availabilitiesGroupedByDay[Ft(this.selectedDate,"y-MM-dd")])||void 0===e?void 0:e.sort((e,t)=>function(e,t){Ge(2,arguments);var n=Qe(e),i=Qe(t),r=n.getTime()-i.getTime();return r<0?-1:r>0?1:r}(Nn(e.datetime),Nn(t.datetime))).map(e=>({dateWithTimeZoneOffset:e,displayTime:Ft(Nn(`${e.datetime}${e.offset}`),"h:mmaaa"),displayTimeZoned:pr(Nn(`${e.datetime}${e.offset}`),this.calendarTimeZone,"h:mmaaa")})):[]}
1276
- @change=${e=>{if(e.target instanceof Jt){if(!this.selectedDate)return;const t=this.availabilitiesGroupedByDay[Ft(new Date(this.selectedDate),"y-MM-dd")],n=e.target.selectedTime?t.indexOf(e.target.selectedTime.dateWithTimeZoneOffset):null;this.selectedTime=null!==n?t[n]:null}}}
1276
+ @change=${e=>{if(e.target instanceof Jt){if(!this.selectedDate)return;const t=this.availabilitiesGroupedByDay[Ft(new Date(this.selectedDate),"y-MM-dd")],n=e.target.selectedTime?t.indexOf(e.target.selectedTime.dateWithTimeZoneOffset):null;this.selectedTime=null!==n?t[n]:null,this.selectedTime&&ni("tourTimeSelected",{selectedTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,tourType:this.tourType,buildingId:this.buildingId})}}}
1277
1277
  ></time-picker>
1278
1278
  </div>
1279
1279
  </div>
@@ -1362,7 +1362,7 @@ xmlns="http://www.w3.org/2000/svg"
1362
1362
  value="${this.currentLeadSource}"
1363
1363
  placeholder="How did you hear about us?"
1364
1364
  .options="${this.leadSources.map(e=>({label:e,value:e}))}"
1365
- @change=${()=>{this.requestUpdate()}}
1365
+ @change=${()=>{var e;(null===(e=this.selectedLeadSource)||void 0===e?void 0:e.value)&&ni("tourLeadSourceSelected",{leadSource:this.selectedLeadSource.value,buildingId:this.buildingId}),this.requestUpdate()}}
1366
1366
  >
1367
1367
  </me-select>`:""}
1368
1368
  </div> `}confirmationMessage(){if(!this.selectedDate||!this.selectedTime||null===this.tourType)return B``;const e=pr(Nn(`${this.selectedTime.datetime}${this.selectedTime.offset}`),this.calendarTimeZone,"MMM d 'at' h:mmaaa");return this.canceledReschedule?B`
@@ -4768,7 +4768,7 @@ xmlns="http://www.w3.org/2000/svg"
4768
4768
  </p>
4769
4769
  </div>
4770
4770
  </div>
4771
- `:B``}};Jo.styles=Xo,Zo([ue({type:Object})],Jo.prototype,"incentive",void 0),Jo=Zo([se("incentive-banner")],Jo);var ea=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ta=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Le,this.backgroundColor=Re,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isFirstCalculation=!0,this.isCalculatingQuote=!1,this.isExporting=!1,this.selectedLayoutIds=[Kr],this.selectedUnit=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.desiredRentableItems=[],this.moveInDateString=pn.toISOString().split("T")[0],this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.groupedFees={[$r.ONE_TIME]:[],[$r.MONTHLY]:[],[$r.WEEKLY]:[],[$r.BI_WEEKLY]:[],[$r.ANNUALLY]:[],[$r.DAILY]:[],[$r.AS_NEEDED]:[],[$r.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!0,this.quoteAbortController=null,this.quoteDebounceTimer=null,this.startQuoteApiCall=async()=>{var e;null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=new AbortController,this.isCalculatingQuote=!0,await this.performQuoteCalculation(this.quoteAbortController.signal)},this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await this.setupCalculator(),await this.fetchUnits()},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const[e,t]=await Promise.all([Mi(this.orgSlug,this.buildingSlug),Yr(this.buildingSlug)]);e&&t&&(this.buildingWebchatView=e,this.groupedFees=this.groupFees(t.fees),this.rentableItems=t.rentableItems)},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.isFirstCalculation=!0,this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||$r.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&window.open(this.pdfUrl,"_blank")},this.fetchUnits=async()=>{let e;this.isLoadingUnits=!0,this.selectedLayoutIds.includes(Kr)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await to({buildingSlug:this.buildingSlug,moveInDateEarliestString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTermMin:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.quote=null,this.pdfUrl=null)}}finally{this.isLoadingUnits=!1}}}async performQuoteCalculation(e){if(!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);const t=dn(Nn(this.moveInDateString),Nn(this.selectedUnit.earliestAvailable))?this.selectedUnit.earliestAvailable:this.moveInDateString;try{const n=await Zr({buildingSlug:this.buildingSlug,unitId:this.selectedUnit.id,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:this.leaseTerm,moveInDate:t},e);this.quote=n.quote,this.pdfUrl=n.pdfUrl||null}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.isCalculatingQuote=!1,vi({logType:bi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e}}))}finally{e.aborted||(this.isCalculatingQuote=!1,this.isFirstCalculation=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isCalculatingQuote&&!this.isExporting&&!this.isFirstCalculation,i=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return B`
4771
+ `:B``}};Jo.styles=Xo,Zo([ue({type:Object})],Jo.prototype,"incentive",void 0),Jo=Zo([se("incentive-banner")],Jo);var ea=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let ta=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Le,this.backgroundColor=Re,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isFirstCalculation=!0,this.isCalculatingQuote=!1,this.isExporting=!1,this.selectedLayoutIds=[Kr],this.selectedUnit=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1,num_cats:0,num_dogs:0,num_other_pets:0},this.desiredRentableItems=[],this.moveInDateString=pn.toISOString().split("T")[0],this.leaseTerm=12,this.buildingWebchatView=null,this.incentives=[],this.quote=null,this.pdfUrl=null,this.groupedFees={[$r.ONE_TIME]:[],[$r.MONTHLY]:[],[$r.WEEKLY]:[],[$r.BI_WEEKLY]:[],[$r.ANNUALLY]:[],[$r.DAILY]:[],[$r.AS_NEEDED]:[],[$r.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!0,this.quoteAbortController=null,this.quoteDebounceTimer=null,this.startQuoteApiCall=async()=>{var e;null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=new AbortController,this.isCalculatingQuote=!0,await this.performQuoteCalculation(this.quoteAbortController.signal)},this.firstUpdated=async()=>{this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor),await this.setupCalculator(),await this.fetchUnits()},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const[e,t]=await Promise.all([Mi(this.orgSlug,this.buildingSlug),Yr(this.buildingSlug)]);e&&t&&(this.buildingWebchatView=e,this.groupedFees=this.groupFees(t.fees),this.rentableItems=t.rentableItems)},this.requestQuoteCalculation=()=>{if(this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);this.quoteDebounceTimer=window.setTimeout(()=>{this.startQuoteApiCall(),this.quoteDebounceTimer=null},1e3)},this.handleUnitSelect=e=>{const t=!this.selectedUnit;if(this.isFirstCalculation=!0,this.selectedUnit=e,t)return this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),this.isCalculatingQuote=!0,void this.startQuoteApiCall();this.requestQuoteCalculation()},this.handleMoveInDateChange=async e=>{this.moveInDateString=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleLeaseTermChange=async e=>{this.leaseTerm=e,this.quote=null,this.pdfUrl=null,await this.fetchUnits(),this.selectedUnit&&this.requestQuoteCalculation()},this.handleChargeInputsChange=e=>{this.chargeInputs={...this.chargeInputs,...e},this.requestQuoteCalculation()},this.handleRentableItemAdd=e=>{this.desiredRentableItems.some(t=>t.id===e.id)||this.desiredRentableItems.push(e),this.requestQuoteCalculation()},this.handleRentableItemRemove=e=>{this.desiredRentableItems=this.desiredRentableItems.filter(t=>t.id!==e.id),this.requestQuoteCalculation()},this.groupFees=e=>e.reduce((e,t)=>{const n=t.frequency||$r.ONE_TIME;return e[n]=[...e[n]||[],t],e},{}),this.handleClickEmailOption=e=>{this.handleClose(),this.onClickEmailOption&&this.onClickEmailOption(e)},this.handleClickPhoneOption=e=>{this.handleClose(),this.onClickPhoneOption&&this.onClickPhoneOption(e)},this.handleClickSSTOption=e=>{this.handleClose(),this.onClickSSTOption&&this.onClickSSTOption(e)},this.handleClickTextUsOption=e=>{this.handleClose(),this.onClickTextUsOption&&this.onClickTextUsOption(e)},this.handleClose=()=>{var e;null===(e=this.onCloseClicked)||void 0===e||e.call(this)},this.handleSelectLayout=async e=>{this.selectedLayoutIds=e,await this.fetchUnits()},this.handleShare=async()=>{var e,t;this.selectedUnit&&this.moveInDateString&&this.pdfUrl&&(ni("feeCalculatorPdfDownloaded",{buildingSlug:this.buildingSlug,quoteId:null!==(t=null===(e=this.quote)||void 0===e?void 0:e.id)&&void 0!==t?t:null}),window.open(this.pdfUrl,"_blank"))},this.fetchUnits=async()=>{let e;this.isLoadingUnits=!0,this.selectedLayoutIds.includes(Kr)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await to({buildingSlug:this.buildingSlug,moveInDateEarliestString:this.moveInDateString,...e?{numBedrooms:e}:{},leaseTermMin:this.leaseTerm}),this.selectedUnit){this.units.some(e=>{var t;return e.id===(null===(t=this.selectedUnit)||void 0===t?void 0:t.id)})||(this.selectedUnit=null,this.quote=null,this.pdfUrl=null)}}finally{this.isLoadingUnits=!1}}}async performQuoteCalculation(e){if(!this.selectedUnit||!this.moveInDateString)return this.quote=null,this.pdfUrl=null,void(this.isCalculatingQuote=!1);const t=dn(Nn(this.moveInDateString),Nn(this.selectedUnit.earliestAvailable))?this.selectedUnit.earliestAvailable:this.moveInDateString,n=this.selectedUnit.id,i=this.leaseTerm;try{const r=await Zr({buildingSlug:this.buildingSlug,unitId:n,chargeInputs:this.chargeInputs,rentableItems:this.desiredRentableItems,leaseTerm:i,moveInDate:t},e);this.quote=r.quote,this.pdfUrl=r.pdfUrl||null,this.quote&&ni("feeCalculatorQuoteGenerated",{buildingSlug:this.buildingSlug,unitId:n,leaseTerm:i})}catch(e){"AbortError"!==(null==e?void 0:e.name)&&(this.quote=null,this.pdfUrl=null,this.isCalculatingQuote=!1,vi({logType:bi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e}}))}finally{e.aborted||(this.isCalculatingQuote=!1,this.isFirstCalculation=!1)}}get layouts(){var e,t;return null!==(t=null===(e=this.buildingWebchatView)||void 0===e?void 0:e.layoutOptions)&&void 0!==t?t:[]}updated(e){(e.has("primaryColor")||e.has("backgroundColor"))&&(this.style.setProperty("--primary-color",this.primaryColor),this.style.setProperty("--background-color",this.backgroundColor))}disconnectedCallback(){var e;super.disconnectedCallback(),this.quoteDebounceTimer&&(clearTimeout(this.quoteDebounceTimer),this.quoteDebounceTimer=null),null===(e=this.quoteAbortController)||void 0===e||e.abort(),this.quoteAbortController=null}render(){var e,t;const n=this.isCalculatingQuote&&!this.isExporting&&!this.isFirstCalculation,i=this.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return B`
4772
4772
  <div
4773
4773
  class="fee-calculator-container"
4774
4774
  @keydown=${e=>e.stopPropagation()}
@@ -5080,7 +5080,7 @@ xmlns="http://www.w3.org/2000/svg"
5080
5080
  <path d="M6 6C7.65685 6 9 4.65685 9 3C9 1.34315 7.65685 0 6 0C4.34315 0 3 1.34315 3 3C3 4.65685 4.34315 6 6 6ZM8 3C8 4.10457 7.10457 5 6 5C4.89543 5 4 4.10457 4 3C4 1.89543 4.89543 1 6 1C7.10457 1 8 1.89543 8 3Z" fill="${e}"/>
5081
5081
  <path d="M12 11C12 12 11 12 11 12H1C1 12 0 12 0 11C0 10 1 7 6 7C11 7 12 10 12 11ZM11 10.9965C10.9986 10.7497 10.8462 10.0104 10.1679 9.33211C9.51563 8.67985 8.2891 8 5.99999 8C3.71088 8 2.48435 8.67985 1.8321 9.33211C1.15375 10.0104 1.00142 10.7497 1 10.9965H11Z" fill="${e}"/>
5082
5082
  </svg>
5083
- `;var va=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let wa=class extends oe{constructor(){super(...arguments),this.isMinimized=!1,this.mobileStyles={},this.isFirstMount=!1,this.autoOpenChatWidget=!1,this.phoneNumber="",this.buildingName="",this.chatId="",this.orgLegalName="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.selfGuidedTourEnabled=!1,this.selfGuidedToursTypeOffered="",this.designConcept="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.hasChatEnabledDesktop=!1,this.hasChatEnabledMobile=!1,this.hasEmailEnabledDesktop=!1,this.hasEmailEnabledMobile=!1,this.hasApplyNowEnabledDesktop=!1,this.hasApplyNowEnabledMobile=!1,this.applicationLink="",this.hasCallUsEnabledDesktop=!1,this.hasCallUsEnabledMobile=!1,this.hasTextUsEnabledDesktop=!1,this.hasTextUsEnabledMobile=!1,this.hasSSTEnabledDesktop=!1,this.hasSSTEnabledMobile=!1,this.tourTypeOptions=[],this.hasDynamicSchedulingEnabled=!1,this.hasPricingCalculatorEnabledDesktop=!1,this.hasPricingCalculatorEnabledMobile=!1,this.onExitChat=()=>{},this.hasHideMobileFeatures=!1,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.showTourNextToChat=!1,this.onChatTapped=()=>{},this.onClickMinimize=()=>{},this.onSstClose=ya(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Le,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.isMobileFeaturesExpanded=!1,this.getNumCallToActions=()=>[this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile,!!this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile),this.hasSSTEnabledDesktop||this.hasSSTEnabledMobile,this.hasTextUsEnabledDesktop||this.hasTextUsEnabledMobile,this.hasApplyNowEnabledDesktop||this.hasApplyNowEnabledMobile,this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile].filter(e=>e).length,this.emailUsWindowRef=ke(),this.tourSchedulerRef=ke(),this.calculatorWindowRef=ke(),this.updated=async()=>{this.attachOnClickToEmailUsWindow(),this.attachOnClickToSSTWindow(),this.attachOnClickToCalculatorWindow(),(this.isEmailWindowOpen||this.isCallUsWindowOpen)&&this.isSSTWindowOpen&&this.onCloseSSTWindow()},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.attachOnClickToCalculatorWindow=()=>{const e=this.calculatorWindowRef.value;e&&(e.onCloseClicked=this.onCloseCalculatorWindow,e.onClickEmailOption=this.onClickEmailOption,e.onClickPhoneOption=this.onClickPhoneOption,e.onClickSSTOption=this.onClickSSTOption,e.onClickTextUsOption=this.onClickTextUsOption)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),zn(),Gn(this.buildingId),this.isSSTWindowOpen=!0},this.onCloseSSTWindow=()=>{this.onSstClose(),this.isSSTWindowOpen=!1,this.showTourNextToChat&&this.dispatchEvent(new CustomEvent("closeShowTourNextToChat",{bubbles:!0}))},this.onCloseCalculatorWindow=()=>{this.isCalculatorWindowOpen=!1},this.onClickTextUsOption=e=>{e.preventDefault(),e.stopPropagation(),this.isTextUsWindowOpen=!0},this.isCallToActionWindowOpen=()=>1===[this.isEmailWindowOpen,this.isCallUsWindowOpen,this.isSSTWindowOpen,this.isTextUsWindowOpen,this.isCalculatorWindowOpen].filter(e=>e).length,this.toggleMobileFeatures=()=>{this.isMobileFeaturesExpanded=!this.isMobileFeaturesExpanded},this.renderActionPills=()=>mn()||this.isMinimized||this.designConcept===_i.MINIMIZED?B` ${this.hasHideMobileFeatures&&mn()?B`<collapse-expand-button
5083
+ `;var va=function(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};let wa=class extends oe{constructor(){super(...arguments),this.isMinimized=!1,this.mobileStyles={},this.isFirstMount=!1,this.autoOpenChatWidget=!1,this.phoneNumber="",this.buildingName="",this.chatId="",this.orgLegalName="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.selfGuidedTourEnabled=!1,this.selfGuidedToursTypeOffered="",this.designConcept="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.hasChatEnabledDesktop=!1,this.hasChatEnabledMobile=!1,this.hasEmailEnabledDesktop=!1,this.hasEmailEnabledMobile=!1,this.hasApplyNowEnabledDesktop=!1,this.hasApplyNowEnabledMobile=!1,this.applicationLink="",this.hasCallUsEnabledDesktop=!1,this.hasCallUsEnabledMobile=!1,this.hasTextUsEnabledDesktop=!1,this.hasTextUsEnabledMobile=!1,this.hasSSTEnabledDesktop=!1,this.hasSSTEnabledMobile=!1,this.tourTypeOptions=[],this.hasDynamicSchedulingEnabled=!1,this.hasPricingCalculatorEnabledDesktop=!1,this.hasPricingCalculatorEnabledMobile=!1,this.onExitChat=()=>{},this.hasHideMobileFeatures=!1,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.showTourNextToChat=!1,this.onChatTapped=()=>{},this.handleChatTapped=()=>{ni("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=ya(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Le,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.isCalculatorWindowOpen=!1,this.isMobileFeaturesExpanded=!1,this.getNumCallToActions=()=>[this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile,!!this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile),this.hasSSTEnabledDesktop||this.hasSSTEnabledMobile,this.hasTextUsEnabledDesktop||this.hasTextUsEnabledMobile,this.hasApplyNowEnabledDesktop||this.hasApplyNowEnabledMobile,this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile].filter(e=>e).length,this.emailUsWindowRef=ke(),this.tourSchedulerRef=ke(),this.calculatorWindowRef=ke(),this.updated=async()=>{this.attachOnClickToEmailUsWindow(),this.attachOnClickToSSTWindow(),this.attachOnClickToCalculatorWindow(),(this.isEmailWindowOpen||this.isCallUsWindowOpen)&&this.isSSTWindowOpen&&this.onCloseSSTWindow()},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.attachOnClickToCalculatorWindow=()=>{const e=this.calculatorWindowRef.value;e&&(e.onCloseClicked=this.onCloseCalculatorWindow,e.onClickEmailOption=this.onClickEmailOption,e.onClickPhoneOption=this.onClickPhoneOption,e.onClickSSTOption=this.onClickSSTOption,e.onClickTextUsOption=this.onClickTextUsOption)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),ni("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),ni("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),ni("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),ni("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),fa(),ni("bookTourClicked",{buildingId:this.buildingId}),zn(),Gn(this.buildingId),this.isSSTWindowOpen=!0},this.onCloseSSTWindow=()=>{this.onSstClose(),this.isSSTWindowOpen=!1,this.showTourNextToChat&&this.dispatchEvent(new CustomEvent("closeShowTourNextToChat",{bubbles:!0}))},this.onCloseCalculatorWindow=()=>{this.isCalculatorWindowOpen=!1},this.onClickTextUsOption=e=>{e.preventDefault(),e.stopPropagation(),this.isTextUsWindowOpen=!0},this.isCallToActionWindowOpen=()=>1===[this.isEmailWindowOpen,this.isCallUsWindowOpen,this.isSSTWindowOpen,this.isTextUsWindowOpen,this.isCalculatorWindowOpen].filter(e=>e).length,this.toggleMobileFeatures=()=>{this.isMobileFeaturesExpanded=!this.isMobileFeaturesExpanded},this.renderActionPills=()=>mn()||this.isMinimized||this.designConcept===_i.MINIMIZED?B` ${this.hasHideMobileFeatures&&mn()?B`<collapse-expand-button
5084
5084
  .toExpand=${this.isMobileFeaturesExpanded}
5085
5085
  .primaryColor=${this.primaryColor}
5086
5086
  .onClick=${this.toggleMobileFeatures}
@@ -5090,7 +5090,7 @@ xmlns="http://www.w3.org/2000/svg"
5090
5090
  .onClickEmailOption=${this.onClickEmailOption}
5091
5091
  .onClickPhoneOption=${this.onClickPhoneOption}
5092
5092
  .onClickSSTOption=${this.onClickSSTOption}
5093
- .onChatTapped=${this.onChatTapped}
5093
+ .onChatTapped=${this.handleChatTapped}
5094
5094
  .onClickApplyNowOption=${this.onClickApplyNowOption}
5095
5095
  .onClickPriceCalculatorOption=${this.onClickPriceCalculatorOption}
5096
5096
  .overrideRentgrata=${this.overrideRentgrata}
@@ -5239,7 +5239,7 @@ xmlns="http://www.w3.org/2000/svg"
5239
5239
  <button
5240
5240
  id="type-hey__ask-prompt"
5241
5241
  class="type-hey__pill"
5242
- @click=${this.onChatTapped}
5242
+ @click=${this.handleChatTapped}
5243
5243
  style=${Ue({background:Fe(this.primaryColor,.2)})}
5244
5244
  aria-label="Chat with us"
5245
5245
  >
@@ -5298,7 +5298,7 @@ xmlns="http://www.w3.org/2000/svg"
5298
5298
  <button
5299
5299
  class="inner-pill-wrapper"
5300
5300
  style=${Ue({background:e?this.backgroundColor:this.primaryColor})}
5301
- @click=${this.onChatTapped}
5301
+ @click=${this.handleChatTapped}
5302
5302
  aria-label="Chat with us"
5303
5303
  >
5304
5304
  <div class="vertical-pill-left">
@@ -5475,7 +5475,7 @@ xmlns="http://www.w3.org/2000/svg"
5475
5475
  </button>`:""}
5476
5476
  </div>
5477
5477
  </div>
5478
- `}}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Pr),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Rr),window.eliseAi.onOpenSST=e=>{this.isSSTWindowOpen=!0,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()},(this.hasChatEnabledDesktop||this.hasChatEnabledMobile)&&(window.eliseAi.onOpenChat=e=>{this.onChatTapped(),this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,e&&e()}),(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile)&&(window.eliseAi.onOpenCallUsWindow=e=>{this.isCallUsWindowOpen=!0,this.isSSTWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile)&&(window.eliseAi.onOpenEmailUsWindow=e=>{this.isEmailWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile)&&(window.eliseAi.onOpenPriceCalculatorWindow=e=>{this.isCalculatorWindowOpen=!0,e&&e()});const e={top:mn()||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:mn()||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:mn()||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:mn()||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return B`
5478
+ `}}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Pr),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Rr),window.eliseAi.onOpenSST=e=>{this.isSSTWindowOpen=!0,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()},(this.hasChatEnabledDesktop||this.hasChatEnabledMobile)&&(window.eliseAi.onOpenChat=e=>{this.handleChatTapped(),this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isEmailWindowOpen=!1,e&&e()}),(this.hasCallUsEnabledDesktop||this.hasCallUsEnabledMobile)&&(window.eliseAi.onOpenCallUsWindow=e=>{this.isCallUsWindowOpen=!0,this.isSSTWindowOpen=!1,this.isEmailWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasEmailEnabledDesktop||this.hasEmailEnabledMobile)&&(window.eliseAi.onOpenEmailUsWindow=e=>{this.isEmailWindowOpen=!0,this.isSSTWindowOpen=!1,this.isCallUsWindowOpen=!1,this.onExitChat(),e&&e()}),(this.hasPricingCalculatorEnabledDesktop||this.hasPricingCalculatorEnabledMobile)&&(window.eliseAi.onOpenPriceCalculatorWindow=e=>{this.isCalculatorWindowOpen=!0,e&&e()});const e={top:mn()||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:mn()||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:mn()||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:mn()||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return B`
5479
5479
  <div
5480
5480
  class=${Zn()({"launcher__mobile-launcher-wrapper":mn()||this.isMinimized,"launcher__mini-launcher-wrapper":!mn()&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(mn()||this.isMinimized)})}
5481
5481
  style=${Ue({...this.launcherStyles,...this.mobileStyles,top:mn()||void 0===this.top||isNaN(this.top)?void 0!==this.mobileStyles.top?`${this.mobileStyles.top}px`:void 0:this.top-700+"px",bottom:mn()||void 0===this.bottom||isNaN(this.bottom)?void 0!==this.mobileStyles.bottom?`${this.mobileStyles.bottom}px`:"72px":`${this.bottom}px`,left:mn()||void 0===this.left||isNaN(this.left)?void 0!==this.mobileStyles.left?`${this.mobileStyles.left}px`:void 0:`${this.left}px`,right:mn()||void 0===this.right||isNaN(this.right)?void 0!==this.mobileStyles.right?`${this.mobileStyles.right}px`:"18px":`${this.right}px`})}
@@ -24,6 +24,7 @@ import { ChargeInputs } from "../../services/fees/calculateQuote";
24
24
  import { DesiredRentableItem } from "./model/desired-rentable-item";
25
25
  import { sendLoggingEvent } from "../../analytics";
26
26
  import { LogType } from "../../analytics";
27
+ import { pushGtmEvent } from "../../gtm";
27
28
  import fetchBuildingUnits from "../../services/fees/fetchBuildingUnits";
28
29
  import { layoutToBedrooms } from "../../services/fees/utils";
29
30
  import parseISO from "date-fns/parseISO";
@@ -171,20 +172,31 @@ export class FeeCalculator extends LitElement {
171
172
  ? this.selectedUnit.earliestAvailable
172
173
  : this.moveInDateString;
173
174
 
175
+ // Capture values before await to avoid race conditions
176
+ const unitId = this.selectedUnit.id;
177
+ const leaseTerm = this.leaseTerm;
178
+
174
179
  try {
175
180
  const res = await calculateQuote(
176
181
  {
177
182
  buildingSlug: this.buildingSlug,
178
- unitId: this.selectedUnit.id,
183
+ unitId,
179
184
  chargeInputs: this.chargeInputs,
180
185
  rentableItems: this.desiredRentableItems,
181
- leaseTerm: this.leaseTerm,
186
+ leaseTerm,
182
187
  moveInDate,
183
188
  },
184
189
  signal
185
190
  );
186
191
  this.quote = res.quote;
187
192
  this.pdfUrl = res.pdfUrl || null;
193
+ if (this.quote) {
194
+ pushGtmEvent("feeCalculatorQuoteGenerated", {
195
+ buildingSlug: this.buildingSlug,
196
+ unitId,
197
+ leaseTerm,
198
+ });
199
+ }
188
200
  } catch (error) {
189
201
  if ((error as DOMException)?.name !== "AbortError") {
190
202
  this.quote = null;
@@ -396,6 +408,10 @@ export class FeeCalculator extends LitElement {
396
408
  handleShare = async (): Promise<void> => {
397
409
  if (!this.selectedUnit || !this.moveInDateString || !this.pdfUrl) return;
398
410
 
411
+ pushGtmEvent("feeCalculatorPdfDownloaded", {
412
+ buildingSlug: this.buildingSlug,
413
+ quoteId: this.quote?.id ?? null,
414
+ });
399
415
  window.open(this.pdfUrl, "_blank");
400
416
  };
401
417
 
@@ -146,7 +146,7 @@ export class TimePicker extends LitElement {
146
146
  `;
147
147
 
148
148
  render(): TemplateResult {
149
- if (this.options.length === 1 && !this.selected) {
149
+ if (this.options?.length === 1 && !this.selected) {
150
150
  this.selected = getDateWithTimezoneOffset(
151
151
  this.options,
152
152
  this.options[0].displayTimeZoned
@@ -402,7 +402,7 @@ export class TourScheduler extends LitElement {
402
402
  };
403
403
 
404
404
  handlePhoneKeydown = (e: Event): void => {
405
- // these should always be true, this is just here to mollify TypeScript
405
+ // these should always be true, this is just here to help TypeScript
406
406
  if (
407
407
  !(e instanceof KeyboardEvent) ||
408
408
  !(e.target instanceof HTMLInputElement) ||
@@ -754,6 +754,10 @@ export class TourScheduler extends LitElement {
754
754
  .backgroundColor=${this.backgroundColor}
755
755
  @click="${async () => {
756
756
  this.tourType = TourType.Self;
757
+ pushGtmEvent("tourTypeSelected", {
758
+ tourType: TourType.Self,
759
+ buildingId: this.buildingId,
760
+ });
757
761
  if (
758
762
  this.sgtUrl &&
759
763
  shouldOpenTourLink(
@@ -798,6 +802,10 @@ export class TourScheduler extends LitElement {
798
802
  .foregroundColorOnSecondaryBackgroundColor}
799
803
  @click="${async () => {
800
804
  this.tourType = TourType.Guided;
805
+ pushGtmEvent("tourTypeSelected", {
806
+ tourType: TourType.Guided,
807
+ buildingId: this.buildingId,
808
+ });
801
809
 
802
810
  if (this.escortedToursLink) {
803
811
  window.open(this.escortedToursLink, "_blank");
@@ -833,6 +841,10 @@ export class TourScheduler extends LitElement {
833
841
  .backgroundColor=${this.backgroundColor}
834
842
  @click="${async () => {
835
843
  this.tourType = TourType.Virtual;
844
+ pushGtmEvent("tourTypeSelected", {
845
+ tourType: TourType.Virtual,
846
+ buildingId: this.buildingId,
847
+ });
836
848
  if (
837
849
  this.virtualToursLink &&
838
850
  shouldOpenTourLink(
@@ -933,6 +945,13 @@ export class TourScheduler extends LitElement {
933
945
  ) {
934
946
  return;
935
947
  }
948
+ if (e.target.selectedDate) {
949
+ pushGtmEvent("tourDateSelected", {
950
+ selectedDate: format(e.target.selectedDate, "yyyy-MM-dd"),
951
+ tourType: this.tourType,
952
+ buildingId: this.buildingId,
953
+ });
954
+ }
936
955
  this._setDefaultSelectedDateAndTimes(
937
956
  tourTypeMap[this.tourType],
938
957
  e.target.selectedDate
@@ -998,6 +1017,13 @@ export class TourScheduler extends LitElement {
998
1017
  : null;
999
1018
  this.selectedTime =
1000
1019
  index !== null ? daysAvailabilities[index] : null;
1020
+ if (this.selectedTime) {
1021
+ pushGtmEvent("tourTimeSelected", {
1022
+ selectedTime: `${this.selectedTime.datetime}${this.selectedTime.offset}`,
1023
+ tourType: this.tourType,
1024
+ buildingId: this.buildingId,
1025
+ });
1026
+ }
1001
1027
  }
1002
1028
  }}
1003
1029
  ></time-picker>
@@ -1177,6 +1203,12 @@ export class TourScheduler extends LitElement {
1177
1203
  value: i,
1178
1204
  }))}"
1179
1205
  @change=${() => {
1206
+ if (this.selectedLeadSource?.value) {
1207
+ pushGtmEvent("tourLeadSourceSelected", {
1208
+ leadSource: this.selectedLeadSource.value,
1209
+ buildingId: this.buildingId,
1210
+ });
1211
+ }
1180
1212
  this.requestUpdate();
1181
1213
  }}
1182
1214
  >
@@ -46,6 +46,7 @@ import {
46
46
  resetAvailabilitiesCache,
47
47
  } from "../../getAvailabilities";
48
48
  import { LeadSourceMultitouchClient } from "../LeadSourceMultitouchClient";
49
+ import { pushGtmEvent } from "../../gtm";
49
50
 
50
51
  @customElement("meetelise-launcher")
51
52
  export class Launcher extends LitElement {
@@ -175,6 +176,11 @@ export class Launcher extends LitElement {
175
176
  return;
176
177
  };
177
178
 
179
+ handleChatTapped = (): void => {
180
+ pushGtmEvent("chatOpened", { buildingId: this.buildingId });
181
+ this.onChatTapped();
182
+ };
183
+
178
184
  @property({ attribute: true })
179
185
  onClickMinimize: (e: MouseEvent) => void = () => {
180
186
  return;
@@ -294,6 +300,7 @@ export class Launcher extends LitElement {
294
300
  e.preventDefault();
295
301
  e.stopPropagation();
296
302
  closeRengrataWidget();
303
+ pushGtmEvent("emailUsClicked", { buildingId: this.buildingId });
297
304
 
298
305
  this.isEmailWindowOpen = true;
299
306
  };
@@ -306,6 +313,7 @@ export class Launcher extends LitElement {
306
313
  e.preventDefault();
307
314
  e.stopPropagation();
308
315
  closeRengrataWidget();
316
+ pushGtmEvent("callTextUsClicked", { buildingId: this.buildingId });
309
317
  this.isCallUsWindowOpen = true;
310
318
  };
311
319
 
@@ -313,6 +321,10 @@ export class Launcher extends LitElement {
313
321
  e.preventDefault();
314
322
  e.stopPropagation();
315
323
  closeRengrataWidget();
324
+ pushGtmEvent("applyNowClicked", {
325
+ buildingId: this.buildingId,
326
+ applicationLink: this.applicationLink,
327
+ });
316
328
  window.open(this.applicationLink, "_blank");
317
329
  };
318
330
 
@@ -320,6 +332,7 @@ export class Launcher extends LitElement {
320
332
  e.preventDefault();
321
333
  e.stopPropagation();
322
334
  closeRengrataWidget();
335
+ pushGtmEvent("feeCalculatorOpened", { buildingId: this.buildingId });
323
336
  this.isCalculatorWindowOpen = true;
324
337
  };
325
338
 
@@ -331,6 +344,7 @@ export class Launcher extends LitElement {
331
344
  e.preventDefault();
332
345
  e.stopPropagation();
333
346
  closeRengrataWidget();
347
+ pushGtmEvent("bookTourClicked", { buildingId: this.buildingId });
334
348
  resetAvailabilitiesCache();
335
349
  getRawAvailabilities(this.buildingId);
336
350
 
@@ -393,7 +407,7 @@ export class Launcher extends LitElement {
393
407
  .onClickEmailOption=${this.onClickEmailOption}
394
408
  .onClickPhoneOption=${this.onClickPhoneOption}
395
409
  .onClickSSTOption=${this.onClickSSTOption}
396
- .onChatTapped=${this.onChatTapped}
410
+ .onChatTapped=${this.handleChatTapped}
397
411
  .onClickApplyNowOption=${this.onClickApplyNowOption}
398
412
  .onClickPriceCalculatorOption=${this.onClickPriceCalculatorOption}
399
413
  .overrideRentgrata=${this.overrideRentgrata}
@@ -680,7 +694,7 @@ export class Launcher extends LitElement {
680
694
  <button
681
695
  id="type-hey__ask-prompt"
682
696
  class="type-hey__pill"
683
- @click=${this.onChatTapped}
697
+ @click=${this.handleChatTapped}
684
698
  style=${styleMap({
685
699
  background: hexToAlmostWhite(this.primaryColor, 0.2),
686
700
  })}
@@ -778,7 +792,7 @@ export class Launcher extends LitElement {
778
792
  ? this.backgroundColor
779
793
  : this.primaryColor,
780
794
  })}
781
- @click=${this.onChatTapped}
795
+ @click=${this.handleChatTapped}
782
796
  aria-label="Chat with us"
783
797
  >
784
798
  <div class="vertical-pill-left">
@@ -1111,7 +1125,7 @@ export class Launcher extends LitElement {
1111
1125
  if (this.hasChatEnabledDesktop || this.hasChatEnabledMobile) {
1112
1126
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1113
1127
  (window as any).eliseAi.onOpenChat = (callBack?: () => void) => {
1114
- this.onChatTapped();
1128
+ this.handleChatTapped();
1115
1129
  this.isSSTWindowOpen = false;
1116
1130
  this.isCallUsWindowOpen = false;
1117
1131
  this.isEmailWindowOpen = false;