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Y,EAAMC,IAAKN,EAAWC,MCJ3EP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCGxDd,EAAoB,K","sources":["webpack://VanillaScrollspy/webpack/universalModuleDefinition","webpack://VanillaScrollspy/./index.js","webpack://VanillaScrollspy/./src/index.js","webpack://VanillaScrollspy/webpack/bootstrap","webpack://VanillaScrollspy/webpack/runtime/define property getters","webpack://VanillaScrollspy/webpack/runtime/hasOwnProperty shorthand","webpack://VanillaScrollspy/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"VanillaScrollspy\"] = factory();\n\telse\n\t\troot[\"VanillaScrollspy\"] = factory();\n})(self, function() {\nreturn ","module.exports = require('./src/index').default;\n","const fncAnimation = (callback) => {\n window.setTimeout(callback, 1000 / 60);\n return callback;\n};\n\nwindow.requestAnimFrame = (() => window.requestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.mozRequestAnimationFrame\n || fncAnimation\n)();\n\nclass VanillaScrollspy {\n constructor(menu, speed = 2000, easing = 'easeOutSine') {\n this.$menu = menu;\n this.speed = speed;\n this.easing = easing;\n }\n\n scrollToY(targetY = 0) {\n const scrollTargetY = targetY;\n const scrollY = window.scrollY || document.documentElement.scrollTop;\n const time = Math.max(0.1, Math.min(Math.abs(scrollY - scrollTargetY) / this.speed, 0.8));\n let currentTime = 0;\n\n const easingEquations = {\n easeOutSine(pos) {\n return Math.sin(pos * (Math.PI / 2));\n },\n\n easeInOutSine(pos) {\n return (-0.5 * (Math.cos(Math.PI * pos) - 1));\n },\n\n easeInOutQuint(pos) {\n /* eslint-disable-next-line */\n if ((pos /= 0.5) < 1) {\n return 0.5 * (pos ** 5);\n }\n return 0.5 * (((pos - 2) ** 5) + 2);\n },\n };\n\n const tick = () => {\n currentTime += 1 / 60;\n\n const p = currentTime / time;\n const t = easingEquations[this.easing](p);\n\n if (p < 1) {\n window.requestAnimFrame(tick);\n window.scrollTo(0, scrollY + ((scrollTargetY - scrollY) * t));\n return;\n }\n\n window.scrollTo(0, scrollTargetY);\n };\n\n tick();\n }\n\n menuControl() {\n const $links = this.$menu.querySelectorAll('a[href^=\"#\"]');\n const scrollPos = window.scrollY || document.documentElement.scrollTop;\n\n Array.from($links).forEach((link) => {\n const $elem = document.querySelector(link.getAttribute('href'));\n\n return $elem.offsetTop <= scrollPos && ($elem.offsetTop + $elem.clientHeight) > scrollPos\n ? link.classList.add('active')\n : link.classList.remove('active');\n });\n }\n\n animated() {\n const self = this;\n\n function control(e) {\n e.preventDefault();\n const $target = document.querySelector(this.hash);\n self.scrollToY($target.offsetTop);\n }\n\n const $links = this.$menu.querySelectorAll('a[href^=\"#\"]');\n Array.from($links).forEach((link) => link.addEventListener('click', control));\n }\n\n init() {\n this.animated();\n document.addEventListener('scroll', () => this.menuControl());\n }\n}\n\nexport default function vanillaScrollspy(...args) {\n return new VanillaScrollspy(...args);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(45);\n"],"names":["root","factory","exports","module","define","amd","self","window","requestAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","callback","setTimeout","VanillaScrollspy","menu","speed","easing","this","$menu","targetY","scrollTargetY","scrollY","document","documentElement","scrollTop","time","Math","max","min","abs","currentTime","easingEquations","easeOutSine","pos","sin","PI","easeInOutSine","cos","easeInOutQuint","tick","p","t","scrollTo","$links","querySelectorAll","scrollPos","Array","from","forEach","link","$elem","querySelector","getAttribute","offsetTop","clientHeight","classList","add","remove","control","e","preventDefault","$target","hash","scrollToY","addEventListener","animated","menuControl","vanillaScrollspy","args","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call"],"sourceRoot":""}