@meetelise/chat 1.20.69 → 1.20.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.20.69",
3
+ "version": "1.20.70",
4
4
  "description": "",
5
5
  "main": "public/dist/index.js",
6
6
  "type": "module",
@@ -2509,20 +2509,20 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2509
2509
  justify-content: center;
2510
2510
  align-items: center;
2511
2511
  }
2512
- `;var zi=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 Vi=class extends ae{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobile=!1,this.brandColor=ri,this.renderListElement=(e,t)=>J` <li
2513
- @click=${e}
2512
+ `;var zi=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 Vi=class extends ae{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobile=!1,this.brandColor=ri,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasCallUsEnabled=!1,this.hasSSTEnabled=!1,this.renderListElement=(e,t,n)=>e?J` <li
2513
+ @click=${t}
2514
2514
  class="typeMobile-bttn"
2515
2515
  style=${Si({background:`${this.brandColor}`})}
2516
2516
  >
2517
2517
  <div class="typeMobile-inner">
2518
- <div class="typeMobile-icon">${t}</div>
2518
+ <div class="typeMobile-icon">${n}</div>
2519
2519
  </div>
2520
- </li>`}render(){return J`<div class="typeMobile-list">
2520
+ </li>`:""}render(){return J`<div class="typeMobile-list">
2521
2521
  <ul>
2522
- ${this.renderListElement(this.onClickEmailOption,Pi)}
2523
- ${this.renderListElement(this.onClickPhoneOption,Mi)}
2524
- ${this.renderListElement(this.onClickSSTOption,_i)}
2525
- ${this.hideChat?"":this.renderListElement(this.onChatTapped,qi)}
2522
+ ${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,Pi)}
2523
+ ${this.renderListElement(this.hasCallUsEnabled,this.onClickPhoneOption,Mi)}
2524
+ ${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,_i)}
2525
+ ${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,qi)}
2526
2526
  ${this.isMobile||this.hideChat?"":J`
2527
2527
  <minimize-expand-button
2528
2528
  .onClick=${this.onClickMinimize}
@@ -2531,7 +2531,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2531
2531
  ></minimize-expand-button>
2532
2532
  `}
2533
2533
  </ul>
2534
- </div>`}};Vi.styles=[Qi],zi([de({attribute:!0})],Vi.prototype,"onClickMinimize",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickEmailOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickPhoneOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickSSTOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onChatTapped",void 0),zi([de({attribute:!0})],Vi.prototype,"hideChat",void 0),zi([de({attribute:!0})],Vi.prototype,"isMobile",void 0),zi([de({attribute:!0})],Vi.prototype,"brandColor",void 0),Vi=zi([ue("mobile-launcher")],Vi);var Xi=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 Yi=class extends ae{constructor(){super(...arguments),this.isMobile=!1,this.isMinimized=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.autoOpenChatWidget=!1,this.phoneNumber="",this.chatId="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.buildingABTestType="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.virtualToursLink="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.onClickMinimize=()=>{},this.launcherStyles={},this.brandColor=ri,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=Oe(),this.textUsWindowRef=Oe(),this.tourSchedulerRef=Oe(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(Wi[e])return Wi[e];const n=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await t().get(n);return Wi[e]=i.data,i.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return J`
2534
+ </div>`}};Vi.styles=[Qi],zi([de({attribute:!0})],Vi.prototype,"onClickMinimize",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickEmailOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickPhoneOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onClickSSTOption",void 0),zi([de({attribute:!0})],Vi.prototype,"onChatTapped",void 0),zi([de({attribute:!0})],Vi.prototype,"hideChat",void 0),zi([de({attribute:!0})],Vi.prototype,"isMobile",void 0),zi([de({attribute:!0})],Vi.prototype,"brandColor",void 0),zi([de({attribute:!0})],Vi.prototype,"hasChatEnabled",void 0),zi([de({attribute:!0})],Vi.prototype,"hasEmailEnabled",void 0),zi([de({attribute:!0})],Vi.prototype,"hasCallUsEnabled",void 0),zi([de({attribute:!0})],Vi.prototype,"hasSSTEnabled",void 0),Vi=zi([ue("mobile-launcher")],Vi);var Xi=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 Yi=class extends ae{constructor(){super(...arguments),this.isMobile=!1,this.isMinimized=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.autoOpenChatWidget=!1,this.phoneNumber="",this.chatId="",this.chatCallUsHeader="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.sgtUrl="",this.buildingABTestType="",this.featureFlagShowDropdown="",this.leadSources=[],this.currentLeadSource="",this.escortedToursLink="",this.virtualToursLink="",this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.unitOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.onClickMinimize=()=>{},this.launcherStyles={},this.brandColor=ri,this.isEmailWindowOpen=!1,this.isCallUsWindowOpen=!1,this.isSSTWindowOpen=!1,this.isTextUsWindowOpen=!1,this.getNumCallToActions=()=>[this.hasEmailEnabled,!!this.phoneNumber&&this.hasCallUsEnabled,this.hasSSTEnabled,this.hasTextUsEnabled].filter((e=>e)).length,this.emailUsWindowRef=Oe(),this.textUsWindowRef=Oe(),this.tourSchedulerRef=Oe(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(Wi[e])return Wi[e];const n=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,i=await t().get(n);return Wi[e]=i.data,i.data})(this.buildingId);this.hasTextUsEnabled=e.length>0&&this.hasTextUsEnabled&&4895!==this.buildingId,await async function(e){return!!e}(this.buildingId)&&this.hasSSTEnabled&&(this.hasSSTEnabled=!0)}},this.attachOnClickToEmailUsWindow=()=>{const e=this.emailUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseEmailWindow)},this.attachOnClickToTextUsWindow=()=>{const e=this.textUsWindowRef.value;e&&(e.onCloseClicked=this.onCloseTextUsWindow)},this.attachOnClickToSSTWindow=()=>{const e=this.tourSchedulerRef.value;e&&(e.onCloseClicked=this.onCloseSSTWindow)},this.onClickEmailOption=e=>{e.preventDefault(),e.stopPropagation(),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.renderEmailOption=()=>{const e=this.getNumCallToActions()>2?"Email":"Email us";return J`
2535
2535
  <div
