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EAAAX,MAAAU,EAAAC,EAAAV,KAAAC,MAAoC,KAA3BC,EAAQO,EAAA1B,MACO,eAAlBmB,EAASC,MACoB,UAA3BD,EAASE,eACP1B,EAAMV,UAAUqC,SAAS,mBAC3B5C,EAAYgC,EAIpB,CAAC,OAAAa,GAAAI,EAAAH,EAAAD,EAAA,SAAAI,EAAAF,GAAA,CACH,M,6EAAC,CA7CmB,E","sources":["webpack://@hero-digital/zoom/./src/components/foundation/NewsletterSignup/NewsletterSignup.js"],"sourcesContent":["function handleError(form) {\r\n const y = form.getBoundingClientRect().top + window.scrollY - 100\r\n form.classList.remove('ValidationFail')\r\n\r\n window.scroll({\r\n top: y,\r\n behavior: 'smooth'\r\n })\r\n}\r\n\r\nclass NewsletterSignup {\r\n constructor(el) {\r\n this.el = el\r\n this.domMap = {\r\n $formWrapper: this.el,\r\n $form: this.el.querySelector('form'),\r\n $statusMessage: this.el.querySelector('.Form__Status__Message')\r\n }\r\n \r\n this.addObservers()\r\n }\r\n addObservers() {\r\n const { $form, $statusMessage } = this.domMap\r\n const observerOptions = { attributes: true }\r\n\r\n const formObserver = new MutationObserver(this.formCallback)\r\n formObserver.observe($form, observerOptions)\r\n const statusObserver = new MutationObserver(this.statusCallback)\r\n statusObserver.observe($statusMessage, observerOptions)\r\n }\r\n statusCallback(mutationsList) {\r\n const formWrapper = document.querySelector('.newsletter-signup')\r\n const $status = mutationsList[0].target\r\n for (let mutation of mutationsList) {\r\n if (mutation.type === 'attributes') {\r\n if (mutation.attributeName === 'class') {\r\n if ($status.classList.contains('Form__Warning__Message')) {\r\n handleError(formWrapper)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n formCallback(mutationsList) {\r\n const formWrapper = document.querySelector('.newsletter-signup')\r\n const $form = mutationsList[0].target\r\n for (let mutation of mutationsList) {\r\n if (mutation.type === 'attributes') {\r\n if (mutation.attributeName === 'class') {\r\n if ($form.classList.contains('ValidationFail')) {\r\n handleError(formWrapper)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\nexport default NewsletterSignup"],"names":["handleError","form","y","getBoundingClientRect","top","window","scrollY","classList","remove","scroll","behavior","NewsletterSignup","el","_classCallCheck","this","domMap","$formWrapper","$form","querySelector","$statusMessage","addObservers","key","value","_this$domMap","observerOptions","attributes","MutationObserver","formCallback","observe","statusCallback","mutationsList","_step","formWrapper","document","$status","target","_iterator","_createForOfIteratorHelper","s","n","done","mutation","type","attributeName","contains","err","e","f","_step2","_iterator2"],"sourceRoot":""}