{"version":3,"file":"js/wsumMarketing.js","mappings":"mBAAA,MAAMA,EAkBJC,YAAAA,GACE,MAAMC,EAAYC,KAAKC,UAAYC,OAAOC,YAC1CH,KAAKC,UAAYC,OAAOC,YAExB,MAAMC,EAAaJ,KAAKK,OAAOC,wBAAwBC,OAGrDP,KAAKQ,UAAUC,MAAMC,QADnBX,KAAeK,EAAa,IAAM,EACL,QAEA,MAEnC,CAKAO,IAAAA,GACEX,KAAKF,eACLI,OAAOU,iBAAiB,SAAUZ,KAAKF,aACzC,CAKAe,OAAAA,GACEX,OAAOY,oBAAoB,SAAUd,KAAKF,cAC1CE,KAAKQ,UAAUC,MAAMC,QAAU,MACjC,CAvCAK,WAAAA,CAAYC,GACVhB,KAAKQ,UAAYQ,EACjBhB,KAAKK,OAASL,KAAKQ,UAAUS,QAAQ,wBACrCjB,KAAKC,WAAa,EAClBD,KAAKF,aAAeE,KAAKF,aAAaoB,KAAKlB,MAE3CA,KAAKW,MACP,EAmCF,MAOA,EAPmB,CACjBA,IAAAA,GACmBQ,SAASC,iBAAiB,gBAClCC,SAAQL,GAAM,IAAInB,EAAOmB,IACpC,GC/Ca,IAAkBM,ICCxB,KACPC,EAAOZ,MAAM,EDDe,YAAxBQ,SAASK,WACXF,IAEAH,SAASP,iBAAiB,oBAAoB,KAC5CU,GAAU,G","sources":["webpack://golf-wp/./wp-content/mu-plugins/wsum-user-manager/resources/js/modules/sticky.js","webpack://golf-wp/./wp-content/mu-plugins/wsum-user-manager/resources/js/utils/DOMReady.js","webpack://golf-wp/./wp-content/mu-plugins/wsum-user-manager/resources/js/templates/wsum-marketing.js"],"sourcesContent":["class Sticky {\n /**\n * Constructor\n *\n * @param {Element} form Form element with the class `.wsum-sticky`\n */\n constructor(el) {\n this.stickyBar = el\n this.parent = this.stickyBar.closest('.wsum-sticky__parent')\n this.scrollPos = -1\n this.handleScroll = this.handleScroll.bind(this)\n\n this.init()\n }\n\n /**\n * Handles the scroll Event\n */\n handleScroll() {\n const direction = this.scrollPos < window.pageYOffset\n this.scrollPos = window.pageYOffset\n\n const boundaries = this.parent.getBoundingClientRect().bottom\n\n if (direction && -(boundaries - 60) > 0) {\n this.stickyBar.style.display = 'block'\n } else {\n this.stickyBar.style.display = 'none'\n }\n }\n\n /**\n * Initializes the Sticky Object\n */\n init() {\n this.handleScroll()\n window.addEventListener('scroll', this.handleScroll)\n }\n\n /**\n * Destroys the current Sticky instance\n */\n destroy() {\n window.removeEventListener('scroll', this.handleScroll)\n this.stickyBar.style.display = 'none'\n }\n}\n\nconst stickyInit = {\n init() {\n const elements = document.querySelectorAll('.wsum-sticky')\n elements.forEach(el => new Sticky(el))\n },\n}\n\nexport default stickyInit\n","/**\n * Triggers a callback function once the DOM is ready\n *\n * @param {function} callback The function to trigger\n */\nexport default function DOMReady(callback) {\n if (document.readyState !== 'loading') {\n callback()\n } else {\n document.addEventListener('DOMContentLoaded', () => {\n callback()\n })\n }\n}\n","import DOMReady from '../utils/DOMReady'\nimport sticky from '../modules/sticky'\n\n// eslint-disable-next-line no-unused-vars\nimport css from '../../css/templates/wsum-marketing.scss'\n\nDOMReady(() => {\n sticky.init()\n})\n"],"names":["Sticky","handleScroll","direction","this","scrollPos","window","pageYOffset","boundaries","parent","getBoundingClientRect","bottom","stickyBar","style","display","init","addEventListener","destroy","removeEventListener","constructor","el","closest","bind","document","querySelectorAll","forEach","callback","sticky","readyState"],"sourceRoot":""}