2536
2536
  @click=${this.onClickEmailOption}
2537
2537
  class="launcher__call-to-action-option"
@@ -2576,6 +2576,10 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2576
2576
  .onChatTapped=${this.onChatTapped}
2577
2577
  .isMobile=${this.isMobile}
2578
2578
  .brandColor=${this.brandColor}
2579
+ .hasChatEnabled=${this.hasChatEnabled}
2580
+ .hasEmailEnabled=${this.hasEmailEnabled}
2581
+ .hasCallUsEnabled=${this.phoneNumber&&this.hasCallUsEnabled}
2582
+ .hasSSTEnabled=${this.hasSSTEnabled}
2579
2583
  ></mobile-launcher>`:this.buildingABTestType===pi.ConceptEmoji?J`
2580
2584
  <div
2581
2585
  class="type-hey__list"
@@ -2837,7 +2841,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2837
2841
  cursor: pointer;
2838
2842
  filter: brightness(90%);
2839
2843
  }
2840
- `],pr([de({attribute:!0})],fr.prototype,"onClick",void 0),pr([de({attribute:!0})],fr.prototype,"brandColor",void 0),pr([de({attribute:!0})],fr.prototype,"toExpand",void 0),fr=pr([ue("minimize-expand-button")],fr);var hr,mr=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 vr=hr=class extends ae{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.themeId="Glass",this.useMiniWidget=!0,this.launcherStyles={},this.isMinimized=!1,this.brandColor=null,this.popup=null,this.theme=ui({themeId:this.themeId,brandColor:this.brandColor}),this.chatId="",this.analytics=null,this.isMobile=r(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Mn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.yardiDNIScriptInterval=null,this.launcherRef=Oe(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1,"true"===localStorage.getItem("overrideContactUsForm")&&this.overrideContactUsForm()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r;if(!this.buildingSlug||!this.orgSlug)return;const[o,a,s,u,l,d,c]=await Promise.all([di(this.orgSlug,this.buildingSlug),fi(this.buildingSlug),cr(this.buildingSlug),hi(this.buildingSlug,document.referrer),Pn(this.buildingSlug),Dn(this.buildingSlug),ci(this.buildingSlug)]);o.phoneNumber=Fe(o.phoneNumber),this.building=o,this.buildingABTestType=null!==(e=null==a?void 0:a.abTestType)&&void 0!==e?e:"",this.leadSources=s,this.currentLeadSource=u,this.featureFlagShowDropdown=l,c&&(null===this.brandColor&&(this.brandColor=null!==(n=c.primaryColor)&&void 0!==n?n:null),null===this.buildingABTestType&&(this.buildingABTestType=null!==(i=c.designConcept)&&void 0!==i?i:null)),null===this.brandColor&&(this.brandColor=ri);let p=null;d&&(p=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Fe(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),this.phoneNumberForSource=p||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),An(this.building.id),this.chatId=function(e,t){const n=ei(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=ti(e,t),i=localStorage.getItem(n)||$n(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Zn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ui({themeId:null!==(r=this.themeId)&&void 0!==r?r:this.building.themeId,brandColor:this.brandColor}),this.analytics=new jn(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,hr.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{var o;const a=n.createPopup(li(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await a.mount({show:!1}),a.on("close",(()=>{this.hideLauncher=!1}));const s=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=s,!s)throw new Error("Failed to find chat window");s.classList.add("meetelise-chat","pane"),this.isMobile||s.classList.add("launcher__desktop"),s.style.zIndex="99999999999",this.popup=a;const u=sessionStorage.getItem("autoOpenedTimestamp"),l=!u||u&&an(un(u));e.autoOpenChatWidget&&l&&!r()&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",tn(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15))),null===(o=this.analytics)||void 0===o||o.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.handleContactTabClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickPhoneOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=this.talkjsPopupElement.getBoundingClientRect(),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActions");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.bottom-24+"px"}},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})},this.overrideContactUsForm=()=>{var e;const t=document.getElementById("myContactForm");let n;if(!(t&&t instanceof HTMLFormElement))return;for(let e=0;e<t.elements.length;e++){const i=t.elements[e];if("button"===i.tagName.toLowerCase()&&"fakebutton"===i.getAttribute("data-selenium-id")){n=i;break}}if(!n)return;const i=n.cloneNode(!0);null===(e=n.parentNode)||void 0===e||e.replaceChild(i,n),i.textContent="Elise Submit";const r=()=>{const e={firstName:document.getElementById("firstname"),lastName:document.getElementById("lastname"),email:document.getElementById("email"),phone:document.getElementById("phonenumber"),message:document.getElementById("message")};return Object.values(e).some((e=>null===e)),e};i.onclick=function(e){if(!Object.values(r()).every((e=>null!==e&&"true"!==e.getAttribute("aria-invalid"))))return;e.preventDefault();const n=(()=>{const e={};return Object.entries(r()).forEach((([t,n])=>e[t]=null==n?void 0:n.value)),e})(),i={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:3660},o=JSON.stringify(i);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":"e2e-test-yardi-building","org-slug":"test-company"},body:o}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return t.reset(),e.json()}))}}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&hr.session))return;this.chatId=Zn(this.orgSlug,this.buildingSlug);const e=await hr.session;this.analytics.chatId=this.chatId,this.popup.select(li(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S,T,A,x,O,C,I,N,R,E,F,_,M;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Yi);const P=this.hideLauncher&&!this.isLoading&&!this.isMobile;return J`
2844
+ `],pr([de({attribute:!0})],fr.prototype,"onClick",void 0),pr([de({attribute:!0})],fr.prototype,"brandColor",void 0),pr([de({attribute:!0})],fr.prototype,"toExpand",void 0),fr=pr([ue("minimize-expand-button")],fr);var hr,mr=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 vr=hr=class extends ae{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.themeId="Glass",this.useMiniWidget=!0,this.launcherStyles={},this.isMinimized=!1,this.brandColor=null,this.popup=null,this.theme=ui({themeId:this.themeId,brandColor:this.brandColor}),this.chatId="",this.analytics=null,this.isMobile=r(),this.launcher=null,this.building=null,this.buildingABTestType=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=Mn.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.talkjsPopupElement=null,this.yardiDNIScriptInterval=null,this.launcherRef=Oe(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher(),this.isLoading=!1,"true"===localStorage.getItem("overrideContactUsForm")&&this.overrideContactUsForm()},this.setBuildingDerivedInfo=async()=>{var e,n,i,r;if(!this.buildingSlug||!this.orgSlug)return;const[o,a,s,u,l,d,c]=await Promise.all([di(this.orgSlug,this.buildingSlug),fi(this.buildingSlug),cr(this.buildingSlug),hi(this.buildingSlug,document.referrer),Pn(this.buildingSlug),Dn(this.buildingSlug),ci(this.buildingSlug)]);o.phoneNumber=Fe(o.phoneNumber),this.building=o,this.buildingABTestType=null!==(e=null==a?void 0:a.abTestType)&&void 0!==e?e:"",this.leadSources=s,this.currentLeadSource=u,this.featureFlagShowDropdown=l,c&&(null===this.brandColor&&(this.brandColor=null!==(n=c.primaryColor)&&void 0!==n?n:null),null===this.buildingABTestType&&(this.buildingABTestType=null!==(i=c.designConcept)&&void 0!==i?i:null)),null===this.brandColor&&(this.brandColor=ri);let p=null;d&&(p=await async function(e,n){try{const i=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source?source=${n}`);return i.data?{number:Fe(i.data.number),isMatch:i.data.isMatch,isPropertyWebsiteCatchall:i.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,this.currentLeadSource)),this.phoneNumberForSource=p||{number:this.building.phoneNumber,isMatch:!1,isPropertyWebsiteCatchall:!0},this.currentLeadSource&&(this.leadSources.includes(this.currentLeadSource)||this.leadSources.push(this.currentLeadSource)),An(this.building.id),this.chatId=function(e,t){const n=ei(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=ti(e,t),i=localStorage.getItem(n)||$n(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Zn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=ui({themeId:null!==(r=this.themeId)&&void 0!==r?r:this.building.themeId,brandColor:this.brandColor}),this.analytics=new jn(this.orgSlug,this.buildingSlug,this.chatId),this.analytics.ping("webchat_heartbeat")},this.initializeLaunchJS=async()=>{var e;if(!this.building||!this.theme)return;if(this.popup&&this.launcher)return;const[t,n,i,r]=await Promise.all([this.building,this.theme,this.avatarSrc,hr.session]);if(t.conversationMaintenanceMode)return new Promise((()=>{console.warn("MeetElise Chat is in maintenance mode. Chat icon will not appear.")}));await this.configureTalkJSPopup(t,n,r,i),this.configureLauncherElement(),null===(e=this.analytics)||void 0===e||e.ping("load"),this.yardiDNIScriptInterval=setInterval((()=>this.pollForYardiCampaignSource()),1e3),setTimeout(clearInterval,15e3,this.yardiDNIScriptInterval)},this.configureLauncherElement=()=>{this.popup&&this.launcherRef.value&&(this.launcher=this.launcherRef.value)},this.configureTalkJSPopup=async(e,t,n,i)=>{var o;const a=n.createPopup(li(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await a.mount({show:!1}),a.on("close",(()=>{this.hideLauncher=!1}));const s=document.querySelector(".__talkjs_popup");if(this.talkjsPopupElement=s,!s)throw new Error("Failed to find chat window");s.classList.add("meetelise-chat","pane"),this.isMobile||s.classList.add("launcher__desktop"),s.style.zIndex="99999999999",this.popup=a;const u=sessionStorage.getItem("autoOpenedTimestamp"),l=!u||u&&an(un(u));e.autoOpenChatWidget&&l&&!r()&&(this.popup.show(),this.hideLauncher=!0,this.hasMounted=!0,sessionStorage.setItem("autoOpenedTimestamp",tn(function(e,t){Ue(2,arguments);var n=et(t);return tt(e,6e4*n)}(new Date,15))),null===(o=this.analytics)||void 0===o||o.ping("autoOpen"))},this.firstUpdated=()=>{this.initializeInstanceVariables()},this.handleContactClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e)},this.handleContactTabClicked=e=>{var t,n;null===(t=this.popup)||void 0===t||t.hide(),this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickPhoneOption(e)},this.adjustTopHeaderContactCoords=()=>{var e;if(this.talkjsPopupElement){const t=this.talkjsPopupElement.getBoundingClientRect(),n=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActions");if(!n)return;n.style.left=`${t.left+20}px`,n.style.top=t.bottom-24+"px"}},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{var e;this.popup&&(this.popup.show(),null===(e=this.analytics)||void 0===e||e.ping("open"),this.hideLauncher=!0,this.hasMounted=!0)})},this.overrideContactUsForm=()=>{var e;const t=document.getElementById("myContactForm");let n;if(!(t&&t instanceof HTMLFormElement))return;for(let e=0;e<t.elements.length;e++){const i=t.elements[e];if("button"===i.tagName.toLowerCase()&&"fakebutton"===i.getAttribute("data-selenium-id")){n=i;break}}if(!n)return;const i=n.cloneNode(!0);null===(e=n.parentNode)||void 0===e||e.replaceChild(i,n),i.textContent="Elise Submit";const r=()=>{const e={firstName:document.getElementById("firstname"),lastName:document.getElementById("lastname"),email:document.getElementById("email"),phone:document.getElementById("phonenumber"),message:document.getElementById("message")};return Object.values(e).some((e=>null===e)),e};i.onclick=function(e){if(!Object.values(r()).every((e=>null!==e&&"true"!==e.getAttribute("aria-invalid"))))return;e.preventDefault();const n=(()=>{const e={};return Object.entries(r()).forEach((([t,n])=>e[t]=null==n?void 0:n.value)),e})(),i={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:3660},o=JSON.stringify(i);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":"e2e-test-yardi-building","org-slug":"test-company"},body:o}).then((e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return t.reset(),e.json()}))}}}pollForYardiCampaignSource(){var e,t,n;(null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&(null===(n=this.analytics)||void 0===n||n.ping("yardi-DNI-init"),this.yardiDNIScriptInterval&&clearInterval(this.yardiDNIScriptInterval))}async restartConversation(){if(!(this.analytics&&this.analytics.chatId&&this.building&&this.popup&&hr.session))return;this.chatId=Zn(this.orgSlug,this.buildingSlug);const e=await hr.session;this.analytics.chatId=this.chatId,this.popup.select(li(e,this.building,this.theme,this.avatarSrc||this.building.avatarSrc,this.chatId,this.isMobile))}remove(){var e;null===(e=this.popup)||void 0===e||e.destroy()}open(){var e;null===(e=this.popup)||void 0===e||e.show()}close(){var e;null===(e=this.popup)||void 0===e||e.hide()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustTopHeaderContactCoords)}disconnectedCallback(){window.removeEventListener("resize",this.adjustTopHeaderContactCoords),super.disconnectedCallback()}updated(){this.adjustTopHeaderContactCoords()}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,b,w,S,T,A,x,O,C,I,N,R,E,F,_,M,P,D,q,U,B,k,L,j;window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Yi);const H=this.hideLauncher&&!this.isLoading&&!this.isMobile;return J`
2841
2845
  <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=1">
2842
2846
  <div id="aria-describe-info" style="display: none;">
2843
2847
  EliseAI widget that allows you to chat with a virtual assistant, book
@@ -2886,7 +2890,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2886
2890
  </div>
2887
2891
  <div
2888
2892
  id="chatAdditionalActions"
2889
- class=${ve({showTab:P,hideTab:!P})}
2893
+ class=${ve({showTab:H,hideTab:!H})}
2890
2894
  >
2891
2895
  <mobile-launcher
2892
2896
  .onClickMinimize=${this.onClickMinimize}
@@ -2896,6 +2900,10 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
2896
2900
  .isMobile=${this.isMobile}
2897
2901
  .brandColor=${this.brandColor}
2898
2902
  .hideChat=${!0}
2903
+ .hasChatEnabled=${!(null===(P=this.building)||void 0===P?void 0:P.chatWidgets)||(null===(D=this.building)||void 0===D?void 0:D.chatWidgets.includes("CHAT"))}
2904
+ .hasEmailEnabled=${!(null===(q=this.building)||void 0===q?void 0:q.chatWidgets)||(null===(U=this.building)||void 0===U?void 0:U.chatWidgets.includes("EMAIL"))}
2905
+ .hasCallUsEnabled=${!(null===(B=this.building)||void 0===B?void 0:B.chatWidgets)||(null===(k=this.building)||void 0===k?void 0:k.chatWidgets.includes("CALL"))}
2906
+ .hasSSTEnabled=${!(null===(L=this.building)||void 0===L?void 0:L.chatWidgets)||(null===(j=this.building)||void 0===j?void 0:j.chatWidgets.includes("SST"))}
2899
2907
  ></mobile-launcher>
2900
2908
  <minimize-expand-button
2901
2909
  .brandColor=${this.brandColor}
@@ -324,6 +324,10 @@ export class Launcher extends LitElement {
324
324
  .onChatTapped=${this.onChatTapped}
325
325
  .isMobile=${this.isMobile}
326
326
  .brandColor=${this.brandColor}
327
+ .hasChatEnabled=${this.hasChatEnabled}
328
+ .hasEmailEnabled=${this.hasEmailEnabled}
329
+ .hasCallUsEnabled=${this.phoneNumber && this.hasCallUsEnabled}
330
+ .hasSSTEnabled=${this.hasSSTEnabled}
327
331
  ></mobile-launcher>`;
