@meetelise/chat 1.43.41 → 1.44.0

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.
@@ -1270,7 +1270,7 @@ otherwise there's some empty space at the bottom of the button, which interferes
1270
1270
  gap: 12px;
1271
1271
  align-items: center;
1272
1272
  }
1273
- `;class wi{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){var t;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:Ci(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const Ci=()=>{var e,t,n,i,r,o;try{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,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Cn("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Cn("bozzuto_ad_source")}}};var xi;!function(e){e.error="error",e.info="info",e.warn="warn"}(xi||(xi={}));const Ai=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:i,logData:o})=>{await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:xi.error,"log-title":i.toUpperCase().replace(/\s/g,"_")}})},Si=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};function ki(){return Ei()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}const Ei=()=>(window.location.search.match(/\?/g)||[]).length>1;var Ti=n(2193),_i=n.n(Ti);function Oi(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const Pi=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=ki();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(Ci()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!wn(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Rn(t.timestamp)}}}const a={leadSource:t,leadId:n,buildingSlug:e,timestamp:On(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Rn(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!wn(Rn(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,{query_params:t,building_slug:e,referrer:n,campaign_sources:i})).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let c=null,d=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(c=e),d=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:_i()(c)?null:c,extras:null!=d?d:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){try{const i={queryParams:ki(),buildingSlug:n,referrer:document.referrer,campaignSources:Ci()};let r=!1;const o=n?this.getLeadSourceBodyIfValid(n):null;if(o){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=o.leadSource,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(i);if(!e)return this.leadSource=o.leadSource,this.leadSource;this.leadSource=e,r=!0}}const a=await this.fetchCurrentParsedLeadSource(i);if(this.leadSource=a,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!a){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSource}if(n){const t=!!a&&a.length>0;this.updateLeadSourceLocalStorage(n,a,e,!t&&!r,r)}return a}catch(e){}return null}},Ii=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}};var Mi,Ni,Di;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Mi||(Mi={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(Ni||(Ni={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(Di||(Di={}));const Li=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function Ui(e,t){var n;const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,o=(await r().get(i)).data;try{o.welcomeMessage=Ri(null!==(n=o.welcomeMessage)&&void 0!==n?n:"",o.userFirstName)}catch(e){}return o}const Ri=(e,t)=>e.replace(/elise/gi,t);var Bi=n(7035),ji=n(6353);function Fi(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function Hi(e,t){var n=function(e){if(!zi[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===t;zi[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return zi[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=$i[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var $i={year:0,month:1,day:2,hour:3,minute:4,second:5};var zi={};function Gi(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var Qi=36e5,Wi={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function qi(e,t,n){var i,r,o;if(!e)return 0;if(i=Wi.timezoneZ.exec(e))return 0;if(i=Wi.timezoneHH.exec(e))return Yi(o=parseInt(i[1],10))?-o*Qi:NaN;if(i=Wi.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Yi(o,a)?(r=Math.abs(o)*Qi+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Ki[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ki[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return Gi(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Vi(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=Vi(new Date(r),n);if(t===o)return t;r-=o-t;var a=Vi(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Vi(e,t){var n=Hi(e,t),i=Gi(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Yi(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Ki={};var Xi={X:function(e,t,n,i){var r=Zi(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return tr(r);case"XXXX":case"XX":return er(r);default:return er(r,":")}},x:function(e,t,n,i){var r=Zi(i.timeZone,e);switch(t){case"x":return tr(r);case"xxxx":case"xx":return er(r);default:return er(r,":")}},O:function(e,t,n,i){var r=Zi(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Ji(o,2)}(r,":");default:return"GMT"+er(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return Fi("short",e,i);default:return Fi("long",e,i)}}};function Zi(e,t){var n=e?qi(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ji(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function er(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Ji(Math.floor(r/60),2)+n+Ji(Math.floor(r%60),2)}function tr(e,t){return e%60==0?(e>0?"-":"+")+Ji(Math.abs(e)/60,2):er(e,t)}const nr=Xi;var ir=n(9784),rr=n(9720);var or=36e5,ar=6e4,sr={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function lr(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:ir(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=sr.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=sr.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=sr.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=sr.YYY[t],r=sr.YYYYY[t];if(n=sr.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=sr.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=sr.MM.exec(e))return i=new Date(0),pr(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=sr.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=hr(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=sr.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return pr(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=sr.Www.exec(e))return fr(t,o=parseInt(n[1],10)-1)?ur(t,o):new Date(NaN);if(n=sr.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return fr(t,o,l)?ur(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),c=0;if(r.time&&(c=function(e){var t,n,i;if(t=sr.HH.exec(e))return gr(n=parseFloat(t[1].replace(",",".")))?n%24*or:NaN;if(t=sr.HHMM.exec(e))return gr(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*or+i*ar:NaN;if(t=sr.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return gr(n,i,r)?n%24*or+i*ar+1e3*r:NaN}return null}(r.time),isNaN(c)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=qi(r.timeZone||n.timeZone,new Date(u+c)),isNaN(l))return new Date(NaN)}else l=rr(new Date(u+c)),l=rr(new Date(u+c+l));return new Date(u+c+l)}return new Date(NaN)}function ur(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var cr=[31,28,31,30,31,30,31,31,30,31,30,31],dr=[31,29,31,30,31,30,31,31,30,31,30,31];function hr(e){return e%400==0||e%4==0&&e%100!=0}function pr(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=hr(e);if(i&&n>dr[t])return!1;if(!i&&n>cr[t])return!1}return!0}function fr(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function gr(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var mr=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function yr(e,t,n,i){var r=Bi(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(mr);if(o){var a=lr(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+nr[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return ji(e,i,r)}(function(e,t,n){var i=lr(e,n),r=qi(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}var br=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=class extends oe{constructor(){super(...arguments),this.tourTypeOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.tourType=null,this.shouldShowTourType={[wr.Guided]:!0,[wr.Self]:!0,[wr.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.leadSources=[],this.orgLegalName="",this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Ue,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.errorGettingAvailabilities=!1,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([Ii(this.buildingId,this.hasDynamicSchedulingEnabled),Kn()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await Vn(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),Ai({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:xi.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void Ai({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[wr.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[wr.Guided]||!!this.escortedToursLink),[wr.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[wr.Self]||!!this.sgtUrl),[wr.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[wr.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,Ai({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await Vn(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return Wt("string"==typeof e?Rn(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==In.Unknown&&a!==In.MediaTour&&(this.selectedDate=Qt("string"==typeof l?Rn(l):l),this.tourType=xr[a],this.selectedTime="string"==typeof l?Zn(l):(e=>({datetime:Ft(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:Ft(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===In.Unknown||e.tourType===In.MediaTour)return!1;const t=xr[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!Li(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===wr.Guided?this.escortedToursTypeOffered:e===wr.Self?this.selfGuidedToursTypeOffered:e===wr.Virtual?this.virtualToursTypeOffered:null,this.firstUpdated=async()=>{await this._setAvailabilities()},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Ne(e)){if("Backspace"===e.key){if(Ne(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Pe(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Ne(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Pe(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Pe(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&An(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&14===this.phoneNumber.length&&xn(this.phoneNumber)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,t,n,i,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const x=new URLSearchParams(window.location.search);let A=null;A=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const S=[...new Set(A?[A,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=A,ai("scheduleTourSubmitted",{email:this.email,phone:`+1${null===(e=this.phoneNumber.match(/\d/g))||void 0===e?void 0:e.join("")}`,firstName:null!==(n=null===(t=this.firstNameInput)||void 0===t?void 0:t.value)&&void 0!==n?n:this.firstNameInputValue,lastName:null!==(o=null===(i=this.lastNameInput)||void 0===i?void 0:i.value)&&void 0!==o?o:this.lastNameInputValue,tourType:Ar[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:S.find(e=>"property-website"!==e)||null});const k={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(a=this.phoneNumber.match(/\d/g))||void 0===a?void 0:a.join("")}`,building_id:this.buildingId,first_name:null!==(l=null===(s=this.firstNameInput)||void 0===s?void 0:s.value)&&void 0!==l?l:this.firstNameInputValue,last_name:null!==(c=null===(u=this.lastNameInput)||void 0===u?void 0:u.value)&&void 0!==c?c:this.lastNameInputValue,tour_type:Ar[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(A?[A,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],query_params:Object.fromEntries(x.entries()),conversation_tracking_id:null===(d=this.leadSourceClient)||void 0===d?void 0:d.chatId,lead_sources_with_timestamps:(null!==(f=null===(h=this.leadSourceMultitouchClient)||void 0===h?void 0:h.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(p=this.selectedLeadSource)||void 0===p?void 0:p.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==f?f:[]).map(e=>gn({...e}))};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",k,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(g=this.leadSourceClient)||void 0===g||g.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(m=this.leadSourceClient)||void 0===m||m.resetLeadSource(),null===(y=this.leadSourceMultitouchClient)||void 0===y||y.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(v=null===(b=t.response)||void 0===b?void 0:b.data)||void 0===v?void 0:v.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[Ft(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[Ft(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===(w=t.response)||void 0===w?void 0:w.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===(C=t.response)||void 0===C?void 0:C.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,qn(),this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>B`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>B`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>B` <action-confirm-button
1273
+ `;class wi{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){var t;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:Ci(),incomingProcessedLeadSource:this.incomingProcessedLeadSource,webchatVersion:null!==(t="MISSING_ENV_VAR".npm_package_version)&&void 0!==t?t:"1.20.155"})})}}const Ci=()=>{var e,t,n,i,r,o;try{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,o=i.get("switch_cls[id]"),a=i.get("ilm"),s=i.get("utm_source");return{entrataCampaignSource:o,realpageCampaignSource:a,utmCampaignSource:s,yardiCampaignSource:r,bozzutoAdSource:Cn("bozzuto_ad_source")}}catch(e){const t=document.createElement("iframe");if(t.style.display="none",document.body.appendChild(t),!t.contentWindow)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const n=t.contentWindow.URL;if(!n)return{entrataCampaignSource:null,realpageCampaignSource:null,utmCampaignSource:null,yardiCampaignSource:null,bozzutoAdSource:null};const a=new n(window.location.href).searchParams,s=null!==(o=null===(r=null===(i=window.RCTPCampaign)||void 0===i?void 0:i.CampaignDetails)||void 0===r?void 0:r.Source)&&void 0!==o?o:null;return{entrataCampaignSource:a.get("switch_cls[id]"),realpageCampaignSource:a.get("ilm"),utmCampaignSource:a.get("utm_source"),yardiCampaignSource:s,bozzutoAdSource:Cn("bozzuto_ad_source")}}};var xi;!function(e){e.error="error",e.info="info",e.warn="warn"}(xi||(xi={}));const Ai=async({logType:e,buildingSlug:t,orgSlug:n,logTitle:i,logData:o})=>{await r().post("https://app.meetelise.com/platformApi/webchat/logging",{...o},{headers:{"Content-Type":"application/json","building-slug":null!=t?t:"","org-slug":null!=n?n:"","log-type":null!=e?e:xi.error,"log-title":i.toUpperCase().replace(/\s/g,"_")}})},Si=async({params:e,sampleRate:t})=>{try{if(Math.random()>=t)return;await r().post("https://app.meetelise.com/platformApi/webchat/log/signal",{...e,website_origin:window.location.origin,website_search:window.location.search})}catch(e){}};function ki(){return Ei()?function(){const e=window.location.search,t={},n=e.split("?").slice(1).join("&");return n.split("&").forEach(e=>{const[n,i]=e.split("=");n&&i&&(t[decodeURIComponent(n)]=decodeURIComponent(i))}),t}():function(){const e=new URLSearchParams(window.location.search),t=e.has("utm_content"),n=e.has("utm_source");if(t&&!n){const t=e.get("utm_content");e.delete("utm_content"),e.set("utm_source",t)}return Object.fromEntries(e)}()}const Ei=()=>(window.location.search.match(/\?/g)||[]).length>1;var Ti=n(2193),_i=n.n(Ti);function Oi(e){return"avb"===e?"AVB Company Website":"windsor"===e?"Windsorcommunities.com":"property-website"}const Pi=class{constructor(){this.chatId=null,this.apiHost="https://app.meetelise.com",this.leadSource=null,this.localStorageTTLDays=30,this.buildingId=null,this.orgSlug=null,this.buildingSlug=null,this.queryParameters=null,this.leadSourceInput=null,this.updateLeadSourceLocalStorage=(e,t,n,i,r)=>{const o=ki();if(this.leadSourceInput={websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:o,referrer:document.referrer,parsedUtmSource:o?o.utm_source:null,campaignSources:Object.values(Ci()).filter(e=>e)},i)return;if(!r){const t=this.getLeadSourceBodyIfValid(e);if(t){if(!wn(t.timestamp,24*this.localStorageTTLDays))return{...t,timestamp:Rn(t.timestamp)}}}const a={leadSource:t,leadId:n,buildingSlug:e,timestamp:On(new Date),leadSourceInput:this.leadSourceInput};return localStorage.setItem("com.elise.webchat.leadsource.slug="+e,JSON.stringify(a)),{...a,timestamp:Rn(a.timestamp)}},this.getLeadSourceBodyIfValid=e=>{const t=localStorage.getItem("com.elise.webchat.leadsource.slug="+e);if(t)try{const n=JSON.parse(t);if(n.buildingSlug===e&&n.leadSource&&n.leadId&&n.timestamp&&!wn(Rn(n.timestamp),24*this.localStorageTTLDays)){try{this.leadSourceInput=n.leadSourceInput}catch(e){}return n}}catch(e){return null}return null},this.resetLeadSource=()=>{if(!this.buildingSlug)return!1;const e="com.elise.webchat.leadsource.slug="+this.buildingSlug;return localStorage.removeItem(e),!0}}async fetchCurrentParsedLeadSource({buildingSlug:e,queryParams:t,referrer:n,campaignSources:i}){try{return(await r().post(`${this.apiHost}/platformApi/webchat/current-parsed-lead-source`,{query_params:t,building_slug:e,referrer:n,campaign_sources:i})).data}catch(e){return null}}async checkAndHandleForLogLeadSource({webchatAction:e,stateId:t}){var n,i,o,a,s,l,u;try{if(!this.chatId)return null;if(!this.orgSlug)return null;let c=null,d=null;try{if("f1ba5a20-d207-4e5a-879e-65199e7d0a53"===this.orgSlug){const e=await this.getCookieValue("_ga");e&&(c=e),d=null===(n=window.dataLayer.find(e=>{var t;return"gtagApiGet"==(null===(t=e.value)||void 0===t?void 0:t.event)}))||void 0===n?void 0:n.value}}catch(e){}return await r().post(`${this.apiHost}/platformApi/webchat/log/lead-source`,{chat_id:this.chatId,webchat_action:e,state_id:t,building_id:this.buildingId,org_slug:this.orgSlug,building_slug:this.buildingSlug,website_origin:null===(i=this.leadSourceInput)||void 0===i?void 0:i.websiteOrigin,website_search:null===(o=this.leadSourceInput)||void 0===o?void 0:o.websiteSearch,query_parameters:null===(a=this.leadSourceInput)||void 0===a?void 0:a.queryParameters,referrer:null===(s=this.leadSourceInput)||void 0===s?void 0:s.referrer,parsed_utm_source:null===(l=this.leadSourceInput)||void 0===l?void 0:l.parsedUtmSource,campaign_sources:null===(u=this.leadSourceInput)||void 0===u?void 0:u.campaignSources,lead_source_output:this.leadSource,google_analytics_client_id:_i()(c)?null:c,extras:null!=d?d:null}),null}catch(e){return null}}async getCookieValue(e){try{const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].trim();if(i.startsWith(e+"=")){return i.substring((e+"=").length,-1===i.indexOf(";")?void 0:i.indexOf(";"))}}return null}catch(e){}return null}async generateUserLeadSource({leadId:e,orgSlug:t,buildingSlug:n}){try{const i={queryParams:ki(),buildingSlug:n,referrer:document.referrer,campaignSources:Ci()};let r=!1;const o=n?this.getLeadSourceBodyIfValid(n):null;if(o){if(!["test-company","daf00bd2-1ecb-482c-b6f4-e1c5511a01be"].includes(t))return this.leadSource=o.leadSource,this.leadSource;{const e=await this.fetchCurrentParsedLeadSource(i);if(!e)return this.leadSource=o.leadSource,this.leadSource;this.leadSource=e,r=!0}}const a=await this.fetchCurrentParsedLeadSource(i);if(this.leadSource=a,this.buildingId=null,this.orgSlug=t,this.buildingSlug=n,n&&!a){const e=this.getLeadSourceBodyIfValid(n);if(e)return this.leadSource=e.leadSource,this.leadSource}if(n){const t=!!a&&a.length>0;this.updateLeadSourceLocalStorage(n,a,e,!t&&!r,r)}return a}catch(e){}return null}},Ii=async(e,t=!1)=>{const n=`https://app.meetelise.com/eliseCrmApi/building/${e}/scheduling_status?observe_dynamic_scheduling=${t}`;try{return(await r().get(n)).data.is_enabled}catch(e){return!1}};var Mi,Ni,Di;!function(e){e.EMOJI="emoji",e.PILLS="pills",e.MINIMIZED="minimized"}(Mi||(Mi={})),function(e){e.UNKNOWN="UNKNOWN",e.SELF_GUIDED="SELF_GUIDED",e.VIRTUAL_SHOWING="VIRTUAL_SHOWING",e.WITH_AGENT="WITH_AGENT",e.MEDIA_TOUR="MEDIA_TOUR",e.OPEN_HOUSE_STUDIO="OPEN_HOUSE_STUDIO",e.OPEN_HOUSE_1BR="OPEN_HOUSE_1BR",e.OPEN_HOUSE_2BR="OPEN_HOUSE_2BR",e.OPEN_HOUSE_3BR="OPEN_HOUSE_3BR",e.OPEN_HOUSE_4BR="OPEN_HOUSE_4BR",e.OPEN_HOUSE_5BR="OPEN_HOUSE_5BR"}(Ni||(Ni={})),function(e){e.LINK="link",e.CLIENT_SCHEDULED="client_scheduled",e.SCHEDULED_BY_ME_MANAGED_BY_ME="scheduled_by_ME_managed_by_ME",e.SCHEDULED_BY_ME_MANAGED_BY_CLIENT="scheduled_by_ME_managed_by_client",e.SCHEDULED_BY_ME_MANAGED_BY_CONCIERGE="scheduled_by_ME_managed_by_concierge"}(Di||(Di={}));const Li=(e,t)=>"link"===(null==t?void 0:t.toLowerCase());async function Ui(e,t){var n;const i=`https://app.meetelise.com/api/pub/v1/organization/${e}/building/${t}/v2`,o=(await r().get(i)).data;try{o.welcomeMessage=Ri(null!==(n=o.welcomeMessage)&&void 0!==n?n:"",o.userFirstName)}catch(e){}return o}const Ri=(e,t)=>e.replace(/elise/gi,t);var Bi=n(7035),ji=n(6353);function Fi(e,t,n){var i=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=n.length-1;i>=0;--i)if("timeZoneName"===n[i].type)return n[i].value}(i,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}(i,t)}function Hi(e,t){var n=function(e){if(!zi[e]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===t||"‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00"===t;zi[e]=n?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return zi[e]}(t);return n.formatToParts?function(e,t){try{for(var n=e.formatToParts(t),i=[],r=0;r<n.length;r++){var o=$i[n[r].type];o>=0&&(i[o]=parseInt(n[r].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}(n,e):function(e,t){var n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[i[3],i[1],i[2],i[4],i[5],i[6]]}(n,e)}var $i={year:0,month:1,day:2,hour:3,minute:4,second:5};var zi={};function Gi(e,t,n,i,r,o,a){var s=new Date(0);return s.setUTCFullYear(e,t,n),s.setUTCHours(i,r,o,a),s}var Qi=36e5,Wi={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function qi(e,t,n){var i,r,o;if(!e)return 0;if(i=Wi.timezoneZ.exec(e))return 0;if(i=Wi.timezoneHH.exec(e))return Yi(o=parseInt(i[1],10))?-o*Qi:NaN;if(i=Wi.timezoneHHMM.exec(e)){o=parseInt(i[2],10);var a=parseInt(i[3],10);return Yi(o,a)?(r=Math.abs(o)*Qi+6e4*a,"+"===i[1]?-r:r):NaN}if(function(e){if(Ki[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Ki[e]=!0,!0}catch(e){return!1}}(e)){t=new Date(t||Date.now());var s=n?t:function(e){return Gi(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),l=Vi(s,e),u=n?l:function(e,t,n){var i=e.getTime(),r=i-t,o=Vi(new Date(r),n);if(t===o)return t;r-=o-t;var a=Vi(new Date(r),n);if(o===a)return o;return Math.max(o,a)}(t,l,e);return-u}return NaN}function Vi(e,t){var n=Hi(e,t),i=Gi(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime(),r=e.getTime(),o=r%1e3;return i-(r-=o>=0?o:1e3+o)}function Yi(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}var Ki={};var Xi={X:function(e,t,n,i){var r=Zi(i.timeZone,e);if(0===r)return"Z";switch(t){case"X":return tr(r);case"XXXX":case"XX":return er(r);default:return er(r,":")}},x:function(e,t,n,i){var r=Zi(i.timeZone,e);switch(t){case"x":return tr(r);case"xxxx":case"xx":return er(r);default:return er(r,":")}},O:function(e,t,n,i){var r=Zi(i.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),o=i%60;if(0===o)return n+String(r);var a=t||"";return n+String(r)+a+Ji(o,2)}(r,":");default:return"GMT"+er(r,":")}},z:function(e,t,n,i){switch(t){case"z":case"zz":case"zzz":return Fi("short",e,i);default:return Fi("long",e,i)}}};function Zi(e,t){var n=e?qi(e,t,!0)/6e4:t.getTimezoneOffset();if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ji(e,t){for(var n=e<0?"-":"",i=Math.abs(e).toString();i.length<t;)i="0"+i;return n+i}function er(e,t){var n=t||"",i=e>0?"-":"+",r=Math.abs(e);return i+Ji(Math.floor(r/60),2)+n+Ji(Math.floor(r%60),2)}function tr(e,t){return e%60==0?(e>0?"-":"+")+Ji(Math.abs(e)/60,2):er(e,t)}const nr=Xi;var ir=n(9784),rr=n(9720);var or=36e5,ar=6e4,sr={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function lr(e,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);var n=t||{},i=null==n.additionalDigits?2:ir(n.additionalDigits);if(2!==i&&1!==i&&0!==i)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var r=function(e){var t,n={},i=sr.dateTimePattern.exec(e);i?(n.date=i[1],t=i[3]):(i=sr.datePattern.exec(e))?(n.date=i[1],t=i[2]):(n.date=null,t=e);if(t){var r=sr.timeZone.exec(t);r?(n.time=t.replace(r[1],""),n.timeZone=r[1].trim()):n.time=t}return n}(e),o=function(e,t){var n,i=sr.YYY[t],r=sr.YYYYY[t];if(n=sr.YYYY.exec(e)||r.exec(e)){var o=n[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(n=sr.YY.exec(e)||i.exec(e)){var a=n[1];return{year:100*parseInt(a,10),restDateString:e.slice(a.length)}}return{year:null}}(r.date,i),a=o.year,s=function(e,t){if(null===t)return null;var n,i,r,o;if(0===e.length)return(i=new Date(0)).setUTCFullYear(t),i;if(n=sr.MM.exec(e))return i=new Date(0),pr(t,r=parseInt(n[1],10)-1)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(n=sr.DDD.exec(e)){i=new Date(0);var a=parseInt(n[1],10);return function(e,t){if(t<1)return!1;var n=hr(e);if(n&&t>366)return!1;if(!n&&t>365)return!1;return!0}(t,a)?(i.setUTCFullYear(t,0,a),i):new Date(NaN)}if(n=sr.MMDD.exec(e)){i=new Date(0),r=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return pr(t,r,s)?(i.setUTCFullYear(t,r,s),i):new Date(NaN)}if(n=sr.Www.exec(e))return fr(t,o=parseInt(n[1],10)-1)?ur(t,o):new Date(NaN);if(n=sr.WwwD.exec(e)){o=parseInt(n[1],10)-1;var l=parseInt(n[2],10)-1;return fr(t,o,l)?ur(t,o,l):new Date(NaN)}return null}(o.restDateString,a);if(isNaN(s))return new Date(NaN);if(s){var l,u=s.getTime(),c=0;if(r.time&&(c=function(e){var t,n,i;if(t=sr.HH.exec(e))return gr(n=parseFloat(t[1].replace(",",".")))?n%24*or:NaN;if(t=sr.HHMM.exec(e))return gr(n=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")))?n%24*or+i*ar:NaN;if(t=sr.HHMMSS.exec(e)){n=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return gr(n,i,r)?n%24*or+i*ar+1e3*r:NaN}return null}(r.time),isNaN(c)))return new Date(NaN);if(r.timeZone||n.timeZone){if(l=qi(r.timeZone||n.timeZone,new Date(u+c)),isNaN(l))return new Date(NaN)}else l=rr(new Date(u+c)),l=rr(new Date(u+c+l));return new Date(u+c+l)}return new Date(NaN)}function ur(e,t,n){t=t||0,n=n||0;var i=new Date(0);i.setUTCFullYear(e,0,4);var r=7*t+n+1-(i.getUTCDay()||7);return i.setUTCDate(i.getUTCDate()+r),i}var cr=[31,28,31,30,31,30,31,31,30,31,30,31],dr=[31,29,31,30,31,30,31,31,30,31,30,31];function hr(e){return e%400==0||e%4==0&&e%100!=0}function pr(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;var i=hr(e);if(i&&n>dr[t])return!1;if(!i&&n>cr[t])return!1}return!0}function fr(e,t,n){return!(t<0||t>52)&&(null==n||!(n<0||n>6))}function gr(e,t,n){return(null==e||!(e<0||e>=25))&&((null==t||!(t<0||t>=60))&&(null==n||!(n<0||n>=60)))}var mr=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function yr(e,t,n,i){var r=Bi(i);return r.timeZone=t,r.originalDate=e,function(e,t,n){var i=String(t),r=n||{},o=i.match(mr);if(o){var a=lr(r.originalDate||e,r);i=o.reduce(function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),i="'"===e[n-1],o=e.replace(t,"'"+nr[t[0]](a,t,null,r)+"'");return i?o.substring(0,n-1)+o.substring(n+1):o},i)}return ji(e,i,r)}(function(e,t,n){var i=lr(e,n),r=qi(t,i,!0),o=new Date(i.getTime()-r),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}(e,t),n,r)}var br=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=class extends oe{constructor(){super(...arguments),this.tourTypeOptions=[],this.layoutOptions=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.sgtUrl="",this.selfGuidedToursTypeOffered="",this.selfGuidedTourEnabled=!1,this.escortedToursLink="",this.escortedToursTypeOffered="",this.virtualToursLink="",this.virtualToursTypeOffered="",this.orgSlug="",this.hasDynamicSchedulingEnabled=!1,this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingName="",this.tourType=null,this.shouldShowTourType={[wr.Guided]:!0,[wr.Self]:!0,[wr.Virtual]:!0},this.email="",this.phoneNumber="",this.availabilitiesGroupedByDay={},this.calendarTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.waitingForAvailabilities=!0,this.mobilePageIndex=0,this.isSubmitting=!1,this.tourIsBooked=!1,this.shouldAllowScheduling=!1,this.shouldAllowScheduleLoading=!0,this.promptForReschedule=!1,this.canceledReschedule=!1,this.leadSources=[],this.orgLegalName="",this.currentLeadSource="",this.featureFlagShowDropdown="",this.compactDesign=!1,this.primaryColor=Ue,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.firstNameInputValue="",this.lastNameInputValue="",this.leadSourceInputValue="",this.selectedLayoutValue="",this.errorGettingAvailabilities=!1,this._setAvailabilities=async()=>{try{const[e,t]=await Promise.all([Ii(this.buildingId,this.hasDynamicSchedulingEnabled),Kn()]);this.shouldAllowScheduling=e,this.shouldAllowScheduleLoading=!1,this.calendarTimeZone=await(async e=>{var t;return null!==(t=(await Vn(e)).calendarTimeZone)&&void 0!==t?t:Intl.DateTimeFormat().resolvedOptions().timeZone})(this.buildingId),Ai({logTitle:"AVAILABILITIES_EXIST_FOR_TOUR_TYPE",logData:t,logType:xi.info,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});const n=Object.values(t).every(e=>!1===e),i=!this.sgtUrl&&!this.escortedToursLink&&!this.virtualToursLink;if(n&&i)return this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,void Ai({logTitle:"NO_AVAILABILITIES_EXIST",logData:null,logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug});this.shouldShowTourType={[wr.Guided]:this.tourTypeOptions.map(e=>e.value).includes("WITH_AGENT")&&(t[wr.Guided]||!!this.escortedToursLink),[wr.Self]:this.tourTypeOptions.map(e=>e.value).includes("SELF_GUIDED")&&(t[wr.Self]||!!this.sgtUrl),[wr.Virtual]:this.tourTypeOptions.map(e=>e.value).includes("VIRTUAL_SHOWING")&&(t[wr.Virtual]||!!this.virtualToursLink)};const r=1===Object.values(this.shouldShowTourType).reduce((e,t)=>!0===t?e+1:e,0);if(this._setDefaultSelectedDateAndTimes(),r&&(this.tourType=Object.keys(this.shouldShowTourType).find(e=>this.shouldShowTourType[e])),null===this.tourType)return void(this.waitingForAvailabilities=!1);this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType]),this.waitingForAvailabilities=!1}catch(e){this.errorGettingAvailabilities=!0,this.waitingForAvailabilities=!1,Ai({logTitle:"ERROR_LOADING_AVAILABILITIES",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this._setDefaultSelectedDateAndTimes=async(e,t)=>{var n,i,r;const o=await Vn(this.buildingId),a=null!=e?e:this._getHighestRankedTourType(o),s=a?null===(r=null===(i=null===(n=o.availability)||void 0===n?void 0:n[a])||void 0===i?void 0:i.availableTourStartTimes)||void 0===r?void 0:r.filter(e=>{if(!t)return!0;return Wt("string"==typeof e?Rn(e):e,t)}):[],l=null==s?void 0:s[0];a&&l&&a!==In.Unknown&&a!==In.MediaTour&&(this.selectedDate=Qt("string"==typeof l?Rn(l):l),this.tourType=xr[a],this.selectedTime="string"==typeof l?Zn(l):(e=>({datetime:Ft(e,"yyyy-MM-dd'T'HH:mm:ss"),offset:Ft(e,"xxx")}))(l))},this._getHighestRankedTourType=e=>{var t;const n=(null!==(t=e.rankOrderedSupportedTourTypes)&&void 0!==t?t:[]).map(t=>{var n,i;return{tourType:t,availabilities:null===(i=null===(n=e.availability)||void 0===n?void 0:n[t])||void 0===i?void 0:i.availableTourStartTimes}}).filter(e=>{if(e.tourType===In.Unknown||e.tourType===In.MediaTour)return!1;const t=xr[e.tourType],n=this._getTourTypeOffered(t);return!!n&&(!Li(0,n)&&e.availabilities&&e.availabilities.length>0)}),i=n[0];return i?i.tourType:null},this._getTourTypeOffered=e=>e===wr.Guided?this.escortedToursTypeOffered:e===wr.Self?this.selfGuidedToursTypeOffered:e===wr.Virtual?this.virtualToursTypeOffered:null,this.firstUpdated=async()=>{await this._setAvailabilities()},this.willUpdate=async e=>{e.has("tourType")&&this.tourType&&(this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType]))},this.handlePhoneKeydown=e=>{var t;if(!(e instanceof KeyboardEvent&&e.target instanceof HTMLInputElement&&null!==e.target.selectionStart))return;const n=e.target.selectionStart;if(1!==e.key.length||Ne(e)){if("Backspace"===e.key){if(Ne(e))return;if(this.phoneInput.selectionEnd&&this.phoneInput.selectionStart&&this.phoneInput.selectionEnd-this.phoneInput.selectionStart>0)return;const t=this.phoneNumber.length,i=this.phoneNumber.slice(0,n).replace(/\D/g,""),r=this.phoneNumber.slice(n).replace(/\D/g,""),o=`${i.slice(0,-1)}${r}`;this.phoneNumber=Pe(o),this.phoneInput.value=this.phoneNumber;const a=n-(t-this.phoneNumber.length);return this.phoneInput.setSelectionRange(a,a),e.preventDefault(),void e.stopPropagation()}if(!["ArrowLeft","ArrowRight"].includes(e.key)||Ne(e)||e.shiftKey)return;if("ArrowLeft"===e.key){const e=((null===(t=this.phoneNumber.slice(0,n).split(/\d+/).at(-1))||void 0===t?void 0:t.length)||0)+1,i=n-e>-1?n-e:0;this.phoneInput.setSelectionRange(i,i)}if("ArrowRight"===e.key){const e=(this.phoneNumber.slice(n).split(/\d+/)[0].length||0)+1,t=n+e<this.phoneNumber.length?n+e:this.phoneNumber.length;this.phoneInput.setSelectionRange(t,t)}e.preventDefault(),e.stopPropagation()}else{e.preventDefault(),e.stopPropagation();const t=this.phoneNumber.slice(0,n)+e.key+this.phoneNumber.slice(n);this.phoneNumber=Pe(t.replace(/\D/g,"")),this.phoneInput.value=this.phoneNumber}},this.handlePhoneKeyup=e=>{var t;if(!e.key)return;if(e.key.includes("Arrow")||["Meta","Shift","Control","Alt"].includes(e.key))return;const n=this.phoneInput.selectionStart,i=n?this.phoneInput.value.slice(n).replace(/\D/g,""):"";this.phoneNumber=Pe(this.phoneInput.value);let r=0,o=i.length;for(;o;)(null===(t=this.phoneNumber.at(r))||void 0===t?void 0:t.match(/\d/))&&o--,r++;const a=this.phoneInput.value.length-r+1;this.phoneInput.setSelectionRange(a,a)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.validators={tourType:()=>null!==this.tourType,dateAndTime:()=>!!this.selectedDate&&!!this.selectedTime,leadInfo:()=>{var e,t,n,i;return(!!(null===(e=this.firstNameInput)||void 0===e?void 0:e.value)||!!(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))&&An(null!==(i=null===(n=this.emailInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"")&&!!this.phoneNumber&&14===this.phoneNumber.length&&xn(this.phoneNumber)}},this.formIsValidForSubmission=()=>this.validators.tourType()&&this.validators.dateAndTime()&&this.validators.leadInfo(),this.timeStringToHoursAndMinutes=e=>{const[t,n]=e.split(/\D/g);return[parseInt(t)+(e.toLowerCase().includes("pm")?12:0),parseInt(n)]},this.submit=async()=>{var e,t,n,i,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C,x;if(!this.selectedDate||!this.selectedTime||null===this.tourType)return;const A=new URLSearchParams(window.location.search);let S=null;S=this.selectedLeadSource&&this.selectedLeadSource.value&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:this.leadSourceInputValue&&this.leadSourceInputValue.length>0?this.leadSourceInputValue:this.currentLeadSource;const k=[...new Set(S?[S,"property-website"]:["property-website"])];this.firstNameInput&&(this.firstNameInputValue=this.firstNameInput.value),this.lastNameInput&&(this.lastNameInputValue=this.lastNameInput.value),this.leadSourceInputValue=S;const E=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||this.selectedLayoutValue||null;ai("scheduleTourSubmitted",{email:this.email,phone:`+1${null===(t=this.phoneNumber.match(/\d/g))||void 0===t?void 0:t.join("")}`,firstName:null!==(i=null===(n=this.firstNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:this.firstNameInputValue,lastName:null!==(a=null===(o=this.lastNameInput)||void 0===o?void 0:o.value)&&void 0!==a?a:this.lastNameInputValue,tourType:Ar[this.tourType],tourTime:`${this.selectedTime.datetime}${this.selectedTime.offset}`,originatingSource:k.find(e=>"property-website"!==e)||null,layout:E});const T={referrer:document.referrer,email_address:this.email,phone_number:`+1${null===(s=this.phoneNumber.match(/\d/g))||void 0===s?void 0:s.join("")}`,building_id:this.buildingId,first_name:null!==(u=null===(l=this.firstNameInput)||void 0===l?void 0:l.value)&&void 0!==u?u:this.firstNameInputValue,last_name:null!==(d=null===(c=this.lastNameInput)||void 0===c?void 0:c.value)&&void 0!==d?d:this.lastNameInputValue,tour_type:Ar[this.tourType],tour_time:`${this.selectedTime.datetime}${this.selectedTime.offset}`,cancel_existing_tours:this.promptForReschedule,lead_sources:[...new Set(S?[S,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],query_params:Object.fromEntries(A.entries()),conversation_tracking_id:null===(h=this.leadSourceClient)||void 0===h?void 0:h.chatId,layouts:E?[E]:void 0,lead_sources_with_timestamps:(null!==(g=null===(p=this.leadSourceMultitouchClient)||void 0===p?void 0:p.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(f=this.selectedLeadSource)||void 0===f?void 0:f.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null}))&&void 0!==g?g:[]).map(e=>gn({...e}))};this.isSubmitting=!0;try{await r().post("https://app.meetelise.com/platformApi/state/create/v2/scheduleMe",T,{headers:{"building-slug":this.buildingSlug,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE","org-slug":this.orgSlug}}),null===(m=this.leadSourceClient)||void 0===m||m.checkAndHandleForLogLeadSource({webchatAction:"tour-scheduler",stateId:null}),null===(y=this.leadSourceClient)||void 0===y||y.resetLeadSource(),null===(b=this.leadSourceMultitouchClient)||void 0===b||b.resetLeadSourceTouchpoints(),this.isSubmitting=!1,this.tourIsBooked=!0}catch(e){const t=e,n=(null===(w=null===(v=t.response)||void 0===v?void 0:v.data)||void 0===w?void 0:w.detail)||"Failed to book tour";if(t.response&&t.response.headers&&t.response.headers["funnel-prospect-conflicting-appointment-error"]){if(this.selectedDate&&this.selectedTime){const e=this.availabilitiesGroupedByDay[Ft(this.selectedDate,"yyyy-MM-dd")];e&&(this.availabilitiesGroupedByDay[Ft(this.selectedDate,"yyyy-MM-dd")]=e.filter(e=>e!==this.selectedTime))}}else{if(409===(null===(C=t.response)||void 0===C?void 0:C.status)&&!this.promptForReschedule&&"User already has a tour scheduled for this building"===n)return this.promptForReschedule=!0,this.isSubmitting=!1,void(this.tourIsBooked=!1);if(409===(null===(x=t.response)||void 0===x?void 0:x.status)&&!this.promptForReschedule)return this.isSubmitting=!1,this.tourIsBooked=!1,qn(),this.availabilitiesGroupedByDay=await Xn(Cr[this.tourType],this.buildingId),void alert("This timeslot is no longer available. Please select a different time.")}alert(n),this.isSubmitting=!1,this.tourIsBooked=!1}},this.mobilePages=[{validate:this.validators.tourType,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>B`${this.tourTypeMenu()}`},{validate:this.validators.dateAndTime,nextButtonText:"Next",nextButtonAction:()=>{this.mobilePageIndex++},render:()=>B`${this.dateAndTimeMenu()}`},{validate:()=>this.validators.leadInfo(),nextButtonText:null,renderNextButton:()=>B` <action-confirm-button
1274
1274
  id="schedule-bttn"
1275
1275
  .onClick=${this.submit}
1276
1276
  .isLoading=${this.isSubmitting}
@@ -1461,6 +1461,13 @@ xmlns="http://www.w3.org/2000/svg"
1461
1461
  />
1462
1462
  ${14!==this.phoneNumber.length||xn(this.phoneNumber)?"":B`<p class="error-message">Invalid phone number</p>`}
1463
1463
  </div>
1464
+ ${this.layoutOptions.length>0?B` <me-select
1465
+ id="layout"
1466
+ placeholder="Bedroom preference (optional)"
1467
+ .options="${this.layoutOptions.map(e=>({label:e.label,value:Sr(e.value)}))}"
1468
+ @change=${()=>{var e;const t=(null===(e=this.selectedLayoutEl)||void 0===e?void 0:e.value)||"";this.selectedLayoutValue=t,t&&ai("tourLayoutSelected",{layout:t,buildingId:this.buildingId})}}
1469
+ >
1470
+ </me-select>`:""}
1464
1471
  ${this.leadSources.length>0&&(this.featureFlagShowDropdown===ri.always||this.featureFlagShowDropdown===ri.onAttributionFailure&&0===this.currentLeadSource.length)?B` <me-select
1465
1472
  id="leadSource"
1466
1473
  value="${this.currentLeadSource}"
@@ -1747,7 +1754,7 @@ xmlns="http://www.w3.org/2000/svg"
1747
1754
  </div>
1748
1755
  `}
1749
1756
  </div>
1750
- `}};var wr;vr.styles=[vi,En],br([ue({attribute:!1})],vr.prototype,"tourTypeOptions",void 0),br([ue({attribute:!0})],vr.prototype,"chatId",void 0),br([ue({type:Number})],vr.prototype,"buildingId",void 0),br([ue({attribute:!0})],vr.prototype,"buildingSlug",void 0),br([ue({attribute:!0})],vr.prototype,"sgtUrl",void 0),br([ue({attribute:!0})],vr.prototype,"selfGuidedToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"selfGuidedTourEnabled",void 0),br([ue({attribute:!0})],vr.prototype,"escortedToursLink",void 0),br([ue({attribute:!0})],vr.prototype,"escortedToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"virtualToursLink",void 0),br([ue({attribute:!0})],vr.prototype,"virtualToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"orgSlug",void 0),br([ue({attribute:!0})],vr.prototype,"hasDynamicSchedulingEnabled",void 0),br([ue({attribute:!0})],vr.prototype,"leadSourceClient",void 0),br([ue({attribute:!0})],vr.prototype,"leadSourceMultitouchClient",void 0),br([ue({attribute:!0})],vr.prototype,"buildingName",void 0),br([ce()],vr.prototype,"tourType",void 0),br([ce()],vr.prototype,"shouldShowTourType",void 0),br([ce()],vr.prototype,"email",void 0),br([ce()],vr.prototype,"phoneNumber",void 0),br([ce()],vr.prototype,"availabilitiesGroupedByDay",void 0),br([ce()],vr.prototype,"calendarTimeZone",void 0),br([ce()],vr.prototype,"waitingForAvailabilities",void 0),br([ce()],vr.prototype,"selectedDate",void 0),br([ce()],vr.prototype,"selectedTime",void 0),br([ce()],vr.prototype,"mobilePageIndex",void 0),br([ce()],vr.prototype,"isSubmitting",void 0),br([ce()],vr.prototype,"tourIsBooked",void 0),br([ce()],vr.prototype,"shouldAllowScheduling",void 0),br([ce()],vr.prototype,"shouldAllowScheduleLoading",void 0),br([ce()],vr.prototype,"promptForReschedule",void 0),br([ce()],vr.prototype,"canceledReschedule",void 0),br([ue({attribute:!1})],vr.prototype,"leadSources",void 0),br([ue({attribute:!0})],vr.prototype,"orgLegalName",void 0),br([ue({attribute:!0})],vr.prototype,"currentLeadSource",void 0),br([ue({attribute:!0})],vr.prototype,"featureFlagShowDropdown",void 0),br([ue({attribute:!0})],vr.prototype,"compactDesign",void 0),br([ue({attribute:!0})],vr.prototype,"primaryColor",void 0),br([ue({attribute:!0})],vr.prototype,"backgroundColor",void 0),br([ue({attribute:!0})],vr.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),br([ue({attribute:!0})],vr.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),br([de(".nameContainer#firstName input")],vr.prototype,"firstNameInput",void 0),br([de(".nameContainer#lastName input")],vr.prototype,"lastNameInput",void 0),br([de(".inputContainer#email input")],vr.prototype,"emailInput",void 0),br([de(".inputContainer#phone input")],vr.prototype,"phoneInput",void 0),br([de("me-select#leadSource")],vr.prototype,"selectedLeadSource",void 0),br([ce()],vr.prototype,"firstNameInputValue",void 0),br([ce()],vr.prototype,"lastNameInputValue",void 0),br([ce()],vr.prototype,"leadSourceInputValue",void 0),br([ce()],vr.prototype,"errorGettingAvailabilities",void 0),vr=br([se("tour-scheduler")],vr),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(wr||(wr={}));const Cr={[wr.Guided]:In.WithAgent,[wr.Self]:In.SelfGuided,[wr.Virtual]:In.VirtualShowing},xr={[In.WithAgent]:wr.Guided,[In.SelfGuided]:wr.Self,[In.VirtualShowing]:wr.Virtual},Ar={[wr.Guided]:"escorted-tour",[wr.Self]:"self-guided-tour",[wr.Virtual]:"live-virtual-tour"};const Sr=(e,t,n=!0,i=!1,r,o=.01)=>Si({params:{org_slug:e,building_slug:t,is_pixel_on_site:n,is_any_webchat_showing:i,extra_data:{webchat_no_show_reason:r}},sampleRate:o}),kr=async(e,t,n)=>{const i=.01;if(!e)return Sr(n,t,!0,!1,"building_does_not_exist",i),!1;if(!e.launchedDateTime)return Sr(n,t,!0,!1,"building_not_launched",i),!1;if(!e.active)return Sr(n,t,!0,!1,"building_not_active",i),!1;if(!e.webchatScopeConfigured)return Sr(n,t,!0,!1,"building_not_webchat_scope_configured",i),!1;const o=await async function(e){if(!e)return!1;try{return(await r().get(ii(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-leasing-in-maintenance-mode",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(t);return!o||(Sr(n,t,!0,!1,"building_in_maintenance_mode",i),!1)},Er=u`
1757
+ `}};var wr;vr.styles=[vi,En],br([ue({attribute:!1})],vr.prototype,"tourTypeOptions",void 0),br([ue({attribute:!1})],vr.prototype,"layoutOptions",void 0),br([ue({attribute:!0})],vr.prototype,"chatId",void 0),br([ue({type:Number})],vr.prototype,"buildingId",void 0),br([ue({attribute:!0})],vr.prototype,"buildingSlug",void 0),br([ue({attribute:!0})],vr.prototype,"sgtUrl",void 0),br([ue({attribute:!0})],vr.prototype,"selfGuidedToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"selfGuidedTourEnabled",void 0),br([ue({attribute:!0})],vr.prototype,"escortedToursLink",void 0),br([ue({attribute:!0})],vr.prototype,"escortedToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"virtualToursLink",void 0),br([ue({attribute:!0})],vr.prototype,"virtualToursTypeOffered",void 0),br([ue({attribute:!0})],vr.prototype,"orgSlug",void 0),br([ue({attribute:!0})],vr.prototype,"hasDynamicSchedulingEnabled",void 0),br([ue({attribute:!0})],vr.prototype,"leadSourceClient",void 0),br([ue({attribute:!0})],vr.prototype,"leadSourceMultitouchClient",void 0),br([ue({attribute:!0})],vr.prototype,"buildingName",void 0),br([ce()],vr.prototype,"tourType",void 0),br([ce()],vr.prototype,"shouldShowTourType",void 0),br([ce()],vr.prototype,"email",void 0),br([ce()],vr.prototype,"phoneNumber",void 0),br([ce()],vr.prototype,"availabilitiesGroupedByDay",void 0),br([ce()],vr.prototype,"calendarTimeZone",void 0),br([ce()],vr.prototype,"waitingForAvailabilities",void 0),br([ce()],vr.prototype,"selectedDate",void 0),br([ce()],vr.prototype,"selectedTime",void 0),br([ce()],vr.prototype,"mobilePageIndex",void 0),br([ce()],vr.prototype,"isSubmitting",void 0),br([ce()],vr.prototype,"tourIsBooked",void 0),br([ce()],vr.prototype,"shouldAllowScheduling",void 0),br([ce()],vr.prototype,"shouldAllowScheduleLoading",void 0),br([ce()],vr.prototype,"promptForReschedule",void 0),br([ce()],vr.prototype,"canceledReschedule",void 0),br([ue({attribute:!1})],vr.prototype,"leadSources",void 0),br([ue({attribute:!0})],vr.prototype,"orgLegalName",void 0),br([ue({attribute:!0})],vr.prototype,"currentLeadSource",void 0),br([ue({attribute:!0})],vr.prototype,"featureFlagShowDropdown",void 0),br([ue({attribute:!0})],vr.prototype,"compactDesign",void 0),br([ue({attribute:!0})],vr.prototype,"primaryColor",void 0),br([ue({attribute:!0})],vr.prototype,"backgroundColor",void 0),br([ue({attribute:!0})],vr.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),br([ue({attribute:!0})],vr.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),br([de(".nameContainer#firstName input")],vr.prototype,"firstNameInput",void 0),br([de(".nameContainer#lastName input")],vr.prototype,"lastNameInput",void 0),br([de(".inputContainer#email input")],vr.prototype,"emailInput",void 0),br([de(".inputContainer#phone input")],vr.prototype,"phoneInput",void 0),br([de("me-select#leadSource")],vr.prototype,"selectedLeadSource",void 0),br([de("me-select#layout")],vr.prototype,"selectedLayoutEl",void 0),br([ce()],vr.prototype,"firstNameInputValue",void 0),br([ce()],vr.prototype,"lastNameInputValue",void 0),br([ce()],vr.prototype,"leadSourceInputValue",void 0),br([ce()],vr.prototype,"selectedLayoutValue",void 0),br([ce()],vr.prototype,"errorGettingAvailabilities",void 0),vr=br([se("tour-scheduler")],vr),function(e){e.Guided="guided",e.Self="self",e.Virtual="virtual"}(wr||(wr={}));const Cr={[wr.Guided]:In.WithAgent,[wr.Self]:In.SelfGuided,[wr.Virtual]:In.VirtualShowing},xr={[In.WithAgent]:wr.Guided,[In.SelfGuided]:wr.Self,[In.VirtualShowing]:wr.Virtual},Ar={[wr.Guided]:"escorted-tour",[wr.Self]:"self-guided-tour",[wr.Virtual]:"live-virtual-tour"};function Sr(e){const t=Math.round(e/10);return 0===t?"studio":`${t}br`}const kr=(e,t,n=!0,i=!1,r,o=.01)=>Si({params:{org_slug:e,building_slug:t,is_pixel_on_site:n,is_any_webchat_showing:i,extra_data:{webchat_no_show_reason:r}},sampleRate:o}),Er=async(e,t,n)=>{const i=.01;if(!e)return kr(n,t,!0,!1,"building_does_not_exist",i),!1;if(!e.launchedDateTime)return kr(n,t,!0,!1,"building_not_launched",i),!1;if(!e.active)return kr(n,t,!0,!1,"building_not_active",i),!1;if(!e.webchatScopeConfigured)return kr(n,t,!0,!1,"building_not_webchat_scope_configured",i),!1;const o=await async function(e){if(!e)return!1;try{return(await r().get(ii(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-leasing-in-maintenance-mode",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(t);return!o||(kr(n,t,!0,!1,"building_in_maintenance_mode",i),!1)},Tr=u`
1751
1758
  * {
1752
1759
  font-family: "Helvetica Neue", Arial;
1753
1760
  font-size: 14px;
@@ -2244,7 +2251,7 @@ xmlns="http://www.w3.org/2000/svg"
2244
2251
  width: 164px;
2245
2252
  }
2246
2253
  }
2247
- `,Tr=u`
2254
+ `,_r=u`
2248
2255
  .type-hey__list {
2249
2256
  width: 280px;
2250
2257
  height: 300px;
@@ -2405,7 +2412,7 @@ xmlns="http://www.w3.org/2000/svg"
2405
2412
  .title-bold {
2406
2413
  font-weight: 700;
2407
2414
  }
2408
- `,_r=u`
2415
+ `,Or=u`
2409
2416
  .vertical-pill-list {
2410
2417
  position: relative;
2411
2418
  display: flex;
@@ -2478,7 +2485,7 @@ xmlns="http://www.w3.org/2000/svg"
2478
2485
  justify-content: center;
2479
2486
  align-items: center;
2480
2487
  }
2481
- `;var Or=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 Pr=class extends oe{constructor(){super(...arguments),this.text="Submit",this.isLoading=!1,this.disabled=!1,this.height="initial",this.width="initial",this.focus=()=>{var e,t;null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===t||t.focus()},this.render=()=>B`<button
2488
+ `;var Pr=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 Ir=class extends oe{constructor(){super(...arguments),this.text="Submit",this.isLoading=!1,this.disabled=!1,this.height="initial",this.width="initial",this.focus=()=>{var e,t;null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("button"))||void 0===t||t.focus()},this.render=()=>B`<button
2482
2489
  class=${ni()("action-confirm-button",{loading:this.isLoading})}
2483
2490
  @click=${this.isLoading?null:this.onClick}
2484
2491
  ?disabled=${this.disabled}
@@ -2490,7 +2497,7 @@ xmlns="http://www.w3.org/2000/svg"
2490
2497
  <div></div>
2491
2498
  <div></div>
2492
2499
  </div>`:this.text}
2493
- </button>`}};Pr.shadowRootOptions={...oe.shadowRootOptions,delegatesFocus:!0},Pr.styles=[u`
2500
+ </button>`}};Ir.shadowRootOptions={...oe.shadowRootOptions,delegatesFocus:!0},Ir.styles=[u`
2494
2501
  .action-confirm-button {
2495
2502
  display: flex;
2496
2503
  justify-content: center;
@@ -2564,7 +2571,7 @@ xmlns="http://www.w3.org/2000/svg"
2564
2571
  transform: rotate(360deg);
2565
2572
  }
2566
2573
  }
2567
- `],Or([ue()],Pr.prototype,"onClick",void 0),Or([ue()],Pr.prototype,"text",void 0),Or([ue({attribute:!1})],Pr.prototype,"isLoading",void 0),Or([ue({type:Boolean})],Pr.prototype,"disabled",void 0),Or([ue({type:String})],Pr.prototype,"height",void 0),Or([ue({type:String})],Pr.prototype,"width",void 0),Pr=Or([se("action-confirm-button")],Pr);var Ir=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 Mr=class extends oe{constructor(){super(...arguments),this.height="425px",this.width="326px",this.useRoundedBorders=!0,this.headerText="",this.isMobileSized=bn(),this.useGradientDesign=!1}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this.isMobileSized=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}render(){return B`
2574
+ `],Pr([ue()],Ir.prototype,"onClick",void 0),Pr([ue()],Ir.prototype,"text",void 0),Pr([ue({attribute:!1})],Ir.prototype,"isLoading",void 0),Pr([ue({type:Boolean})],Ir.prototype,"disabled",void 0),Pr([ue({type:String})],Ir.prototype,"height",void 0),Pr([ue({type:String})],Ir.prototype,"width",void 0),Ir=Pr([se("action-confirm-button")],Ir);var 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 Nr=class extends oe{constructor(){super(...arguments),this.height="425px",this.width="326px",this.useRoundedBorders=!0,this.headerText="",this.isMobileSized=bn(),this.useGradientDesign=!1}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this.isMobileSized=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}render(){return B`
2568
2575
  <div
2569
2576
  id="details-window-inner"
2570
2577
  class="details-window-wrapper"
@@ -2602,7 +2609,7 @@ xmlns="http://www.w3.org/2000/svg"
2602
2609
  </div>
2603
2610
  <slot class="details-window__slot-content"></slot>
2604
2611
  </div>
2605
- `}};Mr.styles=u`
2612
+ `}};Nr.styles=u`
2606
2613
  .details-window-wrapper {
2607
2614
  background: rgba(255, 255, 255, 0.9);
2608
2615
  box-shadow: 0px 0px 14px 5px rgba(0, 0, 0, 0.25);
@@ -2670,7 +2677,7 @@ xmlns="http://www.w3.org/2000/svg"
2670
2677
  border-radius: 0px 0px 0px 0px;
2671
2678
  }
2672
2679
  }
2673
- `,Ir([ue({type:String})],Mr.prototype,"height",void 0),Ir([ue({type:String})],Mr.prototype,"width",void 0),Ir([ue({type:Boolean})],Mr.prototype,"useRoundedBorders",void 0),Ir([ue({type:String})],Mr.prototype,"headerText",void 0),Ir([ue({attribute:!1})],Mr.prototype,"onCloseClick",void 0),Ir([ce()],Mr.prototype,"isMobileSized",void 0),Ir([ue({attribute:!0})],Mr.prototype,"useGradientDesign",void 0),Mr=Ir([se("details-window")],Mr);var Nr=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 Dr=class extends oe{constructor(){super(...arguments),this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.phoneNumberInputRef=Ee(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(De(e))return;const t=e.target;this.phoneNumber=Pe(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{Me(e)||De(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&An(this.email)||(this.hasEmailError=!0),this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0),this.windowHeight=525+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(!(this.isSubmitting||(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError)))try{this.isSubmitting=!0,this.windowHeight=585;const a=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource;await Lr(this.firstName,this.lastName,this.email,this.phoneNumber,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(a?[a,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null})),null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=525}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=525}},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError].filter(e=>e).length,this.render=()=>(window.customElements.get("details-window")||window.customElements.define("details-window",Mr),window.customElements.get("action-confirm-button")||window.customElements.define("action-confirm-button",Pr),this.hasSubmittedForm?B`
2680
+ `,Mr([ue({type:String})],Nr.prototype,"height",void 0),Mr([ue({type:String})],Nr.prototype,"width",void 0),Mr([ue({type:Boolean})],Nr.prototype,"useRoundedBorders",void 0),Mr([ue({type:String})],Nr.prototype,"headerText",void 0),Mr([ue({attribute:!1})],Nr.prototype,"onCloseClick",void 0),Mr([ce()],Nr.prototype,"isMobileSized",void 0),Mr([ue({attribute:!0})],Nr.prototype,"useGradientDesign",void 0),Nr=Mr([se("details-window")],Nr);var Dr=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 Lr=class extends oe{constructor(){super(...arguments),this.leadSources=[],this.chatId="",this.buildingId=0,this.buildingSlug="",this.orgSlug="",this.buildingName="",this.orgLegalName="",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.featureFlagShowDropdown="",this.phoneNumberInputRef=Ee(),this.privatePolicyUrl="https://www.meetelise.com/privacy",this.termsOfServiceUrl="_blank",this.firstName="",this.lastName="",this.email="",this.phoneNumber="",this.message="",this.currentLeadSource="",this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmittedForm=!1,this.windowHeight=525,this.hasSubmissionError=!1,this.isSubmitting=!1,this.onChangeFirstName=e=>{e.target&&(this.firstName=e.target.value)},this.onChangeLastName=e=>{e.target&&(this.lastName=e.target.value)},this.onChangeEmail=e=>{e.target&&(this.email=e.target.value)},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(De(e))return;const t=e.target;this.phoneNumber=Pe(t.value),this.phoneNumberInputRef.value.value=this.phoneNumber},this.onChangeMessage=e=>{e.target&&(this.message=e.target.value)},this.enforceFormat=e=>{Me(e)||De(e)||e.preventDefault()},this.validateFormFields=()=>{this.hasNameError=!1,this.hasEmailError=!1,this.hasPhoneNumberError=!1,this.hasMessageError=!1,this.hasSubmissionError=!1,this.firstName&&this.lastName||(this.hasNameError=!0),this.email&&An(this.email)||(this.hasEmailError=!0),this.phoneNumber&&14===this.phoneNumber.length||(this.hasPhoneNumberError=!0),this.windowHeight=525+30*this.getNumErrors()},this.onClick=async()=>{var e,t,n,i,r,o;if(!(this.isSubmitting||(this.validateFormFields(),this.hasNameError||this.hasEmailError||this.hasPhoneNumberError||this.hasMessageError)))try{this.isSubmitting=!0,this.windowHeight=585;const a=this.selectedLeadSource&&this.selectedLeadSource.value?this.selectedLeadSource.value:this.currentLeadSource;await Ur(this.firstName,this.lastName,this.email,this.phoneNumber,this.message,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(a?[a,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:(null===(n=this.selectedLeadSource)||void 0===n?void 0:n.value)&&this.selectedLeadSource.value.length>0?this.selectedLeadSource.value:null})),null===(i=this.leadSourceClient)||void 0===i||i.checkAndHandleForLogLeadSource({webchatAction:"email-us",stateId:null}),null===(r=this.leadSourceClient)||void 0===r||r.resetLeadSource(),null===(o=this.leadSourceMultitouchClient)||void 0===o||o.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.isSubmitting=!1,this.windowHeight=525}catch(e){this.hasSubmissionError=!0,this.isSubmitting=!1,this.windowHeight=525}},this.getNumErrors=()=>[this.hasNameError,this.hasEmailError,this.hasPhoneNumberError,this.hasMessageError,this.hasSubmissionError].filter(e=>e).length,this.render=()=>(window.customElements.get("details-window")||window.customElements.define("details-window",Nr),window.customElements.get("action-confirm-button")||window.customElements.define("action-confirm-button",Ir),this.hasSubmittedForm?B`
2674
2681
  <details-window
2675
2682
  id="details-window"
2676
2683
  headerText=""
@@ -2795,7 +2802,7 @@ xmlns="http://www.w3.org/2000/svg"
2795
2802
 
2796
2803
  ${bi({buildingName:this.buildingName,phoneNumberInput:this.phoneNumber,emailInput:this.email,orgLegalName:this.orgLegalName,orgSlug:this.orgSlug,clickingButtonText:"send"})}
2797
2804
  </details-window>
2798
- `)}};Dr.styles=[u`
2805
+ `)}};Lr.styles=[u`
2799
2806
  .email-us__name-input,
2800
2807
  .email-us__contact_input,
2801
2808
  .email-us_message-input {
@@ -2867,11 +2874,11 @@ xmlns="http://www.w3.org/2000/svg"
2867
2874
  width: 50%;
2868
2875
  }
2869
2876
  }
2870
- `,En],Nr([ue({attribute:!1})],Dr.prototype,"leadSources",void 0),Nr([ue({attribute:!1})],Dr.prototype,"onCloseClicked",void 0),Nr([ue({attribute:!0})],Dr.prototype,"chatId",void 0),Nr([ue({attribute:!1})],Dr.prototype,"buildingId",void 0),Nr([ue({attribute:!0})],Dr.prototype,"buildingSlug",void 0),Nr([ue({attribute:!0})],Dr.prototype,"orgSlug",void 0),Nr([ue({attribute:!0})],Dr.prototype,"buildingName",void 0),Nr([ue({attribute:!0})],Dr.prototype,"orgLegalName",void 0),Nr([ue({attribute:!0})],Dr.prototype,"leadSourceClient",void 0),Nr([ue({attribute:!0})],Dr.prototype,"leadSourceMultitouchClient",void 0),Nr([ue({attribute:!0})],Dr.prototype,"featureFlagShowDropdown",void 0),Nr([ue()],Dr.prototype,"privatePolicyUrl",void 0),Nr([ue()],Dr.prototype,"termsOfServiceUrl",void 0),Nr([ce()],Dr.prototype,"firstName",void 0),Nr([ce()],Dr.prototype,"lastName",void 0),Nr([ce()],Dr.prototype,"email",void 0),Nr([ce()],Dr.prototype,"phoneNumber",void 0),Nr([ce()],Dr.prototype,"message",void 0),Nr([de("me-select#leadSource")],Dr.prototype,"selectedLeadSource",void 0),Nr([ue({attribute:!0})],Dr.prototype,"currentLeadSource",void 0),Nr([ce()],Dr.prototype,"hasNameError",void 0),Nr([ce()],Dr.prototype,"hasEmailError",void 0),Nr([ce()],Dr.prototype,"hasPhoneNumberError",void 0),Nr([ce()],Dr.prototype,"hasMessageError",void 0),Nr([ce()],Dr.prototype,"hasSubmittedForm",void 0),Nr([ce()],Dr.prototype,"windowHeight",void 0),Nr([ce()],Dr.prototype,"hasSubmissionError",void 0),Nr([ce()],Dr.prototype,"isSubmitting",void 0),Dr=Nr([se("email-us-window")],Dr);const Lr=async(e,t,n,i,o,a,s,l,u,c,d)=>{const h="+1"+i.replace("(","").replace(")","").replace(" ","").replace("-",""),p=new URLSearchParams(window.location.search),f={email_address:n,building_id:a,lead_sources:u,first_message:o,first_name:e,last_name:t,phone_number:h,referrer:document.referrer,query_params:Object.fromEntries(p.entries()),conversation_tracking_id:c,lead_sources_with_timestamps:(null!=d?d:[]).map(e=>gn({...e}))};ai("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:h,message:o,originatingSource:u.find(e=>"property-website"!==e)||null}),await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",f,{headers:{"building-slug":l,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},Ur=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
2877
+ `,En],Dr([ue({attribute:!1})],Lr.prototype,"leadSources",void 0),Dr([ue({attribute:!1})],Lr.prototype,"onCloseClicked",void 0),Dr([ue({attribute:!0})],Lr.prototype,"chatId",void 0),Dr([ue({attribute:!1})],Lr.prototype,"buildingId",void 0),Dr([ue({attribute:!0})],Lr.prototype,"buildingSlug",void 0),Dr([ue({attribute:!0})],Lr.prototype,"orgSlug",void 0),Dr([ue({attribute:!0})],Lr.prototype,"buildingName",void 0),Dr([ue({attribute:!0})],Lr.prototype,"orgLegalName",void 0),Dr([ue({attribute:!0})],Lr.prototype,"leadSourceClient",void 0),Dr([ue({attribute:!0})],Lr.prototype,"leadSourceMultitouchClient",void 0),Dr([ue({attribute:!0})],Lr.prototype,"featureFlagShowDropdown",void 0),Dr([ue()],Lr.prototype,"privatePolicyUrl",void 0),Dr([ue()],Lr.prototype,"termsOfServiceUrl",void 0),Dr([ce()],Lr.prototype,"firstName",void 0),Dr([ce()],Lr.prototype,"lastName",void 0),Dr([ce()],Lr.prototype,"email",void 0),Dr([ce()],Lr.prototype,"phoneNumber",void 0),Dr([ce()],Lr.prototype,"message",void 0),Dr([de("me-select#leadSource")],Lr.prototype,"selectedLeadSource",void 0),Dr([ue({attribute:!0})],Lr.prototype,"currentLeadSource",void 0),Dr([ce()],Lr.prototype,"hasNameError",void 0),Dr([ce()],Lr.prototype,"hasEmailError",void 0),Dr([ce()],Lr.prototype,"hasPhoneNumberError",void 0),Dr([ce()],Lr.prototype,"hasMessageError",void 0),Dr([ce()],Lr.prototype,"hasSubmittedForm",void 0),Dr([ce()],Lr.prototype,"windowHeight",void 0),Dr([ce()],Lr.prototype,"hasSubmissionError",void 0),Dr([ce()],Lr.prototype,"isSubmitting",void 0),Lr=Dr([se("email-us-window")],Lr);const Ur=async(e,t,n,i,o,a,s,l,u,c,d)=>{const h="+1"+i.replace("(","").replace(")","").replace(" ","").replace("-",""),p=new URLSearchParams(window.location.search),f={email_address:n,building_id:a,lead_sources:u,first_message:o,first_name:e,last_name:t,phone_number:h,referrer:document.referrer,query_params:Object.fromEntries(p.entries()),conversation_tracking_id:c,lead_sources_with_timestamps:(null!=d?d:[]).map(e=>gn({...e}))};ai("emailUsSubmitted",{firstName:e,lastName:t,email:n,phone:h,message:o,originatingSource:u.find(e=>"property-website"!==e)||null}),await r().post("https://app.meetelise.com/platformApi/state/create/emailMe",f,{headers:{"building-slug":l,"org-slug":s,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},Rr=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
2871
2878
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.95487 2.54301e-07H7.04513C8.51534 -1.22821e-05 9.67985 -2.22686e-05 10.5912 0.121084C11.5292 0.24572 12.2883 0.508324 12.887 1.10005C13.4857 1.69178 13.7514 2.44211 13.8775 3.36914C14 4.26992 14 5.42089 14 6.874V10.126C14 11.5791 14 12.7301 13.8775 13.6309C13.7514 14.5579 13.4857 15.3082 12.887 15.8999C12.2883 16.4917 11.5292 16.7543 10.5912 16.8789C9.67985 17 8.51534 17 7.04513 17H6.95487C5.48466 17 4.32015 17 3.40878 16.8789C2.47084 16.7543 1.71169 16.4917 1.11299 15.8999C0.514304 15.3082 0.248611 14.5579 0.122508 13.6309C-2.25306e-05 12.7301 -1.24266e-05 11.5791 2.57292e-07 10.126V6.87399C-1.24266e-05 5.42088 -2.25306e-05 4.26992 0.122508 3.36914C0.248611 2.44211 0.514304 1.69178 1.11299 1.10005C1.71169 0.508324 2.47084 0.24572 3.40878 0.121084C4.32015 -2.22686e-05 5.48466 -1.22821e-05 6.95487 2.54301e-07ZM2.85118 1.44157C2.45996 1.55714 2.18378 1.71904 1.96152 1.93871C1.62295 2.27335 1.42002 2.73167 1.31181 3.52718C1.20127 4.33975 1.2 5.41089 1.2 6.9186V10.0814C1.2 11.5891 1.20127 12.6602 1.31181 13.4728C1.42002 14.2683 1.62295 14.7267 1.96152 15.0613C2.30009 15.3959 2.76381 15.5965 3.56868 15.7034C4.39081 15.8127 5.47454 15.814 7 15.814C8.52546 15.814 9.60919 15.8127 10.4313 15.7034C11.2362 15.5965 11.6999 15.3959 12.0385 15.0613C12.377 14.7267 12.58 14.2683 12.6882 13.4728C12.7987 12.6602 12.8 11.5891 12.8 10.0814V6.9186C12.8 5.41089 12.7987 4.33975 12.6882 3.52718C12.58 2.73167 12.377 2.27335 12.0385 1.93871C11.8162 1.71905 11.54 1.55714 11.1488 1.44157C10.6194 2.22728 10.2493 2.77349 9.69896 3.1115C9.58916 3.17894 9.47507 3.23928 9.3574 3.29217C8.76366 3.55903 8.09363 3.55868 7.12834 3.55818C7.08613 3.55816 7.04336 3.55814 7 3.55814C6.95664 3.55814 6.91387 3.55816 6.87166 3.55818C5.90637 3.55868 5.23634 3.55903 4.6426 3.29217C4.52493 3.23928 4.41084 3.17894 4.30104 3.1115C3.75069 2.77349 3.38057 2.22729 2.85118 1.44157ZM4.16103 1.2383C4.51629 1.74715 4.70232 1.96157 4.9344 2.10411C5.00028 2.14457 5.06873 2.18078 5.13933 2.21251C5.46646 2.35954 5.85406 2.37209 7 2.37209C8.14594 2.37209 8.53354 2.35954 8.86066 2.21251C8.93127 2.18078 8.99972 2.14457 9.0656 2.10411C9.29768 1.96157 9.48371 1.74715 9.83897 1.2383C9.10278 1.18681 8.18457 1.18605 7 1.18605C5.81543 1.18605 4.89722 1.18681 4.16103 1.2383ZM4 14.0349C4 13.7074 4.26863 13.4419 4.6 13.4419H9.4C9.73137 13.4419 10 13.7074 10 14.0349C10 14.3624 9.73137 14.6279 9.4 14.6279H4.6C4.26863 14.6279 4 14.3624 4 14.0349Z" fill="${e}"/>
2872
- </svg>`,Rr={},Br=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],jr=async e=>{const t=await(async e=>{if(Rr[e])return Rr[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return Rr[e]=n.data,n.data})(e);return Br.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var Fr=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 Hr=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Ee(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await jr(this.buildingId))},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 B`<a href="tel:${i}"
2879
+ </svg>`,Br={},jr=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],Fr=async e=>{const t=await(async e=>{if(Br[e])return Br[e];const t=`https://app.meetelise.com/platformApi/connectors/talk_js/leasing_office_hours/${e}`,n=await r().get(t);return Br[e]=n.data,n.data})(e);return jr.map(e=>{const n=t[e];return n?{dayOfWeek:e,startTime:n.start,endTime:n.end}:e})};var Hr=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 $r=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.phoneNumberToCall="",this.phoneNumberToText="",this.buildingId=0,this.buildingName="",this.chatCallUsHeader="",this.hasCallUsEnabled="",this.hasTextUsEnabled="",this.currentLeadSource="",this.orgLegalName="",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.phoneNumberInputRef=Ee(),this.hasSubmittedForm=!1,this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.submittingTextUsOption=!1,this.officeHoursTextInfo=[],this.firstUpdated=async()=>{this.buildingId&&this.hasCallUsEnabled&&(this.officeHoursTextInfo=await Fr(this.buildingId))},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 B`<a href="tel:${i}"
2873
2880
  >${e}</a
2874
- >`},this.enforcePhoneFormat=e=>{Me(e)||De(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await $r(this.phoneNumberToText,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(this.currentLeadSource?[this.currentLeadSource,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null})),null===(n=this.leadSourceClient)||void 0===n||n.checkAndHandleForLogLeadSource({webchatAction:"text-us",stateId:null}),null===(i=this.leadSourceClient)||void 0===i||i.resetLeadSource(),null===(r=this.leadSourceMultitouchClient)||void 0===r||r.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.submittingTextUsOption=!1}catch(e){this.submittingTextUsOption=!1,this.hasSubmissionError=!0}},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(De(e))return;const t=e.target;this.phoneNumberToText=Pe(t.value),this.phoneNumberInputRef.value.value=this.phoneNumberToText},this.renderFormTextUsOption=()=>B` <div class="text-us-wrapper">
2881
+ >`},this.enforcePhoneFormat=e=>{Me(e)||De(e)||e.preventDefault()},this.onSubmitTextUs=async()=>{var e,t,n,i,r;if(this.hasPhoneNumberError=!1,this.hasSubmissionError=!1,this.phoneNumberToText&&14===this.phoneNumberToText.length||(this.hasPhoneNumberError=!0),!this.hasPhoneNumberError)try{this.submittingTextUsOption=!0,await zr(this.phoneNumberToText,this.buildingId,this.orgSlug,this.buildingSlug,[...new Set(this.currentLeadSource?[this.currentLeadSource,Oi(this.orgSlug)]:[Oi(this.orgSlug)])],null===(e=this.leadSourceClient)||void 0===e?void 0:e.chatId,null===(t=this.leadSourceMultitouchClient)||void 0===t?void 0:t.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null})),null===(n=this.leadSourceClient)||void 0===n||n.checkAndHandleForLogLeadSource({webchatAction:"text-us",stateId:null}),null===(i=this.leadSourceClient)||void 0===i||i.resetLeadSource(),null===(r=this.leadSourceMultitouchClient)||void 0===r||r.resetLeadSourceTouchpoints(),this.hasSubmittedForm=!0,this.submittingTextUsOption=!1}catch(e){this.submittingTextUsOption=!1,this.hasSubmissionError=!0}},this.onChangePhoneNumber=e=>{if(!e.target||!this.phoneNumberInputRef.value)return;if(De(e))return;const t=e.target;this.phoneNumberToText=Pe(t.value),this.phoneNumberInputRef.value.value=this.phoneNumberToText},this.renderFormTextUsOption=()=>B` <div class="text-us-wrapper">
2875
2882
  <h1 class="text-us-window__header">Send Us a Text</h1>
2876
2883
  <div class="text-us-window__input-container">
2877
2884
  <input
@@ -2975,7 +2982,7 @@ xmlns="http://www.w3.org/2000/svg"
2975
2982
  Contact Our Leasing Team
2976
2983
  </h1>
2977
2984
  <div class="call-us-window__phone-redirect">
2978
- ${Ur("black")}
2985
+ ${Rr("black")}
2979
2986
  ${this.getCallLink(this.phoneNumberToCall)}
2980
2987
  </div>
2981
2988
  <div class="call-us-window__office-hours-wrapper">
@@ -3001,7 +3008,7 @@ xmlns="http://www.w3.org/2000/svg"
3001
3008
  </div>`:""}
3002
3009
  ${this.hasTextUsEnabled?this.hasSubmittedForm?this.renderSubmittedTextUsOption():this.renderFormTextUsOption():""}
3003
3010
  </details-window>
3004
- `}};Hr.styles=[En,u`
3011
+ `}};$r.styles=[En,u`
3005
3012
  #call-us-window__content-wrapper {
3006
3013
  font-family: "Helvetica Neue", Arial;
3007
3014
  font-style: normal;
@@ -3106,7 +3113,7 @@ xmlns="http://www.w3.org/2000/svg"
3106
3113
  .text-us-window__error {
3107
3114
  color: rgb(255, 49, 3);
3108
3115
  }
3109
- `],Fr([ue({attribute:!0})],Hr.prototype,"buildingSlug",void 0),Fr([ue({attribute:!0})],Hr.prototype,"orgSlug",void 0),Fr([ue({attribute:!1})],Hr.prototype,"onCloseClicked",void 0),Fr([ue()],Hr.prototype,"phoneNumberToCall",void 0),Fr([ue()],Hr.prototype,"phoneNumberToText",void 0),Fr([ue({attribute:!1})],Hr.prototype,"buildingId",void 0),Fr([ue({attribute:!1})],Hr.prototype,"buildingName",void 0),Fr([ue({attribute:!0})],Hr.prototype,"chatCallUsHeader",void 0),Fr([ue({attribute:!0})],Hr.prototype,"hasCallUsEnabled",void 0),Fr([ue({attribute:!0})],Hr.prototype,"hasTextUsEnabled",void 0),Fr([ue({attribute:!0})],Hr.prototype,"currentLeadSource",void 0),Fr([ue({attribute:!0})],Hr.prototype,"orgLegalName",void 0),Fr([ue({attribute:!0})],Hr.prototype,"leadSourceClient",void 0),Fr([ue({attribute:!0})],Hr.prototype,"leadSourceMultitouchClient",void 0),Fr([ce()],Hr.prototype,"hasSubmittedForm",void 0),Fr([ce()],Hr.prototype,"hasPhoneNumberError",void 0),Fr([ce()],Hr.prototype,"hasSubmissionError",void 0),Fr([ce()],Hr.prototype,"submittingTextUsOption",void 0),Fr([ue({attribute:!1})],Hr.prototype,"officeHoursTextInfo",void 0),Hr=Fr([se("call-us-window")],Hr);const $r=async(e,t,n,i,o,a,s)=>{const l="+1"+e.replace("(","").replace(")","").replace(" ","").replace("-",""),u=new URLSearchParams(window.location.search),c={building_id:t,lead_sources:o,phone_number:l,referrer:document.referrer,query_params:Object.fromEntries(u.entries()),conversation_tracking_id:a,lead_sources_with_timestamps:(null!=s?s:[]).map(e=>gn({...e}))};ai("textUsSubmitted",{phone:l,originatingSource:o.find(e=>"property-website"!==e)||null}),await r().post("https://app.meetelise.com/platformApi/state/create/textMe",c,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},zr=u`
3116
+ `],Hr([ue({attribute:!0})],$r.prototype,"buildingSlug",void 0),Hr([ue({attribute:!0})],$r.prototype,"orgSlug",void 0),Hr([ue({attribute:!1})],$r.prototype,"onCloseClicked",void 0),Hr([ue()],$r.prototype,"phoneNumberToCall",void 0),Hr([ue()],$r.prototype,"phoneNumberToText",void 0),Hr([ue({attribute:!1})],$r.prototype,"buildingId",void 0),Hr([ue({attribute:!1})],$r.prototype,"buildingName",void 0),Hr([ue({attribute:!0})],$r.prototype,"chatCallUsHeader",void 0),Hr([ue({attribute:!0})],$r.prototype,"hasCallUsEnabled",void 0),Hr([ue({attribute:!0})],$r.prototype,"hasTextUsEnabled",void 0),Hr([ue({attribute:!0})],$r.prototype,"currentLeadSource",void 0),Hr([ue({attribute:!0})],$r.prototype,"orgLegalName",void 0),Hr([ue({attribute:!0})],$r.prototype,"leadSourceClient",void 0),Hr([ue({attribute:!0})],$r.prototype,"leadSourceMultitouchClient",void 0),Hr([ce()],$r.prototype,"hasSubmittedForm",void 0),Hr([ce()],$r.prototype,"hasPhoneNumberError",void 0),Hr([ce()],$r.prototype,"hasSubmissionError",void 0),Hr([ce()],$r.prototype,"submittingTextUsOption",void 0),Hr([ue({attribute:!1})],$r.prototype,"officeHoursTextInfo",void 0),$r=Hr([se("call-us-window")],$r);const zr=async(e,t,n,i,o,a,s)=>{const l="+1"+e.replace("(","").replace(")","").replace(" ","").replace("-",""),u=new URLSearchParams(window.location.search),c={building_id:t,lead_sources:o,phone_number:l,referrer:document.referrer,query_params:Object.fromEntries(u.entries()),conversation_tracking_id:a,lead_sources_with_timestamps:(null!=s?s:[]).map(e=>gn({...e}))};ai("textUsSubmitted",{phone:l,originatingSource:o.find(e=>"property-website"!==e)||null}),await r().post("https://app.meetelise.com/platformApi/state/create/textMe",c,{headers:{"building-slug":i,"org-slug":n,"X-SecurityKey":"webchatkey-wkjcWAKZjqhLStvP8L6SN8y4FbYmPhdE"}})},Gr=u`
3110
3117
  :host {
3111
3118
  display: block;
3112
3119
  position: relative;
@@ -3418,10 +3425,10 @@ xmlns="http://www.w3.org/2000/svg"
3418
3425
  margin: 2px 0;
3419
3426
  }
3420
3427
  }
3421
- `;class Gr{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Qr{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new Gr(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Gr(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new Gr(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var Wr,qr;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(Wr||(Wr={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(qr||(qr={}));class Vr{constructor(e={}){var t,n,i,r,o,a,s,l,u;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(r=e.frequency)&&void 0!==r?r:Wr.ONE_TIME,this.category=null!==(o=e.category)&&void 0!==o?o:qr.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(a=e.refundable)&&void 0!==a&&a,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(s=e.public_facing)||void 0===s||s,this.per_applicant=null!==(l=e.per_applicant)&&void 0!==l&&l,this.required_for_quotes=null!==(u=e.required_for_quotes)&&void 0!==u&&u,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const Yr=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},Kr=hn,Xr=e=>new Vr(e),Zr=e=>new Qr(e),Jr=async(e,t)=>{try{const n=(new Yr).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${Kr}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=fn(i.data);return{fees:e.fees.map(Xr),rentableItems:e.rentableItems.map(Zr),buildingIncentives:e.buildingIncentives}}}catch(t){Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t}})}return{fees:[],rentableItems:[],buildingIncentives:[]}},eo=-1,to=hn,no=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${to}/platformApi/webchat/${e}/quote/calculate`,gn({unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a}),{signal:s});if(l.data){return fn(l.data)}}catch(t){"ERR_CANCELED"!==t.code&&Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t}})}return{quote:{}}},io=(e="black")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
3428
+ `;class Qr{constructor(e={}){var t,n,i,r,o,a;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.description=null!==(n=e.description)&&void 0!==n?n:"",this.type=null!==(i=e.type)&&void 0!==i?i:"",this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.rentFrequency=null!==(o=e.rentFrequency)&&void 0!==o?o:"monthly",this.available=null!==(a=e.available)&&void 0!==a&&a,this.reservedUntil=e.reservedUntil?new Date(e.reservedUntil):void 0}}class Wr{constructor(e={}){var t,n,i,r,o;this.description=null!==(t=e.description)&&void 0!==t?t:"",this.type=null!==(n=e.type)&&void 0!==n?n:"",this.minAvailableItem=e.minAvailableItem?new Qr(e.minAvailableItem):void 0,this.maxAvailableItem=e.maxAvailableItem?new Qr(e.maxAvailableItem):void 0,this.allItems=(null!==(i=e.allItems)&&void 0!==i?i:[]).map(e=>new Qr(e)),this.rent=null!==(r=e.rent)&&void 0!==r?r:0,this.priceDescription=null!==(o=e.priceDescription)&&void 0!==o?o:""}get displayName(){return this.description}get itemDescription(){return this.description}}var qr,Vr;!function(e){e.NEVER="NEVER",e.AS_NEEDED="AS_NEEDED",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(qr||(qr={})),function(e){e.Rent="Rent",e.Utility="Utility",e.ApplicationFee="ApplicationFee",e.Parking="Parking",e.Insurance="Insurance",e.Storage="Storage",e.PetFee="PetFee",e.PetRent="PetRent",e.PetDeposit="PetDeposit",e.SecurityDeposit="SecurityDeposit",e.MoveInFee="MoveInFee",e.Other="Other"}(Vr||(Vr={}));class Yr{constructor(e={}){var t,n,i,r,o,a,s,l,u;this.id=null!==(t=e.id)&&void 0!==t?t:"",this.building_id=e.building_id,this.fee_name=null!==(n=e.fee_name)&&void 0!==n?n:"",this.amount=e.amount,this.amount_display=null!==(i=e.amount_display)&&void 0!==i?i:"",this.min_estimate=e.min_estimate,this.max_estimate=e.max_estimate,this.percent_rent=e.percent_rent,this.percent_rent_min=e.percent_rent_min,this.percent_rent_max=e.percent_rent_max,this.frequency=null!==(r=e.frequency)&&void 0!==r?r:qr.ONE_TIME,this.category=null!==(o=e.category)&&void 0!==o?o:Vr.Other,this.description=e.description,this.additional_info=e.additional_info,this.refundable=null!==(a=e.refundable)&&void 0!==a&&a,this.hidden_reason=e.hidden_reason,this.unit_ids=e.unit_ids,this.layout_ids=e.layout_ids,this.public_facing=null===(s=e.public_facing)||void 0===s||s,this.per_applicant=null!==(l=e.per_applicant)&&void 0!==l&&l,this.required_for_quotes=null!==(u=e.required_for_quotes)&&void 0!==u&&u,this.charge_code=e.charge_code,this.bundle_key=e.bundle_key,this.external_key=e.external_key}get displayFrequency(){return this.frequency.replace(/_/g," ").toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())}get isOptional(){return!this.required_for_quotes}}const Kr=class{constructor(){this.params=new URLSearchParams}addSingle(e,t){return t?(this.params.append(e,t),this):this}addArray(e,t){return t?(t.forEach(t=>{t&&this.params.append(`${e}[]`,t)}),this):this}build(){return this.params.toString()?`?${this.params.toString()}`:""}},Xr=hn,Zr=e=>new Yr(e),Jr=e=>new Wr(e),eo=async(e,t)=>{try{const n=(new Kr).addArray("layout_ids",null==t?void 0:t.map(e=>e.toString())),i=await r().get(`${Xr}/platformApi/webchat/${e}/marketable-fees?${n.build()}`);if(i.data){const e=fn(i.data);return{fees:e.fees.map(Zr),rentableItems:e.rentableItems.map(Jr),buildingIncentives:e.buildingIncentives}}}catch(t){Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_FEES]",logData:{error:t}})}return{fees:[],rentableItems:[],buildingIncentives:[]}},to=-1,no=hn,io=async({buildingSlug:e,unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a},s)=>{try{const l=await r().post(`${no}/platformApi/webchat/${e}/quote/calculate`,gn({unitId:t,chargeInputs:n,rentableItems:i,leaseTerm:o,moveInDate:a}),{signal:s});if(l.data){return fn(l.data)}}catch(t){"ERR_CANCELED"!==t.code&&Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:t}})}return{quote:{}}},ro=(e="black")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
3422
3429
  <line x1="1.70782" y1="13.2254" x2="13.2376" y2="1.69554" stroke="${e}" stroke-width="2.13401"/>
3423
3430
  <path d="M2.00929 1.99996L13.3328 13.3421" stroke="${e}" stroke-width="2.13401"/>
3424
- </svg>`,ro=hn,oo=async({buildingSlug:e,numBedrooms:t,moveInDateEarliestString:n,moveInDateLatest:i,leaseTermMin:o})=>{try{const a=i?i.toISOString().split("T")[0]:void 0,s=new Yr;s.addArray("num_bedrooms",null==t?void 0:t.map(e=>e.toString())).addSingle("move_in_date_earliest",n).addSingle("move_in_date_latest",a).addSingle("lease_term_min",null==o?void 0:o.toString());const l=s.build(),u=await r().get(`${ro}/platformApi/webchat/${e}/units${l}`);if(u.data){return fn(u.data).map(e=>({...e,id:parseInt(e.id.toString().substring(1))}))}}catch(r){Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateEarliestString:n,moveInDateLatest:i}}})}return[]},ao=({color:e="#347FF7",size:t=24}={})=>j`
3431
+ </svg>`,oo=hn,ao=async({buildingSlug:e,numBedrooms:t,moveInDateEarliestString:n,moveInDateLatest:i,leaseTermMin:o})=>{try{const a=i?i.toISOString().split("T")[0]:void 0,s=new Kr;s.addArray("num_bedrooms",null==t?void 0:t.map(e=>e.toString())).addSingle("move_in_date_earliest",n).addSingle("move_in_date_latest",a).addSingle("lease_term_min",null==o?void 0:o.toString());const l=s.build(),u=await r().get(`${oo}/platformApi/webchat/${e}/units${l}`);if(u.data){return fn(u.data).map(e=>({...e,id:parseInt(e.id.toString().substring(1))}))}}catch(r){Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_UNITS]",logData:{error:r,params:{numBedrooms:t,moveInDateEarliestString:n,moveInDateLatest:i}}})}return[]},so=({color:e="#347FF7",size:t=24}={})=>j`
3425
3432
  <svg width="${t}" height="${t}" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
3426
3433
  <g id="Frame" clip-path="url(#clip0_18718_332018)">
3427
3434
  <path id="Vector" d="M3 12.5C3 13.6819 3.23279 14.8522 3.68508 15.9442C4.13738 17.0361 4.80031 18.0282 5.63604 18.864C6.47177 19.6997 7.46392 20.3626 8.55585 20.8149C9.64778 21.2672 10.8181 21.5 12 21.5C13.1819 21.5 14.3522 21.2672 15.4442 20.8149C16.5361 20.3626 17.5282 19.6997 18.364 18.864C19.1997 18.0282 19.8626 17.0361 20.3149 15.9442C20.7672 14.8522 21 13.6819 21 12.5C21 11.3181 20.7672 10.1478 20.3149 9.05585C19.8626 7.96392 19.1997 6.97177 18.364 6.13604C17.5282 5.30031 16.5361 4.63738 15.4442 4.18508C14.3522 3.73279 13.1819 3.5 12 3.5C10.8181 3.5 9.64778 3.73279 8.55585 4.18508C7.46392 4.63738 6.47177 5.30031 5.63604 6.13604C4.80031 6.97177 4.13738 7.96392 3.68508 9.05585C3.23279 10.1478 3 11.3181 3 12.5Z" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
@@ -3434,7 +3441,7 @@ xmlns="http://www.w3.org/2000/svg"
3434
3441
  </clipPath>
3435
3442
  </defs>
3436
3443
  </svg>
3437
- `,so=u`
3444
+ `,lo=u`
3438
3445
  :host {
3439
3446
  display: block;
3440
3447
  margin-bottom: 20px;
@@ -3468,9 +3475,9 @@ xmlns="http://www.w3.org/2000/svg"
3468
3475
  color: #868e96;
3469
3476
  font-size: 0.8rem;
3470
3477
  }
3471
- `;var lo=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 uo=class extends oe{constructor(){super(...arguments),this.promoAmount="0",this.promoDescription="",this.promoValidity=""}render(){return B`
3478
+ `;var uo=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 co=class extends oe{constructor(){super(...arguments),this.promoAmount="0",this.promoDescription="",this.promoValidity=""}render(){return B`
3472
3479
  <div class="promo-card">
3473
- <div class="icon-container">${ao()}</div>
3480
+ <div class="icon-container">${so()}</div>
3474
3481
  <div class="content-container">
3475
3482
  <h2 class="promo-heading">
3476
3483
  ${this.promoAmount} ${this.promoDescription}
@@ -3478,7 +3485,7 @@ xmlns="http://www.w3.org/2000/svg"
3478
3485
  <div class="promo-subtitle">${this.promoValidity}</div>
3479
3486
  </div>
3480
3487
  </div>
3481
- `}};uo.styles=so,lo([ue({type:String})],uo.prototype,"promoAmount",void 0),lo([ue({type:String})],uo.prototype,"promoDescription",void 0),lo([ue({type:String})],uo.prototype,"promoValidity",void 0),uo=lo([se("promo-card")],uo);const co=u`
3488
+ `}};co.styles=lo,uo([ue({type:String})],co.prototype,"promoAmount",void 0),uo([ue({type:String})],co.prototype,"promoDescription",void 0),uo([ue({type:String})],co.prototype,"promoValidity",void 0),co=uo([se("promo-card")],co);const ho=u`
3482
3489
  :host {
3483
3490
  display: block;
3484
3491
  }
@@ -3655,7 +3662,7 @@ xmlns="http://www.w3.org/2000/svg"
3655
3662
  overflow-x: auto;
3656
3663
  }
3657
3664
  }
3658
- `,ho=u`
3665
+ `,po=u`
3659
3666
  :host {
3660
3667
  display: block;
3661
3668
  }
@@ -3759,7 +3766,7 @@ xmlns="http://www.w3.org/2000/svg"
3759
3766
  margin-right: 8px;
3760
3767
  }
3761
3768
  }
3762
- `;var po=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 fo=class extends oe{constructor(){super(...arguments),this.unit={},this.onUnitSelect=null,this.selected=!1}get bedAndBathText(){return`${0===this.unit.numberOfBedrooms?"studio":`${this.unit.numberOfBedrooms}bd`} | ${this.unit.numberOfBathrooms}ba`}get priceRange(){return this.unit.startingPrice===this.unit.maxPrice?`$${this.unit.startingPrice}`:`$${this.unit.startingPrice} - $${this.unit.maxPrice}`}handleOnUnitSelect(){var e;this.selected||(this.selected=!this.selected,null===(e=this.onUnitSelect)||void 0===e||e.call(this,this.unit))}handleOnImgClick(e){const t=e.target;window.open(t.src,"_blank")}render(){return B`
3769
+ `;var fo=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 go=class extends oe{constructor(){super(...arguments),this.unit={},this.onUnitSelect=null,this.selected=!1}get bedAndBathText(){return`${0===this.unit.numberOfBedrooms?"studio":`${this.unit.numberOfBedrooms}bd`} | ${this.unit.numberOfBathrooms}ba`}get priceRange(){return this.unit.startingPrice===this.unit.maxPrice?`$${this.unit.startingPrice}`:`$${this.unit.startingPrice} - $${this.unit.maxPrice}`}handleOnUnitSelect(){var e;this.selected||(this.selected=!this.selected,null===(e=this.onUnitSelect)||void 0===e||e.call(this,this.unit))}handleOnImgClick(e){const t=e.target;window.open(t.src,"_blank")}render(){return B`
3763
3770
  <div class="floorplan-image-card ${this.selected?"selected":""}">
3764
3771
  <div class="section-left">
3765
3772
  ${this.unit.floorplanUrl?B`
@@ -3784,7 +3791,7 @@ xmlns="http://www.w3.org/2000/svg"
3784
3791
  </p>
3785
3792
  </div>
3786
3793
  </div>
3787
- `}};fo.styles=ho,po([ue({type:Object})],fo.prototype,"unit",void 0),po([ue()],fo.prototype,"onUnitSelect",void 0),po([ue({type:Boolean})],fo.prototype,"selected",void 0),fo=po([se("floorplan-image-card")],fo);var go=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 mo=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[eo],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=pn,this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===eo?n=[eo]:this.selectedLayoutIds.includes(eo)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[eo])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value;if(n){const[e,t,i]=n.split("-").map(Number);this.moveInDate=new Date(e,t-1,i)}else this.moveInDate=pn;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||pn.toISOString().split("T")[0])},this.handleLeaseTermChange=e=>{var t;this.leaseTerm=parseInt(e.target.value),null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm)},this.renderUnitSelection=()=>{var e,t;return this.isLoading?B`
3794
+ `}};go.styles=po,fo([ue({type:Object})],go.prototype,"unit",void 0),fo([ue()],go.prototype,"onUnitSelect",void 0),fo([ue({type:Boolean})],go.prototype,"selected",void 0),go=fo([se("floorplan-image-card")],go);var mo=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 yo=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.layoutOptions=[],this.selectedLayoutIds=[to],this.units=[],this.isLoading=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.moveInDate=pn,this.leaseTerm=12,this.selectedUnit=null,this.handleUnitSelect=e=>{var t;this.selectedUnit=e,null===(t=this.onUnitSelect)||void 0===t||t.call(this,e)},this.handleLayoutChange=e=>{var t;let n;e===to?n=[to]:this.selectedLayoutIds.includes(to)?n=[e]:this.selectedLayoutIds.includes(e)?(n=this.selectedLayoutIds.filter(t=>t!==e),0===n.length&&(n=[to])):n=[...this.selectedLayoutIds,e],this.selectedLayoutIds=n,null===(t=this.onSelectLayout)||void 0===t||t.call(this,this.selectedLayoutIds)},this.handleMoveInDateChange=e=>{var t;const n=e.target.value;if(n){const[e,t,i]=n.split("-").map(Number);this.moveInDate=new Date(e,t-1,i)}else this.moveInDate=pn;null===(t=this.onMoveInDateChange)||void 0===t||t.call(this,n||pn.toISOString().split("T")[0])},this.handleLeaseTermChange=e=>{var t;this.leaseTerm=parseInt(e.target.value),null===(t=this.onLeaseTermChange)||void 0===t||t.call(this,this.leaseTerm)},this.renderUnitSelection=()=>{var e,t;return this.isLoading?B`
3788
3795
  <div class="unit-selection">
3789
3796
  <div class="image-carousel">
3790
3797
  ${Array.from({length:3},()=>B`<div class="unit-card-skeleton shimmer"></div>`)}
@@ -3822,7 +3829,7 @@ xmlns="http://www.w3.org/2000/svg"
3822
3829
  </div>
3823
3830
  `)}
3824
3831
  </div>
3825
- `}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:eo,label:"All"},...this.layoutOptions].map(t=>({...t,label:e(t.label.replace(/bedroom/gi,"bd"))})).sort((e,t)=>e.value-t.value)}render(){var e,t;return B`
3832
+ `}get displayOptions(){const e=e=>{let t=e;return Object.entries({zero:"0",one:"1",two:"2",three:"3",four:"4",five:"5",six:"6",seven:"7",eight:"8",nine:"9",ten:"10",eleven:"11",twelve:"12"}).forEach(([e,n])=>{const i=new RegExp(`\\b${e}\\b`,"gi");t=t.replace(i,n)}),t};return[{value:to,label:"All"},...this.layoutOptions].map(t=>({...t,label:e(t.label.replace(/bedroom/gi,"bd"))})).sort((e,t)=>e.value-t.value)}render(){var e,t;return B`
3826
3833
  <div class="floor-plan-selector">
3827
3834
  <div class="floor-plan-selector-label">Select Floor Plan</div>
3828
3835
  ${this.renderBadges()}
@@ -3853,7 +3860,7 @@ xmlns="http://www.w3.org/2000/svg"
3853
3860
  ${this.renderUnitSelection()}
3854
3861
  </div>
3855
3862
  </div>
3856
- `}};mo.styles=co,go([ue({type:String})],mo.prototype,"buildingSlug",void 0),go([ue({type:Array})],mo.prototype,"layoutOptions",void 0),go([ue({type:Array})],mo.prototype,"selectedLayoutIds",void 0),go([ue({type:Array})],mo.prototype,"units",void 0),go([ue({type:Boolean})],mo.prototype,"isLoading",void 0),go([ue({type:Boolean})],mo.prototype,"isLoadingLayouts",void 0),go([ue()],mo.prototype,"onSelectLayout",void 0),go([ue()],mo.prototype,"onUnitSelect",void 0),go([ue()],mo.prototype,"onMoveInDateChange",void 0),go([ue()],mo.prototype,"onLeaseTermChange",void 0),go([ce()],mo.prototype,"moveInDate",void 0),go([ce()],mo.prototype,"leaseTerm",void 0),go([ce()],mo.prototype,"selectedUnit",void 0),mo=go([se("floor-plan-selector")],mo);const yo=u`
3863
+ `}};yo.styles=ho,mo([ue({type:String})],yo.prototype,"buildingSlug",void 0),mo([ue({type:Array})],yo.prototype,"layoutOptions",void 0),mo([ue({type:Array})],yo.prototype,"selectedLayoutIds",void 0),mo([ue({type:Array})],yo.prototype,"units",void 0),mo([ue({type:Boolean})],yo.prototype,"isLoading",void 0),mo([ue({type:Boolean})],yo.prototype,"isLoadingLayouts",void 0),mo([ue()],yo.prototype,"onSelectLayout",void 0),mo([ue()],yo.prototype,"onUnitSelect",void 0),mo([ue()],yo.prototype,"onMoveInDateChange",void 0),mo([ue()],yo.prototype,"onLeaseTermChange",void 0),mo([ce()],yo.prototype,"moveInDate",void 0),mo([ce()],yo.prototype,"leaseTerm",void 0),mo([ce()],yo.prototype,"selectedUnit",void 0),yo=mo([se("floor-plan-selector")],yo);const bo=u`
3857
3864
  :host {
3858
3865
  display: block;
3859
3866
  width: 100%;
@@ -3899,7 +3906,7 @@ xmlns="http://www.w3.org/2000/svg"
3899
3906
  font-size: 1rem;
3900
3907
  align-self: center;
3901
3908
  }
3902
- `;var bo=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 vo=class extends oe{constructor(){super(...arguments),this.feeQuote=null}get name(){var e,t;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem)return Sn(this.feeQuote.sourceRentableItem.description||"");const n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee;return(null==n?void 0:n.feeName)?Sn(n.feeName):""}get description(){var e,t,n,i;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem){return`${this.feeQuote.sourceRentableItem.id}`}return null!==(i=null===(n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee)||void 0===n?void 0:n.description)&&void 0!==i?i:""}get additionalInfo(){var e,t,n;return null!==(n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.additionalInfo)&&void 0!==n?n:""}get triggeredEvent(){var e,t;const n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.triggeredByEvent;if(!n)return"";return{APPLICATION_SUBMISSION:"Due at Application Submission",APPLICATION_APPROVAL:"Due at Application Approval",LEASE_SIGNING:"Due at Lease Signing",MOVE_IN:"Due at Move-In"}[n]||n}get amount(){var e;if(!this.feeQuote)return null;const t=null!==(e=this.feeQuote.amountRange.fixedValue)&&void 0!==e?e:0;return 0===t?null:kn(t,2)}render(){return this.feeQuote&&this.amount?B`
3909
+ `;var vo=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 wo=class extends oe{constructor(){super(...arguments),this.feeQuote=null}get name(){var e,t;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem)return Sn(this.feeQuote.sourceRentableItem.description||"");const n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee;return(null==n?void 0:n.feeName)?Sn(n.feeName):""}get description(){var e,t,n,i;if(null===(e=this.feeQuote)||void 0===e?void 0:e.sourceRentableItem){return`${this.feeQuote.sourceRentableItem.id}`}return null!==(i=null===(n=null===(t=this.feeQuote)||void 0===t?void 0:t.marketableFee)||void 0===n?void 0:n.description)&&void 0!==i?i:""}get additionalInfo(){var e,t,n;return null!==(n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.additionalInfo)&&void 0!==n?n:""}get triggeredEvent(){var e,t;const n=null===(t=null===(e=this.feeQuote)||void 0===e?void 0:e.marketableFee)||void 0===t?void 0:t.triggeredByEvent;if(!n)return"";return{APPLICATION_SUBMISSION:"Due at Application Submission",APPLICATION_APPROVAL:"Due at Application Approval",LEASE_SIGNING:"Due at Lease Signing",MOVE_IN:"Due at Move-In"}[n]||n}get amount(){var e;if(!this.feeQuote)return null;const t=null!==(e=this.feeQuote.amountRange.fixedValue)&&void 0!==e?e:0;return 0===t?null:kn(t,2)}render(){return this.feeQuote&&this.amount?B`
3903
3910
  <div class="fee-item">
3904
3911
  <div class="fee-info">
3905
3912
  <div class="fee-name">${this.name}</div>
@@ -3913,7 +3920,7 @@ xmlns="http://www.w3.org/2000/svg"
3913
3920
  </div>
3914
3921
  <div class="fee-amount">${this.amount}</div>
3915
3922
  </div>
3916
- `:B``}};vo.styles=yo,bo([ue({type:Object})],vo.prototype,"feeQuote",void 0),vo=bo([se("fee-item")],vo);var wo=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 Co=class extends oe{constructor(){super(...arguments),this.feeQuotes=[]}get itemType(){const e=this.feeQuotes[0];return(null==e?void 0:e.sourceRentableItem)?Sn(e.sourceRentableItem.description||""):""}get priceGroups(){const e=new Map;return this.feeQuotes.forEach(t=>{var n;const i=null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0;e.set(i,(e.get(i)||0)+1)}),Array.from(e.entries()).map(([e,t])=>({price:e,count:t})).sort((e,t)=>e.price-t.price)}get totalAmount(){const e=this.feeQuotes.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return kn(e,2)}get priceBreakdown(){const e=this.priceGroups;if(0===e.length)return"";const t=this.getUnitName();return e.map(e=>{return`${e.count} ${n=t,i=e.count,1===i?n:`${n}s`} @ ${kn(e.price,2)}/month`;var n,i}).join(" + ")}getUnitName(){var e;const t=this.feeQuotes[0];return function(e){const t=e.toLowerCase();return t.includes("garage")||t.includes("parking")?"space":t.includes("storage")?"unit":t.includes("locker")?"locker":t.includes("bike")?"spot":"unit"}((null===(e=null==t?void 0:t.sourceRentableItem)||void 0===e?void 0:e.description)||"")}render(){return this.feeQuotes.length&&this.totalAmount!==kn(0,2)?B`
3923
+ `:B``}};wo.styles=bo,vo([ue({type:Object})],wo.prototype,"feeQuote",void 0),wo=vo([se("fee-item")],wo);var Co=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 xo=class extends oe{constructor(){super(...arguments),this.feeQuotes=[]}get itemType(){const e=this.feeQuotes[0];return(null==e?void 0:e.sourceRentableItem)?Sn(e.sourceRentableItem.description||""):""}get priceGroups(){const e=new Map;return this.feeQuotes.forEach(t=>{var n;const i=null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0;e.set(i,(e.get(i)||0)+1)}),Array.from(e.entries()).map(([e,t])=>({price:e,count:t})).sort((e,t)=>e.price-t.price)}get totalAmount(){const e=this.feeQuotes.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return kn(e,2)}get priceBreakdown(){const e=this.priceGroups;if(0===e.length)return"";const t=this.getUnitName();return e.map(e=>{return`${e.count} ${n=t,i=e.count,1===i?n:`${n}s`} @ ${kn(e.price,2)}/month`;var n,i}).join(" + ")}getUnitName(){var e;const t=this.feeQuotes[0];return function(e){const t=e.toLowerCase();return t.includes("garage")||t.includes("parking")?"space":t.includes("storage")?"unit":t.includes("locker")?"locker":t.includes("bike")?"spot":"unit"}((null===(e=null==t?void 0:t.sourceRentableItem)||void 0===e?void 0:e.description)||"")}render(){return this.feeQuotes.length&&this.totalAmount!==kn(0,2)?B`
3917
3924
  <div class="fee-item">
3918
3925
  <div class="fee-info">
3919
3926
  <div class="fee-name">${this.itemType}</div>
@@ -3921,7 +3928,7 @@ xmlns="http://www.w3.org/2000/svg"
3921
3928
  </div>
3922
3929
  <div class="fee-amount">${this.totalAmount}</div>
3923
3930
  </div>
3924
- `:B``}};Co.styles=yo,wo([ue({type:Array})],Co.prototype,"feeQuotes",void 0),Co=wo([se("grouped-rentable-item")],Co);const xo=u`
3931
+ `:B``}};xo.styles=bo,Co([ue({type:Array})],xo.prototype,"feeQuotes",void 0),xo=Co([se("grouped-rentable-item")],xo);const Ao=u`
3925
3932
  .fee-card-section-container {
3926
3933
  margin: 0 12px;
3927
3934
  border-radius: 4px;
@@ -3981,7 +3988,7 @@ xmlns="http://www.w3.org/2000/svg"
3981
3988
  margin: 12px;
3982
3989
  justify-content: space-between;
3983
3990
  }
3984
- `;var Ao=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 So=class extends oe{constructor(){super(...arguments),this.title="Fees",this.fees=[],this.buildingFeesToQuantity={},this.handleQuantityChange=(e,t)=>{this.buildingFeesToQuantity[e]=t,this.requestUpdate()}}get totalAmount(){const e=this.fees.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return kn(e,2)}get groupedRentableItems(){const e=this.fees.filter(e=>e.sourceRentableItem);e.sort((e,t)=>{var n,i;const r=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"",o=(null===(i=t.sourceRentableItem)||void 0===i?void 0:i.description)||"";return r.localeCompare(o,navigator.language,{numeric:!0})});const t={};return e.forEach(e=>{var n;const i=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"unknown";t[i]||(t[i]=[]),t[i].push(e)}),t}get nonRentableItems(){return this.fees.filter(e=>!e.sourceRentableItem)}render(){return B`
3991
+ `;var So=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 ko=class extends oe{constructor(){super(...arguments),this.title="Fees",this.fees=[],this.buildingFeesToQuantity={},this.handleQuantityChange=(e,t)=>{this.buildingFeesToQuantity[e]=t,this.requestUpdate()}}get totalAmount(){const e=this.fees.reduce((e,t)=>{var n;return e+(null!==(n=t.amountRange.fixedValue)&&void 0!==n?n:0)},0);return kn(e,2)}get groupedRentableItems(){const e=this.fees.filter(e=>e.sourceRentableItem);e.sort((e,t)=>{var n,i;const r=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"",o=(null===(i=t.sourceRentableItem)||void 0===i?void 0:i.description)||"";return r.localeCompare(o,navigator.language,{numeric:!0})});const t={};return e.forEach(e=>{var n;const i=(null===(n=e.sourceRentableItem)||void 0===n?void 0:n.description)||"unknown";t[i]||(t[i]=[]),t[i].push(e)}),t}get nonRentableItems(){return this.fees.filter(e=>!e.sourceRentableItem)}render(){return B`
3985
3992
  <div class="fee-card-section-container">
3986
3993
  <div class="fee-card-section-header">
3987
3994
  <h1 class="section-title">${this.title}</h1>
@@ -4005,7 +4012,7 @@ xmlns="http://www.w3.org/2000/svg"
4005
4012
  </div>
4006
4013
  </div>
4007
4014
  </div>
4008
- `}};So.styles=xo,Ao([ue({type:String})],So.prototype,"title",void 0),Ao([ue({type:Array})],So.prototype,"fees",void 0),Ao([ce()],So.prototype,"buildingFeesToQuantity",void 0),So=Ao([se("fee-card")],So);const ko=u`
4015
+ `}};ko.styles=Ao,So([ue({type:String})],ko.prototype,"title",void 0),So([ue({type:Array})],ko.prototype,"fees",void 0),So([ce()],ko.prototype,"buildingFeesToQuantity",void 0),ko=So([se("fee-card")],ko);const Eo=u`
4009
4016
  :host {
4010
4017
  --transition-timing: 0.2s ease;
4011
4018
  display: flex;
@@ -4207,7 +4214,7 @@ xmlns="http://www.w3.org/2000/svg"
4207
4214
  font-weight: bold;
4208
4215
  color: #0066cc;
4209
4216
  }
4210
- `;var Eo;!function(e){e.NEVER="NEVER",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(Eo||(Eo={}));var To=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 _o=class extends oe{constructor(){super(...arguments),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.onChargeInputsChange=null,this.disabled=!1,this.rentableItems=[],this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.handleRentableItemToggle=e=>{var t,n;if(this.selectedRentableItems.some(t=>t.type===e.type)){const n=this.selectedRentableItems.find(t=>t.type===e.type);n&&(null===(t=this.onRentableItemRemove)||void 0===t||t.call(this,n))}else{const t=e.minAvailableItem||e.allItems[0];if(t){const i={id:t.id,type:e.type};null===(n=this.onRentableItemAdd)||void 0===n||n.call(this,i)}}}}handleIncrement(e){var t,n;const i=(null!==(t=this.chargeInputs[e])&&void 0!==t?t:0)+1;"num_cats"===e||"num_dogs"===e||"num_other_pets"===e?this.updatePetCount({[e]:i}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:i})}handleDecrement(e){var t,n;const i=null!==(t=this.chargeInputs[e])&&void 0!==t?t:0,r="num_applicants"===e?1:0,o=Math.max(r,i-1);"num_cats"===e||"num_dogs"===e||"num_other_pets"===e?this.updatePetCount({[e]:o}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:o})}updatePetCount(e){var t,n,i,r;const o={...this.chargeInputs,...e},a=(null!==(t=o.num_cats)&&void 0!==t?t:0)+(null!==(n=o.num_dogs)&&void 0!==n?n:0)+(null!==(i=o.num_other_pets)&&void 0!==i?i:0);null===(r=this.onChargeInputsChange)||void 0===r||r.call(this,{...e,num_pets:a})}getFieldLabel(e){return{base_rent:"Base Rent ($)",num_pets:"Pets",num_vehicles:"Vehicles",num_applicants:"Applicants",num_cats:"Cats",num_dogs:"Dogs",num_other_pets:"All Other Pets"}[e]||e}renderRentableItemRow(e){const t=this.selectedRentableItems.some(t=>t.type===e.type);return B`
4217
+ `;var To;!function(e){e.NEVER="NEVER",e.ONE_TIME="ONE_TIME",e.MONTHLY="MONTHLY",e.WEEKLY="WEEKLY",e.BI_WEEKLY="BI_WEEKLY",e.ANNUALLY="ANNUALLY",e.DAILY="DAILY"}(To||(To={}));var _o=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 Oo=class extends oe{constructor(){super(...arguments),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.onChargeInputsChange=null,this.disabled=!1,this.rentableItems=[],this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.handleRentableItemToggle=e=>{var t,n;if(this.selectedRentableItems.some(t=>t.type===e.type)){const n=this.selectedRentableItems.find(t=>t.type===e.type);n&&(null===(t=this.onRentableItemRemove)||void 0===t||t.call(this,n))}else{const t=e.minAvailableItem||e.allItems[0];if(t){const i={id:t.id,type:e.type};null===(n=this.onRentableItemAdd)||void 0===n||n.call(this,i)}}}}handleIncrement(e){var t,n;const i=(null!==(t=this.chargeInputs[e])&&void 0!==t?t:0)+1;"num_cats"===e||"num_dogs"===e||"num_other_pets"===e?this.updatePetCount({[e]:i}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:i})}handleDecrement(e){var t,n;const i=null!==(t=this.chargeInputs[e])&&void 0!==t?t:0,r="num_applicants"===e?1:0,o=Math.max(r,i-1);"num_cats"===e||"num_dogs"===e||"num_other_pets"===e?this.updatePetCount({[e]:o}):null===(n=this.onChargeInputsChange)||void 0===n||n.call(this,{[e]:o})}updatePetCount(e){var t,n,i,r;const o={...this.chargeInputs,...e},a=(null!==(t=o.num_cats)&&void 0!==t?t:0)+(null!==(n=o.num_dogs)&&void 0!==n?n:0)+(null!==(i=o.num_other_pets)&&void 0!==i?i:0);null===(r=this.onChargeInputsChange)||void 0===r||r.call(this,{...e,num_pets:a})}getFieldLabel(e){return{base_rent:"Base Rent ($)",num_pets:"Pets",num_vehicles:"Vehicles",num_applicants:"Applicants",num_cats:"Cats",num_dogs:"Dogs",num_other_pets:"All Other Pets"}[e]||e}renderRentableItemRow(e){const t=this.selectedRentableItems.some(t=>t.type===e.type);return B`
4211
4218
  <div class="rentable-item-row">
4212
4219
  <div class="rentable-item-info">
4213
4220
  <div class="rentable-item-label">${e.description}</div>
@@ -4263,7 +4270,7 @@ xmlns="http://www.w3.org/2000/svg"
4263
4270
  </div>
4264
4271
  `:""}
4265
4272
  </div>
4266
- `}};_o.styles=u`
4273
+ `}};Oo.styles=u`
4267
4274
  .charge-inputs-container {
4268
4275
  background: white;
4269
4276
  border-radius: 8px;
@@ -4400,7 +4407,7 @@ xmlns="http://www.w3.org/2000/svg"
4400
4407
  opacity: 0.5;
4401
4408
  cursor: not-allowed;
4402
4409
  }
4403
- `,To([ue({type:Object})],_o.prototype,"chargeInputs",void 0),To([ue()],_o.prototype,"onChargeInputsChange",void 0),To([ue({type:Boolean})],_o.prototype,"disabled",void 0),To([ue({type:Array})],_o.prototype,"rentableItems",void 0),To([ue({type:Array})],_o.prototype,"selectedRentableItems",void 0),To([ue()],_o.prototype,"onRentableItemAdd",void 0),To([ue()],_o.prototype,"onRentableItemRemove",void 0),_o=To([se("charge-inputs")],_o);const Oo=u`
4410
+ `,_o([ue({type:Object})],Oo.prototype,"chargeInputs",void 0),_o([ue()],Oo.prototype,"onChargeInputsChange",void 0),_o([ue({type:Boolean})],Oo.prototype,"disabled",void 0),_o([ue({type:Array})],Oo.prototype,"rentableItems",void 0),_o([ue({type:Array})],Oo.prototype,"selectedRentableItems",void 0),_o([ue()],Oo.prototype,"onRentableItemAdd",void 0),_o([ue()],Oo.prototype,"onRentableItemRemove",void 0),Oo=_o([se("charge-inputs")],Oo);const Po=u`
4404
4411
  :host {
4405
4412
  --skeleton-bg-color: #eaeaea;
4406
4413
  --skeleton-highlight-color: #f5f5f5;
@@ -4414,8 +4421,8 @@ xmlns="http://www.w3.org/2000/svg"
4414
4421
  background-position: 200px 0;
4415
4422
  }
4416
4423
  }
4417
- `,Po=u`
4418
- ${Oo}
4424
+ `,Io=u`
4425
+ ${Po}
4419
4426
 
4420
4427
  :host {
4421
4428
  display: block;
@@ -4480,8 +4487,8 @@ xmlns="http://www.w3.org/2000/svg"
4480
4487
  margin-bottom: 10px;
4481
4488
  }
4482
4489
  }
4483
- `,Io=u`
4484
- ${Oo}
4490
+ `,Mo=u`
4491
+ ${Po}
4485
4492
 
4486
4493
  :host {
4487
4494
  display: block;
@@ -4503,16 +4510,16 @@ xmlns="http://www.w3.org/2000/svg"
4503
4510
  box-sizing: border-box;
4504
4511
  }
4505
4512
  }
4506
- `;var Mo=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 No=class extends oe{constructor(){super(...arguments),this.rows=2,this.header=!0}render(){return B`
4513
+ `;var No=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 Do=class extends oe{constructor(){super(...arguments),this.rows=2,this.header=!0}render(){return B`
4507
4514
  <div class="skeleton-card">
4508
4515
  ${this.header?B`<div class="skeleton-header"></div>`:""}
4509
4516
  ${Array(this.rows).fill(0).map(()=>B`<div class="skeleton-row"></div>`)}
4510
4517
  </div>
4511
- `}};No.styles=Po,Mo([ue({type:Number})],No.prototype,"rows",void 0),Mo([ue({type:Boolean})],No.prototype,"header",void 0),No=Mo([se("skeleton-card")],No);var Do=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 Lo=class extends oe{constructor(){super(...arguments),this.cards=3,this.rowsPerCard=[3,2,1]}render(){return B`
4518
+ `}};Do.styles=Io,No([ue({type:Number})],Do.prototype,"rows",void 0),No([ue({type:Boolean})],Do.prototype,"header",void 0),Do=No([se("skeleton-card")],Do);var Lo=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 Uo=class extends oe{constructor(){super(...arguments),this.cards=3,this.rowsPerCard=[3,2,1]}render(){return B`
4512
4519
  <div class="skeleton-loader">
4513
4520
  ${Array.from({length:this.cards},(e,t)=>{const n=Array.isArray(this.rowsPerCard)?this.rowsPerCard[t]||2:this.rowsPerCard;return B`<skeleton-card .rows=${n}></skeleton-card>`})}
4514
4521
  </div>
4515
- `}};Lo.styles=Io,Do([ue({type:Number})],Lo.prototype,"cards",void 0),Do([ue({type:Array})],Lo.prototype,"rowsPerCard",void 0),Lo=Do([se("skeleton-loader")],Lo);var Uo=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 Ro=class extends oe{constructor(){super(...arguments),this.size=64,this.spinSpeed=.8}updated(){this.style.setProperty("--mega-loader-size",`${this.size}px`),this.style.setProperty("--mega-loader-spin-speed",`${this.spinSpeed}s`)}render(){return B`<div class="spinner"></div>`}};Ro.styles=u`
4522
+ `}};Uo.styles=Mo,Lo([ue({type:Number})],Uo.prototype,"cards",void 0),Lo([ue({type:Array})],Uo.prototype,"rowsPerCard",void 0),Uo=Lo([se("skeleton-loader")],Uo);var Ro=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 Bo=class extends oe{constructor(){super(...arguments),this.size=64,this.spinSpeed=.8}updated(){this.style.setProperty("--mega-loader-size",`${this.size}px`),this.style.setProperty("--mega-loader-spin-speed",`${this.spinSpeed}s`)}render(){return B`<div class="spinner"></div>`}};Bo.styles=u`
4516
4523
  .spinner {
4517
4524
  border: 4px solid rgba(0, 0, 0, 0.2);
4518
4525
  border-top: 4px solid var(--primary-color, #c057ff);
@@ -4530,7 +4537,7 @@ xmlns="http://www.w3.org/2000/svg"
4530
4537
  transform: rotate(360deg);
4531
4538
  }
4532
4539
  }
4533
- `,Uo([ue({type:Number})],Ro.prototype,"size",void 0),Uo([ue({type:Number})],Ro.prototype,"spinSpeed",void 0),Ro=Uo([se("mega-loader")],Ro);var Bo=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 jo=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.showSkeletonLoader=!1,this.selectedUnit=null,this.quote=null,this.layoutOptions=[],this.selectedLayoutIds=[eo],this.groupedFees={[Wr.ONE_TIME]:[],[Wr.MONTHLY]:[],[Wr.WEEKLY]:[],[Wr.BI_WEEKLY]:[],[Wr.ANNUALLY]:[],[Wr.DAILY]:[],[Wr.AS_NEEDED]:[],[Wr.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1},this.onChargeInputsChange=null,this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null}get rentAsFeeQuote(){var e,t;return(null===(e=this.quote)||void 0===e?void 0:e.rentCost)?{marketableFee:{id:"rent",buildingId:this.quote.buildingId||0,feeName:"Rent",amount:this.quote.rentCost,amountDisplay:kn(this.quote.rentCost,2),minEstimate:null,maxEstimate:null,percentRentMin:null,percentRentMax:null,percentRent:null,frequency:Eo.MONTHLY,category:"Rent",hiddenReason:null,description:`Unit ${null===(t=this.selectedUnit)||void 0===t?void 0:t.unitNumber}`,additionalInfo:null,refundable:!1,unitIds:null,layoutIds:null,startDate:null,endDate:null,triggeredByEvent:null,externalKey:null,chargeCode:null,bundleKey:null,source:null,publicFacing:!0,perApplicant:!1,prorated:null,syncActive:!0},amountRange:{fixedValue:this.quote.rentCost,minValue:null,maxValue:null},chargeInputs:{baseRent:this.quote.rentCost,numPets:0,numDogs:0,numCats:0,numOtherPets:0,numVehicles:0,numApplicants:1,unitId:this.quote.unitId,layoutId:null},isAddon:!1}:null}renderRecurringFeeSection(e,t){return(null==t?void 0:t.length)?B` <fee-card .fees=${t} title=${e}></fee-card> `:null}renderFeeSections(){var e,t;const n=[],i=[{freq:Eo.ANNUALLY,title:"Yearly Charges"},{freq:Eo.MONTHLY,title:"Monthly Charges"},{freq:Eo.BI_WEEKLY,title:"Bi-Weekly Charges"},{freq:Eo.WEEKLY,title:"Weekly Charges"},{freq:Eo.DAILY,title:"Daily Charges"},{freq:Eo.ONE_TIME,title:"One-Time"},{freq:Eo.NEVER,title:"No Charges"}],r=null===(e=this.quote)||void 0===e?void 0:e.feeQuotes;for(const{freq:e,title:o}of i){if(!(null==r?void 0:r.length)&&e!==Eo.MONTHLY)continue;let i=null!==(t=null==r?void 0:r.filter(t=>{var n,i;if((null===(n=t.marketableFee)||void 0===n?void 0:n.frequency)===e){if(e===Eo.ONE_TIME){return["APPLICATION_SUBMISSION","APPLICATION_APPROVAL","LEASE_SIGNING","MOVE_IN"].includes((null===(i=t.marketableFee)||void 0===i?void 0:i.triggeredByEvent)||"")}return!0}return!!t.sourceRentableItem&&("monthly"===t.sourceRentableItem.rentFrequency&&e===Eo.MONTHLY||"annually"===t.sourceRentableItem.rentFrequency&&e===Eo.ANNUALLY)}))&&void 0!==t?t:[];if(e===Eo.MONTHLY){const e=this.rentAsFeeQuote;e&&(i=[e,...i])}const a=this.renderRecurringFeeSection(o,i);a&&n.push(a)}return n}renderTotalCost(){var e;if(!(null===(e=this.quote)||void 0===e?void 0:e.totalMonthlyCost))return null;const t=this.quote.totalMonthlyCost.fixedValue;return t?B`
4540
+ `,Ro([ue({type:Number})],Bo.prototype,"size",void 0),Ro([ue({type:Number})],Bo.prototype,"spinSpeed",void 0),Bo=Ro([se("mega-loader")],Bo);var jo=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 Fo=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.showSkeletonLoader=!1,this.selectedUnit=null,this.quote=null,this.layoutOptions=[],this.selectedLayoutIds=[to],this.groupedFees={[qr.ONE_TIME]:[],[qr.MONTHLY]:[],[qr.WEEKLY]:[],[qr.BI_WEEKLY]:[],[qr.ANNUALLY]:[],[qr.DAILY]:[],[qr.AS_NEEDED]:[],[qr.NEVER]:[]},this.rentableItems=[],this.units=[],this.isLoadingUnits=!1,this.isLoadingLayouts=!1,this.onSelectLayout=null,this.onUnitSelect=null,this.onMoveInDateChange=null,this.onLeaseTermChange=null,this.chargeInputs={base_rent:0,num_pets:0,num_vehicles:0,num_applicants:1},this.onChargeInputsChange=null,this.selectedRentableItems=[],this.onRentableItemAdd=null,this.onRentableItemRemove=null}get rentAsFeeQuote(){var e,t;return(null===(e=this.quote)||void 0===e?void 0:e.rentCost)?{marketableFee:{id:"rent",buildingId:this.quote.buildingId||0,feeName:"Rent",amount:this.quote.rentCost,amountDisplay:kn(this.quote.rentCost,2),minEstimate:null,maxEstimate:null,percentRentMin:null,percentRentMax:null,percentRent:null,frequency:To.MONTHLY,category:"Rent",hiddenReason:null,description:`Unit ${null===(t=this.selectedUnit)||void 0===t?void 0:t.unitNumber}`,additionalInfo:null,refundable:!1,unitIds:null,layoutIds:null,startDate:null,endDate:null,triggeredByEvent:null,externalKey:null,chargeCode:null,bundleKey:null,source:null,publicFacing:!0,perApplicant:!1,prorated:null,syncActive:!0},amountRange:{fixedValue:this.quote.rentCost,minValue:null,maxValue:null},chargeInputs:{baseRent:this.quote.rentCost,numPets:0,numDogs:0,numCats:0,numOtherPets:0,numVehicles:0,numApplicants:1,unitId:this.quote.unitId,layoutId:null},isAddon:!1}:null}renderRecurringFeeSection(e,t){return(null==t?void 0:t.length)?B` <fee-card .fees=${t} title=${e}></fee-card> `:null}renderFeeSections(){var e,t;const n=[],i=[{freq:To.ANNUALLY,title:"Yearly Charges"},{freq:To.MONTHLY,title:"Monthly Charges"},{freq:To.BI_WEEKLY,title:"Bi-Weekly Charges"},{freq:To.WEEKLY,title:"Weekly Charges"},{freq:To.DAILY,title:"Daily Charges"},{freq:To.ONE_TIME,title:"One-Time"},{freq:To.NEVER,title:"No Charges"}],r=null===(e=this.quote)||void 0===e?void 0:e.feeQuotes;for(const{freq:e,title:o}of i){if(!(null==r?void 0:r.length)&&e!==To.MONTHLY)continue;let i=null!==(t=null==r?void 0:r.filter(t=>{var n,i;if((null===(n=t.marketableFee)||void 0===n?void 0:n.frequency)===e){if(e===To.ONE_TIME){return["APPLICATION_SUBMISSION","APPLICATION_APPROVAL","LEASE_SIGNING","MOVE_IN"].includes((null===(i=t.marketableFee)||void 0===i?void 0:i.triggeredByEvent)||"")}return!0}return!!t.sourceRentableItem&&("monthly"===t.sourceRentableItem.rentFrequency&&e===To.MONTHLY||"annually"===t.sourceRentableItem.rentFrequency&&e===To.ANNUALLY)}))&&void 0!==t?t:[];if(e===To.MONTHLY){const e=this.rentAsFeeQuote;e&&(i=[e,...i])}const a=this.renderRecurringFeeSection(o,i);a&&n.push(a)}return n}renderTotalCost(){var e;if(!(null===(e=this.quote)||void 0===e?void 0:e.totalMonthlyCost))return null;const t=this.quote.totalMonthlyCost.fixedValue;return t?B`
4534
4541
  <div class="total-cost-section">
4535
4542
  <div class="total-cost-row">
4536
4543
  <span class="total-cost-label">Total Monthly Cost:</span>
@@ -4586,7 +4593,7 @@ xmlns="http://www.w3.org/2000/svg"
4586
4593
 
4587
4594
  ${this.renderFeesContent()}
4588
4595
  </div>
4589
- `}};jo.styles=ko,Bo([ue({type:String})],jo.prototype,"buildingSlug",void 0),Bo([ue({type:Boolean})],jo.prototype,"showSkeletonLoader",void 0),Bo([ue({type:Object})],jo.prototype,"selectedUnit",void 0),Bo([ue({type:Object})],jo.prototype,"quote",void 0),Bo([ue({type:Array})],jo.prototype,"layoutOptions",void 0),Bo([ue({type:Array})],jo.prototype,"selectedLayoutIds",void 0),Bo([ue({type:Object})],jo.prototype,"groupedFees",void 0),Bo([ue({type:Array})],jo.prototype,"rentableItems",void 0),Bo([ue({type:Array})],jo.prototype,"units",void 0),Bo([ue({type:Boolean})],jo.prototype,"isLoadingUnits",void 0),Bo([ue({type:Boolean})],jo.prototype,"isLoadingLayouts",void 0),Bo([ue()],jo.prototype,"onSelectLayout",void 0),Bo([ue()],jo.prototype,"onUnitSelect",void 0),Bo([ue()],jo.prototype,"onMoveInDateChange",void 0),Bo([ue()],jo.prototype,"onLeaseTermChange",void 0),Bo([ue({type:Object})],jo.prototype,"chargeInputs",void 0),Bo([ue()],jo.prototype,"onChargeInputsChange",void 0),Bo([ue({type:Array})],jo.prototype,"selectedRentableItems",void 0),Bo([ue()],jo.prototype,"onRentableItemAdd",void 0),Bo([ue()],jo.prototype,"onRentableItemRemove",void 0),jo=Bo([se("fee-calculator-layout")],jo);var Fo,Ho,$o,zo;!function(e){e.OneTime="OneTime",e.Daily="Daily",e.Weekly="Weekly",e.BiWeekly="BiWeekly",e.Monthly="Monthly",e.Yearly="Yearly",e.Unknown="Unknown"}(Fo||(Fo={})),function(e){e.Debit="Debit",e.Credit="Credit"}(Ho||(Ho={})),function(e){e.Fixed="Fixed",e.UsageBased="UsageBased",e.Varies="Varies"}($o||($o={})),function(e){e.AdminFee="AdminFee",e.ApplicationFee="ApplicationFee",e.Concession="Concession",e.Insurance="Insurance",e.LateFee="LateFee",e.Legal="Legal",e.NonSufficientFundFee="NSF",e.Other="Other",e.Parking="Parking",e.Penalty="Penalty",e.Pest="Pest",e.PetDeposit="PetDeposit",e.PetRent="PetRent",e.Refund="Refund",e.Relet="Relet",e.Rent="Rent",e.SecurityDeposit="SecurityDeposit",e.Storage="Storage",e.Trash="Trash",e.Utility="Utility",e.WaterSewer="WaterSewer"}(zo||(zo={}));const Go=u`
4596
+ `}};Fo.styles=Eo,jo([ue({type:String})],Fo.prototype,"buildingSlug",void 0),jo([ue({type:Boolean})],Fo.prototype,"showSkeletonLoader",void 0),jo([ue({type:Object})],Fo.prototype,"selectedUnit",void 0),jo([ue({type:Object})],Fo.prototype,"quote",void 0),jo([ue({type:Array})],Fo.prototype,"layoutOptions",void 0),jo([ue({type:Array})],Fo.prototype,"selectedLayoutIds",void 0),jo([ue({type:Object})],Fo.prototype,"groupedFees",void 0),jo([ue({type:Array})],Fo.prototype,"rentableItems",void 0),jo([ue({type:Array})],Fo.prototype,"units",void 0),jo([ue({type:Boolean})],Fo.prototype,"isLoadingUnits",void 0),jo([ue({type:Boolean})],Fo.prototype,"isLoadingLayouts",void 0),jo([ue()],Fo.prototype,"onSelectLayout",void 0),jo([ue()],Fo.prototype,"onUnitSelect",void 0),jo([ue()],Fo.prototype,"onMoveInDateChange",void 0),jo([ue()],Fo.prototype,"onLeaseTermChange",void 0),jo([ue({type:Object})],Fo.prototype,"chargeInputs",void 0),jo([ue()],Fo.prototype,"onChargeInputsChange",void 0),jo([ue({type:Array})],Fo.prototype,"selectedRentableItems",void 0),jo([ue()],Fo.prototype,"onRentableItemAdd",void 0),jo([ue()],Fo.prototype,"onRentableItemRemove",void 0),Fo=jo([se("fee-calculator-layout")],Fo);var Ho,$o,zo,Go;!function(e){e.OneTime="OneTime",e.Daily="Daily",e.Weekly="Weekly",e.BiWeekly="BiWeekly",e.Monthly="Monthly",e.Yearly="Yearly",e.Unknown="Unknown"}(Ho||(Ho={})),function(e){e.Debit="Debit",e.Credit="Credit"}($o||($o={})),function(e){e.Fixed="Fixed",e.UsageBased="UsageBased",e.Varies="Varies"}(zo||(zo={})),function(e){e.AdminFee="AdminFee",e.ApplicationFee="ApplicationFee",e.Concession="Concession",e.Insurance="Insurance",e.LateFee="LateFee",e.Legal="Legal",e.NonSufficientFundFee="NSF",e.Other="Other",e.Parking="Parking",e.Penalty="Penalty",e.Pest="Pest",e.PetDeposit="PetDeposit",e.PetRent="PetRent",e.Refund="Refund",e.Relet="Relet",e.Rent="Rent",e.SecurityDeposit="SecurityDeposit",e.Storage="Storage",e.Trash="Trash",e.Utility="Utility",e.WaterSewer="WaterSewer"}(Go||(Go={}));const Qo=u`
4590
4597
  :host {
4591
4598
  display: block;
4592
4599
  --table-header-bg: white;
@@ -4654,14 +4661,14 @@ xmlns="http://www.w3.org/2000/svg"
4654
4661
  color: #888;
4655
4662
  font-style: italic;
4656
4663
  }
4657
- `;var Qo=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 Wo=class extends oe{constructor(){super(...arguments),this.tooltip="",this.disabled=!1}render(){return B`
4664
+ `;var Wo=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 qo=class extends oe{constructor(){super(...arguments),this.tooltip="",this.disabled=!1}render(){return B`
4658
4665
  <div
4659
4666
  class="tooltip-container ${this.disabled?"":"show-tooltip"}"
4660
4667
  data-tooltip="${this.tooltip}"
4661
4668
  >
4662
4669
  <slot></slot>
4663
4670
  </div>
4664
- `}};Wo.styles=u`
4671
+ `}};qo.styles=u`
4665
4672
  :host {
4666
4673
  display: block;
4667
4674
  position: relative;
@@ -4695,7 +4702,7 @@ xmlns="http://www.w3.org/2000/svg"
4695
4702
  opacity: 1;
4696
4703
  visibility: visible;
4697
4704
  }
4698
- `,Qo([ue({type:String})],Wo.prototype,"tooltip",void 0),Qo([ue({type:Boolean,reflect:!0})],Wo.prototype,"disabled",void 0),Wo=Qo([se("simple-tooltip")],Wo);const qo=u`
4705
+ `,Wo([ue({type:String})],qo.prototype,"tooltip",void 0),Wo([ue({type:Boolean,reflect:!0})],qo.prototype,"disabled",void 0),qo=Wo([se("simple-tooltip")],qo);const Vo=u`
4699
4706
  :host {
4700
4707
  display: inline-flex;
4701
4708
  }
@@ -4754,7 +4761,7 @@ xmlns="http://www.w3.org/2000/svg"
4754
4761
  font-style: italic;
4755
4762
  cursor: not-allowed;
4756
4763
  }
4757
- `;var Vo=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 Yo=class extends oe{constructor(){super(...arguments),this.feeItem=null,this._previousFeeItemId=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0}get maxQuantity(){var e,t;return null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.max_estimate)&&void 0!==t?t:10}updated(e){var t,n;if(!e.has("feeItem"))return;const i=null!==(n=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==n?n:null;i!==this._previousFeeItemId&&(this.quantity=0,this._previousFeeItemId=i)}handleIncrement(){this.disabled||this.quantity>=this.maxQuantity||(this.quantity+=1,this.notifyQuantityChange())}handleDecrement(){this.disabled||this.quantity<=0||(this.quantity=Math.max(0,this.quantity-1),this.notifyQuantityChange())}notifyQuantityChange(){this.onQuantityChange&&this.feeItem&&this.onQuantityChange({id:this.feeItem.id,quantities:[{itemType:this.feeItem.fee_name,quantity:this.quantity}]})}render(){return this.feeItem?B`
4764
+ `;var Yo=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 Ko=class extends oe{constructor(){super(...arguments),this.feeItem=null,this._previousFeeItemId=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0}get maxQuantity(){var e,t;return null!==(t=null===(e=this.feeItem)||void 0===e?void 0:e.max_estimate)&&void 0!==t?t:10}updated(e){var t,n;if(!e.has("feeItem"))return;const i=null!==(n=null===(t=this.feeItem)||void 0===t?void 0:t.id)&&void 0!==n?n:null;i!==this._previousFeeItemId&&(this.quantity=0,this._previousFeeItemId=i)}handleIncrement(){this.disabled||this.quantity>=this.maxQuantity||(this.quantity+=1,this.notifyQuantityChange())}handleDecrement(){this.disabled||this.quantity<=0||(this.quantity=Math.max(0,this.quantity-1),this.notifyQuantityChange())}notifyQuantityChange(){this.onQuantityChange&&this.feeItem&&this.onQuantityChange({id:this.feeItem.id,quantities:[{itemType:this.feeItem.fee_name,quantity:this.quantity}]})}render(){return this.feeItem?B`
4758
4765
  <div class="quantity-control ${this.disabled?"unavailable":""}">
4759
4766
  <button
4760
4767
  class="quantity-button"
@@ -4776,7 +4783,7 @@ xmlns="http://www.w3.org/2000/svg"
4776
4783
  <span class="operator-sign">+</span>
4777
4784
  </button>
4778
4785
  </div>
4779
- `:B``}};Yo.styles=qo,Vo([ue({type:Object})],Yo.prototype,"feeItem",void 0),Vo([ue()],Yo.prototype,"onQuantityChange",void 0),Vo([ue({type:Boolean,reflect:!0})],Yo.prototype,"disabled",void 0),Vo([ue({type:Number})],Yo.prototype,"quantity",void 0),Yo=Vo([se("table-addon-qty-selector")],Yo);let Ko=class extends oe{constructor(){super(...arguments),this.rentableItem=null,this._previousRentableItemType=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0,this.selectedItemIds=new Set}get totalAvailableItems(){var e,t,n;return null!==(n=null===(t=null===(e=this.rentableItem)||void 0===e?void 0:e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0}get maxSelectableItems(){return Math.min(this.totalAvailableItems,10)}get atMaxUnits(){return this.quantity>=this.maxSelectableItems}get atMinUnits(){return this.quantity<=0}updated(e){var t,n;if(e.has("rentableItem")){const e=null!==(n=null===(t=this.rentableItem)||void 0===t?void 0:t.type)&&void 0!==n?n:null;e!==this._previousRentableItemType&&(this.selectedItemIds=new Set,this._previousRentableItemType=e)}}handleIncrement(){this.disabled||this.atMaxUnits||this.emitChange(this.quantity+1)}handleDecrement(){this.disabled||this.atMinUnits||this.emitChange(Math.max(0,this.quantity-1))}emitChange(e){var t;this.rentableItem&&(null===(t=this.onQuantityChange)||void 0===t||t.call(this,{type:this.rentableItem.type,quantity:e}))}render(){if(!this.rentableItem)return B``;const e=this.totalAvailableItems>0,t=this.disabled||!e||this.atMaxUnits,n=this.disabled||this.quantity<=0;return B`
4786
+ `:B``}};Ko.styles=Vo,Yo([ue({type:Object})],Ko.prototype,"feeItem",void 0),Yo([ue()],Ko.prototype,"onQuantityChange",void 0),Yo([ue({type:Boolean,reflect:!0})],Ko.prototype,"disabled",void 0),Yo([ue({type:Number})],Ko.prototype,"quantity",void 0),Ko=Yo([se("table-addon-qty-selector")],Ko);let Xo=class extends oe{constructor(){super(...arguments),this.rentableItem=null,this._previousRentableItemType=null,this.onQuantityChange=null,this.disabled=!1,this.quantity=0,this.selectedItemIds=new Set}get totalAvailableItems(){var e,t,n;return null!==(n=null===(t=null===(e=this.rentableItem)||void 0===e?void 0:e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0}get maxSelectableItems(){return Math.min(this.totalAvailableItems,10)}get atMaxUnits(){return this.quantity>=this.maxSelectableItems}get atMinUnits(){return this.quantity<=0}updated(e){var t,n;if(e.has("rentableItem")){const e=null!==(n=null===(t=this.rentableItem)||void 0===t?void 0:t.type)&&void 0!==n?n:null;e!==this._previousRentableItemType&&(this.selectedItemIds=new Set,this._previousRentableItemType=e)}}handleIncrement(){this.disabled||this.atMaxUnits||this.emitChange(this.quantity+1)}handleDecrement(){this.disabled||this.atMinUnits||this.emitChange(Math.max(0,this.quantity-1))}emitChange(e){var t;this.rentableItem&&(null===(t=this.onQuantityChange)||void 0===t||t.call(this,{type:this.rentableItem.type,quantity:e}))}render(){if(!this.rentableItem)return B``;const e=this.totalAvailableItems>0,t=this.disabled||!e||this.atMaxUnits,n=this.disabled||this.quantity<=0;return B`
4780
4787
  <div
4781
4788
  class="quantity-control ${!e||this.disabled?"unavailable":""}"
4782
4789
  >
@@ -4800,7 +4807,7 @@ xmlns="http://www.w3.org/2000/svg"
4800
4807
  <span class="operator-sign">+</span>
4801
4808
  </button>
4802
4809
  </div>
4803
- `}};Ko.styles=qo,Vo([ue({type:Object})],Ko.prototype,"rentableItem",void 0),Vo([ue()],Ko.prototype,"onQuantityChange",void 0),Vo([ue({type:Boolean,reflect:!0})],Ko.prototype,"disabled",void 0),Vo([ue({type:Number})],Ko.prototype,"quantity",void 0),Vo([ue({type:Set})],Ko.prototype,"selectedItemIds",void 0),Ko=Vo([se("table-rentable-item-qty-selector")],Ko);var Xo=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 Zo=class extends oe{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.quantities=new Map,this.selectedRentableItemIds=new Map,this.handleAddonQuantityChange=e=>{var t;const n=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(n))?this.quantities.set(n,e.quantities):this.quantities.set(n,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,n,i,r,o,a;const s=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const l=this.addons.find(t=>t instanceof Qr&&t.type===e.type);if(!l)return;const u=null!==(n=this.selectedRentableItemIds.get(e.type))&&void 0!==n?n:new Set,c=(d=null!==(r=null===(i=l.allItems)||void 0===i?void 0:i.filter(e=>e.available))&&void 0!==r?r:[],[...d].sort((e,t)=>e.rent!==t.rent?e.rent-t.rent:e.id.localeCompare(t.id)));var d;if(e.quantity>s){const t=e.quantity-s;let n=0;const i=Math.min(c.length,10);if(u.size+t>i)return;for(const i of c){if(n>=t)break;u.has(i.id)||(u.add(i.id),null===(o=this.onRentableItemAdd)||void 0===o||o.call(this,{id:i.id,type:e.type}),n++)}}else if(e.quantity<s){const t=s-e.quantity;let n=0;const i=function(e){return[...e].sort((e,t)=>e.rent!==t.rent?t.rent-e.rent:t.id.localeCompare(e.id))}(c.filter(e=>u.has(e.id)));for(const r of i){if(n>=t)break;u.delete(r.id),null===(a=this.onRentableItemRemove)||void 0===a||a.call(this,{id:r.id,type:e.type}),n++}}this.selectedRentableItemIds.set(e.type,u),this.requestUpdate("selectedRentableItemIds")}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}preserveExistingQuantity(e,t){const n=this.quantities.get(e);return null!=n?n:t}initializeRentableItemQuantity(e,t){const n=this.preserveExistingQuantity(e.type,0);t.set(e.type,n),this.selectedRentableItemIds.has(e.type)||this.selectedRentableItemIds.set(e.type,new Set)}initializeBuildingFeeQuantity(e,t){const n=e.id,i=this.preserveExistingQuantity(n,0);t.set(n,i)}initializeQuantities(){const e=new Map;this.addons.forEach(t=>{t instanceof Qr?this.initializeRentableItemQuantity(t,e):this.initializeBuildingFeeQuantity(t,e)}),this.quantities=e}getName(e){return e instanceof Qr?e.displayName:e.fee_name}getSortedAddons(){return[...this.addons].sort((e,t)=>{const n=this.getName(e),i=this.getName(t);return n.localeCompare(i,navigator.language,{numeric:!0})})}isRentableItemAvailable(e){var t,n;return!(e instanceof Qr)||(null!==(n=null===(t=e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0)>0}renderQtySelector(e){var t;if(e instanceof Qr){const n=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;return B`
4810
+ `}};Xo.styles=Vo,Yo([ue({type:Object})],Xo.prototype,"rentableItem",void 0),Yo([ue()],Xo.prototype,"onQuantityChange",void 0),Yo([ue({type:Boolean,reflect:!0})],Xo.prototype,"disabled",void 0),Yo([ue({type:Number})],Xo.prototype,"quantity",void 0),Yo([ue({type:Set})],Xo.prototype,"selectedItemIds",void 0),Xo=Yo([se("table-rentable-item-qty-selector")],Xo);var Zo=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 Jo=class extends oe{constructor(){super(...arguments),this._addons=[],this.disabled=!1,this.onAddonSelect=null,this.onRentableItemAdd=null,this.onRentableItemRemove=null,this.quantities=new Map,this.selectedRentableItemIds=new Map,this.handleAddonQuantityChange=e=>{var t;const n=e.id;1!==e.quantities.length||Array.isArray(this.quantities.get(n))?this.quantities.set(n,e.quantities):this.quantities.set(n,e.quantities[0].quantity),this.requestUpdate("quantities"),null===(t=this.onAddonSelect)||void 0===t||t.call(this,e)},this.handleRentableItemQuantityChange=e=>{var t,n,i,r,o,a;const s=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;this.quantities.set(e.type,e.quantity),this.requestUpdate("quantities");const l=this.addons.find(t=>t instanceof Wr&&t.type===e.type);if(!l)return;const u=null!==(n=this.selectedRentableItemIds.get(e.type))&&void 0!==n?n:new Set,c=(d=null!==(r=null===(i=l.allItems)||void 0===i?void 0:i.filter(e=>e.available))&&void 0!==r?r:[],[...d].sort((e,t)=>e.rent!==t.rent?e.rent-t.rent:e.id.localeCompare(t.id)));var d;if(e.quantity>s){const t=e.quantity-s;let n=0;const i=Math.min(c.length,10);if(u.size+t>i)return;for(const i of c){if(n>=t)break;u.has(i.id)||(u.add(i.id),null===(o=this.onRentableItemAdd)||void 0===o||o.call(this,{id:i.id,type:e.type}),n++)}}else if(e.quantity<s){const t=s-e.quantity;let n=0;const i=function(e){return[...e].sort((e,t)=>e.rent!==t.rent?t.rent-e.rent:t.id.localeCompare(e.id))}(c.filter(e=>u.has(e.id)));for(const r of i){if(n>=t)break;u.delete(r.id),null===(a=this.onRentableItemRemove)||void 0===a||a.call(this,{id:r.id,type:e.type}),n++}}this.selectedRentableItemIds.set(e.type,u),this.requestUpdate("selectedRentableItemIds")}}set addons(e){const t=this._addons;this._addons=e,e!==t&&this.initializeQuantities(),this.requestUpdate("addons",t)}get addons(){return this._addons}preserveExistingQuantity(e,t){const n=this.quantities.get(e);return null!=n?n:t}initializeRentableItemQuantity(e,t){const n=this.preserveExistingQuantity(e.type,0);t.set(e.type,n),this.selectedRentableItemIds.has(e.type)||this.selectedRentableItemIds.set(e.type,new Set)}initializeBuildingFeeQuantity(e,t){const n=e.id,i=this.preserveExistingQuantity(n,0);t.set(n,i)}initializeQuantities(){const e=new Map;this.addons.forEach(t=>{t instanceof Wr?this.initializeRentableItemQuantity(t,e):this.initializeBuildingFeeQuantity(t,e)}),this.quantities=e}getName(e){return e instanceof Wr?e.displayName:e.fee_name}getSortedAddons(){return[...this.addons].sort((e,t)=>{const n=this.getName(e),i=this.getName(t);return n.localeCompare(i,navigator.language,{numeric:!0})})}isRentableItemAvailable(e){var t,n;return!(e instanceof Wr)||(null!==(n=null===(t=e.allItems)||void 0===t?void 0:t.filter(e=>e.available).length)&&void 0!==n?n:0)>0}renderQtySelector(e){var t;if(e instanceof Wr){const n=null!==(t=this.quantities.get(e.type))&&void 0!==t?t:0;return B`
4804
4811
  <table-rentable-item-qty-selector
4805
4812
  .rentableItem=${e}
4806
4813
  .quantity=${n}
@@ -4841,7 +4848,7 @@ xmlns="http://www.w3.org/2000/svg"
4841
4848
  </tbody>
4842
4849
  </table>
4843
4850
  </div>
4844
- `:B`<div class="empty-state">No add-ons available</div> `}};Zo.styles=Go,Xo([ue({type:Array})],Zo.prototype,"addons",null),Xo([ue({type:Boolean})],Zo.prototype,"disabled",void 0),Xo([ue()],Zo.prototype,"onAddonSelect",void 0),Xo([ue({attribute:!1})],Zo.prototype,"onRentableItemAdd",void 0),Xo([ue({attribute:!1})],Zo.prototype,"onRentableItemRemove",void 0),Xo([ce()],Zo.prototype,"quantities",void 0),Xo([ce()],Zo.prototype,"selectedRentableItemIds",void 0),Zo=Xo([se("addon-table")],Zo);var Jo=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 ea=class extends oe{constructor(){super(...arguments),this.id="",this.showChatAdditionalActions=!1,this.buildingWebchatView=null,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this.enabledChatWidgets={callDesktop:!1,chatDesktop:!1,emailDesktop:!1,textDesktop:!1,sstDesktop:!1},this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClose=()=>{}}render(){const e=this.primaryColor||Ue,t=this.backgroundColor||"#ffffff",n=this.buildingWebchatView&&He(this.buildingWebchatView.orgId,this.buildingWebchatView.id)&&e!==Ue?Fe(e,.6):"black";return B`
4851
+ `:B`<div class="empty-state">No add-ons available</div> `}};Jo.styles=Qo,Zo([ue({type:Array})],Jo.prototype,"addons",null),Zo([ue({type:Boolean})],Jo.prototype,"disabled",void 0),Zo([ue()],Jo.prototype,"onAddonSelect",void 0),Zo([ue({attribute:!1})],Jo.prototype,"onRentableItemAdd",void 0),Zo([ue({attribute:!1})],Jo.prototype,"onRentableItemRemove",void 0),Zo([ce()],Jo.prototype,"quantities",void 0),Zo([ce()],Jo.prototype,"selectedRentableItemIds",void 0),Jo=Zo([se("addon-table")],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.id="",this.showChatAdditionalActions=!1,this.buildingWebchatView=null,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this.enabledChatWidgets={callDesktop:!1,chatDesktop:!1,emailDesktop:!1,textDesktop:!1,sstDesktop:!1},this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClose=()=>{}}render(){const e=this.primaryColor||Ue,t=this.backgroundColor||"#ffffff",n=this.buildingWebchatView&&He(this.buildingWebchatView.orgId,this.buildingWebchatView.id)&&e!==Ue?Fe(e,.6):"black";return B`
4845
4852
  <style>
4846
4853
  #${this.id}::after {
4847
4854
  border-right-color: ${n} !important;
@@ -4873,7 +4880,7 @@ xmlns="http://www.w3.org/2000/svg"
4873
4880
  .onClick=${this.onClose}
4874
4881
  ></minimize-expand-button>
4875
4882
  </div>
4876
- `}};ea.styles=u`
4883
+ `}};ta.styles=u`
4877
4884
  .hideTab {
4878
4885
  display: none;
4879
4886
  }
@@ -4883,7 +4890,7 @@ xmlns="http://www.w3.org/2000/svg"
4883
4890
  justify-content: space-between;
4884
4891
  gap: 32px;
4885
4892
  }
4886
- `,Jo([ue({type:String})],ea.prototype,"id",void 0),Jo([ue({type:Boolean})],ea.prototype,"showChatAdditionalActions",void 0),Jo([ue({type:Object})],ea.prototype,"buildingWebchatView",void 0),Jo([ue({type:String})],ea.prototype,"primaryColor",void 0),Jo([ue({type:String})],ea.prototype,"backgroundColor",void 0),Jo([ue({type:String})],ea.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Jo([ue({type:String})],ea.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Jo([ue({type:Object})],ea.prototype,"enabledChatWidgets",void 0),Jo([ue({attribute:!0})],ea.prototype,"onClickMinimize",void 0),Jo([ue({attribute:!0})],ea.prototype,"onClickEmailOption",void 0),Jo([ue({attribute:!0})],ea.prototype,"onClickPhoneOption",void 0),Jo([ue({attribute:!0})],ea.prototype,"onClickSSTOption",void 0),Jo([ue({attribute:!0})],ea.prototype,"onClose",void 0),ea=Jo([se("chat-additional-actions")],ea);const ta=u`
4893
+ `,ea([ue({type:String})],ta.prototype,"id",void 0),ea([ue({type:Boolean})],ta.prototype,"showChatAdditionalActions",void 0),ea([ue({type:Object})],ta.prototype,"buildingWebchatView",void 0),ea([ue({type:String})],ta.prototype,"primaryColor",void 0),ea([ue({type:String})],ta.prototype,"backgroundColor",void 0),ea([ue({type:String})],ta.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),ea([ue({type:String})],ta.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),ea([ue({type:Object})],ta.prototype,"enabledChatWidgets",void 0),ea([ue({attribute:!0})],ta.prototype,"onClickMinimize",void 0),ea([ue({attribute:!0})],ta.prototype,"onClickEmailOption",void 0),ea([ue({attribute:!0})],ta.prototype,"onClickPhoneOption",void 0),ea([ue({attribute:!0})],ta.prototype,"onClickSSTOption",void 0),ea([ue({attribute:!0})],ta.prototype,"onClose",void 0),ta=ea([se("chat-additional-actions")],ta);const na=u`
4887
4894
  :host {
4888
4895
  display: block;
4889
4896
  }
@@ -4920,9 +4927,9 @@ xmlns="http://www.w3.org/2000/svg"
4920
4927
  font-size: 0.9rem;
4921
4928
  opacity: 0.9;
4922
4929
  }
4923
- `;var na=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 ia=class extends oe{getFormattedEndDate(e){return new Date(e.endDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}render(){return this.incentive?B`
4930
+ `;var ia=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 ra=class extends oe{getFormattedEndDate(e){return new Date(e.endDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}render(){return this.incentive?B`
4924
4931
  <div class="incentive-banner">
4925
- <div class="incentive-icon">${ao({size:32})}</div>
4932
+ <div class="incentive-icon">${so({size:32})}</div>
4926
4933
  <div class="incentive-content">
4927
4934
  <h2 class="incentive-title">
4928
4935
  ${this.incentive.originalIncentiveString}
@@ -4933,7 +4940,7 @@ xmlns="http://www.w3.org/2000/svg"
4933
4940
  </p>
4934
4941
  </div>
4935
4942
  </div>
4936
- `:B``}};ia.styles=ta,na([ue({type:Object})],ia.prototype,"incentive",void 0),ia=na([se("incentive-banner")],ia);var ra=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 oa=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Ue,this.backgroundColor=Re,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[eo],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={[Wr.ONE_TIME]:[],[Wr.MONTHLY]:[],[Wr.WEEKLY]:[],[Wr.BI_WEEKLY]:[],[Wr.ANNUALLY]:[],[Wr.DAILY]:[],[Wr.AS_NEEDED]:[],[Wr.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 Promise.allSettled([this.setupCalculator(),this.fetchUnits()])},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return void(this.isLoadingLayouts=!1);const e=Ui(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=Jr(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},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.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||Wr.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&&(ai("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(eo)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await oo({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(Rn(this.moveInDateString),Rn(this.selectedUnit.earliestAvailable))?this.selectedUnit.earliestAvailable:this.moveInDateString,n=this.selectedUnit.id,i=this.leaseTerm;try{const r=await no({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&&ai("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,Ai({logType:xi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e}}))}finally{e.aborted||(this.isCalculatingQuote=!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.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return B`
4943
+ `:B``}};ra.styles=na,ia([ue({type:Object})],ra.prototype,"incentive",void 0),ra=ia([se("incentive-banner")],ra);var oa=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 aa=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.primaryColor=Ue,this.backgroundColor=Re,this.onCloseClicked=null,this.onClickEmailOption=null,this.onClickPhoneOption=null,this.onClickSSTOption=null,this.onClickTextUsOption=null,this.isCalculatingQuote=!1,this.isLoadingLayouts=!0,this.isExporting=!1,this.selectedLayoutIds=[to],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={[qr.ONE_TIME]:[],[qr.MONTHLY]:[],[qr.WEEKLY]:[],[qr.BI_WEEKLY]:[],[qr.ANNUALLY]:[],[qr.DAILY]:[],[qr.AS_NEEDED]:[],[qr.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 Promise.allSettled([this.setupCalculator(),this.fetchUnits()])},this.setupCalculator=async()=>{if(!this.buildingSlug||!this.orgSlug)return void(this.isLoadingLayouts=!1);const e=Ui(this.orgSlug,this.buildingSlug).then(e=>{e&&(this.buildingWebchatView=e)}).finally(()=>{this.isLoadingLayouts=!1}),t=eo(this.buildingSlug).then(e=>{e&&(this.groupedFees=this.groupFees(e.fees),this.rentableItems=e.rentableItems)});await Promise.allSettled([e,t])},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.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||qr.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&&(ai("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(to)||(e=this.selectedLayoutIds.map(e=>{return 0===(t=e)?0:Math.floor(t/10);var t}));try{if(this.units=await ao({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(Rn(this.moveInDateString),Rn(this.selectedUnit.earliestAvailable))?this.selectedUnit.earliestAvailable:this.moveInDateString,n=this.selectedUnit.id,i=this.leaseTerm;try{const r=await io({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&&ai("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,Ai({logType:xi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_CALCULATING_QUOTE]",logData:{error:e}}))}finally{e.aborted||(this.isCalculatingQuote=!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.isExporting||this.isCalculatingQuote||!this.selectedUnit||!this.moveInDateString||!this.pdfUrl;return B`
4937
4944
  <div
4938
4945
  class="fee-calculator-container"
4939
4946
  @keydown=${e=>e.stopPropagation()}
@@ -4965,7 +4972,7 @@ xmlns="http://www.w3.org/2000/svg"
4965
4972
  class="close-button"
4966
4973
  @click=${this.handleClose}
4967
4974
  >
4968
- ${io("gray")}
4975
+ ${ro("gray")}
4969
4976
  </button>
4970
4977
  </div>
4971
4978
  </div>
@@ -5013,7 +5020,7 @@ xmlns="http://www.w3.org/2000/svg"
5013
5020
  </div>
5014
5021
  `:""}
5015
5022
  </div>
5016
- `}};oa.styles=zr,ra([ue({attribute:!0})],oa.prototype,"buildingSlug",void 0),ra([ue({attribute:!0})],oa.prototype,"orgSlug",void 0),ra([ue({type:String})],oa.prototype,"primaryColor",void 0),ra([ue({type:String})],oa.prototype,"backgroundColor",void 0),ra([ue()],oa.prototype,"onCloseClicked",void 0),ra([ue()],oa.prototype,"onClickEmailOption",void 0),ra([ue()],oa.prototype,"onClickPhoneOption",void 0),ra([ue()],oa.prototype,"onClickSSTOption",void 0),ra([ue()],oa.prototype,"onClickTextUsOption",void 0),ra([ce()],oa.prototype,"isCalculatingQuote",void 0),ra([ce()],oa.prototype,"isLoadingLayouts",void 0),ra([ce()],oa.prototype,"isExporting",void 0),ra([ce()],oa.prototype,"selectedLayoutIds",void 0),ra([ce()],oa.prototype,"selectedUnit",void 0),ra([ce()],oa.prototype,"chargeInputs",void 0),ra([ce()],oa.prototype,"desiredRentableItems",void 0),ra([ce()],oa.prototype,"moveInDateString",void 0),ra([ce()],oa.prototype,"leaseTerm",void 0),ra([ce()],oa.prototype,"buildingWebchatView",void 0),ra([ce()],oa.prototype,"incentives",void 0),ra([ce()],oa.prototype,"quote",void 0),ra([ce()],oa.prototype,"pdfUrl",void 0),ra([ce()],oa.prototype,"groupedFees",void 0),ra([ce()],oa.prototype,"rentableItems",void 0),ra([ce()],oa.prototype,"units",void 0),ra([ce()],oa.prototype,"isLoadingUnits",void 0),oa=ra([se("fee-calculator")],oa);const aa=u`
5023
+ `}};aa.styles=Gr,oa([ue({attribute:!0})],aa.prototype,"buildingSlug",void 0),oa([ue({attribute:!0})],aa.prototype,"orgSlug",void 0),oa([ue({type:String})],aa.prototype,"primaryColor",void 0),oa([ue({type:String})],aa.prototype,"backgroundColor",void 0),oa([ue()],aa.prototype,"onCloseClicked",void 0),oa([ue()],aa.prototype,"onClickEmailOption",void 0),oa([ue()],aa.prototype,"onClickPhoneOption",void 0),oa([ue()],aa.prototype,"onClickSSTOption",void 0),oa([ue()],aa.prototype,"onClickTextUsOption",void 0),oa([ce()],aa.prototype,"isCalculatingQuote",void 0),oa([ce()],aa.prototype,"isLoadingLayouts",void 0),oa([ce()],aa.prototype,"isExporting",void 0),oa([ce()],aa.prototype,"selectedLayoutIds",void 0),oa([ce()],aa.prototype,"selectedUnit",void 0),oa([ce()],aa.prototype,"chargeInputs",void 0),oa([ce()],aa.prototype,"desiredRentableItems",void 0),oa([ce()],aa.prototype,"moveInDateString",void 0),oa([ce()],aa.prototype,"leaseTerm",void 0),oa([ce()],aa.prototype,"buildingWebchatView",void 0),oa([ce()],aa.prototype,"incentives",void 0),oa([ce()],aa.prototype,"quote",void 0),oa([ce()],aa.prototype,"pdfUrl",void 0),oa([ce()],aa.prototype,"groupedFees",void 0),oa([ce()],aa.prototype,"rentableItems",void 0),oa([ce()],aa.prototype,"units",void 0),oa([ce()],aa.prototype,"isLoadingUnits",void 0),aa=oa([se("fee-calculator")],aa);const sa=u`
5017
5024
  #minimize-mobile {
5018
5025
  position: absolute;
5019
5026
  top: -12px;
@@ -5062,9 +5069,9 @@ xmlns="http://www.w3.org/2000/svg"
5062
5069
  justify-content: center;
5063
5070
  align-items: center;
5064
5071
  }
5065
- `,sa=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
5072
+ `,la=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14" viewBox="0 0 16 14" fill="none">
5066
5073
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6.46964 0.488343H9.53036C10.898 0.488331 11.9813 0.488321 12.829 0.602304C13.7015 0.719609 14.4077 0.966767 14.9647 1.52369C15.5216 2.08061 15.7687 2.78681 15.886 3.65932C16 4.50711 16 5.59038 16 6.95802V7.04198C16 8.40962 16 9.49289 15.886 10.3407C15.7687 11.2132 15.5216 11.9194 14.9647 12.4763C14.4077 13.0332 13.7015 13.2804 12.829 13.3977C11.9813 13.5117 10.898 13.5117 9.53035 13.5117H6.46965C5.10201 13.5117 4.01875 13.5117 3.17096 13.3977C2.29846 13.2804 1.59227 13.0332 1.03534 12.4763C0.478423 11.9194 0.231266 11.2132 0.113961 10.3407C-2.09587e-05 9.49289 -1.15596e-05 8.40962 2.39342e-07 7.04198V6.95801C-1.15596e-05 5.59037 -2.09587e-05 4.50711 0.113961 3.65932C0.231266 2.78681 0.478423 2.08061 1.03534 1.52369C1.59227 0.966767 2.29846 0.719609 3.17096 0.602304C4.01875 0.488321 5.10201 0.488331 6.46964 0.488343ZM3.3197 1.70863C2.57098 1.8093 2.13962 1.99807 1.82467 2.31302C1.50973 2.62797 1.32095 3.05934 1.22029 3.80806C1.11746 4.57283 1.11628 5.58096 1.11628 7C1.11628 8.41903 1.11746 9.42716 1.22029 10.1919C1.32095 10.9407 1.50973 11.372 1.82467 11.687C2.13962 12.0019 2.57098 12.1907 3.3197 12.2914C4.08447 12.3942 5.0926 12.3954 6.51163 12.3954H9.48837C10.9074 12.3954 11.9155 12.3942 12.6803 12.2914C13.429 12.1907 13.8604 12.0019 14.1753 11.687C14.4903 11.372 14.6791 10.9407 14.7797 10.1919C14.8825 9.42716 14.8837 8.41903 14.8837 7C14.8837 5.58096 14.8825 4.57283 14.7797 3.80806C14.6791 3.05934 14.4903 2.62797 14.1753 2.31302C13.8604 1.99807 13.429 1.8093 12.6803 1.70863C11.9155 1.60581 10.9074 1.60463 9.48837 1.60463H6.51163C5.0926 1.60463 4.08448 1.60581 3.3197 1.70863ZM3.10611 3.66593C3.30345 3.42912 3.65539 3.39713 3.8922 3.59446L5.49882 4.93332C6.19311 5.5119 6.67515 5.9123 7.08211 6.17404C7.47605 6.42741 7.7432 6.51246 8 6.51246C8.2568 6.51246 8.52395 6.42741 8.91789 6.17404C9.32485 5.9123 9.80689 5.5119 10.5012 4.93332L12.1078 3.59446C12.3446 3.39713 12.6966 3.42912 12.8939 3.66593C13.0912 3.90273 13.0592 4.25468 12.8224 4.45202L11.1878 5.81419C10.5282 6.36389 9.99359 6.80943 9.52173 7.11291C9.0302 7.42904 8.5515 7.62875 8 7.62875C7.4485 7.62875 6.9698 7.42904 6.47827 7.11291C6.00641 6.80943 5.47179 6.36389 4.81218 5.81419L3.17757 4.45202C2.94077 4.25468 2.90877 3.90273 3.10611 3.66593Z" fill="${e}"/>
5067
- </svg>`,la=(e="black")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
5074
+ </svg>`,ua=(e="black")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="18" viewBox="0 0 16 18" fill="none">
5068
5075
  <path d="M15.6825 6.11855H0.00653076C0.0588276 4.00052 1.79117 2.30087 3.92226 2.30087H4.41255V3.6083C4.41255 3.88285 4.63481 4.09858 4.90283 4.09858C5.17085 4.09858 5.39311 3.88285 5.39311 3.6083V2.30087H10.2959V3.6083C10.2959 3.88285 10.5182 4.09858 10.7862 4.09858C11.0542 4.09858 11.2765 3.88285 11.2765 3.6083V2.30087H11.7668C13.8979 2.30087 15.6302 4.00052 15.6825 6.11855Z" fill="${e}"/>
5069
5076
  <path d="M15.0641 7.39731V14.0677C15.0641 15.8922 13.5861 17.365 11.7668 17.365H3.92227C2.10298 17.365 0.625 15.8922 0.625 14.0677V7.39731H15.0641Z" fill="transparent" stroke="${e}" stroke-width="1.25"/>
5070
5077
  <path d="M4.90283 1V2.30742" stroke="${e}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -5072,14 +5079,14 @@ xmlns="http://www.w3.org/2000/svg"
5072
5079
  <path d="M0 6.11862H0.00653352C-3.5908e-06 6.15131 0 6.19053 0 6.22322V6.11862Z" fill="white"/>
5073
5080
  <path d="M15.689 6.11862V6.22322C15.689 6.19053 15.689 6.15131 15.6825 6.11862H15.689Z" fill="white"/>
5074
5081
  <path d="M4.74594 11.9562L6.56326 13.7735C6.8182 14.0285 7.23004 14.0285 7.48499 13.7735L10.9366 10.3219" stroke="${e}" stroke-miterlimit="10" stroke-linecap="round"/>
5075
- </svg>`,ua=(e="white")=>j`
5082
+ </svg>`,ca=(e="white")=>j`
5076
5083
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
5077
5084
  <path
5078
5085
  fill-rule="evenodd"
5079
5086
  clip-rule="evenodd"
5080
5087
  d="M6.64026 0.25H8.8598C10.0157 0.249995 10.9219 0.249992 11.6459 0.318826C12.3838 0.388987 12.988 0.534458 13.5206 0.860861C14.0784 1.20267 14.5474 1.67164 14.8892 2.22942C15.2156 2.76206 15.3611 3.36627 15.4312 4.10419C15.5001 4.82813 15.5001 5.73432 15.5001 6.89025V7.65964C15.5001 8.48243 15.5001 9.12755 15.4645 9.64868C15.4283 10.1789 15.3535 10.6202 15.1845 11.0283C14.7638 12.044 13.9568 12.851 12.9411 13.2717C12.3607 13.5121 11.6997 13.5654 10.7947 13.581C10.4782 13.5865 10.2777 13.5905 10.1248 13.6074C9.98202 13.6232 9.92665 13.6464 9.89426 13.6652C9.86008 13.6851 9.81351 13.7213 9.73267 13.8323C9.64518 13.9523 9.54632 14.1182 9.38955 14.3831L8.99874 15.0433C8.44104 15.9856 7.05899 15.9856 6.5013 15.0433L6.11048 14.3831C5.95371 14.1182 5.85485 13.9523 5.76736 13.8323C5.68652 13.7213 5.63995 13.6851 5.60577 13.6652C5.57338 13.6464 5.51801 13.6232 5.37519 13.6074C5.22235 13.5905 5.02184 13.5865 4.70528 13.581C3.80031 13.5654 3.13933 13.5121 2.559 13.2717C1.54327 12.851 0.736277 12.044 0.315547 11.0283C0.146515 10.6202 0.0717299 10.1789 0.0355529 9.64868C-4.05001e-06 9.12754 -2.20251e-06 8.48243 1.60891e-07 7.65963L7.4949e-08 6.89026C-4.52294e-06 5.73432 -8.08928e-06 4.82814 0.0688256 4.10419C0.138987 3.36627 0.284458 2.76206 0.610861 2.22942C0.95267 1.67164 1.42164 1.20267 1.97942 0.860861C2.51206 0.534458 3.11627 0.388987 3.85419 0.318826C4.57814 0.249992 5.48432 0.249995 6.64026 0.25ZM3.95654 1.39537C3.29779 1.458 2.87862 1.57812 2.54445 1.78291C2.13217 2.03555 1.78555 2.38217 1.53291 2.79445C1.32812 3.12862 1.208 3.54779 1.14537 4.20654C1.08197 4.87334 1.0814 5.7282 1.0814 6.91863V7.63956C1.0814 8.48674 1.08169 9.09505 1.11444 9.57507C1.14686 10.0502 1.20927 10.3601 1.31463 10.6144C1.6256 11.3652 2.22208 11.9617 2.97284 12.2726C3.34458 12.4266 3.81883 12.4842 4.72391 12.4998L4.74685 12.5002C5.03378 12.5051 5.28522 12.5094 5.49421 12.5326C5.71878 12.5574 5.9384 12.6077 6.14946 12.7304C6.35874 12.8522 6.50969 13.0148 6.64128 13.1953C6.76287 13.3622 6.88783 13.5733 7.02936 13.8124L7.4319 14.4925C7.57086 14.7273 7.92917 14.7273 8.06813 14.4925L8.47067 13.8124C8.6122 13.5733 8.73716 13.3622 8.85875 13.1953C8.99034 13.0148 9.14129 12.8522 9.35057 12.7304C9.56163 12.6077 9.78126 12.5574 10.0058 12.5326C10.2148 12.5094 10.4662 12.5051 10.7532 12.5002L10.7761 12.4998C11.6812 12.4842 12.1555 12.4266 12.5272 12.2726C13.278 11.9617 13.8745 11.3652 14.1854 10.6144C14.2908 10.3601 14.3532 10.0502 14.3856 9.57507C14.4184 9.09505 14.4187 8.48674 14.4187 7.63956V6.91863C14.4187 5.7282 14.4181 4.87334 14.3547 4.20654C14.2921 3.54779 14.1719 3.12862 13.9672 2.79445C13.7145 2.38217 13.3679 2.03555 12.9556 1.78291C12.6214 1.57812 12.2023 1.458 11.5435 1.39537C10.8767 1.33197 10.0219 1.3314 8.83143 1.3314H6.66863C5.4782 1.3314 4.62334 1.33197 3.95654 1.39537ZM7.75003 3.85467C8.04865 3.85467 8.29073 4.09674 8.29073 4.39536V10.1628C8.29073 10.4614 8.04865 10.7035 7.75003 10.7035C7.45141 10.7035 7.20933 10.4614 7.20933 10.1628V4.39536C7.20933 4.09674 7.45141 3.85467 7.75003 3.85467ZM4.8663 5.29653C5.16492 5.29653 5.407 5.53861 5.407 5.83723V8.72096C5.407 9.01958 5.16492 9.26166 4.8663 9.26166C4.56768 9.26166 4.3256 9.01958 4.3256 8.72096V5.83723C4.3256 5.53861 4.56768 5.29653 4.8663 5.29653ZM10.6338 5.29653C10.9324 5.29653 11.1745 5.53861 11.1745 5.83723V8.72096C11.1745 9.01958 10.9324 9.26166 10.6338 9.26166C10.3351 9.26166 10.0931 9.01958 10.0931 8.72096V5.83723C10.0931 5.53861 10.3351 5.29653 10.6338 5.29653Z"
5081
5088
  fill="${e}"/>
5082
- </svg>`,ca=(e="white")=>j`<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
5089
+ </svg>`,da=(e="white")=>j`<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
5083
5090
  <g clip-path="url(#clip0_18382_27345)">
5084
5091
  <g clip-path="url(#clip1_18382_27345)">
5085
5092
  <path d="M9.91666 0.625V3.45833C9.91666 3.6462 9.99128 3.82636 10.1241 3.9592C10.257 4.09204 10.4371 4.16667 10.625 4.16667H13.4583" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
@@ -5096,7 +5103,7 @@ xmlns="http://www.w3.org/2000/svg"
5096
5103
  </clipPath>
5097
5104
  </defs>
5098
5105
  </svg>
5099
- `,da=(e="white",t=20,n=-2)=>j`
5106
+ `,ha=(e="white",t=20,n=-2)=>j`
5100
5107
  <svg
5101
5108
  width="${t}"
5102
5109
  height="${t}"
@@ -5169,7 +5176,7 @@ xmlns="http://www.w3.org/2000/svg"
5169
5176
  </clipPath>
5170
5177
  </defs>
5171
5178
  </svg>
5172
- `;var ha=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 pa=class extends oe{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClickApplyNowOption=()=>{},this.onClickPriceCalculatorOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobileDesign=!1,this.primaryColor=Ue,this.backgroundColor=Re,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasCallUsEnabled=!1,this.hasTextUsEnabled=!1,this.hasSSTEnabled=!1,this.hasApplyNowEnabled=!1,this.hasPricingCalculatorEnabled=!1,this.applicationLink="",this.overrideRentgrata=!1,this.foregroundColorOnSecondaryBackgroundColor="black",this.renderListElement=(e,t,n,i)=>e?B` <li>
5179
+ `;var pa=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 fa=class extends oe{constructor(){super(...arguments),this.onClickMinimize=()=>{},this.onClickEmailOption=()=>{},this.onClickPhoneOption=()=>{},this.onClickSSTOption=()=>{},this.onClickApplyNowOption=()=>{},this.onClickPriceCalculatorOption=()=>{},this.onChatTapped=()=>{},this.hideChat=!1,this.isMobileDesign=!1,this.primaryColor=Ue,this.backgroundColor=Re,this.hasChatEnabled=!1,this.hasEmailEnabled=!1,this.hasCallUsEnabled=!1,this.hasTextUsEnabled=!1,this.hasSSTEnabled=!1,this.hasApplyNowEnabled=!1,this.hasPricingCalculatorEnabled=!1,this.applicationLink="",this.overrideRentgrata=!1,this.foregroundColorOnSecondaryBackgroundColor="black",this.renderListElement=(e,t,n,i)=>e?B` <li>
5173
5180
  <button
5174
5181
  @click=${t}
5175
5182
  class="typeMobile-bttn"
@@ -5185,12 +5192,12 @@ xmlns="http://www.w3.org/2000/svg"
5185
5192
  </button>
5186
5193
  </li>`:""}render(){return B`<div class="typeMobile-list">
5187
5194
  <ul>
5188
- ${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,ca(this.foregroundColorOnSecondaryBackgroundColor),"Apply now")}
5189
- ${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,da("black"),"Price calculator")}
5190
- ${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,sa(this.foregroundColorOnSecondaryBackgroundColor),"Email us")}
5191
- ${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,Ur(this.foregroundColorOnSecondaryBackgroundColor),"Call or text us")}
5192
- ${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,la(this.foregroundColorOnSecondaryBackgroundColor),"Book a tour")}
5193
- ${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,ua(this.foregroundColorOnSecondaryBackgroundColor),"Chat with us")}
5195
+ ${this.renderListElement(!(!this.hasApplyNowEnabled||!this.applicationLink),this.onClickApplyNowOption,da(this.foregroundColorOnSecondaryBackgroundColor),"Apply now")}
5196
+ ${this.renderListElement(this.hasPricingCalculatorEnabled,this.onClickPriceCalculatorOption,ha("black"),"Price calculator")}
5197
+ ${this.renderListElement(this.hasEmailEnabled,this.onClickEmailOption,la(this.foregroundColorOnSecondaryBackgroundColor),"Email us")}
5198
+ ${this.renderListElement(this.hasCallUsEnabled||this.hasTextUsEnabled,this.onClickPhoneOption,Rr(this.foregroundColorOnSecondaryBackgroundColor),"Call or text us")}
5199
+ ${this.renderListElement(this.hasSSTEnabled,this.onClickSSTOption,ua(this.foregroundColorOnSecondaryBackgroundColor),"Book a tour")}
5200
+ ${this.renderListElement(this.hasChatEnabled&&!this.hideChat,this.onChatTapped,ca(this.foregroundColorOnSecondaryBackgroundColor),"Chat with us")}
5194
5201
  ${this.isMobileDesign||this.hideChat?"":B`
5195
5202
  <li>
5196
5203
  <minimize-expand-button
@@ -5201,20 +5208,20 @@ xmlns="http://www.w3.org/2000/svg"
5201
5208
  </li>
5202
5209
  `}
5203
5210
  </ul>
5204
- </div>`}};pa.styles=[aa],ha([ue({attribute:!0})],pa.prototype,"onClickMinimize",void 0),ha([ue({attribute:!0})],pa.prototype,"onClickEmailOption",void 0),ha([ue({attribute:!0})],pa.prototype,"onClickPhoneOption",void 0),ha([ue({attribute:!0})],pa.prototype,"onClickSSTOption",void 0),ha([ue({attribute:!0})],pa.prototype,"onClickApplyNowOption",void 0),ha([ue({attribute:!0})],pa.prototype,"onClickPriceCalculatorOption",void 0),ha([ue({attribute:!0})],pa.prototype,"onChatTapped",void 0),ha([ue({attribute:!0})],pa.prototype,"hideChat",void 0),ha([ue({attribute:!0})],pa.prototype,"isMobileDesign",void 0),ha([ue({attribute:!0})],pa.prototype,"primaryColor",void 0),ha([ue({attribute:!0})],pa.prototype,"backgroundColor",void 0),ha([ue({attribute:!0})],pa.prototype,"hasChatEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasEmailEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasCallUsEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasTextUsEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasSSTEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasApplyNowEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"hasPricingCalculatorEnabled",void 0),ha([ue({attribute:!0})],pa.prototype,"applicationLink",void 0),ha([ue({attribute:!0})],pa.prototype,"overrideRentgrata",void 0),ha([ue({attribute:!0})],pa.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),pa=ha([se("mobile-launcher")],pa);const fa=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
5211
+ </div>`}};fa.styles=[sa],pa([ue({attribute:!0})],fa.prototype,"onClickMinimize",void 0),pa([ue({attribute:!0})],fa.prototype,"onClickEmailOption",void 0),pa([ue({attribute:!0})],fa.prototype,"onClickPhoneOption",void 0),pa([ue({attribute:!0})],fa.prototype,"onClickSSTOption",void 0),pa([ue({attribute:!0})],fa.prototype,"onClickApplyNowOption",void 0),pa([ue({attribute:!0})],fa.prototype,"onClickPriceCalculatorOption",void 0),pa([ue({attribute:!0})],fa.prototype,"onChatTapped",void 0),pa([ue({attribute:!0})],fa.prototype,"hideChat",void 0),pa([ue({attribute:!0})],fa.prototype,"isMobileDesign",void 0),pa([ue({attribute:!0})],fa.prototype,"primaryColor",void 0),pa([ue({attribute:!0})],fa.prototype,"backgroundColor",void 0),pa([ue({attribute:!0})],fa.prototype,"hasChatEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasEmailEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasCallUsEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasTextUsEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasSSTEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasApplyNowEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"hasPricingCalculatorEnabled",void 0),pa([ue({attribute:!0})],fa.prototype,"applicationLink",void 0),pa([ue({attribute:!0})],fa.prototype,"overrideRentgrata",void 0),pa([ue({attribute:!0})],fa.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),fa=pa([se("mobile-launcher")],fa);const ga=(e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
5205
5212
  <path d="M1.31812 7L4.31812 4L1.31811 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
5206
- </svg>`;var ga=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 ma=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Ue,this.toExpand=!1}render(){return B`
5213
+ </svg>`;var ma=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 ya=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Ue,this.toExpand=!1}render(){return B`
5207
5214
  <div class=${"button-container"} @click=${this.onClick}>
5208
5215
  <div
5209
5216
  class="inner-container"
5210
5217
  style=${Le({background:this.primaryColor})}
5211
5218
  >
5212
- ${this.toExpand?fa("black"):((e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
5219
+ ${this.toExpand?ga("black"):((e="white")=>j`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="8" viewBox="0 0 5 8" fill="none">
5213
5220
  <path d="M3.68188 7L0.681885 4L3.68188 1" stroke="${e}" stroke-linecap="round" stroke-linejoin="round"/>
5214
5221
  </svg>`)("black")}
5215
5222
  </div>
5216
5223
  </div>
5217
- `}};ma.styles=[u`
5224
+ `}};ya.styles=[u`
5218
5225
  .button-container {
5219
5226
  width: 36px;
5220
5227
  height: 36px;
@@ -5238,11 +5245,11 @@ xmlns="http://www.w3.org/2000/svg"
5238
5245
  .button-container:hover {
5239
5246
  filter: brightness(90%);
5240
5247
  }
5241
- `],ga([ue({attribute:!0})],ma.prototype,"onClick",void 0),ga([ue({attribute:!0})],ma.prototype,"primaryColor",void 0),ga([ue({attribute:!0})],ma.prototype,"toExpand",void 0),ma=ga([se("collapse-expand-button")],ma);const ya=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},ba=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},va=()=>!!window.rentgrata;var wa=n(3950),Ca=n.n(wa);const xa=(e="black")=>j`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
5248
+ `],ma([ue({attribute:!0})],ya.prototype,"onClick",void 0),ma([ue({attribute:!0})],ya.prototype,"primaryColor",void 0),ma([ue({attribute:!0})],ya.prototype,"toExpand",void 0),ya=ma([se("collapse-expand-button")],ya);const ba=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.openWidget()},va=()=>{const e=window.rentgrata;if(!e)return;const t=e.Widget;t&&t.openWidget&&t.close()},wa=()=>!!window.rentgrata;var Ca=n(3950),xa=n.n(Ca);const Aa=(e="black")=>j`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
5242
5249
  <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}"/>
5243
5250
  <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}"/>
5244
5251
  </svg>
5245
- `;var Aa=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 Sa=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=()=>{ai("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=Ca(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Ue,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this._isMobile=bn(),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=Ee(),this.tourSchedulerRef=Ee(),this.calculatorWindowRef=Ee(),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(),ba(),ai("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),ba(),ai("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),ba(),ai("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),ba(),ai("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),ba(),ai("bookTourClicked",{buildingId:this.buildingId}),qn(),Vn(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=()=>this._isMobile||this.isMinimized||this.designConcept===Mi.MINIMIZED?B` ${this.hasHideMobileFeatures&&this._isMobile?B`<collapse-expand-button
5252
+ `;var Sa=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 ka=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.layoutOptions=[],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=()=>{ai("chatOpened",{buildingId:this.buildingId}),this.onChatTapped()},this.onClickMinimize=()=>{},this.onSstClose=xa(),this.overrideRentgrata=!1,this.launcherStyles={},this.primaryColor=Ue,this.backgroundColor=Re,this.foregroundColorOnPrimaryBackgroundColor="white",this.foregroundColorOnSecondaryBackgroundColor="black",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this._isMobile=bn(),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=Ee(),this.tourSchedulerRef=Ee(),this.calculatorWindowRef=Ee(),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(),va(),ai("emailUsClicked",{buildingId:this.buildingId}),this.isEmailWindowOpen=!0},this.onCloseEmailWindow=()=>{this.isEmailWindowOpen=!1},this.onClickPhoneOption=e=>{e.preventDefault(),e.stopPropagation(),va(),ai("callTextUsClicked",{buildingId:this.buildingId}),this.isCallUsWindowOpen=!0},this.onClickApplyNowOption=e=>{e.preventDefault(),e.stopPropagation(),va(),ai("applyNowClicked",{buildingId:this.buildingId,applicationLink:this.applicationLink}),window.open(this.applicationLink,"_blank")},this.onClickPriceCalculatorOption=e=>{e.preventDefault(),e.stopPropagation(),va(),ai("feeCalculatorOpened",{buildingId:this.buildingId}),this.isCalculatorWindowOpen=!0},this.onClosePhoneWindow=()=>{this.isCallUsWindowOpen=!1},this.onClickSSTOption=e=>{e.preventDefault(),e.stopPropagation(),va(),ai("bookTourClicked",{buildingId:this.buildingId}),qn(),Vn(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=()=>this._isMobile||this.isMinimized||this.designConcept===Mi.MINIMIZED?B` ${this.hasHideMobileFeatures&&this._isMobile?B`<collapse-expand-button
5246
5253
  .toExpand=${this.isMobileFeaturesExpanded}
5247
5254
  .primaryColor=${this.primaryColor}
5248
5255
  .onClick=${this.toggleMobileFeatures}
@@ -5276,7 +5283,7 @@ xmlns="http://www.w3.org/2000/svg"
5276
5283
  >
5277
5284
  <div class="type-hey__pill-left">
5278
5285
  <div class="type-hey__icon">
5279
- ${sa(this.foregroundColorOnSecondaryBackgroundColor)}
5286
+ ${la(this.foregroundColorOnSecondaryBackgroundColor)}
5280
5287
  </div>
5281
5288
  <div
5282
5289
  style=${Le({color:this.foregroundColorOnSecondaryBackgroundColor})}
@@ -5285,7 +5292,7 @@ xmlns="http://www.w3.org/2000/svg"
5285
5292
  </div>
5286
5293
  </div>
5287
5294
  <div class="type-gradient__icon">
5288
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5295
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5289
5296
  </div>
5290
5297
  </button>`:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?B`
5291
5298
  <button
@@ -5296,7 +5303,7 @@ xmlns="http://www.w3.org/2000/svg"
5296
5303
  >
5297
5304
  <div class="type-hey__pill-left">
5298
5305
  <div class="type-hey__icon">
5299
- ${la(this.foregroundColorOnSecondaryBackgroundColor)}
5306
+ ${ua(this.foregroundColorOnSecondaryBackgroundColor)}
5300
5307
  </div>
5301
5308
  <div
5302
5309
  style=${Le({color:this.foregroundColorOnSecondaryBackgroundColor})}
@@ -5305,7 +5312,7 @@ xmlns="http://www.w3.org/2000/svg"
5305
5312
  </div>
5306
5313
  </div>
5307
5314
  <div class="type-gradient__icon">
5308
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5315
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5309
5316
  </div>
5310
5317
  </button>
5311
5318
  `:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?B`
@@ -5317,7 +5324,7 @@ xmlns="http://www.w3.org/2000/svg"
5317
5324
  >
5318
5325
  <div class="type-hey__pill-left">
5319
5326
  <div class="type-hey__icon">
5320
- ${Ur(this.foregroundColorOnSecondaryBackgroundColor)}
5327
+ ${Rr(this.foregroundColorOnSecondaryBackgroundColor)}
5321
5328
  </div>
5322
5329
  <div
5323
5330
  style=${Le({color:this.foregroundColorOnSecondaryBackgroundColor})}
@@ -5329,7 +5336,7 @@ xmlns="http://www.w3.org/2000/svg"
5329
5336
  </div>
5330
5337
  </div>
5331
5338
  <div class="type-gradient__icon">
5332
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5339
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5333
5340
  </div>
5334
5341
  </button>
5335
5342
  `:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?B`
@@ -5341,7 +5348,7 @@ xmlns="http://www.w3.org/2000/svg"
5341
5348
  >
5342
5349
  <div class="type-hey__pill-left">
5343
5350
  <div class="type-hey__icon">
5344
- ${ca(this.foregroundColorOnSecondaryBackgroundColor)}
5351
+ ${da(this.foregroundColorOnSecondaryBackgroundColor)}
5345
5352
  </div>
5346
5353
  <div
5347
5354
  class="vertical-pill-title"
@@ -5352,7 +5359,7 @@ xmlns="http://www.w3.org/2000/svg"
5352
5359
  </div>
5353
5360
  </div>
5354
5361
  <div class="type-gradient__icon">
5355
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5362
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5356
5363
  </div>
5357
5364
  </button>
5358
5365
  `:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?B`
@@ -5364,7 +5371,7 @@ xmlns="http://www.w3.org/2000/svg"
5364
5371
  >
5365
5372
  <div class="type-hey__pill-left">
5366
5373
  <div class="type-hey__icon">
5367
- ${da(this.foregroundColorOnSecondaryBackgroundColor)}
5374
+ ${ha(this.foregroundColorOnSecondaryBackgroundColor)}
5368
5375
  </div>
5369
5376
  <div
5370
5377
  style=${Le({color:this.foregroundColorOnSecondaryBackgroundColor})}
@@ -5373,7 +5380,7 @@ xmlns="http://www.w3.org/2000/svg"
5373
5380
  </div>
5374
5381
  </div>
5375
5382
  <div class="type-gradient__icon">
5376
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5383
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5377
5384
  </div>
5378
5385
  </button>
5379
5386
  `:null}].filter(e=>!!e.pill);return B`
@@ -5407,7 +5414,7 @@ xmlns="http://www.w3.org/2000/svg"
5407
5414
  >
5408
5415
  <div class="type-hey__pill-left">
5409
5416
  <div class="type-hey__icon">
5410
- ${ua(this.foregroundColorOnPrimaryBackgroundColor)}
5417
+ ${ca(this.foregroundColorOnPrimaryBackgroundColor)}
5411
5418
  </div>
5412
5419
  <div
5413
5420
  style=${Le({color:this.foregroundColorOnPrimaryBackgroundColor})}
@@ -5416,7 +5423,7 @@ xmlns="http://www.w3.org/2000/svg"
5416
5423
  </div>
5417
5424
  </div>
5418
5425
  <div class="type-gradient__icon">
5419
- ${fa(this.foregroundColorOnPrimaryBackgroundColor)}
5426
+ ${ga(this.foregroundColorOnPrimaryBackgroundColor)}
5420
5427
  </div>
5421
5428
  </button>
5422
5429
  `:""}
@@ -5428,22 +5435,22 @@ xmlns="http://www.w3.org/2000/svg"
5428
5435
  >
5429
5436
  <div class="type-hey__botton-section-pills">
5430
5437
  ${e.map(e=>e.pill)}
5431
- ${this.overrideRentgrata&&va()?B` <button
5438
+ ${this.overrideRentgrata&&wa()?B` <button
5432
5439
  class="type-hey__pill"
5433
- @click=${()=>{ya()}}
5440
+ @click=${()=>{ba()}}
5434
5441
  style=${Le({background:this.backgroundColor})}
5435
5442
  aria-label="Contact a resident"
5436
5443
  >
5437
5444
  <div class="type-hey__pill-left">
5438
5445
  <div class="type-hey__icon">
5439
- ${xa("black")}
5446
+ ${Aa("black")}
5440
5447
  </div>
5441
5448
  <div>
5442
5449
  <span class="title-bold">Contact</span> a resident
5443
5450
  </div>
5444
5451
  </div>
5445
5452
  <div class="type-gradient__icon">
5446
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5453
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5447
5454
  </div>
5448
5455
  </button>`:""}
5449
5456
  </div>
@@ -5465,7 +5472,7 @@ xmlns="http://www.w3.org/2000/svg"
5465
5472
  >
5466
5473
  <div class="vertical-pill-left">
5467
5474
  <div class="vertical-pill-icon">
5468
- ${ua(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
5475
+ ${ca(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
5469
5476
  </div>
5470
5477
  <div
5471
5478
  class="vertical-pill-title"
@@ -5475,7 +5482,7 @@ xmlns="http://www.w3.org/2000/svg"
5475
5482
  </div>
5476
5483
  </div>
5477
5484
  <div class="chevron-right">
5478
- ${fa(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
5485
+ ${ga(e?this.foregroundColorOnSecondaryBackgroundColor:this.foregroundColorOnPrimaryBackgroundColor)}
5479
5486
  </div>
5480
5487
  </button>
5481
5488
  `:null},{pillKey:"Price Calculator",pill:this.hasPricingCalculatorEnabledDesktop?B`
@@ -5487,14 +5494,14 @@ xmlns="http://www.w3.org/2000/svg"
5487
5494
  >
5488
5495
  <div class="vertical-pill-left">
5489
5496
  <div class="vertical-pill-icon">
5490
- ${da(this.foregroundColorOnSecondaryBackgroundColor)}
5497
+ ${ha(this.foregroundColorOnSecondaryBackgroundColor)}
5491
5498
  </div>
5492
5499
  <div class="vertical-pill-title" style="margin-left: -2px;">
5493
5500
  <span class="vertical-pill-bold">Calculate</span> Cost
5494
5501
  </div>
5495
5502
  </div>
5496
5503
  <div class="chevron-right">
5497
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5504
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5498
5505
  </div>
5499
5506
  </button>
5500
5507
  `:null},{pillKey:"SST",pill:this.hasSSTEnabledDesktop?B`
@@ -5507,7 +5514,7 @@ xmlns="http://www.w3.org/2000/svg"
5507
5514
  >
5508
5515
  <div class="vertical-pill-left">
5509
5516
  <div class="vertical-pill-icon">
5510
- ${la(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
5517
+ ${ua(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
5511
5518
  </div>
5512
5519
  <div
5513
5520
  class="vertical-pill-title"
@@ -5518,7 +5525,7 @@ xmlns="http://www.w3.org/2000/svg"
5518
5525
  </div>
5519
5526
  </div>
5520
5527
  <div class="chevron-right">
5521
- ${fa(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
5528
+ ${ga(e?this.foregroundColorOnPrimaryBackgroundColor:this.foregroundColorOnSecondaryBackgroundColor)}
5522
5529
  </div>
5523
5530
  </button>
5524
5531
  `:null},{pillKey:"Email",pill:this.hasEmailEnabledDesktop?B`
@@ -5530,7 +5537,7 @@ xmlns="http://www.w3.org/2000/svg"
5530
5537
  >
5531
5538
  <div class="vertical-pill-left">
5532
5539
  <div class="vertical-pill-icon">
5533
- ${sa(this.foregroundColorOnSecondaryBackgroundColor)}
5540
+ ${la(this.foregroundColorOnSecondaryBackgroundColor)}
5534
5541
  </div>
5535
5542
  <div
5536
5543
  class="vertical-pill-title"
@@ -5541,7 +5548,7 @@ xmlns="http://www.w3.org/2000/svg"
5541
5548
  </div>
5542
5549
  </div>
5543
5550
  <div class="chevron-right">
5544
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5551
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5545
5552
  </div>
5546
5553
  </button>
5547
5554
  `:null},{pillKey:"Phone",pill:this.phoneNumber&&(this.hasCallUsEnabledDesktop||this.hasTextUsEnabledDesktop)?B`
@@ -5553,7 +5560,7 @@ xmlns="http://www.w3.org/2000/svg"
5553
5560
  >
5554
5561
  <div class="vertical-pill-left">
5555
5562
  <div class="vertical-pill-icon">
5556
- ${Ur(this.foregroundColorOnSecondaryBackgroundColor)}
5563
+ ${Rr(this.foregroundColorOnSecondaryBackgroundColor)}
5557
5564
  </div>
5558
5565
  ${this.hasCallUsEnabledDesktop&&this.hasTextUsEnabledDesktop?B`
5559
5566
  <div
@@ -5582,7 +5589,7 @@ xmlns="http://www.w3.org/2000/svg"
5582
5589
  `:""}
5583
5590
  </div>
5584
5591
  <div class="chevron-right">
5585
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5592
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5586
5593
  </div>
5587
5594
  </button>
5588
5595
  `:null},{pillKey:"Apply",pill:this.applicationLink&&this.hasApplyNowEnabledDesktop?B`
@@ -5594,7 +5601,7 @@ xmlns="http://www.w3.org/2000/svg"
5594
5601
  >
5595
5602
  <div class="vertical-pill-left">
5596
5603
  <div class="vertical-pill-icon">
5597
- ${ca(this.foregroundColorOnSecondaryBackgroundColor)}
5604
+ ${da(this.foregroundColorOnSecondaryBackgroundColor)}
5598
5605
  </div>
5599
5606
  <div
5600
5607
  class="vertical-pill-title"
@@ -5605,7 +5612,7 @@ xmlns="http://www.w3.org/2000/svg"
5605
5612
  </div>
5606
5613
  </div>
5607
5614
  <div class="chevron-right">
5608
- ${fa(this.foregroundColorOnSecondaryBackgroundColor)}
5615
+ ${ga(this.foregroundColorOnSecondaryBackgroundColor)}
5609
5616
  </div>
5610
5617
  </button>
5611
5618
  `:null}].filter(e=>!!e.pill);if(e){const e=t.findIndex(e=>"SST"===e.pillKey);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n)}}return B`
@@ -5613,16 +5620,16 @@ xmlns="http://www.w3.org/2000/svg"
5613
5620
  <nav aria-label="EliseAI options">
5614
5621
  <ul class="vertical-pill-list__items" role="list">
5615
5622
  ${t.map(e=>B`<li>${e.pill}</li>`)}
5616
- ${this.overrideRentgrata&&va()?B`<li>
5623
+ ${this.overrideRentgrata&&wa()?B`<li>
5617
5624
  <button
5618
- @click=${()=>{ya()}}
5625
+ @click=${()=>{ba()}}
5619
5626
  class="inner-pill-wrapper"
5620
5627
  style=${Le({background:this.backgroundColor})}
5621
5628
  aria-label="Contact a resident"
5622
5629
  >
5623
5630
  <div class="vertical-pill-left">
5624
5631
  <div class="vertical-pill-icon">
5625
- ${xa(this.foregroundColorOnSecondaryBackgroundColor)}
5632
+ ${Aa(this.foregroundColorOnSecondaryBackgroundColor)}
5626
5633
  </div>
5627
5634
  <div class="vertical-pill-title">
5628
5635
  <span class="vertical-pill-bold">Contact</span> a
@@ -5630,7 +5637,7 @@ xmlns="http://www.w3.org/2000/svg"
5630
5637
  </div>
5631
5638
  </div>
5632
5639
  <div class="chevron-right">
5633
- ${fa("black")}
5640
+ ${ga("black")}
5634
5641
  </div>
5635
5642
  </button>
5636
5643
  </li>`:""}
@@ -5641,10 +5648,10 @@ xmlns="http://www.w3.org/2000/svg"
5641
5648
  class="minimize-button"
5642
5649
  aria-label="Minimize EliseAI widget"
5643
5650
  >
5644
- <div class="chevron-down">${fa("black")}</div>
5651
+ <div class="chevron-down">${ga("black")}</div>
5645
5652
  </button>`:""}
5646
5653
  </div>
5647
- `}}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Dr),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",Hr),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:this._isMobile||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return B`
5654
+ `}}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}render(){window.customElements.get("email-us-window")||window.customElements.define("email-us-window",Lr),window.customElements.get("call-us-window")||window.customElements.define("call-us-window",$r),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:this._isMobile||void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0:`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0:`${this.right}px`};return B`
5648
5655
  <div
5649
5656
  class=${ni()({"launcher__mobile-launcher-wrapper":this._isMobile||this.isMinimized,"launcher__mini-launcher-wrapper":!this._isMobile&&!this.isMinimized,"launcher__mini-elevated":"livcor"===this.orgSlug.toLowerCase()&&(this._isMobile||this.isMinimized)})}
5650
5657
  style=${Le({...this.launcherStyles,...this.mobileStyles,top:this._isMobile||void 0===this.top||isNaN(this.top)?void 0!==this.mobileStyles.top?`${this.mobileStyles.top}px`:void 0:this.top-700+"px",bottom:this._isMobile||void 0===this.bottom||isNaN(this.bottom)?void 0!==this.mobileStyles.bottom?`${this.mobileStyles.bottom}px`:"72px":`${this.bottom}px`,left:this._isMobile||void 0===this.left||isNaN(this.left)?void 0!==this.mobileStyles.left?`${this.mobileStyles.left}px`:void 0:`${this.left}px`,right:this._isMobile||void 0===this.right||isNaN(this.right)?void 0!==this.mobileStyles.right?`${this.mobileStyles.right}px`:"18px":`${this.right}px`})}
@@ -5690,6 +5697,7 @@ xmlns="http://www.w3.org/2000/svg"
5690
5697
  .hasDynamicSchedulingEnabled=${this.hasDynamicSchedulingEnabled}
5691
5698
  .leadSources="${this.leadSources}"
5692
5699
  .tourTypeOptions=${this.tourTypeOptions}
5700
+ .layoutOptions=${this.layoutOptions}
5693
5701
  .orgLegalName=${this.orgLegalName}
5694
5702
  buildingId=${this.buildingId}
5695
5703
  featureFlagShowDropdown="${this.featureFlagShowDropdown}"
@@ -5748,11 +5756,11 @@ xmlns="http://www.w3.org/2000/svg"
5748
5756
  `:""}
5749
5757
  ${this.isCallToActionWindowOpen()||this.showTourNextToChat?"":this.renderActionPills()}
5750
5758
  </div>
5751
- `}};Sa.styles=u`
5752
- ${Er}
5759
+ `}};ka.styles=u`
5753
5760
  ${Tr}
5754
5761
  ${_r}
5755
- `,Aa([ue({attribute:!0})],Sa.prototype,"isMinimized",void 0),Aa([ue()],Sa.prototype,"mobileStyles",void 0),Aa([ue({type:Boolean})],Sa.prototype,"isFirstMount",void 0),Aa([ue({attribute:!1})],Sa.prototype,"autoOpenChatWidget",void 0),Aa([ue()],Sa.prototype,"phoneNumber",void 0),Aa([ue({attribute:!0})],Sa.prototype,"buildingName",void 0),Aa([ue({attribute:!0})],Sa.prototype,"chatId",void 0),Aa([ue({attribute:!0})],Sa.prototype,"orgLegalName",void 0),Aa([ue({attribute:!0})],Sa.prototype,"chatCallUsHeader",void 0),Aa([ue({attribute:!1})],Sa.prototype,"buildingId",void 0),Aa([ue({attribute:!0})],Sa.prototype,"buildingSlug",void 0),Aa([ue({attribute:!0})],Sa.prototype,"orgSlug",void 0),Aa([ue({attribute:!0})],Sa.prototype,"sgtUrl",void 0),Aa([ue({attribute:!0})],Sa.prototype,"selfGuidedTourEnabled",void 0),Aa([ue({attribute:!0})],Sa.prototype,"selfGuidedToursTypeOffered",void 0),Aa([ue({attribute:!0})],Sa.prototype,"designConcept",void 0),Aa([ue({attribute:!0})],Sa.prototype,"featureFlagShowDropdown",void 0),Aa([ue({attribute:!1})],Sa.prototype,"leadSources",void 0),Aa([ue({attribute:!0})],Sa.prototype,"currentLeadSource",void 0),Aa([ue({attribute:!0})],Sa.prototype,"escortedToursLink",void 0),Aa([ue({attribute:!0})],Sa.prototype,"escortedToursTypeOffered",void 0),Aa([ue({attribute:!0})],Sa.prototype,"virtualToursLink",void 0),Aa([ue({attribute:!0})],Sa.prototype,"virtualToursTypeOffered",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasChatEnabledDesktop",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasChatEnabledMobile",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasEmailEnabledDesktop",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasEmailEnabledMobile",void 0),Aa([ue({attribute:!0})],Sa.prototype,"hasApplyNowEnabledDesktop",void 0),Aa([ue({attribute:!0})],Sa.prototype,"hasApplyNowEnabledMobile",void 0),Aa([ue({attribute:!0})],Sa.prototype,"applicationLink",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasCallUsEnabledDesktop",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasCallUsEnabledMobile",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasTextUsEnabledDesktop",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasTextUsEnabledMobile",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasSSTEnabledDesktop",void 0),Aa([ue({type:Boolean})],Sa.prototype,"hasSSTEnabledMobile",void 0),Aa([ue({attribute:!1})],Sa.prototype,"tourTypeOptions",void 0),Aa([ue({attribute:!0})],Sa.prototype,"hasDynamicSchedulingEnabled",void 0),Aa([ue({attribute:!0})],Sa.prototype,"hasPricingCalculatorEnabledDesktop",void 0),Aa([ue({attribute:!0})],Sa.prototype,"hasPricingCalculatorEnabledMobile",void 0),Aa([ue({attribute:!1})],Sa.prototype,"hasHideMobileFeatures",void 0),Aa([ue({type:Number})],Sa.prototype,"right",void 0),Aa([ue({type:Number})],Sa.prototype,"bottom",void 0),Aa([ue({type:Number})],Sa.prototype,"top",void 0),Aa([ue({type:Number})],Sa.prototype,"left",void 0),Aa([ue({attribute:!0})],Sa.prototype,"showTourNextToChat",void 0),Aa([ue({attribute:!1})],Sa.prototype,"onChatTapped",void 0),Aa([ue({attribute:!0})],Sa.prototype,"onClickMinimize",void 0),Aa([ue({attribute:!0})],Sa.prototype,"onSstClose",void 0),Aa([ue({attribute:!0})],Sa.prototype,"overrideRentgrata",void 0),Aa([ue({attribute:!1})],Sa.prototype,"launcherStyles",void 0),Aa([ue({attribute:!0})],Sa.prototype,"primaryColor",void 0),Aa([ue({attribute:!0})],Sa.prototype,"backgroundColor",void 0),Aa([ue({attribute:!0})],Sa.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Aa([ue({attribute:!0})],Sa.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Aa([ue({attribute:!0})],Sa.prototype,"leadSourceClient",void 0),Aa([ce()],Sa.prototype,"leadSourceMultitouchClient",void 0),Aa([ce()],Sa.prototype,"_isMobile",void 0),Aa([ce()],Sa.prototype,"isEmailWindowOpen",void 0),Aa([ce()],Sa.prototype,"isCallUsWindowOpen",void 0),Aa([ce()],Sa.prototype,"isSSTWindowOpen",void 0),Aa([ce()],Sa.prototype,"isTextUsWindowOpen",void 0),Aa([ce()],Sa.prototype,"isCalculatorWindowOpen",void 0),Aa([ce()],Sa.prototype,"isMobileFeaturesExpanded",void 0),Sa=Aa([se("meetelise-launcher")],Sa);const ka=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",Sa)},Ea=["app.meetelise.com","staging.eliseai.com","localhost"],Ta={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},_a=e=>{const t=window.location.hostname;if(!Ea.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in Ta&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=Ta[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Oa=n(5072),Pa=n.n(Oa),Ia=n(7825),Ma=n.n(Ia),Na=n(7659),Da=n.n(Na),La=n(5056),Ua=n.n(La),Ra=n(540),Ba=n.n(Ra),ja=n(1113),Fa=n.n(ja),Ha=n(5541),$a={};$a.styleTagTransform=Fa(),$a.setAttributes=Ua(),$a.insert=Da().bind(null,"head"),$a.domAPI=Ma(),$a.insertStyleElement=Ba();Pa()(Ha.A,$a);Ha.A&&Ha.A.locals&&Ha.A.locals;async function za(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return Ga(n.data,t)}return[]}catch(e){return[]}}const Ga=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};var Qa,Wa=n(8805),qa=n.n(Wa),Va=new Uint8Array(16);function Ya(){if(!Qa&&!(Qa="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 Qa(Va)}const Ka=/^(?:[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;const Xa=function(e){return"string"==typeof e&&Ka.test(e)};for(var Za=[],Ja=0;Ja<256;++Ja)Za.push((Ja+256).toString(16).substr(1));const es=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Za[e[t+0]]+Za[e[t+1]]+Za[e[t+2]]+Za[e[t+3]]+"-"+Za[e[t+4]]+Za[e[t+5]]+"-"+Za[e[t+6]]+Za[e[t+7]]+"-"+Za[e[t+8]]+Za[e[t+9]]+"-"+Za[e[t+10]]+Za[e[t+11]]+Za[e[t+12]]+Za[e[t+13]]+Za[e[t+14]]+Za[e[t+15]]).toLowerCase();if(!Xa(n))throw TypeError("Stringified UUID is invalid");return n};const ts=function(e,t,n){var i=(e=e||{}).random||(e.rng||Ya)();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 es(i)},ns=e=>localStorage.removeItem("com.elise.webchat.slug="+e),is=(e,t,n)=>{const i=On(new Date),r=n||`lead_${ts()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Rn(i),buildingSlug:e,initiatedChat:t}},rs=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(os(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},os=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(dn(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!wn(t.timestamp,24)};var as;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(as||(as={}));const ss=e=>e.type===us.text,ls=e=>e.type===us.media;var us;!function(e){e.text="text",e.media="media"}(us||(us={}));const cs=class{constructor(e,t,n,i=null,r,o,a=null,s=lu.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.widgetType=lu.Default,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==as.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){this.simpleChatMessages.some(e=>e.type===us.text&&e.message.includes("confirmed for your"))&&ai("scheduledTourEvent",{tourDetails:e.message,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=this.simpleChatMessages.some(e=>{if(!ss(e))return!1;const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order});t&&(this.streamingMessageTimeout=setTimeout(()=>{Ai({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory()},e))},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;ai("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===as.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=is(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===lu.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>gn({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(ai("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),ai("chatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(Ai({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:us.media}):!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:us.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:us.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&Ai({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),null}}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(qa())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==as.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}shouldCreateAsDevState(){return location.href.startsWith("https://app.meetelise.com/settings/widgets")||location.href.includes("demo/utilities")}},ds=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),hs=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return ds.has(t)},ps=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\(\d{3}\)[\s.-]?|\d{3}[\s.-])\d{3}[\s.-]?\d{4}/g,c=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,d=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},y=document.body.getElementsByTagName("*");let b=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(hs(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[e].getAttribute("href");if(!t)continue;let n="",i=c;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=d):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,hs(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t}),C&&Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t}),b||Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:xi.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:xi.error,buildingSlug:n,orgSlug:t}),0}};var fs=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 gs=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Ue,this.toExpand=!1}render(){return B`
5762
+ ${Or}
5763
+ `,Sa([ue({attribute:!0})],ka.prototype,"isMinimized",void 0),Sa([ue()],ka.prototype,"mobileStyles",void 0),Sa([ue({type:Boolean})],ka.prototype,"isFirstMount",void 0),Sa([ue({attribute:!1})],ka.prototype,"autoOpenChatWidget",void 0),Sa([ue()],ka.prototype,"phoneNumber",void 0),Sa([ue({attribute:!0})],ka.prototype,"buildingName",void 0),Sa([ue({attribute:!0})],ka.prototype,"chatId",void 0),Sa([ue({attribute:!0})],ka.prototype,"orgLegalName",void 0),Sa([ue({attribute:!0})],ka.prototype,"chatCallUsHeader",void 0),Sa([ue({attribute:!1})],ka.prototype,"buildingId",void 0),Sa([ue({attribute:!0})],ka.prototype,"buildingSlug",void 0),Sa([ue({attribute:!0})],ka.prototype,"orgSlug",void 0),Sa([ue({attribute:!0})],ka.prototype,"sgtUrl",void 0),Sa([ue({attribute:!0})],ka.prototype,"selfGuidedTourEnabled",void 0),Sa([ue({attribute:!0})],ka.prototype,"selfGuidedToursTypeOffered",void 0),Sa([ue({attribute:!0})],ka.prototype,"designConcept",void 0),Sa([ue({attribute:!0})],ka.prototype,"featureFlagShowDropdown",void 0),Sa([ue({attribute:!1})],ka.prototype,"leadSources",void 0),Sa([ue({attribute:!0})],ka.prototype,"currentLeadSource",void 0),Sa([ue({attribute:!0})],ka.prototype,"escortedToursLink",void 0),Sa([ue({attribute:!0})],ka.prototype,"escortedToursTypeOffered",void 0),Sa([ue({attribute:!0})],ka.prototype,"virtualToursLink",void 0),Sa([ue({attribute:!0})],ka.prototype,"virtualToursTypeOffered",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasChatEnabledDesktop",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasChatEnabledMobile",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasEmailEnabledDesktop",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasEmailEnabledMobile",void 0),Sa([ue({attribute:!0})],ka.prototype,"hasApplyNowEnabledDesktop",void 0),Sa([ue({attribute:!0})],ka.prototype,"hasApplyNowEnabledMobile",void 0),Sa([ue({attribute:!0})],ka.prototype,"applicationLink",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasCallUsEnabledDesktop",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasCallUsEnabledMobile",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasTextUsEnabledDesktop",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasTextUsEnabledMobile",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasSSTEnabledDesktop",void 0),Sa([ue({type:Boolean})],ka.prototype,"hasSSTEnabledMobile",void 0),Sa([ue({attribute:!1})],ka.prototype,"tourTypeOptions",void 0),Sa([ue({attribute:!1})],ka.prototype,"layoutOptions",void 0),Sa([ue({attribute:!0})],ka.prototype,"hasDynamicSchedulingEnabled",void 0),Sa([ue({attribute:!0})],ka.prototype,"hasPricingCalculatorEnabledDesktop",void 0),Sa([ue({attribute:!0})],ka.prototype,"hasPricingCalculatorEnabledMobile",void 0),Sa([ue({attribute:!1})],ka.prototype,"hasHideMobileFeatures",void 0),Sa([ue({type:Number})],ka.prototype,"right",void 0),Sa([ue({type:Number})],ka.prototype,"bottom",void 0),Sa([ue({type:Number})],ka.prototype,"top",void 0),Sa([ue({type:Number})],ka.prototype,"left",void 0),Sa([ue({attribute:!0})],ka.prototype,"showTourNextToChat",void 0),Sa([ue({attribute:!1})],ka.prototype,"onChatTapped",void 0),Sa([ue({attribute:!0})],ka.prototype,"onClickMinimize",void 0),Sa([ue({attribute:!0})],ka.prototype,"onSstClose",void 0),Sa([ue({attribute:!0})],ka.prototype,"overrideRentgrata",void 0),Sa([ue({attribute:!1})],ka.prototype,"launcherStyles",void 0),Sa([ue({attribute:!0})],ka.prototype,"primaryColor",void 0),Sa([ue({attribute:!0})],ka.prototype,"backgroundColor",void 0),Sa([ue({attribute:!0})],ka.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Sa([ue({attribute:!0})],ka.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Sa([ue({attribute:!0})],ka.prototype,"leadSourceClient",void 0),Sa([ce()],ka.prototype,"leadSourceMultitouchClient",void 0),Sa([ce()],ka.prototype,"_isMobile",void 0),Sa([ce()],ka.prototype,"isEmailWindowOpen",void 0),Sa([ce()],ka.prototype,"isCallUsWindowOpen",void 0),Sa([ce()],ka.prototype,"isSSTWindowOpen",void 0),Sa([ce()],ka.prototype,"isTextUsWindowOpen",void 0),Sa([ce()],ka.prototype,"isCalculatorWindowOpen",void 0),Sa([ce()],ka.prototype,"isMobileFeaturesExpanded",void 0),ka=Sa([se("meetelise-launcher")],ka);const Ea=()=>{window.customElements.get("meetelise-launcher")||window.customElements.define("meetelise-launcher",ka)},Ta=["app.meetelise.com","staging.eliseai.com","localhost"],_a={calculator:{desktop:"calcDesktop",mobile:"calcMobile"},email:{desktop:"emailDesktop",mobile:"emailMobile"},call:{desktop:"callDesktop",mobile:"callMobile"},text:{desktop:"textDesktop",mobile:"textMobile"},sst:{desktop:"sstDesktop",mobile:"sstMobile"}},Oa=e=>{const t=window.location.hostname;if(!Ta.includes(t))return e;const n=(e=>{if(!e)return{};try{return e.split(",").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&n in _a&&(e[n]="true"===i.toLowerCase()),e},{})}catch(e){return{}}})(new URLSearchParams(window.location.search).get("widgets"));if(0===Object.keys(n).length)return e;const i={...e};return Object.entries(n).forEach(([e,t])=>{const n=_a[e];n&&(i[n.desktop]=t,i[n.mobile]=t)}),i};var Pa=n(5072),Ia=n.n(Pa),Ma=n(7825),Na=n.n(Ma),Da=n(7659),La=n.n(Da),Ua=n(5056),Ra=n.n(Ua),Ba=n(540),ja=n.n(Ba),Fa=n(1113),Ha=n.n(Fa),$a=n(5541),za={};za.styleTagTransform=Ha(),za.setAttributes=Ra(),za.insert=La().bind(null,"head"),za.domAPI=Na(),za.insertStyleElement=ja();Ia()($a.A,za);$a.A&&$a.A.locals&&$a.A.locals;async function Ga(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${t}/lead-sources`);if(n.data){if("7e352741-1120-4ccf-9929-5dc99193a908"===e){const e=["Zillow","Apartments.com","Google PPC","Google Maps","Apple Maps","Social Media","Print Marketing"];return n.data.filter(t=>e.includes(t))}return Qa(n.data,t)}return[]}catch(e){return[]}}const Qa=(e,t)=>{let n=[];switch(t){case"d41619ec-0f79-11ee-8439-93855926ad58":n=["Forthea - PPC","HotPads","Forthea","Locator","Website-apartmentguide.com","Forthea - organic search","Tdc employee","University newspaper","Nashville apartment locators","Forthea - paid social","Apartment list","Off campus partners","Waze ads","Athletic event","Website-apartment guide"];break;case"d4160560-0f79-11ee-8438-fba837bf3a46":n=["Forthea - PPC","Rentgrata","Website-ApartmentFinder.com","Word of Mouth","Texas A&M A-Frame on Campus","Rent.com","Website-craigslist","Apartment List","Website-apartments.com","Forthea - paid social","Forthea - organic search","Website-apartmentguide.com","Forthea","Uhomes","Phone book","Property - website"];break;default:n=[]}return e.sort(),e.filter(e=>{const t=e.toLowerCase();return!n.map(e=>e.toLowerCase()).includes(t)})};var Wa,qa=n(8805),Va=n.n(qa),Ya=new Uint8Array(16);function Ka(){if(!Wa&&!(Wa="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 Wa(Ya)}const Xa=/^(?:[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;const Za=function(e){return"string"==typeof e&&Xa.test(e)};for(var Ja=[],es=0;es<256;++es)Ja.push((es+256).toString(16).substr(1));const ts=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Ja[e[t+0]]+Ja[e[t+1]]+Ja[e[t+2]]+Ja[e[t+3]]+"-"+Ja[e[t+4]]+Ja[e[t+5]]+"-"+Ja[e[t+6]]+Ja[e[t+7]]+"-"+Ja[e[t+8]]+Ja[e[t+9]]+"-"+Ja[e[t+10]]+Ja[e[t+11]]+Ja[e[t+12]]+Ja[e[t+13]]+Ja[e[t+14]]+Ja[e[t+15]]).toLowerCase();if(!Za(n))throw TypeError("Stringified UUID is invalid");return n};const ns=function(e,t,n){var i=(e=e||{}).random||(e.rng||Ka)();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 ts(i)},is=e=>localStorage.removeItem("com.elise.webchat.slug="+e),rs=(e,t,n)=>{const i=On(new Date),r=n||`lead_${ns()}`;return localStorage.setItem("com.elise.webchat.slug="+e,JSON.stringify({buildingSlug:e,leadId:r,timestamp:i,initiatedChat:t})),{leadId:r,timestamp:Rn(i),buildingSlug:e,initiatedChat:t}},os=e=>{const t=localStorage.getItem("com.elise.webchat.slug="+e);if(t)try{const n=JSON.parse(t),i={leadId:n.leadId,timestamp:new Date(n.timestamp),buildingSlug:n.buildingSlug,initiatedChat:n.initiatedChat};if(as(e,i))return i}catch(e){}return{leadId:null,timestamp:null,buildingSlug:null,initiatedChat:!1}},as=(e,t)=>{try{if(t.timestamp&&t.initiatedChat){const e=new Date("2024-06-06T21:30:00Z");if(dn(t.timestamp,e))return!1}}catch(e){}return!(t.buildingSlug!==e||!t.leadId||!t.timestamp)&&!wn(t.timestamp,24)};var ss;!function(e){e.noReply="no-reply",e.text="text",e.media="media"}(ss||(ss={}));const ls=e=>e.type===cs.text,us=e=>e.type===cs.media;var cs;!function(e){e.text="text",e.media="media"}(cs||(cs={}));const ds=class{constructor(e,t,n,i=null,r,o,a=null,s=du.Default){this.apiHost="https://app.meetelise.com",this.leadSourceClient=null,this.leadSourceMultitouchClient=null,this.buildingWebchatView=null,this.eliseResponseTimeout=null,this.isWaitingForStreamingMessages=!1,this.widgetType=du.Default,this.pubnub=null,this.leadUserId="",this.channel="",this.leadSource=null,this.sessionToken=null,this.isCurrentlyStreamingMessage=!1,this.chatListener=null,this.rawPubnubMessages=[],this.simpleChatMessages=[],this.listenerParams={message:e=>{var t,n;const i={channel:e.channel,message:e.message,publisher:e.publisher,subscription:e.subscription,timetoken:+e.timetoken};this.rawPubnubMessages=[...this.rawPubnubMessages,i],this.markEveryPreviousNoReplyMessageDone(this.rawPubnubMessages),this.rawPubnubMessages=this.rawPubnubMessages.filter(e=>e.message.messageType!==ss.noReply),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),this.checkAndHandleDelayStreamingMessages();const r="eliseai"!==e.publisher&&"elise_health_ai"!==e.publisher;if(null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:r}),!r&&this.eliseResponseTimeout&&clearTimeout(this.eliseResponseTimeout),this.isLoadingMessages=r,"ai_message"===e.message.customType){this.simpleChatMessages.some(e=>e.type===cs.text&&e.message.includes("confirmed for your"))&&ai("scheduledTourEvent",{tourDetails:e.message,buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}this.checkAndHandleGTMForLeadEmail(e)}},this.isLoadingMessages=!1,this.isFirstChatMessageSent=!1,this.streamingMessageTimeout=null,this.checkAndHandleDelayStreamingMessages=({delayToFetchHistoryInMs:e=1e4}={})=>{this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null);const t=this.simpleChatMessages.some(e=>{if(!ls(e))return!1;const t=e.chunks.find(e=>e.isDone);return!t||e.chunks.length===t.order});t&&(this.streamingMessageTimeout=setTimeout(()=>{Ai({logTitle:"PUBNUB_WARN_DELAYED_STREAMING_MESSAGES",logData:{channel:this.channel},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),this.getChannelHistory()},e))},this.checkAndHandleGTMForLeadEmail=e=>{var t;try{if("lead_message"!==e.message.customType)return;if(!(e=>{try{return/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/.test(e)}catch(e){return!1}})(e.message.text))return;ai("leadProvidedEmail",{buildingId:null===(t=this.buildingWebchatView)||void 0===t?void 0:t.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel})}catch(e){return}},this.markEveryPreviousNoReplyMessageDone=e=>{var t,n;for(let i=e.length-1;i>=0;i--){const r=null===(t=e[i])||void 0===t?void 0:t.message,o=i>0&&(null===(n=e[i-1])||void 0===n?void 0:n.message);(null==r?void 0:r.messageType)===ss.noReply&&o&&(o.is_done=!0)}},this.checkMessageChunkValid=e=>{try{return!!e.message&&!!e.message.text&&e.message.text.length>0&&!!e.message.customType}catch(e){return!1}},this.handleChatListeners=()=>{if(this.pubnub&&this.channel)try{this.pubnub.subscribe({channels:[this.channel]}),this.pubnub.addListener(this.listenerParams)}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_ADDING_LISTENER",logData:{error:e,channel:this.channel,leadUserId:this.leadUserId,website:location.href},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}},this.handleDisconnect=()=>{this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.streamingMessageTimeout&&(clearTimeout(this.streamingMessageTimeout),this.streamingMessageTimeout=null),this.removeChatListeners()},this.removeChatListeners=()=>{this.pubnub&&this.channel&&(this.pubnub.unsubscribe({channels:[this.channel]}),this.pubnub.removeListener(this.listenerParams))},this.sendMessage=async e=>{if(e){if(!this.pubnub){const e=rs(this.buildingSlug,!0,this.leadUserId);if(!await this.initializePubnub(e))return}await this.withAuthToken(async()=>{var t,n,i,r,o,a,s,l,u;this.pubnub&&this.channel&&(this.eliseResponseTimeout&&(clearTimeout(this.eliseResponseTimeout),this.eliseResponseTimeout=null),this.eliseResponseTimeout=setTimeout(()=>{this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_ELISEAI_MESSAGE_TIMEOUT",logData:{channel:this.channel,leadUserId:this.leadUserId,message:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})},9e4),0===this.simpleChatMessages.length&&(null===(t=this.leadSourceClient)||void 0===t||t.checkAndHandleForLogLeadSource({webchatAction:"chat",stateId:null})),this.widgetType===du.Utilities?await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),orgSlug:this.orgSlug}}):(await this.pubnub.publish({channel:this.channel,message:{text:e,customType:"lead_message",buildingId:null===(n=this.buildingWebchatView)||void 0===n?void 0:n.id,buildingSlug:this.buildingSlug,userId:null===(i=this.buildingWebchatView)||void 0===i?void 0:i.userId,leadSource:this.leadSource,widgetType:this.widgetType,isDevState:this.shouldCreateAsDevState(),lead_sources_with_timestamps:(null!==(o=null===(r=this.leadSourceMultitouchClient)||void 0===r?void 0:r.getSafeLeadSourceTouchpointsWithDefault({includedUserSelectedLeadSource:null}))&&void 0!==o?o:[]).map(e=>gn({...e}))}}),null===(a=this.leadSourceClient)||void 0===a||a.resetLeadSource(),null===(s=this.leadSourceMultitouchClient)||void 0===s||s.resetLeadSourceTouchpoints()),this.isFirstChatMessageSent||(ai("firstChatMessageSent",{message:e,buildingId:null===(l=this.buildingWebchatView)||void 0===l?void 0:l.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}),this.isFirstChatMessageSent=!0),ai("chatMessageSent",{message:e,buildingId:null===(u=this.buildingWebchatView)||void 0===u?void 0:u.id,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,leadUserId:this.leadUserId,channel:this.channel}))}),!1===this.isLoadingMessages&&(this.isLoadingMessages=!0)}},this.isLeadMessage=e=>e.publisher.includes("lead_")&&"lead_message"===e.message.customType,this.removeDuplicatedRawPubnubMessages=e=>{const t=new Set;return e.filter(e=>{if("lead_message"===e.message.customType||!e.message.stream_id||!e.message.order)return!0;const n=`${e.message.stream_id}-${e.message.order}-${e.message.messageType}`;return t.has(n)?(Ai({logTitle:"PUBNUB_WARN_DUPLICATE_MESSAGE",logData:{message:e,channel:this.channel},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),!1):(t.add(n),!0)})},this.translatePubnubMessagesIntoSimpleChatMessages=e=>{const t=[],n={};return this.removeDuplicatedRawPubnubMessages(e).forEach(e=>{var i;"media"===e.message.messageType?t.push({timestamp:e.timetoken,media:null!==(i=e.message.media)&&void 0!==i?i:[],isLeadMessage:this.isLeadMessage(e),type:cs.media}):!e.message.stream_id||e.message.is_done&&0===e.message.order?t.push({timestamp:e.timetoken,message:e.message.text,isLeadMessage:this.isLeadMessage(e),chunks:[{text:e.message.text,order:0,isDone:!0}],type:cs.text}):n[e.message.stream_id]?n[e.message.stream_id].push(e):n[e.message.stream_id]=[e]}),Object.keys(n).forEach(e=>{const i=n[e],r=this.getConsecutiveChunks(i.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)})),o=r.map(e=>e.message.text).join(""),a=r[0],s={timestamp:a.timetoken,message:o,isLeadMessage:this.isLeadMessage(a),chunks:r.map(e=>{var t,n;return{text:e.message.text,order:null!==(t=e.message.order)&&void 0!==t?t:0,isDone:null!==(n=e.message.is_done)&&void 0!==n&&n}}),type:cs.text};this.isCurrentlyStreamingMessage=this.isMessageStillStreamingChunks(r),t.push(s)}),t.sort((e,t)=>e.timestamp-t.timestamp),t},this.getConsecutiveChunks=e=>{var t,n;const i=e.sort((e,t)=>{var n,i;return(null!==(n=e.message.order)&&void 0!==n?n:0)-(null!==(i=t.message.order)&&void 0!==i?i:0)}),r=[];let o=null!==(t=i[0].message.order)&&void 0!==t?t:0;for(const e of i){if((null!==(n=e.message.order)&&void 0!==n?n:-1)!==o)break;r.push(e),o++}return r},this.isMessageStillStreamingChunks=e=>{const t=e.find(e=>e.message.is_done);return!t||e.length===t.message.order},this.buildingSlug=e,this.buildingWebchatView=t,this.orgSlug=n,this.leadSource=i,this.leadUserId=r,this.channel=`webchat_${r}`,this.leadSourceClient=a,this.leadSourceMultitouchClient=o,this.widgetType=s}async initSession(e,t,n){try{const i={building_slug:e,org_slug:t};n&&(i.lead_id=n);const o=await r().post(`${this.apiHost}/platformApi/webchat/init`,i);return this.sessionToken=o.data.session_token,this.leadUserId=o.data.lead_id,this.channel=o.data.channel,o.data}catch(e){return this.buildingWebchatView&&Ai({logTitle:"WEBCHAT_INIT_SESSION_ERROR",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug}),null}}addChatListener(e){this.chatListener=e}async initializePubnub(e){if(!e.leadId)return;this.leadUserId=e.leadId;const t=await this.fetchToken(this.leadUserId,this.channel);return t?(this.pubnub=new(Va())({publishKey:t.keys.publish_key,subscribeKey:t.keys.subscribe_key,userId:this.leadUserId,authKey:t.auth.result.token,origin:"meetelise.pubnubapi.com"}),this.withAuthToken(()=>new Promise(()=>this.handleChatListeners())),await this.withAuthToken(()=>this.getChannelHistory()),this.pubnub):void 0}async fetchToken(e,t){try{if(this.sessionToken){const e="healthcare"===this.widgetType?"?industry=health_care":"";return(await r().get(`${this.apiHost}/platformApi/webchat/pn/v2/request-token${e}`,{headers:{"X-Session-Token":this.sessionToken}})).data}return(await r().get(`${this.apiHost}/platformApi/webchat/pn/request-token?user_id=${e}&channel=${t}&${"healthcare"===this.widgetType?"industry=health_care":""}`)).data}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_FETCHING_TOKEN",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return null}async fetchChannelExists(e){try{return(await r().get(`${this.apiHost}/platformApi/webchat/check-channel-exists?channel_name=${e}`)).data}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_FETCHING_CHANNEL_EXISTS",logData:{error:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}return!1}async withAuthToken(e){try{await e()}catch(t){if(t instanceof i.AxiosError&&t&&t.response&&403===t.response.status)try{if(!this.pubnub||!this.leadUserId||!this.channel)return;const t=await this.fetchToken(this.leadUserId,this.channel);if(!t)return;this.pubnub.setAuthKey(t.auth.result.token),await e()}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_ERROR_REFETCHING_TOKEN",logData:{retryError:e},logType:xi.error,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}}async getChannelHistory(e=1500){var t;try{let n=[],i=null;const r=100;for(let t=0;t<e;t+=r){const o=await new Promise((n,o)=>{if(!this.pubnub||!this.channel)return[];const a=Math.min(r,e-t);this.pubnub.fetchMessages({channels:[this.channel],count:a,start:null!=i?i:void 0},(e,t)=>{e.error?o(e):n(t)})}),a=o.channels[this.channel];if(!a)break;if(a.sort((e,t)=>+e.timetoken-+t.timetoken),!a||0===a.length)break;if(this.channel&&0!==Object.keys(o.channels).length){const e=o.channels[this.channel],t=[];e.forEach(e=>{e.uuid&&t.push({channel:e.channel,message:e.message,publisher:e.uuid,subscription:e.channel,timetoken:+e.timetoken})}),this.markEveryPreviousNoReplyMessageDone(t),n=n.concat(t.filter(e=>e.message.messageType!==ss.noReply))}if(i=a[0].timetoken,n.length>=e||a.length<r)break}this.rawPubnubMessages=n.slice(0,e),this.simpleChatMessages=this.translatePubnubMessagesIntoSimpleChatMessages(this.rawPubnubMessages),null===(t=this.chatListener)||void 0===t||t.call(this,{messages:this.simpleChatMessages,isLoading:!1})}catch(e){this.buildingWebchatView&&Ai({logTitle:"PUBNUB_WARN_FETCHING_HISTORY",logData:{error:e},logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug})}}shouldCreateAsDevState(){return location.href.startsWith("https://app.meetelise.com/settings/widgets")||location.href.includes("demo/utilities")}},hs=new Set(["8009855990","8338526262","8002221222","8006624357","8002738255","8007997233","8007874889","8006564673","8004224453","8883737888","8006213362","8009506264","8558272736","8008435678","8007862929","8008523836","8007849433","8007729100","8006699777","8006858470","8004322209","8003473735","8008778339","8009552232","8002255342","8009272891","8003049320","8007937724","8002382333","8003353863","8776858878","8003329227","8776554371","8772944357","8772944356","6092925760","6092926735","8007928339","8008329173","8882853036","6092921210","8007929773","8003561561","8003826717","8005727233","8009291040","8888958179","8006879512","8004262537","8773475463","8774149251","8005103102","8889372835","8007010710","8007010720","8774288844","8007929745","8003283838","6092927060","6092928319","8008527899","8662401347","8009923678","8776522873","8776527624","8003313937","8008435437","8776536783","8778392339","8003676274","8006896411"]),ps=e=>{const t=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1");return hs.has(t)},fs=(e,t,n)=>{try{const i=e.replace(/\D/g,"").replace(/^1(\d{10})$/,"$1"),r=`tel:${i}`,o=`sms:${i}`,a=`whatsapp://send?phone=${i}`,s=`facetime:${i}`,l=`facetime-audio:${i}`,u=/(?:\+1[\s.-]?)?(?:\(\d{3}\)[\s.-]?|\d{3}[\s.-])\d{3}[\s.-]?\d{4}/g,c=/(tel|sms):(?:\+1\s)?(?:(?:\(\d{3}\)\s|\d{3}-)\d{3}-\d{4}|\d{10,11})/g,d=/whatsapp:\/\/send\?phone=\d+/g,h=/(facetime|facetime-audio):\d+/g,p=/emergency|emergencia/i,f=300,g=e=>!(!e||e.length>f)&&p.test(e),m=e=>{var t,n,i,r;if(g(e.textContent))return!0;if(g(null===(t=e.previousElementSibling)||void 0===t?void 0:t.textContent)||g(null===(n=e.nextElementSibling)||void 0===n?void 0:n.textContent))return!0;const o=e.parentElement;return!(!o||!g(null===(i=o.previousElementSibling)||void 0===i?void 0:i.textContent)&&!g(null===(r=o.nextElementSibling)||void 0===r?void 0:r.textContent))},y=document.body.getElementsByTagName("*");let b=!1;const v=i.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");let w=!1,C=!1,x=0;for(let e=0;e<y.length;e++)if(y[e].nodeType===Node.ELEMENT_NODE&&!m(y[e])){if(1===y[e].childNodes.length&&y[e].childNodes[0].nodeType==Node.TEXT_NODE){const t=y[e].textContent;if(!t)continue;const n=t.replace(u,e=>{if(ps(e))return e;return e.startsWith("+1 ")?`+1 ${v}`:v});t!==n&&(x++,y[e].textContent=n),b=!0,w||(w=!0)}if(y[e].hasAttribute("href")){const t=y[e].getAttribute("href");if(!t)continue;let n="",i=c;if(t.startsWith("sms:")?n=o:t.startsWith("whatsapp:")?(n=a,i=d):t.startsWith("facetime:")?(n=s,i=h):t.startsWith("facetime-audio:")?(n=l,i=h):n=r,ps(t))continue;const u=t.replace(i,n);if(y[e].setAttribute("href",u),(t.startsWith("tel:")||t.startsWith("sms:"))&&u===t&&u!==n){t.replace(/\D/g,"").length>=7&&y[e].setAttribute("href",t.startsWith("tel:")?r:o)}C||(C=!0)}}return w&&Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"text-insertion",newPhoneNumber:v,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t}),C&&Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"href-insertion",newPhoneNumber:v,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t}),b||Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"no-phone-number-found",website:window.location.href},logType:xi.warn,buildingSlug:n,orgSlug:t}),x}catch(e){return Ai({logTitle:"DNI_WEBSITE_INSERTION",logData:{type:"insertion-error",error:e instanceof Error?e.message:String(e),website:window.location.href},logType:xi.error,buildingSlug:n,orgSlug:t}),0}};var gs=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 ms=class extends oe{constructor(){super(...arguments),this.onClick=()=>{},this.primaryColor=Ue,this.toExpand=!1}render(){return B`
5756
5764
  <button
5757
5765
  class=${this.toExpand?"button-container mini":"button-container"}
5758
5766
  @click=${this.onClick}
@@ -5762,10 +5770,10 @@ xmlns="http://www.w3.org/2000/svg"
5762
5770
  class="inner-container"
5763
5771
  style=${Le({background:this.primaryColor})}
5764
5772
  >
5765
- ${this.toExpand?B`<div class="chevron-up">${fa("white")}</div>`:B` <div class="x-icon">${io("white")}</div>`}
5773
+ ${this.toExpand?B`<div class="chevron-up">${ga("white")}</div>`:B` <div class="x-icon">${ro("white")}</div>`}
5766
5774
  </div>
5767
5775
  </button>
5768
- `}};gs.styles=[u`
5776
+ `}};ms.styles=[u`
5769
5777
  .button-container {
5770
5778
  width: 56px;
5771
5779
  height: 56px;
@@ -5815,7 +5823,7 @@ xmlns="http://www.w3.org/2000/svg"
5815
5823
  cursor: pointer;
5816
5824
  filter: brightness(90%);
5817
5825
  }
5818
- `],fs([ue({attribute:!0})],gs.prototype,"onClick",void 0),fs([ue({attribute:!0})],gs.prototype,"primaryColor",void 0),fs([ue({attribute:!0})],gs.prototype,"toExpand",void 0),gs=fs([se("minimize-expand-button")],gs);const ms=u`
5826
+ `],gs([ue({attribute:!0})],ms.prototype,"onClick",void 0),gs([ue({attribute:!0})],ms.prototype,"primaryColor",void 0),gs([ue({attribute:!0})],ms.prototype,"toExpand",void 0),ms=gs([se("minimize-expand-button")],ms);const ys=u`
5819
5827
  #healthchat-container {
5820
5828
  position: fixed;
5821
5829
 
@@ -5933,7 +5941,7 @@ xmlns="http://www.w3.org/2000/svg"
5933
5941
  .health-bttn-allow-access {
5934
5942
  padding-right: 28px;
5935
5943
  }
5936
- `,ys=u`
5944
+ `,bs=u`
5937
5945
  #pubnub-chat-container {
5938
5946
  position: fixed;
5939
5947
 
@@ -6053,7 +6061,7 @@ xmlns="http://www.w3.org/2000/svg"
6053
6061
  border: none;
6054
6062
  cursor: pointer;
6055
6063
  }
6056
- `,bs=u`
6064
+ `,vs=u`
6057
6065
  #header-text {
6058
6066
  font-size: 12px;
6059
6067
  font-weight: 700;
@@ -6254,7 +6262,7 @@ xmlns="http://www.w3.org/2000/svg"
6254
6262
  .checkbox:hover {
6255
6263
  opacity: 0.5;
6256
6264
  }
6257
- `,{entries:vs,setPrototypeOf:ws,isFrozen:Cs,getPrototypeOf:xs,getOwnPropertyDescriptor:As}=Object;let{freeze:Ss,seal:ks,create:Es}=Object,{apply:Ts,construct:_s}="undefined"!=typeof Reflect&&Reflect;Ss||(Ss=function(e){return e}),ks||(ks=function(e){return e}),Ts||(Ts=function(e,t,n){return e.apply(t,n)}),_s||(_s=function(e,t){return new e(...t)});const Os=Gs(Array.prototype.forEach),Ps=Gs(Array.prototype.lastIndexOf),Is=Gs(Array.prototype.pop),Ms=Gs(Array.prototype.push),Ns=Gs(Array.prototype.splice),Ds=Gs(String.prototype.toLowerCase),Ls=Gs(String.prototype.toString),Us=Gs(String.prototype.match),Rs=Gs(String.prototype.replace),Bs=Gs(String.prototype.indexOf),js=Gs(String.prototype.trim),Fs=Gs(Object.prototype.hasOwnProperty),Hs=Gs(RegExp.prototype.test),$s=(zs=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _s(zs,t)});var zs;function Gs(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Ts(e,t,i)}}function Qs(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ds;ws&&ws(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(Cs(t)||(t[i]=e),r=e)}e[r]=!0}return e}function Ws(e){for(let t=0;t<e.length;t++){Fs(e,t)||(e[t]=null)}return e}function qs(e){const t=Es(null);for(const[n,i]of vs(e)){Fs(e,n)&&(Array.isArray(i)?t[n]=Ws(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=qs(i):t[n]=i)}return t}function Vs(e,t){for(;null!==e;){const n=As(e,t);if(n){if(n.get)return Gs(n.get);if("function"==typeof n.value)return Gs(n.value)}e=xs(e)}return function(){return null}}const Ys=Ss(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ks=Ss(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xs=Ss(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zs=Ss(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Js=Ss(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),el=Ss(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),tl=Ss(["#text"]),nl=Ss(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),il=Ss(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),rl=Ss(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ol=Ss(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),al=ks(/\{\{[\w\W]*|[\w\W]*\}\}/gm),sl=ks(/<%[\w\W]*|[\w\W]*%>/gm),ll=ks(/\$\{[\w\W]*/gm),ul=ks(/^data-[\-\w.\u00B7-\uFFFF]+$/),cl=ks(/^aria-[\-\w]+$/),dl=ks(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hl=ks(/^(?:\w+script|data):/i),pl=ks(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fl=ks(/^html$/i),gl=ks(/^[a-z][.\w]*(-[.\w]+)+$/i);var ml=Object.freeze({__proto__:null,ARIA_ATTR:cl,ATTR_WHITESPACE:pl,CUSTOM_ELEMENT:gl,DATA_ATTR:ul,DOCTYPE_NAME:fl,ERB_EXPR:sl,IS_ALLOWED_URI:dl,IS_SCRIPT_OR_DATA:hl,MUSTACHE_EXPR:al,TMPLIT_EXPR:ll});const yl=1,bl=3,vl=7,wl=8,Cl=9,xl=function(){return"undefined"==typeof window?null:window};var Al=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xl();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==Cl||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:f}=t,g=u.prototype,m=Vs(g,"cloneNode"),y=Vs(g,"remove"),b=Vs(g,"nextSibling"),v=Vs(g,"childNodes"),w=Vs(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:A,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:E}=i,{importNode:T}=r;let _={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof vs&&"function"==typeof w&&A&&void 0!==A.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:P,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=ml;let{IS_ALLOWED_URI:R}=ml,B=null;const j=Qs({},[...Ys,...Ks,...Xs,...Js,...tl]);let F=null;const H=Qs({},[...nl,...il,...rl,...ol]);let $=Object.seal(Es(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,G=null,Q=!0,W=!0,q=!1,V=!0,Y=!1,K=!0,X=!1,Z=!1,J=!1,ee=!1,te=!1,ne=!1,ie=!0,re=!1,oe=!0,ae=!1,se={},le=null;const ue=Qs({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const de=Qs({},["audio","video","img","source","image","track"]);let he=null;const pe=Qs({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let ye=me,be=!1,ve=null;const we=Qs({},[fe,ge,me],Ls);let Ce=Qs({},["mi","mo","mn","ms","mtext"]),xe=Qs({},["annotation-xml"]);const Ae=Qs({},["title","style","font","a","script"]);let Se=null;const ke=["application/xhtml+xml","text/html"];let Ee=null,Te=null;const _e=i.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=qs(e),Se=-1===ke.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Se?Ls:Ds,B=Fs(e,"ALLOWED_TAGS")?Qs({},e.ALLOWED_TAGS,Ee):j,F=Fs(e,"ALLOWED_ATTR")?Qs({},e.ALLOWED_ATTR,Ee):H,ve=Fs(e,"ALLOWED_NAMESPACES")?Qs({},e.ALLOWED_NAMESPACES,Ls):we,he=Fs(e,"ADD_URI_SAFE_ATTR")?Qs(qs(pe),e.ADD_URI_SAFE_ATTR,Ee):pe,ce=Fs(e,"ADD_DATA_URI_TAGS")?Qs(qs(de),e.ADD_DATA_URI_TAGS,Ee):de,le=Fs(e,"FORBID_CONTENTS")?Qs({},e.FORBID_CONTENTS,Ee):ue,z=Fs(e,"FORBID_TAGS")?Qs({},e.FORBID_TAGS,Ee):qs({}),G=Fs(e,"FORBID_ATTR")?Qs({},e.FORBID_ATTR,Ee):qs({}),se=!!Fs(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||dl,ye=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,$=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(B=Qs({},tl),F=[],!0===se.html&&(Qs(B,Ys),Qs(F,nl)),!0===se.svg&&(Qs(B,Ks),Qs(F,il),Qs(F,ol)),!0===se.svgFilters&&(Qs(B,Xs),Qs(F,il),Qs(F,ol)),!0===se.mathMl&&(Qs(B,Js),Qs(F,rl),Qs(F,ol))),e.ADD_TAGS&&(B===j&&(B=qs(B)),Qs(B,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(F===H&&(F=qs(F)),Qs(F,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&Qs(he,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ue&&(le=qs(le)),Qs(le,e.FORBID_CONTENTS,Ee)),oe&&(B["#text"]=!0),X&&Qs(B,["html","head","body"]),B.table&&(Qs(B,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw $s('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,x=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}}(f,o)),null!==C&&"string"==typeof x&&(x=C.createHTML(""));Ss&&Ss(e),Te=e}},Ie=Qs({},[...Ks,...Xs,...Zs]),Me=Qs({},[...Js,...el]),Ne=function(e){Ms(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},De=function(e,t){try{Ms(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ms(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=Us(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&ye===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(ye===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=A.createDocument(ye,"template",null);try{t.documentElement.innerHTML=be?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ye===me?E.call(t,X?"html":"body")[0]:X?t.documentElement:o},Ue=function(e){return S.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"function"==typeof l&&e instanceof l};function je(e,t,i){Os(e,e=>{e.call(n,t,i,Te)})}const Fe=function(e){let t=null;if(je(_.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=Ee(e.nodeName);if(je(_.uponSanitizeElement,e,{tagName:i,allowedTags:B}),K&&e.hasChildNodes()&&!Be(e.firstElementChild)&&Hs(/<[/\w!]/g,e.innerHTML)&&Hs(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===vl)return Ne(e),!0;if(K&&e.nodeType===wl&&Hs(/<[/\w]/g,e.data))return Ne(e),!0;if(!B[i]||z[i]){if(!z[i]&&$e(i)){if($.tagNameCheck instanceof RegExp&&Hs($.tagNameCheck,i))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,b(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=Ds(e.tagName),i=Ds(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Ie[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Me[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Me[n]&&(Ae[n]||!Ie[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!Hs(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===bl&&(t=e.textContent,Os([O,P,I],e=>{t=Rs(t,e," ")}),e.textContent!==t&&(Ms(n.removed,{element:e.cloneNode()}),e.textContent=t)),je(_.afterSanitizeElements,e,null),!1):(Ne(e),!0)},He=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in _e))return!1;if(W&&!G[t]&&Hs(M,t));else if(Q&&Hs(N,t));else if(!F[t]||G[t]){if(!($e(e)&&($.tagNameCheck instanceof RegExp&&Hs($.tagNameCheck,e)||$.tagNameCheck instanceof Function&&$.tagNameCheck(e))&&($.attributeNameCheck instanceof RegExp&&Hs($.attributeNameCheck,t)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(t))||"is"===t&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Hs($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(he[t]);else if(Hs(R,Rs(n,L,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Bs(n,"data:")||!ce[e]){if(q&&!Hs(D,Rs(n,L,"")));else if(n)return!1}else;return!0},$e=function(e){return"annotation-xml"!==e&&Us(e,U)},ze=function(e){je(_.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=Ee(a),c=l;let d="value"===a?c:js(c);if(i.attrName=u,i.attrValue=d,i.keepAttr=!0,i.forceKeepAttr=void 0,je(_.uponSanitizeAttribute,e,i),d=i.attrValue,!re||"id"!==u&&"name"!==u||(De(a,e),d="user-content-"+d),K&&Hs(/((--!?|])>)|<\/(style|title)/i,d)){De(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){De(a,e);continue}if(!V&&Hs(/\/>/i,d)){De(a,e);continue}Y&&Os([O,P,I],e=>{d=Rs(d,e," ")});const h=Ee(e.nodeName);if(He(h,u,d)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":d=C.createHTML(d);break;case"TrustedScriptURL":d=C.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Re(e)?Ne(e):Is(n.removed)}catch(t){De(a,e)}}else De(a,e)}je(_.afterSanitizeAttributes,e,null)},Ge=function e(t){let n=null;const i=Ue(t);for(je(_.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)je(_.uponSanitizeShadowNode,n,null),Fe(n),ze(n),n.content instanceof a&&e(n.content);je(_.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw $s("toString is not a function");if("string"!=typeof(e=e.toString()))throw $s("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Pe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ee(e.nodeName);if(!B[t]||z[t])throw $s("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=Le("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===yl&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=Le(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const c=Ue(ae?e:i);for(;s=c.nextNode();)Fe(s),ze(s),s.content instanceof a&&Ge(s.content);if(ae)return e;if(ee){if(te)for(u=k.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(F.shadowroot||F.shadowrootmode)&&(u=T.call(r,u,!0)),u}let d=X?i.outerHTML:i.innerHTML;return X&&B["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Hs(fl,i.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+d),Y&&Os([O,P,I],e=>{d=Rs(d,e," ")}),C&&ne?C.createHTML(d):d},n.setConfig=function(){Pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Te=null,Z=!1},n.isValidAttribute=function(e,t,n){Te||Pe({});const i=Ee(e),r=Ee(t);return He(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Ms(_[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Ps(_[e],t);return-1===n?void 0:Ns(_[e],n,1)[0]}return Is(_[e])},n.removeHooks=function(e){_[e]=[]},n.removeAllHooks=function(){_={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),Sl=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 kl=class extends oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return B`<div class="spinner"></div>`}};kl.styles=u`
6265
+ `,{entries:ws,setPrototypeOf:Cs,isFrozen:xs,getPrototypeOf:As,getOwnPropertyDescriptor:Ss}=Object;let{freeze:ks,seal:Es,create:Ts}=Object,{apply:_s,construct:Os}="undefined"!=typeof Reflect&&Reflect;ks||(ks=function(e){return e}),Es||(Es=function(e){return e}),_s||(_s=function(e,t,n){return e.apply(t,n)}),Os||(Os=function(e,t){return new e(...t)});const Ps=Qs(Array.prototype.forEach),Is=Qs(Array.prototype.lastIndexOf),Ms=Qs(Array.prototype.pop),Ns=Qs(Array.prototype.push),Ds=Qs(Array.prototype.splice),Ls=Qs(String.prototype.toLowerCase),Us=Qs(String.prototype.toString),Rs=Qs(String.prototype.match),Bs=Qs(String.prototype.replace),js=Qs(String.prototype.indexOf),Fs=Qs(String.prototype.trim),Hs=Qs(Object.prototype.hasOwnProperty),$s=Qs(RegExp.prototype.test),zs=(Gs=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Os(Gs,t)});var Gs;function Qs(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return _s(e,t,i)}}function Ws(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ls;Cs&&Cs(e,null);let i=t.length;for(;i--;){let r=t[i];if("string"==typeof r){const e=n(r);e!==r&&(xs(t)||(t[i]=e),r=e)}e[r]=!0}return e}function qs(e){for(let t=0;t<e.length;t++){Hs(e,t)||(e[t]=null)}return e}function Vs(e){const t=Ts(null);for(const[n,i]of ws(e)){Hs(e,n)&&(Array.isArray(i)?t[n]=qs(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=Vs(i):t[n]=i)}return t}function Ys(e,t){for(;null!==e;){const n=Ss(e,t);if(n){if(n.get)return Qs(n.get);if("function"==typeof n.value)return Qs(n.value)}e=As(e)}return function(){return null}}const Ks=ks(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Xs=ks(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Zs=ks(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Js=ks(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),el=ks(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tl=ks(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nl=ks(["#text"]),il=ks(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),rl=ks(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ol=ks(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),al=ks(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sl=Es(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ll=Es(/<%[\w\W]*|[\w\W]*%>/gm),ul=Es(/\$\{[\w\W]*/gm),cl=Es(/^data-[\-\w.\u00B7-\uFFFF]+$/),dl=Es(/^aria-[\-\w]+$/),hl=Es(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),pl=Es(/^(?:\w+script|data):/i),fl=Es(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gl=Es(/^html$/i),ml=Es(/^[a-z][.\w]*(-[.\w]+)+$/i);var yl=Object.freeze({__proto__:null,ARIA_ATTR:dl,ATTR_WHITESPACE:fl,CUSTOM_ELEMENT:ml,DATA_ATTR:cl,DOCTYPE_NAME:gl,ERB_EXPR:ll,IS_ALLOWED_URI:hl,IS_SCRIPT_OR_DATA:pl,MUSTACHE_EXPR:sl,TMPLIT_EXPR:ul});const bl=1,vl=3,wl=7,Cl=8,xl=9,Al=function(){return"undefined"==typeof window?null:window};var Sl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Al();const n=t=>e(t);if(n.version="3.2.6",n.removed=[],!t||!t.document||t.document.nodeType!==xl||!t.Element)return n.isSupported=!1,n;let{document:i}=t;const r=i,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:u,NodeFilter:c,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:f}=t,g=u.prototype,m=Ys(g,"cloneNode"),y=Ys(g,"remove"),b=Ys(g,"nextSibling"),v=Ys(g,"childNodes"),w=Ys(g,"parentNode");if("function"==typeof s){const e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let C,x="";const{implementation:A,createNodeIterator:S,createDocumentFragment:k,getElementsByTagName:E}=i,{importNode:T}=r;let _={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof ws&&"function"==typeof w&&A&&void 0!==A.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:P,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:N,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:L,CUSTOM_ELEMENT:U}=yl;let{IS_ALLOWED_URI:R}=yl,B=null;const j=Ws({},[...Ks,...Xs,...Zs,...el,...nl]);let F=null;const H=Ws({},[...il,...rl,...ol,...al]);let $=Object.seal(Ts(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),z=null,G=null,Q=!0,W=!0,q=!1,V=!0,Y=!1,K=!0,X=!1,Z=!1,J=!1,ee=!1,te=!1,ne=!1,ie=!0,re=!1,oe=!0,ae=!1,se={},le=null;const ue=Ws({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const de=Ws({},["audio","video","img","source","image","track"]);let he=null;const pe=Ws({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let ye=me,be=!1,ve=null;const we=Ws({},[fe,ge,me],Us);let Ce=Ws({},["mi","mo","mn","ms","mtext"]),xe=Ws({},["annotation-xml"]);const Ae=Ws({},["title","style","font","a","script"]);let Se=null;const ke=["application/xhtml+xml","text/html"];let Ee=null,Te=null;const _e=i.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Te||Te!==e){if(e&&"object"==typeof e||(e={}),e=Vs(e),Se=-1===ke.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ee="application/xhtml+xml"===Se?Us:Ls,B=Hs(e,"ALLOWED_TAGS")?Ws({},e.ALLOWED_TAGS,Ee):j,F=Hs(e,"ALLOWED_ATTR")?Ws({},e.ALLOWED_ATTR,Ee):H,ve=Hs(e,"ALLOWED_NAMESPACES")?Ws({},e.ALLOWED_NAMESPACES,Us):we,he=Hs(e,"ADD_URI_SAFE_ATTR")?Ws(Vs(pe),e.ADD_URI_SAFE_ATTR,Ee):pe,ce=Hs(e,"ADD_DATA_URI_TAGS")?Ws(Vs(de),e.ADD_DATA_URI_TAGS,Ee):de,le=Hs(e,"FORBID_CONTENTS")?Ws({},e.FORBID_CONTENTS,Ee):ue,z=Hs(e,"FORBID_TAGS")?Ws({},e.FORBID_TAGS,Ee):Vs({}),G=Hs(e,"FORBID_ATTR")?Ws({},e.FORBID_ATTR,Ee):Vs({}),se=!!Hs(e,"USE_PROFILES")&&e.USE_PROFILES,Q=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,V=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ie=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||hl,ye=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,xe=e.HTML_INTEGRATION_POINTS||xe,$=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(W=!1),te&&(ee=!0),se&&(B=Ws({},nl),F=[],!0===se.html&&(Ws(B,Ks),Ws(F,il)),!0===se.svg&&(Ws(B,Xs),Ws(F,rl),Ws(F,al)),!0===se.svgFilters&&(Ws(B,Zs),Ws(F,rl),Ws(F,al)),!0===se.mathMl&&(Ws(B,el),Ws(F,ol),Ws(F,al))),e.ADD_TAGS&&(B===j&&(B=Vs(B)),Ws(B,e.ADD_TAGS,Ee)),e.ADD_ATTR&&(F===H&&(F=Vs(F)),Ws(F,e.ADD_ATTR,Ee)),e.ADD_URI_SAFE_ATTR&&Ws(he,e.ADD_URI_SAFE_ATTR,Ee),e.FORBID_CONTENTS&&(le===ue&&(le=Vs(le)),Ws(le,e.FORBID_CONTENTS,Ee)),oe&&(B["#text"]=!0),X&&Ws(B,["html","head","body"]),B.table&&(Ws(B,["tbody"]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw zs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw zs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,x=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return null}}(f,o)),null!==C&&"string"==typeof x&&(x=C.createHTML(""));ks&&ks(e),Te=e}},Ie=Ws({},[...Xs,...Zs,...Js]),Me=Ws({},[...el,...tl]),Ne=function(e){Ns(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){y(e)}},De=function(e,t){try{Ns(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ns(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=Rs(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===Se&&ye===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=C?C.createHTML(e):e;if(ye===me)try{t=(new p).parseFromString(r,Se)}catch(e){}if(!t||!t.documentElement){t=A.createDocument(ye,"template",null);try{t.documentElement.innerHTML=be?x:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(i.createTextNode(n),o.childNodes[0]||null),ye===me?E.call(t,X?"html":"body")[0]:X?t.documentElement:o},Ue=function(e){return S.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Be=function(e){return"function"==typeof l&&e instanceof l};function je(e,t,i){Ps(e,e=>{e.call(n,t,i,Te)})}const Fe=function(e){let t=null;if(je(_.beforeSanitizeElements,e,null),Re(e))return Ne(e),!0;const i=Ee(e.nodeName);if(je(_.uponSanitizeElement,e,{tagName:i,allowedTags:B}),K&&e.hasChildNodes()&&!Be(e.firstElementChild)&&$s(/<[/\w!]/g,e.innerHTML)&&$s(/<[/\w!]/g,e.textContent))return Ne(e),!0;if(e.nodeType===wl)return Ne(e),!0;if(K&&e.nodeType===Cl&&$s(/<[/\w]/g,e.data))return Ne(e),!0;if(!B[i]||z[i]){if(!z[i]&&$e(i)){if($.tagNameCheck instanceof RegExp&&$s($.tagNameCheck,i))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(i))return!1}if(oe&&!le[i]){const t=w(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){for(let i=n.length-1;i>=0;--i){const r=m(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,b(e))}}}return Ne(e),!0}return e instanceof u&&!function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:ye,tagName:"template"});const n=Ls(e.tagName),i=Ls(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===ge?t.namespaceURI===me?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===i||Ce[i]):Boolean(Ie[n]):e.namespaceURI===fe?t.namespaceURI===me?"math"===n:t.namespaceURI===ge?"math"===n&&xe[i]:Boolean(Me[n]):e.namespaceURI===me?!(t.namespaceURI===ge&&!xe[i])&&!(t.namespaceURI===fe&&!Ce[i])&&!Me[n]&&(Ae[n]||!Ie[n]):!("application/xhtml+xml"!==Se||!ve[e.namespaceURI]))}(e)?(Ne(e),!0):"noscript"!==i&&"noembed"!==i&&"noframes"!==i||!$s(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&e.nodeType===vl&&(t=e.textContent,Ps([O,P,I],e=>{t=Bs(t,e," ")}),e.textContent!==t&&(Ns(n.removed,{element:e.cloneNode()}),e.textContent=t)),je(_.afterSanitizeElements,e,null),!1):(Ne(e),!0)},He=function(e,t,n){if(ie&&("id"===t||"name"===t)&&(n in i||n in _e))return!1;if(W&&!G[t]&&$s(M,t));else if(Q&&$s(N,t));else if(!F[t]||G[t]){if(!($e(e)&&($.tagNameCheck instanceof RegExp&&$s($.tagNameCheck,e)||$.tagNameCheck instanceof Function&&$.tagNameCheck(e))&&($.attributeNameCheck instanceof RegExp&&$s($.attributeNameCheck,t)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(t))||"is"===t&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&$s($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(he[t]);else if($s(R,Bs(n,L,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==js(n,"data:")||!ce[e]){if(q&&!$s(D,Bs(n,L,"")));else if(n)return!1}else;return!0},$e=function(e){return"annotation-xml"!==e&&Rs(e,U)},ze=function(e){je(_.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Re(e))return;const i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let r=t.length;for(;r--;){const o=t[r],{name:a,namespaceURI:s,value:l}=o,u=Ee(a),c=l;let d="value"===a?c:Fs(c);if(i.attrName=u,i.attrValue=d,i.keepAttr=!0,i.forceKeepAttr=void 0,je(_.uponSanitizeAttribute,e,i),d=i.attrValue,!re||"id"!==u&&"name"!==u||(De(a,e),d="user-content-"+d),K&&$s(/((--!?|])>)|<\/(style|title)/i,d)){De(a,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){De(a,e);continue}if(!V&&$s(/\/>/i,d)){De(a,e);continue}Y&&Ps([O,P,I],e=>{d=Bs(d,e," ")});const h=Ee(e.nodeName);if(He(h,u,d)){if(C&&"object"==typeof f&&"function"==typeof f.getAttributeType)if(s);else switch(f.getAttributeType(h,u)){case"TrustedHTML":d=C.createHTML(d);break;case"TrustedScriptURL":d=C.createScriptURL(d)}if(d!==c)try{s?e.setAttributeNS(s,a,d):e.setAttribute(a,d),Re(e)?Ne(e):Ms(n.removed)}catch(t){De(a,e)}}else De(a,e)}je(_.afterSanitizeAttributes,e,null)},Ge=function e(t){let n=null;const i=Ue(t);for(je(_.beforeSanitizeShadowDOM,t,null);n=i.nextNode();)je(_.uponSanitizeShadowNode,n,null),Fe(n),ze(n),n.content instanceof a&&e(n.content);je(_.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,o=null,s=null,u=null;if(be=!e,be&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Be(e)){if("function"!=typeof e.toString)throw zs("toString is not a function");if("string"!=typeof(e=e.toString()))throw zs("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Z||Pe(t),n.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){const t=Ee(e.nodeName);if(!B[t]||z[t])throw zs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)i=Le("\x3c!----\x3e"),o=i.ownerDocument.importNode(e,!0),o.nodeType===bl&&"BODY"===o.nodeName||"HTML"===o.nodeName?i=o:i.appendChild(o);else{if(!ee&&!Y&&!X&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(i=Le(e),!i)return ee?null:ne?x:""}i&&J&&Ne(i.firstChild);const c=Ue(ae?e:i);for(;s=c.nextNode();)Fe(s),ze(s),s.content instanceof a&&Ge(s.content);if(ae)return e;if(ee){if(te)for(u=k.call(i.ownerDocument);i.firstChild;)u.appendChild(i.firstChild);else u=i;return(F.shadowroot||F.shadowrootmode)&&(u=T.call(r,u,!0)),u}let d=X?i.outerHTML:i.innerHTML;return X&&B["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&$s(gl,i.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+d),Y&&Ps([O,P,I],e=>{d=Bs(d,e," ")}),C&&ne?C.createHTML(d):d},n.setConfig=function(){Pe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Z=!0},n.clearConfig=function(){Te=null,Z=!1},n.isValidAttribute=function(e,t,n){Te||Pe({});const i=Ee(e),r=Ee(t);return He(i,r,n)},n.addHook=function(e,t){"function"==typeof t&&Ns(_[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=Is(_[e],t);return-1===n?void 0:Ds(_[e],n,1)[0]}return Ms(_[e])},n.removeHooks=function(e){_[e]=[]},n.removeAllHooks=function(){_={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),kl=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 El=class extends oe{constructor(){super(...arguments),this.spinSpeed=.4}updated(){this.style.setProperty("--spin-duration",`${this.spinSpeed}s`)}render(){return B`<div class="spinner"></div>`}};El.styles=u`
6258
6266
  .spinner {
6259
6267
  border: 2px solid rgba(0, 0, 0, 0.2);
6260
6268
  border-top: 2px solid #c057ff;
@@ -6272,7 +6280,7 @@ xmlns="http://www.w3.org/2000/svg"
6272
6280
  transform: rotate(360deg);
6273
6281
  }
6274
6282
  }
6275
- `,Sl([ue({type:Number})],kl.prototype,"spinSpeed",void 0),kl=Sl([se("mini-loader")],kl);var El=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 Tl=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=lu.Default}isMessageStillStreamingChunks(){if(!this.message)return!1;const e=this.message.chunks.find(e=>e.isDone);return!e||this.message.chunks.length===e.order}updated(e){if(this.onMount(),!e.has("message"))return;if(!this.message)return;const{hyperlinks:t,markedText:n}=this.mapAndMarkHyperLinks(this.message.message),i=/(https?:\/\/[^\s]+)/g,r=[],o=[];this.parsedMessage=B`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?B`${a.map(e=>{if(t.find(t=>t.id===e)){const n=t.find(t=>t.id===e);if(!n)return;return o.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),B`<a
6283
+ `,kl([ue({type:Number})],El.prototype,"spinSpeed",void 0),El=kl([se("mini-loader")],El);var Tl=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 _l=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.loadingPreviews=!0,this.websitePreviewInfo=[],this.imagesToDisplay=[],this.imageUrlError=[],this.isLeadMessage=!1,this.widgetType=du.Default}isMessageStillStreamingChunks(){if(!this.message)return!1;const e=this.message.chunks.find(e=>e.isDone);return!e||this.message.chunks.length===e.order}updated(e){if(this.onMount(),!e.has("message"))return;if(!this.message)return;const{hyperlinks:t,markedText:n}=this.mapAndMarkHyperLinks(this.message.message),i=/(https?:\/\/[^\s]+)/g,r=[],o=[];this.parsedMessage=B`${n.trim().split("\n").map(e=>{const n=this.sanitizeMarkdownText(e),a=this.preserveHTMLTags(n);return a?B`${a.map(e=>{if(t.find(t=>t.id===e)){const n=t.find(t=>t.id===e);if(!n)return;return o.push({redirectTo:null==n?void 0:n.link,source:null==n?void 0:n.link}),B`<a
6276
6284
  class="redirect-link"
6277
6285
  href="${null==n?void 0:n.link}"
6278
6286
  target="_blank"
@@ -6284,10 +6292,10 @@ xmlns="http://www.w3.org/2000/svg"
6284
6292
  target="_blank"
6285
6293
  rel="noopener noreferrer"
6286
6294
  >${t}
6287
- </a>`}return B`${li(Al.sanitize(e))} `})}<br />`:B``})}`,this.imagesToDisplay=o,Promise.all(r).then(e=>{this.websitePreviewInfo=e})}preserveHTMLTags(e){var t;const n=e.match(/(<\/?[a-z][^>]*>[^<]*<\/?[a-z]*>|[^\s]+[.,?!]?|\S)/gi);return null!==(t=null==n?void 0:n.filter(e=>""!==e.trim()))&&void 0!==t?t:[]}sanitizeMarkdownText(e){return e.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim,"<b>$1</b>").replace(/\*(.*?)\*/gim,"<i>$1</i>").trim()}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>|<a href="[^"]+"(?: target="[^"]*")?>[^<]+<\/a>|\[.*?\]\([^)]*\.[^)]*\)/g)),n=[],i=t.map(t=>{const n=t[0];if(void 0===t.index)return;const i=e[t.index-1],r=e[t.index+n.length];if(n.startsWith("<https")||n.startsWith("<http"))return{matchedLink:n,link:n.split("|")[0].replace("<",""),hyperlink:n.split("|")[1].replace(">",""),addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)};if(n.startsWith("<a href=")){const e=n.match(/href="([^"]+)"/),t=n.match(/>[^<]+</);return{matchedLink:n,link:e?e[1]:"",hyperlink:t?t[0].slice(1,-1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}{const[e,t]=n.split("](");return{matchedLink:n,link:t?t.slice(0,-1):"",hyperlink:e?e.slice(1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}});return i.forEach(t=>{if(t&&t.link&&t.hyperlink){const i=ts().replace(/-/g,"");n.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.matchedLink,id:i}),e=e.replace(t.matchedLink,`${t.addSpaceBefore?" ":""}${i}${t.addSpaceAfter?" ":""}`)}}),{hyperlinks:n,markedText:e}}async getLinkData(e){var t,n,i,o;try{const a=(await r().get(e)).data,s=(new DOMParser).parseFromString(a,"text/html");return s?{title:null!==(n=null===(t=s.querySelector("title"))||void 0===t?void 0:t.textContent)&&void 0!==n?n:null,description:(null===(i=s.querySelector('meta[name="description"]'))||void 0===i?void 0:i.getAttribute("content"))||null,image:(null===(o=s.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return{title:null,description:null,image:null,favicon:null,link:e}}}render(){return this.message?B`<div class="message-inner-body">
6295
+ </a>`}return B`${li(Sl.sanitize(e))} `})}<br />`:B``})}`,this.imagesToDisplay=o,Promise.all(r).then(e=>{this.websitePreviewInfo=e})}preserveHTMLTags(e){var t;const n=e.match(/(<\/?[a-z][^>]*>[^<]*<\/?[a-z]*>|[^\s]+[.,?!]?|\S)/gi);return null!==(t=null==n?void 0:n.filter(e=>""!==e.trim()))&&void 0!==t?t:[]}sanitizeMarkdownText(e){return e.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim,"<b>$1</b>").replace(/\*(.*?)\*/gim,"<i>$1</i>").trim()}removeTrailingPunctuation(e){return[".",",","!","?",":",";"].includes(e[e.length-1])?this.removeTrailingPunctuation(e.slice(0,-1)):e}mapAndMarkHyperLinks(e){const t=Array.from(e.matchAll(/<https?:\/\/[^|]+\|[^>]+>|<a href="[^"]+"(?: target="[^"]*")?>[^<]+<\/a>|\[.*?\]\([^)]*\.[^)]*\)/g)),n=[],i=t.map(t=>{const n=t[0];if(void 0===t.index)return;const i=e[t.index-1],r=e[t.index+n.length];if(n.startsWith("<https")||n.startsWith("<http"))return{matchedLink:n,link:n.split("|")[0].replace("<",""),hyperlink:n.split("|")[1].replace(">",""),addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)};if(n.startsWith("<a href=")){const e=n.match(/href="([^"]+)"/),t=n.match(/>[^<]+</);return{matchedLink:n,link:e?e[1]:"",hyperlink:t?t[0].slice(1,-1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}{const[e,t]=n.split("](");return{matchedLink:n,link:t?t.slice(0,-1):"",hyperlink:e?e.slice(1):"",addSpaceBefore:!(!i||" "===i),addSpaceAfter:!(!r||" "===r)}}});return i.forEach(t=>{if(t&&t.link&&t.hyperlink){const i=ns().replace(/-/g,"");n.push({link:this.removeTrailingPunctuation(t.link),hyperlink:this.removeTrailingPunctuation(t.hyperlink),mark:t.matchedLink,id:i}),e=e.replace(t.matchedLink,`${t.addSpaceBefore?" ":""}${i}${t.addSpaceAfter?" ":""}`)}}),{hyperlinks:n,markedText:e}}async getLinkData(e){var t,n,i,o;try{const a=(await r().get(e)).data,s=(new DOMParser).parseFromString(a,"text/html");return s?{title:null!==(n=null===(t=s.querySelector("title"))||void 0===t?void 0:t.textContent)&&void 0!==n?n:null,description:(null===(i=s.querySelector('meta[name="description"]'))||void 0===i?void 0:i.getAttribute("content"))||null,image:(null===(o=s.querySelector('meta[property="og:image"]'))||void 0===o?void 0:o.getAttribute("content"))||null,favicon:null,link:e}:{title:null,description:null,image:null,favicon:null,link:e}}catch(t){return{title:null,description:null,image:null,favicon:null,link:e}}}render(){return this.message?B`<div class="message-inner-body">
6288
6296
  ${this.isMessageStillStreamingChunks()?B`<div class="message-loader"><mini-loader></mini-loader></div>`:""}
6289
6297
  <p
6290
- class=${ye({"message-text":this.widgetType!==lu.Utilities,"message-text-large":this.widgetType===lu.Utilities,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}
6298
+ class=${ye({"message-text":this.widgetType!==du.Utilities,"message-text-large":this.widgetType===du.Utilities,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}
6291
6299
  >
6292
6300
  ${this.parsedMessage}
6293
6301
  </p>
@@ -6318,16 +6326,16 @@ xmlns="http://www.w3.org/2000/svg"
6318
6326
  />`:""}
6319
6327
 
6320
6328
  <div class="website-preview-body">
6321
- <p class=${ye({"message-text":this.widgetType!==lu.Utilities,"message-text-large":this.widgetType===lu.Utilities,"website-preview-title":!0,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}>${e.title}</p>
6329
+ <p class=${ye({"message-text":this.widgetType!==du.Utilities,"message-text-large":this.widgetType===du.Utilities,"website-preview-title":!0,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}>${e.title}</p>
6322
6330
  ${e.description?B`<p
6323
- class=${ye({"message-text":this.widgetType!==lu.Utilities,"message-text-large":this.widgetType===lu.Utilities,"website-preview-description":!0,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}
6331
+ class=${ye({"message-text":this.widgetType!==du.Utilities,"message-text-large":this.widgetType===du.Utilities,"website-preview-description":!0,"webchat-font__desktop":!bn(),"webchat-font__mobile":bn()})}
6324
6332
  >
6325
6333
  ${e.description}
6326
6334
  </p>`:""}
6327
6335
  </div>
6328
6336
  </div>
6329
6337
  </a></div> `})}
6330
- </div>`:B``}};Tl.styles=[En,bs,u`
6338
+ </div>`:B``}};_l.styles=[En,vs,u`
6331
6339
  .message-inner-body {
6332
6340
  position: relative;
6333
6341
  }
@@ -6336,7 +6344,7 @@ xmlns="http://www.w3.org/2000/svg"
6336
6344
  bottom: -2px;
6337
6345
  right: -2px;
6338
6346
  }
6339
- `],El([ue({attribute:!0})],Tl.prototype,"buildingSlug",void 0),El([ue({attribute:!0})],Tl.prototype,"message",void 0),El([ue({attribute:!0})],Tl.prototype,"myPubnub",void 0),El([ue({attribute:!0})],Tl.prototype,"onMount",void 0),El([ce()],Tl.prototype,"loadingPreviews",void 0),El([ce()],Tl.prototype,"parsedMessage",void 0),El([ce()],Tl.prototype,"websitePreviewInfo",void 0),El([ce()],Tl.prototype,"imagesToDisplay",void 0),El([ce()],Tl.prototype,"imageUrlError",void 0),El([ue({type:Boolean})],Tl.prototype,"isLeadMessage",void 0),El([ue({attribute:!0})],Tl.prototype,"widgetType",void 0),Tl=El([se("pubnub-message")],Tl);var _l=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 Ol=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.showMediaAsCarousel=!0,this.activeIndex=0}updated(e){this.onMount(),e.has("message")}prevImage(){this.message&&(0===this.activeIndex?this.activeIndex=this.message.media.length-1:this.activeIndex-=1)}nextImage(){this.message&&(this.activeIndex===this.message.media.length-1?this.activeIndex=0:this.activeIndex+=1)}render(){return this.message?this.showMediaAsCarousel?B`<div class="message-inner-body">
6347
+ `],Tl([ue({attribute:!0})],_l.prototype,"buildingSlug",void 0),Tl([ue({attribute:!0})],_l.prototype,"message",void 0),Tl([ue({attribute:!0})],_l.prototype,"myPubnub",void 0),Tl([ue({attribute:!0})],_l.prototype,"onMount",void 0),Tl([ce()],_l.prototype,"loadingPreviews",void 0),Tl([ce()],_l.prototype,"parsedMessage",void 0),Tl([ce()],_l.prototype,"websitePreviewInfo",void 0),Tl([ce()],_l.prototype,"imagesToDisplay",void 0),Tl([ce()],_l.prototype,"imageUrlError",void 0),Tl([ue({type:Boolean})],_l.prototype,"isLeadMessage",void 0),Tl([ue({attribute:!0})],_l.prototype,"widgetType",void 0),_l=Tl([se("pubnub-message")],_l);var Ol=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 Pl=class extends oe{constructor(){super(...arguments),this.onMount=()=>({}),this.showMediaAsCarousel=!0,this.activeIndex=0}updated(e){this.onMount(),e.has("message")}prevImage(){this.message&&(0===this.activeIndex?this.activeIndex=this.message.media.length-1:this.activeIndex-=1)}nextImage(){this.message&&(this.activeIndex===this.message.media.length-1?this.activeIndex=0:this.activeIndex+=1)}render(){return this.message?this.showMediaAsCarousel?B`<div class="message-inner-body">
6340
6348
  <div class="carousel">
6341
6349
  <div
6342
6350
  class="image-container"
@@ -6377,7 +6385,7 @@ xmlns="http://www.w3.org/2000/svg"
6377
6385
  rel="noopener noreferrer"
6378
6386
  ><img class=${"displayed-message-image"} src=${e.url} alt=""
6379
6387
  /></a>`)}
6380
- </div>`:B``}};Ol.styles=[En,bs,u`
6388
+ </div>`:B``}};Pl.styles=[En,vs,u`
6381
6389
  .carousel {
6382
6390
  position: relative;
6383
6391
  max-width: 400px;
@@ -6469,7 +6477,7 @@ xmlns="http://www.w3.org/2000/svg"
6469
6477
  max-height: 200px;
6470
6478
  overflow-y: auto;
6471
6479
  }
6472
- `],_l([ue({attribute:!0})],Ol.prototype,"message",void 0),_l([ue({attribute:!0})],Ol.prototype,"myPubnub",void 0),_l([ue({attribute:!0})],Ol.prototype,"onMount",void 0),_l([ce()],Ol.prototype,"showMediaAsCarousel",void 0),_l([ce()],Ol.prototype,"activeIndex",void 0),Ol=_l([se("pubnub-media")],Ol);function Pl(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Il(e,t){Ge(2,arguments);var n=Qe(e),i=Qe(t),r=Pl(n,i),o=Math.abs(function(e,t){Ge(2,arguments);var n=Qt(e),i=Qt(t),r=n.getTime()-It(n),o=i.getTime()-It(i);return Math.round((r-o)/864e5)}(n,i));n.setDate(n.getDate()-r*o);var a=r*(o-Number(Pl(n,i)===-r));return 0===a?0:a}const Ml=u`
6480
+ `],Ol([ue({attribute:!0})],Pl.prototype,"message",void 0),Ol([ue({attribute:!0})],Pl.prototype,"myPubnub",void 0),Ol([ue({attribute:!0})],Pl.prototype,"onMount",void 0),Ol([ce()],Pl.prototype,"showMediaAsCarousel",void 0),Ol([ce()],Pl.prototype,"activeIndex",void 0),Pl=Ol([se("pubnub-media")],Pl);function Il(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Ml(e,t){Ge(2,arguments);var n=Qe(e),i=Qe(t),r=Il(n,i),o=Math.abs(function(e,t){Ge(2,arguments);var n=Qt(e),i=Qt(t),r=n.getTime()-It(n),o=i.getTime()-It(i);return Math.round((r-o)/864e5)}(n,i));n.setDate(n.getDate()-r*o);var a=r*(o-Number(Il(n,i)===-r));return 0===a?0:a}const Nl=u`
6473
6481
  #utilities-container {
6474
6482
  position: fixed;
6475
6483
 
@@ -6578,17 +6586,17 @@ xmlns="http://www.w3.org/2000/svg"
6578
6586
  .health-bttn-allow-access {
6579
6587
  padding-right: 28px;
6580
6588
  }
6581
- `,Nl=(e="black")=>j`
6589
+ `,Dl=(e="black")=>j`
6582
6590
  <svg width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6583
6591
  <path fill-rule="evenodd" clip-rule="evenodd" d="M15 0C17.7614 0 20 2.23858 20 5V15C20 17.7614 17.7614 20 15 20H5C2.23858 20 0 17.7614 0 15V5C0 2.23858 2.23858 0 5 0H15ZM18 5C18 3.34315 16.6569 2 15 2H5C3.34315 2 2 3.34315 2 5V15C2 16.6569 3.34315 18 5 18H15C16.6569 18 18 16.6569 18 15V5Z" fill="${e}"/>
6584
6592
  <path d="M12.1893 9.25L10.4697 7.53033C10.1768 7.23744 10.1768 6.76256 10.4697 6.46967C10.7626 6.17678 11.2374 6.17678 11.5303 6.46967L13.8232 8.76256C14.5066 9.44598 14.5066 10.554 13.8232 11.2374L11.5303 13.5303C11.2374 13.8232 10.7626 13.8232 10.4697 13.5303C10.1768 13.2374 10.1768 12.7626 10.4697 12.4697L12.1893 10.75L6 10.75C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25L12.1893 9.25Z" fill="${e}"/>
6585
6593
  </svg>
6586
- `,Dl=(e="black")=>j`
6594
+ `,Ll=(e="black")=>j`
6587
6595
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6588
6596
  <path fill-rule="evenodd" clip-rule="evenodd" d="M15 0C17.7614 0 20 2.23858 20 5V15C20 17.7614 17.7614 20 15 20H5C2.23858 20 0 17.7614 0 15V5C0 2.23858 2.23858 0 5 0H15ZM18 5C18 3.34315 16.6569 2 15 2H5C3.34315 2 2 3.34315 2 5V15C2 16.6569 3.34315 18 5 18H15C16.6569 18 18 16.6569 18 15V5Z" fill="${e}"/>
6589
6597
  <path d="M12.1893 9.25L10.4697 7.53033C10.1768 7.23744 10.1768 6.76256 10.4697 6.46967C10.7626 6.17678 11.2374 6.17678 11.5303 6.46967L13.8232 8.76256C14.5066 9.44598 14.5066 10.554 13.8232 11.2374L11.5303 13.5303C11.2374 13.8232 10.7626 13.8232 10.4697 13.5303C10.1768 13.2374 10.1768 12.7626 10.4697 12.4697L12.1893 10.75L6 10.75C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25L12.1893 9.25Z" fill="${e}"/>
6590
6598
  </svg>
6591
- `;var Ll=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 Ul=class extends oe{constructor(){super(...arguments),this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.onMount=()=>({}),this.isHealthChat=!1,this.widgetType=lu.Default,this.primaryColor=Ue,this.backgroundColor=Re,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=bn(),this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t;0!==e.length&&(this.messageInput.value="",this.autoResizeMessageInput(),0===this.messages.length&&(this.messages=[{timestamp:0,message:e,isLeadMessage:!0,chunks:[{text:e,order:0,isDone:!0}],type:us.text}]),await(null===(t=this.myPubnub)||void 0===t?void 0:t.sendMessage(e)))},this.scrollToChatBottom=()=>{this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"smooth"})},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>this.requiresConsent&&!this.hasReceivedConsent}get consentKey(){return`${this.orgSlug}Consent`}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.simpleChatMessages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener(e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading}),this.onMount();const n=localStorage.getItem(this.consentKey);if(!n)return void(this.hasReceivedConsent=!1);const i=JSON.parse(n),{timestamp:r,consentId:o}=i;Il(new Date,new Date(r))<7&&o===fi?this.hasReceivedConsent=!0:(this.hasReceivedConsent=!1,localStorage.removeItem(this.consentKey))}async updated(){this.scrollToChatBottom();try{const e=document.getElementById("#healthchat-container");if(!e)return;e.focus()}catch(e){}}render(){var e,t,n,i,r,o,a,s,l,u,c,d,h,p,f;if(!this.buildingSlug)return B``;const g=null===(e=this.building)||void 0===e?void 0:e.id;let m={};if(m=this._isMobile?{top:void 0,bottom:0,left:void 0,right:0}:{top:void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:void 0===this.bottom||isNaN(this.bottom)?"130px":`${this.bottom}px`,left:void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:void 0===this.right||isNaN(this.right)?"18px":`${this.right}px`},22320===g&&(m={...m,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===lu.Utilities)return B`
6599
+ `;var Ul=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 Rl=class extends oe{constructor(){super(...arguments),this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.onMount=()=>({}),this.isHealthChat=!1,this.widgetType=du.Default,this.primaryColor=Ue,this.backgroundColor=Re,this.onClickExit=()=>{localStorage.setItem("isChatOpen","false")},this.requiresConsent=!1,this._isMobile=bn(),this.messages=[],this.isLoadingMessages=!1,this.hasReceivedConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.websitePreviewMapping={},this.sendMessage=async e=>{var t;0!==e.length&&(this.messageInput.value="",this.autoResizeMessageInput(),0===this.messages.length&&(this.messages=[{timestamp:0,message:e,isLeadMessage:!0,chunks:[{text:e,order:0,isDone:!0}],type:cs.text}]),await(null===(t=this.myPubnub)||void 0===t?void 0:t.sendMessage(e)))},this.scrollToChatBottom=()=>{this.messageBody.scrollTo({top:this.messageBody.scrollHeight-this.messageBody.clientHeight,behavior:"smooth"})},this.autoResizeMessageInput=()=>{this.messageInput.style.height="auto",this.messageInput.style.height=this.messageInput.scrollHeight+"px"},this.needsConsent=()=>this.requiresConsent&&!this.hasReceivedConsent}get consentKey(){return`${this.orgSlug}Consent`}connectedCallback(){super.connectedCallback(),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}disconnectedCallback(){var e;null===(e=this._cleanupMobileListener)||void 0===e||e.call(this),super.disconnectedCallback()}firstUpdated(){var e,t;this.messages=(null===(e=this.myPubnub)||void 0===e?void 0:e.simpleChatMessages)||[],null===(t=this.myPubnub)||void 0===t||t.addChatListener(e=>{this.messages=e.messages,this.isLoadingMessages=e.isLoading}),this.onMount();const n=localStorage.getItem(this.consentKey);if(!n)return void(this.hasReceivedConsent=!1);const i=JSON.parse(n),{timestamp:r,consentId:o}=i;Ml(new Date,new Date(r))<7&&o===fi?this.hasReceivedConsent=!0:(this.hasReceivedConsent=!1,localStorage.removeItem(this.consentKey))}async updated(){this.scrollToChatBottom();try{const e=document.getElementById("#healthchat-container");if(!e)return;e.focus()}catch(e){}}render(){var e,t,n,i,r,o,a,s,l,u,c,d,h,p,f;if(!this.buildingSlug)return B``;const g=null===(e=this.building)||void 0===e?void 0:e.id;let m={};if(m=this._isMobile?{top:void 0,bottom:0,left:void 0,right:0}:{top:void 0===this.top||isNaN(this.top)?void 0:`${this.top}px`,bottom:void 0===this.bottom||isNaN(this.bottom)?"130px":`${this.bottom}px`,left:void 0===this.left||isNaN(this.left)?void 0:`${this.left}px`,right:void 0===this.right||isNaN(this.right)?"18px":`${this.right}px`},22320===g&&(m={...m,fontFamily:'"Helvetica Neue", Arial'}),this.widgetType===du.Utilities)return B`
6592
6600
  <div
6593
6601
  id="utilities-container"
6594
6602
  class=${ye({"pubnub-container__mobile":this._isMobile,"utilities-container__desktop":!this._isMobile})}
@@ -6603,7 +6611,7 @@ xmlns="http://www.w3.org/2000/svg"
6603
6611
  @click=${this.onClickExit}
6604
6612
  aria-label="Close chat"
6605
6613
  >
6606
- ${io("black")}
6614
+ ${ro("black")}
6607
6615
  </button>
6608
6616
  </div>
6609
6617
  <div
@@ -6642,15 +6650,15 @@ xmlns="http://www.w3.org/2000/svg"
6642
6650
  key=${e.timestamp}
6643
6651
  tabindex="0"
6644
6652
  role="article"
6645
- aria-label="${e.isLeadMessage?"You":"Elise"}: ${ss(e)?e.message:"Media message"}"
6653
+ aria-label="${e.isLeadMessage?"You":"Elise"}: ${ls(e)?e.message:"Media message"}"
6646
6654
  >
6647
- ${ls(e)?B` <pubnub-media
6655
+ ${us(e)?B` <pubnub-media
6648
6656
  .message=${e}
6649
6657
  .myPubnub=${this.myPubnub}
6650
6658
  .onMount=${()=>this.scrollToChatBottom()}
6651
6659
  >
6652
6660
  </pubnub-media>`:""}
6653
- ${ss(e)?B` <pubnub-message
6661
+ ${ls(e)?B` <pubnub-message
6654
6662
  .message=${e}
6655
6663
  .myPubnub=${this.myPubnub}
6656
6664
  .onMount=${()=>this.scrollToChatBottom()}
@@ -6693,12 +6701,12 @@ xmlns="http://www.w3.org/2000/svg"
6693
6701
  class=${ye({"health-bttn-allow-access":this._isMobile})}
6694
6702
  @click=${()=>this.sendMessage(this.messageInput.value)}
6695
6703
  >
6696
- ${Nl("black")}
6704
+ ${Dl("black")}
6697
6705
  </button>
6698
6706
  </div>
6699
6707
  </div>
6700
6708
  </div>
6701
- `;if(this.widgetType===lu.Healthcare)return B`
6709
+ `;if(this.widgetType===du.Healthcare)return B`
6702
6710
  <div
6703
6711
  id="healthchat-container"
6704
6712
  class=${ye({"pubnub-container__mobile":this._isMobile,"healthchat-container__desktop":!this._isMobile})}
@@ -6717,7 +6725,7 @@ xmlns="http://www.w3.org/2000/svg"
6717
6725
  @click=${this.onClickExit}
6718
6726
  aria-label="Close chat"
6719
6727
  >
6720
- ${io("black")}
6728
+ ${ro("black")}
6721
6729
  </button>
6722
6730
  </div>
6723
6731
  <div
@@ -6757,15 +6765,15 @@ xmlns="http://www.w3.org/2000/svg"
6757
6765
  key=${e.timestamp}
6758
6766
  tabindex="0"
6759
6767
  role="article"
6760
- aria-label="${e.isLeadMessage?"You":"Elise"}: ${ss(e)?e.message:"Media message"}"
6768
+ aria-label="${e.isLeadMessage?"You":"Elise"}: ${ls(e)?e.message:"Media message"}"
6761
6769
  >
6762
- ${ls(e)?B` <pubnub-media
6770
+ ${us(e)?B` <pubnub-media
6763
6771
  .message=${e}
6764
6772
  .myPubnub=${this.myPubnub}
6765
6773
  .onMount=${()=>this.scrollToChatBottom()}
6766
6774
  >
6767
6775
  </pubnub-media>`:""}
6768
- ${ss(e)?B` <pubnub-message
6776
+ ${ls(e)?B` <pubnub-message
6769
6777
  .message=${e}
6770
6778
  .myPubnub=${this.myPubnub}
6771
6779
  .onMount=${()=>this.scrollToChatBottom()}
@@ -6808,7 +6816,7 @@ xmlns="http://www.w3.org/2000/svg"
6808
6816
  class=${ye({"health-bttn-allow-access":this._isMobile})}
6809
6817
  @click=${()=>this.sendMessage(this.messageInput.value)}
6810
6818
  >
6811
- ${this._isMobile?Nl("black"):Dl("black")}
6819
+ ${this._isMobile?Dl("black"):Ll("black")}
6812
6820
  </button>
6813
6821
  </div>
6814
6822
  </div>
@@ -6831,7 +6839,7 @@ xmlns="http://www.w3.org/2000/svg"
6831
6839
  @click=${this.onClickExit}
6832
6840
  aria-label="Close chat"
6833
6841
  >
6834
- ${io("black")}
6842
+ ${ro("black")}
6835
6843
  </button>
6836
6844
  </div>
6837
6845
  <div
@@ -6869,15 +6877,15 @@ xmlns="http://www.w3.org/2000/svg"
6869
6877
  key=${e.timestamp}
6870
6878
  tabindex="0"
6871
6879
  role="article"
6872
- aria-label="${e.isLeadMessage?"You":"Elise"}: ${ss(e)?e.message:"Media message"}"
6880
+ aria-label="${e.isLeadMessage?"You":"Elise"}: ${ls(e)?e.message:"Media message"}"
6873
6881
  >
6874
- ${ls(e)?B` <pubnub-media
6882
+ ${us(e)?B` <pubnub-media
6875
6883
  .message=${e}
6876
6884
  .myPubnub=${this.myPubnub}
6877
6885
  .onMount=${()=>this.scrollToChatBottom()}
6878
6886
  >
6879
6887
  </pubnub-media>`:""}
6880
- ${ss(e)?B` <pubnub-message
6888
+ ${ls(e)?B` <pubnub-message
6881
6889
  .message=${e}
6882
6890
  .myPubnub=${this.myPubnub}
6883
6891
  .onMount=${()=>this.scrollToChatBottom()}
@@ -6920,11 +6928,11 @@ xmlns="http://www.w3.org/2000/svg"
6920
6928
  aria-label="Send message"
6921
6929
  aria-describedby="Send message"
6922
6930
  >
6923
- ${He(this.building.orgId,this.building.id)&&this.primaryColor!==Ue?Dl("black"):Dl("white")}
6931
+ ${He(this.building.orgId,this.building.id)&&this.primaryColor!==Ue?Ll("black"):Ll("white")}
6924
6932
  </button>
6925
6933
  </div>
6926
6934
  </div>
6927
- `}};Ul.styles=[En,bs,ys,ms,Ml],Ll([ue({type:Number})],Ul.prototype,"right",void 0),Ll([ue({type:Number})],Ul.prototype,"bottom",void 0),Ll([ue({type:Number})],Ul.prototype,"top",void 0),Ll([ue({type:Number})],Ul.prototype,"left",void 0),Ll([ue({attribute:!0})],Ul.prototype,"onMount",void 0),Ll([ue({attribute:!0})],Ul.prototype,"channel",void 0),Ll([ue({attribute:!0})],Ul.prototype,"isHealthChat",void 0),Ll([ue({attribute:!0})],Ul.prototype,"myPubnub",void 0),Ll([ue({attribute:!0})],Ul.prototype,"orgSlug",void 0),Ll([ue({attribute:!0})],Ul.prototype,"buildingSlug",void 0),Ll([ue({attribute:!0})],Ul.prototype,"widgetType",void 0),Ll([ue({attribute:!0})],Ul.prototype,"building",void 0),Ll([ue({attribute:!0})],Ul.prototype,"primaryColor",void 0),Ll([ue({attribute:!0})],Ul.prototype,"backgroundColor",void 0),Ll([ue({attribute:!0})],Ul.prototype,"onClickExit",void 0),Ll([ue({attribute:!0})],Ul.prototype,"requiresConsent",void 0),Ll([de("#message-input",!0)],Ul.prototype,"messageInput",void 0),Ll([de("#conversation-body",!0)],Ul.prototype,"messageBody",void 0),Ll([ce()],Ul.prototype,"_isMobile",void 0),Ll([ce()],Ul.prototype,"messages",void 0),Ll([ce()],Ul.prototype,"isLoadingMessages",void 0),Ll([ce()],Ul.prototype,"hasReceivedConsent",void 0),Ll([ce()],Ul.prototype,"privacyPolicyUrl",void 0),Ll([ce()],Ul.prototype,"websitePreviewMapping",void 0),Ul=Ll([se("pubnub-chat")],Ul);const Rl="cdn.skypack.dev/@meetelise/chat",Bl="cdn.eliseai.com/@meetelise/chat",jl=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Rl)||n.includes(Rl))return"skypack";if(e.includes(Bl)||n.includes(Bl))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},Fl=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?`${t}/units`:t,Hl=["Check Availability","Apply Now"],$l=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&Hl.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),Ai({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:xi.info,buildingSlug:i,orgSlug:n}),!0},zl=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&$l(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)$l(s[e],t,n,i)}},Gl=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)$l(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)zl(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class Ql{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>On(Pn(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=ki();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Ci()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Ai({logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=Oi(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:On(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Rn(e.timestampInitiallyLogged).getTime()-Rn(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:On(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Rn(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var Wl,ql=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 Vl=Wl=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=bn(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=ri.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=lu.Default,this.onWidgetLoaded=Ca(),this.onSstClose=Ca(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const e=await Ui(this.orgSlug,this.buildingSlug);if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{jl(this.orgSlug,this.buildingSlug)}catch(e){}await kr(e,this.buildingSlug,this.orgSlug)&&(Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==e?void 0:e.launchedDateTime)?.01:.05}),this.buildingWebchatView=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0))},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C,x,A,S,k,E,T,_,O,P,I,M,N,D,L,U,R,B,j,F,H,$,z,G,Q,W,q,V;const Y=this.buildingWebchatView;if(!Y)return;Y&&this.orgSlug&&Kl(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const K=Y.featureFlagWebchatMarketingSourceDropdownConfiguration,X=Y.featureFlagWebchatUseDniPhoneNumberBySource,Z=Y.featureFlagInsertDniIntoWebsite,J=Y.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite,[ee,te]=await Promise.all([za(this.orgSlug,this.buildingSlug),oi(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Ie(Y.phoneNumber)),this.leadSources=ee,this.featureFlagShowDropdown=K;const ne=Y.textWithUsPhoneNumber?Y.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug),ie=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,re=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,oe={callDesktop:null!==(c=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==c&&c,callMobile:null!==(h=null===(d=this.buildingWebchatView)||void 0===d?void 0:d.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!ne)&&void 0!==x&&x,textMobile:null!==(S=(null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowTextMobile)&&!!ne)&&void 0!==S&&S,sstDesktop:null!==(E=null===(k=this.buildingWebchatView)||void 0===k?void 0:k.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(_=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==_&&_,calcDesktop:ie,calcMobile:re};var ae,se;this.enabledChatWidgets=_a(oe),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(se=this.handleTourClicked,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",e=>{e.preventDefault(),se(e)})}),J&&(e=>{document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(t=>{t&&t.addEventListener("click",t=>{t.preventDefault(),e(t)})})})(this.handleTourClicked),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&(ae=null!==(I=null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&void 0!==I?I:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(ae)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(M=this.buildingWebchatView.primaryColor)&&void 0!==M?M:null,this.backgroundColor=null!==(N=this.buildingWebchatView.secondaryColor)&&void 0!==N?N:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==D?D:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(L=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==L?L:null,this.webchatConfigHasAutoOpenChat=null!==(U=this.buildingWebchatView.autoOpenChat)&&void 0!==U&&U,this.requiresConsent=null!==(R=this.buildingWebchatView.requiresConsentForChat)&&void 0!==R&&R,this.hideMobileFeatures=null!==(B=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==B&&B,this.privacyPolicyUrl=null!==(j=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==j?j:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===Mi.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===Mi.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===Mi.EMOJI&&(this.designConcept=Mi.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Ue),null===this.backgroundColor&&(this.backgroundColor=Re);const le=null!==(H=null===(F=this.buildingWebchatView)||void 0===F?void 0:F.phoneNumber)&&void 0!==H?H:"";let ue=null;if(X&&(ue=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Ie(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(z=null===($=this.LeadSourceClient)||void 0===$?void 0:$.leadSource)&&void 0!==z?z:null),ue&&!ue.isMatch&&(ue.number=le)),Z&&(null==ue?void 0:ue.number)){const e=ps(ue.number,this.orgSlug,this.buildingSlug);e>0&&Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const ce=localStorage.getItem("eliseai_phone_number_devtest");ce&&ps(ce,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=ue||{number:le,isMatch:!1,isPropertyWebsiteCatchall:!0};const de=null!==(Q=null===(G=this.LeadSourceClient)||void 0===G?void 0:G.leadSource)&&void 0!==Q?Q:null;if(de&&(this.leadSources.includes(de)||this.leadSources.push(de)),Vn(Y.id),te&&this.buildingSlug&&(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isLiveOnApplications)){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=Fl(o,e);l.setAttribute("href",s),a++,Ai({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Ai({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:xi.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}`,this.orgSlug,this.buildingSlug);e>0&&Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}this.buildingSlug&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&Gl(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s;if(!this.buildingWebchatView)return;const l=rs(this.buildingSlug),u=os(this.buildingSlug,l),c=u?l:is(this.buildingSlug,!1);if(!c.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Pi,this.LeadSourceMultitouchClient=new Ql(this.orgSlug,this.buildingSlug),this.myPubnub=new cs(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,c.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const d=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,u&&null!==(e=c.leadId)&&void 0!==e?e:void 0);d&&is(this.buildingSlug,c.initiatedChat,d.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const h=await(null===(t=this.LeadSourceClient)||void 0===t?void 0:t.generateUserLeadSource({leadId:null!==(i=null===(n=this.myPubnub)||void 0===n?void 0:n.leadUserId)&&void 0!==i?i:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));h&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(h),"property-website"!==Oi(this.orgSlug)?this.myPubnub.leadSource=null!==(o=null===(r=this.LeadSourceClient)||void 0===r?void 0:r.leadSource)&&void 0!==o?o:Oi(this.orgSlug):this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:null;const p=rs(this.buildingSlug);p.initiatedChat&&await this.myPubnub.initializePubnub(p)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Dn(Rn(t)));return!!e&&!!n&&!bn()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",On(function(e,t){return Ge(2,arguments),st(e,6e4*at(t))}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let c=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&c.push(...this.collectFocusableElements(e)),t&&c.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(c=this.collectFocusableElements(e))}if(0===c.length)return;e.preventDefault();const d=this.getDeepActiveElement(),h=c.findIndex(e=>e===d);c[e.shiftKey?(h-1+c.length)%c.length:(h+1)%c.length].focus()},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new wi(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ns(this.buildingSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches(Wl.FOCUSABLE_SELECTOR)&&Wl.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){Ai({logType:xi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C,x,A,S,k,E,T,_,O,P,I,M,N,D,L,U;ka();const R=this.hideLauncher&&!this.isLoading&&!this._isMobile;return B`
6935
+ `}};Rl.styles=[En,vs,bs,ys,Nl],Ul([ue({type:Number})],Rl.prototype,"right",void 0),Ul([ue({type:Number})],Rl.prototype,"bottom",void 0),Ul([ue({type:Number})],Rl.prototype,"top",void 0),Ul([ue({type:Number})],Rl.prototype,"left",void 0),Ul([ue({attribute:!0})],Rl.prototype,"onMount",void 0),Ul([ue({attribute:!0})],Rl.prototype,"channel",void 0),Ul([ue({attribute:!0})],Rl.prototype,"isHealthChat",void 0),Ul([ue({attribute:!0})],Rl.prototype,"myPubnub",void 0),Ul([ue({attribute:!0})],Rl.prototype,"orgSlug",void 0),Ul([ue({attribute:!0})],Rl.prototype,"buildingSlug",void 0),Ul([ue({attribute:!0})],Rl.prototype,"widgetType",void 0),Ul([ue({attribute:!0})],Rl.prototype,"building",void 0),Ul([ue({attribute:!0})],Rl.prototype,"primaryColor",void 0),Ul([ue({attribute:!0})],Rl.prototype,"backgroundColor",void 0),Ul([ue({attribute:!0})],Rl.prototype,"onClickExit",void 0),Ul([ue({attribute:!0})],Rl.prototype,"requiresConsent",void 0),Ul([de("#message-input",!0)],Rl.prototype,"messageInput",void 0),Ul([de("#conversation-body",!0)],Rl.prototype,"messageBody",void 0),Ul([ce()],Rl.prototype,"_isMobile",void 0),Ul([ce()],Rl.prototype,"messages",void 0),Ul([ce()],Rl.prototype,"isLoadingMessages",void 0),Ul([ce()],Rl.prototype,"hasReceivedConsent",void 0),Ul([ce()],Rl.prototype,"privacyPolicyUrl",void 0),Ul([ce()],Rl.prototype,"websitePreviewMapping",void 0),Rl=Ul([se("pubnub-chat")],Rl);const Bl="cdn.skypack.dev/@meetelise/chat",jl="cdn.eliseai.com/@meetelise/chat",Fl=async(e,t)=>{try{if(Math.random()>=.15)return;const n=(()=>{try{const e=document.getElementsByTagName("script");for(const t of e){const e=t.src||"",n=t.textContent||"";if(e.includes(Bl)||n.includes(Bl))return"skypack";if(e.includes(jl)||n.includes(jl))return"eliseai"}return"unknown"}catch(e){return"unknown"}})();await r().post("https://app.meetelise.com/platformApi/webchat/cdn-version",{cdn_version:n},{params:{cdn_version:n},headers:{"Content-Type":"application/json","building-slug":t,"org-slug":e}})}catch(e){}},Hl=(e,t)=>["floor plan","floorplan","floor plans","floorplans","apply here"].some(t=>e.toLowerCase().includes(t))?`${t}/units`:t,$l={"95ae958e-95db-11ed-9862-6f4db5533d3f":"8008db60-45b7-11f1-88ac-635f686365da","95ae96b0-95db-11ed-9863-a7aa664fd985":"72ed27c4-45b7-11f1-82d9-37b7db547687"},zl="https://applications.eliseai.com",Gl=["Check Availability","Apply Now"],Ql=(e,t,n,i)=>{if(!(e=>{var t;if(!e.classList.contains("floorplan-button"))return!1;const n=e.getElementsByTagName("span");if(1!==n.length)return!1;const i=null===(t=n[0].textContent)||void 0===t?void 0:t.trim();return null!=i&&Gl.includes(i)})(e))return!1;if(e.getAttribute("href")===t)return!1;const r=e.getAttribute("href");return e.setAttribute("href",t),e.setAttribute("target","_blank"),Ai({logTitle:"CHECK_AVAIL_OVERWRITE",logData:{oldHref:r,newHref:t,website:window.location.href},logType:xi.info,buildingSlug:i,orgSlug:n}),!0},Wl=(e,t,n,i)=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.nodeType!==Node.ELEMENT_NODE)continue;const a=o;"A"===a.tagName&&Ql(a,t,n,i);const s=a.getElementsByTagName("a");for(let e=0;e<s.length;e++)Ql(s[e],t,n,i)}},ql=(e,t,n)=>{((e,t,n)=>{const i=document.body.getElementsByTagName("a");for(let r=0;r<i.length;r++)Ql(i[r],e,t,n)})(n,e,t);new MutationObserver(i=>{for(const r of i)Wl(r.addedNodes,n,e,t)}).observe(document.body,{childList:!0,subtree:!0})};class Vl{constructor(e,t){this.persistLeadSourceTTLDays=30,this.maxSourcesNonPropertyWebsiteCount=3,this._generateLeadSourceLocalStorageKey=()=>`com.eliseai.webchat.leadsources.v2.buildingslug=${this.buildingSlug}`,this._generateNewExpirationTimestamp=()=>On(Pn(new Date,this.persistLeadSourceTTLDays)),this._generateLeadSourceParameters=()=>{const e=ki();return{websiteOrigin:window.location.origin,websiteSearch:window.location.search,queryParameters:e,referrer:document.referrer,parsedUtmSource:e?e.utm_source:null,campaignSources:Object.values(Ci()).filter(e=>e)}},this.addSafeLeadSourceTouchpoint=e=>{const t=this.getLocalStorageMultitouchValue(),n=this._generateLeadSourceLocalStorageKey();if(!t||this.isExpiredTimestamp(t.timestampExpires)){const t={timestampExpires:this._generateNewExpirationTimestamp(),leadSources:[{parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"touchpoint"}]};localStorage.setItem(n,JSON.stringify(t))}else{if(t.leadSources.find(t=>t.leadSourceValue===e))return;if(t.leadSources.length<this.maxSourcesNonPropertyWebsiteCount)return t.leadSources.push({parameters:this._generateLeadSourceParameters(),leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"touchpoint"}),t.timestampExpires=this._generateNewExpirationTimestamp(),void localStorage.setItem(n,JSON.stringify(t));Ai({logType:xi.warn,buildingSlug:this.buildingSlug,orgSlug:this.orgSlug,logTitle:"TOO_MANY_LEAD_SOURCES",logData:{buildingSlug:this.buildingSlug}})}},this.getSafeLeadSourceTouchpointsWithDefault=({includedUserSelectedLeadSource:e})=>{const t=this.getLocalStorageMultitouchValue(),n=Oi(this.orgSlug);if(!t){const t=[{leadSourceValue:n,timestampInitiallyLogged:On(new Date),type:"default"}];return e&&t.push({leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"user-selected"}),t}const i=t.leadSources.length>0?t.leadSources.sort((e,t)=>Rn(e.timestampInitiallyLogged).getTime()-Rn(t.timestampInitiallyLogged).getTime())[0].timestampInitiallyLogged:On(new Date),r=[{timestampInitiallyLogged:i,leadSourceValue:n,type:"default"},...t.leadSources.map(e=>({timestampInitiallyLogged:e.timestampInitiallyLogged,leadSourceValue:e.leadSourceValue,type:e.type}))];return e&&r.push({leadSourceValue:e,timestampInitiallyLogged:On(new Date),type:"user-selected"}),r},this.getLocalStorageMultitouchValue=()=>{const e=this._generateLeadSourceLocalStorageKey(),t=localStorage.getItem(e);if(!t)return null;return JSON.parse(t)},this.isExpiredTimestamp=e=>Rn(e)<new Date,this.resetLeadSourceTouchpoints=()=>{const e=this._generateLeadSourceLocalStorageKey();return localStorage.removeItem(e),!0},this.orgSlug=e,this.buildingSlug=t}}var Yl,Kl=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 Xl=Yl=class extends oe{constructor(){super(...arguments),this.buildingSlug="",this.orgSlug="",this.launcherStyles={},this.mobileStyles={},this.isMinimized=!1,this.primaryColor=null,this.backgroundColor=null,this.foregroundColorOnPrimaryBackgroundColor=null,this.foregroundColorOnSecondaryBackgroundColor=null,this._isMobile=bn(),this.chatId="",this.analytics=null,this.launcher=null,this.buildingWebchatView=null,this.designConcept=null,this.leadSources=null,this.currentLeadSource=null,this.featureFlagShowDropdown=ri.always,this.phoneNumberForSource=null,this.hasMounted=!1,this.hideLauncher=!1,this.isLoading=!0,this.showTourNextToChat=!1,this.displayPubnubChat=!1,this.myPubnub=null,this.LeadSourceClient=null,this.LeadSourceMultitouchClient=null,this.sampleRateToUse=.05,this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.overrideRentgrata=!1,this.widgetType=du.Default,this.onWidgetLoaded=xa(),this.onSstClose=xa(),this.enabledChatWidgets={callDesktop:!1,callMobile:!1,chatMobile:!1,chatDesktop:!1,emailDesktop:!1,emailMobile:!1,textDesktop:!1,textMobile:!1,sstDesktop:!1,sstMobile:!1,calcDesktop:!1,calcMobile:!1},this.webchatConfigHasAutoOpenChat=!1,this.requiresConsent=!1,this.hideMobileFeatures=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.launcherRef=Ee(),this.firstUpdated=async()=>this.setupWebchat(),this.setupWebchat=async()=>{if(!this.buildingSlug||!this.orgSlug)return;const e=await Ui(this.orgSlug,this.buildingSlug);if(Math.random()<.2)try{(async(e,t)=>{const n=window.rentgrata;if(!n)return;const i=n.Widget;if(!i)return;const o=i.config;if(!o)return;const a=o.widgetKey;a&&await r().post(`https://app.meetelise.com/platformApi/webchat/rentgrata?token=${a}`,{},{headers:{"Content-Type":"application/json","building-slug":null!=e?e:"","org-slug":null!=t?t:""}})})(this.buildingSlug,this.orgSlug)}catch(e){}try{Fl(this.orgSlug,this.buildingSlug)}catch(e){}await Er(e,this.buildingSlug,this.orgSlug)&&(Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_pixel_on_site:!0,is_any_webchat_showing:!0},sampleRate:(null==e?void 0:e.launchedDateTime)?.01:.05}),this.buildingWebchatView=e,await this.initializeChatVariables(),await this.handleChatInitializeAnalytics(),await this.setBuildingDerivedInfo(),this.attachOnClickToLauncher(),this.shouldAutoOpenChat(this.webchatConfigHasAutoOpenChat)&&(this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,this.updateAlreadyAutoOpenedTimestamp()),this.isLoading=!1,"true"===localStorage.getItem("isChatOpen")&&(this.hideLauncher=!0,this.displayPubnubChat=!0))},this.setBuildingDerivedInfo=async()=>{var e,t,n,i,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C,x,A,S,k,E,T,_,O,P,I,M,N,D,L,U,R,B,j,F,H,$,z,G,Q,W,q,V;const Y=this.buildingWebchatView;if(!Y)return;Y&&this.orgSlug&&Jl(this.orgSlug,null!==(t=null===(e=this.LeadSourceClient)||void 0===e?void 0:e.chatId)&&void 0!==t?t:null,this.sampleRateToUse,this.buildingSlug,null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null);const K=Y.featureFlagWebchatMarketingSourceDropdownConfiguration,X=Y.featureFlagWebchatUseDniPhoneNumberBySource,Z=Y.featureFlagInsertDniIntoWebsite,J=Y.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite,[ee,te]=await Promise.all([Ga(this.orgSlug,this.buildingSlug),oi(this.buildingSlug)]);this.buildingWebchatView&&(this.buildingWebchatView.phoneNumber=Ie(Y.phoneNumber)),this.leadSources=ee,this.featureFlagShowDropdown=K;const ne=Y.textWithUsPhoneNumber?Y.textWithUsPhoneNumber:await(async e=>{try{const t="https://app.meetelise.com",n=await r().get(`${t}/platformApi/webchat/${e}/phone-number`);if(n.data)return n.data}catch(t){return Ai({logType:xi.error,buildingSlug:e,logTitle:"[ERROR_GETTING_PHONE_NUMBERS]",logData:{error:t}}),null}return null})(this.buildingSlug),ie=null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.shouldShowPricingCalculatorDesktop)&&void 0!==a&&a,re=null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.shouldShowPricingCalculatorMobile)&&void 0!==l&&l,oe={callDesktop:null!==(c=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.shouldShowPhoneDesktop)&&void 0!==c&&c,callMobile:null!==(h=null===(d=this.buildingWebchatView)||void 0===d?void 0:d.shouldShowPhoneMobile)&&void 0!==h&&h,chatDesktop:null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.shouldShowChatDesktop)&&void 0!==f&&f,chatMobile:null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.shouldShowChatMobile)&&void 0!==m&&m,emailDesktop:null!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.shouldShowEmailDesktop)&&void 0!==b&&b,emailMobile:null!==(w=null===(v=this.buildingWebchatView)||void 0===v?void 0:v.shouldShowEmailMobile)&&void 0!==w&&w,textDesktop:null!==(x=(null===(C=this.buildingWebchatView)||void 0===C?void 0:C.shouldShowTextDesktop)&&!!ne)&&void 0!==x&&x,textMobile:null!==(S=(null===(A=this.buildingWebchatView)||void 0===A?void 0:A.shouldShowTextMobile)&&!!ne)&&void 0!==S&&S,sstDesktop:null!==(E=null===(k=this.buildingWebchatView)||void 0===k?void 0:k.shouldShowSstDesktop)&&void 0!==E&&E,sstMobile:null!==(_=null===(T=this.buildingWebchatView)||void 0===T?void 0:T.shouldShowSstMobile)&&void 0!==_&&_,calcDesktop:ie,calcMobile:re};var ae,se;this.enabledChatWidgets=Oa(oe),this.enabledChatWidgets.sstDesktop||this.enabledChatWidgets.sstMobile||"radco"===this.orgSlug?(se=this.handleTourClicked,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");t&&t.startsWith("https://app.meetelise.com/")&&e.addEventListener("click",e=>{e.preventDefault(),se(e)})}),J&&(e=>{document.querySelectorAll('a[href$="schedule-a-tour"]').forEach(t=>{t&&t.addEventListener("click",t=>{t.preventDefault(),e(t)})})})(this.handleTourClicked),"radco"===this.orgSlug&&(e=>{document.querySelectorAll('a[href^="#leaseleads-tour-open"]').forEach(t=>{var n;if(!t)return;const i=document.createElement("a");i.textContent=t.textContent,i.style.cursor="pointer",i.addEventListener("click",t=>{t.preventDefault(),e(t)}),null===(n=t.parentNode)||void 0===n||n.replaceChild(i,t)})})(this.handleTourClicked)):(null===(O=this.LeadSourceClient)||void 0===O?void 0:O.leadSource)&&(ae=null!==(I=null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&void 0!==I?I:null,document.querySelectorAll("a").forEach(function(e){const t=e.getAttribute("href");if(t&&t.startsWith("https://app.meetelise.com/")){const n=t.includes("?")?"&":"?";e.setAttribute("href",t+n+`eliseParsedLeadSource=${encodeURIComponent(ae)}`)}})),this.buildingWebchatView&&(this.primaryColor=null!==(M=this.buildingWebchatView.primaryColor)&&void 0!==M?M:null,this.backgroundColor=null!==(N=this.buildingWebchatView.secondaryColor)&&void 0!==N?N:null,this.foregroundColorOnPrimaryBackgroundColor=null!==(D=this.buildingWebchatView.foregroundColorOnPrimaryBackgroundColor)&&void 0!==D?D:null,this.foregroundColorOnSecondaryBackgroundColor=null!==(L=this.buildingWebchatView.foregroundColorOnSecondaryBackgroundColor)&&void 0!==L?L:null,this.webchatConfigHasAutoOpenChat=null!==(U=this.buildingWebchatView.autoOpenChat)&&void 0!==U&&U,this.requiresConsent=null!==(R=this.buildingWebchatView.requiresConsentForChat)&&void 0!==R&&R,this.hideMobileFeatures=null!==(B=this.buildingWebchatView.collapseMobileFeatures)&&void 0!==B&&B,this.privacyPolicyUrl=null!==(j=this.buildingWebchatView.privacyPolicyUrlForChat)&&void 0!==j?j:this.privacyPolicyUrl,this.buildingWebchatView.displayStyle===Mi.MINIMIZED&&(this.isMinimized=!0),this.buildingWebchatView.displayStyle===Mi.PILLS&&(this.designConcept=null),this.buildingWebchatView.displayStyle===Mi.EMOJI&&(this.designConcept=Mi.EMOJI),this.onWidgetLoaded()),null===this.primaryColor&&(this.primaryColor=Ue),null===this.backgroundColor&&(this.backgroundColor=Re);const le=null!==(H=null===(F=this.buildingWebchatView)||void 0===F?void 0:F.phoneNumber)&&void 0!==H?H:"";let ue=null;if(X&&(ue=await async function(e,t){try{const n=await r().get(`https://app.meetelise.com/platformApi/webchat/${e}/phone-number-by-source`,{params:{source:t}});return n.data?{number:Ie(n.data.number),isMatch:n.data.match,isPropertyWebsiteCatchall:n.data.isPropertyWebsiteCatchall}:null}catch(e){return null}}(this.buildingSlug,null!==(z=null===($=this.LeadSourceClient)||void 0===$?void 0:$.leadSource)&&void 0!==z?z:null),ue&&!ue.isMatch&&(ue.number=le)),Z&&(null==ue?void 0:ue.number)){const e=fs(ue.number,this.orgSlug,this.buildingSlug);e>0&&Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_dni_insert_override_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}const ce=localStorage.getItem("eliseai_phone_number_devtest");ce&&fs(ce,this.orgSlug,this.buildingSlug),this.phoneNumberForSource=ue||{number:le,isMatch:!1,isPropertyWebsiteCatchall:!0};const de=null!==(Q=null===(G=this.LeadSourceClient)||void 0===G?void 0:G.leadSource)&&void 0!==Q?Q:null;if(de&&(this.leadSources.includes(de)||this.leadSources.push(de)),Vn(Y.id),te&&this.buildingSlug&&(null===(W=this.buildingWebchatView)||void 0===W?void 0:W.isLiveOnApplications)){const e=((e,t,n)=>{var i;const r=[/thehavenatgreenhill\.securecafe\.com\/onlineleasing\/the-haven-at-greenhill\/oleapplication\.aspx(\?.*)?$/,/securecafe\.com\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,/vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,/busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/],o=document.body.getElementsByTagName("a");let a=0;for(let s=0;s<o.length;s++){const l=o[s];if(l.nodeType===Node.ELEMENT_NODE&&r.some(e=>e.test(l.href))){const r=l.getAttribute("href"),o=(null===(i=l.textContent)||void 0===i?void 0:i.toLowerCase())||"",s=Hl(o,e);l.setAttribute("href",s),a++,Ai({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"link-replacement",oldHref:r,newHref:s,website:window.location.href},logType:xi.info,buildingSlug:n,orgSlug:t})}}return 0===a&&Ai({logTitle:"SELECT_BUTTON_LINK_REPLACEMENT",logData:{type:"no-select-buttons-found",website:window.location.href},logType:xi.warn,buildingSlug:n,orgSlug:t}),a})(`https://applications.eliseai.com/building/${this.buildingSlug}/units`,this.orgSlug,this.buildingSlug);e>0&&Si({params:{org_slug:this.orgSlug,building_slug:this.buildingSlug,is_application_link_replacement_success:!0,extra_data:{total_replacements:e}},sampleRate:this.sampleRateToUse})}if(this.buildingSlug&&this.orgSlug)try{(e=>{const t=$l[e];if(!t)return 0;const n=`${zl}/building/${t}/units`,i=`${zl}/building/${e}/units`,r=new RegExp(`https://applications\\.eliseai\\.com/building/${t}/units`,"g");let o=0;const a=document.body.getElementsByTagName("a");for(let e=0;e<a.length;e++){const t=a[e],s=t.getAttribute("href");if(!s||!s.includes(n))continue;const l=s.replace(r,i);l!==s&&(t.setAttribute("href",l),o++)}document.body.querySelectorAll("[onclick]").forEach(e=>{const t=e.getAttribute("onclick");if(!t||!t.includes(n))return;const a=t.replace(r,i);a!==t&&(e.setAttribute("onclick",a),o++)})})(this.buildingSlug)}catch{}this.buildingSlug&&(null===(q=this.buildingWebchatView)||void 0===q?void 0:q.isLiveOnApplications)&&(null===(V=this.buildingWebchatView)||void 0===V?void 0:V.applicationLink)&&"c954426c-12ab-4f8e-8384-8218e79eaf72"===this.orgSlug&&ql(this.orgSlug,this.buildingSlug,this.buildingWebchatView.applicationLink)},this.initializeChatVariables=async()=>{var e,t,n,i,r,o,a,s;if(!this.buildingWebchatView)return;const l=os(this.buildingSlug),u=as(this.buildingSlug,l),c=u?l:rs(this.buildingSlug,!1);if(!c.leadId)throw new Error("Lead ID is null");this.LeadSourceClient=new Pi,this.LeadSourceMultitouchClient=new Vl(this.orgSlug,this.buildingSlug),this.myPubnub=new ds(this.buildingSlug,this.buildingWebchatView,this.orgSlug,null,c.leadId,this.LeadSourceMultitouchClient,this.LeadSourceClient,this.widgetType);const d=await this.myPubnub.initSession(this.buildingSlug,this.orgSlug,u&&null!==(e=c.leadId)&&void 0!==e?e:void 0);d&&rs(this.buildingSlug,c.initiatedChat,d.lead_id),this.LeadSourceClient.chatId=this.myPubnub.channel;const h=await(null===(t=this.LeadSourceClient)||void 0===t?void 0:t.generateUserLeadSource({leadId:null!==(i=null===(n=this.myPubnub)||void 0===n?void 0:n.leadUserId)&&void 0!==i?i:"",orgSlug:this.orgSlug,buildingSlug:this.buildingSlug}));h&&this.LeadSourceMultitouchClient.addSafeLeadSourceTouchpoint(h),"property-website"!==Oi(this.orgSlug)?this.myPubnub.leadSource=null!==(o=null===(r=this.LeadSourceClient)||void 0===r?void 0:r.leadSource)&&void 0!==o?o:Oi(this.orgSlug):this.myPubnub.leadSource=null!==(s=null===(a=this.LeadSourceClient)||void 0===a?void 0:a.leadSource)&&void 0!==s?s:null;const p=os(this.buildingSlug);p.initiatedChat&&await this.myPubnub.initializePubnub(p)},this.shouldAutoOpenChat=e=>{const t=sessionStorage.getItem("alreadyAutoOpenedTimestamp"),n=!t||!(t&&!Dn(Rn(t)));return!!e&&!!n&&!bn()},this.updateAlreadyAutoOpenedTimestamp=()=>{sessionStorage.setItem("alreadyAutoOpenedTimestamp",On(function(e,t){return Ge(2,arguments),st(e,6e4*at(t))}(new Date,15)))},this.handleContactClicked=e=>{var t;this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickEmailOption(e)},this.handleTourClicked=e=>{var t,n;this.showTourNextToChat?null===(t=this.launcherRef.value)||void 0===t||t.onClickSSTOption(e):(this.hideLauncher?this.showTourNextToChat=!0:this.displayPubnubChat=!1,this.hideLauncher=!1,null===(n=this.launcherRef.value)||void 0===n||n.onClickSSTOption(e))},this.handleContactTabClicked=e=>{var t;this.displayPubnubChat=!1,this.showTourNextToChat=!1,this.hideLauncher=!1,null===(t=this.launcherRef.value)||void 0===t||t.onClickPhoneOption(e)},this.adjustPositionChatAdditionalActions=()=>{var e,t,n,i;const r=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("chatAdditionalActionsPubnub");if(!r)return;const o=null===(i=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("pubnub-chat"))||void 0===n?void 0:n.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat-container"),a=null==o?void 0:o.getBoundingClientRect();a&&(r.style.left=`${a.left}px`,r.style.top=`${a.bottom}px`)},this.handleKeydownTab=e=>{var t,n,i,r,o,a,s,l;if("Tab"!==e.key)return;const u=null===(n=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById("meetelise-launcher"))||void 0===n?void 0:n.shadowRoot;let c=[];if(this.displayPubnubChat){const e=null===(o=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("pubnub-chat"))||void 0===r?void 0:r.shadowRoot)||void 0===o?void 0:o.getElementById("pubnub-chat-container"),t=null===(a=this.shadowRoot)||void 0===a?void 0:a.getElementById("chatAdditionalActionsPubnub");e&&c.push(...this.collectFocusableElements(e)),t&&c.push(...this.collectFocusableElements(t))}else{const e=null!==(l=null!==(s=null==u?void 0:u.getElementById("email-us-window"))&&void 0!==s?s:null==u?void 0:u.getElementById("tour-scheduler-window"))&&void 0!==l?l:null==u?void 0:u.getElementById("call-us-window");e&&(c=this.collectFocusableElements(e))}if(0===c.length)return;e.preventDefault();const d=this.getDeepActiveElement(),h=c.findIndex(e=>e===d);c[e.shiftKey?(h-1+c.length)%c.length:(h+1)%c.length].focus()},this.onClickMinimize=e=>{e.preventDefault(),e.stopPropagation(),this.isMinimized=!this.isMinimized,this.showTourNextToChat=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0,this.hideLauncher=!0,this.hasMounted=!0,localStorage.setItem("isChatOpen","true")},e.onExitChat=this.onExitChat)},this.onExitChat=()=>{this.displayPubnubChat=!1,this.hideLauncher=!1,this.showTourNextToChat=!1,localStorage.setItem("isChatOpen","false")}}async handleChatInitializeAnalytics(){var e,t,n,i;this.analytics=new wi(this.orgSlug,this.buildingSlug,null!==(t=null===(e=this.myPubnub)||void 0===e?void 0:e.channel)&&void 0!==t?t:"",null!==(i=null===(n=this.LeadSourceClient)||void 0===n?void 0:n.leadSource)&&void 0!==i?i:null),Math.random()<.05&&this.analytics.ping("webchat_heartbeat")}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),is(this.buildingSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.setupWebchat(),this.hideLauncher=!1}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.adjustPositionChatAdditionalActions),window.addEventListener("keydown",this.handleKeydownTab),this._cleanupMobileListener=vn(e=>{this._isMobile=e})}static isFocusable(e){return!("disabled"in e)||!e.disabled}collectFocusableElements(e){const t=[];e instanceof Element&&e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));const n=e.querySelectorAll("*");for(const e of Array.from(n))e.matches(Yl.FOCUSABLE_SELECTOR)&&Yl.isFocusable(e)&&t.push(e),e.shadowRoot&&t.push(...this.collectFocusableElements(e.shadowRoot));return t}getDeepActiveElement(){let e=document.activeElement,t=0;for(;(null==e?void 0:e.shadowRoot)&&(null==e?void 0:e.shadowRoot.activeElement);)if(t+=1,e=null==e?void 0:e.shadowRoot.activeElement,t>100){Ai({logType:xi.error,buildingSlug:this.buildingSlug,logTitle:"[ERROR_GETTING_DEEP_ELEMENT]",logData:{message:"error getting deep active element"}});break}return e}updated(){this.adjustPositionChatAdditionalActions()}disconnectedCallback(){var e,t;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),window.removeEventListener("resize",this.adjustPositionChatAdditionalActions),window.removeEventListener("keydown",this.handleKeydownTab),null===(t=this._cleanupMobileListener)||void 0===t||t.call(this),super.disconnectedCallback()}render(){var e,t,n,i,r,o,a,s,l,u,c,d,h,p,f,g,m,y,b,v,w,C,x,A,S,k,E,T,_,O,P,I,M,N,D,L,U,R,j;Ea();const F=this.hideLauncher&&!this.isLoading&&!this._isMobile;return B`
6928
6936
  <meta name="viewport" content="width=device-width, initial-scale=1">
6929
6937
  ${this.displayPubnubChat?B`
6930
6938
  <pubnub-chat
@@ -6933,7 +6941,7 @@ xmlns="http://www.w3.org/2000/svg"
6933
6941
  .myPubnub=${this.myPubnub}
6934
6942
  .orgSlug=${this.orgSlug}
6935
6943
  .buildingSlug=${this.buildingSlug}
6936
- .widgetType=${lu.Default}
6944
+ .widgetType=${du.Default}
6937
6945
  .building=${this.buildingWebchatView}
6938
6946
  .primaryColor=${this.primaryColor}
6939
6947
  .backgroundColor=${this.backgroundColor}
@@ -6949,7 +6957,7 @@ xmlns="http://www.w3.org/2000/svg"
6949
6957
  ></pubnub-chat>
6950
6958
  <chat-additional-actions
6951
6959
  id="chatAdditionalActionsPubnub"
6952
- .showChatAdditionalActions=${R||this.showTourNextToChat}
6960
+ .showChatAdditionalActions=${F||this.showTourNextToChat}
6953
6961
  .buildingWebchatView=${this.buildingWebchatView}
6954
6962
  .primaryColor=${this.primaryColor}
6955
6963
  .backgroundColor=${this.backgroundColor}
@@ -6976,35 +6984,36 @@ xmlns="http://www.w3.org/2000/svg"
6976
6984
  .hasDynamicSchedulingEnabled=${null!==(a=null===(o=this.buildingWebchatView)||void 0===o?void 0:o.usesDynamicScheduling)&&void 0!==a&&a}
6977
6985
  .orgLegalName=${null!==(l=null===(s=this.buildingWebchatView)||void 0===s?void 0:s.orgLegalName)&&void 0!==l?l:""}
6978
6986
  .tourTypeOptions=${null!==(c=null===(u=this.buildingWebchatView)||void 0===u?void 0:u.tourTypeOptions)&&void 0!==c?c:[]}
6987
+ .layoutOptions=${null!==(h=null===(d=this.buildingWebchatView)||void 0===d?void 0:d.layoutOptions)&&void 0!==h?h:[]}
6979
6988
  .launcherStyles=${this.launcherStyles}
6980
6989
  .primaryColor=${this.primaryColor}
6981
6990
  .backgroundColor=${this.backgroundColor}
6982
- .foregroundColorOnPrimaryBackgroundColor=${null!==(d=this.foregroundColorOnPrimaryBackgroundColor)&&void 0!==d?d:"white"}
6983
- .foregroundColorOnSecondaryBackgroundColor=${null!==(h=this.foregroundColorOnSecondaryBackgroundColor)&&void 0!==h?h:"black"}
6991
+ .foregroundColorOnPrimaryBackgroundColor=${null!==(p=this.foregroundColorOnPrimaryBackgroundColor)&&void 0!==p?p:"white"}
6992
+ .foregroundColorOnSecondaryBackgroundColor=${null!==(f=this.foregroundColorOnSecondaryBackgroundColor)&&void 0!==f?f:"black"}
6984
6993
  .isMinimized=${this.isMinimized}
6985
6994
  .onClickMinimize=${this.onClickMinimize}
6986
6995
  .onSstClose=${this.onSstClose}
6987
6996
  .overrideRentgrata=${this.overrideRentgrata}
6988
- .autoOpenChatWidget=${null!==(f=null===(p=this.buildingWebchatView)||void 0===p?void 0:p.autoOpenChat)&&void 0!==f&&f}
6997
+ .autoOpenChatWidget=${null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.autoOpenChat)&&void 0!==m&&m}
6989
6998
  .mobileStyles=${this._isMobile||this.isMinimized?this.mobileStyles:{}}
6990
- chatCallUsHeader=${null!==(m=null===(g=this.buildingWebchatView)||void 0===g?void 0:g.chatCallUsHeader)&&void 0!==m?m:""}
6999
+ chatCallUsHeader=${null!==(b=null===(y=this.buildingWebchatView)||void 0===y?void 0:y.chatCallUsHeader)&&void 0!==b?b:""}
6991
7000
  chatId="${this.chatId}"
6992
- phoneNumber="${null!==(w=null!==(b=null===(y=this.phoneNumberForSource)||void 0===y?void 0:y.number)&&void 0!==b?b:null===(v=this.buildingWebchatView)||void 0===v?void 0:v.phoneNumber)&&void 0!==w?w:""}"
6993
- buildingName=${null!==(x=null===(C=this.buildingWebchatView)||void 0===C?void 0:C.name)&&void 0!==x?x:""}
7001
+ phoneNumber="${null!==(x=null!==(w=null===(v=this.phoneNumberForSource)||void 0===v?void 0:v.number)&&void 0!==w?w:null===(C=this.buildingWebchatView)||void 0===C?void 0:C.phoneNumber)&&void 0!==x?x:""}"
7002
+ buildingName=${null!==(S=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.name)&&void 0!==S?S:""}
6994
7003
  orgSlug="${this.orgSlug}"
6995
7004
  buildingSlug="${this.buildingSlug}"
6996
- sgtUrl="${null!==(S=null===(A=this.buildingWebchatView)||void 0===A?void 0:A.sgtUrl)&&void 0!==S?S:""}"
6997
- selfGuidedToursTypeOffered="${null===(k=this.buildingWebchatView)||void 0===k?void 0:k.selfGuidedToursTypeOffered}"
6998
- selfGuidedTourEnabled="${null===(E=this.buildingWebchatView)||void 0===E?void 0:E.isSelfGuidedTourEnabled}"
6999
- designConcept="${null!==(T=this.designConcept)&&void 0!==T?T:""}"
7000
- currentLeadSource="${null!==(O=null===(_=this.LeadSourceClient)||void 0===_?void 0:_.leadSource)&&void 0!==O?O:""}"
7005
+ sgtUrl="${null!==(E=null===(k=this.buildingWebchatView)||void 0===k?void 0:k.sgtUrl)&&void 0!==E?E:""}"
7006
+ selfGuidedToursTypeOffered="${null===(T=this.buildingWebchatView)||void 0===T?void 0:T.selfGuidedToursTypeOffered}"
7007
+ selfGuidedTourEnabled="${null===(_=this.buildingWebchatView)||void 0===_?void 0:_.isSelfGuidedTourEnabled}"
7008
+ designConcept="${null!==(O=this.designConcept)&&void 0!==O?O:""}"
7009
+ currentLeadSource="${null!==(I=null===(P=this.LeadSourceClient)||void 0===P?void 0:P.leadSource)&&void 0!==I?I:""}"
7001
7010
  featureFlagShowDropdown="${this.featureFlagShowDropdown}"
7002
- .leadSources="${null!==(P=this.leadSources)&&void 0!==P?P:[]}"
7003
- escortedToursLink="${null!==(M=null===(I=this.buildingWebchatView)||void 0===I?void 0:I.escortedToursLink)&&void 0!==M?M:""}"
7011
+ .leadSources="${null!==(M=this.leadSources)&&void 0!==M?M:[]}"
7012
+ escortedToursLink="${null!==(D=null===(N=this.buildingWebchatView)||void 0===N?void 0:N.escortedToursLink)&&void 0!==D?D:""}"
7004
7013
  .escortedToursTypeOffered="${this.buildingWebchatView.escortedToursTypeOffered}"
7005
- virtualToursLink="${null!==(D=null===(N=this.buildingWebchatView)||void 0===N?void 0:N.virtualToursLink)&&void 0!==D?D:""}"
7006
- virtualToursTypeOffered="${null!==(L=this.buildingWebchatView.virtualToursTypeOffered)&&void 0!==L?L:""}"
7007
- .showTourNextToChat="${null!==(U=this.showTourNextToChat)&&void 0!==U?U:""}"
7014
+ virtualToursLink="${null!==(U=null===(L=this.buildingWebchatView)||void 0===L?void 0:L.virtualToursLink)&&void 0!==U?U:""}"
7015
+ virtualToursTypeOffered="${null!==(R=this.buildingWebchatView.virtualToursTypeOffered)&&void 0!==R?R:""}"
7016
+ .showTourNextToChat="${null!==(j=this.showTourNextToChat)&&void 0!==j?j:""}"
7008
7017
  @closeShowTourNextToChat=${()=>{this.showTourNextToChat=!1,this.hideLauncher=!0}}
7009
7018
  ?hidden=${this.hideLauncher}
7010
7019
  .hasCallUsEnabledDesktop=${this.enabledChatWidgets.callDesktop}
@@ -7033,7 +7042,7 @@ xmlns="http://www.w3.org/2000/svg"
7033
7042
  </meetelise-launcher>`:""}
7034
7043
  </div>
7035
7044
  </meta>
7036
- `}};Vl.styles=u`
7045
+ `}};Xl.styles=u`
7037
7046
  :host {
7038
7047
  all: initial;
7039
7048
  }
@@ -7082,7 +7091,7 @@ xmlns="http://www.w3.org/2000/svg"
7082
7091
  position: fixed;
7083
7092
  bottom: 0;
7084
7093
  }
7085
- `,Vl.FOCUSABLE_SELECTOR="a[href]:not([tabindex='-1']), input:not([disabled]), button:not([disabled]), textarea, [tabindex]:not([tabindex='-1'])",ql([ue({type:String})],Vl.prototype,"buildingSlug",void 0),ql([ue({type:String})],Vl.prototype,"orgSlug",void 0),ql([ue({type:Object})],Vl.prototype,"launcherStyles",void 0),ql([ue()],Vl.prototype,"mobileStyles",void 0),ql([ue({type:Boolean})],Vl.prototype,"isMinimized",void 0),ql([ue({type:String})],Vl.prototype,"primaryColor",void 0),ql([ue({type:String})],Vl.prototype,"backgroundColor",void 0),ql([ue({type:String})],Vl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),ql([ue({type:String})],Vl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),ql([ce()],Vl.prototype,"_isMobile",void 0),ql([ce()],Vl.prototype,"chatId",void 0),ql([ce()],Vl.prototype,"analytics",void 0),ql([ce()],Vl.prototype,"launcher",void 0),ql([ce()],Vl.prototype,"buildingWebchatView",void 0),ql([ce()],Vl.prototype,"designConcept",void 0),ql([ce()],Vl.prototype,"leadSources",void 0),ql([ce()],Vl.prototype,"currentLeadSource",void 0),ql([ce()],Vl.prototype,"featureFlagShowDropdown",void 0),ql([ce()],Vl.prototype,"phoneNumberForSource",void 0),ql([ce()],Vl.prototype,"hasMounted",void 0),ql([ce()],Vl.prototype,"hideLauncher",void 0),ql([ce()],Vl.prototype,"isLoading",void 0),ql([ce()],Vl.prototype,"showTourNextToChat",void 0),ql([ce()],Vl.prototype,"displayPubnubChat",void 0),ql([ce()],Vl.prototype,"myPubnub",void 0),ql([ce()],Vl.prototype,"LeadSourceClient",void 0),ql([ce()],Vl.prototype,"LeadSourceMultitouchClient",void 0),ql([ce()],Vl.prototype,"sampleRateToUse",void 0),ql([ue({type:Number})],Vl.prototype,"right",void 0),ql([ue({type:Number})],Vl.prototype,"bottom",void 0),ql([ue({type:Number})],Vl.prototype,"top",void 0),ql([ue({type:Number})],Vl.prototype,"left",void 0),ql([ue({attribute:!0})],Vl.prototype,"overrideRentgrata",void 0),ql([ue({attribute:!0})],Vl.prototype,"widgetType",void 0),ql([ue()],Vl.prototype,"onWidgetLoaded",void 0),ql([ue({attribute:!0})],Vl.prototype,"onSstClose",void 0),ql([ce()],Vl.prototype,"enabledChatWidgets",void 0),ql([ce()],Vl.prototype,"webchatConfigHasAutoOpenChat",void 0),ql([ce()],Vl.prototype,"requiresConsent",void 0),ql([ce()],Vl.prototype,"hideMobileFeatures",void 0),ql([ce()],Vl.prototype,"privacyPolicyUrl",void 0),Vl=Wl=ql([se("me-chat")],Vl);const Yl=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Kl=async(e,t,n,i,o)=>{var a;if(!i||!e)return;const s=await async function(e){if(!e)return!1;try{return(await r().get(ii(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(i);if(!s)return;const l=Yl(["myContactForm","contactus","fpa-myContactForm"]);let u;if(!(l&&l instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&Xl(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(l.parentElement&&"scheduleTourForm"===l.parentElement.id)return Xl(i,e,"Form is apart of schedule tour form!")}catch(e){}for(let e=0;e<l.elements.length;e++){const t=l.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){u=t;break}if("fpa-contact-submit"===t.getAttribute("id")){u=t;break}}if(!u)return Xl(i,e,"Could not find submit button");const c=()=>({firstName:Yl(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:Yl(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:Yl(["email","txtEmail","fpa-email","Form_Email"]),phone:Yl(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:Yl(["message","txtComments","fpa-email","Form_Message"])});if(Object.values(c()).some(e=>null===e)){const t=Object.entries(c()).filter(([,e])=>null===e).map(([e])=>e);return Xl(i,e,"Missing the following form elements: "+t.join(", "))}const d=u.textContent,h=u.cloneNode(!0);null===(a=u.parentNode)||void 0===a||a.replaceChild(h,u),h&&Si({params:{chat_id:t,org_slug:e,building_slug:i,is_form_override_success:!0},sampleRate:n}),h.onclick=async function(t){if(Object.values(c()).forEach(e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")}),!Object.values(c()).every(e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid"))))return;t.preventDefault(),h.textContent="Processing request...",h.disabled=!0;const n={};Object.entries(c()).forEach(([e,t])=>n[e]=null==t?void 0:t.value);const r=await Ui(e,i);if(!r)return Xl(i,e,"Could not find building"),null;const a={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:r.id,is_external_form:!0,lead_sources:[...new Set(o?[o,Oi(e)]:[Oi(e)])]},s=JSON.stringify(a);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:s}).then(e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return l&&l.reset(),Object.values(c()).forEach(e=>{e&&(e.disabled=!0)}),h.textContent="Submitted",h.disabled=!0,e.json()}).catch(()=>{h.textContent=d})}},Xl=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})},Zl=u`
7094
+ `,Xl.FOCUSABLE_SELECTOR="a[href]:not([tabindex='-1']), input:not([disabled]), button:not([disabled]), textarea, [tabindex]:not([tabindex='-1'])",Kl([ue({type:String})],Xl.prototype,"buildingSlug",void 0),Kl([ue({type:String})],Xl.prototype,"orgSlug",void 0),Kl([ue({type:Object})],Xl.prototype,"launcherStyles",void 0),Kl([ue()],Xl.prototype,"mobileStyles",void 0),Kl([ue({type:Boolean})],Xl.prototype,"isMinimized",void 0),Kl([ue({type:String})],Xl.prototype,"primaryColor",void 0),Kl([ue({type:String})],Xl.prototype,"backgroundColor",void 0),Kl([ue({type:String})],Xl.prototype,"foregroundColorOnPrimaryBackgroundColor",void 0),Kl([ue({type:String})],Xl.prototype,"foregroundColorOnSecondaryBackgroundColor",void 0),Kl([ce()],Xl.prototype,"_isMobile",void 0),Kl([ce()],Xl.prototype,"chatId",void 0),Kl([ce()],Xl.prototype,"analytics",void 0),Kl([ce()],Xl.prototype,"launcher",void 0),Kl([ce()],Xl.prototype,"buildingWebchatView",void 0),Kl([ce()],Xl.prototype,"designConcept",void 0),Kl([ce()],Xl.prototype,"leadSources",void 0),Kl([ce()],Xl.prototype,"currentLeadSource",void 0),Kl([ce()],Xl.prototype,"featureFlagShowDropdown",void 0),Kl([ce()],Xl.prototype,"phoneNumberForSource",void 0),Kl([ce()],Xl.prototype,"hasMounted",void 0),Kl([ce()],Xl.prototype,"hideLauncher",void 0),Kl([ce()],Xl.prototype,"isLoading",void 0),Kl([ce()],Xl.prototype,"showTourNextToChat",void 0),Kl([ce()],Xl.prototype,"displayPubnubChat",void 0),Kl([ce()],Xl.prototype,"myPubnub",void 0),Kl([ce()],Xl.prototype,"LeadSourceClient",void 0),Kl([ce()],Xl.prototype,"LeadSourceMultitouchClient",void 0),Kl([ce()],Xl.prototype,"sampleRateToUse",void 0),Kl([ue({type:Number})],Xl.prototype,"right",void 0),Kl([ue({type:Number})],Xl.prototype,"bottom",void 0),Kl([ue({type:Number})],Xl.prototype,"top",void 0),Kl([ue({type:Number})],Xl.prototype,"left",void 0),Kl([ue({attribute:!0})],Xl.prototype,"overrideRentgrata",void 0),Kl([ue({attribute:!0})],Xl.prototype,"widgetType",void 0),Kl([ue()],Xl.prototype,"onWidgetLoaded",void 0),Kl([ue({attribute:!0})],Xl.prototype,"onSstClose",void 0),Kl([ce()],Xl.prototype,"enabledChatWidgets",void 0),Kl([ce()],Xl.prototype,"webchatConfigHasAutoOpenChat",void 0),Kl([ce()],Xl.prototype,"requiresConsent",void 0),Kl([ce()],Xl.prototype,"hideMobileFeatures",void 0),Kl([ce()],Xl.prototype,"privacyPolicyUrl",void 0),Xl=Yl=Kl([se("me-chat")],Xl);const Zl=e=>{for(const t of e){const e=document.getElementById(t);if(e)return e}return null},Jl=async(e,t,n,i,o)=>{var a;if(!i||!e)return;const s=await async function(e){if(!e)return!1;try{return(await r().get(ii(e),{params:{building_slug:e,flag_type:"bool",feature_flag:"webchat-use-override-contact-us-form",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(i);if(!s)return;const l=Zl(["myContactForm","contactus","fpa-myContactForm"]);let u;if(!(l&&l instanceof HTMLFormElement)){const t=document.querySelector("form");return void(window.location.pathname.toLowerCase().includes("contactus")&&eu(i,e,"Could not find form",t?{id:t.id}:void 0))}try{if(l.parentElement&&"scheduleTourForm"===l.parentElement.id)return eu(i,e,"Form is apart of schedule tour form!")}catch(e){}for(let e=0;e<l.elements.length;e++){const t=l.elements[e];if("button"===t.tagName.toLowerCase()&&"fakebutton"===t.getAttribute("data-selenium-id")){u=t;break}if("fpa-contact-submit"===t.getAttribute("id")){u=t;break}}if(!u)return eu(i,e,"Could not find submit button");const c=()=>({firstName:Zl(["firstname","txtName","fpa-firstname","Form_FirstName"]),lastName:Zl(["lastname","txtName2","fpa-lastname","Form_LastName"]),email:Zl(["email","txtEmail","fpa-email","Form_Email"]),phone:Zl(["phonenumber","txtPhone","fpa-phonenumber","Form_Phone"]),message:Zl(["message","txtComments","fpa-email","Form_Message"])});if(Object.values(c()).some(e=>null===e)){const t=Object.entries(c()).filter(([,e])=>null===e).map(([e])=>e);return eu(i,e,"Missing the following form elements: "+t.join(", "))}const d=u.textContent,h=u.cloneNode(!0);null===(a=u.parentNode)||void 0===a||a.replaceChild(h,u),h&&Si({params:{chat_id:t,org_slug:e,building_slug:i,is_form_override_success:!0},sampleRate:n}),h.onclick=async function(t){if(Object.values(c()).forEach(e=>{"true"!==(null==e?void 0:e.getAttribute("aria-required"))||e.value||(e.className="form-control required is-invalid")}),!Object.values(c()).every(e=>null!==e&&!("true"===e.getAttribute("aria-required")&&!e.value)&&("email"!==e.id&&"phonenumber"!==e.id||"true"!==e.getAttribute("aria-invalid"))))return;t.preventDefault(),h.textContent="Processing request...",h.disabled=!0;const n={};Object.entries(c()).forEach(([e,t])=>n[e]=null==t?void 0:t.value);const r=await Ui(e,i);if(!r)return eu(i,e,"Could not find building"),null;const a={email_address:n.email,first_name:n.firstName,last_name:n.lastName,phone_number:n.phone,first_message:n.message,building_id:r.id,is_external_form:!0,lead_sources:[...new Set(o?[o,Oi(e)]:[Oi(e)])]},s=JSON.stringify(a);fetch("https://app.meetelise.com/platformApi/state/create/contactMe",{method:"POST",headers:{"Content-Type":"application/json","building-slug":i,"org-slug":e},body:s}).then(e=>{if(!e.ok)throw new Error(`HTTP error ${e.status}`);return l&&l.reset(),Object.values(c()).forEach(e=>{e&&(e.disabled=!0)}),h.textContent="Submitted",h.disabled=!0,e.json()}).catch(()=>{h.textContent=d})}},eu=(e,t,n,i)=>{const r=JSON.stringify({orgSlug:t,buildingSlug:e,reason:n,url:window.location.href,formIdInfo:i});fetch("https://app.meetelise.com/platformApi/webchat/form-override-error",{method:"POST",headers:{"Content-Type":"application/json","building-slug":e,"org-slug":t},body:r})},tu=u`
7086
7095
  .chat-launcher {
7087
7096
  position: fixed;
7088
7097
  }
@@ -7113,7 +7122,7 @@ xmlns="http://www.w3.org/2000/svg"
7113
7122
  filter: brightness(1.1);
7114
7123
  }
7115
7124
  }
7116
- `;var Jl=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 eu=class extends oe{constructor(){super(...arguments),this.right=0,this.bottom=0,this.top=0,this.left=0,this.isChatOpen=!1,this.onClickCloseChat=()=>({}),this.onClickOpenChat=()=>({})}render(){return this.isChatOpen?B`
7125
+ `;var nu=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 iu=class extends oe{constructor(){super(...arguments),this.right=0,this.bottom=0,this.top=0,this.left=0,this.isChatOpen=!1,this.onClickCloseChat=()=>({}),this.onClickOpenChat=()=>({})}render(){return this.isChatOpen?B`
7117
7126
  <div
7118
7127
  class="chat-launcher"
7119
7128
  style=${Le({top:bn()||isNaN(this.top)?void 0:`${this.top+432}px`,bottom:bn()||isNaN(this.bottom)?"72px":this.bottom-60+"px",left:bn()||isNaN(this.left)?void 0:`${this.left}px`,right:bn()||isNaN(this.right)?"18px":`${this.right}px`})}
@@ -7163,12 +7172,12 @@ xmlns="http://www.w3.org/2000/svg"
7163
7172
  />
7164
7173
  </svg>
7165
7174
  </button>
7166
- </div>`}};eu.styles=[Zl],Jl([ue({type:Number})],eu.prototype,"right",void 0),Jl([ue({type:Number})],eu.prototype,"bottom",void 0),Jl([ue({type:Number})],eu.prototype,"top",void 0),Jl([ue({type:Number})],eu.prototype,"left",void 0),Jl([ue({attribute:!0})],eu.prototype,"isChatOpen",void 0),Jl([ue({attribute:!0})],eu.prototype,"onClickCloseChat",void 0),Jl([ue({attribute:!0})],eu.prototype,"onClickOpenChat",void 0),eu=Jl([se("simple-launcher")],eu);var tu=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 nu=class extends oe{constructor(){super(...arguments),this.healthcareId="",this.right=0,this.bottom=0,this.top=0,this.left=0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Ee(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=rs(this.healthcareId),t=os(this.healthcareId,e)?e:is(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new cs(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,lu.Healthcare),t.initiatedChat&&await this.myPubnub.initializePubnub(e),bn()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ns(this.healthcareId),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return ka(),this.isLoading?B``:B`
7175
+ </div>`}};iu.styles=[tu],nu([ue({type:Number})],iu.prototype,"right",void 0),nu([ue({type:Number})],iu.prototype,"bottom",void 0),nu([ue({type:Number})],iu.prototype,"top",void 0),nu([ue({type:Number})],iu.prototype,"left",void 0),nu([ue({attribute:!0})],iu.prototype,"isChatOpen",void 0),nu([ue({attribute:!0})],iu.prototype,"onClickCloseChat",void 0),nu([ue({attribute:!0})],iu.prototype,"onClickOpenChat",void 0),iu=nu([se("simple-launcher")],iu);var ru=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 ou=class extends oe{constructor(){super(...arguments),this.healthcareId="",this.right=0,this.bottom=0,this.top=0,this.left=0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Ee(),this.firstUpdated=async()=>{await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=os(this.healthcareId),t=as(this.healthcareId,e)?e:rs(this.healthcareId,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new ds(this.healthcareId,null,"",this.currentLeadSource,t.leadId,null,null,du.Healthcare),t.initiatedChat&&await this.myPubnub.initializePubnub(e),bn()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),is(this.healthcareId),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return Ea(),this.isLoading?B``:B`
7167
7176
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7168
7177
  ${this.displayPubnubChat?B`
7169
7178
  <pubnub-chat
7170
7179
  id="pubnub-chat"
7171
- .widgetType=${lu.Healthcare}
7180
+ .widgetType=${du.Healthcare}
7172
7181
  .channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
7173
7182
  .myPubnub=${this.myPubnub}
7174
7183
  .buildingSlug=${this.healthcareId}
@@ -7194,7 +7203,7 @@ xmlns="http://www.w3.org/2000/svg"
7194
7203
  ></simple-launcher>
7195
7204
 
7196
7205
  </meta>
7197
- `}};nu.styles=u`
7206
+ `}};ou.styles=u`
7198
7207
  :host {
7199
7208
  all: initial;
7200
7209
  }
@@ -7247,13 +7256,13 @@ xmlns="http://www.w3.org/2000/svg"
7247
7256
  line-height: 150%;
7248
7257
  font-size: 16px;
7249
7258
  }
7250
- `,tu([ue({type:String})],nu.prototype,"healthcareId",void 0),tu([ue({type:Number})],nu.prototype,"right",void 0),tu([ue({type:Number})],nu.prototype,"bottom",void 0),tu([ue({type:Number})],nu.prototype,"top",void 0),tu([ue({type:Number})],nu.prototype,"left",void 0),tu([ce()],nu.prototype,"launcher",void 0),tu([ce()],nu.prototype,"currentLeadSource",void 0),tu([ce()],nu.prototype,"displayPubnubChat",void 0),tu([ce()],nu.prototype,"myPubnub",void 0),tu([ce()],nu.prototype,"requiresConsent",void 0),tu([ce()],nu.prototype,"privacyPolicyUrl",void 0),tu([ce()],nu.prototype,"isLoading",void 0),nu=tu([se("health-chat")],nu);var iu=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 ru=class extends oe{constructor(){super(...arguments),this.orgSlug="",this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Ee(),this.firstUpdated=async()=>{(await async function(e){if(!e)return!1;const t="e2e-test-yardi-building";try{return(await r().get(ii(t),{params:{building_slug:t,flag_type:"bool",feature_flag:"enable-show-utilities-webchat",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(this.orgSlug)||location.href.includes("demo/utilities"))&&await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=rs(this.orgSlug),t=os(this.orgSlug,e)?e:is(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new cs(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,lu.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),bn()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),ns(this.orgSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return ka(),this.isLoading?B``:B`
7259
+ `,ru([ue({type:String})],ou.prototype,"healthcareId",void 0),ru([ue({type:Number})],ou.prototype,"right",void 0),ru([ue({type:Number})],ou.prototype,"bottom",void 0),ru([ue({type:Number})],ou.prototype,"top",void 0),ru([ue({type:Number})],ou.prototype,"left",void 0),ru([ce()],ou.prototype,"launcher",void 0),ru([ce()],ou.prototype,"currentLeadSource",void 0),ru([ce()],ou.prototype,"displayPubnubChat",void 0),ru([ce()],ou.prototype,"myPubnub",void 0),ru([ce()],ou.prototype,"requiresConsent",void 0),ru([ce()],ou.prototype,"privacyPolicyUrl",void 0),ru([ce()],ou.prototype,"isLoading",void 0),ou=ru([se("health-chat")],ou);var au=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 su=class extends oe{constructor(){super(...arguments),this.orgSlug="",this.right=void 0,this.bottom=void 0,this.top=void 0,this.left=void 0,this.launcher=null,this.currentLeadSource=null,this.displayPubnubChat=!1,this.myPubnub=null,this.requiresConsent=!1,this.privacyPolicyUrl="http://bit.ly/me_privacy_policy",this.isLoading=!0,this.launcherRef=Ee(),this.firstUpdated=async()=>{(await async function(e){if(!e)return!1;const t="e2e-test-yardi-building";try{return(await r().get(ii(t),{params:{building_slug:t,flag_type:"bool",feature_flag:"enable-show-utilities-webchat",default_str:null,default_bool:!1}})).data}catch(e){return!1}}(this.orgSlug)||location.href.includes("demo/utilities"))&&await this.initializeChatVariables()},this.initializeChatVariables=async()=>{this.isLoading=!0;const e=os(this.orgSlug),t=as(this.orgSlug,e)?e:rs(this.orgSlug,!1);if(!t.leadId)throw new Error("Lead ID is null");this.myPubnub=new ds(this.orgSlug,null,this.orgSlug,this.currentLeadSource,t.leadId,null,null,du.Utilities),t.initiatedChat&&await this.myPubnub.initializePubnub(e),bn()||(this.displayPubnubChat=!0),this.attachOnClickToLauncher(),this.isLoading=!1},this.attachOnClickToLauncher=()=>{const e=this.launcherRef.value;e&&(e.onChatTapped=async()=>{this.displayPubnubChat=!0})}}async restartConversation(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),is(this.orgSlug),this.myPubnub=null,this.displayPubnubChat=!1,await this.initializeChatVariables()}show(){this.launcher&&(this.launcher.style.display="")}hide(){this.launcher&&(this.launcher.style.display="none")}disconnectedCallback(){var e;null===(e=this.myPubnub)||void 0===e||e.handleDisconnect(),super.disconnectedCallback()}render(){var e;return Ea(),this.isLoading?B``:B`
7251
7260
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7252
7261
  ${this.displayPubnubChat?B`
7253
7262
  <pubnub-chat
7254
7263
  id="pubnub-chat"
7255
7264
  .channel=${null===(e=this.myPubnub)||void 0===e?void 0:e.channel}
7256
- .widgetType=${lu.Utilities}
7265
+ .widgetType=${du.Utilities}
7257
7266
  .myPubnub=${this.myPubnub}
7258
7267
  .buildingSlug=${this.orgSlug}
7259
7268
  .onClickExit=${()=>{this.displayPubnubChat=!1}}
@@ -7277,7 +7286,7 @@ xmlns="http://www.w3.org/2000/svg"
7277
7286
 
7278
7287
  ></simple-launcher>
7279
7288
  </meta>
7280
- `}};ru.styles=u`
7289
+ `}};su.styles=u`
7281
7290
  :host {
7282
7291
  all: initial;
7283
7292
  }
@@ -7330,4 +7339,4 @@ xmlns="http://www.w3.org/2000/svg"
7330
7339
  line-height: 150%;
7331
7340
  font-size: 16px;
7332
7341
  }
7333
- `,iu([ue({type:String})],ru.prototype,"orgSlug",void 0),iu([ue({type:Number})],ru.prototype,"right",void 0),iu([ue({type:Number})],ru.prototype,"bottom",void 0),iu([ue({type:Number})],ru.prototype,"top",void 0),iu([ue({type:Number})],ru.prototype,"left",void 0),iu([ce()],ru.prototype,"launcher",void 0),iu([ce()],ru.prototype,"currentLeadSource",void 0),iu([ce()],ru.prototype,"displayPubnubChat",void 0),iu([ce()],ru.prototype,"myPubnub",void 0),iu([ce()],ru.prototype,"requiresConsent",void 0),iu([ce()],ru.prototype,"privacyPolicyUrl",void 0),iu([ce()],ru.prototype,"isLoading",void 0),ru=iu([se("utilities-chat")],ru);const ou=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ai({logType:i&&i.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},au=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class su{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),uu();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),su.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization,this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),uu();let c=null;switch(e.widgetType){case lu.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case lu.Default:c=document.createElement("me-chat");break;case lu.Utilities:c=document.createElement("utilities-chat");break;default:c=document.createElement("me-chat")}if(!c)throw new Error("Invalid widget type");c.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization),c.setAttribute("widgetType",e.widgetType||lu.Default),c.setAttribute("class","meetelise-chat"),c.setAttribute("role","region"),c.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,c.setAttribute("primaryColor",((e,t)=>{const n=Be(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return je(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),c instanceof Vl&&(this.handleBuildingslug(c,e.organization,e.building,e),e.launcherStyles&&(c.launcherStyles=e.launcherStyles),e.mobileStyles&&(c.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(c.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await au("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),c.overrideRentgrata=!0),e.onSstClose&&(c.onSstClose=e.onSstClose)),e.position&&(c.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),c.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),c.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),c.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(c),c instanceof Vl&&(su.meChat=c),c instanceof ru&&(su.utilitiesChat=c)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),su.meChat=null)}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await ou(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,ou(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ai({logType:n&&n.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ai({logType:i&&i.data===e?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}var lu;su.meChat=null,su.healthChat=null,su.utilitiesChat=null,su.orgSlug="",su.mutationObserver=null,su.previousUrl="",su.hasBuildingSlug=null,su.brandColor="",su.backgroundColor="",su.healthcareId="",su.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(lu||(lu={}));const uu=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{lu as WidgetType,su as default};
7342
+ `,au([ue({type:String})],su.prototype,"orgSlug",void 0),au([ue({type:Number})],su.prototype,"right",void 0),au([ue({type:Number})],su.prototype,"bottom",void 0),au([ue({type:Number})],su.prototype,"top",void 0),au([ue({type:Number})],su.prototype,"left",void 0),au([ce()],su.prototype,"launcher",void 0),au([ce()],su.prototype,"currentLeadSource",void 0),au([ce()],su.prototype,"displayPubnubChat",void 0),au([ce()],su.prototype,"myPubnub",void 0),au([ce()],su.prototype,"requiresConsent",void 0),au([ce()],su.prototype,"privacyPolicyUrl",void 0),au([ce()],su.prototype,"isLoading",void 0),su=au([se("utilities-chat")],su);const lu=async e=>{const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":e}});return Math.random()<.2&&Ai({logType:i&&i.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:e,givenBuildingSlug:null,reason:i&&i.data?null:"No match found"}}),i.data},uu=async(e,t=5e3)=>new Promise((n,i)=>{const r=new MutationObserver((t,i)=>{const r=document.getElementById(e);r&&(i.disconnect(),n(r))});r.observe(document.body,{childList:!0,subtree:!0});const o=setTimeout(()=>{r.disconnect(),i(new Error(`Element ${e} did not appear within ${t}ms`))},t),a=document.querySelector(e);a&&(clearTimeout(o),r.disconnect(),n(a))});class cu{static healthcareStart(e,t=!0){var n,i,r,o;t&&(this.healthcareId=e.id,this.overridePlacement={right:e.right,bottom:e.bottom,top:e.top,left:e.left}),hu();const a=document.createElement("health-chat");a.setAttribute("class","health-chat"),a.setAttribute("role","region"),a.setAttribute("aria-label","EliseAI Healthcare Widget"),a.setAttribute("healthcareId",e.id),a.setAttribute("right",(null===(n=e.right)||void 0===n?void 0:n.toString())||"unset"),a.setAttribute("bottom",(null===(i=e.bottom)||void 0===i?void 0:i.toString())||"unset"),a.setAttribute("top",(null===(r=e.top)||void 0===r?void 0:r.toString())||"unset"),a.setAttribute("left",(null===(o=e.left)||void 0===o?void 0:o.toString())||"unset"),document.body.appendChild(a),cu.healthChat=a}static start(e,t=!0){var n,i,r,o,a,s,l,u;if(window.location.pathname.includes("residentservices")||window.location.pathname.includes("onlineleasing"))return;t&&(this.orgSlug="Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization,this.hasBuildingSlug=!!e.building,this.overridePlacement={right:null===(n=null==e?void 0:e.position)||void 0===n?void 0:n.right,bottom:null===(i=null==e?void 0:e.position)||void 0===i?void 0:i.bottom,top:null===(r=null==e?void 0:e.position)||void 0===r?void 0:r.top,left:null===(o=null==e?void 0:e.position)||void 0===o?void 0:o.left}),hu();let c=null;switch(e.widgetType){case du.Healthcare:throw new Error("Healthcare widget is not supported yet, please use the healthcareStart method instead.");case du.Default:c=document.createElement("me-chat");break;case du.Utilities:c=document.createElement("utilities-chat");break;default:c=document.createElement("me-chat")}if(!c)throw new Error("Invalid widget type");c.setAttribute("orgSlug","Pacific Urban Residential"===e.organization?"cbc11aba-21c4-4571-bc43-ff9d86a029e3":e.organization),c.setAttribute("widgetType",e.widgetType||du.Default),c.setAttribute("class","meetelise-chat"),c.setAttribute("role","region"),c.setAttribute("aria-label","EliseAI Widget"),e.brandColor&&(this.brandColor=e.brandColor,c.setAttribute("primaryColor",((e,t)=>{const n=Be(e),i=0,r=0,o=0,a={r:n.r+Math.round((i-n.r)*t),g:n.g+Math.round((r-n.g)*t),b:n.b+Math.round((o-n.b)*t)};return je(a.r,a.g,a.b)})(e.brandColor,.3))),e.backgroundColor&&(this.backgroundColor=e.backgroundColor),c instanceof Xl&&(this.handleBuildingslug(c,e.organization,e.building,e),e.launcherStyles&&(c.launcherStyles=e.launcherStyles),e.mobileStyles&&(c.mobileStyles=e.mobileStyles),e.onWidgetLoaded&&(c.onWidgetLoaded=e.onWidgetLoaded),e.overrideRentgrata&&((async()=>{const e=await uu("rg-widget-compact");e&&e.setAttribute("style","display: none")})(),c.overrideRentgrata=!0),e.onSstClose&&(c.onSstClose=e.onSstClose)),e.position&&(c.setAttribute("right",(null===(a=e.position.right)||void 0===a?void 0:a.toString())||"unset"),c.setAttribute("bottom",(null===(s=e.position.bottom)||void 0===s?void 0:s.toString())||"unset"),c.setAttribute("top",(null===(l=e.position.top)||void 0===l?void 0:l.toString())||"unset"),c.setAttribute("left",(null===(u=e.position.left)||void 0===u?void 0:u.toString())||"unset")),window.eliseAi={},document.body.appendChild(c),c instanceof Xl&&(cu.meChat=c),c instanceof su&&(cu.utilitiesChat=c)}static async restartConversation(){this.meChat&&await this.meChat.restartConversation()}static async remove(){this.meChat&&(await this.meChat.remove(),document.body.removeChild(this.meChat),cu.meChat=null)}static async handleBuildingslug(e,t,n,i){if(n)return void e.setAttribute("buildingSlug",n);if(this.mutationObserver)return;if(!t)return;const r=await lu(t);if(r){const e={...i,organization:t,building:r};this.start(e,!1)}this.previousUrl=window.location.href,document.body.addEventListener("click",()=>{requestAnimationFrame(()=>{this.previousUrl===window.location.href||this.hasBuildingSlug||(this.previousUrl=window.location.href,lu(t).then(e=>{if(!e)return;const n={...i,organization:t,building:e};this.start(n,!1)}))})},!0)}static async handleSingleFamilyUrl(){if(this.hasBuildingSlug)return;this.remove();const e=window.location.href,t=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(e)}`,n=await r().get(t,{headers:{"org-slug":this.orgSlug}});if(Math.random()<.2&&Ai({logType:n&&n.data?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${n?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:n.data,url:e,orgSlug:this.orgSlug,givenBuildingSlug:null,reason:n&&n.data?null:"No match found"}}),!n||!n.data)return;const i={organization:this.orgSlug,building:n.data,brandColor:this.brandColor,backgroundColor:this.backgroundColor};this.start(i,!1)}static async calculateBuildingSlugForLogging(e){const t=window.location.href,n=`https://app.meetelise.com/platformApi/webchat/microsite_slug?uri=${encodeURIComponent(t)}`,i=await r().get(n,{headers:{"org-slug":this.orgSlug}});Math.random()<.2&&Ai({logType:i&&i.data===e?xi.info:xi.warn,logTitle:`[BUILDING_SLUG_CALCULATED_${i&&i.data===e?"SUCCESS":"FAILURE"}]`,logData:{calculatedBuildingSlug:i.data,url:t,orgSlug:this.orgSlug,givenBuildingSlug:e,reason:i&&i.data===e?null:i&&!i.data?"No match found":i&&i.data!==e?"Mismatch":"No match found"}}),i&&i.data}}var du;cu.meChat=null,cu.healthChat=null,cu.utilitiesChat=null,cu.orgSlug="",cu.mutationObserver=null,cu.previousUrl="",cu.hasBuildingSlug=null,cu.brandColor="",cu.backgroundColor="",cu.healthcareId="",cu.overridePlacement={},function(e){e.Default="default",e.Healthcare="healthcare",e.Utilities="utilities"}(du||(du={}));const hu=()=>{const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),document.head.appendChild(e)};export{du as WidgetType,cu as default};