@meetelise/chat 1.20.104 → 1.20.105
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 +1 -1
- package/public/dist/index.js +1 -1
- package/src/analytics.ts +1 -0
package/package.json
CHANGED
package/public/dist/index.js
CHANGED
|
@@ -1201,7 +1201,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
|
|
|
1201
1201
|
</div>
|
|
1202
1202
|
`}
|
|
1203
1203
|
</div>
|
|
1204
|
-
`}};var Kn;Vn.styles=[Qn,Zt],Wn([de({attribute:!1})],Vn.prototype,"layoutOptions",void 0),Wn([de({attribute:!1})],Vn.prototype,"unitOptions",void 0),Wn([de({attribute:!1})],Vn.prototype,"tourTypeOptions",void 0),Wn([de({attribute:!0})],Vn.prototype,"chatId",void 0),Wn([de({type:Number})],Vn.prototype,"buildingId",void 0),Wn([de({attribute:!0})],Vn.prototype,"buildingSlug",void 0),Wn([de({attribute:!0})],Vn.prototype,"sgtUrl",void 0),Wn([de({attribute:!0})],Vn.prototype,"escortedToursLink",void 0),Wn([de({attribute:!0})],Vn.prototype,"virtualToursLink",void 0),Wn([de({attribute:!0})],Vn.prototype,"orgSlug",void 0),Wn([de({attribute:!0})],Vn.prototype,"buildingName",void 0),Wn([ce()],Vn.prototype,"tourType",void 0),Wn([ce()],Vn.prototype,"shouldShowTourType",void 0),Wn([ce()],Vn.prototype,"email",void 0),Wn([ce()],Vn.prototype,"phoneNumber",void 0),Wn([ce()],Vn.prototype,"availabilitiesGroupedByDay",void 0),Wn([ce()],Vn.prototype,"waitingForAvailabilities",void 0),Wn([ce()],Vn.prototype,"selectedDate",void 0),Wn([ce()],Vn.prototype,"selectedTime",void 0),Wn([ce()],Vn.prototype,"mobilePageIndex",void 0),Wn([ce()],Vn.prototype,"isSubmitting",void 0),Wn([ce()],Vn.prototype,"tourIsBooked",void 0),Wn([de({attribute:!1})],Vn.prototype,"leadSources",void 0),Wn([de({attribute:!0})],Vn.prototype,"currentLeadSource",void 0),Wn([de({attribute:!0})],Vn.prototype,"featureFlagShowDropdown",void 0),Wn([de({attribute:!0})],Vn.prototype,"compactDesign",void 0),Wn([pe(".nameContainer#firstName input")],Vn.prototype,"firstNameInput",void 0),Wn([pe(".nameContainer#lastName input")],Vn.prototype,"lastNameInput",void 0),Wn([pe(".inputContainer#email input")],Vn.prototype,"emailInput",void 0),Wn([pe(".inputContainer#phone input")],Vn.prototype,"phoneInput",void 0),Wn([pe("me-select#unitType")],Vn.prototype,"unitTypeSelect",void 0),Wn([pe("me-select#layoutType")],Vn.prototype,"layoutTypeSelect",void 0),Wn([pe("me-select#leadSource")],Vn.prototype,"selectedLeadSource",void 0),Vn=Wn([ue("tour-scheduler")],Vn),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(Kn||(Kn={}));const Xn={[Kn.Guided]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Kn.Self]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Kn.Virtual]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},Yn={[Kn.Guided]:"escorted-tour",[Kn.Self]:"self-guided-tour",[Kn.Virtual]:"live-virtual-tour"},Zn=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(Nn()).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(_n());class $n{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:ei(),incomingProcessedLeadSource:this.incomingProcessedLeadSource})})}}const ei=()=>{var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}};var ti;!function(e){e.error="error",e.info="info",e.warn="warn"}(ti||(ti={}));const ni=async({logType:e,buildingSlug:n,orgSlug:i,logTitle:r,logData:o})=>{await t().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=n?n:"","org-slug":null!=i?i:"","log-type":null!=e?e:ti.error,"log-title":r.toUpperCase().replace(/\s/g,"_")}})};var ii,ri=new Uint8Array(16);function oi(){if(!ii&&!(ii="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ii(ri)}const ai=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,si=function(e){return"string"==typeof e&&ai.test(e)};for(var ui=[],li=0;li<256;++li)ui.push((li+256).toString(16).substr(1));const di=function(e,t,n){var i=(e=e||{}).random||(e.rng||oi)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase();if(!si(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function ci(e,t){const n=fi(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=mi(e,t),i=localStorage.getItem(n)||hi(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:pi(e,t)}function pi(e,t){const n=fi(e,t),i=di();return localStorage.setItem(n,i),hi(e,t),i}function hi(e,t){const n=mi(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function fi(e,t){return`com.meetelise.chatID-${e}-${t}`}function mi(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const gi="#FFFFFF",vi="#202020",yi="#636889",bi={user:{textColor:gi,backgroundColor:"#1990FF"},agent:{textColor:gi,backgroundColor:"#1E1E1E"}},wi={user:{textColor:gi,backgroundColor:"#83818E"},agent:{textColor:gi,backgroundColor:vi}},Si={Light:{chatHeader:{backgroundColor:gi,textColor:vi},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:bi},Dark:{chatHeader:{backgroundColor:vi,textColor:gi},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:bi},Purple:{chatHeader:{backgroundColor:"#550098",textColor:gi},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:bi},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:gi},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:bi},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:vi},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:wi},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:gi},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:bi},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:vi},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:wi},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:gi},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:bi},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:gi},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:bi},Glass:{chatHeader:{backgroundColor:gi,textColor:vi},chatPaneBackgroundColor:"rgba(193, 193, 193, 0.5)",message:{user:{textColor:"#FFFFFF",backgroundColor:"#000000"},agent:{textColor:"#000000",backgroundColor:"#FFFFFF"}}}},Ti=({themeId:e,brandColor:t})=>{const n=Si[e&&Object.keys(Si).includes(e)?e:"Light"];return t&&t!==yi&&(n.message.user.backgroundColor=t,n.chatHeader.backgroundColor=o(t,.6)),n};function Ai(e,t,n,i,r,o){var a;const s=new Ee.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage,availabilityText:t.systemWelcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===wi).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}async function xi(e,n){const i="https://app.meetelise.com",r=`${i}/api/pub/v1/organization/${e}/building/${n}`,o=`${i}/eliseCrmApi/pub/building/${n}/units`,a=`${i}/eliseCrmApi/pub/building/${n}/layouts`,[s,u,l]=await Promise.all([t().get(r),t().get(o),t().get(a)]),d=s.data,c=u.data,p=l.data;return d.unitOptionsV2=c,d.layoutOptionsV2=p,d}var Oi,Ci;async function Ii(e){try{const n=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/customization`);return n.data?{primaryColor:n.data.primaryColor,designConcept:n.data.designConcept,delayOpen:+n.data.delayOpen,autoMinimize:"true"===n.data.autoMinimize}:null}catch(e){return null}}async function Ni(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function Ei(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:kn(),building_slug:e,referrer:n,campaign_sources:ei()})).data}catch(e){return null}}!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Oi||(Oi={})),function(e){e.ConceptEmoji="Concept 2 (Blue/White)"}(Ci||(Ci={}));const Ri=d`
|
|
1204
|
+
`}};var Kn;Vn.styles=[Qn,Zt],Wn([de({attribute:!1})],Vn.prototype,"layoutOptions",void 0),Wn([de({attribute:!1})],Vn.prototype,"unitOptions",void 0),Wn([de({attribute:!1})],Vn.prototype,"tourTypeOptions",void 0),Wn([de({attribute:!0})],Vn.prototype,"chatId",void 0),Wn([de({type:Number})],Vn.prototype,"buildingId",void 0),Wn([de({attribute:!0})],Vn.prototype,"buildingSlug",void 0),Wn([de({attribute:!0})],Vn.prototype,"sgtUrl",void 0),Wn([de({attribute:!0})],Vn.prototype,"escortedToursLink",void 0),Wn([de({attribute:!0})],Vn.prototype,"virtualToursLink",void 0),Wn([de({attribute:!0})],Vn.prototype,"orgSlug",void 0),Wn([de({attribute:!0})],Vn.prototype,"buildingName",void 0),Wn([ce()],Vn.prototype,"tourType",void 0),Wn([ce()],Vn.prototype,"shouldShowTourType",void 0),Wn([ce()],Vn.prototype,"email",void 0),Wn([ce()],Vn.prototype,"phoneNumber",void 0),Wn([ce()],Vn.prototype,"availabilitiesGroupedByDay",void 0),Wn([ce()],Vn.prototype,"waitingForAvailabilities",void 0),Wn([ce()],Vn.prototype,"selectedDate",void 0),Wn([ce()],Vn.prototype,"selectedTime",void 0),Wn([ce()],Vn.prototype,"mobilePageIndex",void 0),Wn([ce()],Vn.prototype,"isSubmitting",void 0),Wn([ce()],Vn.prototype,"tourIsBooked",void 0),Wn([de({attribute:!1})],Vn.prototype,"leadSources",void 0),Wn([de({attribute:!0})],Vn.prototype,"currentLeadSource",void 0),Wn([de({attribute:!0})],Vn.prototype,"featureFlagShowDropdown",void 0),Wn([de({attribute:!0})],Vn.prototype,"compactDesign",void 0),Wn([pe(".nameContainer#firstName input")],Vn.prototype,"firstNameInput",void 0),Wn([pe(".nameContainer#lastName input")],Vn.prototype,"lastNameInput",void 0),Wn([pe(".inputContainer#email input")],Vn.prototype,"emailInput",void 0),Wn([pe(".inputContainer#phone input")],Vn.prototype,"phoneInput",void 0),Wn([pe("me-select#unitType")],Vn.prototype,"unitTypeSelect",void 0),Wn([pe("me-select#layoutType")],Vn.prototype,"layoutTypeSelect",void 0),Wn([pe("me-select#leadSource")],Vn.prototype,"selectedLeadSource",void 0),Vn=Wn([ue("tour-scheduler")],Vn),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(Kn||(Kn={}));const Xn={[Kn.Guided]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.WithAgent,[Kn.Self]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.SelfGuided,[Kn.Virtual]:nn.TourAvailabilityResponseRankOrderedSupportedTourTypesEnum.VirtualShowing},Yn={[Kn.Guided]:"escorted-tour",[Kn.Self]:"self-guided-tour",[Kn.Virtual]:"live-virtual-tour"},Zn=e=>e.map((e=>(e=>({studio:0,"1br":1,"2br":2,"3br":3,"4br":4,"5br":5,"6br":6,"7br":7,"8br":8,"9br":9,"10br":10}[e]))(e))).filter(Nn()).sort().map((e=>(e=>({0:"studio",1:"1br",2:"2br",3:"3br",4:"4br",5:"5br",6:"6br",7:"7br",8:"8br",9:"9br",10:"10br"}[e]))(e))).filter(_n());class $n{constructor(e,t,n,i){this.org=e,this.building=t,this.chatId=n,this.incomingProcessedLeadSource=i,this.featureFlags={}}setFeatureFlags(e){this.featureFlags={...this.featureFlags,...e}}ping(e){fetch("https://app.meetelise.com/platformApi/connectors/talk_js/analytics",{method:"POST",credentials:"omit",keepalive:!0,headers:{"content-type":"application/json; charset=UTF-8"},body:JSON.stringify({eventType:e,chatId:this.chatId,url:location.href,org:this.org,building:this.building,referrer:document.referrer,featureFlags:this.featureFlags,campaignSources:ei(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:"MISSING_ENV_VAR".npm_package_version})})}}const ei=()=>{var e,t,n;const i=new URL(window.location.href).searchParams,r=null!==(n=null===(t=null===(e=window.RCTPCampaign)||void 0===e?void 0:e.CampaignDetails)||void 0===t?void 0:t.Source)&&void 0!==n?n:null;return{entrataCampaignSource:i.get("switch_cls[id]"),realpageCampaignSource:i.get("ilm"),utmCampaignSource:i.get("utm_source"),yardiCampaignSource:r}};var ti;!function(e){e.error="error",e.info="info",e.warn="warn"}(ti||(ti={}));const ni=async({logType:e,buildingSlug:n,orgSlug:i,logTitle:r,logData:o})=>{await t().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=n?n:"","org-slug":null!=i?i:"","log-type":null!=e?e:ti.error,"log-title":r.toUpperCase().replace(/\s/g,"_")}})};var ii,ri=new Uint8Array(16);function oi(){if(!ii&&!(ii="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ii(ri)}const ai=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,si=function(e){return"string"==typeof e&&ai.test(e)};for(var ui=[],li=0;li<256;++li)ui.push((li+256).toString(16).substr(1));const di=function(e,t,n){var i=(e=e||{}).random||(e.rng||oi)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase();if(!si(n))throw TypeError("Stringified UUID is invalid");return n}(i)};function ci(e,t){const n=fi(e,t),i=localStorage.getItem(n);return i&&!function(e,t){const n=mi(e,t),i=localStorage.getItem(n)||hi(e,t),r=new Date(new Date(i).getTime()+216e5);return new Date>r}(e,t)?i:pi(e,t)}function pi(e,t){const n=fi(e,t),i=di();return localStorage.setItem(n,i),hi(e,t),i}function hi(e,t){const n=mi(e,t),i=(new Date).toISOString();return localStorage.setItem(n,i),i}function fi(e,t){return`com.meetelise.chatID-${e}-${t}`}function mi(e,t){return`com.meetelise.chatIDIssueTime-${e}-${t}`}const gi="#FFFFFF",vi="#202020",yi="#636889",bi={user:{textColor:gi,backgroundColor:"#1990FF"},agent:{textColor:gi,backgroundColor:"#1E1E1E"}},wi={user:{textColor:gi,backgroundColor:"#83818E"},agent:{textColor:gi,backgroundColor:vi}},Si={Light:{chatHeader:{backgroundColor:gi,textColor:vi},chatPaneBackgroundColor:"rgba(255, 255, 255, 0.9)",message:bi},Dark:{chatHeader:{backgroundColor:vi,textColor:gi},chatPaneBackgroundColor:"rgba(32, 32, 32, 0.9)",message:bi},Purple:{chatHeader:{backgroundColor:"#550098",textColor:gi},chatPaneBackgroundColor:"rgba(85, 0, 152, 0.6)",message:bi},Blue:{chatHeader:{backgroundColor:"#0814E5",textColor:gi},chatPaneBackgroundColor:"rgba(4, 17, 245, 0.6)",message:bi},Teal:{chatHeader:{backgroundColor:"#6EE7ED",textColor:vi},chatPaneBackgroundColor:"rgba(115, 247, 253, 0.8)",message:wi},Green:{chatHeader:{backgroundColor:"#147B0E",textColor:gi},chatPaneBackgroundColor:"rgba(13, 141, 5, 0.6)",message:bi},Yellow:{chatHeader:{backgroundColor:"#F1E54F",textColor:vi},chatPaneBackgroundColor:"rgba(251, 239, 80, 0.9)",message:wi},Orange:{chatHeader:{backgroundColor:"#C06C31",textColor:gi},chatPaneBackgroundColor:"rgba(238, 126, 49, 0.7)",message:bi},Pink:{chatHeader:{backgroundColor:"#A24599",textColor:gi},chatPaneBackgroundColor:"rgba(167, 70, 157, 0.8)",message:bi},Glass:{chatHeader:{backgroundColor:gi,textColor:vi},chatPaneBackgroundColor:"rgba(193, 193, 193, 0.5)",message:{user:{textColor:"#FFFFFF",backgroundColor:"#000000"},agent:{textColor:"#000000",backgroundColor:"#FFFFFF"}}}},Ti=({themeId:e,brandColor:t})=>{const n=Si[e&&Object.keys(Si).includes(e)?e:"Light"];return t&&t!==yi&&(n.message.user.backgroundColor=t,n.chatHeader.backgroundColor=o(t,.6)),n};function Ai(e,t,n,i,r,o){var a;const s=new Ee.User({id:`building_${t.id}`,name:t.userFirstName,email:null,role:"Default",welcomeMessage:t.welcomeMessage,availabilityText:t.systemWelcomeMessage}),u=e.getOrCreateConversation(r);return u.setParticipant(e.me),u.setParticipant(s),u.subject=16===t.orgId?"Leasing team":null!==(a=t.chatTitle)&&void 0!==a?a:t.userFirstName,u.custom={buildingId:t.id.toString(),userId:t.userId.toString(),orgId:t.orgId.toString(),subtitle:t.chatSubtitle,url:location.href,buildingName:t.name,isMobile:o.toString(),chatHeaderBackgroundColor:n.chatHeader.backgroundColor,chatHeaderTextColor:n.chatHeader.textColor,chatPaneBackgroundColor:n.chatPaneBackgroundColor,userMessageTextColor:n.message.user.textColor,userMessageBackgroundColor:n.message.user.backgroundColor,agentMessageTextColor:n.message.agent.textColor,agentMessageBackgroundColor:n.message.agent.backgroundColor,isLightTheme:(n.message===wi).toString(),avatarUrl:"image"===t.avatarType&&t.avatarSrc?i:"https://eliseusercontent.meetelise.com/webchat/looping-gradient.gif"},u}async function xi(e,n){const i="https://app.meetelise.com",r=`${i}/api/pub/v1/organization/${e}/building/${n}`,o=`${i}/eliseCrmApi/pub/building/${n}/units`,a=`${i}/eliseCrmApi/pub/building/${n}/layouts`,[s,u,l]=await Promise.all([t().get(r),t().get(o),t().get(a)]),d=s.data,c=u.data,p=l.data;return d.unitOptionsV2=c,d.layoutOptionsV2=p,d}var Oi,Ci;async function Ii(e){try{const n=await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/customization`);return n.data?{primaryColor:n.data.primaryColor,designConcept:n.data.designConcept,delayOpen:+n.data.delayOpen,autoMinimize:"true"===n.data.autoMinimize}:null}catch(e){return null}}async function Ni(e){try{return(await t().get(`https://app.meetelise.com/platformApi/webchat/${e}/ab-test-type`)).data}catch(e){return null}}async function Ei(e,n){try{return(await t().post("https://app.meetelise.com/platformApi/webchat/current-parsed-lead-source",{query_params:kn(),building_slug:e,referrer:n,campaign_sources:ei()})).data}catch(e){return null}}!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Oi||(Oi={})),function(e){e.ConceptEmoji="Concept 2 (Blue/White)"}(Ci||(Ci={}));const Ri=d`
|
|
1205
1205
|
* {
|
|
1206
1206
|
font-family: "Helvetica Neue", Arial;
|
|
1207
1207
|
font-size: 14px;
|
package/src/analytics.ts
CHANGED
|
@@ -67,6 +67,7 @@ export default class Analytics {
|
|
|
67
67
|
featureFlags: this.featureFlags,
|
|
68
68
|
campaignSources: getCampaignSources(),
|
|
69
69
|
incomingProcessedLeadSource: this.incomingProcessedLeadSource, // if we already know the lead source, send it along
|
|
70
|
+
webchatVersion: process.env.npm_package_version,
|
|
70
71
|
}),
|
|
71
72
|
}
|
|
72
73
|
);
|