328
332
  }
329
333
 
@@ -45,10 +45,26 @@ export class MobileLauncher extends LitElement {
45
45
  @property({ attribute: true })
46
46
  brandColor: string = defaultBrandColor;
47
47
 
48
+ @property({ attribute: true })
49
+ hasChatEnabled = false;
50
+
51
+ @property({ attribute: true })
52
+ hasEmailEnabled = false;
53
+
54
+ @property({ attribute: true })
55
+ hasCallUsEnabled = false;
56
+
57
+ @property({ attribute: true })
58
+ hasSSTEnabled = false;
59
+
48
60
  private renderListElement = (
61
+ isEnabled: boolean,
49
62
  onClick: (e: MouseEvent) => void,
50
63
  icon: TemplateResult<2> // is an svg icon in lit
51
64
  ) => {
65
+ if (!isEnabled) {
66
+ return "";
67
+ }
52
68
  return html` <li
53
69
  @click=${onClick}
54
70
  class="typeMobile-bttn"
@@ -66,20 +82,25 @@ export class MobileLauncher extends LitElement {
66
82
  return html`<div class="typeMobile-list">
67
83
  <ul>
68
84
  ${this.renderListElement(
85
+ this.hasEmailEnabled,
69
86
  this.onClickEmailOption,
70
87
  EmailBlackOutlineIcon
71
88
  )}
72
89
  ${this.renderListElement(
90
+ this.hasCallUsEnabled,
73
91
  this.onClickPhoneOption,
74
92
  PhoneBlackOutlineIcon
75
93
  )}
76
94
  ${this.renderListElement(
95
+ this.hasSSTEnabled,
77
96
  this.onClickSSTOption,
78
97
  BookTourBlackOutlineIcon
79
98
  )}
80
- ${this.hideChat
81
- ? ""
82
- : this.renderListElement(this.onChatTapped, ChatBlackOutlineIcon)}
99
+ ${this.renderListElement(
100
+ this.hasChatEnabled && !this.hideChat, // hide chat if under talkjs popup
101
+ this.onChatTapped,
102
+ ChatBlackOutlineIcon
103
+ )}
83
104
  ${!this.isMobile && !this.hideChat
84
105
  ? html`
85
106
  <minimize-expand-button
@@ -571,6 +571,26 @@ export class MEChat extends LitElement {
571
571
  .isMobile=${this.isMobile}
572
572
  .brandColor=${this.brandColor}
573
573
  .hideChat=${true}
574
+ .hasChatEnabled=${
575
+ !this.building?.chatWidgets
576
+ ? true
577
+ : this.building?.chatWidgets.includes("CHAT")
578
+ }
579
+ .hasEmailEnabled=${
580
+ !this.building?.chatWidgets
581
+ ? true
582
+ : this.building?.chatWidgets.includes("EMAIL")
583
+ }
584
+ .hasCallUsEnabled=${
585
+ !this.building?.chatWidgets
586
+ ? true
587
+ : this.building?.chatWidgets.includes("CALL")
588
+ }
589
+ .hasSSTEnabled=${
590
+ !this.building?.chatWidgets
591
+ ? true
592
+ : this.building?.chatWidgets.includes("SST")
593
+ }
574
594
  ></mobile-launcher>
575
595
  <minimize-expand-button
576
596
  .brandColor=${this.brandColor}