@meetelise/chat 1.19.4 → 1.19.5
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
package/public/dist/index.js
CHANGED
|
@@ -1793,12 +1793,12 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1793
1793
|
line-height: 22px;
|
|
1794
1794
|
margin-top: 8px;
|
|
1795
1795
|
}
|
|
1796
|
-
`,ii],si([oe({attribute:!1})],ui.prototype,"onCloseClicked",void 0),si([oe({attribute:!1})],ui.prototype,"buildingId",void 0),si([ae()],ui.prototype,"phoneNumber",void 0),si([ae()],ui.prototype,"hasSubmittedForm",void 0),si([ae()],ui.prototype,"hasPhoneNumberError",void 0),si([ae()],ui.prototype,"hasSubmissionError",void 0),si([ae()],ui.prototype,"isSubmitting",void 0),ui=si([ie("text-us-window")],ui);const li=async(e,t)=>{const n={building_id:t,lead_source:"property-website",phone_number:"+1"+e.replace("(","").replace(")","").replace(" ","").replace("-","")};await Xt().post("https://app.meetelise.com/platformApi/state/create/textMe",n,{headers:{"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})},di={},ci=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];var pi=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 fi=class extends te{constructor(){super(...arguments),this.phoneNumber="1-855-531-5131",this.buildingId=0,this.firstUpdated=async()=>{this.buildingId&&(this.officeHoursTextInfo=await(async e=>{const t=await(async e=>{if(di[e])return di[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await Xt().get(t);return di[e]=n.data,n.data})(e);return ci.map((e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e}))})(this.buildingId))},this.officeHoursTextInfo=[],this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return D`<a href="tel:${i}"
|
|
1796
|
+
`,ii],si([oe({attribute:!1})],ui.prototype,"onCloseClicked",void 0),si([oe({attribute:!1})],ui.prototype,"buildingId",void 0),si([ae()],ui.prototype,"phoneNumber",void 0),si([ae()],ui.prototype,"hasSubmittedForm",void 0),si([ae()],ui.prototype,"hasPhoneNumberError",void 0),si([ae()],ui.prototype,"hasSubmissionError",void 0),si([ae()],ui.prototype,"isSubmitting",void 0),ui=si([ie("text-us-window")],ui);const li=async(e,t)=>{const n={building_id:t,lead_source:"property-website",phone_number:"+1"+e.replace("(","").replace(")","").replace(" ","").replace("-","")};await Xt().post("https://app.meetelise.com/platformApi/state/create/textMe",n,{headers:{"X-SecurityKey":"JRL8jV4VcSCwOSir5gWkpgNLfKghmhBG"}})},di={},ci=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];var pi=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 fi=class extends te{constructor(){super(...arguments),this.phoneNumber="1-855-531-5131",this.buildingId=0,this.chatCallUsHeader="Call Us",this.firstUpdated=async()=>{this.buildingId&&(this.officeHoursTextInfo=await(async e=>{const t=await(async e=>{if(di[e])return di[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await Xt().get(t);return di[e]=n.data,n.data})(e);return ci.map((e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e}))})(this.buildingId))},this.officeHoursTextInfo=[],this.getCallLink=e=>{const t=(e.match(/\d+/g)||[]).join(""),n=t.length<11?`1${t}`:t,i=`+${n[0]}-${n.slice(1,4)}-${n.slice(4,7)}-${n.slice(7)}`;return D`<a href="tel:${i}"
|
|
1797
1797
|
>${e}</a
|
|
1798
1798
|
>`},this.render=()=>D`
|
|
1799
1799
|
<details-window
|
|
1800
1800
|
height="443px"
|
|
1801
|
-
headerText="
|
|
1801
|
+
headerText="${this.chatCallUsHeader}"
|
|
1802
1802
|
.onCloseClick=${this.onCloseClicked}
|
|
1803
1803
|
>
|
|
1804
1804
|
<div class="call-us-window__content-wrapper">
|
|
@@ -1863,7 +1863,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1863
1863
|
.call-us-window__open-times {
|
|
1864
1864
|
text-transform: lowercase;
|
|
1865
1865
|
}
|
|
1866
|
-
`],pi([oe({attribute:!1})],fi.prototype,"onCloseClicked",void 0),pi([oe()],fi.prototype,"phoneNumber",void 0),pi([oe({attribute:!1})],fi.prototype,"buildingId",void 0),pi([oe({attribute:!1})],fi.prototype,"officeHoursTextInfo",void 0),fi=pi([ie("call-us-window")],fi);const hi={};var mi=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 te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.buildingId=0,this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},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=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(hi[e])return hi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return hi[e]=n.data,n.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 D`
|
|
1866
|
+
`],pi([oe({attribute:!1})],fi.prototype,"onCloseClicked",void 0),pi([oe()],fi.prototype,"phoneNumber",void 0),pi([oe({attribute:!1})],fi.prototype,"buildingId",void 0),pi([oe({attribute:!0})],fi.prototype,"chatCallUsHeader",void 0),pi([oe({attribute:!1})],fi.prototype,"officeHoursTextInfo",void 0),fi=pi([ie("call-us-window")],fi);const hi={};var mi=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 te{constructor(){super(...arguments),this.isMobile=!1,this.isFirstMount=!1,this.backgroundColor="rgba(255, 255, 255, 0.75)",this.textColor="#202020",this.isMini=!0,this.phoneNumber="",this.chatCallUsHeader="Call us",this.buildingId=0,this.hasCallUsEnabled=!1,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasSSTEnabled=!1,this.hasTextUsEnabled=!1,this.layoutOptions=[],this.tourTypeOptions=[],this.onChatTapped=()=>{},this.launcherStyles={},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=be(),this.textUsWindowRef=be(),this.tourSchedulerRef=be(),this.updated=async()=>{if(this.attachOnClickToEmailUsWindow(),this.attachOnClickToTextUsWindow(),this.attachOnClickToSSTWindow(),this.buildingId){const e=await(async e=>{if(hi[e])return hi[e];const t=`https://app.meetelise.com/sms_management_numbers/webchat/building/${e}/numbers`,n=await Xt().get(t);return hi[e]=n.data,n.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 D`
|
|
1867
1867
|
<div
|
|
1868
1868
|
@click=${this.onClickEmailOption}
|
|
1869
1869
|
class="launcher__call-to-action-option"
|
|
@@ -1932,6 +1932,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
1932
1932
|
.onCloseClicked=${this.onClosePhoneWindow}
|
|
1933
1933
|
phoneNumber="${this.phoneNumber}"
|
|
1934
1934
|
.buildingId=${this.buildingId}
|
|
1935
|
+
chatCallUsHeader="${this.chatCallUsHeader}"
|
|
1935
1936
|
></call-us-window>
|
|
1936
1937
|
</div>
|
|
1937
1938
|
`:""}
|
|
@@ -2079,7 +2080,7 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2079
2080
|
</div>
|
|
2080
2081
|
`}
|
|
2081
2082
|
</div>
|
|
2082
|
-
`}};vi.styles=Xn,mi([oe({type:Boolean})],vi.prototype,"isMobile",void 0),mi([oe({type:Boolean})],vi.prototype,"isFirstMount",void 0),mi([oe()],vi.prototype,"backgroundColor",void 0),mi([oe()],vi.prototype,"textColor",void 0),mi([oe({type:Boolean})],vi.prototype,"isMini",void 0),mi([oe()],vi.prototype,"phoneNumber",void 0),mi([oe({attribute:!1})],vi.prototype,"buildingId",void 0),mi([oe({type:Boolean})],vi.prototype,"hasCallUsEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasChatEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasEmailEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasSSTEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasTextUsEnabled",void 0),mi([oe({attribute:!1})],vi.prototype,"layoutOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"tourTypeOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"onChatTapped",void 0),mi([oe({attribute:!1})],vi.prototype,"launcherStyles",void 0),mi([ae()],vi.prototype,"isEmailWindowOpen",void 0),mi([ae()],vi.prototype,"isCallUsWindowOpen",void 0),mi([ae()],vi.prototype,"isSSTWindowOpen",void 0),mi([ae()],vi.prototype,"isTextUsWindowOpen",void 0),vi=mi([ie("meetelise-launcher")],vi);var gi=n(3379),yi=n.n(gi),wi=n(7795),bi=n.n(wi),Si=n(569),Ti=n.n(Si),xi=n(3565),Oi=n.n(xi),Ii=n(9216),Ri=n.n(Ii),Ni=n(4589),Ai=n.n(Ni),Ci=n(3631),Ei={};Ei.styleTagTransform=Ai(),Ei.setAttributes=Oi(),Ei.insert=Ti().bind(null,"head"),Ei.domAPI=bi(),Ei.insertStyleElement=Ri(),yi()(Ci.Z,Ei),Ci.Z&&Ci.Z.locals&&Ci.Z.locals;var _i,Fi=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 Mi=_i=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=zn(),this.chatId="",this.analytics=null,this.isMobile=bn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),vn(this.building.id),this.chatId=function(e,t){const n=Ln(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Bn(e,t),i=localStorage.getItem(n)||kn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Cn(this.orgSlug,this.buildingSlug,this.chatId))},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,_i.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)=>{const r=n.createPopup(Vn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},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)})}}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&&_i.session))return;this.chatId=Jn(this.orgSlug,this.buildingSlug);const e=await _i.session;this.analytics.chatId=this.chatId,this.popup.select(Vn(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")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",vi),D`
|
|
2083
|
+
`}};vi.styles=Xn,mi([oe({type:Boolean})],vi.prototype,"isMobile",void 0),mi([oe({type:Boolean})],vi.prototype,"isFirstMount",void 0),mi([oe()],vi.prototype,"backgroundColor",void 0),mi([oe()],vi.prototype,"textColor",void 0),mi([oe({type:Boolean})],vi.prototype,"isMini",void 0),mi([oe()],vi.prototype,"phoneNumber",void 0),mi([oe({attribute:!0})],vi.prototype,"chatCallUsHeader",void 0),mi([oe({attribute:!1})],vi.prototype,"buildingId",void 0),mi([oe({type:Boolean})],vi.prototype,"hasCallUsEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasChatEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasEmailEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasSSTEnabled",void 0),mi([oe({type:Boolean})],vi.prototype,"hasTextUsEnabled",void 0),mi([oe({attribute:!1})],vi.prototype,"layoutOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"tourTypeOptions",void 0),mi([oe({attribute:!1})],vi.prototype,"onChatTapped",void 0),mi([oe({attribute:!1})],vi.prototype,"launcherStyles",void 0),mi([ae()],vi.prototype,"isEmailWindowOpen",void 0),mi([ae()],vi.prototype,"isCallUsWindowOpen",void 0),mi([ae()],vi.prototype,"isSSTWindowOpen",void 0),mi([ae()],vi.prototype,"isTextUsWindowOpen",void 0),vi=mi([ie("meetelise-launcher")],vi);var gi=n(3379),yi=n.n(gi),wi=n(7795),bi=n.n(wi),Si=n(569),Ti=n.n(Si),xi=n(3565),Oi=n.n(xi),Ii=n(9216),Ri=n.n(Ii),Ni=n(4589),Ai=n.n(Ni),Ci=n(3631),Ei={};Ei.styleTagTransform=Ai(),Ei.setAttributes=Oi(),Ei.insert=Ti().bind(null,"head"),Ei.domAPI=bi(),Ei.insertStyleElement=Ri(),yi()(Ci.Z,Ei),Ci.Z&&Ci.Z.locals&&Ci.Z.locals;var _i,Fi=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 Mi=_i=class extends te{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.useMiniWidget=!0,this.launcherStyles={},this.popup=null,this.theme=zn(),this.chatId="",this.analytics=null,this.isMobile=bn(),this.launcher=null,this.building=null,this.hasMounted=!1,this.hideLauncher=!1,this.yardiDNIScriptInterval=null,this.launcherRef=be(),this.initializeInstanceVariables=async()=>{await this.setBuildingDerivedInfo(),await this.initializeLaunchJS(),this.attachOnClickToLauncher()},this.setBuildingDerivedInfo=async()=>{var e;this.buildingSlug&&this.orgSlug&&(this.building=await async function(e,t){const n=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}`,i=await fetch(n);return await i.json()}(this.orgSlug,this.buildingSlug),vn(this.building.id),this.chatId=function(e,t){const n=Ln(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=Bn(e,t),i=localStorage.getItem(n)||kn(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:Jn(e,t)}(this.orgSlug,this.buildingSlug),this.avatarSrc=this.avatarSrc||this.building.avatarSrc,this.theme=zn(null!==(e=this.themeId)&&void 0!==e?e:this.building.themeId),this.analytics=new Cn(this.orgSlug,this.buildingSlug,this.chatId))},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,_i.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)=>{const r=n.createPopup(Vn(n,e,t,i||e.avatarSrc,this.chatId,this.isMobile),{launcher:"never",showCloseInHeader:!0,messageField:{placeholder:"Ask a question..."}});await r.mount({show:!1}),r.on("close",(()=>{this.hideLauncher=!1}));const o=document.querySelector(".__talkjs_popup");if(!o)throw new Error("Failed to find chat window");o.classList.add("meetelise-chat","pane"),this.isMobile||o.classList.add("launcher__desktop"),o.style.zIndex="99999999999",this.popup=r},this.firstUpdated=()=>{this.initializeInstanceVariables()},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)})}}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&&_i.session))return;this.chatId=Jn(this.orgSlug,this.buildingSlug);const e=await _i.session;this.analytics.chatId=this.chatId,this.popup.select(Vn(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")}render(){var e,t,n,i,r,o,a,s,u,l,d,c,p,f,h,m,v,g,y,w;return window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",vi),D`
|
|
2083
2084
|
<div
|
|
2084
2085
|
class=${ce({launcherContainer:!0,launcher__mobile:this.isMobile,launcher__desktop:!this.isMobile,"meetelise-chat":!0,launcher:!0,shouldBeVisible:!0})}
|
|
2085
2086
|
>
|
|
@@ -2092,15 +2093,16 @@ var e={8005:function(e,t,n){var i,r=this&&this.__extends||(i=function(e,t){retur
|
|
|
2092
2093
|
.layoutOptions=${null!==(i=null===(n=this.building)||void 0===n?void 0:n.layoutOptions)&&void 0!==i?i:[]}
|
|
2093
2094
|
.tourTypeOptions=${null!==(o=null===(r=this.building)||void 0===r?void 0:r.tourTypeOptions)&&void 0!==o?o:[]}
|
|
2094
2095
|
.launcherStyles=${this.launcherStyles}
|
|
2095
|
-
|
|
2096
|
+
chatCallUsHeader=${null!==(s=null===(a=this.building)||void 0===a?void 0:a.chatCallUsHeader)&&void 0!==s?s:"Call us"}
|
|
2097
|
+
phoneNumber="${null!==(l=null===(u=this.building)||void 0===u?void 0:u.phoneNumber)&&void 0!==l?l:""}"
|
|
2096
2098
|
textColor="${this.theme.chatHeader.textColor}"
|
|
2097
2099
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|
|
2098
2100
|
?hidden=${this.hideLauncher}
|
|
2099
|
-
?hasCallUsEnabled=${!(null===(
|
|
2100
|
-
?hasChatEnabled=${!(null===(
|
|
2101
|
-
?hasEmailEnabled=${!(null===(
|
|
2102
|
-
?hasTextUsEnabled=${!(null===(
|
|
2103
|
-
?hasSSTEnabled=${!(null===(
|
|
2101
|
+
?hasCallUsEnabled=${!(null===(d=this.building)||void 0===d?void 0:d.chatWidgets)||(null===(c=this.building)||void 0===c?void 0:c.chatWidgets.includes("CALL"))}
|
|
2102
|
+
?hasChatEnabled=${!(null===(p=this.building)||void 0===p?void 0:p.chatWidgets)||(null===(f=this.building)||void 0===f?void 0:f.chatWidgets.includes("CHAT"))}
|
|
2103
|
+
?hasEmailEnabled=${!(null===(h=this.building)||void 0===h?void 0:h.chatWidgets)||(null===(m=this.building)||void 0===m?void 0:m.chatWidgets.includes("EMAIL"))}
|
|
2104
|
+
?hasTextUsEnabled=${!(null===(v=this.building)||void 0===v?void 0:v.chatWidgets)||(null===(g=this.building)||void 0===g?void 0:g.chatWidgets.includes("SMS"))}
|
|
2105
|
+
?hasSSTEnabled=${!(null===(y=this.building)||void 0===y?void 0:y.chatWidgets)||(null===(w=this.building)||void 0===w?void 0:w.chatWidgets.includes("SST"))}
|
|
2104
2106
|
>
|
|
2105
2107
|
</meetelise-launcher>`:""}
|
|
2106
2108
|
</div>
|
|
@@ -34,6 +34,8 @@ export class Launcher extends LitElement {
|
|
|
34
34
|
|
|
35
35
|
@property()
|
|
36
36
|
phoneNumber = "";
|
|
37
|
+
@property({ attribute: true })
|
|
38
|
+
chatCallUsHeader = "Call us";
|
|
37
39
|
@property({ attribute: false })
|
|
38
40
|
buildingId = 0;
|
|
39
41
|
@property({ type: Boolean })
|
|
@@ -295,6 +297,7 @@ export class Launcher extends LitElement {
|
|
|
295
297
|
.onCloseClicked=${this.onClosePhoneWindow}
|
|
296
298
|
phoneNumber="${this.phoneNumber}"
|
|
297
299
|
.buildingId=${this.buildingId}
|
|
300
|
+
chatCallUsHeader="${this.chatCallUsHeader}"
|
|
298
301
|
></call-us-window>
|
|
299
302
|
</div>
|
|
300
303
|
`
|
|
@@ -56,6 +56,8 @@ export class CallUsWindow extends LitElement {
|
|
|
56
56
|
phoneNumber = "1-855-531-5131";
|
|
57
57
|
@property({ attribute: false })
|
|
58
58
|
buildingId = 0;
|
|
59
|
+
@property({ attribute: true })
|
|
60
|
+
chatCallUsHeader = "Call Us";
|
|
59
61
|
|
|
60
62
|
firstUpdated = async (): Promise<void> => {
|
|
61
63
|
if (!this.buildingId) {
|
|
@@ -89,7 +91,7 @@ export class CallUsWindow extends LitElement {
|
|
|
89
91
|
return html`
|
|
90
92
|
<details-window
|
|
91
93
|
height="443px"
|
|
92
|
-
headerText="
|
|
94
|
+
headerText="${this.chatCallUsHeader}"
|
|
93
95
|
.onCloseClick=${this.onCloseClicked}
|
|
94
96
|
>
|
|
95
97
|
<div class="call-us-window__content-wrapper">
|
|
@@ -288,6 +288,7 @@ export class MEChat extends LitElement {
|
|
|
288
288
|
.layoutOptions=${this.building?.layoutOptions ?? []}
|
|
289
289
|
.tourTypeOptions=${this.building?.tourTypeOptions ?? []}
|
|
290
290
|
.launcherStyles=${this.launcherStyles}
|
|
291
|
+
chatCallUsHeader=${this.building?.chatCallUsHeader ?? "Call us"}
|
|
291
292
|
phoneNumber="${this.building?.phoneNumber ?? ""}"
|
|
292
293
|
textColor="${this.theme.chatHeader.textColor}"
|
|
293
294
|
backgroundColor="${this.theme.chatPaneBackgroundColor}"
|