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AAS,CACdF,IAAKF,EACLK,SAAU,UAEd,CACF,IAEAxC,EAAA,8BACwB,WACtB,IAAMyC,EAAc3C,EAAKD,GAAG6C,cAAc,kBACpCC,EAAgB7C,EAAKD,GAAG6C,cAAc,oBACtCE,EAAqB9C,EAAKD,GAAG6C,cACjC,gCAGF,GAAID,GAAeE,GAAiBC,EAAoB,CAEtD,IAAMC,EAAgB5C,OAAO6C,WAEzBD,GAAiB,KAAOA,EAAgB,KAEtCF,EAAcI,mBAAqBH,IACrCD,EAAcK,YAAYJ,GAE1BD,EAAcM,UAAUC,IAAI,qBAIzBT,EAAYU,SAASP,KACxBH,EAAYO,YAAYJ,GAExBD,EAAcM,UAAUG,OAAO,oBAGrC,CACF,IAxGEC,KAAKxD,GAAKA,EACVwD,KAAKtC,OAAS,CACZK,MAAOvB,EAAG6C,cAAc,gBACxBhB,YAAa7B,EAAG6C,cAAc,kBAC9B1B,aAAcnB,EAAG6C,cAAc,4CAEjCW,KAAK9C,MAAQ+C,MAAMC,KAAK1D,EAAGe,iBAAiB,gBAC5CyC,KAAKG,QAAU3D,EAAGoD,UAClBI,KAAKjD,iBACLiD,KAAKhD,aACLgD,KAAK/C,mBACL+C,KAAKI,eACLJ,KAAKlD,uBACP,G","sources":["webpack://@hero-digital/zoom/./src/components/modules/Hero/Hero.js"],"sourcesContent":["class Hero {\r\n constructor(el) {\r\n this.el = el\r\n this.domMap = {\r\n image: el.querySelector('.hero__image'),\r\n contentHero: el.querySelector('.hero__content'),\r\n $printButton: el.querySelector('.fdn-button--button-style-icon-download')\r\n }\r\n this.links = Array.from(el.querySelectorAll('.fdn-button'))\r\n this.classes = el.classList\r\n this.setImageHeight()\r\n this.deviceSize()\r\n this.setContentHeight()\r\n this.addListeners()\r\n this.handlePricingCardMove()\r\n }\r\n\r\n addListeners = () => {\r\n window.addEventListener('resize', this.handlePricingCardMove)\r\n window.addEventListener('resize', this.setImageHeight)\r\n window.addEventListener('resize', this.deviceSize)\r\n window.addEventListener('resize', this.setContentHeight)\r\n this.links.forEach((link) => {\r\n link.addEventListener('click', this.handleCtaClicks)\r\n })\r\n\r\n const scrollLinks = document.querySelectorAll('a[href^=\"#\"]')\r\n scrollLinks.forEach((scrollLinks) => {\r\n scrollLinks.addEventListener('click', this.handleAnchorClick)\r\n })\r\n\r\n if (this.domMap.$printButton) {\r\n this.domMap.$printButton.addEventListener('click', function () {\r\n if (window && window.print) {\r\n window.print()\r\n } else {\r\n console.error('Printing not supported')\r\n }\r\n })\r\n }\r\n }\r\n setImageHeight = () => {\r\n if (this.domMap.image) {\r\n this.el.style.setProperty(\r\n '--image-height',\r\n `${this.domMap.image.clientHeight}px`\r\n )\r\n }\r\n }\r\n deviceSize = () => {\r\n this.el.style.setProperty('--device-width', `${this.el.clientWidth}px`)\r\n }\r\n setContentHeight = () => {\r\n if (this.domMap.contentHero) {\r\n this.el.style.setProperty(\r\n '--content-height',\r\n `${this.domMap.contentHero.clientHeight}px`\r\n )\r\n }\r\n }\r\n\r\n handleAnchorClick = (event) => {\r\n event.preventDefault()\r\n const targetId = event.target.getAttribute('href').substring(1)\r\n const targetSection = document.getElementById(targetId)\r\n\r\n if (targetSection) {\r\n const offset = 100\r\n const offsetTop =\r\n targetSection.getBoundingClientRect().top + window.pageYOffset - offset\r\n\r\n window.scrollTo({\r\n top: offsetTop,\r\n behavior: 'smooth'\r\n })\r\n }\r\n }\r\n\r\n // New Pricing API\r\n handlePricingCardMove = () => {\r\n const heroContent = this.el.querySelector('.hero__content')\r\n const heroContainer = this.el.querySelector('.hero__container')\r\n const pricingCardWrapper = this.el.querySelector(\r\n '.fdn-pricingcard-uni-wrapper'\r\n )\r\n\r\n if (heroContent && heroContainer && pricingCardWrapper) {\r\n // Get current viewport width\r\n const viewportWidth = window.innerWidth\r\n\r\n if (viewportWidth >= 768 && viewportWidth < 1220) {\r\n // Move the pricing card wrapper as the last element of hero__container\r\n if (heroContainer.lastElementChild !== pricingCardWrapper) {\r\n heroContainer.appendChild(pricingCardWrapper)\r\n // Add the class __hasPricingCard to heroContainer\r\n heroContainer.classList.add('__hasPricingCard')\r\n }\r\n } else {\r\n // Move the pricing card wrapper back inside the hero__content\r\n if (!heroContent.contains(pricingCardWrapper)) {\r\n heroContent.appendChild(pricingCardWrapper)\r\n // Remove the class __hasPricingCard from heroContainer\r\n heroContainer.classList.remove('__hasPricingCard')\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport default Hero\r\n"],"names":["_createClass","Hero","el","_this","_classCallCheck","_defineProperty","window","addEventListener","handlePricingCardMove","setImageHeight","deviceSize","setContentHeight","links","forEach","link","handleCtaClicks","document","querySelectorAll","scrollLinks","handleAnchorClick","domMap","$printButton","print","console","error","image","style","setProperty","concat","clientHeight","clientWidth","contentHero","event","preventDefault","targetId","target","getAttribute","substring","targetSection","getElementById","offsetTop","getBoundingClientRect","top","pageYOffset","scrollTo","behavior","heroContent","querySelector","heroContainer","pricingCardWrapper","viewportWidth","innerWidth","lastElementChild","appendChild","classList","add","contains","remove","this","Array","from","classes","addListeners"],"sourceRoot":""}