1(()=>{var e={"./node_modules/moment/locale sync recursive ^\\.\\/.*$"(e,t,o){const n={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-ps":"./node_modules/moment/locale/ar-ps.js","./ar-ps.js":"./node_modules/moment/locale/ar-ps.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku-kmr":"./node_modules/moment/locale/ku-kmr.js","./ku-kmr.js":"./node_modules/moment/locale/ku-kmr.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.
1js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function i(e){const t=s(e);return o(t)}function s(e){if(!o.o(n,e)){const t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=s,e.exports=i,i.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./src/js/global/global-custom.ts"(e,t,o){"use strict";o.d(t,{EventTeaserSlider:()=>R,StickyHeader:()=>L,TinySlider:()=>C,addLocalizationHeaderMenuLocal:()=>
1$,brandPopupHandler:()=>J,handleMobileDesktopSubmenuClicks:()=>V,initializeNavDropdown:()=>U});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js"),s=o(/*! ../opus2/util/getDynamicMenu */"./src/js/opus2/util/getDynamicMenu.ts"),r=o(/*! ../opus2/util/share */"./src/js/opus2/util/share.ts"),l=o(/*! ../opus2/location-search-map/models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts"),a=o(/*! ../opus2/location-search-map/reportScreenSize */"./src/js/opus2/location-search-map/reportScreenSize.ts"),d=o(/*! ../opus2/util/siteConfig */"./src/js/opus2/util/siteConfig.ts"),c=o(/*! ../opus2/util/device-detection */"./src/js/opus2/util/device-detection.ts"),u=o(/*! ../opus2/util/coupons-event-handling */"./src/js/opus2/util/coupons-event-handling.ts"),m=o(/*! ../opus2/util/localizationService */"./src/js/opus2/util/localizationService.ts"),h=o(/*! ../opus2/api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),p=o(/*! ../opus2/helperModules/localizedToken */"./src/js/opus2/helperModules/localizedToken.ts"),v=o(/*! ../opus2/util/hoverintent */"./src/js/opus2/util/hoverintent.ts"),g=o(/*! ../opus2/apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),f=o(/*! ../opus2/config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),y=o(/*! ../opus2/config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),b=o(/*! ../opus2/util/loader */"./src/js/opus2/util/loader.ts"),I=o(/*! ../opus2/util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),S=o(/*! ../opus2/nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),w=o(/*! ../opus2/search-result */"./src/js/opus2/search-result/index.ts"); 2/*!* Global JS v13.08.24:01*/ 3class L{constructor(e){var t,o,n;this.menuCloseTimeout=new Map,this.headerAlertObserver=null,this.firstHead=document.querySelector(".first-head");const i=document.querySelector(".second-head");this.headerH=null!==(t=null==i?void 0:i.offsetHeight)&&void 0!==t?t:0,this.dynamicMenuType="",this.headerAlert=document.getElementById("header-alert");const s=document.createElement("div");s&&(s.id="sticky-placeholder"),(null==s?void 0:s.style)&&(s.style.width="100%",s.style.display="none"),null===(n=null===(o=null==i?void 0:i.parentNode)||void 0===o?void 0:o.insertBefore)||void 0===n||n.call(o,s,i),window.addEventListener("resize",()=>{var e;"block"===(null===(e=null==s?void 0:s.style)||void 0===e?void 0:e.display)&&(s.style.height=this.getSecondHeadHeight()+"px")}),this.stickyHeader(e);const l=document.querySelectorAll(".link-target");null==l||l.forEach(e=>{e.style.scrollMarginTop=this.headerH-30+"px"}),setTimeout(()=>{this.megaMenu.call(this)},1e3),this.readDynamicMenu(),(0,r.getCampaignName)()}static getInstance(e){var t;return null!==(t=L.instance)&&void 0!==t||(L.instance=new L(e)),L.instance}static init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;try{const o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,r.getBrandDetailsFromBrandJson)(o),i=document.querySelector(".second-head"),s=null===(t=document.getElementById("pageType"))||void 0===t?void 0:t.value;"Opus 2 Lead Flow Template"!==s&&"Opus 2 Onverity-IMS Lead Flow"!==s&&"Opus 2 HMS Lead Flow Template"!==s&&"Opus 2 MLY Lead Flow Template"!==s&&"Opus 2 Agnostic Lead Flow Template"!==s&&i&&(yield this.checkToToggleLogoAndLocationFromStickyHeader(i)),L.getInstance(n||{})}catch(e){console.error("Error initializing StickyHeader:",e),L.getInstance({})}})}getSecondHeadHeight(){const e=document.querySelector(".second-head");return e?e.offsetHeight:0}getHeaderHeight(){var e,t,o,n,i,s,r;return(null===(e=this.headerAlert)||void 0===e?void 0:e.classList.contains("hidden"))?null!==(r=null===(s=this.firstHead)||void 0===s?void 0:s.offsetHeight)&&void 0!==r?r:0:(null!==(o=null===(t=this.headerAlert)||void 0===t?void 0:t.offsetHeight)&&void 0!==o?o:0)+(null!==(i=null===(n=this.firstHead)||void 0===n?void 0:n.offsetHeight)&&void 0!==i?i:0)}stickyHeader(e){var t;const o=document.querySelector(".second-head");let n=0,i=0,s=document.querySelector(".find-local-mobile"),l=document.querySelector(".second-head .mobile-menu-logo"),a=document.querySelector(".second-head .header-cta-mobile");const d=document.getElementById("sticky-placeholder");l&&(i=l.offsetHeight),l&&a&&s&&(n=l.offsetHeight+a.offsetHeight+s.offsetHeight);const c=document.querySelector(".second-head"),u=document.querySelectorAll(".accordion-icon-list");
3null==u||u.forEach(e=>{null==e||e.addEventListener("click",e=>{let t=null==c?void 0:c.offsetHeight;const o=e.target.closest(".card-list");if(e.target&&o){const e=o.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:e,behavior:"smooth"})}})});const m=document.querySelector(".secondary-btn");m&&"function"==typeof m.getAttribute&&(null===(t=null==m?void 0:m.getAttribute("href"))||void 0===t?void 0:t.includes("#short-form-req-name"))&&(null==m||m.addEventListener("click",e=>{e.preventDefault();let t=null==c?void 0:c.offsetHeight;const o=document.querySelector(".short-form-component");if(o){const e=o.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:e,behavior:"smooth"})}}));let h=0,p=!1;const v=this,g=()=>{var e,t,n,i,s,r,l;(null===(e=null==d?void 0:d.style)||void 0===e?void 0:e.display)&&"none"!==(null===(t=null==d?void 0:d.style)||void 0===t?void 0:t.display)||(null==d?void 0:d.style)&&(d.style.height=this.getSecondHeadHeight()+"px",d.style.display="block"),(null===(n=v.headerAlert)||void 0===n?void 0:n.classList.contains("fixed-alert"))&&(v.headerAlert.style.position="fixed",o&&(o.style.marginTop=v.headerAlert.offsetHeight+"px")),null===(s=null===(i=v.firstHead)||void 0===i?void 0:i.classList)||void 0===s||s.add("hidden"),null===(r=null==o?void 0:o.classList)||void 0===r||r.remove("relative"),null===(l=null==o?void 0:o.classList)||void 0===l||l.add("fixed","top-0")},f=()=>{var e,t,n,i,s,r;"block"===(null===(e=null==d?void 0:d.style)||void 0===e?void 0:e.display)&&(d.style.height="0px",d.style.display="none"),(null===(t=v.headerAlert)||void 0===t?void 0:t.classList.contains("fixed-alert"))&&(v.headerAlert.style.position="relative",o&&(o.style.marginTop="0")),null===(i=null===(n=v.firstHead)||void 0===n?void 0:n.classList)||void 0===i||i.remove("hidden"),null===(s=null==o?void 0:o.classList)||void 0===s||s.remove("fixed","top-0"),null===(r=null==o?void 0:o.classList)||void 0===r||r.add("relative")};if(v.headerAlert){const e=new MutationObserver(()=>{var e;try{(null===(e=v.headerAlert)||void 0===e?void 0:e.classList.contains("hidden"))&&o&&(o.style.marginTop="0")}catch(e){console.error("Error in MutationObserver callback:",e)}});e.observe(v.headerAlert,{attributes:!0,attributeFilter:["class"],childList:!1,subtree:!1}),v.headerAlertObserver=e}let y=0;window.addEventListener("scroll",()=>{var t,l,a,d,c,u;const m=window.scrollY;let v=o?o.offsetTop:0,b=window.pageYOffset,I=window.innerWidth;p||(window.requestAnimationFrame(()=>{var e,t,n,i;window.innerWidth<1024&&(!(0,r.isNegative)(h)&&m>h?(null===(e=null==o?void 0:o.classList)||void 0===e?void 0:e.contains("sticky-head"))&&(null===(t=null==o?void 0:o.classList)||void 0===t||t.add("hidden")):(m<h||(0,r.isNegative)(h))&&(null===(n=null==o?void 0:o.classList)||void 0===n?void 0:n.contains("sticky-head"))&&(null===(i=null==o?void 0:o.classList)||void 0===i||i.remove("hidden"))),h=window.scrollY,p=!1}),p=!0),(()=>{var e;const t=document.querySelector(".main-header");if(!(null===(e=null==t?void 0:t.classList)||void 0===e?void 0:e.contains("compressed-header")))return;const n=document.getElementById("sticky-placeholder");n&&o&&requestAnimationFrame(()=>{const e=o.offsetHeight;e!==y&&(y=e,n.style.height=`${e}px`)})})(),I<1024?(null==e?void 0:e.disable_sticky_header_mobile)?f():(null==e?void 0:e.disable_findmylocations)?b>i?(g(),s&&(s.style.display="none")):(f(),s&&(s.style.display="flex")):(null===(t=null==o?void 0:o.classList)||void 0===t?void 0:t.contains("sticky-head"))&&!(null===(l=null==o?void 0:o.classList)||void 0===l?void 0:l.contains("hide-find-local"))?b>i?g():f():(null===(a=null==o?void 0:o.classList)||void 0===a?void 0:a.contains("hide-find-local"))&&(null===(d=null==o?void 0:o.classList)||void 0===d?void 0:d.contains("sticky-head"))?b>n?(g(),(null==s?void 0:s.style)&&(s.style.display="none")):(f(),(null==s?void 0:s.style)&&(s.style.display="flex")):(null===(c=null==o?void 0:o.classList)||void 0===c?void 0:c.contains("hide-find-local"))||(null===(u=null==o?void 0:o.classList)||void 0===u?void 0:u.contains("sticky-head"))||(b>v?g():f()):I>1024&&((null==e?void 0:e.disable_sticky_header)||b<=this.getHeaderHeight()?f():g())})}disconnectObserver(){try{this.headerAlertObserver&&(this.headerAlertObserver.disconnect(),this.headerAlertObserver=null)}catch(e){console.error("Error disconnecting header alert observer:",e)}}static destroy(){L.instance&&L.instance.disconnectObserver()}readDynamicMenu(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;try{const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,r.getBrandDetailsFromBrandJson)(t);if(null==o?void 0:o.display_icon_menu){W({dynamicMenuType:"dynamic menu icons"})}else{let e=yield(0,s.getDynamicMenuResponse)();this.dynamicMenuType=null==e?void 0:e.dynamicMenuType,this.dynamicMenuV2(),W(e),this.initializeSubmegaTabs()}}catch(e){console.warn("Error Fetching dynamic menu")}yield $()})}initializeSubmegaTabs(){var e;const t=null===(e=document.querySelector(".dynamic-service-menu"))||void 0===e?void 0:e.closest("ul");t?t.addEventListener("click",function(e){const t=e.target.closest(".submega-tab-button");if(!t)return;const o=t.getAttribute("data-tabs-target");if(!o)return void console.error("No target ID found for button:",t);const n=document.querySelector(o);if(!n)return void console.error("No target element found for selector:",o);document.querySelector(".submega-tab-content")?(document.querySelectorAll(".submega-tab-content >
3 div").forEach(e=>{e.classList.add("hidden")}),document.querySelectorAll(".submega-tab-button").forEach(e=>{e.setAttribute("aria-selected","false")}),n.classList.remove("hidden"),t.setAttribute("aria-selected","true")):console.error("No '.submega-tab-content' container found.")}):console.error("No parent <ul> found for '.dynamic-service-menu'.")}megaMenu(){document.querySelector(".mega-menu"),document.querySelector(".sub-menu");const e=document.querySelector(".mobile-sidebar-drawer"),t=(document.querySelectorAll(".expand-menu-js"),document.querySelectorAll(".nav-link"));window.matchMedia("(max-width: 1023px)").matches&&(null==e||e.setAttribute("data-drawer-target","sidebar"),null==e||e.setAttribute("data-drawer-toggle","sidebar"),null==e||e.setAttribute("data-drawer-backdrop","false")),null==t||t.forEach(e=>{(0,a.reportScreenSize)()!==l.ScreenType.Desktop&&e.addEventListener("click",function(e){let t=this.getAttribute("data-nested-value"),o=document.getElementById(t);null==o||o.classList.add("show-menu"),null==o||o.classList.remove("hide-menu")})});document.querySelectorAll("button.nav-link-mobile").forEach(e=>{e.addEventListener("click",function(){var e;const t=this.dataset.nestedValue;t&&(null===(e=document.getElementById(t))||void 0===e||e.classList.add("active")),this.setAttribute("aria-expanded","true")})});const o=document.querySelectorAll(".back-btn");null==o||o.forEach(e=>{e.addEventListener("click",function(e){let t=this.getAttribute("data-back"),o=document.getElementById(t);null==o||o.classList.remove("show-menu"),null==o||o.classList.add("hide-Submenu")})});const n=document.querySelectorAll(".back-tab-btn");null==n||n.forEach(e=>{e.addEventListener("click",function(t){var o,n;null===(n=null===(o=e.closest(".mega-menu"))||void 0===o?void 0:o.querySelector(".tab-sibling"))||void 0===n||n.classList.remove("hide-menu");let i=this.getAttribute("data-back"),s=document.getElementById(i);null==s||s.classList.remove("show-menu"),null==s||s.classList.add("hidden")})});const i=document.querySelector(".sidenav-close");null==i||i.addEventListener("click",function(){var e;s.forEach(e=>{null==e||e.classList.remove("show-menu")}),r.forEach(e=>{null==e||e.classList.add("hide-Submenu")}),null===(e=document.querySelector(".tab-sibling"))||void 0===e||e.classList.remove("hide-menu");const t=document.querySelector(".dynamic-menu-wrap");t&&(t.classList.add("hide-menu"),t.classList.remove("show-menu"));const o=document.querySelectorAll(".new-submenu-inner-warp > div");o.length>0&&o.forEach(e=>{e.classList.add("hide-menu"),e.classList.remove("show-menu")})});let s=document.querySelectorAll(".mega-menu"),r=document.querySelectorAll(".sub-menu");const d=document.querySelector(".slide-block"),c=document.querySelector(".main-nav-warpper"),u=null==d?void 0:d.offsetHeight,m=(null==c||c.offsetHeight,document.querySelectorAll(".mega-menu")),h=document.querySelectorAll(".sub-menu");window.matchMedia("(max-width: 1023px)").matches&&(m.forEach(e=>{e.style.top=u+16+"px"}),h.forEach(e=>{e.style.top="0"}));const p=document.getElementsByClassName("submega-inner-warp");if(0===p.length)return;let v=this;if(window.matchMedia("(min-width:1024px)").matches){for(let e=0;e<p.length;e++)p[e].onmouseleave=function(){const t=document.getElementsByClassName("mega-inner-warp tab-sibling");t&&(v.menuCloseTimeout.has(e)||v.menuCloseTimeout.set(e,setTimeout(()=>{var o,n,i;if(!t[e])return;null===(o=t[e])||void 0===o||o.classList.remove("hide-menu"),null===(n=p[e])||void 0===n||n.classList.remove("show-menu"),null===(i=p[e])||void 0===i||i.classList.add("hide-menu");document.querySelectorAll('.submega-tab-content div[role="tabpanel"]').forEach(e=>{e.classList.add("hidden")});document.querySelectorAll('.submega-tab li[role="presentation"] button').forEach(e=>{e.setAttribute("aria-selected","false")})},300)))},p[e].onmouseenter=function(){v.menuCloseTimeout.get(e)&&(clearTimeout(v.menuCloseTimeout.get(e)),v.menuCloseTimeout.delete(e))};const e=document.querySelectorAll(".ads-wrapper");if(0===e.length)return;e.forEach(e=>{e.onmouseenter=function(){v.menuCloseTimeout.size>
30&&(v.menuCloseTimeout.forEach(e=>{clearTimeout(e)}),v.menuCloseTimeout.clear())}})}}static checkToToggleLogoAndLocationFromStickyHeader(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;const o=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,n=yield(0,r.getBrandDetailsFromBrandJson)(o);n&&(n.disable_stickyheader_logo?e.classList.add("sticky-head"):e.classList.remove("sticky-head"),n.disable_findmylocations?e.classList.add("hide-find-local"):e.classList.remove("hide-find-local"))})}dynamicMenuV2(){var e,t;const o=document.querySelectorAll(".expand-menu-js");this.dynamicMenuType=null===(t=null===(e=this.dynamicMenuType)||void 0===e?void 0:e.replace(/\s/g,""))||void 0===t?void 0:t.toLowerCase();const n="Dynamic Menu V2".replace(/\s/g,"").toLowerCase();this.dynamicMenuType==n&&(null==o||o.forEach(e=>{e.addEventListener("click",function(t){var o,n,i,s,r;try{e.closest(".dynamic-service-menu .tab-sibling")&&(null===(o=e.closest(".dynamic-service-menu .tab-sibling"))||void 0===o||o.classList.add("hide-menu"));let t=this.getAttribute("data-nested-value"),l=this.getAttribute("data-active-tab"),a=document.getElementById(t);null==a||a.classList.add("show-menu"),null==a||a.classList.remove("hide-menu");let d=document.getElementById(l);null===(i=null===(n=null==d?void 0:d.closest(".submega-tab"))||void 0===n?void 0:n.querySelector(".submega-tab-button"))||void 0===i||i.setAttribute("aria-selected","false"),null==d||d.setAttribute("aria-selected","true");let c=null==d?void 0:d.getAttribute("data-tabs-target"),u=null==c?void 0:c.split("#");if(u&&u.length>0){let e=document.getElementById(u[1]);null===(r=null===(s=null==e?void 0:e.closest(".submega-inner-warp"))||void 0===s?void 0:s.querySelector(".submega-tab-content div[role='tabpanel']"))||void 0===r||r.classList.add("hidden"),null==e||e.classList.remove("hidden")}}catch(e){console.error("An error occurred in the click event:",e)}})}))}}L.instance=null;class E{constructor(){var e;this.secondHead=document.querySelector(".second-head"),this.aside=document.querySelector(".blog-aside"),this.headerH=(null===(e=this.secondHead)||void 0===e?void 0:e.offsetHeight)||0,this.aside&&(this.aside.style.top=this.headerH-64+"px");const t=document.querySelectorAll(".link-target");null==t||t.forEach(e=>{e.style.scrollMarginTop=this.headerH-30+"px"})}}class C{constructor(){if(this.offerSlider=document.querySelector(".offers-slider"),this.offerWrapper=document.querySelector(".offers-block-wrapper"),this.offerSlider){const e=this.offerSlider.getElementsByTagName("li").length;let t=4;e<t&&(t=e);(0,i.tns)({container:this.offerSlider,items:1,loop:!1,gutter:20,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3},1300:{items:t}}});document.querySelectorAll(".mega-menu");let o=document.querySelector(".slide-block");null==o||o.offsetHeight,window.matchMedia("(max-width: 768px)")}}}class A{constructor(){var e,t,o,n;this.reviewSlider=document.querySelector(".review-slider"),this.reviewSlider1=document.querySelector(".review-slider1"),this.reviewWrapper=document.querySelector(".reviews-list-wrapper");let s=null!==(t=null===(e=this.reviewSlider)||void 0===e?void 0:e.querySelectorAll(".reviews-item").length)&&void 0!==t?t:0;if(s<4&&window.innerWidth>=1024)null===(n=null===(o=this.reviewSlider)||void 0===o?void 0:o.classList)||void 0===n||n.remove("review-slider");else if(1==s&&this.reviewWrapper)this.reviewWrapper.style.paddingBottom="0";else{const e=e=>{(0,i.tns)({container:e,items:1,loop:!1,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3}}})};if(this.reviewSlider){e(this.reviewSlider);document.querySelectorAll(".mega-menu");let t=document.querySelector(".slide-block");null==t||t.offsetHeight,window.matchMedia("(max-width: 768px)")}if(this.reviewSlider1){e(this.reviewSlider1);document.querySelectorAll(".mega-menu");let t=document.querySelector(".slide-block");null==t||t.offsetHeight,window.matchMedia("(max-width: 768px)")}}if(this.reviewSlider){const e=200,t=document.querySelectorAll(".reviews-list-wrapper .reviews-item .review");if(!t||0===(null==t?void 0:t.length))return;null==t||t.forEach(t=>{var o;if(!(t instanceof HTMLElement))return;const n=(null===(o=null==t?void 0:t.textContent)||void 0===o?void 0:o.trim())||"";if(t.style.display="inline-block",n.length<=e)return;const i=(null==n?void 0:n.slice(0,e))+"...",s=n,r=document.createElement("span");r.className="short-text",r.textContent=i;const l=document.createElement("span");l.className="full-text",l.textContent=s,l.style.display="none";const a=document.createElement("button");a.className="read-btn",a.textContent=" Read More",a.style.cursor="pointer",a.style.textDecoration="underline",a.style.fontStyle="normal",t.textContent="",t.appendChild(r),t.appendChild(l),t.appendChild(a),a.addEventListener("click",()=>{const e="none"!==r.style.display;r.style.display=e?"none":"inline",l.style.display=e?"inline":"none",a.textContent=e?" Read Less":" Read More"})})}}}class _{constructor(){this.slideIndexMap=new Map;const e=document.querySelectorAll(".photo-gallery-section.content_manual");
3null==e||e.forEach(e=>{const t=null==e?void 0:e.querySelector(".gallery-slider"),o=null==e?void 0:e.querySelector(".gallery-modal");if(!o)return;const n=(null==o?void 0:o.getElementsByClassName("pop-up-slider"))||[],s=(0,r.removeElementEventListeners)(null==o?void 0:o.querySelector(".prev")),l=(0,r.removeElementEventListeners)(null==o?void 0:o.querySelector(".next")),a=(0,r.removeElementEventListeners)(null==o?void 0:o.querySelector(".close"));if(!s||!l||!a)return;const d=e;this.slideIndexMap.set(d,1);null==a||a.addEventListener("click",()=>{o&&(o.style.display="none")});const c=d.querySelector(".gallery-wrapper .photo-gallery-list");null==c||c.addEventListener("click",e=>{e.stopImmediatePropagation();const t=e.target;if(t instanceof HTMLImageElement){const e=Array.from(c.querySelectorAll("img")).indexOf(t);this.setSlideIndex(d,e+1),o&&(o.style.display="flex"),this.showSlides(d,n,e+1),this.updateNavButtons(d,n,s,l)}}),null==s||s.addEventListener("click",()=>{this.plusSlides(d,-1,n,s,l)}),null==l||l.addEventListener("click",()=>{this.plusSlides(d,1,n,s,l)}),t&&(0,i.tns)({container:t,items:1,loop:!1,slideBy:"page",nav:!0,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3}}})})}setSlideIndex(e,t){this.slideIndexMap.set(e,t)}getSlideIndex(e){var t;return null!==(t=this.slideIndexMap.get(e))&&void 0!==t?t:1}plusSlides(e,t,o,n,i){let s=this.getSlideIndex(e)+t;s<1&&(s=1),s>o.length&&(s=o.length),this.setSlideIndex(e,s),this.showSlides(e,o,s),this.updateNavButtons(e,o,n,i)}showSlides(e,t,o){for(const e of t)e.style.display="none";const n=t[o-1];n&&(n.style.display="flex")}updateNavButtons(e,t,o,n){const i=this.getSlideIndex(e);o.disabled=1===i,n.disabled=i===t.length}}class k{constructor(){this.stepsSlider=document.querySelector(".steps-slider"),this.stepsWrapper=document.querySelector(".steps-img-wrapper");if(this.stepsSlider){(e=>{(0,i.tns)({container:e,items:1,loop:!1,slideBy:"page",nav:!0,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:1}}});const t=e.getElementsByTagName("li").length,o=document.querySelectorAll(".card-step"),n=document.querySelector(".card-steps-wrapper"),s=document.querySelector('.service-steps button[data-controls="prev"]'),r=document.querySelector('.service-steps button[data-controls="next"]');let l=0;null==s||s.addEventListener("click",()=>{l>0&&(l--,o.forEach((e,t)=>{t===l?e.classList.add("active-step"):e.classList.remove("active-step")})),window.innerWidth<1024?null==n||n.scrollBy(-322,0):null==n||n.scrollBy(-316,0)}),null==r||r.addEventListener("click",()=>{l<t-1&&(l++,o.forEach((e,t)=>{t===l?e.classList.add("active-step"):e.classList.remove("active-step")})),window.innerWidth<1024?null==n||n.scrollBy(322,0):null==n||n.scrollBy(316,0)})})(this.stepsSlider);document.querySelectorAll(".mega-menu");let e=document.querySelector(".slide-block");null==e||e.offsetHeight,window.matchMedia("(max-width: 768px)")}}}class N{constructor(){this.initWindowSlider(),window.screen&&window.screen.width<1024&&this.initWindowWrapSlider()}initWindowSlider(){const e=document.querySelectorAll(".window-slider");this.initSlider(e)}initWindowWrapSlider(){const e=document.querySelectorAll(".window-wrap");this.initSlider(e)}initSlider(e){let t=document.getElementsByClassName("window-list-wrapper");for(let o=0;o<t.length;o++)if(e[o]){(0,i.tns)({container:e[o],items:1,slideBy:"page",loop:!1,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{640:{items:2},1024:{items:4}}})}}}class T{constructor(){this.logoImgSliderFunction()}static getInstance(){return T.instance||(T.instance=new T),T.instance}logoImgSliderFunction(){document.querySelectorAll(".meet-the-team-teaser .meet-the-team-teaser-list").forEach(e
3=>{const t=e.querySelectorAll(".logo-img-carousel-item");t.length>6&&t.forEach((e,t)=>{t>=6&&e.remove()});const o=(0,i.tns)({container:e,items:1,loop:!1,gutter:0,nav:!0,controls:!0,edgePadding:0,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{640:{items:2,gutter:24,nav:!1},1024:{items:3,gutter:24,nav:!1,slideBy:"page"}}}),n=e.closest(".logo-img-carousel-wrap");if(!n)return;const s=n.querySelector(".tns-outer");s instanceof HTMLElement&&(s.style.overflow="hidden");const r=()=>{if(window.innerWidth<640){const e=o.getInfo().index,t=n.querySelector(".tns-nav");if(!t)return;t.style.display="flex";const i=t.querySelectorAll("button");if(i.length>3){i.forEach(e=>{e.style.display="none",e.classList.remove("tns-nav-active")});const t=3*Math.floor(e/3),n=e%3;for(let e=0;e<3&&t+e<i.length;e++){const n=i[e];n.style.display="",n.onclick=function(){const n=t+e;o.goTo(n)}}i[n]&&i[n].classList.add("tns-nav-active")}}};o.events.on("indexChanged",r),setTimeout(r,100)});const e=document.querySelectorAll(".logo-img-slider");e&&0!==e.length&&e.forEach(e=>{if(!e)return;if(e.closest(".meet-the-team-teaser"))return;const t=e.closest(".logo-img-carousel-wrap");if(!(t instanceof HTMLElement))return;const o=e.querySelectorAll(".logo-img-carousel-item").length,n=null!==e.closest(".our-team-section-v2");if(!n&&o<5&&window.innerWidth>=1024)return e.classList.remove("logo-img-slider"),void(t.style.paddingBottom="0");if(!e.classList.contains("tns-initialized"))if("function"==typeof i.tns){const o=null!==document.querySelector(".logo-img-carousel-list-auto-scroll");if(n){const o=(0,i.tns)({container:e,items:1,loop:!1,gutter:0,nav:!0,controls:!0,edgePadding:0,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{640:{items:2,gutter:24,nav:!1},1024:{items:3,gutter:24,nav:!1}}});e.classList.add("tns-initialized");const n=t.querySelector(".tns-outer");n instanceof HTMLElement&&(n.style.overflow="hidden");const s=()=>
3{if(window.innerWidth<640){const e=o.getInfo().index,n=t.querySelector(".tns-nav");n&&(n.style.display="flex");const i=t.querySelectorAll(".tns-nav button");if(i.length>3){i.forEach(e=>{e.style.display="none"});const t=e%3;for(let e=0;e<3&&e<i.length;e++)i[e].style.display="";i.forEach((e,o)=>{o===t?e.classList.add("tns-nav-active"):o<3&&e.classList.remove("tns-nav-active")})}}};o.events.on("indexChanged",s),setTimeout(s,100)}else{const t=(0,i.tns)({container:e,items:1,loop:o,slideBy:"page",autoplay:o,autoplayTimeout:5e3,autoplayButtonOutput:!1,autoplayResetOnVisibility:!1,speed:1e3,mode:"carousel",animateIn:"tns-fadeIn",animateOut:"tns-fadeOut",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:5}}});if(e.classList.add("tns-initialized"),t.events.on("indexChanged",()=>(0,r.manageTNSPaginationDots)(t,".logo-img-carousel")),setTimeout(()=>(0,r.manageTNSPaginationDots)(t,".logo-img-carousel"),150),o){const o=e.closest(".logo-img-carousel-wrap"),n=null==o?void 0:o.querySelector('.tns-controls [data-controls="prev"]'),i=null==o?void 0:o.querySelector('.tns-controls [data-controls="next"]');null==n||n.addEventListener("click",()=>{setTimeout(()=>{t.play()},100)}),null==i||i.addEventListener("click",()=>{setTimeout(()=>{t.play()},100)})}}}else console.warn("Tiny Slider is not loaded.")})}}class B{constructor(){this.handlePopoverButton()}static getInstance(){return B.instance||(B.instance=new B),B.instance}handlePopoverButton(){if(window.innerWidth>768){const e=document.querySelectorAll(".open-modal-btn"),t=document.querySelectorAll(".close-popover");e.forEach(function(e){e.addEventListener("click",function(){const t=e.getAttribute("data-popover-target"),o=document.getElementById(t);o&&(o.style.display="flex",o.style.zIndex="11")})}),t.forEach(function(e){e.addEventListener("click",function(){const t=e.closest("[data-popover]");t&&(t.style.display="none",t.style.zIndex="5")})})}if(window.innerWidth<=768){const e=document.querySelectorAll(".open-modal-btn"),t=document.querySelector(".popover-mobile");null!=t&&(t.style.display="none",e.forEach(function(o){o.addEventListener("click",function(){const n=o.nextElementSibling.innerHTML;t.innerHTML=n,t.style.display="flex";const i=t.querySelector(".close-popover");null==i||i.addEventListener("click",function(){t.style.display="none"}),document.addEventListener("click",function(o){const n=t.contains(o.target),i=Array.from(e).some(function(e){return e.contains(o.target)});n||i||(t.style.display="none")})})}))}}}class P{static getInstance(){return P.instance||(P.instance=new P),P.instance}constructor(){this.multiImgSlideIndex=1,this.multiImgSlides=document.getElementsByClassName("pop-up-img-slider");if(document.querySelector(".multi-img-section")){const e=document.querySelectorAll(".multi-img-item"),t=document.querySelector("#multiImageModal .close"),o=document.querySelector("#multiImageModal .prev"),n=document.querySelector("#multiImageModal .next");null==t||t.addEventListener("click",()=>{document.getElementById("multiImageModal").style.display="none",document.body.style.overflow=""}),o&&o.addEventListener("click",()=>this.plusMultiSlides(-1)),n&&n.addEventListener("click",()=>this.plusMultiSlides(1)),null==e||e.forEach(e=>{e.addEventListener("click",()=>{var t;const o=null===(t=e.children[0])||void 0===t?void 0:t.getAttribute("data-image-id"),n=null!==o?Number(o):0;this.openModalMultiImg(n)})})}}openModalMultiImg(e){let t=document.getElementById("multiImageModal");t&&(t.style.display="flex",document.body.style.overflow="hidden"),this.currentMultiSlide(e)}plusMultiSlides(e){const t=document.querySelector("#multiImageModal .prev"),o=document.querySelector("#multiImageModal .next");this.multiImgSlideIndex>=this.multiImgSlides.length-1&&e>0?(this.multiImgSlideIndex=this.multiImgSlideIndex+e,this.showMultiSlides(this.multiImgSlideIndex),this.disableButton(o,!0),this.disableButton(t,!1)):this.multiImgSlideIndex<=2&&e<0?(this.multiImgSlideIndex=this.multiImgSlideIndex+e,this.showMultiSlides(this.multiImgSlideIndex),this.disableButton(o,!1),this.disableButton(t,!0)):(this.multiImgSlideIndex=this.multiImgSlideIndex+e,this.showMultiSlides(this.multiImgSlideIndex),this.disableButton(o,!1),this.disableButton(t,!1))}disableButton(e,t){e&&(e.disabled=t)}currentMultiSlide(e){this.multiImgSlideIndex=e,this.showMultiSlides(this.multiImgSlideIndex);const t=document.querySelector("#multiImageModal .prev"),o=document.querySelector("#multiImageModal .next"),n=document.getElementsByClassName("pop-up-img-slider");this.multiImgSlideIndex===n.length?this.disableButton(o,!0):1===this.multiImgSlideIndex?(this.disableButton(t,!0),this.disableButton(o,!1)):(this.disableButton(o,!1),this.disableButton(t,!1))}showMultiSlides(e){let t;const o=document.getElementsByClassName("pop-up-img-slider");for(e>o.length&&(this.multiImgSlideIndex=1),e<1&&(this.multiImgSlideIndex=o.length),t=0;t<o.length;t++)o[t].style.display="none";o[this.multiImgSlideIndex-1].style.display="flex"}}class j{constructor(){var e,t;this.sections=Array.from(document.querySelectorAll(".inspiration-gallery")),(null===(e=this.sections)||void 0===e?void 0:e.length)&&(null===(t=this.sections)||void 0===t||t.forEach(e
3=>this.init(e)))}static getInstance(){return j.instance||(j.instance=new j),j.instance}init(e){const t=e.querySelector("#galleryModal"),o=Array.from(e.getElementsByClassName("pop-up-slider")),n=e.querySelectorAll(".photo-card-item");if(!t||0===o.length)return;const i=t.querySelector(".close"),s=t.querySelector(".prev"),r=t.querySelector(".next");let l=1;const a=e=>{0!==o.length&&(e>o.length&&(l=1),e<1&&(l=o.length),null==o||o.forEach(e=>e.style.display="none"),o[l-1].style.display="flex",s.disabled=1===l,r.disabled=l===o.length)},d=e=>{l+=e,a(l)};null==i||i.addEventListener("click",()=>{t&&(t.style.display="none"),document.body.style.overflow=""}),null==s||s.addEventListener("click",()=>d(-1)),null==r||r.addEventListener("click",()=>d(1)),null==n||n.forEach(e=>{var o;if(!e.querySelector(".video-area")){const n=null===(o=e.children[0])||void 0===o?void 0:o.getAttribute("data-photo-id"),i=n?Number(n):1;null==e||e.addEventListener("click",()=>{return e=i,void(t&&(t.style.display="flex",document.body.style.overflow="hidden",l=e,a(l)));var e})}}),this.copySocialLink(e)}copySocialLink(e){const t=e.querySelectorAll(".copy_link_share");null==t||t.forEach(e=>{e&&e.addEventListener("click",e=>{e.preventDefault();let t=decodeURIComponent(window.location.href);navigator.clipboard.writeText(t).then(()=>{console.log("URL copied to clipboard"),alert(`${t}\n Copied to Clipboard`)}).catch(e=>{console.error("Failed to copy URL: ",e)})})})}}class D{static getInstance(){return D.instance||(D.instance=new D),D.instance}constructor(){this.transFormationSlider()}transFormationSlider(){let e=document.querySelector(".transformation-slider");e&&(0,i.tns)({container:e,items:1,loop:!1,gutter:10,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>']})}}class M{static getInstance(){return M.instance||(M.instance=new M),M.instance}constructor(){this.solutionMagazineSlider();const e=document.querySelector(".solution-magazine-slider");null==e||e.addEventListener("transitionend",this.handleSolutionSliderChange),setTimeout(this.handleSolutionSliderChange,100)}solutionMagazineSlider(){let e=document.querySelector(".solution-magazine-slider");e&&(0,i.tns)({container:e,items:1,loop:!1,gutter:10,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],navContainer:"#magazine-thumbnails",navAsThumbnails:!0,swipeAngle:!1,onInit:this.handleSolutionSliderChange})}handleSolutionSliderChange(){const e=document.querySelector(".solution-magazine-slider");if(e){const t=Array.from(e.children).findIndex(e=>e.classList.contains("tns-slide-active")),o=document.querySelectorAll(".thumbnails li"),n=o.length;o.forEach(function(e){e.style.display="none"});const i=Math.max(0,t-2),s=Math.min(n,i+6),r=s-i;for(let e=i;e<s;e++)o[e].style.display="inline-block";const l=6-r;if(l>0){for(let e=Math.max(0,i-l);e<i;e++)o[e].style.display="inline-block"}}}}class q{static getInstance(){return q.instance||(q.instance=new q),q.instance}constructor(){var e;document.querySelector(".color-visualizer-carousel")&&(this.tinySliderInstance=(0,i.tns)({container:".color-visualizer-carousel",items:1,slideBy:"page",autoplay:!1,controls:!0,loop:!1,gutter:10,controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],navAsThumbnails:!0,nav:!1}),this.allThumbnails=document.querySelectorAll(".thumbnails ul li"),this.dropdownBtn=document.querySelector(".dropdown-btn"),this.dropdownContent=document.querySelector(".dropdown-content"),this.btnContent=null===(e=this.dropdownBtn)||void 0===e?void 0:e.querySelector(".dropdown-btn-content"),this.init())}insertCheckIcon(e){const t=e.querySelector(".thumb-icon");t&&(t.innerHTML='\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#check-mark"></use>\n </svg>\n ')}insertChevronIcon(e){const t=e.querySelector(".thumb-icon");t&&(t.innerHTML='\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-down"></use>\n </svg>\n ')}activateImageById(e){var t,o,n,i,s,r;null===(t=document.querySelectorAll(".color-visualizer-item"))||void 0===t||t.forEach(t=>{null==t||t.classList.remove("active"),(null==t?void 0:t.getAttribute("data-id"))===e&&(null==t||t.classList.add("active"))}
3),null===(o=this.allThumbnails)||void 0===o||o.forEach(t=>{null==t||t.classList.remove("active-thumb"),(null==t?void 0:t.getAttribute("data-id"))===e&&(null==t||t.classList.add("active-thumb"))}),null===(n=this.dropdownContent)||void 0===n||n.querySelectorAll("li").forEach(t=>{null==t||t.classList.remove("active-thumb"),(null==t?void 0:t.getAttribute("data-id"))===e&&(null==t||t.classList.add("active-thumb"))}),null===(i=this.dropdownContent)||void 0===i||i.querySelectorAll("li .thumb-icon").forEach(e=>e.innerHTML=""),document.querySelectorAll(".thumbnails ul li .thumb-icon").forEach(e=>e.innerHTML="");const l=null===(s=this.dropdownContent)||void 0===s?void 0:s.querySelector(`li[data-id="${e}"] .palette-card`),a=document.querySelector(`.thumbnails ul li[data-id="${e}"] .palette-card`);l&&this.insertCheckIcon(l),a&&this.insertCheckIcon(a);const d=null===(r=this.dropdownContent)||void 0===r?void 0:r.querySelector(`li[data-id="${e}"] .palette-card`);if(d){this.btnContent&&(this.btnContent.innerHTML="");const e=d.cloneNode(!0);this.insertChevronIcon(e),this.btnContent&&this.btnContent.appendChild(e)}}updateVisibleThumbnailsBySlide(e){var t,o;const n=null==e?void 0:e.querySelectorAll(".color-visualizer-item"),i=[];null==n||n.forEach(e=>{const t=e.getAttribute("data-id");t&&i.push(t)}),null===(t=this.allThumbnails)||void 0===t||t.forEach(e=>{const t=null==e?void 0:e.getAttribute("data-id");t&&(e.style.display=(null==i?void 0:i.includes(t))?"inline-block":"none")}),this.dropdownContent&&(this.dropdownContent.innerHTML=""),null===(o=this.allThumbnails)||void 0===o||o.forEach(e=>{var t,o;const n=null!==(t=null==e?void 0:e.getAttribute("data-id"))&&void 0!==t?t:"";if(null==i?void 0:i.includes(n)){const t=null==e?void 0:e.cloneNode(!0);null==t||t.setAttribute("data-id",n),null===(o=this.dropdownContent)||void 0===o||o.appendChild(t),t.addEventListener("click",()=>{this.activateImageById(n),this.dropdownContent&&(this.dropdownContent.style.display="none");const e=t.querySelector(".palette-card");if(e){const t=e.cloneNode(!0);this.insertChevronIcon(t),this.btnContent&&(this.btnContent.innerHTML="",this.btnContent.appendChild(t))}})}})}init(){var e,t,o,n,i,s;const r=document.querySelector(".color-visualizer-section .thumbnails"),l=document.querySelector(".color-visualizer-section .thumbnails-dropdown");if(null===(e=this.allThumbnails)||void 0===e?void 0:e.length){let e=!0,o=!0;null===(t=this.allThumbnails)||void 0===t||t.forEach(t=>{var n;const i=null==t?void 0:t.querySelector(".color-vir-li-img img"),s=null==i?void 0:i.getAttribute("src"),r=null==t?void 0:t.querySelector(".color-var-li-text");!s&&i?i.style.display="none":s&&""!==s.trim()&&(e=!1),(null===(n=null==r?void 0:r.textContent)||void 0===n?void 0:n.trim())&&(o=!1),null==t||t.addEventListener("click",()=>{const e=null==t?void 0:t.getAttribute("data-id");this.activateImageById(e)})}),e&&(null==r||r.classList.add("thumbnails-only-title"),null==l||l.classList.add("thumbnails-only-title")),o&&(null==r||r.classList.add("thumbnails-only-image"),null==l||l.classList.add("thumbnails-only-image"))}null===(o=this.dropdownBtn)||void 0===o||o.addEventListener("click",e=>{var t,o;if(e.stopPropagation(),!this.dropdownContent)return;const n="block"===(null===(t=this.dropdownContent)||void 0===t?void 0:t.style.display);if(this.dropdownContent.style.display=n?"none":"block",!n){const e=null===(o=this.dropdownContent)||void 0===o?void 0:o.querySelector(".active-thumb .palette-card");if(e){this.btnContent&&(this.btnContent.innerHTML="");const t=e.cloneNode(!0);this.insertChevronIcon(t),this.btnContent&&this.btnContent.appendChild(t)}}}),document.addEventListener("click",e=>{const t=e.target;!t||t.closest(".thumbnails-dropdown")||t.closest(".dropdown-btn")||t.closest(".bio-btn")||this.dropdownContent&&(this.dropdownContent.style.display="none")}),null===(i=null===(n=this.tinySliderInstance)||void 0===n?void 0:n.events)||void 0===i||i.on("indexChanged",e=>{const t=e.slideItems[e.index];null==t||t.querySelectorAll(".color-visualizer-item").forEach((e,t)=>{null==e||e.classList.remove("active"),0===t&&(null==e||e.classList.add("active"))}
3),this.updateVisibleThumbnailsBySlide(t);const o=null==t?void 0:t.querySelector(".color-visualizer-item.active");o&&this.activateImageById(o.getAttribute("data-id"))}),window.addEventListener("load",()=>{const e=setInterval(()=>{var t,o;const n=null===(t=this.tinySliderInstance)||void 0===t?void 0:t.getInfo();if(n&&(null===(o=null==n?void 0:n.slideItems)||void 0===o?void 0:o.length)>0){clearInterval(e);const t=n.slideItems[n.index];this.updateVisibleThumbnailsBySlide(t);const o=t.querySelector(".color-visualizer-item.active");o&&this.activateImageById(o.getAttribute("data-id"))}},100)});const a=document.getElementById("color-image-modal"),d=document.getElementById("color-modal-img"),c=document.querySelector(".visual-close");null===(s=document.querySelectorAll(".color-visualizer-item img"))||void 0===s||s.forEach(e=>{null==e||e.addEventListener("click",function(){var e;if(a&&(a.style.display="flex"),d){const t=d;t.src=null!==(e=this.getAttribute("data-large"))&&void 0!==e?e:"",t.alt=this.alt||""}})}),null==c||c.addEventListener("click",function(){a&&(a.style.display="none")}),null==a||a.addEventListener("click",function(e){e.target===a&&(a.style.display="none")})}}class R{constructor(){this.initSlider()}static getInstance(){var e;return null!==(e=R.instance)&&void 0!==e||(R.instance=new R),R.instance}initSlider(){const e=document.querySelector(".upcoming-events-slider .card-list");e&&(0,i.tns)({container:e,items:1,loop:!1,slideBy:"page",nav:!0,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3}}})}}R.instance=null;class O{constructor(){this.initSlider()}static getInstance(){var e;return null!==(e=O.instance)&&void 0!==e||(O.instance=new O),O.instance}initSlider(){const e=document.querySelector(".brand-popup-photo-gallery-slider");e&&(0,i.tns)({container:e,items:1,loop:!1,slideBy:"page",nav:!1,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3}}})}}O.instance=null;class x{constructor(){this.initSlider()}static getInstance(){var e;return null!==(e=x.instance)&&void 0!==e||(x.instance=new x),x.instance}initSlider(){const e=document.querySelector(".brand-popup-review-slider");e&&(0,i.tns)({container:e,items:2,loop:!1,slideBy:"page",nav:!1,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],gutter:12})}}function F(){const e=document.querySelector(".read-more-wrap");if(e){const t=e.innerHTML.trim(),o=t.split(/\s+/);if(o.length>100){const n=o.slice(0,100).join(" ")+"...";e.innerHTML=n;const i=document.createElement("button");i.textContent="...Read More",i.className="red-more-button",i.style.width="fit-content",e.appendChild(i),i&&i.addEventListener("click",function(){"...Read More"===i.textContent?(e.innerHTML=t,i.textContent="...Read Less",e.appendChild(i)):(e.innerHTML=n,i.textContent="...Read More",e.appendChild(i))})}}}function $(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;try{const t=document.querySelector(".header-wrapper"),o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,r.getBrandDetailsFromBrandJson)(o),i=localStorage.getItem("dbaName");t&&(null==n?void 0:n.show_localheader_dba_center)&&i?t.classList.add("menu-local"):null==t||t.classList.remove("menu-local")}catch(e){console.error("An error occurred in the addLocalizationHeaderMenuLocal function:",e)}})}function H(e){var t,o,n,i;const s=document.querySelector(".sticky-footer"),r=s.querySelector(".sticky_title"),l=s.querySelector(".icon.sticky_icon"),a=document.querySelector("footer");if(null===(t=null==s?void 0:s.classList)||void 0===t||t.remove("hidden"),null===(o=null==s?void 0:s.classList)||void 0===o||o.add("footer-fixed"),a&&(a.style.paddingBottom=s.offsetHeight+"px"),e.sticky_subtitle&&r&&(r.innerHTML=e.sticky_subtitle,(null===(n=null==e?void 0:e.sticky_subtitle_icon)||void 0===n?void 0:n.trim())&&l&&(l.innerHTML=e.sticky_subtitle_icon)),(null===(i=null==e?void 0:e.sticky_icon)||void 0===i?void 0:i.trim())&&l&&(l.innerHTML=e.sticky_icon),!r&&e.sticky_title){const t=document.querySelector(".sticky-footer .sticky-footer-cta");if(!t)return;const o=`${t.outerHTML.split("</svg>")[0]}</svg>${e.sticky_title}</a>`,n=document.querySelector(".sticky-footer-wrap");n?n.innerHTML=o:t.parentElement&&(t.parentElement.innerHTML=o)}}function z(e){const t=e.querySelector(".service-tile-list");if(null==t?void 0:t.classList.contains("auto-expand-tile"))return;const o=e.querySelectorAll(".service-tile-card-subtext");(null==o?void 0:o.length)>
30&&(o.forEach(e=>{if(null==e?void 0:e.textContent){const t=e.textContent.trim(),o=t.slice(0,140);if(t.length>140){const n=document.createElement("span");n.textContent="...",n.classList.add("ellipsis"),n.style.cursor="pointer",n.setAttribute("data-fulltext",t),e.textContent=o,e.appendChild(n)}}}),null==t||t.addEventListener("click",e=>{var t,o;const n=e.target;if(null==n?void 0:n.classList.contains("ellipsis")){const n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.parentElement;if(null==n?void 0:n.textContent){const t=null===(o=e.target)||void 0===o?void 0:o.getAttribute("data-fulltext");t&&(n.textContent=t)}}}))}function W(e){var t,o;const n=null!=e?e:{};"dynamic menu icons"===(null===(o=null===(t=null==n?void 0:n.dynamicMenuType)||void 0===t?void 0:t.toLowerCase())||void 0===o?void 0:o.trim())&&document.querySelectorAll(".new-expand-menu.no-tab-switch").forEach(e=>{e.addEventListener("click",function(t){var o;t.preventDefault();const n=e.closest(".tab-sibling");n&&n.classList.add("hide-menu");const i=this.getAttribute("data-target"),s=i?document.getElementById(i):null,r=null===(o=null==s?void 0:s.parentElement)||void 0===o?void 0:o.parentElement;(null==r?void 0:r.classList.contains("dynamic-menu-wrap"))&&(r.classList.remove("hide-menu"),r.classList.add("show-menu")),s&&(document.querySelectorAll(".new-submenu-inner-warp > div").forEach(e=>{e.classList.add("hide-menu"),e.classList.remove("show-menu")}),document.querySelectorAll(".new-submenu-inner-wrap-mobile > div").forEach(e=>{e.classList.add("hide-menu"),e.classList.remove("show-menu")}),s.classList.remove("hide-menu"),s.classList.add("show-menu"))});document.querySelectorAll(".back-to-menu-btn").forEach(e=>{e.addEventListener("click",function(){const e=this.getAttribute("data-back");if(e){const t=document.getElementById(e);if(t){t.classList.remove("show-menu"),t.classList.add("hide-Submenu");const e=null==t?void 0:t.closest(".dynamic-menu-wrap");e&&(e.classList.add("hide-menu"),e.classList.remove("show-menu"))}}})});document.querySelectorAll(".new-back-btn").forEach(e=>{e.addEventListener("click",function(){const t=e.closest(".mega-menu");if(t){const e=t.querySelector(".tab-sibling");e&&e.classList.remove("hide-menu")}const o=this.getAttribute("data-back");if(o){const e=document.getElementById(o);e&&(e.classList.remove("show-menu"),e.classList.add("hide-menu"))}})});const t=document.querySelectorAll(".dynamic-menu-wrap"),o=document.querySelectorAll(".new-submenu-inner-warp > div");t&&(null===window||void 0===window?void 0:window.matchMedia("(min-width: 1024px)").matches)&&t.forEach(e=>{e.addEventListener("mouseleave",function(){o.forEach(e=>{e.classList.remove("show-menu"),e.classList.add("hide-menu")}),e.classList.add("hide-menu"),e.classList.remove("show-menu");const t=document.querySelectorAll(".new-dynamic-menu .mega-inner-warp");null==t||t.forEach(e=>{e.classList.remove("hide-menu")})})})})}x.instance=null,document.addEventListener("DOMContentLoaded",()=>{new E,new C,new A,new _,new k,new N;T.getInstance(),B.getInstance(),P.getInstance(),j.getInstance(),D.getInstance(),M.getInstance(),q.getInstance(),null==R||R.getInstance();if(document.querySelectorAll(".meet-the-team-teaser .bio-btn").length>0){const{Concert:e}=o(/*! ./teams */"./src/js/global/teams.ts");e.getInstance()}setTimeout(()=>{(0,a.reportScreenSize)()!==l.ScreenType.Desktop&&(function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e;let t=localStorage.getItem("brandDetails");const o=localStorage.getItem("fullAttrOnLoad"),n=localStorage.getItem("dbaName");let i=yield(0,m.getDisplayPhoneNumber)();const s=localStorage.getItem("siteConfigDisplayClickToCallCta");t&&(t=JSON.parse(t));const l=document.querySelectorAll(".replace-with-click-to-lead-cta.cta-header-component-lead"),a=document.querySelectorAll(".replace-with-click-to-call-cta.cta-header-component-call"),d=document.querySelectorAll(".replace-with-click-to-lead-cta.cta-body-component-lead"),c=o&&(0,r.isOperationActiveNow)(null===(e=JSON.parse(o))||void 0===e?void 0:e.hoursofOperation),u=e=>{if((null==t?void 0:t.mobile_cta_text)&&(e.innerHTML=t.mobile_cta_text),e){const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("aria-hidden","true"),o.innerHTML=t.mobile_cta_icon,e.prepend(o)}e instanceof HTMLAnchorElement&&i&&(i=String(i),e.href=`tel:${i.replace(/[\(\)\-\s]/g,"")}`)},h=e=>
3{e.forEach(e=>{e.classList.add("hidden")})},p=e=>{e.forEach(e=>{e.classList.remove("hidden")})};(null==t?void 0:t.displayClickToCallCtaHeader)&&"true"===s&&(null==t?void 0:t.displayClickToCallCtaBody)&&(!n||n&&o&&c)?(h(l),h(d),p(a),a.forEach(u),p(d),d.forEach(u)):(null==t?void 0:t.displayClickToCallCtaHeader)&&"true"===s&&!(null==t?void 0:t.displayClickToCallCtaBody)&&(!n||n&&o&&c)?(h(l),p(d),p(a),a.forEach(u)):!(null==t?void 0:t.displayClickToCallCtaHeader)&&"true"===s&&(null==t?void 0:t.displayClickToCallCtaBody)&&(!n||n&&o&&c)?(p(l),p(a),p(d),d.forEach(u)):(p(l),p(d),p(a))})}(),function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if("true"===localStorage.getItem("siteConfigHideOSCTA"))return;if(document.querySelector(".sticky-footer")){const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,r.getBrandDetailsFromBrandJson)(t),n=localStorage.getItem("dbaName");(null==o?void 0:o.enable_sticky_footer_national)&&!n&&H(o),(null==o?void 0:o.enable_sticky_footer_local)&&n&&H(o)}})}())},1e3),function(){const e=document.getElementById("header-alert");e&&(0,d.getMessagesData)().then(t=>{const o=null==t?void 0:t.informationBanner;if(o){if(e.classList.remove("alert-warning"),e.classList.remove("alert-info"),e.classList.remove("alert-danger"),(null==o?void 0:o.alertClass)&&"string"==typeof o.alertClass&&e.classList.add(o.alertClass),null==o?void 0:o.infotext){const t=null==e?void 0:e.querySelector(".alert-text .wysiwyg");t&&(t.innerHTML=null==o?void 0:o.infotext)}if(null==o?void 0:o.infosvg){const t=null==e?void 0:e.querySelector(".inner-alert svg");t&&(t.innerHTML=null==o?void 0:o.infosvg)}}}).catch(e=>{console.log(e,"Error in getting the function addLocalizationHeaderBannerInformationLocal")})}(),document.querySelectorAll("a.click-to-call[href]").forEach(e=>{e.addEventListener("click",()=>{const t=globalThis.dataLayer;"function"==typeof(null==t?void 0:t.push)&&t.push({event:"ComponentClick2call",PageType:"HomePage",Localization:(0,m.isLocalized)()?"Local":"National",ComponentName:"ImageTileSix",PageUrl:window.location.href,Phone:e.getAttribute("href")})})}),(0,c.isTouchDevice)()&&function(){const e=document.querySelectorAll(".card-item .card-main.clicktocall");e.length>0&&e.forEach(e=>{const t=e.querySelector(".mobile-only"),o=e.querySelector(".full-link");if(t&&o){const e=t.getAttribute("href");e&&(o.setAttribute("href",e),o.removeAttribute("target"))}})}(),(0,u.attachEventListenerForClaim)(".sp-offers-section.coupons-eight","a.secondary-btn","li.sp-offers-item",{titleSelector:".sp-offers-details .sp-offer",descriptionSelector:".sp-offers-details .sp-offer-desc",expirySelector:".sp-offer-expire",disclaimerSelector:".sp-offers-disclaimer",couponCodeInputSelector:"#coupons-code"});const e=document.querySelector(".offers-block-section");(null==e?void 0:e.classList.contains("dynamic-offer-teaser-component"))||(0,u.attachEventListenerForClaim)(".offers-block-section",".offers-block-item a.secondary-btn","li.offers-block-item",{titleSelector:".offers-block-details .block-offer",descriptionSelector:".offers-block-details .offers-block-desc",expirySelector:".offers-block-main .offers-block-expire",disclaimerSelector:".offers-block-disclaimer",couponCodeInputSelector:"#block-coupons-code"}),function(){const e=document.querySelector(".nbly-main"),t=null==e?void 0:e.querySelector(".nbly-cta");if(!e)return;(0,d.getMessagesData)().then(o=>{const n=null==o?void 0:o.nblyHeaderBanner;n&&(function(e,t){var o;const n=null==e?void 0:e.querySelector(".nbly-logo"),i=null==e?void 0:e.querySelector(".nbly-block a"),s=null==t?void 0:t.logoImage,r=null==t?void 0:t.logoAltText,l=null===(o=null==t?void 0:t.logoOpenNewTab)||void 0===o?void 0:o.toLocaleLowerCase(),a=null==t?void 0:t.imageLink;"yes"===l&&i&&i.setAttribute("target","_blank");a&&i&&i.setAttribute("href",a);n&&s&&(n.innerHTML=s);r&&n&&n.setAttribute("alt",r)}(e,n),function(e,t){const o=null==t?void 0:t.nblyHeader_link;e&&(null==o?void 0:o.length)>0&&(e.innerHTML="",null==o||o.forEach(t=>{var o;const n=document.createElement("a"),i=t.linkText,s=t.ctaClass,r=t.linkType,l=null===(o=t.openNewTab)||void 0===o?void 0:o.toLocaleLowerCase();r&&n.setAttribute("href",r),s&&n.setAttribute("class",s),"yes"===l&&n.setAttribute("target","_blank"),i&&(n.innerHTML=i),e.appendChild(n)}))}(t,n))}).catch(e=>{console.log(e,"Error in getting the function addNblyHeaderInformation")})}(),function(){const e=document.querySelectorAll(".service-tile-section, .replacement-block, .dynamic-service-5050-media-tile-component");e.length>
30&&e.forEach(e=>{e instanceof HTMLElement&&z(e)})}(),function(){var e,t,o;try{const i=null===(e=document.getElementById("servicelargemediatile"))||void 0===e?void 0:e.value,s=null!==(o=null===(t=document.getElementById("weblocationId"))||void 0===t?void 0:t.value)&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId"),r=localStorage.getItem("dbaName");if(i&&s&&r){const e=JSON.parse(i),t=JSON.stringify(e),o={method:"POST",url:`${window.location.origin}/dynamicservicelargemediatiledata/${s}/${r}`,data:{configJson:t}};(0,h.default)(o).then(e=>{if(e){const t=document.querySelector(".service-tile-section");t&&(t.outerHTML=e)}}).catch(e=>{console.error("Error in fetching dynamic service large media tile data:",e)}).finally(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield(0,p.fetchLocalTokenInfo)();const e=document.querySelector(".service-tile-section");e instanceof HTMLElement&&z(e)}))}}catch(e){console.error("An error occurred in localDynamicMenuLargeMediaTile function:",e)}}(),function(){var e,t,o;try{const i=null===(e=document.getElementById("replacementblockdynamic"))||void 0===e?void 0:e.value,s=null!==(o=null===(t=document.getElementById("weblocationId"))||void 0===t?void 0:t.value)&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId"),r=localStorage.getItem("dbaName");if(i&&s&&r){let e=null;try{e=JSON.parse(i)}catch(t){const o=i.replace(/"/g,'"').replace(/'/g,"'");try{e=JSON.parse(o)}catch(e){return void console.warn("Failed to parse serviceLargeMediaTile JSON",e)}}if(!e||"object"!=typeof e)return void console.warn("Invalid serviceLargeMediaTile data");const t=JSON.stringify(e),o={method:"POST",url:`${window.location.origin}/dynamicservicemediatextlistdata/${s}/${r}`,data:{configJson:t}};(0,h.default)(o).then(e=>{if(e){const t=document.querySelector(".replacement-block");t&&(t.outerHTML=e)}}).catch(e=>{console.warn("Error in fetching dynamic service large media tile data:",e)}).finally(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield(0,p.fetchLocalTokenInfo)();const e=document.querySelector(".replacement-block");e instanceof HTMLElement&&z(e)}))}}catch(e){console.warn("An error occurred in localDynamicMenuLarge2575MediaTile function:",e)}}(),function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;try{const i=null===(e=document.getElementById("service5050mediatile"))||void 0===e?void 0:e.value,s=null!==(o=null===(t=document.getElementById("weblocationId"))||void 0===t?void 0:t.value)&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId"),r=localStorage.getItem("dbaName");if(i&&s&&r){let e=null;try{e=JSON.parse(i)}catch(t){const o=i.replace(/"/g,'"').replace(/'/g,"'");try{e=JSON.parse(o)}catch(e){return void console.warn("Failed to parse serviceLargeMediaTile JSON",e)}}const t=JSON.stringify(e),o={method:"POST",url:`${window.location.origin}/dynamicservice5050mediatiledata/${s}/${r}`,data:{configJson:t}};(0,h.default)(o).then(e=>{var t;if(e){const o=document.querySelector(".dynamic-service-5050-media-tile-component");if(o){o.outerHTML=e;const n=document.querySelector(".dynamic-service-5050-media-tile-component");null===(t=null==n?void 0:n.querySelectorAll(".find-a-loc-wrapper"))||void 0===t||t.forEach(e=>{e&&(e.style.display="none")})}}}).catch(e=>{console.warn("Error in fetching dynamic service large media tile 50/50 data:",e)}).finally(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield(0,p.fetchLocalTokenInfo)();const e=document.querySelector(".dynamic-service-5050-media-tile-component");e instanceof HTMLElement&&z(e)}))}}catch(e){console.warn("An error occurred in localDynamicMenuLarge5050MediaTile function:",e)}})}(),function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=localStorage.getItem("dbaName"),n=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("franchiseWebLocationId"),i=document.querySelector(".real-time-comm-cta.real-time-call-us");if(n&&o&&!globalThis.location.href.includes(o)&&i){const e=(0,I.getPageSettings)("RealTimeCommunicationComponent"),t=(0,I.getPageSettings)("pagescope");if(("true"===e||!0===e)&&"national"===t){const e={method:"GET",url:`${globalThis.location.origin}/realtimecta/${n}/${o}`};(0,h.default)(e).then(e=>{e&&(i.outerHTML=e)}).catch(e=>{console.warn("Error in fetching Phone Number:",e)})}}})}(),F(),function(){var e;try{const t=null===(e=document.getElementById("dynamicserviceaccordion"))||void 0===e?void 0:e.value,o=localStorage.getItem("weblocationId"),n=localStorage.getItem("dbaName");let i,s;if(t&&o&&n&&window.location.href.includes(n)&&(i=JSON.parse(t),s=JSON.stringify(i),sessionStorage.setItem("dynamicAccorInfo",s)),t&&o&&n&&!window.location.href.includes(n)){const e=sessionStorage.getItem("dynamicAccorInfo"),t={method:"POST",url:`${window.location.origin}/dynamicserviceaccordiondata/${o}/${n}`,data:{configJson:e}};(0,h.default)(t).then(e=>{if(!e)return;const t=document.querySelector(".residential-block.dynamic-service-accordion");if(!t)return;t.outerHTML=e,F();const o=document.querySelector("#dynamic-accordion-service");o&&(null==o||o.querySelectorAll("[data-accordion-target]").forEach(e
3=>{e.addEventListener("click",()=>{const t=e.getAttribute("data-accordion-target");if(!t)return;const o=document.querySelector(t);if(!o)return;const n="true"===e.getAttribute("aria-expanded");document.querySelectorAll(".list-accordion-btn").forEach(e=>{e.setAttribute("aria-expanded","false")}),o&&(o.classList.toggle("hidden",n),e.setAttribute("aria-expanded",String(!n)))})}))}).catch(e=>{console.error("Error in fetching dynamic service accordion data:",e)})}}catch(e){console.error("An error occurred in dynamic service accordion function:",e)}}(),function(){window.location.hash&&(history.scrollRestoration="manual",document.documentElement.style.scrollBehavior="auto",window.scrollTo(0,0));window.addEventListener("DOMContentLoaded",()=>{window.location.hash&&requestAnimationFrame(e)}),window.addEventListener("popstate",()=>{window.location.hash&&requestAnimationFrame(e)});const e=()=>{const e=window.location.hash;if(!e||/\/.*/.test(e))return;const t=document.querySelector(decodeURIComponent(e));if(!t)return;const o=()=>{const e=document.querySelector(".second-head");return e?e.offsetHeight:0};(e=>{const t=()=>{const o=document.querySelector(".second-head");o&&(null==o?void 0:o.offsetHeight)>0?e():requestAnimationFrame(t)};t()})(()=>{const e=o(),n=t.offsetTop;requestAnimationFrame(()=>{document.documentElement.style.scrollBehavior="smooth",window.scrollTo({top:n-e-10,behavior:"smooth"})})})}}(),function(e=".faqs-section ul.accordion-icon-list.accordion-icon-list .list-accordion-btn"){try{const t=(0,a.reportScreenSize)();if(t==l.ScreenType.Desktop){const e=document.querySelectorAll(".faqs-section ul.accordion-icon-list.accordion-icon-list");e&&e.length>0&&e.forEach(e=>{e.setAttribute("data-accordion","open")})}const o=document.querySelectorAll(".residential-accordion ul.accordion-icon-list");if(o&&o.length>0&&o.forEach(e=>{e.setAttribute("data-accordion","open")}),function(){const e=[0,500,1e3,5e3],t=(o=0)=>{o>=e.length?console.error("All attempts to initialize accordions failed."):setTimeout(()=>{try{!function(){const e=document.querySelectorAll("[data-accordion-target]");let t=!0;for(const o of e){const e=o.dataset.accordionTarget;try{e&&document.querySelector(e)||(t=!1)}catch(e){console.log("Error in selector:",e),t=!1}}if(!t||"function"!=typeof window.initAccordions)throw new Error("Accordion prerequisites not met.");try{window.initAccordions()}catch(e){throw console.error("Error during accordion initialization:",e),e}}()}catch(e){console.warn(`Accordion init attempt ${o+1} failed. Retrying...`,e),t(o+1)}},e[o])};t()}(),t==l.ScreenType.Desktop){const t=document.querySelectorAll(e);if(!t||0===t.length)return;t.forEach(e=>{var t;const o=e.getAttribute("data-accordion-target");if(!o)return;const n=document.querySelector(o);if(n&&e&&"function"==typeof e.click){"true"===e.getAttribute("aria-expanded")||(null===(t=n.classList)||void 0===t||t.remove("hidden"),e.setAttribute("aria-expanded","true"),e.click())}})}!function(){(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=document.getElementById("conceptCode");if(!e)return;const t=e.value,o=yield(0,r.getBrandDetailsFromBrandJson)(t);if(!(null==o?void 0:o.expand_service_accordion)){return void document.querySelectorAll(".residential-accordion ul.accordion-icon-list").forEach(e=>{e.setAttribute("data-accordion","collapse")})}const n=document.querySelectorAll(".residential-accordion ul.accordion-icon-list button.list-accordion-btn");if(!n.length)return;n.forEach(e=>{e.click()})}catch(e){console.warn("Error in expandAccordionByBrandConfig:",e)}})}()}catch(e){console.error("Error in expandAccordionOnLoad:",e)}}();(0,a.reportScreenSize)()===l.ScreenType.Desktop&&U(),function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n,i,s,l,a,d,c;try{const u=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("franchiseWebLocationId"),m=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value,h=yield(0,r.getBrandDetailsFromBrandJson)(m),p=null!==(i=null===(n=document.getElementById("conceptId"))||void 0===n?void 0:n.value)&&void 0!==i?i:null,v=null==h?void 0:h.vendorId,y=null!==(l=null===(s=document.getElementById("media_with_form_dynamic_pricing_serviceid"))||void 0===s?void 0:s.value)&&void 0!==l?l:null;if(u&&v&&p&&y){(0,b.startLoader)();const e=yield(0,g.cachedAPIWrapper)(`${f.apiConfig.QUOTE_API_URL}?webLocationId=${u}&vendorId=${v}&conceptId=${p}&serviceSkus=${y}`);if((null===(a=null==e?void 0:e.services)||void 0===a?void 0:a.length)>0){const t=null===(d=null==e?void 0:e.services)||void 0===d?void 0:d.find(e=>e.serviceID==y),o=document.querySelector(".media_with_form_dynamic_pricing");if(!o)return;const n=o.querySelectorAll(".check-list-item");if(0===n.length)return;const i=n[0],s=null==i?void 0:i.querySelector(".check-list-text");
3s?s.innerText="":i.innerText="",n.forEach((e,t)=>{0!==t&&e.remove()}),null===(c=null==t?void 0:t.pricingTiers)||void 0===c||c.forEach((e,t)=>{var n;const s=i.cloneNode(!0),r=null==s?void 0:s.querySelector(".check-list-text");if(r?r.textContent=`${null==e?void 0:e.label} - $${null==e?void 0:e.price}`:s.textContent=`${null==e?void 0:e.label} - $${null==e?void 0:e.price}`,0===t){const e=null==i?void 0:i.querySelector(".check-list-text");e?e.innerHTML=null!==(n=null==r?void 0:r.textContent)&&void 0!==n?n:"":i.textContent=s.innerText}else o.appendChild(s)})}else G();(0,b.stopLoader)()}}catch(e){console.error("Error in pricingComponent7:",e),(0,b.stopLoader)(),G()}})}(),function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;const n=document.querySelector(".pricing-section.dynamic-pricing-section");if(n)try{if(!(0,m.isLocalized)())return void n.classList.add("hidden");const i=null!==(o=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("weblocationId"))&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId");if(!i)return console.warn("dynamicPricingSection: missing franchiseWebLocationId, skipping."),void n.classList.add("hidden");const s=`${f.apiConfig.franchiseWebLocationProfileFees}/${i}`,r=yield(0,g.cachedAPIWrapper)(s,y.apiCaching.FranchiseWebLocationProfileFees,!1);if(!Array.isArray(r)||0===r.length)return console.warn("dynamicPricingSection: no profile fees returned from API."),void n.classList.add("hidden");const l=n.querySelectorAll(".pricing-card");if(0===l.length)return console.warn("dynamicPricingSection: no .pricing-card elements found."),void n.classList.add("hidden");let a=0;l.forEach(e=>{var t;const o=e.querySelector("#pricing_card_identifier"),n=null===(t=null==o?void 0:o.value)||void 0===t?void 0:t.trim(),i=n?r.find(e=>{var t;return(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"").includes(n)}):void 0;if(!i)return void e.classList.add("hidden");a++,e.classList.remove("hidden");const s=e.querySelector(".pricing-amount-value");if(s){const e=function(e){const t="number"==typeof e?e:Number(e);return!Number.isFinite(t)||t<=0?null:`$${t.toFixed(2)}`}(null==i?void 0:i.defaultFee);e&&(s.textContent=e),s.style.removeProperty("visibility")}}),0===a&&n.classList.add("hidden")}catch(e){console.error("Error in dynamicPricingSection:",e),null==n||n.classList.add("hidden")}})}(),V(),function(){try{const e=document.querySelectorAll(".reviews-list .reviewer-name");if(!e||0===e.length)return;null==e||e.forEach(e=>{if(!(e instanceof HTMLElement))return;const t=e.textContent;if(!(null==t?void 0:t.trim()))return;const o=function(e){try{if(!e||"string"!=typeof e)return"";const t=e.trim().split(/\s+/);if(1===t.length)return t[0];const o=t[0],n=t.slice(1).map(e=>e[0]+".").join(" ");return n?`${o} ${n}`:o}catch(e){return console.error("Error formatting name:",e),""}}(t);o&&o!==t.trim()&&(e.textContent=o)})}catch(e){console.error("Error formatting names:",e)}}()}),document.querySelectorAll(".gallery-modal .modal-content .pop-up-img-slider").forEach(e=>{e.querySelector(".card-footer")||null==e||e.classList.add("no-footer")}),document.addEventListener("DOMContentLoaded",function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,r.getBrandDetailsFromBrandJson)(t),n=e=>{const t=document.querySelectorAll(`.${e}`);null==t||t.forEach(t=>{t&&(null==o?void 0:o[e])?(t.classList.add("hidden"),t.style.display="none"):("disable_phone_cta_os_flow"!==e&&(t.style.display="block"),null==t||t.classList.remove("hidden"))})};n("disable_phone_os_flow"),n("disable_dba_os_flow");(0,a.reportScreenSize)()!==l.ScreenType.Desktop&&n("disable_phone_cta_os_flow")})}),document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".more-text");e.length&&e.forEach(e=>{var t;const o=null===(t=e.textContent)||void 0===t?void 0:t.trim();if(!o||o.length<=160)return;e.innerHTML=`${o.substring(0,160)}... <span style="color:blue;cursor:pointer" class="toggle">Read More</span>`;const n=e.querySelector(".toggle");null==n||n.addEventListener("click",()=>{e.textContent=o})})}),document.addEventListener("DOMContentLoaded",()=>{const e=window.location.hash;if(e&&!/\/.*/.test(e)){const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth",block:"start"})}});function U(){const e=document.querySelector(".main-nav-warpper");
3e&&(Array.from(e.querySelectorAll(".hoverable")).forEach(e=>{e.classList.remove("hoverable"),e.classList.add("headl2-hoverable")}),(e=>{const t=e.querySelectorAll(".headl2-hoverable"),o={sensitivity:7,timeout:100,interval:50};t.forEach(e=>{(0,v.hoverintent)(e,function(){e.classList.add("hovering")},function(){e.classList.remove("hovering")}).options(o)})})(e))}function G(){const e=document.querySelector(".media_with_form_dynamic_pricing"),t=document.querySelector(".dynamic-list-err-msg");t&&(t.classList.remove("hidden"),null==e||e.classList.add("hidden"))}function V(){try{const e=(0,a.reportScreenSize)(),t=e===l.ScreenType.Desktop?".new-submenu-list-main":".new-submenu-mobile-list-main",o=document.querySelectorAll(t);if(!o)return;o.forEach(t=>{t.addEventListener("click",t=>{var o;const n=t.target,i=n.closest("a.new-submenu-list-link");if(!i)return;const s=null!==(o=i.getAttribute("href"))&&void 0!==o?o:"",r=s.includes("#"),a=s.split("#")[1];if(r&&(null==a?void 0:a.length)>1&&n)if(e===l.ScreenType.Desktop){const e=n.closest(".hovering");if(e){e.classList.remove("hovering");document.querySelectorAll(".dynamic-menu-wrap").forEach(e=>{e.classList.add("hide-menu"),e.classList.remove("show-menu")});const t=document.querySelectorAll(".new-dynamic-menu .mega-inner-warp");null==t||t.forEach(e=>{e.classList.remove("hide-menu")})}}else{const e=document.querySelector('[data-drawer-hide="sidebar"]');e&&e.click()}})})}catch(e){console.error("Error handling mobile/desktop submenu clicks:",e)}}function J(){try{const e=document.querySelectorAll("#brand-list .more-info");e&&e.length>0&&e.forEach(e=>{e.addEventListener("click",e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s,r,l,a,d,c,u,m;(0,b.startLoader)();const p=null===(t=e.target)||void 0===t?void 0:t.closest(".right-btn");console.log("brandData:",p);const v=null!==(n=null===(o=null==p?void 0:p.querySelector(".search-result-weblocationid"))||void 0===o?void 0:o.value)&&void 0!==n?n:"",g=null!==(s=null===(i=null==p?void 0:p.querySelector(".search-result-conceptid"))||void 0===i?void 0:i.value)&&void 0!==s?s:"",f=(null===(r=null==p?void 0:p.querySelector(".search-result-reviewrating"))||void 0===r?void 0:r.value)||0,y=(null===(l=null==p?void 0:p.querySelector(".search-result-reviewcount"))||void 0===l?void 0:l.value)||0,I=null!==(d=null===(a=null==p?void 0:p.querySelector(".search-result-phonenumber"))||void 0===a?void 0:a.value)&&void 0!==d?d:"",L=null!==(u=null===(c=null==p?void 0:p.querySelector(".search-result-locationurl"))||void 0===c?void 0:c.value)&&void 0!==u?u:"",E=null!==(m=sessionStorage.getItem("brandZipCode"))&&void 0!==m?m:"",C=(0,S.isValidCAPostalCode)(E)?"/ca/brandmoreinfo":"/brandmoreinfo";let A=`${window.location.origin}${C}/${g}/${v}/${f}/${y}/${I}`;L&&(A+=`/${L}`);const _={method:"GET",url:A};(0,h.default)(_).then(e=>{var t,o,n;if(null==e?void 0:e.BrandMoreInfoPopupMarkup){const i=document.querySelector(".brand-modal-body");i?(i.outerHTML=e.BrandMoreInfoPopupMarkup,function(){const e=document.getElementById("brand-modal");if(!e)return;const t=e.querySelector(".brand-services-section");if(!t)return;const o=t.querySelector(".services-list");if(!o)return;const n=14;let i=[];function s(){const e=null==o?void 0:o.querySelectorAll("li:not(.service-more-btn)");i=Array.from(null!=e?e:[]).map(e=>{var t;return(null===(t=e.textContent)||void 0===t?void 0:t.trim())||""})}function r(e=null){const t=e?i.slice(0,e):i;if(o&&(o.innerHTML=""),t.forEach(e=>{const t=document.createElement("li");t.textContent=e,o&&o.appendChild(t)}),e&&i.length>e){const e=document.createElement("li");e.className="service-more-btn",e.textContent="...and many more",o&&o.appendChild(e)}}s(),i.length>n?r(n):r()}(),null===(t=null==O?void 0:O.getInstance())||void 0===t||t.initSlider(),null===(o=null==x?void 0:x.getInstance())||void 0===o||o.initSlider(),null===(n=null===w.BrandResult||void 0===w.BrandResult?void 0:w.BrandResult.getInstance())||void 0===n||n.constructAndAddUTMTagsToCTA()):console.error("Brand popup container not found.")}(0,b.stopLoader)()}).catch(e=>{(0,b.stopLoader)(),console.error("Error in fetching brand popup data:",e)})}))})}
3catch(e){console.error("An error occurred in brandPopupHandler function:",e)}}(0,n.__awaiter)(void 0,void 0,void 0,function*(){yield L.init()}),window.addEventListener("pagehide",()=>{L.destroy()}),J()},"./src/js/global/glossary.ts"(){"use strict";new class{constructor(){var e,t,o;this.alphaBlock=document.querySelector(".alpha-block"),this.alphaScroller=document.querySelector(".alpha-scroller"),this.prevBtn=document.querySelector(".alpha-pre"),this.nextBtn=document.querySelector(".alpha-next"),null===(e=this.prevBtn)||void 0===e||e.addEventListener("click",this.slideLeft.bind(this)),null===(t=this.nextBtn)||void 0===t||t.addEventListener("click",this.slideRight.bind(this)),this.prevBtn&&(this.prevBtn.style.display="none"),this.nextBtn&&(this.nextBtn.style.display="none"),(null===(o=this.alphaBlock)||void 0===o?void 0:o.scrollWidth)<1232&&(this.nextBtn.style.display="flex",this.alphaBlock.onscroll=()=>{let e=this.alphaBlock.scrollLeft,t=this.alphaBlock.scrollWidth,o=this.alphaBlock.offsetWidth;0==e&&(this.prevBtn.style.display="none",this.nextBtn.style.display="flex"),e>10&&(this.prevBtn.style.display="flex",this.nextBtn.style.display="flex"),t-e==o&&(this.nextBtn.style.display="none",this.prevBtn.style.display="flex")}),document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelectorAll('a[href^="#"]');document.querySelector(".alpha-next")&&(null==e||e.forEach(e=>{e.addEventListener("click",this.scrollToTarget.bind(this))}))});let n=document.querySelector(".second-head"),i=null==n?void 0:n.offsetHeight;document.querySelectorAll(".glossary-list-item").forEach(e=>{e.style.scrollMarginTop=i+20+"px"})}slideLeft(){var e;null===(e=this.alphaBlock)||void 0===e||e.scrollBy(-200,0)}slideRight(){var e;null===(e=this.alphaBlock)||void 0===e||e.scrollBy(200,0)}smoothScroll(e){let t=null===document||void 0===document?void 0:document.querySelector(e);null==t||t.scrollIntoView({behavior:"smooth"})}scrollToTarget(e){e.preventDefault();const t=e.target.getAttribute("href"),o=null==t?void 0:t.substring(1);o&&(this.smoothScroll("#"+o),history.pushState("",document.title,window.location.pathname+window.location.search))}}},"./src/js/global/index.ts"(e,t,o){"use strict";o.d(t,{Concert:()=>n.Concert,EventTeaserSlider:()=>i.EventTeaserSlider,StickyHeader:()=>i.StickyHeader,addLocalizationHeaderMenuLocal:()=>i.addLocalizationHeaderMenuLocal,brandPopupHandler:()=>i.brandPopupHandler,handleMobileDesktopSubmenuClicks:()=>i.handleMobileDesktopSubmenuClicks,initializeNavDropdown:()=>i.initializeNavDropdown});o(/*! ./glossary */"./src/js/global/glossary.ts");var n=o(/*! ./teams */"./src/js/global/teams.ts"),i=o(/*! ./global-custom */"./src/js/global/global-custom.ts")},"./src/js/global/teams.ts"(e,t,o){"use strict";o.d(t,{Concert:()=>n});class n{static getInstance(){return n.instance||(n.instance=new n),n.instance}constructor(){this.bioBtns=document.getElementsByClassName("bio-btn"),this.memberBios=document.getElementsByClassName("member-bio");for(let e=0;e<this.bioBtns.length;e++)this.bioBtns[e].addEventListener("click",t=>{t.stopPropagation(),this.toggleMemberBio(e)})}toggleMemberBio(e){const t=this.bioBtns[e],o=null==t?void 0:t.closest(".team-list-item, .team-list-item-v2"),n=null==o?void 0:o.querySelector(".member-bio"),i=null==t?void 0:t.querySelector("svg");n&&"block"!==n.style.display?(n.style.display="block",i&&(i.style.transform="rotate(-90deg)")):n&&(n.style.display="none",i&&(i.style.transform="rotate(90deg)"))}}},"./src/js/index-pilot.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./opus2/util/serviceWorkerRegistration */"./src/js/opus2/util/serviceWorkerRegistration.ts"),s=o(/*! ./opus2/router/router */"./src/js/opus2/router/router.ts"),r=o(/*! ./opus2/router/background-job/background-fetch-chunks */"./src/js/opus2/router/background-job/background-fetch-chunks.ts");o(/*! ./opus2 */"./src/js/opus2/index.ts"),o(/*! ./global */"./src/js/global/index.ts");const l=globalThis.location.href;(l.includes("nblysbx")||l.includes("nblydev")||l.includes("nblytest")||l.includes("localhost"))&&(0,n.__awaiter)(void 0,void 0,void 0,function*(){const{default:e}=yield o.e(/*! import() | redirect-guard */"redirect-guard").then(o.bind(o,/*! ./opus2/redirect-interceptor/locationInterceptor */"./src/js/opus2/redirect-interceptor/locationInterceptor.ts"));e.getInstance().init()}),(0,i.conditionalServiceWorkerInstall)();s.Router.getInstance().init(),window.addEventListener("load",()=>{(0,r.backgroundFetchChunks)()})},"./src/js/opus2/api/apiLogger.ts"(e,t,o){"use strict";o.d(t,{handleApiError:()=>g,performanceBenchmark:()=>v,uniqueIDGenerator:()=>y,unlockIt:()=>f});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! axios */"./node_modules/axios/lib/axios.js"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),l=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),a=o(/*! ../util/sessionCorelationID */"./src/js/opus2/util/sessionCorelationID.ts"),d=o(/*! ../util/crypto */"./src/js/opus2/util/crypto.ts"),c=o(/*! ./logging-whitelisting */"./src/js/opus2/api/logging-whitelisting.ts"),u=o(/*! ./apiTester */"./src/js/opus2/api/apiTester.ts");const m=i.default.create({baseURL:"MISSING_ENV_VAR".API_URL,headers:{Accept:"application/json","Content-Type":"application/json",apikey:"dneiadmincache-DvVi9b4k3Rg3Zwd"}});function h(e){const t=new URL(e);return t.searchParams.has("apikey")&&t.searchParams.delete("apikey"),t.toString()}function p(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){const i={method:"POST",url:e,data:t};try{o&&console.log(i);const e=yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{return(yield m.request(e)).data}catch(t){throw yield g(t,e.url)}})}(i);o&&console.log("Log sent to URL Transformer:",e)}catch(e){o&&console.error("Failed to send log to URL Transformer",e)}})}function v(e,t){var o;const i=(0,l.isTestEnvironment)();performance.mark(`${t}-end`),performance.measure(`${t}-duration`,`${t}-start`,`${t}-end`);const a=performance.getEntriesByName(`${t}-duration`);if(a.length>0){const t=a[0].duration||0;t>Number.parseInt(null!==(o="2000")?o:"5000",10)&&function(e,t){(0,n.__awaiter)(this,void 0,void 0,function*(){const o={source:"js-api-latency",apiEndpoint:`${h(e)} - Source URL - ${window.location.href}`,latency:`${t} ms - JS Version: ad8092ef6`,timeStamp:new Date,deviceType:(0,r.isTouchDevice)()?`Mobile Device - UserAgent: ${navigator.userAgent}`:`Desktop Device - UserAgent: ${navigator.userAgent}`},n=(0,l.isTestEnvironment)();p(`${window.location.origin}/${s.apiConfig.ApiLogperformanceEndpoint}`,o,n)})}(e,t),i&&console.log(`${e}: ${t} ms`)}else i&&console.warn('No performance entries found for "api-call-duration"');performance.clearMarks(`${t}-start`),performance.clearMarks(`${t}-end`),performance.clearMeasures(`${t}-duration`)}function g(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var i,a,m;if(e.response){const{status:v,data:g}=e.response,f=null!==(a=null!==(i=g.Message)&&void 0!==i?i:g.message)&&void 0!==a?a:"API Error";let y=null!=f?f:"No message received from API response";"object"==typeof y&&(y=JSON.stringify(y)),404===v&&(y="Resource does not exist");let b=`Response: ${y} - JS Version: ad8092ef6 - Source URL - ${window.location.href}`;const I=(new Date).toISOString();if(((null==t?void 0:t.includes("Booking"))||(null==t?void 0:t.includes("ContactUs")))&&o&&"N/A"!==o){const e=(0,u.extractPageDetails)();b="",e&&(b=` Complete Log: ${JSON.stringify(e)} -`);const t=yield function(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=d.CryptoWrapper.getInstance(),{ciphertext:i,iv:s,salt:r}=yield n.encryptObject(e,t,o);return{ciphertext:i,iv:s,salt:r}})}(o,null!==(m='h&(5MQdHe;y!^D>t#Rz."~Z}4%[$KkN+')?m:"nopwd",I);b=`Response: ${y} - Source URL: ${window.location.href} - ${b} FailedPayload: ${JSON.stringify(t.ciphertext)} - ver: ${t.iv}`}const S={httpStatusCode:v.toString(),message:b,timeStamp:I,apiEndpoint:h(null!=t?t:""),deviceType:`${(0,r.isTouchDevice)()?"Mobile":"Desktop"} Device - UserAgent: ${navigator.userAgent}`};return(0,c.isWhitelistedAPI)({url:null!=t?t:""})?(function(e){(0,n.__awaiter)(this,void 0,void 0,function*(){const t=(0,l.isTestEnvironment)(),o=`${window.location.origin}/${s.apiConfig.ApiLogerrorEndpoint}`;e.apiEndpoint?e.apiEndpoint!==o?p(o,{source:"js-code",errorMessages:[e]},t):t&&(console.error("Error Logger API failed."),console.log(e)):t&&console.log("Error in determining the API endpoint of the failed call")})}(S),new Error(f)):new Error(f)}return e.request?new Error("No response received from the server"):new Error("Error occurred while setting up the request")})}function f(e,t,o,i){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=d.CryptoWrapper.getInstance(),s=yield n.decryptObject(e,t,o,i);console.log("%c[Crypto]%c Decrypted data:","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px","",s)})}function y(e){return`api-call-${e}-${(0,a.generateRandomString)(5)}`}},"./src/js/opus2/api/apiRequest.ts"(e,t,o){"use strict";o.d(t,{apiRequest:()=>p,apiRequest2:()=>v,apiRequestForWrapper:()=>g,default:()=>y,wrapperAPICall:()=>f});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! axios */"./node_modules/axios/lib/axios.js"),s=o(/*! ./apiLogger */"./src/js/opus2/api/apiLogger.ts"),r=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts");const l=i.default.create({baseURL:"MISSING_ENV_VAR".API_URL,headers:{Accept:"application/json","Content-Type":"application/json"}}),a=i.default.create({baseURL:"MISSING_ENV_VAR".API_URL,headers:{Accept:"application/json","Content-Type":"application/json",apikey:"pneiweb-9pbaOywNKQj853D"}}),d=i.default.create({baseURL:"MISSING_ENV_VAR".API_URL,headers:{Accept:"application/json","Content-Type":"application/json"}}),c=(0,r.isTestEnvironment)(),u=new Map,m=new Map;function h(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=l,o){var n,i,r,a,h;const p=function(e,t){var o,n,i;const s=null!==(o=e.url)&&void 0!==o?o:"unknown-url",r=null!==(i=null===(n=e.method)||void 0===n?void 0:n.toUpperCase())&&void 0!==i?i:"GET";return t?`${r}-${s}-${t}`:`${r}-${s}`}(e,o),v=Date.now(),g=!(null===(n=null==e?void 0:e.url)||void 0===n?void 0:n.includes("api/logerror")),f=!(null===(i=null==e?void 0:e.url)||void 0===i?void 0:i.includes("api/loglatency"));if(t!==d&&["POST","PUT","PATCH","DELETE"].includes(null!==(a=null===(r=e.method)||void 0===r?void 0:r.toUpperCase())&&void 0!==a?a:"")&&m.has(p)&&g&&f){if(v-m.get(p)<3e3)return c&&console.log("%c[API]%c Throttled request, no new call made:","background:orange; color:#f3f3f3; font-weight: bold; padding: 0 8px","",p),Promise.reject(new Error("Request throttled due to duplicate payload."))}if(u.has(p)&&!(null==e?void 0:e.skipDeduplication))return c&&console.log("%c[API]%c API request already in progress - Returning existing promise:","background:orange; color:#f3f3f3; font-weight: bold; padding: 0 8px","",p),u.get(p);const y=(0,s.uniqueIDGenerator)(null!==(h=e.url)&&void 0!==h?h:"unknown-url");performance.mark(`${y}-start`);const b=t.request(e).then(t=>{var o;return(0,s.performanceBenchmark)(null!==(o=e.url)&&void 0!==o?o:"unknown-url",y),m.set(p,Date.now()),t.data}).catch(t=>{var o,n;throw(0,s.handleApiError)(t,null!==(o=e.url)&&void 0!==o?o:"unknown-url",null!==(n=e.data)&&void 0!==n?n:"N/A")}).finally(()=>{u.delete(p)});return u.set(p,b),b})}function p(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return h(e,l)})}function v(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return h(e,a)})}function g(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return h(e,l)})}function f(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return h(e,a)})}const y=p},"./src/js/opus2/api/apiTester.ts"(e,t,o){"use strict";o.d(t,{extractPageDetails:()=>g,getRequestLogger:()=>p,requestLogger:()=>h,successLogger:()=>v});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../util/checkDeviceAndBrowserType */"./src/js/opus2/util/checkDeviceAndBrowserType.ts"),l=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),a=o(/*! axios */"./node_modules/axios/lib/axios.js"),d=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),c=o(/*! ./logging-whitelisting */"./src/js/opus2/api/logging-whitelisting.ts");const u=new Map;function m(e){const t=new URL(e);return t.searchParams.has("apikey")&&t.searchParams.delete("apikey"),t.toString()}function h(e,t){if(!e)return void console.log("No payload found");console.log("%c[FAKE BOOKING]%c Mock Request Payload :","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px; font-size:1.2rem","",e),sessionStorage.setItem("mockRequestPayload",JSON.stringify(e));f({httpStatusCode:"418",message:`${JSON.stringify(e)} - JS Version: ad8092ef6 - Source URL - ${window.location.href}`,timeStamp:new Date,apiEndpoint:m(null!=t?t:""),deviceType:(0,l.isTouchDevice)()?`Mobile Device - UserAgent: ${navigator.userAgent}`:`Desktop Device - UserAgent: ${navigator.userAgent}`})}function p(e,t){if(!(0,c.isWhitelistedAPI)({url:null!=e?e:""}))return;const o=`${null!=e?e:"unknown"}-${null!=t?t:"unknown"}`,n=Date.now(),s=u.get(o);if(s&&n-s<6e3)return void((0,i.isTestEnvironment)()&&console.log(`[getRequestLogger] Skipped duplicate log for: ${e}`));if(u.size>=100){const e=[];u.forEach((t,o)=>{n-t>6e3&&e.push(o)}
3),e.forEach(e=>u.delete(e))}u.set(o,n);f({httpStatusCode:"400",message:`Source URL - ${window.location.href} - JS Version: ad8092ef6 - GET Request failed due to error: ${t}`,timeStamp:new Date,apiEndpoint:m(null!=e?e:""),deviceType:(0,l.isTouchDevice)()?`Mobile Device - UserAgent: ${navigator.userAgent}`:`Desktop Device - UserAgent: ${navigator.userAgent}`})}function v(e,t,o,i){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,s,l,a;if(!(0,c.isWhitelistedAPI)({url:null!=t?t:""}))return;if(!e||!o)return;const d=yield(0,r.userBrowserDetails)(),u=localStorage.getItem("sessionIDFr"),h=sessionStorage.getItem("correlationIDFr"),p=g(),v={brand:null!==(s=null===(n=document.getElementById("conceptCode"))||void 0===n?void 0:n.value)&&void 0!==s?s:"N/A",sessionID:null!=u?u:"N/A",correlationID:null!=h?h:"N/A",requestPage:p.requestPage,jsVersion:null!==(l="ad8092ef6")?l:"no version detected",requestComponentId:{buttonId:p.requestComponentId.buttonId,formId:p.requestComponentId.formId,formClasses:p.requestComponentId.formClasses},response:null!=i?i:"N/A",formTemplate:p.pageScope,webLocationId:null!==(a=e.webLocationId)&&void 0!==a?a:"N/A"};f({httpStatusCode:"418",message:JSON.stringify(v),timeStamp:new Date,apiEndpoint:m(null!=t?t:""),deviceType:JSON.stringify(d)})})}function g(){var e,t;const o=(0,d.getPageSettings)("pagetemplate"),n=document.activeElement;let i="N/A",s="N/A",r=[];if(n&&"BUTTON"===n.tagName){const o=n.closest("form");i=null!==(e=n.id)&&void 0!==e?e:"N/A",s=null!==(t=null==o?void 0:o.id)&&void 0!==t?t:"N/A",r=(null==o?void 0:o.classList)?Array.from(o.classList):[]}const l=window.versionDetail;return{requestComponentId:{buttonId:i,formId:s,formClasses:r},requestPage:window.location.href,pageScope:o,codeVersions:l}}function f(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=(0,i.isTestEnvironment)(),o=`${window.location.origin}/${s.apiConfig.ApiLogerrorEndpoint}`;e.apiEndpoint?e.apiEndpoint!==o?function(e,t,o){(0,n.__awaiter)(this,void 0,void 0,function*(){const i={method:"POST",url:e,data:t};try{o&&console.log(i);const e=yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{return(yield y.request(e)).data}catch(e){return console.log("Failed to send the mocklog"),e}})}(i);o&&console.log("Log sent to URL Transformer:",e)}catch(e){o&&console.error("Failed to send log to URL Transformer",e)}})}(o,{source:"js-code",errorMessages:[e]},t):t&&console.error("Error Logger API failed."):t&&console.log("Error in determining the API endpoint of the failed call")})}const y=a.default.create({baseURL:"MISSING_ENV_VAR".API_URL,headers:{Accept:"application/json","Content-Type":"application/json",apikey:"dneiadmincache-DvVi9b4k3Rg3Zwd"}})},"./src/js/opus2/api/logging-whitelisting.ts"(e,t,o){"use strict";o.d(t,{isWhitelistedAPI:()=>r});var n=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts");const i=["techavailability","calculateestimate","booking","contactus","quote","capturelead","createlead","lead-source","profilefees"],s=[];function r(e){if(!e||!e.url)return!1;const t=e.url;if(s.length>0){const e=(0,n.getPageSettings)("pagetemplate");if(e){const t=l(e);return s.map(e=>l(e)).includes(t)}}const o=l(t);return i.some(e=>null!==new RegExp(`[/\\?&]${e}([/\\?&#]|$)`,"i").exec(o))}function l(e){return e?e.toLowerCase().replace(/\s+/g,""):""}},"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"(e,t,o){"use strict";o.d(t,{contactUsPostCallWrapper:()=>b});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ./keys/contactKeys */"./src/js/opus2/apiCaching/POST-Requests/keys/contactKeys.ts"),a=o(/*! ../../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../../util/discovery */"./src/js/opus2/util/discovery.ts"),c=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts"),u=o(/*! ../../constants/regex */"./src/js/opus2/constants/regex.ts");const m="PLG",h="PLGC",p=14,v=256;function g(e){let t=JSON.parse(JSON.stringify((0,r.normalizeKeys)(e)));t=JSON.parse(JSON.stringify((0,r.removeNullAndEmpty)(t)));if(!["isLocalized","zipCode","email"].every(e=>null==t?void 0:t.hasOwnProperty((0,r.normalizeKeys)(e))))return!1;if(Object.keys(t).some(e=>{if(!l.contactUsPayloadModelKeys.hasOwnProperty(e))return console.error("Invalid key in Contact Payload:",e),!0}))return!1;return!Object.entries(t).some(([e,t])=>void 0===t?(console.error("Undefined value in Contact Payload:",e),!1):typeof t!==l.contactUsPayloadModelKeys[e])&&(!!(0,r.isValidZipCode)(t.zipCode)&&(e.ZipCode=(0,r.isValidZipCode)(t.zipCode),e.IsTest=(0,r.isTestEnvironment)(),e))}function f(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s,r;e.isLocalized=!!e.franchiseWebLocationId,e.conceptId||e.ConceptId||console.error("Concept Id is missing in the payload"),e.address=null!==(t=e.address)&&void 0!==t?t:"No address collected",e.address=e.address.replace(/^,/,"").trim(),e.comments=null===(o=e.comments)||void 0===o?void 0:o.replace(/^[ \t]*,+/,"").trim(),!u.REGEX.sendCaPostalCode.test(e.zipCode)&&(null===(n=null==e?void 0:e.zipCode)||void 0===n?void 0:n.includes("-"))&&(e.ZipCode=(0,a.normalizeUSZipCode)(e.zipCode),e.zipCode=(0,a.normalizeUSZipCode)(e.zipCode));const l=null!==(i=e.city)&&void 0!==i?i:e.City,c=null!==(s=e.state)&&void 0!==s?s:e.State,m=null!==(r=e.zipCode)&&void 0!==r?r:e.ZipCode;try{const{city:t,state:o}=yield(0,d.handleMissingData)(l,c,m);e.city=null!=t?t:l,e.state=null!=o?o:c}catch(e){console.error("Error in preparing payload for Contact us endpoint",e)}return e})}function y(e){var t,o;const n=null!==(o=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value)&&void 0!==o?o:null==e?void 0:e.conceptId;if(Number(n)!==v&&Number(n)!==p)return e;if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Invalid payload: payload must be a valid object");
3if(e.conceptId||(e.conceptId=p),e.conceptCode||(e.conceptCode=m),"string"==typeof e.conceptId){const t=Number(e.conceptId);Number.isNaN(t)||(e.conceptId=t)}return e.conceptCode.toUpperCase()===h&&(e.conceptCode=m),e.conceptId===v&&(e.conceptId=p),e}function b(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,l,d,u;const m="true"===localStorage.getItem("suLogger");if(!(0,r.enviromentCheck)(e))return(0,s.stopLoader)(),!1;const h="true"===(null===(o="false")?void 0:o.toLowerCase());if(t=yield f(t),h){if(!g(t))throw console.error("Invalid payload for Contact us Endpoint:",t),new Error(`Invalid payload for Contact us Endpoint: ${JSON.stringify(t)}`)}else console.log("Strict Payload validation disabled");const p={method:"POST",url:e,data:JSON.parse(JSON.stringify((0,r.normalizeKeys)(y(t))))};if((null===(l=null===(n=null==p?void 0:p.data)||void 0===n?void 0:n.firstName)||void 0===l?void 0:l.toLowerCase().includes("isfakesubmit"))||(null===(u=null===(d=null==p?void 0:p.data)||void 0===d?void 0:d.lastName)||void 0===u?void 0:u.toLowerCase().includes("isfakesubmit"))){(0,a.handleFakeSubmit)(p).then(()=>{console.log("Mock Request",p)}).catch(e=>{console.error("Error in Fake Submit:",e)}).finally(()=>Promise.resolve(!0));const e=JSON.stringify(t);return sessionStorage.setItem("fakeSubmitData",e),!0}try{(0,s.startLoader)();const e=yield(0,i.default)(p);return(0,c.successLogger)(p.data,p.url,m,e),e&&sessionStorage.setItem("contactResponse",JSON.stringify(e)),e}catch(e){throw console.error("Error:",e),(0,r.storeFailedResponse)(p,e),e}finally{(0,s.stopLoader)()}})}},"./src/js/opus2/apiCaching/POST-Requests/apiCouponOffersWrapper.ts"(e,t,o){"use strict";o.d(t,{couponOffersWrapper:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ./keys/couponOffersKeys */"./src/js/opus2/apiCaching/POST-Requests/keys/couponOffersKeys.ts"),a=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts");function d(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o;const n="true"===localStorage.getItem("suLogger");if("true"===(null===(o="false")?void 0:o.toLowerCase())&&!function(e){let t=JSON.parse(JSON.stringify((0,r.normalizeKeys)(e)));return t=JSON.parse(JSON.stringify((0,r.removeNullAndEmpty)(t))),!!["conceptID","webLocationID"].every(e=>null==t?void 0:t.hasOwnProperty((0,r.normalizeKeys)(e)))&&(!Object.keys(t).some(e=>{if(!l.couponOffersDataKeys.hasOwnProperty(e))return console.error("Invalid key in coupon offers Payload:",e),!0})&&(!Object.entries(t).some(([e,t])=>void 0===t?(console.error("Undefined value in coupon offers Payload:",e),!0):(console.log(typeof t,l.couponOffersDataKeys[e],"Value:",t,"Key:",e),typeof t!==l.couponOffersDataKeys[e]))&&e))}(t))throw console.error("Invalid payload for coupon offers Endpoint:",t),new Error(`Invalid payload: ${JSON.stringify(t)}`);const d=(0,r.normalizeKeys)(t),c={method:"POST",url:e,data:d};try{(0,s.startLoader)();const e=yield(0,i.apiRequest2)(c);return(0,a.successLogger)(c.data,c.url,n,e),e}catch(e){throw console.error("Error in couponOffersWrapper:",e),(0,r.storeFailedResponse)(c,e),new Error(`couponOffersWrapper failed: ${e.message||e}`)}finally{(0,s.stopLoader)()}})}},"./src/js/opus2/apiCaching/POST-Requests/apiIsReturningCustomerWrapper.ts"(e,t,o){"use strict";o.d(t,{isReturningCustomerWrapper:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ./keys/isReturningCustomerKeys */"./src/js/opus2/apiCaching/POST-Requests/keys/isReturningCustomerKeys.ts"),a=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts");function d(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o;const n="true"===localStorage.getItem("suLogger");if("true"===(null===(o="false")?void 0:o.toLowerCase())&&!function(e){let t=JSON.parse(JSON.stringify((0,r.normalizeKeys)(e)));return t=JSON.parse(JSON.stringify((0,r.removeNullAndEmpty)(t))),!(!t||"object"!=typeof t)&&(!!["conceptId","weblocationId"].every(e=>null==t?void 0:t.hasOwnProperty((0,r.normalizeKeys)(e)))&&(!Object.keys(t).some(e=>{if(!l.isReturningCustomerDataKeys.hasOwnProperty(e))return console.error("Invalid key in isReturningCustomer Payload:",e),!0})&&(!Object.entries(t).some(([e,t])=>void 0===t?(console.error("Undefined value in isReturningCustomer Payload:",e),!0):(console.log(typeof t,l.isReturningCustomerDataKeys[e],"Value:",t,"Key:",e),typeof t!==l.isReturningCustomerDataKeys[e]))&&e)))}(t))throw console.error("Invalid payload for isReturningCustomer Endpoint:",t),new Error(`Invalid payload: ${JSON.stringify(t)}`);const d=(0,r.normalizeKeys)(t),c={method:"POST",url:e,data:d};try{(0,s.startLoader)();const e=yield(0,i.apiRequest2)(c);return(0,a.successLogger)(c.data,c.url,n,e),e}catch(e){throw console.error("Error in isReturningCustomerWrapper:",e),(0,r.storeFailedResponse)(c,e),new Error(`isReturningCustomerWrapper failed: ${e.message||e}`)}finally{(0,s.stopLoader)()}})}},"./src/js/opus2/apiCaching/POST-Requests/apiPriceQuoteWrapper.ts"(e,t,o){"use strict";o.d(t,{priceQuoteWrapper:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ./keys/priceQuoteKeys */"./src/js/opus2/apiCaching/POST-Requests/keys/priceQuoteKeys.ts"),a=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts");function d(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o;const n="true"===localStorage.getItem("suLogger");if("true"===(null===(o="false")?void 0:o.toLowerCase())&&!function(e){let t=JSON.parse(JSON.stringify((0,r.normalizeKeys)(e)));return t=JSON.parse(JSON.stringify((0,r.removeNullAndEmpty)(t))),["franchiseWebLocationId","brandId","postalCode"].every(e=>null==t?void 0:t.hasOwnProperty((0,r.normalizeKeys)(e)))?!Object.keys(t).some(e=>{if(!l.priceQuoteDataKeys.hasOwnProperty(e))return console.error("Invalid key in price quote Payload:",e),!0})&&(!Object.entries(t).some(([e,t])=>void 0===t?(console.error("Undefined value in price quote Payload:",e),!1):(console.log(typeof t,l.priceQuoteDataKeys[e],"Value:",t,"Key:",e),typeof t!==l.priceQuoteDataKeys[e]))&&e):(console.error("Missing mandatory fields in price quote payload"),!1)}(t))throw console.error("Invalid payload for price quote Endpoint:",t),new Error(`Invalid payload: ${JSON.stringify(t)}`);const d=(0,r.normalizeKeys)(t),c={method:"POST",url:e,data:d};try{(0,s.startLoader)();const e=yield(0,i.default)(c);return(0,a.successLogger)(c.data,c.url,n,e),e}catch(e){throw console.error("Error in priceQuoteWrapper:",e),(0,r.storeFailedResponse)(c,e),new Error(`priceQuoteWrapper failed: ${e.message||e}`)}finally{(0,s.stopLoader)()}})}},"./src/js/opus2/apiCaching/POST-Requests/apiSendNblyBrandEmail.ts"(e,t,o){"use strict";o.d(t,{sendNblyBrandEmailWrapper:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ../../config/apiConfig */"./src/js/opus2/config/apiConfig.ts");function d(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;const o="true"===localStorage.getItem("suLogger");if("true"===(null===(t="false")?void 0:t.toLowerCase())&&!function(e){const t=structuredClone((0,r.removeNullAndEmpty)(e));return(null==t?void 0:t.hasOwnProperty("sender"))?(null==t?void 0:t.hasOwnProperty("templateId"))?(null==t?void 0:t.hasOwnProperty("receiver"))?e:(console.error("Missing mandatory field in Payload: receiver"),!1):(console.error("Missing mandatory field in Payload: templateId"),!1):(console.error("Missing mandatory field in Payload: sender"),!1)}(e))throw console.error("Invalid payload for Nbly Contact Us Email:",e),new Error(`Invalid payload: ${JSON.stringify(e)}`);const n={method:"POST",url:a.apiConfig.GENERIC_EMAIL_ENDPOINT,data:e,headers:{Accept:"application/json","Content-Type":"application/json",apikey:"pneiweb-9pbaOywNKQj853D"},skipDeduplication:!0}
3;try{(0,l.startLoader)();const e=yield(0,i.default)(n);return(0,s.successLogger)(n.data,n.url,o,e),e}catch(e){throw console.error("Error in sendNblyBrandEmailWrapper:",e),(0,r.storeFailedResponse)(n,e),new Error(`sendNblyBrandEmailWrapper failed: ${e.message||e}`)}finally{(0,l.stopLoader)()}})}},"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"(e,t,o){"use strict";o.d(t,{bookingUsPostCallWrapper:()=>N,utmCampaign:()=>L});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ./keys/bookingKeys */"./src/js/opus2/apiCaching/POST-Requests/keys/bookingKeys.ts"),a=o(/*! ../../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../../util/discovery */"./src/js/opus2/util/discovery.ts"),c=o(/*! ../../api/apiTester */"./src/js/opus2/api/apiTester.ts"),u=(o(/*! ../../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),o(/*! ./apiContactCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"),o(/*! ../../util/gtmEventHandlers */"./src/js/opus2/util/gtmEventHandlers.ts")),m=o(/*! ../../constants/regex */"./src/js/opus2/constants/regex.ts"),h=o(/*! ../../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),p=o(/*! ./helperModules/handleBookingSubmit */"./src/js/opus2/apiCaching/POST-Requests/helperModules/handleBookingSubmit.ts");const v={vendorName:"Neighborly Website",vendorId:Number("48")||48},g="29",f=!1,y="RPM";function b(e){return["webLocationId","postalCode","city","state","address","conceptCalledId","isLeadOnly","callType","campaignName","leadOrigin","firstName","lastName"].every(t=>e.hasOwnProperty(t))?function(e,t){var o,n;if(!E(e,t))return console.log("Main Root Level payload validation failed"),!1;if(e.hmsRoleInfo&&!function(e){if(!E(e,l.hmsRoleInfosKeys))return console.log("hmsRoleInfosKeys payload validation failed"),!1;if(e.hmsRoleDetail&&!E(e.hmsRoleDetail,l.hmsRoleDetailKeys))return console.log("hmsRoleDetail payload validation failed"),!1;if(e.hmsPropertyDetail&&!E(e.hmsPropertyDetail,l.propertyDetailsKeys))return console.log("hmsPropertyDetail payload validation failed"),!1;if(e.hmsSelectedServiceDetail&&!function(e){if(!E(e,l.servicePayloadKeys))return console.log("servicePayloadKeys payload validation failed"),!1;if(e.hmsAvailableServices&&!function(e){for(const t of e)if(!E(t,l.hmsAvailableServiceKeys))return console.log("hmsAvailableServiceKeys payload validation failed"),!1;return!0}(e.hmsAvailableServices))return console.log("hmsAvailableServices payload validation failed"),!1;if(e.hmsServiceBundles&&!A(e.hmsServiceBundles))return console.log("hmsServiceBundles payload validation failed"),!1;return!0}(e.hmsSelectedServiceDetail))return console.log("hmsSelectedServiceDetail payload validation failed"),!1;if(e.hmsTaxDetail&&!function(e){if(!E(e,l.bookingPayloadModelKeys))return console.log("taxDetail payload validation failed"),!1;if(e.regionalTaxes&&!function(e){for(const t of e){if(!E(t,l.regionalTaxKeys))return console.log("tax payload validation failed"),!1;if(t.taxRate&&!E(t.taxRate,l.taxRatesKeys))return console.log("taxRate payload validation failed"),!1;if(t.taxAuthority&&!E(t.taxAuthority,l.taxAuthoritiesKeys))return console.log("taxAuthority payload validation failed"),!1}return!0}(e.regionalTaxes))return console.log("regionalTaxes payload validation failed"),!1;return!0}(e.hmsTaxDetail))return console.log("hmsTaxDetail payload validation failed"),!1;return!0}(e.hmsRoleInfo))return console.log("HMSInfo payload validation failed"),!1;if(e.timeBlock&&!E(e.timeBlock,l.timeBlockInfoKeys))return console.log("TimeBlock payload validation failed"),!1;if((null===(n=null===(o=e.hmsRoleInfo)||void 0===o?void 0:o.hmsSelectedServiceDetail)||void 0===n?void 0:n.hmsServiceBundles)&&!A(e.hmsRoleInfo.hmsSelectedServiceDetail.hmsServiceBundles))return console.log("HmsServiceBundles payload validation failed"),!1;if(e.leadAdditionalNotes&&!function(e){if("object"!=typeof e)return console.log("Invalid additionalNote: not an object"),!1;if(!E(e,l.leadAdditionalNotesKeys))return console.log("leadAdditionalNotesKeys payload validation failed"),!1;return!0}(e.leadAdditionalNotes))return console.log("LeadAdditionalNotes payload validation failed"),!1;if(e.imageUrls&&!function(e){for(const t of e)if(!E(t,l.imageUrlsKeys))return console.log("imageUrlsKeys payload validation failed"),!1;return!0}(e.imageUrls))return console.log("ImageUrls payload validation failed"),!1;if(e.jobPromiseEndTime&&!E(e.jobPromiseEndTime,l.jobPromiseEndTimeKeys))return console.log("JobPromiseEndTime payload validation failed"),!1;if(e.crossSellDetails&&!function(e){if(!Array.isArray(e))return console.log("crossSellDetails is not an array"),!1;for(const t of e){if(!E(t,l.crossSellDetailsKeys))return console.log("crossSellDetailsKeys payload validation failed"),!1;if(!t.conceptCode)return console.log("conceptCode is required in crossSellDetails"),!1;if(!t.services)return console.log("services array is required in crossSellDetails"),!1;if(!C(t.services))return console.log("crossSellServices payload validation failed"),!1}return!0}(e.crossSellDetails))return console.log("CrossSellDetails payload validation failed"),!1;return!0}(e,l.bookingPayloadModelKeys)?!!(0,r.isValidZipCode)(e.zipCode)&&(e.zipCode=(0,r.isValidZipCode)(e.zipCode),e):(console.log("Invalid keys or dataTypes detected in the payload:",e),!1):(console.log("Missing mandatory fields in the payload:",e),!1)}function I(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s,l,c,u,g,f,b,I,S,w;e.callType=null!==(t=e.callType)&&void 0!==t?t:"In Bound",e.campaignName=null!==(o=e.campaignName)&&void 0!==o?o:"Web",e.leadOrigin=null!==(n=e.leadOrigin)&&void 0!==n?n:"BrandWebsite",e.lastName=null!==(i=e.lastName)&&void 0!==i?i:" ",e.isTest=(0,r.isTestEnvironment)();const E=L();E&&(e.leadAdditionalNotes=null!==(s=e.leadAdditionalNotes)&&void 0!==s?s:{},e.leadAdditionalNotes.leadAdditionalNoteLabel?e.leadAdditionalNotes.leadAdditionalNoteLabel=`${E}`:e.leadAdditionalNotes.leadAdditionalNoteLabel=E);const C=(null===(c=null===(l=e.address)||void 0===l?void 0:l.toLowerCase())||void 0===c?void 0:c.trim())||"",A=!C||"no address collected"===C||"no address"===C,_=null!==(u=e.City)&&void 0!==u?u:e.city,k=null!==(g=e.State)&&void 0!==g?g:e.state;!m.REGEX.sendCaPostalCode.test(e.zipCode)&&(null===(f=null==e?void 0:e.zipCode)||void 0===f?void 0:f.includes("-"))&&(e.zipCode=(0,a.normalizeUSZipCode)(e.zipCode));const N=yield(0,d.handleMissingData)(_,k,null!==(b=e.ZipCode)&&void 0!==b?b:e.zipCode);e.city=(null==N?void 0:N.city)||_,e.state=(null==N?void 0:N.state)||k,e.address=e.address.replace(/^,/,"").trim();if(JSON.parse(localStorage.getItem("brandDetails")||"{}").append_url_to_notes){const t=`URL: ${null!==(I=sessionStorage.getItem("campaignName"))&&void 0!==I?I:window.location.href}`;(null===(S=e.note)||void 0===S?void 0:S.includes(t))||(e.note=`${e.note} | ${t}`)}if(!A){const t={city:e.city,state:e.state,country:e.country,zipcode:e.zipCode,us_originalName:"us",us_shortened:"USA",us_fullname:"United States of America",us_altName:"United States",ca_originalName:"ca",ca_shortened:"CAN",ca_fullname:"Canada",ca_altName:"Canada",state_code:sessionStorage.getItem("manualStateCode")||""},o=(0,p.parseAddressRobust)(e.address,t);e.address=o||"No Address Collected"}return(null===(w=e.conceptCode)||void 0===w?void 0:w.toUpperCase())!==y&&delete e.comments,delete e.preferredCommunicationType,(0,h.
3conceptIdLookupForNblyOrCorp)()&&(e=function(e){if(!e)return console.error("Invalid payload provided to replaceVendorDetailsForNBLY"),e;return Object.assign(Object.assign({},e),{vendorName:v.vendorName,vendorId:v.vendorId})}(e)),e})}function S(e){return["campaign","source","medium","term","content","device","aff_id"].reduce((t,o)=>{const n="aff_id"===o?"aff_id":`utm_${o}`,i=e.get(n);if(i){t["aff_id"===o?"aff_id":`Marketing${o.charAt(0).toUpperCase()+o.slice(1)}`]=i}return t},{})}function w(e){return Object.entries(e).filter(([e,t])=>!/\{\{.*?\}\}|\$\{.*?\}/.test(t)||(console.warn(`Template injection detected and removed from ${e}: ${t}`),!1)).map(([e,t])=>`${e}: ${t}`).join(", ")}function L(){const e=S(new URLSearchParams(window.location.search));if(Object.keys(e).length>0)return w(e);const t=sessionStorage.getItem("campaignName");if(t)try{const e=t.includes("?")?t.split("?")[1]:t,o=S(new URLSearchParams(e));if(Object.keys(o).length>0)return w(o)}catch(e){console.warn("Error parsing campaign data from sessionStorage:",e)}return""}function E(e,t){return Object.keys(e).every(o=>{if(!t.hasOwnProperty(o))return!1;const n=t[o],i=Array.isArray(e[o])?"object":typeof e[o];return i!==n&&console.log(`The ${o} has ${i} but the expected type is ${n}`),i===n})}function C(e){if(!Array.isArray(e))return console.log("services is not an array"),!1;for(const t of e){if(!E(t,l.crossSellServicesKeys))return console.log("crossSellServicesKeys payload validation failed"),!1;if(!t.hasOwnProperty("serviceId"))return console.log("serviceId is required in services"),!1;if(!t.hasOwnProperty("serviceSkuId"))return console.log("serviceSkuId is required in services"),!1;if(!t.hasOwnProperty("serviceName"))return console.log("serviceName is required in services"),!1}return!0}function A(e){for(const t of e){if(!E(t,l.hmsServiceBundleKeys))return console.log("hmsServiceBundleKeys payload validation failed"),!1;if(t.packagePayload&&!_(t.packagePayload))return console.log("serviceBundles payload validation failed"),!1}return!0}function _(e){for(const t of e)if(!E(t,l.packagePayloadKeys))return console.log("packagePayload payload validation failed"),!1;return!0}function k(e){var t,o;return(null!==(o=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value)&&void 0!==o?o:null==e?void 0:e.conceptId)!==g||f&&(e.lastName="Test"),e}function N(e,t){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t,o=!1){var n,l,d,m,h;const p="true"===localStorage.getItem("suLogger");if(t.gaValue=(0,a.getCookie)("_ga"),!(0,r.enviromentCheck)(e))return(0,s.stopLoader)(),!1;let v=yield I(t);if("true"===(null===(n="false")?void 0:n.toLowerCase())){if(v=JSON.parse(JSON.stringify((0,r.normalizeKeys)(v))),v=JSON.parse(JSON.stringify((0,r.removeNullAndEmpty)(v))),v=yield I(v),!b(v))throw console.error("Invalid payload for Booking Endpoint:",v),new Error("Invalid payload for Booking Endpoint:"+JSON.stringify(v));v=b(v)}else console.log("Strict Payload validation disabled");const g={method:"POST",url:e,data:k(v)};if((null===(d=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l.firstName)||void 0===d?void 0:d.toLowerCase().includes("isfakesubmit"))||(null===(h=null===(m=null==g?void 0:g.data)||void 0===m?void 0:m.lastName)||void 0===h?void 0:h.toLowerCase().includes("isfakesubmit"))){(0,a.handleFakeSubmit)(g).then(()=>{console.log("Fake Submit Request triggered")}).catch(e=>{console.error("Error in Fake Submit:",e)}).finally(()=>Promise.resolve(!0));const e=JSON.stringify(t);return sessionStorage.setItem("fakeSubmitData",e),!0}try{(0,s.startLoader)();const e=yield(0,i.default)(g);return(0,c.successLogger)(g.data,g.url,p,e),(0,u.fireGTMEvent)("success",g.data,o),e&&sessionStorage.setItem("bookingResponse",JSON.stringify(e)),e}catch(e){throw(0,u.fireGTMEvent)("fail",g.data,o),console.error("Error:",e),(0,r.storeFailedResponse)(g,e),e}finally{(0,s.stopLoader)(),sessionStorage.removeItem("isRequestCallBackChecked")}})}},"./src/js/opus2/apiCaching/POST-Requests/helperModules/handleBookingSubmit.ts"(e,t,o){"use strict";o.d(t,{attachClearFieldListeners:()=>b,cityNameValidation:()=>L,closeAllSelectCommon:()=>_,commonInputError:()=>C,getBrandData:()=>v,handleBookingSubmit:()=>p,handleCheckboxChangeUtility:()=>g,handleFilePreview:()=>I,handleHideError:()=>y,handleOptinEmailCheck:()=>A,initCustomSelectHelper:()=>S,parseAddressRobust:()=>N,showAndFocusErrors:()=>f,stateNameValidation:()=>E,zipCodeValidation:()=>w});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"),r=o(/*! ../../../util/share */"./src/js/opus2/util/share.ts"),l=o(/*! ../../../util/gtm-custom-event-lead-flow */"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"),a=o(/*! ../../../util/loader */"./src/js/opus2/util/loader.ts"),d=o(/*! ../../../util/fileUploads3 */"./src/js/opus2/util/fileUploads3.ts"),c=o(/*! ../../../constants/regex */"./src/js/opus2/constants/regex.ts"),u=o(/*! ../../../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),m=o(/*! ../../../util/domainService */"./src/js/opus2/util/domainService.ts"),h=o(/*! ../../../util/localizationService */"./src/js/opus2/util/localizationService.ts");function p(e,t,o,d,c,u){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o=yield(0,s.bookingUsPostCallWrapper)(i.apiConfig.BOOKING_API_URL,e);(0,a.stopLoader)(),(0,r.storeBookingApiPayload)(e,o),sessionStorage.removeItem("campaignName");const n={event:t,status:"success"};(0,l.gtmCustomEventLeadFlow)(n),u()}catch(e){(0,a.stopLoader)(),function(e,t,o){const n=document.getElementById(e),i=document.getElementById(t);if(n&&n.click(),i){i.classList.remove("hidden");const e=document.getElementById(o);e&&e.classList.add("hidden")}}(o,d,c);const n={event:t,status:"failure"};(0,l.gtmCustomEventLeadFlow)(n)}})}function v(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=document.getElementById("conceptCode");if(!e)throw new Error("Concept code element not found");const t=e.value;if(!t)throw new Error("Concept code is empty");return yield(0,r.getBrandDetailsFromBrandJson)(t)})}function g(e){const t=document.querySelector(e);
3if(!t)return void console.log("Form doesnt exist.");const o=null==t?void 0:t.querySelectorAll(".service-reminder-main");let n=null;if(o&&0!==(null==o?void 0:o.length))return o.forEach(e=>{if(e&&!e.classList.contains("hidden")){const t=e.querySelector('input[type="checkbox"]'),o=e.querySelector(".error-msg");t&&o&&t instanceof HTMLInputElement&&(null==t?void 0:t.required)&&(t.addEventListener("change",()=>{(null==t?void 0:t.checked)?o.classList.add("hidden"):(o.classList.remove("hidden"),n=null==o?void 0:o.id)}),(null==t?void 0:t.required)&&!(null==t?void 0:t.checked)&&(o.classList.remove("hidden"),n=null==o?void 0:o.id))}}),n;console.log("Service Disclaimer not authored in CP")}function f(e){Object.keys(e).forEach(t=>{const o=document.getElementById(t),n=document.getElementById(`${t}-error-msg`);(null==o?void 0:o.parentNode)&&(o.classList.add("invalid-field"),n&&(n.innerHTML=e[t],n.classList.remove("hidden")))});const t=Object.keys(e)[0];if(t){const e=document.getElementById(t);e&&e.focus()}}function y(e){const t=document.getElementById(e),o=document.getElementById(`${e}-error-msg`);null==o||o.classList.add("hidden"),null==t||t.classList.remove("invalid-field")}function b(e){e.forEach(e=>{const t=document.getElementById(e);t&&t.addEventListener("input",()=>{t.classList.remove("invalid-field");const o=document.getElementById(`${e}-error-msg`);o&&o.remove()})})}function I(e,t,o){var n;const i=(null==e?void 0:e.files)&&(null==e?void 0:e.files[0]);(0,d.s3upload)(i,e=>{o[t]=e});const s=null===(n=i.name.split(".")[1])||void 0===n?void 0:n.trim(),r=["png","svg","jpg","jpeg"].includes(s),l="pdf"===s,a="xlsx"===s,c=["docx","doc"].includes(s);if(i){const e=new FileReader;e.onload=()=>{const o=null===document||void 0===document?void 0:document.querySelectorAll(".file-upload img")[t],n=null===document||void 0===document?void 0:document.querySelectorAll(".upload-data")[t];o&&(r?(o.src=e.result,o.style.display="block",n.classList.add("active")):l?(o.src="/brand/_assets/images/icons/pdf-icon.svg",o.style.display="block",n.classList.add("active")):a?(o.src="/brand/_assets/images/icons/excel-icon.svg",o.style.display="block",n.classList.add("active")):c&&(o.src="/brand/_assets/images/icons/doc-icon.svg",o.style.display="block",n.classList.add("active")))},e.readAsDataURL(i)}}function S(){const e=document.querySelectorAll(".custom-select .select-selected"),t=document.querySelectorAll(".custom-select .select-items");e.length>=2&&(e[1].disabled=!0),t.forEach((t,o)=>{t.addEventListener("click",function(){const t=e[o];t&&(t.style.backgroundColor="var(--primary-500)",t.style.color="var(--white)")})}),e[0]&&t[0].addEventListener("click",function(){var t;e[0].style.backgroundColor="var(--primary-500)",e[0].style.color="var(--white)",null===(t=e[1])||void 0===t||t.removeAttribute("disabled")})}function w(e){const t=c.REGEX.sendZip;return e.trim()?t.test(e.trim())&&"00000"!==e.trim()?"":"Invalid zip code format.":"Zip code is required."}function L(e){const t=c.REGEX.sendName;return e.trim()?t.test(e)?"":"Enter valid city.":"City is required."}function E(e){return e&&""!==e?"":"State is required."}function C(e,t,o,n){var i;const s=null===(i=document.getElementById(t))||void 0===i?void 0:i.getAttribute("aria-describedby"),r=document.getElementById(t);""===e.value||o.test(e.value)?(e.classList.remove("invalid-field"),r&&r.classList.add("hidden")):r&&(r.classList.remove("hidden"),r.innerHTML=null!=s?s:n)}function A(e,t,o,n,i){try{const i=(0,m.DomainIdentifier)(),s=(0,h.LocalizationIdentifier)(),r=c.REGEX.sendCaPostalCode.test(e.zipCode)?"ca":"us";let l="";l=("us"===i&&!s||"us"===i&&"us"===s)&&"us"===r?o:n;const a=document.querySelector(t);return(0,u.disclaimerHandleCheck)(!1,a,e,e.zipCode,l)}catch(t){return console.error(`An error occurred in disclaimerHandleCheck in ${i}:`,t),e}}function _(e){const t=document.getElementsByClassName("select-items slim-scroll"),o=document.getElementsByClassName("select-selected"),n=t.length,i=o.length,s=[];for(let t=0;t<i;t++)e===o[t]?s.push(t):o[t].classList.remove("select-arrow-active");for(let e=0;e<n;e++)s.includes(e)||t[e].classList.add("select-hide")}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}function N(e,t){let o=e;for(const e in t){const n=t[e];if(!n||"string"!=typeof n)continue;const i=new RegExp(`\\b${k(n)}\\b`,"gi");o=o.replace(i,"")}return o.replace(/,\s*,/g,",").replace(/, ,/g,",").replace(/^[,\s]+|[,\s]+$/g,"").trim()}},"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"(e,t,o){"use strict";o.d(t,{convertBookingToContactPayload:()=>u,enviromentCheck:()=>c,isTestEnvironment:()=>i,isValidZipCode:()=>r,normalizeKeys:()=>d,removeNullAndEmpty:()=>l,storeFailedResponse:()=>s});var n=o(/*! ../../../constants/regex */"./src/js/opus2/constants/regex.ts");function i(){var e,t,o;const n=null!==(o=null===(t=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.hostname)||void 0===t?void 0:t.toLowerCase())&&void 0!==o?o:"";return["nblysbx","nblydev","nblytest","localhost"].some(e=>n.includes(e))}function s(e,t){try{const o=function(){const e=localStorage.getItem("fR");return e?JSON.parse(e):[]}();o.push(btoa(JSON.stringify({data:e,error:t,timestamp:(new Date).getTime()}))),localStorage.setItem("fR",JSON.stringify(o))}catch(e){console.error("Error while storing failed responses:",e)}}function r(e){const t=String(e).trim();return!!n.REGEX.sendZip.test(t)&&t}function l(e){if(null==e)return e;if(Array.isArray(e))return e.filter(e=>!a(e));if("object"==typeof e){const t={};for(const o in e){const n=e[o];a(n)||(t[o]=l(n))}return t}return e}function a(e){return null==e||("string"==typeof e&&""===e.trim()||"object"==typeof e&&(Array.isArray(e)?0===e.length:0===Object.keys(e).length))}function d(e){return Array.isArray(e)?e.map(d):null!==e&&"object"==typeof e?Object.keys(e).reduce((t,o)=>(t[o.charAt(0).toLowerCase()+o.slice(1)]=d(e[o]),t),{}):e}function c(e){return!(i()&&!(e.includes("test")||e.includes("release")||e.includes("develop")))||(console.log("%cProd API being called from lower env, aborting","background: #f3f3f3; color: red; font-size: 32px; padding: 8px 16px; margin: 8px 0; font-weight: bold;"),!1)}function u(e){const{franchiseWebLocationId:t,conceptId:o,isLocalized:n,firstName:i,lastName:s="",zipCode:r,email:a,phone:d,note:c,signUpForUpdates:u,isTest:m,vendorId:h,city:p,state:v,country:g,address:f,address2:y,correlationId:b,conceptCode:I,optIn:S=!1,emailOptOut:w=!0}=e;if(!["isLocalized","zipCode","email"].every(t=>e.hasOwnProperty(t)))return console.log("Mandatory fields missing in booking payload"),null;return l({franchiseWebLocationId:t,conceptId:o,isLocalized:n,firstName:i,lastName:s,zipCode:r,email:a,phone:d,comments:`${c} || Booking endpoint failed, applying fallback to contact us endpoint`,signUpForUpdates:u,isTest:m,vendorId:h,city:p,state:v,country:g,address:f,address2:y,correlationId:b,conceptCode:I,optIn:S,emailOptOut:w})}},"./src/js/opus2/apiCaching/POST-Requests/keys/bookingKeys.ts"(e,t,o){"use strict";o.d(t,{bookingPayloadModelKeys:()=>m,crossSellDetailsKeys:()=>p,crossSellServicesKeys:()=>v,hmsAvailableServiceKeys:()=>y,hmsRoleDetailKeys:()=>a,hmsRoleInfosKeys:()=>l,hmsServiceBundleKeys:()=>f,imageUrlsKeys:()=>g,jobPromiseEndTimeKeys:()=>b,leadAdditionalNotesKeys:()=>h,packagePayloadKeys:()=>c,propertyDetailsKeys:()=>d,regionalTaxKeys:()=>i,servicePayloadKeys:()=>u,taxAuthoritiesKeys:()=>r,taxRatesKeys:()=>s,timeBlockInfoKeys:()=>n});const n={conceptId:"number",googleCalendarEventId:"string",googleCalendarEmail:"string",timeSlotTypeId:"number",serviceSkuId:"number",isEstimate:"boolean",jobPromisedDate:"string",isAvailable:"boolean",isFranchiseInPOS:"boolean",displayText:"string",technicianExternalId:"string",opalScheduleId:"string",fsmSlotCode:"string",franchiseId:"number",jobPromisedEndDate:"string",startMinutes:"number",endMinutes:"number",franchiseWebLocationCalendarId:"number",technicianName:"string",businessAssetId:"number",duration:"string",jobPromisedStartDateUTC:"string",jobPromisedEndDateUTC:"string",startDate:"string"},i={id:"string",regionalTaxCode:"string",taxRegionName:"string",exemptFromWo:"boolean",sequence:"number",type:"number",value:"number",displayOnInvoice:"boolean",taxAmount:"number",taxR
3ate:"object",taxAuthority:"object"},s={id:"string",name:"string",rateValue:"number"},r={roundingCode:"number",roundingDigitsQuantity:"number"},l={hmsRoleType:"string",hmsRoleKey:"string",hmsRoleDetail:"object",hmsPropertyDetail:"object",hmsSelectedServiceDetail:"object",hmsTaxDetail:"object"},a={willOwnerOrAdultAttend:"boolean",presentForInspection:"object",buyerAgentFirstName:"string",buyerAgentLastName:"string",buyerAgentPhone:"string",buyerAgentEmail:"string",buyerNameOfAgency:"string",buyerAgentReceiveTextMessages:"boolean",sellerAgentFirstName:"string",sellerAgentLastName:"string",sellerAgentPhone:"string",sellerAgentEmail:"string",sellerNameOfAgency:"string",sellerAgentReceiveTextMessages:"boolean",buyerOrSellerAgent:"string",clientFirstName:"string",clientLastName:"string",clientPhone:"string",clientEmail:"string",clientReceiveTextMessages:"boolean",agentNameOfAgency:"string"},d={builtYear:"number",squareFeet:"number",typeOfFoundation:"string",numberOfBedrooms:"number",numberOfBathrooms:"number",numberOfKitchens:"number",isPoolAvailable:"boolean",utilitiesOn:"boolean",propertyAccess:"string",hearAboutHouseMaster:"string",explainOther:"string",isPropertyOccupied:"boolean"},c={hmsBundleServiceId:"string",hmsBundleServiceName:"string",hmsBundleServiceDescription:"string",hmsBundleServiceProductNumber:"string",hmsBundleServiceCreatedBy:"string",hmsBundleServicePrice:"number",hmsBundleItemTax:"number",isTaxable:"boolean"},u={hmsServiceId:"string",hmsServiceName:"string",hmsServiceDescription:"string",hmsServiceProductNumber:"string",hmsServiceCreatedBy:"string",hmsPrice:"number",hmsItemTax:"number",isTaxable:"boolean"},m={franchiseId:"number",hasSameDayScheduling:"boolean",isBetaTester:"boolean",comments:"string",isLocalized:"boolean",conceptId:"number",useFranchiseProfileOptInForPOSScheduling:"boolean",isFranchiseOptedIntoPOSScheduling:"boolean",c4ChannelTypeId:"number",conceptCalledId:"number",c4CallQueueId:"number",conceptName:"string",conceptCode:"string",c4LeadsEnabled:"boolean",canceledJobInformation:"string",vendorId:"number",vendorLeadId:"number",nationalLeadId:"string",isTest:"boolean",vendorName:"string",webLocationId:"number",correlationId:"string",c4CallCenterId:"number",dayTimePhoneNumber:"string",zipCode:"string",billingAddress1:"string",billingAddress2:"string",billingCity:"string",billingState:"string",billingZip:"string",fee:"number",floor:"string",isPreapptCallReqd:"boolean",isNewCaNCall:"boolean",note:"string",firstName:"string",lastName:"string",email:"string",phone:"string",phone2:"string",phone3:"string",phoneType:"string",phoneType2:"string",phoneType3:"string",postalCode:"string",city:"string",state:"string",country:"string",address:"string",address2:"string",leadSource:"string",licenseNumber:"string",webLocationAccountCode:"string",leadOrigin:"string",campaignName:"string",referringURL:"string",disposition:"string",agentEmail:"string",callType:"string",preferredCommunicationType:"string",emailOptOut:"boolean",tagName:"string",signUpForUpdates:"boolean",latitude:"number",longitude:"number",locationType:"string",isGoogleAddress:"boolean",googleCalendarEventId:"string",googleCalendarEmail:"string",serviceText:"string",serviceId:"number",isCoreWebhook:"boolean",warranty:"boolean",timeSlotTypeId:"number",makeId:"number",leadSourceId:"number",secondaryLeadSourceId:"number",serviceTypeProblem:"string",overrideJobPromisedDate:"string",serviceSkuId:"number",serviceSkuIds:"object",isEstimate:"boolean",estimateFrequency:"string",estimateHouseStyle:"string",estimateSquareFeet:"string",estimateBedrooms:"string",estimateBathrooms:"string",estimatePets:"string",ccFirstName:"string",ccLastName:"string",ccType:"string",ccSuffix:"string",ccToken:"string",ccExpirationDate:"string",ccComment:"string",isLeadOnly:"boolean",scheduleID:"string",timeBlock:"object",overrideCSRName:"string",overrideComment:"string",syncTenantName:"string",isEmergencyCall:"boolean",callId:"string",isFranchiseInPOS:"boolean",testOfflinePOS:"string",ranLoginTypeID:"number",ranUserID:"string",referralFirstName:"string",referralLastName:"string",referralZipCode:"string",referralPhone:"string",referralEmail:"string",referralReason:"string",currentPage:"string",emailDocumentName:"string",emailDocumentUrl:"string",optIn:"boolean",isForm:"boolean",customerId:"string",isFsmUpdatedCu
3stomer:"boolean",referralTypeId:"string",referralType:"string",referralSourceId:"string",referralSource:"string",leadId:"string",customerType:"string",neighborlyAccountId:"number",neighborlyLeadSourceId:"number",fileUrls:"object",jobFrequency:"string",jobFrequencyDetail:"string",year:"number",make:"string",model:"string",bodyStyle:"string",vin:"string",licensePlateNumber:"string",windshieldRepair:"string",headlightRestoration:"string",serviceRequested:"object",leadAdditionalNotes:"object",formOfPayment:"string",insuranceCompany:"string",deductibleAmount:"number",policyNumber:"string",imageUrls:"object",howDidYouHearAboutUs:"string",bookingId:"number",otherText:"string",advantagePlanMember:"boolean",firstTimeCustomer:"boolean",businessName:"string",serviceTypeID:"number",priority:"string",jobPromiseEndTime:"object",legacyLeadTableID:"number",legacyLeadTableID2:"number",scheduleDate:"string",packageType:"string",sendToSyncSourceTypeId:"number",timeZoneId:"number",timeZoneInfoId:"string",bypassTenantCheckOnAvailabilityAndBooking:"boolean",opalScheduleId:"string",vendorRouting:"number",webhookLeadEventId:"number",adjustedPOSSource:"string",preferredContactMethod:"string",message:"string",insuranceCompanyPhoneNumber:"string",insuranceDateOfLoss:"string",claimNetworkReferralNumber:"string",insuranceCauseOfLoss:"string",agencyAgentName:"string",agencyDirectPhoneNumber:"string",agencyEmailAddress:"string",agencyName:"string",agencyAddress:"string",agencyCity:"string",agencyState:"string",agencyZipCode:"string",hmsAppointmentType:"number",hmsParticularInspector:"string",hmsRoleInfo:"object",scheduledTime:"string",callCenterBrandEmail:"string",calendarTypeId:"number",syncCampaignId:"number",serviceType:"string",estimateNote:"string",isOverriding:"boolean",pauseLead:"boolean",gaValue:"string",itemList:"string",howheard:"string",appointmentTypeID:"string",userAgent:"string",howheardother:"string",landingPage:"string",referringPage:"string",AdditionalInfo:"string",isDumpster:"boolean",couponCode:"string",technicianIds:"string",pauseLeadTimer:"number",formType:"string",stepType:"string",stepNumber:"number",crossSellDetails:"object"},h={leadAdditionalNoteLabel:"string",leadAdditionalNoteText:"string"},p={conceptCode:"string",services:"object"},v={serviceId:"number",serviceSkuId:"number",serviceName:"string"},g={imageUrl:"string"},f={hmsBundleServiceId:"string",hmsBundleServiceName:"string",hmsBundleServiceDescription:"string",hmsBundleServiceProductNumber:"string",hmsBundleServiceCreatedBy:"string",hmsBundleServicePrice:"number",hmsBundleItemTax:"number",isTaxable:"boolean"},y={hmsServiceId:"string",hmsServiceName:"string",hmsServiceDescription:"string",hmsServiceProductNumber:"string",hmsServiceCreatedBy:"string",hmsPrice:"number",hmsItemTax:"number",isTaxable:"boolean"},b={ticks:"number",days:"number",hours:"number",milliseconds:"number",minutes:"number",seconds:"number",totalDays:"number",totalHours:"number",totalMilliseconds:"number",totalMinutes:"number",totalSeconds:"number"}},"./src/js/opus2/apiCaching/POST-Requests/keys/contactKeys.ts"(e,t,o){"use strict";o.d(t,{contactUsPayloadModelKeys:()=>n});const n={franchiseWebLocationId:"number",conceptId:"number",isLocalized:"boolean",firstName:"string",lastName:"string",zipCode:"string",email:"string",phone:"string",isNewCustomer:"string",comments:"string",signUpForUpdates:"boolean",isTest:"boolean",vendorId:"number",howDidYouHearAboutUs:"string",city:"string",state:"string",country:"string",address:"string",address2:"string",legacyLeadTableId:"number",legacyLeadTableId2:"number",correlationId:"string",conceptCode:"string",optIn:"boolean",emailOptOut:"boolean",formType:"string",companyName:"string"}},"./src/js/opus2/apiCaching/POST-Requests/keys/couponOffersKeys.ts"(e,t,o){"use strict";o.d(t,{couponOffersDataKeys:()=>n});const n={conceptID:"number",webLocationID:"number",dbaName:"string",stateName:"string",couponCode:"string",statusCode:"string",enableFeaturedOffers:"boolean",isActive:"boolean",latestVersion:"string",serviceCategories:"object",serviceSkus:"object",displayOffer:"string",offerType:"string",serviceTypeID:"number"}},"./src/js/opus2/apiCaching/POST-Requests/keys/isReturningCustomerKeys.ts"(e,t,o){"use strict";o.d(t,{isReturningCustomerDataKeys:()=>n});const n={firstName:"string",lastName:"string",phone:"string",email:"string",zipcode:"string",conceptId:"number",weblocationId:"number"}},"./src/js/opus2/apiCaching/POST-Requests/keys/priceQuoteKeys.ts"(e,t,o){"use strict";o.d(t,{priceQuoteDataKeys:()=>n});const n={franchiseWebLocationId:"number",conceptId:"number",serviceIdsAndQuantities:"object",brandId:"number",postalCode:"number",includeDetail:"boolean",serviceItems:"object"}},"./src/js/opus2/apiCaching/apiWrapper.ts"(e,t,o){"use strict";o.d(t,{cachedAPIWrapper:()=>I,getAttomDataByAddress:()=>L,getCachedAPIResponse:()=>b});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../api/apiTester */"./src/js/opus2/api/apiTester.ts"),r=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),l=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts");const a=(0,r.isTestEnvironment)(),d="opus2.0-api-cache",c="boolean"==typeof JSON.parse("false".toLowerCase())&&JSON.parse("false".toLowerCase());function u(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{if(window.__cachePurgeInProgress){const t=yield fetch(e,{cache:"no-store",headers:{"Cache-Control":"no-cache, no-store, must-revalidate"}});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return yield t.json()}return yield(0,i.apiRequestForWrapper)({method:"GET",url:e})}catch(t){const o=yield h(t,e);if(o)throw o;throw console.error("Error fetching data from API:",t),t}})}function m(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield(0,i.wrapperAPICall)({method:"GET",url:e});return a&&console.log(e),t}catch(t){console.error("Error fetching data from API:",t);const o=yield h(t,e);if(o)throw o;throw t}})}function h(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n;let i=e,s="";if(e instanceof Promise)try{i=yield e}catch(e){i=e}if(i instanceof Response)try{const e=yield i.json();s=null!==(o=null==e?void 0:e.message)&&void 0!==o?o:JSON.stringify(e),i=e}catch(e){console.error("Error parsing response JSON:",e),s=null!==(n=i.statusText)&&void 0!==n?n:`HTTP error! status: ${i.status}`}else if(i instanceof Error){if(s=i.message,"Full address is needed to narrow down results"===s)return new Error("Full address is needed to narrow down results")}else s="object"==typeof i&&null!==i&&"message"in i?i.message:String(i);return a&&console.log(t),i})}function p(e,t){try{const o=new URL(e),n=o.searchParams,i=n.get("PostalCode"),s=n.get("Address");if(i&&n.set("PostalCode",i.trim()),s&&n.set("Address",s.trim()),t){let e=null;if(n.forEach((t,o)=>{"apikey"===o.toLowerCase()&&(e=t)}),!e)return console.error("API key is missing in the URL"),null}return o.toString()}catch(e){return console.error("Invalid URL:",e),null}}function v(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=yield caches.open(d),n=yield o.match(e);if(!n)return null;const i=yield n.json();if(Date.now()-i.timestamp<60*t*1e3)return c&&console.info(`C_Hit: ${e}`),i.data;try{yield o.delete(e)}catch(e){console.warn("Failed to delete expired cache:",e)}return null})}function g(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=yield caches.open(d),n={timestamp:Date.now(),data:t};o.put(e,new Response(JSON.stringify(n))),c&&console.log("C_Set ",e)})}function f(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o=yield function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){return(yield v(e,t))||null})}(e,t);return o||(yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=yield u(e);
3if(!window.__cachePurgeInProgress&&S(t))try{yield g(e,t)}catch(e){console.warn("Failed to cache data:",e)}else S(t)||(console.error("Empty API response"),w(e,"Empty API response"));return t})}(e))}catch(t){return console.error("Error with Cache API:",t),yield u(e)}})}function y(e){if(e.includes("site-config")){const n=null!==(o=null===(t=document.getElementById("local_weblocationId"))||void 0===t?void 0:t.value)&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId");return`${e}${n?`/${n}`:""}`}var t,o;return e}function b(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=10,o=!1,n=!0){let i=p(e,o);return i?(i=y(i),window.__cachePurgeInProgress?u(i):n&&"caches"in window?f(i,t):n?(console.warn("Caching not present in this browser"),u(i)):u(i)):null})}function I(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=10,o=!0){let n=p(e,!1);if(!n)return null;if(n=y(n),window.__cachePurgeInProgress)return m(n);if(!o)return m(n);if(!("caches"in window))return console.warn("Caching not present in this browser"),m(n);try{const e=yield v(n,t);if(e)return e;const o=yield m(n);return!window.__cachePurgeInProgress&&S(o)?yield g(n,o):S(o)||w(n,"Empty API response"),o}catch(e){return m(n)}})}function S(e){return Array.isArray(e)?e.length>0?e:null:e}function w(e,t){try{(0,s.getRequestLogger)(e,t)}catch(e){return void console.error("Request logging to datadog failed...",e)}}function L(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,s,a,d,c,u,m,h,p,v,g,f,y,b,I,S,L,E,C,A,_,k,N,T,B;const{address1:P,city:j,state:D,zipcode:M,signal:q}=e,R=new URLSearchParams({address1:P,address2:`${j} ${D} ${M}`}),O=`${l.apiConfig.ATTOM_API_URL}/?${R.toString()}`;try{(0,r.isTestEnvironment)()&&console.log(O);const e={headers:{Accept:"application/json","Content-Type":"application/json",apikey:"63cd35856abc51483699f59f167df20e"},method:"GET",url:O,signal:q},l=yield(0,i.default)(e);if(!(null==l?void 0:l.property)||!Array.isArray(l.property)||0===l.property.length||!(null===(t=l.property[0])||void 0===t?void 0:t.building))throw new Error("Missing property/building data from Attom API response");let w=1;(null===(a=null===(s=null===(n=null===(o=null==l?void 0:l.property)||void 0===o?void 0:o[0])||void 0===n?void 0:n.building)||void 0===s?void 0:s.rooms)||void 0===a?void 0:a.beds)?w=null===(m=null===(u=null===(c=null===(d=null==l?void 0:l.property)||void 0===d?void 0:d[0])||void 0===c?void 0:c.building)||void 0===u?void 0:u.rooms)||void 0===m?void 0:m.beds:(null===(g=null===(v=null===(p=null===(h=null==l?void 0:l.property)||void 0===h?void 0:h[0])||void 0===p?void 0:p.building)||void 0===v?void 0:v.rooms)||void 0===g?void 0:g.roomsTotal)&&(w=null===(I=null===(b=null===(y=null===(f=null==l?void 0:l.property)||void 0===f?void 0:f[0])||void 0===y?void 0:y.building)||void 0===b?void 0:b.rooms)||void 0===I?void 0:I.roomsTotal);const P=null!==(A=null===(C=null===(E=null===(L=null===(S=null==l?void 0:l.property)||void 0===S?void 0:S[0])||void 0===L?void 0:L.building)||void 0===E?void 0:E.rooms)||void 0===C?void 0:C.bathsTotal)&&void 0!==A?A:1;return{beds:w,baths:P,sqft:null!==(B=null===(T=null===(N=null===(k=null===(_=null==l?void 0:l.property)||void 0===_?void 0:_[0])||void 0===k?void 0:k.building)||void 0===N?void 0:N.size)||void 0===T?void 0:T.livingSize)&&void 0!==B?B:0}}catch(e){return w(O,e instanceof Error?e.message:"Missing property/building data from Attom API response"),console.warn("Error while fetching ATTOM data:",e),null}})}},"./src/js/opus2/ccpa/deregister.ts"(e,t,o){"use strict";o.d(t,{Deregister:()=>r});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts");class r{constructor(){this.success=null,this.error=null,this.domStore(),this.init()}init(){const e=this.fetchParams();e&&this.getApiResult(e)}fetchParams(){const e=globalThis.location.href,t=new URL(e),o=new URLSearchParams(t.search);return this.sanitizeInput(o.get("ccpa"))}sanitizeInput(e){if(!e)return"";const t=e.trim().replace(/\/+$/,"");if(!t)return console.warn("Invalid CCPA parameter format. Expected UUID format."),"";return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)?t:(console.warn("Invalid CCPA parameter format. Expected UUID format."),"")}domStore(){this.success=document.querySelector(".success-message"),this.error=document.querySelector(".error-message")}getApiResult(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t="pneiweb-9pbaOywNKQj853D";if(!t)return console.error("API key is missing. Cannot proceed with CCPA deregister request."),void this.showError();const o=`${i.apiConfig.CCPA_DEREGISTER}${e}`,n=yield(0,s.apiRequestForWrapper)({method:"PUT",url:`${o}?apikey=${t}`,headers:{"Content-Type":"application/json"}});!1===(null==n?void 0:n.success)?this.showError():this.showSuccess()}catch(e){console.error("CCPA deregister error:",e),this.showError()}})}showSuccess(){var e,t;null===(e=this.success)||void 0===e||e.classList.remove("hidden"),null===(t=this.error)||void 0===t||t.classList.add("hidden")}showError(){var e,t;null===(e=this.error)||void 0===e||e.classList.remove("hidden"),null===(t=this.success)||void 0===t||t.classList.add("hidden")}static getInstance(){return r.instance||(r.instance=new r),r.instance}}},"./src/js/opus2/common/index.ts"(e,t,o){"use strict";o.d(t,{AreaWeServe:()=>i.AreaWeServe,Footer:()=>n.Footer});o(/*! ../lead-flow */"./src/js/opus2/lead-flow/index.ts"),o(/*! ../header/index */"./src/js/opus2/header/index.ts");var n=o(/*! ../footer/footer */"./src/js/opus2/footer/footer.ts"),i=o(/*! ../map/areaWeServe */"./src/js/opus2/map/areaWeServe.ts");
3o(/*! ../services/index */"./src/js/opus2/services/index.ts"),o(/*! ../event-service */"./src/js/opus2/event-service/index.ts"),o(/*! ../hero_component/index */"./src/js/opus2/hero_component/index.ts"),o(/*! ../photo_gallery */"./src/js/opus2/photo_gallery/index.ts"),o(/*! ../header/searchLocalSite */"./src/js/opus2/header/searchLocalSite.ts")},"./src/js/opus2/config/apiConfig.ts"(e,t,o){"use strict";var n,i,s;o.d(t,{apiConfig:()=>h});let r="MRA";const l=document.querySelector("#conceptCode");(null===(n=null==l?void 0:l.value)||void 0===n?void 0:n.length)&&(r=l.value);let a="";const d=document.querySelector("#conceptId");(null===(i=null==d?void 0:d.value)||void 0===i?void 0:i.length)&&(a=d.value);let c="8628";const u=document.querySelector("#weblocationId");u&&(null===(s=u.value)||void 0===s?void 0:s.length)&&(c=u.value);const m=document.querySelector("#conceptCode"),h={LocateLocationApiWithRoundRobinFalse:`https://api2-unifiedsyncplatform.dwyergroup.com/UnifiedSyncPlatform/FranchiseLookUpByServiceAddress?apikey=pneiweb-9pbaOywNKQj853D&Address=sAddressParamValue&IsRoundRobin=false&RequireAddressOnPartialPostalCode=true&conceptID=${encodeURIComponent(a)}`,LocateLocationApiWithRoundRobinTrue:`https://api2-unifiedsyncplatform.dwyergroup.com/UnifiedSyncPlatform/FranchiseLookUpByServiceAddress?apikey=pneiweb-9pbaOywNKQj853D&Address=sAddressParamValue&IsRoundRobin=true&RequireAddressOnPartialPostalCode=true&conceptID=${encodeURIComponent(a)}`,LocateLocationApiWithRoundRobin:"https://api.neighborly.com/digitalorchestrations-api/v1/public/FranchiseLookup/FranchiseLookUpByServiceAddress",APP_LINK_SEND:"https://api.neighborly.com/notificationservice/v1/public/PushNotification/MobileAppPromo?apikey=pneiweb-9pbaOywNKQj853D",FOOTER_BRAND_LINK:"https://api.neighborly.com/digitalorchestrations-api/v1/public/fullattribute/franchiseWeblocations/search/",stateApi:"https://api.neighborly.com/digitalorchestrations-api/v1/public/States/",CONTACT_US_SEND:"https://api.neighborly.com/unifiedsyncplatform-api/v1/public/UnifiedSyncPlatform/ContactUs?apikey=pneiweb-9pbaOywNKQj853D",BOOKING_API_URL:"https://api.neighborly.com/unifiedsyncplatform-api/v1/public/UnifiedSyncPlatform/Booking?apikey=pneiweb-9pbaOywNKQj853D",TESTIMONIAL_REVIEWS:"https://api.neighborly.com/digitalorchestrations-api/v1/public/Reviews/review-aggregates/search",ourTeam:"https://api.neighborly.com/digitalorchestrations-api/v1/public/MeetTheTeam/FranchiseWebLocationId/",GETHeaderMenu:`https://api.neighborly.com/serviceorchestrations-api/v1/public/service/config/menu/brand/${null==m?void 0:m.value}`,fullAttribute:"https://api.neighborly.com/digitalorchestrations-api/v1/public/fullattribute/franchiseWeblocations/search/",howToKnow:"https://api.neighborly.com/digitalorchestrations-api/v1/public/generic-lead-sources",franchiseWebLocationPostalCodeFees:"https://api.neighborly.com/franchisegroup-api/v1/public/franchiseWebLocationPostalCodeFees",franchiseWebLocationProfileFees:"https://api.neighborly.com/franchisegroup-api/v1/public/franchiseWebLocationProfileFees/franchiseWeblocations",AppointMentAPi:"https://api2-unifiedsyncplatform.dwyergroup.com/public/UnifiedSyncPlatform/TechAvailability",GET_ATTRIBUTE_DATA:"https://api.neighborly.com/digitalorchestrations-api/v1/public/fullattribute/franchiseWeblocations/search",GET_SERVICE_BUNDLE:"https://api2-unifiedsyncplatform.dwyergroup.com/public/UnifiedSyncPlatform/Settings/GetOnverityServiceBundle",HMS_BOOKING:"https://api2-unifiedsyncplatform.dwyergroup.com/public/UnifiedSyncPlatform/Booking?apikey=pneiweb-9pbaOywNKQj853D",BLOG_URL:"https://searchg2.crownpeak.net/",FranchiseLookUpByServiceAddress:`https://api2-unifiedsyncplatform.dwyergroup.com/UnifiedSyncPlatform/FranchiseLookUpByServiceAddress?conceptID=${encodeURIComponent(a)}&apikey=pneiweb-9pbaOywNKQj853D`,paymentPostUrl:"https://app.onverity.com/static/ccpayment/payment",POSLookup:`https://api2-unifiedsyncplatform.dwyergroup.com/UnifiedSyncPlatform/FranchisePosLookup?conceptid=${encodeURIComponent(a)}&apikey=pneiweb-9pbaOywNKQj853D&postalcode=`,syncCleoLeadSources:`https://api.neighborly.com/serviceorchestrations-api/v1/public/concepts/${a}/lead-sources?apikey=pneiweb-9pbaOywNKQj853D`,DISCOVER_API:"https://discover.search.hereapi.com/v1/discover",calculateEstimate:"https://api2-unifiedsyncplatform.dwyergroup.com/public/UnifiedSyncPlatform/CalculateEstimate?apikey=pneiweb-9pbaOywNKQj853D",FranchisePOSLookup:"https://api2-unifiedsyncplatform.dwyergroup.com/UnifiedSyncPlatform/FranchisePosLookup?apikey=pneiweb-9pbaOywNKQj853D&FranchiseWebLocationId=",WebLocationsAPI:`https://api.neighborly.com/digitalorchestrations-api/v1/public/concepts/${r}/franchiseweblocations`,WebLocationsFranchiseGroupAPI:`https://api.neighborly.com/franchisegroup-api/v1/public/concepts/${r}/franchiseweblocations`,geoCodeSearchApiUrl:"https://geocode.search.hereapi.com/v1/geocode",GenericLeadSourceEndpoint:"https://api.neighborly.com/serviceorchestrations-api/v1/public/generic-lead-sources?apikey=pneiweb-9pbaOywNKQj853D",MollyLeadSourceEndpoint:"https://api.neighborly.com/serviceorchestrations-api/v1/public/concepts/8/lead-sources?apikey=pneiweb-9pbaOywNKQj853D",ApiLogerrorEndpoint:"api/logerror",ApiLogperformanceEndpoint:"api/loglatency",FranchiseTerritoriesAPI:"https://api.neighborly.com/franchisegroup-api/v1/public/franchiseTerritories/postalCodes?apikey=pneiweb-9pbaOywNKQj853D",PhotosAPI:"https://api.neighborly.com/digitalorchestrations-api/v1/public/photos/images",PhotoCategoriesAPI:"https://api.neighborly.com/digitalorchestrations-api/v1/public/photos/categories",CROWNPEAK_WEBLOCATION_URL:`${window.origin}/config-files/_weblocations-config.json`,CROWNPEAK_CACHING_SETTINGS:`${window.origin}/brand/_assets/config/cache-config.json`,VIN_API_URL:"https://api.neighborly.com/digitalorchestrations-api/v1/public/vehicleDetails",ATTOM_API_URL:"https://api.gateway.attomdata.com/propertyapi/v1.0.0/property/basicprofile",QUOTE_API_URL:`https://api.neighborly.com/digitalorchestrations-api/v1/public/quote/${r}`,CLIENT_TRANSFORM_CAROUSEL_V2:"https://junkware.junk-king.com/system/services/doak.asmx/GetDiaryData",DOK_DIARY_DATA:"https://api.neighborly.com/digitalorchestrations-api/v1/public/diarydata",CHUNKING_MANIFEST:`${globalThis.location.origin}/brand/_assets/js/opus2-build-manifest.json`,CcpaPersonalInformation:"https://api.neighborly.com/digitalorchestrations-api/v1/public/CcpaPersonalInformation?apikey=pneiweb-9pbaOywNKQj853D",ServiceAPI:"https://api.neighborly.com/serviceorchestrations-api/v1/public/protypes/serviceprotypes-aggregates/search?apikey=pneiweb-9pbaOywNKQj853D",ServiceSearchTermAPI:"https://api.neighborly.com/digitalorchestrations-api/v1/public/service-search-term-aggregates/search?apikey=pneiweb-9pbaOywNKQj853D",BRAND_SEARCH_API:`${globalThis.location.origin}/searchservice`,CA_BRAND_SEARCH_API:`${globalThis.location.origin}/ca/searchservice`,GENERIC_EMAIL_ENDPOINT:`${globalThis.origin}/api/email/generic`,CCPA_DEREGISTER:"https://api.neighborly.com/digitalorchestrations-api/v1/public/CcpaPersonalInformation/"}},"./src/js/opus2/config/cachingConfig.ts"(e,t,o){"use strict";o.d(t,{apiCaching:()=>n});const n={TestimonyAndReview:60,DynamicMenu:60,IsnRedirectConfig:60,POSSystemLookup:5,FranchisePOSLookup:5,FullAttributeResponse:60,LocateLocationApiWithRoundRobinTrue:60,TechAvailability:2,SiteConfig:60,BrandJsonConfig:60,HereMapConfig:60,OffersLanding:20,OffersPopup:20,OfferTeaser:20,serviceAccordion:60,eventDetails:60,FranchiseWebLocationProfileFees:60}},"./src/js/opus2/constants/regex.ts"(e,t,o){"use strict";o.d(t,{REGEX:()=>n});const n={mobileNumberRegex:/(\d{0,3})(\d{0,3})(\d{0,4})/,sendName:/^(?=[A-Za-z])(?=[^+(),*]*$)(?=(?:[^.]*\.){0,2}[^.]*$)(?=(?:[^-]*-){0,2}[^-]*$)(?=(?:[^']*'){0,2}[^']*$)(?=(?:[^ ]* ){0,2}[^ ]*$)[A-Za-z][A-Za-z .'-]*$/,sendLname:/^(?=[A-Za-z])(?=[^+(),*]*$)(?=(?:[^.]*\.){0,2}[^.]*$)(?=(?:[^-]*-){0,2}[^-]*$)(?=(?:[^']*'){0,2}[^']*$)(?=(?:[^ ]* ){0,2}[^ ]*$)[A-Za-z][A-Za-z .'-]*$/,sendZip:/^(\d{5}(-\d{4})?|[A-Za-z]\d[A-Za-z] ?\d[A-Za-z]\d|[A-Za-z]\d[A-Za-z])$/,sendPhone:/^(\+?[1-9]\d{1,14}|0)$/,sendEmail:/^(([^<>()[\]\\.,;:\s@"#]+(\.[^<>()[\]\\.,;:\s@"#]+)*)|("[^"]+"))@((\[(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}\])|(([a-z\d]([a-z\d\-]*[a-z\d])?\.)+[a-z]{2,}))$/i,sendAddress1:/^[^\s!@#$%^&*()].*$/,sendAddress2:/^[^!@#$%^&*()].*$/,sendCity:/^[A-Za-z][A-Za-z ]*$/,sendCaPostalCode:/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/,matchAny:/^(?=.*\S).+$/,sendNumber:/^[0-9]+$/,sendYear:/^\d{4}$/,allow3Digit:/^(?:[5-9]\d{2}|[1-9]\d{3,4})$/,allow1to9:/^[1-9]$/,allow1to99:/^(?:[1-9]|[1-9][0-9]?)$/,floatDigit:/^\d+(\.\d+)?$/,caSendZip:/^(3|5|\d{3}|\d{5}|[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d|[A-Za-z]\d[A-Za-z]|[A-Za-z]+(?: [A-Za-z]+)*)$/,allow1to99999Digit:/^[1-9]\d{0,4}$/,caPostalCodeFSA:/^[A-Z]\d[A-Z]$/,caPostalCodeFull:/^[A-Z]\d[A-Z]\s?\d[A-Z]\d$/,usZipCode:/^\d{5}(-\d{4})?$/,noBracketAddress:/^[^!?@#$%^&*()]*$/,alphanumeric:/^[a-zA-Z0-9]+$/,dateMMDDYYYY:/^(0[1-9]|1[0-2])\s*\/\s*(0[1-9]|[12][0-9]|3[01])\s*\/\s*\d{4}$/,agentAgencyName:/^[A-Za-z][A-Za-z' .-]{0,399}$/}},"./src/js/opus2/cwv-handlers/handleConcomShop.ts"(e,t,o){"use strict";function n(){const e=document.getElementById("concom-shop"),t=document.querySelector("section.short
3-form-component.secondary-bg"),o=document.querySelector("footer#footer");if(!e)return;const n=setInterval(()=>{e.children.length>0&&setTimeout(()=>{e.style.minHeight="",e.style.visibility="visible",t&&(t.style.visibility="visible"),o&&(o.style.visibility="visible"),clearInterval(n)},1e3)},100)}o.d(t,{handleConcomShopLoad:()=>n})},"./src/js/opus2/cwv-handlers/handleMeetTheTeamLoad.ts"(e,t,o){"use strict";function n(){const e=document.querySelector(".our-team-section");setTimeout(()=>{e.style.removeProperty("height"),e.style.contentVisibility="visible",e.style.height="auto"},600)}o.d(t,{default:()=>n})},"./src/js/opus2/cwv-handlers/handleStickyNavCollapse.ts"(e,t,o){"use strict";function n(){const e=document.getElementById("sticky-placeholder"),t=document.getElementById("main");if(e&&t){new MutationObserver(()=>{"none"===e.style.display?t.style.paddingTop="":t.style.paddingTop="92px"}).observe(e,{attributes:!0,attributeFilter:["style"]})}}o.d(t,{handleStickyNavCollapse:()=>n})},"./src/js/opus2/event-service/eventLanding.ts"(e,t,o){"use strict";o.d(t,{EventLanding:()=>n});class n{static getInstance(){var e;return null!==(e=n.instance)&&void 0!==e||(n.instance=new n),n.instance}constructor(){this.globalEventMonth="Select Month",this.globalIndex=0,this.selectedItemLength=0,this.maxItemsInOneGo=5,this.maxItemsOnLoadMore=3,this.itemsCurrentlyThatCanBeViewed=5,this.isClickTriggered=!1,this.init(),document.querySelector(".events-card")&&this.applyReadMore()}displayOnlySelectedMonth(){this.isClickTriggered=!1;const e=document.getElementById("filter-event").value;this.globalIndex=0,this.selectedItemLength=0,this.globalEventMonth=e;const t=document.querySelectorAll(".events-list>.event-wrapper");if(t.forEach(e=>{e.style.display="none"}),"Select Month"!==e&&document.getElementById(e)){document.getElementById(e).style.display="flex"}else t.forEach(e=>{e.style.display="flex"});this.setGlobalValuesToEventLength(),this.showFiveContents()}showFiveContents(){this.itemsCurrentlyThatCanBeViewed=this.isClickTriggered?this.maxItemsInOneGo+this.maxItemsOnLoadMore*this.globalIndex:this.maxItemsInOneGo,this.globalIndex+=1;let e=new Set,t="Select Month"===this.globalEventMonth?".event-wrapper>.events-card":`#${this.globalEventMonth}>.events-card`,o=document.querySelectorAll(t);o&&o.forEach((t,o)=>{const n=t.parentNode,i=document.getElementById(n.id).querySelector(".event-list-date"),s=t;o>this.itemsCurrentlyThatCanBeViewed-1?s.style.display="none":(s.style.display="block",e.add(n.id)),null==i||i.classList.toggle("hidden",!e.has(n.id))});const n=document.getElementById("load_more_events"),i=document.getElementById("load-more"),s=document.getElementById("back_to_top"),r=null==s?void 0:s.parentNode;if(n){const e=this.selectedItemLength<this.maxItemsInOneGo+1||this.itemsCurrentlyThatCanBeViewed>this.selectedItemLength-1;n.classList.toggle("hidden",e),i.classList.toggle("hidden",e),s&&(null==r||r.classList.toggle("hidden",!e),s.removeEventListener("click",this.scrollToTop),e&&s.addEventListener("click",this.scrollToTop))}this.isClickTriggered=!0}setGlobalValuesToEventLength(){const e=document.getElementById(this.globalEventMonth);this.selectedItemLength=e?e.querySelectorAll(".events-card").length:document.querySelectorAll(".events-list>.event-wrapper>.events-card").length}scrollToTop(){scrollTo(0,0)}checkIfLoadMoreNeedsToBeShown(){const e=document.getElementById("load_more_events");if(e)if(this.selectedItemLength<this.maxItemsInOneGo+1||this.globalIndex*this.maxItemsInOneGo>this.selectedItemLength-1){e.classList.add("hidden");const t=document.getElementById("back_to_top");if(t){const e=t.parentNode;null==e||e.classList.remove("hidden"),t.addEventListener("click",this.scrollToTop)}}else{e.classList.remove("hidden");const t=document.getElementById("back_to_top");if(t){const e=t.parentNode;null==e||e.classList.add("hidden"),t.removeEventListener("click",this.scrollToTop)}}}init(){var e,t;this.isClickTriggered=!1,this.setupReadMoreEventDelegation(),document.getElementById("load_more_events")&&document.getElementById("filter-event")&&(null===(e=document.getElementById("load_more_events"))||void 0===e||e.addEventListener("click",this.show
3FiveContents.bind(this)),this.dropDown=document.getElementById("filter-event"),null===(t=document.getElementById("filter-event"))||void 0===t||t.addEventListener("change",this.displayOnlySelectedMonth.bind(this)),this.setGlobalValuesToEventLength(),this.showFiveContents())}setupReadMoreEventDelegation(){const e=document.querySelectorAll(".events-list, .card-list");null==e||e.forEach(e=>{null==e||e.addEventListener("click",e=>{var t,o;const n=e.target;((null==n?void 0:n.classList.contains("read-more-btn"))||"BUTTON"===(null==n?void 0:n.tagName)&&((null===(t=null==n?void 0:n.textContent)||void 0===t?void 0:t.includes("Read more"))||(null===(o=null==n?void 0:n.textContent)||void 0===o?void 0:o.includes("Read less"))))&&(null==e||e.preventDefault(),this.handleReadMoreToggle(n))})})}handleReadMoreToggle(e){const t=null==e?void 0:e.closest(".events-card");if(!t)return;"Read more"===(null==e?void 0:e.textContent)?this.expandCard(t,e):this.collapseCard(t,e)}expandCard(e,t){var o,n;const i=JSON.parse((null===(o=null==e?void 0:e.dataset)||void 0===o?void 0:o.originalContent)||"[]"),s=Array.from(null==e?void 0:e.querySelectorAll("p")),r=null==s?void 0:s.filter(e=>!(null==e?void 0:e.closest(".events-location")));null==r||r.forEach((e,t)=>{e.innerHTML=i[t],e.style.display=""}),null===(n=r[r.length-1])||void 0===n||n.appendChild(t),t.textContent="Read less"}collapseCard(e,t){var o,i;const s=n.CHARACTER_LIMIT,r=Array.from(e.querySelectorAll("p")).filter(e=>!e.closest(".events-location"));let l=0,a=!1;const d=JSON.parse(e.dataset.originalContent||"[]");r.forEach((e,t)=>{d[t]&&(e.innerHTML=d[t]),e.style.display=""});for(let e=0;e<r.length;e++){const n=r[e],d=(null===(i=null===(o=n.textContent)||void 0===o?void 0:o.replace(/\s/g,""))||void 0===i?void 0:i.length)||0;if(l+d>=s){const o=s-l,i=this.truncateHTML(n.innerHTML,o);n.innerHTML=`${i} <span class="ellipsis">...</span>`,n.appendChild(t);for(let t=e+1;t<r.length;t++)r[t].style.display="none";a=!0;break}l+=d}a&&(t.textContent="Read more",e.scrollIntoView({behavior:"smooth",block:"nearest"}))}truncateHTML(e,t){if(t<=0)return"";const o=document.createElement("div");o.innerHTML=e;let n=0;const i=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),s=[];let r,l=!1;for(;!l&&(r=i.nextNode());)if(r.textContent){const e=r.textContent,o=e.replace(/\s/g,"").length;if(n+o>t){const o=t-n;let i=0,s=0;for(let t=0;t<e.length&&(""!==e[t].trim()&&s++,!(s>o));t++)i=t+1;r.textContent=e.slice(0,i),l=!0}else n+=o}if(l&&r){let e=r.nextSibling;for(;e;)s.push(e),e=e.nextSibling;let t=r.parentElement;for(;t&&t!==o;){let e=t.nextSibling;for(;e;)s.push(e),e=e.nextSibling;t=t.parentElement}}return s.forEach(e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)}),o.innerHTML}applyReadMore(){const e=document.querySelectorAll(".events-card"),t=n.CHARACTER_LIMIT;null==e||e.forEach(e=>{const o=Array.from(null==e?void 0:e.querySelectorAll("p")),n=null==o?void 0:o.filter(e=>!(null==e?void 0:e.closest(".events-location")));if((null==n?void 0:n.reduce((e,t)=>{var o;return e+((null===(o=null==t?void 0:t.textContent)||void 0===o?void 0:o.length)||0)},0))>t){const t=null==n?void 0:n.map(e=>e.innerHTML);e&&(e.dataset.originalContent=JSON.stringify(t));const o=document.createElement("button");o.classList.add("read-more-btn"),o.textContent="Read more",o.style.textDecoration="underline",this.collapseCard(e,o)}})}}n.CHARACTER_LIMIT=375,n.getInstance()},"./src/js/opus2/event-service/eventService.ts"(e,t,o){"use strict";o.d(t,{EventService:()=>c});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),l=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),a=o(/*! ../../global */"./src/js/global/index.ts"),d=o(/*! ./eventLanding */"./src/js/opus2/event-service/eventLanding.ts");class c{constructor(e,t){var o;this.getStateName=()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null,{include_statename:t}=null!=e?e:{};let o=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;return!o&&t&&(yield(0,i.fetchCrownpeakUrlDetails)(),o=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),t&&(null==o?void 0:o.stateName)?`${o.stateName}`:""});const s=null===(o=document.getElementById("pageType"))||void 0===o?void 0:o.value;s&&"opus 2 event details page"==s.toLocaleLowerCase()&&this.init(e,t)}static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n,i,l;
3try{const l=localStorage.getItem("dbaName");let a,d=yield c.buildEventUrl(l);const u=yield(0,s.getCachedAPIResponse)(d,r.apiCaching.eventDetails);(Array.isArray(null==u?void 0:u.data)&&0===(null===(e=null==u?void 0:u.data)||void 0===e?void 0:e.length)||Array.isArray(null===(t=null==u?void 0:u.data)||void 0===t?void 0:t.events)&&0===(null===(n=null===(o=null==u?void 0:u.data)||void 0===o?void 0:o.events)||void 0===n?void 0:n.length))&&(a=new c(null,null)),a=new c(u,null);const m=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null;return null!==(i=null==m?void 0:m.enable_events_fte)&&void 0!==i&&i&&a.migrateEventFTE(),a}catch(e){return 404!==(null===(l=e.response)||void 0===l?void 0:l.status)?new c(null,e):new c(null,null)}})}static buildEventUrl(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=window.location.origin;if(!e)return`${t}/eventslandingmodalpopup/none`;const o=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null,{include_statename:n}=null!=o?o:{};let s=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;return!s&&n&&(yield(0,i.fetchCrownpeakUrlDetails)(),s=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),n&&(null==s?void 0:s.stateName)?`${t}/eventslandingmodalpopup/${e}/${s.stateName}/`:`${t}/eventslandingmodalpopup/${e}`})}init(e,t){var o;if(e){const t=null!==(o=null==e?void 0:e.events)&&void 0!==o?o:[],n=Array.isArray(t)?t:[],i=window.location.pathname.replace(/\/$/,""),s=n.findIndex(e=>{var t;return(null==e?void 0:e.href)&&(null===(t=null==e?void 0:e.href)||void 0===t?void 0:t.replace(/\/$/,""))===i});this.updatePaginationButtons(s,n)}t&&(console.error("Error fetching event details:",t),this.disablesPagination())}disablesPagination(){document.querySelectorAll(".events-section .pagination-link").forEach((e,t,o)=>{e.style.opacity="0.3",e.style.pointerEvents="none"})}updatePaginationButtons(e,t){var o,n;const i=document.querySelectorAll(".events-section .pagination-link"),s=i[0],r=i[1];-1!==e&&(e>0&&(null===(o=t[e-1])||void 0===o?void 0:o.href)?s.href=t[e-1].href:(s.disabled=!0,s.style.opacity="0.3",s.style.pointerEvents="none"),e<(null==t?void 0:t.length)-1&&(null===(n=t[e+1])||void 0===n?void 0:n.href)?r.href=t[e+1].href:(r.disabled=!0,r.style.opacity="0.3",r.style.pointerEvents="none"))}migrateEventFTE(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;try{const o=localStorage.getItem("dbaName");if(!o)return void console.warn("DBA name not found in localStorage.");if(window.location.href.includes(o))return;const n=document.querySelector(".events-section .blog-wrapper"),i=document.querySelector(".upcoming-events-section .card-wrapper"),s=(0,l.getPageSettings)("EventTeaserComponentView"),r=null!==(e=(0,l.getPageSettings)("EventTeaserComponent"))&&void 0!==e&&e,a=null===(t=document.getElementById("pageType"))||void 0===t?void 0:t.value;if(i&&s&&r||n&&a&&"opus 2 event landing page"==a.toLocaleLowerCase()){const e=yield this.safeGetStateName(),{APIUrl:t,eventDom:n}=this.buildApiUrlAndDom(r,s,o,e);yield this.handleTeaserComponent(t,n,r)}}catch(e){console.error("Unexpected error in migrateEventFTE:",e)}})}safeGetStateName(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{return yield this.getStateName()}catch(e){return console.error("Error getting state name:",e),""}})}buildApiUrlAndDom(e,t,o,n){var i;let s=`${window.location.origin}`,r=null;const a=document.querySelector(".events-section .blog-wrapper");if(e&&t)s+=`/eventsteaserdata/${t}`,r=document.querySelector(".upcoming-events-section .card-wrapper");else if(a){s+=`/eventslandingpage/${null!==(i=(0,l.getPageSettings)("EventLandingShortFormPresent"))&&void 0!==i&&i}`,r=a}return o&&(s+=`/${o}`),n&&(s+=`/${n}`),{APIUrl:s,eventDom:r}}handleTeaserComponent(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const n=yield(0,s.getCachedAPIResponse)(e);if(!n)return void console.warn("No response received from API:",e);t?o&&document.querySelector(".card-wrapper.upcoming-events-slider")?(t.outerHTML=n,this.initSliderSafe()):(t.
3innerHTML=n,new d.EventLanding):console.warn("Event DOM not found for selector: .card-wrapper.upcoming-events-slider")}catch(e){console.error("Error fetching event teaser data:",e)}})}initSliderSafe(){var e;try{null===(e=a.EventTeaserSlider.getInstance())||void 0===e||e.initSlider()}catch(e){console.error("Error initializing EventTeaserSlider:",e)}}}},"./src/js/opus2/event-service/index.ts"(e,t,o){"use strict";o(/*! ./eventService */"./src/js/opus2/event-service/eventService.ts"),o(/*! ./eventLanding */"./src/js/opus2/event-service/eventLanding.ts")},"./src/js/opus2/find-us/FindUsAddressBumper.ts"(e,t,o){"use strict";o.d(t,{FindUsAddressBumper:()=>a});var n=o(/*! ../apiCaching/POST-Requests/helperModules/handleBookingSubmit */"./src/js/opus2/apiCaching/POST-Requests/helperModules/handleBookingSubmit.ts"),i=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),s=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ../util/nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),l=o(/*! ../util/share */"./src/js/opus2/util/share.ts");class a{constructor(){this.zipCodeValue="",this.STEP_SELECTORS={step1:".dynamic-step-1",step2:".dynamic-step-2",step3:".dynamic-step-3",step4:".dynamic-step-4",step5:".dynamic-step-5"},this.FORM_SELECTORS={form:".dynamic-step-2 .modal-search",sendButton:".dynamic-step-2 .form-cta button",closeButton:"#dynamic-close-local-modal",errorCloseButton:"#dynamic-close-btn-error",inputAddress1:".dynamic-step-2 #dynamic-modal-address-1",inputAddress2:".dynamic-step-2 #dynamic-modal-address-2",inputCity:".dynamic-step-2 #dynamic-modal-city",inputState:".dynamic-step-2 #dynamic-modal-state",inputZipCode:".dynamic-step-2 #dynamic-modal-zipcode"},this.steps=this.initializeSteps(),this.formElement=document.querySelector(this.FORM_SELECTORS.form),this.sendButton=document.querySelector(this.FORM_SELECTORS.sendButton),this.handleClose=this.handleModalClose.bind(this),this.initializeEventListeners(),this.setupInlineValidation()}initializeSteps(){return Object.entries(this.STEP_SELECTORS).reduce((e,[t,o])=>(e[t]=document.querySelector(o),e),{})}initializeEventListeners(){this.sendButton&&this.sendButton.addEventListener("click",()=>this.handleNextBtnClick());const e=document.querySelector(this.FORM_SELECTORS.closeButton);e&&e.addEventListener("click",this.handleClose);const t=document.querySelector(this.FORM_SELECTORS.errorCloseButton);t&&t.addEventListener("click",()=>this.resetModalClose())}resetModalClose(){this.formElement.reset(),this.toggleStep("step4",!1),this.toggleStep("step1",!0)}setupInlineValidation(){const e={address1:document.querySelector(this.FORM_SELECTORS.inputAddress1),address2:document.querySelector(this.FORM_SELECTORS.inputAddress2),city:document.querySelector(this.FORM_SELECTORS.inputCity),state:document.querySelector(this.FORM_SELECTORS.inputState),zipCode:document.querySelector(this.FORM_SELECTORS.inputZipCode)},t={address1:()=>this.addressValidation(e.address1.value,!0),address2:()=>this.addressValidation(e.address2.value,!1),city:()=>this.cityValidation(e.city.value),state:()=>this.stateValidation(e.state.value),zipCode:()=>this.zipValidation(e.zipCode.value)};Object.entries(e).forEach(([e,o])=>{if(!o)return;const n="state"===e?"change":"input";o.addEventListener(n,o=>{const n=o.target;this.validateField(n,t[e])})})}validateField(e,t){var o;const n=t(),i=e.nextElementSibling;if(n)if(e.classList.add("invalid-field"),null==i?void 0:i.classList.contains("error-msg"))i.textContent=n;else{const t=document.createElement("span");t.className="error-msg",t.textContent=n,null===(o=e.parentNode)||void 0===o||o.insertBefore(t,e.nextSibling)}else e.classList.remove("invalid-field"),(null==i?void 0:i.classList.contains("error-msg"))&&i.remove()}getFormFields(){const e=e=>{var t;return(null===(t=document.querySelector(e))||void 0===t?void 0:t.value)||""};return{zipCode:e(this.FORM_SELECTORS.inputZipCode),address1:e(this.FORM_SELECTORS.inputAddress1),address2:e(this.FORM_SELECTORS.inputAddress2),city:e(this.FORM_SELECTORS.inputCity),state:e(this.FORM_SELECTORS.inputState)}}addressValidation(e,t){const o=e.trim();return t&&!o?"Address Line 1 is required.":o&&!i.REGEX.noBracketAddress.test(o)?"Enter valid address.":""}zipValidation(e){return(0,n.zipCodeValidation)(e)}cityValidation(e){return(0,n.cityNameValidation)(e)}stateValidation(e){return(0,n.stateNameValidation)(e)}validateForm(){const e=this.getFormFields(),t=[{id:"dynamic-modal-address-1",error:this.addressValidation(e.address1,!0)},{id:"dynamic-modal-address-2",error:this.addressValidation(e.address2,!1)},{id:"dynamic-modal-zipcode",error:this.zipValidation(e.zipCode)},{id:"dynamic-modal-city",error:this.cityValidation(e.city)},{id:"dynamic-modal-state",error:this.stateValidation(e.state)}];let o=!0;return t.forEach(({id:e,error:t})=>{const n=document.getElementById(e);
3n&&t&&(this.showFieldError(n,t),o=!1)}),o}showFieldError(e,t){if(!e.parentNode)return;let o=e.parentNode.querySelector(".error-msg");o||(o=document.createElement("span"),o.className="error-msg",e.parentNode.insertBefore(o,e.nextSibling)),o.textContent=t,o.classList.remove("hidden"),e.classList.add("invalid-field")}handleNextBtnClick(){this.validateForm()&&((0,s.startLoader)(),this.handleNextBtnSubmit())}handleNextBtnSubmit(){const e=this.getFormFields(),{address1:t,address2:o,city:n,state:i,zipCode:r}=e,a=[t,o,n,i,r].join(" ");this.zipCodeValue=r,(0,l.getFranchiseDetails)(a).then(e=>{if(!e.length)return void this.handleNoResults();this.showStep("step5"),this.updateLocationDetails(e[0],".dynamic-step-5",e[0].locationWebsiteUrl);const t=document.querySelector(".dynamic-step-5 .happy-text span");t&&r&&((0,s.stopLoader)(),t.textContent=r)}).catch(e=>{console.error("Error fetching franchise details:",e),this.handleNoResults()})}handleNoResults(){const e=this.getFormFields().zipCode;e&&(this.handleNearbyLocationsFlow(e),(0,s.stopLoader)())}handleNearbyLocationsFlow(e){this.callNearbyLocations("50miles",50,e)}handleErrorScenario(e){var t;this.toggleStep("step2",!1),this.toggleStep("step4",!0);const o=null===(t=this.steps.step4)||void 0===t?void 0:t.querySelector(".modal-text");o&&(o.textContent=`We're sorry. We don't currently provide service to ${this.zipCodeValue}.`)}callNearbyLocations(e,t,o){new r.NearbyLocations(e,t).searchNearbyLocations(o).then(e=>this.displayNearbyLocations(e)).catch(()=>this.handleErrorScenario(o))}updateLocationDetails(e,t,o){if(!e)return;const n=document.querySelector(t);if(!n)return;const i=n.querySelector(".heading-container h3");i&&(i.textContent=e.doingBusinessAs);const s=n.querySelector(".phone-num-wrapper");var r;s&&(s.href=`tel:${null==(r=e.phoneNumber)?void 0:r.replace(/\D/g,"")}`,s.innerHTML=(e=>{const t=(e=>e?`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6)}`:"")(e);return`\n <svg aria-hidden="true" class="h-6 w-6">\n <use xlink:href="/_assets-global/images/hero-icon-sprite.svg#phone-outline-primary"></use>\n </svg>\n ${t}\n `})(e.phoneNumber));const l=n.querySelector(".view-web-link");l&&(l.href=o)}displayNearbyLocations(e){if(!(null==e?void 0:e.length))return this.handleErrorScenario(e);this.showStep("step5");const t=e[0];t&&(this.updateNotFoundUI(),this.updateLocationDetails(t,".dynamic-step-5",t.websiteUrl))}updateNotFoundUI(){var e,t;const o=this.steps.step5;if(!o)return;const n=o.querySelector(".loc-not-found-wrapper");null==n||n.classList.remove("hidden");const i=o.querySelector(".loc-not-found-wrapper p span");i&&this.zipCodeValue&&(i.textContent=this.zipCodeValue),null===(e=o.querySelector(".not-found-text"))||void 0===e||e.classList.remove("hidden"),null===(t=o.querySelector(".happy-text"))||void 0===t||t.classList.add("hidden")}clearValidationErrors(){const e=this.steps.step2;e&&(e.querySelectorAll(".error-msg").forEach(e=>e.remove()),e.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field")))}handleModalClose(){this.formElement.reset(),this.clearValidationErrors();const e=document.querySelector(this.FORM_SELECTORS.closeButton);e&&e.removeEventListener("click",this.handleClose)}showStep(e,t=!0){const o=this.steps[e];o&&(t?(Object.values(this.steps).forEach(e=>null==e?void 0:e.classList.add("hidden")),o.classList.remove("hidden")):o.classList.add("hidden"))}toggleStep(e,t){const o=this.steps[e];o&&(t?o.classList.remove("hidden"):o.classList.add("hidden"))}}}
3,"./src/js/opus2/find-us/FindUsModal.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/getStateFun */"./src/js/opus2/util/getStateFun.ts"),s=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ../util/nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),l=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),a=o(/*! ./FindUsAddressBumper */"./src/js/opus2/find-us/FindUsAddressBumper.ts"),d=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),c=o(/*! ../util/findusmodal-verbiage */"./src/js/opus2/util/findusmodal-verbiage.ts"),u=o(/*! ../header/useMyLocation */"./src/js/opus2/header/useMyLocation.ts");class m{static getInstance(){return m.instance||(m.instance=new m),m.instance}constructor(){var e;this.zipInput=document.getElementById("dynamic-local-search-modal"),this.submitBtn=document.querySelector(".dynamic-find-local-modal .dynamic-step-1 .form-cta .primary-btn"),this.step5=document.querySelector(".dynamic-step-5"),this.steps={step1:document.querySelector(".dynamic-step-1"),step2:document.querySelector(".dynamic-step-2"),step3:document.querySelector(".dynamic-step-3"),step4:document.querySelector(".dynamic-step-4"),step5:document.querySelector(".dynamic-step-5")},this.happyText=document.querySelector(".dynamic-step-5 .happy-text"),this.submitBtn&&this.submitBtn.addEventListener("click",()=>this.handleSubmit()),this.zipInput&&(null===(e=this.zipInput)||void 0===e||e.addEventListener("input",this.zipCodeError.bind(this)));const t=document.getElementById("dynamic-close-local-modal");null==t||t.addEventListener("click",()=>{document.querySelectorAll(".dynamic-step-2, .dynamic-step-3, .dynamic-step-4, .dynamic-step-5").forEach(e=>e.classList.add("hidden"));const e=document.querySelector(".dynamic-step-1");if(e){const t=document.getElementById("dynamic-step1-text1"),o=document.getElementById("dynamic-step1-text2");t&&(t.style.display="block"),o&&(o.style.display="none"),e.classList.remove("hidden"),this.zipInput&&(this.zipInput.value="")}});const o=document.querySelectorAll(".dynamic-find-local-modal .use-my-location-btn");o&&(null==o?void 0:o.length)>0&&(null==o||o.forEach(e=>{null==e||e.addEventListener("click",e=>{e.preventDefault(),(new u.UseMyLocationSearch).getCurrentLocation(e)})}))}zipCodeError(){var e;if(!this.zipInput)return;
3const t="ca"===(0,l.checkDomain)()?!d.REGEX.caSendZip.test(this.zipInput.value.trim()):!d.REGEX.sendZip.test(this.zipInput.value.trim()),o=document.querySelector(".dynamic-find-local-modal .error-msg");""!==(null===(e=this.zipInput)||void 0===e?void 0:e.value)&&t?(null==o||o.classList.remove("hidden"),!o.innerHTML.trim()&&(o.innerHTML="Invalid zip code format.")):null==o||o.classList.add("hidden")}callNearbyLocations(e,t,o){new r.NearbyLocations(e,t).searchNearbyLocations(o).then(this.displayNearbyLocations.bind(this)).catch(()=>this.handleErrorScenario(o))}fetchPhoneFromBrandData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;if(!t)return Promise.reject(new Error("Concept code is missing"));try{const e=yield(0,l.getBrandDetailsFromBrandJson)(t);return null==e?void 0:e.phone}catch(e){return console.error("Error fetching brand details:",e),Promise.reject(e instanceof Error?e:new Error(String(e)))}})}extractPhoneNumber(e){var t;let o;return Array.isArray(e.websiteTrackingPhone)&&(null===(t=e.websiteTrackingPhone)||void 0===t?void 0:t.length)>0?o=e.websiteTrackingPhone[0]:"string"==typeof e.websiteTracking&&(o=e.websiteTracking),null!=o?o:e.phoneNumber}displayNearbyLocations(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n;if(!e.length)return this.handleErrorScenario(e);Object.values(this.steps).forEach(e=>null==e?void 0:e.classList.add("hidden"));const i=e[0];if(i){const e=document.querySelector(".dynamic-step-5");null==e||e.classList.remove("hidden");const s=this.steps.step5.querySelector(".loc-not-found-wrapper");null==s||s.classList.remove("hidden");const r=this.steps.step5.querySelector(".loc-not-found-wrapper p span");let l;if(r&&this.zipInput&&(r.textContent=null===(t=this.zipInput)||void 0===t?void 0:t.value.trim()),null===(o=this.steps.step5.querySelector(".not-found-text"))||void 0===o||o.classList.remove("hidden"),null===(n=this.steps.step5.querySelector(".happy-text"))||void 0===n||n.classList.add("hidden"),this.steps.step5.querySelector(".heading-container h3").textContent=i.doingBusinessAs,this.steps.step5.querySelector(".view-web-link").setAttribute("href",i.websiteUrl),l=this.extractPhoneNumber(i),null!=l||(l=yield this.fetchPhoneFromBrandData()),l){const e=l.replace(/\D/g,""),t=`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6)}`;this.steps.step5.querySelector(".phone-num-wrapper").setAttribute("href",`tel:${e}`),this.steps.step5.querySelector(".phone-num-wrapper").innerHTML=`\n <svg aria-hidden="true" class="h-6 w-6">\n <use xlink:href="/_assets-global/images/hero-icon-sprite.svg#phone-outline-primary"></use>\n </svg>\n ${t}`}}})}handleSubmit(){var e,t;if(!this.zipInput)return;const o=null===(e=this.zipInput)||void 0===e?void 0:e.value.trim(),n=document.getElementById("dynamic-glb-find-local"),i=null===(t=null==n?void 0:n.getAttribute("data-service-id"))||void 0===t?void 0:t.trim();this.validateForm()&&((0,s.startLoader)(),this.getData(o,i))}getData(e,t){(t?(0,l.getFranchiseDetails)(e,!1,t):(0,l.getFranchiseDetails)(e,!1)).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i;const r=e;if(0===e.length)return void this.handleNoResults();if(!this.happyText)return;const l=document.querySelectorAll(".dynamic-step-1, .dynamic-step-2, .dynamic-step-3, .dynamic-step-4");null==l||l.forEach(e=>e.classList.add("hidden")),null===(t=this.step5)||void 0===t||t.classList.remove("hidden");const a=document.querySelector(".dynamic-step-5 .happy-text span");a&&this.zipInput&&((0,s.stopLoader)(),a.textContent=this.zipInput.value.trim(),null===(o=this.steps.step5.querySelector(".not-found-text"))||void 0===o||o.classList.add("hidden"),null===(n=this.steps.step5.querySelector(".loc-not-found-wrapper"))||void 0===n||n.classList.add("hidden"),null===(i=this.steps.step5.querySelector(".happy-text"))||void 0===i||i.classList.remove("hidden"));const d=document.querySelector(".dynamic-step-5 .heading-container h3"),c=document.querySelector(".dynamic-step-5 .phone-num-wrapper"),u=document.querySelector(".dynamic-step-5 .view-web-link");let h,p=r[0];if(h=this.extractPhoneNumber(p),null!=h||(h=yield this.fetchPhoneFromBrandData()),h){const e=h.replace(/\D/g,""),t=h?`(${h.slice(0,3)}) ${h.slice(3,6)}-${h.slice(6)}`:null;d&&(d.textContent=r[0].doingBusinessAs),c&&(c.href=`tel:${e}`,c.innerHTML=`\n <svg aria-hidden="true" class="h-6 w-6">\n <use xlink:href="/_assets-global/images/hero-icon-sprite.svg#phone-outline-primary"></use>\n </svg>\n ${t}\n `)}u&&(u.href=r[0].locationWebsiteUrl),m.getInstance().updateServiceHeading()})).catch(t=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n;(0,s.stopLoader)(),"function"==typeof(null==t?void 0:t.then)&&(t=yield t);let r=null===(n=null===(o=null==t?void 0:t.response)||void 0===o?void 0:o.data)||void 0===n?void 0:n.message;if(r||(r=null==t?void 0:t.message),r||(r=""),"full address is needed to narrow down results"===r.toLowerCase()){(new i.StateHandler).getStateFun();const t=document.querySelector(".dynamic-step-1"),o=document.querySelector(".dynamic-step-2");if(t&&t.classList.add("hidden"),o){o.classList.remove("hidden");const e=document.querySelector(".close-modal-btn");null==e||e.addEventListener("click",function(e){o.classList.add("hidden"),t.classList.remove("hidden")})}document.querySelector(".dynamic-step-2 #dynamic-modal-zipcode").value=encodeURIComponent(e);new a.FindUsAddressBumper}else this.handleErrorScenario(e)}))}handleNoResults(){var e;const t=null===(e=this.zipInput)||void 0===e?void 0:e.value.trim();t&&this.handleNearbyLocationsFlow(t),(0,s.stopLoader)()}handleNearbyLocationsFlow(e){let t,o;o="50miles",t=50,this.callNearbyLocations("50miles",50,e)}handleErrorScenario(e){const t=document.getElementById("dynamic-step1-text1"),o=document.getElementById("dynamic-step1-text2");t&&(t.style.display="none"),o&&(o.style.display="block")}validateForm(){const e=document.getElementById("dynamic-local-search-modal"),t=document.querySelector(".dynamic-find-local-modal .error-msg");
3if(!e||!t)return!1;const o=e.value.trim();return t.classList.add("hidden"),e.classList.remove("invalid-field"),e.required&&!o?(t.classList.remove("hidden"),e.classList.add("invalid-field"),e.focus(),!1):!!d.REGEX.sendZip.test(o)||(t.classList.remove("hidden"),e.classList.add("invalid-field"),e.focus(),!1)}updateServiceHeading(){const e=document.getElementById("dynamic-glb-find-local");if(!e)return;const t=document.querySelector("#dynamic-glb-find-local .dynamic-step-5 .happy-text"),o=t instanceof HTMLElement?t:null,n=document.querySelector("#dynamic-glb-find-local .dynamic-step-5 .loc-not-found-wrapper p"),i=n instanceof HTMLElement?n:null;(0,c.updateServiceHeadingUtil)({modal:e,happyText:o,notFoundText:i})}}document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".section-50-50"),t=localStorage.getItem("dbaName"),o=localStorage.getItem("weblocationId");null==e||e.forEach(e=>{if(!e)return;const n=!!e.closest(".hero-banner"),i=e.querySelector(".find-loc-link"),s=e.querySelector(".find-a-loc-wrapper, .accommodate-text"),r=i&&o&&t,l=r&&window.location.href.includes(t),a=r&&!window.location.href.includes(t);n||!l&&!a?i&&(i.addEventListener("click",function(){var e,t,o;const n=i.closest(".section-50-50"),s=null==n?void 0:n.querySelector(".find-a-loc-wrapper p span:first-child, .accommodate-text p span:first-child"),r=document.getElementById("dynamic-glb-find-local");let l;const a=null==n?void 0:n.querySelector('.accommodate-text input[type="hidden"], .find-a-loc-wrapper input[type="hidden"]');(null===(e=null==a?void 0:a.value)||void 0===e?void 0:e.trim())&&(l=a.value.trim()),s&&r&&(r.setAttribute("data-service-heading",null!==(o=null===(t=s.textContent)||void 0===t?void 0:t.trim())&&void 0!==o?o:"Electrical Services"),r.setAttribute("data-service-id",null!=l?l:"")),m.getInstance().updateServiceHeading()}),m.getInstance()):s instanceof HTMLElement&&(s.style.display="none")})})},"./src/js/opus2/find-us/index.ts"(e,t,o){"use strict";o(/*! ./FindUsModal */"./src/js/opus2/find-us/FindUsModal.ts")},"./src/js/opus2/footer/footer.ts"(e,t,o){"use strict";o.d(t,{Footer:()=>g});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),r=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),l=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),a=o(/*! ../util/addressOnLeadFlow */"./src/js/opus2/util/addressOnLeadFlow.ts"),d=o(/*! ../util/getDynamicMenu */"./src/js/opus2/util/getDynamicMenu.ts"),c=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),u=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),m=o(/*! ../util/phoneNumberReplacement */"./src/js/opus2/util/phoneNumberReplacement.ts"),h=o(/*! ../util/brandLoadingManager */"./src/js/opus2/util/brandLoadingManager.ts"),p=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),v=o(/*! ../nbly-brand/conditional_localization */"./src/js/opus2/nbly-brand/conditional_localization.ts");class g{constructor(e){const t=document.getElementById("dbaName");if(t&&localStorage.setItem("dbaName",null==t?void 0:t.value),e)this.getFooterData();else{const e=document.querySelector(".fb-des-para > .fb-tel");this.setMobileNumber(null==e?void 0:e.innerText)}const o=document.querySelectorAll(".dynamic-service-menu");if(o.length>0){let e=[];o.forEach(t=>{e.push({name:null==t?void 0:t.querySelector("a span").textContent.trim(),link:null==t?void 0:t.querySelector("a").href})}),this.setServices(e)}else{let e=(0,s.getFooterLink)();this.setServices(e)}this.setupFooter()}static init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;let t=!1;return localStorage.getItem("localPhoneNumber")||localStorage.getItem("franchiseWebLocationId")||(null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)?t=!0:(0,d.handleSocialIcon)(),new g(t)})}setupFooter(){this.initializeFooter()}initializeFooter(){return(0,n.__awaiter)(this,void 0,void 0,function*(){yield this.localizeLegalWrapper(),yield this.setYear()})}localizeLegalWrapper(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.localizeLegalFooter()})}setYear(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield(0,s.getWeblocationPathGroupWithSiteConfig)();try{if(e){const t=yield(0,l.getCachedAPIResponse)(e,r.apiCaching.SiteConfig,!1),{token_details:o}=t;(0,s.setLocalTagLineText)(t);try{let e=document.body.querySelectorAll("*");null==o||o.forEach(t=>{e.forEach(function(e){let o=t.key;if(e.innerHTML&&e.innerHTML.includes(`{${o}}`)){const n=new RegExp(`\\{${o}\\}`,"g");e.innerHTML=e.innerHTML.replace(n,t.value)}})})}catch(e){throw new Error(e)}}}catch(e){console.error("Error in fetching site config and setting footer Year",e)}
3})}getLocalSocialIcon(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!v.ConditionalLocalization.getInstance().init())return;const e=yield(0,s.getWeblocationPathGroupWithSiteConfig)();try{if(e){const t=yield(0,l.getCachedAPIResponse)(e,r.apiCaching.SiteConfig,!1);if(t)return t.social_links}}catch(e){return console.error("Error in fetching site config"),{}}})}getFooterData(){var e;if(v.ConditionalLocalization.getInstance().init())try{const t=localStorage.getItem("franchiseWebLocationId")||(null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value),o=`${i.apiConfig.FOOTER_BRAND_LINK}${t}`;(0,l.cachedAPIWrapper)(o).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){let t;this.appendSocialLinks(null==e?void 0:e.franchiseWebLocationLinks),this.changeFooterAddress(e),yield this.fetchCesUrl(),null==e||e.callTrackings.forEach(e=>{"WebsiteTracking"===e.callTrackingTypeDescription&&(t=e.callTrackingNumber)}),t||(t=null==e?void 0:e.mainPhoneNumber),this.setMobileNumber(t)})).catch(e=>{console.error("Error fetching FOOTER_BRAND_LINK:",e)})}catch(e){console.error("Error fetching FOOTER_BRAND_LINK:",e)}}formSocialLink(e){const t=[];return null==e||e.forEach(e=>{let o={};o.linkTypeDescription=e.label,o.description=e.hreflink,o.svg=e.iconlink,t.push(o)}),t}appendSocialLinks(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=document.querySelector(".fb-social-block"),o=yield this.getLocalSocialIcon(),n=Array.isArray(o)?o:[],i=null==n?void 0:n.filter(t=>!(null==e?void 0:e.some(e=>{var o;return t.label.toLowerCase()===(null===(o=e.linkTypeDescription)||void 0===o?void 0:o.toLowerCase())}))),s=this.formSocialLink(i);for(s&&s.length>0&&e.push(...s);null==t?void 0:t.firstChild;)t.removeChild(t.firstChild);const r=[];null==e||e.filter(e=>{var t,o;const n=null===(t=null==e?void 0:e.linkTypeDescription)||void 0===t?void 0:t.toLowerCase(),i=null==e?void 0:e.description,s=null==e?void 0:e.linkTypeDescription,l=null!==(o=null==e?void 0:e.svg)&&void 0!==o?o:`<use xlink:href="/_assets-global/images/social-icon-sprite.svg#${s.toLowerCase()}" />`;"yelp"!=n&&r.push(`<li class="fb-social-li">\n <a href="${i}" target="_blank" rel="noopener" class="fb-social-link" aria-label="${s}">\n <svg aria-hidden="true" class="social-icon">\n ${l}\n </svg>\n </a>\n </li>`)}),null==t||t.insertAdjacentHTML("beforeend",r.join("")),sessionStorage.setItem("socialIconsFooter",r.join("")),yield(0,d.handleSocialIcon)(t)})}changeFooterAddress(e){if(!v.ConditionalLocalization.getInstance().init())return;const{locationDoingBusinessAs:t,address:o,address2:n,state:i,country:s,city:r,zip:l,displayAddressSwitch:d,stateLicenseNumbers:c}=e;let u;u=(null==c?void 0:c.length)>1?this.getLicenseNumber(c):c&&c[0]?c[0]:"";const m=document.querySelector(".fb-des-block-para"),h=document.querySelectorAll(".local-address-footer");h&&h.forEach(e=>e.remove()),""!=u&&(u="#"===u[0]?u:"#"+u);let p="";r&&i&&l&&(p=d?`${o}${n?", "+n:""}, ${r}, ${i}, ${l}`:`${r}, ${i}, ${l}`,(0,a.showAddressForGoogle)(p));const g=`<div class="local-address-footer"> \n <p>${t}</p>\n ${d?`\n <address class="address-line">\n <span>${o}${n?", "+n:""} </span>\n <span>${r}, ${i}, ${l}</span>\n ${u?`<span>License: ${u}</span>`:""}\n </address>`:`\n <address class="address-line">\n <span>${r}, ${i}, ${l}</span>\n ${u?`<span>License: ${u}</span>`:""}\n </address>\n `}\n \n </div>`;m&&m.insertAdjacentHTML("beforeend",g)}setMobileNumber(e){if((0,m.shouldSkipPhoneNumberProcessing)())return null;const t=String(e).replace(/\D/g,"").match(/(\d{0,3})(\d{0,3})(\d{0,4})/),o=document.querySelector(".fb-des-para > .fb-tel");return t&&o&&(o.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`,o.href=`tel:${t[1]}${t[2]}${t[3]}`),o}setServices(e){const t=document.querySelector("#fblinkblock-services > .footer-submenu");for(;null==t?void 0:t.firstChild;)t.removeChild(t.firstChild);0==e.length&&document.getElementById("fblinkblock-services")&&(document.getElementById("fblinkblock-services").style.display="none");const o=e.map(e=>`<li class="submenu-li">\n <a href=${e.link} class="submenu-a">${e.name}</a>\n </li>`);null==t||t.insertAdjacentHTML("beforeend",o.join(""))}getLicenseNumber(e){if(Array.isArray(e))return e.map(e=>e.includes("#")?e:`#${e}`).join(", ")}fetchCesUrl(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if(!v.ConditionalLocalization.getInstance().init())return;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,s.getBrandDetailsFromBrandJson)(t);if(null==o?void 0:o.displayCESurl){const e=localStorage.getItem("franchiseWebLocationId"),t=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;try{const e=yield(0,l.cachedAPIWrapper)(t,r.apiCaching.FullAttributeResponse);if("loading"===document.readyState)document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelector(".footer-block .footer-url-link"),o=document.querySelector(".footer-block .fb-des-block-para"),n=document.querySelector(".footer-block .local-address-footer");t&&o&&n&&e.locationWebsiteUrl&&(t.href=e.locationWebsiteUrl,t.textContent=e.locationWebsiteUrl.replace(/^https?:\/\/(www\.)?/,""),o.insertBefore(t,n.nextSibling))});else{const t=document.querySelector(".footer-block .footer-url-link"),o=document.querySelector(".footer-block .fb-des-block-para"),n=document.querySelector(".footer-block .local-address-footer");t&&o&&n&&e.locationWebsiteUrl&&(t.href=e.locationWebsiteUrl,t.textContent=e.locationWebsiteUrl.replace(/^https?:\/\/(www\.)?/,""),o.insertBefore(t,n.nextSibling))}}catch(e){console.error("Error in fecthing Full Attribute Details:",e)}}})}shouldSkipLocalization(e,t){return!t||!e||window.location.href.includes(e)}loadBrandDataFallback(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if(yield(0,h.waitForBrandDataBeforeFooterConfig)())return;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;(yield(0,s.getBrandDetailsFromBrandJson)(t))&&(0,p.isTestEnvironment)()&&console.log("Brands.json loaded successfully as a fallback on 2nd attempt")})}fetchFooterConfig(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e={method:"GET",url:yield(0,s.getWeblocationPathGroupWithFooterConfig)()};try{const t=yield(0,c.default)(e);(0,u.replaceLegalFooter)(t)}catch(e){this.logFooterConfigError(e)}})}logFooterConfigError(e){(0,p.isTestEnvironment)()&&(console.error("Footer config API request failed:",e),404===(null==e?void 0:e.status)&&console.log("Local footer config not found"))}localizeLegalFooter(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=localStorage.getItem("dbaName"),t=localStorage.getItem("weblocationId");if(this.shouldSkipLocalization(e,t))return;
3yield this.loadBrandDataFallback(),yield this.fetchFooterConfig()}catch(e){console.error("Error in localizeLegalFooter:",e)}})}}g.init()},"./src/js/opus2/header/GetLocateLocation.ts"(e,t,o){"use strict";o.r(t),o.d(t,{GetLocateLocation:()=>m});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/getStateFun */"./src/js/opus2/util/getStateFun.ts"),s=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),l=o(/*! ../util/nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../hms/hms-step1 */"./src/js/opus2/hms/hms-step1.ts"),c=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),u=o(/*! ../util/common-neaybyLocations */"./src/js/opus2/util/common-neaybyLocations.ts");class m{constructor(){}static getInstance(){return m.instance||(m.instance=new m),m.instance}getElement(e){return document.getElementById(e)}getInputValue(e){var t;const o=this.getElement(e);return null!==(t=null==o?void 0:o.value)&&void 0!==t?t:""}querySelector(e){return document.querySelector(e)}storeSessionData(e,t){sessionStorage.setItem(e,t)}storeLocalData(e,t){localStorage.setItem(e,t)}storeFranchiseData(e,t){this.storeSessionData("alternateConcept",e.alternateConcept),this.storeLocalData("franchiseWebLocationId",e.franchiseWebLocationId),this.storeSessionData("countryCode",(0,r.getCountryCode)()),this.storeLocalData("doingBusinessAs",e.doingBusinessAs),this.storeSessionData("franchiseeName",e.franchiseeName),this.storeSessionData("sAddressParam",t)}handleRedirection(e){const t=new URL(e).pathname,o=new URL(window.location.href).host;window.location.replace(`https://${o}${t}`)}searchNearbyLocations(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){return new l.NearbyLocations(e,t).searchNearbyLocations(o)})}handleNearbyLocationResults(e,t,o){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t,o,n="miles"){var i;const s=this.getInputValue("conceptId");if((null==e?void 0:e.length)>1)this.openNearByLocationsModal(e,t,o,n);else if(1===(null==e?void 0:e.length))if("25"===s){d.ScheduleService.getInstance().checkPOSSystemWithZip(t)}else(null===(i=e[0])||void 0===i?void 0:i.websiteUrl)?(t&&this.storeSessionData("sAddressParam",t),this.handleRedirection(e[0].websiteUrl)):this.handleBrandSpecificError();else this.handleBrandSpecificError()})}handleNearbyLocationsFlow(e){const t=this.getInputValue("conceptCode");(0,a.getBrandDetailsFromBrandJson)(t).then(t=>{const o=null==t?void 0:t.enable_50mile_areameasure_findChangeMyLocation,n=null==t?void 0:t.enable_50mile_areameasure;if(o)(null==t?void 0:t.use_miles_endPoint)?this.handleEnable50MilesFindMyLocationNewEndPoint(e,t):this.handleEnable50MilesFindMyLocation(e,t);else if(n){const o=(null==t?void 0:t.area_measure_values)?this.findUnits(t.area_measure_values):"miles",n=(null==t?void 0:t.nearest_franchiselimit)?Number(t.nearest_franchiselimit):50;this.callNearbyLocations(o,n,e)}else this.handleBrandSpecificError()}).catch(t=>{console.log("Unable to read brands.json. Using default range 50 miles radius..."),this.callNearbyLocations("miles",50,e)})}callNearbyLocations(e,t,o){this.searchNearbyLocations(e,t,o).then(n=>{const i={containingData:Boolean(n),franchiseLimit:t,units:e,resultData:n,searchQuery:o};sessionStorage.setItem("nearbyLocations",JSON.stringify(i)),this.openLocationsPage()}).catch(()=>{console.log("Error searching nearby locations"),this.handleBrandSpecificError()})}openLocationsPage(){window.location.replace(window.location.origin+"/locations/")}handleErrorScenario(){const e=this.querySelector("#glb-find-local");null==e||e.classList.add("modal");const t=this.getElement("step1-text1"),o=this.getElement("step1-text2");t&&(t.style.display="none"),o&&(o.style.display="block")}findUnits(e){return e.includes("measure_km")?"km":"miles"}getAddressParam(e){return"desk"===e?this.processDesktopAddress():"mob"===e?this.processMobileAddress():""}processDesktopAddress(){var e;const t=this.getElement("local-search-modal"),o=null===(e=null==t?void 0:t.value)||void 0===e?void 0:e.trim();if(o&&this.storeSessionData("temp_zipcode",o),!o)return"";const n=location.hostname.toLowerCase(),i=-1===n.indexOf("-ca-")&&-1===n.indexOf(".ca")&&-1===n.indexOf("-ca.")?"us":"ca",s=(0,a.determineCountryZip)(o);return"ca"===i&&"ca"===s?-1===o.indexOf(" ")?o.replace(/^(.{3})(.*)$/,"$1 $2"):o:o.length>0?o:""}processMobileAddress(){const e=this.getValue("inputLocal-zip");return e.length>0?e:""}extractServiceId(){const e=this.querySelector(".find-local-modal");if(!e)return;const t=e.querySelectorAll('input[type="radio"].glass-type-radio');if(0!==t.length)for(const e of t){const t=e;if(null==t?void 0:t.checked){const e=t.closest(".glass-type"),o=null==e?void 0:e.querySelector(".modal-lead-service-id");if((null==o?void 0:o.classList.contains("modal-lead-service-id"))&&o.value){const e=o.value;return this.storeSessionData("serviceIdValue",e),e}}}}processFranchiseDetailsResponse(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n;if(0===e.length)return;(0,s.stopLoader)();const i=e[0],r=null!==(o=i.locationWebsiteUrl)&&void 0!==o?o:"";this.storeFranchiseData(i,t);"25"===this.getInputValue("conceptId")&&this.storeLocalData("hms_redirect_local","true"),r&&(0,a.handleCrossDomainLink)(r);const l=this.getInputValue("conceptCode"),d=yield(0,a.getBrandDetailsFromBrandJson)(l);null!==(n=null==d?void 0:d.include_crownpeakURL)&&void 0!==n&&n||(null==d?void 0:d.include_statename)?this.redirectToWebLocation():r?window.location.href=r:this.redirectToWebLocation()})}handleLocationError(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,s,r;if("function"==typeof(null==e?void 0:e.then)&&(e=yield e),"full address is needed to narrow down results"===(null!==(r=null!==(s=null===(n=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===n?void 0:n.message)&&void 0!==s?s:null==e?void 0:e.message)&&void 0!==r?r:"").toLowerCase()){(new i.StateHandler).getStateFun();const e=this.querySelector(".step-1"),o=this.querySelector(".step-2");if(null==e||e.classList.add("hidden"),o){o.classList.remove("hidden"),o.classList.add("block");const t=this.querySelector(".close-modal-btn");null==t||t.addEventListener("click",()=>{o.classList.add("hidden"),null==e||e.classList.remove("hidden")})}const n=this.querySelector(".step-2 #modal-zipcode");n&&(n.value=t)}})}locateLocation(e){const t=this.getAddressParam(e),o=this.extractServiceId();(0,s.startLoader)(),(0,a.getFranchiseDetails)(t,!1,o).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){e.length>0?yield this.processFranchiseDetailsResponse(e,t):(this.handleNearbyLocationsFlow(t),(0,s.stopLoader)())})).catch(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){(0,s.stopLoader)(),yield this.handleLocationError(e,t)}))}getValue(e){return this.getInputValue(e)}
3redirectToWebLocation(){const e=(0,a.weblocationDetailsById)();(null==e?void 0:e.weblocation_url)&&window.location.replace(e.weblocation_url)}fetchNearbyLocations(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){let o=c.apiConfig.WebLocationsFranchiseGroupAPI;const n=localStorage.getItem("zipcode");return n?("km"===e&&(t=this.milesToKilometers(t)),(0,u.fetchNearbyLocationData)(o,n,t,"#glb-find-local")):null})}handleEnable50MilesFindMyLocationNewEndPoint(e,t){var o,i,s;const r=null!==(i=null===(o=null==t?void 0:t.area_measure_values_findChangeMyLocation)||void 0===o?void 0:o.includes("miles"))&&void 0!==i&&i?"miles":"km";let l=null!==(s=null==t?void 0:t.nearest_franchiselimit_findChangeMyLocation)&&void 0!==s?s:50;this.fetchNearbyLocations(r,l,t).then(o=>(0,n.__awaiter)(this,void 0,void 0,function*(){(null==o?void 0:o.length)>0?yield this.handleNearbyLocationResults(o,e,t,r):this.handleBrandSpecificError()})).catch(e=>{console.error("Error fetching nearby locations:",e),this.handleBrandSpecificError()})}handleEnable50MilesFindMyLocation(e,t){var o;const i="miles",s=null!==(o=null==t?void 0:t.nearest_franchiselimit_findChangeMyLocation)&&void 0!==o?o:50;this.searchNearbyLocations(i,s,e).then(o=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield this.handleNearbyLocationResults(o,e,t,i)})).catch(e=>{console.log("Error searching nearby locations",e),this.handleBrandSpecificError()})}milesToKilometers(e){return Math.round(1.60934*e)}handleBrandSpecificError(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value,o=sessionStorage.getItem("from-hms-nearby-location");if("25"===t&&"true"===o){d.ScheduleService.getInstance().handleErrorModal(),sessionStorage.setItem("from-hms-nearby-location","false")}else this.handleErrorScenario()})}openNearByLocationsModal(e,t,o,i="miles"){var r,l;(0,s.stopLoader)();if(document.getElementById("findnearby-user-zip-code")){const s=null==e?void 0:e.length,d=document.querySelector(".results-text");d&&(d.textContent=` ${s} Results for ${t}`);const c=document.querySelector(".user-zip-result-list");c.innerHTML="";const u=null==e?void 0:e.slice().sort((e,t)=>e.distance-t.distance);null==u||u.forEach(e=>{var t;const n=document.createElement("li");n.className="user-zip-result-item",i.includes("mi")&&(i="mi.",e.distance=.621371*e.distance);const s=Math.round(e.distance)+" "+i,r=(null===(t=null==e?void 0:e.websiteTrackingPhone)||void 0===t?void 0:t.length)>0?e.websiteTrackingPhone[0]:e.phoneNumber;n.innerHTML=`\n <div class="locaion-info">\n <div class="locaion-time">\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use>\n </svg>\n <span class="location-text">${s}</span>\n </div>\n <div class="locaion-name">\n <p class="location-main">${null==e?void 0:e.doingBusinessAs}</p>\n <a class="location-call" href="tel:${r}">(${null==r?void 0:r.slice(0,3)}) ${null==r?void 0:r.slice(3,6)}-${null==r?void 0:r.slice(6)}</a>\n <p class="location-zip-code hidden">${null==e?void 0:e.zipCode}</p>\n <input type="hidden" class="location-weblocationid" value="${null==e?void 0:e.franchiseWebLocationId}" />\n <input type="hidden" class="location-franchiseid" value="${null==e?void 0:e.franchiseId}" />\n <input type="hidden" class="location-weblocationmarketingid" value="${null==e?void 0:e.franchiseWebLocationMarketingId}" />\n </div>\n </div>\n ${(null==e?void 0:e.websiteUrl)?`<div class="locaion-btn">\n <a href=${null==e?void 0:e.websiteUrl} class="primary-link">${null==o?void 0:o.websitelink_findChangeMyLocation}</a>\n </div>`:""}`,null==c||c.appendChild(n)});const m=document.getElementById("close-local-modal");m&&m.click(),null===(r=document.querySelector(".findnearby-modal"))||void 0===r||r.click();if("25"===(null===(l=document.getElementById("conceptId"))||void 0===l?void 0:l.value)){document.querySelectorAll(".user-zip-result-item >
3 .locaion-btn a").forEach(e=>{e.addEventListener("click",e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s,r,l,d,c,u,m,h,p,v;e.preventDefault();const g=e.currentTarget.closest(".user-zip-result-item"),f=null!==(n=null===(o=null===(t=null==g?void 0:g.querySelector(".location-weblocationid"))||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim())&&void 0!==n?n:"",y=null!==(r=null===(s=null===(i=null==g?void 0:g.querySelector(".location-franchiseid"))||void 0===i?void 0:i.value)||void 0===s?void 0:s.trim())&&void 0!==r?r:"",b=null!==(c=null===(d=null===(l=null==g?void 0:g.querySelector(".location-weblocationmarketingid"))||void 0===l?void 0:l.value)||void 0===d?void 0:d.trim())&&void 0!==c?c:"",I=null!==(h=null===(m=null===(u=null==g?void 0:g.querySelector(".location-zip-code"))||void 0===u?void 0:u.textContent)||void 0===m?void 0:m.trim())&&void 0!==h?h:"",S=/\b(?:\d{5}(?:-\d{4})?|[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d)\b/.exec(I);if(S){const t=S[0];sessionStorage.setItem("sAddressParam",t);const o=document.getElementById("findnearby-user-zip-code");(null==o?void 0:o.classList.contains("hidden"))||null===(p=document.querySelector(".findnearby-modal"))||void 0===p||p.click(),(0,a.isISNFlow)({franchiseWebLocationId:f,franchiseId:y,franchiseWebLocationMarketingId:b},t,null===(v=e.currentTarget)||void 0===v?void 0:v.href)}else console.log("ZIP code not found in location text.")}))})}}}findMyChangeLocationRedirectAndLocalise(e){(0,s.startLoader)(),(0,a.getFranchiseDetails)(e,!1).then(t=>{var o;const n=t;if(n.length>0){(0,s.stopLoader)();const t=null!==(o=n[0].locationWebsiteUrl)&&void 0!==o?o:"";sessionStorage.setItem("alternateConcept",n[0].alternateConcept),localStorage.setItem("franchiseWebLocationId",n[0].franchiseWebLocationId);let i=(0,r.getCountryCode)();sessionStorage.setItem("countryCode",i),localStorage.setItem("doingBusinessAs",n[0].doingBusinessAs),sessionStorage.setItem("franchiseeName",n[0].franchiseeName),sessionStorage.setItem("sAddressParam",e);const l=new URL(t).pathname,a=new URL(window.location.href).host;window.location.replace(`https://${a}${l}`)}else(0,s.stopLoader)(),this.handleBrandSpecificError()}).catch(e=>{(0,s.stopLoader)(),this.handleBrandSpecificError()})}getNearbylocation(e,t){(null==t?void 0:t.use_miles_endPoint)?(localStorage.setItem("zipcode",e),this.handleEnable50MilesFindMyLocationNewEndPoint(e,t)):this.handleEnable50MilesFindMyLocation(e,t)}}},"./src/js/opus2/header/SetLocalHeader.ts"(e,t,o){"use strict";o.d(t,{SetLocalHeader:()=>y});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../opus2/footer/footer */"./src/js/opus2/footer/footer.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),l=o(/*! flowbite */"./node_modules/flowbite/lib/esm/index.js"),a=o(/*! ../util/replaceLocalLogoLink */"./src/js/opus2/util/replaceLocalLogoLink.ts"),d=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),c=o(/*! ../location-search-map/reportScreenSize */"./src/js/opus2/location-search-map/reportScreenSize.ts"),u=o(/*! ../location-search-map/models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts"),m=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),h=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),p=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),v=o(/*! ../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),g=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts"),f=o(/*! ../util/siteConfig */"./src/js/opus2/util/siteConfig.ts");class y{constructor(){this.isApp=!1,this.screenType=(0,c.reportScreenSize)();const e=document.getElementById("dbaName");this.modalOptions(),e&&(localStorage.setItem("dbaName",null==e?void 0:e.value),(0,g.localizationTagUpadation)());const t=document.getElementById("weblocationId");if(t&&localStorage.setItem("weblocationId",null==t?void 0:t.value),localStorage.getItem("weblocationId")){const e=document.createElement("input");e.type="hidden",e.value=localStorage.getItem("dbaName"),e.id="full_dbaName";const t=document.createElement("input");t.type="hidden",t.value=localStorage.getItem("weblocationId"),t.id="local_weblocationId",document.body.appendChild(e),document.body.appendChild(t)}}initAsync(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{this.isApp=yield(0,d.checkOSFlowPathAndReturnBoolean)()}catch(e){console.log("Error occurred in checkOSFlowPathAndReturnBoolean function: "+e)}this.setHeader(),(0,d.modifyAllApplyLocalHref)()})}modalOptions(){const e=document.getElementById("glb-find-local");return new l.Modal(e,{placement:"center",backdrop:"static",backdropClasses:"bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40",closable:!0,onHide:()=>{},onShow:()=>{},onToggle:()=>{}})}modalToggle(){const e=document.querySelector(".find-local");null==e||e.addEventListener("click",e=>{e.preventDefault(),this.modalOptions().show()});const t=document.getElementById("close-local-modal");null==t||t.addEventListener("click",()=>{this.modalOptions().hide(),setTimeout(()=>{var e;return null===(e=document.querySelector("body >
3 div[modal-backdrop]"))||void 0===e?void 0:e.remove()},0)})}setMobileLocalHeader(){const e=document.querySelector(".find-local-mobile"),t=localStorage.getItem("dbaName");if(localStorage.getItem("franchiseWebLocationId")&&t){const t=`\n <svg aria-hidden="true" class="icon"> <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use></svg>\n <div>\n <span class="local-address">${localStorage.getItem("doingBusinessAs")}</span> Change location\n </div>\n `;e&&(e.innerHTML=t),this.setHamburgerMenuDba(t),this.setHamburgerSubMenuInnerDba(t)}}setHeader(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;const l=document.querySelector(".find-local-mobile"),c=localStorage.getItem("dbaName"),u=document.querySelector(".header-wrapper .call-cta")||document.querySelector(".header-wrapper .form-call-cta"),h=localStorage.getItem("localPhoneNumber"),p=localStorage.getItem("doingBusinessAs");if(this.setSubtext(),this.setMobilePhoneNumber(),this.handleOSCTAVisibility(),p)(0,d.updateHeaderContent)(p);else if(!c){const e=!0;this.customizeBrandHeader(e)}if(u&&h){u.href=`tel:${h}`;const t=/(\d{0,3})(\d{0,3})(\d{0,4})/,o=null===(e=String(h))||void 0===e?void 0:e.replace(/\D/g,"").match(t);u.innerHTML=`(${o[1]}) ${o[2]}-${o[3]}`,u.setAttribute("data-title",`(${o[1]}) ${o[2]}-${o[3]}`)}if(localStorage.getItem("franchiseWebLocationId")&&!this.isApp&&c&&!window.location.href.toLowerCase().includes(c.toLowerCase())){this.modalToggle();const e=(0,g.setDBAandLocationPin)();l&&e&&(l.innerHTML=e),this.setHamburgerMenuDba(e),this.setHamburgerSubMenuInnerDba(e);const t=document.querySelector(".mobile-menu-logo .brand-logo-mobile");t&&(0,a.replaceLocalLogoLink)(t);const o=document.querySelector(".sidenav-logo-cta .sidenav-brand-logo");o&&(0,a.replaceLocalLogoLink)(o);const n=document.querySelector(".brand-footer .fb-des-link");n&&(0,a.replaceLocalLogoLink)(n)}else{const e=null!==(o=null===(t=document.getElementById("weblocationId"))||void 0===t?void 0:t.value)&&void 0!==o?o:localStorage.getItem("franchiseWebLocationId");if(e&&"string"==typeof e&&!this.isApp){const t=`${s.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;(0,m.cachedAPIWrapper)(t).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t;let o;null==e||e.callTrackings.forEach(e=>{"WebsiteTracking"===e.callTrackingTypeDescription&&(o=e.callTrackingNumber)}),o||(o=null==e?void 0:e.mainPhoneNumber),localStorage.setItem("franchiseWebLocationId",e.franchiseWebLocationId),localStorage.setItem("doingBusinessAs",e.locationDoingBusinessAs),localStorage.setItem("localPhoneNumber",o);let n=(0,r.getCountryCode)();sessionStorage.setItem("countryCode",n);const s=sessionStorage.getItem("sAddressParam");(0,v.DisclaimerServiceIdentifier)(s);const l=document.querySelector(".find-local-mobile"),a=document.querySelector(".header-wrapper .call-cta")||document.querySelector(".header-wrapper .form-call-cta"),c=localStorage.getItem("localPhoneNumber"),u=document.getElementById("full_dbaName");if(this.setMobilePhoneNumber(),a&&c){a.href=`tel:${c}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,o=null===(t=String(c))||void 0===t?void 0:t.replace(/\D/g,"").match(e);a.innerHTML=`(${o[1]}) ${o[2]}-${o[3]}`,a.setAttribute("data-title",`(${o[1]}) ${o[2]}-${o[3]}`)}if(u){const t=null==e?void 0:e.locationDoingBusinessAs;(0,d.updateHeaderContent)(t);const o=!1;this.customizeBrandHeader(o),this.modalToggle()}if(null==e?void 0:e.locationDoingBusinessAs){const e=(0,g.setDBAandLocationPin)();l&&(l.innerHTML=e),this.setHamburgerMenuDba(e),this.setHamburgerSubMenuInnerDba(e)}const m=yield i.Footer.init();null==m||m.appendSocialLinks(null==e?void 0:e.franchiseWebLocationLinks),null==m||m.changeFooterAddress(e),null==m||m.setMobileNumber(o),this.handleOSCTAVisibility()})).catch(e=>{console.error("Error initializing footer:",e)})}}})}setSubtext(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=document.querySelector(".enable-disable-subtext-header"),o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,d.getBrandDetailsFromBrandJson)(o);if(!t)return void((0,h.isTestEnvironment)()&&console.log("Subtext class not authored from CP, please add the required class for subtext"));this.checkLocalization()?yield this.handleLocalizedSubtext(t,n):this.handleNationalSubtext(t,n)})}checkLocalization(){const e=localStorage.getItem("dbaName");return!(!localStorage.getItem("franchiseWebLocationId")||!e)}handleLocalizedSubtext(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=yield(0,d.getWeblocationPathGroupWithSiteConfig)();if(o)try{const n=yield(0,m.getCachedAPIResponse)(o,p.apiCaching.SiteConfig,!1);n&&(n.disable_SubText_Local?e.classList.add("hidden"):this.updateSubtext(e,t))}catch(e){console.error("Error in fetching site config")}})}handleNationalSubtext(e,t){(null==t?void 0:t.disable_SubText_National)?e.classList.add("hidden"):this.updateSubtext(e,t)}updateSubtext(e,t){var o;e.classList.remove("hidden"),e.innerHTML=null!==(o=null==t?void 0:t.subText_value)&&void 0!==o?o:""}handleOSCTAVisibility(){const e=localStorage.getItem("siteConfigHideOSCTA"),t=document.querySelectorAll(".header-cta-container>a.primary-btn, .mobile-menu-logo>
3a.primary-btn.replace-with-click-to-lead-cta.cta-header-component-lead, .header-cta-mobile a.primary-btn.replace-with-click-to-lead-cta.cta-header-component-lead"),o=document.querySelectorAll(".header-wrapper .header-cta-wrap, .header-wrapper .form-call-cta"),n=document.querySelectorAll(".mob-call-cta"),i=document.querySelectorAll(".fb-des-para"),s=document.querySelector(".sticky-footer.footer-fixed"),r=document.querySelectorAll(".slide-block .sidenav-cta"),l=document.querySelector(".brand-header-mob > .header-cta-mobile");(null==t?void 0:t.length)>0&&t.forEach(t=>{t.style.display="true"===e?"none":"flex"}),(null==o?void 0:o.length)>0&&o.forEach(t=>{t.style.display="true"===e?"none":"flex"}),(null==n?void 0:n.length)>0&&n.forEach(t=>{t.style.display="true"===e?"none":"flex"}),(null==i?void 0:i.length)>0&&i.forEach(t=>{t.style.display="true"===e?"none":"flex"}),s&&(s.style.display="true"===e?"none":"block"),(null==r?void 0:r.length)>0&&r.forEach(t=>{t.style.display="true"===e?"none":"flex"}),l&&("true"===e?l.style.display="none":this.screenType!==u.ScreenType.Desktop?l.style.display="flex":l.style.display="none")}setMobilePhoneNumber(){const e=localStorage.getItem("localPhoneNumber"),t=document.querySelectorAll(".mob-call-cta");t&&e&&t.forEach(t=>{t.href=`tel:${e}`})}customizeBrandHeader(e){const t=document.querySelector(".brand-header"),o=null==t?void 0:t.querySelector(".brand-logo-wrapper");o&&(o.style.display=e&&this.screenType===u.ScreenType.Desktop?"flex":"none");const n=null==t?void 0:t.querySelector(".find-local");n&&(this.screenType===u.ScreenType.Desktop?n.style.display=e?"flex":"none":n.style.display="flex")}setHamburgerMenuDba(e){if(this.screenType!==u.ScreenType.Desktop){const t=document.querySelector(".brand-header .find-local");return t&&(t.innerHTML=e),t}}setHamburgerSubMenuInnerDba(e){if(this.screenType!==u.ScreenType.Desktop){const t=document.querySelectorAll(".main-nav-warpper .find-local");t&&(null==t||t.forEach(t=>{t.innerHTML=e}))}}}document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){yield(0,f.getMessagesData)();const e=new y;yield e.initAsync()}))},"./src/js/opus2/header/dynamicInjectMenu.ts"(e,t,o){"use strict";o.d(t,{default:()=>I});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../global */"./src/js/global/index.ts"),s=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),r=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),l=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),a=o(/*! ../location-search-map/models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts"),d=o(/*! ../location-search-map/reportScreenSize */"./src/js/opus2/location-search-map/reportScreenSize.ts"),c=o(/*! ../util/headerUpdate */"./src/js/opus2/util/headerUpdate.ts"),u=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),m=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),h=o(/*! ../util/brandLoadingManager */"./src/js/opus2/util/brandLoadingManager.ts"),p=o(/*! ./SetLocalHeader */"./src/js/opus2/header/SetLocalHeader.ts"),v=o(/*! ./serviceLinks */"./src/js/opus2/header/serviceLinks.ts"),g=o(/*! ./meet-the-team-helper */"./src/js/opus2/header/meet-the-team-helper.ts"),f=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),y=o(/*! ../util/coupons-event-handling */"./src/js/opus2/util/coupons-event-handling.ts"),b=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts");class I{static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return I.instance||(I.instance=new I,yield I.instance.initialize()),I.instance})}static getInstance(){return I.instance||(I.instance=new I),I.instance}constructor(){this.initialized=!1}initialize(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n;if(this.initialized)return;const i=localStorage.getItem("dbaName");let s=!1;localStorage.getItem("weblocationId")&&i&&!window.location.href.includes(i)&&(yield this.getMenu(),s=!0),s||(yield this.getFooterMenu(i));(null!==(n=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:null===(o=document.getElementById("local_weblocationId"))||void 0===o?void 0:o.value)&&void 0!==n?n:localStorage.getItem("franchiseWebLocationId"))&&(yield this.hideOurTeamsMenu(),yield this.hideOffersMenu()),yield this.fetchPhotoGalleryData(),this.initialized=!0})}hideOurTeamsMenu(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{sessionStorage.removeItem("ourTeamObject");const e=localStorage.getItem("franchiseWebLocationId"),t=document.getElementById("weblocationId"),o=document.getElementById("local_weblocationId");let n;n=(null==t?void 0:t.value)?t.value:(null==o?void 0:o.value)?o.value:e;const i=l.apiConfig.ourTeam+n,s=yield(0,r.cachedAPIWrapper)(i);s&&(sessionStorage.setItem("ourTeamObject",JSON.stringify(s)),(0,g.isValidTeamJson)(s)?this.hideTeamAndPhotoMenu("team",!0):this.hideTeamAndPhotoMenu("team",!1))}catch(e){console.log("Error in rendering our teams section.",e),this.hideTeamAndPhotoMenu("team",!1)}})}hideOffersMenu(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,m.getBrandDetailsFromBrandJson)(o),i=document.getElementById("specialoffer_menu");if((null==n?void 0:n.display_special_offers_from_CES)&&i){const e=yield(0,y.getOfferTeaserPath)();try{if(e){let o=yield(0,r.getCachedAPIResponse)(e,f.apiCaching.OfferTeaser,!1);(null===(t=null==o?void 0:o.SpecialOfferMarkup)||void 0===t?void 0:t.trim())?this.hideTeamAndPhotoMenu("offer",!0):this.hideTeamAndPhotoMenu("offer",!1)}else this.hideTeamAndPhotoMenu("offer",!1)}catch(e){this.hideTeamAndPhotoMenu("offer",!1)}}})}hideTeamAndPhotoMenu(e,t=!1){let o;switch(e){case"photo":o=document.getElementById("photogallery_menu"),o&&n(o,t);break;case"team":o=document.getElementById("meettheteam_menu"),o&&n(o,t);break;case"offer":o=document.getElementById("specialoffer_menu"),o&&n(o,t)}function n(t,o=!1){const n=document.querySelector(".main-nav-warpper");if(n){let i=["menu-block","subMenu-li","nav-link-item"];try{for(;t!==n;){const e=i.some(e=>t.classList.contains(e));if(e&&!o){t.classList.add("hidden");break}if(e&&o){t.classList.remove("hidden");break}if(!t.parentNode)break;t=t.parentNode}}catch(t){console.log(`Error -${t}- in handling menu hide function for ${e} menu`)}}else console.log("Error parent menu class name has been modified from the original 'main-nav-warpper'. Exiting hiding")}}fetchPhotoGalleryData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n;const i=null!==(o=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("franchiseWebLocationId"))&&void 0!==o?o:0;let s=localStorage.getItem(`galleryPhotos-${i}`);if(s)s=JSON.parse(s);else{const e=(0,b.conceptIdForAllBrands)();if(!e)return;const t=0,o=`${l.apiConfig.PhotosAPI}/${i}/${e}/${t}?skip=100`;try{const e=yield(0,r.cachedAPIWrapper)(o);s=null!==(n=null==e?void 0:e.photos)&&void 0!==n?n:[],localStorage.setItem(`galleryPhotos-${i}`,JSON.stringify(s))}catch(e){console.error("Error fetching photo gallery data:",e)}}s&&s.length<6?this.hideTeamAndPhotoMenu("photo",!1):this.hideTeamAndPhotoMenu("photo",!0)})}getFooterMenu(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;if(null!==(t=localStorage.getItem("dbaName"))&&void 0!==t?t:e){if(!(yield(0,h.waitForBrandDataBeforeFooterConfig)())){console.warn("Brands.json not loaded, making another brands.json call soon");const e=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value;(yield(0,m.getBrandDetailsFromBrandJson)(e))&&console.log("Brands.json loaded successfully as a fallback on 2nd attempt")}try{const e={method:"GET",url:yield(0,m.getWeblocationPathGroupWithFooterConfig)()};try{const t=yield(0,s.default)(e);this.insertDataIntoFooterMenu(t),(0,u.replaceNeighborlyFooter)(t),(0,u.replaceLegalFooter)(t)}catch(e){console.log("Footer menu API request failed:",e)}}catch(e){console.log("Error getting footer config URL:",e)}finally{(0,m.modifyAllApplyLocalHref)()}}})}insertDataIntoFooterMenu(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=(new DOMParser).parseFromString(e,"text/html"),o=document.querySelector(".fb-wrapper-link"),n=t.querySelector(".fb-wrapper-link");n&&o&&(o.innerHTML=n.innerHTML),this.getLocalHeaderData()})}getLocalHeaderData(){const e=document.querySelectorAll(".dynamic-service-menu");let t=[];if(e.length>
30)e.forEach(e=>{t.push({name:null==e?void 0:e.querySelector("a span").textContent.trim(),link:null==e?void 0:e.querySelector("a").href})}),(0,v.setServices)(t);else{let e=(0,m.getFooterLink)();(0,v.setServices)(e)}}getMenu(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n;const r=null!==(t=null===(e=document.getElementById("dbaName"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("dbaName"),l=null!==(n=null===(o=document.getElementById("weblocationId"))||void 0===o?void 0:o.value)&&void 0!==n?n:localStorage.getItem("weblocationId"),a=localStorage.getItem("doingBusinessAs"),d=window.location.origin;let c=`${d}/localmenu/${l}/${r}`;const u=localStorage.getItem("brandDetails")?JSON.parse(localStorage.getItem("brandDetails")):null;let h=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;!h&&(null==u?void 0:u.include_statename)&&(yield(0,m.fetchCrownpeakUrlDetails)(),h=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),(null==u?void 0:u.include_statename)&&h&&(c=`${d}/localmenu/${l}/${r}/${null==h?void 0:h.stateName}`);const v={method:"GET",url:c};try{const e=yield(0,s.default)(v);this.insertMenuIntoDOM(e),yield i.StickyHeader.init();const t=new p.SetLocalHeader;if(yield t.initAsync(),this.getFooterMenu(r),r&&a){const e=`\n <svg aria-hidden="true" class="icon"> <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use></svg>\n <div>\n <span class="local-address">${a}</span> Change location\n </div>\n `;t.setHamburgerSubMenuInnerDba(e)}}catch(e){console.error("Error fetching menu:",e)}})}insertMenuIntoDOM(e){var t,o,n;if(e){const s=document.querySelector(".main-nav"),r=document.querySelector(".header-wrapper .brand-cta-list"),l=(new DOMParser).parseFromString(e,"text/html"),u=l.getElementById("bottom-menu"),m=l.getElementById("top-menu");s&&u&&(s.innerHTML=u.innerHTML),r&&m&&(r.innerHTML=m.innerHTML);const h=null===(t=document.getElementById("local_weblocationId"))||void 0===t?void 0:t.value;(localStorage.getItem("franchiseWebLocationId")||h)&&this.hideOurTeamsMenu(),this.fetchPhotoGalleryData();const p=null==l?void 0:l.getElementById("local-header-logoimagepath"),v=null==l?void 0:l.getElementById("local-header-logoimagealt");p&&v&&(0,c.updateHeaderLogo)(null===(o=p.textContent)||void 0===o?void 0:o.trim(),null===(n=v.textContent)||void 0===n?void 0:n.trim());try{(0,d.reportScreenSize)()===a.ScreenType.Desktop&&(0,i.initializeNavDropdown)()}catch(e){console.error("Error in updating NavDropdown:",e)}try{(0,i.handleMobileDesktopSubmenuClicks)()}catch(e){console.error("Error in handling mobile/desktop submenu clicks:",e)}}}}(0,n.__awaiter)(void 0,void 0,void 0,function*(){yield I.create()})},"./src/js/opus2/header/index.ts"(e,t,o){"use strict";o.d(t,{SetLocalHeader:()=>n.SetLocalHeader,UseMyLocationSearch:()=>i.UseMyLocationSearch});var n=o(/*! ./SetLocalHeader */"./src/js/opus2/header/SetLocalHeader.ts"),i=(o(/*! ./dynamicInjectMenu */"./src/js/opus2/header/dynamicInjectMenu.ts"),o(/*! ../header/useMyLocation */"./src/js/opus2/header/useMyLocation.ts"))},"./src/js/opus2/header/locateAddressBumper.ts"(e,t,o){"use strict";o.d(t,{LocateAddressBumper:()=>c});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),s=o(/*! ../hero_component/ResidentialForm */"./src/js/opus2/hero_component/ResidentialForm.ts"),r=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../util/getStateFun */"./src/js/opus2/util/getStateFun.ts");class c{constructor(){const e=document.querySelector(".find-local-modal .modal-loc-div");this.formElement=document.querySelector(".step-2 .modal-search"),e&&e.classList.add("banner-wizard"),this.sendButton=document.querySelector(".step-2 .form-cta button"),this.sendButton&&this.sendButton.addEventListener("click",this.handleNextBtnClick.bind(this));const t=document.getElementById("close-local-modal");t&&t.addEventListener("click",()=>{this.handleModalClose()}),this.setupInlineValidation()}validateField(e,t){var o;const n=t(),i=e.nextElementSibling;if(n)if(e.classList.add("invalid-field"),null==i?void 0:i.classList.contains("error-msg"))i.textContent=n;else{const t=document.createElement("span");t.className="error-msg",t.textContent=n,null===(o=e.parentNode)||void 0===o||o.insertBefore(t,e.nextSibling)}else e.classList.remove("invalid-field"),(null==i?void 0:i.classList.contains("error-msg"))&&i.remove()}setupInlineValidation(){const e=this.getFormFieldsElement();e&&((null==e?void 0:e.address1)&&e.address1.addEventListener("input",t=>this.validateField(t.target,()=>{var t,o;return this.validateAddress(null!==(o=null===(t=e.address1)||void 0===t?void 0:t.value)&&void 0!==o?o:"",!0)})),(null==e?void 0:e.address2)&&e.address2.addEventListener("input",t=>this.validateField(t.target,()=>{var t,o;return this.validateAddress(null!==(o=null===(t=e.address2)||void 0===t?void 0:t.value)&&void 0!==o?o:"",!1)})),(null==e?void 0:e.city)&&e.city.addEventListener("input",t=>this.validateField(t.target,()=>{var t,o;return this.validateCity(null!==(o=null===(t=e.city)||void 0===t?void 0:t.value)&&void 0!==o?o:"")})),(null==e?void 0:e.zipCode)&&e.zipCode.addEventListener("input",e=>{var t;const o=null===(t=e.target)||void 0===t?void 0:t.value;if(o.trim().length>=5){sessionStorage.setItem("temp_zipcode",o);d.StateHandler.getInstance().getStateFun()}this.validateField(e.target,()=>this.zipValidation(o)?"":this.validateZipCode(o))}),(null==e?void 0:e.state)&&e.state.addEventListener("change",t=>this.validateField(t.target,()=>{var t,o;return this.validateState(null!==(o=null===(t=e.state)||void 0===t?void 0:t.value)&&void 0!==o?o:"")})))}getFormFieldsElement(){return{address1:document.getElementById("modal-address-1"),address2:document.getElementById("modal-address-2"),city:document.getElementById("modal-city"),state:document.getElementById("modal-states"),zipCode:document.getElementById("modal-zipcode")}}getFormFields(){var e,t,o,n,i,s,r,l,a,d;const c=this.getFormFieldsElement();return{zipCode:null!==(t=null===(e=c.zipCode)||void 0===e?void 0:e.value.trim())&&void 0!==t?t:"",address1:null!==(n=null===(o=c.address1)||void 0===o?void 0:o.value.trim())&&void 0!==n?n:"",address2:null!==(s=null===(i=c.address2)||void 0===i?void 0:i.value.trim())&&void 0!==s?s:"",city:null!==(l=null===(r=c.city)||void 0===r?void 0:r.value.trim())&&void 0!==l?l:"",state:null!==(d=null===(a=c.state)||void 0===a?void 0:a.value.trim())&&void 0!==d?d:""}}validateAddress(e,t){return t&&!e.trim()?"Address Line 1 is required.":e.trim()&&!i.REGEX.noBracketAddress.test(e)?"Enter valid address.":""}
3validateZipCode(e){return e.trim()?i.REGEX.sendZip.test(e.trim())&&"00000"!==e.trim()?"":"Invalid zip code format.":"Zip code is required."}zipValidation(e){return!!e.trim()&&(i.REGEX.sendZip.test(e.trim())&&"00000"!==e.trim())}validateCity(e){return e.trim()?i.REGEX.sendName.test(e)?"":"Enter valid city.":"City is required."}validateState(e){return e.trim()?"":"State is required."}validateForm(){var e,t,o,n,i,s,r,l,a,d;const c=this.getFormFieldsElement();this.clearValidationErrors();const u=[{id:"modal-address-1",value:null!==(t=null===(e=c.address1)||void 0===e?void 0:e.value)&&void 0!==t?t:"",validator:e=>this.validateAddress(e,!0)},{id:"modal-address-2",value:null!==(n=null===(o=c.address2)||void 0===o?void 0:o.value)&&void 0!==n?n:"",validator:e=>this.validateAddress(e,!1)},{id:"modal-city",value:null!==(s=null===(i=c.city)||void 0===i?void 0:i.value)&&void 0!==s?s:"",validator:this.validateCity},{id:"modal-zipcode",value:null!==(l=null===(r=c.zipCode)||void 0===r?void 0:r.value)&&void 0!==l?l:"",validator:this.validateZipCode},{id:"modal-states",value:null!==(d=null===(a=c.state)||void 0===a?void 0:a.value)&&void 0!==d?d:"",validator:this.validateState}].map(({id:e,value:t,validator:o})=>({id:e,value:t,error:o(t)})).filter(e=>e.error);if(u.forEach(({id:e,error:t})=>{var o;const n=document.getElementById(e);if(n&&t){const e=document.createElement("span");e.className="error-msg",e.textContent=t,n.classList.add("invalid-field"),null===(o=n.parentNode)||void 0===o||o.appendChild(e)}}),u.length>0){const e=document.getElementById(u[0].id);return null==e||e.focus(),!1}return!0}handleNextBtnClick(e){e.preventDefault();this.validateForm()&&((0,l.startLoader)(),this.handleNextBtnSubmit(e))}handleAddressBumperModalClose(){const e=document.getElementById("close-local-modal");null==e||e.click()}errorHandling(e=!1){if("true"===sessionStorage.getItem("shortFormAddressBumper")){this.handleAddressBumperModalClose();return void(new s.ResidentialForm).handleErrorcase(e?1:0)}const t=document.getElementById("step1-text1"),o=document.getElementById("step1-text2");t&&(t.style.display="none"),o&&(o.style.display="block");const n=document.querySelector(".step-1"),i=document.querySelector(".step-2");i&&i.classList.add("hidden"),n&&n.classList.remove("hidden")}handleNextBtnSubmit(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,d,c;const u=this.getFormFields();if(!u)return void this.errorHandling();const m=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,h=yield(0,a.getBrandDetailsFromBrandJson)(m),p=`${null!==(o=u.address1)&&void 0!==o?o:""} ${null!==(n=u.address2)&&void 0!==n?n:""} ${null!==(i=u.city)&&void 0!==i?i:""} ${null!==(d=u.state)&&void 0!==d?d:""} ${null!==(c=u.zipCode)&&void 0!==c?c:""}`;(0,a.getFranchiseDetails)(p).then(t=>{if(Array.isArray(t)&&(null==t?void 0:t.length)>0){const o=t.filter(e=>null!=e.franchiseId);if(1===o.length){if("true"===sessionStorage.getItem("shortFormAddressBumper")){sessionStorage.removeItem("shortFormAddressBumper");const o={franchiseId:t[0].franchiseId,franchiseWebLocationId:t[0].franchiseWebLocationId},n={address:{state:u.state,city:u.city,postalCode:u.zipCode},title:u.address1};(new s.ResidentialForm).handleSubmit(e,o,n).finally(()=>{this.handleAddressBumperModalClose()})}else{const e=o[0],t=e.locationWebsiteUrl;sessionStorage.setItem("alternateConcept",e.alternateConcept),localStorage.setItem("franchiseWebLocationId",e.franchiseWebLocationId),localStorage.setItem("doingBusinessAs",e.doingBusinessAs),sessionStorage.setItem("franchiseeName",e.franchiseeName),sessionStorage.setItem("sAddressParam",u.zipCode);let n=(0,r.getCountryCode)();sessionStorage.setItem("countryCode",n),t&&(t.startsWith("http:")?window.location.href=t.replace("http:","https:"):t.startsWith("https:")&&(window.location.href=t))}}else this.errorHandling()}else if(null==h?void 0:h.lead_contactapi){const e={address:{state:u.state,city:u.city,postalCode:u.zipCode},title:u.address1};(new s.ResidentialForm).contactUsApiCall(e),this.handleAddressBumperModalClose()}else this.errorHandling();(0,l.stopLoader)()}).catch(()=>{(0,l.stopLoader)(),this.errorHandling(!0),this.handleAddressBumperModalClose()})})}clearValidationErrors(){document.querySelectorAll(".step-2 .error-msg").forEach(e
3=>e.remove()),document.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"))}handleModalClose(){this.formElement.reset(),this.clearValidationErrors()}}},"./src/js/opus2/header/meet-the-team-helper.ts"(e,t,o){"use strict";function n(e){if(!e)return!1;let t=e.title,o=e.name,n=e.displayName;return e.franchiseProfileEmployeeBioDetail&&(t=t||e.franchiseProfileEmployeeBioDetail.title,o=o||e.franchiseProfileEmployeeBioDetail.name,n=n||e.franchiseProfileEmployeeBioDetail.displayName),!!((null==t?void 0:t.trim())||(null==o?void 0:o.trim())||(null==n?void 0:n.trim()))}function i(e){const t=null!==e.teamInfo&&void 0!==e.teamInfo,o="number"==typeof e.teamSize&&e.teamSize>0;if(t&&o)return!0;const i=e.staffPhotoInfo&&Array.isArray(e.staffPhotoInfo)||e.employeePhotoInfo&&Array.isArray(e.employeePhotoInfo),s=Array.isArray(e.staffPhotoInfo)&&e.staffPhotoInfo.some(n),r=Array.isArray(e.employeePhotoInfo)&&e.employeePhotoInfo.some(n);return!(!i||!(s||r))}o.d(t,{isValidTeamJson:()=>i})},"./src/js/opus2/header/searchLocalSite.ts"(e,t,o){"use strict";var n=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),i=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),s=o(/*! ./GetLocateLocation */"./src/js/opus2/header/GetLocateLocation.ts"),r=o(/*! ./locateAddressBumper */"./src/js/opus2/header/locateAddressBumper.ts");class l{static showError(e,t=""){const o=document.getElementById(e),n=document.getElementById(`${e}-error-msg`);o&&o.classList.add("invalid-field"),n&&(t&&(n.textContent=t),n.classList.remove("hidden"))}static hideError(e){const t=document.getElementById(e),o=document.getElementById(`${e}-error-msg`);t&&t.classList.remove("invalid-field"),o&&o.classList.add("hidden")}static getSelectedServiceType(){const e=document.querySelectorAll('.find-local-modal .glass-type-container input[name="glass-type"]');return Array.from(e).some(e=>e.checked)}}new class{constructor(){this.headerBtnZipcode=document.querySelector(".find-local-modal form .form-cta .primary-btn"),this.localSearchInput=document.getElementById("local-search-modal"),this.locateLocation=s.GetLocateLocation.getInstance(),this.initializeEventListeners(),this.initializeErrorMessageElement(),this.initializeCloseButtonHandlers()}initializeEventListeners(){this.headerBtnZipcode&&this.headerBtnZipcode.addEventListener("click",this.handleButtonClick.bind(this));const e=document.querySelectorAll(".find-local-modal .glass-type-container .glass-type-radio");null==e||e.forEach(e=>{e.addEventListener("change",this.handleServiceTypeChange.bind(this))}),this.localSearchInput&&(this.localSearchInput.addEventListener("input",this.handleSearchInput.bind(this)),this.headerBtnZipcode&&this.localSearchInput.addEventListener("keydown",e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this.handleEnterKey())}))}initializeErrorMessageElement(){if(!this.localSearchInput)return;const e=document.createElement("span");e.id="modal-error_message",e.className="error-msg block",e.style.display="none";const t=document.querySelector(".step-1 .form-cta"),o=null==t?void 0:t.parentNode;o&&o.insertBefore(e,t)}initializeCloseButtonHandlers(){window.addEventListener("load",()=>{document.querySelectorAll(".close-modal-btn").forEach(e=>{e&&e.addEventListener("click",e=>this.handleCloseButtonClick(e))})})}handleSearchInput(){if(!this.localSearchInput)return;const e="ca"===(0,i.checkDomain)()?n.REGEX.caSendZip:n.REGEX.sendZip;""!==this.localSearchInput.value&&!e.test(this.localSearchInput.value.trim())?l.showError("local-search-modal","Invalid zip code format."):l.hideError("local-search-modal"),this.updateStepTextVisibility("block","none")}handleEnterKey(){var e,t;(null===(e=this.localSearchInput)||void 0===e?void 0:e.value)?null===(t=this.headerBtnZipcode)||void 0===t||t.click():l.showError("local-search-modal","Please enter a zip code")}handleCloseButtonClick(e){e.preventDefault(),this.localSearchInput&&(this.localSearchInput.value=""),this.updateStepTextVisibility("block","none");const t=document.querySelector(".menu-sidebar-mobile");"true"===(null==t?void 0:t.getAttribute("aria-modal"))&&document.body.classList.add("overflow-hidden")}handleButtonClick(e){var t,o;e.stopPropagation(),e.preventDefault();let n=null===(o=null===(t=this.localSearchInput)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim();if(!n)return console.log("No zip code provided"),void l.showError("local-search-modal","Please enter a zip code");this.isCanadianSite()&&-1===n.indexOf(" ")&&(n=n.replace(/^(.{3})(.*)$/,"$1 $2")),this.saveZipCode(n);if(this.validateForm(n)){new r.LocateAddressBumper;this.locateLocation.locateLocation("desk")}else console.log("Form validation failed")}handleServiceTypeChange(){document.querySelector(".find-local-modal .glass-type-container")&&this.isServiceTypeRequired()&&(this.isServiceTypeSelected()?l.hideError("local-search-modal"):l.showError("local-search-modal","Please select a service type"))}getFormattedZipCode(e,t){var o;const n=null===(o=this.localSearchInput)||void 0===o?void 0:o.value;let i="local-search-modal"===e?n:null==t?void 0:t.value;if(!i)return;return this.isCanadianSite()&&-1===i.indexOf(" ")&&(i=i.replace(/^(.{3})(.*)$/,"$1 $2")),i}isCanadianSite(){const e=location.hostname.toLowerCase();return e.includes("-ca-")||e.endsWith(".ca")||e.includes("-ca.")}saveZipCode(e){localStorage.setItem("zipcode",e);const t=document.querySelector(".step-2 #modal-zipcode");t&&(t.value=e)}validateForm(e){if(!this.localSearchInput)return!1;
3if(document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),this.isServiceTypeRequired()&&!this.isServiceTypeSelected()){const e=document.getElementById("local-search-modal-error-msg");return e&&(e.textContent="Please select a service type",e.classList.remove("hidden")),!1}const t=("ca"===(0,i.checkDomain)()?n.REGEX.caSendZip:n.REGEX.sendZip).test(e.trim());if(this.localSearchInput.required&&!t){const e=document.getElementById("local-search-modal-error-msg");return e&&(e.textContent="Invalid zip code format.",e.classList.remove("hidden")),!1}return!0}isServiceTypeRequired(){var e;const t=document.querySelector(".find-local-modal .glass-type-container");return null!==(e=null==t?void 0:t.hasAttribute("required"))&&void 0!==e&&e}isServiceTypeSelected(){return l.getSelectedServiceType()}updateStepTextVisibility(e,t){const o=document.getElementById("step1-text1"),n=document.getElementById("step1-text2");o&&(o.style.display=e),n&&(n.style.display=t)}}},"./src/js/opus2/header/serviceLinks.ts"(e,t,o){"use strict";function n(e){const t=document.querySelector("#fblinkblock-services > .footer-submenu");for(;null==t?void 0:t.firstChild;)t.removeChild(t.firstChild);if(0==e.length&&document.getElementById("fblinkblock-services"))document.getElementById("fblinkblock-services").style.display="none";else{const o=e.map(e=>`<li class="submenu-li">\n <a href=${e.link} class="submenu-a">${e.name}</a>\n </li>`);null==t||t.insertAdjacentHTML("beforeend",o.join(""))}}o.d(t,{setServices:()=>n})},"./src/js/opus2/header/useMyLocation.ts"(e,t,o){"use strict";o.d(t,{UseMyLocationSearch:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! axios */"./node_modules/axios/lib/axios.js");class s{constructor(){const e=document.querySelector(".modal-search .use-my-location-btn"),t=document.querySelector(".location-search-form .use-my-location-btn");e&&e.addEventListener("click",this.getCurrentLocation.bind(this)),t&&(null==t||t.addEventListener("click",this.getCurrentLocation.bind(this)))}getCurrentLocation(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){null==e||e.stopPropagation(),null==e||e.preventDefault();let o=null;if(null==e?void 0:e.currentTarget){const s=e.currentTarget,r=null==s?void 0:s.closest("form");r&&(o=r.querySelector('input[type="search"], input[type="text"]'))}if(t&&(o=t),navigator.geolocation&&o){function l(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,s,r;if(""===e||""===t)return;let l,a=`https://revgeocode.search.hereapi.com/v1/revgeocode?at=${e}%2C${t}&lang=en-US&apikey=NSFzJWiXqllZTvP4jbKP6vNbb_K9NHSIJVKJt0uFfTo`;const d=yield i.default.get(a);if(!(null==d?void 0:d.data))return void console.log("Geolocation is not available in this browser.");let c=null===(n=null==d?void 0:d.data)||void 0===n?void 0:n.items;if(Array.isArray(c)&&(null==c?void 0:c.length)>0&&(null===(s=c[0])||void 0===s?void 0:s.address))for(let e in null===(r=c[0])||void 0===r?void 0:r.address)e.indexOf("postalCode")>-1&&c[0].address[e]&&(l=c[0].address.postalCode);l&&(l.includes("-")&&(l=l.split("-")[0]),o.value=l)})}navigator.geolocation.getCurrentPosition(function(e){l(e.coords.latitude,e.coords.longitude,o)})}})}}new s},"./src/js/opus2/helperModules/localizedToken.ts"(e,t,o){"use strict";o.d(t,{LocalizedToken:()=>l,fetchLocalTokenInfo:()=>a});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../util/share */"./src/js/opus2/util/share.ts");class l{static getInstance(){return l.instance?l.instance.init():l.instance=new l,l.instance}constructor(){this.init()}init(){document.getElementById("main")&&this.getLocalTokenInfo()}getLocalTokenInfo(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=yield(0,r.getWeblocationPathGroupWithSiteConfig)();if(!e)return;const t=yield(0,i.getCachedAPIResponse)(e,s.apiCaching.SiteConfig,!1);if(!t||!Array.isArray(null==t?void 0:t.token_details_without_curlybraces))return;const o=t.token_details_without_curlybraces,n=document.getElementById("main");if(n&&Array.isArray(o)){const e=this.buildTokenMap(o);if(0===Object.keys(e).length)return;const t=new RegExp(Object.keys(e).join("|"),"gi"),i=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let s;for(;s=i.nextNode();){const o=s.textContent;if(!o||!t.test(o))continue;const n=o.replace(t,t=>{const o=Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase());return o?e[o]:t});s.textContent=n}}}catch(e){console.error("SiteConfig loading failed:",e)}})}buildTokenMap(e){return e.reduce((e,t)=>
3{var o;const n=null===(o=null==t?void 0:t.key)||void 0===o?void 0:o.trim(),i="string"==typeof(null==t?void 0:t.value)?t.value.trim():"";return n&&i&&(e[n]=i),e},{})}}function a(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return l.getInstance().getLocalTokenInfo()})}},"./src/js/opus2/hero_component/ResidentialForm.ts"(e,t,o){"use strict";o.d(t,{ResidentialForm:()=>k});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),l=o(/*! ../util/getStateFun */"./src/js/opus2/util/getStateFun.ts"),a=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),d=o(/*! ../header/locateAddressBumper */"./src/js/opus2/header/locateAddressBumper.ts"),c=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),u=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),m=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),h=o(/*! ../util/gtm-custom-event-lead-flow */"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"),p=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),v=o(/*! ../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),g=o(/*! ../util/modalVisibilityCheck */"./src/js/opus2/util/modalVisibilityCheck.ts"),f=o(/*! ../util/domainService */"./src/js/opus2/util/domainService.ts"),y=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),b=o(/*! flowbite */"./node_modules/flowbite/lib/esm/index.js"),I=o(/*! ../apiCaching/POST-Requests/apiContactCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"),S=o(/*! ../apiCaching/POST-Requests/apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"),w=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),L=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts"),E=o(/*! ../util/real-time-email-validation */"./src/js/opus2/util/real-time-email-validation.ts"),C=o(/*! ../util/nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),A=o(/*! ../util/nearbyLocationsMiles */"./src/js/opus2/util/nearbyLocationsMiles.ts"),_=o(/*! ../nbly-brand/nbly-brand-contactus */"./src/js/opus2/nbly-brand/nbly-brand-contactus.ts");class k{constructor(){var e,t,o;this.privateSuggestedArray=[],this.isCAReminderModal=!1,this.controller=new AbortController,this.isServiceModifierNotSelected=!1,this.getCheckedPreferedComunnication=()=>{var e;const t=null===(e=this.form)||void 0===e?void 0:e.querySelectorAll('input[type="checkbox"].checkbox-basic:checked');let o="";return null==t||t.forEach((e,n)=>{const i=e.value;o+=(0,c.capitalizeString)(i),n<t.length-1&&(o+=",")}),o},this.setAutoSuggested=e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;if(this.form=e.target.closest("form"),window.isShortForm=this.form,e.preventDefault(),this.validateInputs()){const n=this.getFormFields(),l=null===(t=null==n?void 0:n.addressInput)||void 0===t?void 0:t.id,a=this.form.querySelector(`#${l}`);if(!a)return;const d=a.value;if(!d)return;const u=this.formatZipCode(d);try{const e=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value;if((yield(0,c.getBrandDetailsFromBrandJson)(e)).send_nonagnostic_to_contact_endpoint)return console.log("Skipping booking call due to brand config 'send_nonagnostic_to_contact_endpoint'"),void(yield this.contactUsApiCall(u))}catch(e){console.error("Error in fetching getBrandDetailsFromBrandJson API data:",e)}const m={method:"GET",url:`${s.apiConfig.DISCOVER_API}?q=${u}&in=countryCode%3AUSA%2CCAN%2CPRI&at=0,0&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`};(0,i.default)(m).then(t=>{var o,i;if((null==t?void 0:t.items.length)>0){this.privateSuggestedArray=null==t?void 0:t.items;const s=null==t?void 0:t.items[0],l=!r.REGEX.sendCaPostalCode.test(null==d?void 0:d.trim());if((null===(i=null===(o=null==s?void 0:s.address)||void 0===o?void 0:o.postalCode)||void 0===i?void 0:i.includes("-"))&&l){const e=s.address.postalCode.split("-")[0];s.address.postalCode=null==e?void 0:e.trim()}const a=this.getAddress(s);let c=n.leadServiceId;c?this.getFranchiseWebLocationId(e,a,c):this.getFranchiseWebLocationId(e,a)}else this.handleErrorcase(1)}).catch(e=>{this.handleErrorcase(1)})}}),document.addEventListener("DOMContentLoaded",()=>{this.calculateShortFormCount(),this.asideCardToMobile(),this.initializeCommercialRadioCheck()}),window.addEventListener("resize",this.asideCardToMobile);document.querySelector(".aside-card.tabs-mobile");this.asideCardToMobile();const l=document.getElementById("req-name"),a=document.getElementById("req-lname"),d=document.getElementById("req-name-mobile"),u=document.getElementById("req-email"),m=document.getElementById("req-email-mobile"),h=document.getElementById("req-phone"),p=document.getElementById("req-phone-mobile"),v=document.getElementById("req-address");null==v||v.addEventListener("focusout",this.handleFocusOut.bind(this,"req-address"));const g=document.getElementById("short-form-req-address");null==g||g.addEventListener("focusout",this.handleFocusOut.bind(this,"short-form-req-address"));const y=document.getElementById("req-address-mobile");this.shortFormService=document.querySelectorAll('[id*="short-form-service-reminder"]'),this.nameInput=l||d,this.lastNameInput=a,this.emailInput=u||m,this.phoneInput=h||p,this.addressInput=v||y,this.fullAddressInput=document.getElementById("req-full-address");const b=document.getElementById("sendB-name"),I=document.getElementById("sendB-name-mobile");this.businessNameInput=b||I,this.submitButton=document.querySelectorAll(".residential-form .primary-btn"),null===(e=this.submitButton)||void 0===e||e.forEach(e
3=>{e.addEventListener("click",this.setAutoSuggested.bind(this))}),this.serviceTypeID=Number.NaN,this.initializeInputNameRestriction(),this.initializeInputLastNameRestriction(),this.initializeInputBusinessNameValidation(),this.initializeInputEmailValidation(),this.initializeInputPhoneValidation(),this.initializeInputZipCodeValidation(),this.initializeInputFullAddressValidation(),this.allRadioButtonsEventListener(),this.initializeInputCommentValidation(),this.initializePreferredContactValidation(),null===(t=this.shortFormService)||void 0===t||t.forEach(e=>{e.addEventListener("change",this.handleCheckboxChange.bind(this))}),this.shortFormLeadType=document.querySelectorAll(".short-lead-radio-wrap .radio-basic"),null===(o=this.shortFormLeadType)||void 0===o||o.forEach(e=>{e.addEventListener("change",e=>{this.handleRadioChange(e)})});const S=(0,f.DomainIdentifier)(),L=(0,w.getCountryCode)(),E=sessionStorage.getItem("countryCode");"ca"!=S&&"ca"!==L&&"ca"!==E||this.hideTermsPolicyForAllForms()}hideTermsPolicyForAllForms(){document.querySelectorAll(".residential-form").forEach(e=>{const t=e.querySelector(".short-form-req-new"),o=Array.from(e.children);if(t){const e=Array.from(t.children).find(e=>e.classList.contains("terms-policy-text"));if(e){e.style.display="none"}}else{const e=o.find(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains("terms-policy-text")});e&&(e.style.display="none")}})}getCountryByZip(e){return r.REGEX.sendCaPostalCode.test(e)?"ca":"us"}toggleTermsPolicyDisplay(e,t,o){const n=(0,f.DomainIdentifier)(),i=(0,w.getCountryCode)(),s=sessionStorage.getItem("countryCode");let r=null==o?void 0:o.value.trim();e.style.display="ca"===t&&("ca"===n||"ca"===i||"ca"===s)||"ca"===t||""===r&&("ca"==n||"ca"===i||"ca"===s)?"none":"block"}handleFocusOut(e){let t=document.getElementById(e);const o=this.getCountryByZip((null==t?void 0:t.value.trim())||""),n=t.closest(".residential-form");if(n){const e=n.querySelector(".short-form-req-new"),i=Array.from(n.children);if(e){const n=Array.from(e.children).find(e=>e.classList.contains("terms-policy-text"));if(n){const e=n;this.toggleTermsPolicyDisplay(e,o,t)}}else{const e=i.find(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.contains("terms-policy-text")});e&&this.toggleTermsPolicyDisplay(e,o,t)}}}handleCheckboxChange(){var e;const t=null===(e=this.form)||void 0===e?void 0:e.querySelectorAll(".service-reminder-main");let o=null;if(0!==t.length)return t.forEach(e=>{if(e&&!e.classList.contains("hidden")){const t=e.querySelector('input[type="checkbox"]'),n=e.querySelector(".error-msg");t&&n&&t instanceof HTMLInputElement&&t.required&&(t.addEventListener("change",()=>{t.checked?n.classList.add("hidden"):(n.classList.remove("hidden"),o=null==n?void 0:n.id)}),t.required&&!t.checked&&(n.classList.remove("hidden"),o=null==n?void 0:n.id))}}),o;console.log("Servcie Disclaimer not authored in CP")}handleRadioChange(e){const t=null==e?void 0:e.target,o=(null==t?void 0:t.closest("form"))||this.form;if(!o)return null;this.form=o;const n=null==o?void 0:o.querySelectorAll(".short-lead-radio-wrap .radio-basic");let i=!1,s=null;null==n||n.forEach(t=>{var o;const n=null==e?void 0:e.target;(null===(o=null==n?void 0:n.classList)||void 0===o?void 0:o.contains("radio-basic"))&&t.classList.remove("invalid-field"),(null==t?void 0:t.checked)&&(i=!0)});const r=this.form.querySelector(".short-lead-radio-wrap");if(!r)return console.log("Service Type not authored in CP"),null;const l=r.querySelector(".error-msg");return l&&(!i&&r.hasAttribute("required")?(l.classList.remove("hidden"),s=null==l?void 0:l.id):(l.classList.add("hidden"),s=null==l?void 0:l.id)),s}allRadioButtonsEventListener(){document.querySelectorAll(".req-call-btn").forEach(e=>{e.addEventListener("click",e=>{const t=e.target.closest(".req-call-btn").closest(".req-call-tablist").querySelector(".req-call-radio");t&&(t.checked=!0)})})}setRadioChecked(e){const t=sessionStorage.getItem("serviceType");if(!t)return;if(t!==e)return;const o=document.querySelectorAll(`input[type="radio"][value*="${e}"]`);for(const e of o)e&&(e.checked=!0)}initializeCommercialRadioCheck(){(0,c.detectServicePageTypeByAssetPath)().then(e=>{e&&this.setRadioChecked("commercial")})}getShouldRedirectToLeadFlow(){var e,t;return"true"===(null===(t=null===(e=this.form)||void 0===e?void 0:e.querySelector(".redirect_lead_flow"))||void 0===t?void 0:t.value)}initializeInputNameRestriction(){document.querySelectorAll("input.short-form-req-name,#req-name").forEach(e
3=>{e.addEventListener("input",this.errorOnName.bind(this))})}initializeInputLastNameRestriction(){document.querySelectorAll("input.short-form-req-lname,#req-lname").forEach(e=>{e.addEventListener("input",this.errorOnLastName.bind(this))})}initializeInputBusinessNameValidation(){document.querySelectorAll("input.short-form-sendB-name,#sendB-name").forEach(e=>{e.addEventListener("input",this.errorOnBusinessName.bind(this))})}isShowRealtimeEmailValidationError(e,t){if(!t)return;const o=t.querySelector(".realtime-email-validation-error-message");o&&(o.classList.contains("hidden")&&e&&o.classList.remove("hidden"),o.classList.contains("hidden")||e||o.classList.add("hidden"))}initializeInputEmailValidation(){document.querySelectorAll("input.short-form-req-email,#req-email").forEach(e=>{e.addEventListener("input",this.emailError.bind(this)),e.addEventListener("blur",t=>{const o=t.target,n=document.getElementById("conceptCode"),i=n?n.value:"",s={value:o.value,signal:this.controller.signal,conceptCode:i},r=o.parentNode,l=()=>{if(!r)return;const e=r.querySelector(".error-msg");e&&(e.classList.contains("hidden")||e.classList.add("hidden"))};(0,E.validateEmail)(s).then(t=>{"EmptyField"!==t&&"RegexFailed"!==t&&("EmailValidationPassed"!==t&&"SendGridFailed"!==t?(this.isShowRealtimeEmailValidationError(!0,r),l(),e.setAttribute("data-validation-result","email-validated")):this.isShowRealtimeEmailValidationError(!1,r))}).catch(()=>{o.parentNode&&(this.isShowRealtimeEmailValidationError(!0,r),l()),e.setAttribute("data-validation-result","email-validated")})})})}initializeInputPhoneValidation(){document.querySelectorAll("input.short-form-req-phone,#req-phone").forEach(e=>{e.addEventListener("input",this.handleMobileInput.bind(this))})}initializeInputZipCodeValidation(){document.querySelectorAll("input.short-form-req-address,#req-address").forEach(e=>{e.addEventListener("input",this.zipCodeError.bind(this))})}initializeInputFullAddressValidation(){document.addEventListener("input",e=>{e.target.matches("#req-full-address, input#short-form-req-full-address")&&this.fullAddressError(e)})}initializeInputCommentValidation(){const e=document.getElementById("short-form-req-comment");null==e||e.addEventListener("input",this.errorOnComment.bind(this))}initializePreferredContactValidation(){document.querySelectorAll('input[id*="short-form-req-pref"]').forEach(e=>{e.addEventListener("input",this.prefMethodError.bind(this))})}scrollToThankYouSection(e=null){var t;if(window.innerWidth<=768){let o=document.querySelector(".hero-review");const n=null!=e?e:this.form;if(o){let e=null==o?void 0:o.offsetTop;window.scrollTo({top:e,behavior:"smooth"})}else null===(t=null==n?void 0:n.closest(".short-form-component"))||void 0===t||t.scrollIntoView({behavior:"smooth",block:"center"})}}errorOnComment(e){var t;const o=e.target;if(this.form=e.target.closest("form"),""===o.value||r.REGEX.matchAny.test(o.value))this.hideError(null==o?void 0:o.id);else{const e=null===(t=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`))||void 0===t?void 0:t.textContent,n=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`);n&&(n.classList.remove("hidden"),n.innerHTML=e||"Invalid comment.")}}prefMethodError(e){e.target;this.form=e.target.closest("form");const t=document.querySelectorAll('input[id*="short-form-req-pref"]'),o=[];t.forEach(e=>{o.push(null==e?void 0:e.checked)});o.some(function(e){return e})?this.hidePrefError("shortform_preferred-contact-error-msg"):this.addPrefError("shortform_preferred-contact-error-msg")}handleMobileInput(e){var t,o;const n=e.target;this.form=e.target.closest("form"),e.preventDefault();const i=r.REGEX.mobileNumberRegex,s=null==n?void 0:n.value,l=null==s?void 0:s.replace(/\D/g,"").match(i),a=l?`(${l[1]}) ${l[2]}${l[3]?"-"+l[3]:""}`:"",d=null!==(t=n.selectionStart)&&void 0!==t?t:0,c=s;if(""!=(null==n?void 0:n.value)&&(null==n?void 0:n.value.length)<14&&a.length<14){const e=null===(o=this.form.querySelector(`#${null==n?void 0:n.id}-error-msg`))||void 0===o?void 0:o.textContent,t=this.form.querySelector(`#${null==n?void 0:n.id}-error-msg`);if(t)t.classList.remove("hidden"),t.innerHTML=e||"Invalid phone format.";else{const t=n;if(t&&t.parentNode){const o=e||"Invalid phone format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}else this.hideError(null==n?void 0:n.id);if(l&&(n.value=l[2]?`(${l[1]}) ${l[2]}${l[3]?"-"+l[3]:""}
3`:l[1],n)){const e=d+((null==n?void 0:n.value)?n.value.length-c.length:0);n.setSelectionRange(n.selectionStart,e)}}errorOnName(e){var t;const o=e.target;if(this.form=e.target.closest("form"),""===o.value||r.REGEX.sendName.test(o.value))this.hideError(null==o?void 0:o.id);else{const e=null===(t=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`))||void 0===t?void 0:t.textContent,n=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`);if(n)n.classList.remove("hidden"),n.innerHTML=e||"Invalid name format.";else{const t=o;if(t&&t.parentNode){const o=e||"Invalid name format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}}errorOnLastName(e){var t;const o=e.target;if(this.form=e.target.closest("form"),""===o.value||r.REGEX.sendName.test(o.value))this.hideError(null==o?void 0:o.id);else{const e=null===(t=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`))||void 0===t?void 0:t.textContent,n=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`);if(n)n.classList.remove("hidden"),n.innerHTML=e||"Invalid last name format.";else{const t=o;if(null==t?void 0:t.parentNode){const o=e||"Invalid last name format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}}errorOnBusinessName(e){var t;const o=e.target;if(this.form=e.target.closest("form"),""===o.value||r.REGEX.matchAny.test(o.value))this.hideError(null==o?void 0:o.id);else{const e=null===(t=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`))||void 0===t?void 0:t.textContent,n=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`);if(n)n.classList.remove("hidden"),n.innerHTML=e||"Invalid business name format.";else{const t=o;if(null==t?void 0:t.parentNode){const o=e||"Invalid business name format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}}emailError(e){const t=e.target,o=t.parentNode;if(this.form=e.target.closest("form"),o&&(this.isShowRealtimeEmailValidationError(!1,o),t.hasAttribute("data-validation-result")&&t.removeAttribute("data-validation-result")),""==t.value||r.REGEX.sendEmail.test(t.value))this.hideError(null==t?void 0:t.id);else{const e=this.form.querySelector(`#${null==t?void 0:t.id}-error-msg`),o=null==e?void 0:e.textContent,n=this.form.querySelector(`#${null==t?void 0:t.id}-error-msg`);if(n)n.classList.remove("hidden"),n.innerHTML=o||"Invalid email address, please try again.";else{const e=t;if(e&&e.parentNode){const t=o||"Invalid email address, please try again.",n=document.createElement("span");n.className="error-msg",n.id=`${e.id}-error-msg`,n.textContent=t,e.classList.add("invalid-field"),e.parentNode.appendChild(n)}}}}zipCodeError(e){var t;const o=e.target;if(this.form=e.target.closest("form"),""!=(null==o?void 0:o.value)&&!r.REGEX.sendZip.test(null==o?void 0:o.value.trim())||"00000"==(null==o?void 0:o.value)){const e=null===(t=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`))||void 0===t?void 0:t.textContent,n=this.form.querySelector(`#${null==o?void 0:o.id}-error-msg`);if(n)n.classList.remove("hidden"),n.innerHTML=e||"Invalid zip code format.";else{const t=o;if(t&&t.parentNode){const o=e||"Invalid zip code format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}else this.hideError(null==o?void 0:o.id)}fullAddressError(e){const t=e.target;this.form=e.target.closest("form");if(this.getShouldRedirectToLeadFlow()&&""!=(null==t?void 0:t.value)&&!r.REGEX.sendAddress2.test(null==t?void 0:t.value)){const e=this.form.querySelector(`#${null==t?void 0:t.id}-error-msg`),o=null==e?void 0:e.textContent;if(e)e.classList.remove("hidden"),e.innerHTML=o||"Invalid address format.";else{const e=t;if(null==e?void 0:e.parentNode){const t=o||"Invalid address format.",n=document.createElement("span");n.className="error-msg",n.id=`${e.id}-error-msg`,n.textContent=t,e.classList.add("invalid-field"),e.parentNode.appendChild(n)}}}else this.hideError(null==t?void 0:t.id)}hideError(e){const t=this.form.querySelector(`#${e}`),o=this.form.querySelector(`#${e}-error-msg`);null==o||o.classList.add("hidden"),null==t||t.classList.remove("invalid-field")}hidePrefError(e){const t=this.form.querySelector(`#${e}`);null==t||t.classList.add("hidden"),null==t||t.classList.remove("invalid-field")}addPrefError(e){const t=this.form.querySelector(`#${e}`);null==t||t.classList.remove("hidden"),null==t||t.classList.add("invalid-field")}getFormFields(){var e,t,o,n,i,s,r,l,a,d,u,m,h,p,v,g,f;let y=null===(t=null===(e=this.form)||void 0===e?void 0:e.closest(".tabs-wrapper"))||void 0===t?void 0:t.querySelectorAll('input[name^="short-request-call-"]'),b="";const I=null===(o=Array.from(y))||void 0===o?void 0:o.filter(e=>e.checked),S=null===(s=null===(i=null===(n=this.form)||void 0===n?void 0:n.closest(".tabs-wrapper"))||void 0===i?void 0:i.querySelector("#defaultCustomerType"))||void 0===s?void 0:s.value;if(0===(null==I?void 0:I.length)&&!this.isServiceModifierNotSelected){const e=null===(r=Array.from(y))||void 0===r?void 0:r.filter(e=>{var t,o,n;return null===(o=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.toLowerCase())||void 0===o?void 0:o.includes(null!==(n=null==S?void 0:S.toLowerCase())&&void 0!==n?n:"residential")});e.length>0&&(I.push(e[0]),this.isServiceModifierNotSelected=!0)}const w=null!==(u=null===(d=null===(a=null===(l=I[0])||void 0===l?void 0:l.parentElement)||void 0===a?void 0:a.querySelector(".lead-service-typeId"))||void 0===d?void 0:d.value)&&void 0!==u?u:null===(p=null===(h=null===(m=I[0])||void 0===m?void 0:m.parentElement)||void 0===h?void 0:h.querySelector(".short-lead-service-typeId"))||void 0===p?void 0:p.value;w&&(this.serviceTypeID=Number.parseInt(w));const L=(e,t)=>{var o,n,i,s,r,l,a,d,u,m;if(e.length>0){let h=null===(n=null===(o=e[0])||void 0===o?void 0:o.parentElement.querySelector(t))||void 0===n?void 0:n.value;b=null!==(i=null==h?void 0:h.replace(/-/g," "))&&void 0!==i?i:"";let p=null===(s=e[0])||void 0===s?void 0:s.value;if(!p||""===p.trim()){const t=null===(r=e[0])||void 0===r?void 0:r.id;if(t){const o=(null===(a=null===(l=e[0])||void 0===l?void 0:l.parentElement)||void 0===a?void 0:a.querySelector(`label[for="${t}"]`))||(null===(u=null===(d=e[0])||void 0===d?void 0:d.parentElement)||void 0===u?void 0:u.querySelector(`label[for="short-form-${t}"]`));o&&(p=(null===(m=o.textContent)||void 0===m?void 0:m.trim())||"")}}return(0,c.capitalizeString)(null==p?void 0:p.replaceAll("-"," "))}return S?(0,c.capitalizeString)(S):"Residential"};let E=L(I,'input[name^="lead-service-text-"]')||"Residential";const C=null===(v=this.form)||void 0===v?void 0:v.closest(".short-form-component"),A=this.form.querySelector("#short-form-req-comment");let _=this.getCheckedPreferedComunnication();if(C){this.nameInput=this.form.querySelector("#short-form-req-name"),this.lastNameInput=this.form.querySelector("#short-form-req-lname"),this.businessNameInput=this.form.querySelector("#short-form-sendB-name")||this.form.querySelector("#sendB-name"),this.emailInput=this.form.querySelector("#short-form-req-email"),this.phoneInput=this.form.querySelector("#short-form-req-phone"),this.addressInput=this.form.querySelector("#short-form-req-address"),this.fullAddressInput=this.form.querySelector("#short-form-req-full-address");const e=C.querySelectorAll('input[name^="short-request-call"]');E=L(null===(g=Array.from(e))||void 0===g?void 0:g.filter(e=>e.checked),'input[name^="short-lead-service-text-"]')||"Residential"}else this.nameInput=this.form.querySelector("#req-name"),this.lastNameInput=this.form.querySelector("#req-lname"),this.businessNameInput=this.form.querySelector("#sendB-name"),this.emailInput=this.form.querySelector("#req-email"),this.phoneInput=this.form.querySelector("#req-phone"),this.addressInput=this.form.querySelector("#req-address"),this.fullAddressInput=this.form.querySelector("#req-full-address");let k="";if(I.length>0){const e=I[0],t=null===(f=null==e?void 0:e.parentElement)||void 0===f?void 0:f.querySelector(".lead-service-id");t&&(null==t?void 0:t.value)&&(k=null==t?void 0:t.value)}const N={nameInput:this.nameInput,lastNameInput:this.lastNameInput,businessNameInput:this.businessNameInput,emailInput:this.emailInput,phoneInput:this.phoneInput,addressInput
3:this.addressInput,isResidential:E,comments:(null==A?void 0:A.value)||"",preferCommunication:_||"",serviceText:b,fullAddressInput:this.fullAddressInput};return k&&(N.leadServiceId=k),Number.isNaN(this.serviceTypeID)||(N.serviceTypeID=this.serviceTypeID),N}validateInputs(){var e,t,o,n,i,s,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w,L,E,C,A,_,k,N,T,B;const P=this.getFormFields();window.getFormFields=P,null===(e=this.form)||void 0===e||e.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"));const j={};if(P.nameInput&&(""===(null===(t=P.nameInput)||void 0===t?void 0:t.value)?j[null===(o=P.nameInput)||void 0===o?void 0:o.id]="":r.REGEX.sendName.test(null===(n=P.nameInput)||void 0===n?void 0:n.value)||(j[null===(i=P.nameInput)||void 0===i?void 0:i.id]="Invalid name format.")),P.lastNameInput&&(""===(null===(s=P.lastNameInput)||void 0===s?void 0:s.value)?j[null===(l=P.lastNameInput)||void 0===l?void 0:l.id]="":r.REGEX.sendName.test(null===(a=P.lastNameInput)||void 0===a?void 0:a.value)||(j[null===(d=P.lastNameInput)||void 0===d?void 0:d.id]="Invalid last name format.")),P.businessNameInput&&""===(null===(c=P.businessNameInput)||void 0===c?void 0:c.value)&&(j[null===(u=P.businessNameInput)||void 0===u?void 0:u.id]="Invalid business name format."),P.phoneInput&&(""===(null===(m=P.phoneInput)||void 0===m?void 0:m.value)?j[P.phoneInput.id]="":(null===(p=null===(h=P.phoneInput)||void 0===h?void 0:h.value)||void 0===p?void 0:p.length)<14&&(j[P.phoneInput.id]="Invalid phone format.")),P.addressInput&&(""===(null===(v=P.addressInput)||void 0===v?void 0:v.value)?j[null===(g=P.addressInput)||void 0===g?void 0:g.id]="":r.REGEX.sendZip.test(null===(y=null===(f=P.addressInput)||void 0===f?void 0:f.value)||void 0===y?void 0:y.trim())&&"00000"!=(null===(b=this.addressInput)||void 0===b?void 0:b.value)||(j[null===(I=P.addressInput)||void 0===I?void 0:I.id]="Invalid zip code format.")),P.fullAddressInput)if(""===(null===(S=P.fullAddressInput)||void 0===S?void 0:S.value))j[null===(w=P.fullAddressInput)||void 0===w?void 0:w.id]="";else{this.getShouldRedirectToLeadFlow()&&!r.REGEX.sendAddress2.test(null===(L=P.fullAddressInput)||void 0===L?void 0:L.value)&&(j[null===(E=P.fullAddressInput)||void 0===E?void 0:E.id]="Invalid address format.")}P.emailInput&&(""===(null===(C=P.emailInput)||void 0===C?void 0:C.value)?j[null===(A=P.emailInput)||void 0===A?void 0:A.id]="":r.REGEX.sendEmail.test(null===(_=P.emailInput)||void 0===_?void 0:_.value)||(j[null===(k=P.emailInput)||void 0===k?void 0:k.id]="Invalid email address, please try again."));const D=this.form.querySelector("#short-form-req-comment");(null==D?void 0:D.required)&&""===P.comments&&(j[null==D?void 0:D.id]="");const M=null===(T=null===(N=this.form.querySelector("#short-form-req-pref-email,#short-form-req-pref-phone,short-form-req-pref-text"))||void 0===N?void 0:N.closest(".input-label-wrap"))||void 0===T?void 0:T.querySelector(".label-basic");let q=!1;M&&(q=M.hasAttribute("required")),q&&""===P.preferCommunication&&(j["shortform_preferred-contact"]="");const R=this.handleCheckboxChange();R&&(j[R]="");const O=this.handleRadioChange(),x=this.form.querySelector(".short-lead-radio-wrap"),F=null==x?void 0:x.querySelector(".error-msg");if(O&&(null==x?void 0:x.hasAttribute("required"))&&!(null===(B=null==F?void 0:F.classList)||void 0===B?void 0:B.contains("hidden"))){const e=O.replace("-error-msg","");j[e]=""}let $=this;return Object.keys(j).forEach((e,t)=>{let o=$.form.querySelector(`#${e}`);"short-lead-service-type"===e&&(o=$.form.querySelector(`.${e}`));const n=$.form.querySelector(`#${e}-error-msg`);if("shortform_preferred-contact"===e&&(null==n?void 0:n.classList.contains("hidden"))&&n.classList.remove("hidden"),o&&o.parentNode){const t=j[e],i=document.createElement("span");i.className="error-msg",i.id=`${e}-error-msg`,i.textContent=t,o.classList.add("invalid-field"),n&&n.classList.contains("hidden")&&n.classList.remove("hidden")}0==t&&o&&o.focus()}),0===Object.keys(j).length}getAddressValue(e,t){var o;return(null===(o=null==e?void 0:e.fullAddressInput)||void 0===o?void 0:o.value)?e.fullAddressInput.value:t}handleSubmit(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,i,l,d,I,w,L,C,A,_,k,N,T,B,P,j,D,M,q,R,O,x,F,$,H,z,W,U,G,V,J,Y,K,X,Z,Q,ee,te,oe;e.preventDefault();const ne=window.getFormFields?window.getFormFields:this.getFormFields();this.form=window.isShortForm?window.isShortForm:this.form;const ie=(0,c.getCampaignName)(),se=o;let re,le=window.location.hostname.toLowerCase();re=!!(le.includes("nblysbx")||le.includes("nblydev")||le.includes("nblytest"));const ae=null!==(n=null==t?void 0:t.franchiseWebLocationId)&&void 0!==n?n:void 0,de=null!==(i=null==t?void 0:t.franchiseId)&&void 0!==i?i:void 0,ce=null===(l=document.getElementById("conceptId"))||void 0===l?void 0:l.value,ue=null===(d=document.getElementById("conceptCode"))||void 0===d?void 0:d.value,me=ne.emailInput;if(!me.getAttribute("data-validation-result")){const e={value:me.value,signal:this.controller.signal,conceptCode:ue,historyCount:5};yield(0,E.validateEmail)(e)}const he=null===(I=document.getElementById("defaultCustomerType"))||void 0===I?void 0:I.value,pe=window.location.href;let ve,ge;const fe=yield(0,c.getBrandDetailsFromBrandJson)(ue);fe&&(ve=fe.vendorId,ge=fe.vendorName);const ye=null!==(L=null===(w=ne.lastNameInput)||void 0===w?void 0:w.value)&&void 0!==L?L:"",be=(A=null===(C=ne.businessNameInput)||void 0===C?void 0:C.value,
3null==fe?void 0:fe.enable_emailOptOut),Ie=(null==fe?void 0:fe.default_leadSourceID)||0,Se=null===(_=this.form)||void 0===_?void 0:_.closest(".short-form-component");let we="";(null==fe?void 0:fe.send_shortleadform_comments)&&Se&&(we=null==fe?void 0:fe.send_shortleadform_comments),(null==fe?void 0:fe.send_leadform_comments)&&!Se&&(we&&(we+=", "),we+=null==fe?void 0:fe.send_leadform_comments),(null==ne?void 0:ne.comments)&&(we&&(we+=", "),we+=ne.comments+" "),we+=(we?", ":"")+"Short Form Submit ID: 5h0r7";const Le={isLocalized:!0,firstName:(null===(k=ne.nameInput)||void 0===k?void 0:k.value.split(" ")[0])?null===(N=ne.nameInput)||void 0===N?void 0:N.value.split(" ")[0]:"",lastName:(null===(T=ne.nameInput)||void 0===T?void 0:T.value.split(" ")[1])?null===(B=ne.nameInput)||void 0===B?void 0:B.value.split(" ")[1]:" ",zipCode:null===(P=null==se?void 0:se.address)||void 0===P?void 0:P.postalCode.trim(),postalCode:null===(j=null==se?void 0:se.address)||void 0===j?void 0:j.postalCode.trim(),email:null===(D=ne.emailInput)||void 0===D?void 0:D.value,state:(null==t?void 0:t.state)||(null===(M=null==se?void 0:se.address)||void 0===M?void 0:M.state),city:(null==t?void 0:t.city)||(null===(q=null==se?void 0:se.address)||void 0===q?void 0:q.city),phone:null===(R=ne.phoneInput)||void 0===R?void 0:R.value,address:this.getAddressValue(ne,"No address collected"),address2:"",comments:we,note:we,signUpForUpdates:!1,conceptId:Number(ce),conceptCode:ue,leadSource:"WEB",leadOrigin:"WEB",phoneType:"true",isLeadOnly:!0,isTest:re,scheduleID:"",campaignName:ie,callType:"WEB",conceptCalledId:Number(ce),isEstimate:!1,emailOptOut:be,vendorId:Number(ve),vendorName:ge,currentPage:pe,customerType:ne.isResidential,preferredCommunicationType:(null==ne?void 0:ne.preferCommunication)||"Email,Phone",leadSourceId:Ie,webLocationId:0,licenseNumber:null==t?void 0:t.licenseNumber};if(Number.isNaN(this.serviceTypeID)||(Le.serviceTypeID=this.serviceTypeID),ae){Le.webLocationId=ae,Le.franchiseId=de;if((null!==(x=null===(O=document.getElementById("dbaName"))||void 0===O?void 0:O.value)&&void 0!==x?x:localStorage.getItem("dbaName"))&&(null==fe?void 0:fe.send_shortform_lead_bookingapi)){const e=sessionStorage.getItem("sAddressParam"),t=null!==($=null===(F=document.getElementById("weblocationId"))||void 0===F?void 0:F.value)&&void 0!==$?$:localStorage.getItem("weblocationId");if(e){let o=yield(0,c.getFranchiseWebLocationId)(e);Le.webLocationId=Number(null!=t?t:ae),Le.franchiseId=o?null==o?void 0:o.franchiseId:null}else if(t){Le.webLocationId=Number(t);const e=s.apiConfig.FranchisePOSLookup+t;try{let t=yield(0,u.getCachedAPIResponse)(e,m.apiCaching.POSSystemLookup);t.length>0&&(Le.franchiseId=(null===(H=t[0])||void 0===H?void 0:H.franchiseId)?null===(z=t[0])||void 0===z?void 0:z.franchiseId:null)}catch(e){console.error("Error fetching FranchisePOSLookup in Residential Forms")}}}}ye&&(Le.lastName=ye,Le.firstName=null!==(U=null===(W=ne.nameInput)||void 0===W?void 0:W.value)&&void 0!==U?U:"");try{if("dvw"===(null==ue?void 0:ue.toLocaleLowerCase())&&de){const e=`${s.apiConfig.howToKnow}/${de}`,t=(yield(0,u.cachedAPIWrapper)(e)).find(e=>"others"===(null==e?void 0:e.leadSourceName.toLocaleLowerCase()));(null==t?void 0:t.referralTypeId)&&(Le.referralTypeId=t.referralTypeId),(null==t?void 0:t.leadSourceName)&&(Le.referralType=t.leadSourceName)}}catch(e){console.error("An error occurred in generic-lead-sources API in ResidentialForm.ts file:",e)}ne.isResidential&&(Le.note&&(Le.note+=" , "),Le.note+=ne.isResidential);const Ee=yield(0,p.handleMissingData)(Le.city,Le.state,Le.zipCode);Le.city=(null==Ee?void 0:Ee.city)||Le.city,Le.state=(null==Ee?void 0:Ee.state)||Le.state;const Ce=null===(G=this.form)||void 0===G?void 0:G.closest(".tab-body");try{let n=(0,g.modalVisibilityCheck)(null===(V=null==Le?void 0:Le.zipCode)||void 0===V?void 0:V.trim());const i=(0,f.DomainIdentifier)(),s=(0,y.LocalizationIdentifier)();let l="";const d=r.REGEX.sendCaPostalCode.test((null===(J=Le.zipCode)||void 0===J?void 0:J.trim())||"")?"ca":"us";l=("us"===i&&!s||"us"===i&&"us"==s)&&"us"===d||n?"short-form-service-reminder-us":"short-form-service-reminder-ca",this.isCAReminderModal&&(n=!1),this.noteWithRequestBody=(0,v.disclaimerHandleCheck)(n,Ce,Le,Le.zipCode,l);const c=document.querySelector(".service-reminder-ca-modal");if(n&&!this.isCAReminderModal&&c&&"ca"==d&&"ca"!==s){(0,a.stopLoader)(),this.isCAReminderModal=!0,null===(K=null===(Y=document.getElementById("service-reminder-modal"))||void 0===Y?void 0:Y.querySelector(".primary-btn"))||void 0===K||K.addEventListener("click",()=>{var n,i,s,r;(0,a.startLoader)();const d=Ce.querySelector(`#${l}`);d&&(d.checked=!0),"isfakesubmit"!==(null===(n=Le.firstName)||void 0===n?void 0:n.toLowerCase())||"isfakesubmit"!==(null===(i=Le.lastName)||void 0===i?void 0:i.toLowerCase())?(this.handleSubmit(e,t,o),null===(s=document.querySelector(".service-reminder-ca-modal"))||void 0===s||s.click()):(this.handleSubmit(e,t,o),(0,a.stopLoader)(),null===(r=document.querySelector(".service-reminder-ca-modal"))||void 0===r||r.click())}),null===(Z=null===(X=document.getElementById("service-reminder-modal"))||void 0===X?void 0:X.querySelectorAll(".primary-outline-btn,#close-reminder-local-modal"))||void 0===Z||Z.forEach(n=>
3{n.addEventListener("click",()=>{var n,i;(0,a.startLoader)(),"isfakesubmit"!==(null===(n=Le.firstName)||void 0===n?void 0:n.toLowerCase())||"isfakesubmit"!==(null===(i=Le.lastName)||void 0===i?void 0:i.toLowerCase())?this.handleSubmit(e,t,o):(this.handleSubmit(e,t,o),(0,a.stopLoader)())})});const n=document.querySelector("#service-reminder-modal"),i=new b.Modal(n),s=this;return n&&(n.onclick=function(e){var r,l,d;(0,a.startLoader)(),e.target===n&&(null==i||i.hide()),"isfakesubmit"!==(null===(r=Le.firstName)||void 0===r?void 0:r.toLowerCase())||"isfakesubmit"!==(null===(l=Le.lastName)||void 0===l?void 0:l.toLowerCase())?(null===(d=document.querySelector(".service-reminder-ca-modal"))||void 0===d||d.click(),s.handleSubmit(e,t,o)):(0,a.stopLoader)()}),!1}(null===(Q=this.noteWithRequestBody)||void 0===Q?void 0:Q.note)&&(Le.note=this.noteWithRequestBody.note),(null===(ee=this.noteWithRequestBody)||void 0===ee?void 0:ee.comments)&&(Le.comments=this.noteWithRequestBody.comments),Le.optIn=this.noteWithRequestBody.optIn,Le.emailOptOut=this.noteWithRequestBody.emailOptOut,this.isCAReminderModal=!1}catch(e){console.error("An error occurred in disclaimerHandleCheck in ResidentialForm.ts file:",e)}let Ae=null==Ce?void 0:Ce.querySelector(".residential-form-container"),_e=null==Ce?void 0:Ce.querySelector(".form-heading-container"),ke=null==Ce?void 0:Ce.querySelector("#thank-you-header"),Ne=null==Ce?void 0:Ce.querySelector("#thank-you-description"),Te=null==Ce?void 0:Ce.querySelector("#error--header"),Be=null==Ce?void 0:Ce.querySelector("#error-description");if(Se){const e=null===(te=this.form)||void 0===te?void 0:te.closest(".short-form-component");Ae=e.querySelector(".residential-form-container"),_e=e.querySelector(".form-heading-container"),ke=e.querySelector("#shortform-thank-you-header"),Ne=e.querySelector("#shortform-thank-you-description"),Te=e.querySelector("#shortform-error--header"),Be=e.querySelector("#shortform-error-description")}(null==ne?void 0:ne.serviceText)&&(Le.serviceText=null==ne?void 0:ne.serviceText);if(this.getShouldRedirectToLeadFlow()){const e=Le.customerType;Le.customerType=e?e.toLowerCase():(null==he?void 0:he.toLowerCase())||"residential";const t=JSON.stringify(Le);sessionStorage.setItem("formValues",t),sessionStorage.setItem("shouldRedirectToLeadFlow","true");const o=null===(oe=document.getElementById("conceptCode"))||void 0===oe?void 0:oe.value,n=yield(0,c.getBrandDetailsFromBrandJson)(o);if(!(null==n?void 0:n.request_button_link_type))return;return globalThis.location.href=`${globalThis.location.origin}${null==n?void 0:n.request_button_link_type}`,void(0,a.stopLoader)()}sessionStorage.removeItem("shouldRedirectToLeadFlow"),yield(0,S.bookingUsPostCallWrapper)(s.apiConfig.BOOKING_API_URL,Le,!0).then(e=>{localStorage.setItem("weblocationId",Le.webLocationId.toString()),(0,a.stopLoader)();(0,h.gtmCustomEventLeadFlow)({event:"opus_form_submit_ev",status:"success"}),(0,c.storeBookingApiPayload)(Le,e),Ae.remove(),null==_e||_e.remove(),null==ke||ke.classList.remove("hidden"),null==Ne||Ne.classList.remove("hidden"),this.scrollToThankYouSection(Ce);const t=document.getElementById("close-local-modal");t&&t.click(),(0,c.insertAfterUrl)(),this.createHiddenLocalWeblocalIdInput(ae)}).catch(e=>{(0,a.stopLoader)();(0,h.gtmCustomEventLeadFlow)({event:"opus_form_submit_ev",status:"failure"}),this.handleCloseNearByLocationsModal(),null==Te||Te.classList.remove("hidden"),null==Be||Be.classList.remove("hidden"),null==Ae||Ae.remove(),null==_e||_e.remove()})})}getAddress(e){let t=e;return t.title="No address collected",t}handleErrorcase(e=0){var t,o,n,i,s;let r,l,d,c,u,m=(null===(t=this.form)||void 0===t?void 0:t.closest(".short-form-component"))||(null===(o=null===globalThis||void 0===globalThis?void 0:globalThis.isShortForm)||void 0===o?void 0:o.closest(".short-form-component"));const h=(null===(n=this.form)||void 0===n?void 0:n.closest(".residential-form-container"))||(null===(i=null===globalThis||void 0===globalThis?void 0:globalThis.isShortForm)||void 0===i?void 0:i.closest(".residential-form-container"));if(h&&(c=h.parentElement,c&&(r=c.querySelector("#error--header"),l=c.querySelector("#error-description"),d=c.querySelector("#no-service-header"),u=c.querySelector("#no-service-description"))),m){const t=m.querySelector(".form-heading-container"),o=m.querySelector('div[class*="form-container"]');r=m.querySelector("#shortform-error--header"),l=m.querySelector("#shortform-error-description"),d=m.querySelector("#shortform-no-service-header");const n=m.querySelector("#shortform-no-service-description");t.classList.add("hidden"),o.classList.add("hidden"),1===e?(r.classList.remove("hidden"),l.classList.remove("hidden"),d.classList.add("hidden"),n.classList.add("hidden")):(r.classList.add("hidden"),l.classList.add("hidden"),d.classList.remove("hidden"),n.classList.remove("hidden")),this.scrollToThankYouSection()}else{1===e?(null==r||r.classList.remove("hidden"),null==l||l.classList.remove("hidden"),null==d||d.classList.add("hidden"),null==u||u.classList.add("hidden")):(null==r||r.classList.add("hidden"),null==l||l.classList.add("hidden"),null===(s=null==d?void 0:d.classList)||void 0===s||s.remove("hidden"),null==u||u.classList.remove("hidden"));const t=null==c?void 0:c.querySelector(".form-heading-container"),o=null==c?void 0:c.querySelector('div[class*="form-container"]');null==t||t.classList.add("hidden"),null==o||o.classList.add("hidden"),this.scrollToThankYouSection()}(0,a.stopLoader)()}asideCardToMobile(){const e=document.querySelector(".aside-card.tabs"),t=document.querySelector(".aside-card.tabs-mobile");try{if(e&&t)if(window.innerWidth<=768)for(;e.firstChild;)t.appendChild(e.firstChild);else for(;t.firstChild;)e.appendChild(t.firstChild)}catch(e){console.log("Error in Residential form: ",e)}}handleCloseNearByLocationsModal(){const e=document.querySelector("#findnearby-user-zip-code .close-modal-btn");e&&e.click()}checkToShowCARemainderModal(e,t,o,i){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,s,l,d,c,u,m;try{let h=(0,g.modalVisibilityCheck)(null===(n=null==e?void 0:e.zipCode)||void 0===n?void 0:n.trim());const p=(0,f.DomainIdentifier)(),v=(0,y.LocalizationIdentifier)();let I="";const S=r.REGEX.sendCaPostalCode.test((null===(s=e.zipCode)||void 0===s?void 0:s.trim())||"")?"ca":"us";I=("us"===p&&!v||"us"===p&&"us"==v)&&"us"===S?"short-form-service-reminder-us":"short-form-service-reminder-ca";const w=null===(l=this.form)||void 0===l?void 0:l.closest(".tab-body"),L=document.querySelector(".service-reminder-ca-modal");if(h&&L&&"ca"==S&&"ca"!==v){L.click(),(0,a.stopLoader)(),this.isCAReminderModal=!0,null===(c=null===(d=document.getElementById("service-reminder-modal"))||void 0===d?void 0:d.querySelector(".primary-btn"))||void 0===c||c.addEventListener("click",()=>{var n,s,r;(0,a.startLoader)();const l=w.querySelector(`#${I}`);l&&(l.checked=!0),this.fetchNearByLocations(o,t,i),((null===(n=e.firstName)||void 0===n?void 0:n.toLowerCase().includes("isfakesubmit"))||(null===(s=e.lastName)||void 0===s?void 0:s.toLowerCase().includes("isfakesubmit")))&&(0,a.stopLoader)(),null===(r=document.querySelector(".service-reminder-ca-modal"))||void 0===r||r.click()});const n=null!==(m=null===(u=document.getElementById("service-reminder-modal"))||void 0===u?void 0:u.querySelectorAll(".primary-outline-btn,#close-reminder-local-modal"))&&void 0!==m?m:[];for(const s of n)s.addEventListener("click",()=>{var n,s;(0,a.startLoader)(),this.fetchNearByLocations(o,t,i),((null===(n=e.firstName)||void 0===n?void 0:n.toLowerCase().includes("isfakesubmit"))||(null===(s=e.lastName)||void 0===s?void 0:s.toLowerCase().includes("isfakesubmit")))&&(0,a.stopLoader)()});const s=document.querySelector("#service-reminder-modal"),r=new b.Modal(s);return s&&(s.onclick=o=>{var n,l,d;(0,a.startLoader)(),o.target===s?(null===(n=e.firstName)||void 0===n?void 0:n.toLowerCase().includes("isfakesubmit"))||(null===(l=e.lastName)||void 0===l?void 0:l.toLowerCase().includes("isfakesubmit"))?(0,a.stopLoader)():(null===(d=document.querySelector(".service-reminder-ca-modal"))||void 0===d||d.click(),this.fetchNearByLocations(o,t,i)):null==r||r.hide()}),!0}return this.isCAReminderModal=!1,!1}catch(e){return console.error("An error occurred in handleCAReminderModal in ResidentialForm.ts file:",e),!1}})}constructNearbyLocationsModal(e,t="miles"){var o;const n=document.querySelector(".user-zip-result-list");if(n.innerHTML="",e)for(const i of e){const e=document.createElement("li");e.className="user-zip-result-item",t.includes("mi")&&(t="mi.",i.distance=.62
31371*i.distance);const s=Math.round(i.distance)+" "+t,r=(null===(o=null==i?void 0:i.websiteTrackingPhone)||void 0===o?void 0:o.length)>0?i.websiteTrackingPhone[0]:i.phoneNumber,l=(null==i?void 0:i.websiteUrl)?'<div class="locaion-btn"><button class="btn primary-btn">Select Location</button></div>':"";e.innerHTML=`\n <div class="locaion-info">\n <div class="locaion-time">\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use>\n </svg>\n <span class="location-text">${s}</span>\n </div>\n <div class="locaion-name">\n <p class="location-main">${null==i?void 0:i.doingBusinessAs}</p>\n <a class="location-call" href="tel:${r}">(${null==r?void 0:r.slice(0,3)}) ${null==r?void 0:r.slice(3,6)}-${null==r?void 0:r.slice(6)}</a>\n <p class="location-zip-code hidden">${null==i?void 0:i.zipCode}</p>\n </div>\n </div>\n ${l}`,null==n||n.appendChild(e)}}displayNearByLocations(e,t,o="miles"){var i,s,r;(0,a.stopLoader)();const l=document.getElementById("findnearby-user-zip-code");if(!l)return;const d=null===(i=null==t?void 0:t.address)||void 0===i?void 0:i.postalCode.trim(),u=null==e?void 0:e.length,m=document.querySelector(".results-text");m&&d&&(m.textContent=` ${u} Results for ${d}`);const h=null===(s=null==e?void 0:e.slice())||void 0===s?void 0:s.sort((e,t)=>e.distance-t.distance);this.constructNearbyLocationsModal(h,o);const p=document.querySelector("#findnearby-user-zip-code .close-modal-btn");p&&p.addEventListener("click",()=>{null==l||l.classList.add("hidden")}),null===(r=document.querySelector(".findnearby-modal"))||void 0===r||r.click();const v=document.querySelectorAll(".locaion-btn .btn.primary-btn");for(const o of v)o.addEventListener("click",o=>(0,n.__awaiter)(this,void 0,void 0,function*(){var n,i;o.preventDefault();const s=o.currentTarget.closest("li.user-zip-result-item");if(s){const r=null===(n=s.querySelector(".location-main"))||void 0===n?void 0:n.textContent;let l=e.find(e=>e.doingBusinessAs===r);if(l){yield(0,c.localizationHelper)([l],!0,!1),sessionStorage.setItem("isNearbyRedirect","true");let e={city:null==l?void 0:l.city,state:null==l?void 0:l.state,franchiseWebLocationId:Number(null==l?void 0:l.franchiseWebLocationId),franchiseId:null==l?void 0:l.franchiseId,licenseNumber:null!==(i=null==l?void 0:l.licenseNumber)&&void 0!==i?i:""};this.handleCloseNearByLocationsModal(),this.handleSubmit(o,e,t)}}}))}handleLocationResults(e,t,o){var n,i,s;const r={franchiseId:t[0].franchiseId,franchiseWebLocationId:t[0].franchiseWebLocationId},l=t[0].doingBusinessAs,a=(null!==(i=null===(n=t[0].locationWebsiteUrl)||void 0===n?void 0:n.replace(/\/$/,""))&&void 0!==i?i:"").toLowerCase().split("/"),d=a[a.length-1];d&&(localStorage.setItem("dbaName",d),(0,L.localizationTagUpadation)()),localStorage.setItem("franchiseWebLocationId",null===(s=t[0])||void 0===s?void 0:s.franchiseWebLocationId),localStorage.setItem("doingBusinessAs",l),this.handleSubmit(e,r,o)}handleNearbyLocationsResponse(e,t,o,n,i){(null==e?void 0:e.length)>1?this.displayNearByLocations(e,o,n):1===(null==e?void 0:e.length)?(sessionStorage.setItem("isNearbyRedirect","true"),this.handleLocationResults(t,e,o)):(null==i?void 0:i.lead_contactapi)?this.contactUsApiCall(o):this.handleErrorcase(null===e?1:0)}fetchNearByLocations(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,i,s;const r=document.getElementById("conceptCode"),l=yield(0,c.getBrandDetailsFromBrandJson)(null==r?void 0:r.value),a=null===(n=null==t?void 0:t.address)||void 0===n?void 0:n.postalCode.trim();sessionStorage.setItem("serviceIdValue",o);try{const n=Number(null==l?void 0:l.nearest_franchiselimit_shortform)||50,d=null!==(s=null===(i=null==l?void 0:l.area_measure_values_shortform)||void 0===i?void 0:i.includes("miles"))&&void 0!==s&&s?"miles":"km";let c;if(null==l?void 0:l.use_miles_endPoint){const e=new A.NearbyLocationsMiles(a,null==r?void 0:r.value,A.ComponentType.SHORT_FORM,o);c=yield e.searchNearbyLocations()}else{let e=new C.NearbyLocations(d,n);c=yield e.searchNearbyLocations(a)}this.handleNearbyLocationsResponse(c,e,t,d,l)}catch(e){this.handleErrorcase(1),console.error("Error searching nearby locations:",e)}})}handleNearByLocations(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const n=this.getFormFields();(yield this.checkToShowCARemainderModal(n,t,e,o))||this.fetchNearByLocations(e,t,o)}catch(n){console.error("An error occurred while showing CA Remainder modal:",n),this.fetchNearByLocations(e,t,o)}})}getFranchiseWebLocationId(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var i,s,r,u;e.preventDefault();const m=this.getFormFields(),h=t,p=null===(i=this.form)||void 0===i?void 0:i.closest(".tab-body");let v=null==p?void 0:p.querySelector("#error--header"),g=null==p?void 0:p.querySelector("#error-description"),f=null===(s=this.form)||void 0===s?void 0:s.closest(".short-form-component");if(f){const e=null===(r=this.form)||void 0===r?void 0:r.closest(".short-form-component");v=e.querySelector("#shortform-error--header"),g=e.querySelector("#shortform-error-description")}if(this.validateInputs()){(0,a.startLoader)();const i=document.getElementById("conceptCode"),s=yield(0,c.getBrandDetailsFromBrandJson)(null==i?void 0:i.value);if((null==s?void 0:s.send_leadform_contactus_api)&&!f)return void this.contactUsApiCall(t);if((null==s?void 0:s.send_shortleadform_contactus_api)&&f)return void this.contactUsApiCall(t);const r=o;(0,c.getFranchiseDetails)(null===(u=null==h?void 0:h.address)||void 0===u?void 0:u.postalCode.trim(),!1,r).then(o=>(0,n.__awaiter)(this,void 0,void 0,function*(){var n,i;const l=o;if(l.length>0)this.handleLocationResults(e,l,t);else if(0===l.length&&(null==s?void 0:s.enable_50mile_areameasure_shortform)&&!(null==s?void 0:s.send_shortform_lead_bookingapi))this.handleNearByLocations(e,t,r);else{const o=null!==(i=null===(n=document.getElementById("dbaName"))||void 0===n?void 0:n.value)&&void 0!==i?i:localStorage.getItem("dbaName");if((null==s?void 0:s.send_shortform_lead_bookingapi)&&o){const o={franchiseId:null,franchiseWebLocationId:localStorage.getItem("weblocationId")};this.handleSubmit(e,o,t)}else(null==s?void 0:s.lead_contactapi)?this.contactUsApiCall(t):this.handleErrorcase();(0,a.stopLoader)()}})).catch(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i;(0,a.stopLoader)();const s=document.getElementById("conceptCode"),r=yield(0,c.getBrandDetailsFromBrandJson)(null==s?void 0:s.value),u=document.querySelector(".step-1");u&&u.classList.add("hidden"),"function"==typeof(null==e?void 0:e.then)&&(e=yield e);let h=null===(n=null===(o=null==e?void 0:e.response)||void 0===o?void 0:o.data)||void 0===n?void 0:n.message;if(h||(h=null==e?void 0:e.message),h||(h=""),"full address is needed to narrow down results"===h.toLowerCase()){(new l.StateHandler).getStateFun();const e=document.querySelector(".find-local");null==e||e.click();const t=document.querySelector(".step-2");if(t){t.classList.remove("hidden"),t.classList.add("block");const e=document.querySelector(".close-modal-btn");null==e||e.addEventListener("click",function(e){t.classList.add("hidden"),u.classList.remove("hidden")})}document.querySelector(".step-2 #modal-zipcode").value=null===(i=m.addressInput)||void 0===i?void 0:i.value,sessionStorage.setItem("shortFormAddressBumper","true");new d.LocateAddressBumper}else if(null==r?void 0:r.lead_contactapi)this.contactUsApiCall(t);else{let e=null==p?void 0:p.querySelector(".residential-form-container"),t=null==p?void 0:p.querySelector(".form-heading-container");null==e||e.remove(),null==t||t.remove(),null==v||v.classList.remove("hidden"),null==g||g.classList.remove("hidden")}}))}})}contactUsApiCall(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,l,d,u,m,h,p,S,w,L,E,C,A,k,N,T,B,P,j,D,M,q,R,O,x,F,$,H,z,W,U;const G=null!==(t=globalThis.getFormFields)&&void 0!==t?t:this.getFormFields();this.form=null!==(o=globalThis.isShortForm)&&void 0!==o?o:this.form;const V=document.getElementById("conceptCode"),J=document.getElementById("conceptId"),Y=null!==(i=null===(n=G.lastNameInput)||void 0===n?void 0:n.value)&&void 0!==i?i:"",K=e,X=null===(l=this.form)||void 0===l?void 0:l.closest(".tab-body");let Z=null==X?void 0:X.querySelector(".residential-form-container"),Q=null==X?void 0:X.querySelector(".form-heading-container"),ee=null==X?void 0:X.querySelector("#thank-you-header"),te=null==X?void 0:X.querySelector("#thank-you-description"),oe=null==X?void 0:X.querySelector("#error--header"),ne=null==X?void 0:X.querySelector("#error-description");const ie=null===(d=this.form)||void 0===d?void 0:d.closest(".short-form-component");let se,re="";if(ie){const e=null===(u=this.form)||void 0===u?void 0:u.closest(".short-form-component");Z=e.querySelector(".residential-form-container"),Q=e.querySelector(".form-heading-container"),ee=e.querySelector("#shortform-thank-you-header"),te=e.querySelector("#shortform-thank-you-description"),oe=e.querySelector("#shortform-error--header"),ne=e.querySelector("#shortform-error-description"),re=null===(m=e.querySelector("#short-form-req-comment"))||void 0===m?void 0:m.value}try{const t=yield(0,c.getBrandDetailsFromBrandJson)(null==V?void 0:V.value);if(t.lead_contactapi||(null==t?void 0:t.send_leadform_contactus_api)||(null==t?void 0:t.send_shortleadform_contactus_api)||(null==t?void 0:t.send_nonagnostic_to_contact_endpoint)){t&&(se=t.vendorId);let o="";(null===(h=t.osflow_contactUs_comments)||void 0===h?void 0:h.length)>0&&(o=t.osflow_contactUs_comments),(null==t?void 0:t.send_leadform_comments)&&!ie&&(o&&(o+=" , "),o+=null==t?void 0:t.send_leadform_comments),(null==t?void 0:t.send_shortleadform_comments)&&ie&&(o&&(o+=" , "),o+=null==t?void 0:t.send_shortleadform_comments);const n={firstName:(null===(p=G.nameInput)||void 0===p?void 0:p.value.split(" ")[0])?null===(S=G.nameInput)||void 0===S?void 0:S.value.split(" ")[0]:"",lastName:(null===(w=G.nameInput)||void 0===w?void 0:w.value.split(" ")[1])?null===(L=G.nameInput)||void 0===L?void 0:L.value.split(" ")[1]:" ",zipCode:(null==t?void 0:t.send_nonagnostic_to_contact_endpoint)?e:null===(E=null==K?void 0:K.address)||void 0===E?void 0:E.postalCode.trim(),email:null===(C=G.emailInput)||void 0===C?void 0:C.value,state:null===(A=null==K?void 0:K.address)||void 0===A?void 0:A.state,city:null===(k=null==K?void 0:K.address)||void 0===k?void 0:k.city,phone:null===(N=G.phoneInput)||void 0===N?void 0:N.value,address:(null==K?void 0:K.title)?null==K?void 0:K.title:this.getAddressValue(G,null===(T=null==K?void 0:K.address)||void 0===T?void 0:T.label),address2:"",country:null!==(P=null===(B=null==K?void 0:K.address)||void 0===B?void 0:B.country)&&void 0!==P?P:"",comments:o,signUpForUpdates:!1,isLocalized:"25"===(null==J?void 0:J.value),isNewCustomer:"",isTest:!0,
3conceptId:Number(null==J?void 0:J.value),vendorId:Number(se),companyName:(null===(j=G.businessNameInput)||void 0===j?void 0:j.value)||""};if((null==t?void 0:t.send_leadform_contactus_api)&&!(null==t?void 0:t.send_leadform_value)&&!ie||(null==t?void 0:t.send_shortleadform_contactus_api)&&ie&&!(null==t?void 0:t.send_shortleadform_value)){const e=yield(0,c.getFranchiseWebLocationIdDetails)(null===(D=null==K?void 0:K.address)||void 0===D?void 0:D.postalCode.trim());"25"!==(null==J?void 0:J.value)&&e&&(n.franchiseWebLocationId=Number(e),n.isLocalized=!0)}re&&(n.comments&&(n.comments+=" , "),n.comments+=re);const i=window.location.hostname.toLowerCase();i.includes("nblysbx")||i.includes("nblydev")||i.includes("nblytest")||i.includes("localhost")?n.isTest=!0:n.isTest=!1,Y&&(n.lastName=Y,n.firstName=null!==(q=null===(M=G.nameInput)||void 0===M?void 0:M.value)&&void 0!==q?q:"");try{let o=(0,g.modalVisibilityCheck)(null===(R=null==n?void 0:n.zipCode)||void 0===R?void 0:R.trim());const i=(0,f.DomainIdentifier)(),s=(0,y.LocalizationIdentifier)();let l="";const d=r.REGEX.sendCaPostalCode.test(null===(O=n.zipCode)||void 0===O?void 0:O.trim())?"ca":"us";l=("us"===i&&!s||"us"===i&&"us"==s)&&"us"===d||o?"short-form-service-reminder-us":"short-form-service-reminder-ca",this.isCAReminderModal&&(o=!1),this.noteWithRequestBody=(0,v.disclaimerHandleCheck)(o,X,n,n.zipCode,l);const c=document.querySelector(".service-reminder-ca-modal");if(o&&!this.isCAReminderModal&&c&&"ca"==d&&"ca"!==s){(0,a.stopLoader)(),this.isCAReminderModal=!0,null===(F=null===(x=document.getElementById("service-reminder-modal"))||void 0===x?void 0:x.querySelector(".primary-btn"))||void 0===F||F.addEventListener("click",()=>{var t;(0,a.startLoader)(),this.contactUsApiCall(e);const o=X.querySelector(`#${l}`);o&&(o.checked=!0),null===(t=document.querySelector(".service-reminder-ca-modal"))||void 0===t||t.click()}),null===(H=null===($=document.getElementById("service-reminder-modal"))||void 0===$?void 0:$.querySelectorAll(".primary-outline-btn,#close-reminder-local-modal"))||void 0===H||H.forEach(t=>{t.addEventListener("click",()=>{(0,a.startLoader)(),this.contactUsApiCall(e)})});const t=document.querySelector("#service-reminder-modal"),o=new b.Modal(t),n=this;return t&&(t.onclick=function(i){var s;(0,a.startLoader)(),i.target===t&&(null==o||o.hide()),null===(s=document.querySelector(".service-reminder-ca-modal"))||void 0===s||s.click(),n.contactUsApiCall(e)}),!1}(null===(z=this.noteWithRequestBody)||void 0===z?void 0:z.comments)&&(n.comments=this.noteWithRequestBody.comments),n.optIn=this.noteWithRequestBody.optIn,n.emailOptOut=this.noteWithRequestBody.emailOptOut,this.isCAReminderModal=!1;const u=ie&&(null==t?void 0:t.send_shortleadform_value),m=!ie&&(null==t?void 0:t.send_leadform_value);(m||u)&&(u&&(n.formType=null!==(W=null==t?void 0:t.send_shortleadform_value)&&void 0!==W?W:""),m&&(n.formType=null!==(U=null==t?void 0:t.send_leadform_value)&&void 0!==U?U:""),delete n.franchiseWebLocationId,n.isLocalized=!1)}catch(e){console.error("An error occurred in disclaimerHandleCheck in ResidentialForm.ts file:",e)}const l=document.getElementById("conceptId");if("255"===((null==l?void 0:l.value)?l.value.trim().toLowerCase():""))try{yield _.NblyBrandContactUs.getInstance().callParallelEmails(n)}catch(e){throw console.error("Error sending Nbly brand contact emails:",e),e}else yield(0,I.contactUsPostCallWrapper)(s.apiConfig.CONTACT_US_SEND,n);null==Z||Z.remove(),null==Q||Q.remove(),ee&&(ee.classList.remove("hidden"),te.classList.remove("hidden")),this.scrollToThankYouSection(X),(0,a.stopLoader)()}}catch(e){console.error(`Error in Residential.ts file in the contactUsApiCall function. Error message: ${e}`),null==oe||oe.classList.remove("hidden"),null==ne||ne.classList.remove("hidden"),null==Z||Z.remove(),null==Q||Q.remove(),(0,a.stopLoader)()}})}createHiddenLocalWeblocalIdInput(e){const t=document.createElement("input");t.type="hidden",t.value=e,t.id="local_weblocationId",document.body.appendChild(t)}formatZipCode(e){if(!e)return"";try{const t=e.replace(/[^A-Z0-9]/gi,"").toUpperCase();return/^[A-Z]\d[A-Z]\d[A-Z]\d$/.test(t)?t.replace(/^(.{3})(.{3})$/,"$1 $2"):e}catch(t){return console.warn("Error formatting zip code:",t),e}}calculateShortFormCount(){const e=document.querySelectorAll(".aside-card.tabs .tabs-wrapper");
3null==e||e.forEach((e,t)=>{var o;const n=e.querySelectorAll("label"),i=e.querySelectorAll("ul.req-call-tabs");if(e.querySelectorAll(".lead-service-type,.short-lead-service-type").length>0){null===(o=e.querySelector("ul.req-call-tabs"))||void 0===o||o.remove();const n=`short-request-call-${t+1}`,i=e.querySelectorAll(".lead-service-type,.short-lead-service-type");null==i||i.forEach(e=>{e.name=`${n}`,e.id=`${e.id}-${t+1}`})}null==i||i.forEach(e=>{const o=`short-request-call-${t+1}`,n=e.querySelectorAll("input");null==n||n.forEach(e=>{e.name=`${o}`,e.id=`${e.id}-${t+1}`})}),null==n||n.forEach(e=>{if(e.htmlFor){const o=`short-form-${e.htmlFor}-${t+1}`;e.htmlFor=o}})});const t=document.querySelectorAll(".req-call-tablist .req-call-radio");null==t||t.forEach(e=>{const t=e;(t.hasAttribute("checked")||t.checked)&&(t.checked=!0)})}}new k},"./src/js/opus2/hero_component/index.ts"(e,t,o){"use strict";o(/*! ./ResidentialForm */"./src/js/opus2/hero_component/ResidentialForm.ts")},"./src/js/opus2/hms/hms-step1.ts"(e,t,o){"use strict";o.d(t,{ScheduleService:()=>L,getHmsBooking:()=>b,getIsLeadDataHms:()=>S,setHmsBooking:()=>I,setIsLeadDataHms:()=>w});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../util/gtm-custom-event-lead-flow */"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"),c=o(/*! ../footer/footer */"./src/js/opus2/footer/footer.ts"),u=o(/*! ./step2 */"./src/js/opus2/hms/step2.ts"),m=o(/*! ./step3 */"./src/js/opus2/hms/step3.ts"),h=o(/*! ./step4 */"./src/js/opus2/hms/step4.ts"),p=o(/*! ../lead-flow */"./src/js/opus2/lead-flow/index.ts"),v=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),g=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts");let f={},y=!1;const b=()=>f,I=e=>{f=e,sessionStorage.setItem("hms_booking",JSON.stringify(f))},S=()=>y,w=e=>{y=e};class L{constructor(){this.isLead=!1,this.skipPOSLookupCall=!0,this.isLeadPage=!1;const e=document.querySelectorAll("#form-section .contact-us-section"),t=document.querySelector(".scheduler-main .container");t&&(t.style.display="");const o=JSON.parse(sessionStorage.getItem("hms_booking")),n=sessionStorage.getItem("sAddressParam");e.length>0?(this.insideOnlinePage(n,o),sessionStorage.removeItem("locationLeadFlow")):(this.reconstructRedirectPopup(),this.nonLeadFlowPage(n,o))}static getInstance(){return L.instance||(L.instance=new L),L.instance}reconstructRedirectPopup(){const e=document.createElement("div");e.innerHTML='<div class="redirection-modal hidden modal justify-center items-center" id="redirection-modal" data-nbly="redirection-modal" tabindex="-1" aria-hidden="true" data-modal-backdrop="static">\n <div class="modal-loc-inner">\n <div class="modal-loc-div">\n <div class="modal-header">\n <button type="button" class="close-modal-btn" data-modal-hide="redirection-modal">\n <img src="/brand/_assets/images/brand-img/close-circle.svg" alt="close modal" width="24" height="24">\n <span class="sr-only">Close modal</span>\n </button>\n </div>\n <div class="modal-body">\n \n <div class="text-wrapper">\n <h2 class="modal-heading">Connecting with your local HouseMaster</h2>\n <img class="brand-logo" src="/brand/_assets/images/brand-img/brand-logo.svg" alt="Connecting with your local HouseMaster" width="230" height="48">\n <p class="modal-text">HouseMaster is a Neighborly Company. You are being transferred to Neighborly.com to complete you scheduled request.</p>\n <button type="button" data-modal-hide="redirection-modal" class="primary-btn close-modal-btn">Continue</button>\n </div>\n </div>\n </div>\n </div>\n </div>';const t=e.firstChild;t&&document.body.appendChild(t);const o=document.createElement("div");o.innerHTML='<a href="#" data-modal-target="redirection-modal" data-modal-toggle="redirection-modal" id="open-redirection-modal" class="hidden">\n <div>Redirection Modal</div>\n </a>';const n=o.firstChild;n&&document.body.appendChild(n)}insideOnlinePage(e,t){var o,n;if(this.isLeadPage=!0,e)return this.checkPOSSystemWithZip(e),void this.handleEventListeners();{const e=document.getElementById("local_weblocationId"),t=sessionStorage.getItem("hms_weblocation_temp"),i=null!==(n=null!==(o=null==e?void 0:e.value)&&void 0!==o?o:t)&&void 0!==n?n:"";i&&this.checkPOSSystemWithWebLocation(i)}(null==t?void 0:t.zipcode)&&(this.checkPOSSystemWithZip(null==t?void 0:t.zipcode),I(t),this.nextStep2(null)),this.handleEventListeners()}nonLeadFlowPage(e,t){var o,n;if(this.isLeadPage=!1,e)this.addEventListnersToHMSCta(e,"zip");else{{const e=document.getElementById("local_weblocationId"),t=document.getElementById("weblocationId"),i=null!==(n=null!==(o=null==e?void 0:e.value)&&void 0!==o?o:null==t?void 0:t.value)&&void 0!==n?n:"";i&&(sessionStorage.setItem("hms_weblocation_temp",i),this.addEventListnersToHMSCta(i,"weblocation"))}(null==t?void 0:t.zipcode)&&this.addEventListnersToHMSCta(e,"zip")}}addEventListnersToHMSCta(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=yield this.getAuthoredCtaLinkFromBrand();if(o){const n=document.querySelectorAll(`a[href="${o}"]`);if(JSON.parse(sessionStorage.getItem("locationLeadFlow"))){this.reDirectComputeIfitsRedirect(e,t,o);sessionStorage.getItem("redirectionURL")||sessionStorage.removeItem("locationLeadFlow")}
3else n.forEach(n=>{n.addEventListener("click",n=>{n.preventDefault(),this.reDirectComputeIfitsRedirect(e,t,o)})})}})}getAuthoredCtaLinkFromBrand(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,a.getBrandDetailsFromBrandJson)(o);return null!==(t=null==n?void 0:n.request_button_link_type)&&void 0!==t?t:null})}reDirectComputeIfitsRedirect(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){(0,l.startLoader)();try{"zip"===t?yield this.reDirectHandleZipType(e,o):"weblocation"===t&&(yield this.reDirectHandleWebLocationType(e,o))}catch(o){console.error(`Error processing ${t} type for value: ${e}`,o)}finally{(0,l.stopLoader)()}})}reDirectHandleZipType(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=i.apiConfig.POSLookup+e;try{const n=yield(0,v.getCachedAPIResponse)(o,s.apiCaching.POSSystemLookup);if(n){const o=n[0].posName;this.POSObject=n[0],null===o&&null==n[0].franchiseWebLocationId?window.location.href=t:null===o&&null!==n[0].franchiseWebLocationId||"isn"===o.toLowerCase()?(sessionStorage.setItem("hms_lead_ISN_zip",e),yield this.reDirectProcessISNZip(e,t)):"onverity"===o.toLowerCase()&&(window.location.href=t)}}catch(t){console.error(`Error fetching POS systems for ${e}`,t)}})}reDirectProcessISNZip(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o=yield(0,a.getFranchiseDetails)(e);if(o.length>0){const{franchiseWebLocationId:e}=o[0],n={franchiseWeblocationId:e};(null==n?void 0:n.franchiseWeblocationId)&&(yield this.reDirectFetchFullAttribute(null==n?void 0:n.franchiseWeblocationId,t))}}catch(t){console.error(`Error fetching LocateLocationApiWithRoundRobinTrue for ${e}`,t)}})}reDirectHandleWebLocationType(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(this.skipPOSLookupCall)yield this.reDirectFetchFullAttribute(e,t);else{const o=i.apiConfig.FranchisePOSLookup+e;try{const n=yield(0,v.getCachedAPIResponse)(o,s.apiCaching.FranchisePOSLookup);if(n){const o=n[0].posName;this.POSObject=n[0],null===o&&null==n[0].franchiseWebLocationId?window.location.href=t:null===o&&null!==n[0].franchiseWebLocationId||"isn"===o.toLowerCase()?yield this.reDirectFetchFullAttribute(e,t):"onverity"===o.toLowerCase()&&(window.location.href=t)}}catch(t){console.error(`Error fetching POS systems for weblocationID: ${e}`,t)}}})}reDirectFetchFullAttribute(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;try{const e=yield(0,v.cachedAPIWrapper)(o,s.apiCaching.FullAttributeResponse);this.onlineScheduling=null==e?void 0:e.onlineScheduling,this.onlineScheduling?this.redirectToExternalSite(e.franchiseWebLocationMarketingId):window.location.href=t}catch(t){throw console.error(`Error fetching Full Attribute for ${e}`,t),new Error("Error fetching Full Attribute")}})}init(){var e,t;this.onlineScheduling=!1;const o=window.location.pathname.includes("schedule-appointment"),n=null===(e=document.getElementById("dbaName"))||void 0===e?void 0:e.value,i=null===(t=document.getElementById("weblocationId"))||void 0===t?void 0:t.value,s=document.querySelector(".scheduler-main .container");s&&(s.style.display=""),n&&i&&(sessionStorage.setItem("isLocal","true"),localStorage.setItem("franchiseWebLocationId",i)),this.CloseErrorModal(),this.initBackBtn(),"true"==(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.isLocal)&&o&&(this.isLead=!0,this.getDetails(sessionStorage.franchiseWebLocationId))}handleEventListeners(){var e;this.localSearchInput=document.getElementById("location-search-input"),this.headerBtnZipcode=document.querySelector(".zip-modal form .btn-container .primary-btn"),this.cancelBtn=document.querySelector("#zip-modal .white-btn"),this.headerBtnZipcode&&this.headerBtnZipcode.addEventListener("click",this.handleButtonSubmit.bind(this)),this.localSearchInput&&(null===(e=this.localSearchInput)||void 0===e||e.addEventListener("input",this.zipCodeError.bind(this)),document.getElementById("step1-title").style.display="block",document.getElementById("step1-subtitle").style.display="none"),this.cancelBtn&&this.cancelBtn.addEventListener("click",this.handleCancelBtnClick.bind(this))}handleErrorModal(){var e,t;const o=document.getElementById("modal-hms-appoinment-slot-error");
3if(o){const n='\n <p class="title">\n <svg aria-hidden="true" class="close-icon"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#information-circle"></use></svg>Please call us to find a franchise near you.</p>\n <p class="text-center">We apologize for the inconvenience. Please call us at (800) 526-3939 and we will help you book an inspection.</p>\n <strong></strong>\n ';o.innerHTML=n,o.style.display="",null===(e=document.getElementById("error-modal-HMS-trigger"))||void 0===e||e.click(),null===(t=document.querySelector(".error-modal-HMS .modal-body button"))||void 0===t||t.addEventListener("click",()=>{this.handleCancelBtnClick()})}}checkPOSSystemWithZip(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=i.apiConfig.POSLookup+e;try{const o=yield(0,v.getCachedAPIResponse)(t,s.apiCaching.POSSystemLookup);if(o){(0,l.stopLoader)();const t=o[0].posName;this.POSObject=o[0],null===t&&null!==o[0].franchiseWebLocationId?(sessionStorage.setItem("franchiseWebLocationMarketingId",o[0].franchiseWebLocationMarketingId),sessionStorage.setItem("from-hms-nearby-location","false"),this.isnFlow(e)):"onverity"===(null==t?void 0:t.toLowerCase())?(sessionStorage.setItem("sAddressParam",e),sessionStorage.setItem("franchiseWebLocationMarketingId",o[0].franchiseWebLocationMarketingId),sessionStorage.setItem("from-hms-nearby-location","false"),this.onverityFlow(e)):"isn"===(null==t?void 0:t.toLowerCase())?(sessionStorage.setItem("sAddressParam",e),sessionStorage.setItem("franchiseWebLocationMarketingId",o[0].franchiseWebLocationMarketingId),sessionStorage.setItem("from-hms-nearby-location","false"),this.isnFlow(e)):this.checkNearByLocation(e)}else this.checkNearByLocation(e)}catch(t){(0,l.stopLoader)(),this.handleErrorModal(),sessionStorage.setItem("from-hms-nearby-location","false"),console.error(`Error fetching POS systems for ${e}`)}})}checkNearByLocation(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,n;try{(0,l.startLoader)();const i=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,s=yield(0,a.getBrandDetailsFromBrandJson)(i),r=null!==(n=JSON.parse(sessionStorage.getItem("from-hms-nearby-location")))&&void 0!==n&&n;if((null==s?void 0:s.enable_50mile_area_OSflow)&&!r){const{GetLocateLocation:t}=yield Promise.resolve().then(o.bind(o,/*! ../header/GetLocateLocation */"./src/js/opus2/header/GetLocateLocation.ts")),n=t.getInstance();sessionStorage.setItem("from-hms-nearby-location","true"),n.getNearbylocation(e,s)}else sessionStorage.setItem("from-hms-nearby-location","false"),this.handleErrorModal();(0,l.stopLoader)()}catch(e){console.error("Error in checkNearByLocation:",e),this.handleErrorModal(),(0,l.stopLoader)()}})}checkPOSSystemWithWebLocation(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,r;const a=i.apiConfig.FranchisePOSLookup+e;try{const n=yield(0,v.getCachedAPIResponse)(a,s.apiCaching.FranchisePOSLookup);(0,l.stopLoader)();const i=n[0].posName;if(this.POSObject=n[0],null===i&&null!==n[0].franchiseWebLocationId)sessionStorage.setItem("franchiseWebLocationMarketingId",n[0].franchiseWebLocationMarketingId),this.redirectToISN();else if(null===i&&null===n[0].franchiseWebLocationId){const e=document.getElementById("modal-hms-appoinment-slot-error");if(e){const n='\n <p class="title">\n <svg aria-hidden="true" class="close-icon"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#information-circle"></use></svg>Please call us to find a franchise near you.</p>\n <p class="text-center">We apologize for the inconvenience. Please call us at (800) 526-3939 and we will help you book an inspection.</p>\n <strong></strong>\n ';e.innerHTML=n,e.style.display="",null===(t=document.getElementById("error-modal-HMS-trigger"))||void 0===t||t.click(),null===(o=document.querySelector(".error-modal-HMS .modal-body button"))||void 0===o||o.addEventListener("click",()=>{this.handleCancelBtnClick()})}}else"isn"===i.toLowerCase()&&(sessionStorage.setItem("franchiseWebLocationMarketingId",n[0].franchiseWebLocationMarketingId),this.getOnlineSchedulingWithWeblocation(e))}catch(t){const o=document.getElementById("modal-hms-appoinment-slot-error");
3if(o){const e='\n <p class="title">\n <svg aria-hidden="true" class="close-icon"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#information-circle"></use></svg>Please call us to find a franchise near you.</p>\n <p class="text-center">We apologize for the inconvenience. Please call us at (800) 526-3939 and we will help you book an inspection.</p>\n <strong></strong>\n ';o.innerHTML=e,o.style.display="",null===(n=document.getElementById("error-modal-HMS-trigger"))||void 0===n||n.click(),null===(r=document.querySelector(".error-modal-HMS .modal-body button"))||void 0===r||r.addEventListener("click",()=>{this.handleCancelBtnClick()})}console.error(`Error fetching POS systems for weblocationID: ${e}`)}(0,l.stopLoader)()})}onverityFlow(e){const t=document.getElementById("isn-form");t&&t.parentNode&&t.parentNode.removeChild(t),this.init(),this.franchiseLookupAddressApi(e)}isnFlow(e){this.getOnlineScheduleFlowStatus(e),(0,l.stopLoader)()}redirectToISN(){const e=document.getElementById("onverity-form");e&&e.parentNode&&e.parentNode.removeChild(e);const t=document.getElementById("isn-form");t&&t.classList.remove("hidden");const o=document.querySelector("#isn-form #form-section");o&&(o.style.display="block");const n=document.querySelector(".zip-modal");n&&(n.style.display="none"),(0,l.stopLoader)(),sessionStorage.setItem("hms_lead_ISN","true"),p.FormHandlerLead.getInstance()}openRedirectionModal(e){const t=document.getElementById("open-redirection-modal");if(t){t.click();const o=document.querySelector("#redirection-modal .modal-body button"),n=document.querySelector("#redirection-modal .modal-header button");o&&o.addEventListener("click",()=>{const t=sessionStorage.getItem("redirectionURL"),o=window.open(e,"_blank");o&&(o.focus(),setTimeout(()=>{t&&(window.location.href=t,sessionStorage.removeItem("redirectionURL")),null==n||n.click()},100))})}}redirectToExternalSite(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){(0,l.startLoader)();const t=this.getRedirectConfigUrl();try{const o=yield(0,v.getCachedAPIResponse)(t,s.apiCaching.IsnRedirectConfig,!1);(0,l.stopLoader)(),this.handleFranchiseRedirect(o,e)}catch(e){(0,l.stopLoader)(),console.error("Error fetching ISN redirect config from CP"),this.redirectToISN()}})}getRedirectConfigUrl(){const e=window.location.href;let t=`${e.split("/")[0]}/${e.split("/")[1]}/${e.split("/")[2]}/brand/_assets/data/isn_redirect_config.json`;return t.includes("localhost")&&(t="https://dig-www-nei-hms2-dev.nblysbx.com/brand/_assets/data/isn_redirect_config.json"),t}handleFranchiseRedirect(e,t){const o=e.find(e=>e.franchisee_number===t);o?"\\N"===o.isnUrl?this.redirectToISN():(this.triggerGTMEvent(o.isnUrl),this.handlePopupWindow(o.isnUrl)):this.redirectToISN()}triggerGTMEvent(e){try{const t={event:"custEv_ISNRedirectDataLayer",ISNRediectLink:e,isRedirectedToExternalSite:!0};(0,d.gtmCustomEventLeadFlow)(t)}catch(e){console.log("An error occurred in gtmCustomEventLeadFlow: ",e)}}handlePopupWindow(e){var t;const o=sessionStorage.getItem("campaignName");let n="";o&&(n=null!==(t=o.split("?")[1])&&void 0!==t?t:"");const i=e.trim(),s=i.indexOf("#"),r=-1!==s?i.substring(0,s):i,l=-1!==s?i.substring(s):"",a=n?r.includes("?")?"&":"?":"",d=`${r}${a}${n}${l}`,c=window.open(d,"_blank");if(!c||c.closed||void 0===c.closed)console.log("Popup blocker detected in the browser"),this.openRedirectionModal(d);else{const e=sessionStorage.getItem("redirectionURL"),t=JSON.parse(sessionStorage.getItem("locationLeadFlow"));e&&!t&&(window.location.href=e,sessionStorage.removeItem("redirectionURL")),sessionStorage.removeItem("locationLeadFlow")}}getOnlineSchedulingWithWeblocation(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;try{const e=yield(0,v.cachedAPIWrapper)(t,s.apiCaching.FullAttributeResponse);this.onlineScheduling=null==e?void 0:e.onlineScheduling,this.setLocalData(e,""),this.onlineScheduling?this.redirectToExternalSite(this.POSObject.franchiseWebLocationMarketingId):this.redirectToISN()}catch(t){console.error(`Error fetching POS systems for weblocationID: ${e}`)}})}getOnlineScheduleFlowStatus(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){sessionStorage.setItem("hms_lead_ISN_zip",e),(0,l.startLoader)();try{const t=yield(0,a.getFranchiseDetails)(e);if(t.length>0){const{franchiseWebLocationId:o}=t[0],n={franchiseWeblocationId:o},r=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${null==n?void 0:n.franchiseWeblocationId}`;try{const t=yield(0,v.cachedAPIWrapper)(r,s.apiCaching.FullAttributeResponse);this.onlineScheduling=null==t?void 0:t.onlineScheduling,this.setLocalData(t,e),this.onlineScheduling?this.redirectToExternalSite(this.POSObject.franchiseWebLocationMarketingId):this.redirectToISN()}catch(e){throw console.error("Error fetching Full Attribute"),new Error("Error fetching Full Attribute")}}else document.getElementById("step1-title").style.display="none",document.getElementById("step1-subtitle").style.display="block",document.getElementById("step1-subtitle").classList.remove("hidden")}catch(t){console.error(`Error fetching LocateLocationApiWithRoundRobinTrue ${e}`)}})}handleButtonSubmit(e){if(e.stopPropagation(),e.preventDefault(),this.validateForm()){(0,l.startLoader)();const e=this.localSearchInput.value;f.zipcode=e,localStorage.removeItem("hms_redirect_local"),this.checkPOSSystemWithZip(e)}}handleCancelBtnClick(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,a.getBrandDetailsFromBrandJson)(t);let n=localStorage.getItem("dbaName")?localStorage.getItem("dbaName"):"",i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;!i&&(null==o?void 0:o.include_statename)&&(yield(0,a.fetchCrownpeakUrlDetails)(),i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),n=(null==o?void 0:o.weblocation_path_group)&&(null==i?void 0:i.stateName)?`/${o.weblocation_path_group}/${null==i?void 0:i.stateName}/${n}`:(null==o?void 0:o.weblocation_path_group)?`/${o.weblocation_path_group}/${n}`:`/${n}`,n?window.location.href=window.location.origin+n:document.referrer?window.history.back():window.location.href=window.location.origin})}zipCodeError(){if(document.getElementById("step1-subtitle").classList.contains("hidden")||(document.getElementById("step1-title").style.display="block",document.getElementById("step1-subtitle").style.display="none",document.getElementById("step1-subtitle").classList.add("hidden")),""==this.localSearchInput.value||r.REGEX.sendZip.test(this.localSearchInput.value.trim()))this.hideError("location-search-input-modal");else{const e=document.getElementById("location-search-input-modal-error-msg").getAttribute("aria-describedby"),t=document.getElementById("location-search-input-modal-error-msg");
3if(t)t.classList.remove("hidden"),t.innerHTML=e||"Invalid zip code format.";else{const t=this.localSearchInput;if(t&&t.parentNode){const o=e||"Invalid zip code format.",n=document.createElement("span");n.className="error-msg",n.id=`${t.id}-error-msg`,n.textContent=o,t.classList.add("invalid-field"),t.parentNode.appendChild(n)}}}}hideError(e){const t=document.getElementById(e),o=document.getElementById(`${e}-error-msg`);null==o||o.classList.add("hidden"),null==t||t.classList.remove("invalid-field")}validateForm(){const e=document.getElementById("location-search-input"),t={zipCode:e.value},o={};return e.required&&""===t.zipCode?o["location-search-input"]="":e.required&&!r.REGEX.sendZip.test(t.zipCode.trim())&&(o["location-search-input"]="Invalid zip code format."),document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),Object.keys(o).forEach((e,t)=>{const n=document.getElementById(e),i=document.getElementById(`${e}-modal-error-msg`);if(n&&n.parentNode){const t=o[e],s=document.createElement("span");s.className="error-msg",s.textContent=t,n.classList.add("invalid-field"),i&&t&&(i.innerHTML=t),i&&i.classList.contains("hidden")&&i.classList.remove("hidden")}0==t&&n&&n.focus()}),0===Object.keys(o).length}setLocalData(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i,s,r;if(e&&(null===(o=this.POSObject)||void 0===o?void 0:o.franchiseId)){const o=null===(n=this.POSObject)||void 0===n?void 0:n.franchiseId,{franchiseWebLocationId:l,locationDoingBusinessAs:d,locationWebsiteUrl:u,mainPhoneNumber:m,callTrackings:h}=e;localStorage.setItem("franchiseWebLocationId",l),sessionStorage.setItem("franchiseId",o),localStorage.setItem("doingBusinessAs",d),sessionStorage.setItem("redirectionURL",u),localStorage.setItem("weblocationId",l);const p=null!==(i=null==u?void 0:u.replace(/\/$/,""))&&void 0!==i?i:"",v=p.toLowerCase().split("/"),f=v[v.length-1];(0,a.handleCrossDomainLink)(p);let y=m;h.forEach(e=>{"WebsiteTracking"==e.callTrackingTypeDescription&&(y=e.callTrackingNumber,localStorage.setItem("localPhoneNumber",y))});const b=document.querySelector(".header-wrapper .form-call-cta");if(b){b.href=`tel:${y}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,t=null===(s=String(y))||void 0===s?void 0:s.replace(/\D/g,"").match(e);b.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`}const I=document.querySelector(".header-cta-mobile .primary-btn");I&&(I.href=`tel:${y}`),f&&(localStorage.setItem("dbaName",f),(0,g.localizationTagUpadation)()),this.updateInputValue("local_weblocationId",l),this.updateInputValue("weblocationId",l),this.updateInputValue("full_dbaName",f),this.updateInputValue("dbaName",f);const S=document.querySelector(".header-wrapper .address"),w=document.querySelector(".header-wrapper .description");d&&(0,a.updateHeaderContent)(d),S&&w&&(S.innerHTML=d,(0,g.localizationTagLine)());const L=null===(r=document.getElementById("user-service-address"))||void 0===r?void 0:r.value;sessionStorage.setItem("manualEnteredAddress",L+", "+t),sessionStorage.setItem("RL_Weblocation_ID",l),sessionStorage.setItem("RL_DBAName",d),c.Footer.init()}})}franchiseLookupAddressApi(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield(0,a.getFranchiseDetails)(e);if(t.length>0){const{franchiseWebLocationId:o,doingBusinessAs:i,licenseNumber:s,franchiseId:r}=t[0];localStorage.setItem("franchiseWebLocationId",o),sessionStorage.setItem("franchiseId",t[0].franchiseId),localStorage.setItem("doingBusinessAs",i),localStorage.setItem("weblocationId",o),f.franchiseWebLocationId=o,f.doingBusinessAs=i,f.licenseNumber=s,f.franchiseId=r,sessionStorage.setItem("hms_booking",JSON.stringify(f)),(()=>{(0,n.__awaiter)(this,void 0,void 0,function*(){var n,r,l;yield this.getDetails(o);const m=(null!==(r=null===(n=t[0].locationWebsiteUrl)||void 0===n?void 0:n.replace(/\/$/,""))&&void 0!==r?r:"").toLowerCase().split("/"),h=m[m.length-1];h&&(f.pathname=h,localStorage.setItem("dbaName",h),sessionStorage.setItem("hms_hms_booking",JSON.stringify(f))),this.updateInputValue("local_weblocationId",o),this.updateInputValue("weblocationId",o),this.updateInputValue("full_dbaName",h),this.updateInputValue("dbaName",h);const p=document.querySelector(".header-wrapper .address"),v=document.querySelector(".header-wrapper .description");i&&(0,a.updateHeaderContent)(i),p&&v&&(p.innerHTML=i,(0,g.localizationTagLine)());const y=null===(l=document.getElementById("user-service-address"))||void 0===l?void 0:l.value;sessionStorage.setItem("manualEnteredAddress",y+", "+e),sessionStorage.setItem("RL_Weblocation_ID",o),sessionStorage.setItem("RL_DBAName",i);try{const t={event:"custEv_LocalDataLayer",locationID:o,locationDBA:i,locationZipcode:e,licenseNumber:s};(0,d.gtmCustomEventLeadFlow)(t)}catch(e){console.log("An error occurred in gtmCustomEventLeadFlow: ",e)}try{yield u.Step2.create();c.Footer.init()}catch(e){}})})(),setTimeout(()=>{(0,l.stopLoader)()},0)}else(0,l.stopLoader)(),document.getElementById("step1-title").style.display="none",document.getElementById("step1-subtitle").style.display="block",document.getElementById("step1-subtitle").classList.remove("hidden")}catch(e){if(null==e?void 0:e.message)if("Full address is needed to narrow down results"===e.message){const e=document.getElementById("zip-code").value,t=`${document.getElementById("user-service-address").value}, ${e}`;this.franchiseLookupAddressApi(t)}else(0,l.stopLoader)(),this.OpenErrorModal();else(0,l.stopLoader)(),this.OpenErrorModal()}})}nextStep2(e){const t=document.querySelector(".zip-modal");t&&(t.style.display="none");const o=document.getElementById("form-section");o&&(o.style.display="block");
3const n=document.querySelector(".brand-license .serving");if(n){n.innerText=`${(null==f?void 0:f.doingBusinessAs)?null==f?void 0:f.doingBusinessAs:null==e?void 0:e.locationDoingBusinessAs} `;document.querySelector(".brand-license .license").innerText=(null==f?void 0:f.licenseNumber)?null==f?void 0:f.licenseNumber:null==e?void 0:e.locationDoingBusinessAs}const i=document.querySelectorAll("#form-section .contact-us-section");null==i||i.forEach(e=>{e.classList.remove("form-step-active")});const s=document.querySelectorAll(".progressbar .progress-step"),r=document.getElementById("progress"),l=i[0],a=s[0];r.style.width="0%",l.classList.add("form-step-active"),a.classList.add("progress-step-active"),a.classList.add("progress-step-confirmed"),w(!1)}getDetails(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;const o=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;try{const e=yield(0,v.cachedAPIWrapper)(o,s.apiCaching.FullAttributeResponse);let n=null==e?void 0:e.mainPhoneNumber;if(this.onlineScheduling=null==e?void 0:e.onlineScheduling,null==e||e.callTrackings.forEach(e=>{"WebsiteTracking"==e.callTrackingTypeDescription&&(n=e.callTrackingNumber,f.localPhoneNumber=n,localStorage.setItem("localPhoneNumber",n),sessionStorage.setItem("hms_booking",JSON.stringify(f)))}),this.isLead){const{franchiseWebLocationId:t,locationDoingBusinessAs:o,franchiseWebLocationMarketingId:n}=e;localStorage.setItem("franchiseWebLocationId",t),sessionStorage.setItem("franchiseId",""),localStorage.setItem("doingBusinessAs",o),localStorage.setItem("weblocationId",t),f.franchiseWebLocationId=t,f.doingBusinessAs=o,f.licenseNumber=n,f.franchiseId="",sessionStorage.setItem("hms_booking",JSON.stringify(f))}const i=document.querySelector(".header-wrapper .form-call-cta");if(i){i.href=`tel:${n}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,o=null===(t=String(n))||void 0===t?void 0:t.replace(/\D/g,"").match(e);i.innerHTML=`(${o[1]}) ${o[2]}-${o[3]}`}const r=document.querySelector(".header-cta-mobile .primary-btn");if(r&&(r.href=`tel:${n}`),null==e?void 0:e.onlineScheduling)this.nextStep2(e);else{const e=document.querySelector(".progressbar"),t=document.querySelectorAll(".progressbar .progress-step"),o=t[2];o&&(null==e||e.removeChild(o));document.getElementById("progress").style.width="100%";const n=document.querySelectorAll("#form-section .contact-us-section"),i=document.querySelectorAll(".contact-us-section .btn-next")[1],s=n[0],r=n[1],l=t[0],a=t[1];s.classList.remove("form-step-active"),r.classList.add("form-step-active"),i&&(i.innerHTML="Submit"),l.classList.remove("progress-step-active"),l.classList.add("progress-step-confirmed"),a.classList.add("progress-step-active"),w(!0)}return e}catch(e){console.log("Error in GET_ATTRIBUTE_DATA in HMS step1")}})}updateInputValue(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.error(`Error in updateInputValue function: ${e}`)}}CloseErrorModal(){const e=document.querySelector(".error-local-modal.error-modal-HMS .error-btn-close"),t=document.getElementById("error-modal-HMS");null==e||e.addEventListener("click",()=>{document.getElementById("modal-hms-system-error").style.display="none",null==t||t.classList.add("hidden")})}OpenErrorModal(){const e=document.querySelector(".error-local-modal.error-modal-HMS");e&&(null==e||e.classList.remove("hidden"),document.getElementById("modal-hms-system-error").style.display="block")}initBackBtn(){const e=document.querySelector("#schedule-step .cancel-verification");null==e||e.addEventListener("click",()=>{const e=document.querySelectorAll("#form-section .contact-us-section");if(null==e||e.forEach(e=>{e.classList.remove("form-step-active")}),this.isLead)this.handleCancelBtnClick();else{document.getElementById("form-section").style.display="none";const e=document.querySelector(".zip-modal");document.body.scrollTop=0,document.documentElement.scrollTop=0,e.style.display=""}})}}document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){var e;"25"===(null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value)&&(L.getInstance(),m.Step3.getInstance(),yield h.HMSStep4.create())}))},"./src/js/opus2/hms/index.ts"(e,t,o){"use strict";o.r(t),o.d(t,{HMSStep4:()=>s.HMSStep4,InspectionSummary:()=>l.InspectionSummary,ScheduleService:()=>n.ScheduleService,ServiceInspection:()=>r.ServiceInspection,Step3:()=>i.Step3,getHmsBooking:()=>n.getHmsBooking,getIsLeadDataHms:()=>
3n.getIsLeadDataHms,setHmsBooking:()=>n.setHmsBooking,setIsLeadDataHms:()=>n.setIsLeadDataHms});var n=o(/*! ./hms-step1 */"./src/js/opus2/hms/hms-step1.ts"),i=o(/*! ./step3 */"./src/js/opus2/hms/step3.ts"),s=o(/*! ./step4 */"./src/js/opus2/hms/step4.ts"),r=o(/*! ./step5 */"./src/js/opus2/hms/step5.ts"),l=o(/*! ./step6 */"./src/js/opus2/hms/step6.ts")},"./src/js/opus2/hms/step2.ts"(e,t,o){"use strict";o.d(t,{Step2:()=>b,currentActiveStep:()=>y});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js"),s=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),r=o(/*! ./hms-step1 */"./src/js/opus2/hms/hms-step1.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../util/commonValidation */"./src/js/opus2/util/commonValidation.ts"),c=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),u=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts");let m,h=[],p=o(/*! moment */"./node_modules/moment/moment.js"),v="",g="",f="";function y(e){const t=document.querySelectorAll(".section-main>.contact-us-section");e&&t&&(t.forEach(e=>{e.classList.remove("form-step-active")}),e.classList.add("form-step-active"))}class b{constructor(){this.buttonName=[],this.setCard=e=>e.map(e=>`\n <li class="date-details-item">\n <button type="button" class="${(null==h?void 0:h.some(t=>p(t.startDate).format("DD MMM, YYYY")==p(e.startDate).format("DD MMM, YYYY")&&t.isAvailable))?p(e.startDate).format("ddd DD MMM, YYYY")===p(v).format("ddd DD MMM, YYYY")?"date-details-inactive date-details-active dateapp":"date-details-inactive dateapp":"date-details-disable"}"\n value=${e.startDate}>\n <span value=${e.startDate} class="date-text-small">${p(e.startDate).format("MMM")}</span>\n <strong value=${e.startDate} class="date-text-normal">${p(e.startDate).format("DD")}</strong>\n <input class="getDateApp" hidden value=${e.startDate}>\n <input class="scheduleID" hidden value=${e.scheduleID}> \n <span value=${e.startDate} class="date-text-small">${p(e.startDate).format("ddd")} </span>\n </button>\n </li>\n `),this.init(),this.initInput(),this.initCancelBtn(),(0,a.hmsProgressBarUpdate)("0%",0)}static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return b.instance||(b.instance=new b,yield b.instance.setAppointmainCalander()),b.instance})}static getInstance(){return b.instance}init(){window.scrollTo(0,0),this.form=document.querySelectorAll(".appointment-details-section.contact-us-section.form-step .btn-next");const e=(0,a.removeAllEventListeners)(".appointment-details-section.contact-us-section.form-step .btn-next");null==e||e.addEventListener("click",this.handleSubmit.bind(this))}initCancelBtn(){const e=(0,a.removeAllEventListeners)(".appointment-details-section.contact-us-section.form-step .cancel-verification");e&&(null==e||e.addEventListener("click",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if(localStorage.getItem("hms_redirect_local")){const t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value,o=yield(0,a.getBrandDetailsFromBrandJson)(t);let n=localStorage.getItem("dbaName")?localStorage.getItem("dbaName"):"",i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;if(!i&&(null==o?void 0:o.include_statename)&&(yield(0,a.fetchCrownpeakUrlDetails)(),i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),n=(null==o?void 0:o.weblocation_path_group)&&(null==i?void 0:i.stateName)?`/${o.weblocation_path_group}/${null==i?void 0:i.stateName}/${n}`:(null==o?void 0:o.weblocation_path_group)?`/${o.weblocation_path_group}/${n}`:`/${n}`,n)return localStorage.removeItem("hms_redirect_local"),void(window.location.href=window.location.origin+n)}const t=document.querySelector(".zip-modal");t&&(t.style.display="flex");const o=document.getElementById("form-section");o&&(o.style.display="none"),window.scrollTo(0,0)})))}initInput(){this.bookInspector=document.getElementById("book-inspector"),this.bookInspector&&this.bookInspector.addEventListener("input",()=>(0,d.handleCommonInputError)(this.bookInspector,`${this.bookInspector.id}-modal-error-msg`,s.REGEX.sendName,"Please Enter Book Inspector"))}nextStep3(){y(document.getElementById("inspection-step")),(0,a.hmsProgressBarUpdate)("25%",1)}handleSubmit(){var e,t,o;if(this.validateForm()){const n=null!==(e=JSON.parse(sessionStorage.getItem("hms_booking")))&&void 0!==e?e:{},i={};i.bookInspector=null!==(o=null===(t=this.bookInspector)||void 0===t?void 0:t.value)&&void 0!==o?o:"",i.userSelectDate=v,i.userSelectTime=g,i.isCalanderDIsable=(0,r.getIsLeadDataHms)(),i.ScheduleID=f,n.calendarPaylod=i,n.ScheduleID=f,sessionStorage.setItem("hms_booking",JSON.stringify(n)),this.nextStep3(),this.setupDateTime()}}setupDateTime(){const e=document.querySelectorAll(".step-time"),t=document.querySelector(".select-time");
3null==e||e.forEach(e=>{e&&(e.innerHTML=`Selected Start Time: <span>${p(v).format("ddd DD MMM, YYYY")} at ${(null==t?void 0:t.innerHTML)||""}</span>`)})}validateForm(){var e,t,o,n,i;null===(e=document.querySelectorAll(".error-msg"))||void 0===e||e.forEach(e=>e.classList.add("hidden")),null===(t=document.querySelectorAll(".invalid-field"))||void 0===t||t.forEach(e=>e.classList.remove("invalid-field"));const r={},l=[{input:this.bookInspector,id:null===(o=this.bookInspector)||void 0===o?void 0:o.id,regex:s.REGEX.sendName,errorMessage:"Please Enter valid Book Inspector."}];v&&g||(r["appointment-selection"]=null!==(i=null===(n=document.getElementById("appointment-selection-modal-error-msg"))||void 0===n?void 0:n.innerText)&&void 0!==i?i:"Please Select a Date and Time."),l.forEach(({input:e,id:t,regex:o,errorMessage:n})=>{var i,s;let l=n;n=null!==(s=null===(i=document.getElementById(`${t}-modal-error-msg`))||void 0===i?void 0:i.innerText)&&void 0!==s?s:n,e.required&&""===e.value?r[t]=n:""!==e.value&&o&&!o.test(e.value)&&(r[t]=l)});const a=Object.keys(r)[0];if(a){const e=document.getElementById(a);e&&e.focus()}return Object.keys(r).forEach(e=>{const t=document.getElementById(e),o=document.getElementById(`${e}-modal-error-msg`);t&&t.parentNode&&(t.classList.add("invalid-field"),o&&(o.innerHTML=r[e],o.classList.remove("hidden")))}),0===Object.keys(r).length}setTinySlider(e){try{(0,i.tns)({container:".date-slider",loop:!1,gutter:8,items:7,slideBy:"page",nav:!1,autoplay:!1,speed:400,swipeAngle:!1,autoplayButtonOutput:!1,mouseDrag:!0,lazyload:!0,controlsContainer:"#customize-controls",responsive:{350:{items:5},640:{items:5},768:{items:5},1024:{items:7}}})}catch(e){}}setAppointmainCalander(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;const n=JSON.parse(sessionStorage.getItem("hms_booking"));let i=null!==(t=(null===(e=document.getElementById("location-search-input"))||void 0===e?void 0:e.value)||(null==n?void 0:n.zipcode))&&void 0!==t?t:sessionStorage.getItem("sAddressParam");s.REGEX.sendCaPostalCode.test(i)&&(i=-1==(null==i?void 0:i.indexOf(" "))?null==i?void 0:i.replace(/^(.{3})(.*)$/,"$1 $2"):i);try{const e=localStorage.getItem("franchiseWebLocationId"),t=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value,n=yield(0,a.getBrandDetailsFromBrandJson)(t),s=null==n?void 0:n.vendorId,r={PostalCode:i,WebLocationId:null!=e?e:"",DateStart:p().format("MM/DD/YYYY"),IsEstimate:!0,apikey:"pneiweb-9pbaOywNKQj853D",VendorId:s,NumberOfDays:56},l={method:"GET",url:(0,a.constructAppointMentApiUrl)(r)};""==v?this.calendarApiRequest(l):m&&(m=!1,this.calendarApiRequest(l))}catch(e){}})}calendarApiRequest(e){(0,l.startLoader)(),(0,c.getCachedAPIResponse)(e.url,u.apiCaching.TechAvailability).then(e=>{var t;const o=document.getElementsByClassName("calendar-container");h=null==e?void 0:e.resultCollection;let n=h.findIndex(e=>e.isAvailable);if(-1===n){const e=document.getElementById("link-checkbox");o[0].style.display="none";const n=document.getElementsByClassName("appointment-heading"),i=null===(t=document.getElementById("modal-appoinment-slot"))||void 0===t?void 0:t.innerHTML;return n.length>0&&(n[0].innerHTML=i||""),this.enableButton(),void(e&&(e.checked=!0))}n=Math.floor(n/3);const i=this.removeDuplicateDates(h,true);v=null==h?void 0:h.find(e=>e.isAvailable).startDate;const s=this.setCard(i);this.buttonName=document.querySelectorAll(".date-details-item .dateapp");const r=null==h?void 0:h.find(e=>e.isAvailable);this.setTimeUl(r),f=null==r?void 0:r.scheduleID,document.querySelector(".appointment-section-text").innerHTML=`${p(v).format("ddd MMM DD, YYYY")}, <span class="select-time"> Please Select a Time </span>`;let a=document.querySelector(".date-slider")||document.querySelector(".date-details-list");a&&(a.innerHTML="",a.innerHTML=s.join("")),this.addListner(),this.setTinySlider.call(this,n),o[0].style.display="flex",setTimeout(()=>{(0,l.stopLoader)()},0);const d=document.querySelector(".unavailable");d&&(d.style.display="none")}).catch(e=>{var t;(0,l.stopLoader)();const o=document.querySelector(".unavailable");o&&(o.style.display="flex");const n=document.getElementById("link-checkbox"),i=document.getElementsByClassName("calendar-container");i&&(null==i?void 0:i.length)>0&&(i[0].style.display="none");const s=document.getElementsByClassName("appointment-heading"),r=null===(t=document.getElementById("modal-appoinment-slot"))||void 0===t?void 0:t.innerHTML;s&&(null==s?void 0:s.length)>0&&(s[0].innerHTML=r||""),this.enableButton(),n&&(n.checked=!0)})}enableButton(){const e=document.querySelector(".appointment-details-section .btn-container .primary-btn");e&&(e.disabled=!1,e.style.opacity="1")}removeDuplicateDates(e,t){const o=new Set,n=[];for(const t of e){const e=t.startDate.split("T")[0];o.has(e)||(o.add(e),n.push(t))}const i=p().format("DD MMM, YYYY");if(0==t){return n.filter(e=>i!=p(e.startDate).format("DD MMM, YYYY"))}return n}setTimeUl(e){const t=document.querySelector(".calendar-row"),o=null==h?void 0:h.filter(t=>p(t.startDate).format("DD MMM, YYYY")==p(e.startDate).format("DD MMM, YYYY")),n=null==o?void 0:o.map((e,t)=>`<li class="calendar-row-item"><button type="button" value="${e.scheduleID}" class="calendar-col btn-time ${0==e.isAvailable?"disable-btn":""} " id="${e.displayText}">${e.displayText}</button></li>`);t&&(t.innerHTML=n.join("")),this.setListnerOnUlBtn(),this.setAppointmentTimeText(o)}disableButton(){const e=document.querySelector(".appointment-details-section .btn-container .primary-btn");e.disabled=!0,e.style.opacity="0.3"}setAppointmentTimeText(e){document.querySelectorAll(".calendar-col.btn-time").forEach(t=>
3{e.forEach(e=>{t.innerHTML==e.displayText&&(t.setAttribute("value",e.scheduleID),e.isAvailable||t.setAttribute("disabled",""))})})}setListnerOnUlBtn(){const e=document.querySelectorAll(".calendar-col");e.forEach(e=>e.classList.remove("active")),e&&e.forEach(t=>{t.addEventListener("click",o=>{e.forEach(e=>e.classList.remove("active")),t.classList.toggle("active");const n=document.querySelector(".select-time");n&&(n.innerHTML=t.innerHTML),f=t.value,g=t.id,this.enableButton(),this.hideDateTimeError()})})}hideDateTimeError(){const e=document.getElementById("appointment-selection-modal-error-msg");e&&e.classList.add("hidden")}addListner(){var e;null===(e=document.querySelectorAll(".dateapp"))||void 0===e||e.forEach(e=>{e.addEventListener("click",t=>{document.querySelectorAll(".dateapp").forEach(e=>e.classList.remove("date-details-active")),v=p(e.querySelector(".getDateApp").value).format("ddd DD MMM, YYYY"),g="",f=e.querySelector(".scheduleID").value,e.classList.toggle("date-details-active");const o=null==h?void 0:h.find(e=>e.scheduleID==f);document.querySelector(".appointment-section-text").innerHTML=`${p(e.querySelector(".getDateApp").value).format("ddd MMM DD, YYYY")}, <span class="select-time"> Please Select a Time </span>`,this.setTimeUl(o)})})}}b.instance=null},"./src/js/opus2/hms/step3.ts"(e,t,o){"use strict";o.d(t,{Step3:()=>c});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),s=o(/*! ../util/errorMessages */"./src/js/opus2/util/errorMessages.ts"),r=o(/*! ./step2 */"./src/js/opus2/hms/step2.ts"),l=o(/*! ./step4 */"./src/js/opus2/hms/step4.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../apiCaching/POST-Requests/helperModules/handleBookingSubmit */"./src/js/opus2/apiCaching/POST-Requests/helperModules/handleBookingSubmit.ts");class c{static getInstance(){return c.instance||(c.instance=new c),c.instance}constructor(){this.PHONE_NUMBER_LENGTH=14,this.selectedValue="",this.homeOwnerInspectionOver18=HTMLInputElement,this.ownerNameInput=HTMLInputElement,this.ownerLastNameInput=HTMLInputElement,this.selectedScheduling="",this.inspectionPresent=HTMLInputElement,this.agentPropertyAccess=HTMLInputElement,this.agentInspectionPresent=HTMLInputElement,this.agentNameInput=HTMLInputElement,this.agentLastNameInput=HTMLInputElement,this.agentClientNameInput=HTMLInputElement,this.agentClientLastNameInput=HTMLInputElement,this.agentClientRecieveUpdate=HTMLInputElement,this.agentClientAgencyNameInput=HTMLInputElement,this.agentsAgentNameInput=HTMLInputElement,this.agentsAgentLastNameInput=HTMLInputElement,this.agentsRecieveUpdate=HTMLInputElement,this.agentsAgencyNameInput=HTMLInputElement,this.buyerPropertyAccess=HTMLInputElement,this.buyerInspectionPresent=HTMLInputElement,this.buyerNameInput=HTMLInputElement,this.buyerLastNameInput=HTMLInputElement,this.buyerAgentNameInput=HTMLInputElement,this.buyerAgentLastNameInput=HTMLInputElement,this.buyerAgentRecieveUpdate=HTMLInputElement,this.buyerAgentAgencyNameInput=HTMLInputElement,this.buyerSellerAgentNameInput=HTMLInputElement,this.buyerSellerAgentLastNameInput=HTMLInputElement,this.buyerSellerRecieveUpdate=HTMLInputElement,this.buyerSellerAgencyNameInput=HTMLInputElement,this.sellerPropertyAccess=HTMLInputElement,this.sellerInspectionPresent=HTMLInputElement,this.sellerNameInput=HTMLInputElement,this.sellerLastNameInput=HTMLInputElement,this.sellerAgentNameInput=HTMLInputElement,this.sellerAgentLastNameInput=HTMLInputElement,this.sellerAgentRecieveUpdate=HTMLInputElement,this.sellerAgentAgencyNameInput=HTMLInputElement,this.buyersAgentNameInput=HTMLInputElement,this.buyersAgentLastNameInput=HTMLInputElement,this.buyersAgentRecieveUpdate=HTMLInputElement,this.buyersAgentAgencyNameInput=HTMLInputElement,this.agentInformationYes=HTMLInputElement,this.agentInformationNo=HTMLInputElement,this.buyersAgentDetail=HTMLInputElement,this.buyerAgentYes=HTMLInputElement,this.buyerAgentNo=HTMLInputElement,this.buyerAgentDetail=HTMLInputElement,this.buyerInformationYes=HTMLInputElement,this.buyerInformationNo=HTMLInputElement,this.buyerSellerAgentDetail=HTMLInputElement,this.sellerAgentYes=HTMLInputElement,this.sellerAgentNo=HTMLInputElement,this.sellerAgentDetail=HTMLInputElement,this.sellerInformationYes=HTMLInputElement,this.sellerInformationNo=HTMLInputElement,this.sellerBuyersAgentDetail=HTMLInputElement,this.hideDropdown=null,this.agentBuyerYes=HTMLInputElement,this.agentSellerYes=HTMLInputElement,this.getCheckedInspectionPresent=()=>{let e=[];return e=Array.from(document.querySelectorAll(".inspection-present")).filter(e=>e.checked).map(e=>e.value),e},this.initInputs(),this.initForm(),this.initCustomSelect(),this.initSelectInspector(),this.radioToggle(),this.handleDOMContentLoaded(),this.addToggleEventListeners(this.agentInformationYes,this.agentInformationNo,this.buyersAgentDetail),this.addToggleEventListeners(this.buyerInformationYes,this.buyerInformationNo,this.buyerSellerAgentDetail),this.addToggleEventListeners(this.buyerAgentYes,this.buyerAgentNo,this.buyerAgentDetail),this.addToggleEventListeners(this.sellerAgentYes,this.sellerAgentNo,this.sellerAgentDetail),this.addToggleEventListeners(this.sellerInformationYes,this.sellerInformationNo,this.sellerBuyersAgentDetail),window.scrollTo(0,0),this.editSchedule(),this.handleSelectInspectorClick=this.handleSelectInspectorClick.bind(this)}editSchedule(){var e,t;(null===(e=this.selectInspector)||void 0===e?void 0:e.value)&&(this.hideAllDivs(),this.showDivById(null===(t=this.selectInspector)||void 0===t?void 0:t.value))}hideErrorMessage(e){const t=document.getElementById(e);t&&t.classList.add("hidden")}radioToggle(){document.querySelectorAll('input[name="agent-buyer-seller-radio"]').forEach(e
3=>{e.addEventListener("change",()=>{this.updateText()})})}updateText(){const e=document.querySelectorAll('input[name="agent-buyer-seller-radio"]'),t=document.querySelectorAll(".buyer-or-seller");e[0].checked?t.forEach(function(e){e.innerText.includes("Buyer")?e.innerText=e.innerText.replace("Buyerâs","Sellerâs"):e.innerText.includes("Seller")&&(e.innerText=e.innerText.replace("Sellerâs","Buyerâs"))}):e[1].checked&&t.forEach(function(e){e.innerText.includes("Seller")?e.innerText=e.innerText.replace("Sellerâs","Buyerâs"):e.innerText.includes("Buyer")&&(e.innerText=e.innerText.replace("Buyerâs","Sellerâs"))})}addToggleEventListeners(e,t,o){e&&t&&o&&(t.checked&&(o.style.display="none"),e.addEventListener("click",()=>{o.style.display=""}),t.addEventListener("click",()=>{o.style.display="none"}))}initInputs(){this.agentBuyerYes=document.getElementById("agent-buyer-yes"),this.agentSellerYes=document.getElementById("agent-seller-yes"),this.agentInformationYes=document.getElementById("agent-information-yes"),this.agentInformationNo=document.getElementById("agent-information-no"),this.buyersAgentDetail=document.getElementById("agentBuyersAgentDetail"),this.buyerInformationYes=document.getElementById("buyer-information-yes"),this.buyerInformationNo=document.getElementById("buyer-information-no"),this.buyerSellerAgentDetail=document.getElementById("buyerSellerAgentDetail"),this.buyerAgentYes=document.getElementById("buyer-agent-yes"),this.buyerAgentNo=document.getElementById("buyer-agent-no"),this.buyerAgentDetail=document.getElementById("buyerAgentDetail"),this.sellerAgentYes=document.getElementById("seller-agent-yes"),this.sellerAgentNo=document.getElementById("seller-agent-no"),this.sellerAgentDetail=document.getElementById("sellerAgentDetail"),this.sellerInformationYes=document.getElementById("seller-information-yes"),this.sellerInformationNo=document.getElementById("seller-information-no"),this.sellerBuyersAgentDetail=document.getElementById("sellerBuyersAgentDetail"),this.inspectionPresent=document.getElementsByClassName("inspection-present"),this.selectInspector=document.getElementById("select-inspector"),this.ownerNumberInput=document.getElementById("owner-number"),this.homeOwnerInspectionOver18=document.getElementById("yes-18"),this.ownerNameInput=document.getElementById("owner-name"),this.ownerLastNameInput=document.getElementById("owner-lname"),this.ownerEmailInput=document.getElementById("owner-email"),this.agentPropertyAccess=document.getElementById("agent-property-access"),this.agentInspectionPresent=document.getElementById("agent-buyer-agent"),this.agentNameInput=document.getElementById("agent-name"),this.agentLastNameInput=document.getElementById("agent-lname"),this.agentNumberInput=document.getElementById("agent-number"),this.agentEmailInput=document.getElementById("agent-email"),this.agentAgencyNameInput=document.getElementById("agent-agency-name"),this.agentClientNameInput=document.getElementById("agent-client-name"),this.agentClientLastNameInput=document.getElementById("agent-client-lname"),this.agentClientNumberInput=document.getElementById("agent-client-number"),this.agentClientEmailInput=document.getElementById("agent-client-email"),this.agentClientRecieveUpdate=document.getElementById("agent-client-receive-update"),this.agentClientAgencyNameInput=document.getElementById("agent-client-agency-name"),this.agentsAgentNameInput=document.getElementById("agents-agent-name"),this.agentsAgentLastNameInput=document.getElementById("agents-agent-lname"),this.agentsAgentNumberInput=document.getElementById("agents-agent-number"),this.agentsAgentEmailInput=document.getElementById("agents-agent-email"),this.agentsRecieveUpdate=document.getElementById("agents-receive-update"),this.agentsAgencyNameInput=document.getElementById("agents-agency-name"),this.buyerPropertyAccess=document.getElementById("buyer-property-access"),this.buyerInspectionPresent=document.getElementById("buyer-the-buyer"),this.buyerNameInput=document.getElementById("buyer-name"),this.buyerLastNameInput=document.getElementById("buyer-lname"),this.buyerNumberInput=document.getElementById("buyer-number"),this.buyerEmailInput=document.getElementById("buyer-email"),this.buyerAgentNameInput=document.getElementById("buyer-agent-name"),this.buyerAgentLastNameInput=document.getElementById("buyer-agent-lname"),this.buyerAgentNumberInput=document.getElementById("buyer-agent-number"),this.buyerAgentEmailInput=document.getElementById("buyer-agent-email"),this.buyerAgentRecieveUpdate=document.getElementById("buyer-agent-receive-update"),this.buyerAgentAgencyNameInput=document.getElementById("buyer-agent-agency-name"),this.buyerSellerAgentNameInput=document.getElementById("buyer-seller-agent-name"),this.buyerSellerAgentLastNameInput=document.getElementById("buyer-seller-agent-lname"),this.buyerSellerAgentNumberInput=document.getElementById("buyer-seller-agent-number"),this.buyerSellerAgentEmailInput=document.getElementById("buyer-seller-agent-email"),this.buyerSellerRecieveUpdate=document.getElementById("buyer-seller-receive-update"),this.buyerSellerAgencyNameInput=document.getElementById("buyer-seller-agency-name"),this.sellerPropertyAccess=document.getElementById("seller-property-access"),this.sellerInspectionPresent=document.getElementById("seller-buyer-agent"),this.sellerNameInput=document.getElementById("seller-name"),this.sellerLastNameInput=document.getElementById("seller-lname"),this.sellerNumberInput=document.getElementById("seller-number"),this.sellerEmailInput=document.getElementById("seller-email"),this.sellerAgentNameInput=document.getElementById("seller-agent-name"),this.sellerAgentLastNameInput=document.getElementById("seller-agent-lname"),this.sellerAgentNumberInput=document.getElementById("seller-agent-number"),this.sellerAgentEmailInput=document.getElementById("seller-agent-email"),this.sellerAgentRecieveUpdate=document.getElementById("seller-agent-receive-update"),this.sellerAgentAgencyNameInput=document.getElementById("seller-agent-agency-name"),this.buyersAgentNameInput=document.getElementById("buyers-agent-name"),this.buyersAgentLastNameInput=document.getElementById("buyers-agent-lname"),this.buyersAgentNumberInput=document.getElementById("buyers-agent-number"),this.buyersAgentEmailInput=document.getElementById("buyers-agent-email"),this.buyersAgentRecieveUpdate=document.getElementById("buyers-receive-update"),this.buyersAgentAgencyNameInput=document.getElementById("buyers-agency-name"),this.homeO
3wnerInspectionOver18&&this.homeOwnerInspectionOver18.addEventListener("input",()=>{var e;return this.handleError(this.homeOwnerInspectionOver18,i.REGEX.sendName,null===(e=this.homeOwnerInspectionOver18)||void 0===e?void 0:e.id,s.default.invalidName)}),this.ownerNumberInput&&this.ownerNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.ownerNumberInput)),this.ownerNameInput&&this.ownerNameInput.addEventListener("input",()=>{var e;return this.handleError(this.ownerNameInput,i.REGEX.sendName,null===(e=this.ownerNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.ownerLastNameInput&&this.ownerLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.ownerLastNameInput,i.REGEX.sendName,null===(e=this.ownerLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.ownerEmailInput&&this.ownerEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.ownerEmailInput,i.REGEX.sendEmail,null===(e=this.ownerEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.agentPropertyAccess&&this.agentPropertyAccess.addEventListener("input",()=>{var e;return this.handleError(this.agentPropertyAccess,i.REGEX.sendName,null===(e=this.agentPropertyAccess)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentNumberInput&&this.agentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.agentNumberInput)),this.agentNameInput&&this.agentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentNameInput,i.REGEX.sendName,null===(e=this.agentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentLastNameInput&&this.agentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentLastNameInput,i.REGEX.sendName,null===(e=this.agentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentEmailInput&&this.agentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.agentEmailInput,i.REGEX.sendEmail,null===(e=this.agentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.agentClientNumberInput&&this.agentClientNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.agentClientNumberInput)),this.agentClientNameInput&&this.agentClientNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentClientNameInput,i.REGEX.sendName,null===(e=this.agentClientNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentClientLastNameInput&&this.agentClientLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentClientLastNameInput,i.REGEX.sendName,null===(e=this.agentClientLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentClientEmailInput&&this.agentClientEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.agentClientEmailInput,i.REGEX.sendEmail,null===(e=this.agentClientEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.agentsAgentNumberInput&&this.agentsAgentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.agentsAgentNumberInput)),this.agentsAgentNameInput&&this.agentsAgentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentsAgentNameInput,i.REGEX.sendName,null===(e=this.agentsAgentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentsAgentLastNameInput&&this.agentsAgentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.agentsAgentLastNameInput,i.REGEX.sendName,null===(e=this.agentsAgentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.agentsAgentEmailInput&&this.agentsAgentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.agentsAgentEmailInput,i.REGEX.sendEmail,null===(e=this.agentsAgentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.buyerPropertyAccess&&this.buyerPropertyAccess.addEventListener("input",()=>{var e;return this.handleError(this.buyerPropertyAccess,i.REGEX.sendName,null===(e=this.buyerPropertyAccess)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerNumberInput&&this.buyerNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.buyerNumberInput)),this.buyerNameInput&&this.buyerNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerNameInput,i.REGEX.sendName,null===(e=this.buyerNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerLastNameInput&&this.buyerLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerLastNameInput,i.REGEX.sendName,null===(e=this.buyerLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerEmailInput&&this.buyerEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerEmailInput,i.REGEX.sendEmail,null===(e=this.buyerEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.buyerAgentNumberInput&&this.buyerAgentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.buyerAgentNumberInput)),this.buyerAgentNameInput&&this.buyerAgentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerAgentNameInput,i.REGEX.sendName,null===(e=this.buyerAgentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerAgentLastNameInput&&this.buyerAgentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerAgentLastNameInput,i.REGEX.sendName,null===(e=this.buyerAgentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerAgentEmailInput&&this.buyerAgentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerAgentEmailInput,i.REGEX.sendEmail,null===(e=this.buyerAgentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.buyerSellerAgentNumberInput&&this.buyerSellerAgentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.buyerSellerAgentNumberInput)),this.buyerSellerAgentNameInput&&this.buyerSellerAgentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerSellerAgentNameInput,i.REGEX.sendName,null===(e=this.buyerSellerAgentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerSellerAgentLastNameInput&&this.buyerSellerAgentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerSellerAgentLastNameInput,i.REGEX.sendName,null===(e=this.buyerSellerAgentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyerSellerAgentEmailInput&&this.buyerSellerAgentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.buyerSellerAgentEmailInput,i.REGEX.sendEmail,null===(e=this.buyerSellerAgentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.sellerPropertyAccess&&this.sellerPropertyAccess.addEventListener("input",()=>{var e;return this.handleError(this.sellerPropertyAccess,i.REGEX.sendName,null===(e=this.sellerPropertyAccess)||void 0===e?void 0:e.id,s.default.invalidName)}),this.sellerNumberInput&&this.sellerNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.sellerNumberInput)),this.sellerNameInput&&this.sellerNameInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerNameInput,i.REGEX.sendName,null===(e=this.sellerNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.sellerLastNameInput&&this.sellerLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerLastNameInput,i.REGEX.sendName,null===(e=this.sellerLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.sellerEmailInput&&this.sellerEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerEmailInput,i.REGEX.sendEmail,null===(e=this.sellerEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.sellerAgentNumberInput&&this.sellerAgentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.sellerAgentNumberInput)),this.sellerAgentNameInput&&this.sellerAgentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerAgentNameInput,i.REGEX.sendName,null===(e=this.sellerAgentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.sellerAgentLastNameInput&&this.sellerAgentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerAgentLastNameInput,i.REGEX.sendName,null===(e=this.sellerAgentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.sellerAgentEmailInput&&this.sellerAgentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.sellerAgentEmailInput,i.REGEX.sendEmail,null===(e=this.sellerAgentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)}),this.buyersAgentNumberInput&&this.buyersAgentNumberInput.addEventListener("input",e=>this.handleMobileInput(e,this.buyersAgentNumberInput)),this.buyersAgentNameInput&&this.buyersAgentNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyersAgentNameInput,i.REGEX.sendName,null===(e=this.buyersAgentNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyersAgentLastNameInput&&this.buyersAgentLastNameInput.addEventListener("input",()=>{var e;return this.handleError(this.buyersAgentLastNameInput,i.REGEX.sendName,null===(e=this.buyersAgentLastNameInput)||void 0===e?void 0:e.id,s.default.invalidName)}),this.buyersAgentEmailInput&&this.buyersAgentEmailInput.addEventListener("input",()=>{var e;return this.handleError(this.buyersAgentEmailInput,i.REGEX.sendEmail,null===(e=this.buyersAgentEmailInput)||void 0===e?void 0:e.id,s.default.invalidEmail)})}initForm(){this.form=document.querySelectorAll("#inspection-step .btn-next"),this.form&&this.form[0]&&this.form[0].addEventListener("click",this.handleSubmit.bind(this));const e=document.querySelectorAll("#inspection-step .btn-cancel");e&&e[0]&&e[0].addEventListener("click",this.handleGoBack.bind(this.selectedValue))}initCustomSelect(){(0,d.initCustomSelectHelper)()}initSelectInspector(){const e=this,t=document.querySelector(".custom-select #select-inspector + button.select-selected");t&&t.addEventListener("click",e.handleSelectInspectorClick.bind(e)),this.hideAllDivs()}handleSelectInspectorClick(e){var t,o,n;const i=document.getElementById("select-inspector-error-msg");i&&i.classList.add("hidden"),this.selectedValue=null===(t=e.target)||void 0===t?void 0:t.textContent,this.hideAllDivs(),this.showDivById(this.selectedValue),e.stopPropagation();const s=document.querySelector(".custom-select #select-inspector + button.select-selected");this.closeAllSelect(s);const r=null==s?void 0:s.nextElementSibling;r&&(null===(o=r.classList)||void 0===o||o.toggle("select-hide"),null===(n=s.classList)||void 0===n||n.toggle("select-arrow-active"));const l=e=>{"Escape"===e.key&&(r.classList.add("select-hide"),s.classList.remove("select-arrow-active"),document.removeEventListener("keydown",l))};document.addEventListener("keydown",l)}closeAllSelect(e){(0,d.closeAllSelectCommon)(e)}hideAllDivs(){document.querySelectorAll(".selected-person").forEach(e
3=>{e.style.display="none"})}showDivById(e){const t=document.getElementById(e);t&&(t.style.display="flex")}getAgentSellerValue(){const e=document.getElementById("agent-buyer-yes"),t=document.getElementById("agent-seller-yes"),o=null==e?void 0:e.checked,n=null==t?void 0:t.checked;return o?e.value:n?t.value:"Not Specified"}nextStep4(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=document.getElementById("property-step");(0,r.currentActiveStep)(e),yield l.HMSStep4.create(),(0,a.hmsProgressBarUpdate)("50%",2)})}handleSubmit(){var e;if(this.validateForm()){document.getElementById("property-step"),document.getElementById("inspection-step");let t=null!==(e=JSON.parse(sessionStorage.getItem("hms_booking")))&&void 0!==e?e:{};const o=this.generateHmsRoleInfo(this.selectedValue);t.HmsRoleInfo=Object.assign({HmsRoleDetail:o.HmsRoleDetail},null==t?void 0:t.HmsRoleInfo),t=this.updateBookingDataPayload(t),sessionStorage.setItem("hms_booking",JSON.stringify(t)),console.log(o,"HmsRoleInformation........"),this.nextStep4()}}updateBookingDataPayload(e){var t,o,n,i,s,r,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w;return"homeowner"===(null===(t=this.selectedValue)||void 0===t?void 0:t.toLowerCase())&&(e.HmsRoleInfo.HmsRoleKey="CONTACT_SUBTYPE_HOME_OWNER",e.HmsRoleInfo.HmsRoleType="CUSTOMER",e.FirstName=null===(o=this.ownerNameInput)||void 0===o?void 0:o.value,e.LastName=null===(n=this.ownerLastNameInput)||void 0===n?void 0:n.value,e.Email=null===(i=this.ownerEmailInput)||void 0===i?void 0:i.value,e.Phone=null===(s=this.ownerNumberInput)||void 0===s?void 0:s.value),"agent"===(null===(r=this.selectedValue)||void 0===r?void 0:r.toLowerCase())&&((null===(l=this.agentBuyerYes)||void 0===l?void 0:l.checked)&&(e.HmsRoleInfo.HmsRoleKey="CONTACT_SUBTYPE_BUYER_AGENT"),(null===(a=this.agentSellerYes)||void 0===a?void 0:a.checked)&&(e.HmsRoleInfo.HmsRoleKey="CONTACT_SUBTYPE_SELLER_AGENT"),e.HmsRoleInfo.HmsRoleType="CUSTOMER",e.FirstName=null===(d=this.agentNameInput)||void 0===d?void 0:d.value,e.LastName=null===(c=this.agentLastNameInput)||void 0===c?void 0:c.value,e.Email=null===(u=this.agentEmailInput)||void 0===u?void 0:u.value,e.Phone=null===(m=this.agentNumberInput)||void 0===m?void 0:m.value),"buyer"===(null===(h=this.selectedValue)||void 0===h?void 0:h.toLowerCase())&&(e.HmsRoleInfo.HmsRoleKey="CONTACT_SUBTYPE_BUYER",e.HmsRoleInfo.HmsRoleType="CUSTOMER",e.FirstName=null===(p=this.buyerNameInput)||void 0===p?void 0:p.value,e.LastName=null===(v=this.buyerLastNameInput)||void 0===v?void 0:v.value,e.Email=null===(g=this.buyerEmailInput)||void 0===g?void 0:g.value,e.Phone=null===(f=this.buyerNumberInput)||void 0===f?void 0:f.value),"seller"===(null===(y=this.selectedValue)||void 0===y?void 0:y.toLowerCase())&&(e.HmsRoleInfo.HmsRoleKey="CONTACT_SUBTYPE_SELLER",e.HmsRoleInfo.HmsRoleType="CUSTOMER",e.FirstName=null===(b=this.sellerNameInput)||void 0===b?void 0:b.value,e.LastName=null===(I=this.sellerLastNameInput)||void 0===I?void 0:I.value,e.Email=null===(S=this.sellerEmailInput)||void 0===S?void 0:S.value,e.Phone=null===(w=this.sellerNumberInput)||void 0===w?void 0:w.value),e}generateHmsRoleInfo(e){var t,o,n,i,s,r,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w,L,E,C,A,_,k,N,T,B,P,j,D,M,q,R,O,x,F,$,H,z,W,U,G,V,J,Y,K,X,Z,Q,ee,te,oe,ne,ie,se,re,le,ae,de,ce,ue,me,he,pe,ve,ge,fe,ye,be,Ie,Se,we,Le,Ee;const Ce={HmsRoleDetail:{}};if("homeowner"===(null===(t=this.selectedValue)||void 0===t?void 0:t.toLowerCase())&&(Ce.HmsRoleDetail={willOwnerOrAdultAttend:null===(o=this.homeOwnerInspectionOver18)||void 0===o?void 0:o.checked,OwnerFirstName:null===(n=this.ownerNameInput)||void 0===n?void 0:n.value,OwnerLastName:null===(i=this.ownerLastNameInput)||void 0===i?void 0:i.value,OwnerPhone:null===(s=this.ownerNumberInput)||void 0===s?void 0:s.value,OwnerEmail:null===(r=this.ownerEmailInput)||void 0===r?void 0:r.value,PresentForInspection:[],BuyerAgentFirstName:null,BuyerAgentLastName:null,BuyerAgentPhone:null,BuyerAgentEmail:null,BuyerNameOfAgency:null,BuyerAgentReceiveTextMessages:!1,SellerAgentFirstName:null,SellerAgentLastName:null,SellerAgentPhone:null,SellerAgentEmail:null,SellerAgentReceiveTextMessages:!1,SellerNameOfAgency:null,BuyerOrSellerAgent:null,ClientFirstName:null,ClientLastName:null,ClientPhone:null,ClientEmail:null,ClientReceiveTextMessages:!1}),"agent"===(null===(l=this.selectedValue)||void 0===l?void 0:l.toLowerCase())){if(Ce.HmsRoleDetail={PresentForInspection:this.getCheckedInspectionPresent(),AgentPropertyAcsess:null===(a=this.agentPropertyAccess)||void 0===a?void 0:a.value,AgentBuyerOrSeller:this.getAgentSellerValue(),ClientFirstName:null===(d=this.agentClientNameInput)||void 0===d?void 0:d.value,ClientLastName:null===(c=this.agentClientLastNameInput)||void 0===c?void 0:c.value,ClientPhone:null===(u=this.agentClientNumberInput)||void 0===u?void 0:u.value,ClientEmail:null===(m=this.agentClientEmailInput)||void 0===m?void 0:m.value,AgentNameOfAgency:null===(h=this.agentClientAgencyNameInput)||void 0===h?void 0:h.value,ClientReceiveTextMessages:null===(p=this.agentClientRecieveUpdate)||void 0===p?void 0:p.checked},null===(v=this.agentBuyerYes)||void 0===v?void 0:v.checked){const e={BuyerAgentFirstName:null===(g=this.agentNameInput)||void 0===g?void 0:g.value,BuyerAgentLastName:null===(f=this.agentLastNameInput)||void 0===f?void 0:f.value,BuyerAgentPhone:null===(y=this.agentNumberInput)||void 0===y?void 0:y.value,BuyerAgentEmail:null===(b=this.agentEmailInput)||void 0===b?void 0:b.value,BuyerNameOfAgency:null===(I=this.agentAgencyNameInput)||void 0===I?void 0:I.value};if(Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail),null===(S=this.agentInformationYes)||void 0===S?void 0:S.checked){const e={SellerAgentFirstName:null===(w=this.agentsAgentNameInput)||void 0===w?void 0:w.value,SellerAgentLastName:null===(L=this.agentsAgentLastNameInput)||void 0===L?void 0:L.value,SellerAgentPhone:null===(E=this.agentsAgentNumberInput)||void 0===E?void 0:E.value,SellerAgentEmail:null===(C=this.agentsAgentEmailInput)||void 0===C?void 0:C.value,SellerNameOfAgency:null===(A=this.agentsAgencyNameInput)||void 0===A?void 0:A.value,SellerAgentReceiveTextMessages:null===(_=this.agentsRecieveUpdate)||void 0===_?void 0:_.checked};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}}if(null===(k=this.agentSellerYes)||void 0===k?void 0:k.checked){const e={SellerAgentFirstName:null===(N=this.agentNameInput)||void 0===N?void 0:N.value,SellerAgentLastName:null===(T=this.agentLastNameInput)||void 0===T?void 0:T.value,SellerAgentPhone:null===(B=this.agentNumberInput)||void 0===B?void 0:B.value,SellerAgentEmail:null===(P=this.agentEmailInput)||void 0===P?void 0:P.value,SellerNameOfAgency:null===(j=this.agentAgencyNameInput)||void 0===j?void 0:j.value};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}if(null===(D=this.agentInformationYes)||void 0===D?void 0:D.checked){const e={BuyerAgentFirstName:null===(M=this.agentsAgentNameInput)||void 0===M?void 0:M.value,BuyerAgentLastName:null===(q=this.agentsAgentLastNameInput)||void 0===q?void 0:q.value,BuyerAgentPhone:null===(R=this.agentsAgentNumberInput)||void 0===R?void 0:R.value,BuyerAgentEmail:null===(O=this.agentsAgentEmailInput)||void 0===O?void 0:O.value,BuyerNameOfAgency:null===(x=this.agentsAgencyNameInput)||void 0===x?void 0:x.value,BuyerAgentReceiveTextMessages:null===(F=this.agentsRecieveUpdate)||void 0===F?void 0:F.checked};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}}if("buyer"===(null===($=this.selectedValue)||void 0===$?void 0:$.toLowerCase())){if(Ce.HmsRoleDetail={PresentForInspection:this.getCheckedInspectionPresent(),BuyerPropertyAcess:null===(H=this.buyerPropertyAccess)||void 0===H?void 0:H.value,BuyerFirstName:null===(z=this.buyerNameInput)||void 0===z?void 0:z.value,BuyerLastName:null===(W=this.buyerLastNameInput)||void 0===W?void 0:W.value,BuyerPhone:null===(U=this.buyerNumberInput)||void 0===U?void 0:U.value,BuyerEmail:null===(G=this.buyerEmailInput)||void 0===G?void 0:G.value},null===(V=this.buyerAgentYes)||void 0===V?void 0:V.checked){const e={BuyerAgentFirstName:null===(J=this.buyerAgentNameInput)||void 0===J?void 0:J.value,BuyerAgentLastName:this.buyerAgentLastNameInput.value,BuyerAgentPhone:null===(Y=this.buyerAgentNumberInput)||void 0===Y?void 0:Y.value,BuyerAgentEmail:null===(K=this.buyerAgentEmailInput)||void 0===K?void 0:K.value,BuyerAgentReceiveTextMessages:null===(X=this.buyerAgentRecieveUpdate)||void 0===X?void 0:X.checked,BuyerNameOfAgency:null===(Z=this.buyerAgentAgencyNameInput)||void 0===Z?void 0:Z.value};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}if(null===(Q=this.buyerInformationYes)||void 0===Q?void 0:Q.checked){const e={SellerAgentFirstName:null===(ee=this.buyerSellerAgentNameInput)||void 0===ee?void 0:ee.value,SellerAgentLastName:null===(te=this.buyerSellerAgentLastNameInput)||void 0===te?void 0:te.value,SellerAgentPhone:null===(oe=this.buyerSellerAgentNumberInput)||void 0===oe?void 0:oe.value,SellerAgentEmail:this.buyerSellerAgentEmailInput.value,SellerAgentReceiveTextMessages:null===(ne=this.buyerSellerRecieveUpdate)||void 0===ne?void 0:ne.checked,SellerNameOfAgency:null===(ie=this.buyerSellerAgencyNameInput)||void 0===ie?void 0:ie.value};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}}if("seller"===(null===(se=this.selectedValue)||void 0===se?void 0:se.toLowerCase())){if(Ce.HmsRoleDetail={PresentForInspection:this.getCheckedInspectionPresent(),SellerPropertyAcess:null===(re=this.sellerPropertyAccess)||void 0===re?void 0:re.value,SellerFirstName:null===(le=this.sellerNameInput)||void 0===le?void 0:le.value,SellerLastName:null===(ae=this.sellerLastNameInput)||void 0===ae?void 0:ae.value,SellerPhone:null===(de=this.sellerNumberInput)||void 0===de?void 0:de.value,SellerEmail:null===(ce=this.sellerEmailInput)||void 0===ce?void 0:ce.value},null===(ue=this.sellerAgentYes)||void 0===ue?void 0:ue.checked){const e={SellerAgentFirstName:null===(me=this.sellerAgentNameInput)||void 0===me?void 0:me.value,SellerAgentLastName:null===(he=this.sellerAgentLastNameInput)||void 0===he?void 0:he.value,SellerAgentPhone:null===(pe=this.sellerAgentNumberInput)||void 0===pe?void 0:pe.value,SellerAgentEmail:null===(ve=this.sellerAgentEmailInput)||void 0===ve?void 0:ve.value,SellerAgentReceiveTextMessages:null===(ge=this.sellerAgentRecieveUpdate)||void 0===ge?void 0:ge.checked,SellerNameOfAgency:null===(fe=this.sellerAgentAgencyNameInput)||void 0===fe?void 0:fe.value};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}if(null===(ye=this.sellerInformationYes)||void 0===ye?void 0:ye.checked){const e={BuyerAgentFirstName:null===(be=this.buyersAgentNameInput)||void 0===be?void 0:be.value,BuyerAgentLastName:null===(Ie=this.buyersAgentLastNameInput)||void 0===Ie?void 0:Ie.value,BuyerAgentPhone:null===(Se=this.buyersAgentNumberInput)||void 0===Se?void 0:Se.value,BuyerAgentEmail:null===(we=this.buyersAgentEmailInput)||void 0===we?void 0:we.value,BuyerAgentReceiveTextMessages:null===(Le=this.buyersAgentRecieveUpdate)||void 0===Le?void 0:Le.checked,BuyerNameOfAgency:null===(Ee=this.buyersAgentAgencyNameInput)||void 0===Ee?void 0:Ee.value};Ce.HmsRoleDetail=Object.assign(Object.assign({},e),Ce.HmsRoleDetail)}}return Ce}editForm(e){var t,o,n,i,s,r,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w,L,E,C,A,_,k,N,T,B,P,j,D,M,q,R,O,x,F,$,H,z,W,U,G,V,J,Y,K,X,Z,Q,ee,te,oe,ne,ie,se,re,le,ae,de,ce,ue,me,he,pe,ve,ge,fe,ye,be,Ie,Se,we,Le,Ee,Ce,Ae,_e,ke,Ne,Te,Be,Pe,je,De,Me,qe,Re,Oe,xe,Fe,$e,He,ze,We,Ue,Ge,Ve,Je,Ye,Ke,Xe,Ze,Qe,et,tt,ot,nt,it,st,rt,lt,at,dt,ct,ut,mt;const ht=JSON.parse(sessionStorage.getItem("hms_booking"));let pt=this.getCheckedInspectionPresent();
3"homeowner"===e.toLowerCase()&&(this.homeOwnerInspectionOver18.checked=null===(o=null===(t=null==ht?void 0:ht.HmsRoleInfo)||void 0===t?void 0:t.HmsRoleDetail)||void 0===o?void 0:o.willOwnerOrAdultAttend,this.ownerNameInput.value=(null===(i=null===(n=null==ht?void 0:ht.HmsRoleInfo)||void 0===n?void 0:n.HmsRoleDetail)||void 0===i?void 0:i.OwnerFirstName)||"",this.ownerLastNameInput.value=(null===(r=null===(s=null==ht?void 0:ht.HmsRoleInfo)||void 0===s?void 0:s.HmsRoleDetail)||void 0===r?void 0:r.OwnerLastName)||"",this.ownerNumberInput.value=(null===(a=null===(l=null==ht?void 0:ht.HmsRoleInfo)||void 0===l?void 0:l.HmsRoleDetail)||void 0===a?void 0:a.OwnerPhone)||"",this.ownerEmailInput.value=(null===(c=null===(d=null==ht?void 0:ht.HmsRoleInfo)||void 0===d?void 0:d.HmsRoleDetail)||void 0===c?void 0:c.OwnerEmail)||""),"agent"===e.toLowerCase()&&(pt=null===(m=null===(u=null==ht?void 0:ht.HmsRoleInfo)||void 0===u?void 0:u.HmsRoleDetail)||void 0===m?void 0:m.PresentForInspection,this.agentPropertyAccess.value=(null===(p=null===(h=null==ht?void 0:ht.HmsRoleInfo)||void 0===h?void 0:h.HmsRoleDetail)||void 0===p?void 0:p.AgentPropertyAcsess)||"",this.agentNameInput.value=(null===(g=null===(v=null==ht?void 0:ht.HmsRoleInfo)||void 0===v?void 0:v.HmsRoleDetail)||void 0===g?void 0:g.AgentFirstName)||"",this.agentLastNameInput.value=(null===(y=null===(f=null==ht?void 0:ht.HmsRoleInfo)||void 0===f?void 0:f.HmsRoleDetail)||void 0===y?void 0:y.AgentLastName)||"",this.agentNumberInput.value=(null===(I=null===(b=null==ht?void 0:ht.HmsRoleInfo)||void 0===b?void 0:b.HmsRoleDetail)||void 0===I?void 0:I.AgentPhone)||"",this.agentEmailInput.value=(null===(w=null===(S=null==ht?void 0:ht.HmsRoleInfo)||void 0===S?void 0:S.HmsRoleDetail)||void 0===w?void 0:w.AgentEmail)||"",this.agentAgencyNameInput.value=(null===(E=null===(L=null==ht?void 0:ht.HmsRoleInfo)||void 0===L?void 0:L.HmsRoleDetail)||void 0===E?void 0:E.AgentNameOfAgency)||"",this.agentClientNameInput.value=(null===(A=null===(C=null==ht?void 0:ht.HmsRoleInfo)||void 0===C?void 0:C.HmsRoleDetail)||void 0===A?void 0:A.AgentClientFirstName)||"",this.agentClientLastNameInput.value=(null===(k=null===(_=null==ht?void 0:ht.HmsRoleInfo)||void 0===_?void 0:_.HmsRoleDetail)||void 0===k?void 0:k.AgentClientLastName)||"",this.agentClientNumberInput.value=(null===(T=null===(N=null==ht?void 0:ht.HmsRoleInfo)||void 0===N?void 0:N.HmsRoleDetail)||void 0===T?void 0:T.AgentClientPhone)||"",this.agentClientEmailInput.value=(null===(P=null===(B=null==ht?void 0:ht.HmsRoleInfo)||void 0===B?void 0:B.HmsRoleDetail)||void 0===P?void 0:P.AgentClientEmail)||"",this.agentClientRecieveUpdate.checked=null===(D=null===(j=null==ht?void 0:ht.HmsRoleInfo)||void 0===j?void 0:j.HmsRoleDetail)||void 0===D?void 0:D.AgentClientReceiveTextMessages,this.agentClientAgencyNameInput.value=(null===(q=null===(M=null==ht?void 0:ht.HmsRoleInfo)||void 0===M?void 0:M.HmsRoleDetail)||void 0===q?void 0:q.AgentClientNameOfAgency)||"",this.agentsAgentNameInput.value=(null===(O=null===(R=null==ht?void 0:ht.HmsRoleInfo)||void 0===R?void 0:R.HmsRoleDetail)||void 0===O?void 0:O.AgentsAgentFirstName)||"",this.agentsAgentLastNameInput.value=(null===(F=null===(x=null==ht?void 0:ht.HmsRoleInfo)||void 0===x?void 0:x.HmsRoleDetail)||void 0===F?void 0:F.AgentsAgentLastName)||"",this.agentsAgentNumberInput.value=(null===(H=null===($=null==ht?void 0:ht.HmsRoleInfo)||void 0===$?void 0:$.HmsRoleDetail)||void 0===H?void 0:H.AgentsAgentPhone)||"",this.agentsAgentEmailInput.value=(null===(W=null===(z=null==ht?void 0:ht.HmsRoleInfo)||void 0===z?void 0:z.HmsRoleDetail)||void 0===W?void 0:W.AgentsAgentEmail)||"",this.agentsAgencyNameInput.value=(null===(G=null===(U=null==ht?void 0:ht.HmsRoleInfo)||void 0===U?void 0:U.HmsRoleDetail)||void 0===G?void 0:G.AgentsAgentNameOfAgency)||"",this.agentsRecieveUpdate.checked=null===(J=null===(V=null==ht?void 0:ht.HmsRoleInfo)||void 0===V?void 0:V.HmsRoleDetail)||void 0===J?void 0:J.AgentsReceiveTextMessages),"buyer"===e.toLowerCase()&&(pt=null===(K=null===(Y=null==ht?void 0:ht.HmsRoleInfo)||void 0===Y?void 0:Y.HmsRoleDetail)||void 0===K?void 0:K.PresentForInspection,this.buyerPropertyAccess.value=(null===(Z=null===(X=null==ht?void 0:ht.HmsRoleInfo)||void 0===X?void 0:X.Hms
3RoleDetail)||void 0===Z?void 0:Z.BuyerPropertyAcess)||"",this.buyerNameInput.value=(null===(ee=null===(Q=null==ht?void 0:ht.HmsRoleInfo)||void 0===Q?void 0:Q.HmsRoleDetail)||void 0===ee?void 0:ee.BuyerFirstName)||"",this.buyerLastNameInput.value=(null===(oe=null===(te=null==ht?void 0:ht.HmsRoleInfo)||void 0===te?void 0:te.HmsRoleDetail)||void 0===oe?void 0:oe.BuyerLastName)||"",this.buyerNumberInput.value=(null===(ie=null===(ne=null==ht?void 0:ht.HmsRoleInfo)||void 0===ne?void 0:ne.HmsRoleDetail)||void 0===ie?void 0:ie.BuyerPhone)||"",this.buyerEmailInput.value=(null===(re=null===(se=null==ht?void 0:ht.HmsRoleInfo)||void 0===se?void 0:se.HmsRoleDetail)||void 0===re?void 0:re.BuyerEmail)||"",this.buyerAgentNameInput.value=(null===(ae=null===(le=null==ht?void 0:ht.HmsRoleInfo)||void 0===le?void 0:le.HmsRoleDetail)||void 0===ae?void 0:ae.BuyerAgentFirstName)||"",this.buyerAgentLastNameInput.value=(null===(ce=null===(de=null==ht?void 0:ht.HmsRoleInfo)||void 0===de?void 0:de.HmsRoleDetail)||void 0===ce?void 0:ce.BuyerAgentLastName)||"",this.buyerAgentNumberInput.value=(null===(me=null===(ue=null==ht?void 0:ht.HmsRoleInfo)||void 0===ue?void 0:ue.HmsRoleDetail)||void 0===me?void 0:me.BuyerAgentPhone)||"",this.buyerAgentEmailInput.value=(null===(pe=null===(he=null==ht?void 0:ht.HmsRoleInfo)||void 0===he?void 0:he.HmsRoleDetail)||void 0===pe?void 0:pe.BuyerAgentEmail)||"",this.buyerAgentRecieveUpdate.checked=null===(ge=null===(ve=null==ht?void 0:ht.HmsRoleInfo)||void 0===ve?void 0:ve.HmsRoleDetail)||void 0===ge?void 0:ge.BuyerAgentReceiveTextMessages,this.buyerAgentAgencyNameInput.value=(null===(ye=null===(fe=null==ht?void 0:ht.HmsRoleInfo)||void 0===fe?void 0:fe.HmsRoleDetail)||void 0===ye?void 0:ye.BuyerNameOfAgency)||"",this.buyerSellerAgentNameInput.value=(null===(Ie=null===(be=null==ht?void 0:ht.HmsRoleInfo)||void 0===be?void 0:be.HmsRoleDetail)||void 0===Ie?void 0:Ie.SellerAgentFirstName)||"",this.buyerSellerAgentLastNameInput.value=(null===(we=null===(Se=null==ht?void 0:ht.HmsRoleInfo)||void 0===Se?void 0:Se.HmsRoleDetail)||void 0===we?void 0:we.SellerAgentLastName)||"",this.buyerSellerAgentNumberInput.value=(null===(Ee=null===(Le=null==ht?void 0:ht.HmsRoleInfo)||void 0===Le?void 0:Le.HmsRoleDetail)||void 0===Ee?void 0:Ee.SellerAgentPhone)||"",this.buyerSellerAgentEmailInput.value=(null===(Ae=null===(Ce=null==ht?void 0:ht.HmsRoleInfo)||void 0===Ce?void 0:Ce.HmsRoleDetail)||void 0===Ae?void 0:Ae.SellerAgentEmail)||"",this.buyerSellerAgencyNameInput.value=(null===(ke=null===(_e=null==ht?void 0:ht.HmsRoleInfo)||void 0===_e?void 0:_e.HmsRoleDetail)||void 0===ke?void 0:ke.SellerNameOfAgency)||"",this.buyersAgentRecieveUpdate.checked=null===(Te=null===(Ne=null==ht?void 0:ht.HmsRoleInfo)||void 0===Ne?void 0:Ne.HmsRoleDetail)||void 0===Te?void 0:Te.SellerAgentReceiveTextMessages),"seller"===e.toLowerCase()&&(pt=null===(Pe=null===(Be=null==ht?void 0:ht.HmsRoleInfo)||void 0===Be?void 0:Be.HmsRoleDetail)||void 0===Pe?void 0:Pe.PresentForInspection,this.sellerPropertyAccess.value=(null===(De=null===(je=null==ht?void 0:ht.HmsRoleInfo)||void 0===je?void 0:je.HmsRoleDetail)||void 0===De?void 0:De.SellerPropertyAcess)||"",this.sellerNameInput.value=(null===(qe=null===(Me=null==ht?void 0:ht.HmsRoleInfo)||void 0===Me?void 0:Me.HmsRoleDetail)||void 0===qe?void 0:qe.SellerFirstName)||"",this.sellerLastNameInput.value=(null===(Oe=null===(Re=null==ht?void 0:ht.HmsRoleInfo)||void 0===Re?void 0:Re.HmsRoleDetail)||void 0===Oe?void 0:Oe.SellerLastName)||"",this.sellerNumberInput.value=(null===(Fe=null===(xe=null==ht?void 0:ht.HmsRoleInfo)||void 0===xe?void 0:xe.HmsRoleDetail)||void 0===Fe?void 0:Fe.SellerPhone)||"",this.sellerEmailInput.value=(null===(He=null===($e=null==ht?void 0:ht.HmsRoleInfo)||void 0===$e?void 0:$e.HmsRoleDetail)||void 0===He?void 0:He.SellerEmail)||"",this.sellerAgentNameInput.value=(null===(We=null===(ze=null==ht?void 0:ht.HmsRoleInfo)||void 0===ze?void 0:ze.HmsRoleDetail)||void 0===We?void 0:We.SellerAgentFirstName)||"",this.sellerAgentLastNameInput.value=(null===(Ge=null===(Ue=null==ht?void 0:ht.HmsRoleInfo)||void 0===Ue?void 0:Ue.HmsRoleDetail)||void 0===Ge?void 0:Ge.SellerAgentLastName)||"",this.sellerAgentNumberInput.value=(null===(Je=null===(Ve=null==ht?void 0:ht.HmsRoleInfo)||void 0===Ve?void 0:Ve.HmsRoleDetail)||void 0===Je?void 0:Je.SellerAgentPhone)||"",this.sellerAgentEmailInput.value=(null===(Ke=null===(Ye=null==ht?void 0:ht.HmsRoleInfo)||void 0===Ye?void 0:Ye.HmsRoleDetail)||void 0===Ke?void 0:Ke.SellerAgentEmail)||"",this.sellerAgentRecieveUpdate.checked=null===(Ze=null===(Xe=null==ht?void 0:ht.HmsRoleInfo)||void 0===Xe?void 0:Xe.HmsRoleDetail)||void 0===Ze?void 0:Ze.SellerAgentReceiveTextMessages,this.sellerAgentAgencyNameInput.value=(null===(et=null===(Qe=null==ht?void 0:ht.HmsRoleInfo)||void 0===Qe?void 0:Qe.HmsRoleDetail)||void 0===et?void 0:et.SellerNameOfAgency)||"",this.buyersAgentNameInput.value=(null===(ot=null===(tt=null==ht?void 0:ht.HmsRoleInfo)||void 0===tt?void 0:tt.HmsRoleDetail)||void 0===ot?void 0:ot.BuyersAgentFirstName)||"",this.buyersAgentLastNameInput.value=(null===(it=null===(nt=null==ht?void 0:ht.HmsRoleInfo)||void 0===nt?void 0:nt.HmsRoleDetail)||void 0===it?void 0:it.BuyersAgentLastName)||"",this.buyersAgentNumberInput.value=(null===(rt=null===(st=null==ht?void 0:ht.HmsRoleInfo)||void 0===st?void 0:st.HmsRoleDetail)||void 0===rt?void 0:rt.BuyersAgentPhone)||"",this.buyersAgentEmailInput.value=(null===(at=null===(lt=null==ht?void 0:ht.HmsRoleInfo)||void 0===lt?void 0:lt.HmsRoleDetail)||void 0===at?void 0:at.BuyersAgentEmail)||"",this.buyersAgentAgencyNameInput.value=(null===(ct=null===(dt=null==ht?void 0:ht.HmsRoleInfo)||void 0===dt?void 0:dt.HmsRoleDetail)||void 0===ct?void 0:ct.BuyersNameOfAgency)||"",this.buyersAgentRecieveUpdate.checked=null===(mt=null===(ut=null==ht?void 0:ht.HmsRoleInfo)||void 0===ut?void 0:ut.HmsRoleDetail)||void 0===mt?void 0:mt.BuyersReceiveTextMessages)}validateForm(){var e,t,o,n,s,r,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w,L,E,C,A,_,k,N,T,B,P,j,D,M,q,R,O,x,F,$,H,z,W,U,G,V,J,Y,K,X,Z,Q;let ee=[];
3document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),document.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"));const te={};if(ee=[{input:this.selectInspector,id:null===(e=this.selectInspector)||void 0===e?void 0:e.id,regex:i.REGEX.matchAny,errorMessage:"Please select the option"}],"homeowner"===(null===(t=this.selectedValue)||void 0===t?void 0:t.toLowerCase())){const e=document.getElementById("yes-18"),t=document.getElementById("no-18");if(!(null===(o=this.homeOwnerInspectionOver18)||void 0===o?void 0:o.checked)&&!(null==t?void 0:t.checked)){const e=document.getElementById("yes-18-error-msg");te["yes-18-error-msg"]=(null==e?void 0:e.innerText)||"This is mandatory Field",e.classList.remove("hidden")}[t,e].forEach(e=>e.addEventListener("click",()=>this.hideErrorMessage("yes-18-error-msg"))),ee=[{input:this.ownerNameInput,id:null===(n=this.ownerNameInput)||void 0===n?void 0:n.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.ownerLastNameInput,id:null===(s=this.ownerLastNameInput)||void 0===s?void 0:s.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.ownerNumberInput,id:null===(r=this.ownerNumberInput)||void 0===r?void 0:r.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.ownerEmailInput,id:null===(l=this.ownerEmailInput)||void 0===l?void 0:l.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}]}if("agent"===(null===(a=this.selectedValue)||void 0===a?void 0:a.toLowerCase())){const e=document.getElementById("agent-the-buyer"),t=document.getElementById("agent-buyer-agent"),o=document.getElementById("agent-the-seller"),n=document.getElementById("agent-seller-agent");if(!((null==e?void 0:e.checked)||(null==t?void 0:t.checked)||(null==o?void 0:o.checked)||(null==n?void 0:n.checked))){document.getElementById("agent-inspector_attend").classList.remove("hidden")}
3if([e,t,o,n].forEach(e=>e.addEventListener("click",()=>this.hideErrorMessage("agent-inspector_attend"))),!(null===(d=this.agentBuyerYes)||void 0===d?void 0:d.checked)&&!(null===(c=this.agentSellerYes)||void 0===c?void 0:c.checked)){document.getElementById("agent-buyer-yes-error-msg").classList.remove("hidden")}if([this.agentBuyerYes,this.agentSellerYes].forEach(e=>e.addEventListener("click",()=>this.hideErrorMessage("agent-buyer-yes-error-msg"))),ee=[{input:this.agentPropertyAccess,id:null===(u=this.agentPropertyAccess)||void 0===u?void 0:u.id,regex:i.REGEX.sendName,errorMessage:"Invalid name format."},{input:this.agentNameInput,id:null===(m=this.agentNameInput)||void 0===m?void 0:m.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.agentLastNameInput,id:null===(h=this.agentLastNameInput)||void 0===h?void 0:h.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.agentNumberInput,id:null===(p=this.agentNumberInput)||void 0===p?void 0:p.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.agentEmailInput,id:null===(v=this.agentEmailInput)||void 0===v?void 0:v.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."},{input:this.agentClientNameInput,id:null===(g=this.agentClientNameInput)||void 0===g?void 0:g.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.agentClientLastNameInput,id:null===(f=this.agentClientLastNameInput)||void 0===f?void 0:f.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.agentClientNumberInput,id:null===(y=this.agentClientNumberInput)||void 0===y?void 0:y.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.agentClientEmailInput,id:null===(b=this.agentClientEmailInput)||void 0===b?void 0:b.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],this.agentInformationYes.checked){ee=[...[{input:this.agentsAgentNameInput,id:null===(I=this.agentsAgentNameInput)||void 0===I?void 0:I.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.agentsAgentLastNameInput,id:null===(S=this.agentsAgentLastNameInput)||void 0===S?void 0:S.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.agentsAgentNumberInput,id:null===(w=this.agentsAgentNumberInput)||void 0===w?void 0:w.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.agentsAgentEmailInput,id:null===(L=this.agentsAgentEmailInput)||void 0===L?void 0:L.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],...ee]}}if("buyer"===(null===(E=this.selectedValue)||void 0===E?void 0:E.toLowerCase())){const e=document.getElementById("buyer-the-buyer"),t=document.getElementById("buyer-buyer-agent"),o=document.getElementById("buyer-the-seller"),n=document.getElementById("buyer-seller-agent");if(!((null==e?void 0:e.checked)||(null==t?void 0:t.checked)||(null==o?void 0:o.checked)||(null==n?void 0:n.checked))){document.getElementById("buyer-inspector_attend").classList.remove("hidden")}
3if([e,t,o,n].forEach(e=>e.addEventListener("click",()=>this.hideErrorMessage("buyer-inspector_attend"))),ee=[{input:this.buyerPropertyAccess,id:null===(C=this.buyerPropertyAccess)||void 0===C?void 0:C.id,regex:i.REGEX.sendName,errorMessage:"Invalid name format."},{input:this.buyerNameInput,id:null===(A=this.buyerNameInput)||void 0===A?void 0:A.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.buyerLastNameInput,id:null===(_=this.buyerLastNameInput)||void 0===_?void 0:_.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.buyerNumberInput,id:null===(k=this.buyerNumberInput)||void 0===k?void 0:k.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.buyerEmailInput,id:null===(N=this.buyerEmailInput)||void 0===N?void 0:N.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],null===(T=this.buyerAgentYes)||void 0===T?void 0:T.checked){ee=[...[{input:this.buyerAgentNameInput,id:null===(B=this.buyerAgentNameInput)||void 0===B?void 0:B.id,regex:i.REGEX.sendName,errorMessage:"Invalid name format."},{input:this.buyerAgentLastNameInput,id:null===(P=this.buyerAgentLastNameInput)||void 0===P?void 0:P.id,regex:i.REGEX.sendName,errorMessage:"Invalid name format."},{input:this.buyerAgentNumberInput,id:null===(j=this.buyerAgentNumberInput)||void 0===j?void 0:j.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.buyerAgentEmailInput,id:null===(D=this.buyerAgentEmailInput)||void 0===D?void 0:D.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],...ee]}if(null===(M=this.buyerInformationYes)||void 0===M?void 0:M.checked){ee=[...[{input:this.buyerSellerAgentNameInput,id:null===(q=this.buyerSellerAgentNameInput)||void 0===q?void 0:q.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.buyerSellerAgentLastNameInput,id:null===(R=this.buyerSellerAgentLastNameInput)||void 0===R?void 0:R.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.buyerSellerAgentNumberInput,id:null===(O=this.buyerSellerAgentNumberInput)||void 0===O?void 0:O.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.buyerSellerAgentEmailInput,id:null===(x=this.buyerSellerAgentEmailInput)||void 0===x?void 0:x.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],...ee]}}if("seller"===(null===(F=this.selectedValue)||void 0===F?void 0:F.toLowerCase())){const e=document.getElementById("seller-the-buyer"),t=document.getElementById("seller-buyer-agent"),o=document.getElementById("seller-the-seller"),n=document.getElementById("seller-seller-agent");if(!((null==e?void 0:e.checked)||(null==t?void 0:t.checked)||(null==o?void 0:o.checked)||(null==n?void 0:n.checked))){document.getElementById("seller-inspector_attend").classList.remove("hidden")}
3if([e,t,o,n].forEach(e=>e.addEventListener("click",()=>this.hideErrorMessage("seller-inspector_attend"))),ee=[{input:this.sellerPropertyAccess,id:null===($=this.sellerPropertyAccess)||void 0===$?void 0:$.id,regex:i.REGEX.sendName,errorMessage:"Invalid name format."},{input:this.sellerNameInput,id:null===(H=this.sellerNameInput)||void 0===H?void 0:H.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.sellerLastNameInput,id:null===(z=this.sellerLastNameInput)||void 0===z?void 0:z.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.sellerNumberInput,id:null===(W=this.sellerNumberInput)||void 0===W?void 0:W.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.sellerEmailInput,id:null===(U=this.sellerEmailInput)||void 0===U?void 0:U.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],this.sellerAgentYes.checked){ee=[...[{input:this.sellerAgentNameInput,id:null===(G=this.sellerAgentNameInput)||void 0===G?void 0:G.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.sellerAgentLastNameInput,id:null===(V=this.sellerAgentLastNameInput)||void 0===V?void 0:V.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.sellerAgentNumberInput,id:null===(J=this.sellerAgentNumberInput)||void 0===J?void 0:J.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.sellerAgentEmailInput,id:null===(Y=this.sellerAgentEmailInput)||void 0===Y?void 0:Y.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],...ee]}if(this.sellerInformationYes.checked){ee=[...[{input:this.buyersAgentNameInput,id:null===(K=this.buyersAgentNameInput)||void 0===K?void 0:K.id,regex:i.REGEX.sendName,errorMessage:"Invalid first name format."},{input:this.buyersAgentLastNameInput,id:null===(X=this.buyersAgentLastNameInput)||void 0===X?void 0:X.id,regex:i.REGEX.sendName,errorMessage:"Invalid last name format."},{input:this.buyersAgentNumberInput,id:null===(Z=this.buyersAgentNumberInput)||void 0===Z?void 0:Z.id,regex:null,errorMessage:"Invalid phone format.",isPhone:!0},{input:this.buyersAgentEmailInput,id:null===(Q=this.buyersAgentEmailInput)||void 0===Q?void 0:Q.id,regex:i.REGEX.sendEmail,errorMessage:"Invalid email format."}],...ee]}}ee.forEach(({input:e,id:t,regex:o,errorMessage:n})=>{var i,s;let r=n;if(n=null!==(s=null===(i=document.getElementById(`${t}-error-msg`))||void 0===i?void 0:i.innerText)&&void 0!==s?s:n,e.required&&""===e.value)te[t]=n;else if(""!==e.value&&o&&!o.test(e.value))te[t]=r;else if(""!==e.value&&e.isPhone&&e.value.length<this.PHONE_NUMBER_LENGTH){const e=document.getElementById(`${t}-error-msg`);te[t]=r,e&&(e.innerHTML=n,e.classList.remove("hidden"))}});const oe=Object.keys(te)[0];if(oe){const e=document.getElementById(oe);e&&e.focus()}return Object.keys(te).forEach(e=>{const t=document.getElementById(e),o=document.getElementById(`${e}-error-msg`);t&&t.parentNode&&(t.classList.add("invalid-field"),o&&(o.innerHTML=te[e],o.classList.remove("hidden")))}),0===Object.keys(te).length}handleGoBack(){const e=document.getElementById("schedule-step");(0,r.currentActiveStep)(e),(0,a.hmsProgressBarUpdate)("0%",0),window.scrollTo(0,0)}handleDOMContentLoaded(){const e=document.querySelector(".select-items.slim-scroll");if(e){const t=e.querySelectorAll('button[type="button"]');t.forEach(e=>{e.addEventListener("click",o=>{var n;t.forEach(e=>{e.classList.remove("same-as-selected")}),this.selectInspector&&(this.selectInspector.value=null===(n=null==o?void 0:o.target)||void 0===n?void 0:n.textContent),e.classList.add("same-as-selected");const i=e.parentNode;if(i){const t=i.previousElementSibling;t instanceof HTMLElement?(t.innerHTML=e.innerHTML,this.selectedScheduling=e.innerHTML,t.click()):console.error("Previous sibling element is not an HTMLElement.")}else console.error("Select options container is null or undefined.")})})}}handleMobileInput(e,t){e.preventDefault();const o=i.REGEX.mobileNumberRegex,n=null==t?void 0:t.value,r=null==n?void 0:n.replace(/\D/g,"").match(o);if(n&&n.length<this.PHONE_NUMBER_LENGTH?this.handleError(t,i.REGEX.mobileNumberRegex,null==t?void 0:t.id,s.default.invalidPhoneNumber):this.hideError(null==t?void 0:t.id),r){const e=r[2]?`(${r[1]}) ${r[2]}
3${r[3]?"-"+r[3]:""}`:r[1];t.value=e}}hideError(e){var t;null===(t=document.getElementById(`${e}-error-msg`).classList)||void 0===t||t.add("hidden")}handleError(e,t,o,n){const i=document.getElementById(`${o}-error-msg`);""!==e.value&&!t.test(e.value)&&i&&e.required?(i.classList.remove("hidden"),i.innerHTML=null!=n?n:"Invalid format."):this.hideError(o)}}},"./src/js/opus2/hms/step4.ts"(e,t,o){"use strict";o.d(t,{HMSStep4:()=>f});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),a=o(/*! ../util/commonValidation */"./src/js/opus2/util/commonValidation.ts"),d=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),c=o(/*! ./step2 */"./src/js/opus2/hms/step2.ts"),u=o(/*! ./step5 */"./src/js/opus2/hms/step5.ts");let m="",h=!1,p=null,v=[];const g="https://discover.search.hereapi.com/v1/discover?q=";class f{constructor(){this.getAutoSuggested=()=>{let e=!1;const t=document.querySelectorAll(".input-label-wrap #select-zip")[0];t&&"select-zip"==t.id&&(e=!0);const o={method:"GET",url:`${g}${e&&this.zipCodeInput.value?`${this.zipCodeInput.value}`:document.getElementById("address-1").value}&in=countryCode%3AUSA%2CCAN&at=0,0&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`};(0,i.default)(o).then(e=>{var t,o,n,i;let s=null===(o=null===(t=null==e?void 0:e.items[0])||void 0===t?void 0:t.address)||void 0===o?void 0:o.city,r=null===(i=null===(n=null==e?void 0:e.items[0])||void 0===n?void 0:n.address)||void 0===i?void 0:i.state;sessionStorage.setItem("manualCity",s),sessionStorage.setItem("manualState",r)}).catch(e=>{})},this.setAutoSuggested=e=>(0,n.__awaiter)(this,void 0,void 0,function*(){e.preventDefault();let t=!1;const o=document.querySelectorAll(".input-label-wrap #select-zip")[0];sessionStorage.setItem("suggestion","false"),sessionStorage.setItem("manualCity",""),sessionStorage.setItem("manualState",""),o&&"select-zip"==o.id&&(t=!0);const n={method:"GET",url:`${g}${t&&this.zipCodeInput.value?`${document.getElementById("address-1").value}, ${this.zipCodeInput.value}`:document.getElementById("address-1").value}&in=countryCode%3AUSA%2CCAN&at=0,0&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`};(0,i.default)(n).then(e=>{v=null==e?void 0:e.items,m=null==e?void 0:e.items[0],this.setDatat(null==e?void 0:e.items.map(e=>e))}).catch(e=>{})}),this.setDatat=e=>{try{const t=document.getElementById("address-1"),o=t.value.toLowerCase(),n=document.createElement("ul");for(n.className="suggestion-container";t.nextSibling&&"suggestion-container"===t.nextSibling.className;)t.parentNode.removeChild(t.nextSibling);o&&(e.forEach(e=>{var o,i,s,r,l,a,d;let c=!1;const u=document.createElement("li");u.className="suggestion-item",u.textContent=null==e?void 0:e.title,u.setAttribute("data-city",null!==(o=null==e?void 0:e.address.city)&&void 0!==o?o:""),u.setAttribute("data-country-name",null!==(s=null===(i=null==e?void 0:e.address)||void 0===i?void 0:i.countryName)&&void 0!==s?s:""),u.setAttribute("data-state-code",null!==(l=null===(r=null==e?void 0:e.address)||void 0===r?void 0:r.stateCode)&&void 0!==l?l:""),u.setAttribute("data-state-name",null!==(d=null===(a=null==e?void 0:e.address)||void 0===a?void 0:a.state)&&void 0!==d?d:""),u.addEventListener("click",()=>{var o,i,s;c=!0,h=!1,sessionStorage.setItem("suggestion","true"),t.value=null==e?void 0:e.title,n.parentNode.removeChild(n),this.setZipCode(),this.hadleaddressReate(null==e?void 0:e.title);const r=null!==(o=u.getAttribute("data-city"))&&void 0!==o?o:"",l=(u.getAttribute("data-country-name"),null!==(i=u.getAttribute("data-state-code"))&&void 0!==i?i:""),a=null!==(s=u.getAttribute("data-state-name"))&&void 0!==s?s:"";this.setCity(r),this.setState(l,a)}),c||(h=!0),n.appendChild(u)}),e.length>0&&t.parentNode.insertBefore(n,t.nextSibling))}catch(e){console.log("error",e)}},this.setZipCode=()=>{var e;let t=!0;h=!1;const o=document.querySelectorAll(".input-label-wrap #select-zip")[0];o&&"select-zip"==o.id&&(t=!1);const n=this.serviceAddressInput.value,i=v.filter(e=>e.title==n)[0],s=String(null===(e=null==i?void 0:i.address)||void 0===e?void 0:e.postalCode).split("-")[0];s&&t&&(this.zipCodeInput.value=s),setTimeout(()=>{this.addreddErrorRemove.call(this)},300)},this.staticData=!1,this.showButton=!1,this.serviceAddressInput=document.getElementById("address-1"),this.serviceAddress2Input=document.getElementById("address-2"),this.selectCity=document.getElementById("select-city"),this.zipCodeInput=document.getElementById("select-zip"),this.selectState=document.getElementById("select-state-province"),this.yearBuiltInput=document.getElementById("input-year-built"),this.sqrftInput=document.getElementById("input-sqrft"),this.foundationTypeInput=document.getElementById("select-foundation"),this.bedRoomInput=document.getElementById("input-bedroom"),this.bathRoomInput=document.getElementById("input-bathroom"),this.kitchenInput=document.getElementById("input-kitchen"),this.poolInput=document.getElementById("yes-pool"),this.onUtitlityInput=document.getElementById("on-utility"),this.occupyInput=document.getElementById("yes-occupy"),this.howAboutInput=document.getElementById("how-about-hms"),this.serviceAddressInput&&this.serviceAddressInput.addEventListener("input",this.setAutoSuggested.bind(this)),this.commonErrorValidation(),sessionStorage.setItem("manualCity",""),sessionStorage.setItem("manualState","");const e=document.querySelector(".property-address-modal a.btn");null==e||e.addEventListener("click",()=>{var e,t;h=!1;const o=document.getElementById("suggested-address-radio"),n=document.getElementById("entered-address-radio");(null==n?void 0:n.checked)&&(sessionStorage.setItem("suggestion","false"),this.getAutoSuggested()),console.log("saveBtn",null==o?void 0:o.checked),(null==o?void 0:o.checked)&&(null===(e=null==m?void 0:m.address)||void 0===e?void 0:e.label)&&(this.serviceAddressInput.value=null===(t=null==m?void 0:m.address)||void 0===t?void 0:t.label,this.hadleaddressReate(this.serviceAddressInput.value),sessionStorage.setItem("suggestion","true")),this.form.length>0&&this.form[0].click()}),this.form=document.querySelectorAll("#property-step .btn-next");const t=(0,d.removeAllEventListeners)("#property-step .btn-next"),o=document.querySelectorAll("#property-step .btn-cancel");t&&t.addEventListener("click",this.handleSubmit.bind(this)),o&&o[0]&&o[0].addEventListener("click",this.handleGoBack.bind(this)),this.setupZip()}static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!f.instance){f.instance=new f;try{yield Promise.all([f.instance.setHowOknow(),f.instance.fetchAllState()]);JSON.parse(sessionStorage.getItem("hms_booking"));f.instance.initializeCustomSelect(),f.instance.editProperty()}catch(e){console.error("Error:",e)}}return f.instance})}static getInstance(){return f.instance}commonErrorValidation(){[{element:this.serviceAddressInput,regex:l.REGEX.sendAddress1,errorMessage:"Invalid address format."},{element:this.serviceAddress2Input,regex:l.REGEX.sendAddress2,errorMessage:"Invalid address2 format."},{element:this.selectCity,regex:l.REGEX.sendName,errorMessage:"Enter Valid City"},{element:this.zipCodeInput,regex:l.REGEX.sendZip,errorMessage:"Invalid zip code format."},{element:this.yearBuiltInput,regex:l.REGEX.sendYear,errorMessage:"Must be in the last 250 years in format YYYY"},{element:this.sqrftInput,regex:l.REGEX.allow3Digit,errorMessage:"Please enter a number between 500 - 99999"},{element:this.bedRoomInput,regex:l.REGEX.allow1to99,errorMessage:"Please enter a number between 1 - 99"},{element:this.bathRoomInput,regex:l.REGEX.allow1to99,errorMessage:"Please enter a number between 1 - 99"},{element:this.kitchenInput,regex:l.REGEX.allow1to9,errorMessage:"Please enter a number between 1 - 9"}
3].forEach(({element:e,regex:t,errorMessage:o})=>{e&&e.addEventListener("input",()=>(0,a.handleCommonInputError)(e,`${e.id}-modal-error-msg`,t,o))});[{element:this.selectState,regex:l.REGEX.sendName,errorMessage:"Please select State"},{element:this.foundationTypeInput,regex:l.REGEX.sendName,errorMessage:"Please Select Foundation Type."},{element:this.howAboutInput,regex:l.REGEX.sendName,errorMessage:"Please Select"}].forEach(({element:e,regex:t,errorMessage:o})=>{e&&e.addEventListener("change",()=>(0,a.handleCommonInputError)(e,`${e.id}-modal-error-msg`,t,o))})}handleGoBack(){const e=document.getElementById("inspection-step");(0,c.currentActiveStep)(e),(0,d.hmsProgressBarUpdate)("25%",1),window.scrollTo(0,0)}setupZip(){let e=JSON.parse(sessionStorage.getItem("hms_booking"));if(this.zipCodeInput)if(null==e?void 0:e.zipcode)this.zipCodeInput.value=null==e?void 0:e.zipcode;else{const e=sessionStorage.getItem("sAddressParam");this.zipCodeInput.value=e||""}}nextStep5(){const e=document.getElementById("service-step");(0,c.currentActiveStep)(e);sessionStorage.getItem("hms_s5")||new u.ServiceInspection}handleSubmit(){var e,t,o,n,i,s;if(this.validateForm()){let r=JSON.parse(sessionStorage.getItem("hms_booking"));
3const{serviceAddressInput:l,serviceAddress2Input:a,selectCity:d,zipCodeInput:c,selectState:u,yearBuiltInput:p,sqrftInput:v,foundationTypeInput:g,bedRoomInput:f,bathRoomInput:y,kitchenInput:b,poolInput:I,onUtitlityInput:S,occupyInput:w,howAboutInput:L}=this;let E=r;const C={Address:null==l?void 0:l.value,Address2:(null==a?void 0:a.value)||null,City:null==d?void 0:d.value,State:null==u?void 0:u.value,Country:sessionStorage.getItem("countryName")};E=Object.assign(Object.assign({},E),C);let A={BuiltYear:null==p?void 0:p.value,SquareFeet:Number.parseInt(null==v?void 0:v.value),TypeOfFoundation:null==g?void 0:g.value,NumberOfBedrooms:Number.parseInt(null==f?void 0:f.value),NumberOfBathrooms:Number.parseInt(null==y?void 0:y.value),NumberOfKitchens:Number.parseInt(null==b?void 0:b.value),IsPoolAvailable:null==I?void 0:I.checked,UtilitiesOn:null==S?void 0:S.checked,HearAboutHouseMaster:null==L?void 0:L.value,explainOther:"",isPropertyOccupied:null==w?void 0:w.checked};if((null==r?void 0:r.HmsRoleInfo)?E.HmsRoleInfo=Object.assign(Object.assign({},r.HmsRoleInfo),{HmsPropertyDetail:Object.assign({},A)}):E=Object.assign({HmsRoleInfo:{HmsPropertyDetail:A}},r),r=E,console.log(E,"propertyPayload"),sessionStorage.setItem("hms_booking",JSON.stringify(r)),l.value.trim()==(null===(e=null==m?void 0:m.address)||void 0===e?void 0:e.label)&&(h=!1),h&&(null===(t=null==m?void 0:m.address)||void 0===t?void 0:t.label)){const e=document.getElementById("address-modal"),t=null===(o=null==m?void 0:m.address)||void 0===o?void 0:o.label;null==e||e.click();const r=document.querySelector("[for=entered-address-radio]");r&&(r.innerHTML=this.serviceAddressInput.value);const l=document.querySelector("[for=suggested-address-radio]");if(l){l.innerHTML=t;const e=null===(n=null==m?void 0:m.address)||void 0===n?void 0:n.city,o=null===(i=null==m?void 0:m.address)||void 0===i?void 0:i.stateCode,r=null===(s=null==m?void 0:m.address)||void 0===s?void 0:s.state;e&&this.setCity(e),o&&this.setState(o,r)}}else this.nextStep5()}}validateForm(){var e,t,o,n,i,s,r,a,d,c,u,m;document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),document.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"));const h={},p=document.getElementById("yes-pool"),v=document.getElementById("no-pool");if(!p.checked&&!v.checked){const e=document.getElementById("yes-pool-modal-error-msg");e.innerText=e.innerText||"Please select",e.classList.remove("hidden")}const g=document.getElementById("on-utility"),f=document.getElementById("off-utility");if(!g.checked&&!f.checked){const e=document.getElementById("on-utility-modal-error-msg");e.innerText=e.innerText||"Please select",e.classList.remove("hidden")}const y=document.getElementById("yes-occupy"),b=document.getElementById("no-occupy");if(!y.checked&&!b.checked){const e=document.getElementById("yes-occupy-modal-error-msg");e.innerText=e.innerText||"Please select",e.classList.remove("hidden")}[{input:this.serviceAddressInput,id:null===(e=this.serviceAddressInput)||void 0===e?void 0:e.id,regex:l.REGEX.sendAddress1,errorMessage:"Invalid address format."},{input:this.serviceAddress2Input,id:null===(t=this.serviceAddress2Input)||void 0===t?void 0:t.id,regex:l.REGEX.sendAddress2,errorMessage:"Invalid address2 format."},{input:this.selectCity,id:null===(o=this.selectCity)||void 0===o?void 0:o.id,regex:l.REGEX.sendName,errorMessage:"Enter Valid City"},{input:this.selectState,id:null===(n=this.selectState)||void 0===n?void 0:n.id,regex:l.REGEX.matchAny,errorMessage:"Please select State"},{input:this.zipCodeInput,id:null===(i=this.zipCodeInput)||void 0===i?void 0:i.id,regex:l.REGEX.sendZip,errorMessage:"Invalid zip code format."},{input:this.yearBuiltInput,id:null===(s=this.yearBuiltInput)||void 0===s?void 0:s.id,regex:l.REGEX.sendYear,errorMessage:"Must be in the last 250 years in format YYYY"},{input:this.sqrftInput,id:null===(r=this.sqrftInput)||void 0===r?void 0:r.id,regex:l.REGEX.allow3Digit,errorMessage:"Please enter a number between 500 - 99999"},{input:this.foundationTypeInput,id:null===(a=this.foundationTypeInput)||void 0===a?void 0:a.id,regex:l.REGEX.matchAny,errorMessage:"Please Select Foundation Type."},{input:this.bedRoomInput,id:null===(d=this.bedRoomInput)||void 0===d?void 0:d.id,regex:l.REGEX.allow1to99,errorMessage:"Please enter a number between 1 - 99"},{input:this.bathRoomInput,id:null===(c=this.bathRoomInput)||void 0===c?void 0:c.id,regex:l.REGEX.allow1to99,errorMessage:"Please enter a number between 1 - 99"},{input:this.kitchenInput,id:null===(u=this.kitchenInput)||void 0===u?void 0:u.id,regex:l.REGEX.allow1to9,errorMessage:"Please enter a number between 1 - 9"},{input:this.howAboutInput,id:null===(m=this.howAboutInput)||void 0===m?void 0:m.id,regex:l.REGEX.matchAny,errorMessage:"Please Select"}
3].forEach(({input:e,id:t,regex:o,errorMessage:n})=>{var i,s;let r=n;if(n=null!==(s=null===(i=document.getElementById(`${t}-modal-error-msg`))||void 0===i?void 0:i.innerText)&&void 0!==s?s:n,e.required&&""===e.value)h[t]=n;else if(""!==e.value&&o&&!o.test(e.value))h[t]=r;else if("input-year-built"===e.id){const o=e.value;o>=(new Date).getFullYear()-250&&o<=(new Date).getFullYear()||(h[t]=r)}});const I=Object.keys(h)[0];if(I){const e=document.getElementById(I);e&&e.focus()}return Object.keys(h).forEach(e=>{const t=document.getElementById(e),o=document.getElementById(`${e}-modal-error-msg`);t&&t.parentNode&&(t.classList.add("invalid-field"),o&&(o.innerHTML=h[e],o.classList.remove("hidden")))}),0===Object.keys(h).length}hadleaddressReate(e){var t,o,n,i,s,r,l,a;p="";const d=null==v?void 0:v.find(t=>(null==t?void 0:t.title.trim())===e.trim());if(sessionStorage.setItem("stateCode",null===(t=null==d?void 0:d.address)||void 0===t?void 0:t.stateCode),sessionStorage.setItem("countryName",null===(o=null==d?void 0:d.address)||void 0===o?void 0:o.countryName),d)if((null===(n=null==d?void 0:d.address)||void 0===n?void 0:n.houseNumber)&&(null===(i=null==d?void 0:d.address)||void 0===i?void 0:i.street))p=(null===(s=null==d?void 0:d.address)||void 0===s?void 0:s.houseNumber)+" "+(null===(r=null==d?void 0:d.address)||void 0===r?void 0:r.street);else{let e=Object.keys(null==d?void 0:d.address).includes("street"),t=Object.keys(null==d?void 0:d.address).includes("houseNumber");!0===e&&!1===t&&(p=null===(l=null==d?void 0:d.address)||void 0===l?void 0:l.street),!1===e&&!0===t&&(p=null===(a=null==d?void 0:d.address)||void 0===a?void 0:a.houseNumber)}}setCity(e){var t;this.selectCity&&(this.selectCity.value=e,this.hideErrorMessage(null===(t=this.selectCity)||void 0===t?void 0:t.id))}setState(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o;let n=document.querySelector("#select-state-province"),i=null==n?void 0:n.parentElement.querySelector(".select-selected");const s=document.querySelector("#select-state-province"),r=yield this.fetchAllState(),l=null==r?void 0:r.findIndex(t=>{var o;return(null===(o=t.stateCode)||void 0===o?void 0:o.toLowerCase())===(null==e?void 0:e.toLowerCase())});let a=t;-1!=l&&r&&r.length>0&&(a=null===(o=r[l])||void 0===o?void 0:o.stateName),i&&(0==l||l)&&s&&(s.value=e,i.innerText=a,i.style.backgroundColor="var(--primary-500)",i.style.color="var(--white)",i.style.whiteSpace="nowrap",i.style.overflow="hidden",i.style.borderRight="40px solid var(--primary-500)",this.hideErrorMessage("select-state-province"))})}addreddErrorRemove(){var e;if(this.serviceAddressInput.value==(null===(e=null==m?void 0:m.address)||void 0===e?void 0:e.label)&&(h=!1),""==this.serviceAddressInput.value||l.REGEX.sendAddress1.test(this.serviceAddressInput.value))this.showButton=!0,this.hideError("address-1"),this.hideError("select-zip");else{const e=document.getElementById("address-1-error-msg");e.classList.remove("hidden"),e.innerHTML="Invalid address format.",this.showButton=!1}}hideError(e){const t=document.getElementById(e);document.getElementById(`${e}-modal-error-msg`).classList.add("hidden"),t.classList.remove("invalid-field")}setHowOknow(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return new Promise((e,t)=>{const o=sessionStorage.getItem("franchiseId");let n=`${r.apiConfig.howToKnow}/${o}`;if(o){const o=document.getElementById("how-about-hms");o?(0,s.cachedAPIWrapper)(n).then(t=>{const n=t;o.innerHTML="";const i=document.createElement("option");i.value="",i.textContent="Select a Referral Method";let s=JSON.parse(sessionStorage.getItem("hms_booking"));(null==s?void 0:s.ReferralType)&&(i.value=null==s?void 0:s.ReferralType,i.textContent=null==s?void 0:s.ReferralType),o.appendChild(i),n.forEac
3h(e=>{const t=document.createElement("option");t.value=e.leadSourceName,t.textContent=e.leadSourceName,t.setAttribute("data-sync-generic-lead-source-id",e.syncGenericLeadSourceId),t.setAttribute("data-referral-type-id",e.referralTypeId),o.appendChild(t)}),e()}).catch(e=>{t(e)}):e()}else e()})})}createCommonState(e){const t=document.getElementById("select-state-province");if(t){for(;null==t?void 0:t.firstChild;)t.removeChild(t.firstChild);const o=document.createElement("option");o.text="State/Province",o.value="",t.appendChild(o),null==e||e.forEach(e=>{const o=document.createElement("option");o.text=e.stateName,o.value=e.stateCode,t.appendChild(o)})}}fetchAllState(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=yield(0,d.commonStates)("US"),t=yield(0,d.commonStates)("CA");let o=[...e,...t];return o.sort((e,t)=>e.stateName!==t.stateName?e.stateName<t.stateName?-1:1:0),this.createCommonState(o),o}catch(e){console.error("Error in fetching state API data:",e)}})}createCustomSelect(){document.querySelectorAll("#property-step .custom-select").forEach(e=>{var t,o;const n=e.querySelector("select"),i=n.querySelectorAll("option"),s=null!==(o=null===(t=i[n.selectedIndex])||void 0===t?void 0:t.innerHTML)&&void 0!==o?o:"",r=document.createElement("button");r.type="button",r.classList.add("select-selected"),r.innerHTML=s,e.appendChild(r);const l=document.createElement("div");l.classList.add("select-items","select-hide","slim-scroll"),i.forEach(t=>{let o=this;if(0!==t.index){const i=document.createElement("button");i.type="button",i.innerHTML=t.innerHTML,i.value=t.value,e.querySelector("#how-about-hms")&&((null==t?void 0:t.getAttribute("data-referral-type-id"))&&i.setAttribute("data-referral-type-id",null==t?void 0:t.getAttribute("data-referral-type-id")),(null==t?void 0:t.getAttribute("data-sync-generic-lead-source-id"))&&i.setAttribute("data-sync-generic-lead-source-id",null==t?void 0:t.getAttribute("data-sync-generic-lead-source-id"))),i.addEventListener("click",function(t){var i,s,l,a,d;const c=null===(i=t.target)||void 0===i?void 0:i.innerHTML;if(r.innerHTML=c,n.value=null===(s=t.target)||void 0===s?void 0:s.value,e.querySelector("#how-about-hms")){let e=JSON.parse(sessionStorage.getItem("hms_booking"));const o=null===(l=t.target)||void 0===l?void 0:l.getAttribute("data-referral-type-id"),n=t.target.value;o&&null!=o&&(e.ReferralTypeId=o),n&&(e.ReferralType=n);null===(a=t.target)||void 0===a||a.getAttribute("data-sync-generic-lead-source-id");let i=localStorage.getItem("brandDetails");if("undefined"!==i&&null!=i){i=JSON.parse(i);const o=null===(d=t.target)||void 0===d?void 0:d.getAttribute("data-sync-generic-lead-source-id");i&&(null==i?void 0:i.send_leadsource_id)&&o&&(e.LeadSourceID=o)}sessionStorage.setItem("hms_booking",JSON.stringify(e))}o.closeAllSelect(r),e.querySelector("#select-state-province")&&o.hideErrorMessage("select-state-province"),e.querySelector("#select-foundation")&&o.hideErrorMessage("select-foundation"),e.querySelector("#how-about-hms")&&o.hideErrorMessage("how-about-hms")}),l.appendChild(i)}}),e.appendChild(l);let a=this;r.addEventListener("click",function(e){e.stopPropagation(),a.closeAllSelect(this);const t=this.nextSibling;t&&(t.classList.toggle("select-hide"),this.classList.toggle("select-arrow-active")),document.addEventListener("keydown",e=>{"Escape"===e.key&&(a.nextSibling.classList.add("select-hide"),a.classList.remove("select-arrow-active"))}),r.style.backgroundColor="var(--primary-500)",r.style.color="var(--white)",r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.borderRight="40px solid var(--primary-500)"})})}closeAllSelect(e){const t=document.querySelectorAll("#property-step .select-items.slim-scroll"),o=document.querySelectorAll("#property-step .select-selected");t.forEach((t,n)=>{var i,s;e!==o[n]&&(t.classList.add("select-hide"),null===(s=null===(i=o[n])||void 0===i?void 0:i.classList)||void 0===s||s.remove("select-arrow-active"))})}initializeCustomSelect(){document.querySelectorAll("#property-step .select-selected").forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this.createCustomSelect();let e=this;document.addEventListener("click",function(){e.closeAllSelect(null)})}hideErrorMessage(e){const t=document.getElementById(`${e}-modal-error-msg`);t&&(null==t||t.classList.add("hidden"))}editProperty(){var e,t,o,n,i,s,r,l,a,d,c,u,m,h,p,v,g,f,y,b,I,S;let w=JSON.parse(sessionStorage.getItem("hms_booking")||"{}");
3const{serviceAddressInput:L,serviceAddress2Input:E,selectCity:C,zipCodeInput:A,selectState:_,yearBuiltInput:k,sqrftInput:N,foundationTypeInput:T,bedRoomInput:B,bathRoomInput:P,kitchenInput:j,poolInput:D,onUtitlityInput:M,occupyInput:q,howAboutInput:R}=this;if(L&&w.Address&&(L.value=w.Address),E&&w.Address2&&(E.value=w.Address2),C&&w.City&&(C.value=w.City),A&&w.ZipCode&&(A.value=w.zipcode),_&&w.State&&(_.value=w.State,this.setState(w.State,"")),k&&(null===(t=null===(e=w.HmsRoleInfo)||void 0===e?void 0:e.HmsPropertyDetail)||void 0===t?void 0:t.BuiltYear)&&(k.value=w.HmsRoleInfo.HmsPropertyDetail.BuiltYear),N&&(null===(n=null===(o=w.HmsRoleInfo)||void 0===o?void 0:o.HmsPropertyDetail)||void 0===n?void 0:n.SquareFeet)&&(N.value=w.HmsRoleInfo.HmsPropertyDetail.SquareFeet),T&&(null===(s=null===(i=w.HmsRoleInfo)||void 0===i?void 0:i.HmsPropertyDetail)||void 0===s?void 0:s.TypeOfFoundation)){let e=null===(l=null===(r=w.HmsRoleInfo)||void 0===r?void 0:r.HmsPropertyDetail)||void 0===l?void 0:l.TypeOfFoundation;T.value=w.HmsRoleInfo.HmsPropertyDetail.TypeOfFoundation;let t=document.querySelector("#select-foundation"),o=null==t?void 0:t.parentElement.querySelector(".select-selected");const n=document.querySelector("#select-foundation");o&&n&&(n.value=e,o.innerText=e,o.style.backgroundColor="var(--primary-500)",o.style.color="var(--white)",o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.borderRight="40px solid var(--primary-500)")}if(B&&(null===(d=null===(a=w.HmsRoleInfo)||void 0===a?void 0:a.HmsPropertyDetail)||void 0===d?void 0:d.NumberOfBedrooms)&&(B.value=w.HmsRoleInfo.HmsPropertyDetail.NumberOfBedrooms),P&&(null===(u=null===(c=w.HmsRoleInfo)||void 0===c?void 0:c.HmsPropertyDetail)||void 0===u?void 0:u.NumberOfBathrooms)&&(P.value=w.HmsRoleInfo.HmsPropertyDetail.NumberOfBathrooms),j&&(null===(h=null===(m=w.HmsRoleInfo)||void 0===m?void 0:m.HmsPropertyDetail)||void 0===h?void 0:h.NumberOfKitchens)&&(j.value=w.HmsRoleInfo.HmsPropertyDetail.NumberOfKitchens),D&&(null===(v=null===(p=w.HmsRoleInfo)||void 0===p?void 0:p.HmsPropertyDetail)||void 0===v?void 0:v.IsPoolAvailable)&&(D.value=w.HmsRoleInfo.HmsPropertyDetail.IsPoolAvailable?"Yes":"No"),M&&"boolean"==typeof(null===(f=null===(g=w.HmsRoleInfo)||void 0===g?void 0:g.HmsPropertyDetail)||void 0===f?void 0:f.UtilitiesOn)&&(M.value=w.HmsRoleInfo.HmsPropertyDetail.UtilitiesOn?"Yes":"No"),q&&(null===(b=null===(y=w.HmsRoleInfo)||void 0===y?void 0:y.HmsPropertyDetail)||void 0===b?void 0:b.isPropertyOccupied)&&(q.value=w.HmsRoleInfo.HmsPropertyDetail.isPropertyOccupied?"Yes":"No"),R&&(null===(S=null===(I=null==w?void 0:w.HmsRoleInfo)||void 0===I?void 0:I.HmsPropertyDetail)||void 0===S?void 0:S.HearAboutHouseMaster)){let e=document.querySelector("#how-about-hms"),t=null==e?void 0:e.parentElement.querySelector(".select-selected");const o=document.querySelector("#how-about-hms");t&&o&&(o.value=null==w?void 0:w.ReferralType,t.innerText=null==w?void 0:w.ReferralType,t.style.backgroundColor="var(--primary-500)",t.style.color="var(--white)",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.borderRight="40px solid var(--primary-500)")}}}f.instance=null},"./src/js/opus2/hms/step5.ts"(e,t,o){"use strict";o.d(t,{ServiceInspection:()=>a});var n=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),r=o(/*! ./step6 */"./src/js/opus2/hms/step6.ts"),l=o(/*! ../util/share */"./src/js/opus2/util/share.ts");class a{constructor(){this.packageSelected=!1,this.isPageInEditMode=!1,sessionStorage.setItem("hms_s5","true"),window.scrollTo(0,0),this.clickTracker=[],this.taken_arr=[],this.totalPrice=0,this.inspectionPackages={},this.inspectionServices={},this.init(),this.loadStep5(),(0,l.hmsProgressBarUpdate)("75%",3),this.showFooterData()}errorModalTrigger(){const e=document.getElementById("error-modal-HMS-trigger");null==e||e.click();const t=document.getElementById("modal-hms-system-error");t&&(t.style.display="block");const o=document.querySelector("#error-modal-HMS .error-btn-close");o&&o.addEventListener("click",()=>{(0,l.returnToHomePage)()})}showFooterData(){const e=document.querySelector(".table-total");e&&(e.innerHTML="<p>Subtotal </p>\n <strong>$0.00</strong>")}loadStep5(){const e=document.getElementById("service-step"),t=document.querySelectorAll(".section-main>.contact-us-section");
3e&&t&&(t.forEach(e=>{e.classList.remove("form-step-active")}),e.classList.add("form-step-active"))}getServices(e){const t={method:"POST",url:`${i.apiConfig.GET_SERVICE_BUNDLE}?apikey=pneiweb-9pbaOywNKQj853D`,data:e};return(0,n.default)(t).then(e=>{if(this.inspectionPackages=e.inspectionPackages?e.inspectionPackages.inspectionPackageServices:null,this.inspectionServices=e.inspectionServices?e.inspectionServices.inspectioServiceServices:null,this.tableElements=document.querySelector(".inspection-table"),this.tableElements){this.tableElements.style.width="100%";const e=this.tableElements.querySelector("tbody");e&&(e.innerHTML=""),this.checkIfEditMode(),this.setInspectionPackages(),this.setInspectionServices(),this.updateTotalCost()}(0,s.stopLoader)()}).catch(e=>{(0,s.stopLoader)(),console.error("Error fetching API data : ",e),this.errorModalTrigger()})}handleClick(e){const t=e.target;if("BUTTON"===t.nodeName){const e=t.className;if(e.includes("accrd-btn")){const e=t.getAttribute("data-accordion-target");this.accordianSection(e)}else{const o=e.split(" ")[1],n={type:o.split("__")[0],action:JSON.parse(o.split("__")[1]),index:t.id.split("-")[1]};"package"===n.type?this.clickEventForPackages(this.inspectionPackages[n.index],n.action,t.id):this.clickEventForServices(this.inspectionServices[n.index],n.action,t.id),n.action&&this.toggleErrorDiv()}}}setTimeAndDate(e){return new Date(e).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}setInspectionPackages(){this.isPageInEditMode&&this.editData.HmsServiceBundles.length>0&&this.editData.HmsServiceBundles.forEach(e=>{this.clickTracker.push(e.hmsBundleServiceId),this.totalPrice+=e.hmsBundleServicePrice,this.checkforItemInServices(),this.updateTotalCost()});const e=this.tableElements.querySelector("tbody");e.addEventListener("click",this.handleClick.bind(this)),this.inspectionPackages.forEach((t,o)=>{let n="",i="";if(t.inspectionRelatedServices.length>0){let e="";t.inspectionRelatedServices.forEach(t=>{e+=`<li>${t.inspectionRelatedServiceName}</li>`}),i=`<div class="the-details hidden" id="accrd-pack-${o}"><div class="inspection-list"><strong>Included Services:</strong><ul>${e}</ul></div></div>`}else t.inspectionServiceDescription&&(i=`<div class="the-details hidden" id="accrd-pack-${o}"><p class="inspection-sub-text">${t.inspectionServiceDescription}</p></div>`);n=""===i||/<\/?[a-z][\s\S]*>/i.test(t.inspectionServiceDescription)?`<p class="inspection-text-main">${t.inspectionServiceName} <button type="button" class="accrd-btn text-gray-500 dark:text-gray-400" data-accordion-target="#accrd-pack-${o}" aria-expanded="false" aria-controls="accrd-pack-${o}" style="display:none">(show included services)</button></p>`:`<p class="inspection-text-main">${t.inspectionServiceName} <button type="button" class="accrd-btn text-gray-500 dark:text-gray-400" data-accordion-target="#accrd-pack-${o}" aria-expanded="false" aria-controls="accrd-pack-${o}">(show included services)</button></p>`;const s=`<td><strong class="price">$${t.inspectionServicePrice}</strong></td>`,r=`ctaButtonPack-${o}`,l=`<td><button type="button" id="${r}" class="table-danger-btn package__false"><span style="pointer-events:none">Remove</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-danger"></use>\n </svg>\n </button></td>`,a=`<td><button type="button" id="${r}" class="table-primary-btn package__true"><span style="pointer-events:none">Add</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-white"></use>\n </svg>\n </button></td>`;let d;d=this.clickTracker.includes(t.inspectionServiceId)?l:a,e.insertAdjacentHTML("beforeend",`<tr><td><div class="row-wrap">${n}${i}</div></td>${s}${d}</tr>`)})}setInspectionServices(){this.isPageInEditMode&&this.editData.HmsAvailableServices.length>
30&&this.editData.HmsAvailableServices.forEach(e=>{this.clickTracker.push(e.HmsServiceId),this.totalPrice+=e.HmsPrice,this.updateTotalCost()});const e=this.tableElements.querySelector("tbody");e.insertAdjacentHTML("beforeend",'<tr><td colspan="3" class="table-header">Inspection Services</td></tr>'),this.inspectionServices.forEach((t,o)=>{let n="",i="";t.inspectionServiceDescription&&(i=`<div class="the-details hidden" id="accrd-serv-${o}"><p class="inspection-sub-text">${t.inspectionServiceDescription}</p></div>`),n=""===i||/<\/?[a-z][\s\S]*>/i.test(t.inspectionServiceDescription)?`<p class="inspection-text-main">${t.inspectionServiceName} <button type="button" class="accrd-btn bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white" data-accordion-target="#accrd-serv-${o}" aria-expanded="false" aria-controls="accrd-serv-${o}" style="display:none">(show included services)</button></p>`:`<p class="inspection-text-main">${t.inspectionServiceName} <button type="button" class="accrd-btn bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white" data-accordion-target="#accrd-serv-${o}" aria-expanded="false" aria-controls="accrd-serv-${o}">(show included services)</button></p>`;const s=`<td><strong class="price">$${t.inspectionServicePrice}</strong></td>`,r=`ctaButtonServ-${o}`,l=`<td><button type="button" id="${r}" class="table-danger-btn service__false"><span style="pointer-events:none">Remove</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-danger"></use>\n </svg>\n </button></td>`,a=`<td><button type="button" id="${r}" class="table-primary-btn service__true"><span style="pointer-events:none">Add</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-white"></use>\n </svg>\n </button></td>`;let d;void 0===t.buttonEnabled&&(t.buttonEnabled=!0),d=t.buttonEnabled?this.clickTracker.includes(t.inspectionServiceId)?l:a:`<td><button type="button" id="${r}" class="table-disable-btn service__disabled" title="This service has been included in your Package"><span style="pointer-events:none">Included</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-danger"></use>\n </svg>\n </button></td>`,e.insertAdjacentHTML("beforeend",`<tr><td><div class="row-wrap">${n}${i}</div></td>${s}${d}</tr>`)})}checkforItemInServices(){return this.inspectionServices.map(e=>{const t=Object.values(e).some(e=>this.taken_arr.includes(e));return Object.assign(Object.assign({},e),{buttonEnabled:!t})})}clickEventForPackages(e,t,o){const n=document.getElementById(o),i=n.closest("td");if(t&&!this.packageSelected)n&&i&&(i.innerHTML=""),this.clickTracker.push(e.inspectionServiceId),this.totalPrice+=e.inspectionServicePrice,i.innerHTML=`<button type="button" id="${o}" class="table-danger-btn package__false"><span style="pointer-events:none">Remove</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-danger"></use>\n </svg>\n </button>`,this.packageSelected=!0;else if(!t){n&&i&&(i.innerHTML=""),this.totalPrice-=e.inspectionServicePrice;let t=this.clickTracker.indexOf(e.inspectionServiceId);-1!==t&&this.clickTracker.splice(t,1),i.innerHTML=`<button type="button" id="${o}" class="table-primary-btn package__true"><span style="pointer-events:none">Add</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-white"></use>\n </svg>\n </button>`,this.packageSelected=!1}this.checkforItemInServices(),this.updateTotalCost()}clickEventForServices(e,t,o){const n=document.getElementById(o),i=n.closest("td");if(n&&i&&(i.innerHTML=""),t)this.totalPrice+=e.inspectionServicePrice,this.clickTracker.push(e.inspectionServiceId),i.innerHTML=`<button type="button" id="${o}" class="table-danger-btn service__false"><span style="pointer-events:none">Remove</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-danger"></use>\n </svg>\n </button>`;else{this.totalPrice-=e.inspectionServicePrice;let t=this.clickTracker.indexOf(e.inspectionServiceId);-1!==t&&this.clickTracker.splice(t,1),i.innerHTML=`<button type="button" id="${o}" class="table-primary-btn service__true"><span style="pointer-events:none">Add</span>\n <svg aria-hidden="true" class="close-icon" style="pointer-events:none">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#x-mark-white"></use>\n </svg>\n </button>`}this.updateTotalCost()}
3pushId(e){e.forEach(e=>{this.taken_arr.push(e.inspectionRelatedServiceId)})}popId(e){this.taken_arr=this.taken_arr.filter(t=>!e.includes(t))}updateTotalCost(){const e=this.tableElements.querySelector(".table-total strong");e&&(e.textContent=null===this.totalPrice||Number.isNaN(this.totalPrice)?"$0.00":`$${this.totalPrice}`)}handleBackButton(){(0,l.hmsProgressBarUpdate)("50%",2);const e=document.getElementById("property-step"),t=document.querySelectorAll(".section-main>.contact-us-section");e&&t&&(t.forEach(e=>{e.classList.remove("form-step-active")}),e.classList.add("form-step-active")),sessionStorage.removeItem("hms_s5"),window.scrollTo(0,0)}init(){var e,t,o,n,i,r,l,a,d,c,u,m,h,p,v,g,f;(0,s.startLoader)();let y=sessionStorage.getItem("hms_booking");if(y){const s=JSON.parse(y),b=`{\n "Zipcode": ${null===(e=null==s?void 0:s.zipcode)||void 0===e?void 0:e.trim()},\n "WebLocationId": ${null==s?void 0:s.franchiseWebLocationId},\n "AppointmentType": 2,\n "PropertyType": "Residential",\n "PropertyInfo": {\n "YearBuilt": ${null===(o=null===(t=null==s?void 0:s.HmsRoleInfo)||void 0===t?void 0:t.HmsPropertyDetail)||void 0===o?void 0:o.BuiltYear},\n "SquareFeet": ${null===(i=null===(n=null==s?void 0:s.HmsRoleInfo)||void 0===n?void 0:n.HmsPropertyDetail)||void 0===i?void 0:i.SquareFeet},\n "FoundationType": "${null===(l=null===(r=null==s?void 0:s.HmsRoleInfo)||void 0===r?void 0:r.HmsPropertyDetail)||void 0===l?void 0:l.TypeOfFoundation}",\n "NumberOfBedrooms": "${null===(d=null===(a=null==s?void 0:s.HmsRoleInfo)||void 0===a?void 0:a.HmsPropertyDetail)||void 0===d?void 0:d.NumberOfBedrooms}",\n "NumberOfBathrooms": "${null===(u=null===(c=null==s?void 0:s.HmsRoleInfo)||void 0===c?void 0:c.HmsPropertyDetail)||void 0===u?void 0:u.NumberOfBathrooms}",\n "NumberOfKitchens": "${null===(h=null===(m=null==s?void 0:s.HmsRoleInfo)||void 0===m?void 0:m.HmsPropertyDetail)||void 0===h?void 0:h.NumberOfKitchens}",\n "HasPool": ${null===(v=null===(p=null==s?void 0:s.HmsRoleInfo)||void 0===p?void 0:p.HmsPropertyDetail)||void 0===v?void 0:v.IsPoolAvailable},\n "AreUtilitiesOn": ${null===(f=null===(g=null==s?void 0:s.HmsRoleInfo)||void 0===g?void 0:g.HmsPropertyDetail)||void 0===f?void 0:f.UtilitiesOn}\n }\n }`;this.getServices(b)}const b=document.querySelector("#service-step .service-alert");if(b){b.style.display="none";const e=document.querySelector("#service-step .btn-next");e&&e.addEventListener("click",this.manageSubmit.bind(this))}const I=document.querySelector("#service-step .btn-cancel");I&&I.addEventListener("click",this.handleBackButton);const S=sessionStorage.getItem("hms_booking");if(S){this.hmsBookingObject=JSON.parse(S);const e=document.querySelector("#service-step .step-time");e&&(e.innerHTML=`Selected Start Time: <span>${this.setTimeAndDate(this.hmsBookingObject.calendarPaylod.userSelectDate)}</span>`)}}checkIfEditMode(){var e,t;const o=sessionStorage.getItem("hms_booking");if(o){const n=JSON.parse(o);(null===(e=null==n?void 0:n.HmsRoleInfo)||void 0===e?void 0:e.HmsSelectedServiceDetail)&&(this.editData=null===(t=null==n?void 0:n.HmsRoleInfo)||void 0===t?void 0:t.HmsSelectedServiceDetail,this.isPageInEditMode=!0)}}progressBarUpdater(){const e=document.querySelector(".progressbar #progress"),t=document.querySelectorAll(".progressbar .progress-step");t&&e&&(e.style.width="75%",t.forEach((e,t)=>{t<3?e.classList.add("prograssbar-length","progress-step-confirmed"):3===t&&e.classList.add("prograssbar-length","progress-step-active")}))}accordianSection(e){const t=document.querySelectorAll(".accrd-btn"),o=document.querySelector(e);if(o){const e=o.closest(".row-wrap").querySelector("button");o.classList.toggle("hidden");const n=o.classList.contains("hidden")?"false":"true";e.setAttribute("aria-expanded",n),e.textContent="true"===n?"(hide included services)":"(show included services)",t.forEach(t=>{if(t!==e){const e=t.getAttribute("data-accordion-target");let o;e&&(o=document.querySelector(e),o&&(o.classList.add("hidden"),t.setAttribute("aria-expanded","fal
3se"),t.textContent="(show included services)"))}})}}toggleErrorDiv(){const e=document.querySelector("#service-step .service-alert");e&&(e.style.display=0===this.clickTracker.length?"flex":"none")}manageSubmit(e){e.preventDefault();const t=document.querySelector("#service-step .service-alert");t&&(0===this.clickTracker.length?t.style.display="flex":(t.style.display="none",this.packageAndServiceSummary(),sessionStorage.removeItem("hms_s5")))}packageAndServiceSummary(){let e=JSON.parse(JSON.stringify(this.inspectionPackages.filter(e=>this.clickTracker.includes(e.inspectionServiceId)))),t=JSON.parse(JSON.stringify(this.inspectionServices.filter(e=>this.clickTracker.includes(e.inspectionServiceId))));e.forEach(e=>{delete e.$id,delete e.buttonEnabled,e.hmsBundleServiceId=e.inspectionServiceId,delete e.inspectionServiceId,e.hmsBundleServiceName=e.inspectionServiceName,delete e.inspectionServiceName,e.hmsBundleServiceDescription=e.inspectionServiceDescription,delete e.inspectionServiceDescription,e.hmsBundleServiceProductNumber=e.inspectionServiceProductNumber,delete e.inspectionServiceProductNumber,e.hmsBundleServiceCreatedBy=e.inspectionServiceCreatedBy,delete e.inspectionServiceCreatedBy,e.hmsBundleServicePrice=e.inspectionServicePrice,delete e.inspectionServicePrice,e.hmsBundleItemTax=e.inspectionServiceItemTax,delete e.inspectionServiceItemTax}),t.forEach(e=>{delete e.$id,delete e.buttonEnabled,e.HmsServiceId=e.inspectionServiceId,delete e.inspectionServiceId,e.HmsServiceName=e.inspectionServiceName,delete e.inspectionServiceName,e.HmsServiceDescription=e.inspectionServiceDescription,delete e.inspectionServiceDescription,e.HmsServiceProductNumber=e.inspectionServiceProductNumber,delete e.inspectionServiceProductNumber,e.HmsServiceCreatedBy=e.inspectionServiceCreatedBy,delete e.inspectionServiceCreatedBy,e.HmsPrice=e.inspectionServicePrice,delete e.inspectionServicePrice,e.HmsItemTax=e.inspectionServiceItemTax,delete e.inspectionServiceItemTax});const o={HmsRoleInfo:{HmsSelectedServiceDetail:{HmsServiceBundles:[...e],HmsAvailableServices:[...t],HmsServiceSubTotal:this.totalPrice,HmsServiceTotal:0},HmsTaxDetail:{RegionalTaxes:[{taxAmount:0}]}}};if(sessionStorage.getItem("hms_booking")){const e=o.HmsRoleInfo.HmsSelectedServiceDetail;this.hmsBookingObject.HmsRoleInfo.HmsSelectedServiceDetail=e,this.hmsBookingObject.HmsRoleInfo.HmsTaxDetail=o.HmsRoleInfo.HmsTaxDetail}else this.hmsBookingObject=o;sessionStorage.setItem("hms_booking",JSON.stringify(this.hmsBookingObject)),new r.InspectionSummary}}},"./src/js/opus2/hms/step6.ts"(e,t,o){"use strict";o.d(t,{InspectionSummary:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts");class d{constructor(){this.summary_data={},this.loadTestData=!1,this.typeOfUser="",this.DOMsToDisplay={},sessionStorage.setItem("hms_s6","true"),window.scrollTo(0,0),this.init(),this.loadEditScreen("inspection-summary-step"),(0,a.hmsProgressBarUpdate)("100%",4)}loadEditScreen(e){const t=document.getElementById(e),o=document.querySelectorAll(".section-main>.contact-us-section");t&&o&&(o.forEach(e=>{e.classList.remove("form-step-active")}),t.classList.add("form-step-active"))}init(){(0,l.startLoader)(),this.populateSummaryData(),(0,l.stopLoader)();const e=document.querySelector("#inspection-summary-step .btn-container .btn-submit");e&&e.addEventListener("click",this.manageSubmit.bind(this));const t=document.querySelector("#inspection-summary-step .btn-container .btn-cancel");t&&t.addEventListener("click",this.manageCancel.bind(this));const o=document.querySelector(".summery-all");o&&o.addEventListener("click",this.handleRedirtects.bind(this))}handleRedirtects(e){e.preventDefault();const t=e.target;if(t.parentNode.className.includes("edit-btn")){switch(t.closest(".summery-main").id){case"inspection-time":(0,a.hmsProgressBarUpdate)("0%",0),this.loadEditScreen("schedule-step");break;case"inspection-info":case"seller-agent-info":case"buyer-agent-info":(0,a.hmsProgressBarUpdate)("25%",1),this.loadEditScreen("inspection-step");break;case"property-info":(0,a.hmsProgressBarUpdate)("50%",2),this.loadEditScreen("property-step");break;case"inspection-summary-total":(0,a.hmsProgressBarUpdate)("75%",3),this.loadEditScreen("service-step")}window.scrollTo(0,0)}}progressBarUpdater(){const e=document.querySelector(".progressbar #progress"),t=document.querySelectorAll(".progressbar .progress-step");t&&e&&(e.style.width="100%",t.forEach((e,t)=>{t<4?e.classList.add("prograssbar-length","progress-step-confirmed"):4===t&&e.classList.add("prograssbar-length","progress-step-active")}))}populateSummaryData(){if(this.loadTestData)this.loadDummyData();else{const e=sessionStorage.getItem("hms_booking");e&&(this.summary_data=JSON.parse(e))}this.populateTimeBlock(),this.populatePropertyInfo(),this.populateSummaryBlock(),this.populateTotalPrice(),this.checkUserTypeAndPopulate()}populateTimeBlock(){const e=document.getElementById("inspection-time"),t=document.querySelector("#confirmation-ins
3pection-time-date .summery");e&&this.updatePropertyInfo("#inspection-time-date .edit-content",this.setTimeAndDate(this.summary_data.calendarPaylod.userSelectDate)),t&&this.updatePropertyInfo("#confirmation-inspection-time-date .summery",this.setTimeAndDate(this.summary_data.calendarPaylod.userSelectDate))}populatePropertyInfo(){document.getElementById("property-info")&&(this.updatePropertyInfo("#property-info-address .edit-content",this.summary_data.Address),this.updatePropertyInfo("#confirmation-property-info-address .summery",this.summary_data.Address),this.updatePropertyInfo("#property-info-year-built .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.BuiltYear),this.updatePropertyInfo("#confirmation-property-info-year-built .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.BuiltYear),this.updatePropertyInfo("#property-info-sqr-feet .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.SquareFeet),this.updatePropertyInfo("#confirmation-property-info-sqr-feet .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.SquareFeet),this.updatePropertyInfo("#property-info-baths .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfBathrooms),this.updatePropertyInfo("#confirmation-property-info-baths .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfBathrooms),this.updatePropertyInfo("#property-info-beds .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfBedrooms),this.updatePropertyInfo("#confirmation-property-info-beds .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfBedrooms),this.updatePropertyInfo("#property-info-kitchens .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfKitchens),this.updatePropertyInfo("#confirmation-property-info-kitchens .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.NumberOfKitchens),this.updatePropertyInfo("#property-info-pool .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.IsPoolAvailable?"Yes":"No"),this.updatePropertyInfo("#confirmation-property-info-pool .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.IsPoolAvailable?"Yes":"No"),this.updatePropertyInfo("#property-info-utility .edit-content",this.summary_data.HmsRoleInfo.HmsPropertyDetail.UtilitiesOn?"Yes":"No"),this.updatePropertyInfo("#confirmation-property-info-utility .summery",this.summary_data.HmsRoleInfo.HmsPropertyDetail.UtilitiesOn?"Yes":"No"))}populateSummaryBlock(){const e=document.getElementById("inspection-summary-total"),t=document.getElementById("confirmation-inspection-summary-total");if(e&&t){const o=e.querySelector(".summery-data"),n=t.querySelector(".summery-data");if(o&&n){o.innerHTML="",n.innerHTML="";const e=this.summary_data.HmsRoleInfo.HmsSelectedServiceDetail.HmsServiceBundles,t=this.summary_data.HmsRoleInfo.HmsSelectedServiceDetail.HmsAvailableServices;let i="";t.length>0&&t.forEach(e=>{i+=`<div class="summery-wrap">\n <p class="summery">${e.HmsServiceName}</p>\n <p class="summery-price">$${e.HmsPrice}</p>\n </div>`}),e.length>0&&e.forEach(e=>{i+=`<div class="summery-wrap">\n <p class="summery">${e.hmsBundleServiceName}</p>\n <p class="summery-price">$${e.hmsBundleServicePrice}</p>\n </div>`}),o.innerHTML=i,n.innerHTML=i}}}populateTotalPrice(){const e=document.querySelector("#inspection-summary-step .total-wrap .table-total"),t=document.querySelector(".scheduler-thankyou .total-wrap .table-total");if(e&&t){const o=`<p>Subtotal</p><strong>$${this.summary_data.HmsRoleInfo.HmsSelectedServiceDetail.HmsServiceSubTotal}</strong>`;e.innerHTML=o,t.innerHTML=o}}setTimeAndDate(e){return new Date(e).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}addAgencyForFirstBlock(e){const t=document.getElementById("inspection-info-agency"),o=document.getElementById("confirmation-inspection-info-agency");if(t&&o){this.showAndHideDiv("inspection-info-agency","flex",!1),this.showAndHideDiv("confirmation-inspection-info-agency","flex",!1);const n=t.querySelector(".edit-content"),i=o.querySelector(".edit-content");n&&i&&(n.innerHTML=e,i.innerHTML=e)}else{const t=`<div class="summery-wrap" id="inspection-info-agency">\n <p class="summery-label">Name of Agency</p>\n <p class="summery edit-content">${e}</p>\n </div>
3`,o=`<div class="summery-wrap" id="confirmation-inspection-info-agency">\n <p class="summery-label">Name of Agency</p>\n <p class="summery edit-content">${e}</p>\n </div>`,n=document.querySelector("#inspection-info .summery-data");n&&(n.innerHTML+=t);const i=document.querySelector("#confirmation-inspection-info .summery-data");i&&(i.innerHTML+=o)}}resetAngentAgency(){delete this.summary_data.HmsRoleInfo.HmsRoleDetail.AgentNameOfAgency,sessionStorage.setItem("hms_booking",JSON.stringify(this.summary_data)),this.showAndHideDiv("inspection-info-agency","flex",!0),this.showAndHideDiv("confirmation-inspection-info-agency","flex",!0)}secondBlockAgencyCheck(){const e=this.summary_data.HmsRoleInfo.HmsRoleDetail;null===e.AgentNameOfAgency||void 0===e.AgentNameOfAgency||""===e.AgentNameOfAgency?(this.showAndHideDiv("seller-agent-info-agency","flex",!0),this.showAndHideDiv("confirmation-seller-agent-info-agency","flex",!0)):(this.showAndHideDiv("seller-agent-info-agency","flex",!1),this.showAndHideDiv("confirmation-seller-agent-info-agency","flex",!1),this.updatePropertyInfo("#seller-agent-info-agency .summery",e.AgentNameOfAgency),this.updatePropertyInfo("#onfirmation-seller-agent-info-agency .summery",e.AgentNameOfAgency))}checkUserTypeAndPopulate(){var e,t,o,n,i,s,r,l,a,d;const c=document.getElementById("inspection-info"),u=document.getElementById("seller-agent-info"),m=document.getElementById("buyer-agent-info"),h=document.getElementById("confirmation-inspection-info"),p=document.getElementById("confirmation-seller-agent-info"),v=document.getElementById("confirmation-buyer-agent-info"),g=this.summary_data.HmsRoleInfo.HmsRoleDetail;if(c&&u&&m&&h&&p&&v)switch(this.summary_data.HmsRoleInfo.HmsRoleKey){case"CONTACT_SUBTYPE_BUYER_AGENT":{this.updatePropertyInfo("#confirmation-inspection-info .summery-heading","Buyerâs Agentâs Information"),this.updatePropertyInfo("#inspection-info .summery-heading","Buyerâs Agentâs Information");const o=g.BuyerNameOfAgency;o&&""!==o&&null!==o&&this.addAgencyForFirstBlock(o),this.updateFirstBlockOfUserInformation(),this.updatePropertyInfo("#confirmation-seller-agent-info .summery-heading","Buyerâs Information"),this.updatePropertyInfo("#seller-agent-info .summery-heading","Buyerâs Information"),this.secondBlockAgencyCheck(),this.updateClientInformation(),null===g.SellerAgentFirstName||null===g.SellerAgentPhone||null===g.SellerAgentEmail||void 0===g.SellerAgentFirstName||void 0===g.SellerAgentPhone||void 0===g.SellerAgentEmail?(m.classList.add("hidden"),v.classList.add("hidden")):(this.updatePropertyInfo("#buyer-agent-info .summery-heading","Sellerâs Agent's Information"),this.updatePropertyInfo("#buyer-agent-info-first-name .summery",g.SellerAgentFirstName),""!==g.SellerAgentLastName?this.updatePropertyInfo("#buyer-agent-info-last-name .summery",g.SellerAgentLastName):null===(e=document.getElementById("buyer-agent-info-last-name"))||void 0===e||e.classList.add("hidden"),this.updatePropertyInfo("#buyer-agent-info-email .summery",g.SellerAgentEmail),this.updatePropertyInfo("#buyer-agent-info-phone .summery",g.SellerAgentPhone),null===g.SellerNameOfAgency||void 0===g.SellerNameOfAgency||""===g.SellerNameOfAgency?(this.showAndHideDiv("buyer-agent-info-agency","flex",!0),this.showAndHideDiv("confirmation-buyer-agent-info-agency","flex",!0)):(this.updatePropertyInfo("#buyer-agent-info-agency .summery",g.SellerNameOfAgency),this.updatePropertyInfo("#confirmation-buyer-agent-info-agency .summery",g.SellerNameOfAgency)),this.updatePropertyInfo("#confirmation-buyer-agent-info .summery-heading","Sellerâs Agent's Information"),this.updatePropertyInfo("#confirmation-buyer-agent-info-first-name .summery",g.SellerAgentFirstName),""!==g.SellerAgentLastName?this.updatePropertyInfo("#confirmation-buyer-agent-info-last-name .summery",g.SellerAgentLastName):null===(t=document.getElementById("confirmation-buyer-agent-info-last-name"))||void 0===t||t.classList.add("hidden"),this.updatePropertyInfo("#confirmation-buyer-agent-info-email .summery",g.SellerAgentEmail),this.updatePropertyInfo("#confirmation-buyer-agent-info-phone .summery",g.SellerAgentPhone));break}case"CONTACT_SUBTYPE_SELLER_AGENT":{this.updatePropertyInfo("#inspection-info .summery-heading","Sellerâs Agentâs Information"),this.updatePropertyInfo("#confirmation-ins
3pection-info .summery-heading","Sellerâs Agentâs Information");const e=g.SellerNameOfAgency;e&&""!==e&&null!==e&&this.addAgencyForFirstBlock(e),this.updateFirstBlockOfUserInformation(),this.updatePropertyInfo("#seller-agent-info .summery-heading","Sellerâs Information"),this.updatePropertyInfo("#confirmation-seller-agent-info .summery-heading","Sellerâs Information"),this.secondBlockAgencyCheck(),this.updateClientInformation(),null===g.BuyerAgentFirstName||null===g.BuyerAgentPhone||null===g.BuyerAgentEmail||void 0===g.BuyerAgentFirstName||void 0===g.BuyerAgentPhone||void 0===g.BuyerAgentEmail?(m.classList.add("hidden"),v.classList.add("hidden")):(this.updatePropertyInfo("#buyer-agent-info .summery-heading","Buyerâs Agent's Information"),this.updatePropertyInfo("#buyer-agent-info-first-name .summery",g.BuyerAgentFirstName),""!==g.BuyerAgentLastName?this.updatePropertyInfo("#buyer-agent-info-last-name .summery",g.BuyerAgentLastName):null===(o=document.getElementById("buyer-agent-info-last-name"))||void 0===o||o.classList.add("hidden"),this.updatePropertyInfo("#buyer-agent-info-email .summery",g.BuyerAgentEmail),this.updatePropertyInfo("#buyer-agent-info-phone .summery",g.BuyerAgentPhone),this.updatePropertyInfo("#confirmation-buyer-agent-info .summery-heading","Buyerâs Agent's Information"),this.updatePropertyInfo("#confirmation-buyer-agent-info-first-name .summery",g.BuyerAgentFirstName),""!==g.BuyerAgentLastName?this.updatePropertyInfo("#confirmation-buyer-agent-info-last-name .summery",g.BuyerAgentLastName):null===(n=document.getElementById("confirmation-buyer-agent-info-last-name"))||void 0===n||n.classList.add("hidden"),this.updatePropertyInfo("#confirmation-buyer-agent-info-email .summery",g.BuyerAgentEmail),this.updatePropertyInfo("#confirmation-buyer-agent-info-phone .summery",g.BuyerAgentPhone),null===g.BuyerNameOfAgency||void 0===g.BuyerNameOfAgency||""===g.BuyerNameOfAgency?(this.showAndHideDiv("buyer-agent-info-agency","flex",!0),this.showAndHideDiv("confirmation-buyer-agent-info-agency","flex",!0)):(this.updatePropertyInfo("#buyer-agent-info-agency .summery",g.BuyerNameOfAgency),this.updatePropertyInfo("#confirmation-buyer-agent-info-agency .summery",g.BuyerNameOfAgency)));break}case"CONTACT_SUBTYPE_BUYER":this.updatePropertyInfo("#inspection-info .summery-heading","Buyerâs Information"),this.updatePropertyInfo("#confirmation-inspection-info .summery-heading","Buyerâs Information"),this.updateFirstBlockOfUserInformation(),this.showBuyerAndSellerAgentDetails(),this.resetAngentAgency();break;case"CONTACT_SUBTYPE_SELLER":this.updatePropertyInfo("#inspection-info .summery-heading","Sellerâs Information"),this.updatePropertyInfo("#confirmation-inspection-info .summery-heading","Sellerâs Information"),this.updateFirstBlockOfUserInformation(),this.showBuyerAndSellerAgentDetails(),this.resetAngentAgency();break;case"CONTACT_SUBTYPE_HOME_OWNER":this.updatePropertyInfo("#inspection-info .summery-heading","Home Ownerâs Information"),this.updatePropertyInfo("#confirmation-inspection-info .summery-heading","Home Ownerâs Information"),this.updateFirstBlockOfUserInformation(),this.showBuyerAndSellerAgentDetails(),this.resetAngentAgency();break;default:null===(i=document.getElementById("inspection-info"))||void 0===i||i.classList.add("hidden"),null===(s=document.getElementById("seller-agent-info"))||void 0===s||s.classList.add("hidden"),null===(r=document.getElementById("buyer-agent-info"))||void 0===r||r.classList.add("hidden"),null===(l=document.getElementById("confirmation-inspection-info"))||void 0===l||l.classList.add("hidden"),null===(a=document.getElementById("confirmation-seller-agent-info"))||void 0===a||a.classList.add("hidden"),null===(d=document.getElementById("confirmation-buyer-agent-info"))||void 0===d||d.classList.add("hidden")}}updateFirstBlockOfUserInformation(){var e,t;this.updatePropertyInfo("#inspection-info-first-name .summery",this.summary_data.FirstName),""!==this.summary_data.LastName?this.updatePropertyInfo("#inspection-info-last-name .summery",this.summary_data.LastName):null===(e=document.getElementById("inspection-info-last-name"))||void 0===e||e.classList.add("hidden"),this.updatePropertyInfo("#inspection-info-email .summery",this.summary_data.Email),this.updatePropertyInfo("#inspection-info-phone .summery",this.summary_data.Phone),this.updatePropertyInfo("#confirmation-ins
3pection-info-first-name .summery",this.summary_data.FirstName),""!==this.summary_data.LastName?this.updatePropertyInfo("#confirmation-inspection-info-last-name .summery",this.summary_data.LastName):null===(t=document.getElementById("confirmation-inspection-info-last-name"))||void 0===t||t.classList.add("hidden"),this.updatePropertyInfo("#confirmation-inspection-info-email .summery",this.summary_data.Email),this.updatePropertyInfo("#confirmation-inspection-info-phone .summery",this.summary_data.Phone)}updateClientInformation(){var e,t;const o=this.summary_data.HmsRoleInfo.HmsRoleDetail,n=document.getElementById("seller-agent-info");null===o.ClientFirstName||null===o.ClientPhone||null===o.ClientEmail?null==n||n.classList.add("hidden"):(this.updatePropertyInfo("#seller-agent-info-first-name .summery",o.ClientFirstName),""!==o.ClientLastName?this.updatePropertyInfo("#seller-agent-info-last-name .summery",o.ClientLastName):null===(e=document.getElementById("seller-agent-info-last-name"))||void 0===e||e.classList.add("hidden"),this.updatePropertyInfo("#seller-agent-info-email .summery",o.ClientEmail),this.updatePropertyInfo("#seller-agent-info-phone .summery",o.ClientPhone));const i=document.getElementById("confirmation-seller-agent-info");null===o.ClientFirstName||null===o.ClientPhone||null===o.ClientEmail?null==i||i.classList.add("hidden"):(this.updatePropertyInfo("#confirmation-seller-agent-info-first-name .summery",o.ClientFirstName),""!==o.ClientLastName?this.updatePropertyInfo("#confirmation-seller-agent-info-last-name .summery",o.ClientLastName):null===(t=document.getElementById("confirmation-seller-agent-info-last-name"))||void 0===t||t.classList.add("hidden"),this.updatePropertyInfo("#confirmation-seller-agent-info-email .summery",o.ClientEmail),this.updatePropertyInfo("#confirmation-seller-agent-info-phone .summery",o.ClientPhone))}showAndHideDiv(e,t,o){const n=document.getElementById(e);if(n)if(o)n.style.display="none";else switch(t){case"flex":n.style.display="flex";break;case"block":default:n.style.display="block";break;case"grid":n.style.display="grid"}}showBuyerAndSellerAgentDetails(){const e=document.getElementById("seller-agent-info"),t=document.getElementById("buyer-agent-info"),o=document.getElementById("confirmation-seller-agent-info"),n=document.getElementById("confirmation-buyer-agent-info"),i=this.summary_data.HmsRoleInfo.HmsRoleDetail;null===i.BuyerAgentFirstName||void 0===i.BuyerAgentFirstName?(null==t||t.classList.add("hidden"),null==n||n.classList.add("hidden")):(this.updatePropertyInfo("#buyer-agent-info .summery-heading","Buyerâs Agent's Information"),this.updatePropertyInfo("#buyer-agent-info-first-name .summery",i.BuyerAgentFirstName),""!==i.BuyerAgentLastName?(this.showAndHideDiv("buyer-agent-info-last-name","flex",!1),this.updatePropertyInfo("#buyer-agent-info-last-name .summery",i.BuyerAgentLastName)):this.showAndHideDiv("buyer-agent-info-last-name","flex",!0),""===i.BuyerNameOfAgency||null===i.BuyerNameOfAgency||void 0===i.BuyerNameOfAgency?this.showAndHideDiv("buyer-agent-info-agency","flex",!0):(this.updatePropertyInfo("#buyer-agent-info-agency .summery",i.BuyerNameOfAgency),this.showAndHideDiv("buyer-agent-info-agency","flex",!1)),this.updatePropertyInfo("#buyer-agent-info-email .summery",i.BuyerAgentEmail),this.updatePropertyInfo("#buyer-agent-info-phone .summery",i.BuyerAgentPhone),this.updatePropertyInfo("#confirmation-buyer-agent-info .summery-heading","Buyerâs Agent's Information"),this.updatePropertyInfo("#confirmation-buyer-agent-info-first-name .summery",i.BuyerAgentFirstName),""!==i.BuyerAgentLastName?(this.updatePropertyInfo("#confirmation-buyer-agent-info-last-name .summery",i.BuyerAgentLastName),this.showAndHideDiv("confirmation-buyer-agent-info-last-name","flex",!1)):this.showAndHideDiv("confirmation-buyer-agent-info-last-name","flex",!0),""===i.BuyerNameOfAgency||null===i.BuyerNameOfAgency?this.showAndHideDiv("confirmation-buyer-agent-info-agency","flex",!0):(this.updatePropertyInfo("#confirmation-buyer-agent-info-agency .summery",i.BuyerNameOfAgency),this.showAndHideDiv("confirmation-buyer-agent-info-agency","flex",!1)),this.updatePropertyInfo("#confirmation-buyer-agent-info-email .summery",i.BuyerAgentEmail),this.updatePropertyInfo("#confirmation-buyer-agent-info-phone .summery",i.BuyerAgentPhone)),null===i.SellerAgentFirstName||void 0===i.SellerAgentFirstName?(null==e||e.classList.add("hidden"),null==o||o.classList.add("hidden")):(this.updatePropertyInfo("#seller-agent-info .summery-heading","Sellerâs Agent's Information"),this.updatePropertyInfo("#seller-agent-info-first-name .summery",i.SellerAgentFirstName),""!==i.SellerAgentLastName?(this.showAndHideDiv("seller-agent-info-last-name","flex",!1),this.updatePropertyInfo("#seller-agent-info-last-name .summery",i.SellerAgentLastName)):this.showAndHideDiv("seller-agent-info-last-name","flex",!0),""===i.SellerNameOfAgency||null===i.SellerNameOfAgency?this.showAndHideDiv("seller-agent-info-agency","flex",!0):(this.updatePropertyInfo("#seller-agent-info-agency .summery",i.SellerNameOfAgency),this.showAndHideDiv("seller-agent-info-agency","flex",!1)),this.updatePropertyInfo("#seller-agent-info-email .summery",i.SellerAgentEmail),this.updatePropertyInfo("#seller-agent-info-phone .summery",i.SellerAgentPhone),this.updatePropertyInfo("#confirmation-seller-agent-info .summery-heading","Sellerâs Agent's Information"),this.updatePropertyInfo("#confirmation-seller-agent-info-first-name .summery",i.SellerAgentFirstName),""!==i.SellerAgentLastName?(this.updatePropertyInfo("#confirmation-seller-agent-info-last-name .summery",i.SellerAgentLastName),this.showAndHideDiv("confirmation-seller-agent-info-last-name","flex",!1)):this.showAndHideDiv("confirmation-seller-agent-info-last-name","flex",!1),""===i.SellerNameOfAgency||null===i.SellerNameOfAgency?this.showAndHideDiv("confirmation-seller-agent-info-agency","flex",!0):(this.showAndHideDiv("confirmation-seller-agent-info-agency","flex",!1),this.updatePropertyInfo("#confirmation-seller-agent-info-agency .summery",i.SellerNameOfAgency)),this.updatePropertyInfo("#confirmation-seller-agent-info-email .summery",i.SellerAgentEmail),this.updatePropertyInfo("#confirmation-seller-agent-info-phone .summery",i.SellerAgentPhone))}updatePropertyInfo(e,t){const o=document.querySelector(e);o&&(o.innerHTML=t)}manageCancel(e){e.preventDefault();document.querySelector("#inspection-summary-step .btn-container .btn-submit").removeEventListener("click",this.manageSubmit);document.querySelector("#inspection-summary-step .btn-container .btn-cancel").removeEventListener("click",this.manageCancel),sessionStorage.removeItem("hms_booking"),this.clearFormV
3alues(),(0,a.hmsProgressBarUpdate)("0%",0);const t=document.getElementById("zip-modal"),o=document.getElementById("form-section");t&&o&&(t.style.display="flex",o.style.display="none");const n=document.querySelectorAll(".section-main>.contact-us-section");n&&n.forEach(e=>{e.classList.remove("form-step-active")}),window.scrollTo(0,0)}manageSubmit(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,d,c,u,m,h,p,v,g,f,y,b;e.preventDefault();let I=JSON.parse(JSON.stringify(this.summary_data));const S=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value,w=yield(0,a.getBrandDetailsFromBrandJson)(S),L=null!==(o=null==w?void 0:w.enable_emailOptOut)&&void 0!==o&&o,E=(null==w?void 0:w.default_leadSourceID)||0,C=window.location.hostname.toLowerCase();let A;A=!!(C.includes("nblysbx")||C.includes("nblydev")||C.includes("nblytest")||C.includes("localhost"));const _=C.split("?")[1];let k,N;const T=(0,r.getSessionAndCorrelationID)();k=T.sessionID,N=T.correlationID;const B={c4ChannelTypeId:0,conceptCalledId:Number(S),isTest:A,webLocationId:null==I?void 0:I.franchiseWebLocationId,c4CallCenterId:0,note:`Particular Inspector: ${null===(n=null==I?void 0:I.calendarPaylod)||void 0===n?void 0:n.bookInspector}, Pool:${null===(c=null===(d=null==I?void 0:I.HmsRoleInfo)||void 0===d?void 0:d.HmsPropertyDetail)||void 0===c?void 0:c.IsPoolAvailable}, Utilities:${null===(m=null===(u=null==I?void 0:I.HmsRoleInfo)||void 0===u?void 0:u.HmsPropertyDetail)||void 0===m?void 0:m.UtilitiesOn}`,firstName:null==I?void 0:I.FirstName,lastName:null==I?void 0:I.LastName,email:null==I?void 0:I.Email,phone:null==I?void 0:I.Phone,postalCode:null==I?void 0:I.zipcode.trim(),city:null==I?void 0:I.City,state:null==I?void 0:I.State,country:null==I?void 0:I.Country,address:null==I?void 0:I.Address,address2:null!==(h=null==I?void 0:I.Address2)&&void 0!==h?h:null,leadSource:"BrandWebsite",leadOrigin:"BrandWebsite",campaignName:null!=_?_:"N/A",referringURL:"",callType:"In Bound",preferredCommunicationType:"Email, Phone",emailOptOut:L,leadSourceId:E,serviceSkuId:0,isLeadOnly:!1,scheduleID:null===(p=null==I?void 0:I.calendarPaylod)||void 0===p?void 0:p.ScheduleID,timeBlock:{}
3,customerId:null,isFsmUpdatedCustomer:null,referralTypeId:null==I?void 0:I.ReferralTypeId,referralType:null==I?void 0:I.ReferralType,customerType:"Residential",neighborlyAccountId:null,vendorRouting:0,agencyName:"",hmsAppointmentType:2,hmsParticularInspector:null===(v=null==I?void 0:I.calendarPaylod)||void 0===v?void 0:v.bookInspector,hmsRoleInfo:null==I?void 0:I.HmsRoleInfo,correlationId:"",vendorId:0};N&&(B.correlationId=N);let P="";P=N&&k?`${s.apiConfig.HMS_BOOKING}&correlationId=${N}&sessionId=${k}`:s.apiConfig.HMS_BOOKING;const j={method:"POST",url:P,data:B};if("isfakesubmit"===(null===(f=null===(g=null==j?void 0:j.data)||void 0===g?void 0:g.firstName)||void 0===f?void 0:f.toLowerCase())||"isfakesubmit"===(null===(b=null===(y=null==j?void 0:j.data)||void 0===y?void 0:y.lastName)||void 0===b?void 0:b.toLowerCase()))return(0,a.handleFakeSubmit)(j),void this.confirmationScreenDisplay();const D=sessionStorage.getItem("hms_s6");D&&JSON.parse(D)&&((0,l.startLoader)(),sessionStorage.setItem("rl-post-data",JSON.stringify(B)),sessionStorage.removeItem("hms_s6"),(0,i.default)(j).then(()=>{(0,l.stopLoader)(),sessionStorage.removeItem("hms_booking"),sessionStorage.removeItem("hms_booking_selection"),this.confirmationScreenDisplay()}).catch(e=>{(0,l.stopLoader)(),console.error("Error while scheduling booking :",e),this.errorModalTrigger()}))})}loadDummyData(){this.summary_data={calendarPaylod:{bookInspector:"Ajay Varma",userSelectDate:"2024-05-08T12:00:00",userSelectTime:"Afternoon"},doingBusinessAs:"HouseMaster Serving Shiloh/Metro East Illinois",franchiseId:48476,C4ChannelTypeId:0,ConceptCalledId:25,IsTest:!1,WebLocationId:27438,C4CallCenterId:null,Note:"Particular Inspector: Ajay, Pool:false, Utilities:true",FirstName:"Ajay",LastName:"V",Email:"[email protected]",Phone:"(884) 848-4848",PostalCode:"35124",City:"Birmingham",State:"AL",Country:"US",Address:"1st Street 2nd cross Birmingham",Address2:null,LeadSource:"BrandWebsite",LeadOrigin:"BrandWebsite",CampaignName:"Web",ReferringURL:null,CallType:"In Bound",PreferredCommunicationType:"Text, Email, Phone",EmailOptOut:!1,LeadSourceId:1,ServiceSkuId:0,IsLeadOnly:!1,ScheduleID:"eyJDb25jZXB0SWQiOjI1LCJKb2JQcm9taXNlZERhdGUiOiIyMDI0LTA0LTE5VDA3OjAwOjAwIiwiSXNBdmFpbGFibGUiOnRydWUsIklzRnJhbmNoaXNlSW5QT1MiOnRydWUsIkRpc3BsYXlUZXh0IjoiTW9ybmluZyIsIlRlY2huaWNpYW5FeHRlcm5hbElkIjpudWxsLCJPcGFsU2NoZWR1bGVJZCI6bnVsbCwiRnNtU2xvdENvZGUiOiIwOTNkOTNmYi01NjcwLTQxNDgtYjVmNi02Y2JkYzcwN2QzZDAiLCJGcmFuY2hpc2VJZCI6NDg0NzYsIkpvYlByb21pc2VkRW5kRGF0ZSI6bnVsbCwiU3RhcnRNaW51dGVzIjpudWxsLCJFbmRNaW51dGVzIjpudWxsLCJGcmFuY2hpc2VXZWJMb2NhdGlvbkNhbGVuZGFySWQiOm51bGwsIlRlY2huaWNpYW5OYW1lIjpudWxsfQ==",TimeBlock:null,CustomerId:null,IsFsmUpdatedCu
3stomer:null,ReferralTypeId:"33829658-6598-47af-ba82-8941214de3b9",ReferralType:"Neighborly.com",ReferralSourceId:null,ReferralSource:null,CustomerType:"Residential",NeighborlyAccountId:null,NeighborlyLeadSourceId:4,VendorRouting:0,AgencyName:null,hmsAppointmentType:2,HmsParticularInspector:"Ajay",HmsRoleInfo:{HmsRoleType:"REP",HmsRoleKey:"CONTACT_SUBTYPE_BUYER_AGENT",HmsRoleDetail:{willOwnerOrAdultAttend:!1,PresentForInspection:["Buyer"],BuyerAgentFirstName:"Roshan",BuyerAgentLastName:"Jose",BuyerAgentPhone:"(012) 343-5345",BuyerAgentEmail:"[email protected]",BuyerNameOfAgency:null,BuyerAgentReceiveTextMessages:!1,SellerAgentFirstName:"ajay",SellerAgentLastName:"Kumar",SellerAgentPhone:"(012) 343-5345",SellerAgentEmail:"[email protected]",SellerAgentReceiveTextMessages:!1,SellerNameOfAgency:null,BuyerOrSellerAgent:"buyer",ClientFirstName:"Roshan",ClientLastName:"Jose",ClientPhone:"(012) 343-5345",ClientEmail:"[email protected]",ClientReceiveTextMessages:!1},HmsPropertyDetail:{BuiltYear:2009,SquareFeet:1e3,TypeOfFoundation:"Basement",NumberOfBedrooms:4,NumberOfBathrooms:1,NumberOfKitchens:4,IsPoolAvailable:!1,UtilitiesOn:!0,HearAboutHouseMaster:"Neighborly.com",explainOther:"",isPropertyOccupied:!0},HmsSelectedServiceDetail:{HmsServiceBundles:[],HmsAvailableServices:[{HmsServiceId:"2258d319-f827-47cc-aa85-4416517d1a18",HmsServiceName:"Construction/Damage Evaluation",HmsServiceDescription:"Construction/Damage Evaluation",HmsServiceProductNumber:"10083",HmsServiceCreatedBy:"Eventbridge user",HmsPrice:100,HmsItemTax:0,isTaxable:!1},{HmsServiceId:"ee24ea10-8c12-4835-a730-a5c2d3646070",HmsServiceName:"Plumbing Inspection",HmsServiceDescription:"Plumbing Inspection",HmsServiceProductNumber:"10008",HmsServiceCreatedBy:"Eventbridge user",HmsPrice:275,HmsItemTax:0,isTaxable:!1},{HmsServiceId:"6cc258a1-9983-4583-a82d-ded4d53accbe",HmsServiceName:"Ancillary Systems (vacuum, intercom, etc)",HmsServiceDescription:"Ancillary Systems (vacuum, intercom, etc)",HmsServiceProductNumber:"10070",HmsServiceCreatedBy:"Eventbridge user",HmsPrice:100,HmsItemTax:0,isTaxable:!1},{HmsServiceId:"18cc29a5-c977-4617-a54c-b05262fb2371",HmsServiceName:"Foundation Inspection",HmsServiceDescription:"Foundation Inspection",HmsServiceProductNumber:"10002",HmsServiceCreatedBy:"Eventbridge user",HmsPrice:275,HmsItemTax:3,isTaxable:!0}],HmsServiceSubTotal:"750.00",HmsServiceTotal:0},HmsTaxDetail:{RegionalTaxes:[{taxAmount:0}]}}}}errorModalTrigger(){const e=document.getElementById("error-modal-HMS-trigger");null==e||e.click();const t=document.getElementById("modal-hms-system-error");t&&(t.style.display="block");const o=document.querySelector("#error-modal-HMS .error-btn-close");o&&o.addEventListener("click",()=>{(0,a.returnToHomePage)()})}confirmationScreenDisplay(){document.querySelector("#inspection-summary-step .btn-container .btn-submit").removeEventListener("click",this.manageSubmit),window.scrollTo(0,0);const e=document.querySelector(".lead-flow-thank-you"),t=document.querySelector(".scheduler-main");e&&(e.style.display="block"),t&&t.classList.add("hidden")}clearFormValues(){const e=document.getElementById("form-section");if(e){e.querySelectorAll("input, textarea, select").forEach(e=>{if(e instanceof HTMLInputElement)switch(e.type){case"text":case"password":case"email":case"number":case"search":case"url":case"tel":e.value="";break;case"checkbox":case"radio":e.checked=!1}else e instanceof HTMLTextAreaElement?e.value="":e instanceof HTMLSelectElement&&(e.selectedIndex=-1)})}}}},"./src/js/opus2/index.ts"(e,t,o){"use strict";o(/*! ./common */"./src/js/opus2/common/index.ts"),o(/*! ./testimonial */"./src/js/opus2/testimonial/index.ts"),o(/*! ./hms */"./src/js/opus2/hms/index.ts"),o(/*! ./mly */"./src/js/opus2/mly/index.ts"),o(/*! ./helperModules/localizedToken */"./src/js/opus2/helperModules/localizedToken.ts"),o(/*! ./offers/offers-popup */"./src/js/opus2/offers/offers-popup.ts"),o(/*! ./find-us */"./src/js/opus2/find-us/index.ts")},"./src/js/opus2/lead-flow/filterArray.ts"(e,t,o){"use strict";function n(e){const t=(null==e?void 0:e.menu)?null==e?void 0:e.menu:[];let o=[];
3return null==t||t.forEach(e=>{var t;!e.service&&"Service Sku"==e.serviceType&&e.visibility?(e.serviceSkuId=!0,o.push(e)):null===(t=null==e?void 0:e.service)||void 0===t||t.forEach(e=>{e.visibility&&(e.serviceSkuId=!0,o.push(e))})}),o}o.d(t,{extractServices:()=>n})},"./src/js/opus2/lead-flow/index.ts"(e,t,o){"use strict";o.d(t,{FormHandlerLead:()=>n.FormHandlerLead});var n=o(/*! ./step1 */"./src/js/opus2/lead-flow/step1.ts");o(/*! ./step4 */"./src/js/opus2/lead-flow/step4.ts")},"./src/js/opus2/lead-flow/scheduler.ts"(e,t,o){"use strict";o.d(t,{DateSlider:()=>s});var n,i=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js");class s{constructor(){var e,t,o,n;this.nextDate=document.getElementById("show-next-dates"),this.prevDate=document.getElementById("show-prev-dates"),this.dateBlock=document.querySelector(".date-details-list"),this.dateBlockWidth=null===(e=this.dateBlock)||void 0===e?void 0:e.scrollWidth;const i=document.querySelectorAll(".cancel-verification"),s=document.querySelectorAll(".btn-next");null===(t=this.nextDate)||void 0===t||t.addEventListener("click",this.slideRight.bind(this)),null===(o=this.prevDate)||void 0===o||o.addEventListener("click",this.slideLeft.bind(this)),this.dateBlockWidth<1232&&(null===(n=this.prevDate)||void 0===n||n.classList.add("disabled"),this.dateBlock.onscroll=this.handleScroll.bind(this)),this.setTinySlider(),this.focusTabElement(),this.scrollTop(i),this.scrollTop(s)}scrollTop(e){e.forEach(e=>{e.addEventListener("click",()=>{document.body.scrollTop=0,document.documentElement.scrollTop=0})})}setTinySlider(){try{(0,i.tns)({container:".date-slider",loop:!1,items:7,slideBy:"page",nav:!1,autoplay:!1,speed:400,swipeAngle:!1,autoplayButtonOutput:!1,mouseDrag:!0,lazyload:!0,controlsContainer:"#customize-controls",responsive:{350:{items:5},640:{items:5},768:{items:5},1024:{items:7}}})}catch(e){}}slideLeft(){this.dateBlock.scrollBy(-100,0)}slideRight(){this.dateBlock.scrollBy(100,0)}handleScroll(){const e=this.dateBlock.scrollLeft,t=this.dateBlock.scrollWidth,o=this.dateBlock.offsetWidth;0===e&&(this.prevDate.classList.add("disabled"),this.nextDate.classList.remove("disabled")),e>10&&(this.nextDate.classList.remove("disabled"),this.prevDate.classList.remove("disabled")),t-e===o&&(this.nextDate.classList.add("disabled"),this.prevDate.classList.remove("disabled"))}focusTabElement(){const e='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',t=document.querySelector(".custom-select");if(!t)return;const o=t.querySelectorAll(e)[0],n=t.querySelectorAll(e),i=n[n.length-1];document.addEventListener("keydown",function(e){"Tab"===e.key&&(e.shiftKey&&document.activeElement===o?(i.focus(),e.preventDefault()):document.activeElement===i&&(o.focus(),e.preventDefault()))}),o.focus()}}if("25"!==(null===(n=document.getElementById("conceptId"))||void 0===n?void 0:n.value)){document.addEventListener("DOMContentLoaded",()=>{window.scrollTo(0,0)});new s}},"./src/js/opus2/lead-flow/step1.ts"(e,t,o){"use strict";o.d(t,{FormHandlerLead:()=>q,getChangeZip:()=>D,getFullData:()=>B,getIsLeadData:()=>P,setChangeZip:()=>M});var n,i=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),a=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),d=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),c=o(/*! ./step2 */"./src/js/opus2/lead-flow/step2.ts"),u=o(/*! ./step3 */"./src/js/opus2/lead-flow/step3.ts"),m=o(/*! ../../opus2/footer/footer */"./src/js/opus2/footer/footer.ts"),h=o(/*! ./scheduler */"./src/js/opus2/lead-flow/scheduler.ts"),p=o(/*! ../util/gtm-custom-event-lead-flow */"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"),v=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),g=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),f=o(/*! ../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),y=o(/*! ../util/domainService */"./src/js/opus2/util/domainService.ts"),b=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),I=o(/*! ../apiCaching/POST-Requests/apiContactCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"),S=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts"),w=o(/*! ../apiCaching/POST-Requests/apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"),L=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),E=o(/*! ../util/hideTermsPolicy */"./src/js/opus2/util/hideTermsPolicy.ts"),C=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts");let A=[],_=null,k=!1,N=!1,T=!1;function B(){return _}function P(){return k}function j(e){k=e}function D(){return N}function M(e){N=e}sessionStorage.removeItem("currentZip");class q{static getInstance(){return q.instance||(q.instance=new q),q.instance}constructor(){var e,t,o,n,s,r,l,a,d;if(this.HMSLeadFlow=!1,this.setAutoSuggested=e=>(0,i.__awaiter)(this,void 0,void 0,function*(){e.preventDefault(),sessionStorage.setItem("suggestion","false"),this.serviceAddressInput.removeAttribute("suggestion"),sessionStorage.setItem("manualCity",""),sessionStorage.setItem("manualState","")}),this.setZipCode=()=>{var e;let t=!0;T=!1;const o=document.querySelectorAll(".input-label-wrap #zip-code")[0];o&&"zip-code"==o.id&&(t=!1);const n=this.serviceAddressInput.value,i=A.filter(e=>e.title==n)[0],s=String(null===(e=null==i?void 0:i.address)||void 0===e?void 0:e.postalCode).split("-")[0];s&&t&&(this.zipCodeInput.value=s),setTimeout(()=>{this.addreddErrorRemove.bind(this)},300)},this.handleHMSLeadflow(),this.onlineScheduling=!1,this.form=document.querySelectorAll(".contact-us-section .btn-next"),this.showButton=!1,this.nameInput=document.getElementById("user-full-name"),this.phoneNumberInput=document.getElementById("user-phone-number"),this.emailInput=document.getElementById("user-email"),this.serviceAddressInput=document.getElementById("user-service-address"),this.serviceAddress2Input=document.getElementById("user-address-2"),this.zipCodeInput=document.getElementById("zip-code"),this.lastNameInput=document.getElementById("user-last-name"),this.leadFlowService=document.querySelectorAll('[id*="lead-flow-service-reminder"]'),this.counter=0,sessionStorage.setItem("manualCity",""),sessionStorage.setItem("manualState",""),document.querySelector(".confirmation-section")||(sessionStorage.removeItem("booking"),sessionStorage.removeItem("os_note")),this.handleFocusOut=this.handleFocusOut.bind(this),null===(e=this.nameInput)||void 0===e||e.addEventListener("input",this.errorOnName.bind(this)),null===(t=this.emailInput)||void 0===t||t.addEventListener("input",this.emailError.bind(this)),null===(o=this.serviceAddressInput)||void 0===o||o.addEventListener("input",(0,v.debounce)(this.addreddErrorRemove2.bind(this),500)),null===(n=this.zipCodeInput)||void 0===n||n.addEventListener("input",this.zipCodeError.bind(this)),null===(s=this.zipCodeInput)||void 0===s||s.addEventListener("focusout",this.handleFocusOut.bind(this)),null===(r=this.lastNameInput)||void 0===r||r.addEventListener("input",this.errorOnLastName.bind(this)),null===(l=this.serviceAddress2Input)||void 0===l||l.addEventListener("keyup",this.address2Error.bind(this)),null===(a=this.leadFlowService)||void 0===a||a.forEach(e
3=>{e.addEventListener("change",this.handleCheckboxChange.bind(this))}),this.form&&this.form[0]){this.form[0].addEventListener("click",this.handleSubmit.bind(this));const e=document.querySelectorAll(".contact-us-section .cancel-verification");e.length>0&&(null===(d=e[0])||void 0===d||d.addEventListener("click",()=>{sessionStorage.setItem("suggestion","false"),this.handleCancelBtnClick()}))}this.phoneNumberInput&&this.phoneNumberInput.addEventListener("input",this.handleMobileInput.bind(this)),localStorage.getItem("doingBusinessAs")&&this.setHeaderCheck();const c=sessionStorage.getItem("sAddressParam");c&&this.zipCodeInput&&(this.zipCodeInput.value=c);const u=(0,y.DomainIdentifier)(),m=(0,L.getCountryCode)(),h=sessionStorage.getItem("countryCode");"ca"!=u&&"ca"!==m&&"ca"!==h||this.form&&(0,E.hideTermsPolicy)(".scheduler-main .contact-us-section","terms-policy-text"),(0,C.localizationMobileDBATitle)()}handleCheckboxChange(){const e=document.querySelectorAll(".service-reminder-main");if(0===e.length)return void console.log("Servcie Disclaimer not authored in CP");let t=null;return e.forEach(e=>{if(e&&!e.classList.contains("hidden")){const o=e.querySelector('input[type="checkbox"]'),n=e.querySelector(".error-msg");o&&n&&o instanceof HTMLInputElement&&o.required&&(o.addEventListener("change",()=>{o.checked?n.classList.add("hidden"):(n.classList.remove("hidden"),t=null==n?void 0:n.id)}),o.required&&!o.checked&&(n.classList.remove("hidden"),t=null==n?void 0:n.id))}}),t}handleCancelBtnClick(){return(0,i.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=yield(0,v.getBrandDetailsFromBrandJson)(t);let n=localStorage.getItem("dbaName")?localStorage.getItem("dbaName"):"",i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail;if(!i&&(null==o?void 0:o.include_statename)&&(yield(0,v.fetchCrownpeakUrlDetails)(),i=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail),n=(null==o?void 0:o.weblocation_path_group)&&(null==i?void 0:i.stateName)?`/${o.weblocation_path_group}/${null==i?void 0:i.stateName}/${n}`:(null==o?void 0:o.weblocation_path_group)?`/${o.weblocation_path_group}/${n}`:`/${n}`,document.referrer&&document.referrer.includes(null==o?void 0:o.url))window.history.back();else{if(n)return void(window.location.href=window.location.origin+n);window.location.href=window.location.origin}})}setHeaderCheck(){const e=document.querySelector(".header-wrapper .address"),t=document.querySelector(".header-wrapper .description");e&&t&&(e.innerHTML=localStorage.getItem("doingBusinessAs"),(0,C.localizationTagLine)())}errorOnName(){if(""===this.nameInput.value||a.REGEX.sendName.test(this.nameInput.value))this.showButton=!0,this.hideError("user-full-name");else{const e=document.getElementById("user-full-name-error-msg");e.classList.remove("hidden"),e.innerHTML="Invalid name format.",this.showButton=!1}}errorOnLastName(){var e,t;if(""===(null===(e=this.lastNameInput)||void 0===e?void 0:e.value)||a.REGEX.sendName.test(null===(t=this.lastNameInput)||void 0===t?void 0:t.value))this.showButton=!0,this.hideError("user-last-name");else{const e=document.getElementById("user-last-name-error-msg");e.classList.remove("hidden"),e.innerHTML="Invalid last name format.",this.showButton=!1}}
3emailError(){""==this.emailInput.value||a.REGEX.sendEmail.test(this.emailInput.value)?(this.showButton=!0,this.hideError("user-email")):this.showButton=!1}zipCodeError(){if(""==this.zipCodeInput.value.trim()||a.REGEX.sendZip.test(this.zipCodeInput.value.trim()))this.showButton=!0,this.hideError("zip-code"),this.zipCodeInput.value.trim()!=sessionStorage.getItem("currentZip")?M(!0):M(!1);else{document.getElementById("zip-code-error-msg").innerHTML="Invalid zip code format.",this.showButton=!1}}handleFocusOut(){var e;const t=null===(e=this.zipCodeInput)||void 0===e?void 0:e.value.trim();(0,f.DisclaimerServiceIdentifier)(t),(0,E.toggleTermsPolicyBasedOnCountry)(".scheduler-main .contact-us-section",t)}addreddErrorRemove2(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i;try{this.setAutoSuggested(e),yield(0,g.discoverSuggestions)(this.zipCodeInput,this.serviceAddressInput);const s=null===(t=this.serviceAddressInput)||void 0===t?void 0:t.getAttribute("data-suggestion"),r=null!==(o=s&&"undefined"!==s&&JSON.parse(s))&&void 0!==o?o:{};if(this.serviceAddressInput.value===(null===(n=null==r?void 0:r.address)||void 0===n?void 0:n.label)?T=!1:(null===(i=null==r?void 0:r.address)||void 0===i?void 0:i.label)&&(T=!0),""==this.serviceAddressInput.value||a.REGEX.sendAddress1.test(this.serviceAddressInput.value))this.showButton=!0,this.hideError("user-service-address"),this.hideError("zip-code");else{const e=document.getElementById("user-service-address-error-msg");e.classList.remove("hidden"),e.innerHTML="Invalid address format.",this.showButton=!1}}catch(e){console.error("Error during discoverSuggestions:",e)}})}addreddErrorRemove(){var e,t;if(this.serviceAddressInput.value==(null===(t=null===(e=(0,g.getSuggestedAddress)())||void 0===e?void 0:e.address)||void 0===t?void 0:t.label)&&(T=!1),""==this.serviceAddressInput.value||a.REGEX.sendAddress1.test(this.serviceAddressInput.value))this.showButton=!0,this.hideError("user-service-address"),this.hideError("zip-code");else{const e=document.getElementById("user-service-address-error-msg");e.classList.remove("hidden"),e.innerHTML="Invalid address format.",this.showButton=!1}}hideError(e){const t=document.getElementById(e);document.getElementById(`${e}-error-msg`).classList.add("hidden"),t.classList.remove("invalid-field")}handleMobileInput(e){var t,o,n;e.preventDefault();const i=a.REGEX.mobileNumberRegex,s=null===(t=this.phoneNumberInput)||void 0===t?void 0:t.value,r=null==s?void 0:s.replace(/\D/g,"").match(i),l=null!==(o=this.phoneNumberInput.selectionStart)&&void 0!==o?o:0,d=s;""!=this.phoneNumberInput.value&&(null===(n=this.phoneNumberInput)||void 0===n?void 0:n.value.length)<14?this.showButton=!1:(this.showButton=!0,this.hideError.call(this,"user-phone-number")),r&&(this.phoneNumberInput.value=r[2]?`(${r[1]}) ${r[2]}
3${r[3]?"-"+r[3]:""}`:r[1],(0,v.calculateCaretPosition)(this.phoneNumberInput,l,d))}address2Error(){var e,t,o;if(""==(null===(e=this.serviceAddress2Input)||void 0===e?void 0:e.value)||a.REGEX.sendAddress2.test(null===(t=this.serviceAddress2Input)||void 0===t?void 0:t.value))this.hideError("user-address-2");else{const e=document.getElementById("user-address-2-error-msg");e&&(null===(o=e.classList)||void 0===o||o.remove("hidden"),e.innerHTML="Invalid address2 format.")}}handleSubmit(e){var t,o,n;if(e.preventDefault(),this.validateForm()){const e=document.getElementById("zip-code");sessionStorage.setItem("sAddressParam",e.value),sessionStorage.setItem("currentZip",e.value),this.zipCodeInput.value=e.value;const i=sessionStorage.getItem("suggestion"),s=null===(t=this.serviceAddressInput)||void 0===t?void 0:t.getAttribute("data-suggestion"),r=null!==(o=s&&"undefined"!==s&&JSON.parse(s))&&void 0!==o?o:{};if("false"===i&&(null===(n=null==r?void 0:r.address)||void 0===n?void 0:n.label)&&T)this.openValidationModal();else{(0,d.startLoader)();const e=document.getElementById("zip-code").value;this.franchiseLookupAddressApi(e)}}}openValidationModal(){var e,t,o;const n=document.getElementById("address-modal"),i=null===(e=this.serviceAddressInput)||void 0===e?void 0:e.getAttribute("data-suggestion"),s=null!==(t=i&&"undefined"!==i&&JSON.parse(i))&&void 0!==t?t:{},r=null===(o=null==s?void 0:s.address)||void 0===o?void 0:o.label;null==n||n.click();const l=document.querySelector("[for=entered-address-radio]");l&&(l.innerHTML=this.serviceAddressInput.value);const a=document.querySelector("[for=suggested-address-radio]");a&&(a.innerHTML=r);const d=document.querySelector(".property-address-modal a.btn");null==d||d.addEventListener("click",()=>{var e;T=!1;const t=document.getElementById("suggested-address-radio"),o=document.getElementById("entered-address-radio");if((null==o?void 0:o.checked)&&(sessionStorage.setItem("suggestion","false"),sessionStorage.setItem("manualAddress","true")),(null==t?void 0:t.checked)&&(null===(e=null==s?void 0:s.address)||void 0===e?void 0:e.label)){this.serviceAddressInput.value=s.address.label;const e=(0,g.getAddressDetails)(s.address);sessionStorage.setItem("suggestedAddress",JSON.stringify(e)),sessionStorage.setItem("suggestion","true"),sessionStorage.setItem("manualAddress","false")}this.form.length>0&&this.form[0].click()})}setGTMTags(e){try{const t={event:"custEv_LocalDataLayer",locationID:e.franchiseWebLocationId,locationDBA:e.doingBusinessAs,locationZipcode:e.zipCode,licenseNumber:e.licenseNumber};(0,p.gtmCustomEventLeadFlow)(t)}catch(e){console.log("An error occurred in gtmCustomEventLeadFlow: ",e)}}callBookingWithoutLocalization(e,t){var o,n,s;this.setGTMTags({locationID:null!==(o=localStorage.getItem("franchiseWebLocationId"))&&void 0!==o?o:"",locationDBA:null!==(n=localStorage.getItem("doingBusinessAs"))&&void 0!==n?n:"",locationZipcode:t,licenseNumber:null!==(s=sessionStorage.getItem("franchiseWebLocationMarketingId"))&&void 0!==s?s:""});const r=document.getElementById("user-service-address").value;sessionStorage.setItem("manualEnteredAddress",r+", "+t),e?this.contactUsApiCall():(()=>{(0,i.__awaiter)(this,void 0,void 0,function*(){try{yield u.AppointmentForm.create(this.onlineScheduling),yield c.FormHandlerStep2.create(this.onlineScheduling),new h.DateSlider}catch(e){console.log(e)}})})()}settingLocalizaionInStorage(e,t){(0,v.localizationHelper)([e],!1,!1);const o=document.getElementById("user-service-address").value;sessionStorage.setItem("manualEnteredAddress",o+", "+t)}callBookingAfterLocalization(e,t,o){var n;if(e.length>0){const{franchiseWebLocationId:o,doingBusinessAs:n,licenseNumber:s}=e[0],r=o;(()=>{(0,i.__awaiter)(this,void 0,void 0,function*(){yield this.getDetails(r),this.settingLocalizaionInStorage(e[0],t),this.setGTMTags({locationID:r,locationDBA:n,locationZipcode:t,licenseNumber:s}),this.HMSLeadFlow?this.contactUsApiCall():(()=>{(0,i.__awaiter)(this,void 0,void 0,function*(){try{yield u.AppointmentForm.create(this.onlineScheduling),yield c.FormHandlerStep2.create(this.onlineScheduling),new h.DateSlider;m.Footer.init()}catch(e){console.error("Error initializing FormHandlerStep2:",e)}})})()})})(),setTimeout(()=>{(0,d.stopLoader)()},3e3)}else if((0,d.stopLoader)(),o.lead_contactapi)this.contactUsApiCall();else{const e=document.getElementById("error-modal-id");null==e||e.click();const o=document.getElementById("modal-zipcode-error");o&&(null===(n=document.getElementById("modal-appoinment-slot"))||void 0===n||n.classList.add("hidden"),o.innerHTML=`We're sorry. We don't currently provide service to ${t}`,null==o||o.classList.remove("hidden"))}}franchiseLookupAddressApi(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){try{const t=yield(0,v.getFranchiseDetails)(e);t&&(null==t?void 0:t.length)?yield this.handleLocalization(t,e):yield this.handleError({error:"No result found"})}catch(e){yield this.handleError(e)}})}handleLocalization(e,t){return(0,i.__awaiter)(this,void 0,void 0,function*(){const o=document.getElementById("conceptCode"),n=yield(0,v.getBrandDetailsFromBrandJson)(null==o?void 0:o.value);this.getZipCodeToggeleFlag(n)?this.callBookingWithoutLocalization(this.HMSLeadFlow,t):this.callBookingAfterLocalization(e,t,n)})}handleError(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){var t,o;(0,d.stopLoader)();const n=document.getElementById("conceptCode"),i=yield(0,v.getBrandDetailsFromBrandJson)(null==n?void 0:n.value);"function"==typeof(null==e?void 0:e.then)&&(e=yield e);let s=null===(o=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.data)||void 0===o?void 0:o.message;if(s||(s=null==e?void 0:e.message),s||(s=""),"full address is needed to narrow down results"===s.toLowerCase()){const e=document.getElementById("zip-code").value,t=`${document.getElementById("user-service-address").value}, ${e}`;this.franchiseLookupAddressApi(t)}else this.handleGenericError(i)})}handleGenericError(e){if((0,d.stopLoader)(),(0,v.hideErrorMsgInModal)(),e.lead_contactapi)this.contactUsApiCall();else{const e=document.getElementById("error-modal-id");null==e||e.click();const t=document.getElementById("modal-zipcode-error");t&&(t.innerHTML="We're sorry. Something went wrong. Please try again later.",null==t||t.classList.remove("hidden"))}}getZipCodeToggeleFlag(e){var t;return null!==(t=e.send_shortform_lead_bookingapi)&&void 0!==t&&t}contactUsApiCall(){return(0,i.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=(yield u.AppointmentForm.create(!1)).getValues(),n=sessionStorage.getItem("manualCity"),i=sessionStorage.getItem("manualState"),s=sessionStorage.getItem("countryName"),r=document.getElementById("conceptCode"),l=document.getElementById("conceptId"),d=null===(e=document.querySelector('label[for="zip-code"]'))||void 0===e?void 0:e.innerText.trim(),c=null!==(t=o.lastName)&&void 0!==t?t:"";let m,h;try{const e=yield(0,v.getBrandDetailsFromBrandJson)(null==r?void 0:r.value);e&&(m=e.vendorId,h=e.vendorName);let t=this.contactCreateRequestBody(o,n,i,s,l,m,h,d,c);const u=!1,p=document.querySelectorAll("#form-section .contact-us-section")[0].closest('[id*="form"]'),g=(0,y.DomainIdentifier)(),I=(0,b.LocalizationIdentifier)();let S="";const w=a.REGEX.sendCaPostalCode.test(null==d?void 0:d.trim())?"ca":"us";if(S=("us"===g&&!I||"us"===g&&"us"==I)&&"us"===w?"lead-flow-service-reminder-us":"lead-flow-service-reminder-ca",p){const e=(0,f.disclaimerHandleCheck)(u,p,t,d,S);(null==e?void 0:e.comments)&&(t.comments=e.comments),t.optIn=e.optIn,t.emailOptOut=e.emailOptOut}e.lead_contactapi?yield this.contactCallContactUsEndpoint(t):this.HMSLeadFlow&&(yield this.HMSCallBookingEndpoint(t))}catch(e){console.error(`Error in Step1.ts file in the contactUsApiCall function while fetching the Brand JSON. Error message: ${e}`)}})}contactCreateRequestBody(e,t,o,n,i,s,r,l,a){var d,c,u;const m={firstName:e.name.split(" ")[0]?e.name.split(" ")[0]:"",lastName:(null===(d=e.name)||void 0===d?void 0:d.split(" ")[1])?null===(c=e.name)||void 0===c?void 0:c.split(" ")[1]:" ",zipCode:e.zip.trim(),phone:e.phone,email:e.email,city:t,state:o,country:null!=n?n:"",address:e.address||"",address2:e.address2||"",comments:l,signUpForUpdates:!1,isLocalized:"25"===(null==i?void 0:i.value),isTest:this.contactDetermineIsTest(),conceptId:Number(null==i?void 0:i.value),vendorId:Number(s)};return a&&(m.lastName=a,m.firstName=null!==(u=e.name)&&void 0!==u?u:""),m}contactDetermineIsTest(){const e=window.location.hostname.toLowerCase();return e.includes("nblysbx")||e.includes("nblydev")||e.includes("nblytest")||e.includes("localhost")}contactCallContactUsEndpoint(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){try{yield(0,I.contactUsPostCallWrapper)(r.apiConfig.CONTACT_US_SEND,e),this.setLocalStorageAndRedirectToConfirmation(e,!0)}catch(e){console.error(`Error in Step1.ts file in the contactCallContactUsEndpoint function while calling the contactus endpoint: ${e}`)}})}HMSCallBookingEndpoint(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s;let l,a,c=localStorage.getItem("brandDetails");c&&(c=JSON.parse(c)),e.leadSource="Web",e.leadOrigin="Web",e.emailOptOut=!0,e.isLeadOnly=!0,e.leadSourceId=0,e.franchiseId=Number(sessionStorage.getItem("franchiseId"))||0,e.webLocationId=Number(localStorage.getItem("franchiseWebLocationId"))||0,e.state=null!==(o=null!==(t=sessionStorage.getItem("stateCode"))&&void 0!==t?t:sessionStorage.getItem("manualState"))&&void 0!==o?o:"",e.country=null!==(i=null!==(n=sessionStorage.getItem("manualCountryCode"))&&void 0!==n?n:sessionStorage.getItem("countryName"))&&void 0!==i?i:"",e.city=null!==(s=sessionStorage.getItem("manualCity"))&&void 0!==s?s:"",e.campaignName="N/A",e.callType="Inbound",e.conceptCalledId=Number(e.conceptId),e.postalCode=e.zipCode;const u=(0,S.getSessionAndCorrelationID)();l=u.sessionID,a=u.correlationID,a&&(e.correlationId=a);try{const t=yield(0,g.handleMissingData)(e.city,e.state,e.zipCode);e.city=(null==t?void 0:t.city)||e.city,e.state=(null==t?void 0:t.state)||e.state;let o="";o=a&&l?`${r.apiConfig.BOOKING_API_URL}
3&correlationId=${a}&sessionId=${l}`:r.apiConfig.BOOKING_API_URL,(0,d.startLoader)(),yield(0,w.bookingUsPostCallWrapper)(o,e),this.setLocalStorageAndRedirectToConfirmation(e,!1)}catch(e){console.error(`Error while calling the booking endpoint in HMSCallBookingEndpoint: ${e}`)}finally{(0,d.stopLoader)()}})}setLocalStorageAndRedirectToConfirmation(e,t){const o=document.getElementById("conceptId");if("25"===(null==o?void 0:o.value))e.isContact=t,e.postalCode=e.zipCode,sessionStorage.setItem("suggestion","false"),sessionStorage.setItem("booking",JSON.stringify(e));else{const o={FirstName:e.firstName,LastName:e.lastName,ZipCode:e.zipCode,Phone:e.phone,Email:e.email,isContact:t};sessionStorage.setItem("booking",JSON.stringify(o))}window.history.replaceState({},"","/confirmation"),window.location.href="/confirmation",setTimeout(()=>{(0,d.stopLoader)()},1e3)}getDetails(e){return(0,i.__awaiter)(this,void 0,void 0,function*(){var t,o;const n=`${r.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;try{const e=yield(0,s.cachedAPIWrapper)(n,l.apiCaching.FullAttributeResponse);let i=null==e?void 0:e.mainPhoneNumber;this.onlineScheduling=null==e?void 0:e.onlineScheduling;const r=null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.offersClosetAppointments;window.offersClosetAppointments=r,window.calendarTypeId=null==e?void 0:e.calendarTypeId;const a=null===(o=null==e?void 0:e.options)||void 0===o?void 0:o.showFees;return sessionStorage.setItem("hideInspectionFee",a),null==e||e.callTrackings.forEach(t=>{var o;"WebsiteTracking"==t.callTrackingTypeDescription&&(i=t.callTrackingNumber,localStorage.setItem("localPhoneNumber",i));const n=document.querySelector(".header-wrapper .form-call-cta");if(n){n.href=`tel:${i}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,t=null===(o=String(i))||void 0===o?void 0:o.replace(/\D/g,"").match(e);n.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`}const s=document.querySelector(".header-cta-mobile .primary-btn");if(s&&(s.href=`tel:${i}`),this.HMSLeadFlow){document.getElementById("progress").style.width="100%"}else if(null==e?void 0:e.onlineScheduling){const e=document.querySelectorAll("#form-section .contact-us-section"),t=document.querySelectorAll(".progressbar .progress-step"),o=document.getElementById("progress"),n=e[0],i=e[1],s=t[0],r=t[1];o.style.width="50%",n.classList.remove("form-step-active"),i.classList.add("form-step-active"),s.classList.remove("progress-step-active"),s.classList.add("progress-step-confirmed"),r.classList.add("progress-step-active"),j(!1)}else{const e=document.querySelector(".progressbar"),t=document.querySelectorAll(".progressbar .progress-step"),o=t[2];o&&(null==e||e.removeChild(o));document.getElementById("progress").style.width="100%";const n=document.querySelectorAll("#form-section .contact-us-section"),i=document.querySelectorAll(".contact-us-section .btn-next")[1],s=n[0],r=n[1],l=t[0],a=t[1];s.classList.remove("form-step-active"),r.classList.add("form-step-active"),i&&(i.innerHTML="Submit"),l.classList.remove("progress-step-active"),l.classList.add("progress-step-confirmed"),a.classList.add("progress-step-active"),j(!0)}}),e}catch(e){throw console.error("Error in getDetails:",e),e}})}validateForm(){var e,t,o,n,i,s,r,l,d,c,u,m;document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),document.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"));const h={};if(this.nameInput.required&&""===this.nameInput.value?h["user-full-name"]="":""===this.nameInput.value||a.REGEX.sendName.test(this.nameInput.value)||(h["user-full-name"]="Invalid name format."),(null===(e=this.lastNameInput)||void 0===e?void 0:e.required)&&""===(null===(t=this.lastNameInput)||void 0===t?void 0:t.value)?h["user-last-name"]="":""===(null===(o=this.lastNameInput)||void 0===o?void 0:o.value)||a.REGEX.sendName.test(null===(n=this.lastNameInput)||void 0===n?void 0:n.value)||(h["user-last-name"]="Invalid last name format."),this.phoneNumberInput.required&&""===this.phoneNumberInput.value)h["user-phone-number"]="";else if(""!=this.phoneNumberInput.value&&(null===(i=this.phoneNumberInput)||void 0===i?void 0:i.value.length)<14){document.getElementById("user-phone-number-error-msg");h["user-phone-number"]="Invalid phone format."}(null===(s=this.zipCodeInput)||void 0===s?void 0:s.required)&&""===(null===(r=this.zipCodeInput)||void 0===r?void 0:r.value)?h["zip-code"]="":""==this.zipCodeInput.value||a.REGEX.sendZip.test(this.zipCodeInput.value.trim())||(h["zip-code"]="Invalid zip code format."),this.serviceAddressInput.required&&""===this.serviceAddressInput.value?h["user-service-address"]="":""==this.serviceAddressInput.value||a.REGEX.sendAddress1.test(this.serviceAddressInput.value)||(h["user-service-address"]="Invalid address format."),(null===(l=this.serviceAddress2Input)||void 0===l?void 0:l.required)&&""===(null===(d=this.serviceAddress2Input)||void 0===d?void 0:d.value)?h["user-address-2"]="":""==(null===(c=this.serviceAddress2Input)||void 0===c?void 0:c.value)||(null===(u=a.REGEX.sendAddress2)||void 0===u?void 0:u.test(null===(m=this.serviceAddress2Input)||void 0===m?void 0:m.value))||(h["user-address-2"]="Invalid address2 format."),this.emailInput.required&&""===this.emailInput.value?h["user-email"]="":""==this.emailInput.value||a.REGEX.sendEmail.test(this.emailInput.value)||(h["user-email"]="Invalid email address, please try again.");const p=this.handleCheckboxChange();
3return p&&(h[p]=""),Object.keys(h).forEach((e,t)=>{const o=document.getElementById(e),n=document.getElementById(`${e}-error-msg`);if(o&&o.parentNode){const t=h[e],i=document.createElement("span");i.className="error-msg",i.textContent=t,o.classList.add("invalid-field"),n&&t&&(n.innerHTML=t),n&&n.classList.contains("hidden")&&n.classList.remove("hidden")}0==t&&o&&o.focus()}),0===Object.keys(h).length}updateInputValue(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.error(`Error in updateInputValue function: ${e}`)}}handleHMSLeadflow(){const e=document.getElementById("conceptId"),t=null==e?void 0:e.value,o=sessionStorage.getItem("hms_lead_ISN_zip");if("25"!==t)return;const n=document.querySelector("#isn-form #zip-code");n&&o&&(n.value=o),this.HMSLeadFlow=!0;const i=document.querySelectorAll(".contact-us-section .btn-next")[0];i&&(i.innerHTML="Submit",i.title="Click to Submit Form");const s=document.querySelector(".progressbar"),r=document.querySelectorAll(".progressbar .progress-step")[2];r&&(null==s||s.removeChild(r))}}null===(n=null===document||void 0===document?void 0:document.body)||void 0===n||n.addEventListener("click",function(e){var t;const o=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value;if("19"===o||"255"===o)return;const n=document.querySelector(".suggestion-container");(null==n?void 0:n.parentNode)&&n.parentNode.removeChild(n)}),document.addEventListener("DOMContentLoaded",()=>{var e;const t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value;"25"!==t&&"1"!==t&&q.getInstance()})},"./src/js/opus2/lead-flow/step2.ts"(e,t,o){"use strict";o.d(t,{FormHandlerStep2:()=>S,inspectionFeeObj:()=>v,serviceSelect:()=>g,serviceSelectCat:()=>y,serviceSelectFloors:()=>b,serviceSkuId:()=>f});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ./filterArray */"./src/js/opus2/lead-flow/filterArray.ts"),r=o(/*! ./step3 */"./src/js/opus2/lead-flow/step3.ts"),l=o(/*! ../location-search-map/config */"./src/js/opus2/location-search-map/config.ts"),a=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),d=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),c=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),u=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),m=o(/*! ../apiCaching/POST-Requests/helperModules/handleBookingSubmit */"./src/js/opus2/apiCaching/POST-Requests/helperModules/handleBookingSubmit.ts");let h=[];const p=[null,null,null];let v=null,g="",f="",y="",b="",I="Residential";class S{constructor(e){var t,o,n,i,s,r,l,a,d,m,p,v,g;this.onlineScheduling=e,this.formElement=document.querySelector(".contact-us-section"),this.showButton2=!0,this.form=document.querySelectorAll(".contact-us-section .btn-next"),this.serviceTypeRadioElements=document.querySelectorAll('input[name="service-type"]'),this.sendNoteTextarea=document.getElementById("send-note"),this.selectServiceSelect=document.getElementById("select-service-category");const f=document.querySelectorAll('input[type="file"]');this.imageInputs=(null==f?void 0:f.length)>0?Array.from(f):[],this.emailCheckbox=document.getElementById("default-checkbox"),this.textCheckbox=document.getElementById("checked-checkbox"),this.howAboutUsSelect=document.getElementById("how-about-us"),this.selectSubServiceSelect=document.getElementById("select-service"),this.selectFloorAppliance=document.getElementById("select-floor"),this.selectServiceProCategory=document.getElementById("select-servicepro-category"),this.selectServicePro=document.getElementById("select-servicepro"),null===(t=this.howAboutUsSelect)||void 0===t||t.addEventListener("change",this.hideError.bind(this,"how-about-us")),null===(o=this.selectServiceSelect)||void 0===o||o.addEventListener("change",this.hideError.bind(this,"select-service-category")),null===(n=this.sendNoteTextarea)||void 0===n||n.addEventListener("input",this.hideError.bind(this,"send-note")),null===(i=this.selectSubServiceSelect)||void 0===i||i.addEventListener("change",this.hideError.bind(this,"select-service")),null===(s=this.selectFloorAppliance)||void 0===s||s.addEventListener("change",this.hideError.bind(this,"select-floor")),null===(r=this.selectServiceProCategory)||void 0===r||r.addEventListener("change",this.hideError.bind(this,"select-servicepro-category")),null===(l=this.selectServicePro)||void 0===l||l.addEventListener("change",this.hideError.bind(this,"select-servicepro")),this.initImages(),this.form&&(null===(a=(0,u.removeElementEventListeners)(this.form[1]))||void 0===a||a.addEventListener("click",this.handleSubmit.bind(this)),(null===(d=this.howAboutUsSelect)||void 0===d?void 0:d.required)||(null===(m=this.selectServiceSelect)||void 0===m?void 0:m.required)||null===(p=this.sendNoteTextarea)||void 0===p||p.required),this.serviceTypeRadioElements&&(null===(v=this.serviceTypeRadioElements)||void 0===v?void 0:v.length)>0&&(this.serviceTypeRadioElements[0].checked=!0,this.serviceTypeRadioElements.forEac
3h(e=>{e.addEventListener("click",(e,t)=>{var o;try{(0,c.startLoader)();const n=document.getElementById("custom-select2"),i=document.getElementById("custom-select2-scheduler-pro");function s(e){for(var t;(null===(t=null==e?void 0:e.options)||void 0===t?void 0:t.length)>0;)null==e||e.remove(0)}this.disibleSelectCateogry(n,"select-service"),this.disibleSelectCateogry(i,"select-service");const r=document.getElementById("select-service-category"),l=document.getElementById("select-servicepro-category");s(l);let a=this.getValue();null!==r&&(r.innerHTML=""),null!==l&&(l.innerHTML=""),I=1==a?"Commercial":"Residential";const d=document.createElement("option");d.value="",d.textContent="Select a Service Category",r?(null==r||r.appendChild(d),null==l||l.appendChild(d.cloneNode(!0))):null==l||l.appendChild(d),null===(o=h[a])||void 0===o||o.category.forEach(e=>{const t=document.createElement("option");t.value=e.name,t.textContent=e.name,null==r||r.appendChild(t),null==l||l.appendChild(t.cloneNode(!0))}),setTimeout(()=>{2==(null===window||void 0===window?void 0:window.calendarTypeId)?(this.setupData("custom-select1-scheduler-pro",!1),this.setupData2("custom-select2-scheduler-pro",!0)):(this.setupData("custom-select1",!1),this.setupData2("custom-select2",!0)),(0,c.stopLoader)()},1e3)}catch(u){(0,c.stopLoader)(),console.log("Service type onclick issue: ",u)}})})),this.solutionAppointmentError(),this.getFee(),this.floorAppliance();const y=document.querySelectorAll(".contact-us-section .cancel-verification");y&&(null===(g=(0,u.removeElementEventListeners)(y[1]))||void 0===g||g.addEventListener("click",()=>{const e=document.querySelectorAll("#form-section .contact-us-section"),t=Array.from(e).findIndex(e=>e.classList.contains("form-step-active")),o=document.querySelectorAll(".progressbar .progress-step"),n=document.getElementById("progress"),i=e[t],s=e[t-1],r=o[t],l=o[t-1],a=(t-1)/(e.length-1)*100;n.style.width=`${a}%`,i.classList.remove("form-step-active"),s.classList.add("form-step-active"),r.classList.remove("progress-step-active"),l.classList.add("progress-step-active"),1==t&&r.classList.remove("progress-step-confirmed")})),this.hideClosetButton(),this.hideAndShowServicePro(2==(null===window||void 0===window?void 0:window.calendarTypeId))}static create(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return S.instance||(S.instance=new S(e),yield Promise.all([S.instance.getMenu(),S.instance.setHowOknowAsync()])),S.instance})}static getInstance(){return S.instance}hideAndShowServicePro(e=!1){var t,o,n,i;const s=document.querySelectorAll(".scheduler-pro"),r=document.getElementById("select-service"),l=document.getElementById("select-service-category");e?(null==s||s.forEach(e=>{null==e||e.classList.remove("hidden")}),null===(t=null==r?void 0:r.closest(".input-label-wrap"))||void 0===t||t.classList.add("hidden"),null===(o=null==l?void 0:l.closest(".input-label-wrap"))||void 0===o||o.classList.add("hidden")):(null==s||s.forEach(e=>{null==e||e.classList.add("hidden")}),null===(n=null==r?void 0:r.closest(".input-label-wrap"))||void 0===n||n.classList.remove("hidden"),null===(i=null==l?void 0:l.closest(".input-label-wrap"))||void 0===i||i.classList.remove("hidden"))}hideClosetButton(){var e,t;let o=document.querySelector(".select-solution-wrap");(null===window||void 0===window?void 0:window.offersClosetAppointments)&&this.onlineScheduling?(null===(t=null==o?void 0:o.classList)||void 0===t||t.remove("hidden"),sessionStorage.setItem("solutionAppointment","true")):(null===(e=null==o?void 0:o.classList)||void 0===e||e.add("hidden"),sessionStorage.setItem("solutionAppointment","false"))}setupData(e,t=!0){var o;document.addEventListener("click",this.closeAllSelect.bind(this));const n=document.getElementById(e);if(null!==n){const e=n.querySelector("select"),i=e.options,s=i[e.selectedIndex],r=n.querySelector(".select-selected");null==r||r.remove();const a=document.getElementById("conceptCode"),d=l.brandColorCode[a.value],c=document.createElement("button");c.type="button",c.className="select-selected",c.innerHTML=(null==s?void 0:s.innerHTML)&&t?null==s?void 0:s.innerHTML:"Select a Service Category",n.appendChild(c),null===(o=null==n?void 0:n.parentNode.querySelectorAll(".select-items.select-hide.slim-scroll"))||void 0===o||o.forEach(e
3=>{null==e||e.remove()});const u=document.createElement("div");u.className="select-items select-hide slim-scroll";for(let t=0;t<i.length;t++){if(t===e.selectedIndex)continue;const o=document.createElement("button");o.innerHTML=i[t].innerHTML,o.type="button",o.addEventListener("click",()=>{e.selectedIndex=t,c.innerHTML=i[t].innerHTML,y=i[t].innerHTML,c.style.backgroundColor=d,c.style.color="white",this.setupServiceDropdown(c),2==(null===window||void 0===window?void 0:window.calendarTypeId)?this.setupData2("custom-select2-scheduler-pro"):this.setupData2("custom-select2"),this.closeAllSelect.call(this)}),u.appendChild(o)}this.setupServiceDropdown(c),n.appendChild(u),c.addEventListener("click",e=>{e.stopPropagation(),this.closeAllSelect(),u.classList.toggle("select-hide"),c.classList.toggle("select-arrow-active"),this.escapeServiceCategory(u,c)})}else this.setupServiceDropdown(null)}setupData2(e,t=!1){var o,n,i;document.addEventListener("click",this.closeAllSelect.bind(this));const s=document.getElementById(e);if(null!=s){const e=s.querySelector("select"),r=s.querySelector(".select-selected");null==r||r.remove();const a=e.options,d=a[e.selectedIndex],c=document.getElementById("conceptCode"),u=l.brandColorCode[c.value],m=document.createElement("button");m.className="select-selected",m.type="button",m.innerHTML=(null==d?void 0:d.innerHTML)?null==d?void 0:d.innerHTML:"",s.appendChild(m),null===(o=null==s?void 0:s.parentNode.querySelectorAll(".select-items.select-hide.slim-scroll"))||void 0===o||o.forEach(e=>{null==e||e.remove()});const h=document.createElement("div");if(h.className="select-items select-hide slim-scroll",(a.length>1||null===this.selectServiceSelect)&&!t){const e=document.querySelectorAll(".select-service");null==e||e.forEach(e=>{var t;null===(t=null==e?void 0:e.classList)||void 0===t||t.remove("select-service")})}for(let t=0;t<a.length;t++){if(t===e.selectedIndex)continue;const o=document.createElement("button");o.innerHTML=a[t].innerHTML,o.type="button";const s=null===(n=a[t])||void 0===n?void 0:n.getAttribute("data-service-sku-id"),r=null===(i=a[t])||void 0===i?void 0:i.getAttribute("data-service-sku");s&&o.setAttribute("data-service-sku-id",s),r&&o.setAttribute("data-service-sku",r),o.addEventListener("click",()=>{var o,n;e.selectedIndex=t,m.innerHTML=a[t].innerHTML,g=a[t].innerHTML,m.style.backgroundColor=u,m.style.color="white";const i=null===(o=a[t])||void 0===o?void 0:o.getAttribute("data-service-sku-id"),s=null===(n=a[t])||void 0===n?void 0:n.getAttribute("data-service-sku");i&&s&&(f=i),this.closeAllSelect()}),h.appendChild(o)}s.appendChild(h),m.addEventListener("click",e=>{e.stopPropagation(),h.innerHTML&&(this.closeAllSelect(),h.classList.toggle("select-hide"),m.classList.toggle("select-arrow-active"),this.escapeServiceCategory(h,m))})}}floorAppliance(){document.addEventListener("click",this.closeAllSelect.bind(this));const e=document.getElementById("custom-select3"),t=document.getElementById("select-floor-error-msg");if(e){const o=e.querySelector("select"),n=e.querySelector(".select-selected");if(o&&n){n.remove();const i=o.options,s=i[o.selectedIndex],r=document.getElementById("conceptCode"),a=l.brandColorCode[r.value],d=document.createElement("button");d.className="select-selected",d.type="button",d.innerHTML=s?s.innerHTML:"",e.appendChild(d);const c=document.createElement("div");if(c.className="select-items select-hide slim-scroll",i.length>1||!this.selectServiceSelect){const e=document.querySelector(".select-floor");e&&e.classList.remove("select-floor")}for(let e=0;e<i.length;e++){if(e===o.selectedIndex)continue;const n=document.createElement("button");n.innerHTML=i[e].innerHTML,n.type="button",n.addEventListener("click",()=>{null==t||t.classList.add("hidden"),o.selectedIndex=e,d.innerHTML=i[e].innerHTML,b=i[e].innerHTML,d.style.backgroundColor=a,d.style.color="white",this.closeAllSelect()}),c.appendChild(n)}e.appendChild(c),d.addEventListener("click",e=>{e.stopPropagation(),this.closeAllSelect(),c.classList.toggle("select-hide"),d.classList.toggle("select-arrow-active"),this.escapeServiceCategory(c,d)})}}}closeAllSelect(){const e=document.querySelectorAll(".select-items.slim-scroll"),t=document.querySelectorAll(".select-selected");
3e.forEach(e=>{e.classList.add("select-hide")}),t.forEach(e=>{e.classList.remove("select-arrow-active")})}initImages(){if(document.querySelector(".scheduler-main")){const e=document.querySelectorAll('input[type="file"]');null==e||e.forEach((e,t)=>{e.addEventListener("change",()=>{this.showFilePreview(e,t)})});const t=document.querySelectorAll(".icon-close");null==t||t.forEach((e,t)=>{e.addEventListener("click",this.clearPreview.bind(this,t))})}}getFee(){if(!document.getElementById("zip-code"))return;const e=`${i.apiConfig.franchiseWebLocationPostalCodeFees}/${localStorage.getItem("franchiseWebLocationId")}/${document.getElementById("zip-code").value}?apikey=pneiweb-9pbaOywNKQj853D`;(0,d.getCachedAPIResponse)(e).then(e=>{v=e.find(e=>"Inspection Fee"==e.feeName),this.showOrHideInspectionFeeDiv(v)}).catch(e=>{})}showOrHideInspectionFeeDiv(e){const t=sessionStorage.getItem("hideInspectionFee"),o=document.querySelector(".inspection-fee"),n=document.querySelector(".fee-wrapper.alert-info");if(!n)return;if(!e||!o||"false"===t)return sessionStorage.setItem("hideInspectionFee","false"),void(n.style.display="none");const i=e.fee;i?(n.style.display="flex",sessionStorage.setItem("hideInspectionFee","true"),o.innerHTML=`<strong> $${i}</strong>`):(sessionStorage.setItem("hideInspectionFee","false"),n.style.display="none")}setHowOknowAsync(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return new Promise((e,t)=>{var o,n,s,r;const l=sessionStorage.getItem("franchiseId");if(!l)return void e();let a=`${i.apiConfig.howToKnow}/${l}`;const c=null===(n=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value)||void 0===n?void 0:n.toLocaleLowerCase(),u=document.getElementById("how-about-us");u?(null===(s=this.howAboutUsSelect)||void 0===s?void 0:s.value)&&"Select a referal method"!=(null===(r=this.howAboutUsSelect)||void 0===r?void 0:r.value)?e():(0,d.cachedAPIWrapper)(a).then(t=>{const o=t;if(u){u.innerHTML="";const e=document.createElement("option");e.value="",e.textContent="Select a Referral Method",u.appendChild(e),o.forEach(e=>{const t=document.createElement("option");t.value=e.leadSourceName,t.textContent=e.leadSourceName,t.setAttribute("data-sync-generic-lead-source-id",e.syncGenericLeadSourceId),"dvw"===c&&e.referralTypeId&&t.setAttribute("data-referral-type-id",e.referralTypeId),u.appendChild(t)})}e()}).catch(e=>{var o,n,i,s;"dvw"===c&&(null===(o=document.getElementById("modal-zipcode-error"))||void 0===o||o.classList.add("hidden"),null===(n=document.getElementById("error-modal-id"))||void 0===n||n.click(),null===(i=document.getElementById("modal-appoinment-slot"))||void 0===i||i.classList.remove("hidden"),null===(s=document.getElementById("error-modal"))||void 0===s||s.classList.remove("hidden")),t(e)}):e()})})}setHowOknow(){this.setHowOknowAsync().catch(e=>{console.error("Error in setHowOknow:",e)})}getValue(){const e=document.querySelector('input[name="service-type"]:checked');if(e){const t=document.querySelector(`label[for="${e.id}"]`);return"Commercial"==(null==t?void 0:t.textContent)?1:0}return 0}handleSubmit(e){e.preventDefault();const t=document.querySelectorAll("#form-section .contact-us-section"),o=Array.from(t).findIndex(e=>e.classList.contains("appointment-details-section"));if(this.isFormValid())if(2==o){if("Next"==this.form[0].innerHTML||"Next"==this.form[1].innerHTML){window.scrollTo({top:0});let e=null===window||void 0===window?void 0:window.offersClosetAppointments;if(this.onlineScheduling&&e||2==window.calendarTypeId){let e=document.querySelector("input[type='radio'][name=solution-type]");(e||2==window.calendarTypeId)&&(e&&sessionStorage.setItem("solutionAppointment","true"),(()=>{(0,n.__awaiter)(this,void 0,void 0,function*(){yield r.AppointmentForm.create(this.onlineScheduling)})})())}}if("Submit"==this.form[1].innerHTML){const t=!1;(()=>{(0,n.__awaiter)(this,void 0,void 0,function*(){(yield r.AppointmentForm.create(t)).handleSubmit(e,!1)})})()}else{const e=document.querySelectorAll("#form-section .contact-us-section"),t=document.querySelectorAll(".progressbar .progress-step"),o=document.getElementById("progress"),n=e[1],i=e[2],s=t[1],r=t[2];o.style.width="100%",n.classList.remove("form-step-active"),i.classList.add("form-step-active"),s.classList.remove("progress-step-active"),s.classList.add("progress-step-confirmed"),r.classList.add("progress-step-active"),window.scrollTo(0,10)}}else(()=>{(0,n.__awaiter)(this,void 0,void 0,function*(){(yield r.AppointmentForm.create(this.onlineScheduling)).bookingProcess(e,!1)})})();new FormData(this.formElement)}hideError(e){const t=document.getElementById(e);let o=document.getElementById(`${e}-error-msg`);if("send-note"==t.id&&""==t.value)return o.classList.remove("hidden"),void t.classList.add("invalid-field");null==o||o.classList.add("hidden"),t.classList.remove("invalid-field"),setTimeout(()=>{this.showSubmitButton.call(this)},300)}showSubmitButton(){}getMenu(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=(0,u.getWeblocationPathGroupWithDynamicConfig)(),t=document.getElementById("select-service-category");if(this.shouldFetchMenu())try{const o=yield(0,d.getCachedAPIResponse)(e,a.apiCaching.SiteConfig,!1);if(o){const e=this.getServiceOptions(o);h=e,(t||this.selectServiceProCategory)&&(this.clearExistingOptions(t,this.selectServiceProCategory),this.populateOptions(t,this.selectServiceProCategory,e)),this.setupCustomSelects()}}catch(e){console.log("Error in getMenu function",e)}})}shouldFetchMenu(){var e,t,o;return!(null===(e=this.selectServiceSelect)||void 0===e?void 0:e.value)||"Select a category type"===(null===(t=this.selectServiceSelect)||void 0===t?void 0:t.value)||!(null===(o=this.selectServiceProCategory)||void 0===o?void 0:o.value)}getServiceOptions(e){var t,o,n,i;const s=e.serviceMenu;let r=s.country[0].brand[0].option;return localStorage.getItem("dbaName")&&(r=null===(i=null===(n=null===(o=null===(t=s.country[0])||void 0===t?void 0:t.brand[0])||void 0===o?void 0:o.webLocation)||void 0===n?void 0:n[0])||void 0===i?void 0:i.option),null==r?void 0:r.filter(e=>null==e?void 0:e.visibility).map(e=>Object.assign(Object.assign({},e),{category:e.category.filter(e=>{var t;return(null==e?void 0:e.visibility)&&(null===(t=e.menu)||void 0===t?void 0:t.some(e=>null==e?void 0:e.visibility))})}))}clearExistingOptions(e,t){e&&(e.innerHTML=""),t&&(t.innerHTML="")}populateOptions(e,t,o){var n;const i=this.createOption("","Select a Service Category");null==e||e.appendChild(i),null==t||t.appendChild(i.cloneNode(!0));const s=this.sortServicesByName(null===(n=o[0])||void 0===n?void 0:n.category);
3null==s||s.forEach(o=>{const n=this.createOption(o.name,o.name);null==e||e.appendChild(n),null==t||t.appendChild(n.cloneNode(!0))})}createOption(e,t){const o=document.createElement("option");return o.value=e,o.textContent=t,o}setupCustomSelects(){setTimeout(()=>{2==(null===window||void 0===window?void 0:window.calendarTypeId)?(this.setupData("custom-select1-scheduler-pro"),this.setupData2("custom-select2-scheduler-pro",!!this.selectServiceProCategory)):(this.setupData("custom-select1"),this.setupData2("custom-select2",!!this.selectServiceSelect))},1e3)}solutionAppointmentError(){[document.getElementById("shelf-solution-radio"),document.getElementById("closet-solution-radio"),document.getElementById("both-solution-radio")].forEach(e=>{null==e||e.addEventListener("click",()=>{this.hideErrorMessage()})})}hideErrorMessage(){const e=document.getElementById("shelf-solution-radio-error-msg");e&&e.classList.add("hidden")}isFormValid(){var e,t,o,n,i,s,r,l,a,d,c,u,m,h;const p=document.getElementById("shelf-solution-radio"),v=document.getElementById("closet-solution-radio"),g=document.getElementById("both-solution-radio"),f=document.querySelector(".select-solution-wrap .confiramtion_slnLabel");f&&sessionStorage.setItem("solution_needs_label",f.innerHTML),document.querySelectorAll(".error-msg").forEach(e=>e.classList.add("hidden")),document.querySelectorAll(".invalid-field").forEach(e=>e.classList.remove("invalid-field"));const y={},b=!p&&!v&&!g;let I=window.offersClosetAppointments;if(!b&&I&&this.onlineScheduling){const e=!p||p.required&&!p.checked,t=!v||v.required&&!v.checked,o=!g||g.required&&!g.checked;e&&t&&o&&(y["shelf-solution-radio"]="")}return(null===(e=this.sendNoteTextarea)||void 0===e?void 0:e.required)&&""===(null===(t=this.sendNoteTextarea)||void 0===t?void 0:t.value)&&(y["send-note"]=""),2!=(null===window||void 0===window?void 0:window.calendarTypeId)&&(null===(o=this.selectServiceSelect)||void 0===o?void 0:o.required)&&""===(null===(n=this.selectServiceSelect)||void 0===n?void 0:n.value)&&(y["select-service-category"]=""),2!=(null===window||void 0===window?void 0:window.calendarTypeId)&&(null===(i=this.selectSubServiceSelect)||void 0===i?void 0:i.required)&&""===(null===(s=this.selectSubServiceSelect)||void 0===s?void 0:s.value)&&(y["select-service"]=""),(null===(r=this.selectFloorAppliance)||void 0===r?void 0:r.required)&&"Select floor"===(null===(l=this.selectFloorAppliance)||void 0===l?void 0:l.value)&&(y["select-floor"]=""),
3(null===(a=this.howAboutUsSelect)||void 0===a?void 0:a.required)&&""===(null===(d=this.howAboutUsSelect)||void 0===d?void 0:d.value)&&(y["how-about-us"]=""),2==(null===window||void 0===window?void 0:window.calendarTypeId)&&(null===(c=this.selectServiceProCategory)||void 0===c?void 0:c.required)&&""===(null===(u=this.selectServiceProCategory)||void 0===u?void 0:u.value)&&(y["select-servicepro-category"]=""),2==(null===window||void 0===window?void 0:window.calendarTypeId)&&(null===(m=this.selectServicePro)||void 0===m?void 0:m.required)&&""===(null===(h=this.selectServicePro)||void 0===h?void 0:h.value)&&(y["select-servicepro"]=""),Object.keys(y).forEach((e,t)=>{var o;const n=document.getElementById(e);let i=document.getElementById(`${e}-error-msg`);if(n&&n.parentNode){const t=y[e],s=document.createElement("span");s.className="error-msg",s.textContent=t,n.classList.add("invalid-field"),i&&t&&(i.innerHTML=t),i&&(null===(o=i.classList)||void 0===o?void 0:o.contains("hidden"))&&i.classList.remove("hidden")}0==t&&n&&n.focus()}),0===Object.keys(y).length}resetForm(){this.formElement.reset()}getSelectedFiles(){const e=document.querySelectorAll('input[type="file"]'),t=[];return e.forEach(e=>{e.files&&e.files.length>0&&t.push(e.files[0])}),t}clearPreview(e){const t=null===document||void 0===document?void 0:document.querySelectorAll(".file-upload img")[e],o=null===document||void 0===document?void 0:document.querySelectorAll(".upload-data")[e];t.src=null;const n=document.querySelectorAll('input[type="file"]')[e];n&&(n.value=null),t.removeAttribute("style"),null==o||o.classList.remove("active")}showFilePreview(e,t){(0,m.handleFilePreview)(e,t,p)}escapeServiceCategory(e,t){document.addEventListener("keydown",o=>{"Escape"===o.key&&(e.classList.add("select-hide"),t.classList.remove("select-arrow-active"))})}flattenMenu(e){return e.reduce((e,t)=>(e.push(t),t.menu&&Array.isArray(t.menu)&&e.push(...this.flattenMenu(t.menu)),e),[])}setupServiceDropdown(e){var t,o,n,i,r;const l=document.getElementById("custom-select2"),a=document.getElementById("custom-select2-scheduler-pro");if(null!=l||null!=a){const d=this.getValue(),c=null===(o=null===(t=h[d])||void 0===t?void 0:t.category)||void 0===o?void 0:o.find(t=>t.name==(null==e?void 0:e.innerHTML));let u=(0,s.extractServices)(c);if(null===e){const e=null===(i=null===(n=h[d])||void 0===n?void 0:n.category)||void 0===i?void 0:i.flatMap(e=>e.menu?e.menu.flatMap(e=>e.service?(e.service.forEach(e=>{e.serviceSkuId=!0}),this.flattenMenu(null==e?void 0:e.service)):[e]):[]);if(e&&Array.isArray(e)){u=e.sort((e,t)=>e.name.localeCompare(t.name)).filter((e,t,o)=>t===o.findIndex(t=>t.name===e.name))}}c||(this.disibleSelectCateogry(l,"select-service"),this.disibleSelectCateogry(a,"select-service"));const m=document.getElementById("select-service");if(null!==m||null!==this.selectServicePro){null!==m&&(m.innerHTML=""),null!==this.selectServicePro&&(this.selectServicePro.innerHTML="");const e=document.createElement("option");e.value="",e.textContent="Select a Service",null==m||m.appendChild(e),null===(r=this.selectServicePro)||void 0===r||r.appendChild(e.cloneNode(!0))}u=this.sortServicesByName(u),null==u||u.forEach(e=>{var t;const o=document.createElement("option");o.value=e.name,o.textContent=e.name,o.setAttribute("data-service-sku-id",e.id),o.setAttribute("data-service-sku",e.serviceSkuId),null==m||m.appendChild(o),null===(t=this.selectServicePro)||void 0===t||t.appendChild(o.cloneNode(!0))})}}disibleSelectCateogry(e,t){if(e){const o=e.parentElement;o&&o.classList.add(t)}}sortServicesByName(e){return null==e?void 0:e.sort((e,t)=>e.name<t.name?-1:e.name>t.name?1:0)}getFormElement(){return this.formElement}}S.instance=null},"./src/js/opus2/lead-flow/step3.ts"(e,t,o){"use strict";o.d(t,{AppointmentForm:()=>C});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),a=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),d=o(/*! ./step1 */"./src/js/opus2/lead-flow/step1.ts"),c=o(/*! ./step2 */"./src/js/opus2/lead-flow/step2.ts"),u=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),m=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),h=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),p=o(/*! ../mly/booking-payload */"./src/js/opus2/mly/booking-payload.ts"),v=o(/*! ../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),g=o(/*! ../util/domainService */"./src/js/opus2/util/domainService.ts"),f=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),y=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts"),b=o(/*! ../apiCaching/POST-Requests/apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts");let I=[],S=o(/*! moment */"./node_modules/moment/moment.js"),w="",L="",E="";class C{constructor(e){this.buttonName=[],this.isDateTime=!1,this.shgSolutionType=null,this.sentCommentAndNote=!0,this.getCheckedCheckboxes=()=>{let e=[];return e=Array.from(document.querySelectorAll(".received-updates")).filter(e=>e.checked).map(e=>e.value),e.join(" , ")},this.getCheckedPreferedComunnication=()=>{const e=document.querySelectorAll('input[type="checkbox"][data-preferred-communication]:checked');let t="";return e.forEach((o,n)=>{const i=o.getAttribute("data-preferred-communication");t+=this.capitalizeString(i),n<e.length-1&&(t+=",")}),t},this.setCard=e=>e.map(e=>`\n <li class="date-details-item">\n <button type="button" class="${(null==I?void 0:I.some(t=>S(t.startDate).format("DD MMM, YYYY")==S(e.startDate).format("DD MMM, YYYY")&&t.isAvailable))?S(e.startDate).format("ddd DD MMM, YYYY")===S(w).format("ddd DD MMM, YYYY")?"date-details-inactive date-details-active dateapp":"date-details-inactive dateapp":"date-details-disable"}"\n value=${e.startDate}>
3\n <span value=${e.startDate} class="date-text-small">${S(e.startDate).format("MMM")}</span>\n <strong value=${e.startDate} class="date-text-normal">${S(e.startDate).format("DD")}</strong>\n <input class="getDateApp" hidden value=${e.startDate}>\n <input class="scheduleID" hidden value=${e.scheduleID}> \n <span value=${e.startDate} class="date-text-small">${S(e.startDate).format("ddd")} </span>\n </button>\n </li>\n `),this.onlineScheduling=e,null!==this.onlineScheduling&&void 0!==this.onlineScheduling&&sessionStorage.setItem("onlineSchedule",this.onlineScheduling.toString()),this.onlineSchedulingFlagValidation=e,this.init()}static create(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return C.instance||(C.instance=new C(e),C.instance.onlineScheduling&&(yield C.instance.setAppointmainCalander())),C.instance})}static getInstance(){return C.instance}init(){this.enableDisableCalendarBtn();const e=this.removeAllEventListeners(".appointment-details-section .btn-container .primary-btn"),t=(0,m.removeAllEventListeners)("#link-checkbox");t&&t.addEventListener("click",this.handleDisableApp.bind(this)),null==e||e.addEventListener("click",this.handleSubmit.bind(this));const o=(0,m.removeAllEventListeners)(".contact-us-section .btn-cancel");o&&o.addEventListener("click",()=>{const e=document.querySelectorAll("#form-section .contact-us-section"),t=Array.from(e).findIndex(e=>e.classList.contains("form-step-active")),o=document.querySelectorAll(".progressbar .progress-step"),n=document.getElementById("progress"),i=e[t],s=e[t-1],r=o[t],l=o[t-1],a=(t-1)/(e.length-1)*100;n.style.width=`${a}%`,i.classList.remove("form-step-active"),s.classList.add("form-step-active"),r.classList.remove("progress-step-active"),1==t&&r.classList.remove("progress-step-confirmed"),l.classList.add("progress-step-active")})}removeDuplicateDates(e,t){const o=new Set,n=[];for(const t of e){const e=t.startDate.split("T")[0];o.has(e)||(o.add(e),n.push(t))}const i=S().format("DD MMM, YYYY");if(0==t){return n.filter(e=>i!=S(e.startDate).format("DD MMM, YYYY"))}return n}setAppointmainCalander(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n,i;let s="",r=document.querySelector("input[type='radio'][name=solution-type]"),l=null===(e=document.getElementById("zip-code"))||void 0===e?void 0:e.value;if(r){let e=null===(t=document.querySelector("input[type='radio'][name=solution-type]:checked"))||void 0===t?void 0:t.value;this.shgSolutionType=e||"Shelf",e=null!=e?e:"both",this.onlineScheduling&&"true"==sessionStorage.getItem("solutionAppointment")?s=`&ShgAppointmentType=${e}`:this.onlineScheduling&&!window.offersClosetAppointments&&(s="&ShgAppointmentType=Shelf")}u.REGEX.sendCaPostalCode.test(l)&&(l=-1==(null==l?void 0:l.indexOf(" "))?null==l?void 0:l.replace(/^(.{3})(.*)$/,"$1 $2"):l);try{const e=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value,t=yield(0,m.getBrandDetailsFromBrandJson)(e),r=null==t?void 0:t.vendorId,a=7*((null==t?void 0:t.calendarMaxWeeksCap)?null==t?void 0:t.calendarMaxWeeksCap:8),u={PostalCode:l,WebLocationId:null!==(n=localStorage.getItem("franchiseWebLocationId"))&&void 0!==n?n:"",DateStart:S().format("MM/DD/YYYY"),IsEstimate:!0,apikey:null!==(i="pneiweb-9pbaOywNKQj853D")?i:"",VendorId:r,ServiceSkuId:null!==c.serviceSkuId&&void 0!==c.serviceSkuId?c.serviceSkuId:"",NumberOfDays:a};let h=(0,m.constructAppointMentApiUrl)(u);s&&(h+=s);let p=window.calendarTypeId;const v={method:"GET",url:h};""==w||s||2==p&&c.serviceSkuId?this.calendarApiRequest(v):(0,d.getChangeZip)()&&((0,d.setChangeZip)(!1),this.calendarApiRequest(v))}catch(e){console.log("Error in setAppointmain calander function",e)}})}setTimeUl(e){const t=document.querySelector(".calendar-row"),o=null==I?void 0:I.filter(t=>S(t.startDate).format("DD MMM, YYYY")==S(e.startDate).format("DD MMM, YYYY")),n=null==o?void 0:o.map((e,t)=>`<li class="calendar-row-item"><button type="button" value="${e.scheduleID}" class="calendar-col btn-time ${0==e.isAvailable?"disable-btn":""} " id="${e.displayText}">${e.displayText}</button></li>`);t&&(t.innerHTML=n.join("")),this.setListnerOnUlBtn(),this.setAppointmentTimeText(o)}setListnerOnUlBtn(){const e=document.querySelectorAll(".calendar-col");
3e.forEach(e=>{var t;return null===(t=e.classList)||void 0===t?void 0:t.remove("active")}),e&&e.length>0&&e.forEach(t=>{t.addEventListener("click",o=>{e.forEach(e=>e.classList.remove("active")),t.classList.toggle("active");const n=document.querySelector(".select-time");if(n&&(n.innerHTML=t.innerHTML),E=t.value,L=t.id,this.isDateTime=!0,this.enableButton(),this.hideErrorMessage(),null==n?void 0:n.innerHTML){const e=null==n?void 0:n.innerHTML;sessionStorage.setItem("time",`${e}`)}})})}timeFormatChanger(e){document.querySelectorAll(".calendar-col.btn-time").forEach(e=>{const t=e.textContent;if(t){let o=t.trim().split(" - ").map(e=>e=(e=e.replace(/^0/,"")).replace("PM","pm").replace("AM","am")),n=o.join(" - ");e.textContent=n}else console.warn("Text content of the element is null.")})}setAppointmentTimeText(e){const t=document.querySelectorAll(".calendar-col.btn-time");this.timeFormatChanger(t),t.forEach(t=>{null==e||e.forEach(e=>{t.innerHTML==e.displayText&&(t.setAttribute("value",e.scheduleID),e.isAvailable||t.setAttribute("disabled",""))})})}setTinySlider(e){try{(0,i.tns)({container:".date-slider",loop:!1,items:7,slideBy:"page",nav:!1,autoplay:!1,speed:400,swipeAngle:!1,autoplayButtonOutput:!1,mouseDrag:!0,lazyload:!0,controlsContainer:"#customize-controls",responsive:{350:{items:5},640:{items:5},768:{items:5},1024:{items:7}}}).goTo(e)}catch(e){}}addListner(){document.querySelectorAll(".dateapp").forEach(e=>{e.addEventListener("click",t=>{document.querySelectorAll(".dateapp").forEach(e=>e.classList.remove("date-details-active")),w=S(e.querySelector(".getDateApp").value).format("ddd DD MMM, YYYY"),L="",E=e.querySelector(".scheduleID").value,this.isDateTime=!1,e.classList.toggle("date-details-active");const o=null==I?void 0:I.find(e=>e.scheduleID==E);document.querySelector(".appointment-section-text").innerHTML=`${S(e.querySelector(".getDateApp").value).format("ddd MMM DD, YYYY")}, <span class="select-time"> Please Select a Time </span>`,this.setTimeUl(o)})})}hideErrorMessage(){const e=document.getElementById("appointment-date-time-error-msg"),t=document.getElementById("link-checkbox-error-msg");e&&e.classList.add("hidden"),t&&t.classList.add("hidden")}validateForm(){const e=document.getElementById("appointment-date-time-error-msg"),t=document.getElementById("link-checkbox-error-msg"),o=document.getElementById("link-checkbox");return!(!(w&&L||(null==o?void 0:o.checked))&&this.onlineSchedulingFlagValidation)||(e&&(e.classList.remove("hidden"),(null==e?void 0:e.innerText)||(e.innerText="Please select a date and time")),t&&(t.classList.remove("hidden"),(null==t?void 0:t.innerText)||(t.innerText="or choose to get a call back.")),!1)}getValueService(){const e=document.querySelector('input[name="service-type"]:checked');if(e){const t=document.querySelector(`label[for="${e.id}"]`);return null==t?void 0:t.textContent}return"Residential"}getVisibleServiceReminderCheckboxChecked(){const e=document.querySelectorAll(".service-reminder-main");if(0===e.length)return!1;for(let t of e)if(!t.classList.contains("hidden")){const e=t.querySelector('input[type="checkbox"]');if(e instanceof HTMLInputElement)return e.checked}return!1}getValues(){var e,t,o,n,i,s,r,l,a,u,m,h,p,v,g,f;return{name:null===(e=document.getElementById("user-full-name"))||void 0===e?void 0:e.value,lastName:null===(t=document.getElementById("user-last-name"))||void 0===t?void 0:t.value,phone:null===(o=document.getElementById("user-phone-number"))||void 0===o?void 0:o.value,email:null===(n=document.getElementById("user-email"))||void 0===n?void 0:n.value,address:null===(i=document.getElementById("user-service-address"))||void 0===i?void 0:i.value,address2:null===(s=document.getElementById("user-address-2"))||void 0===s?void 0:s.value,zip:null===(r=document.getElementById("zip-code"))||void 0===r?void 0:r.value,floorLabel:null===(l=document.querySelector('label[for="select-floor"].label-basic'))||void 0===l?void 0:l.innerText,notes:null===(a=document.getElementById("send-note"))||void 0===a?void 0:a.value,service:c.serviceSelect?c.serviceSelect:null===(u=document.getElementById("select-service"))||void 0===u?void 0:u.value,catService:c.serviceSelectCat?c.serviceSelectCat:null===(m=document.getElementById("select-service-category"))||void 0===m?void 0:m.value,floorService:null!==c.serviceSelectFloors&&void 0!==c.serviceSelectFloors?c.serviceSelectFloors:"",emailCheckbox:null===(h=document.getElementById("default-checkbox"))||void 0===h?void 0:h.value,now:null===(p=document.getElementById("checked-checkbox"))||void 0===p?void 0:p.value,howAboutUsSelect:null===(v=document.getElementById("how-about-us"))||void 0===v?void 0:v.value,isCalanderDIsable:(null===(g=document.getElementById("link-checkbox"))||void 0===g?void 0:g.checked)?null===(f=d
3ocument.getElementById("link-checkbox"))||void 0===f?void 0:f.checked:(0,d.getIsLeadData)(),serviceCheck:this.getVisibleServiceReminderCheckboxChecked()}}capitalizeString(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}handleSubmit(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=!0){e.preventDefault();const o=document.querySelectorAll("#form-section .contact-us-section"),n=Array.from(o).findIndex(e=>e.classList.contains("appointment-details-section"));if(this.validateForm())if(2==n)this.bookingProcess(e,t);else{const e=document.querySelectorAll("#form-section .contact-us-section"),t=document.querySelectorAll(".progressbar .progress-step"),o=document.getElementById("progress"),n=e[1],i=e[2],s=t[1],r=t[2];o.style.width="100%",n.classList.remove("form-step-active"),i.classList.add("form-step-active"),s.classList.remove("progress-step-active"),s.classList.add("progress-step-confirmed"),r.classList.add("progress-step-active")}else(0,a.stopLoader)()})}bookingProcess(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=!0){var o,n,i,s,r,l,y,b,I,S,L;(0,a.startLoader)();const C=null!==(o=sessionStorage.getItem("campaignName"))&&void 0!==o?o:"N/A";window.location.hostname.toLowerCase();let A=(0,p.isTestFcn)();const _=this.getValues(),k=this.geServiceTypetValue();let N,T,B=void 0!==(null==_?void 0:_.catService)?", ServiceCat: "+(null==_?void 0:_.catService):"",P=(null==_?void 0:_.howAboutUsSelect)?((null==_?void 0:_.notes)?",":"")+", Lead Source: "+(null==_?void 0:_.howAboutUsSelect):"";void 0===(null==_?void 0:_.floorLabel)?(N="",T=""):(N=void 0!==(null==_?void 0:_.floorService)?`, ${null==_?void 0:_.floorLabel}:`+(null==_?void 0:_.floorService):"",T=void 0!==(null==_?void 0:_.floorService)?null==_?void 0:_.floorService:"");let j=(null==_?void 0:_.service)?", ServiceType: "+(null==_?void 0:_.service):"",D=void 0!==k?(P&&_.notes?", ":"")+"Service: "+k:"";2==(null===window||void 0===window?void 0:window.calendarTypeId)&&c.serviceSkuId&&c.serviceSkuId;sessionStorage.setItem("serviceType",k),(null==_?void 0:_.notes)&&sessionStorage.setItem("os_note",null==_?void 0:_.notes),sessionStorage.setItem("floorService",null==_?void 0:_.floorService),sessionStorage.setItem("floorLabel",null==_?void 0:_.floorLabel);let M=sessionStorage.getItem("manualCity"),q=sessionStorage.getItem("manualState"),R=M||"",O=q||"";const x=null===(n=_.zip)||void 0===n?void 0:n.toUpperCase();document.getElementById("brandName");let F=_.address,$=sessionStorage.getItem("suggestion");const H=sessionStorage.getItem("suggestedAddress");H&&"true"==$&&(R=JSON.parse(H).city,O=JSON.parse(H).stateCode,F=JSON.parse(H).addr1);sessionStorage.getItem("manualAddress");const z=null===(i=document.getElementById("conceptId"))||void 0===i?void 0:i.value,W=null===(s=document.getElementById("conceptCode"))||void 0===s?void 0:s.value,U=window.location.origin;let G,V;const J=yield(0,m.getBrandDetailsFromBrandJson)(W);J&&(G=J.vendorId,V=J.vendorName);const Y=this.getCheckedCheckboxes();let K=Y?`, Preferred method of communication: ${Y}`:"",X=this.getCheckedPreferedComunnication();X||(X="Email,Phone"),(null==J?void 0:J.enable_line_break_bpro)&&(K&&(K=`<br>${K}`),P&&(P=`<br>${P}`),D&&(D=`<br>${D}`),B&&(B=`<br>${B}`),j&&(j=`<br>${j}`),N&&(N=`<br>${N}`));const Z=null!==(r=_.lastName)&&void 0!==r?r:"",Q=J.enable_emailOptOut,ee=J.default_leadSourceID||0;let te={isLocalized:!0,firstName:_.name.split(" ")[0]?_.name.split(" ")[0]:"",lastName:(null===(l=_.name)||void 0===l?void 0:l.split(" ")[1])?null===(y=_.name)||void 0===y?void 0:y.split(" ")[1]:" ",zipCode:x.trim(),postalCode:x.trim(),email:_.email,hasSameDayScheduling:!(null===(b=(0,d.getFullData)())||void 0===b?void 0:b.options.hasSameDayScheduling)||(null===(I=(0,d.getFullData)())||void 0===I?void 0:I.options.hasSameDayScheduling),state:O,city:R,phone:_.phone,address:F,address2:null!==(S=null==_?void 0:_.address2)&&void 0!==S?S:"",comments:"",preferredCommunicationType:X,note:[null==_?void 0:_.notes,P,D,B,j,N,K].filter(e=>null!=e&&""!==e).join(" ")||"",signUpForUpdates:!1,conceptId:Number(z),currentPage:U,leadSource:"WEB",leadOrigin:"WEB",phoneType:"",isLeadOnly:_.isCalanderDIsable,scheduleID:_.isCalanderDIsable?"":E||"",campaignName:C,callType:"WEB",conceptCalledId:Number(z),serviceType:null==_?void 0:_.service,fee:c.inspectionFeeObj?Number(null===c.inspectionFeeObj||void 0===c.inspectionFeeObj?void 0:c.inspectionFeeObj.fee):0,emailOptOut:Q,vendorId:Number(G),isTest:A,conceptCode:W,vendorName:V,fileUrls:[{}],customerType:null!=k?k:"Residential",leadSourceId:ee,webLocationId:0};this.shgSolutionType&&(te.serviceType=this.shgSolutionType),""!==T&&(te.floor=T),Z&&(te.lastName=Z,te.firstName=null!==(L=_.name)&&void 0!==L?L:""),E&&(te.timeBlock={conceptId:Number(z),googleCalendarEventId:"",googleCalendarEmail:"",timeSlotTypeId:0,serviceSkuId:0,jobPromisedDate:w?`${w}`:"",isAvailable:!!E,isFranchiseInPOS:!0,displayText:""}),localStorage.getItem("franchiseWebLocationId")&&(te.webLocationId=Number(localStorage.getItem("franchiseWebLocationId")),te.franchiseId=Number(sessionStorage.getItem("franchiseId")));const oe=document.getElementById("how-about-us"),ne=null==oe?void 0:oe.options[oe.selectedIndex],ie=null==ne?void 0:ne.getAttribute("data-sync-generic-lead-source-id");if((null==J?void 0:J.send_leadsource_id)&&ie&&(te.leadSourceId=Number(ie)),"dvw"===(null==W?void 0:W.toLocaleLowerCase())){const e=document.getElementById("how-about-us"),t=null==e?void 0:e.options[e.selectedIndex],o=null==t?void 0:t.getAttribute("data-referral-type-id"),n=t.value;o&&(te.referralTypeId=o),n&&(te.referralType=n),te.preferredCommunicationType||(te.preferredCommunicationType="Email,Phone")}2==window.calendarTypeId&&c.serviceSkuId&&(te.serviceSkuId=Number(c.serviceSkuId)),te.note&&this.sentCommentAndNote&&(te.comments=te.note);const se=document.querySelectorAll("#form-section .contact-us-section")[0].closest('[id*="form"]'),re=(0,g.DomainIdentifier)(),le=(0,f.LocalizationIdentifier)();let ae="";
3const de=u.REGEX.sendCaPostalCode.test(null==x?void 0:x.trim())?"ca":"us";if(ae=("us"===re&&!le||"us"===re&&"us"==le)&&"us"===de?"lead-flow-service-reminder-us":"lead-flow-service-reminder-ca",se){const e=(0,v.disclaimerHandleCheck)(false,se,te,x,ae);(null==e?void 0:e.comments)&&(te.comments=e.comments),(null==e?void 0:e.note)&&(te.note=e.note),te.optIn=e.optIn,te.emailOptOut=e.emailOptOut}(0,h.handleMissingData)(R,O,x).then(e=>{te.city=null==e?void 0:e.city,te.state=null==e?void 0:e.state,this.callBookingAPI(te)})})}callBookingAPI(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;let o,n;const i=(0,y.getSessionAndCorrelationID)();o=i.sessionID,n=i.correlationID,n&&(e.correlationId=n);const s=Object.assign({},e),l=this.getValues();s.serviceCat=null!==(t=null==l?void 0:l.catService)&&void 0!==t?t:"",sessionStorage.setItem("booking",JSON.stringify(s));let d="";d=n&&o?`${r.apiConfig.BOOKING_API_URL}&correlationId=${n}&sessionId=${o}`:r.apiConfig.BOOKING_API_URL,yield(0,b.bookingUsPostCallWrapper)(d,e).then(t=>{(0,a.stopLoader)(),(0,m.storeBookingApiPayload)(e,t),window.history.replaceState({},"","/confirmation"),window.location.href="/confirmation",sessionStorage.removeItem("campaignName")}).catch(e=>{(0,a.stopLoader)(),this.throwBookingError()})})}throwBookingError(){const e=document.getElementById("error-modal-id");null==e||e.click();const t=document.getElementById("modal-appoinment-slot"),o=document.getElementById("error-modal");null==o||o.classList.remove("hidden"),null==t||t.classList.remove("hidden")}handleDisableApp(){const e=document.querySelector(".calendar-container"),t=(0,m.removeAllEventListeners)("#link-checkbox");t&&t.addEventListener("click",this.handleDisableApp.bind(this)),e&&t.checked?(e.classList.add("disable-calendar"),sessionStorage.setItem("onlineSchedule","false")):e&&!t.checked&&(e.classList.remove("disable-calendar"),sessionStorage.setItem("onlineSchedule","true"));const o=document.querySelector(".callback-wrapper");null==o||o.classList.toggle("callback-requested"),this.enableDisableCalendarBtn(),this.hideErrorMessage()}geServiceTypetValue(){const e=document.querySelector('input[name="service-type"]:checked');if(e){const t=document.querySelector(`label[for="${e.id}"]`);return null==t?void 0:t.textContent}}enableButton(){const e=document.querySelector(".appointment-details-section .btn-container .primary-btn");e&&(e.disabled=!1,e.style.opacity="1")}disableButton(){const e=document.querySelector(".appointment-details-section .btn-container .primary-btn");e&&(e.disabled=!0,e.style.opacity="0.3")}enableDisableCalendarBtn(){const e=document.getElementsByClassName("calendar-col active"),t=document.getElementById("link-checkbox");0!=(null==e?void 0:e.length)?this.enableButton():(null==t?void 0:t.checked)&&(this.onlineScheduling=!1,sessionStorage.setItem("onlineSchedule",this.onlineScheduling.toString()),this.enableButton())}calendarApiRequest(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i;(0,a.startLoader)();try{const i=yield(0,s.getCachedAPIResponse)(e.url,l.apiCaching.TechAvailability),r=document.getElementsByClassName("calendar-container"),c=!(null===(t=(0,d.getFullData)())||void 0===t?void 0:t.options.hasSameDayScheduling)||(null===(o=(0,d.getFullData)())||void 0===o?void 0:o.options.hasSameDayScheduling);I=null==i?void 0:i.resultCollection;let u=I.findIndex(e=>e.isAvailable);const m=document.querySelector(".appointment-details-section .btn-container .primary-btn");if(-1===u){const e=document.getElementById("link-checkbox");r&&r.length>0&&(r[0].style.display="none");const t=document.getElementsByClassName("appointment-heading"),o=null===(n=document.getElementById("modal-appoinment-slot"))||void 0===n?void 0:n.innerHTML;return t&&t.length>0&&(t[0].innerHTML=o||""),this.enableButton(),void(e?e.checked=!0:m&&m.classList.add("hidden"))}m&&m.classList.remove("hidden"),r[0].style.display="flex";const h=this.removeDuplicateDates(I,c);w=null==I?void 0:I.find(e=>e.isAvailable).startDate,u=h.findIndex(e=>S(e.startDate).format("ddd DD MMM, YYYY")==S(w).format("ddd DD MMM, YYYY"));
3const p=this.setCard(h);this.buttonName=document.querySelectorAll(".date-details-item .dateapp"),L="";const v=null==I?void 0:I.find(e=>e.isAvailable);this.setTimeUl(v),E=null==v?void 0:v.scheduleID,document.querySelector(".appointment-section-text").innerHTML=`${S(w).format("ddd MMM DD, YYYY")}, <span class="select-time"> Please Select a Time </span>`;let g=document.querySelector(".date-slider")||document.querySelector(".date-details-list");g.innerHTML="",g&&(g.innerHTML=p.join("")),setTimeout(()=>{this.addListner(),this.setTinySlider.call(this,u)},500),setTimeout(()=>(0,a.stopLoader)(),1e3)}catch(e){(0,a.stopLoader)();const t=document.getElementById("link-checkbox"),o=document.getElementsByClassName("calendar-container");o&&o.length>0&&(o[0].style.display="none");const n=document.getElementsByClassName("appointment-heading"),s=null===(i=document.getElementById("modal-appoinment-slot"))||void 0===i?void 0:i.innerHTML;if(n&&n.length>0&&(n[0].innerHTML=s||""),this.enableButton(),t)t.checked=!0;else{const e=document.querySelector(".appointment-details-section .btn-container .primary-btn");e&&e.classList.add("hidden")}return}})}removeAllEventListeners(e){const t=document.querySelector(e);if(t){const e=t.cloneNode(!0);return t.parentNode.replaceChild(e,t),e}return null}}C.instance=null},"./src/js/opus2/lead-flow/step4.ts"(e,t,o){"use strict";var n=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),i=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),s=o(/*! ../util/setDateAndTime */"./src/js/opus2/util/setDateAndTime.ts");let r=[];new class{constructor(){if(this.toggleInspectionFeeSection(),sessionStorage.getItem("booking")){const e=sessionStorage.getItem("booking"),t=JSON.parse(e),o=null==t?void 0:t.FileUrls;(null==o?void 0:o.some(e=>""!=e.FileUrl))?this.getImagesFromApi():this.setData(),this.authorableConfirmationTitle()}const e=document.querySelector(".confirmation-section .primary-outline-btn");e&&e.addEventListener("click",()=>{window.location.href="/"})}toggleInspectionFeeSection(){if("false"===sessionStorage.getItem("hideInspectionFee")){const e=document.querySelector(".confirmation-main .fee-wrapper");e&&(e.style.display="none")}}authorableConfirmationTitle(){const e=sessionStorage.getItem("onlineSchedule"),t=document.getElementById("appointment_title"),o=document.getElementById("leadflow_title");"true"===e&&t?(t.classList.remove("hidden"),o&&!o.classList.contains("hidden")&&o.classList.add("hidden")):"false"===e&&o&&(o.classList.remove("hidden"),t&&!t.classList.contains("hidden")&&t.classList.add("hidden"))}getImagesFromApi(){var e=new Headers;e.append("apikey","dneiweb-oZlRRNnlSLCWP37"),e.append("Content-Type","application/json");const t=sessionStorage.getItem("booking"),o=JSON.parse(t),i={method:"POST",url:"https://api.neighborly.com/digitalorchestrations-api/v1/public/onlineschedulerfiledownload/getpresignedurl?apikey=pneiweb-9pbaOywNKQj853D",data:(null==o?void 0:o.FileUrls).filter(e=>""!=e.FileUrl).map(e=>e.FileUrl)};(0,n.default)(i).then(e=>{for(let t in null==e?void 0:e.presignedURLToDownload)r.push(null==e?void 0:e.presignedURLToDownload[t]);this.setData()}).catch(e=>{})}setData(){var e,t,o,n,l,a,d,c,u;const m=sessionStorage.getItem("booking");if(!m)return;const h=JSON.parse(m),p=document.querySelector(".appointment-details"),v=(null==h?void 0:h.serviceCat)?" ServiceCat : "+(null==h?void 0:h.serviceCat):"",g=(null==h?void 0:h.serviceType)?null==h?void 0:h.serviceType:"",f=(null==h?void 0:h.customerType)?" Service : "+(null==h?void 0:h.customerType):"";sessionStorage.getItem("stateCode"),sessionStorage.getItem("countryName");sessionStorage.getItem("suggestion");let y,b=(0,i.getAddressConfirmation)(JSON.parse(m));y=b.line1&&b.line2?`${b.line1} ${b.line2}`:b.line1?`${b.line1}`:b.line2?`${b.line2}`:"";const I=sessionStorage.getItem("serviceType"),S=null!==(t=null!==(e=null==h?void 0:h.LastName)&&void 0!==e?e:null==h?void 0:h.lastName)&&void 0!==t?t:"",w=`<div class="appointment-wrap">\n <p class="appointment-heading">Contact Information</p>\n <span class="appointment-text">${null!==(n=null!==(o=null==h?void 0:h.FirstName)&&void 0!==o?o:null==h?void 0:h.firstName)&&void 0!==n?n:""} ${S}</span>
3\n <span class="appointment-text">${null!==(a=null!==(l=h.Phone)&&void 0!==l?l:h.phone)&&void 0!==a?a:""}</span>\n <span class="appointment-text">${null!==(c=null!==(d=h.Email)&&void 0!==d?d:h.email)&&void 0!==c?c:""}</span>\n </div>`;null==p||p.insertAdjacentHTML("beforeend",w);const L=`<div class="appointment-wrap">\n <p class="appointment-heading">Service Address</p>\n <span class="appointment-text">${y}</span>\n </div>`;(null==h?void 0:h.isContact)||null==p||p.insertAdjacentHTML("beforeend",L);const E=null===(u=h.timeBlock)||void 0===u?void 0:u.jobPromisedDate;let C,A;if(E){const e={weekday:"short",day:"2-digit",month:"short",year:"numeric"};C=new Date(E).toLocaleDateString("en-US",e),A=sessionStorage.getItem("time")}if(h.scheduleID&&C&&!h.isLeadOnly){const e=`<div class="appointment-wrap">\n <p class="appointment-heading">Date and Time of Service </p>\n <span class="appointment-text">${(0,s.reformatDate)(C)} ${A}</span>\n </div>`;null==p||p.insertAdjacentHTML("beforeend",e)}else{const e=document.getElementById("request-appointment"),t=document.getElementById("request-call");e&&(e.style.display="none"),null==t||t.removeAttribute("style")}if(I){const e=`<div class="appointment-wrap">\n <p class="appointment-heading">Service Request</p>\n <span class="appointment-text">${I||"N/A"}</span>\n </div>`;"undefined"===I||h.isContact||null==p||p.insertAdjacentHTML("beforeend",e)}const _=sessionStorage.getItem("os_note"),k=[];_&&k.push(_),f&&k.push(f),v&&k.push(v);const N=k.join(", "),T=`<div class="appointment-wrap">\n <p class="appointment-heading">Service Description</p>\n <span class="appointment-text">${N}</span>\n </div>`;N&&(null==p||p.insertAdjacentHTML("beforeend",T));const B=sessionStorage.getItem("solution_needs_label");if(B){const e=`<div class="appointment-wrap">\n <p class="appointment-heading">${B}</p>\n <span class="appointment-text">${g||""}</span>\n </div>`;null==p||p.insertAdjacentHTML("beforeend",e)}const P=sessionStorage.getItem("floorService"),j=sessionStorage.getItem("floorLabel");if(P&&j){const e=`<div class="appointment-wrap">\n <p class="appointment-heading">${j}</p>\n <span class="appointment-text"> ${P}</span>\n </div>`;null==p||p.insertAdjacentHTML("beforeend",e)}const D=document.querySelector(".confirmation-section .inspection-fee");D&&(null==h?void 0:h.fee)&&(D.innerHTML=`<strong>$${null==h?void 0:h.fee}</strong>`);const M=null==h?void 0:h.FileUrls,q=null==M?void 0:M.some(e=>""!=e.FileUrl),R=` <div class="appointment-wrap">\n <p class="appointment-heading">Uploaded Images</p>\n <div class="uploaded-images">\n ${r.map(e=>`<img src="${e}" alt="map" width="88" height="88">`).join("")} \n </div>\n </div>`;q&&(null==p||p.insertAdjacentHTML("beforeend",R))}}},"./src/js/opus2/location-search-map/config.ts"(e,t,o){"use strict";o.d(t,{brandColorCode:()=>r,locationSearchMapConfig:()=>s,nearbyLocationsExists:()=>l});var n=o(/*! ./getConceptCode */"./src/js/opus2/location-search-map/getConceptCode.ts"),i=o(/*! ./getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts");const s={initView:{lat:"us"===(0,i.getCountryCode)()?"43":"50",lng:"us"===(0,i.getCountryCode)()?"-99":"-100",zoom:"4",mobileZoom:"2.2"},franchiseWebLocationsApiCall:`https://api.neighborly.com/digitalorchestrations-api/v1/public/concepts/${(0,n.getConceptCode)()}/franchiseweblocations`,apiKey:"1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk",geoCodeSearchApiUrl:"https://geocode.search.hereapi.com/v1/geocode",revGeoCodeSearchApiUrl:"https://geocode.search.hereapi.com/v1/revgeocode",fullAttributeApiUrl:"https://api.neighborly.com/digitalorchestrations-api/v1/public/fullattribute/franchiseWeblocations/search",nblyApiKey:"pneiweb-9pbaOywNKQj853D",mobileViewWidth:992,desktopMapContainerCol:"map-wrapper-mobile",mobileMapContainerCol:"map-wrapper"},r={MRE:"#006AC6",RBW:"#18487F",WDG:"#500878",DVW:"#463C96",SHG:"#005489",HMS:"#009578",LAP:"#C93F01",JUK:"#ED1C24",PDS:"#00523D",MOJ:"#43B02A",MDG:"#0B408F",MLY:"#071D49",MRR:"#003DA6",GUY:"#4A7729",MRA:"#F4633A",FSA:"#FF6900",ASV:"#0033a0",FSP:"#003057",PLG:"#eb0045",PLG2C:"#eb0045",MRH:"#b52126",MHM:"#b52126",HMC:"#b52126",NEI:"#407EC9"},l=()=>{var e;const t=JSON.parse(null!==(e=sessionStorage.getItem("nearbyLocations"))&&void 0!==e?e:"null");return!!(null==t?void 0:t.containingData)}}
3,"./src/js/opus2/location-search-map/getConceptCode.ts"(e,t,o){"use strict";o.d(t,{getConceptCode:()=>n});const n=()=>{var e;return(null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value)||"MRE"}},"./src/js/opus2/location-search-map/getCountryCode.ts"(e,t,o){"use strict";o.r(t),o.d(t,{getCountryCode:()=>n});const n=()=>{var e;return null===(e=document.getElementById("countryCode"))||void 0===e?void 0:e.value}},"./src/js/opus2/location-search-map/models/ScreenType.ts"(e,t,o){"use strict";var n;o.d(t,{ScreenType:()=>n}),function(e){e[e.Desktop=0]="Desktop",e[e.SmallDesktop=1]="SmallDesktop",e[e.Mobile=2]="Mobile"}(n||(n={}))},"./src/js/opus2/location-search-map/reportScreenSize.ts"(e,t,o){"use strict";o.d(t,{reportScreenSize:()=>s});var n=o(/*! ./config */"./src/js/opus2/location-search-map/config.ts"),i=o(/*! ./models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts");const s=()=>window.innerWidth>=n.locationSearchMapConfig.mobileViewWidth?i.ScreenType.Desktop:i.ScreenType.Mobile},"./src/js/opus2/map/areaWeServe.ts"(e,t,o){"use strict";o.d(t,{AreaWeServe:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../util/hours_operation */"./src/js/opus2/util/hours_operation.ts"),l=o(/*! ../util/share */"./src/js/opus2/util/share.ts");const a=o(/*! terraformer-wkt-parser */"./node_modules/terraformer-wkt-parser/terraformer-wkt-parser.js");class d{static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return d.instance||(d.instance=new d,yield d.instance.initialize()),d.instance})}static getInstance(){var e;return null!==(e=d.instance)&&void 0!==e||(d.instance=new d),d.instance}constructor(){var e;this.wkts=[],this.mapType="",this.centroid="",this.correlationId="",this.counter=!1,this.initialized=!1;const t=sessionStorage.getItem("corelationID"),o=sessionStorage.getItem("sessionID");this.correlationId=`correlationId=${t}&sessionId=${o}`;const n=localStorage.getItem("franchiseWebLocationId"),i=document.getElementById("weblocationId");this.franchiseWebLocationId=(null==i?void 0:i.value)?null==i?void 0:i.value:n,this.zoom_Level=Number(null===(e=document.getElementById("map-zoom-level"))||void 0===e?void 0:e.value),this.areaContainer=document.querySelector(".area-serve-container"),this.mapContainer=document.querySelector(".map-img-box"),this.counter=!1,this.areaContainer&&this.loadCities(),this.franchiseWebLocationId&&this.getCityData()}initialize(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;if(this.initialized)return;const o=null===(e=this.areaContainer)||void 0===e?void 0:e.querySelector(".serve-hours"),n=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;let i;n&&(i=yield(0,l.getBrandDetailsFromBrandJson)(n)),o&&!(null==i?void 0:i.enable_area_we_serve_fte)&&this.init(),this.areaContainer&&(yield this.getWellKnownText()),this.initialized=!0})}init(){(0,r.toggleHoursOfOperation)(".area-serve-text-section .serve-hours",".area-serve-text-section .serve-hours-list",".serve-hours-list li")}loadCities(){const e=document.querySelector(".city-list"),t=document.getElementById("readMoreListButton");if(window.innerWidth<1024&&e){const o=Array.from(e.children),n=20;if(t&&o.length>n){for(let e=n;e<o.length;e++)o[e].style.display="none";t.classList.remove("hidden"),t.style.display="",t.addEventListener("click",function(){if("Read more..."===t.textContent){for(let e=n;e<o.length;e++)o[e].style.display="list-item";t.textContent="Read less..."}else{for(let e=n;e<o.length;e++)o[e].style.display="none";t.textContent="Read more..."}})}else t.classList.add("hidden"),t.style.display="none"}}multipleWkts(){this.wkts.forEach(e=>{"polygon"===this.mapType?this.initGMapPolygon():this.initGMap(e)})}initGMapPolygon(){let e,t,o,n,i;const s=e=>{const s=/\(([^()]+)\)/g,r=[];let l;for(;l=s.exec(e);)r.push(l[1]);const a=[];let d=0,c=0;for(let e=0;e<r.length;e++)d<=r[e].length&&(d=r[e].length,c=e);((e,s)=>{const r=s.split(",");let l="";for(let s=0;s<r.length;s++){const a=r[s].trim().split(" "),d=new google.maps.LatLng(Number.parseFloat(a[1]),Number.parseFloat(a[0]));l=l+", "+a[1]+" "+a[0],e.push(d),0===s?(t=n=Number.parseFloat(a[1]),o=i=Number.parseFloat(a[0])):(t=Math.min(Number.parseFloat(a[1]),t),o=Math.min(Number.parseFloat(a[0]),o),n=Math.max(Number.parseFloat(a[1]),n),i=Math.max(Number.parseFloat(a[0]),i)
3)}})(a,r[c]);return new google.maps.Polygon({paths:a,strokeColor:"#FF0000",strokeOpacity:.8,strokeWeight:2,fillColor:"#1E90FF",fillOpacity:.35})};this.wkts.forEach(r=>{const l=s(r);navigator.geolocation.getCurrentPosition(t=>{const o=this.zoom_Level?this.zoom_Level:8.8,n={zoom:o,center:new google.maps.LatLng(37.7749,-122.4194),zoomControl:!0,scaleControl:!0};e=new google.maps.Map(this.mapContainer,n);const i=new google.maps.LatLngBounds;l.getPath().forEach(e=>{i.extend(e)}),e.fitBounds(i);let s=google.maps.event.addListener(e,"idle",function(){e.setZoom(o),google.maps.event.removeListener(s)});l.setMap(e)},s=>{const r=(n+t)/2,a=(i+o)/2,d=this.zoom_Level?this.zoom_Level:8.8,c={zoom:d,center:new google.maps.LatLng(r,a),zoomControl:!0,scaleControl:!0};e=new google.maps.Map(this.mapContainer,c);const u=new google.maps.LatLngBounds;l.getPath().forEach(e=>{u.extend(e)}),e.fitBounds(u);let m=google.maps.event.addListener(e,"idle",function(){e.setZoom(d),google.maps.event.removeListener(m)});l.setMap(e)})})}getCityData(){const e=s.apiConfig.fullAttribute+this.franchiseWebLocationId,t=(e,t)=>{e&&(e.textContent=t)};(0,i.cachedAPIWrapper)(e).then(e=>{const o=localStorage.getItem("brandDetails");if(o){((e,o)=>{const{address:n,address2:i,state:s,country:r,city:l,zip:a,displayAddressSwitch:d}=e,c=document.getElementById("show-address");if(!o.disable_location_address&&c){const e=document.querySelector(".area-serve-title");e&&(e.innerHTML+='<p class="title-sub-text"></p>');const o=document.querySelector(".area-serve-title .title-sub-text");t(o,d?`${n}${i?", "+i:""} ${l}, ${s} ${a}, ${r}`:`${l}, ${s} ${a}, ${r}`)}})(e,JSON.parse(o))}(e=>{const{locationDoingBusinessAs:o}=e,n=document.querySelector(".area-serve-title .title-heading");!(null==n?void 0:n.textContent)&&o&&t(n,o)})(e)}).catch(e=>{console.error(e)})}getWellKnownText(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(yield(0,l.loadHereMapScripts)(),!this.counter&&this.franchiseWebLocationId)try{let e;if(!0)e=`${s.apiConfig.FranchiseTerritoriesAPI}&franchiseWeblocationId=${this.franchiseWebLocationId}`;else{const t=yield(0,i.cachedAPIWrapper)(s.apiConfig.WebLocationsAPI);if(!t)return;if(this.franchiseId=yield this.findFranchiseIdByWebLocationId(t,this.franchiseWebLocationId),!this.franchiseId||null===this.franchiseId)return void setTimeout(()=>{this.getWellKnownText(),this.counter=!0},1e3);e=`${s.apiConfig.FranchiseTerritoriesAPI}&franchiseId=${this.franchiseId}`}(0,i.getCachedAPIResponse)(e).then(e=>{var t;let o;if(e.franchiseTerritories.forEach(e=>{e.franchiseWebLocationId===Number(this.franchiseWebLocationId)&&e.comment.includes("website")&&(o=e)}),null===(t=null==o?void 0:o.territoryBoundary)||void 0===t?void 0:t.wellKnownText){const e=o.territoryBoundary.wellKnownText;this.wkts.push(e),this.mapType=e.split(" ")[0].toLowerCase(),this.centroid=o.territoryBoundary.centroid,this.multipleWkts()}else console.log("No map data available")}).catch(e=>{console.log("Error:",e)})}catch(e){console.log("Fetch error:",e)}})}findFranchiseIdByWebLocationId(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o;if(!(null==e?void 0:e.length))return null;try{const n=localStorage.getItem("fullAttrOnLoad"),i=n?null===(o=JSON.parse(n))||void 0===o?void 0:o.contractNumber:null;return i?this.findFranchiseIdWithContractNumber(e,t,i):yield this.fetchAndStoreFullAttr(t,e)}catch(e){return console.error("Error finding franchise ID:",e),null}})}fetchAndStoreFullAttr(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o=yield(0,i.cachedAPIWrapper)(`${s.apiConfig.GET_ATTRIBUTE_DATA}/${e}`);return localStorage.setItem("fullAttrOnLoad",JSON.stringify(o)),(null==o?void 0:o.contractNumber)?this.findFranchiseIdWithContractNumber(t,e,o.contractNumber):this.findFranchiseIdWithoutContractNumber(t,e)}catch(e){return console.warn("Error fetching full attribute data:",e),null}})}findFranchiseIdWithoutContractNumber(e,t){for(const o of e){const e=o.franchiseDetails;for(const n of e)if(n.franchiseWebLocationId==t)return o.franchiseId}return null}findFranchiseIdWithContractNumber(e,t,o){for(const n of e){const e=n.franchiseDetails;for(const i of e)if(i.franchiseWebLocationId==t&&i.licenseNumber===o)return n.franchiseId}return null}initGMap(e){let t=a.parse(e),o=this.centroid.replace("POINT (","").replace(")","").split(" "),n={type:"FeatureCollection",features:[{type:"Feature",properties:{fillColor:"#1E90FF"},geometry:t}]},i={center:{lat:Number.parseFloat(o[1]),lng:Number.parseFloat(o[0])},zoom:this.zoom_Level?this.zoom_Level:8.8,zoomControl:!0,scaleControl:!0},s=new google.maps.Map(this.mapContainer,i);s.data.addGeoJson(n),s.data.setStyle(function(e){return{fillColor:"#1E90FF",strokeColor:"#FF0000",strokeOpacity:.8,strokeWeight:2,fillOpacity:.35}})}}},"./src/js/opus2/mly/booking-payload.ts"(e,t,o){"use strict";o.d(t,{bookingPayload:()=>n,isTestFcn:()=>i});const n={franchiseId:0,hasSameDayScheduling:!0,isBetaTester:!1,comments:"",isLocalized:!0,conceptId:1,useFranchiseProfileOptInForPOSScheduling:!0,isFranchiseOptedIntoPOSScheduling:!0,c4ChannelTypeId:0,conceptCalledId:1,conceptName:"Molly Maid",conceptCode:"MLY",c4LeadsEnabled:!0,canceledJobInformation:"",vendorId:70,nationalLeadId:"",isTest:!1,vendorName:"Molly Maid Website",webLocationId:0,c4CallCenterId:0,dayTimePhoneNumber:"",zipCode:"",note:"",optIn:!1,firstName:"",lastName:"",email:"",ph
3one:"",phoneType:"",postalCode:"",city:"",state:"",country:"",address:"",address2:"",leadSource:"Web",licenseNumber:"",webLocationAccountCode:"",leadOrigin:"Web",campaignName:"N/A",referringURL:"",currentPage:window.location.origin,disposition:"",callType:"In Bound",preferredCommunicationType:"",emailOptOut:!1,tagName:"",latitude:0,longitude:0,locationType:"",isGoogleAddress:!0,googleCalendarEventId:"",googleCalendarEmail:"",serviceText:"Lead Only",serviceId:0,warranty:!1,timeSlotTypeId:0,makeId:0,leadSourceId:0,secondaryLeadSourceId:0,serviceTypeID:0,businessName:"",serviceTypeProblem:"",overrideJobPromisedDate:"",serviceSkuId:0,isEstimate:!1,estimateHouseStyle:"",estimateSquareFeet:"",estimateBedrooms:"",estimateBathrooms:"",estimatePets:"",ccFirstName:"",ccLastName:"",ccType:"",ccSuffix:"",ccToken:"",ccExpirationDate:"",ccComment:"",isLeadOnly:!1,overrideCSRName:"",overrideComment:"",syncTenantName:"",isEmergencyCall:!1,callId:"",isFranchiseInPOS:!0,customerType:"",neighborlyAccountId:0,neighborlyLeadSourceId:0,fileUrls:[{fileUrl:""}],jobFrequency:"",jobFrequencyDetail:"",year:0,make:"",model:"",bodyStyle:"",vin:"",licensePlateNumber:"",windshieldRepair:"",headlightRestoration:"",serviceRequested:[""],leadAdditionalNotes:{leadAdditionalNoteLabel:"Website",leadAdditionalNoteText:""},formOfPayment:"",insuranceCompany:"",deductibleAmount:0,policyNumber:"",scheduleID:"",signUpForUpdates:!1,referralType:"",referralTypeId:""};function i(){const e=window.location.hostname.toLowerCase();let t;return t=!!(e.includes("nblysbx")||e.includes("nblydev")||e.includes("nblytest")),t}},"./src/js/opus2/mly/callBookingApi.ts"(e,t,o){"use strict";o.d(t,{calcEstFail:()=>R,calcEstimate:()=>q,callBookingApi:()=>k,checkTechAvailability:()=>P,configureMollyEstimate:()=>j,confirmMlyLeadSourceAPI:()=>D,contactUsEndpoint:()=>O,determineFlowType:()=>T,getFranchiseDetails:()=>N,getRegularEstimate:()=>C,getWeekendEstimate:()=>E,payloadHelper:()=>_,setDefaultLeadSource:()=>M});var n,i,s=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),r=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),l=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),a=o(/*! ../apiCaching/POST-Requests/apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"),d=o(/*! ../apiCaching/POST-Requests/apiContactCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"),c=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),u=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),m=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts"),h=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),p=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),v=o(/*! ./booking-payload */"./src/js/opus2/mly/booking-payload.ts"),g=o(/*! ./confirmation */"./src/js/opus2/mly/confirmation.ts"),f=o(/*! ./molly-flow */"./src/js/opus2/mly/molly-flow.ts"),y=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),b=o(/*! ../util/createModal */"./src/js/opus2/util/createModal.ts"),I=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts");let S=o(/*! moment */"./node_modules/moment/moment.js");const w=null===(n=document.getElementById("conceptCode"))||void 0===n?void 0:n.value,L=null===(i=document.getElementById("conceptId"))||void 0===i?void 0:i.value;function E(e,t){let o,n;return t?(o=Math.round(null==e?void 0:e.estimateMoveRangeLowSaturday),n=Math.round(null==e?void 0:e.estimateMoveRangeHighSaturday)):(o=Math.round(null==e?void 0:e.estimateOccasionalRangeLowSaturday),n=Math.round(null==e?void 0:e.estimateOccasionalRangeHighSaturday)),{low:o||0,high:n||0}}function C(e,t){let o,n;return t?(o=Math.round(null==e?void 0:e.estimateMoveRangeLow),n=Math.round(null==e?void 0:e.estimateMoveRangeHigh)):(o=Math.round(null==e?void 0:e.estimateOccasionalRangeLow),n=Math.round(null==e?void 0:e.estimateOccasionalRangeHigh)),{low:o||0,high:n||0}}function A(e){var t;const o=(null===(t=e.customerType)||void 0===t?void 0:t.toLowerCase().includes("residential"))&&!e.jobFrequency.toLowerCase().includes("recurring")&&(0,g.validEstimate)(),n=function(){const e=sessionStorage.getItem("PriceNote");return(null==e?void 0:e.includes("No Calendar Pricing"))?"No Calendar Pricing":""}();if(o){const t=JSON.parse(sessionStorage.getItem("mollyEstimate")),o=e.jobFrequencyDetail.toLowerCase().includes("not a move in or move out clean"),i=sessionStorage.getItem("selectedDay");let s;if(s="Saturday"===i||"Sunday"===i?E(t,!o):C(t,!o),s.low>0&&s.high>
30){const e=`Price: $${s.low} - $${s.high} ${n}`;sessionStorage.setItem("PriceNote",e)}}}function _(e){var t,o,n,i;e.note="";const s=sessionStorage.getItem("PriceNote"),r=sessionStorage.getItem("noZipNote");let l="";const a=(null===(t=e.customerType)||void 0===t?void 0:t.toLowerCase().includes("residential"))&&!(null===(o=e.jobFrequency)||void 0===o?void 0:o.toLowerCase().includes("recurring"));if(s&&a&&(l=l.concat(s+", ")),r&&(l=l.concat(r+", ")),l=l.concat(`Customer Type: ${e.customerType}, MLY Frequency: ${e.jobFrequency}`),(null===(n=null==e?void 0:e.jobFrequency)||void 0===n?void 0:n.toLowerCase().includes("one-time"))&&(l=l.concat(`, ${e.jobFrequencyDetail}`)),e.estimateSquareFeet&&e.estimateBathrooms){const t=e.estimateSquareFeet,o=e.estimateBedrooms,n=e.estimateBathrooms,s=(null===(i=e.customerType)||void 0===i?void 0:i.toLowerCase().includes("residential"))?"Bedrooms":"Offices";l=l.concat(`, Square Feet: {${t}}, ${s}: {${o}} , Bathrooms: {${n}}`)}const d=sessionStorage.getItem("PreferredCommunicationText");(null==d?void 0:d.toLowerCase().includes("text"))&&(l=l.concat(", Text OptIn: Yes"));const c=sessionStorage.getItem("callBackID");return c&&(l=l.concat(" ,"+c)),e.note.includes(l)||(e.note=e.note.concat(l)),e}function k(e,t){return(0,s.__awaiter)(this,void 0,void 0,function*(){var o;(0,h.startLoader)(),sessionStorage.setItem("formValues",JSON.stringify(e)),A(e),e=_(e);let n,i,s=(yield(0,p.getBrandDetailsFromBrandJson)(w)).pause_lead_flag;const r=(0,m.getSessionAndCorrelationID)();n=r.sessionID,i=r.correlationID,i&&(e.correlationId=i);const l=yield(0,u.handleMissingData)(e.city,e.state,e.zipCode);e.city=(null==l?void 0:l.city)||e.city,e.state=(null==l?void 0:l.state)||e.state;let d="";d=i&&n?`${c.apiConfig.BOOKING_API_URL}&correlationId=${i}&sessionId=${n}`:c.apiConfig.BOOKING_API_URL,t&&(e.note=null===(o=null==e?void 0:e.note)||void 0===o?void 0:o.concat(" ID: 5ubm17 "));const v=sessionStorage.getItem("callFromCalendar");if("true"===v){const e=sessionStorage.getItem("isBookingDone");if(e&&"true"===e)return}yield(0,a.bookingUsPostCallWrapper)(d,e).then(o=>{if(sessionStorage.removeItem("callBackID"),o)"true"===v&&sessionStorage.setItem("isBookingDone","true"),(0,p.storeBookingApiPayload)(e,o),window.history.replaceState({},"",window.location.href),t&&(sessionStorage.setItem("IsLeadOnly","false"),sessionStorage.setItem("bookingLeadSent","true"),s||((0,h.stopLoader)(),(0,y.isTouchDevice)()&&(0,b.closeFunctionality)())),t||(document.querySelectorAll("form").forEach(e=>{e.reset()}),window.location.pathname="/confirmation");else if(s)(0,f.throwBookingError)();else{(0,y.isTouchDevice)()&&t?(0,b.closeFunctionality)():(0,f.throwBookingError)()}}).catch(e=>{if(s)B(e);else{(0,y.isTouchDevice)()&&t?(0,b.closeFunctionality)():B(e)}})})}function N(e){return(0,s.__awaiter)(this,void 0,void 0,function*(){const t=(0,p.getConceptId)(),o=c.apiConfig.LocateLocationApiWithRoundRobin+`/${e}/false/true/${t}`;return(0,l.cachedAPIWrapper)(o)})}function T(e){const t=`${c.apiConfig.GET_ATTRIBUTE_DATA}/${e}`;return(0,l.cachedAPIWrapper)(t)}function B(e){var t;(null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.toLowerCase().includes("request throttled due to duplicate payload"))?(document.querySelectorAll("form").forEach(e=>{e.reset()}),window.location.pathname="/confirmation"):(0,f.throwBookingError)()}function P(e){return(0,s.__awaiter)(this,void 0,void 0,function*(){var t;const o=localStorage.getItem("franchiseWebLocationId"),n=sessionStorage.getItem("zipcode"),i=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,s=yield(0,p.getBrandDetailsFromBrandJson)(i),r=(null==s?void 0:s.calendarMaxWeeksCap)?null==s?void 0:s.calendarMaxWeeksCap:8,a=null==s?void 0:s.vendorId;let d;d=!!e.toLowerCase().includes("recurring");const c={PostalCode:null!=n?n:"",WebLocationId:null!=o?o:"",DateStart:S().format("MM/DD/YYYY"),IsEstimate:d,apikey:"pneiweb-9pbaOywNKQj853D",VendorId:a,NumberOfDays:7*r},u=(0,p.constructAppointMentApiUrl)(c);return(0,l.getCachedAPIResponse)(u,I.apiCaching.TechAvailability)})}function j(){return(0,s.__awaiter)(this,void 0,void 0,function*(){var e;let t=localStorage.getItem("franchiseWebLocationId")?localStorage.getItem("franchiseWebLocationId"):localStorage.getItem("weblocationId");const o=yield T(Number(t));return!(null===(e=null==o?void 0:o.options)||void 0===e?void 0:e.mollyOneTimeCleansDisableEstimatePricing)})}function D(){return(0,s.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;let o=c.apiConfig.GenericLeadSourceEndpoint;const n=yield(0,p.getBrandDetailsFromBrandJson)(t);return n&&(o=(null==n?void 0:n.send_brand_leadsource_api)?c.apiConfig.MollyLeadSourceEndpoint:c.apiConfig.GenericLeadSourceEndpoint),o})}function M(){return(0,s.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,n=yield(0,p.getBrandDetailsFromBrandJson)(o);return{LeadSourceID:(null==n?void 0:n.default_leadSourceID)||0,LeadSource:null!==(t=null==n?void 0:n.default_leadSource)&&void 0!==t?t:"Web"}})}function q(e){return(0,s.__awaiter)(this,void 0,void 0,function*(){var t,o;(0,h.startLoader)(),sessionStorage.removeItem("noCalendarPricing");let n={franchiseWebLocationId:e.webLocationId,LeadSourceId:e.leadSourceId,FirstName:e.firstName,LastName:e.lastName,Address:e.address+(e.address2?`, ${e.address2}`:""),City:e.city,State:e.state,PostalCode:e.postalCode.trim(),Email:e.email,Phone:e.phone,EstimateSquareFeet:Number(e.estimateSquareFeet),EstimateBedrooms:Number(e.estimateBedrooms),EstimateBathrooms:Number(e.estimateBathrooms),conceptId:L,vendorId:Number(e.vend
3orId)};const i={method:"POST",url:c.apiConfig.calculateEstimate,data:n};return"isfakesubmit"===(null===(t=e.firstName)||void 0===t?void 0:t.toLowerCase())||"isfakesubmit"===(null===(o=e.lastName)||void 0===o?void 0:o.toLowerCase())?new Promise(e=>{setTimeout(()=>{(0,h.stopLoader)(),console.warn("IsFakeSubmit Detected, skipping API call for calculate estimate"),sessionStorage.setItem("noCalendarPricing","true"),e(null)},1e3)}):(0,r.default)(i).then(e=>((0,h.stopLoader)(),e?(sessionStorage.setItem("mollyEstimate",JSON.stringify(e)),e):(console.warn("CalculateEstimate API call returned no response"),sessionStorage.setItem("noCalendarPricing","true"),null))).catch(e=>((0,h.stopLoader)(),console.error("Error in CalculateEstimate API call:",e),sessionStorage.setItem("noCalendarPricing","true"),null))})}function R(){const e=sessionStorage.getItem("noCalendarPricing");return!(!e||"true"!=e)}function O(e){return(0,s.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i;(0,h.startLoader)();const s=yield(0,p.getBrandDetailsFromBrandJson)(w);let r=s.osflow_contactUs_comments;const l={firstName:e.firstName,lastName:null!==(t=e.lastName)&&void 0!==t?t:"",zipCode:e.zipCode,phone:e.phone,email:e.email,city:e.city,state:e.state,country:null!==(o=e.country)&&void 0!==o?o:"",address:null!==(n=e.address)&&void 0!==n?n:"",address2:null!==(i=e.address2)&&void 0!==i?i:"",comments:null!=r?r:"",signUpForUpdates:!0,isLocalized:!1,isNewCustomer:"",isTest:(0,v.isTestFcn)(),conceptId:Number(L),conceptCode:w,vendorId:Number(s.vendorId)};return(0,d.contactUsPostCallWrapper)(c.apiConfig.CONTACT_US_SEND,l).then(e=>{(0,h.stopLoader)(),e?((0,p.storeBookingApiPayload)(l,e),window.history.replaceState({},"",window.location.href),document.querySelectorAll("form").forEach(e=>{e.reset()}),window.location.pathname="/confirmation"):(0,f.throwBookingError)()}).catch(e=>{(0,h.stopLoader)(),(0,f.throwBookingError)()})})}},"./src/js/opus2/mly/confirmation.ts"(e,t,o){"use strict";o.d(t,{Confirmation:()=>d,validEstimate:()=>a});var n=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),i=o(/*! ../util/setDateAndTime */"./src/js/opus2/util/setDateAndTime.ts"),s=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),r=o(/*! ../util/confirmation-page-add-to-calendar */"./src/js/opus2/util/confirmation-page-add-to-calendar.ts"),l=o(/*! ./callBookingApi */"./src/js/opus2/mly/callBookingApi.ts");function a(){const e=sessionStorage.getItem("mollyEstimate");let t;return t=!(!e||""===e||"null"===e||null==e),t}class d{constructor(){var e;this.calendarRecurHeading=document.getElementById("recurring_heading"),this.calendarOTCHeading=document.getElementById("onetime_heading"),this.leadRecurHeading=document.getElementById("recurring_lead_heading"),this.leadOTCHeading=document.getElementById("onetime_lead_heading"),this.osDetails=document.getElementById("appointment_title"),this.leadDetails=document.getElementById("leadflow_title"),this.appointmentDetails=document.querySelector("ul.appointment-list"),sessionStorage.getItem("fakeSubmitData")?this.inputData=JSON.parse(sessionStorage.getItem("fakeSubmitData")):this.inputData=JSON.parse(sessionStorage.getItem("rl-post-data")),this.frequency=sessionStorage.getItem("JobFrequency"),this.type=sessionStorage.getItem("CustomerType"),this.calendarConf=document.getElementById("confirmation_calendar_subhead"),this.leadConf=document.getElementById("confirmation_lead_subhead"),this.isLeadFlow=null===(e=this.inputData)||void 0===e?void 0:e.isLeadOnly}showAllHeadings(){this.isLeadFlow?(this.leadConf.classList.remove("hidden"),this.calendarConf.classList.add("hidden"),this.calendarOTCHeading.classList.add("hidden"),this.calendarRecurHeading.classList.add("hidden"),this.leadDetails.classList.remove("hidden"),this.osDetails.classList.add("hidden"),this.toggleFrequencyHeading(this.leadRecurHeading,this.leadOTCHeading)):(this.leadConf.classList.add("hidden"),this.calendarConf.classList.remove("hidden"),this.leadRecurHeading.classList.add("hidden"),this.leadOTCHeading.classList.add("hidden"),this.leadDetails.classList.add("hidden"),this.osDetails.classList.remove("hidden"),this.toggleFrequencyHeading(this.calendarRecurHeading,this.calendarOTCHeading))}toggleFrequencyHeading(e,t){this.frequency.toLowerCase().includes("recurring")?(e.classList.remove("hidden"),t.classList.add("hidden")):(e.classList.add("hidden"),t.classList.remove("hidden"))}updateAppointmentDetails(){var e,t;let o=this.frequency.toLowerCase();const n={"Date and Time":"/brand/_assets/images/brand-img/lead-flow/calendar.svg",Estimate:"/brand/_assets/images/brand-img/lead-flow/tag.svg","Service Address":"/brand/_assets/images/brand-img/lead-flow/location-marker.svg","Contact Info":"/brand/_assets/images/brand-img/lead-flow/mail.svg"};let i="";
3Object.keys(n).forEach(e=>{i=i.concat(this.generateLi(e,n[e],o))}),this.appointmentDetails.innerHTML=i,"false"===sessionStorage.getItem("IsLeadOnly")&&(null===(t=null===(e=this.appointmentDetails)||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("add-to-calendar"))&&(0,r.loadAddToCalendarDropDown)()}generateLi(e,t,o){var n,i;let r,d,c,u="",m="",h="";if(e.includes("Estimate")&&!o.includes("recurring")&&!this.type.toLowerCase().includes("commercial")&&a()){const e=JSON.parse(sessionStorage.getItem("mollyEstimate")),t=null===(n=this.inputData.jobFrequencyDetail)||void 0===n?void 0:n.toLowerCase().includes("not a move in or move out clean"),o=sessionStorage.getItem("selectedDay");h="one-time-estimate-wrap";const i="Saturday"===o||"Sunday"===o;let s=(0,l.getRegularEstimate)(e,!t);if(i&&(s=(0,l.getWeekendEstimate)(e,!t)),!(s.low>0&&s.high>0))return"";r=`$${s.low} - $${s.high}`,c="yes"}else if(e.includes("Date and Time")&&!(null===(i=this.inputData)||void 0===i?void 0:i.isLeadOnly)){h="booking-date-time";let e=this.processString(sessionStorage.getItem("userSelectDatae"));r=e.date,d=o.includes("recurring")?e.time:sessionStorage.getItem("timeOfDay")}else if(e.includes("Service Address")){let e=(0,s.getAddressConfirmation)(this.inputData);h="service-address",e.line1?(r=e.line1,d=e.line2):r=e.line2}else e.includes("Contact Info")&&(r=this.inputData.firstName+" "+this.inputData.lastName,d=this.inputData.email,u=this.inputData.phone);r&&t&&(m=m.concat(`<li class="appointment-list-item ${h}"> <div class="icon-block">`),m=m.concat(`<img src="${t}" alt="calendar" width="24" height="24">`),m=m.concat(`<div class="appointment-detail-wrap"><div class="icon-block-wrap"><p class="icon-block-heading">${e}</p><p class="icon-block-text">${r}</p>`)),d&&(m=m.concat(`<p class="icon-block-text">${d}</p>`)),c&&(m=m.concat('<span class="icon-block-sub-text">plus any applicable sales taxes</span>')),u&&(m=m.concat(`<p class="icon-block-text">${u}</p>`)),m=m.concat("</div>");const p=sessionStorage.getItem("hidePreferMethod");return e.includes("Contact Info")&&"false"===p&&(m=m.concat(`<div class="icon-block-wrap"><p class="icon-block-heading">Preferred Method of contact:</p><p class="icon-block-text">${sessionStorage.getItem("PreferredCommunicationText")}</p></div>`)),m=m.concat("</div> </div> </li>"),m}processString(e){let t=e.split(","),o=t.slice(0,t.length-1).join(",").trim(),n=t[t.length-1].trim();return{date:`${(0,i.setTimeAndDate)(o)}`,time:`${n.toLowerCase()}`}}destroy(){sessionStorage.removeItem("callFromCalendar"),sessionStorage.removeItem("isBookingDone"),sessionStorage.removeItem("zipcode"),sessionStorage.removeItem("noZipNote"),sessionStorage.removeItem("noCalendarPricing"),sessionStorage.removeItem("mollyEstimate"),sessionStorage.removeItem("bookingLeadSent"),sessionStorage.removeItem("zipcode"),sessionStorage.removeItem("TA_IsEstimate"),sessionStorage.removeItem("PriceNote"),sessionStorage.removeItem("selectedDay"),sessionStorage.removeItem("timeOfDay"),sessionStorage.removeItem("userSelectDatae"),sessionStorage.removeItem("fakeSubmitData"),sessionStorage.removeItem("correlationIDFr")}}document.addEventListener("DOMContentLoaded",()=>{var e;(0,n.stopLoader)();const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=document.getElementsByClassName("mly-confirmation-section");if("MLY"===t&&(null==o?void 0:o.length)>0){const e=new d;e.showAllHeadings(),e.updateAppointmentDetails(),(0,r.setupCalendarInvites)(),e.destroy()}})},"./src/js/opus2/mly/form-validation.ts"(e,t,o){"use strict";o.d(t,{handleCheckboxInput:()=>u,handleInput:()=>c,validateDropdown:()=>h,validateForm:()=>s,validateSqrft:()=>m});var n=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),i=o(/*! ../util/share */"./src/js/opus2/util/share.ts");function s(e){let t=[],o=!0;const n=e.querySelectorAll("input");n.forEach(e=>{c(e,true,!0)});u(e.querySelectorAll('div.referred-check-wrap input[type="checkbox"]')),t=m(),t.length>0?t.forEach(e=>{h(e)}):document.querySelectorAll('select[id*="detail"]').forEach(e=>{d(e,!1)}),h("mly-how-about-us");
3return e.querySelectorAll("span.error-msg").forEach(e=>{e.classList.contains("hidden")||(o=!1)}),o}function r(e,t){return!!t&&(!e||/^\s*$/.test(e))}function l(e,t){const o=n.REGEX.sendName;if(e.required)if(r(e.value,t))d(e,!0);else if(e.value&&!o.test(e.value)){const t=document.getElementById(`${e.name}-error-msg`);t&&("mly-user-fname"==e.name?t.innerHTML="Invalid name format.":"mly-user-lname"==e.name&&(t.innerHTML="Invalid last name format."),t.classList.remove("hidden"))}else d(e,!1)}function a(e,t){var o;const i=n.REGEX.allow1to99999Digit;if(e.required&&r(e.value,t))d(e,!0);else if(e.value=null===(o=e.value)||void 0===o?void 0:o.replace(/\D+/g,""),e.value){const t=e.value.match(i);t?(e.value=t[0],d(e,!1)):d(e,!0)}}function d(e,t){var o,n;const i=e.name?e.name:e.id;t?null===(o=document.getElementById(`${i}-error-msg`))||void 0===o||o.classList.remove("hidden"):null===(n=document.getElementById(`${i}-error-msg`))||void 0===n||n.classList.add("hidden")}function c(e,t,o=!1){switch(e.type){case"text":switch(e.name){case"mly-user-number":!function(e,t,o){var s;const l=e,a=n.REGEX.mobileNumberRegex;if(e.required&&r(e.value,t))d(e,!0);else{const t=e.value,n=t.replace(/\D/g,"").match(a),r=n?`(${n[1]}) ${n[2]}${n[3]?"-"+n[3]:""}`:"",c=null!==(s=e.selectionStart)&&void 0!==s?s:0,u=t;if(o)if((null==l?void 0:l.value.length)<14&&r.length<14){const t=document.getElementById(`${e.name}-error-msg`);t&&(t.innerHTML="Invalid phone number format.",t.classList.remove("hidden")),d(e,!0)}else e.value=n[2]?`(${n[1]}) ${n[2]}${n[3]?"-"+n[3]:""}`:n[1],(0,i.calculateCaretPosition)(e,c,u),d(e,!1);else e.value=n[2]?`(${n[1]}) ${n[2]}${n[3]?"-"+n[3]:""}`:n[1],(0,i.calculateCaretPosition)(e,c,u),d(e,!1)}}(e,t,o);break;case"mly-user-address":!function(e,t){if(e.required&&r(e.value,t))d(e,!0);else if(e.required&&e.value){let t;if(t="true"===sessionStorage.getItem("suggestion")?/^[^!?@#$%^*]*$/:/^[^!?@#$%^&*()]*$/,t.test(e.value))d(e,!1);else{const t=document.getElementById(`${e.name}-error-msg`);t&&(t.innerHTML="Invalid address format.",t.classList.remove("hidden")),d(e,!0)}}else d(e,!1)}(e,t);break;case"mly-user-address-2":/^[^!?@#$%^&*()]*$/.test((s=e).value)?d(s,!1):d(s,!0);break;case"mly-user-zip-code":!function(e,t){const o=n.REGEX.sendZip;if(e.value=e.value.trim(),e.required)if(r(e.value,t))d(e,!0);else if(e.value&&!o.test(e.value)||"00000"==e.value){const t=document.getElementById(`${e.name}-error-msg`);t&&(t.innerHTML="Invalid zip code format.",t.classList.remove("hidden")),d(e,!0)}else d(e,!1)}(e,t);break;case"mly-user-fname":case"mly-user-lname":l(e,t)}break;case"email":!function(e,t){const o=n.REGEX.sendEmail;if(e.required)if(r(e.value,t))d(e,!0);else if(e.value&&!o.test(e.value)){const t=document.getElementById(`${e.name}-error-msg`);t&&(t.innerHTML="Invalid email format.",t.classList.remove("hidden")),d(e,!0)}else d(e,!1)}(e,t);break;case"number":a(e,t)}var s}function u(e){var t,o,n;if(e&&(null==e?void 0:e.length)>0){if(e[0].closest("div.referred-check-wrap").querySelector(".label-basic").hasAttribute("required")){let n=0;e.forEach(e=>{e.checked||(n+=1)}),n==e.length?null===(t=document.getElementById("preferred-contact-error-msg"))||void 0===t||t.classList.remove("hidden"):null===(o=document.getElementById("preferred-contact-error-msg"))||void 0===o||o.classList.add("hidden")}else null===(n=document.getElementById("preferred-contact-error-msg"))||void 0===n||n.classList.add("hidden")}}function m(){["home-detail-bedroom","home-detail-bathroom","office-detail-offices","office-detail-bathroom"].forEach(e=>{const t=document.getElementById(e);t&&d(t,!1)});const e=document.getElementById("cleaning-residential"),t=document.getElementById("cleaning-commercial"),o=document.getElementById("frequency-cleaning-one");let n=null;const i=document.getElementById("home-detail-sqrft"),s=document.getElementById("office-detail-sqrft");let r=[];const l=["home-detail-bedroom","home-detail-bathroom"],c=["office-detail-offices","office-detail-bathroom"];return(null==e?void 0:e.checked)&&(null==o?void 0:o.checked)?(n=i,r=l):(null==t?void 0:t.checked)&&(n=s,r=c),n?a(n,!0):(i&&d(i,!1),s&&d(s,!1)),r}function h(e){var t;const o=document.getElementById(e),n=null===(t=null==o?void 0:o.parentElement)||void 0===t?void 0:t.querySelector("button");
3n&&((null==o?void 0:o.required)&&(null==n?void 0:n.innerText.toLowerCase().includes("select"))?d(o,!0):d(o,!1))}},"./src/js/opus2/mly/index.ts"(e,t,o){"use strict";o.r(t),o.d(t,{CleaningType:()=>n.CleaningType,Confirmation:()=>i.Confirmation,MollyCalendarFlow:()=>s.MollyCalendarFlow,MollyFlow:()=>n.MollyFlow,calendarFlowMLY:()=>s.calendarFlowMLY,displayEstimate:()=>s.displayEstimate,extractAddress:()=>n.extractAddress,getDayOfWeek:()=>s.getDayOfWeek,isWeekend:()=>s.isWeekend,throwBookingError:()=>n.throwBookingError,togglePreferredContactInConfirmationPage:()=>n.togglePreferredContactInConfirmationPage,validEstimate:()=>i.validEstimate});var n=o(/*! ./molly-flow */"./src/js/opus2/mly/molly-flow.ts"),i=o(/*! ./confirmation */"./src/js/opus2/mly/confirmation.ts"),s=o(/*! ./mly-calendar-flow */"./src/js/opus2/mly/mly-calendar-flow.ts")},"./src/js/opus2/mly/mly-calendar-flow.ts"(e,t,o){"use strict";o.d(t,{MollyCalendarFlow:()=>E,calendarFlowMLY:()=>b,displayEstimate:()=>I,getDayOfWeek:()=>w,isWeekend:()=>L});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! moment */"./node_modules/moment/moment.js"),s=o.n(i),r=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),l=o(/*! ./callBookingApi */"./src/js/opus2/mly/callBookingApi.ts"),a=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js"),d=o(/*! ./confirmation */"./src/js/opus2/mly/confirmation.ts"),c=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),u=o(/*! ../util/createModal */"./src/js/opus2/util/createModal.ts"),m=o(/*! ../util/share */"./src/js/opus2/util/share.ts");let h,p,v,g;function f(e){e.isLeadOnly=!0,sessionStorage.setItem("IsLeadOnly",e.isLeadOnly),(0,l.callBookingApi)(e)}function y(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,i;!function(){document.querySelectorAll("#form-section .form-step").forEach(e=>{(null==e?void 0:e.className.includes("appointment-details-section"))?e.classList.add("form-step-active"):e.classList.remove("form-step-active")});let e=document.querySelector("#progress");e&&(e.style.width="100%");let t=document.querySelectorAll(".progress-step");t&&t.length>1&&(t[1].classList.add("prograssbar-length"),t[1].classList.add("progress-step-active"))}();const s=function(e){if(!e)return"";const t=document.querySelector(".recurring-estimation-heading"),o=document.querySelector(".one-time-heading-wrap");return t&&o?(null==e?void 0:e.includes("recurring"))?(t.style.display="flex",o.style.display="none","Estimate"):(t.style.display="none",o.style.display="flex","One Time Clean"):""}(null===(t=e.jobFrequency)||void 0===t?void 0:t.toLowerCase());s&&(e.serviceText=s);const r=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value;if(!(yield(0,m.getBrandDetailsFromBrandJson)(r)).pause_lead_flag){const t=(0,c.isTouchDevice)(),o=document.querySelector(".heading-thanyou-text");if(o&&""!==(null===(i=null==o?void 0:o.textContent)||void 0===i?void 0:i.trim())){const o=sessionStorage.getItem("bookingLeadSent");!0!==t&&"false"===o&&(window.onbeforeunload=function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){window.onbeforeunload=null,e.isLeadOnly=!0,e.serviceText="Lead Only",sessionStorage.setItem("fakeBrowserCloseEvent","true"),yield(0,l.callBookingApi)(e,!0),sessionStorage.removeItem("fakeBrowserCloseEvent")})})}}})}function b(e){if(document.querySelector(".calendar-container")){const t=sessionStorage.getItem("zipcode"),o=sessionStorage.getItem("TA_IsEstimate");if(t&&o&&e.zipCode===t&&e.jobFrequency===o)return I(e,h),void(0,r.stopLoader)();sessionStorage.setItem("zipcode",e.zipCode),sessionStorage.setItem("TA_IsEstimate",e.jobFrequency),g=new E(e),(0,l.checkTechAvailability)(g.jobFreq).then(t=>{var o;if(null==t?void 0:t.resultCollection){const n=null==t?void 0:t.resultCollection;let i=n.findIndex(e=>e.isAvailable);if(-1!=i){let t;h=null===(o=n[i])||void 0===o?void 0:o.startDate,I(e,h),p="",g.dateSlider&&(g.dateSlider.innerHTML=function(e){let t=new Set;return e.map(o=>{let n=o.startDate.split("T")[0];const i=null==e?void 0:e.some(e=>s()(e.startDate.split("T")[0]).format("DD MMM, YYYY")==s()(n).format("DD MMM, YYYY")&&e.isAvailable);if(!t.has(n))return t.add(n),`\n <li class="date-details-item">\n <button type="button" class="${i?s()(n).format("ddd DD MMM, YYYY")===s()(h).format("ddd DD MMM, YYYY")?"date-details-inactive date-details-active dateapp":"date-details-inactive dateapp":"date-details-disable"}"\n value=${n}>
3\n <span value=${n} class="date-text-small">${s()(n).format("MMM")}</span>\n <strong value=${n} class="date-text-normal">${s()(n).format("DD")}</strong>\n <input class="getDateApp" hidden value=${n}>\n <input class="scheduleID" hidden value=${o.scheduleID}> \n <span value=${n} class="date-text-small">${s()(n).format("ddd")} </span>\n </button>\n </li>\n `})}(n).join("")),g.selectedDateTime.innerHTML=`${h?s()(h).format("ddd MMM DD"):"Please Select a Date"}, <span class="selected-time"> Please Select a Time </span>`,g.addListner(n);let l=function(e){let t=h.split("T")[0],o=e.filter(e=>e.startDate.split("T")[0]===t);return o.length}(n);t=g.jobFreq.toLowerCase().includes("recurring")?Math.floor(i/13):Math.floor(i/l),function(e,t){try{(0,a.tns)({container:".mly-date-slider",loop:!1,gutter:8,items:7,slideBy:"page",nav:!1,autoplay:!1,speed:400,swipeAngle:!1,autoplayButtonOutput:!1,mouseDrag:!0,lazyload:!0,startIndex:t,controlsContainer:"#customize-controls",responsive:{350:{items:5},640:{items:5},768:{items:5},1024:{items:7}}})}catch(e){throw console.log("Error loading slider: ",e),e}}(0,t),g.setTimeUl(n,h.split("T")[0]),(0,r.stopLoader)()}else console.log("Tech Availability API has no available slots => Submitting Lead flow "),window.onbeforeunload=null,f(e)}else console.log("Tech Availability API returns empty => Submitting Lead flow "),window.onbeforeunload=null,f(e)}).catch(t=>{console.error("Tech Availability API fail=> Submitting lead flow: ",t),window.onbeforeunload=null,f(e)})}else console.error("Error in HTML")}function I(e,t){const o=document.querySelector(".one-time-estimate-wrap"),n=!(0,l.calcEstFail)()&&(0,d.validEstimate)()&&e.jobFrequency.toLowerCase().includes("one-time");y(e),(0,l.configureMollyEstimate)().then(e=>{var i;if(n){const n=sessionStorage.getItem("mollyEstimate"),s=JSON.parse(n),r=document.querySelector(".one-time-amount");let l,a;if(null===(i=document.getElementById("ont-time-clean"))||void 0===i?void 0:i.checked){const e=function(e,t){let o,n;return L(t)?(o=null==e?void 0:e.estimateOccasionalRangeLowSaturday,n=null==e?void 0:e.estimateOccasionalRangeHighSaturday):(o=null==e?void 0:e.estimateOccasionalRangeLow,n=null==e?void 0:e.estimateOccasionalRangeHigh),{low:o,high:n}}(s,t);l=e.low,a=e.high}else{const e=function(e,t){let o,n;return L(t)?(o=null==e?void 0:e.estimateMoveRangeLowSaturday,n=null==e?void 0:e.estimateMoveRangeHighSaturday):(o=null==e?void 0:e.estimateMoveRangeLow,n=null==e?void 0:e.estimateMoveRangeHigh),{low:o,high:n}}(s,t);l=e.low,a=e.high}let d="";o&&l>0&&a>0?(r.innerHTML=`$${Math.round(l)} - $${Math.round(a)}`,d=`Price: {${r.innerHTML}}`,e?function(){const e=document.querySelector(".one-time-estimate-wrap");e&&e.classList.remove("hidden")}():(S(),r.innerHTML="",d=`${d} No Calendar Pricing`)):(S(),d="No Calendar Pricing"),sessionStorage.setItem("PriceNote",d)}else S()}).catch(e=>{console.log("Error in displaying Molly Estimate: ",e),S()})}function S(){const e=document.querySelector(".one-time-estimate-wrap");e&&e.classList.add("hidden")}function w(e){if(!e)return"";return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][new Date(e).getDay()]}function L(e){if(!e)return!1;const t=w(e);return!!t&&("Saturday"===t||"Sunday"===t)}class E{constructor(e){this.cachedConfirmBtn=null,this.bookingPayload=e,this.jobFreq=this.bookingPayload.jobFrequency,this.dateSlider=document.querySelector(".date-details-wrapper #start-index"),this.selectedDateTime=document.querySelector(".appointment-date-wrap .appointment-section-text"),this.requestCallBack=document.querySelector(".sheduling-time-box #link-checkbox"),this.backBtn=document.querySelector(".btn-container .btn-cancel"),this.confirmBtn=document.querySelector(".btn-container .primary-btn"),this.containerClass=document.querySelector(".calendar-container");const t=document.querySelector("#mly-mobile-close");this.mollyModalClose=t||null,this.pauseLeadFlag=!1,this.initListeners(),this.availableHrs=this.getCalendarRow()}removeListeners(){var e,t,o,n;null===(e=this.backBtn)||void 0===e||e.removeEventListener("click",this.backListener),null===(t=this.confirmBtn)||void 0===t||t.removeEventListener("click",this.handleConfirmBtn),null===(o=this.requestCallBack)||void 0===o||o.removeEventListener("click",this.handleDisableApp),this.cachedConfirmBtn=null,this.pauseLeadFlag||null===(n=this.mollyModalClose)||void 0===n||n.removeEventListener("click",this.handleMobileClose)}initListeners(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n,i,s;const r=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,l=yield(0,m.getBrandDetailsFromBrandJson)(r);this.pauseLeadFlag=l.pause_lead_flag,this.removeListeners(),null===(t=this.backBtn)||void 0===t||t.addEventListener("click",this.backListener.bind(this)),null===(o=this.confirmBtn)||void 0===o||o.addEventListener("click",this.handleConfirmBtn.bind(this)),null===(n=this.requestCallBack)||void 0===n||n.addEventListener("click",this.handleDisableApp.bind(this)),this.pauseLeadFlag||(null===(i=this.mollyModalClose)||void 0===i||i.removeEventListener("click",u.closeFunctionality),null===(s=this.mollyModalClose)||void 0===s||s.addEventListener("click",this.handleMobileClose.bind(this)))})}backListener(e){e.preventDefault();
3document.querySelectorAll("#form-section .form-step").forEach(e=>{(null==e?void 0:e.className.includes("appointment-details-section"))?e.classList.remove("form-step-active"):e.classList.add("form-step-active")}),document.querySelector("#progress").style.width="0%";let t=document.querySelectorAll(".progress-step");t[1].classList.remove("prograssbar-length"),t[1].classList.remove("progress-step-active")}handleConfirmBtn(e){var t,o;e.preventDefault(),(null===(t=this.requestCallBack)||void 0===t?void 0:t.checked)&&(this.bookingPayload.isLeadOnly=!0,this.bookingPayload.serviceText="Lead Only",sessionStorage.setItem("isRequestCallBackChecked",JSON.stringify(!0)),sessionStorage.setItem("IsLeadOnly",this.bookingPayload.isLeadOnly)),this.validateForm()&&!sessionStorage.getItem("callFromCalendar")&&((null===(o=this.requestCallBack)||void 0===o?void 0:o.checked)||this.storeDateTime(),this.bookingPayload.scheduleID=v,"true"==sessionStorage.getItem("IsLeadOnly")?this.bookingPayload.isLeadOnly=!0:this.bookingPayload.isLeadOnly=!1,window.onbeforeunload=null,
3sessionStorage.setItem("callFromCalendar","true"),(0,l.callBookingApi)(this.bookingPayload))}hideDateTimeError(){const e=document.getElementById("mly-appointment-date-time-error-msg");e&&e.classList.add("hidden");const t=document.getElementById("mly-link-checkbox-error-msg");t&&t.classList.add("hidden")}handleMobileClose(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=(0,c.isTouchDevice)(),o=sessionStorage.getItem("bookingLeadSent"),n=document.querySelector(".heading-thanyou-text");n&&""!==(null===(e=null==n?void 0:n.textContent)||void 0===e?void 0:e.trim())&&t&&"false"===o&&(this.bookingPayload.isLeadOnly=!0,this.bookingPayload.serviceText="Lead Only",yield(0,l.callBookingApi)(this.bookingPayload,!0))})}validateForm(){const e=document.getElementById("mly-appointment-date-time-error-msg"),t=document.getElementById("mly-link-checkbox-error-msg"),o=document.getElementById("link-checkbox");return!!(h&&p||(null==o?void 0:o.checked))||(e&&(e.classList.remove("hidden"),(null==e?void 0:e.innerText)||(e.innerText="Please select a date and time")),t&&(t.classList.remove("hidden"),(null==t?void 0:t.innerText)||(t.innerText="or choose to get a call back.")),!1)}handleDisableApp(){var e,t;if(this.cachedConfirmBtn&&document.body.contains(this.cachedConfirmBtn)||(this.cachedConfirmBtn=document.querySelector(".btn-container .primary-btn")),!this.cachedConfirmBtn)return void console.warn("Confirm button not found.Cannot update text.");const o=this.cachedConfirmBtn;this.containerClass&&(null===(e=this.requestCallBack)||void 0===e?void 0:e.checked)?(this.containerClass.classList.add("disable-calendar"),sessionStorage.setItem("callBackID","Call Back ID: C811"),o&&(o.textContent=E.BUTTON_TEXT_REQUEST_CALLBACK)):this.containerClass&&!(null===(t=this.requestCallBack)||void 0===t?void 0:t.checked)&&(this.containerClass.classList.remove("disable-calendar"),sessionStorage.removeItem("callBackID"),o&&(o.textContent=E.BUTTON_TEXT_CONFIRM_APPOINTMENT));const n=document.querySelector(".callback-wrapper");n&&n.classList.toggle("callback-requested"),this.hideDateTimeError()}getCalendarRow(){let e;return document.querySelectorAll(".calendar-row").forEach(e=>{e.innerHTML=""}),e=this.jobFreq.toLowerCase().includes("recurring")?document.querySelector(".recurring-calendar"):document.querySelector(".one-time-calendar"),e}storeDateTime(){let e;sessionStorage.setItem("selectedDay",w(h)),e=this.jobFreq.toLowerCase().includes("recurring")?function(e){const t=e.trim().split(" - "),o=s()(t,["h:mm A","hh:mm A"]),n=Number(o.format("HH"));return n<=12?"Morning":n>12&&n<=17?"Afternoon":"Evening"}(p):p,sessionStorage.setItem("timeOfDay",e),sessionStorage.setItem("userSelectDatae",`${h}, ${p}`)}setTimeUl(e,t){const o=this.getCalendarRow();if(!o)return;const n=s()(t).format("DD MMM, YYYY"),i=null==e?void 0:e.reduce((e,t)=>(s()(t.startDate).format("DD MMM, YYYY")===n&&e.push(`<li class="calendar-row-item">\n <button type="button" value="${t.scheduleID}" \n class="calendar-col btn-time ${t.isAvailable?"":"disable-btn"}" \n id="${t.displayText}">\n ${t.displayText}\n </button>\n </li>`),e),[]).join("");o.innerHTML=i,this.setListnerOnUlBtn()}addListner(e){var t;null===(t=document.querySelectorAll(".dateapp"))||void 0===t||t.forEach(t=>{t.addEventListener("click",o=>{document.querySelectorAll(".dateapp").forEach(e=>e.classList.remove("date-details-active")),h=s()(t.querySelector(".getDateApp").value).format("ddd DD MMM, YYYY"),I(this.bookingPayload,h),p="",t.classList.toggle("date-details-active"),v=t.querySelector(".scheduleID").value,document.querySelector(".appointment-section-text").innerHTML=`${s()(t.querySelector(".getDateApp").value).format("ddd MMM DD")}, <span class="selected-time"> Please Select a Time </span>`,this.setTimeUl(e,t.querySelector(".getDateApp").value)})})}setListnerOnUlBtn(){const e=document.querySelectorAll(".calendar-col");let t=this;e&&e.forEach(o=>{o.classList.remove("active"),o.addEventListener("click",n=>
3{e.forEach(e=>e.classList.remove("active")),o.classList.toggle("active");const i=document.querySelector(".selected-time");i&&(i.innerHTML=o.innerHTML),v=o.value,p=o.id,t.hideDateTimeError()})})}}E.BUTTON_TEXT_REQUEST_CALLBACK="Request a Call Back",E.BUTTON_TEXT_CONFIRM_APPOINTMENT="Confirm Your Appointment"},"./src/js/opus2/mly/molly-flow.ts"(e,t,o){"use strict";o.d(t,{CleaningType:()=>I,MollyFlow:()=>w,extractAddress:()=>C,throwBookingError:()=>E,togglePreferredContactInConfirmationPage:()=>L});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./form-validation */"./src/js/opus2/mly/form-validation.ts"),s=o(/*! ./booking-payload */"./src/js/opus2/mly/booking-payload.ts"),r=o(/*! ./callBookingApi */"./src/js/opus2/mly/callBookingApi.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ./mly-calendar-flow */"./src/js/opus2/mly/mly-calendar-flow.ts"),d=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),c=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),u=o(/*! ../util/nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),m=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),h=o(/*! ../util/createModal */"./src/js/opus2/util/createModal.ts"),p=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),v=o(/*! ../util/domainService */"./src/js/opus2/util/domainService.ts"),g=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),f=o(/*! ../util/hideTermsPolicy */"./src/js/opus2/util/hideTermsPolicy.ts"),y=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts"),b=o(/*! ../util/real-time-email-validation */"./src/js/opus2/util/real-time-email-validation.ts");class I{constructor(){this.cleaningType=document.getElementsByName("mly-cleaning-radio"),this.cleaningFreq=document.querySelectorAll('input[name*="frequency-cleaning"]')}getCleaningType(){const e=this.cleaningType;if(e)for(const t of e)if(t.checked){const e=document.querySelector(`label[for="${t.id}"]`);return e?e.innerHTML.trim():""}return""}getCleaningFreq(){const e=this.getCleaningType().toLowerCase();if(e){const t={residential:"frequency-cleaning","light commercial":"commercial-frequency-cleaning"},o=this.cleaningFreq;if(o)for(const n of o)if(n.id.includes(t[e])&&n.checked){const e=document.querySelector(`label[for="${n.id}"]`);return e?e.innerHTML.trim():""}}return""}toggleCleaningDiv(){const e=this.getCleaningType().toLowerCase(),t=this.getCleaningFreq().toLowerCase(),o=document.getElementById("cleaningResidential"),n=document.getElementById("cleaningCommercial"),i=document.getElementById("one-next-btn"),s=document.getElementById("recurring-next-btn"),r=document.querySelector(".btn-container-mobile #one-next-btn"),l=document.querySelector(".btn-container-mobile #recurring-next-btn"),a=document.querySelector(".one-time-frequency-only"),d=document.getElementById("commercialRecurring"),c=document.getElementById("commercialOneTime"),u=document.querySelector("p.contract-cancel-text"),m=[document.getElementById("resi-recurring"),document.getElementById("comm-recurring"),document.getElementById("resi-one-time-move"),document.getElementById("resi-one-time-one"),document.getElementById("comm-one-time-move-yes"),document.getElementById("comm-one-time-move-no")],h=document.querySelectorAll('input[name*="one-time-radio"]'),p=document.querySelectorAll('input[name*="move-in-out-radio"]');let v,g="";for(const e of h)if(e.checked){v=document.querySelector(`[for="${e.id}"]`).innerText}for(const e of p)if(e.checked){g=document.querySelector(`[for="${e.id}"]`).innerText}e.includes("residential")?(o.style.display="flex",n.style.display="none",t.includes("recurring")?(s.style.display="flex",i.style.display="none",r.style.display="none",l.style.display="flex",a.style.display="none",u.style.display="flex",this.toggleCleaningBanners(m,0)):(s.style.display="none",i.style.display="flex",r.style.display="flex",l.style.display="none",a.style.display="flex",u.style.display="none",(null==v?void 0:v.includes("Move In"))?this.toggleCleaningBanners(m,2):this.toggleCleaningBanners(m,3))):(o.style.display="none",n.style.display="flex",t.includes("recurring")?(s.style.display="flex",i.style.display="none",r.style.display="none",l.style.display="flex",d.style.display="flex",c.style.display="none",u.style.display="flex",this.toggleCleaningBanners(m,1)):(s.style.display="none",i.style.display="flex",r.style.display="flex",l.style.display="none",d.style.display="none",c.style.display="flex",u.style.display="none",g.includes("Yes")?this.toggleCleaningBanners(m,4):this.toggleCleaningBanners(m,5)))}
3toggleCleaningBanners(e,t){null==e||e.forEach(e=>{e.style.display="none"}),e[t].style.display="block"}}function S(e){e&&(e.style.backgroundColor="var(--primary-500)",e.style.color="var(--white)",e.style.whiteSpace="nowrap",e.style.overflow="hidden",e.style.borderRight="40px solid var(--primary-500)")}class w{constructor(){var e,t,o;this.enableAutoFill=!1,this.isAutoFilled=!1,this.hasUserEdited=!1,this.applyValueToDropDown=(e,t)=>{if(e){e.setAttribute("selected-value",String(t));const o=e.parentNode;if(!o)return;const n=null==o?void 0:o.querySelector("button");if(!n)return;n.textContent=String(t)}},this.applyValueToInput=(e,t)=>{e&&(e.value=String(t))},this.debouncedSearch=(0,d.debounce)((e,t)=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield(0,m.discoverSuggestions)(e,t)}),500),this.setAutoSuggested=e=>(0,n.__awaiter)(this,void 0,void 0,function*(){e.preventDefault(),sessionStorage.setItem("suggestion","false"),this.address.removeAttribute("data-suggestion"),sessionStorage.setItem("manualCity",""),sessionStorage.setItem("manualState",""),this.debouncedSearch(this.zipCode,this.address)}),this.emailHistory=[],this.isEmailApiComplete=!1,(0,p.isTouchDevice)()&&this.initializeModal(".scheduler-main"),sessionStorage.removeItem("PriceNote"),sessionStorage.removeItem("selectedDay"),sessionStorage.removeItem("suggestion"),this.firstName=document.getElementById("mly-user-fname"),this.lastName=document.getElementById("mly-user-lname"),this.email=document.getElementById("mly-user-email"),this.phoneNumber=document.getElementById("mly-user-number"),this.phoneNumber.maxLength=14,this.address=document.getElementById("mly-user-address"),this.address2=document.getElementById("mly-user-address-2"),this.zipCode=document.getElementById("mly-user-zip-code"),this.preferMethods=document.querySelectorAll('input[name*="mly-contact"]'),this.leadSourceBtn=null===(t=null===(e=document.getElementById("mly-how-about-us"))||void 0===e?void 0:e.parentElement)||void 0===t?void 0:t.querySelector("button"),this.initLeadSources(),this.cleaningType=new I,this.officeSqrft=document.getElementById("office-detail-sqrft"),this.officeSqrft.maxLength=5,this.homeSqrft=document.getElementById("home-detail-sqrft"),this.homeSqrft.maxLength=5,this.weeklyFreq=document.getElementsByName("frequency-week-radio"),this.bathrooms=document.getElementById("office-detail-bathroom"),this.offices=document.getElementById("office-detail-offices"),this.resBathrooms=document.getElementById("home-detail-bathroom"),this.bedrooms=document.getElementById("home-detail-bedroom"),this.enableAutoFill="true"===(null===(o=document.getElementById("getPropertyDetails"))||void 0===o?void 0:o.value),this.populateDropdowns(this.offices.id),this.populateDropdowns(this.bathrooms.id),this.populateDropdowns(this.resBathrooms.id),this.populateDropdowns(this.bedrooms.id),this.initZipCode(),this.initListeners(),this.loadHereMapScripts(),this.bookingPayload=s.bookingPayload,this.bookingPayload.isTest=(0,s.isTestFcn)(),(0,d.getVendorDetails)().then(e=>{var t;this.bookingPayload.vendorId=Number(e.vendorId)||70,this.bookingPayload.vendorName=null!==(t=e.vend
3orName)&&void 0!==t?t:"Molly Maid Website"}).catch(e=>{console.log("Failed to get vendor details, using defaults:",e),this.bookingPayload.vendorId=70,this.bookingPayload.vendorName="Molly Maid Website"}),this.bookingPayload.country=(0,d.getCountryCodefromAssetpath)();const i=sessionStorage.getItem("campaignName");sessionStorage.setItem("bookingLeadSent","false"),this.bookingPayload.campaignName=i||(0,d.getCampaignName)(),(0,r.setDefaultLeadSource)().then(e=>{this.bookingPayload.leadSource=e.LeadSource||"Web",this.bookingPayload.leadSourceId=Number(e.LeadSourceID)||0}).catch(e=>{console.error("Error setting default Lead Source"),this.bookingPayload.leadSource="Web",this.bookingPayload.leadSourceId=0});const l=(0,v.DomainIdentifier)(),a=(0,g.getCountryCode)(),c=sessionStorage.getItem("countryCode");"ca"!=l&&"ca"!==a&&"ca"!==c||(0,f.hideTermsPolicy)(".mly-lead-started-form .contact-us-section .btn-container-mly","terms-policy-text"),(0,y.localizationMobileDBATitle)()}initializeModal(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;const o=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;try{const t=(yield(0,d.getBrandDetailsFromBrandJson)(o)).pause_lead_flag;(0,h.createModal)(e,t)}catch(e){console.error("Error fetching brand data:",e)}})}initZipCode(){const e=sessionStorage.getItem("sAddressParam");(0,m.isValidZip)(e)&&(this.zipCode.value=e),sessionStorage.removeItem("zipcode"),sessionStorage.removeItem("noZipNote")}loadHereMapScripts(){const e=(e,t)=>{const o=document.createElement("script");o.async=!1,o.src=e,o.id=t,document.head.appendChild(o)};e("https://js.api.here.com/v3/3.1/mapsjs-core.js","mapsjs-core-js"),e("https://js.api.here.com/v3/3.1/mapsjs-ui.js","mapsjs-ui-js")}initListeners(){this.firstName.addEventListener("input",e=>{e.preventDefault(),(0,i.handleInput)(this.firstName,!1)}),this.lastName.addEventListener("input",e=>{e.preventDefault(),(0,i.handleInput)(this.lastName,!1)}),this.email.addEventListener("input",e=>{this.emailInputEventListener(e)}),this.email.addEventListener("blur",e=>{this.validateForRealEmail()}),this.phoneNumber.addEventListener("input",e=>{e.preventDefault(),(0,i.handleInput)(this.phoneNumber,!1)}),this.address.addEventListener("input",e=>{e.preventDefault(),sessionStorage.setItem("suggestion","false"),(0,i.handleInput)(this.address,!1)}),this.address.addEventListener("input",this.setAutoSuggested.bind(this)),this.enableAutoFill&&this.address.addEventListener("focusout",e=>{this.handleAddressFocusOut()}),this.address2.addEventListener("input",e=>{e.preventDefault(),(0,i.handleInput)(this.address2,!1)}),this.zipCode.addEventListener("input",e=>{e.preventDefault(),(0,i.handleInput)(this.zipCode,!1)}),this.zipCode.addEventListener("focusout",this.handleFocusOut.bind(this)),this.preferMethods.forEach(e=>{e.addEventListener("input",e=>{e.preventDefault(),(0,i.handleCheckboxInput)(this.preferMethods)})}),this.homeSqrft&&(this.homeSqrft.addEventListener("input",e=>{e.preventDefault(),(0,i.validateSqrft)(),this.hasUserEdited=!0}),this.homeSqrft.addEventListener("focus",e=>{this.removeDynamicAutfillSuggestion()})),this.officeSqrft&&(this.officeSqrft.addEventListener("input",e=>{e.preventDefault(),(0,i.validateSqrft)(),this.hasUserEdited=!0}),this.officeSqrft.addEventListener("focus",e=>{this.removeDynamicAutfillSuggestion()}))}emailInputEventListener(e){e.preventDefault(),this.isEmailApiComplete=!1,this.displayEmailErrorFor("syntaxError"),(0,i.handleInput)(this.email,!1)}handleFocusOut(){var e;const t=null===(e=this.zipCode)||void 0===e?void 0:e.value.trim();(0,f.toggleTermsPolicyBasedOnCountry)(".mly-lead-started-form .contact-us-section .btn-container-mly",t)}handleAddressFocusOut(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=sessionStorage.getItem("suggestedAddress"),t=sessionStorage.getItem("suggestion");if(!e||!t)return;const o=JSON.parse(e);if(o.addr1&&"no address collected"===o.addr1.toLowerCase())return;const n=o.city,i=o.stateCode,s=o.addr1,r=o.postalCode;this.attomApiController&&this.attomApiController.abort(),this.attomApiController=new AbortController;const l={address1:s,city:n,state:i,zipcode:r,signal:this.attomApiController.signal};if(this.isAddressSame(l)&&this.attomResponseData)return void this.applyBedBathSqftValues(this.attomResponseData);if(this.attomResponseData=yield(0,c.getAttomDataByAddress)(l),!this.attomResponseData)return;this.applyBedBathSqftValues(this.attomResponseData)}catch(e){console.warn("Error fetching property details:",e)}})}enableDynamicAutoFillInfo(){if(!this.isAutoFilled)return;const e=this.cleaningType.getCleaningType().toLowerCase(),t=this.cleaningType.getCleaningFreq().toLowerCase(),o=e.includes("residential"),n=t.includes("one-time clean"),i=document.querySelector(".dynamic-autofill-info");if(!i)return;const s=i.querySelector(".autofill-info-cleantype-heading");s&&(o&&n&&(s.textContent="Property details",i.classList.contains("hidden")&&i.classList.remove("hidden")),o||(s.textContent="Office details",i.classList.contains("hidden")&&i.classList.remove("hidden")))}removeDynamicAutfillSuggestion(){this.isAutoFilled=!1;const e=document.querySelector(".dynamic-autofill-info");e&&(e.classList.contains("hidden")||e.classList.add("hidden"))}applyBedBathSqftValues(e){if(this.isAutoFilled=!0,this.hasUserEdited)return;const{beds:t,baths:o,sqft:n}=e;this.applyValueToInput(this.homeSqrft,n),this.applyValueToInput(this.officeSqrft,n),this.applyValueToDropDown(this.bedrooms,t),this.applyValueToDropDown(this.resBathrooms,o),this.applyValueToDropDown(this.offices,t),this.applyValueToDropDown(this.bathrooms,o)}isAddressSame(e){if(!this.attomRequestParam||!e)return this.attomRequestParam=e,!1;const t=this.attomRequestParam.address1===e.address1&&this.attomRequestParam.city===e.city&&this.attomRequestParam.state===e.state&&this.attomRequestParam.zipcode===e.zipcode;return t||(this.attomRequestParam=e),t}preferredCommunicationMethod(){const e=this.preferMethods;let t=[];
3return e&&e.forEach(e=>{if("checkbox"==e.type&&e.checked){let o="";e.id.toLowerCase().includes("text")?o="Text":e.id.toLowerCase().includes("phone")?o="Phone":e.id.toLowerCase().includes("mail")&&(o="Email"),t.push(o)}}),sessionStorage.setItem("PreferredCommunicationText",t.join(", ")),t.join(", ")}displayEmailErrorFor(e){const t=document.querySelector(".realtime-email-validation-error-message"),o=document.getElementById(`${this.email.name}-error-msg`);t&&o&&(console.log("elements present",o,t,"error type",e),"syntaxError"!==e?"sendGridError"===e&&(t.classList.contains("hidden")&&t.classList.remove("hidden"),o.classList.contains("hidden")||o.classList.add("hidden")):t.classList.contains("hidden")||t.classList.add("hidden"))}validateForRealEmail(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!this.email)return void console.error("Email field doesnt exist");const e=document.getElementById("conceptCode");let t;t=e?e.value:"MLY",this.emailValidationAbortController&&this.emailValidationAbortController.abort(),this.emailValidationAbortController=new AbortController,this.isEmailApiComplete=!1;const o=yield(0,b.validateEmail)({historyCount:5,signal:this.emailValidationAbortController.signal,value:this.email.value,conceptCode:t});o&&(this.isEmailApiComplete=!0,"SendGridResponseFalse"===o&&this.displayEmailErrorFor("sendGridError"),"EmailValidationPassed"===o&&this.displayEmailErrorFor("syntaxError"))})}initLeadSources(){var e,t;const o="mly-how-about-us",n=document.getElementById(o);if(n){const s=null===(e=n.parentElement)||void 0===e?void 0:e.querySelector("div.select-items"),l=null===(t=n.parentElement)||void 0===t?void 0:t.querySelector("button");(0,r.confirmMlyLeadSourceAPI)().then(e=>{let t=this;(0,c.getCachedAPIResponse)(e).then(e=>{(e=null==e?void 0:e.filter(e=>"Undefined"!==e.leadSourceName&&e.isActive)).forEach(e=>{const t=document.createElement("button"),n=e.leadSourceId?e.leadSourceId:e.syncGenericLeadSourceId?e.syncGenericLeadSourceId:"";t.setAttribute("data-type-lead-source-id",n),t.setAttribute("data-type-lead-source-name",e.leadSourceName),t.textContent=e.leadSourceName,t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),S(l),null==s||s.classList.add("select-hide"),l&&(l.textContent=t.getAttribute("data-type-lead-source-name"),l.value=t.getAttribute("data-type-lead-source-id"),l.classList.remove("select-arrow-active")),(0,i.validateDropdown)(o)}),null==s||s.appendChild(t)}),null==l||l.addEventListener("click",function(e){var o;e.stopPropagation(),t.closeAllSelect(this),null==s||s.classList.toggle("select-hide"),l.classList.toggle("select-arrow-active"),!this.classList.contains("select-arrow-active")&&(null==l?void 0:l.nextElementSibling)&&(null===(o=l.nextElementSibling)||void 0===o||o.classList.add("select-hide")),document.addEventListener("keydown",e=>{"Escape"===e.key&&(null==s||s.classList.add("select-hide"),l.classList.remove("select-arrow-active"))}),document.addEventListener("click",e=>{null==s||s.classList.add("select-hide"),l.classList.remove("select-arrow-active")}),S(l)})}).catch(e=>{console.log("Could not get lead sources in CLEO",e)})}).catch(e=>{throw e})}}getRadioBtnVal(e){const t=document.getElementsByName(e);for(const e of t)if(e.checked){return document.querySelector(`[for="${e.id}"]`).innerText}return""}closeAllSelect(e){const t=document.querySelectorAll(".mly-lead-started-form .select-items.slim-scroll"),o=document.querySelectorAll(".mly-lead-started-form .select-selected");t.forEach((t,n)=>{var i,s,r,l,a;e!==o[n]&&(t.classList.add("select-hide"),null===(s=null===(i=o[n])||void 0===i?void 0:i.classList)||void 0===s||s.remove("select-arrow-active"),(null===(r=o[n])||void 0===r?void 0:r.nextElementSibling)&&(null===(a=null===(l=o[n])||void 0===l?void 0:l.nextElementSibling)||void 0===a||a.classList.add("select-hide")))})}populateDropdowns(e){var t,o;const n=document.getElementById(e);if(n){const s=null===(t=n.parentElement)||void 0===t?void 0:t.querySelector("div.select-items"),r=null===(o=n.parentElement)||void 0===o?void 0:o.querySelector("button");s&&(s.innerHTML="");const l=null==n?void 0:n.querySelectorAll("option");let a=this;l.forEach(t=>{if(!t.innerText.toLowerCase().includes("select")){const o=document.createElement("button");o.textContent=null==t?void 0:t.value,o.value=null==t?void 0:t.value,o.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),r&&(r.textContent=o.textContent,r.value=o.value,n.setAttribute("selected-value",o.value),S(r),null==s||s.classList.add("select-hide"),r.classList.remove("select-arrow-active"),(0,i.validateDropdown)(e))}),null==s||s.appendChild(o)}}),null==r||r.addEventListener("click",function(e){var t;e.preventDefault(),e.stopPropagation(),a.closeAllSelect(this),a.hasUserEdited=!0,a.removeDynamicAutfillSuggestion(),null==s||s.classList.toggle("select-hide"),this.classList.toggle("select-arrow-active"),this.classList.contains("select-arrow-active")||(null==r?void 0:r.nextElementSibling)&&(null===(t=r.nextElementSibling)||void 0===t||t.classList.add("select-hide")),document.addEventListener("keydown",e=>{"Escape"===e.key&&(null==s||s.classList.add("select-hide"),r.classList.remove("select-arrow-active"))}),document.addEventListener("click",e=>{null==s||s.classList.add("select-hide"),r.classList.remove("select-arrow-active")}),S(r)})}}readForm(){var e,t;const o=sessionStorage.getItem("suggestedAddress"),n=sessionStorage.getItem("suggestion");this.bookingPayload.address=this.address.value,o&&n&&(this.bookingPayload.city=JSON.parse(o).city,this.bookingPayload.state=JSON.parse(o).stateCode,this.bookingPayload.address=JSON.parse(o).addr1),this.bookingPayload.firstName=this.firstName.value,this.bookingPayload.lastName=this.lastName.value,this.bookingPayload.email=this.email.value,this.bookingPayload.address2=this.address2.value?this.address2.value:"",this.bookingPayload.phone=this.phoneNumber.value,this.bookingPayload.zipCode=this.zipCode.value,this.bookingPayload.postalCode=this.bookingPayload.zipCode;const i=this.preferredCommunicationMethod();this.bookingPayload.optIn=i.toLowerCase().includes("text"),this.bookingPayload.preferredCommunicationType=this.preferredCommunicationMethod(),!(null===(t=null===(e=this.leadSourceBtn)||void 0===e?void 0:e.textContent)||void 0===t?void 0:t.toLowerCase().includes("select"))&&this.leadSourceBtn&&(this.bookingPayload.leadSource=this.leadSourceBtn.textContent,this.bookingPayload.leadSourceId=Number(this.leadSourceBtn.value));const s=this.cleaningType.getCleaningType().toLowerCase(),r=this.cleaningType.getCleaningFreq().toLowerCase();sessionStorage.setItem("CustomerType",s),sessionStorage.setItem("JobFrequency",r),this.flushPayloadprops()}readResidentialForm(){this.bookingPayload.customerType="Residential",this.cleaningType.getCleaningFreq().toLowerCase().includes("one-time")?(this.bookingPayload.jobFrequency="One-time",this.getRadioBtnVal("one-time-radio").toLowerCase().includes("move in/move out")?this.bookingPayload.jobFrequencyDetail
3="Move In or Move Out Clean":this.bookingPayload.jobFrequencyDetail="Not a Move In or Move Out Clean",this.bookingPayload.estimateBathrooms=this.resBathrooms.getAttribute("selected-value"),this.bookingPayload.estimateBedrooms=this.bedrooms.getAttribute("selected-value"),this.bookingPayload.estimateSquareFeet=this.homeSqrft.value):this.bookingPayload.jobFrequency="Recurring",sessionStorage.setItem("JobFrequency",this.bookingPayload.jobFrequency)}flushPayloadprops(){this.bookingPayload.estimateBathrooms="",this.bookingPayload.estimateSquareFeet="",this.bookingPayload.estimateBedrooms="",this.bookingPayload.jobFrequencyDetail=""}getSelectedFrequencyWeek(){var e,t;const o=document.getElementsByName("frequency-week-radio");if(!o||0===o.length)return"";for(const n of o)if(null==n?void 0:n.checked){const o=document.querySelector(`label[for="${n.id}"]`);return null!==(t=null!==(e=null==o?void 0:o.innerText)&&void 0!==e?e:null==n?void 0:n.value)&&void 0!==t?t:""}return""}readCommercialForm(){if(this.bookingPayload.customerType="Commercial",this.bookingPayload.isLeadOnly=!0,this.bookingPayload.estimateBathrooms=this.bathrooms.getAttribute("selected-value"),this.bookingPayload.estimateBedrooms=this.offices.getAttribute("selected-value"),this.bookingPayload.estimateSquareFeet=this.officeSqrft.value,this.cleaningType.getCleaningFreq().toLowerCase().includes("recurring")){this.bookingPayload.jobFrequency="Recurring";const e=this.getSelectedFrequencyWeek();e&&""!==(null==e?void 0:e.trim())&&(this.bookingPayload.jobFrequencyDetail=e)}else this.bookingPayload.jobFrequency="One-time",this.getRadioBtnVal("move-in-out-radio").toLowerCase().includes("yes")?this.bookingPayload.jobFrequencyDetail="Move In or Move Out Clean":this.bookingPayload.jobFrequencyDetail="Not a Move In or Move Out Clean";sessionStorage.setItem("JobFrequency",this.bookingPayload.jobFrequency)}setHeaderFooter(e){localStorage.setItem("franchiseWebLocationId",e.franchiseWebLocationId),sessionStorage.setItem("franchiseId",e.franchiseId),localStorage.setItem("doingBusinessAs",e.doingBusinessAs),localStorage.setItem("weblocationId",e.franchiseWebLocationId)}openPropertyValidationModal(e,t,o){var n,i;const s=function(e){try{return(null!=e||null!=e||"undefined"!=e)&&JSON.parse(e)}catch(e){return!1}}(t);if(s&&(null===(n=s.address)||void 0===n?void 0:n.label)!=e){(0,l.stopLoader)();const t=document.getElementById("address-modal");null==t||t.click();const o=document.querySelector('label[for="entered-address-radio"]'),n=document.querySelector('label[for="suggested-address-radio"]');o&&n&&(o.textContent=e,n.textContent=s.address.label),null===(i=document.querySelector(".cta-wrapper .primary-btn"))||void 0===i||i.addEventListener("click",()=>{let e;const t=document.getElementById("suggested-address-radio");if(null==t?void 0:t.checked){e=null==n?void 0:n.textContent,this.address.value=e,sessionStorage.setItem("suggestion","true");const t=(0,m.getAddressDetails)(s.address);(null==t?void 0:t.addr1)&&(this.bookingPayload.address=t.addr1),sessionStorage.setItem("suggestedAddress",JSON.stringify(t))}else sessionStorage.setItem("suggestion","false"),e=null==o?void 0:o.textContent,this.bookingPayload.address=C(this.bookingPayload,e);sessionStorage.setItem("bumper_address",e),this.retryLookupAPI()})}else o<2?this.callLookupAPI(o):this.retryLookupAPI()}openNearByLocationsModal(e){var t;(0,l.stopLoader)();const o=document.getElementById("user-zip-code");if(o){if(!document.getElementsByClassName("modalgrey").length){document.querySelector("body").insertAdjacentHTML("beforeend",'<div modal-backdrop="" class="bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40 modalgrey"></div>')}const i=null==e?void 0:e.length,s=null===(t=this.zipCode)||void 0===t?void 0:t.value,r=document.querySelector(".results-text");r&&(r.textContent=` ${i} Results for ${s}`);const l=document.querySelector(".user-zip-result-list");l.innerHTML="";const a=null==e?void 0:e.slice().sort((e,t)=>e.distance-t.distance);null==a||a.forEach(e=>{const t=document.createElement("li");t.className="user-zip-result-item";const o=Math.round(e.distance)+" mi.",n=e.websiteTrackingPhone?e.websiteTrackingPhone[0]:e.phoneNumber;t.innerHTML=`\n <div class="locaion-info">\n <div class="locaion-time">\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use>\n </svg>
3\n <span class="location-text">${o}</span>\n </div>\n <div class="locaion-name">\n <p class="location-main">${e.doingBusinessAs}</p>\n <a class="location-call" href="tel:${n}">(${n.slice(0,3)}) ${n.slice(3,6)}-${n.slice(6)}</a>\n </div>\n </div>\n <div class="locaion-btn">\n <a href="#" class="btn primary-btn">\n REQUEST ESTIMATE\n <svg aria-hidden="true" ><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>\n </a>\n </div>\n `,null==l||l.appendChild(t)}),o.style.display="flex",o.classList.remove("hidden");const c=document.querySelector(".user-zip-close-modal");null==c||c.addEventListener("click",function(e){var t;null==o||o.classList.add("hidden"),o.style.display="none",null===(t=document.querySelector(".modalgrey"))||void 0===t||t.remove()});const u=document.querySelectorAll(".locaion-btn .btn.primary-btn");let m=this;u.forEach(t=>{const o=m.bookingPayload;let i;t.addEventListener("click",function(t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,s;t.preventDefault();const r=this.closest("li.user-zip-result-item");if(r){const t=null===(n=r.querySelector(".location-main"))||void 0===n?void 0:n.textContent;i=e.find(e=>e.doingBusinessAs===t),yield(0,d.localizationHelper)([i],!0,!1),i&&(o.city=null==i?void 0:i.city,o.state=null==i?void 0:i.state,o.webLocationId=Number(null==i?void 0:i.franchiseWebLocationId),o.franchiseId=null==i?void 0:i.franchiseId,o.isLocalized=!!o.webLocationId,o.licenseNumber=null!==(s=null==i?void 0:i.licenseNumber)&&void 0!==s?s:""),m.formSubmissionLeadFlow(o)}})})})}}isManualAddress(){const e=sessionStorage.getItem("suggestion");return null!=e&&null!=e&&"false"==e}retryLookupAPI(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=yield(0,m.handleMissingData)(this.bookingPayload.city,this.bookingPayload.state,this.bookingPayload.postalCode);this.bookingPayload.city=null!==(e=null==o?void 0:o.city)&&void 0!==e?e:"No city found",this.bookingPayload.state=null!==(t=null==o?void 0:o.state)&&void 0!==t?t:"No state found",this.callLookupAPI(2)})}handleSubmit(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=document.querySelector("#form-section .mly-lead-started-form .contact-us-section");if(null==o||o.addEventListener("change",e=>{sessionStorage.setItem("bookingLeadSent","false")}),(0,i.validateForm)(o))if(this.isEmailApiComplete||(yield this.validateForRealEmail()),(0,l.startLoader)(),this.readForm(),this.isManualAddress()){const e=this.getFullAddress(),t=this.address.getAttribute("data-suggestion");this.openPropertyValidationModal(e,t,1)}else{const o=yield(0,m.handleMissingData)(this.bookingPayload.city,this.bookingPayload.state,this.bookingPayload.postalCode);this.bookingPayload.city=null!==(e=null==o?void 0:o.city)&&void 0!==e?e:"No city found",this.bookingPayload.state=null!==(t=null==o?void 0:o.state)&&void 0!==t?t:"No state found",this.callLookupAPI(1)}})}getFullAddress(){let e=" "+this.bookingPayload.city+" "+this.bookingPayload.state+" "+this.bookingPayload.postalCode;return e=this.address2.value?this.address.value.concat(" ",this.address2.value," ",this.bookingPayload.city," ",this.bookingPayload.state," ",this.bookingPayload.postalCode):this.address.value.concat(" ",this.bookingPayload.city," ",this.bookingPayload.state," ",this.bookingPayload.postalCode),e}setAddrParam(e){let t;if(e<2)t=this.bookingPayload.postalCode;else{let e=sessionStorage.getItem("bumper_address");t="null"!=e&&"undefined"!=e&&e&&e.includes(this.bookingPayload.city)&&e.includes(this.bookingPayload.state)&&e.includes(this.bookingPayload.postalCode)?e:this.getFullAddress()}return t}callLookupAPI(e){if((0,l.startLoader)(),e>2)this.handleNearbyLocationsFlow();else{let t=this.setAddrParam(e);this.isManualAddress()&&(this.bookingPayload.address=e>1?C(this.bookingPayload,t):this.address.value),(0,r.getFranchiseDetails)(t).then(t=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i,s;(null==t?void 0:t.length)>0&&t[0]?(yield(0,d.localizationHelper)(t,!0,!1),this.bookingPayload.webLocationId=Number(null===(o=t[0])||void 0===o?void 0:o.franchiseWebLocationId),this.bookingPayload.franchiseId=null===(n=t[0])||void 0===n?void 0:n.franchiseId,this.bookingPayload.isLocalized=!!this.bookingPayload.webLocationId,this.bookingPayload.licenseNumber=null!==(s=null===(i=t[0])||void 0===i?void 0:i.licenseNumber)&&void 0!==s?s:"",(0,r.payloadHelper)(this.bookingPayload),this.decideFlow()):(e++,this.callLookupAPI(e))})).catch(t=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i,s,r,a;"function"==typeof(null==t?void 0:t.then)&&(t=yield t);let c=null===(n=null===(o=null==t?void 0:t.response)||void 0===o?void 0:o.data)||void 0===n?void 0:n.message;if(c||(c=null==t?void 0:t.message),c||(c=""),"full address is needed to narrow down results"===c.toLowerCase()){let t;if((0,l.stopLoader)(),++e>2)this.handleNearbyLocationsFlow();else{t=this.isManualAddress()?this.getFullAddress():null===(s=JSON.parse(null===(i=this.address)||void 0===i?void 0:i.getAttribute("data-suggestion")))||void 0===s?void 0:s.address.label;const o=null===(r=this.address)||void 0===r?void 0:r.getAttribute("data-suggestion");this.openPropertyValidationModal(t,o,e)}}else{const e=null===(a=document.getElementById("conceptCode"))||void 0===a?void 0:a.value;(0,d.getBrandDetailsFromBrandJson)(e).then(e=>{e?this.handleErrorScenario(e.lead_contactapi):this.handleErrorScenario(!1)}).catch(e=>{this.handleErrorScenario(!1)})}}))}}decideFlow(){const e=this.cleaningType.getCleaningType().toLowerCase(),t=this.cleaningType.getCleaningFreq().toLowerCase();e.includes("commercial")?(this.readCommercialForm(),(0,r.callBookingApi)(this.bookingPayload)):e.includes("residential")&&(this.readResidentialForm(),(0,r.determineFlowType)(this.bookingPayload.webLocationId).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i,l,c,u,h;if(sessionStorage.removeItem("mollyEstimate"),sessionStorage.removeItem("noCalendarPricing"),sessionStorage.removeItem("PriceNote"),t.includes("recurring"))this.bookingPayload.isLeadOnly=!(null===(o=null==e?void 0:e.options)||void 0===o?void 0:o.optInForPOSScheduling),this.bookingPayload.isEstimate=null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.optInForPOSScheduling;else{this.bookingPayload.isLeadOnly=!(null===(i=null==e?void 0:e.options)||void 0===i?void 0:i.optInForPOSScheduling2),this.bookingPayload.isEstimate=!1;const t=yield(0,m.handleMissingData)(this.bookingPayload.city,this.bookingPayload.state,this.bookingPayload.postalCode);this.bookingPayload.city=null!==(l=null==t?void 0:t.city)&&void 0!==l?l:"No city found",this.bookingPayload.state=null!==(c=null==t?void 0:t.state)&&void 0!==c?c:"No state found",yield(0,r.calcEstimate)(this.bookingPayload)}if(sessionStorage.setItem("IsLeadOnly",this.bookingPayload.isLeadOnly.toString()),this.bookingPayload.isLeadOnly)(0,r.callBookingApi)(this.bookingPayload);else{const e=null===(u=document.getElementById("conceptCode"))||void 0===u?void 0:u.value;if((yield(0,d.getBrandDetailsFromBrandJson)(e)).pause_lead_flag){const e=document.querySelector(".heading-thanyou-text");if(e&&""!==(null===(h=null==e?void 0:e.textContent)||void 0===h?void 0:h.trim())){"false"===sessionStorage.getItem("bookingLeadSent")&&(s.bookingPayload.isLeadOnly=!0,s.bookingPayload.serviceText="Lead Only",s.bookingPayload.pauseLead=!0,sessionStorage.setItem("fakeBrowserCloseEvent","true"),yield(0,r.callBookingApi)(s.bookingPayload,!0),sessionStorage.removeItem("fakeBrowserCloseEvent"))}}(0,a.calendarFlowMLY)(this.bookingPayload)}})).catch(e=>{console.warn("Encountered error:",e),(0,r.callBookingApi)(this.bookingPayload)}))}handleNearbyLocationsFlow(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;let o;(0,d.getBrandDetailsFromBrandJson)(t).then(e=>{var t;if(null==e?void 0:e.enable_50mile_area_OSflow){const n=(null===(t=e.area_measure_values_OSflow)||void 0===t?void 0:t.includes("measure_km"))?"km":"miles",i=Number(e.nearest_franchiselimit_OSflow)||50;o=new u.NearbyLocations(n,i),this.searchLocationsFlow(o)}else this.handleErrorScenario(e.lead_contactapi)}).catch(e=>{this.handleErrorScenario(!1)})}searchLocationsFlow(e,t=!1){(0,l.stopLoader)(),e.searchNearbyLocations(this.zipCode.value).then(e=>{var o,n,i,s;document.getElementById("user-zip-code")&&(null==e?void 0:e.length)>1?this.openNearByLocationsModal(e):1==(null==e?void 0:e.length)?(this.setHeaderFooter(e[0]),this.bookingPayload.city=null===(o=e[0])||void 0===o?void 0:o.city,this.bookingPayload.state=null===(n=e[0])||void 0===n?void 0:n.state,this.bookingPayload.webLocationId=Number(null===(i=e[0])||void 0===i?void 0:i.franchiseWebLocationId),this.bookingPayload.franchiseId=Number(null===(s=e[0])||void 0===s?void 0:s.franchiseId),this.formSubmissionLeadFlow(this.bookingPayload)):null!=e&&0!=e.length||this.handleErrorScenario(t)}
3).catch(e=>{console.error("Error searching nearby locations:",e),this.handleErrorScenario(t)})}handleErrorScenario(e){if(e)try{this.cleaningType.getCleaningFreq().toLowerCase().includes("one-time")?sessionStorage.setItem("JobFrequency","One-Time"):sessionStorage.setItem("JobFrequency","Recurring"),(0,r.contactUsEndpoint)(this.bookingPayload)}catch(e){this.throwErrorModal()}else this.throwErrorModal()}throwErrorModal(){var e,t,o;(0,l.stopLoader)();const n=`We're sorry. We don't currently provide service to ${this.zipCode.value}.`;null===(e=document.getElementById("error-modal-id"))||void 0===e||e.click(),null===(t=document.getElementById("error-modal"))||void 0===t||t.classList.remove("hidden");const i=document.getElementById("modal-zipcode-error");i&&(i.textContent=n),null===(o=document.getElementById("modal-zipcode-error"))||void 0===o||o.classList.remove("hidden")}updateInputValue(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.error(`Error in updateInputValue function: ${e}`)}}formSubmissionLeadFlow(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;this.cleaningType.getCleaningType().toLowerCase().includes("commercial")?this.readCommercialForm():this.readResidentialForm(),e.isLeadOnly=!0,sessionStorage.setItem("IsLeadOnly",e.isLeadOnly);const o=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,n=yield(0,d.getBrandDetailsFromBrandJson)(o);sessionStorage.setItem("noZipNote",null==n?void 0:n.os_flow_50Mile_note),(0,r.callBookingApi)(e)})}}function L(){document.getElementById("mly_hide_preferred_contact")?sessionStorage.setItem("hidePreferMethod","true"):sessionStorage.setItem("hidePreferMethod","false")}function E(){var e,t;(0,l.stopLoader)();const o=document.querySelector(".user-zip-close-modal");null==o||o.click(),null===(e=document.getElementById("error-modal-id"))||void 0===e||e.click();const n=document.getElementById("error-modal");null==n||n.classList.remove("hidden"),null===(t=document.getElementById("modal-system-error"))||void 0===t||t.classList.remove("hidden");document.querySelector(".error-text-wrapper .error-btn-close").addEventListener("click",function(e){n.classList.add("hidden")})}function C(e,t){return t?(t=t.replace(/,/g,""),e.postalCode&&(t=(0,m.replaceLast)(t,e.postalCode,"")),e.state&&(t=(0,m.replaceLast)(t,e.state,"")),e.city&&(t=(0,m.replaceLast)(t,e.city,"")),e.address2&&(t=(0,m.replaceLast)(t,e.address2,"")),(0,m.setNAC)(t.trim())):(0,m.setNAC)(t)}document.addEventListener("DOMContentLoaded",()=>{var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,o=document.getElementsByClassName("mly-lead-started-form");if("MLY"===t&&(null==o?void 0:o.length)>0){const e=new w;(0,l.stopLoader)(),L(),document.querySelector("#progress").style.width="0%";let t=document.querySelectorAll(".progress-step");t[1].className.includes("prograssbar-length progress-step-active")&&(t[1].classList.remove("prograssbar-length"),t[1].classList.remove("progress-step-active")),e.cleaningType.toggleCleaningDiv(),e.cleaningType.cleaningType.forEach(t=>{null==t||t.addEventListener("click",()=>{e.cleaningType.toggleCleaningDiv(),e.enableDynamicAutoFillInfo()})}),e.cleaningType.cleaningFreq.forEach(t=>{null==t||t.addEventListener("click",()=>{e.cleaningType.toggleCleaningDiv(),e.enableDynamicAutoFillInfo()})});const o=document.querySelectorAll('input[name*="one-time-radio"]'),n=document.querySelectorAll('input[name*="move-in-out-radio"]');o.forEach(t=>{null==t||t.addEventListener("click",()=>{e.enableDynamicAutoFillInfo()})}),n.forEach(t=>{null==t||t.addEventListener("click",()=>{e.cleaningType.toggleCleaningDiv()})});document.querySelectorAll("#form-section .mly-lead-started-form .btn-next").forEach(t=>{null==t||t.addEventListener("click",t=>{e.handleSubmit()})})}})},"./src/js/opus2/nbly-brand/conditional_localization.ts"(e,t,o){"use strict";o.d(t,{ConditionalLocalization:()=>r});var n=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),i=o(/*! ../util/phoneNumberReplacement */"./src/js/opus2/util/phoneNumberReplacement.ts"),s=o(/*! ./helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts");class r{static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new r),this.instance}constructor(){this.templateCheckSet=new Set(["opus 2 agnostic lead flow template","opus 2 agnostic lead flow confirmation page"]),this.localStorageItemsToDelete=new Set(["dbaName","weblocationId","full_dbaName","local_weblocationId","localPhoneNumber","franchiseWebLocationId","doingBusinessAs","alternateConcept","dynamicMenuURLResponse","filterService","dynamicAccorInfo","countryCode","franchiseeName","socialIconsFooter","ourTeamObject","photoGalleryData","franchiseId"]),this.deleteLocalizedData=!0}init(){return this.conditionalLocalize()}conditionalLocalize(){return this.isNblyOrCorp()&&!this.pageTemplateCheck()?(console.log("Nbly or Corp brand - not using agnostic template"),this.deleteLocalization(),!1):(this.replaceLogoAndPhone(),!0)}pageTemplateCheck(){const e=(0,n.getPageSettings)("pagetemplate"),t=(null!=e?e:"").trim().toLowerCase();return!!t&&this.templateCheckSet.has(t)}isNblyOrCorp(){return(0,s.conceptIdLookupForNblyOrCorp)()}deleteLocalization(){if(this.deleteLocalizedData)try{this.localStorageItemsToDelete.forEach(e
3=>{localStorage.removeItem(e),sessionStorage.removeItem(e)})}catch(e){console.error("Error while deleting localization items from storage:",e)}}replaceLogoAndPhone(){const e=document.querySelector(".fb-des-para > .fb-tel"),t=document.querySelector(".brand-header"),o=null==t?void 0:t.querySelector(".brand-logo-wrapper");o&&(o.style.display="flex"),e&&this.setMobileNumber(null==e?void 0:e.innerText)}setMobileNumber(e){const t=String(e).replace(/\D/g,"").match(/(\d{0,3})(\d{0,3})(\d{0,4})/),o=document.querySelector(".fb-des-para > .fb-tel");return t&&o&&!(0,i.shouldSkipPhoneNumberProcessing)()&&(o.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`,o.href=`tel:${t[1]}${t[2]}${t[3]}`),o}}},"./src/js/opus2/nbly-brand/helper_functions.ts"(e,t,o){"use strict";o.d(t,{conceptIdForAllBrands:()=>c,conceptIdLookupForNblyOrCorp:()=>d,constructNblyObject:()=>m,formatCAPostalCode:()=>g,getBrandFilter:()=>y,isValidCAPostalCode:()=>v,returnBrandUrl:()=>u,validateLocalZipPostalCode:()=>f});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),s=o(/*! ../util/locationBasedBrandJson */"./src/js/opus2/util/locationBasedBrandJson.ts"),r=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),l=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts");const a=new Set(["19","255"].filter(e=>!!e&&e.trim().length>0).map(e=>e.trim().toLowerCase()));function d(){const e=document.getElementById("conceptId"),t=(null==e?void 0:e.value)?e.value.trim().toLowerCase():"";return!!t&&a.has(t)}function c(){var e;if(d()){const t=null===(e=(0,i.getPageSettings)("metaInfo"))||void 0===e?void 0:e.AlternateConceptId;return t||null}const t=document.getElementById("conceptId");return(null==t?void 0:t.value)||null}function u(){var e;if(d()){const t=null===(e=(0,i.getPageSettings)("metaInfo"))||void 0===e?void 0:e.PageDomain;if(t)return t}return null}function m(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=(0,s.getBrandJSON)();if("Error validating Location"===e)return console.error("Error determining BrandJSON path for given location"),[];const t="undefined"!=typeof window?window.location.origin:"",o=yield(0,r.cachedAPIWrapper)(`${t}/${e}`);return Array.isArray(o)?o:[]}catch(e){return console.error("Error fetching BrandJSON:",e),[]}})}(),t="undefined"!=typeof window?window.location.origin:"",o=e.map(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){const{url:o,"www-url":i}=function(e){const t=p(null!=e?e:""),o=/^(https?)/.exec(t);if(!o)return{url:t,"www-url":`www${t}`};const n=o[0],i=t.slice(n.length);return{url:t.replace(/^https?www/,n),"www-url":`${n}www${i.replace(/^www/,"")}`}}(e.url);if(!o||!i)return null;const s=`${t}/brand/_assets/images/multiple-brand-logo/${p(e.code)}-brand-logo.svg`,r=yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(h.has(e))return h.get(e);const t=yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{return(yield fetch(e,{method:"HEAD"})).ok}catch(e){return!1}})}(e);return h.set(e,t),t})}(s);if(!r)return null;const l={code:p(e.code),name:p(e.name),url:o,"www-url":i,vendorName:p(e.vendorName),imageUrl:s,redirectUrl:e.url};return e.secondary_domains.forEach((e,t)=>{l[`secondaryDomainName${t}`]=p(e.domainName)}),l}));return(yield Promise.all(o)).filter(e=>null!==e)})}const h=new Map;function p(e){return(t=null!=e?e:"",t.replace(/[^a-zA-Z0-9]/g,"")).toLowerCase();var t}function v(e){if(!e)return!1;const t=e.trim().toUpperCase();return l.REGEX.caPostalCodeFSA.test(t)||l.REGEX.caPostalCodeFull.test(t)}function g(e){var t;const o=null!==(t=null==e?void 0:e.trim().toUpperCase())&&void 0!==t?t:"";return v(o)&&6===o.length?`${o.substring(0,3)} ${o.substring(3)}`:o}function f(e){const t="ca"===window.location.href.toLowerCase().split("/")[3]?"ca":"us";"string"!=typeof e&&(e=e.toString());const o=e.trim();return"ca"===t?v(o):"us"===t&&(function(e){if(!e)return!1;const t=e.trim();return l.REGEX.usZipCode.test(t)}(o)||v(o))}function y(e,t){const o=p(e).toLowerCase(),n=localStorage.getItem("nblyBrands");if(!n)return[];try{const e=JSON.parse(n),i=function(e){const t=e.some(e=>{var t,o;return"mhm"===(null===(t=e.code)||void 0===t?void 0:t.toLowerCase())&&"mrhandyman"===(null===(o=e.name)||void 0===o?void 0:o.toLowerCase())});return t?e.filter(e=>{var t;return"myhandyman"!==(null===(t=e.name)||void 0===t?void 0:t.toLowerCase())}):e}
3(e.filter(e=>Object.values(e).some(e=>"string"==typeof e&&e.toLowerCase().includes(o)))).sort((e,t)=>e.name.localeCompare(t.name));let s=[];return i.length>0&&i.forEach(e=>{s.push(function(e,t){var o,n;let i=null==e?void 0:e.redirectUrl;if(v(t)){["mrr","mra","juk","mrh","mhm","asv","pds","guy"].includes(null!==(n=null===(o=null==e?void 0:e.code)||void 0===o?void 0:o.toLowerCase())&&void 0!==n?n:"")&&"myhandyman"!==(null==e?void 0:e.name)&&((s=i).includes("nblysbx")||s.includes("nblydev")||s.includes("nblytest")?(i=i.replace("-stage","-ca-stage"),i=i.replace("-test","-ca-test"),i=i.replace("-dev","-ca-dev")):(i=i.replace(".nblyprod","-ca.nblyprod"),i=i.replace(".com",".ca")))}var s;return`<li class="brand-item">\n <a href="${i}" class="brand-link" target="_blank">\n <img src="${e.imageUrl}" alt="${e.name}" class="brand-logo" width="auto" height="50">\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/_assets-global/images/hero-icon-sprite.svg#arrow-up-right"></use>\n </svg>\n </a>\n </li>`}(e,t))}),s}catch(e){return console.error("Error parsing nblyBrands from localStorage:",e),[]}}},"./src/js/opus2/nbly-brand/nbly-brand-contactus.ts"(e,t,o){"use strict";o.d(t,{NblyBrandContactUs:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/POST-Requests/apiSendNblyBrandEmail */"./src/js/opus2/apiCaching/POST-Requests/apiSendNblyBrandEmail.ts");class s{constructor(){}static getInstance(){return s.instance||(s.instance=new s),s.instance}constructPayload(e){var t,o,n,i;if(!e.email)return;return[{sender:null!==(t="[email protected]")?t:"",templateId:null!==(o="d-3262a6c6909448c49b6666a1c73edeb8")?o:"",receiver:e.email,EmailObject:{firstName:e.firstName,lastName:e.lastName}},{sender:null!==(n="[email protected]")?n:"",templateId:null!==(i="d-6ca48fc147c143f2bd2cce11f944a98d")?
3i:"",receiver:"[email protected]",EmailObject:{firstName:e.firstName,lastName:e.lastName,phoneNumber:e.phone,postalCode:e.zipCode,emailAddress:e.email,message:e.comments}}]}callParallelEmails(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=this.constructPayload(e);if(!t)return void console.error("No payloads generated from constructPayload");const[o,n]=t,s=yield Promise.allSettled([(0,i.sendNblyBrandEmailWrapper)(o),(0,i.sendNblyBrandEmailWrapper)(n)]);s.forEach((e,t)=>{const o=0===t?"self":"switchboard";"rejected"===e.status&&console.error(`Failed to send ${o} email:`,e.reason)});if(s.every(e=>"rejected"===e.status))throw new Error("All email sends failed")})}}s.instance=null},"./src/js/opus2/offers/offers-popup.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),l=o(/*! ../util/specialOffersTimer */"./src/js/opus2/util/specialOffersTimer.ts");document.addEventListener("DOMContentLoaded",function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if(!document.getElementById("sp-offer-modal"))return;let t,o=0,a=1e4;const d=function(){const e=document.getElementById("sp-offer-modal");return!!e&&"enable"===e.dataset.lookup}();if(d){const t=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=localStorage.getItem("dbaName"),t=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null;if(e&&(null==t?void 0:t.include_statename)){let t=window.crownpeakWeblocationsByIdDetail;return t?`${window.location.origin}/specialoffermodalpopup/${e}/${null==t?void 0:t.stateName}`:(yield(0,r.fetchCrownpeakUrlDetails)(),t=window.crownpeakWeblocationsByIdDetail,t?`${window.location.origin}/specialoffermodalpopup/${e}/${null==t?void 0:t.stateName}`:`${window.location.origin}/specialoffermodalpopup/${e}`)}return e?`${window.location.origin}/specialoffermodalpopup/${e}`:`${window.location.origin}/specialoffermodalpopup/none`})}();try{const e=yield(0,i.getCachedAPIResponse)(t,s.apiCaching.OffersPopup),{SpecialOfferExists:o}=e;o&&!sessionStorage.getItem("splOfferModalShown")&&(a=yield(0,l.getExitPopupTimerValue)(),c())}catch(t){404!==(null===(e=t.response)||void 0===e?void 0:e.status)&&console.error("Error fetching data:",t)}}else sessionStorage.getItem("splOfferModalShown")||(a=yield(0,l.getExitPopupTimerValue)(),c());function c(){o=0,t=setInterval(u,1e3),document.addEventListener("mousemove",m),document.addEventListener("keypress",m),document.addEventListener("click",m),document.addEventListener("scroll",m)}function u(){o+=1e3,o>a&&(!function(){const e=document.getElementById("sp-offer-modal"),t=document.querySelector(".sp-offer-modal .close-modal-btn");if(!e||!t)return;e.classList.remove("hidden"),e.classList.add("flex"),e.style.backgroundColor="#00000066",sessionStorage.setItem("splOfferModalShown","true"),t.addEventListener("click",()=>{e&&(e.classList.add("hidden"),e.classList.remove("flex"),e.style.backgroundColor="")})}(),clearInterval(t))}function m(){o=0}})})},"./src/js/opus2/photo_gallery/index.ts"(e,t,o){"use strict";o(/*! ./photoGallery */"./src/js/opus2/photo_gallery/photoGallery.ts")},"./src/js/opus2/photo_gallery/photoGallery.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! tiny-slider */"./node_modules/tiny-slider/dist/tiny-slider.js"),s=o(/*! ../header/dynamicInjectMenu */"./src/js/opus2/header/dynamicInjectMenu.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),a=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),d=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts");class c{static create(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return c.instance||(c.instance=new c,yield c.instance.initialize()),c.instance})}static getInstance(){return c.instance||(c.instance=new c),c.instance}constructor(){var e,t,o;this.slideIndex=1,this.prevBtn=(0,a.removeElementEventListeners)(document.querySelector(".photo-gallery-section.content_ces .gallery-modal .prev")),this.nextBtn=(0,a.removeElementEventListeners)(document.querySelector(".photo-gallery-section.content_ces .gallery-modal .next")),this.initialized=!1,this.modal=document.querySelector(".photo-gallery-section.content_ces #galleryModal"),this.photoSection=document.querySelector(".photo-gallery-section.content_ces");const n=null===(e=this.photoSection)||void 0===e?void 0:e.querySelector(".gallery-modal .close");null==n||n.addEventListener("click",()=>{this.closeModal()}),null===(t=this.prevBtn)||void 0===t||t.addEventListener("click",()=>{this.changeSlide(-1)}),null===(o=this.nextBtn)||void 0===o||o.addEventListener("click",()=>{this.changeSlide(1)})}initialize(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.initialized||(yield this.fetchImageData(),this.initialized=!0)})}fetchImageData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=localStorage.getItem("franchiseWebLocationId"),t=document.getElementById("weblocationId");let o;o=(null==t?void 0:t.value)?null==t?void 0:t.value:e||0;const a=(0,d.conceptIdForAllBrands)();if(!a)return;const c=`${r.apiConfig.PhotosAPI}/${o}/${a}/0?skip=100`,u=`${r.apiConfig.PhotoCategoriesAPI}/${o}/${a}`;Promise.all([(0,l.cachedAPIWrapper)(c),(0,l.cachedAPIWrapper)(u)]).then(e=>(0,n.__awaiter)(this,[e],void 0,function*([e,t]){var o,n,r;const l=e,a=t,d=null!==(o=null==l?void 0:l.photos)&&void 0!==o?o:[];localStorage.setItem("galleryPhotos",JSON.stringify(d));const c=s.default.getInstance();yield c.fetchPhotoGalleryData();const u=null!==(n=null==a?void 0:a.photoGalleryCategories)&&void 0!==n?n:[];if(this.photoSection&&d.length>5){this.populateGallery(d,u);const e=document.querySelector(".photo-gallery-section.content_ces .gallery-slider");e&&(e=>{const t=(0,i.tns)({container:e,items:1,loop:!1,slideBy:"page",nav:!0,navPosition:"bottom",controlsText:['<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-left-white"></use></svg>','<svg aria-hidden="true" class="slider-control"><use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#chevron-right-white"></use></svg>'],responsive:{1024:{items:2},1200:{items:3}}});let o=e.getElementsByTagName("li").length;const n=()=>{let e=window.innerWidth;if(o<=3&&e>1300){null==t||t.destroy();const e=document.querySelector(".gallery-wrapper");e&&(e.style.maxWidth="100%")}};window.addEventListener("load",n),window.addEventListener("resize",n)})(e)}else this.photoSection&&(this.photoSection.style.display="none");null===(r=document.querySelector("#skeleton-gallery-wrapper"))||void 0===r||r.classList.add("hidden")}
3)).catch(e=>{console.log("Error fetching data:",e)})})}changeSlide(e){this.currentSlide(this.slideIndex+e)}photoUrlFun(){let e="";const t="https://www.mrhandyman.com/";return t&&(e=t.indexOf("-dev")>0?t.replace("-dev","-stage").replace("nblysbx","nblytest"):t.indexOf("-test")>0?t.replace("-test","-stage").replace("nblydev","nblytest"):t.indexOf("-stage")>0?t.replace("-stage","").replace("nblytest","nblyprod"):t),e}populateGallery(e,t){const o=(0,d.conceptIdLookupForNblyOrCorp)();let n=`${window.location.origin}/`;o&&(0,d.returnBrandUrl)()&&(n=`${(0,d.returnBrandUrl)()}/`);const i=document.querySelector(".photo-gallery-section.content_ces .gallery-wrapper .photo-gallery-list");if(!i||!Array.isArray(e))return void console.warn("Gallery list or image data is invalid.");i.innerHTML="";let s="";e.forEach((t,o)=>{var i;const r=document.createElement("li");r.classList.add("photo-gallery-item");const l=document.createElement("div");l.classList.add("gallery-card");const a=document.createElement("div");a.classList.add("card-img");const d=document.createElement("img"),c=null!==(i=t.thumbnailURL)&&void 0!==i?i:t.imageURL;d.src=c?`${n}photos/${c}`:"",d.alt=t.altText,d.width=321,d.height=256,d.addEventListener("click",()=>{this.openModal(e,n),this.currentSlide(o+1)});const u=document.createElement("div");u.classList.add("card-body");const m=document.createElement("span");m.classList.add("card-title"),m.innerHTML=t.shortCaption?`${t.shortCaption} -`:"";const h=document.createElement("span");h.classList.add("card-desc"),h.innerHTML=t.longCaption?t.longCaption:"",h.style.whiteSpace="normal",a.appendChild(d),u.appendChild(m),u.appendChild(h),l.appendChild(a),l.appendChild(u),r.appendChild(l),s+=r.outerHTML}),i.addEventListener("click",t=>{const o=t.target;if(o instanceof HTMLImageElement){const t=Array.from(i.querySelectorAll("img")).indexOf(o);this.openModal(e,n),this.currentSlide(t+1)}}),i.innerHTML=s}openModal(e,t){if(this.modal){this.modal.style.display="flex";const o=document.querySelector(".photo-gallery-section.content_ces #galleryModal .modal-content");if(o){let n="";o.innerHTML="",e.forEach((e,o)=>{const i=document.createElement("li");i.classList.add("pop-up-slider");const s=document.createElement("div");s.classList.add("gallery-card");const r=document.createElement("div");r.classList.add("card-img");const l=document.createElement("img");l.src=e.imageURL?`${t}photos/${e.imageURL}`:"",l.alt=e.altText,l.width=321,l.height=256,r.appendChild(l);const a=document.createElement("div");a.classList.add("card-body");const d=document.createElement("span");d.classList.add("card-title"),d.textContent=e.shortCaption?`${e.shortCaption} -`:"";const c=document.createElement("span");c.classList.add("card-desc"),c.textContent=e.longCaption?e.longCaption:"",a.appendChild(d),a.appendChild(c),s.appendChild(r),s.appendChild(a),i.appendChild(s),n+=i.outerHTML}),o.innerHTML=n}}}closeModal(){this.modal&&(this.modal.style.display="none")}currentSlide(e){this.slideIndex=e,this.showSlides(e)}showSlides(e){var t;let o;const n=document.querySelectorAll(".photo-gallery-section.content_ces .pop-up-slider");if(0!==(null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0)){for(e>n.length&&(this.slideIndex=1),e<1&&(this.slideIndex=n.length),o=0;o<n.length;o++)n[o].style.display="none";n[this.slideIndex-1].style.display="flex",this.prevBtn&&(1===this.slideIndex?this.prevBtn.disabled=!0:this.prevBtn.disabled=!1),this.nextBtn&&(this.slideIndex===n.length?this.nextBtn.disabled=!0:this.nextBtn.disabled=!1)}}}document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){document.querySelector(".photo-gallery-section.content_ces")&&(yield c.create())}))},"./src/js/opus2/router/background-job/background-fetch-chunks.ts"(e,t,o){"use strict";o.d(t,{backgroundFetchChunks:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),r=o(/*! ../../config/apiConfig */"./src/js/opus2/config/apiConfig.ts");function l(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=`${r.apiConfig.CHUNKING_MANIFEST}?v=${Date.now()}`;try{const n=yield(0,i.cachedAPIWrapper)(o,0,!1);(0,s.isTestEnvironment)()&&console.log("[Chunk] manifest response",n);const r=[],l=n.chunks;for(const o of l)(null===(e=o.files[0])||void 0===e?void 0:e.includes("o2/opus2"))&&(null===(t=o.publicUrls[0])||void 0===t?void 0:t.includes("o2/opus2"))&&r.push(o.publicUrls[0]);(0,s.isTestEnvironment)()&&console.log("[Chunk] chunklist",r),r.length>0&&function(e){var t;if(!(null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller))return void console.warn("[Chunk] Service worker not available, falling back to direct fetch");const o=globalThis.location.origin,n=e.map(e=>e.startsWith(o)||e.startsWith("http://")||e.startsWith("https://")?e:`${o}${e}`),i=Array.from(new Set(n));(0,s.isTestEnvironment)()&&console.log("[Chunk] Sending prefetch request to service worker:",i);navigator.serviceWorker.controller.postMessage({type:"PREFETCH_CHUNKS",urls:i,origin:o})}(r)}catch(e){console.warn("[Chunk] unable to fetch the chunking manifest",e)}})}},"./src/js/opus2/router/modulePaths/brand-json-loader.ts"(e,t,o){"use strict";o.d(t,{BrandJsonLoader:()=>r});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts"),s=o(/*! ../../util/share */"./src/js/opus2/util/share.ts");
3class r{constructor(){this.conceptId="",this.routerHelper=i.RouterHelper.getInstance(),this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new r),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;try{this.conceptId=null!==(t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value)&&void 0!==t?t:"",this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"BrandJsonLoader"}getStatus(){return Object.assign({},this.status)}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.brandJsonModules()})}getBrandJson(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.brandJson||(this.brandJson=yield(0,s.getBrandDetailsFromBrandJson)(this.conceptId)),this.brandJson})}brandJsonModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.status.isLoading=!0;try{const e=yield this.getBrandJson();if(!e)return void this.routerHelper.routerConsoleLog("Brand JSON failed to load - no data returned",!0,"BrandJsonLoader");this.routerHelper.routerConsoleLog("Brand JSON loaded successfully",!1,"BrandJsonLoader"),this.status.loadedModules.push("brand-json"),yield this.loadBrandSpecificModules(e)}catch(e){const t=e instanceof Error?e.message:String(e);throw this.status.failedModules.push("brand-json"),this.status.lastError=t,this.routerHelper.routerConsoleLog(`Brand JSON failed to load - ${t}`,!0,"BrandJsonLoader"),e}finally{this.status.isLoading=!1}})}loadBrandSpecificModules(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){})}}},"./src/js/opus2/router/modulePaths/brand-loader.ts"(e,t,o){"use strict";o.d(t,{BrandLoader:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts");class s{constructor(){this.routerHelper=i.RouterHelper.getInstance(),this.conceptId="",this.currentBrand="",this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1},this.conceptIDMap=new Map([["3",()=>"ASV"],["24",()=>"DVW"],["4",()=>"FSP"],["5",()=>"MDG"],["6",()=>"GUY"],["25",()=>"HMS"],["30",()=>"JUK"],["29",()=>"LAP"],["1",()=>"MLY"],["18",()=>"MOJ"],["8",()=>"MRA"],["9",()=>"MRE"],["2",()=>"MRH"],["10",()=>"MRR"],["14",()=>"PLG"],["27",()=>"PDS"],["11",()=>"RBW"],["26",()=>"SHG"],["16",()=>"WDG"]])}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new s),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n;try{this.conceptId=null!==(t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value)&&void 0!==t?t:"",this.currentBrand=null!==(n=null===(o=this.conceptIDMap.get(this.conceptId))||void 0===o?void 0:o())&&void 0!==n?n:"",this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"BrandLoader"}getStatus(){return Object.assign({},this.status)}getCurrentBrand(){return this.currentBrand}getConceptId(){return this.conceptId}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.brandModules()})}brandModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(this.currentBrand){this.status.isLoading=!0;try{switch(this.currentBrand){case"MLY":yield this.routerHelper.loadModuleSafely("mly",()=>Promise.resolve().then(o.bind(o,/*! ../../mly/index */"./src/js/opus2/mly/index.ts")),"Molly"),this.status.loadedModules.push("mly");break;case"HMS":yield this.routerHelper.loadModuleSafely("hms",()=>Promise.resolve().then(o.bind(o,/*! ../../hms/index */"./src/js/opus2/hms/index.ts")),"HMS"),this.status.loadedModules.push("hms")}}catch(e){throw this.status.failedModules.push(this.currentBrand),this.status.lastError=e instanceof Error?e.message:String(e),e}finally{this.status.isLoading=!1}}else this.routerHelper.routerConsoleLog("No brand detected, skipping brand module loading",!1,"BrandLoader")})}}},"./src/js/opus2/router/modulePaths/conditional-page-loader.ts"(e,t,o){"use strict";o.d(t,{ConditionalPageLoader:()=>r});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts"),s=o(/*! ../../util/dom-loader-check */"./src/js/opus2/util/dom-loader-check.ts");
3class r{constructor(){this.routerHelper=i.RouterHelper.getInstance(),this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new r),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"ConditionalPageLoader"}getStatus(){return Object.assign({},this.status)}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.loadConditionalPageModules()})}loadConditionalFeatureModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.routerHelper.routerConsoleLog("ConditionalPageLoader does not handle feature modules",!1,"ConditionalPageLoader")})}loadConditionalPageModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.status.isLoading=!0;try{const e=globalThis.location.href;e.includes("gift-certificate-image")&&(yield this.routerHelper.loadModuleSafely("gift-certificate-image",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | gift-certificate-image-loader */"gift-certificate-image-loader").then(o.bind(o,/*! ../../mly/gift-certification-image */"./src/js/opus2/mly/gift-certification-image.ts"));return e.GiftCertificateImage&&(0,s.initOnceWithDOMReady)("GiftCertificateImage",()=>{e.GiftCertificateImage.getInstance()}),e}),"GiftCertificateImage"),this.status.loadedModules.push("gift-certificate-image")),this.routerHelper.routerConsoleLog("Conditional page modules loading completed",!1,"ConditionalPageLoader")}catch(e){const t=e instanceof Error?e.message:String(e);throw this.status.failedModules.push("conditional-page-modules"),this.status.lastError=t,this.routerHelper.routerConsoleLog(`Failed to load conditional page modules - ${t}`,!0,"ConditionalPageLoader"),e}finally{this.status.isLoading=!1}})}}},"./src/js/opus2/router/modulePaths/dom-loader.ts"(e,t,o){"use strict";o.d(t,{DomLoader:()=>a});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts"),s=o(/*! ../../location-search-map/models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts"),r=o(/*! ../../location-search-map/reportScreenSize */"./src/js/opus2/location-search-map/reportScreenSize.ts"),l=o(/*! ../../util/dom-loader-check */"./src/js/opus2/util/dom-loader-check.ts");class a{constructor(){this.routerHelper=i.RouterHelper.getInstance(),this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new a),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"DomLoader"}getStatus(){return Object.assign({},this.status)}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.domModules()})}domModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.status.isLoading=!0;try{const e=[{selector:".insurance-form-section",moduleName:"Insuranceform",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield Promise.all(/*! import() | insurance-form-loader */[o.e("vendor"),o.e("insurance-form-loader")]).then(o.bind(o,/*! ../../insurance/InsuranceForm */"./src/js/opus2/insurance/InsuranceForm.ts"));return e.InsuranceForm&&(0,l.initOnceWithDOMReady)("InsuranceForm",()=>{e.InsuranceForm.getInstance?e.InsuranceForm.getInstance():new e.InsuranceForm}),e}),instanceName:"InsuranceForm"},{selector:".st-prequal-show",moduleName:"CustomerFinancing",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | customer-financing-loader */"customer-financing-loader").then(o.bind(o,/*! ../../financing/customer-financing */"./src/js/opus2/financing/customer-financing.ts"));return e.CustomerFinancing&&(0,l.initOnceWithDOMReady)("CustomerFinancing",()=>{globalThis.__CustomerFinancingInitialized||(e.CustomerFinancing.getInstance?e.CustomerFinancing.getInstance():new e.CustomerFinancing,globalThis.__CustomerFinancingInitialized=!0)}),e}),instanceName:"CustomerFinancing"},{selector:"#insurance-confirmation",moduleName:"InsuranceConfirmation",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | insurance-confirmation-loader */"insurance-confirmation-loader").then(o.bind(o,/*! ../../insurance/insuranceConfirmation */"./src/js/opus2/insurance/insuranceConfirmation.ts"));return e.InsuranceConfirmation&&(0,l.initOnceWithDOMReady)("InsuranceConfirmation",()=>{e.InsuranceConfirmation.getInstance?e.InsuranceConfirmation.getInstance():new e.InsuranceConfirmation}),e}),instanceName:"InsuranceConfirmation"},{selector:"#financing-form, #finance-confirmation",moduleName:"Financeform",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | finance-form-loader */"finance-form-loader").then(o.bind(o,/*! ../../finance/index */"./src/js/opus2/finance/index.ts"));return e.FinancesService&&(0,l.initOnceWithDOMReady)("FinancesService",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t;if(globalThis.__FinancesServiceInitialized)return;(document.getElementById("financing-form")||document.getElementById("finance-confirmation"))&&(globalThis.__FinancesServiceInitialized=!0,(null===(t=e.FinancesService)||void 0===t?void 0:t.create)?yield e.FinancesService.create():e.FinancesService&&new e.FinancesService([]));const o=localStorage.getItem("doingBusinessAs");if(o){const e=document.querySelector(".finance-sub-heading");e&&(e.classList.remove("hidden"),e.innerHTML=o)}})),e}),instanceName:"FinancesService"},{selector:".refer-wrapper",moduleName:"Referform",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | refer-form-loader */"refer-form-loader").then(o.bind(o,/*! ../../refer/index */"./src/js/opus2/refer/index.ts"));return e.ReferralService&&(0,l.initOnceWithDOMReady)("ReferralService",()=>{if(globalThis.__ReferralServiceInitialized)return;document.querySelector(".refer-wrapper")&&(globalThis.__ReferralServiceInitialized=!0,new e.ReferralService)}),e}),instanceName:"ReferralService"},{selector:".reward-form-section",moduleName:"RewardForm",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | reward-form-loader */"reward-form-loader").then(o.bind(o,/*! ../../reward/reward */"./src/js/opus2/reward/reward.ts"));return e.RewardForm&&(0,l.initOnceWithDOMReady)("RewardForm",()=>{if(globalThis.__RewardFormInitialized)return;document.querySelector(".reward-form-section")&&(globalThis.__RewardFormInitialized=!0,new e.RewardForm)}),e}),instanceName:"RewardForm"},{selector:"#reward-confirmation",moduleName:"RewardConfirmation",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | reward-confirmation-loader */"reward-confirmation-loader").then(o.bind(o,/*! ../../reward/rewardConfirmation */"./src/js/opus2/reward/rewardConfirmation.ts"));return e.RewardConfirmation&&(0,l.initOnceWithDOMReady)("RewardConfirmation",()=>{globalThis.__RewardConfirmationInitialized||(globalThis.__RewardConfirmationInitialized=!0,e.RewardConfirmation.getInstance?e.RewardConfirmation.getInstance():new e.RewardConfirmation)}),e}),instanceName:"RewardConfirmation"},{selector:"#ask-question-form",moduleName:"FormHandlerAskQuestion",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | askquestion-form-loader */"askquestion-form-loader").then(o.bind(o,/*! ../../ask-aquestion/index */"./src/js/opus2/ask-aquestion/index.ts"));return e.FormHandlerAskQuestion&&(0,l.initOnceWithDOMReady)("FormHandlerAskQuestion",()=>{globalThis.__AskQuestionFormInitialized||(globalThis.__AskQuestionFormInitialized=!0,e.FormHandlerAskQuestion.getInstance())}),e}),instanceName:"FormHandlerAskQuestion"},{selector:"#papers-download-form",moduleName:"FormHandlerAskQuestionWhitePaper",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | whitepaper-form-loader */"whitepaper-form-loader").then(o.bind(o,/*! ../../white-paper/index */"./src/js/opus2/white-paper/index.ts"));return e.FormHandlerAskQuestionWhitePaper&&(0,l.initOnceWithDOMReady)("FormHandlerAskQuestionWhitePaper",()=>{globalThis.__WhitePaperFormInitialized||(globalThis.__WhitePaperFormInitialized=!0,e.FormHandlerAskQuestionWhitePaper.getInstance())}),e}),instanceName:"FormHandlerAskQuestionWhitePaper"},{selector:".transformation-section.testimonials .transformation-carousel-wrap",moduleName:"ClientTransformCarousel",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | clientCarousel-loader */"clientCarousel-loader").then(o.bind(o,/*! ../../carouselVersion2/index */"./src/js/opus2/carouselVersion2/index.ts"));return e.ClientTransformCarousel&&(0,l.initOnceWithDOMReady)("ClientTransformCarousel",()=>{e.ClientTransformCarousel.getInstance().getData()}),e}),instanceName:"ClientTransformCarousel"},{selector:".author-section",moduleName:"AuthorProfilePage",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | authorprofile-loader */"authorprofile-loader").then(o.bind(o,/*! ../../components/index */"./src/js/opus2/components/index.ts"));return e.AuthorProfilePage&&(0,l.initOnceWithDOMReady)("AuthorProfilePage",()=>{if(globalThis.__AuthorProfilePageInitialized)return;document.querySelector(".author-section")&&(globalThis.__AuthorProfilePageInitialized=!0,e.AuthorProfilePage.getInstance())}),e}),instanceName:"AuthorProfilePage"},{selector:".process-component",moduleName:"ProcessComponent",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | process-component-loader */"process-component-loader").then(o.bind(o,/*! ../../components/processComponent */"./src/js/opus2/components/processComponent.ts"));return e.ProcessComponent?(0,l.initOnceWithDOMReady)("ProcessComponent",()=>{try{if(globalThis.__ProcessComponentInitialized)return;document.querySelector(".process-steps")&&(globalThis.__ProcessComponentInitialized=!0,e.ProcessComponent.getInstance())}catch(e){console.warn("ProcessComponent initialization failed:",e)}}):console.warn("ProcessComponent module loaded but ProcessComponent class not found"),e}),instanceName:"ProcessComponent"},{selector:".new-calculator-section, .new-calculator-wrapper",moduleName:"CalculatorComponent",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | calculator-component-loader */"calculator-component-loader").then(o.bind(o,/*! ../../cust-fin/index */"./src/js/opus2/cust-fin/index.ts"));return e.CalculatorComponent&&!globalThis.__CalculatorComponentDOMLoader&&(globalThis.__CalculatorComponentDOMLoader=!0,(0,l.initOnceWithDOMReady)("CalculatorComponent",()=>{e.CalculatorComponent.getInstance()})),e}),instanceName:"CalculatorComponent"},{selector:".drip-form-wrap",moduleName:"DripCalculator",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | dripcalculator-component-loader */"dripcalculator-component-loader").then(o.bind(o,/*! ../../helperModules/dripCalculator */"./src/js/opus2/helperModules/dripCalculator.ts"));return e.DripCalculator&&!globalThis.__DripCalculatorDOMLoader&&(globalThis.__DripCalculatorDOMLoader=!0,(0,l.initOnceWithDOMReady)("DripCalculator",()=>{e.DripCalculator.getInstance()})),e}),instanceName:"DripCalculator"},{selector:".deck-calculator-section",moduleName:"DeckCalculator",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | deckcalculator-component-loader */"deckcalculator-component-loader").then(o.bind(o,/*! ../../helperModules/deckCalculator */"./src/js/opus2/helperModules/deckCalculator.ts"));return e.DeckCalculator&&(0,l.initOnceWithDOMReady)("DeckCalculator",()=>{new e.DeckCalculator}),e}),instanceName:"DeckCalculator"},{selector:".video-wrapper .video-container",moduleName:"MediaInjector",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | media-injector-loader */"media-injector-loader").then(o.bind(o,/*! ../../video/video-component */"./src/js/opus2/video/video-component.ts"));return e.MediaInjector&&!globalThis.__MediaInjectorInitialized&&(0,l.initOnceWithDOMReady)("MediaInjector",()=>{new e.MediaInjector}),e}),instanceName:"MediaInjector"},{selector:".video-container",moduleName:"YouTubeInit",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | youtube-init-loader */"youtube-init-loader").then(o.bind(o,/*! ../../video/index */"./src/js/opus2/video/index.ts"));return e.youtubeInit&&(0,l.initOnceWithDOMReady)("YouTubeInit",()=>{globalThis.__YouTubeInitInitialized||(globalThis.__YouTubeInitInitialized=!0,e.youtubeInit())}),e}),instanceName:"YouTubeInit"},{selector:".gallery-page-section.inspiration-gallery",moduleName:"InspirationGallery",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | inspiration-gallery-loader */"inspiration-gallery-loader").then(o.bind(o,/*! ../../photo_gallery/inspirationGallery */"./src/js/opus2/photo_gallery/inspirationGallery.ts"));return e.InspirationGallery&&(0,l.initOnceWithDOMReady)("InspirationGallery",()=>{globalThis.__InspirationGalleryInitialized||(globalThis.__InspirationGalleryInitialized=!0,e.InspirationGallery.getInstance())}),e}),instanceName:"InspirationGallery"},{selector:".gallery-page-section",moduleName:"PhotoGallery2",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | photogallery2-loader */"photogallery2-loader").then(o.bind(o,/*! ../../photo_gallery/photogallery2 */"./src/js/opus2/photo_gallery/photogallery2.ts"));return e.PhotoGallery2&&(0,l.initOnceWithDOMReady)("PhotoGallery2",()=>{globalThis.__PhotoGallery2Initialized||(e.PhotoGallery2.getInstance(),globalThis.__PhotoGallery2Initialized=!0)}),e}),instanceName:"PhotoGallery2"},{selector:".sp-offers-section",moduleName:"OffersLanding",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | offers-landing-loader */"offers-landing-loader").then(o.bind(o,/*! ../../offers/offers-landing */"./src/js/opus2/offers/offers-landing.ts"));return e.OffersLanding&&(0,l.initOnceWithDOMReady)("OffersLanding",()=>{if(!globalThis.__OffersLandingInitialized){globalThis.__OffersLandingInitialized=!0;const t=e.OffersLanding.getInstance();null==t||t.attachPrintEvntListner(),null==t||t.attachCloseDrawerListener(),null==t||t.readmoreFunctionality(),null==t||t.attachEventListnerForClaim();const o=document.querySelector(".sp-offers-section");o&&!o.classList.contains("coupons-eight")&&(null==t||t.init())}}),e}),instanceName:"OffersLanding"},{selector:".offers-block-section.dynamic-offer-teaser-component",moduleName:"OffersTeaser",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | offers-teaser
3-loader */"offers-teaser-loader").then(o.bind(o,/*! ../../offers/offers-teaser */"./src/js/opus2/offers/offers-teaser.ts"));return e.OffersTeaser&&(0,l.initOnceWithDOMReady)("OffersTeaser",()=>{if(!globalThis.__OffersTeaserLoaded){globalThis.__OffersTeaserLoaded=!0;document.querySelector(".offers-block-section.dynamic-offer-teaser-component .offers-block-wrapper .offers-block-list")&&e.OffersTeaser.getInstance()}}),e}),instanceName:"OffersTeaser"},{selector:"#sp-offer-new",moduleName:"SpecialOfferPopUp",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | special-offer-popup-loader */"special-offer-popup-loader").then(o.bind(o,/*! ../../offers/special-offer-popup */"./src/js/opus2/offers/special-offer-popup.ts"));return e.SpecialOfferPopUp&&(0,l.initOnceWithDOMReady)("SpecialOfferPopUp",()=>{document.getElementById("sp-offer-new")&&(globalThis.__SpecialOfferPopUpInitialized||(globalThis.__SpecialOfferPopUpInitialized=!0,e.SpecialOfferPopUp.create()))}),e}),instanceName:"SpecialOfferPopUp"},{selector:".gift-cetificate-wrap",moduleName:"GiftCardFormHandler",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | getgiftcard-loader */"getgiftcard-loader").then(o.bind(o,/*! ../../moly-gift/index */"./src/js/opus2/moly-gift/index.ts"));return e.GiftCardFormHandler&&(0,l.initOnceWithDOMReady)("GiftCardFormHandler",()=>{globalThis.__GiftCardFormHandlerInitialized||(globalThis.__GiftCardFormHandlerInitialized=!0,e.GiftCardFormHandler.getInstance())}),e}),instanceName:"GiftCardFormHandler"},{selector:".blog-section",moduleName:"BlogList",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield Promise.all(/*! import() | blog-loader */[o.e("blog-ai-summary-loader"),o.e("blog-loader")]).then(o.bind(o,/*! ../../blog/index */"./src/js/opus2/blog/index.ts"));return e.BlogList&&(0,l.initOnceWithDOMReady)("BlogList",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){var t;const n=new e.BlogList,i=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;if(i){const{getBrandDetailsFromBrandJson:e}=yield Promise.resolve().then(o.bind(o,/*! ../../util/share */"./src/js/opus2/util/share.ts")),t=yield e(i);n.brandDetail=t;(null===document||void 0===document?void 0:document.querySelector(".blog-list"))&&t&&!t.enable_fte&&"function"==typeof n.getData&&n.getData(null)}})),e.NextPrev&&(0,l.initOnceWithDOMReady)("NextPrev",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield e.NextPrev.init()})),e}),instanceName:"BlogList"},{selector:".ai-summarize-block",moduleName:"BlogAiSummary",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | blog-ai-summary-loader */"blog-ai-summary-loader").then(o.bind(o,/*! ../../blog/ai-summary */"./src/js/opus2/blog/ai-summary.ts"));return e.BlogAiSummary?(0,l.initOnceWithDOMReady)("BlogAiSummary",()=>{try{e.BlogAiSummary.getInstance().init()}catch(e){console.warn("BlogAiSummary initialization failed:",e)}}):console.warn("BlogAiSummary module loaded but BlogAiSummary class not found"),e}),instanceName:"BlogAiSummary"},{selector:".ai-share-dropdown",moduleName:"AiShareToggle",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | ai-share-toggle-loader */"ai-share-toggle-loader").then(o.bind(o,/*! ../../blog/aiShareToggle */"./src/js/opus2/blog/aiShareToggle.ts"));return e.AiShareToggle?(0,l.initOnceWithDOMReady)("AiShareToggle",()=>{try{e.AiShareToggle.getInstance().init()}catch(e){console.warn("AiShareToggle initialization failed:",e)}}):console.warn("AiShareToggle module loaded but AiShareToggle class not found"),e}),instanceName:"AiShareToggle"},{selector:".hero-review",moduleName:"HeroComponent",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | hero-component-loader */"hero-component-loader").then(o.bind(o,/*! ../../hero_component/heroComponent */"./src/js/opus2/hero_component/heroComponent.ts"));return e.HeroComponent&&(0,l.initOnceWithDOMReady)("HeroComponent",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){globalThis.__HeroComponentInitialized||(globalThis.__HeroComponentInitialized=!0,yield e.HeroComponent.create())})),e}),instanceName:"HeroComponent"},{selector:".residential-form.mobile-contact-us",moduleName:"MobileContactUs",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | mobile-contact-us-loader */"mobile-contact-us-loader").then(o.bind(o,/*! ../../hero_component/contactUsMobile */"./src/js/opus2/hero_component/contactUsMobile.ts"));return e.MobileContactUs&&(0,l.initOnceWithDOMReady)("MobileContactUs",()=>{if(globalThis.__MobileContactUsInitialized)return;(null===r.reportScreenSize||void 0===r.reportScreenSize?void 0:(0,r.reportScreenSize)())!==s.ScreenType.Desktop&&(e.MobileContactUs.getInstance(),globalThis.__MobileContactUsInitialized=!0)}),e}),instanceName:"MobileContactUs"},{selector:".sp-offers-list .sp-offers-item .sp-offers-cta .secondary-btn",moduleName:"Print",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | print-offer-loader */"print-offer-loader").then(o.bind(o,/*! ../../print/print */"./src/js/opus2/print/print.ts"));return e.Print&&"loading"!==document.readyState&&(0,l.initOnceWithDOMReady)("Print",()=>{!function(e){const t=new e,o=document.querySelectorAll(".sp-offers-list .sp-offers-item .sp-offers-cta .secondary-btn");o&&o.forEach((e,o)=>{e.closest("section.sp-offers-section.coupons-section.fte-special-offers-list")||""!==(null==e?void 0:e.getAttribute("href"))&&"#"!==(null==e?void 0:e.getAttribute("href"))||e.addEventListener("click",e=>t.printOffer(e,o))})}(e.Print)}),e}),instanceName:"Print"},{selector:"#header-alert",moduleName:"BannerManager",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | banner-manager-loader */"banner-manager-loader").then(o.bind(o,/*! ../../header/information-banner */"./src/js/opus2/header/information-banner.ts"));return e.BannerManager&&(0,l.initOnceWithDOMReady)("BannerManager",()=>{e.BannerManager.getInstance()}),e}),instanceName:"BannerManager"},{selector:".contact-info form",moduleName:"FormHandler",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | form-handler-loader */"form-handler-loader").then(o.bind(o,/*! ../../contact_us/contactus */"./src/js/opus2/contact_us/contactus.ts"));return(0,l.initOnceWithDOMReady)("ContactUsFormHandler",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){globalThis.__ContactUsFormHandlerDOMLoader||(globalThis.__ContactUsFormHandlerDOMLoader=!0,yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(document.getElementById("ask-question-form"))return;globalThis.__ContactUsFormHandlerDOMLoader=!0;globalThis.__ContactUsFormHandlerCreated||(yield e.FormHandler.create(),globalThis.__ContactUsFormHandlerCreated=!0),yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(globalThis.__ContactUsDOMContentHandled)return;globalThis.__ContactUsDOMContentHandled=!0;if(!document.querySelector(".contact-info form"))return;const e=document.querySelector(".scheduler-main"),t=globalThis.location.pathname.includes("schedule-appointment");e||t||(document.querySelectorAll('input[type="file"]').forEach((e,t)=>{var o;const n=e.cloneNode();null===(o=e.parentNode)||void 0===o||o.replaceChild(n,e),n.addEventListener("change",()=>{document.dispatchEvent(new CustomEvent("filePreviewNeeded",{detail:{fileInput:n,index:t}}))})}),document.querySelectorAll(".icon-close").forEach((e,t)=>{var o;const n=e.cloneNode(!0);null===(o=e.parentNode)||void 0===o||o.replaceChild(n,e),n.addEventListener("click",()=>{const e=new CustomEvent("clearPreviewNeeded",{detail:{index:t}});document.dispatchEvent(e)})})),yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const{DomainIdentifier:e}=yield Promise.resolve().then(o.bind(o,/*! ../../util/domainService */"./src/js/opus2/util/domainService.ts")),{getCountryCode:t}=yield Promise.resolve().then(o.bind(o,/*! ../../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts")),n=e(),i=t(),s=sessionStorage.getItem("countryCode");if("ca"===n||"ca"===i||"ca"===s){const e=new CustomEvent("toggleDisclaimerNeeded",{detail:{countryZip:"ca"===n||"ca"===i?"ca":"us",zipCode:""}});document.dispatchEvent(e)}})}()})}()})}(e))})),e}),instanceName:"FormHandler"},{selector:".contact-info .contact-block .get_in_touch_hrs_operation",moduleName:"GetHoursOfOperation",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | hours-of-operation-loader */"hours-of-operation-loader").then(o.bind(o,/*! ../../contact_us/get_HoursofOperation */"./src/js/opus2/contact_us/get_HoursofOperation.ts"));return e.GetHoursOfOperation&&(0,l.initOnceWithDOMReady)("GetHoursOfOperation",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){globalThis.__GetHoursOfOperationDOMLoader||(globalThis.__GetHoursOfOperationDOMLoader=!0,yield e.GetHoursOfOperation.create())})),e}),instanceName:"GetHoursOfOperation"},{selector:".donation-form, .donation-success",moduleName:"Donation",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | donation-loader */"donation-loader").then(o.bind(o,/*! ../../mly/donation/donation */"./src/js/opus2/mly/donation/donation.ts"));return e.Donation&&"loading"!==document.readyState&&(0,l.initOnceWithDOMReady)("Donation",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){if(!globalThis.__DonationDOMLoader){globalThis.__DonationDOMLoader=!0;const t=document.getElementById("conceptId");if(t&&1===Number.parseInt(t.value)){const t=document.querySelector(".donation-form"),o=document.querySelector(".donation-success");if(t)e.Donation.getInstance();else if(o){const t=globalThis.location.href,o=Object.fromEntries(new URLSearchParams(globalThis.location.search).entries()).result_msg;e.donationConfirmation(t,o)}}}})),e}),instanceName:"Donation"},{selector:".gift-certificate-form, .gift-add-certificate-form, #gc-recipients-details",moduleName:"GiftRecipient",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const[e,t]=yield Promise.all([Promise.all(/*! import() | gift-recipient-loader */[o.e("gift-purchase-loader"),o.e("gift-recipient-loader")]).then(o.bind(o,/*! ../../mly/gift-recipient */"./src/js/opus2/mly/gift-recipient.ts")),o.e(/*! import() | gift-purchase-loader */"gift-purchase-loader").then(o.bind(o,/*! ../../mly/gift-purchase */"./src/js/opus2/mly/gift-purchase.ts"))]);if(e.GiftRecipient){const o=()=>{globalThis.__GiftFlowInitialized||(e.GiftRecipient.getInstance(),t.GiftPurchase.getInstance(),this.routerHelper.routerConsoleLog("GiftRecipient and GiftPurchase loaded successfully",!1,"DomLoader"),globalThis.__GiftFlowInitialized=!0)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",o,{once:!0}):o()}return e}),instanceName:"GiftRecipient"},{selector:".gift-purchase-msg",moduleName:"GiftConfirmation",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | gift-confirmation-loader */"gift-confirmation-loader").then(o.bind(o,/*! ../../mly/gift-confirmation */"./src/js/opus2/mly/gift-confirmation.ts"));if(e.GiftConfirmation){const t=()=>{if(globalThis.__GiftConfirmationFlowInitialized)return;const t=globalThis.location.href,o=new URLSearchParams(globalThis.location.search),n=Object.fromEntries(o.entries()).result_msg,i=t.
3includes("gift-certificate");if(globalThis.location.pathname.endsWith("confirmation/")&&i){const o=new e.GiftConfirmation;if(t.includes("?"))"APPROVAL"===(null==n?void 0:n.toUpperCase())?(globalThis.sessionStorage.setItem("giftCertPaymentResult",n),o.displayMessage(!0)):(o.displayMessage(!1),globalThis.sessionStorage.removeItem("giftCertPaymentResult")),o.pushHTMLToHistoryAndCleanUrl();else{globalThis.sessionStorage.getItem("giftCertPaymentResult")?o.displayMessage(!0):o.displayMessage(!1)}globalThis.onpopstate=e=>{e.state&&(document.documentElement.outerHTML=e.state.html,document.title=e.state.pageTitle)}}globalThis.__GiftConfirmationFlowInitialized=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}return e}),instanceName:"GiftConfirmation"},{selector:".unsubscribe-form-section",moduleName:"UnsubscribeForm",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | unsubscribe-form-loader */"unsubscribe-form-loader").then(o.bind(o,/*! ../../unsubscribe-form/UnsubscribeForm */"./src/js/opus2/unsubscribe-form/UnsubscribeForm.ts"));return e.UnsubscribeForm&&(0,l.initOnceWithDOMReady)("UnsubscribeForm",()=>{globalThis.__UnsubscribeFormInitialized||(globalThis.__UnsubscribeFormInitialized=!0,e.UnsubscribeForm.create(),this.routerHelper.routerConsoleLog("UnsubscribeForm loaded successfully",!1,"DomLoader"))}),e}),instanceName:"UnsubscribeForm"},{selector:".search-result-hero-banner",moduleName:"BrandResult",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield Promise.resolve().then(o.bind(o,/*! ../../search-result/brand-result */"./src/js/opus2/search-result/brand-result.ts"));return e.BrandResult&&(0,l.initOnceWithDOMReady)("BrandResult",()=>{globalThis.__SearchResultFormInitialized||(globalThis.__SearchResultFormInitialized=!0,e.BrandResult.getInstance())}),e}),instanceName:"BrandResult"},{selector:".google-preferred-bage",moduleName:"GooglePreferredBadge",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | google-preferred-badge-loader */"google-preferred-badge-loader").then(o.bind(o,/*! ../../util/googlePreferredBadge */"./src/js/opus2/util/googlePreferredBadge.ts"));return e.GooglePreferredBadge?(0,l.initOnceWithDOMReady)("GooglePreferredBadge",()=>{try{e.GooglePreferredBadge.getInstance().init()}catch(e){console.warn("GooglePreferredBadge initialization failed:",e)}}):console.warn("GooglePreferredBadge module loaded but GooglePreferredBadge class not found"),e}),instanceName:"GooglePreferredBadge"},{selector:".share-and-google-cta-wrapper",moduleName:"ShareGoogleCtaPlacement",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | share-google-cta-placement-loader */"share-google-cta-placement-loader").then(o.bind(o,/*! ../../blog/shareGoogleCtaPlacement */"./src/js/opus2/blog/shareGoogleCtaPlacement.ts"));return e.ShareGoogleCtaPlacement?(0,l.initOnceWithDOMReady)("ShareGoogleCtaPlacement",()=>{try{e.ShareGoogleCtaPlacement.getInstance().init()}catch(e){console.warn("ShareGoogleCtaPlacement initialization failed:",e)}}):console.warn("ShareGoogleCtaPlacement module loaded but ShareGoogleCtaPlacement class not found"),e}),instanceName:"ShareGoogleCtaPlacement"}];for(const t of e){document.querySelector(t.selector)&&(yield this.routerHelper.loadModuleSafely(t.moduleName,t.importFn,t.instanceName),this.status.loadedModules.push(t.moduleName),this.routerHelper.routerConsoleLog(`${t.moduleName} loaded for ${t.selector}`,!1,"DomLoader"))}0===this.status.loadedModules.length&&this.routerHelper.routerConsoleLog("DOM modules loading completed (no modules found)",!1,"DomLoader")}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}finally{this.status.isLoading=!1}})}}},"./src/js/opus2/router/modulePaths/feature-module.ts"(e,t,o){"use strict";o.d(t,{FeatureModule:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts");class s{constructor(){this.routerHelper=i.RouterHelper.getInstance(),this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new s),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"FeatureModule"}getStatus(){return Object.assign({},this.status)}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.loadConditionalFeatureModules()})}loadConditionalPageModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.routerHelper.routerConsoleLog("FeatureModule does not handle page modules",!1,"FeatureModule")})}loadConditionalFeatureModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.status.isLoading=!0;try{this.routerHelper.routerConsoleLog("Feature modules loading completed (no modules to load)",!1,"FeatureModule")}catch(e){const t=e instanceof Error?e.message:String(e);throw this.status.failedModules.push("feature-modules"),this.status.lastError=t,this.routerHelper.routerConsoleLog(`Failed to load conditional feature modules - ${t}`,!0,"FeatureModule"),e}finally{this.status.isLoading=!1}})}}},"./src/js/opus2/router/modulePaths/required-loader.ts"(e,t,o){"use strict";o.d(t,{RequiredLoader:()=>c});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts"),s=o(/*! ../../util/add-Page-Type-DataLayer */"./src/js/opus2/util/add-Page-Type-DataLayer.ts"),r=o(/*! ../../util/gtm-custom-event-lead-flow */"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"),l=o(/*! ../../util/share */"./src/js/opus2/util/share.ts"),a=o(/*! ../../util/dom-loader-check */"./src/js/opus2/util/dom-loader-check.ts"),d=o(/*! ../../util/loader */"./src/js/opus2/util/loader.ts");class c{constructor(){this.routerHelper=i.RouterHelper.getInstance(),this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new c),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"RequiredLoader"}getStatus(){return Object.assign({},this.status)}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.requiredModules()})}requiredModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){this.status.isLoading=!0;try{const e=[{moduleName:"NeighborlyApp",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield Promise.all(/*! import() | neighborly-app-module */[o.e("vendor"),o.e("neighborly-app-module")]).then(o.bind(o,/*! ../../neighborly_app/neighborly-app */"./src/js/opus2/neighborly_app/neighborly-app.ts"));return(0,a.initOnceWithDOMReady)("NeighborlyApp",()=>{var t;const o=document.getElementById("send-number");o&&(null===(t=null==e?void 0:e.neighborlyApp)||void 0===t?void 0:t.mobileNumberInput)||o&&e.NeighborlyApp&&(globalThis.__NeighborlyAppInitialized=!0,globalThis.__NeighborlyAppInstance=new e.NeighborlyApp,new e.NeighborlyApp)}),e}),instanceName:"NeighborlyApp"},{moduleName:"SearchServiceInput",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | search-service-module */"search-service-module").then(o.bind(o,/*! ../../search-service/search-service-input */"./src/js/opus2/search-service/search-service-input.ts"));return e.SearchServiceInput&&!globalThis.__SearchServiceInputInitialized&&(0,a.initOnceWithDOMReady)("SearchServiceInput",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){if(globalThis.__SearchServiceInputInitialized)return;globalThis.__SearchServiceInputInitialized=!0;const t=yield e.SearchServiceInput.create();globalThis.__SearchServiceInputInstance=t})),e}),instanceName:"SearchServiceInput"},{moduleName:"MrElectricFormHandler",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | mrelectricform-loader */"mrelectricform-loader").then(o.bind(o,/*! ../../find_service_near_me/findMyLocal */"./src/js/opus2/find_service_near_me/findMyLocal.ts"));if(e.MrElectricFormHandler){if(globalThis.__MrElectricFormHandlerInitialized)return e;(0,a.initOnceWithDOMReady)("MrElectricFormHandler",()=>{globalThis.__MrElectricFormHandlerInitialized||(globalThis.__MrElectricFormHandlerInitialized=!0,e.MrElectricFormHandler.getInstance())})}return e}),instanceName:"MrElectricFormHandler"},{moduleName:"ServiceList",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | service-list-module */"service-list-module").then(o.bind(o,/*! ../../services/list */"./src/js/opus2/services/list.ts"));return e.ServiceList&&"loading"!==document.readyState&&(0,a.initOnceWithDOMReady)("ServiceList",()=>{(new e.ServiceList).initialize()}),e}),instanceName:"ServiceList"},{moduleName:"MenuGenerator",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | header-menu-config-loader */"header-menu-config-loader").then(o.bind(o,/*! ../../header/headerMenuConfig */"./src/js/opus2/header/headerMenuConfig.ts"));return e.MenuGenerator&&(0,a.initOnceWithDOMReady)("MenuGenerator",()=>{globalThis.__MenuGeneratorInitialized||(globalThis.__MenuGeneratorInitialized=!0,new e.MenuGenerator)}),e}),instanceName:"MenuGenerator"},{moduleName:"DisplayAddress",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | display-address-loader */"display-address-loader").then(o.bind(o,/*! ../../contact_us/displayAddress */"./src/js/opus2/contact_us/displayAddress.ts"));return e.DisplayAddress&&(0,a.initOnceWithDOMReady)("DisplayAddress",()=>(0,n.__awaiter)(this,void 0,void 0,function*(){globalThis.__DisplayAddressInitialized||(globalThis.__DisplayAddressInitialized=!0,yield e.DisplayAddress.create())})),e}),instanceName:"DisplayAddress"},{moduleName:"StorageManager",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | storage-manager-loader */"storage-manager-loader").then(o.bind(o,/*! ../../../global/storage-manager */"./src/js/global/storage-manager.ts"));return e.StorageManager&&(0,a.initOnceWithDOMReady)("StorageManager",()=>{globalThis.__StorageManagerInitialized||(globalThis.__StorageManagerInitialized=!0,e.StorageManager.getInstance())}),e}),instanceName:"StorageManager"},{moduleName:"BrandLogo",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield o.e(/*! import() | brand-logo-loader */"brand-logo-loader").then(o.bind(o,/*! ../../header/brandLogo */"./src/js/opus2/header/brandLogo.ts"));return e.BrandLogo&&"loading"!==document.readyState&&(0,a.initOnceWithDOMReady)("BrandLogo",()=>{globalThis.__BrandLogoInitialized||(globalThis.__BrandLogoInitialized=!0,new e.BrandLogo)}),e}),instanceName:"BrandLogo"},{moduleName:"App",importFn:()=>(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield Promise.all(/*! import() | location-map-app-loader */[o.e("vendor"),o.e("location-map-app-loader")]).then(o.bind(o,/*! ../../location-search-map/App */"./src/js/opus2/location-search-map/App.ts"));return(()=>{(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;const n=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;yield(0,l.getBrandDetailsFromBrandJson)(n);try{const e=null===(o=document.getElementById("pageType"))||void 0===o?void 0:o.value;if(e&&"opus 2 lead flow confirmation page"===e.toLocaleLowerCase()){const e=sessionStorage.getItem("RL_Weblocation_ID"),t=sessionStorage.getItem("RL_DBAName");e&&t&&(0,r.gtmCustomEventLeadFlow)({event:"custEv_LocalDataLayer",locationID:e,locationDBA:t})}}catch(e){this.routerHelper.routerConsoleLog(`gtmCustomEventLeadFlow - ${e}`,!0,"RequiredLoader")}try{const e=(0,s.getPageInfo)(),t=(0,s.getLocalization)();(0,r.gtmCustomEventLeadFlow)({event:"pageDataLayer",pageType:e,localization:t})}catch(e){this.routerHelper.routerConsoleLog(`PagetypeDatalayer - ${e}`,!0,"RequiredLoader")}if(document.querySelector(".find-location-section")){(0,d.startLoader)();const t=yield e.App.create();window.addEventListener("resize",()=>{t.windowResizeCallback()}),(0,d.stopLoader)()}})})(),e}),instanceName:"App"}];for(const t of e)yield this.routerHelper.loadModuleSafely(t.moduleName,t.importFn,t.instanceName),this.status.loadedModules.push(t.moduleName),this.routerHelper.routerConsoleLog(`${t.moduleName} loaded successfully`,!1,"RequiredLoader")}catch(e){throw this.status.failedModules.push("global"),this.status.lastError=e instanceof Error?e.message:String(e),e}finally{this.status.isLoading=!1}})}}},"./src/js/opus2/router/modulePaths/template-loader.ts"(e,t,o){"use strict";o.d(t,{TemplateLoader:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),s=o(/*! ../router-helper */"./src/js/opus2/router/router-helper.ts"),r=o(/*! ../../util/dom-loader-check */"./src/js/opus2/util/dom-loader-check.ts");class l{constructor(){this.routerHelper=s.RouterHelper.getInstance(),this.pageTemplate="",this.status={isInitialized:!1,loadedModules:[],failedModules:[],isLoading:!1}}static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new l),this.instance}init(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;try{this.pageTemplate=null!==(e=(0,i.getPageSettings)("pagetemplate"))&&void 0!==e?e:"",this.status.isInitialized=!0}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}})}getName(){return"TemplateLoader"}getStatus(){return Object.assign({},this.status)}getPageTemplate(){return this.pageTemplate}loadModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.templateModules()})}templateModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;this.status.isLoading=!0;try{const n=null===(e=this.pageTemplate)||void 0===e?void 0:e.toLowerCase().includes("campaign page template"),i=document.getElementById("pageType"),s=null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.toLowerCase();if(n){const{MarketingLandingPage:e}=yield o.e(/*! import() | marketing-landing-loader */"marketing-landing-loader").then(o.bind(o,/*! ../../marketing/marketingLandingPage */"./src/js/opus2/marketing/marketingLandingPage.ts"));(0,r.initOnceWithDOMReady)("MarketingLandingPage",()=>{e.getInstance().init()}),this.status.loadedModules.push("marketing-landing");const{MarketingPage:t}=yield o.e(/*! import() | marketing-page-loader */"marketing-page-loader").then(o.bind(o,/*! ../../marketing/marketing-page */"./src/js/opus2/marketing/marketing-page.ts"));i&&"opus 2 campaign page template"===s&&((0,r.initOnceWithDOMReady)("MarketingPage",()=>{if(globalThis.__MarketingPageInitialized)return;globalThis.__MarketingPageInitialized=!0;(new t).localizationPhoneNumber()}),this.status.loadedModules.push("marketing-page"))}if("opus 2 our team page template"===s){const{OurTeam:e}=yield o.e(/*! import() | our-team-loader */"our-team-loader").then(o.bind(o,/*! ../../our_team/index */"./src/js/opus2/our_team/index.ts"));(0,r.initOnceWithDOMReady)("OurTeam",()=>{globalThis.__OurTeamInitialized||(globalThis.__OurTeamInitialized=!0,e.getInstance())}),this.status.loadedModules.push("our-team")}}catch(e){throw this.status.lastError=e instanceof Error?e.message:String(e),e}finally{this.status.isLoading=!1}})}}},"./src/js/opus2/router/router-helper.ts"(e,t,o){"use strict";o.d(t,{RouterHelper:()=>i});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");
3class i{static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new i),this.instance}constructor(){this.loadedModules=new Map,this.loadingPromises=new Map,this.showConsole=!0}isModuleLoaded(e){const t=this.loadedModules.get(e);return"loaded"===(null==t?void 0:t.status)}isModuleLoading(e){const t=this.loadedModules.get(e);return"loading"===(null==t?void 0:t.status)}getLoadingPromise(e){return this.loadingPromises.get(e)}markModuleAsLoading(e,t,o){if(!this.isValidModuleKey(e))throw new Error(`Invalid module key: ${e}`);this.loadedModules.set(e,{key:e,loadedAt:Date.now(),chunkName:this.sanitizeChunkName(t),status:"loading"}),this.loadingPromises.set(e,o)}markModuleAsLoaded(e){const t=this.loadedModules.get(e);t&&this.loadedModules.set(e,Object.assign(Object.assign({},t),{status:"loaded",loadedAt:Date.now()})),this.loadingPromises.delete(e)}markModuleAsFailed(e){const t=this.loadedModules.get(e);t&&this.loadedModules.set(e,Object.assign(Object.assign({},t),{status:"failed"})),this.loadingPromises.delete(e);const o=Array.from(this.loadedModules.values()).filter(e=>"failed"===e.status).length;o>0&&o%10==0&&setTimeout(()=>this.cleanupFailedModules(),0)}getModuleMetadata(e){return this.loadedModules.get(e)}getAllLoadedModules(){return Array.from(this.loadedModules.values()).filter(e=>"loaded"===e.status)}isValidModuleKey(e){return/^[a-zA-Z0-9_-]+$/.test(e)&&e.length>0&&e.length<=50}sanitizeChunkName(e){return e.replace(/[<>'"&]/g,"")}isTestEnvironment(){var e,t,o;if(this.showConsole){const n=null!==(o=null===(t=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.hostname)||void 0===t?void 0:t.toLowerCase())&&void 0!==o?o:"",i=["nblysbx","nblydev","nblytest","localhost"];this.showConsole=i.some(e=>n.includes(e))}return this.showConsole}routerConsoleLog(e,t=!1,o){if(!this.isTestEnvironment())return;"string"!=typeof e&&(e=String(e));const n=e.replace(/[<>'"&]/g,""),i=t?"#c0392b":"#ecf0f1",s=t?"8px":"10px",r=o?` [${o}]`:"";(t?console.error:console.log)(`%c[Router]${r}%c ${n}`,`background:#8e44ad; color: ${i}; font-weight: bold; padding: 0 8px; font-size: ${s}`,"")}cleanupFailedModules(e=3e5){const t=Date.now();let o=0;for(const[n,i]of this.loadedModules.entries())if("failed"===i.status){const s=t-i.loadedAt;s>e&&(this.loadedModules.delete(n),o++,this.routerConsoleLog(`Cleaned up failed module: ${n} (age: ${Math.round(s/1e3)}s)`,!1,"RouterHelper"))}return o>0&&this.routerConsoleLog(`Cleanup completed: ${o} failed modules removed`,!1,"RouterHelper"),o}clearAllModules(){this.loadedModules.clear(),this.loadingPromises.clear()}getFailedModuleStats(){const e=Date.now(),t=Array.from(this.loadedModules.entries()).filter(([,e])=>"failed"===e.status).map(([t,o])=>({key:t,age:e-o.loadedAt,chunkName:o.chunkName})),o=t.map(e=>e.age),n=o.length>0?Math.max(...o):0,i=o.length>0?o.reduce((e,t)=>e+t,0)/o.length:0;return{count:t.length,oldestFailureAge:n,averageAge:i,recommendCleanup:t.length>5||n>6e5,modules:t.sort((e,t)=>t.age-e.age)}}getModuleStatus(){const e=this.getAllLoadedModules();return{loaded:e,total:e.length,loadedCount:e.filter(e=>"loaded"===e.status).length}}loadModuleSafely(e,t,o){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t,o,n=3e4){if(this.isModuleLoaded(e))return void this.routerConsoleLog(`${o} already loaded`,!1,e);if(this.isModuleLoading(e)){const t=this.getLoadingPromise(e);if(t)return this.routerConsoleLog(`${o} already loading, waiting...`,!1,e),t}const i=this.performModuleLoadWithTimeout(e,t,o,n);return this.markModuleAsLoading(e,o,i),i})}performModuleLoadWithTimeout(e,t,o,i){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const n=new Promise((e,t)=>{setTimeout(()=>{t(new Error(`Module loading timeout after ${i}ms`))},i)});yield Promise.race([t(),n]),this.markModuleAsLoaded(e),this.routerConsoleLog(`${o} loaded successfully`,!1,e)}catch(t){this.markModuleAsFailed(e);const n=t instanceof Error?t.message:String(t);throw n.includes("timeout")?this.routerConsoleLog(`${o} timed out after ${i}ms`,!0,e):this.routerConsoleLog(`${o} failed to load - ${n}`,!0,e),t}})}performModuleLoad(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){return this.performModuleLoadWithTimeout(e,t,o,3e4)})}}},"./src/js/opus2/router/router.ts"(e,t,o){"use strict";o.d(t,{Router:()=>m});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./modulePaths/brand-json-loader */"./src/js/opus2/router/modulePaths/brand-json-loader.ts"),s=o(/*! ./modulePaths/brand-loader */"./src/js/opus2/router/modulePaths/brand-loader.ts"),r=o(/*! ./modulePaths/conditional-page-loader */"./src/js/opus2/router/modulePaths/conditional-page-loader.ts"),l=o(/*! ./modulePaths/dom-loader */"./src/js/opus2/router/modulePaths/dom-loader.ts"),a=o(/*! ./modulePaths/feature-module */"./src/js/opus2/router/modulePaths/feature-module.ts"),d=o(/*! ./modulePaths/required-loader */"./src/js/opus2/router/modulePaths/required-loader.ts"),c=o(/*! ./modulePaths/template-loader */"./src/js/opus2/router/modulePaths/template-loader.ts"),u=o(/*! ./router-helper */"./src/js/opus2/router/router-helper.ts");class m{static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new m),this.instance}constructor(){this.routerHelper=u.RouterHelper.getInstance(),this.brandLoader=s.BrandLoader.getInstance(),this.requiredLoader=d.RequiredLoader.getInstance(),this.domLoader=l.DomLoader.getInstance(),this.templateLoader=c.TemplateLoader.getInstance(),this.brandJsonLoader=i.BrandJsonLoader.getInstance(),this.featureModule=a.FeatureModule.getInstance(),this.conditionalPageLoader=r.ConditionalPageLoader.getInstance(),this.loaders=[this.requiredLoader,this.templateLoader,this.domLoader,this.brandLoader,this.brandJsonLoader,this.featureModule,this.conditionalPageLoader],this.init()}init(){this.routerModules().then(()=>{this.routerHelper.routerConsoleLog("Router loaded successfully")}).catch(e=>{this.routerHelper.routerConsoleLog(`Router failed to load - ${e}`,!0)})}routerModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){yield this.initializeLo
3aders(),yield this.loadAllModules()})}initializeLoaders(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=this.loaders.map(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){try{yield e.init(),this.routerHelper.routerConsoleLog(`${e.getName()} initialized successfully`,!1,e.getName())}catch(t){const o=t instanceof Error?t.message:String(t);this.routerHelper.routerConsoleLog(`${e.getName()} initialization failed - ${o}`,!0,e.getName())}}));yield Promise.allSettled(e)})}loadAllModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=this.loaders.map(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){try{yield e.loadModules(),this.routerHelper.routerConsoleLog(`${e.getName()} modules loaded successfully`,!1,e.getName())}catch(t){const o=t instanceof Error?t.message:String(t);this.routerHelper.routerConsoleLog(`${e.getName()} module loading failed - ${o}`,!0,e.getName())}}));yield Promise.allSettled(e)})}conditionalModules(){return(0,n.__awaiter)(this,void 0,void 0,function*(){yield this.featureModule.loadConditionalFeatureModules(),yield this.conditionalPageLoader.loadConditionalPageModules()})}getModuleStatus(){const e={};let t=0,o=0,n=0,i=0;for(const s of this.loaders){const r=s.getStatus();e[s.getName()]=r,r.isInitialized&&t++,r.isLoading&&o++,r.loadedModules.length>0&&n++,r.failedModules.length>0&&i++}return{totalLoaders:this.loaders.length,initializedLoaders:t,loadingLoaders:o,completedLoaders:n,failedLoaders:i,loaderStatuses:e}}}},"./src/js/opus2/search-result/brand-result.ts"(e,t,o){"use strict";o.r(t),o.d(t,{BrandResult:()=>p});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../../global */"./src/js/global/index.ts"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ./helperCalls */"./src/js/opus2/search-result/helperCalls.ts"),d=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),c=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),u=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),m=o(/*! ./search-results-page */"./src/js/opus2/search-result/search-results-page.ts"),h=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts");class p{static getInstance(){return p.instance||(p.instance=new p),p.instance}constructor(){var e,t,o;this.fallbackExecuted=!1,this.brandListListenerAttached=!1,this.searchZipCode=document.querySelector(".search-result-hero-banner .zip-input"),this.searchInput=document.querySelector(".search-result-banner-wrap .service-input"),this.populateFromQueryString(),null===(e=document.querySelector(".search-result-banner-wrap .search-btn.primary-btn"))||void 0===e||e.addEventListener("click",e=>{this.handleSearchClick(e)}),null===(t=this.searchZipCode)||void 0===t||t.addEventListener("input",()=>{this.validZipCode()}),null===(o=this.searchInput)||void 0===o||o.addEventListener("change",()=>this.removeServiceIdOnChange()),this.attachEventListenerToCtaButton(),this.handleEmptySearchResult()}attachEventListenerToCtaButton(){var e,t;if(this.brandListListenerAttached)return;const o=document.getElementById("brand-list");o?(o.addEventListener("click",e=>{this.clickInterceptorForCampaignNames(e)}),this.brandListListenerAttached=!0):this.handleNoResults(null!==(t=null===(e=this.searchInput)||void 0===e?void 0:e.value)&&void 0!==t?t:"")}removeServiceIdOnChange(){this.searchInput&&delete this.searchInput.dataset.serviceId}populateFromQueryString(){const e=new URLSearchParams(globalThis.location.search),t=e.get("service"),o=e.get("address"),n=e.get("name");this.searchInput&&n&&(this.searchInput.value=decodeURIComponent(n),t&&(this.searchInput.dataset.serviceId=t)),this.searchZipCode&&o&&(this.searchZipCode.value=decodeURIComponent(o),sessionStorage.setItem("brandZipCode",this.searchZipCode.value))}validZipCode(){var e,t,o;const n=null!==(o=null===(t=null===(e=this.searchZipCode)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim())&&void 0!==o?o:"",i=""!==n&&!(0,d.validateLocalZipPostalCode)(n);this.toggleErrorVisibility("zip-error-msg",i)}toggleErrorVisibility(e,t){const o=document.getElementById(e);o&&(t?o.classList.remove("hidden"):o.classList.add("hidden"))}handleSearchClick(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s,r;e.preventDefault(),this.fallbackExecuted=!1;const l=null===(o=null===(t=this.searchZipCode)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim(),a=(0,c.isValidZipCode)(l),u=""!==l&&(0,d.validateLocalZipPostalCode)(l)&&l&&a&&"00000"!==a;if(this.validateSearchInput()&&u)if((0,d.isValidCAPostalCode)(l)){const e=(null===(i=null===(n=this.searchInput)||void 0===n?void 0:n.dataset)||void 0===i?void 0:i.serviceId)||"",t=(null===(r=null===(s=this.searchInput)||void 0===s?void 0:s.value)||void 0===r?void 0:r.trim())||"",o="/ca/search-result",a=`${window.location.origin}${o}?service=${e}&address=${encodeURIComponent(l)}&name=${encodeURIComponent(t)}`;window.location.replace(a)}else yield this.performBrandSearch();else this.updateErrorVisibility(!!u)})}findBySearchTerm(e,t){if(!t)return;const o=t.trim().toLowerCase();return e.find(e=>{var t;return(null===(t=e.searchTerm)||void 0===t?void 0:t.toLowerCase())===o})}handleFallbackSearchCondition(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=yield(0,a.fetchSearchTerms)(e,t);if(o.length>0){const n=this.findBySearchTerm(o,e);n?this.performBrandSearch(n.searchTerm,t,n.serviceId):this.handleNoResults(e)}else this.handleNoResults(e)})}handleEmptySearchResult(){setTimeout(()=>{const e=document.querySelector(".no-search-results .nbly-search-title span"),t=document.querySelector(".no-search-results"),o=document.querySelector(".nbly-search-results"),n=document.querySelector(".new-search-result-section"),i=document.querySelectorAll(".new-search-results li");'""'===(null==e?void 0:e.textContent)?t&&o&&t.classList.add("hidden"):t&&o&&n&&0===(null==i?void 0:i.length)&&o.classList.remove("hidden")},0)}handleNoResults(e){const t=document.querySelector(".new-search-result-section"),o=document.querySelectorAll(".new-search-results li"),n=document.querySelector(".no-search-results"),i=document.querySelector(".nbly-search-results");if(i&&i.classList.remove("hidden"),n&&t&&0===(null==o?void 0:o.length)){n.classList.remove("hidden"),t.style.display="none";const o=n.querySelector(".nbly-search-title span");o&&(o.textContent=`"${e||""}"`)}this.showBottomServices(),this.hideSearchResults()}hideNoResultsContainer(){const e=document.querySelector(".no-search-results");e&&e.classList.add("hidden")}performBrandSearch(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n,i,a,c;const u=null!=e?e:null===(n=this.searchInput)||void 0===n?void 0:n.value,v=null!=t?t:null===(i=this.searchZipCode)||void 0===i?void 0:i.value,g=o||(null===(c=null===(a=this.searchInput)||void 0===a?void 0:a.dataset)||void 0===c?void 0:c.serviceId),f=document.querySelector(".new-search-result-section"),y=document.querySelector(".no-search-results");if(f){const e=document.querySelectorAll(".new-search-results li"),t=document.querySelector(".nbly-search-results .container");(null==e?void 0:e.length)>0&&t&&t.classList.add("hidden")}(0,l.startLoader)();try{const e=(0,d.isValidCAPostalCode)(v||"")?`${window.location.origin}/ca/searchservice`:r.apiConfig.BRAND_SEARCH_API,t=(0,h.getPageSettings)("pagetemplate");(null==t?void 0:t.toLowerCase().includes("opus 2 neighborly search results"))&&this.hideBottomServices();const o=yield(0,s.cachedAPIWrapper)(`${e}/${u}/${v}/${g||""}`,60);if(o){if(o&&"search-results"===(null==o?void 0:o.Source)){p.getInstance().updateMarkup(o),f.style.display="none",this.hideNoResultsContainer()}else o&&"aggregate-results"===(null==o?void 0:o.Source)?(console.log("aggregate-results",o),f.style.display="block",(0,m.updateAggregateMarkup)(o),this.hideSearchResults(),this.hideNoResultsContainer()):o&&"no-results"===(null==o?void 0:o.Source)&&(null==y||y.classList.remove("hidden"),f.style.display="none",this.hideSearchResults(),this.showBottomServices());v&&sessionStorage.setItem("brandZipCode",v)}(0,l.stopLoader)()}catch(e){console.warn(`Error while searching respective brands. Error message: ${e}`);const t=document.querySelector("#brand-list");t&&(t.innerHTML=""),(0,l.stopLoader)()}})}updateErrorVisibility(e){if(!e){const e=document.getElementById("zip-error-msg");e&&e.classList.remove("hidden")}if(!this.validateSearchInput()){const e=document.getElementById("service-error-msg");e&&e.classList.remove("hidden")}}updateMarkup(e){var t,o;const n=document.querySelector(".service-highlight");n&&(n.textContent=e.SearchTerm);const s=document.querySelector(".nbly-search-results .container");if(s){const n=s.querySelector("#brand-list");n&&n.remove();const r=e.SearchServiceResultMarkup||"";"\x3c!-- Service Search FTE Template Start --\x3e\x3c!-- Service Search FTE Template Start --\x3e"===r&&this.handleNoResults(null!==(o=null===(t=this.searchInput)||void 0===t?void 0:t.value)&&void 0!==o?o:"");if(r.replace(/<!--[\s\S]*?-->/g,"").trim()){const e=document.querySelector(".nbly-search-results");e&&e.classList.remove("hidden"),this.brandListListenerAttached=!1;const t=document.createElement("div");for(t.innerHTML=r;t.firstChild;)s.appendChild(t.firstChild);"function"==typeof window.initFlowbite&&(window.initFlowbite(),(0,i.brandPopupH
3andler)()),s.classList.remove("hidden"),this.hideNoResultsContainer(),this.hideBottomServices(),this.attachEventListenerToCtaButton()}(0,l.stopLoader)()}}constructAndAddUTMTagsToCTA(){const e="neighborly.com",t="referral",o="neighborly_referral";const n=(0,u.getCookie)("_ga").replace(/[<>"']/g,""),i=document.querySelectorAll(".visit-website");console.log(i),i.forEach(i=>{const s=i.getAttribute("href");if(s&&"string"==typeof s&&""!==s.trim())try{const r=new URL(s);if(!r.protocol.startsWith("http"))return void console.warn(`Skipping non-HTTP URL: ${s}`);r.searchParams.set("utm_source",e),r.searchParams.set("utm_medium",t),r.searchParams.set("utm_campaign",o),n&&r.searchParams.set("nbly_ga_id",n),i.setAttribute("href",r.toString())}catch(e){console.error(`Failed to add UTM tags to CTA: ${s}`,e)}})}hideSearchResults(){const e=document.querySelector(".nbly-search-results .container");e&&e.classList.add("hidden")}hideBottomServices(){const e=document.querySelector(".popular-service");e&&e.classList.add("hidden");const t=document.querySelector(".services-list");t&&t.classList.add("hidden")}showBottomServices(){const e=document.querySelector(".popular-service");e&&e.classList.remove("hidden");const t=document.querySelector(".services-list");t&&t.classList.remove("hidden")}validateSearchInput(){const e=document.querySelector(".search-result-banner-wrap .service-input");return e instanceof HTMLInputElement&&""!==(null==e?void 0:e.value.trim())}clickInterceptorForCampaignNames(e){const t=e.target.closest(".booking-redirect");if(t){const o=t.getAttribute("href");if(o){e.preventDefault(),e.stopPropagation();const n=sessionStorage.getItem("campaignName"),i=null==n?void 0:n.split("?")[1];if(i){const e=new URL(o,window.location.origin);new URLSearchParams(i).forEach((t,o)=>{"leadconcept"!==o&&"weblocation"!==o&&e.searchParams.set(o,t)}),t.setAttribute("href",e.toString())}window.location.href=t.getAttribute("href")||o}}}}document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){if(!document.querySelector(".search-result-hero-banner"))return;if(globalThis.__SearchResultFormInitialized)return;globalThis.__SearchResultFormInitialized=!0,p.getInstance();const e=document.querySelector(".new-search-result-section"),t=document.querySelectorAll(".new-search-results li"),o=document.querySelector(".nbly-search-results .container");e&&(null==t?void 0:t.length)>0&&o&&o.classList.add("hidden")}))},"./src/js/opus2/search-result/helperCalls.ts"(e,t,o){"use strict";o.d(t,{fetchSearchTerms:()=>a});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),l=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts");function a(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=(0,r.isValidCAPostalCode)(t)?2:1,n=(0,l.getSessionAndCorrelationID)();if(!t||!e)return[];let a=t;(0,r.isValidCAPostalCode)(t)&&!a.includes(" ")&&(a=a.slice(0,3)+" "+a.slice(3));const d=`${s.apiConfig.ServiceSearchTermAPI}&search_term=${encodeURIComponent(e)}&country_id=${o}&postal_code=${a}&correlationId=${n.correlationID}&sessionId=${n.sessionID}`;return yield(0,i.getCachedAPIResponse)(d,60)})}},"./src/js/opus2/search-result/index.ts"(e,t,o){"use strict";o.d(t,{BrandResult:()=>n.BrandResult});var n=o(/*! ./brand-result */"./src/js/opus2/search-result/brand-result.ts");
3o(/*! ./search-result */"./src/js/opus2/search-result/search-result.ts"),o(/*! ./search-results-page */"./src/js/opus2/search-result/search-results-page.ts")},"./src/js/opus2/search-result/search-result.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),a=o(/*! ../header */"./src/js/opus2/header/index.ts"),d=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),c=o(/*! ../util/getSessionCorrelationId */"./src/js/opus2/util/getSessionCorrelationId.ts"),u=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),m=o(/*! ../util/memoization */"./src/js/opus2/util/memoization.ts"),h=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),p=o(/*! ./helperCalls */"./src/js/opus2/search-result/helperCalls.ts");class v{static getInstance(){return v.instance||(v.instance=new v),v.instance}constructor(){this.dropdown=null,this.serviceInput=null,this.zipInput=null,this.debounceTimer=null,this.debounceDelay=300,this.dropdown=document.querySelector(".suggestion-container"),this.serviceInput=document.querySelector(".service-input"),this.zipInput=document.querySelector(".zip-input"),this.zipInput.maxLength=10,this.serviceInput&&this.setupEventListeners(),this.populateIfexistingZipExists(),this.initAutoLocation()}initAutoLocation(){var e;(null!==(e=new URLSearchParams(globalThis.location.search).get("address"))&&void 0!==e?e:"")||(0,h.checkAutoLocationOnLoad)("know_my_location",this.zipInput)}setupEventListeners(){var e,t,o;null===(e=this.serviceInput)||void 0===e||e.addEventListener("focusin",()=>this.handleServiceInputFocus()),null===(t=this.serviceInput)||void 0===t||t.addEventListener("keyup",e=>this.handleSearchInputKeyup(e)),null===(o=this.zipInput)||void 0===o||o.addEventListener("input",()=>this.handleZipcodeInput());const n=document.querySelector(".new-hero-banner .search-btn"),i=document.querySelector(".zip-box .icon");null==n||n.addEventListener("click",e=>this.handleSearchButtonClick(e)),null==i||i.addEventListener("click",e=>this.handleMapIconClick(e)),document.addEventListener("click",e=>{const t=e.target;(null==t?void 0:t.closest(".relative.flex-1"))||this.hideDropdown()})}populateIfexistingZipExists(){if(!this.zipInput||this.zipInput.value)return;const e=sessionStorage.getItem("brandZipCode");e&&(this.zipInput.value=e)}handleMapIconClick(e){var t;e.preventDefault(),this.zipInput&&(null===(t=new a.UseMyLocationSearch)||void 0===t||t.getCurrentLocation(e,this.zipInput))}handleServiceInputFocus(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,i;const s=null===(t=null===(e=this.zipInput)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim();if(!s)return void this.showError("Please enter a zip code first");const r=(null===(i=null===(o=document.getElementById("service-search-input"))||void 0===o?void 0:o.value)||void 0===i?void 0:i.trim())||"";if(r)return this.debounceTimer&&clearTimeout(this.debounceTimer),void(this.debounceTimer=setTimeout(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){r.length>=Number("3")?yield this.performSearchTermLookup(r):this.hideDropdown()}),this.debounceDelay));try{(0,u.startLoader)();const e=yield this.fetchServices(s);(null==e?void 0:e.length)>0?(this.renderServiceSuggestions(e),this.setupPopularServiceSelection()):this.showError("No services found for this zip code")}catch(e){this.handleError("Failed to fetch services",e)}finally{(0,u.stopLoader)()}})}fetchServices(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=(0,c.getSessionAndCorrelationID)();let o=(0,d.formatCAPostalCode)(e);const n=(0,d.isValidCAPostalCode)(e)?2:1;(0,d.isValidCAPostalCode)(e)&&!o.includes(" ")&&(o=o.slice(0,3)+" "+o.slice(3));const s=`${r.apiConfig.ServiceAPI}&ZipCode=${o}&countryid=${n}&ServiceModifier=4&take=12&correlationId=${t.correlationID}&sessionId=${t.sessionID}`;return yield(0,i.getCachedAPIResponse)(s,60)})}renderServiceSuggestions(e){const t=document.querySelector("#popular-services-dropdown");
3if(!t)return;(t.querySelector("ul")||this.createElement(t,"ul")).innerHTML=e.map(e=>`\n <li class="suggestion-item">\n <button id="${e.proTypeId}" type="button" class="service-pill-btn">\n ${this.escapeHtml(e.proTypeName)}\n </button>\n </li>\n `).join(""),this.showDropdown(t)}setupPopularServiceSelection(){var e,t;null===(t=null===(e=this.dropdown)||void 0===e?void 0:e.querySelectorAll("button"))||void 0===t||t.forEach(e=>{e.addEventListener("click",()=>this.handleServiceSelection(e))})}handleServiceSelection(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,s;if(this.hideDropdown(),!this.serviceInput)return;const r=(null===(t=e.textContent)||void 0===t?void 0:t.trim())||"";this.serviceInput.value=r;const l=(0,m.useMemo)(()=>{var e,t;return(0,d.getBrandFilter)(r,(null===(t=null===(e=this.zipInput)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim())||"")},[r,(null===(n=null===(o=this.zipInput)||void 0===o?void 0:o.value)||void 0===n?void 0:n.trim())||""]);l.length>0?(this.populateBrandDetails(l),this.showBrandDetails()):this.hideBrandDetails();try{const e=yield(0,p.fetchSearchTerms)(r,(null===(s=null===(i=this.zipInput)||void 0===i?void 0:i.value)||void 0===s?void 0:s.trim())||"");if((null==e?void 0:e.length)>0){const t=g(e,"rank",!0);this.renderPredictiveText(t),this.setupServiceSelection()}}catch(e){this.handleError("Failed to fetch search suggestions",e)}})}renderPredictiveText(e){var t,o;const n=document.querySelector("#popular-services-dropdown"),i=document.querySelector("#predictive-text-dropdown");if(!i)return;const s=(null===(o=null===(t=this.serviceInput)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim().toLowerCase())||"";(i.querySelector(".predictive-list")||this.createElement(i,"ul")).innerHTML=e.map(e=>{const t=this.highlightMatchedText(e.name,s);return`\n <li class="predictive-item" serviceId="${e.serviceId}">\n <svg aria-hidden="true" class="icon">\n <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#search-icon"></use>\n </svg>\n <span class="predictive-text">${t}</span>\n </li>\n `}).join(""),this.showDropdown(i),null==n||n.classList.add("hidden")}highlightMatchedText(e,t){if(!t)return this.escapeHtml(e);const o=this.escapeHtml(e),n=new RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return o.replace(n,"<strong>$1</strong>")}setupServiceSelection(){const e=document.querySelector("#predictive-text-dropdown .predictive-list");e&&e.addEventListener("click",t=>(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n;const i=null===(o=t.target)||void 0===o?void 0:o.closest(".predictive-item");if(i&&this.serviceInput){const t=i.getAttribute("serviceId")||"";this.serviceInput.dataset.serviceId=t,this.serviceInput.value=(null===(n=i.textContent)||void 0===n?void 0:n.trim())||"",this.hideDropdown();(null==e?void 0:e.closest(".search-result-hero-banner"))&&(yield this.triggerBrandSearch())}}))}triggerBrandSearch(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,n,i,s;const r=null===(t=null===(e=this.zipInput)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim(),l=null===(i=null===(n=this.serviceInput)||void 0===n?void 0:n.value)||void 0===i?void 0:i.trim(),a=null===(s=this.serviceInput)||void 0===s?void 0:s.dataset.serviceId;if(!r||!l)return;if(!(0,d.validateLocalZipPostalCode)(r))return void this.showZipcodeError();const c=(0,d.formatCAPostalCode)(r),{BrandResult:u}=yield Promise.resolve().then(o.bind(o,/*! ./brand-result */"./src/js/opus2/search-result/brand-result.ts")),m=u.getInstance();yield m.performBrandSearch(l,c,a)})}updateSearchButton(){var e,t,o;if(!document.querySelector(".new-hero-banner .search-btn")||!this.serviceInput)return;const n=this.serviceInput.dataset.serviceId||"",i=(null===(t=null===(e=this.zipInput)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim().toUpperCase())||"";if(!(0,d.validateLocalZipPostalCode)(i))return console.log("Zipcode validation failed for current site"),void this.showZipcodeError();const s=(null===(o=this.serviceInput.value)||void 0===o?void 0:o.trim())||"",r=(0,d.isValidCAPostalCode)(i)?"/ca/search-result":"/search-result";let l=i;(0,d.isValidCAPostalCode)(i)&&!l.includes(" ")&&(l=l.slice(0,3)+" "+l.slice(3));const a=`${window.location.origin}${r}?service=${n}&address=${encodeURIComponent(l)}&name=${encodeURIComponent(s)}&cacheBuster=${Date.now()}`;if(document.querySelector(".new-search-result-section")){const e=document.querySelectorAll(".new-search-results li"),t=document.querySelector(".nbly-search-results .container");(null==e?void 0:e.length)>0&&t&&t.classList.add("hidden")}window.location.replace(a)}
3showDropdown(e){var t;null===(t=this.dropdown)||void 0===t||t.classList.remove("hidden"),null==e||e.classList.remove("hidden")}hideDropdown(){var e,t,o;null===(e=document.querySelector("#predictive-text-dropdown"))||void 0===e||e.classList.add("hidden"),null===(t=document.querySelector("#popular-services-dropdown"))||void 0===t||t.classList.add("hidden"),null===(o=this.dropdown)||void 0===o||o.classList.add("hidden")}handleError(e,t){console.error(`${e}:`,t),this.showError(e),this.hideDropdown()}showError(e){console.warn(e)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}createElement(e,t){const o=document.createElement(t);return e.appendChild(o),o}handleSearchButtonClick(e){var t,o;const n=null===(o=null===(t=this.zipInput)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim(),i=(0,s.isValidZipCode)(n);if(!(""!==n&&(0,d.validateLocalZipPostalCode)(n)&&n&&i&&"00000"!==i&&n.length>0))return e.preventDefault(),void this.showZipcodeError();this.updateSearchButton(),this.hideZipcodeError()}handleZipcodeInput(){var e,t;const o=null===(t=null===(e=this.zipInput)||void 0===e?void 0:e.value)||void 0===t?void 0:t.trim();o&&o.length>0&&this.isValidZipCode(o)&&this.hideZipcodeError()}showZipcodeError(){const e=document.getElementById("zip-error-msg");e&&(e.innerText="Please enter a valid zipcode",e.classList.remove("hidden"))}hideZipcodeError(){const e=document.getElementById("zip-error-msg");e&&e.classList.add("hidden")}isValidZipCode(e){const t=l.REGEX.sendZip,o=l.REGEX.caSendZip;return t.test(e)||o.test(e)}handleSearchInputKeyup(e){var t,o;const i=null===(o=null===(t=e.target)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim();this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){i&&i.length>=Number("3")?yield this.performSearchTermLookup(i):this.hideDropdown()}),this.debounceDelay)}performSearchTermLookup(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;const n=null===(o=null===(t=this.zipInput)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim();if(n)try{(0,u.startLoader)();const t=(0,d.formatCAPostalCode)(n),o=yield(0,p.fetchSearchTerms)(e,t);if(o&&(null==o?void 0:o.length)>0){const e=g(o,"rank",!0);this.renderPredictiveText(e),this.setupServiceSelection()}else this.hideDropdown()}catch(e){this.handleError("Failed to fetch search terms",e)}finally{const t=(0,m.useMemo)(()=>(0,d.getBrandFilter)(e,n),[e,n]);t.length>0?(this.populateBrandDetails(t),this.showBrandDetails()):this.hideBrandDetails(),(0,u.stopLoader)()}else this.showZipcodeError()})}populateBrandDetails(e){const t=document.querySelector("#predictive-text-dropdown .brand-suggestions .brand-list");t&&(t.innerHTML=e.join(""))}showBrandDetails(){const e=document.querySelector(".suggestion-container .brand-suggestions");e&&e.classList.remove("hidden");const t=document.querySelector(".suggestion-container");t&&t.classList.remove("hidden");const o=document.querySelector("#predictive-text-dropdown");o&&o.classList.remove("hidden")}hideBrandDetails(){const e=document.querySelector(".suggestion-container .brand-suggestions");e&&e.classList.add("hidden")}}function g(e,t,o){return e.sort(function(e,n){return o?e[t]>n[t]?1:e[t]<n[t]?-1:0:n[t]>e[t]?1:n[t]<e[t]?-1:0}),e}document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector(".new-hero-banner"),t=document.querySelector(".search-result-hero-banner");(e||t)&&v.getInstance()})},"./src/js/opus2/search-result/search-results-page.ts"(e,t,o){"use strict";o.d(t,{updateAggregateMarkup:()=>u});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../util/loader */"./src/js/opus2/util/loader.ts"),a=o(/*! ./brand-result */"./src/js/opus2/search-result/brand-result.ts"),d=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts");class c{static getInstance(){var e;return null!==(e=this.instance)&&void 0!==e||(this.instance=new c),this.instance}constructor(){this.searchResults=null,this.zipCodeEntryInBanner=null,this.serviceEntryInBanner=null,this.paramService=null,this.paramName=null,this.paramAddress=null,this.popularServices=null,this.popularServicesList=null,this.moreServiceList=null,this.listenersAttached=!1,this.zipIcon=null,this.searchButton=null,this.selectors={results:".nbly-search-results .container",zipInput:".search-result-hero-banner .zip-input",popularGrid:".popular-services-grid",popularServices:".popular-service",serviceEntryInBanner:"service-search-input",moreServiceList:".services-list",zipIcon:".zip-box .icon",searchButton:".search-result-hero-banner .search-btn"},this.onPopularServiceClick=e=>this.getClickedPopularServices(e),this.domLookup()}domLookup(){this.searchResults=document.querySelectorAll(this.selectors.results),this.zipCodeEntryInBanner=document.querySelector(this.selectors.zipInput),this.serviceEntryInBanner=document.getElementById(this.selectors.serviceEntryInBanner),this.popularServices=document.querySelector(this.selectors.popularServices),this.moreServiceList=document.querySelector(this.selectors.moreServiceList),this.popularServicesList=document.querySelectorAll(this.selectors.popularGrid),this.zipIcon=document.querySelector(this.selectors.zipIcon),this.searchButton=document.querySelector(this.selectors.searchButton),this.attachClickEventListener(),this.attachSearchButtonListener()}init(){this.queryParamLookup()}queryParamLookup(){var e,t,o;const n=new URLSearchParams(window.location.search);this.paramService=null!==(e=n.get("service"))&&void 0!==e?e:"",this.paramName=null!==(t=n.get("name"))&&void 0!==t?t:"",this.paramAddress=null!==(o=n.get("address"))&&void 0!==o?o:"",this.paramAddress&&this.paramAddress.length>0?this.populateZipFromQueryParams():this.hideSearchResults(),this.zipIcon&&(this.zipIcon.style.cursor="pointer");const i=document.querySelector(".new-search-result-section"),s=document.querySelectorAll(".new-search-results li"),r=document.querySelector(".nbly-search-results .container");if([this.paramService,this.paramName,this.paramAddress].every(e=>"string"==typeof e&&e.trim().length>0))this.populateServiceFromQueryParams(),this.showSearchResult(),this.hideNoResultsContent(),this.hideStaticContent();else{this.hideSearchResults(),null==r||r.classList.add("hidden");const e=(0,d.getPageSettings)("pagetemplate");(null==e?void 0:e.toLowerCase().includes("opus 2 neighborly search results"))&&this.hideBottomServices(),i&&0===(null==s?void 0:s.length)&&(this.showNoResultsContent(this.paramName),this.showStaticContent())}}attachClickEventListener(){var e,t;!this.listenersAttached&&(null===(e=this.popularServicesList)||void 0===e?void 0:e.length)&&this.serviceEntryInBanner&&(null===(t=this.popularServicesList)||void 0===t||t.forEach(e
3=>{e.classList.contains("service-redirection")||e.addEventListener("click",this.onPopularServiceClick)}),this.listenersAttached=!0)}getClickedPopularServices(e){var t,o;const n=e.target;if(!n)return;const i=n.closest(".popular-service-item"),s=(null!==(o=null===(t=null==i?void 0:i.querySelector(".service-name"))||void 0===t?void 0:t.textContent)&&void 0!==o?o:"").trim();s&&this.populateClickedTileInSearch(s)}populateClickedTileInSearch(e){this.serviceEntryInBanner&&(this.serviceEntryInBanner.value=e,this.serviceEntryInBanner.focus(),this.serviceEntryInBanner.dispatchEvent(new Event("input",{bubbles:!0})),this.serviceEntryInBanner.dispatchEvent(new Event("change",{bubbles:!0})),this.serviceEntryInBanner.dispatchEvent(new Event("keyup",{bubbles:!0})))}populateZipFromQueryParams(){var e;this.zipCodeEntryInBanner&&(this.zipCodeEntryInBanner.value=null!==(e=this.paramAddress)&&void 0!==e?e:"")}populateServiceFromQueryParams(){var e;this.serviceEntryInBanner&&(this.serviceEntryInBanner.value=null!==(e=this.paramName)&&void 0!==e?e:"")}hideNoResultsContent(){const e=document.querySelector(".no-search-results");e&&e.classList.add("hidden")}showNoResultsContent(e){const t=document.querySelector(".no-search-results");if(t){t.classList.remove("hidden");const o=t.querySelector(".nbly-search-title span");o&&(o.textContent=`"${e||""}"`)}}hideSearchResults(){this.searchResults&&this.searchResults.forEach(e=>{e.classList.add("hidden")})}showSearchResult(){this.searchResults&&this.searchResults.forEach(e=>{e.classList.remove("hidden")})}hideStaticContent(){this.popularServices&&(this.popularServices.classList.add("hidden"),this.moreServiceList&&this.moreServiceList.classList.add("hidden"))}showStaticContent(){this.popularServices&&(this.popularServices.classList.remove("hidden"),this.moreServiceList&&this.moreServiceList.classList.remove("hidden"))}hideBottomServices(){const e=document.querySelector(".popular-service");e&&e.classList.add("hidden");const t=document.querySelector(".services-list");t&&t.classList.add("hidden")}attachSearchButtonListener(){var e;null===(e=this.searchButton)||void 0===e||e.addEventListener("click",e=>{this.handleSearchButtonClick(e)})}handleSearchButtonClick(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o,n,i,l,d,c,m,h;e.preventDefault();const p=null!==(n=null===(o=null===(t=this.serviceEntryInBanner)||void 0===t?void 0:t.value)||void 0===o?void 0:o.trim())&&void 0!==n?n:"",v=null!==(d=null===(l=null===(i=this.zipCodeEntryInBanner)||void 0===i?void 0:i.value)||void 0===l?void 0:l.trim())&&void 0!==d?d:"",g=null!==(h=null===(m=null===(c=this.serviceEntryInBanner)||void 0===c?void 0:c.dataset)||void 0===m?void 0:m.serviceId)&&void 0!==h?h:"",f=document.querySelector(".new-search-result-section"),y=document.querySelector(".nbly-search-results"),b=r.apiConfig.BRAND_SEARCH_API;this.hideNoResultsContent();const I=yield(0,s.cachedAPIWrapper)(`${b}/${p}/${v}/${g}`,60);if(I&&"search-results"===(null==I?void 0:I.Source)){a.BrandResult.getInstance().updateMarkup(I),y.classList.remove("hidden"),f.style.display="none",this.hideNoResultsContent()}else if(I&&"aggregate-results"===(null==I?void 0:I.Source))u(I),f.style.display="block",this.hideNoResultsContent();else if(I&&"no-results"===(null==I?void 0:I.Source)){this.showNoResultsContent(p),f.style.display="none",this.hideSearchResults();a.BrandResult.getInstance().showBottomServices()}})}}function u(e){var t;const o=document.querySelector(".new-search-result-section");if(!o)return;const n=null!==(t=e.SearchServiceResultMarkup)&&void 0!==t?t:"";n.replace(/<!--[\s\S]*?-->/g,"").trim()&&(o.innerHTML=n,o.style.display="block",m())}function m(){const e=document.querySelector(".new-search-result-section"),t=document.querySelectorAll(".new-search-results li"),o=document.querySelectorAll(".page-number"),d=document.querySelector(".pagination-results-text"),u=document.querySelector(".new-search-results-pagination.pagination"),m=t.length,h=Math.ceil(m/15);function p(e){if(e<1||e>h)return;const o=15*(e-1),n=o+15;t.forEach((e,t)=>{e.style.display=t>=o&&t<n?"list-item":"none"});const i=0===m?0:o+1,s=Math.min(n,m);d&&(d.textContent=`Showing ${i}-${s} of ${m} results`)}
3u&&(u.style.display=h<=1?"none":"block"),o.forEach(e=>{var t,o;if(!u)return;parseInt(null!==(t=e.textContent)&&void 0!==t?t:"1")>h&&(null===(o=e.parentElement)||void 0===o||o.style.setProperty("display","none"))}),o.forEach(e=>{u&&e.addEventListener("click",function(e){var t;e.preventDefault();p(parseInt(null!==(t=this.textContent)&&void 0!==t?t:"1")),o.forEach(e=>e.classList.remove("current-page")),this.classList.add("current-page")})});const v=document.querySelector(".search-result-hero-banner .zip-input");t.forEach(t=>{t.addEventListener("click",function(t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,d,u;t.preventDefault();const m=new URLSearchParams(window.location.search),h=null!==(o=m.get("name"))&&void 0!==o?o:"",p=null!==(u=null!==(d=null===(n=null==v?void 0:v.value)||void 0===n?void 0:n.trim())&&void 0!==d?d:m.get("address"))&&void 0!==u?u:"",g=this.getAttribute("data-service-id"),f=this.getAttribute("data-service-name"),y=document.querySelector(".search-result-banner-wrap .service-input");y&&(y.value=""),(0,l.startLoader)();try{const t=(0,i.isValidCAPostalCode)(p)?r.apiConfig.CA_BRAND_SEARCH_API:r.apiConfig.BRAND_SEARCH_API,o=yield(0,s.cachedAPIWrapper)(`${t}/${null!=f?f:encodeURIComponent(h)}/${encodeURIComponent(p)}/${encodeURIComponent(g||"")}`,60);if("search-results"===(null==o?void 0:o.Source)){a.BrandResult.getInstance().updateMarkup(o);const t=document.querySelector(".service-highlight");t&&f&&(t.textContent=f),e.style.display="none"}else if("no-results"===(null==o?void 0:o.Source)){e.style.display="none";c.getInstance().hideSearchResults();a.BrandResult.getInstance().showBottomServices()}(0,l.stopLoader)()}catch(e){console.warn(`Error fetching service results: ${e}`),(0,l.stopLoader)()}})})}),p(1)}m(),document.addEventListener("DOMContentLoaded",()=>{if(!(0,i.conceptIdLookupForNblyOrCorp)())return;c.getInstance().init()})},"./src/js/opus2/services/index.ts"(e,t,o){"use strict";o(/*! ./onloadFunction */"./src/js/opus2/services/onloadFunction.ts")},"./src/js/opus2/services/onloadFunction.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../common */"./src/js/opus2/common/index.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),l=o(/*! ../util/device-detection */"./src/js/opus2/util/device-detection.ts"),a=o(/*! ../util/disclaimerService */"./src/js/opus2/util/disclaimerService.ts"),d=o(/*! ../util/domainService */"./src/js/opus2/util/domainService.ts"),c=o(/*! ../util/headerUpdate */"./src/js/opus2/util/headerUpdate.ts"),u=o(/*! ../util/localizationService */"./src/js/opus2/util/localizationService.ts"),m=o(/*! ../util/share */"./src/js/opus2/util/share.ts"),h=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),p=o(/*! ../apiCaching/POST-Requests/apibookingCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apibookingCallWrapper.ts"),v=o(/*! ../apiCaching/POST-Requests/apiContactCallWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiContactCallWrapper.ts"),g=o(/*! ../apiCaching/POST-Requests/apiPriceQuoteWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiPriceQuoteWrapper.ts"),f=o(/*! ../apiCaching/POST-Requests/apiCouponOffersWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiCouponOffersWrapper.ts"),y=o(/*! ../apiCaching/POST-Requests/apiIsReturningCustomerWrapper */"./src/js/opus2/apiCaching/POST-Requests/apiIsReturningCustomerWrapper.ts"),b=o(/*! ../util/localizationTag */"./src/js/opus2/util/localizationTag.ts"),I=o(/*! ../util/confirmation-page-add-to-calendar */"./src/js/opus2/util/confirmation-page-add-to-calendar.ts"),S=o(/*! ../api/apiLogger */"./src/js/opus2/api/apiLogger.ts"),w=o(/*! ../util/headerSwitch */"./src/js/opus2/util/headerSwitch.ts"),L=o(/*! ../util/real-time-email-validation */"./src/js/opus2/util/real-time-email-validation.ts"),E=o(/*! ../helperModules/localizedToken */"./src/js/opus2/helperModules/localizedToken.ts"),C=o(/*! ../util/imageQuality */"./src/js/opus2/util/imageQuality.ts"),A=o(/*! ../event-service/eventService */"./src/js/opus2/event-service/eventService.ts"),_=o(/*! ../util/pageSettings */"./src/js/opus2/util/pageSettings.ts"),k=o(/*! ../util/versionControl */"./src/js/opus2/util/versionControl.ts"),N=o(/*! ../mly/callBookingApi */"./src/js/opus2/mly/callBookingApi.ts"),T=o(/*! ../util/discovery */"./src/js/opus2/util/discovery.ts"),B=o(/*! ../util/user-info-handler */"./src/js/opus2/util/user-info-handler.ts"),P=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),j=o(/*! ../nbly-brand/conditional_localization */"./src/js/opus2/nbly-brand/conditional_localization.ts"),D=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts"),M=o(/*! ../util/cwv.handler */"./src/js/opus2/util/cwv.handler.ts"),q=o(/*! ../util/phoneNumberReplacement */"./src/js/opus2/util/phoneNumberReplacement.ts"),R=o(/*! ../ccpa/deregister */"./src/js/opus2/ccpa/deregister.ts");class O{constructor(e,t){this.loggedErrors=[],this.getLocalizedFromLink(t),this.attachErrorListener(),this.updatePhoneNumbersOnPage(e),this.updateTaglines(),this.displaySocialMediaIcons(),this.printFakeBookingConfirmation(),this.addAnimation(),this.photoGalleryImageHelper(),this.captureUserDetailsFromQuery()}captureUserDetailsFromQuery(){const e=new URLSearchParams(globalThis.location.search).get("onemail");if(e)try{sessionStorage.setItem("cs-userDetails",e)}catch(e){console.warn("Error while storing user details from onemail param",e),sessionStorage.removeItem("cs-userDetails")}}photoGalleryImageHelper(){const e=document.querySelectorAll(".photo-gallery-section .gallery-wrapper .tns-outer .photo-gallery-list");
30!==(null==e?void 0:e.length)&&e.forEach(e=>{e&&(0,C.restructureImages)(e)})}localisedHeader(){w.HeaderSwitch.getInstance()}static getInstance(e,t){return O.instance||(O.instance=new O(e,t)),O.instance}static getAsyncData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;let t,o;try{const n=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value,i=yield(0,m.getBrandDetailsFromBrandJson)(n);sessionStorage.setItem("brandDetails",JSON.stringify(i)),t=yield(0,u.getDisplayPhoneNumber)();const l=window.location.href,a=new URL(l),d=a.searchParams.get("location");if(d){localStorage.setItem("weblocationId",d);const e=`${s.apiConfig.GET_ATTRIBUTE_DATA}/${d}`;o=yield(0,h.cachedAPIWrapper)(e,r.apiCaching.FullAttributeResponse)}}catch(e){console.warn("Error getting the data",e)}O.getInstance(t,o)})}addAnimation(){this.addAnimationToHeaderCTA()}addAnimationToHeaderCTA(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=document.getElementById("conceptCode");if(!e)return;const t=e.value,o=yield(0,m.getBrandDetailsFromBrandJson)(t);if(!o)return;const n=o.enable_animation,i=document.querySelectorAll(".brand-header-mob>.header-cta-mobile>.cta-header-component-lead, .header-cta-container>a.primary-btn, .brand-header-mob .header-cta-mobile .primary-btn.replace-with-click-to-lead-cta");0!=i.length&&(n?i.forEach(e=>{e.classList.add("animation")}):i.forEach(e=>{e.classList.remove("animation")}))})}displaySocialMediaIcons(){if((0,l.isTouchDevice)()){if("local"===(0,_.getPageSettings)("pagescope")){const e=document.querySelector(".header-wrapper .brand-header");if(!e)return;e.style.display=""}}}printFakeBookingConfirmation(){const e=(0,_.getPageSettings)("pagetemplate");(null==e?void 0:e.toLowerCase().includes("confirmation"))&&(0,m.logPayloadForFakeSubmit)()}updatePhoneNumbersOnPage(e){if(!(e=e?String(e):null))return;const t=document.querySelectorAll(".sticky-footer-cta"),o=document.querySelectorAll('.click-to-call:not([target="_self"]):not([target="_blank"])'),n=document.querySelector(".sticky_title"),i=document.querySelector(".sticky-footer-cta.cta-footer-component-lead");if(n&&i&&!(0,q.shouldSkipPhoneNumberProcessing)()){const t=`<svg aria-hidden="true" class="icon sticky_icon"><use xlink:href="/_assets-global/images/hero-icon-sprite.svg#phone-primary"></use></svg>${e.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")}`;i.innerHTML=t}[...t,...o].forEach(t=>{t&&(t.href=`tel:${e.replace(/[\(\)\-\s]/g,"")}`)})}updateTaglines(){(0,b.localizationTagLine)()}attachErrorListener(){window.addEventListener("error",e=>{var t,o,n,i,s;const r=e.error,a=new Date(Date.now());if(r){const e={httpStatusCode:null!==(t=r.httpStatusCode)&&void 0!==t?t:"",message:null!==(o=r.message)&&void 0!==o?o:"No message",stackTrace:null!==(n=r.stack)&&void 0!==n?n:"No message",timeStamp:a,deviceType:(0,l.isTouchDevice)()?`Mobile Device - UserAgent: ${navigator.userAgent}`:`Desktop Device - UserAgent: ${navigator.userAgent}`};this.loggedErrors.push(e)}else{const t={httpStatusCode:"No Status Code, as error is in the script",message:null!==(i=e.message)&&void 0!==i?i:"No Trace available",stackTrace:"No message",timeStamp:a,deviceType:(0,l.isTouchDevice)()?`Mobile Device - UserAgent: ${navigator.userAgent}`:`Desktop Device - UserAgent: ${navigator.userAgent}`};console.info(null!==(s=e.message)&&void 0!==s?s:"Error in GTM script"),this.loggedErrors.push(t)}})}getLoggedErrors(){return this.loggedErrors}getLocalizedFromLink(e){var t,o;if(e){const n=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value,i=null===(o=document.getElementById("conceptCode"))||void 0===o?void 0:o.value;e.conceptId===Number(n)&&e.brandCode===i&&this.setLocalData(e,null==e?void 0:e.zip)}}updateInputValue(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.warn(`Error in updateInputValue function: ${e}`)}}setLocalData(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,s;if(e){const{franchiseWebLocationId:r,locationDoingBusinessAs:l,locationWebsiteUrl:a,mainPhoneNumber:d,callTrackings:c}=e;localStorage.setItem("franchiseWebLocationId",r),sessionStorage.setItem("franchiseId",r),localStorage.setItem("doingBusinessAs",l),sessionStorage.setItem("redirectionURL",a),localStorage.setItem("weblocationId",r);const u=null!==(o=null==a?void 0:a.replace(/\/$/,""))&&void 0!==o?o:"",h=u.toLowerCase().split("/"),p=h[h.length-1];(0,m.handleCrossDomainLink)(u);let v=d;
3c.forEach(e=>{"WebsiteTracking"==e.callTrackingTypeDescription&&(v=e.callTrackingNumber,localStorage.setItem("localPhoneNumber",v))});const g=document.querySelector(".header-wrapper .form-call-cta");if(g){g.href=`tel:${v}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,t=null===(n=String(v))||void 0===n?void 0:n.replace(/\D/g,"").match(e);g.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`}const f=document.querySelector(".header-cta-mobile .primary-btn");f&&(f.href=`tel:${v}`),p&&(localStorage.setItem("dbaName",p),(0,b.localizationTagUpadation)()),this.updateInputValue("local_weblocationId",r),this.updateInputValue("weblocationId",r),this.updateInputValue("full_dbaName",p),this.updateInputValue("dbaName",p);const y=document.querySelector(".header-wrapper .address"),I=document.querySelector(".header-wrapper .description");l&&(0,m.updateHeaderContent)(l),y&&I&&(y.innerHTML=l,(0,b.localizationTagLine)());const S=null===(s=document.getElementById("user-service-address"))||void 0===s?void 0:s.value;sessionStorage.setItem("manualEnteredAddress",S+", "+t),sessionStorage.setItem("RL_Weblocation_ID",r),sessionStorage.setItem("RL_DBAName",l);const w=document.querySelector(".brand-header .brand-logo-wrapper"),L=document.querySelector(".brand-header .find-local");w&&(w.style.display="none"),L&&(L.style.display="none"),i.Footer.init()}})}}(0,n.__awaiter)(void 0,void 0,void 0,function*(){document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){var e,t;(0,M.cwvHandler)(),j.ConditionalLocalization.getInstance().init(),w.HeaderSwitch.getInstance(),yield O.getAsyncData();const s=sessionStorage.getItem("sAddressParam");(0,a.DisclaimerServiceIdentifier)(s),document.querySelector(".unsubscribe-form-section")&&(globalThis.__DeregisterInitialized=!0,R.Deregister.getInstance());const r=localStorage.getItem("localHeaderUrl"),l=localStorage.getItem("localHeaderAlt");r&&(0,c.updateHeaderLogo)(r,null!=l?l:"Brand Logo");const b=localStorage.getItem("weblocationId"),C=localStorage.getItem("dbaName"),k=null===(e=document.getElementById("servicelargemediatile"))||void 0===e?void 0:e.value,D=null===(t=document.getElementById("replacementblockdynamic"))||void 0===t?void 0:t.value;b&&C&&!k&&!D&&E.LocalizedToken.getInstance();const q=B.UserInfoHandler.getInstance();yield q.captureUserInfo(),function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=(0,_.getPageSettings)("pagetemplate"),t=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;try{if("false"===(null===(e="true")||void 0===e?void 0:e.toLowerCase()))return Promise.reject(new Error("TextToSpeech - Disabed from Config Level"));const n=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,i=yield(0,m.getBrandDetailsFromBrandJson)(n);return(null==i?void 0:i.text_to_speech)&&"disabled"!==(null===(o=null==i?void 0:i.text_to_speech)||void 0===o?void 0:o.toLowerCase())?Promise.resolve(!0):Promise.reject(new Error("TextToSpeech - Disabed from Brand JSON Level"))}catch(e){return(0,P.isTestEnvironment)()&&console.warn("Failed to load the config for text to speech Module",e),Promise.reject(e)}})}();if(!(null==e?void 0:e.toLowerCase().includes("opus 2 blog article details"))||!("speechSynthesis"in window)||!t)return Promise.reject(new Error("TextToSpeech - Page Template does not match or SpeechSynthesis API is not supported"));const{TextToSpeechHelper:i}=yield o.e(/*! import() | textToSpeech */"textToSpeech").then(o.bind(o,/*! ../text2speech/mainT2S */"./src/js/opus2/text2speech/mainT2S.ts"));return yield i.create(),Promise.resolve(!0)}catch(e){return console.warn("Failed to load the text to speech Module",e),Promise.reject(e)}})}().then(()=>{console.log("Initalized")}).catch(e=>{console.warn("Failed to load the text to speech Module",e)}),window.LocalizationIdentifier=u.LocalizationIdentifier,window.DomainIdentifier=d.DomainIdentifier,window.UpdateHeaderLogo=c.updateHeaderLogo,window.GetCachedResponse=h.cachedAPIWrapper,window.GetCachedUnifiedSync=h.getCachedAPIResponse,window.BookingWrapper=p.bookingUsPostCallWrapper,window.ContactWrapper=v.contactUsPostCallWrapper,window.PriceQuoteWrapper=g.priceQuoteWrapper,window.CouponOffersWrapper=f.couponOffersWrapper,window.IsReturningCustomerWrapper=y.isReturningCustomerWrapper,window.CalendarInvite=I.calendarInvite,window.UnlockIt=S.unlockIt,window.ValidateEmail=L.validateEmail,window.CalcEstimate=N.calcEstimate,window.HandleMissingData=T.handleMissingData,yield i.AreaWeServe.create(),yield A.EventService.create(),(0,m.detectFinancingPage)()}))}),window.addEventListener("load",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){if("requestIdleCallback"in window?requestIdleCallback(()=>{setTimeout(()=>{(0,k.attachVersionPrinterToWindow)()},50)}):setTimeout(()=>{(0,k.attachVersionPrinterToWindow)()},1e3),(0,D.conceptIdLookupForNblyOrCorp)()){const e=yield(0,D.constructNblyObject)();localStorage.setItem("nblyBrands",JSON.stringify(e))}}))},"./src/js/opus2/services/woker-api.ts"(e,t,o){"use strict";o.d(t,{insertTemplate:()=>c,lookupTemplate:()=>d});var n,i=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),s=o(/*! ./wor
3ker-injector */"./src/js/opus2/services/worker-injector.ts");const r="true"===(null===(n="MISSING_ENV_VAR".SHOW_WORKER_LOG)||void 0===n?void 0:n.toLowerCase())||!1;function l(e,t){r&&console.log(`%c[DOMWorker]%c ${e}`,`background:${t}; color:#f3f3f3; font-weight: bold; padding: 0 8px`,"")}function a(e,t){return new Promise((o,n)=>{(()=>{(0,i.__awaiter)(this,void 0,void 0,function*(){var i;if(!("Worker"in window))return l("Web Workers are not supported in this environment.","red"),void o(null);let r;try{r=yield(0,s.getWorker)()}catch(e){return l(`Failed to get worker: ${e instanceof Error?e.message:null!==(i=JSON.stringify(e))&&void 0!==i?i:"Unknown error"}`,"red"),n(new Error("Incognito mode or Worker unavailable."))}if(!r)return l("Worker is not available (possibly in incognito mode).","red"),void o(null);l("Registering domTemplateServiceWorker...","blue"),r.onmessage=e=>{var t,i;const{type:s}=e.data,a=Object.assign({},e.data);delete a.type,s.endsWith("_RESULT")?(o(a),r.terminate(),l("Worker response received.","green")):"ERROR"===s&&(n(new Error(null!==(t=a.error)&&void 0!==t?t:"Unknown worker error")),l(`Worker error: ${null!==(i=a.error)&&void 0!==i?i:"Unknown error"}`,"red"),r.terminate())},r.onerror=e=>{var t,o;n(new Error(null!==(t=null==e?void 0:e.message)&&void 0!==t?t:JSON.stringify(e))),r.terminate(),l(`Worker error: ${null!==(o=null==e?void 0:e.message)&&void 0!==o?o:JSON.stringify(e)}`,"red")},r.postMessage({type:e,payload:t})})})()})}function d(e,t){return a("LOOKUP",{key:e,hashedValue:t})}function c(e,t){return a("INSERT",{key:e,value:t})}},"./src/js/opus2/services/worker-injector.ts"(e,t,o){"use strict";o.d(t,{checkIncognito:()=>s,getWorker:()=>r});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/checkDeviceAndBrowserType */"./src/js/opus2/util/checkDeviceAndBrowserType.ts");function s(){return new Promise(e=>{(0,i.userBrowserDetails)().then(t=>{var o;e(null!==(o=null==t?void 0:t.inCognito)&&void 0!==o&&o)})})}function r(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield(0,i.userBrowserDetails)();if(null==e?void 0:e.inCognito)return null;const t=window.location.origin+"/brand/_assets/js/webWorker.js";return new Worker(t)})}},"./src/js/opus2/testimonial/helperIdb.ts"(e,t,o){"use strict";o.d(t,{TestimonialHelperIdb:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../util/keyGeneration */"./src/js/opus2/util/keyGeneration.ts"),s=o(/*! ../util/virtualDom */"./src/js/opus2/util/virtualDom.ts"),r=o(/*! ./testimonial-common */"./src/js/opus2/testimonial/testimonial-common.ts");class l{static getInstance(){var e;return null!==(e=l.instance)&&void 0!==e||(l.instance=new l),l.instance}constructor(){this.conceptId=null,this.countryId=null,this.weblocationId="",this.selector=r.TESTIMONIAL_SELECTOR,this.realUl=null,this.ratingCache={},this.pageSize=window.innerWidth>=768?30:4,this.selectedStarRating=5}domLookup(){var e,t,o,n,i,s,r;if(this.conceptId=null!==(t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value)&&void 0!==t?t:"",this.weblocationId=null!==(i=null!==(n=null===(o=document.getElementById("weblocationId"))||void 0===o?void 0:o.value)&&void 0!==n?n:localStorage.getItem("franchiseWebLocationId"))&&void 0!==i?i:"",null!=sessionStorage.getItem("countryCode")){const e=null===(s=sessionStorage.getItem("countryCode"))||void 0===s?void 0:s.toLowerCase();this.countryId="us"===e?"1":"2"}else{const e=null===(r=document.getElementById("countryCode"))||void 0===r?void 0:r.value;e?"us"===(null==e?void 0:e.toLowerCase())?this.countryId="1":this.countryId="2":this.countryId="1"}}getData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,n;const l=r.default.getInstance().buildUrl(this.conceptId,this.weblocationId||0,this.countryId,1,this.pageSize,this.selectedStarRating),a=(0,i.keyGenerator)(l,this.selector);let d=yield this.getFromCache(a);if(Array.isArray(d)&&d.length>0)return;let c,u;if(d=yield this.getDataFromServer(this.selectedStarRating),(null===(e=d[0])||void 0===e?void 0:e.overallRating)&&(null===(t=d[0])||void 0===t?void 0:t.grandTotal)){c=null===(o=d[0])||void 0===o?void 0:o.overallRating,u=null===(n=d[0])||void 0===n?void 0:n.grandTotal;const e={or:c,gt:u};sessionStorage.setItem(`rev-${this.weblocationId||"national"}`,JSON.stringify(e))}const m={type:"ul",props:{},children:yield this.createTestimonialLists(d)};this.realUl&&(0,s.updateVDomElement)(this.realUl,m),yield this.storeInCache(a,d)})}storeInCache(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){return r.default.getInstance().storeInCache(e,t)})}createTestimonialVNode(e){return r.default.getInstance().createTestimonialVNode(e)}generateRatingStars(e){return r.default.getInstance().generateRatingStars(e)}getDataFromServer(e){return r.default.getInstance().getDataFromServer(this.conceptId,this.weblocationId||0,this.countryId,1,this.pageSize,e)}getFromCache(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return r.default.getInstance().getFromCache(e,this.selectedStarRating,this.ratingCache)})}handleCacheFailure(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return r.default.getInstance().handleCacheFailure(this.ratingCache)})}createTestimonialLists(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){return r.default.getInstance().createTestimonialLists(e)})}}l.instance=null},"./src/js/opus2/testimonial/imageHelper.ts"(e,t,o){"use strict";function n(e="Unknown",t){null==e&&(e="Unknown");const o=["#16a085","#f1c40f","#f39c12","#27ae60","#d35400","#2980b9","#c0392b","#8e44ad","#2c3e50"];if(null===o)throw new Error("solidColors is null or undefined");const n=new Uint32Array(1);window.crypto.getRandomValues(n);const i=o[n[0]%o.length];if(null==i)throw new Error("randomColor is null or undefined");const s=e.split(" ")[0].charAt(0).toUpperCase(),r=`Profile image for ${e}`,l=`\n background: ${i};\n display: grid;\n place-content: center;\n color: #ecf0f1;\n font-size: 2.2rem;\n `;return"testimonial"===t?`<div class="testi-profile" style="${l}" role="img" aria-label="${r}">${s}</div>`:{type:"div",props:{class:"testi-profile",style:l,role:"img","aria-label":r},children:[s]}}o.d(t,{getImageReplacemnt:()=>n})},"./src/js/opus2/testimonial/index.ts"(e,t,o){"use strict";o(/*! ./testimonial-card */"./src/js/opus2/testimonial/testimonial-card.ts"),o(/*! ./testimonial-animation */"./src/js/opus2/testimonial/testimonial-animation.ts")},"./src/js/opus2/testimonial/ratingDisplay.ts"(e,t,o){"use strict";function n(e){const t=document.getElementById("ratingText"),o=document.getElementById("ratingsInfo");(null==e?void 0:e.classList.contains("hidden"))&&(null==e||e.classList.remove("hidden"),e.classList.add("reset-text"),t&&(t.textContent="Showing:",t.classList.remove("ratings-text"),t.classList.add("showing-text"),null==o||o.classList.remove("ratings-info"),null==o||o.classList.add("hidden")))}o.d(t,{handleRatingDisplayChanges:()=>n})},"./src/js/opus2/testimonial/testimonial-animation.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../util/infinty-scroll */"./src/js/opus2/util/infinty-scroll.ts"),l=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),a=o(/*! ../util/generateSvgDataUrl */"./src/js/opus2/util/generateSvgDataUrl.ts");class d{constructor(e){this.topCarousel=null,this.bottomCarousel=null,this.isPaused=!1,this.createTemplate=e=>
3{const t='\n <span class="star full">\n <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="20" height="20">\n <title>Star Icon</title>\n <desc>Star Icon</desc>\n <path fill="#FFC800" d="m48,234 73-226 73,226-192-140h238z"></path>\n </svg>\n </span>\n ',o=this.getReviewerData(e);return`\n <div class="card" >\n <div class="testimonial-wrapper">\n <div class="testimonial-upper-content">\n <div class="testimonal-client-image">\n <img src="${o.reviewPhotoUrl}" \n alt="Profile image for ${o.reviewAuthorName}"\n onerror="this.onerror=null; this.src='${(0,a.generateSvgDataUrl)(o.reviewAuthorName.charAt(0))}';">\n </div>\n <div class="testimonial-name-and-ratings-wrapper">\n <p class="testimonial-client-name">${o.reviewAuthorName}</p>\n ${this.displayStars?`<div role="img" aria-lebel="Rating: 5 out of 5" class="testimonial-ratings">\n ${t} \n ${t} \n ${t} \n ${t}\n ${t}\n </div>`:""}\n </div>\n </div>\n <div class="testimonial-description">\n ${o.reviewBody}\n </div>\n </div>\n </div>\n `},this.handlePauseResumeClick=()=>{this.isPaused?(this.topCarousel&&this.topCarousel.play(),this.bottomCarousel&&this.bottomCarousel.play(),this.isPaused=!1):(this.topCarousel&&this.topCarousel.pause(),this.bottomCarousel&&this.bottomCarousel.pause(),this.isPaused=!0),this.togglePauseResumeElements()};const{parentElement:t,conceptId:o,countryId:n,displayStars:i}=e;this.displayStars=i,this.parentElement=t,this.conceptId=o,this.countryId=n,this.init()}init(){var e;const t=localStorage.getItem("franchiseWebLocationId"),o=(null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)||"",n=null!=t?t:o,i=l.apiConfig.TESTIMONIAL_REVIEWS+`/${this.conceptId}/${n||0}/${this.countryId}/0/1/30/5`;this.fetchReviewData(i)}fetchReviewData(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield(0,i.cachedAPIWrapper)(e,s.apiCaching.TestimonyAndReview);if(!Array.isArray(t))return void console.warn("Invalid testimonial response");if(t.length<6){const e=document.querySelector(".customer-review.reviews-animation-section");return void(e&&(e.style.display="none"))}this.filterData(t)}catch(e){console.warn("Failed to fetch testimonial data",e)}})}filterData(e){const t=e.filter(e=>e.reviewBody&&e.reviewBody.trim().length>0&&e.reviewBody.length<=300&&e.reviewAuthorName);if(t.length<12){const o=e.filter(e=>!t.includes(e)&&e.reviewAuthorName).slice(0,12-t.length);t.push(...o)}const o=t.slice(0,12),n=Math.ceil(o.length/2),i=o.slice(0,n),s=o.slice(n);this.generateHTML(i,s)}getReviewerData(e){var t;const o=e.reviewAuthorName,n=o.match(/\b[a-zA-Z]+\b/g);let i=o;n&&1===n.length&&(i=n[0]),n&&n.length>=2&&(i=`${n[0]} ${n[1].charAt(0).toUpperCase()}.`);return Object.assign(Object.assign({},e),{reviewAuthorName:i,reviewBody:null!==(t=e.reviewBody)&&void 0!==t?t:"No review provided."})}generateHTML(e,t){const o=e.map(this.createTemplate).join("");let n="desktop"==this.viewType||"tablet"==this.viewType?t.map(this.createTemplate).join(""):null;const i=document.createElement("div"),s="desktop"==this.viewType||"tablet"==this.viewType?document.createElement("div"):null;i.className="carousel-container",i.innerHTML=o,n&&s&&(s.className="carousel-container",s.innerHTML=n);const r=document.createElement("div"),l="desktop"==this.viewType||"tablet"==this.viewType?document.createElement("div"):null;l&&s&&(l.className="left-carousel-parent rtl",l.appendChild(s),this.parentElement.appendChild(l)),r.className="right-carousel-parent ltr",r.appendChild(i),this.parentElement.appendChild(r),this.applyAnimation(r,l)}applyAnimation(e,t){try{const o=this.parentElement.getAttribute("data-speed");let n;switch(null==o?void 0:o.toLowerCase()){case"fast":n=1;break;case"medium":default:n=.5;break;
3case"slow":n=.1}e&&(this.bottomCarousel=new r.Carousel({selector:".reviews-animation .right-carousel-parent",trackSelector:".reviews-animation .right-carousel-parent .carousel-container",autoStart:!0,speed:n,infinite:!0,pauseDelay:3e4,direction:"right2left",gap:20})),t&&(this.topCarousel=new r.Carousel({selector:".reviews-animation .left-carousel-parent",trackSelector:".reviews-animation .left-carousel-parent .carousel-container",autoStart:!0,speed:n,infinite:!0,pauseDelay:3e4,direction:"left2right",gap:20})),this.setupPauseResumeButton()}catch(e){console.warn("Failed to apply animation",e)}}setupPauseResumeButton(){const e=document.querySelector(".review-animation-controls.carousel-cta");if(!e)return;e.classList.contains("hidden")&&e.classList.remove("hidden");const t=document.querySelector(".review-animation-controls.carousel-cta .play-pause-btn");t?(t.removeEventListener("click",this.handlePauseResumeClick),t.addEventListener("click",this.handlePauseResumeClick)):console.warn("Pause/Resume button not found with selector: .review-animation-controls.carousel-cta .play-pause-btn")}togglePauseResumeElements(){const e=".review-animation-controls.carousel-cta .play-pause-btn",[t,o]=document.querySelectorAll(`${e} .play-icon, ${e} .pause-icon`);if(!t||!o)return;const n=this.isPaused?t:o,i=this.isPaused?o:t;n.classList.contains("hidden")&&n.classList.remove("hidden"),i.classList.contains("hidden")||i.classList.add("hidden")}get viewType(){let e="desktop";return window.innerWidth<426&&(e="mobile"),window.innerWidth<781&&window.innerWidth>425&&(e="tablet"),e}}window.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector(".reviews-animation");if(!e)return;e.innerHTML="";const[t,o]=document.querySelectorAll("#countryCode, #conceptId");if(!t||!o)return;const n="us"==(null==t?void 0:t.value.toLowerCase())?1:2,i=o.value;try{new d({parentElement:e,conceptId:i,countryId:n,displayStars:!0})}catch(e){console.warn("Failed to load testimonial animation",e)}})},"./src/js/opus2/testimonial/testimonial-card.ts"(e,t,o){"use strict";var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=(o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),o(/*! ./imageHelper */"./src/js/opus2/testimonial/imageHelper.ts"),o(/*! ./ratingDisplay */"./src/js/opus2/testimonial/ratingDisplay.ts"),o(/*! ../services/worker-injector */"./src/js/opus2/services/worker-injector.ts"));let s="idle";document.addEventListener("DOMContentLoaded",()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("pageType"))||void 0===e?void 0:e.value;if(t&&"opus 2 location map"!==t.toLocaleLowerCase()){document.querySelector(".testimonials-section")&&function(){(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if("idle"===s){s="in_progress";try{if(yield(0,i.checkIncognito)()){const{TestimonialVDOM:e}=yield o.e(/*! import() | testimonial-vdom */"testimonial-vdom").then(o.bind(o,/*! ./testimonial-card-VDOM */"./src/js/opus2/testimonial/testimonial-card-VDOM.ts"));yield e.create(),s="done"}const t="true"===sessionStorage.getItem("rocketEnabled"),r="true"===sessionStorage.getItem("rocketDisabled"),l=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value;if(t&&"19"!==l){const{TestimonialRocket:e}=yield o.e(/*! import() | testimonial-rocket */"testimonial-rocket").then(o.bind(o,/*! ./testimonial-poc */"./src/js/opus2/testimonial/testimonial-poc.ts")),t=e.getTestimonialInstance();return t.domLookup(),t.getData(),void(s="done")}if(r){const{TestimonialVDOM:e}=yield o.e(/*! import() | testimonial-vdom */"testimonial-vdom").then(o.bind(o,/*! ./testimonial-card-VDOM */"./src/js/opus2/testimonial/testimonial-card-VDOM.ts"));return yield e.create(),void(s="done")}{let e=0;const t=setInterval(()=>(0,n.__awaiter)(this,void 0,void 0,function*(){if("done"===s)return void clearInterval(t);const n="true"===sessionStorage.getItem("rocketEnabled"),i="true"===sessionStorage.getItem("rocketDisabled");if(n&&"19"!==l){clearInterval(t);const{TestimonialRocket:e}=yield o.e(/*! import() | testimonial-rocket */"testimonial-rocket").then(o.bind(o,/*! ./testimonial-poc */"./src/js/opus2/testimonial/testimonial-poc.ts")),n=e.getTestimonialInstance();return n.domLookup(),n.getData(),void(s="done")}if(i||5===e){clearInterval(t);const{TestimonialVDOM:e}=yield o.e(/*! import() | testimonial-vdom */"testimonial-vdom").then(o.bind(o,/*! ./testimonial-card-VDOM */"./src/js/opus2/testimonial/testimonial-card-VDOM.ts"));return yield e.create(),void(s="done")}e++}),500)}}catch(e){throw s="idle",e}}})}()}}))},"./src/js/opus2/testimonial/testimonial-common.ts"(e,t,o){"use strict";o.d(t,{TESTIMONIAL_SELECTOR:()=>u,default:()=>h});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),l=o(/*! ../services/worker-injector */"./src/js/opus2/services/worker-injector.ts"),a=o(/*! ../util/keyGeneration */"./src/js/opus2/util/keyGeneration.ts"),d=o(/*! ./imageHelper */"./src/js/opus2/testimonial/imageHelper.ts"),c=o(/*! ../services/woker-api */"./src/js/opus2/services/woker-api.ts");const u=".testimonials-section";class m{static getInstance(){var e;return null!==(e=m.instance)&&void 0!==e||(m.instance=new m),m.instance}constructor(){}buildUrl(e,t,o,n,s,r){const l=null!=e?e:0,a=null!=t?t:0,d=null!=o?o:0;return`${i.apiConfig.TESTIMONIAL_REVIEWS}/${l}/${a}/${d}/0/${n}/${s}/${r}`}getDataFromServer(e,t,o,i,l,a){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=this.buildUrl(e,t,o,i,l,a);return(0,r.cachedAPIWrapper)(n,s.apiCaching.TestimonyAndReview)})}clampRating(e){return Number.isNaN(e)?0:Math.max(0,Math.min(5,e))}computeStarBuckets(e){const t=this.clampRating(e),o=Math.floor(t),n=t-o>=.5&&o<5;return{full:o,half:n,empty:5-o-(n?1:0)}}generateRatingStars(e){const{full:t,half:o,empty:n}=this.computeStarBuckets(e);return'<span class="star full">â
</span>'.repeat(t)+(o?'<span class="star half">
3â
</span>':"")+'<span class="star empty">â</span>'.repeat(n)}createTestimonialVNode(e){if(!(null==e?void 0:e.reviewAuthorName))return null;const t=e.reviewAuthorName,o=t.match(/\p{L}+/gu)||t.match(/\b[a-zA-Z]+\b/g)||[];let n=t;1===o.length?n=o[0]:o.length>=2&&(n=`${o[0]} ${o[1].charAt(0).toUpperCase()}.`);const i=null===e.reviewPhotoUrl?(0,d.getImageReplacemnt)(n,"testimonialVdom"):{type:"div",props:{class:"testi-profile"},children:[{type:"img",props:{src:e.reviewPhotoUrl,alt:`Profile image for ${n}`,width:72,height:73},children:[]}]},s=[],r=this.computeStarBuckets(e.reviewStarRating?e.reviewStarRating:0);for(let e=0;e<r.full;e++)s.push({type:"span",props:{class:"star full"},children:["â
"]});r.half&&s.push({type:"span",props:{class:"star half"},children:["â
"]});for(let e=0;e<r.empty;e++)s.push({type:"span",props:{class:"star"},children:["â"]});return{type:"li",props:{class:"testi-main-wrap"},children:[{type:"div",props:{class:"testi-main"},children:[{type:"div",props:{class:"testi-details"},children:[i,{type:"div",props:{class:"testi-bio"},children:(()=>{const t=[];return t.push({type:"strong",props:{class:"user-name"},children:[n]}),e.city&&t.push({type:"address",props:{class:"address"},children:[e.city]}),t.push({type:"div",props:{class:"rating"},children:s}),e.reviewSourceType&&t.push({type:"span",props:{class:"review-source"},children:[`via ${e.reviewSourceType}`]}),t})()}]},{type:"div",props:{class:"testi-comment"},children:(()=>{const t=[];return e.reviewBody&&t.push({type:"p",props:{class:"body-text-sm"},children:["â"+e.reviewBody+"â"]}),e.reviewResponseBody&&t.push({type:"div",props:{class:"testi-reply"},children:[{type:"p",props:{class:"body-text-sm"},children:["Owner Response:"]},{type:"p",props:{class:"body-text-sm"},children:["â"+e.reviewResponseBody+"â"]}]}),t})()}]}]}}storeInCache(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o=t.map(e=>this.createTestimonialVNode(e)).filter(e=>null!==e),n=yield(0,a.createVDOMHash)(o);yield(0,c.insertTemplate)(e,{responseHash:n,generatedTemplate:JSON.stringify(o),expiryTimestamp:Date.now()+864e5})}catch(e){console.warn("Error storing in cache:",e)}})}getFromCache(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n;try{const t=yield(0,c.lookupTemplate)(e);if(!(null==t?void 0:t.generatedTemplate))return null;const o=JSON.parse(t.generatedTemplate);return Array.isArray(o)&&o.length>0?o:null}catch(e){return console.warn("Error retrieving from cache:",e),this.handleCacheFailure(o),null!==(n=o[t])&&void 0!==n?n:null}})}handleCacheFailure(e){localStorage.setItem("testimonialCacheError","true");for(const t of Object.keys(e))delete e[Number(t)]}createTestimonialLists(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t;return(yield(0,l.checkIncognito)())?e.map(e=>{var t;return null!==(t=this.createTestimonialVNode(e))&&void 0!==t?t:null}).filter(e=>null!==e):Array.isArray(e)&&(null===(t=e[0])||void 0===t?void 0:t.type)?e:e.map(e=>this.createTestimonialVNode(e)).filter(e=>null!==e)})}}m.instance=null;const h=m}
3,"./src/js/opus2/util/add-Page-Type-DataLayer.ts"(e,t,o){"use strict";function n(){var e,t,o,n,i,s,r,l,a;let d,c={},u=window.location.origin,m=window.location.href;const h=null===(e=document.getElementById("pageType"))||void 0===e?void 0:e.value,p=null===window||void 0===window?void 0:window.crownpeakWeblocationsByIdDetail,v=(null===(t=null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)||void 0===t?void 0:t.include_statename)&&p&&m===`${u}/${null==p?void 0:p.stateName}/${localStorage.dbaName}/`||m===`${u}/${null===(o=null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)||void 0===o?void 0:o.weblocation_path_group}/${null==p?void 0:p.stateName}/${localStorage.dbaName}/`;if(u===m.substring(0,m.length-1)||m===`${u}/${localStorage.dbaName}`||m===`${u}/${localStorage.dbaName}/`||m===`${u}/${null===(n=null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)||void 0===n?void 0:n.weblocation_path_group}/${localStorage.dbaName}/`||v)return"Homepage";try{c=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)&&(null===(i=JSON.parse(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails))||void 0===i?void 0:i.pageTypeObj)?null===(s=JSON.parse(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails))||void 0===s?void 0:s.pageTypeObj:{pageArray:["Location Map","Blog","Service","Contact Us","Lead Flow","Content Page","White Paper","Photo Gallery","Our Team","Expert Tips","SiteMap","Confirmation","Event"]};for(const e of c.pageArray)(null===(l=null===(r=null==h?void 0:h.replace(/\s/g,""))||void 0===r?void 0:r.toLowerCase())||void 0===l?void 0:l.includes(null===(a=null==e?void 0:e.replace(/\s/g,""))||void 0===a?void 0:a.toLowerCase()))&&(d=e.toLowerCase());if(d==="Content Page".toLowerCase()){d=u===m.substring(0,m.length-1)||m===`${u}/${localStorage.dbaName}/`?"Homepage":"Others"}return d}catch(e){console.log("An error occurred in adding PagetypeDatalayer: ",e)}}function i(){var e;const t=null===(e=document.getElementById("dbaName"))||void 0===e?void 0:e.value;return localStorage.dbaName||t?"Local":"National"}o.d(t,{getLocalization:()=>i,getPageInfo:()=>n})},"./src/js/opus2/util/addressOnLeadFlow.ts"(e,t,o){"use strict";o.d(t,{showAddressForGoogle:()=>i});var n=o(/*! ./pageSettings */"./src/js/opus2/util/pageSettings.ts");function i(e){if(function(e,t){return null!==e&&t.includes(e)}((""===(0,n.getPageSettings)("pagescope")?null:(0,n.getPageSettings)("pagescope")).replace(/\s+/g,"-"),["general-os-flow-content","opus-2-lead-flow-template","opus-2-lead-flow-confirmation-page","opus-2-onverity-ims-lead-flow","opus-2-hms-lead-flow-template","opus-2-mly-lead-flow-template","opus-2-agnostic-lead-flow-template"])){"true"===function(){const e=new URL(window.location.href);return new URLSearchParams(e.search).get("ShowAddressOnHeader")}()&&function(e){const t=document.querySelector(".brand-header-local .local-location.disable_dba_os_flow");if(t){const o=t.querySelector(".address-full");o&&o.remove(),t.innerHTML+=`<span class="address-full">${null!=e?e:""}</span>`;const n=t.querySelector(".address-full");n&&(n.style.fontSize=".875rem",n.style.fontWeight="400")}}(e)}}},"./src/js/opus2/util/brandLoadingManager.ts"(e,t,o){"use strict";o.d(t,{waitForBrandDataBeforeFooterConfig:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts"),s=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts");class r{constructor(){this.brandLoadingPromise=null,this.isBrandLoaded=!1,this.maxWaitTime=1e4}static getInstance(){return r.instance||(r.instance=new r),r.instance}isBrandDataAvailable(){const e=localStorage.getItem("brandDetails");return null!==e&&"undefined"!==e&&e.length>0}loadBrandData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(this.brandLoadingPromise)return this.brandLoadingPromise;const e=document.getElementById("conceptCode"),t=null==e?void 0:e.value;return t?(this.brandLoadingPromise=(0,i.getBrandDetailsFromBrandJson)(t).then(e=>(this.isBrandLoaded=!0,e)).catch(e=>((0,s.isTestEnvironment)()&&console.error("Failed to load brand data:",e),this.isBrandLoaded=!1,null)),this.brandLoadingPromise):((0,s.isTestEnvironment)()&&console.warn("ConceptCode not found - skipping brand data loading"),null)})}waitForBrandData(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(this.isBrandDataAvailable())return this.isBrandLoaded=!0,!0;if(this.brandLoadingPromise)try{return yield this.brandLoadingPromise,this.isBrandLoaded}catch(e){return(0,s.isTestEnvironment)()&&console.error("Error waiting for existing brand loading promise:",e),!1}try{const e=new Promise((e,t)=>
3{setTimeout(()=>{t(new Error(`Brand data loading timeout after ${this.maxWaitTime}ms`))},this.maxWaitTime)});return yield Promise.race([this.loadBrandData(),e]),this.isBrandLoaded}catch(e){return(0,s.isTestEnvironment)()&&console.warn("Brand data loading failed or timed out:",e),!1}})}}function l(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=r.getInstance();return yield e.waitForBrandData()})}},"./src/js/opus2/util/checkDeviceAndBrowserType.ts"(e,t,o){"use strict";o.d(t,{userBrowserDetails:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! detectincognitojs */"./node_modules/detectincognitojs/dist/detectIncognito.esm.js");function s(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o,s,r,l,a,d,c,u;const m=localStorage.getItem("encypUsrDtl");if(m)try{const e=atob(m);return JSON.parse(e)}catch(e){console.warn("Error in encypUsrDtl:",e)}try{const m=null!==(e=navigator.userAgent)&&void 0!==e?e:"Unknown",h=null!==(t=function(e){return/Firefox/i.test(e)?"Firefox":/Edg/i.test(e)?"Edge":/Chrome/i.test(e)&&!/Chromium/i.test(e)?"Chrome":/Safari/i.test(e)&&!/Chrome/i.test(e)?"Safari":/OPR|Opera/i.test(e)?"Opera":"Unknown"}(m))&&void 0!==t?t:"Unknown",p=null!==(o=function(e){const t=/(Firefox|Chrome|Safari|Edg|Opera|OPR)\/(\d+\.\d+)/.exec(e);return t?t[2]:"Unknown"}(m))&&void 0!==o?o:"Unknown",v=Number.parseInt(p,10)||"Unknown",g=null!==(s=function(e){return/Mobi|Android/i.test(e)?"Mobile":/Tablet|iPad/i.test(e)?"Tablet":"Desktop"}(m))&&void 0!==s?s:"Unknown",f=null!==(r=function(e){return/Windows NT 10/i.test(e)?"Windows 10/11":/Windows NT 6.3/i.test(e)?"Windows 8.1":/Windows NT 6.2/i.test(e)?"Windows 8":/Windows NT 6.1/i.test(e)?"Windows 7":/Mac OS X/i.test(e)?"MacOS":/Linux/i.test(e)?"Linux":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":"Unknown"}(m))&&void 0!==r?r:"Unknown",y=`${null!==(a=null===(l=window.screen)||void 0===l?void 0:l.width)&&void 0!==a?a:0}x${null!==(c=null===(d=window.screen)||void 0===d?void 0:d.height)&&void 0!==c?c:0}`,b={userAgent:m,userBrowser:h,userBrowserVersion:p,majorVersion:v,deviceType:g,operatingSystem:f,screenResolution:y,inCognito:null!==(u=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const e=yield(0,i.detectIncognito)();return null!=e&&("boolean"==typeof e.isPrivate&&e.isPrivate)}catch(e){return!1}})}())&&void 0!==u&&u},I=btoa(JSON.stringify(b));return localStorage.setItem("encypUsrDtl",I),b}catch(e){return console.error("Error fetching user browser details:",e),{userAgent:"Unknown",userBrowser:"Unknown",userBrowserVersion:"Unknown",majorVersion:"Unknown",deviceType:"Unknown",operatingSystem:"Unknown",screenResolution:"Unknown",inCognito:!1}}})}},"./src/js/opus2/util/common-neaybyLocations.ts"(e,t,o){"use strict";o.d(t,{fetchNearbyLocationData:()=>h,handleErrorScenario:()=>p,handleNearbyLocationsFlow:()=>m});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ../header/GetLocateLocation */"./src/js/opus2/header/GetLocateLocation.ts"),a=o(/*! ../hms/hms-step1 */"./src/js/opus2/hms/hms-step1.ts"),d=o(/*! ./nearbyLocations */"./src/js/opus2/util/nearbyLocations.ts"),c=o(/*! ./share */"./src/js/opus2/util/share.ts");function u(e,t,o,i){new d.NearbyLocations(e,t).searchNearbyLocations(o).then(e=>function(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!(null==e?void 0:e.length))return p(e);(null==e?void 0:e.length)>0?yield v(e,t,o):p(e)})}(e,o,i)).catch(()=>p(o))}function m(e){const t=l.GetLocateLocation.getInstance().getInputValue("conceptCode");(0,c.getBrandDetailsFromBrandJson)(t).then(t=>{const o=null==t?void 0:t.enable_50mile_areameasure_findChangeMyLocation,i=null==t?void 0:t.enable_50mile_areameasure;if(o)(null==t?void 0:t.use_miles_endPoint)?function(e,t){(0,n.__awaiter)(this,void 0,void 0,function*(){var o,i,s;(function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){let o=r.apiConfig.WebLocationsFranchiseGroupAPI;const n=document.getElementById("find-local-input").value.trim();return n?("km"===e&&(t=l.GetLocateLocation.getInstance().milesToKilometers(t)),h(o,n,t,".find-section")):null})})(null!==(i=null===(o=null==t?void 0:t.area_measure_values_findChangeMyLocation)||void 0===o?void 0:o.includes("miles"))&&void 0!==i&&i?"miles":"km",null!==(s=null==t?void 0:t.nearest_franchiselimit_findC
3hangeMyLocation)&&void 0!==s?s:50).then(o=>(0,n.__awaiter)(this,void 0,void 0,function*(){(null==o?void 0:o.length)>0?yield v(o,e,t):p(e)})).catch(t=>{console.error("Error fetching nearby locations:",t),p(e)})})}(e,t):function(e,t){var o;const i="miles",s=null!==(o=null==t?void 0:t.nearest_franchiselimit_findChangeMyLocation)&&void 0!==o?o:50;l.GetLocateLocation.getInstance().searchNearbyLocations(i,s,e).then(o=>(0,n.__awaiter)(this,void 0,void 0,function*(){yield v(o,e,t)})).catch(t=>{console.log("Error searching nearby locations",t),p(e)})}(e,t);else if(i){u((null==t?void 0:t.area_measure_values)?l.GetLocateLocation.getInstance().findUnits(t.area_measure_values):"miles",(null==t?void 0:t.nearest_franchiselimit)?Number(t.nearest_franchiselimit):50,e,t)}else p(e)}).catch(t=>{console.log("Unable to read brands.json. Error:",t),p(e)})}function h(e,t,o,r){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!t)return null;let n=`${e}/${t}/miles/${o}?apikey=pneiweb-9pbaOywNKQj853D`;const l=function(e){var t,o,n,i;const s=document.querySelector(e);if(!s)return;let r,l=s.querySelectorAll('input[type="radio"].radio-basic');l&&0!==(null==l?void 0:l.length)||(l=s.querySelectorAll('input[type="radio"].glass-type-radio'));if((null==l?void 0:l.length)>0)for(const e of l){const s=e;if(null==s?void 0:s.checked){const s=(null===(t=e.parentElement)||void 0===t?void 0:t.querySelector(".findlocal-service-id"))||(null===(o=e.closest(".glass-type"))||void 0===o?void 0:o.querySelector(".modal-lead-service-id"));if(s&&(null===(n=null==s?void 0:s.classList)||void 0===n?void 0:n.contains("findlocal-service-id"))&&(null==s?void 0:s.value)||s&&(null===(i=null==s?void 0:s.classList)||void 0===i?void 0:i.contains("modal-lead-service-id"))&&(null==s?void 0:s.value))return r=s.value,r}}return}(r);l&&(n+=`&serviceId=${l}`);try{const e=yield(0,i.cachedAPIWrapper)(n),t=(0,c.filterFranchiseData)(e);return(0,s.isTestEnvironment)()&&(console.log("NearByLocation:",t),console.log("NearByLocation length:",null==t?void 0:t.length)),t}catch(e){return console.error("Error searching nearby locations",e),null}})}function p(e){const t=document.querySelector(".find-local"),o=document.getElementById("local-search-modal"),n=document.getElementById("find-local-input");n&&(o.value=n.value);const i=document.getElementById("step1-text1"),s=document.getElementById("step1-text2");i.style.display="none",s.style.display="block",t.click()}function v(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n;const i=l.GetLocateLocation.getInstance().getInputValue("conceptId");if((null==e?void 0:e.length)>1)l.GetLocateLocation.getInstance().openNearByLocationsModal(e,t,o);else if(1===(null==e?void 0:e.length))if("25"===i){a.ScheduleService.getInstance().checkPOSSystemWithZip(t)}else if(null===(n=e[0])||void 0===n?void 0:n.websiteUrl){t&&l.GetLocateLocation.getInstance().storeSessionData("sAddressParam",t);const o=new URL(e[0].websiteUrl).pathname,n=new URL(globalThis.location.href).host;globalThis.location.replace(`https://${n}${o}`)}else p();else p()})}},"./src/js/opus2/util/commonValidation.ts"(e,t,o){"use strict";function n(e,t,o,n){var i;const s=null===(i=document.getElementById(t))||void 0===i?void 0:i.getAttribute("aria-describedby"),r=document.getElementById(t);if(""===e.value||o.test(e.value))e.classList.remove("invalid-field"),r&&r.classList.add("hidden");else if(r)r.classList.remove("hidden"),r.innerHTML=null!=s?s:n;else if(e.parentNode){const t=document.createElement("span");t.className="error-msg",t.id=`${e.id}-error-msg`,t.textContent=null!=s?s:n,e.classList.add("invalid-field"),e.parentNode.appendChild(t)}}function i(e,t,o,n){var i;const s=null===(i=document.getElementById(t))||void 0===i?void 0:i.getAttribute("aria-describedby"),r=document.getElementById(t);if(""===e.value||o.test(e.value))e.classList.remove("invalid-field"),r&&r.classList.add("hidden");else if(r)r.classList.remove("hidden"),r.innerHTML=null!=s?s:n;else if(e.parentNode){const t=document.createElement("span");t.className="error-msg",t.id=`${e.id}-modal-error-msg`,t.textContent=null!=s?s:n,e.classList.add("invalid-field"),e.parentNode.appendChild(t)}}o.d(t,{handleCommonInputError:()=>i,handleInputError:()=>n})},"./src/js/opus2/util/confirmation-page-add-to-calendar.ts"(e,t,o){"use strict";function n(){!function(){const e=document.querySelector(".booking-date-time .appointment-detail-wrap");if(!e)return void console.error(".appointment-detail-wrap element not found");const t='\n <div class="icon-block-text mt-2">\n <button id="dropdown-user-calendar" data-dropdown-toggle="dropdown-calendar" data-dropdown-placement="bottom" class="primary-outline-btn" type="button">\n <img src="/brand/_assets/images/brand-img/lead-flow/calendar-ad
3d-svgrepo-com.svg" alt="calendar" width="24" height="24" style="">\n Add to Calendar\n </button>\n </div>\n ',o=document.createElement("template");o.innerHTML=t.trim();const n=o.content.firstElementChild;n&&e.appendChild(n)}();const e=document.querySelector(".appointment-list");if(!e)return void console.error(".appointment-list element not found");const t=document.createElement("div");t.id="dropdown-calendar",t.className="calendar-listing hidden";const o=document.createElement("ul");o.className="listing-cal",o.setAttribute("aria-labelledby","dropdown-user-calendar");[{src:"/brand/_assets/images/brand-img/lead-flow/apple.svg",alt:"apple calendar",text:"Apple"},{src:"/brand/_assets/images/brand-img/lead-flow/google-calendar.svg",alt:"g-calendar calendar",text:"Google"},{src:"/brand/_assets/images/brand-img/lead-flow/outlook.svg",alt:"outlook calendar",text:"Outlook"},{src:"/brand/_assets/images/brand-img/lead-flow/ical.svg",alt:"icalender calendar",text:"iCalendar"},{src:"/brand/_assets/images/brand-img/lead-flow/yahoo.svg",alt:"yahoo calendar",text:"Yahoo"}].forEach(e=>{const t=document.createElement("li"),n=document.createElement("a");n.className="calendar-link";const i=document.createElement("img");i.className="w-6 h-6 me-2",i.src=e.src,i.alt=e.alt,n.appendChild(i),n.appendChild(document.createTextNode(e.text)),t.appendChild(n),o.appendChild(t)}),t.appendChild(o),e.insertAdjacentElement("afterend",t)}function i(){var e,t,o,n,i,s,r,l,a,d;const c=null!==(o=null===(t=null===(e=document.querySelector(".booking-date-time .icon-block-text"))||void 0===e?void 0:e.textContent)||void 0===t?void 0:t.trim())&&void 0!==o?o:"",u=document.querySelectorAll(".booking-date-time .icon-block-text");let m=u.length>1&&null!==(i=null===(n=u[1].textContent)||void 0===n?void 0:n.trim())&&void 0!==i?i:"",h="";const v=document.querySelectorAll(".service-address .icon-block-text");null==v||v.forEach(e=>{var t;h&&(h+=", "),h+=null===(t=e.textContent)||void 0===t?void 0:t.trim()});const g=null!==(s=localStorage.getItem("localPhoneNumber"))&&void 0!==s?s:"",f=null!==(r=localStorage.getItem("doingBusinessAs"))&&void 0!==r?r:"";if(!c||!m)return void console.error("Appointment date or time is missing.");let y,b;/\d{1,2}:\d{2}\s?(?:am|pm)\s?-\s?\d{1,2}:\d{2}\s?(?:am|pm)/i.test(m)||(m=function(e){return{morning:"8:00 am - 12:00 pm",afternoon:"12:00 pm - 5:00 pm",evening:"5:00 pm - 9:00 pm","after hours":"5:00 pm - 9:00 pm"}[e.toLowerCase()]||""}(m.toLowerCase())),[y,b]=m.split(" - ");const I=p(c,y),S=p(c,b);if(!I||!S)return;let w="recurring"===sessionStorage.getItem("JobFrequency").toLowerCase()?".recurring-email-description":".otc-email-description";document.querySelector(w)||(w=".email-description");const L=null!==(d=null===(a=null===(l=document.querySelector(w))||void 0===l?void 0:l.textContent)||void 0===a?void 0:a.trim())&&void 0!==d?d:"";return{uid:"",title:"",description:"",startTime:I,endTime:S,location:h,brandDBAName:f,phone:g,comments:L}}function s(e,t){var o,n,i,s;if((null==e?void 0:e.startTime)&&(null==e?void 0:e.endTime)&&(null==e?void 0:e.location)&&(null==e?void 0:e.brandDBAName)&&(null==e?void 0:e.phone))switch(e.uid||(e.uid=function(){const e=new Uint32Array(2);return crypto.getRandomValues(e),`${Date.now().toString(16)}-${e[0].toString(16)}-${e[1].toString(16)}`}()),e.title||(e.title=`Your Appointment with ${e.brandDBAName}`),e.description||(e.description=(n=null!==(o=e.comments)&&void 0!==o?o:"",i=e.brandDBAName,s=function(e){let t=e.toString();return t.length>10&&(t=t.substring(1,t.length)),`${t.slice(0,3)}-${t.slice(3,6)}-${t.slice(6)}`}(e.phone),n?(n=n.replace("[brandname]",i).replace("[phonenumber]",s)).trim():"")),t.toLowerCase()){case"apple":case"icalendar":l(e);break;case"google":case"yahoo":case"outlook":c(e,t);break;default:a(e)}else console.log("Mandatory fields are missing")}function r(){const e=i();if(!e)return void console.log("could not get the required details");const t=document.getElementById("dropdown-calendar");t?t.addEventListener("click",t=>{var o,n;const i=null!==(n=null===(o=t.target.textContent)||void 0===o?void 0:o.trim())&&void 0!==n?n:"";i&&s(e,i)}):console.warn("Calendar container not found")}function l(e){console.log("iCalendar invite created",e);const t=a(e),o=new Blob([t],{type:"text/calendar"}),n=URL.createObjectURL(o),i=document.createElement("a");i.href=n,i.download="invite.ics",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)}function a(e){const{uid:t,title:o,description:n,startTime:i,endTime:s,location:r}=e,l=d(i),a=d(s),c=d(new Date);return`BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//NBLY//EN\nCALSCALE:GREGORIAN\nMETHOD:REQUEST\nBEGIN:VEVENT\nUID:${t}@${window.origin}\nDTSTAMP:${c}\nDTSTART:${l}\nDTEND:${a}\nSUMMARY:${o}\nDESCRIPTION:${n}\nLOCATION:${r}\nSTATUS:CONFIRMED\nSEQUENCE:0\nBEGIN:VALARM\nDESCRIPTION:Reminder\nACTION:DISPLAY\nEND:VALARM\nEND:VEVENT\nEND:VCALENDAR`}function d(e){return`${e.getUTCFullYear()}${("0"+(e.getUTCMonth()+1)).slice(-2)}${("0"+e.getUTCDate()).slice(-2)}T${("0"+e.getUTCHours()).slice(-2)}${("0"+e.getUTCMinutes()).slice(-2)}${("0"+e.getUTCSeconds()).slice(-2)}Z`}function c(e,t){console.log(`${t} calendar invite created`,e);const o=u(e,t);window.open(o,"_blank")}function u(e,t){const{uid:o,title:n,description:i,startTime:s,endTime:r,location:l}=e,a=h(s),d=h(r),c=n?encodeURIComponent(n):"",u=i?encodeURIComponent(i):"",p=l?encodeURIComponent(l):"";if("google"===t.toLowerCase())return`https://calendar.google.com/calendar/render?action=TEMPLATE&text=${c}&details=${u}&location=${p}&dates=${a}/${d}&id=${o}`;if("outlook"===t.toLowerCase()){return`https://outlook.office365.com/calendar/action/compose?subject=${c}&startdt=${m(s)}&enddt=${m(r)}&body=${u}&location=${p}&id=${o}`}return`https://calendar.yahoo.com/?v=60&view=d&type=20&title=${c}&st=${a}&et=${d}&desc=${u}&in_loc=${p}&id=${o}`}function m(e){return new Date(e).toISOString()}function h(e){return e.toISOString().replace(/[-:]/g,"").split(".")[0]+"Z"}function p(e,t){try{const o=`${e.split(", ")[1]+", "+e.split(", ")[2]} ${t}`,n=new Date(o);if(Number.isNaN(n.getTime()))throw new Error("Invalid Date Format");return n}catch(e){return console.error("Error parsing date:",e),null}}o.d(t,{calendarInvite:()=>s,loadAddToCalendarDropDown:()=>n,setupCalendarInvites:()=>r})},"./src/js/opus2/util/coupons-event-handling.ts"(e,t,o){"use strict";o.d(t,{attachEventListenerForClaim:()=>r,attachEventListenerForHeroBannerClaim:()=>d,getOfferTeaserPath:()=>a});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./prints */"./src/js/opus2/util/prints.ts"),s=o(/*! ./share */"./src/js/opus2/util/share.ts");function r(e,t,o,n){const s=document.querySelectorAll(`${e} ${t}`);
30!==(null==s?void 0:s.length)&&s.forEach((t,s)=>{var r;""!==(null==t?void 0:t.getAttribute("href"))&&"#"!==(null==t?void 0:t.getAttribute("href"))?null==t||t.addEventListener("click",t=>{var i;t.preventDefault();const s=t.target;if(null===(i=null==s?void 0:s.classList)||void 0===i?void 0:i.contains("secondary-btn")){const t=s.href;let i;".sp-offers-section.coupons-eight"!==e&&".offers-block-section"!==e&&".offers-block-section.dynamic-offer-teaser-component"!==e||(i=null==s?void 0:s.closest(o),i&&function(e,t,o,n){var i,s,r,a,d,c,u,m,h,p,v,g,f,y,b,I,S,w;const L={title:"",description:"",couponexpirydate:"",longdescription:"",couponcode:"",servicemodifier:[]};L.title=null!==(s=null===(i=t.querySelector(n.titleSelector))||void 0===i?void 0:i.textContent)&&void 0!==s?s:"",L.description=null!==(a=null===(r=t.querySelector(n.descriptionSelector))||void 0===r?void 0:r.textContent)&&void 0!==a?a:"",L.couponexpirydate=null!==(u=null===(c=null===(d=t.querySelector(n.expirySelector))||void 0===d?void 0:d.textContent)||void 0===c?void 0:c.replace("Expires: ",""))&&void 0!==u?u:"";const E=null!==(h=null===(m=t.querySelector(`${n.disclaimerSelector} p`))||void 0===m?void 0:m.textContent)&&void 0!==h?h:"",C=null!==(v=null===(p=t.querySelector(`${n.disclaimerSelector} p a`))||void 0===p?void 0:p.textContent)&&void 0!==v?v:"";L.longdescription=`${E} ${C}`;const A=null!==(f=null===(g=t.querySelector('input[type="hidden"][servicetype]'))||void 0===g?void 0:g.getAttribute("servicetype"))&&void 0!==f?f:"";A&&(L.servicemodifier=A.split(","));if(".offers-block-section"===e||".offers-block-section.dynamic-offer-teaser-component"===e){const e=null!==(b=null===(y=t.querySelector(`${n.disclaimerSelector}`))||void 0===y?void 0:y.textContent)&&void 0!==b?b:"";L.longdescription=`${e}`}const _=t.querySelector(n.couponCodeInputSelector);if(".offers-block-section.dynamic-offer-teaser-component"===e){const e=Array.from(null!==(S=null===(I=t.parentElement)||void 0===I?void 0:I.children)&&void 0!==S?S:[]).indexOf(t);if(n.couponCodeInputSelector){const o=t.querySelector(`${n.couponCodeInputSelector}${e}`);o?L.couponcode=null!==(w=o.textContent)&&void 0!==w?w:"":console.log("No Coupon code found")}}else _?L.couponcode=_.value:console.log("No Coupon code found");l(L,o)}(e,i,t,n))}}):".offers-block-section"!==e&&".offers-block-section.dynamic-offer-teaser-component"!==e||""!==(null==t?void 0:t.getAttribute("href"))&&"#"!==(null==t?void 0:t.getAttribute("href"))||t.addEventListener("click",e=>{e.preventDefault(),(0,i.printOffer)(e,s)});const a=null===(r=t.closest(".offers-block-item"))||void 0===r?void 0:r.querySelector(".print-offer-link a");a&&a.addEventListener("click",e=>{e.preventDefault(),(0,i.printOffer)(e,s)})})}function l(e,t){sessionStorage.setItem("offerDetails",JSON.stringify(e)),t&&(globalThis.location.href=t)}function a(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=globalThis.location.origin,t=localStorage.getItem("dbaName");let o=[];if(t){const n=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null;if(null==n?void 0:n.include_statename){let n=null===globalThis||void 0===globalThis?void 0:globalThis.crownpeakWeblocationsByIdDetail;if(n){const i=null==n?void 0:n.stateName;return o.push("specialofferteaserdata",t,i),`${e}/${o.join("/")}`}if(yield(0,s.fetchCrownpeakUrlDetails)(),n=null===globalThis||void 0===globalThis?void 0:globalThis.crownpeakWeblocationsByIdDetail,n){const i=null==n?void 0:n.stateName;return o.push("specialofferteaserdata",t,i),`${e}/${o.join("/")}`}return o.push("specialofferteaserdata",t),`${e}/${o.join("/")}`}return o.push("specialofferteaserdata",t),`${e}/${o.join("/")}`}return null})}function d(){const e=document.querySelector("section.hero-banner .hero-coupon-cta-button");if(!e)return;const t=e.getAttribute("href");""!==t&&"#"!==t&&e.addEventListener("click",t=>{var o,n,i,s,r,a,d,c,u,m,h,p,v,g;t.preventDefault();const f=e.closest(".hero-coupon-content"),y=e.closest(".hero-coupon-cta-wrap"),b=null==y?void 0:y.querySelector("#hero-banner-Offer-c
3pn-code"),I=null!==(n=null===(o=null==b?void 0:b.textContent)||void 0===o?void 0:o.trim())&&void 0!==n?n:"";l({title:null!==(r=null===(s=null===(i=null==f?void 0:f.querySelector(".hero-coupon-offer"))||void 0===i?void 0:i.textContent)||void 0===s?void 0:s.trim())&&void 0!==r?r:"",description:null!==(c=null===(d=null===(a=null==f?void 0:f.querySelector(".hero-coupon-desc"))||void 0===a?void 0:a.textContent)||void 0===d?void 0:d.trim())&&void 0!==c?c:"",couponexpirydate:null!==(h=null===(m=null===(u=null==f?void 0:f.querySelector(".hero-coupon-expires"))||void 0===u?void 0:u.textContent)||void 0===m?void 0:m.replace("Expires: ","").trim())&&void 0!==h?h:"",longdescription:null!==(g=null===(v=null===(p=null==f?void 0:f.querySelector(".hero-coupon-footer"))||void 0===p?void 0:p.textContent)||void 0===v?void 0:v.trim())&&void 0!==g?g:"",couponcode:I,servicemodifier:[]},e.href)})}},"./src/js/opus2/util/createModal.ts"(e,t,o){"use strict";function n(e,t){const o=document.querySelector(e);if(o){const n={position:"relative"};if(Object.assign(o.style,n),!t){const e=document.createElement("button");e.type="button",e.className="close",e.setAttribute("data-dismiss","modal"),e.setAttribute("aria-label","Close"),e.style.position="absolute",e.style.top="-1.5rem",e.style.display="grid",e.style.right="0.25rem",e.style.height="3.25rem",e.style.width="3.25rem",e.style.background="#fff",e.style.borderRadius="50%",e.style.placeItems="center",e.style.boxShadow="rgba(90, 90, 90, 0.15) 7px 9px 17px -1px",e.id="mly-mobile-close",e.title="Close",e.addEventListener("click",i);const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.textContent="x",t.style.display="inline-block",t.style.width="3rem",t.style.height="3rem",t.style.top="0",t.style.backgroundImage="url(/brand/_assets/images/brand-img/icons/close-circle.svg)",t.style.color="rgba(0, 0, 0, 0)",t.style.overflow="hidden",t.style.backgroundSize="3rem",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="center",t.style.fontSize="0",t.style.opacity="0.8",t.style.pointerEvents="none",e.appendChild(t),o.appendChild(e)}const s=document.querySelector(`${e} .form-section.mly-lead-flow`);s&&(s.style.padding="2rem 1rem",s.style.marginTop="2rem",s.style.boxShadow="rgba(90, 90, 90, 0.5) 7px 9px 17px -1px",s.style.borderRadius="0.5rem")}}function i(){var e;(null===(e=document.referrer)||void 0===e?void 0:e.includes(window.location.origin))&&document.referrer?window.history.back():window.location.href=window.location.origin}o.d(t,{closeFunctionality:()=>i,createModal:()=>n})},"./src/js/opus2/util/crypto.ts"(e,t,o){"use strict";o.d(t,{CryptoWrapper:()=>i});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");class i{static getInstance(){return i.instance||(i.instance=new i),i.instance}constructor(){this.encoder=new TextEncoder,this.decoder=new TextDecoder,this.encode=e=>this.encoder.encode(e),this.decode=e=>this.decoder.decode(e),this.toBase64=e=>btoa(String.fromCharCode(...e)),this.fromBase64=e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0))}toSafeUint8Array(e){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}deriveKey(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=this.toSafeUint8Array(this.encode(e)),n=yield crypto.subtle.importKey("raw",o,{name:"PBKDF2"},!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:1e5,hash:"SHA-256"},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])})}encryptObject(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=crypto.getRandomValues(new Uint8Array(12)),i=this.toSafeUint8Array(n),s=this.encode(o),r=this.toSafeUint8Array(s),l=yield this.deriveKey(t,r),a=this.encode(JSON.stringify(e)),d=this.toSafeUint8Array(a),c=yield crypto.subtle.encrypt({name:"AES-GCM",iv:i},l,d);return{ciphertext:this.toBase64(new Uint8Array(c)),iv:this.toBase64(i),salt:o}})}decryptObject(e,t,o,i){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const n=this.fromBase64(t),s=this.toSafeUint8Array(n),r=this.fromBase64(e),l=this.toSafeUint8Array(r),a=this.encode(i),d=this.toSafeUint8Array(a),c=yield this.deriveKey(o,d),u=yield crypto.subtle.decrypt({
3name:"AES-GCM",iv:s},c,l);return JSON.parse(this.decode(u))}catch(e){throw new Error("Decryption failed. Possible incorrect password or corrupt data.")}})}}},"./src/js/opus2/util/cwv.handler.ts"(e,t,o){"use strict";o.d(t,{cwvHandler:()=>r});var n=o(/*! ../cwv-handlers/handleConcomShop */"./src/js/opus2/cwv-handlers/handleConcomShop.ts"),i=o(/*! ../cwv-handlers/handleMeetTheTeamLoad */"./src/js/opus2/cwv-handlers/handleMeetTheTeamLoad.ts"),s=o(/*! ../cwv-handlers/handleStickyNavCollapse */"./src/js/opus2/cwv-handlers/handleStickyNavCollapse.ts");(0,o(/*! ./pageSettings */"./src/js/opus2/util/pageSettings.ts").getPageSettings)("pagetemplate");function r(){var e;const t=(null===(e=globalThis.location)||void 0===e?void 0:e.pathname)||"/not-found/",o={"/gift-certificates/":{method:s.handleStickyNavCollapse},"/why-hire-us/":{method:s.handleStickyNavCollapse},"/residential/dryer-vent-cleaning-services/dryer-vent-service-and-repair/":{method:s.handleStickyNavCollapse},"/leadership-team/":{method:i.default}};(0,n.handleConcomShopLoad)(),(0,i.default)();const r=t.split("/").filter(Boolean);if(r.length>0)for(const e of r){const t=`/${e}/`;if(o[t]){o[t].method();break}}}},"./src/js/opus2/util/device-detection.ts"(e,t,o){"use strict";function n(){return("ontouchstart"in window||navigator.maxTouchPoints)&&window.innerWidth<720}o.d(t,{isTouchDevice:()=>n})},"./src/js/opus2/util/disclaimerService.ts"(e,t,o){"use strict";o.d(t,{DisclaimerServiceIdentifier:()=>l,disclaimerHandleCheck:()=>a});var n=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),i=o(/*! ./domainService */"./src/js/opus2/util/domainService.ts"),s=o(/*! ./localizationService */"./src/js/opus2/util/localizationService.ts"),r=o(/*! ./payloadManipulator */"./src/js/opus2/util/payloadManipulator.ts");function l(e){const t=(0,i.DomainIdentifier)(),o=(0,s.LocalizationIdentifier)();let r=null;r=null==e||""===e?null:n.REGEX.sendCaPostalCode.test(e.trim())?"ca":"us";const l=document.querySelectorAll(".service-reminder-main"),a=Array.from(l);null==a||a.forEach(e=>{e.classList.add("hidden")}),0!==a.length&&a.forEach(e=>{const n=e.querySelector("[id*='service-reminder-us']"),i=e.querySelector("[id*='service-reminder-ca']");!function(e,t,o,n,i,s){const r=t=>{t&&e.classList.remove("hidden")};if("us"===t){if("ca"===o&&null===n)return void r(s);if("us"===n||!n)return void r(i);if("ca"===n&&s)e.classList.remove("hidden")}else if("ca"===t){if("ca"===n||!n)return void r(s);if("us"===n&&i)e.classList.remove("hidden")}}(e,t,o,r,n,i)})}function a(e,t,o,l,a){const d=a?t.querySelector(`#${a}`):null,c=document.querySelector(".service-reminder-ca-modal"),u=(0,i.DomainIdentifier)(),m=(0,s.LocalizationIdentifier)(),h=n.REGEX.sendCaPostalCode.test(null==l?void 0:l.trim())?"ca":"us";e&&c&&"ca"==h&&"ca"!==m&&c.click();const p=t.querySelector(`#${null==d?void 0:d.id}`);let v=p instanceof HTMLInputElement&&p.checked;return(0,r.payloadManipulator)(o,u,m,v,h)}},"./src/js/opus2/util/discovery.ts"(e,t,o){"use strict";o.d(t,{NO_CITY_FOUND:()=>a,NO_STATE_FOUND:()=>d,discoverSuggestions:()=>b,discoverSuggestionsFilter:()=>I,discoveryAPI:()=>S,getAddressConfirmation:()=>N,getAddressDetails:()=>C,getAllAddressList:()=>p,getSuggestedAddress:()=>v,handleMissingData:()=>k,isValidZip:()=>y,replaceLast:()=>L,setNAC:()=>E});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),l=o(/*! ./share */"./src/js/opus2/util/share.ts");const a="no city found",d="no state found";let c={lat:0,lng:0},u=[],m="",h=[];function p(){return u}function v(){return h}function g(e){u=e}function f(e){h=e}function y(e){const t=r.REGEX.sendZip;return!(!e||"00000"==e||!t.test(e))}function b(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){let o=!1;return y(null==e?void 0:e.value.trim())&&e.id.includes("zip-code")&&(o=!0),new Promise((n,r)=>{if(o){const o=`${s.apiConfig.geoCodeSearchApiUrl}?qq=postalCode=${e.value}&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk&in=countryCode%3AUSA%2CCAN%2CPRI`;(0,i.getCachedAPIResponse)(o).then(o=>{if(c=null==o?void 0:o.items[0].position,t.value){let o=`${s.apiConfig.DISCOVER_API}?q=${t.value}&in=countryCode%3AUSA%2CCAN%2CPRI&in=circle:${c.lat},${c.lng};r=50000&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`;(0,i.getCachedAPIResponse)(o).then(o=>{let i=[];
3null==o||o.items.forEach(t=>{var o;if(null===(o=t.address.postalCode)||void 0===o?void 0:o.includes("-")){t.address.postalCode=t.address.postalCode.split("-")[0];let e=t.address.label.split(t.address.postalCode);e.length>1&&(e=e[0]+t.address.postalCode+","+e[1].split(",")[1]),t.address.label=e}t.address.postalCode===e.value&&i.push(t)}),i.length>0?(f(i[0]),g(i),t.setAttribute("data-suggestion",JSON.stringify(p()[0])),w(p(),t),n(!0)):n(!0)}).catch(e=>{console.error("Error fetching suggestions:",e),n([])})}}).catch(e=>{console.error("Error fetching suggestions:",e),n([])})}else S(t.value).then(e=>{f(null==e?void 0:e.items[0]),null==e||e.items.forEach(e=>{var t;if(null===(t=e.address.postalCode)||void 0===t?void 0:t.includes("-")){e.address.postalCode=e.address.postalCode.split("-")[0];let t=e.address.label.split(e.address.postalCode);t.length>1&&(t=t[0]+e.address.postalCode+","+t[1].split(",")[1]),e.address.label=t}}),g(null==e?void 0:e.items),t.setAttribute("data-suggestion",JSON.stringify(e.items[0])),w(p(),t),n(!0)}).catch(e=>{console.error("Error fetching suggestions:",e),n([])})})})}function I(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(!(null==t?void 0:t.value))return[];let n=!1;return y(null==e?void 0:e.value.trim())&&e.id.includes("zip-code")&&(n=!0),new Promise((r,l)=>{if(n){const n=`${s.apiConfig.geoCodeSearchApiUrl}?qq=postalCode=${e.value}&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk&in=countryCode%3AUSA%2CCAN%2CPRI`;(0,i.getCachedAPIResponse)(n).then(n=>{if(c=null==n?void 0:n.items[0].position,t.value){let n=`${s.apiConfig.DISCOVER_API}?q=${t.value}&in=countryCode%3AUSA%2CCAN%2CPRI&in=circle:${c.lat},${c.lng};r=50000&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`;(0,i.getCachedAPIResponse)(n).then(n=>{let i=[];if(null==n||n.items.forEach(t=>{var n;const s=t.address;if(null===(n=t.address.postalCode)||void 0===n?void 0:n.includes("-")){t.address.postalCode=t.address.postalCode.split("-")[0];let e=t.address.label.split(t.address.postalCode);e.length>1&&(e=e[0]+t.address.postalCode+","+e[1].split(",")[1]),t.address.label=e}t.address.postalCode===e.value&&j(s,o)&&i.push(t)}),i.length>0)f(i[0]),g(i),t.setAttribute("data-suggestion",JSON.stringify(p()[0])),w(p(),t),r(i);else{const e=document.querySelector(".suggestion-container");null==e||e.remove(),r([])}}).catch(e=>{console.error("Error fetching suggestions:",e);const t=document.querySelector(".suggestion-container");null==t||t.remove(),r([])})}}).catch(e=>{console.error("Error fetching suggestions:",e);const t=document.querySelector(".suggestion-container");null==t||t.remove(),r([])})}else S(t.value).then(n=>{f(null==n?void 0:n.items[0]);let i=[];null==n||n.items.forEach(t=>{var n;if(null===(n=t.address.postalCode)||void 0===n?void 0:n.includes("-")){t.address.postalCode=t.address.postalCode.split("-")[0];let e=t.address.label.split(t.address.postalCode);e.length>1&&(e=e[0]+t.address.postalCode+","+e[1].split(",")[1]),t.address.label=e}const s=t.address;s.postalCode===e.value&&j(s,o)&&i.push(t)}),g(null==n?void 0:n.items),t.setAttribute("data-suggestion",JSON.stringify(n.items[0])),w(p(),t),r(i)}).catch(e=>{console.error("Error fetching suggestions:",e);const t=document.querySelector(".suggestion-container");null==t||t.remove(),r([])})})})}function S(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{if(e){const t=`${s.apiConfig.DISCOVER_API}?q=${e}&in=countryCode%3AUSA%2CCAN%2CPRI&at=0,0&apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk`;return yield(0,i.getCachedAPIResponse)(t)}}catch(e){throw new Error("Discover API does not return")}})}
3function w(e,t){try{const o=t,n=document.createElement("ul");for(n.className="suggestion-container";o.nextSibling&&"suggestion-container"===o.nextSibling.className;)o.parentNode.removeChild(o.nextSibling);e.forEach(e=>{var t;const i=document.createElement("li");i.className="suggestion-item",i.textContent=null==e?void 0:e.address.label,i.setAttribute("data-heremap",null!==(t=JSON.stringify(e.address))&&void 0!==t?t:""),i.addEventListener("click",()=>{sessionStorage.setItem("suggestion","true"),o.value=e.address.label,n.parentNode.removeChild(n);const t=C(JSON.parse(i.getAttribute("data-heremap")));sessionStorage.setItem("suggestedAddress",JSON.stringify(t)),o.focus(),m=t}),n.appendChild(i)}),e.length>0&&o.parentNode.insertBefore(n,o.nextSibling)}catch(e){console.log("error",e)}}function L(e,t,o){const n=e.lastIndexOf(t);return-1===n?e:e.slice(0,n)+o+e.slice(n+t.length)}function E(e){return e||"No Address Collected"}function C(e){if(!e||0===Object.keys(e).length)return{};let t=function(e){let t=e.label.replace(/,/g,"");return["countryName","countryCode","postalCode","stateCode","city","county","district","street","houseNumber"].forEach(o=>{e.hasOwnProperty(o)&&(t=L(t,e[o],""))}),t.trim()}(e),o="";t&&(o=t),e.hasOwnProperty("houseNumber")&&(o&&(o=`${o}, `),o=`${o}${e.houseNumber} `),e.hasOwnProperty("street")&&(o&&o==t&&(o+=", "),o+=e.street),e.hasOwnProperty("district")&&e.label.includes(e.district)&&(o&&o!=t&&(o+=","),o=o+" "+e.district);return{addr1:`${E(o)}`,city:`${A(e.city)}`,stateCode:`${A(e.stateCode)}`,postalCode:`${A(e.postalCode)}`,country:`${A(e.countryCode)}`}}function A(e){return e&&"null"!=e&&"undefined"!=e?e:""}const _=(e,t)=>{var o,n;return!(e&&t&&e.trim()&&t.trim())||((null===(o=null==e?void 0:e.trim())||void 0===o?void 0:o.toLowerCase())===a||(null===(n=null==t?void 0:t.trim())||void 0===n?void 0:n.toLowerCase())===d)};function k(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){var n;const i=sessionStorage.getItem("manualStateCode");if(!_(e,t)&&(null==i?void 0:i.trim())||!o)return Promise.resolve({city:e,state:t});try{const i=yield S(o),s=null===(n=null==i?void 0:i.items)||void 0===n?void 0:n[0],r=null==s?void 0:s.address;if(sessionStorage.setItem("manualStateCode",(null==r?void 0:r.stateCode)||""),(null==r?void 0:r.stateCode)&&(null==r?void 0:r.city))t=null==r?void 0:r.stateCode,e=null==r?void 0:r.city;else{const o=yield(0,l.handleGetFallbackLocationData)();t=o.state,e=o.city}return e=e||a,t=t||d,sessionStorage.setItem("manualCity",e),sessionStorage.setItem("manualState",t),Promise.resolve({city:e,state:t})}catch(o){if(console.warn("handleMissingData: Error occurred while fetching data from HERE Maps API",o),_(e,t)){const o=yield(0,l.handleGetFallbackLocationData)();t=o.state,e=o.city}return e=e||a,t=t||d,sessionStorage.setItem("manualCity",e),sessionStorage.setItem("manualState",t),Promise.resolve({city:e,state:t})}})}function N(e){var t,o,n,i,s,r,l,a,d,c,u,m;if(!e||0===Object.keys(e).length)return{line1:"",line2:""};const h=sessionStorage.getItem("suggestion"),p=sessionStorage.getItem("suggestedAddress");let v,g;if(h&&"true"===h&&p){const r=JSON.parse(p);v=P([null==r?void 0:r.addr1,null!==(o=null!==(t=null==e?void 0:e.Address2)&&void 0!==t?t:null==e?void 0:e.address2)&&void 0!==o?o:""]);g=B([T(null==r?void 0:r.city,null!==(n=null==e?void 0:e.City)&&void 0!==n?n:null==e?void 0:e.city),T(null==r?void 0:r.stateCode,null!==(i=null==e?void 0:e.State)&&void 0!==i?i:null==e?void 0:e.state),null!==(s=null==e?void 0:e.PostalCode)&&void 0!==s?s:null==e?void 0:e.postalCode])}else{v=P([null!==(l=null!==(r=null==e?void 0:e.Address)&&void 0!==r?r:null==e?void 0:e.address)&&void 0!==l?l:"",null!==(d=null!==(a=null==e?void 0:e.Address2)&&void 0!==a?a:null==e?void 0:e.address2)&&void 0!==d?d:""]);g=B([null!==(c=null==e?void 0:e.City)&&void 0!==c?c:null==e?void 0:e.city,null!==(u=null==e?void 0:e.State)&&void 0!==u?u:null==e?void 0:e.state,null!==(m=null==e?void 0:e.PostalCode)&&void 0!==m?m:null==e?void 0:e.postalCode])}return sessionStorage.setItem("suggestion","false"),{line1:v,line2:g}}function T(e,t){return e&&""!=e&&null!=e?e:t}function B(e){return e.filter(e=>
3e&&""!==e&&"no city found"!==e.toLowerCase()&&"no state found"!==e.toLowerCase()).join(", ")}function P(e){return e.filter(e=>e&&""!==e&&"No Address Collected"!==e).join(", ")}function j(e,t){return(null!=t?t:"").toLowerCase().split(" ").filter(Boolean).every(t=>Object.keys(e).filter(e=>"label"!==e).some(o=>{const n=e[o];return"string"==typeof n&&n.toLowerCase().includes(t)}))}},"./src/js/opus2/util/dom-loader-check.ts"(e,t,o){"use strict";function n(e,t){const o=`__${e}Init`;globalThis[o]?console.log(`${e} already initialized â skipping.`):(globalThis[o]=!0,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{t(),console.log(`${e} initialized (waited for DOMContentLoaded)`)},{once:!0}):(t(),console.log(`${e} initialized (DOM already ready)`)))}o.d(t,{initOnceWithDOMReady:()=>n})},"./src/js/opus2/util/domainService.ts"(e,t,o){"use strict";function n(){const e=window.location.origin;return function(e){return e.includes("localhost")}(e)?function(){var e;const t=globalThis.location.pathname,o=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value;if(t.toLowerCase().includes("/ca")&&("19"===o||"255"===o))return"ca";const n=document.getElementById("assetPath");if(n){const e=n.value;if(e.includes("/US/"))return"us";if(e.includes("/CA/"))return"ca"}return"Error validating Location"}():function(e){return e.includes("nblysbx")||e.includes("nblydev")||e.includes("nblytest")||e.includes("nblyprod")}(e)?function(e){var t;try{const o=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value;return!window.location.pathname.toLowerCase().includes("/ca")&&!e.toLowerCase().includes("/ca")||"19"!==o&&"255"!==o?e.includes("-ca-")||e.includes("-ca")&&e.includes("nblyprod")?"ca":"us":"ca"}catch(e){return"Error validating Location"}}(e):function(e){var t;try{const o=null===(t=document.getElementById("conceptId"))||void 0===t?void 0:t.value;if((window.location.pathname.toLowerCase().includes("/ca")||e.toLowerCase().includes("/ca"))&&("19"===o||"255"===o))return"ca";const n=e.lastIndexOf(".");return"ca"===e.substring(n+1)?"ca":"us"}catch(e){return"Error validating Location"}}(e)}o.r(t),o.d(t,{DomainIdentifier:()=>n})},"./src/js/opus2/util/errorMessages.ts"(e,t,o){"use strict";o.d(t,{default:()=>n});const n={invalidName:"Invalid name format.",invalidPhoneNumber:"Invalid phone number format.",invalidEmail:"Invalid email id format."}},"./src/js/opus2/util/fileUploads3.ts"(e,t,o){"use strict";o.d(t,{s3upload:()=>s});var n=o(/*! axios */"./node_modules/axios/lib/axios.js");const i=!1;function s(e,t){if(!i){const o=e,i=[];if(o){const e=function(){function e(e){const t=Date.now().toString(16).substring(2,8);return e?"-"+t.substring(0,4)+"-"+t.substring(4,4):t}return e(!1)+e(!0)+e(!0)+e(!1)}(),s=o,r=e+"."+s.name.split(".").pop(),l=function(e){const t=("localhost"===location.hostname||-1!==window.location.hostname.indexOf("nblydev")||-1!==window.location.hostname.indexOf("nblysbx")||window.location.hostname.indexOf("nblytest"),"https://api.neighborly.com"),o=("localhost"===location.hostname||-1!==window.location.hostname.indexOf("nblydev")||-1!==window.location.hostname.indexOf("nblysbx")||window.location.hostname.indexOf("nblytest"),"pneiweb-9pbaOywNKQj853D"),i=("localhost"===location.hostname||-1!==window.location.hostname.indexOf("nblydev")||-1!==window.location.hostname.indexOf("nblysbx")||window.location.hostname.indexOf("nblytest"),"digitalorchestrations-api");return n.default.get(`${t}/${i}/v1/public/OnlineSchedulerFileUpload/getpresignedurl?filename=${e}&apikey=${o}`,{}).then(e=>e.data.presignedURL).catch(e=>Promise.reject(e))}(r).then(e=>{if(null!=e)return t=e,o=s,new Promise(function(e,n){let i=new XMLHttpRequest;i.onload=function(){if(this.status>=200&&this.status<300)e(i);else{const e=new Error(`S3 upload failed: ${i.statusText||"Unknown error"}`);e.status=this.status,e.statusText=i.statusText,n(e)}};let s=new FileReader;i.open("PUT",t),s.onload=function(e){i.send(e.target.result)},s.readAsArrayBuffer(o)});var t,o}).catch(e=>{});i.push(l),Promise.all(i).then(e=>{t(r)}).catch(()=>{})}}}},"./src/js/opus2/util/findusmodal-verbiage.ts"(e,t,o){"use strict";o.d(t,{updateServiceHeadingUtil:()=>s});var n=o(/*! ./domainService */"./src/js/opus2/util/domainService.ts");function i(e,t,o){const n=null==e?void 0:e.querySelector(o),i=null==t?void 0:t.querySelector("#dynamic-local-search-modal");n&&i&&(n.textContent=i.value.trim())}function s({modal:e,happyText:t,notFoundText:o}){var s,r,l,a,d;const c=null!==(s=e.getAttribute("data-service-heading"))&&void 0!==s?s:"Electrical Services",u=(0,n.DomainIdentifier)();if(t&&!(null===(r=t.dataset)||void 0===r?void 0:r.template)&&(t.dataset.template=t.innerHTML),o&&!(null===(l=o.dataset)||void 0===l?void 0:l.template)&&(o.dataset.template=o.innerHTML),null===(a=null==t?void 0:t.dataset)||void 0===a?void 0:a.template){let o=t.dataset.template.replace(/We found (.*?) Services/i,`We found ${c}`);
3"ca"===u&&(o=o.replace(/ZIP code/gi,"Postal code")),t.innerHTML=o,i(t,e,"span.text-primary-500")}if(null===(d=null==o?void 0:o.dataset)||void 0===d?void 0:d.template){let t=o.dataset.template.replace(/We are sorry (.*?) Services is not offered/i,`We are sorry ${c} is not offered`);"ca"===u&&(t=t.replace(/ZIP code/gi,"Postal code")),o.innerHTML=t,i(o,e,"span")}}},"./src/js/opus2/util/generateSvgDataUrl.ts"(e,t,o){"use strict";function n(e){const t=["#16a085","#f1c40f","#f39c12","#27ae60","#d35400","#2980b9","#c0392b","#8e44ad","#2c3e50"],o=new Uint32Array(1);window.crypto.getRandomValues(o);const n=t[o[0]%t.length],i=e.toUpperCase();return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(`\n <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="128" height="128">\n <circle cx="64" cy="64" r="64" fill="${n}" />\n <text x="50%" y="50%" text-anchor="middle" dy=".35em"\n font-family="sans-serif" font-size="64" fill="#ffffff">\n ${i}\n </text>\n </svg>\n `).replace(/'/g,"%27").replace(/"/g,"%22")}`}o.d(t,{generateSvgDataUrl:()=>n})},"./src/js/opus2/util/getDynamicMenu.ts"(e,t,o){"use strict";o.d(t,{getDynamicMenuResponse:()=>a,handleSocialIcon:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts"),s=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),r=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),l=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts");function a(){return(0,n.__awaiter)(this,void 0,void 0,function*(){let e={};if((0,l.conceptIdLookupForNblyOrCorp)())return;const t=(0,i.getWeblocationPathGroupWithDynamicConfig)();try{const o=yield(0,r.getCachedAPIResponse)(t,s.apiCaching.DynamicMenu,!1);if(o)return"object"==typeof o&&(e=o,localStorage.setItem("dynamicMenuURLResponse",JSON.stringify(e)),function(e){var t,o,n,i,s,r;const l=e.serviceMenu;if(l.country){let e=null===(o=null===(t=l.country[0])||void 0===t?void 0:t.brand[0])||void 0===o?void 0:o.option;localStorage.getItem("dbaName")&&(e=null===(r=null===(s=null===(i=null===(n=l.country[0])||void 0===n?void 0:n.brand[0])||void 0===i?void 0:i.webLocation)||void 0===s?void 0:s[0])||void 0===r?void 0:r.option);const a=e;sessionStorage.setItem("filterService",JSON.stringify(a))}}(o)),e}catch(e){throw console.error("Error in fetching state API data:",e),e}})}function d(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;const n=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;if(!n)return;const s=yield(0,i.getBrandDetailsFromBrandJson)(n);if(!s)return;const r=e||document.querySelector(".fb-social-block"),l=document.querySelector(".menu-social"),a=document.querySelector(".hero-social");if(!r)return void(a&&(a.style.display="none"));const d=!!(null===(o=document.getElementById("dbaName"))||void 0===o?void 0:o.value),u=!!document.getElementById("hero-banner-social");((null==s?void 0:s.display_social_icons_humburger_national)||(null==s?void 0:s.display_social_icons_humburger_local)&&d)&&c(r,l);const m=d?null==s?void 0:s.display_social_icons_local_hero_banner:null==s?void 0:s.display_social_icons_national_hero_banner;var h;h=u,m&&h&&c(r,a);const p=a;p&&!p.querySelector(".card-social-link")?p.style.display="none":null==p||p.style.removeProperty("display")})}function c(e,t){if(e&&t){const o=e.cloneNode(!0);!function(e){const t=e.querySelectorAll(".fb-social-li");t&&(t.forEach(e=>{e.classList.replace("fb-social-li","card-social-list");const t=e.querySelector("use");if(t){const e=function(e){if(!e)return"";const t=e.split("#");t[1]="insta"!==t[1]?t[1]:"instagram";let o=t[1].endsWith("-white")?t[1]:t[1].concat("-white");return`${t[0]}#${o}`}(t.getAttribute("xlink:href"));t.setAttribute("xlink:href",e)}const o=e.querySelector(".fb-social-link");o&&(null==o||o.classList.replace("fb-social-link","card-social-link"))}),e.classList.replace("fb-social-block","card-social"))}(o),t.innerHTML="",t.appendChild(o);const n=sessionStorage.getItem("socialIconsFooter"),i=document.querySelector(".fb-social-block");n&&i&&(i.innerHTML=n)}}},"./src/js/opus2/util/getSessionCorrelationId.ts"(e,t,o){"use strict";function n(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o="";const n=new Uint32Array(e);window.crypto.getRandomValues(n);for(const e of n)o+=t.charAt(e%62);return o}function i(){let e={correlationID:"",sessionID:""};const t=localStorage.getItem("sessionIDFr");t?e.sessionID=t:(e.sessionID=n(5),localStorage.setItem("sessionIDFr",e.sessionID));const o=sessionStorage.getItem("correlationIDFr");return o?e.correlationID=o:(e.correlationID=`${n(5)}-${Date.now()}`,sessionStorage.setItem("correlationIDFr",e.correlationID)),e}o.d(t,{getSessionAndCorrelationID:()=>i})},"./src/js/opus2/util/getStateFun.ts"(e,t,o){"use strict";o.d(t,{StateHandler:()=>s});var n=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts");class s{static getInstance(){var e;return null!==(e=s.instance)&&void 0!==e||(s.instance=new s),s.instance}getStateFun(){this.initStateCall()}initStateCall(){var e,t,o;const n=i.apiConfig.stateApi,s=(null===(e=document.querySelector("#conceptCode"))||void 0===e?void 0:e.value)||"MRE",r=(null===(t=document.querySelector("#countryCode"))||void 0===t?void 0:t.value)||"us",l=null==r?void 0:r.toUpperCase(),a=null!==(o=sessionStorage.getItem("temp_zipcode"))&&void 0!==o?o:"",d=/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/.test(a);"FSP"===s?this.profileStateApi(n,l):"ca"===r&&d?this.profileStateApi(n,"CA"):this.profileStateApi(n,"US")}profileStateApi(e,t){(0,n.cachedAPIWrapper)(e+t).then(e=>{const t=e,o=[];
3null==t||t.forEach(e=>{o.push(`<option id="${e.stateCode}" value="${e.stateCode}">${e.stateName}</option>`)});const n=document.querySelector("#modal-states.select-basic"),i=document.querySelector("#dynamic-modal-state.select-basic"),s=document.querySelector("#conceptCode")||"MRE",r=e=>{e&&(e.innerHTML="",e.innerHTML+=`<option value="">${"PLG"===(null==s?void 0:s.value)?"Select State":"Select State/Province"}</option>`,e.innerHTML+=o.join(""))};r(n),r(i)}).catch(e=>{})}}},"./src/js/opus2/util/gtm-custom-event-lead-flow.ts"(e,t,o){"use strict";function n(e){let t=window.dataLayer;null==t||t.push(e)}o.d(t,{gtmCustomEventLeadFlow:()=>n})},"./src/js/opus2/util/gtmEventHandlers.ts"(e,t,o){"use strict";o.d(t,{fireGTMEvent:()=>s});function n(e,t,o,n){const i=localStorage.getItem("doingBusinessAs")?localStorage.getItem("doingBusinessAs"):"";let s={event:"request_estimate",locationID:localStorage.getItem("weblocationId")?localStorage.getItem("weblocationId"):"",locationDBA:i,submitType:e,formType:t,formDescription:n,formStatus:o};!function(e){try{(null===window||void 0===window?void 0:window.dataLayer)||console.warn("GTM event push failed:"),window.dataLayer.push(e)}catch(e){console.warn("GTM event push failed:",e)}}(s),sessionStorage.setItem("request_estimate",JSON.stringify(s))}const i=()=>{setTimeout(()=>{((e="")=>{var t;let o=window.dataLayer;if(o)for(let n=o.length-1;n>=0;n--)(null===(t=o[n])||void 0===t?void 0:t.event)===e&&o.splice(n,1);else console.warn("GTM dataLayer not found. Event(s) not cleared:",e)})("request_estimate")},Number("300")||300)};function s(e,t,o){var s,r;if(o)n("request-call-back","short-form",e,null!==(s=null==t?void 0:t.customerType)&&void 0!==s?s:"");else{let o=(()=>{var e,t,o,n,i,s,r;const l=[],a=null!==(t=JSON.parse(null!==(e=sessionStorage.getItem("formValues"))&&void 0!==e?e:"{}"))&&void 0!==t?t:{};return(null==a?void 0:a.servicetype)&&l.push(a.servicetype),(null==a?void 0:a.serviceRequestImage)&&l.push(null!==(s=null===(i=null===(n=null===(o=a.serviceRequestImage)||void 0===o?void 0:o[0])||void 0===n?void 0:n.label)||void 0===i?void 0:i.replace(/ /g,"_"))&&void 0!==s?s:""),(null===(r=null==a?void 0:a.applianceBrand)||void 0===r?void 0:r.makeName)&&l.push(a.applianceBrand.makeName.replace(/ /g,"_")),(null==a?void 0:a.customerType)&&l.push(a.customerType),(null==a?void 0:a.jobFrequency)&&l.push(a.jobFrequency),(null==a?void 0:a.leadSourceName)&&l.push(a.leadSourceName.replace(/ /g,"_")),(null==l?void 0:l.length)>0?l.join("_"):""})();const i=null!==(r=JSON.parse(sessionStorage.getItem("isRequestCallBackChecked")))&&void 0!==r&&r?"request_call_back":"submit_and_continue";n((null==t?void 0:t.isLeadOnly)?i:"full_form_submit","long-form",e,o)}i()}},"./src/js/opus2/util/headerSwitch.ts"(e,t,o){"use strict";o.d(t,{HeaderSwitch:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../header */"./src/js/opus2/header/index.ts"),s=o(/*! ./pageSettings */"./src/js/opus2/util/pageSettings.ts"),r=o(/*! ./share */"./src/js/opus2/util/share.ts");class l{static getInstance(){return l.instance||(l.instance=new l),l.instance}constructor(){this.init()}init(){const e=null!==localStorage.getItem("dbaName");if(!e)return;const t=(0,s.getPageSettings)("pagescope");e&&"national"===t&&this.initalizeVDOM()}initalizeVDOM(){const e=document.querySelector(".header-wrapper"),t=document.querySelector(".brand-header"),o=document.querySelector(".brand-header-local");t&&o&&e&&this.handleDOMLoaded()}handleDOMLoaded(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=document.querySelector(".brand-header"),o=document.querySelector(".brand-header-local");if(t&&o){const n=o.cloneNode(!0),s=document.querySelector(".main-header");(null===(e=null==s?void 0:s.classList)||void 0===e?void 0:e.contains("compressed-header"))?n.style.display="":n.style.display="flex",t.replaceWith(n),(0,r.modifyAllApplyLocalHref)(),o.remove();const l=new i.SetLocalHeader;yield l.initAsync()}})}}},"./src/js/opus2/util/headerUpdate.ts"(e,t,o){"use strict";o.d(t,{changeWhiteBackgroundLogoPath:()=>l,updateHeaderLogo:()=>i});var n=o(/*! ./logger */"./src/js/opus2/util/logger.ts");function i(e,t,o){if(!e)return void console.log("Header URL not found");if(!r(e))return;const i=document.querySelectorAll("header .brand-logo"),a=document.querySelectorAll(".brand-logo-mobile img"),d=document.querySelectorAll("#footer .fb-des-col a picture img");
3if(0!==i.length&&0!==a.length){try{s(i,e,t),s(a,e,t);const n=document.querySelectorAll("#footer .fb-des-col a picture");if(d.length>0){const i=o||e;s(d,i,t),n.forEach(e=>{e.querySelectorAll("source").forEach(e=>{e.srcset=`${i}`})})}else console.log("No footer logo elements found");localStorage.setItem("localHeaderUrl",e),t&&localStorage.setItem("localHeaderAlt",t)}catch(e){console.error("Error while updating header logo or saving to localStorage",e)}try{l((null==o?void 0:o.trim())?null==o?void 0:o.trim():e,t)}catch(e){(0,n.logInTestEnv)("Error while updating the ",e)}}else console.log("No brand logo elements found")}function s(e,t,o){e.forEach(e=>{try{e.src=t,o&&(e.alt=o)}catch(e){console.error("Error while updating logo src",e)}})}function r(e){var t;if(!e||""===(null==e?void 0:e.trim()))return console.error("Image URL is null, undefined, or empty"),!1;const o=new Set(["png","jpg","jpeg","gif","svg","webp"]),n=null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase();return n?!!o.has(n)||(console.error(`Invalid file extension for image URL: ${e}`),!1):(console.error(`No file extension found in URL: ${e}`),!1)}function l(e,t){try{if(e){if(!r(e))return;const o=document.querySelectorAll(".modal-loc-inner .brand-logo");(null==o?void 0:o.length)>0&&s(o,e,t);const n=document.querySelectorAll(".neighborly-footer .ftr-nbly-logo picture img");(null==n?void 0:n.length)>0&&function(e,t,o){null==e||e.forEach(e=>{try{if(t){e.src=t,o&&(e.alt=o);const n=e.closest("picture");if(n){const e=n.querySelectorAll("source");null==e||e.forEach(e=>{null==e||e.setAttribute("srcset",t)})}}}catch(e){console.error("Error while updating logo paths",e)}})}(n,e,t);const i=document.querySelector(".main-nav-warpper .sidenav-brand-logo img");i&&function(e,t,o="Hamburger Menu Logo"){try{if(e){if(!r(e))return;t&&(t.setAttribute("src",e),t.setAttribute("alt",o),console.log("Hamburger logo updated successfully"))}}catch(e){console.error("An unexpected error occurred while updating the hamburger logo:",e)}}(e,i,t)}}catch(e){(0,n.logInTestEnv)("Error while updating logo src",e)}}},"./src/js/opus2/util/hideTermsPolicy.ts"(e,t,o){"use strict";o.d(t,{hideTermsPolicy:()=>l,toggleTermsPolicyBasedOnCountry:()=>a});var n=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),i=o(/*! ../location-search-map/getCountryCode */"./src/js/opus2/location-search-map/getCountryCode.ts"),s=o(/*! ./domainService */"./src/js/opus2/util/domainService.ts");function r(e,t="terms-policy-text"){if(!e)return null;const o=document.querySelector(e);if(!o)return null;return Array.from(o.children).find(e=>{var o;return null===(o=e.classList)||void 0===o?void 0:o.contains(t)})||null}function l(e,t="terms-policy-text"){const o=r(e,t);o&&(o.style.display="none")}function a(e,t){const o=r(e,"terms-policy-text");if(o){const e=n.REGEX.sendCaPostalCode.test(t||"")?"ca":"us",r=(0,s.DomainIdentifier)(),l=(0,i.getCountryCode)(),a=sessionStorage.getItem("countryCode");o.style.display="ca"===e&&("ca"===r||"ca"===l||"ca"===a)||"ca"===e||""===t&&("ca"==r||"ca"===l||"ca"===a)?"none":"block"}}},"./src/js/opus2/util/hours_operation.ts"(e,t,o){"use strict";o.d(t,{toggleHoursOfOperation:()=>a});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ./share */"./src/js/opus2/util/share.ts"),l=o(/*! ./virtualDom */"./src/js/opus2/util/virtualDom.ts");function a(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=localStorage.getItem("brandDetails");if(n){if(JSON.parse(n).disableHoursOfOperation)return void d(e);u(t,o)}else{const n=document.getElementById("conceptCode");if(n){const i=n.value;try{const n=yield(0,r.getBrandDetailsFromBrandJson)(i);if(n.code===i){const i=n;if(localStorage.setItem("brandDetails",JSON.stringify(i)),i.disableHoursOfOperation)return void d(e);u(t,o)}}catch(e){return console.error("Error in fetching getBrandDetailsFromBrandJson API data:",e),[]}}}if(!localStorage.getItem("fullAttrOnLoad"))try{const e=localStorage.getItem("franchiseWebLocationId"),o=document.getElementById("weblocationId");let n=(null==o?void 0:o.value)?null==o?void 0:o.value:e;if(n){const e=`${s.apiConfig.GET_ATTRIBUTE_DATA}/${n}`,o=yield(0,i.cachedAPIWrapper)(e);localStorage.setItem("fullAttrOnLoad",JSON.stringify(o)),m(t)}}catch(e){console.error("Error fetching full attribute data:",e)}})}function d(e){const t=document.querySelector(e);t&&(t.style.display="none")}
3function c(){document.querySelectorAll(".card-text").forEach(e=>{e.style.color="var(--primary-500)"})}function u(e,t){try{const o=document.querySelector(e),n=document.querySelectorAll(t);if(o&&o.children.length<7)o.innerHTML="",m(e);else if(o&&7===o.children.length&&n){let e=[];n.forEach(t=>e.push(t.textContent));const t=(new Date).getDay()-1;e.splice(0,0,...e.slice(t)),e.splice(7,7-t);const i={type:"ul",props:{class:"get_in_touch_hrs_operation"},children:e.map((e,t)=>({type:"li",props:{class:0===t?"card-text":"card-listtext"},children:[e]}))};(0,l.updateVDomElement)(o,i),c()}}catch(e){console.log(e)}}function m(e){var t;const o=document.querySelector(e),n=localStorage.getItem("fullAttrOnLoad");if(n&&(null===(t=JSON.parse(n))||void 0===t?void 0:t.hoursofOperation)){const e=JSON.parse(n),t={0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"},i=(new Date).getDay(),s=e.hoursofOperation.sort((e,t)=>e.dayOfWeek>t.dayOfWeek?1:-1);s.splice(0,0,...s.slice(i)),s.splice(7,7-i);const r=s.map((e,o)=>{let n="";if(e.isOpenForNormalHours){let t=Math.floor(Number.parseInt(e.startMinutes)/60),o=Math.floor(Number.parseInt(e.startMinutes)%60).toString(),i=Math.floor(Number.parseInt(e.endMinutes)/60),s=Math.floor(Number.parseInt(e.endMinutes)%60).toString();const r=t>=12?" PM":" AM",l=i>=12?" PM":" AM";o=1==o.length?"0"+o:o,s=1==s.length?"0"+s:s,t=(t+11)%12+1+":"+o+r,i=(i+11)%12+1+":"+s+l,n=t+" - "+i}else n="Closed";return{type:"li",props:{class:0===o?"card-text":"card-listtext"},children:[`${t[e.dayOfWeek]} ${n}`]}});o&&((0,l.updateVDomElement)(o,{type:"ul",props:{},children:r}),c())}}},"./src/js/opus2/util/hoverintent.ts"(e,t,o){"use strict";function n(e,t,o){let n=0,i=0,s=0,r=0,l=0,a=null,d=!1,c=!1,u={sensitivity:7,interval:100,timeout:0,handleFocus:!1};function m(e){n=e.clientX,i=e.clientY}function h(o){var d,m;a&&clearTimeout(a),Math.abs(s-n)+Math.abs(r-i)<(null!==(d=u.sensitivity)&&void 0!==d?d:7)?(l=1,c||t.call(e,o)):(s=n,r=i,a=setTimeout(()=>h(o),null!==(m=u.interval)&&void 0!==m?m:100))}function p(t){var o;d=!0,a&&clearTimeout(a),1!==l&&(s=t.clientX,r=t.clientY,e.addEventListener("mousemove",m,!1),a=setTimeout(()=>h(t),null!==(o=u.interval)&&void 0!==o?o:100))}function v(t){var n;d=!1,a&&clearTimeout(a),e.removeEventListener("mousemove",m,!1),1===l&&(a=setTimeout(()=>{l=0,o.call(e,t)},null!==(n=u.timeout)&&void 0!==n?n:0))}function g(o){d||(c=!0,t.call(e,o))}function f(t){c&&(c=!1,o.call(e,t))}function y(){e.removeEventListener("focus",g,!1),e.removeEventListener("blur",f,!1)}const b={options(t){const o=void 0!==t.handleFocus&&t.handleFocus!==u.handleFocus;return u=Object.assign(Object.assign({},u),t),o&&(u.handleFocus?(e.addEventListener("focus",g,!1),e.addEventListener("blur",f,!1)):y()),b},remove(){e.removeEventListener("mouseover",p,!1),e.removeEventListener("mouseout",v,!1),y()}};return e.addEventListener("mouseover",p,!1),e.addEventListener("mouseout",v,!1),b}o.d(t,{hoverintent:()=>n})},"./src/js/opus2/util/idleLoader.ts"(e,t,o){"use strict";o.d(t,{PreFetchUrls:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../testimonial/helperIdb */"./src/js/opus2/testimonial/helperIdb.ts");class l{static getInstance(){return l.instance||(l.instance=new l),l.instance}constructor(){var e,t,o;this.urlMappings=new Map([["{conceptid}",()=>this.conceptId],["{weblocationid}",()=>this.weblocationId||"0"],["{franchiseweblocationid}",()=>this.weblocationId||"0"],["{countryid}",()=>this.countryId],["{origin}",()=>this.origin],["{dbaname}",()=>this.dbaName],["{apiconfig.locatelocationapiwithroundrobinfalse}",()=>s.apiConfig.LocateLocationApiWithRoundRobinFalse],["{apiconfig.locatelocationapiwithroundrobintrue}",()=>s.apiConfig.LocateLocationApiWithRoundRobinTrue],["{apiconfig.locatelocationapiwithroundrobin}",()=>s.apiConfig.LocateLocationApiWithRoundRobin],["{apiconfig.app_link_send}",()=>s.apiConfig.APP_LINK_SEND],["{apiconfig.footer_brand_link}",()=>s.apiConfig.FOOTER_BRAND_LINK],["{apiconfig.stateapi}",()=>s.apiConfig.stateApi],["{apiconfig.contact_us_send}",()=>s.apiConfig.CONTACT_US_SEND],["{apiconfig.booking_api_url}",()=>s.apiConfig.BOOKING_API_URL],["{apiconfig.testimonial_reviews}",()=>s.apiConfig.TESTIMONIAL_REVIEWS],["{apiconfig.ourteam}",()=>s.apiConfig.ourTeam],["{apiconfig.getheadermenu}",()=>s.apiConfig.GETHeaderMenu],["{apiconfig.fullattribute}",()=>s.apiConfig.fullAttribute],["{apiconfig.howtoknow}",()=>s.apiConfig.howToKnow],["{apiconfig.franchiseweblocationpostalcodefees}",()=>s.apiConfig.franchiseWebLocationPostalCodeFees],["{apiconfig.appointmentapi}",()=>s.apiConfig.AppointMentAPi],["{apiconfig.get_attribute_data}",()=>s.apiConfig.GET_ATTRIBUTE_DATA],["{apiconfig.get_service_bundle}",()=>s.apiConfig.GET_SERVICE_BUNDLE],["{apiconfig.hms_booking}",()=>s.apiConfig.HMS_BOOKING],["{apiconfig.blog_url}",()=>s.apiConfig.BLOG_URL],["{apiconfig.franchiselookupbyserviceaddress}",()=>s.apiConfig.FranchiseLookUpByServiceAddress],["{apiconfig.paymentposturl}",()=>s.apiConfig.paymentPostUrl],["{apiconfig.poslookup}",()=>s.apiConfig.POSLookup],["{apiconfig.synccleoLeadsources}",()=>s.apiConfig.syncCleoLeadSources],["{apiconfig.discover_api}",()=>s.apiConfig.DISCOVER_API],["{apiconfig.calculateestimate}",()=>s.apiConfig.calculateEstimate],["{apiconfig.franchiseposlookup}",()=>s.apiConfig.FranchisePOSLookup],["{apiconfig.weblocationsapi}",()=>s.apiConfig.WebLocationsAPI],["{apiconfig.weblocationsfranchisegroupapi}",()=>s.apiConfig.WebLocationsFranchiseGroupAPI],["{apiconfig.geocodesearchapiurl}",()=>s.apiConfig.geoCodeSearchApiUrl],["{apiconfig.genericleadsourceendpoint}",()=>s.apiConfig.GenericLeadSourceEndpoint],["{apiconfig.mollyleadsourceendpoint}",()=>s.apiConfig.MollyLeadSourceEndpoint],["{apiconfig.apilogerrorendpoint}",()=>s.apiConfig.ApiLogerrorEndpoint],["{apiconfig.apilogperformanceendpoint}",()=>s.apiConfig.ApiLogperformanceEndpoint],["{apiconfig.franchiseterritoriesapi}",()=>s.apiConfig.FranchiseTerritoriesAPI],["{apiconfig.photosapi}",()=>s.apiConfig.PhotosAPI],["{apiconfig.photocategoriesapi}",()=>s.apiConfig.PhotoCategoriesAPI],["{apiconfig.crownpeak_weblocation_url}",()=>s.apiConfig.CROWNPEAK_WEBLOCATION_URL],["{apiconfig.crownpeak_caching_settings}",()=>s.apiConfig.CROWNPEAK_CACHING_SETTINGS],["{apiconfig.vin_api_url}",()=>s.apiConfig.VIN_API_URL],["{apiconfig.attom_api_url}",()=>s.apiConfig.ATTOM_API_URL],["{apiconfig.quote_api_url}",()=>s.apiConfig.QUOTE_API_URL],["{apiconfig.client_transform_carousel_v2}",()=>s.apiConfig.CLIENT_TRANSFORM_CAROUSEL_V2]]),this.conceptId=null!==(t=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value)&&void 0!==t?t:"",this.countryId=this.determineCountryId(),this.origin=this.insertOrigin(),this.weblocationId=null!==(o=this.getWebLocationId())&&void 0!==o?o:"0",this.dbaName=this.getDBAName()}loadApisOnIdle(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Invalid URL provided to loadApisOnIdle:",e);yield(0,i.cachedAPIWrapper)(e.replace(/\/+$/,""),120,!1)}catch(t){console.error(`Failed to load ${e}:`,t)}})}getPreFetchUrls(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{if(!e||0===e.length||!Array.isArray(e))return;const t=e.map(e=>{if("string"!=typeof e||0===e.trim().length)return null;let t=this.constructUrls(e);if(!t)return null;try{return new URL(t),t}catch(e){return null}}).filter(e=>null!==e);
3if(0===t.length)return void console.log("No valid URLs found in preFetchList");const o=yield Promise.allSettled(t.map(e=>this.loadApisOnIdle(e))),n=o.filter(e=>"fulfilled"===e.status).length,i=o.filter(e=>"rejected"===e.status).length;console.log(`Prefetch completed: ${n} successful, ${i} failed out of ${t.length} URLs`),o.forEach((e,o)=>{"rejected"===e.status&&console.error(`Failed to prefetch ${t[o]}:`,e.reason)})}catch(e){console.error("Error in getPreFetchUrls:",e)}})}getWebLocationId(){var e;return localStorage.getItem("franchiseWebLocationId")||(null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)||"0"}insertOrigin(){return window.location.origin}getDBAName(){var e,t,o;return null!==(o=null!==(t=null===(e=document.getElementById("dbaName"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("dbaName"))&&void 0!==o?o:""}determineCountryId(){var e;return"us"===(sessionStorage.getItem("countryCode")||(null===(e=document.getElementById("countryCode"))||void 0===e?void 0:e.value)||"").toLowerCase()?"1":"2"}constructUrls(e){var t;const o=e.toLowerCase();if(!o.includes("[js]"))return e;const n=null===(t=o.split("[js]")[1])||void 0===t?void 0:t.split("/");if(!(null==n?void 0:n.length))return null;if(n.some(e=>e.includes("{apiconfig.testimonial_reviews}"))){sessionStorage.setItem("rocketEnabled","true"),sessionStorage.removeItem("rocketDisabled");const e=r.TestimonialHelperIdb.getInstance();e.domLookup(),e.getData()}else sessionStorage.setItem("rocketDisabled","true"),sessionStorage.removeItem("rocketEnabled");const i=[];for(const e of n)if(e.includes("{")){const t=e.trim(),o=this.urlMappings.get(t);if(!o)return console.warn(`Unsupported segment: ${e}`),null;{const t=o();if(!t)return console.warn(`Empty value for segment: ${e}`),null;i.push(t)}}else i.push(e);return i.join("/")+"/"}}},"./src/js/opus2/util/imageQuality.ts"(e,t,o){"use strict";function n(e){return e.naturalHeight>e.naturalWidth?"portrait":e.naturalHeight===e.naturalWidth?"square":"landscape"}o.d(t,{restructureImages:()=>s,restructureImagesV2:()=>r});function i(e,t,o){const{width:n,height:i}=e.getBoundingClientRect();t.style.objectFit="contain",t.style.maxWidth="100%",t.style.maxHeight="100%";const s=window.innerWidth<768;s&&(e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center");const r=function(e,t,o,n){const i=n.naturalWidth||n.width||0,s=n.naturalHeight||n.height||0;if(0===i||0===s)return"portrait"===o||"square"===o;const r=e/t;return r>i/s}(n,i,o,t);r?s&&"portrait"===o?function(e,t,o){const n=e.naturalWidth||e.width||400,i=e.naturalHeight||e.height||600,s=o/i,r=n*s/t*100;e.style.width=`${Math.min(r,100)}%`,e.style.height="100%"}(t,n,i):(t.style.height="100%",t.style.width="auto"):(t.style.width="100%",t.style.height="auto")}function s(e){var t;if(!(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length))return;Array.from(e.children).forEach((e,t)=>{const o=e.querySelector(".gallery-card img"),s=e.querySelector(".card-img"),r=e.querySelector(".card-body");if(s&&(s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center"),r&&(r.style.textAlign="center"),o)try{if(o.complete&&0!==o.naturalHeight){const t=n(o);i(e,o,t)}else(l=o.src,new Promise((e,t)=>{if(!/\.(jpeg|jpg|gif|png|webp|svg|bmp|ico)(\?.*)?$/i.test(l))return void t(new Error("URL does not appear to be an image based on its extension."));const o=new Image;o.onload=()=>{let t;t=o.naturalHeight>o.naturalWidth?"portrait":o.naturalHeight===o.naturalWidth?"square":"landscape",e(t)},o.onerror=()=>{t(new Error("Could not load image from URL to determine orientation."))},o.src=l})).then(t=>{i(e,o,t)}).catch(e=>{console.warn(`Photo gallery image resizer issue. Error determining orientation for image at index ${t}:`,e)})}catch(e){console.warn(`Error processing image at index ${t}:`,e)}var l})}function r(e){var t;if(!(null===(t=null==e?void 0:e.children)||void 0===t?void 0:t.length))return;Array.from(e.children).forEach((e,t)=>{const o=e.querySelector(".carousel-wrap-img");if(!o)return;o.style.alignItems="center";const i=o.querySelector("img-comparison-slider");if(!i)return;[i.querySelector("figure.before-img img"),i.querySelector("figure.after-img img")].forEac
3h((e,o)=>{if(!e)return;!function(e,t,o){e.onerror=()=>{e.style.display="none",console.warn(`[Carousel] Failed to load ${t} image at index ${o}: ${e.src}`)}}(e,0===o?"before":"after",t);const i=()=>{try{const t=n(e);!function(e,t){e.style.objectFit="contain",e.style.display="block","portrait"===t?(e.style.width="auto",e.style.height="100%"):"landscape"===t&&(e.style.width="100%",e.style.height="auto")}(e,t)}catch(e){console.warn(`[Carousel] Exception on styling image at index ${t}:`,e)}};(null==e?void 0:e.complete)&&e.naturalHeight>0?i():e.onload=i})})}},"./src/js/opus2/util/infinty-scroll.ts"(e,t,o){"use strict";o.d(t,{Carousel:()=>n});class n{constructor(e){var t,o,n,i,s,r,l;const a=document.querySelector(e.selector);if(!(a instanceof HTMLElement))throw new Error("Container not found or invalid");const d=a.querySelector(e.trackSelector);if(!(d instanceof HTMLElement))throw new Error("Track not found or invalid");if(this.container=a,this.track=d,this.originalCards=Array.from(this.track.children),0===this.originalCards.length)throw new Error("No cards found in track");this.autoStart=null===(t=e.autoStart)||void 0===t||t,this.speed=null!==(o=e.speed)&&void 0!==o?o:1,this.infinite=null===(n=e.infinite)||void 0===n||n,this.pauseDelay=null!==(i=e.pauseDelay)&&void 0!==i?i:1e3,this.direction=null!==(s=e.direction)&&void 0!==s?s:"right2left",this.gap=null!==(r=e.gap)&&void 0!==r?r:10,this.cardWidth=this.originalCards[0].offsetWidth+this.gap,this.isPaused=!this.autoStart,this.scrollOffset=0,this.scrollInterval=null,this.controls=null!==(l=e.constrols)&&void 0!==l?l:{nextBtn:"",prevBtn:""},this.dragStartX=0,this.dragging=!1,this.init()}init(){this.infinite&&this.cloneForInfiniteScroll(),this.addEventListeners(),this.enableDragging(),this.autoStart&&this.play()}cloneForInfiniteScroll(){for(let e=0;e<3;e++){for(const e of this.originalCards)this.track.appendChild(e.cloneNode(!0));for(let e=this.originalCards.length-1;e>=0;e--)this.track.insertBefore(this.originalCards[e].cloneNode(!0),this.track.firstChild)}this.scrollOffset=this.cardWidth*this.originalCards.length*3,this.track.style.transform=`translateX(${-this.scrollOffset}px)`}play(){this.isPaused=!1,null!==this.scrollInterval&&clearInterval(this.scrollInterval),this.scrollInterval=globalThis.setInterval(()=>{if(!this.isPaused){const e="left2right"===this.direction?-1:1;this.scrollOffset+=e*this.speed,this.track.style.transform=`translateX(${-this.scrollOffset}px)`,this.recenterIfNeeded()}},16)}pause(){this.isPaused=!0,null!==this.scrollInterval&&clearInterval(this.scrollInterval)}pauseWithDelay(){this.pause(),setTimeout(()=>this.play(),this.pauseDelay)}next(){this.scrollOffset+=this.cardWidth,this.track.style.transform=`translateX(${-this.scrollOffset}px)`,this.recenterIfNeeded()}prev(){this.scrollOffset-=this.cardWidth,this.track.style.transform=`translateX(${-this.scrollOffset}px)`,this.recenterIfNeeded()}addEventListeners(){if(this.container.addEventListener("click",()=>this.pauseWithDelay()),this.controls.nextBtn&&this.controls.prevBtn){const e=document.querySelector(this.controls.nextBtn),t=document.querySelector(this.controls.prevBtn);null==e||e.addEventListener("click",()=>this.next()),null==t||t.addEventListener("click",()=>this.prev())}}enableDragging(){this.track.addEventListener("mousedown",e=>{this.dragging=!0,this.dragStartX=e.pageX,this.pause(),this.track.style.cursor="grabbing"}),globalThis.addEventListener("mouseup",()=>{this.dragging&&(this.dragging=!1,this.track.style.cursor="grab",setTimeout(()=>this.play(),this.pauseDelay))}),this.track.addEventListener("mousemove",e=>{if(!this.dragging)return;const t=e.pageX-this.dragStartX;this.dragStartX=e.pageX,this.scrollOffset-=t,this.track.style.transform=`translateX(${-this.scrollOffset}px)`,this.recenterIfNeeded()}),this.track.addEventListener("touchstart",e=>{this.dragStartX=e.touches[0].pageX,this.pause()}),this.track.addEventListener("touchmove",e=>{const t=e.touches[0].pageX-this.dragStartX;this.dragStartX=e.touches[0].pageX,this.scrollOffset-=t,this.track.style.transform=`translateX(${-this.scrollOffset}px)`,this.recenterIfNeeded()}),this.track.addEventListener("touchend",()=>{setTimeout(()=>this.play(),this.pauseDelay)})}recenterIfNeeded(){const e=this.track.scrollWidth,t=e/2-this.container.offsetWidth/2,o=this.cardWidth*this.originalCards.length;(this.scrollOffset<=o||this.scrollOffset>
3=e-o)&&(this.scrollOffset=t,this.track.style.transform=`translateX(${-this.scrollOffset}px)`)}destroy(){if(this.pause(),this.container.replaceWith(this.container.cloneNode(!0)),this.infinite){for(;this.track.firstChild;)this.track.removeChild(this.track.firstChild);this.originalCards.forEach(e=>{this.track.appendChild(e)}),this.track.style.transform=""}this.track.style.cursor=""}}},"./src/js/opus2/util/keyGeneration.ts"(e,t,o){"use strict";o.d(t,{createVDOMHash:()=>s,keyGenerator:()=>i});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");function i(e,t){return`${e} || ${t}`}function s(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=JSON.stringify(e),o=(new TextEncoder).encode(t),n=new Uint8Array([...o]),i=yield crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")})}},"./src/js/opus2/util/loader.ts"(e,t,o){"use strict";function n(){if(!document.querySelector(".loading-div .loader")){let e=document.createElement("div"),t=document.createElement("div");e.className="loading-div active",t.className="loader",t.style.backgroundImage="url(/brand/_assets/images/global-img/loader.gif)",e.appendChild(t),document.body.appendChild(e)}}function i(){var e;const t=document.querySelector(".loading-div");t&&(null===(e=document.body)||void 0===e||e.removeChild(t))}o.d(t,{startLoader:()=>n,stopLoader:()=>i})},"./src/js/opus2/util/localizationService.ts"(e,t,o){"use strict";o.d(t,{LocalizationIdentifier:()=>a,getDisplayPhoneNumber:()=>d,isLocalized:()=>c,replaceLegalFooter:()=>u,replaceNeighborlyFooter:()=>m});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ./share */"./src/js/opus2/util/share.ts"),l=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts");function a(){const e=localStorage.getItem("dbaName"),t=sessionStorage.getItem("countryCode");return e&&t?t:null}function d(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=document.getElementById("weblocationId")||document.getElementById("local_weblocationId");let o=!1;t&&Number(t.value)>0&&(o=!0);let l=yield function(e){if(!e)return Promise.resolve(null);const t=`${s.apiConfig.FOOTER_BRAND_LINK}${e}`;return(0,i.cachedAPIWrapper)(t).then(e=>(0,n.__awaiter)(this,void 0,void 0,function*(){let t;return null==e||e.callTrackings.forEach(e=>{"WebsiteTracking"===e.callTrackingTypeDescription&&(t=e.callTrackingNumber)}),t||(t=null==e?void 0:e.mainPhoneNumber),localStorage.setItem("localPhoneNumber",t),t})).catch(e=>(console.error("Error fetching FOOTER_BRAND_LINK:",e),null))}((null==t?void 0:t.value)||"");if(!l&&!o){const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;if(t)try{const e=yield(0,r.getBrandDetailsFromBrandJson)(t);return e&&(l=e.phone),l}catch(e){console.error("Error in fetching brand details for getDisplayPhoneNumber:",e)}}return l})}function c(){let e=!1;return localStorage.getItem("dbaName")&&(e=!0),e}function u(e){if(!e)return void((0,l.isTestEnvironment)()&&console.log("No footer HTML provided, keeping national footer"));const t=(new DOMParser).parseFromString(e,"text/html"),o=document.querySelector(".legal-footer"),n=t.querySelector(".legal-footer");n&&o?(o.innerHTML=n.innerHTML,(0,l.isTestEnvironment)()&&console.log("â Legal footer replaced with local version")):(0,l.isTestEnvironment)()&&console.log("Legal footer elements not found, keeping national footer")}function m(e){if(!e)return void((0,l.isTestEnvironment)()&&console.log("No footer HTML provided, keeping national neighborly footer"));const t=(new DOMParser).parseFromString(e,"text/html"),o=document.querySelector(".neighborly-ftr-section"),n=t.querySelector(".neighborly-ftr-section");n&&o?(o.innerHTML=n.innerHTML,(0,l.isTestEnvironment)()&&console.log("â Neighborly footer replaced with local version")):(0,l.isTestEnvironment)()&&console.log("Neighborly footer elements not found, keeping national footer")}},"./src/js/opus2/util/localizationTag.ts"(e,t,o){"use strict";o.d(t,{localizationMobileDBATitle:()=>r,localizationTagLine:()=>s,localizationTagUpadation:()=>l,setDBAandLocationPin:()=>a});var n=o(/*! ./device-detection */"./src/js/opus2/util/device-detection.ts");const i="Locally Owned and Operated";function s(){var e;const t=document.querySelector(".header-wrapper .description"),o=localStorage.getItem("dbaName"),n=null!==(e=localStorage.getItem("localTagLine"))&&void 0!==e?e:i;o&&n&&t&&(t.innerHTML=null!=n?n:i)}function r(){if(!(0,n.isTouchDevice)())return;const e=sessionStorage.getItem("brandDetails"),t=e?JSON.parse(e):{},o=document.querySelector(".local-owned.mobile-only");o&&!(null==t?void 0:t.disable_mobile_dba_os_flow)&&function(e){var t;const o=localStorage.getItem("doingBusinessAs");if(localStorage.getItem("franchiseWebLocationId")&&o){e.classList.remove("hidden");const n=e.querySelector(".local-title"),s=e.querySelector(".local-subtitle");n&&(e.style.backgroundColor="rgb(255 255 255)",n.textContent=o),s&&(s.innerHTML=null!==(t=localStorage.getItem("localTagLine"))&&void 0!==t?t:i)}}(o)}function l(){const e=localStorage.getItem("localTagLine");if(localStorage.getItem("dbaName")){let t=null!=e?e:i;localStorage.setItem("localTagLine",t)}}function a(){const e=localStorage.getItem("doingBusinessAs"),t=localStorage.getItem("localTagLine");let o="";return o=t&&t.includes("<img")?"<img"+t.split("<img")[1].split(">")[0]+">":'<svg aria-hidden="true" class="icon"> <use xlink:href="/brand/_assets/images/icons/hero-icon-sprite.svg#map-pin-primary"></use></svg>',`${o}<div><span class="local-address">${e}</span> Change location</div>`}},"./src/js/opus2/util/locationBasedBrandJson.ts"(e,t,o){"use strict";function n(e){return"CA"===e?"_assets-global/configs/brands-ca.json":"_assets-global/configs/brands.json"}function i(){const e=window.location.origin;if(e.includes("localhost")){const e=document.getElementById("assetPath");if(e){const t=e.value;if(t.includes("/US/"))return n("US");if(t.includes("/CA/"))return n("CA")}return"Error validating Location"}if(e.includes("nblysbx")||e.includes("nblydev")||e.includes("nblytest")||e.includes("nblyprod"))try{return e.includes("-ca-")||e.includes("-ca")&&e.includes("nblyprod")?n("CA"):n("US")}catch(e){return"Error validating Location"}else try{const t=e.lastIndexOf(".");return n("ca"===e.substring(t+1)?"CA":"US")}catch(e){return"Error validating Location"}}o.d(t,{getBrandJSON:()=>i})},"./src/js/opus2/util/logger.ts"(e,t,o){"use strict";o.d(t,{logInTestEnv:()=>i});var n=o(/*! ../apiCaching/POST-Requests/helperModules/helperFunctions */"./src/js/opus2/apiCaching/POST-Requests/helperModules/helperFunctions.ts");function i(...e){(0,n.isTestEnvironment)()&&console.log(e.join(" "))}},"./src/js/opus2/util/memoization.ts"(e,t,o){"use strict";o.d(t,{useMemo:()=>n});o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");function n(e,t=[]){const o=e.name+JSON.stringify(t),n=localStorage.getItem(o);if(n)try{return JSON.parse(n)}catch(e){console.warn("Failed to parse memoized result, recalculating...")}const i=e(...t);return localStorage.setItem(o,JSON.stringify(i)),i}},"./src/js/opus2/util/modalVisibilityCheck.ts"(e,t,o){"use strict";o.d(t,{modalVisibilityCheck:()=>r});var n=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),i=o(/*! ./domainService */"./src/js/opus2/util/domainService.ts"),s=o(/*! ./localizationService */"./src/js/opus2/util/localizationService.ts");function r(e){const t=(0,i.DomainIdentifier)(),o=(0,s.LocalizationIdentifier)(),r=n.REGEX.sendCaPostalCode.test(null==e?void 0:e.trim())?"ca":"us";return"us"===t&&"ca"===o||"us"===t&&"ca"===r}},"./src/js/opus2/util/nearbyLocations.ts"(e,t,o){"use strict";o.d(t,{NearbyLocations:()=>d});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),l=o(/*! ../mly */"./src/js/opus2/mly/index.ts"),a=o(/*! ./share */"./src/js/opus2/util/share.ts");Number.prototype.degreeToRadius=function(){return this*(Math.PI/180)}
3,Number.prototype.radiusToDegree=function(){return 180*this/Math.PI};class d{constructor(e="miles",t=50,o=()=>{},n=()=>{},i=()=>{},s={},r=void 0){var a;this.isLeadContactApi=!1,this.units=e,this.franchiseLimit=t,this.countryCode=null===(a=document.getElementById("countryCode"))||void 0===a?void 0:a.value.toLowerCase(),this.loadHereMapScripts(),this.singleCallBackFcn=o,this.multiCallBackFcn=n,this.errorCallBackFcn=i,this.cleaningType=new l.CleaningType,this.bookingPayload=s,this.zipCode=r}loadHereMapScripts(){if(!document.getElementById("mapsjs-core-js")){const e=(e,t)=>{const o=document.createElement("script");o.async=!1,o.src=e,o.id=t,document.head.appendChild(o)};e("https://js.api.here.com/v3/3.1/mapsjs-core.js","mapsjs-core-js"),e("https://js.api.here.com/v3/3.1/mapsjs-ui.js","mapsjs-ui-js")}}convertToKM(e,t){return t.includes("miles")?Math.round(1.60934*e):e}getAllLocations(){const e=sessionStorage.getItem("serviceIdValue");let t=s.apiConfig.WebLocationsAPI;return e&&(t+=`/${e}`,sessionStorage.removeItem("serviceIdValue")),(0,i.cachedAPIWrapper)(t)}searchNearbyLocations(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){let t="USA,PRI";"ca"===(0,a.determineCountryZip)(e)&&(t="CAN");const o=`${s.apiConfig.geoCodeSearchApiUrl}?apiKey=1nz-GVrXhtXIjYpS4LQ-sMSaPzQeYJvzjPJsK4vzeDk&q=${e.trim()}&in=countryCode:${t}`;return(0,i.getCachedAPIResponse)(o,r.apiCaching.HereMapConfig,!1).then(e=>{if((null==e?void 0:e.items)&&0!==e.items.length){const t=e.items[0].position,o=this.convertToKM(this.franchiseLimit,this.units);sessionStorage.setItem("distanceTo",JSON.stringify(t));const n=this.getBoundingBox(t.lat,t.lng,o),i=new H.geo.Rect(n[0],n[1],n[2],n[3]);return this.getAllLocations().then(e=>{const t=(0,a.filterFranchiseData)(e);return this.filterResults(i,t,-1)}).catch(e=>(console.error("Facing this error when calling Web Locations API",e),null))}return console.log("Error: No items found in data."),null}).catch(e=>(console.error("Facing this error when calling Geo Code API",e),null))})}filterResults(e,t,o){const n=JSON.parse(sessionStorage.getItem("distanceTo"));let i=[];return t.forEach(t=>{(e.containsLatLng(t.latitude,t.longitude)||o===t.franchiseWebLocationId)&&(t.distance=this.getDistanceFromLatLon(n.lat,n.lng,t.latitude,t.longitude),i.push(t))}),1===i.length?(console.log("Only one location found within range"),this.singleCallBackFcn(),i):i.length>1?(console.log("Multiple locations found within range"),this.multiCallBackFcn(),i):(console.error(`Could not find a location within ${this.franchiseLimit} ${this.units} range`),this.errorCallBackFcn(),i)}getDistanceFromLatLon(e,t,o,n){if(e==o&&t==n)return 0;const i=Math.PI*e/180,s=Math.PI*o/180,r=t-n,l=Math.PI*r/180;let a=Math.sin(i)*Math.sin(s)+Math.cos(i)*Math.cos(s)*Math.cos(l);return a>1&&(a=1),a=Math.acos(a),a=180*a/Math.PI*60*1.1515,"km"===this.units&&(a*=1.609344),a}getBoundingBox(e,t,o){let n,i,s,r,l,a,d,c,u,m,h,p,v,g,f;return null!=o&&null!=o&&0!=o||(o=1),n=(-90).degreeToRadius(),i=90..degreeToRadius(),s=(-180).degreeToRadius(),r=180..degreeToRadius(),l=6378.1,a=o/6378.1,d=e,c=t,u=d.degreeToRadius(),m=c.degreeToRadius(),h=u-a,p=u+a,v=void 0,g=void 0,f=Math.asin(Math.sin(a)/Math.cos(u)),h>n&&p<i?(v=m-f,g=m+f,v<s&&(v+=2*Math.PI),g>r&&(g-=2*Math.PI)):(h=Math.max(h,n),p=Math.min(p,i),v=s,g=r),[h.radiusToDegree(),v.radiusToDegree(),p.radiusToDegree(),g.radiusToDegree()]}}},"./src/js/opus2/util/nearbyLocationsMiles.ts"(e,t,o){"use strict";o.d(t,{ComponentType:()=>n,NearbyLocationsMiles:()=>a});var n,i=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),l=o(/*! ./share */"./src/js/opus2/util/share.ts");!function(e){e.SHORT_FORM="shortform",e.OS_FLOW="osflow"}(n||(n={}));class a{constructor(e,t,o=n.SHORT_FORM,i){this.zipcode=e,this.conceptCode=t,this.componentType=o,this.serviceId=i}getBrandFlagConfig(){return a.BRAND_FLAG_MAP[this.componentType]}convertToKilometers(e){return Math.round(1.60934*e)}getUnitType(e){const t=this.getBrandFlagConfig(),o=null==e?void 0:e[t.unitFlag];return(null==o?void 0:o.includes("miles"))?"miles":"km"}getFranchiseLimit(e){const t=this.getBrandFlagConfig();return Number(null==e?void 0:e[t.limitFlag])||50}buildApiUrl(e){let t=`${r.apiConfig.WebLocationsFranchiseGroupAPI}/${this.zipcode.trim()}/miles/${e}?apikey=pneiweb-9pbaOywNKQj853D`;return this.serviceId&&(t+=`&serviceId=${this.serviceId}`,sessionStorage.removeItem("serviceIdValue")),t}searchNearbyLocations(){return(0,i.__awaiter)(this,void 0,void 0,function*(){try{const e=yield(0,l.getBrandDetailsFromBrandJson)(this.conceptCode);let t=this.getFranchiseLimit(e);"km"===this.getUnitType(e)&&(t=this.convertToKilometers(t));const o=this.buildApiUrl(t),n=yield(0,s.cachedAPIWrapper)(o);return(0,l.filterFranchiseData)(n)}catch(e){return console.error("Error searching nearby locations with miles endpoint:",e),null}})}}a.BRAND_FLAG_MAP={[n.SHORT_FORM]:{limitFlag:"nearest_franchiselimit_shortform",unitFlag:"area_measure_values_shortform"},[n.OS_FLOW]:{limitFlag:"nearest_franchiselimit_OSflow",unitFlag:"area_measure_values_OSflow"}}},"./src/js/opus2/util/pageSettings.ts"(e,t,o){"use strict";function n(e){const t=e.toLowerCase(),o=document.getElementById("page-settings");if(!o)return function(e){var t;const o=document.getElementById("page-settings-object");
3if(!o)return;const n=o.textContent;if(!n)return;try{return null!==(t=(i=JSON.parse(n),Object.fromEntries(Object.entries(i).map(([e,t])=>[e.toLowerCase(),"string"==typeof t?t.toLowerCase():t])))[e])&&void 0!==t?t:""}catch(t){return console.warn(`Error parsing field ${e} from page settings, either no settings reccieved from CP or invalid JSON`,t),""}var i}(t);const n=o.outerHTML.split("value=")[1].toLowerCase();if(!n.includes(t))return"";try{const e=n.split(t)[1];return e.split(",")[0].replace(/\"/g,"").replace(/=/g,"").replace(/^:/,"").replace(/\s+/g," ").trim().toLowerCase()||""}catch(e){return console.warn(`Error parsing field ${t} from page settings, either no settings reccieved from CP or invalid JSON`,e),""}}o.d(t,{getPageSettings:()=>n})},"./src/js/opus2/util/payloadManipulator.ts"(e,t,o){"use strict";function n(e,t,o,n,i){let s=Object.assign({},e);const r=i;s.optIn=n,s.emailOptOut=!1;const l=(e,t)=>{s.hasOwnProperty("Note")?""!==s.Note?s.Note+=`, Text OptIn: ${e}, Email OptIn: ${t}`:s.Note=`Text OptIn: ${e}, Email OptIn: ${t}`:s.hasOwnProperty("note")&&(""!==s.note?s.note+=`, Text OptIn: ${e}, Email OptIn: ${t}`:s.note=`Text OptIn: ${e}, Email OptIn: ${t}`),s.hasOwnProperty("Comments")?""!==s.Comments?s.Comments+=`, Text OptIn: ${e}, Email OptIn: ${t}`:s.Comments=`Text OptIn: ${e}, Email OptIn: ${t}`:s.hasOwnProperty("comments")&&(""!==s.comments?s.comments+=`, Text OptIn: ${e}, Email OptIn: ${t}`:s.comments=`Text OptIn: ${e}, Email OptIn: ${t}`)},a=(e,t,o=!1)=>{"us"===e?(s.emailOptOut=!1,s.optIn=t,l(t?"yes":"no",o?"no":"yes")):"ca"===e&&(s.emailOptOut=!t,s.optIn=!1,l("no",t?"yes":"no"))};return"us"===t?(()=>{if(null!==o&&"us"!==o&&"ca"!==o)return s;a(r,n)})():"ca"===t&&(()=>{if(null!==o&&"ca"!==o)return s;a(r,n,!0)})(),s}o.d(t,{payloadManipulator:()=>n})},"./src/js/opus2/util/phoneNumberReplacement.ts"(e,t,o){"use strict";function n(){var e,t,o,n;const i=(null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)||(null===(t=document.getElementById("local_weblocationId"))||void 0===t?void 0:t.value)||null||localStorage.getItem("dbaName"),s=null!==(n=null===(o=document.getElementById("conceptId"))||void 0===o?void 0:o.value)&&void 0!==n?n:null;return!i&&"30"===s}o.d(t,{shouldSkipPhoneNumberProcessing:()=>n})},"./src/js/opus2/util/prints.ts"(e,t,o){"use strict";function n(e,t){var o,n;const s=document.querySelectorAll(".sp-offers-item")[t]||document.querySelectorAll(".offers-block-item")[t],r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const l=null===(o=r.contentWindow)||void 0===o?void 0:o.document;if(l){if(l.open(),function(e){e.write("<html><head>");["/brand/_assets/css/service.css","/brand/_assets/css/main.css","/brand/_assets/css/brand-config.css","/brand/_assets/css/header.css","/brand/_assets/css/footer.css","/brand/_assets/css/glossary.css"].forEach(t=>{e.write(`<link rel="stylesheet" type="text/css" href="${t}" media="all">`)}),e.write("<style>\n @page {\n margin:10mm;\n }\n * {\n -webkit-print-color-adjust: exact !important; /* Chrome, Safari */\n color-adjust: exact !important; /*Firefox*/\n }\n .claim-offer{\n display:none\n }\n @media print {\n @-moz-document url-prefix() {\n .btn-group li {\n display: none !important;\n }\n .btn-group li:first-child {\n display: block !important;\n }\n }\n .sp-offers-main {\n padding: 1rem !important;\n }\n .sp-offers-section .sp-offers-main .sp-offers-details {\n display: flex !important;\n flex-direction: column !important;\n gap: 8px !important;\n align-items: center !important;\n width: 100% !important;\n }\n .block-offer {\n font-size: 24px !important;\n font-weight: 700 !important;\n line-height: 45px !important;\n text-align: center !important;\n }\n .offers-block-desc {\n font-size: 18px !important;\n font-weight: 400 !important;\n line-height: 1.75rem !important;\n text-align: center !important;\n }\n\n .offers-block-disclaimer {\n background-image: linear-gradient(90deg, hsla(0, 0%, 100%, .5) 60%, hsla(0, 0%, 100%, 0) 0) !important;\n background-position: top !important;\n background-repeat: repeat-x !important;\n background-size: 20px 1px !important;\n font-size: 8px !important;\n font-weight: 400 !important;\n margin-top: .5rem !important;\n padding-top: .5rem !important;\n }\n \n .offers-block-disclaimer p {\n display: block !important;\n visibility: visible !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n \n .offers-block-disclaimer p a {\n display: inline !important;\n visibility: visible !important;\n text-decoration: none !important;\n }\n \n .offers-block-expire {\n display: block !important;\n font-size: 14px !important;\n font-weight: 500 !important;\n line-height: 1rem !important;\n margin-top: .5rem !important;\n text-align: center !important;\n }\n\n .sp-offers-section .container .claim-offer {\n display: none !important;\n } \n .offers-block-disclaimer,\n .offers-block-disclaimer *,\n .offers-block-disclaimer p,\n .offers-block-main .offers-block-expire,\n .offers-block-expire {\n color: inherit !important;\n -webkit-text-fill-color: inherit !important;\n }\n }\n </style>"),e.write("</head>")}
3(l),function(e){e.write("<body>"),e.write('<section class="sp-offers-section">'),e.write('<div class="container">'),e.write('<ul class="sp-offers-list">')}(l),null===(n=null==s?void 0:s.classList)||void 0===n?void 0:n.contains("offers-block-item")){const e=i(s);(null==e?void 0:e.innerHTML)&&l.write(e.innerHTML)}else(null==s?void 0:s.innerHTML)&&l.write(s.innerHTML);!function(e){e.write("</div>"),e.write("</ul>"),e.write("</section>"),e.write("</body></html>")}(l),l.close(),r.onload=function(){var e,t;try{r.contentWindow?(null===(e=r.contentWindow)||void 0===e||e.focus(),null===(t=r.contentWindow)||void 0===t||t.print()):console.log("Content window is not available.")}catch(e){console.log("err",e)}},r.onerror=function(e){console.log(e)}}else alert("Printing is blocked by the browser. Please allow pop-ups for this site to print the offer.")}function i(e){var t,o,n,i,s,r,l;const a=document.createElement("li");a.classList.add("sp-offers-item");const d=document.createElement("div");d.classList.add("sp-offers-main");const c=document.createElement("div");c.classList.add("sp-offers-data");const u=document.createElement("div");u.classList.add("sp-offers-details");const m=null===(t=e.querySelector(".brand-logo"))||void 0===t?void 0:t.cloneNode(!0),h=null===(o=e.querySelector(".block-offer"))||void 0===o?void 0:o.cloneNode(!0),p=null===(n=e.querySelector(".offers-block-desc"))||void 0===n?void 0:n.cloneNode(!0);u.appendChild(m),u.appendChild(h),u.appendChild(p),c.appendChild(u);const v=null===(i=e.querySelector(".offers-block-disclaimer"))||void 0===i?void 0:i.cloneNode(!0),g=null===(s=e.querySelector(".offers-block-expire"))||void 0===s?void 0:s.cloneNode(!0),f=null===(r=e.querySelector(".offers-watermark"))||void 0===r?void 0:r.cloneNode(!0);d.appendChild(c),v&&d.appendChild(v),g&&d.appendChild(g),f&&d.appendChild(f);const y=null===(l=e.querySelector(".claim-offer"))||void 0===l?void 0:l.cloneNode(!0);return a.appendChild(d),y&&a.appendChild(y),a}o.d(t,{convertToFirstReference:()=>i,printOffer:()=>n})},"./src/js/opus2/util/purgeCache.ts"(e,t,o){"use strict";o.d(t,{clearCacheIfOnline:()=>d,getCacheSettings:()=>c,setCachePurgeFlag:()=>m});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),s=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),r=o(/*! ./idleLoader */"./src/js/opus2/util/idleLoader.ts"),l=o(/*! ./serviceWorkerDeregHelper */"./src/js/opus2/util/serviceWorkerDeregHelper.ts");let a=null;function d(){var e,t,o,n;const i=JSON.parse("false".toLowerCase());navigator.onLine?(null===(n=null===(o=navigator.serviceWorker)||void 0===o?void 0:o.controller)||void 0===n||n.postMessage({origin:location.origin,action:"online"}),i&&console.error("%c[SW]%c Error in fetching service worker config","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),h(!1)):(console.log("%c[SW]%c User is offline","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),null===(t=null===(e=navigator.serviceWorker)||void 0===e?void 0:e.controller)||void 0===t||t.postMessage({origin:location.origin,action:"offline"}))}function c(){return window.__calledAPIEndpoint||(a=null),a||(window.__calledAPIEndpoint?Promise.resolve(void 0):(a=function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){window.__calledAPIEndpoint=!0;const e=JSON.parse("false".toLowerCase()),t=`${s.apiConfig.CROWNPEAK_CACHING_SETTINGS}?${Date.now()}`;try{const o=yield(0,i.getCachedAPIResponse)(t,10,!1,!1);return o&&0!==Object.keys(o).length?(e&&console.log("%c[SW]%c Cache settings fetched successfully","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px","",o),yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t=JSON.parse("false".toLowerCase()),{timestamp:o,enabled:i,preCache:s,apiCache:a,enableLogger:c}=e,m=Array.isArray(a)?a:[];if(m.length>0&&r.PreFetchUrls.getInstance().getPreFetchUrls(m),!o||!s)return t&&console.error("Invalid cache settings response:",e),void d();if(!i)return t&&console.log("%c[SW]%c Caching is disabled, cleaning up...","background:orange; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),localStorage.removeItem("cachingL2"),yield(0,l.deregOfServiceWorker)(),void(yield h(i));(yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=new Date(e).getTime(),o=localStorage.getItem("lastCacheClear");return!o||(Number.isNaN(t)||Number.parseInt(o,10)<t)}catch(e){return console.error("Error checking cache purge status:",e),!1}})}(o))&&(yield h(i));const p=!0===c;localStorage.setItem("suLogger",String(p)),localStorage.setItem("fallbackCall",String(!1)),localStorage.setItem("cachingL2","true"),yield function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const t="NBLY-nahsor",o=yield caches.open(t);yield u(o,"offlineCaching","true"),e.length>0?yield u(o,"preCache",JSON.stringify(e)):yield function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){const o=`/${t}`,n=yield e.keys();for(const t of n)new URL(t.url).pathname.endsWith(o)&&(yield e.delete(t))})}(o,"preCache")})}(s)})}(o),o):(e&&console.log("%c[SW]%c CP has not set up the Config setting for Caching","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),void d())}catch(e){return void d()}})}(),a))}function u(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){const n=new Request
3(`/${t}`,{method:"GET"}),i=new Response(o,{headers:{"Content-Type":"text/plain"}});yield e.put(n,i)})}function m(e){var t;if(window.__cachePurgeInProgress=e,null===(t=navigator.serviceWorker)||void 0===t?void 0:t.controller){const t={origin:location.origin,action:e?"cachePurgeInProgress":"cachePurgeCompleted"};console.log(`%c[SW]%c Sending message to service worker: ${t.action}`,"background:purple; color:#fff; font-weight: bold; padding: 0 8px",""),navigator.serviceWorker.controller.postMessage(t)}else e&&console.log("%c[SW]%c Unable to notify service worker - controller not available","background:red; color:#fff; font-weight: bold; padding: 0 8px","")}function h(){return(0,n.__awaiter)(this,arguments,void 0,function*(e=!1){var t;const o=JSON.parse("false".toLowerCase());m(!0);!function(){const e=["doingBusinessAs","franchiseWebLocationId","localPhoneNumber","rl-post-data","NEI-API data","RL_DBAName","RL_Weblocation_ID","fR","sAddressParam","franchiseId","fakeSubmitData","correlationIDFr","rewardConfirmation","insuranceFormPayload"],t=["dbaName","weblocationId","doingBusinessAs","franchiseWebLocationId","localPhoneNumber","sessionIDFr","cachingL2","lastCacheClear","localHeaderUrl","CA","US","brandDetails","dynamicMenuURLResponse","siteConfigDisplayClickToCallCta"].reduce((e,t)=>(localStorage.getItem(t)&&(e[t]=localStorage.getItem(t)),e),{}),o=e.reduce((e,t)=>(sessionStorage.getItem(t)&&(e[t]=sessionStorage.getItem(t)),e),{})}();try{yield(0,l.deregOfServiceWorker)();const n=yield caches.keys();if(yield Promise.all(n.map(e=>caches.delete(e))),yield new Promise((e,t)=>{const n=window.indexedDB.deleteDatabase("resource-store");n.onerror=()=>{o&&console.error("%c[SW]%c Error deleting IndexedDB database","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),t(new Error("Failed to delete IndexedDB"))},n.onsuccess=()=>{o&&console.log("%c[SW]%c IndexedDB database deleted successfully","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),e(void 0)}}),localStorage.setItem("lastCacheClear",Date.now().toString()),m(!1),"true"===(null===(t="true")?void 0:t.toLowerCase())&&e)try{const e=yield navigator.serviceWorker.register("/brand/_assets/js/sw1.js",{scope:"/"});o&&console.log("%c[SW]%c Service worker re-registered","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),yield new Promise(t=>{e.active?t():e.addEventListener("activate",()=>t())})}catch(e){o&&console.log("%c[SW]%c Failed to re-register service worker:","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px",e)}}catch(e){throw console.error("Error during purge:",e),m(!1),e}})}window.__calledAPIEndpoint=!1},"./src/js/opus2/util/real-time-email-validation.ts"(e,t,o){"use strict";o.d(t,{validateEmail:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts"),s=o(/*! ../api/apiRequest */"./src/js/opus2/api/apiRequest.ts"),r=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts");function l(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){const{value:t,conceptCode:o,signal:l,historyCount:a=5}=e,d="emailValidationHistory",c=sessionStorage,u=c.getItem(d);let m,h=[],p="EmailValidationPassed";const v=()=>{m={value:t,validity:p},h.length>a&&h.shift(),h.push(m),c.setItem(d,JSON.stringify(h))};if(""===t.trim())return p="EmptyField",p;if(!r.REGEX.sendEmail.test(t))return p="RegexFailed",p;if(u&&(h=JSON.parse(u),m=h.find(e=>e.value===t),m))return p=m.validity,p;if(!(yield(0,i.getBrandDetailsFromBrandJson)(o)).enable_realtime_email_validation)return p;try{const e=yield function(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const o={url:"https://api.neighborly.com/digitalorchestrations-api/v1/public/ValidateEmail",headers:{Accept:"application/json","Content-Type":"application/json",apikey:"pneiweb-9pbaOywNKQj853D"},signal:t,data:{email:e},method:"POST"};return yield(0,s.default)(o)}catch(e){throw new Error("Send grid API falied"+e)}})}(t,l);if(!e)return p="SendGridResponseFalse",v(),p;c.removeItem(d)}catch(e){return console.warn(e),p="SendGridFailed",p}return v(),p})}window.ValidateEmail=l},"./src/js/opus2/util/replaceLocalLogoLink.ts"(e,t,o){"use strict";o.d(t,{replaceLocalLogoLink:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts");function s(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;let n="",s="";const r=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;if(r){const t=yield(0,i.getBrandDetailsFromBrandJson)(r);(null==t?void 0:t.includeTrailingSlash)&&(n=t.includeTrailingSlash?"/":""),(null==t?void 0:t.weblocation_path_group)&&(s=t.weblocation_path_group);let l=s?`${s}/${localStorage.getItem("dbaName")}`:localStorage.getItem("dbaName");const a=null!==(o=window.crownpeakWeblocationsByIdDetail)&&void 0!==o?o:{},d=(0,i.getDomainUrl)();(null==t?void 0:t.include_crownpeakURL)&&(null==a?void 0:a.weblocation_url)||(null==t?void 0:t.include_statename)&&(null==a?void 0:a.weblocation_url)?null==e||e.setAttribute("href",`${null==a?void 0:a.weblocation_url}`):d&&l&&(null==e||e.setAttribute("href",`${d}/${l}${n}`))}})}},"./src/js/opus2/util/serviceWorkerDeregHelper.ts"(e,t,o){"use strict";o.d(t,{deregOfServiceWorker:()=>i});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");function i(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(window.__derOfServiceWorker)return;window.__derOfServiceWorker=!0;let e=!1;try{e=JSON.parse("false".toLowerCase())}catch(t){e=!1}const t=yield navigator.serviceWorker.getRegistrations();e&&console.log(`%c[SW]%c Found ${t.length} service worker registrations:`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px","");for(let o=0;o<t.length;o++){const n=t[o];if(e&&(console.log(`%c[SW]%c Registration ${o+1}:`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),console.log(`%c[SW]%c - Scope: ${n.scope}`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),console.log(`%c[SW]%c - Active: ${n.active?n.active.scriptURL:"None"}`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),console.log(`%c[SW]%c - Installing: ${n.installing?n.installing.scriptURL:"None"}`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px",""),console.log(`%c[SW]%c - Waiting: ${n.waiting?n.waiting.scriptURL:"None"}`,"background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px","")),n){n.active&&n.active.scriptURL&&n.active.scriptURL.includes("sw1.js")&&(yield n.unregister(),e&&console.log("%c[SW]%c Service worker sw1 unregistered","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px",""))}}})}window.__derOfServiceWorker=!1},"./src/js/opus2/util/serviceWorkerRegistration.ts"(e,t,o){"use strict";o.d(t,{conditionalServiceWorkerInstall:()=>f});var n,i,s,r,l=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),a=o(/*! ./checkDeviceAndBrowserType */"./src/js/opus2/util/checkDeviceAndBrowserType.ts"),d=o(/*! ./purgeCache */"./src/js/opus2/util/purgeCache.ts"),c=o(/*! ./serviceWorkerDeregHelper */"./src/js/opus2/util/serviceWorkerDeregHelper.ts");const u="true"===(null===(n="false")?void 0:n.toLowerCase())||!1,m="true"===(null===(i="true")?void 0:i.toLowerCase())||!1;let h=!1;try{h="true"===localStorage.getItem("cachingL2")}catch(e){v("User is in Cognito - localStorage not accessible","red")}const p="development"===(null===(s="production")?void 0:s.toLowerCase())||"release"===(null===(r="production")?void 0:r.toLowerCase());function v(e,t){u&&console.log(`%c[SW]%c ${e}`,`background:${t}; color:#f3f3f3; font-weight: bold; padding: 0 8px`,"")}function g(){return(0,l.__awaiter)(this,void 0,void 0,function*(){try{const e=yield navigator.serviceWorker.getRegistration();e&&(yield e.unregister(),v("Service worker unregistered successfully","green"))}catch(e){v(`Error unregistering service worker: ${e}`,"red")}})}function f(){return(0,l.__awaiter)(this,void 0,void 0,function*(){const e=yield function(){return(0,l.__awaiter)(this,void 0,void 0,function*(){try{return yield(0,a.userBrowserDetails)()}catch(e){return console.error("%c[SW]%c Error fetching user details:","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px","",e),{inCognito:!1}}})}();p&&(console.log("%cNon - Prod Build has been loaded","background: #f3f3f3; color: red; font-size: 32px; padding: 8px 16px; margin: 8px 0; font-weight: bold;"),v(`User Details: ${JSON.stringify(e)}`,"grey")),e.inCognito?v("User is in Cognito","red"):h?m?(yield function(){return(0,l.__awaiter)(this,void 0,void 0,function*(){if("serviceWorker"
3in navigator){if(!m)return v("Service worker is disabled by configuration","orange"),void(yield g());try{window.__cachePurgeInProgress&&(v("Cache purge in progress, deferring service worker registration","orange"),yield new Promise(e=>{const t=Date.now(),o=()=>{const n=Date.now()-t;!window.__cachePurgeInProgress||n>5e3?(n>5e3&&(v("Timeout waiting for cache purge to complete, proceeding anyway","red"),window.__cachePurgeInProgress=!1),e(void 0)):setTimeout(o,100)};o()}));const e=yield navigator.serviceWorker.register("/brand/_assets/js/sw1.js",{scope:"/"});e.addEventListener("activate",()=>{v("Service worker activated","green")}),e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{"installed"===t.state&&navigator.serviceWorker.controller&&v("New service worker installed","green")})}),navigator.serviceWorker.addEventListener("message",e=>{"CACHE_CLEARED"===e.data.type&&(v("Cache cleared by service worker","green"),window.__cachePurgeInProgress&&(0,d.setCachePurgeFlag)(!1))}),h&&(yield(0,d.getCacheSettings)())}catch(e){v(`Service worker registration failed: ${e}`,"red"),yield g()}}else v("Service workers are not supported","red")})}(),(0,d.getCacheSettings)()):(0,c.deregOfServiceWorker)().then(()=>{m&&console.log("%c[SW]%c Service worker deregistered","background:blue; color:#f3f3f3; font-weight: bold; padding: 0 8px","")}).catch(e=>{m&&console.error("%c[SW]%c Error deregistering service worker:","background:red; color:#f3f3f3; font-weight: bold; padding: 0 8px","",e)}):(0,d.getCacheSettings)()})}},"./src/js/opus2/util/sessionCorelationID.ts"(e,t,o){"use strict";o.d(t,{generateRandomString:()=>n});o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs");function n(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o="";const n=new Uint32Array(e);window.crypto.getRandomValues(n);for(const e of n)o+=t.charAt(e%62);return o}},"./src/js/opus2/util/setDateAndTime.ts"(e,t,o){"use strict";function n(e){return new Date(e).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}function i(e){let t=e.replace(/,/g,"").split(" "),o=t.slice(4,e.length).join(" ").replace(/ /g," ");return`${t[0]}, ${t[2]} ${t[1]}, ${t[3]}, ${o}`}o.d(t,{reformatDate:()=>i,setTimeAndDate:()=>n})},"./src/js/opus2/util/share.ts"(e,t,o){"use strict";o.r(t),o.d(t,{calculateCaretPosition:()=>Ee,capitalizeString:()=>Y,checkAutoLocationOnLoad:()=>Re,checkDomain:()=>J,checkOSFlowPathAndReturnBoolean:()=>R,closeReminderModal:()=>ne,commonStates:()=>D,constructAppointMentApiUrl:()=>be,debounce:()=>Q,detectFinancingPage:()=>De,detectPageTypeByAssetPath:()=>je,detectServicePageTypeByAssetPath:()=>Pe,determineCountryZip:()=>Ce,fetchCrownpeakUrlDetails:()=>ae,filterFranchiseData:()=>Be,getAddressLine:()=>_e,getBrandDetailsFromBrandJson:()=>B,getCampaignName:()=>j,getConceptId:()=>fe,getCookie:()=>Ne,getCountryCodefromAssetpath:()=>P,getDomainUrl:()=>we,getFooterLink:()=>q,getFranchiseDetails:()=>ge,getFranchiseWebLocationId:()=>V,getFranchiseWebLocationIdDetails:()=>T,getFullAttributeData:()=>de,getPostalCodeForLocalizedLink:()=>ce,getSiteConfigApplyLocallyFlag:()=>me,getVendorDetails:()=>Z,getWebLocationId:()=>ue,getWeblocationPathGroupWithDynamicConfig:()=>U,getWeblocationPathGroupWithFooterConfig:()=>G,getWeblocationPathGroupWithSiteConfig:()=>W,handleCrossDomainLink:()=>Se,handleFakeSubmit:()=>ie,handleGetFallbackLocationData:()=>Ae,hideErrorMsgInModal:()=>ye,hmsProgressBarUpdate:()=>F,insertAfterUrl:()=>N,isISNFlow:()=>Me,isNegative:()=>ve,isOperationActiveNow:()=>K,isValidEmail:()=>Le,loadHereMapScripts:()=>pe,localSearch:()=>M,localizationHelper:()=>oe,logPayloadForFakeSubmit:()=>se,manageTNSPaginationDots:()=>qe,modifyAllApplyLocalHref:()=>he,normalizeUSZipCode:()=>Te,rearrangeCanadaFirst:()=>ke,removeAllEventListeners:()=>z,removeElementEventListeners:()=>X,returnToHomePage:()=>$,setLocalTagLineText:()=>Ie,shareOnFacebook:()=>C,shareOnLinkedIn:()=>_,shareOnPinterest:()=>k,shareOnTwitter:()=>A,storeBookingApiPayload:()=>H,updateCompressedHeaderLogo:()=>x,updateFranchiseDataWithCrownpeakData:()=>le,updateHeaderContent:()=>
3O,weblocationDetailsById:()=>re});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/apiConfig */"./src/js/opus2/config/apiConfig.ts"),s=o(/*! ../location-search-map/models/ScreenType */"./src/js/opus2/location-search-map/models/ScreenType.ts"),r=o(/*! ../location-search-map/reportScreenSize */"./src/js/opus2/location-search-map/reportScreenSize.ts"),l=o(/*! ./replaceLocalLogoLink */"./src/js/opus2/util/replaceLocalLogoLink.ts"),a=o(/*! ../util/locationBasedBrandJson */"./src/js/opus2/util/locationBasedBrandJson.ts"),d=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),c=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),u=o(/*! ../footer/footer */"./src/js/opus2/footer/footer.ts"),m=o(/*! ../api/apiTester */"./src/js/opus2/api/apiTester.ts"),h=(o(/*! ./domainService */"./src/js/opus2/util/domainService.ts"),o(/*! ./localizationTag */"./src/js/opus2/util/localizationTag.ts")),p=o(/*! ./headerUpdate */"./src/js/opus2/util/headerUpdate.ts"),v=o(/*! ./localizationService */"./src/js/opus2/util/localizationService.ts"),g=o(/*! ../../global */"./src/js/global/index.ts"),f=o(/*! ./logger */"./src/js/opus2/util/logger.ts"),y=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),b=o(/*! ./pageSettings */"./src/js/opus2/util/pageSettings.ts"),I=o(/*! ../hms */"./src/js/opus2/hms/index.ts"),S=o(/*! ./loader */"./src/js/opus2/util/loader.ts"),w=o(/*! ../nbly-brand/conditional_localization */"./src/js/opus2/nbly-brand/conditional_localization.ts"),L=o(/*! ../header */"./src/js/opus2/header/index.ts"),E=o(/*! ../nbly-brand/helper_functions */"./src/js/opus2/nbly-brand/helper_functions.ts");function C(e,t){const o=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(e)}"e=${encodeURIComponent(t)}`;window.open(o,"_blank")}function A(e,t){const o=`https://twitter.com/intent/tweet?text=${encodeURIComponent(e)}&url=${encodeURIComponent(t)}`;window.open(o,"_blank")}function _(e){const t=`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(e)}`;window.open(t,"_blank")}function k(e,t){const o=new URLSearchParams;o.append("url",e),o.append("description",t);const n="https://www.pinterest.com/pin/create/button/?"+o.toString();window.open(n,"_blank")}function N(){let e;e="/"!=window.location.pathname.substr(-1)?window.location.protocol+"//"+window.location.host+window.location.pathname+"/#thank-you":window.location.protocol+"//"+window.location.host+window.location.pathname+"#thank-you",window.history.pushState({path:e},"",e)}function T(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield ge(e);if(Array.isArray(t)&&t.length>0){const e=t[0];return localStorage.setItem("doingBusinessAs",e.doingBusinessAs),localStorage.setItem("weblocationId",e.franchiseWebLocationId),e.hasOwnProperty("franchiseWebLocationId")?e.franchiseWebLocationId:""}return""}catch(e){return console.error("Error in fetching FranchiseLookUpByServiceAddress API data:",e),""}})}function B(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=(0,a.getBrandJSON)();if("Error validating Location"===t)return console.error("Error Determining BrandJSON path for given location"),[];{const o=localStorage.getItem("brandDetails");if("undefined"!==o&&null!==o){let t=JSON.parse(o);if((null==t?void 0:t.code)===e)return((null==t?void 0:t.include_crownpeakURL)||(null==t?void 0:t.include_statename))&&(yield ae()),t}const n=window.location.origin;try{const o=`${n}/${t}`,i=(yield(0,c.getCachedAPIResponse)(o,d.apiCaching.BrandJsonConfig,!1)).find(t=>t.code===e);return((null==i?void 0:i.include_crownpeakURL)||(null==i?void 0:i.include_statename))&&(yield ae()),i&&localStorage.setItem("brandDetails",JSON.stringify(i)),i}catch(t){const o=`Error fetching brand details for ${e}: ${t.message}`;throw console.error(o),new Error(o)}}}catch(e){return console.error("Error in fetching getBrandDetailsFromBrandJson API data:",e),[]}})}function P(){let e=document.getElementById("countryCode");e=null==e?void 0:e.value.toLocaleLowerCase();let t=document.getElementById("assetPath");t=null==t?void 0:t.value.toLocaleLowerCase();const o=(null==t?void 0:t.includes("blogs"))?null==t?void 0:t.split("/")[4]:null==t?void 0:t.split("/")[5];return e===o?e:o}function j(){let e=window.location.href,t="";return e.includes("?")?function(e){if(!(0,E.conceptIdLookupForNblyOrCorp)())return!0;try{const t=new URL(e).searchParams,o=t.get("service"),n=t.get("address");return!o&&!n}catch(e){return console.warn("Invalid URL in checkIfNblyAndIsSearchResultParam:",e),!0}}(e)&&(t=e,sessionStorage.setItem("campaignName",t)):t="N/A",t}function D(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=localStorage.getItem(e);if(t)return JSON.parse(t);const o=i.apiConfig.stateApi+e,n=yield(0,c.cachedAPIWrapper)(o);return localStorage.setItem(e,JSON.stringify(n)),n}catch(e){return console.error("Error in fetching state API data:",e),[]}})}function M(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t,o;const n=document.getElementById("full_dbaName"),i=P(),s=window.location.origin;try{const r=`${s}/${i}/en-${i}/_assets/brand/${null==n?void 0:n.value}/js/data/dynamic_menu.json`,l=yield(0,c.getCachedAPIResponse)(r,d.apiCaching.DynamicMenu,!1);if(l){const n=l.serviceMenu,i=null===(o=null===(t=null===(e=n.country[0])||void 0===e?void 0:e.brand[0])||void 0===t?void 0:t.webLocation[0])||void 0===o?void 0:o.option;sessionStorage.setItem("localFilterService",JSON.stringify(i))}}catch(e){console.error("Error in fetching state API data:",e)}})}function q(){var e,t,o;try{let n=[],i={};i=localStorage.getItem("dynamicMenuURLResponse"),i=JSON.parse(i);const s=null===(o=null===(t=null===(e=null==i?void 0:i.serviceMenu)||void 0===e?void 0:e.country[0])||void 0===t?void 0:t.brand[0])||void 0===o?void 0:o.option;
3return null==s||s.forEach(e=>{n.push({name:null==e?void 0:e.name,link:window.location.origin+(null==e?void 0:e.link)})}),n}catch(e){return[]}}function R(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=document.getElementById("conceptCode");if(e){const t=e.value,o=yield B(t),n=o.request_button_link_type?o.request_button_link_type.replace(/\//g,""):"";return window.location.pathname.includes(n)}return!1})}function O(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;if(!w.ConditionalLocalization.getInstance().init())return;const n=document.querySelector(".local-location .address"),i=document.querySelector(".local-location .description"),a=document.querySelector(".brand-header-local .brand-logo-wrapper");let d="",c="";const u=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;if(u){const t=yield B(u);(null==t?void 0:t.includeTrailingSlash)&&(d="/");try{((null==t?void 0:t.include_crownpeakURL)||(null==t?void 0:t.include_statename))&&(yield ae())}catch(e){console.error("Error in fetching Crownpeak API data:",e)}(null==t?void 0:t.weblocation_path_group)&&(c=t.weblocation_path_group);let m=null!==(o=localStorage.getItem("dbaName"))&&void 0!==o?o:"",p=c?`${c}/${m}`:m;if(null==t?void 0:t.include_statename){const e=window.crownpeakWeblocationsByIdDetail,t=null==e?void 0:e.stateName;t&&(p=c?`${c}/${t}/${m}`:m)}!function(e,t,o,n,i,s,r){var l;t&&(t.innerText=e);o&&""===o.innerText&&(0,h.localizationTagLine)();const a=null!==(l=window.crownpeakWeblocationsByIdDetail)&&void 0!==l?l:{},d=we();n&&((null==r?void 0:r.include_crownpeakURL)&&(null==a?void 0:a.weblocation_url)||(null==a?void 0:a.weblocation_url)&&(null==r?void 0:r.include_statename))?n.setAttribute("href",null==a?void 0:a.weblocation_url):d&&s&&(null==n||n.setAttribute("href",`${d}/${s}${i}`));x(a,d,s,i,r)}(e,n,i,a,d,p,t),function(){const e=document.querySelector(".brand-header-local"),t=null!==localStorage.getItem("dbaName"),o=(0,b.getPageSettings)("pagescope");!e||t&&"national"===o||(e.style.display="");const n=document.querySelector(".brand-header-local .find-local");if(n){const e=n.childNodes[1];e&&(e.textContent="Change Location")}}(),function(){const e=document.querySelector(".brand-footer .fb-des-link");e&&(0,l.replaceLocalLogoLink)(e)}(),function(e,t,o){var n;if((0,r.reportScreenSize)()!==s.ScreenType.Desktop){const i=document.querySelector(".sidenav-brand-logo");i&&i.setAttribute("href",`${window.location.origin}/${t}${e}`);const s=document.querySelector(".brand-logo-mobile"),r=null!==(n=window.crownpeakWeblocationsByIdDetail)&&void 0!==n?n:{},l=we();s&&(null==o?void 0:o.include_crownpeakURL)&&(null==r?void 0:r.weblocation_url)?s.setAttribute("href",null==r?void 0:r.weblocation_url):l&&t&&(null==s||s.setAttribute("href",`${l}/${t}${e}`))}}(d,p,t)}})}function x(e,t,o,n,i){var s;const r=document.querySelector(".main-header");if(null===(s=null==r?void 0:r.classList)||void 0===s?void 0:s.contains("compressed-header")){const s=document.querySelector(".fixed-brand-logo");s&&((null==i?void 0:i.include_crownpeakURL)&&(null==e?void 0:e.weblocation_url)||(null==e?void 0:e.weblocation_url)&&(null==i?void 0:i.include_statename)?s.setAttribute("href",null==e?void 0:e.weblocation_url):t&&o&&s.setAttribute("href",`${t}/${o}${n}`))}}function F(e,t){const o=document.querySelector(".progressbar #progress"),n=document.querySelectorAll(".progressbar .progress-step");n&&o&&(o.style.width=e,n.forEach((e,t)=>{e.classList.remove("prograssbar-length","progress-step-confirmed"),e.classList.remove("prograssbar-length","progress-step-active")}),n.forEach((e,o)=>{o<t?e.classList.add("prograssbar-length","progress-step-confirmed"):o===t&&e.classList.add("prograssbar-length","progress-step-active")}))}function $(){const e=window.location.href.split("/").slice(0,3).join("/");window.location.href=`${e}/`}function H(e,t){try{const o=JSON.stringify(e);sessionStorage.setItem("rl-post-data",o);let n='{ "Result": '+JSON.stringify(t)+', "Form data": '+o+', "Response message":"SUCCESS" }';sessionStorage.setItem("NEI-API data",n)}catch(e){console.log("Error while storing the apipayload",e)}}function z(e){const t=document.querySelector(e);
3if(t){const e=t.cloneNode(!0);return t.parentNode.replaceChild(e,t),e}return null}function W(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=window.location.origin,n=document.getElementById("dbaName"),i=(null==n?void 0:n.value)||localStorage.getItem("dbaName"),s=i?{dbName:i}:{};let r=null!==(e=null==s?void 0:s.dbName)&&void 0!==e?e:"",l=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null;if(!l){const e=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value;e&&(l=yield B(e))}const{weblocation_path_group:a,include_statename:d}=l||{};let c=["config-files","_site-config.json"];if(r){if(c.unshift(r),d){let e=window.crownpeakWeblocationsByIdDetail;e||(yield ae(),e=window.crownpeakWeblocationsByIdDetail);const t=null==e?void 0:e.stateName;t&&c.unshift(t)}a&&c.unshift(a)}return`${o}/${c.join("/")}`})}function U(){var e;const t=window.location.origin,o=localStorage.getItem("dbaName"),n=null===(e=document.getElementById("brandName"))||void 0===e?void 0:e.value,i=P();let s=[];const r=localStorage.getItem("franchiseWebLocationId"),l=document.getElementById("weblocationId"),a=(null==l?void 0:l.value)?null==l?void 0:l.value:r;return o&&a?s.push("cesmenu",a,o):s.push(i,`en-${i}`,n,"_assets","js","data","dynamic_menu.json"),`${t}/${s.join("/")}`}function G(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=window.location.origin,t=localStorage.getItem("dbaName"),o=(null===localStorage||void 0===localStorage?void 0:localStorage.brandDetails)?JSON.parse(localStorage.brandDetails):null,{weblocation_path_group:n,include_statename:i}=o||{};let s=["config-files","_footer-config"];if(t){if(s.unshift(t),i){let e=window.crownpeakWeblocationsByIdDetail;e||(yield ae(),e=window.crownpeakWeblocationsByIdDetail);const t=null==e?void 0:e.stateName;t&&s.unshift(t)}n&&s.unshift(n)}return`${e}/${s.join("/")}`})}function V(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield ge(e);if(Array.isArray(t)&&t.length>0){return t[0]}return""}catch(e){return console.error("Error in fetching FranchiseLookUpByServiceAddress API data:",e),""}})}function J(){const e=window.location.origin;if(e.includes("localhost")){const e=document.getElementById("assetPath");if(e){const t=e.value;if(t.includes("/US/"))return"us";if(t.includes("/CA/"))return"ca"}return"Error validating Location"}if(e.includes("nblysbx")||e.includes("nblydev")||e.includes("nblytest")||e.includes("nblyprod"))try{return e.includes("-ca-")||e.includes("-ca")&&e.includes("nblyprod")?"ca":"us"}catch(e){return"Error validating Location"}else try{const t=e.lastIndexOf(".");return"ca"===e.substring(t+1)?"ca":"us"}catch(e){return"Error validating Location"}}function Y(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}function K(e){if(!e||0===e.length)return!1;const t=new Date,o=t.getDay(),n=60*t.getHours()+t.getMinutes();for(const t of e){if(null==t.dayOfWeek||null==t.startMinutes||null==t.endMinutes)continue;const e=t.dayOfWeek,i=t.startMinutes,s=t.endMinutes;if(e===o&&n>=i&&n<=s)return!0}return!1}function X(e){if(e){const t=e.cloneNode(!0);return e.parentNode.replaceChild(t,e),t}return null}function Z(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value,n=null===(t=document.getElementById("conceptCode"))||void 0===t?void 0:t.value,i=yield B(n);let s=0,r="";return i&&(s=Number(i.vendorId)||0,r=i.vendorName),{conceptId:o,conceptCode:n,vendorId:s,vendorName:r}})}function Q(e,t){let o;return function(...n){null!==o&&clearTimeout(o),o=setTimeout(()=>e.apply(this,n),t)}}function ee(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.error(`Error in updateInputValue function: ${e}`)}}function te(e){e&&(localStorage.setItem("dbaName",e),(0,h.localizationTagUpadation)())}function oe(e,t){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t,o=!0){var n,i,s,r,l,a,d,c,m;if(!e||0===e.length)return void(0,f.logInTestEnv)("Invalid result data:",e);const{franchiseWebLocationId:p,doingBusinessAs:v,franchiseId:y,phoneNumber:b,websiteTracking:I}=e[0];let S=I||b,w=null!==(i=null===(n=e[0].locationWebsiteUrl)||void 0===n?void 0:n.replace(/\/$/,""))&&void 0!==i?i:"";t&&e[0].websiteUrl&&(w=null!==(r=null===(s=e[0].websiteUrl)||void 0===s?void 0:s.replace(/\/$/,""))&&void 0!==r?r:"",S=(null===(a=null===(l=e[0])||void 0===l?void 0:l.websiteTrackingPhone)||void 0===a?void 0:a.length)>0?null===(d=e[0])||void 0===d?void 0:d.websiteTrackingPhone[0]:b),localStorage.setItem("franchiseWebLocationId",p),sessionStorage.setItem("franchiseId",y),localStorage.setItem("doingBusinessAs",v),localStorage.setItem("weblocationId",p),localStorage.setItem("localPhoneNumber",S),sessionStorage.setItem("RL_Weblocation_ID",p),sessionStorage.setItem("RL_DBAName",v);const L=w.toLowerCase().split("/"),E=L[L.length-1],C=null===(c=document.getElementById("conceptCode"))||void 0===c?void 0:c.value,A=yield B(C);if(null==A?void 0:A.displayCESurl){yield ae();const e=p,t=window.crownpeakWeblocationsDetails,o=null==t?void 0:t.find(t=>t.weblocation_id==e);te(null!==(m=null==o?void 0:o.dbaName)&&void 0!==m?m:E)}else te(E);ee("local_weblocationId",p),ee("weblocationId",p),ee("full_dbaName",E),ee("dbaName",E);const _=document.querySelector(".header-wrapper .address"),k=document.querySelector(".header-wrapper .description"),N=document.querySelector(".header-wrapper .form-call-cta"),T=document.querySelector(".header-cta-mobile .mob-call-cta");if(Se(w),E&&v&&O(v),_&&k&&N&&(_.innerHTML=v,(0,h.localizationTagLine)(),N.href=`tel:${S}`,N.innerText=`(${S.slice(0,3)}) ${S.slice(3,6)}-${S.slice(6)}`),T&&(T.href=`tel:${S}`),(0,h.localizationMobileDBATitle)(),o){try{yield(0,g.addLocalizationHeaderMenuLocal)()}catch(e){(0,f.logInTestEnv)("Error in addLocalizationHeaderMenuLocal function:",e)}u.Footer.init()}})}function ne(){const e=document.getElementById("close-reminder-local-modal");e&&e.click()}function ie(e){return(0,m.requestLogger)(e.data,e.url),Promise.resolve()}function se(){sessionStorage.getItem("mockRequestPayload")&&console.log("%c[FAKE BOOKING]%c Mock Request Payload :","background:green; color:#f3f3f3; font-weight: bold; padding: 0 8px; font-size:1.2rem","",sessionStorage.getItem("mockRequestPayload"))}function re(){var e,t;try{const o=null!==(e=localStorage.getItem("franchiseWebLocationId"))&&void 0!==e?e:localStorage.getItem("weblocationId"),n=null!==(t=window.crownpeakWeblocationsDetails)&&void 0!==t?t:{};return n.find(e=>e.weblocation_id==o)}catch(e){return console.error("Error in fetching Crownpeak API data:",e),{}}}function le(e){var t;const o=null!==(t=window.crownpeakWeblocationsDetails)&&void 0!==t?t:[];console.log("Before updating--------\x3e",o);const n=new Map;
3return null==o||o.forEach(e=>{n.set(e.weblocation_id,e.weblocation_url)}),console.log("After updating--------\x3e",o),null==e||e.forEach(e=>{if(e.franchiseWebLocationId){const t=e.franchiseWebLocationId.toString(),o=n.get(t);o&&(e.crownpeak_weblocation_url=o)}}),console.log("After updating--------\x3e Franchise",e),e}function ae(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=i.apiConfig.CROWNPEAK_WEBLOCATION_URL,t=yield(0,c.getCachedAPIResponse)(e,60,!1);window.crownpeakWeblocationsDetails=t,window.crownpeakWeblocationsByIdDetail=re()})}function de(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e}`,o=yield(0,c.cachedAPIWrapper)(t);return o&&0!==Object.keys(o).length?(localStorage.setItem("fullAttrOnLoad",JSON.stringify(o)),o):(console.warn("No data found for the provided webId:",e),null)}catch(e){return console.error("Error fetching full attribute data:",e),null}})}function ce(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){let t="";try{const o=yield de(e);return o&&0!==Object.keys(o).length?(t=(null==o?void 0:o.zip)||"",t?t.trim():""):""}catch(e){return console.error("Error fetching postal code for localized link:",e),""}})}function ue(){var e,t;let o=null!==(t=null===(e=document.getElementById("weblocationId"))||void 0===e?void 0:e.value)&&void 0!==t?t:localStorage.getItem("franchiseWebLocationId");return o||(o=localStorage.getItem("weblocationId")||localStorage.getItem("local_weblocationId")),"undefined"!==o&&"null"!==o&&o?o:null}function me(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=yield W();if(!t)return!1;try{const o=yield(0,c.getCachedAPIResponse)(t,d.apiCaching.SiteConfig,!1);return!!o&&!(null!==(e=null==o?void 0:o.chk_disable_job_link_localization)&&void 0!==e&&e)}catch(e){return console.error("Error in fetching site config"),!1}})}function he(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;const t=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;if(!t)return;const o=yield B(t),n=yield me(),i=ue();if(i&&(null==o?void 0:o.job_link_localisation)&&n){let e=yield ce(i);if(!e)return;const t=['.brand-header ul.brand-cta-list li.brand-cta-item a[aria-labelledby="Apply Locally"]','.brand-header ul.brand-cta-list li.brand-cta-item a[aria-labelledby="Aplicar Localmente"]','.brand-header-local ul.brand-cta-list li.brand-cta-item a[aria-labelledby="Apply Locally"]','.brand-header-local ul.brand-cta-list li.brand-cta-item a[aria-labelledby="Aplicar Localmente"]','.brand-footer .footer-block .fb-wrapper-link .fb-link-block ul.footer-submenu li.submenu-li a[title="Apply Locally - opens in a new tab"]','.brand-footer .footer-block .fb-wrapper-link .fb-link-block ul.footer-submenu li.submenu-li a[title="Aplicar Localmente - opens in a new tab"]','.brand-footer .fb-inner-wrapper .fb-wrapper-link a[title="Apply Locally"]','.brand-footer .fb-inner-wrapper .fb-wrapper-link a[title="Aplicar Localmente"]','.main-nav-warpper a[title="Apply Locally - open in new tab"]','.team-neighborly-section a[title^="View All Positions"]','.team-neighborly-section a[title^="View All Open Positions"]'],n="25",s="100",r=(null==o?void 0:o.localization_radius)||s,l=(null==o?void 0:o.localization_radius)||n,a=J(),d="ca"===(null==a?void 0:a.toLowerCase()),c=/[a-zA-Z]/.test(e);let u;u=d?r:c?s:l;const m=[["location_name",e],["location_type","1"],["radius",u]];document.querySelectorAll(t.join(",")).forEach(e=>{var t;try{const o=e;if(!o)return;if(!o.href||(null===(t=o.getAttribute("href"))||void 0===t?void 0:t.startsWith("javascript:")))return;const n=new URL(o.href);if(n.pathname){if(!n.pathname.includes("jobs")){const e=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`;n.pathname=`${e}jobs`}}else n.pathname="/jobs";const i=new URLSearchParams(n.search);for(let[e,t]of m)i.has(e)||i.append(e,t);n.search=i.toString(),o.href=n.toString()}catch(e){console.error("Error setting Apply Locally href:",e)}})}})}function pe(){return(0,n.__awaiter)(this,void 0,void 0,function*(){if(document.getElementById("mapsjs-core-js"))console.log("Here Map scripts are already loaded.");else{const e=`cb=${Date.now()}`,t=(t,o)=>new Promise((n,i)=>{const s=document.createElement("script");s.async=!1,s.src=`${t}?${e}`,s.id=o,s.onload=()=>n(),s.onerror=()=>i(new Error(`Failed to load script: ${t}`)),document.head.appendChild(s)});yield Promise.all([t("https://js.api.here.com/v3/3.1/mapsjs-core.js","mapsjs-core-js"),t("https://js.api.here.com/v3/3.1/mapsjs-ui.js","mapsjs-ui-js")])}})}function ve(e){return e<0}function ge(e){return(0,n.__awaiter)(this,arguments,void 0,function*(e,t=!0,o){const n=fe();let s=`${i.apiConfig.LocateLocationApiWithRoundRobin}/${Te(e)}/${t}/true/${n}`;return o&&(s+=`/${o}`),(0,c.cachedAPIWrapper)(s)})}window.localizationHelper=oe;const fe=()=>{var e;return null===(e=document.getElementById("conceptId"))||void 0===e?void 0:e.value};function ye(){const e=document.querySelectorAll(".error-text-wrapper .modal-text");(null==e?void 0:e.length)>
30&&Array.from(e).forEach(e=>null==e?void 0:e.classList.add("hidden"))}function be(e){const t=i.apiConfig.AppointMentAPi,o=new URLSearchParams({PostalCode:e.PostalCode,WebLocationId:e.WebLocationId,DateStart:e.DateStart,IsEstimate:e.IsEstimate.toString(),VendorId:e.VendorId.toString()});return e.apikey&&o.append("apikey",e.apikey),e.NumberOfDays&&o.append("NumberOfDays",e.NumberOfDays.toString()),2==window.calendarTypeId&&e.ServiceSkuId&&o.append("ServiceSkuId",e.ServiceSkuId),`${t}?${o.toString()}`}function Ie(e){var t,o,n,i;if(e&&(0,v.isLocalized)()){const s=null!==(t=null==e?void 0:e.locateSubTitle)&&void 0!==t?t:"Locally Owned and Operated";s&&(localStorage.setItem("localTagLine",s),(0,h.localizationTagLine)());const r=null===(o=null==e?void 0:e.headerLogo)||void 0===o?void 0:o.logoImage,l=null===(n=null==e?void 0:e.headerLogo)||void 0===n?void 0:n.logoAltText,a=null===(i=null==e?void 0:e.headerLogo)||void 0===i?void 0:i.hamburgerViewLogoImage;r?(0,p.updateHeaderLogo)(r,null!=l?l:"Brand Logo",a):a&&(0,p.changeWhiteBackgroundLogoPath)(a,null!=l?l:"Brand Logo"),(null==e?void 0:e.headerLogo)&&sessionStorage.setItem("headerLogoURL",JSON.stringify(null==e?void 0:e.headerLogo))}}function Se(e){localStorage.removeItem("locationWebsiteUrl");try{const t=new URL(e);(null==t?void 0:t.origin)&&localStorage.setItem("locationWebsiteUrl",t.origin)}catch(e){console.error("Error processing cross-domain link:",e)}}function we(){const e=localStorage.getItem("locationWebsiteUrl");return null!=e?e:window.location.origin}function Le(){return(0,n.__awaiter)(this,void 0,void 0,function*(){return new Promise(e=>{setTimeout(()=>{e(!0)},200)})})}function Ee(e,t,o){if(e){const n=t+((null==e?void 0:e.value)?e.value.length-o.length:0);e.setSelectionRange(e.selectionStart,n)}}const Ce=e=>e&&y.REGEX.sendCaPostalCode.test(e.trim())?"ca":"us",Ae=()=>(0,n.__awaiter)(void 0,void 0,void 0,function*(){var e,t;const o=localStorage.getItem("weblocationId");if(!o)return{state:"No state found",city:"No city found"};try{const n=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${o}`,s=yield(0,c.cachedAPIWrapper)(n);return{state:null!==(e=null==s?void 0:s.state)&&void 0!==e?e:"No state found",city:null!==(t=null==s?void 0:s.city)&&void 0!==t?t:"No city found"}}catch(e){return console.error("Failed get attribute api call:",e),{state:"No state found",city:"No city found"}}}),_e=(e,t=!1)=>
3e.displayAddressSwitch?e.address1&&e.address2?`<span class="${t?"modal-text":""}">${e.address1}, ${e.address2}</span>`:e.address1?`<span class="${t?"modal-text":""}">${e.address1}, </span>`:e.address2?`<span class="${t?"modal-text":""}">${e.address2}, </span>`:"":"",ke=e=>{const t=[],o=[];e.forEach(e=>{var n;const i=null===(n=e.country)||void 0===n?void 0:n.toLowerCase();"can"===i||"ca"===i||"canada"===i?t.push(e):o.push(e)});return[...t,...o]};function Ne(e){const t=e+"=",o=decodeURIComponent(document.cookie).split(";");for(const e of o){let o=e.trim();if(o.startsWith(t))return o.substring(t.length)}return""}function Te(e){try{if(!e)return"";const t=(e=e.trim()).includes("-");if(/^\d{5}(-\d{4})?$/.test(e)&&t){const t=e.split("-")[0];e=null==t?void 0:t.trim()}return e}catch(t){return console.error("Error normalizing us zip code:",t),e}}function Be(e){var t,o,n;const i=null===(t=document.getElementById("countryCode"))||void 0===t?void 0:t.value.toLowerCase();let s=e.flatMap(e=>e.franchiseDetails.map(t=>Object.assign(Object.assign({},t),{franchiseId:e.franchiseId,distance:(null==t?void 0:t.distanceFromPostalCode)?null==t?void 0:t.distanceFromPostalCode:null==t?void 0:t.distance})));s="us"===i?s.filter(e=>"USA"===e.country||"United States"===e.country):s.filter(e=>"CAN"===e.country||"Canada"===e.country);let r=[];const l=new Set;for(let e of s){const t=null!==(n=null===(o=null==e?void 0:e.doingBusinessAs)||void 0===o?void 0:o.toLocaleLowerCase())&&void 0!==n?n:"",i=t.includes("test account"),s=t.includes("demo");l.has(e.franchiseWebLocationId)||i||s||(r.push(e),l.add(e.franchiseWebLocationId))}return r}function Pe(){return new Promise(e=>{var t,o;const n=document.getElementById("assetPath"),i=null===(t=document.getElementById("pageType"))||void 0===t?void 0:t.value;if(!(null==n?void 0:n.value))return sessionStorage.removeItem("serviceType"),void e(null);const s=n.value;if("Opus 2 Agnostic Lead Flow Template"!==i&&!s.includes("/Services")&&!s.includes("/Other Services"))return sessionStorage.removeItem("serviceType"),void e(null);const r=/\/Services(.+)/i.exec(s),l=/\/Other Services(.+)/i.exec(s),a=(null==r?void 0:r[1])||(null==l?void 0:l[1]);if(a){const t=null===(o=a.split("/").find(e=>""!==e.trim()))||void 0===o?void 0:o.toLowerCase();if(t)return sessionStorage.setItem("serviceType",t),void e(t)}e(null)})}function je(e,t,o){return new Promise(n=>{var i;const s=null===(i=document.getElementById("pageType"))||void 0===i?void 0:i.value,r=document.getElementById("assetPath"),l=null==r?void 0:r.value;if(!l)return sessionStorage.removeItem(t),void n(!1);const a="Opus 2 Agnostic Lead Flow Template"===s;(o?o(l):l.split("/").pop()||"").toLowerCase().includes(e.toLowerCase())?(sessionStorage.setItem(t,"true"),n(!0)):(a||sessionStorage.removeItem(t),n(!1))})}function De(){return je("financing","leadFlowFromFinancingPage")}function Me(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{if(!(null==e?void 0:e.franchiseWebLocationMarketingId))return!1;yield function(e,t,o){return(0,n.__awaiter)(this,void 0,void 0,function*(){(0,S.startLoader)();const t=`${i.apiConfig.GET_ATTRIBUTE_DATA}/${e.franchiseWebLocationId}`,s=I.ScheduleService.getInstance();e&&(s.POSObject=e);try{const i=yield(0,c.cachedAPIWrapper)(t,d.apiCaching.FullAttributeResponse);yield null==s?void 0:s.setLocalData(i,""),(null==i?void 0:i.onlineScheduling)?function(e,t){(0,n.__awaiter)(this,void 0,void 0,function*(){(0,S.startLoader)();const o=I.ScheduleService.getInstance();try{const n=o.getRedirectConfigUrl(),i=yield(0,c.getCachedAPIResponse)(n,d.apiCaching.IsnRedirectConfig,!1);(0,S.stopLoader)();const s=i.find(t=>t.franchisee_number===e);s.isnUrl===String.raw`\N`?window.open(t,"_blank"):(o.triggerGTMEvent(s.isnUrl),o.handlePopupWindow(s.isnUrl))}catch(e){(0,S.stopLoader)(),console.error("Error fetching ISN redirect config from CP"),window.open(t,"_blank")}})}(e.franchiseWebLocationMarketingId,o):window.open(o,"_blank"),(0,S.stopLoader)()}catch(t){(0,S.stopLoader)(),console.error(`Error fetching POS systems for weblocationID: ${e.franchiseWebLocationId}`),window.open(o,"_blank")}})}(e,0,o)}catch(e){return console.error("Error in isISNFlow function:",e),!1}})}function qe(e,t,o=8){var n;const i=e.getInfo();if(!i)return;
3const s=i.container.closest(t);if(!s)return;const r=s.querySelector(".tns-nav");if(!r)return;const l=r.querySelectorAll("button"),a=l.length;if(window.innerWidth>=1024||a<=o){for(const e of l)e.classList.remove("hide-dot");return}const d=(null!==(n=i.displayIndex)&&void 0!==n?n:1)-1,c=Math.floor(d/o)*o,u=Math.min(c+o,a);for(const e of l)e.classList.add("hide-dot");for(let e=c;e<u;e++)l[e].classList.remove("hide-dot")}function Re(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,i;if(!t||(null===(o=t.value)||void 0===o?void 0:o.trim()))return;const s=null===(n=document.getElementById("conceptCode"))||void 0===n?void 0:n.value;if(!s)return;const r=yield B(s);if(null==r?void 0:r[e])try{const e=yield navigator.permissions.query({name:"geolocation"});if("granted"===e.state)null===(i=new L.UseMyLocationSearch)||void 0===i||i.getCurrentLocation(null,t);else if("prompt"===e.state){const e=t;navigator.geolocation.getCurrentPosition(()=>{var t;e&&(null===(t=new L.UseMyLocationSearch)||void 0===t||t.getCurrentLocation(null,e))},()=>{console.log("Location permission denied by user")})}}catch(e){console.warn("Permissions API not supported",e)}})}},"./src/js/opus2/util/siteConfig.ts"(e,t,o){"use strict";o.d(t,{getMessagesData:()=>l});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ../config/cachingConfig */"./src/js/opus2/config/cachingConfig.ts"),s=o(/*! ../apiCaching/apiWrapper */"./src/js/opus2/apiCaching/apiWrapper.ts"),r=o(/*! ./share */"./src/js/opus2/util/share.ts");function l(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=yield(0,r.getWeblocationPathGroupWithSiteConfig)();try{if(o){const n=yield(0,s.getCachedAPIResponse)(o,i.apiCaching.SiteConfig,!1);if(n)return localStorage.setItem("siteConfigDisplayClickToCallCta",null!==(e=null==n?void 0:n.displayClickToCallCta)&&void 0!==e&&e),localStorage.setItem("siteConfigHideOSCTA",null!==(t=null==n?void 0:n.hideLocalOsCta)&&void 0!==t&&t),(0,r.setLocalTagLineText)(n),n}}catch(e){return console.error("Error in fetching site config"),{}}})}},"./src/js/opus2/util/specialOffersTimer.ts"(e,t,o){"use strict";o.d(t,{getExitPopupTimerValue:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts");function s(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e,t;const o=null===(e=document.getElementById("conceptCode"))||void 0===e?void 0:e.value;if(!o)return 1e4;const n=yield(0,i.getBrandDetailsFromBrandJson)(o);return 1e3*(null!==(t=null==n?void 0:n.exit_popup_timer_value)&&void 0!==t?t:10)})}},"./src/js/opus2/util/user-info-handler.ts"(e,t,o){"use strict";o.d(t,{UserInfoHandler:()=>c});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./share */"./src/js/opus2/util/share.ts"),s=o(/*! ../constants/regex */"./src/js/opus2/constants/regex.ts"),r=o(/*! ./localizationTag */"./src/js/opus2/util/localizationTag.ts"),l=o(/*! ../../global */"./src/js/global/index.ts"),a=o(/*! ../footer/footer */"./src/js/opus2/footer/footer.ts"),d=o(/*! ./headerSwitch */"./src/js/opus2/util/headerSwitch.ts");class c{constructor(){this.formIds=["referral-form"],this.userDetailsKey="userDetails"}static getInstance(){return c.instance||(c.instance=new c),c.instance}setFormIds(e){this.formIds=e}setUserDetailsKey(e){this.userDetailsKey=e}captureUserInfo(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=new URLSearchParams(globalThis.location.search).get(this.userDetailsKey);for(const t of this.formIds){const o=document.querySelector(`#${t}, .${t}`);if(e&&o)try{const o=this.decodeUserDetails(e);this.isInvalidZipCode(o)||""===o.zipcode||(yield this.fetchFranchiseDetailsAndUpdate(o.zipcode)),this.prefillFormWithUserData(t,o)}catch(e){console.warn(`Error decoding or parsing user details: ${e}`),yield this.addLocalizationAndUpdateHeader()}else yield this.addLocalizationAndUpdateHeader()}})}isInvalidZipCode(e){const t="ca"===(0,i.checkDomain)()?s.REGEX.caSendZip:s.REGEX.sendZip;return""!==e.zipcode&&!t.test(e.zipcode.trim())}prefillFormWithUserData(e,t){const o=this.getFieldMappings(e,t);this.prefillFormFields(o)}decodeUserDetails(e){const t=atob(e);return JSON.parse(t)}getFieldMappings(e,t){return"referral-form"===e?[{id:"my-refer-fname",value:t.firstName,regex:s.REGEX.sendName},{id:"my-refer-lname",value:t.lastName,regex:s.REGEX.sendLname},{id:"my-refer-email",value:t.email,regex:s.REGEX.sendEmail},{id:"my-refer-phone",value:t.phone,regex:s.REGEX.mobileNumberRegex},{id:"my-refer-zip-code",value:t.zipcode,regex:s.REGEX.sendZip}]:[]}formatAndValidatePhone(e){if(!e)return null;const t=e.replace(/\D/g,"");if(10!==t.length)return null;const o=s.REGEX.mobileNumberRegex,n=t.match(o);return n?`(${n[1]}) ${n[2]}-${n[3]}`:null}updateInputValue(e,t){try{const o=document.getElementById(e);o&&null!=t&&(o.value=t.toString())}catch(e){console.warn(`Error in updateInputValue function: ${e}`)}}fetchFranchiseDetailsAndUpdate(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){try{const t=yield(0,i.getFranchiseDetails)(e);t.length>0&&(localStorage.setItem("franchiseWebLocationId",t[0].franchiseWebLocationId),yield this.setLocalDataReferForm(t[0],e))}catch(e){console.warn("Error fetching franchise details:",e)}finally{yield this.addLocalizationAndUpdateHeader()}})}
3prefillFormFields(e){e.forEach(e=>{if(e.regex.test(e.value)){const t=document.getElementById(e.id);if(!t)return;if("my-refer-phone"===e.id){const o=this.formatAndValidatePhone(e.value);return void(o&&(t.value=o))}t&&(t.value=e.value)}})}setLocalDataReferForm(e,t){return(0,n.__awaiter)(this,void 0,void 0,function*(){var o,n,s;if(e){const{franchiseWebLocationId:l,doingBusinessAs:d,locationWebsiteUrl:c,websiteTracking:u}=e;localStorage.setItem("franchiseWebLocationId",l),sessionStorage.setItem("franchiseId",l),localStorage.setItem("doingBusinessAs",d),sessionStorage.setItem("redirectionURL",c),localStorage.setItem("weblocationId",l);const m=null!==(o=null==c?void 0:c.replace(/\/$/,""))&&void 0!==o?o:"",h=m.toLowerCase().split("/"),p=h[h.length-1];(0,i.handleCrossDomainLink)(m),localStorage.setItem("localPhoneNumber",u);const v=document.querySelector(".header-wrapper .form-call-cta");if(v){v.href=`tel:${u}`;const e=/(\d{0,3})(\d{0,3})(\d{0,4})/,t=null===(n=String(u))||void 0===n?void 0:n.replace(/\D/g,"").match(e);v.innerHTML=`(${t[1]}) ${t[2]}-${t[3]}`}const g=document.querySelector(".header-cta-mobile .primary-btn");g&&(g.href=`tel:${u}`),p&&(localStorage.setItem("dbaName",p),(0,r.localizationTagUpadation)()),this.updateInputValue("local_weblocationId",l),this.updateInputValue("weblocationId",l),this.updateInputValue("full_dbaName",p),this.updateInputValue("dbaName",p);const f=document.querySelector(".header-wrapper .address"),y=document.querySelector(".header-wrapper .description");d&&(0,i.updateHeaderContent)(d),f&&y&&(f.innerHTML=d,(0,r.localizationTagLine)());const b=null===(s=document.getElementById("user-service-address"))||void 0===s?void 0:s.value;sessionStorage.setItem("manualEnteredAddress",b+", "+t),sessionStorage.setItem("RL_Weblocation_ID",l),sessionStorage.setItem("RL_DBAName",d),this.hideGlobalBrandElements(),a.Footer.init()}})}hideGlobalBrandElements(){const e=document.querySelector(".brand-header .brand-logo-wrapper"),t=document.querySelector(".brand-header .find-local");e&&(e.style.display="none"),t&&(t.style.display="none")}addLocalizationAndUpdateHeader(){return(0,n.__awaiter)(this,void 0,void 0,function*(){yield(0,l.addLocalizationHeaderMenuLocal)(),d.HeaderSwitch.getInstance()})}}},"./src/js/opus2/util/versionControl.ts"(e,t,o){"use strict";o.d(t,{attachVersionPrinterToWindow:()=>s});var n=o(/*! tslib */"./node_modules/tslib/tslib.es6.mjs"),i=o(/*! ./purgeCache */"./src/js/opus2/util/purgeCache.ts");function s(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){const e=".env.production",t="production";let o=[],s=null,r=null,l={},a=[];try{o=function(){var e,t;try{const o=[],n=document.documentElement.outerHTML;(null===(t=null===(e=n.split('<style id="required">')[1])||void 0===e?void 0:e.split("</style>")[0])||void 0===t?void 0:t.split("\n")).forEach(e=>{var t,n;const i=null===(n=null===(t=e.split("*/")[0])||void 0===t?void 0:t.split("/*!*")[1])||void 0===n?void 0:n.trim();i&&o.push(i.replace(" ",": "))});const i=function(e){const t=/<link[^>]+href=["'][^"']*scheduler\/index\.(\d+\.\d+\.\d+(?:-[a-zA-Z0-9-]*)?)\.js["'][^>]*>/g.exec(e);return(null==t?void 0:t[1])?`Agnostic: ${t[1]}`:null}(n);return i&&o.push(i),o}catch(e){return console.error("[Ver] Failed to extract assets from page",e),[]}}(),s=function(e){const t=e.find(e=>e.startsWith("Agnostic:"));if(t)return t.slice(9).trim()||null;return null}(o),s&&(o=o.filter(e=>!e.toLowerCase().startsWith("agnostic:")&&!e.toLowerCase().startsWith("agnostic"))),r="ad8092ef6";l=function(e){const t=performance.getEntriesByType("resource"),o={};for(const n of e)o[n]=t.some(e=>e.name.includes(n));return o}(["convertexperiments.com","here.com","datadoghq-browser-agent.com"]),a=yield function(){return(0,n.__awaiter)(this,void 0,void 0,function*(){var e;if(!(null===(e=null===window||void 0===window?void 0:window.convert)||void 0===e?void 0:e.activeLocations))return[];try{return yield window.convert.activeLocations}catch(e){return console.error("[Ver] Failed to get Convert active locations:",e),[]}})}()}catch(e){console.error("[Ver] Failed to get version info:",e)}return function(e){return(0,n.__awaiter)(this,void 0,void 0,function*(){var t,o;if(function(){try{const e=localStorage.getItem("lastAutoPurgeTime");if(e){const t=new Date(e),o=(new Date).getTime()-t.getTime();if(o/36e5<24)return!0;localStorage.removeItem("lastAutoPurgeTime")}}catch(e){console.warn("[Ver] Could not access localStorage:",e)}return!1}())return;if(!e)return;const n=`/brand/_assets/js/opus2-build-manifest.json?${Date.now()}`,s=null!==(t=yield fetch(n).then(e=>e.json()).then(e=>e.buildVersion).catch(()=>"remoteVerNotFound"))&&void 0!==t?t:"remoteVerNotFound",r=null!==(o=e.jsVersion)&&void 0!==o?o:"localVerNotFound";s.includes(r)||r.includes(s)||(0,i.clearCacheIfOnline)(),function(){try{localStorage.setItem("lastAutoPurgeTime",(new Date).toISOString())}catch(e){console.warn("[Ver] Could not set last purge time:",e)}}()})}({envFilePath:e,buildEnv:t,cssVersions:o,agnosticVersion:s,jsVersion:r,externalScriptsLoaded:l,convertExperiments:a}).catch(e=>{console.error("[Ver] Failed to match versions:",e)}),{envFilePath:e,buildEnv:t,cssVersions:o,agnosticVersion:s,jsVersion:r,externalScriptsLoaded:l,convertExperiments:a}})}();window.versionDetail=e,console.log("[Ver] Version info:",e)})}},"./src/js/opus2/util/virtualDom.ts"(e,t,o){"use strict";function n(e){if(null==e)return null;if("string"==typeof e)return document.createTextNode(e);const t=document.createElement(e.type);
3if(e.props&&Object.keys(e.props).forEach(o=>{if(o.startsWith("on")){const n=o.slice(2).toLowerCase();"function"==typeof e.props[o]&&(t.addEventListener(n,e.props[o]),t._listeners=t._listeners||{},t._listeners[n]=e.props[o])}else null!==e.props[o]&&void 0!==e.props[o]&&t.setAttribute(o,e.props[o])}),e.children&&Array.isArray(e.children)){e.children.filter(e=>null!=e&&""!==e).map(n).filter(e=>null!==e).forEach(e=>t.appendChild(e))}return t}function i(e,t){t&&Object.keys(t).forEach(t=>{var o;if(t.startsWith("on")){const n=t.slice(2).toLowerCase(),i=null===(o=e._listeners)||void 0===o?void 0:o[n];i&&e.removeEventListener(n,i)}})}function s(e){return"string"!=typeof e}function r(e,t,o,l=0){const a=e.childNodes[l];var d,c,u,m;o?t?typeof(d=t)!=typeof(c=o)||"string"==typeof d&&d!==c||s(d)&&s(c)&&d.type!==c.type||s(d)&&s(c)&&(null===(u=d.props)||void 0===u?void 0:u.key)!==(null===(m=c.props)||void 0===m?void 0:m.key)?function(e,t,o){const i=n(o);i&&t&&e.replaceChild(i,t)}(e,a,t):s(t)&&s(o)&&a&&function(e,t,o,n){(function(e,t){const o=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of o)if(e[n]!==t[n])return!0;return!1})(o.props,n.props)&&(s=t,l=o.props,a=n.props,Object.keys(l).forEach(e=>{var t;if(!a[e])if(e.startsWith("on")){const o=e.slice(2).toLowerCase(),n=null===(t=s._listeners)||void 0===t?void 0:t[o];n&&s.removeEventListener(o,n)}else s.removeAttribute(e)}),Object.keys(a).forEach(e=>{if(a[e]!==l[e])if(e.startsWith("on")){const t=e.slice(2).toLowerCase();"function"==typeof a[e]&&(s.addEventListener(t,a[e]),s._listeners=s._listeners||{},s._listeners[t]=a[e])}else null!==a[e]&&void 0!==a[e]&&s.setAttribute(e,a[e])}));var s,l,a;!function(e,t,o){const n=Math.max(t.length,o.length);for(let s=0;s<n;s++)if(s<o.length)r(e,o[s],t[s],s);else if(s>=o.length&&s<t.length){const o=e.childNodes[s];o&&(i(o,t[s].props),e.removeChild(o))}}(t,o.children,n.children)}(0,a,o,t):function(e,t,o){t&&(i(t,o.props),e.removeChild(t))}(e,a,o):function(e,t){const o=n(t);if(o){if("ul"===e.tagName.toLowerCase()&&o instanceof HTMLElement&&"ul"===o.tagName.toLowerCase()){return void Array.from(o.children).filter(e=>"li"===e.tagName.toLowerCase()).forEach(t=>{e.appendChild(t)})}e.appendChild(o)}}(e,t)}function l(e){return function e(t){const o=t.tagName.toLowerCase(),n={};Array.from(t.attributes).forEach(e=>{n[e.name]=e.value});const i=[];return t.childNodes.forEach(t=>{var o;t.nodeType===Node.TEXT_NODE?i.push(null!==(o=t.textContent)&&void 0!==o?o:""):t.nodeType===Node.ELEMENT_NODE&&i.push(e(t))}),{type:o,props:n,children:i}}((new DOMParser).parseFromString(e,"text/html").body.firstChild)}o.d(t,{parseDOMString:()=>l,updateVDomElement:()=>r})}};const t={};function o(n){const i=t[n];if(void 0!==i)return i.exports;const s=t[n]={id:n,loaded:!1,exports:{}};if(!(n in e)){delete t[n];const e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}return e[n].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=e,(()=>{const e=[];o.O=(t,n,i,s)=>{if(n){s=s||0;for(var r=e.length;r>0&&e[r-1][2]>s;r--)e[r]=e[r-1];return void(e[r]=[n,i,s])}let l=1/0;for(r=0;r<e.length;r++){let[n,i,s]=e[r],d=!0;for(var a=0;a<n.length;a++)(!1&s||l>=s)&&Object.keys(o.O).every(e=>o.O[e](n[a]))?n.splice(a--,1):(d=!1,s<l&&(l=s));if(d){e.splice(r--,1);const o=i();void 0!==o&&(t=o)}}return t}})(),o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],s=t[n++];o.o(e,i)?0===s&&n++:0===s?Object.defineProperty(e,i,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:s})}else for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce((t,n)=>(o.f[n](e,t),t),[])),o.u=e=>"o2/opus2."+e+"."+{"redirect-guard":"96a99a58a0e2a4251d4e","gift-certificate-image-loader":"44967b439743ad35f139","insurance-form-loader":"2aa33a0bf78f9e681f8d","customer-financing-loader":"99938abbeaf17dd5c7b9","insurance-confirmation-loader":"940a7fdc7b2fe5df7bc2","finance-form-loader":"a092da4cdfbe271b9957","refer-form-loader":"233c85a03af20b722269","reward-form-loader":"3b7e11073cd527f30aa7","reward-confirmation-loader":"054fd8970a2b96addb7c","askquestion-form-loader":"d10561be73483f086ee9","whitepaper-form-loader":"0f5e0172c6e7b30f61b9","clientCarousel-loader":"52bdcc7261ef60ccaa4d","authorprofile-loader":"8a855f837e885a387427","process-component-loader":"c2bda6d6cf252c8c2d6e","calculator-component-loader":"425387b3ca33dc061c9b","dripcalculator-component-loader":"90bd733e8f8726445030","deckcalculator-component-loader":"a59f992ae072c515e06e","media-injector-loader":"cab26020be0b80db9292","youtube-init-loader":"1045f23890c34929d988","inspiration-gallery-loader":"cc98eb5db7863a30f348","photogallery2-loader":"519653cdcd0538e4bbef","offers-landing-loader":"021d9b067e75a9d5838e","offers-teaser
3-loader":"2ea8ecb57da4e888b682","special-offer-popup-loader":"9ff49ebc4b619801d718","getgiftcard-loader":"7df0d5ca22ab7f13d71e","blog-ai-summary-loader":"464f168788fd37d6cfbd","blog-loader":"4c8a44bca6550c82845d","ai-share-toggle-loader":"b3c5615b2445421409f7","hero-component-loader":"08757f8ccb8dd0f54437","mobile-contact-us-loader":"d86b8f8b268b1b8b7578","print-offer-loader":"19228b97f5dd81cc3c52","banner-manager-loader":"b319cbecfdf20f9c9695","form-handler-loader":"4f51a6541936593ed58b","hours-of-operation-loader":"086ff881be6b48791e25","donation-loader":"962c8110e902f5abbea8","gift-purchase-loader":"510623a72929033fa9bb","gift-recipient-loader":"e30118379b8ceab0deae","gift-confirmation-loader":"f297bf3a691a927a97af","unsubscribe-form-loader":"b1d8b2957321ac8643d8","google-preferred-badge-loader":"d8fa7d7ded5f570588e3","share-google-cta-placement-loader":"9398eb4baef7dc332747","neighborly-app-module":"5d0ab51770e766c1f9b4","search-service-module":"fb7ef9da6bf5b420cc7c","mrelectricform-loader":"5503b3b70afe86b09f64","service-list-module":"d4bfc6e02a0c5550dc25","header-menu-config-loader":"7a999a495fcc19969b45","display-address-loader":"eeca89696586f4a7a877","storage-manager-loader":"1611316d8ec9bfa135f6","brand-logo-loader":"28097e4462345245471a","location-map-app-loader":"292ada01b296e6e21055","marketing-landing-loader":"341ba97afa97b0040b95","marketing-page-loader":"769619e9ad7970c2d498","our-team-loader":"44543f47e22ed1cbcf96",textToSpeech:"33ffdb1c267e783cdc4a","testimonial-vdom":"cbd17515671a62be4a52","testimonial-rocket":"e89cd7945befe11c875b"}[e]+".js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="crownpeak-opus2:";o.l=(n,i,s,r)=>{if(e[n])return void e[n].push(i);let l,a;if(void 0!==s){const e=document.getElementsByTagName("script");for(var d=0;d<e.length;d++){const o=e[d];if(o.getAttribute("src")==n||o.getAttribute("data-webpack")==t+s){l=o;break}}}l||(a=!0,l=document.createElement("script"),l.charset="utf-8",o.nc&&l.setAttribute("nonce",o.nc),l.setAttribute("data-webpack",t+s),l.src=n),e[n]=[i];const c=(t,o)=>{l.onerror=l.onload=null,clearTimeout(u);const i=e[n];if(delete e[n],l.parentNode?.removeChild(l),i?.forEach(e=>e(o)),t)return t(o)},u=setTimeout(c.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=c.bind(null,l.onerror),l.onload=c.bind(null,l.onload),a&&document.head.appendChild(l)}})(),o.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.dn=e=>{(Object.getOwnPropertyDescriptor(e,"name")||{}).writable||Object.defineProperty(e,"name",{value:"default",configurable:!0})},o.p="/brand/_assets/js/",(()=>{const e={opus2:0};o.f.j=(t,n)=>{let i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{const s=new Promise((o,n)=>i=e[t]=[o,n]);n.push(i[2]=s);const r=o.p+o.u(t),l=new Error,a=n=>{if(o.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){const e=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+e+": "+o+")",l.name="ChunkLoadError",l.type=e,l.request=o,i[1](l)}};o.l(r,a,"chunk-"+t,t)}},o.O.j=t=>0===e[t];const t=(t,n)=>{let[i,s,r]=n;var l,a,d=0;if(i.some(t=>0!==e[t])){for(l in s)o.o(s,l)&&(o.m[l]=s[l]);if(r)var c=r(o)}for(t&&t(n);d<i.length;d++)a=i[d],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(c)},n=self.webpackChunkcrownpeak_opus2=self.webpackChunkcrownpeak_opus2||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();let n=o.O(void 0,["vendor"],()=>o("./src/js/index-pilot.ts"));n=o.O(n)})(); 4//# sourceMappingURL=opus2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.