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F,IAcA3H,SAASH,iBAAiB,gBAAgB,SAAC+H,GAAI,OAZ/C,SAA0BA,GACxB,IAQsBC,EARlB/B,EAAK8B,EAAKjH,OAAOC,SACjBuF,GAOkB0B,EAPI/B,EAAIE,EAQlBW,MAAK,SAACmB,GAAG,OAAKA,EAAIhC,GAAGiC,WAAWF,EAAS,IAAI,KAPzDnI,EAAOlB,cAAc,QAAQ+B,YAAc4F,EAAK3F,MAChD2G,EAAgBrH,UAAUM,OAAO,QACjCV,EAAOI,UAAUM,OAAO,UACxBV,EAAOqH,aAAa,gBAAiB,QACvC,CAMEiB,CAAiBJ,EAAK,IAGxBT,EAAgBD,YAAYE,GAC5B3H,EAASyH,YAAYC,GACrBxH,EAAQuH,YAAYzH,GACpB+G,EAAgByB,YAAYtI,GAC5BD,EAAOG,iBAAiB,SAAS,SAACI,GAChCA,EAAEiI,kBACF,IAAMC,EAAoD,SAAzCzI,EAAOb,aAAa,iBACrCa,EAAOqH,aAAa,kBAAmBoB,GAAUC,YACjDjB,EAAgBrH,UAAUC,OAAO,QAASoI,GAC1CzI,EAAOI,UAAUC,OAAO,UAAWoI,EACrC,IACAnI,SAASH,iBAAiB,SAAS,SAACI,GAC7BN,EAAQO,SAASD,EAAEE,UACtBgH,EAAgBrH,UAAUM,OAAO,QACjCV,EAAOI,UAAUM,OAAO,UACxBV,EAAOqH,aAAa,gBAAiB,SAEzC,GACF,CAWEsB,CACErC,EACAH,EAAQpH,oBACRoH,EAAQ7G,cAKd,I,gFAAC,CAzegB,E","sources":["webpack://@hero-digital/zoom/./src/components/product-hub-components/pricing-cards-v1/pricing-cards-v1.js"],"sourcesContent":["class PricingCardV1 {\r\n constructor(el) {\r\n this.el = el\r\n this.switches = this.el.querySelectorAll('input[name=\"zdcm-pricing-switch\"]')\r\n this.indicator = this.el.querySelector('.zdcm-indicator')\r\n this.currencyPlaceHolder = this.el.querySelector(\r\n '.fdn-zdcm-plan-currency-placeholder'\r\n )\r\n\r\n this.ul = this.el.querySelector('ul')\r\n this.isSwiperRequiredOnMobile = this.isMobileCarousel = this.el.getAttribute('data-mobile-carousel') === '1'\r\n this.monthlyPrices = this.el.querySelectorAll('[data-price=\"0\"]')\r\n this.annualPrices = this.el.querySelectorAll('[data-price=\"1\"], [data-price=\"2\"]');\r\n this.currencyLabel = this.apiUrl = this.el.dataset.currencyLabel\r\n this.monthlyCTAs = this.el.querySelectorAll('.fdn-zdcm-buy:nth-of-type(1)')\r\n this.annualCTAs = this.el.querySelectorAll('.fdn-zdcm-buy:nth-of-type(2)')\r\n this.monthlyCTAs = this.el.querySelectorAll('.fdn-zdcm-pricing-card-content-body[data-price]:not([data-price=\"-1\"]) .fdn-zdcm-buy:nth-of-type(1)')\r\n this.annualCTAs = this.el.querySelectorAll('.fdn-zdcm-pricing-card-content-body[data-price]:not([data-price=\"-1\"]) .fdn-zdcm-buy:nth-of-type(2)')\r\n this.domMap = {\r\n $swiper: el.querySelector('.fdn-zdcm-pricing-cards .swiper'),\r\n $slides: el.querySelectorAll(\r\n '.fdn-zdcm-pricing-cards .zdcm-resources-carousel .zdcm-resources'\r\n ),\r\n $slide: el.querySelectorAll('.fdn-zdcm-pricing-cards .swiper-slide')\r\n }\r\n\r\n const dropdown = this.el.querySelector('.fdn-currency-dropdown')\r\n if (dropdown) {\r\n const button = dropdown.querySelector('button')\r\n const wrapper = dropdown.querySelector('.fdn-currency-dropdown-wrapper')\r\n const radioInputs = dropdown.querySelectorAll('input[type=\"radio\"]')\r\n\r\n button.addEventListener('click', () => {\r\n wrapper.classList.toggle('open')\r\n button.classList.toggle('active')\r\n })\r\n\r\n document.addEventListener('click', (e) => {\r\n if (!dropdown.contains(e.target)) {\r\n wrapper.classList.remove('open')\r\n button.classList.remove('active')\r\n }\r\n })\r\n\r\n radioInputs.forEach((input) => {\r\n input.addEventListener('change', (e) => {\r\n const span = button.querySelector('span')\r\n span.textContent = e.target.value\r\n\r\n wrapper.classList.remove('open')\r\n button.classList.remove('active')\r\n\r\n this.el.dispatchEvent(\r\n new CustomEvent('currency:changed', {\r\n detail: { currency: e.target.value }\r\n })\r\n )\r\n })\r\n })\r\n\r\n const checkedCurrency = dropdown.querySelector(\r\n 'input[type=\"radio\"]:checked'\r\n )\r\n if (checkedCurrency) {\r\n const span = button.querySelector('span')\r\n span.textContent = checkedCurrency.value\r\n }\r\n }\r\n this.swiper = null\r\n this.handleResize = this.handleResize.bind(this)\r\n window.addEventListener('resize', () => {\r\n setTimeout(this.handleResize, 300)\r\n })\r\n this.init()\r\n this.syncCurrencyDropdown()\r\n requestAnimationFrame(() => {\r\n setTimeout(() => {\r\n this.initFeaturesSlide();\r\n }, 0);\r\n });\r\n window.addEventListener(\"load\", () => {\r\n this.initAfterpageLoad()\r\n });\r\n }\r\n\r\n init() {\r\n this.switches.forEach((checkbox) => {\r\n if(checkbox.checked) {\r\n this.showAnnually()\r\n } else {\r\n this.showMonthly()\r\n }\r\n })\r\n\r\n // Add change event listener to each switch\r\n this.switches.forEach((checkbox) => {\r\n checkbox.addEventListener('change', () => {\r\n // Find the label element wrapping this checkbox\r\n const label = checkbox.closest('.zdcm-switch')\r\n // Get the plan label span (you might need to adjust this selector if you have many switches)\r\n const labelText = label.nextElementSibling; // assumes the span is right after the label\r\n if(checkbox.checked) {\r\n this.showAnnually()\r\n if (labelText) {\r\n labelText.textContent = label.dataset.labelAnnual\r\n }\r\n } else {\r\n this.showMonthly()\r\n if (labelText) {\r\n labelText.textContent = label.dataset.labelMonth\r\n }\r\n }\r\n this.setFeaturesHeight()\r\n this.reinitiateSlide()\r\n })\r\n })\r\n \r\n this.handleResize()\r\n }\r\n\r\n initAfterpageLoad() {\r\n const cards = this.el\r\n if (cards) {\r\n cards.style.opacity = '1';\r\n }\r\n }\r\n \r\n initFeaturesSlide() {\r\n const titles = this.el.querySelectorAll('.fdn-zdcm-features-title')\r\n let isDesktop = window.innerWidth > 1024\r\n let maxHeight = 0\r\n\r\n // Step 1: Calculate max scrollHeight of all content sections\r\n titles.forEach((title) => {\r\n const content = title.nextElementSibling\r\n\r\n // Temporarily set to auto to measure true scrollHeight\r\n const originalHeight = content.style.height\r\n content.style.height = 'auto'\r\n const height = content.scrollHeight\r\n content.style.height = originalHeight\r\n\r\n if (height > maxHeight) {\r\n maxHeight = height\r\n }\r\n })\r\n\r\n // Step 2: Apply fixed height to all content sections\r\n if (isDesktop) {\r\n titles.forEach((title) => {\r\n const content = title.nextElementSibling\r\n content.style.height = maxHeight + 'px' // ✅ Fixed height\r\n content.style.overflow = 'hidden'\r\n content.style.transition = 'height 0.3s ease'\r\n title.classList.add('features-open')\r\n });\r\n }\r\n\r\n // Step 3: Setup click behavior\r\n titles.forEach((title) => {\r\n const content = title.nextElementSibling\r\n\r\n title.addEventListener('click', function () {\r\n const isOpen = content.style.height && content.style.height !== '0px'\r\n title.classList.toggle(\"features-open\")\r\n\r\n if (isOpen) {\r\n content.style.height = maxHeight + 'px' // Reset before collapsing\r\n requestAnimationFrame(() => {\r\n content.style.height = '0'\r\n })\r\n } else {\r\n content.style.height = maxHeight + 'px'\r\n const afterExpand = () => {\r\n // Keep height fixed\r\n content.removeEventListener('transitionend', afterExpand);\r\n }\r\n\r\n content.addEventListener('transitionend', afterExpand);\r\n }\r\n })\r\n })\r\n\r\n // Step 4: Responsive behavior\r\n const handleDesktopResize = () => {\r\n this.setFeaturesHeight()\r\n\r\n const nowDesktop = window.innerWidth > 1024\r\n\r\n if (!nowDesktop && isDesktop) {\r\n titles.forEach((title) => {\r\n if (title.classList.contains('features-open')) {\r\n title.click()\r\n }\r\n const content = title.nextElementSibling;\r\n content.style.height = '0' // Collapse on mobile\r\n });\r\n }\r\n\r\n if (nowDesktop && !isDesktop) {\r\n titles.forEach((title) => {\r\n if (!title.classList.contains('features-open')) {\r\n title.click()\r\n }\r\n })\r\n }\r\n\r\n isDesktop = nowDesktop;\r\n};\r\n\r\n// Attach debounced resize handler\r\nwindow.addEventListener('resize', this.debounce(handleDesktopResize, 500))\r\n}\r\n\r\ndebounce(fn, delay) {\r\n let timeoutId;\r\n return function (...args) {\r\n clearTimeout(timeoutId);\r\n timeoutId = setTimeout(() => fn.apply(this, args), delay);\r\n };\r\n}\r\n\r\nsetFeaturesHeight() {\r\n const titles = this.el.querySelectorAll('.fdn-zdcm-features-title')\r\n let isDesktop = window.innerWidth > 1024\r\n let maxHeight = 0\r\n\r\n // Step 1: Calculate max scrollHeight of all content sections\r\n titles.forEach((title) => {\r\n const content = title.nextElementSibling\r\n\r\n // Temporarily set to auto to measure true scrollHeight\r\n const originalHeight = content.style.height\r\n content.style.height = 'auto'\r\n const height = content.scrollHeight\r\n content.style.height = originalHeight\r\n\r\n if (height > maxHeight) {\r\n maxHeight = height\r\n }\r\n\r\n if (isDesktop) {\r\n titles.forEach((title) => {\r\n const content = title.nextElementSibling\r\n content.style.height = maxHeight + 'px' // ✅ Fixed height\r\n content.style.overflow = 'hidden'\r\n content.style.transition = 'height 0.3s ease'\r\n title.classList.add('features-open')\r\n });\r\n }\r\n })\r\n}\r\n\r\n reinitiateSlide () {\r\n const titles = document.querySelectorAll('.fdn-zdcm-features-title')\r\n let isDesktop = window.innerWidth > 1024;\r\n titles.forEach(function (title) {\r\n const content = title.nextElementSibling\r\n title.classList.remove(\"features-open\")\r\n content.style.height = 0\r\n if (isDesktop) {\r\n title.click()\r\n }\r\n })\r\n }\r\n\r\n initSwiper() {\r\n const { $swiper } = this.domMap\r\n this.swiper = new Swiper($swiper, {\r\n autoHeight: false,\r\n spaceBetween: 20,\r\n centeredSlides: true, // If you want the slide to be centered\r\n initialSlide: 1, // this shows the 2nd slide\r\n slidesPerView: 1.5,\r\n navigation: {\r\n nextEl: this.el.querySelector(\r\n '.fdn-zdcm-pricing-cards .swiper-button-next'\r\n ),\r\n prevEl: this.el.querySelector(\r\n '.fdn-zdcm-pricing-cards .swiper-button-prev'\r\n )\r\n },\r\n pagination: {\r\n el: this.el.querySelector('.fdn-zdcm-pricing-cards .swiper-pagination'),\r\n clickable: true\r\n },\r\n breakpoints: {\r\n 768: { slidesPerView: 2, loop: false },\r\n 1024: { slidesPerView: 3, loop: false }\r\n }\r\n })\r\n }\r\n\r\n destroySwiper() {\r\n if (this.swiper) {\r\n this.swiper.destroy(true, true)\r\n this.swiper = null\r\n }\r\n }\r\n\r\n handleResize() {\r\n const viewportWidth = window.innerWidth\r\n const prevBtn = this.el.querySelector('.swiper-button-prev')\r\n const nextBtn = this.el.querySelector('.swiper-button-next')\r\n const isSwiperRequiredOnMobile = this.isSwiperRequiredOnMobile\r\n\r\n if ((isSwiperRequiredOnMobile && viewportWidth < 768) || \r\n (viewportWidth >= 768 && viewportWidth <= 1024)) {\r\n if (!this.swiper && this.domMap.$slides != null) {\r\n if (prevBtn) prevBtn.style.display = 'flex'\r\n if (nextBtn) nextBtn.style.display = 'flex'\r\n this.initSwiper()\r\n }\r\n } else {\r\n this.destroySwiper()\r\n if (prevBtn) prevBtn.style.display = 'none'\r\n if (nextBtn) nextBtn.style.display = 'none'\r\n }\r\n this.reinitiateSlide()\r\n }\r\n\r\n showMonthly() {\r\n this.monthlyPrices.forEach((el) => {\r\n el.classList.remove('hidden')\r\n el.removeAttribute(\"style\")\r\n })\r\n this.annualPrices.forEach((el) => {\r\n el.classList.add('hidden')\r\n el.removeAttribute(\"style\")\r\n })\r\n\r\n this.monthlyCTAs.forEach((el) => el.classList.remove('hidden'))\r\n this.annualCTAs.forEach((el) => el.classList.add('hidden'))\r\n }\r\n\r\n showAnnually() {\r\n this.monthlyPrices.forEach((el) => {\r\n el.classList.add('hidden')\r\n el.removeAttribute(\"style\")\r\n })\r\n this.annualPrices.forEach((el) => {\r\n el.classList.remove('hidden')\r\n el.removeAttribute(\"style\")\r\n })\r\n\r\n this.monthlyCTAs.forEach((el) => el.classList.add('hidden'))\r\n this.annualCTAs.forEach((el) => el.classList.remove('hidden'))\r\n }\r\n\r\n syncCurrencyDropdown() {\r\n function getCurrenciesFromOldDropdown(id) {\r\n const items = document.querySelectorAll(\r\n '#js-currency-content .zdcm-module-footer-dropdown__item'\r\n )\r\n\r\n if (!items.length) {\r\n return []\r\n }\r\n\r\n const currencies = Array.from(items).map((item) => {\r\n const btn = item.querySelector('button')\r\n return {\r\n id: item.id + '_' + id,\r\n value: item.getAttribute('data-currency-value'),\r\n country: item.getAttribute('data-country-value'),\r\n label: btn?.textContent.trim() || '',\r\n active: btn?.classList.contains('active')\r\n }\r\n })\r\n\r\n return currencies\r\n }\r\n\r\n function buildNewDropdown(currencies, targetContainer, currencyLabel) {\r\n const wrapper = document.createElement('div')\r\n wrapper.className = 'fdn-zdcm-plan-currency'\r\n\r\n const dropdown = document.createElement('div')\r\n dropdown.className = 'fdn-currency-dropdown'\r\n\r\n const active = currencies.find((c) => c.active) || currencies[0]\r\n\r\n const button = document.createElement('button')\r\n button.type = 'button'\r\n button.name = 'currency'\r\n button.setAttribute('aria-expanded', 'false')\r\n button.innerHTML = `${currencyLabel} ${\r\n active?.value || '???'\r\n }`\r\n\r\n dropdown.appendChild(button)\r\n\r\n const dropdownWrapper = document.createElement('div')\r\n dropdownWrapper.className = 'fdn-currency-dropdown-wrapper'\r\n\r\n const fieldset = document.createElement('fieldset')\r\n const legend = document.createElement('legend')\r\n legend.className = 'visually-hidden'\r\n legend.textContent = 'Currency Selection'\r\n fieldset.appendChild(legend)\r\n\r\n const inputMap = {}\r\n\r\n currencies.forEach((curr) => {\r\n const optionDiv = document.createElement('div')\r\n optionDiv.className = 'fdn-currency-option'\r\n\r\n const input = document.createElement('input')\r\n input.type = 'radio'\r\n input.className = 'checkbox-currency'\r\n input.id = curr.id\r\n input.value = curr.value\r\n input.name = 'currency'\r\n if (curr.active) input.checked = true\r\n\r\n inputMap[curr.id] = input\r\n\r\n const label = document.createElement('label')\r\n label.setAttribute('for', curr.id)\r\n label.textContent = curr.value\r\n\r\n optionDiv.appendChild(input)\r\n optionDiv.appendChild(label)\r\n fieldset.appendChild(optionDiv)\r\n\r\n input.addEventListener('click', () => {\r\n let currency = curr?.id?.split('_')[0]\r\n document.dispatchEvent(\r\n new CustomEvent('currencySync', {\r\n detail: { currency },\r\n bubbles: true\r\n })\r\n )\r\n })\r\n })\r\n\r\n function onChangeCurrency(data) {\r\n let id = data.detail.currency\r\n let item = findByIdPrefix(id, currencies)\r\n button.querySelector('span').textContent = item.value\r\n dropdownWrapper.classList.remove('open')\r\n button.classList.remove('active')\r\n button.setAttribute('aria-expanded', 'false')\r\n }\r\n\r\n function findByIdPrefix(prefix, list) {\r\n return list.find((obj) => obj.id.startsWith(prefix + '_'))\r\n }\r\n document.addEventListener('currencySync', (data) =>\r\n onChangeCurrency(data)\r\n )\r\n\r\n dropdownWrapper.appendChild(fieldset)\r\n dropdown.appendChild(dropdownWrapper)\r\n wrapper.appendChild(dropdown)\r\n targetContainer.replaceWith(wrapper)\r\n button.addEventListener('click', (e) => {\r\n e.stopPropagation()\r\n const expanded = button.getAttribute('aria-expanded') === 'true'\r\n button.setAttribute('aria-expanded', (!expanded).toString())\r\n dropdownWrapper.classList.toggle('open', !expanded)\r\n button.classList.toggle('active', !expanded)\r\n })\r\n document.addEventListener('click', (e) => {\r\n if (!wrapper.contains(e.target)) {\r\n dropdownWrapper.classList.remove('open')\r\n button.classList.remove('active')\r\n button.setAttribute('aria-expanded', 'false')\r\n }\r\n })\r\n }\r\n\r\n function init(context) {\r\n const currencies = getCurrenciesFromOldDropdown(\r\n context.el.getAttribute('data-id')\r\n )\r\n\r\n if (!currencies.length) {\r\n return\r\n }\r\n\r\n buildNewDropdown(\r\n currencies,\r\n context.currencyPlaceHolder,\r\n context.currencyLabel\r\n )\r\n }\r\n\r\n init(this)\r\n }\r\n}\r\n\r\nexport default PricingCardV1\r\n"],"names":["PricingCardV1","el","_this","_classCallCheck","this","switches","querySelectorAll","indicator","querySelector","currencyPlaceHolder","ul","isSwiperRequiredOnMobile","isMobileCarousel","getAttribute","monthlyPrices","annualPrices","currencyLabel","apiUrl","dataset","monthlyCTAs","annualCTAs","domMap","$swiper","$slides","$slide","dropdown","button","wrapper","radioInputs","addEventListener","classList","toggle","document","e","contains","target","remove","forEach","input","textContent","value","dispatchEvent","CustomEvent","detail","currency","checkedCurrency","swiper","handleResize","bind","window","setTimeout","init","syncCurrencyDropdown","requestAnimationFrame","initFeaturesSlide","initAfterpageLoad","key","_this2","checkbox","checked","showAnnually","showMonthly","label","closest","labelText","nextElementSibling","labelAnnual","labelMonth","setFeaturesHeight","reinitiateSlide","cards","style","opacity","_this3","titles","isDesktop","innerWidth","maxHeight","title","content","originalHeight","height","scrollHeight","overflow","transition","add","isOpen","afterExpand","removeEventListener","debounce","nowDesktop","click","fn","delay","timeoutId","_this4","_len","arguments","length","args","Array","_key","clearTimeout","apply","Swiper","autoHeight","spaceBetween","centeredSlides","initialSlide","slidesPerView","navigation","nextEl","prevEl","pagination","clickable","breakpoints","loop","destroy","viewportWidth","prevBtn","nextBtn","display","initSwiper","destroySwiper","removeAttribute","context","id","items","currencies","from","map","item","btn","country","trim","active","targetContainer","createElement","className","find","c","type","name","setAttribute","innerHTML","concat","appendChild","dropdownWrapper","fieldset","legend","inputMap","curr","optionDiv","_curr$id","split","bubbles","data","prefix","obj","startsWith","onChangeCurrency","replaceWith","stopPropagation","expanded","toString","buildNewDropdown"],"sourceRoot":""}