{"version":3,"sources":["vendor/smooth-scroll.js","components/smoothScroll.js"],"names":["root","factory","define","amd","exports","module","SmoothScroll","global","window","this","supports","document","Element","prototype","defaults","ignore","header","speed","offset","easing","customEasing","before","after","extend","extended","i","length","arguments","merge","obj","prop","hasOwnProperty","getHeight","elem","parseInt","getComputedStyle","height","escapeCharacters","id","charAt","substr","codeUnit","string","String","index","result","firstCodeUnit","charCodeAt","InvalidCharacterError","toString","easingPattern","settings","time","pattern","getDocumentHeight","Math","max","body","scrollHeight","documentElement","offsetHeight","clientHeight","getEndLocation","anchor","headerHeight","location","offsetParent","offsetTop","getHeaderHeight","adjustFocus","endLocation","isNum","focus","activeElement","setAttribute","style","outline","scrollTo","reduceMotion","matchMedia","matches","selector","options","toggle","fixedHeader","eventTimeout","animationInterval","smoothScroll","cancelScroll","cancelAnimationFrame","animateScroll","animateSettings","Object","call","anchorElem","tagName","startLocation","pageYOffset","querySelector","start","percentage","position","distance","documentHeight","timeLapsed","stopAnimateScroll","currentLocation","innerHeight","loopAnimateScroll","timestamp","floor","requestAnimationFrame","hashChangeHandler","event","getAttribute","clickHandler","button","metaKey","ctrlKey","target","closest","toLowerCase","hostname","pathname","test","href","hash","decodeURIComponent","e","preventDefault","substring","resizeThrottler","setTimeout","destroy","removeEventListener","init","addEventListener","dmx","Component","attributes","type","default","Number","methods","goto","scroll","render","node","update","props","JSON","stringify"],"mappings":";;;;;;;;;;;;CAOA,SAAAA,EAAAC,GACA,kBAAAC,SAAAA,OAAAC,IACAD,UAAA,WACA,MAAAD,GAAAD,KAEA,gBAAAI,SACAC,OAAAD,QAAAH,EAAAD,GAEAA,EAAAM,aAAAL,EAAAD,IAEA,mBAAAO,QAAAA,OAAA,mBAAAC,QAAAA,OAAAC,KAAA,SAAAD,GAEA,YAMA,IAAAE,GACA,iBAAAC,WACA,oBAAAH,IACA,yBAAAA,IACA,WAAAA,GAAAI,QAAAC,UAOAC,GAEAC,OAAA,uBACAC,OAAA,KAGAC,MAAA,IACAC,OA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KAAA4I,QAAAC,KAAAC,UAAAF,KACA5I,KAAAwI,QAAAxI,KAAAwI,OAAAZ,UACA5H,KAAAwI,OAAA,GAAA3I,cAAAG,KAAA4I,MAAApE,SAAAxE,KAAA4I,SAIAhB,QAAA,WACA5H,KAAAwI,OAAAZ","file":"../dmxSmoothScroll/dmxSmoothScroll.js","sourcesContent":["/*!\n * smooth-scroll v12.1.5: Animate scrolling to anchor links\n * (c) 2017 Chris Ferdinandi\n * MIT License\n * http://github.com/cferdinandi/smooth-scroll\n */\n\n(function (root, factory) {\n\tif ( typeof define === 'function' && define.amd ) {\n\t\tdefine([], (function () {\n\t\t\treturn factory(root);\n\t\t}));\n\t} else if ( typeof exports === 'object' ) {\n\t\tmodule.exports = factory(root);\n\t} else {\n\t\troot.SmoothScroll = factory(root);\n\t}\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, (function (window) {\n\n\t'use strict';\n\n\t//\n\t// Feature Test\n\t//\n\n\tvar supports =\n\t\t'querySelector' in document &&\n\t\t'addEventListener' in window &&\n\t\t'requestAnimationFrame' in window &&\n\t\t'closest' in window.Element.prototype;\n\n\n\t//\n\t// Default settings\n\t//\n\n\tvar defaults = {\n\t\t// Selectors\n\t\tignore: '[data-scroll-ignore]',\n\t\theader: null,\n\n\t\t// Speed & Easing\n\t\tspeed: 500,\n\t\toffset: 0,\n\t\teasing: 'easeInOutCubic',\n\t\tcustomEasing: null,\n\n\t\t// Callback API\n\t\tbefore: function () {},\n\t\tafter: function () {}\n\t};\n\n\n\t//\n\t// Utility Methods\n\t//\n\n\t/**\n\t * Merge two or more objects. Returns a new object.\n\t * @param {Object} objects The objects to merge together\n\t * @returns {Object} Merged values of defaults and options\n\t */\n\tvar extend = function () {\n\n\t\t// Variables\n\t\tvar extended = {};\n\t\tvar deep = false;\n\t\tvar i = 0;\n\t\tvar length = arguments.length;\n\n\t\t// Merge the object into the extended object\n\t\tvar merge = function (obj) {\n\t\t\tfor (var prop in obj) {\n\t\t\t\tif (obj.hasOwnProperty(prop)) {\n\t\t\t\t\textended[prop] = obj[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t// Loop through each object and conduct a merge\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tvar obj = arguments[i];\n\t\t\tmerge(obj);\n\t\t}\n\n\t\treturn extended;\n\n\t};\n\n\t/**\n\t * Get the height of an element.\n\t * @param {Node} elem The element to get the height of\n\t * @return {Number} The element's height in pixels\n\t */\n\tvar getHeight = function (elem) {\n\t\treturn parseInt(window.getComputedStyle(elem).height, 10);\n\t};\n\n\t/**\n\t * Escape special characters for use with querySelector\n\t * @param {String} id The anchor ID to escape\n\t * @author Mathias Bynens\n\t * @link https://github.com/mathiasbynens/CSS.escape\n\t */\n\tvar escapeCharacters = function (id) {\n\n\t\t// Remove leading hash\n\t\tif (id.charAt(0) === '#') {\n\t\t\tid = id.substr(1);\n\t\t}\n\n\t\tvar string = String(id);\n\t\tvar length = string.length;\n\t\tvar index = -1;\n\t\tvar codeUnit;\n\t\tvar result = '';\n\t\tvar firstCodeUnit = string.charCodeAt(0);\n\t\twhile (++index < length) {\n\t\t\tcodeUnit = string.charCodeAt(index);\n\t\t\t// Note: there’s no need to special-case astral symbols, surrogate\n\t\t\t// pairs, or lone surrogates.\n\n\t\t\t// If the character is NULL (U+0000), then throw an\n\t\t\t// `InvalidCharacterError` exception and terminate these steps.\n\t\t\tif (codeUnit === 0x0000) {\n\t\t\t\tthrow new InvalidCharacterError(\n\t\t\t\t\t'Invalid character: the input contains U+0000.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\n\t\t\t\t// U+007F, […]\n\t\t\t\t(codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\n\t\t\t\t// If the character is the first character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039), […]\n\t\t\t\t(index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\n\t\t\t\t// If the character is the second character and is in the range [0-9]\n\t\t\t\t// (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\n\t\t\t\t(\n\t\t\t\t\tindex === 1 &&\n\t\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 &&\n\t\t\t\t\tfirstCodeUnit === 0x002D\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t// http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point\n\t\t\t\tresult += '\\\\' + codeUnit.toString(16) + ' ';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If the character is not handled by one of the above rules and is\n\t\t\t// greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\n\t\t\t// is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\n\t\t\t// U+005A), or [a-z] (U+0061 to U+007A), […]\n\t\t\tif (\n\t\t\t\tcodeUnit >= 0x0080 ||\n\t\t\t\tcodeUnit === 0x002D ||\n\t\t\t\tcodeUnit === 0x005F ||\n\t\t\t\tcodeUnit >= 0x0030 && codeUnit <= 0x0039 ||\n\t\t\t\tcodeUnit >= 0x0041 && codeUnit <= 0x005A ||\n\t\t\t\tcodeUnit >= 0x0061 && codeUnit <= 0x007A\n\t\t\t) {\n\t\t\t\t// the character itself\n\t\t\t\tresult += string.charAt(index);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Otherwise, the escaped character.\n\t\t\t// http://dev.w3.org/csswg/cssom/#escape-a-character\n\t\t\tresult += '\\\\' + string.charAt(index);\n\n\t\t}\n\n\t\treturn '#' + result;\n\n\t};\n\n\t/**\n\t * Calculate the easing pattern\n\t * @link https://gist.github.com/gre/1650294\n\t * @param {String} type Easing pattern\n\t * @param {Number} time Time animation should take to complete\n\t * @returns {Number}\n\t */\n\tvar easingPattern = function (settings, time) {\n\t\tvar pattern;\n\n\t\t// Default Easing Patterns\n\t\tif (settings.easing === 'easeInQuad') pattern = time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuad') pattern = time * (2 - time); // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuad') pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInCubic') pattern = time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutCubic') pattern = (--time) * time * time + 1; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutCubic') pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInQuart') pattern = time * time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuart') pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuart') pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration\n\t\tif (settings.easing === 'easeInQuint') pattern = time * time * time * time * time; // accelerating from zero velocity\n\t\tif (settings.easing === 'easeOutQuint') pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity\n\t\tif (settings.easing === 'easeInOutQuint') pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration\n\n\t\t// Custom Easing Patterns\n\t\tif (!!settings.customEasing) pattern = settings.customEasing(time);\n\n\t\treturn pattern || time; // no easing, no acceleration\n\t};\n\n\t/**\n\t * Determine the document's height\n\t * @returns {Number}\n\t */\n\tvar getDocumentHeight = function () {\n\t\treturn Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t);\n\t};\n\n\t/**\n\t * Calculate how far to scroll\n\t * @param {Element} anchor The anchor element to scroll to\n\t * @param {Number} headerHeight Height of a fixed header, if any\n\t * @param {Number} offset Number of pixels by which to offset scroll\n\t * @returns {Number}\n\t */\n\tvar getEndLocation = function (anchor, headerHeight, offset) {\n\t\tvar location = 0;\n\t\tif (anchor.offsetParent) {\n\t\t\tdo {\n\t\t\t\tlocation += anchor.offsetTop;\n\t\t\t\tanchor = anchor.offsetParent;\n\t\t\t} while (anchor);\n\t\t}\n\t\tlocation = Math.max(location - headerHeight - offset, 0);\n\t\treturn location;\n\t};\n\n\t/**\n\t * Get the height of the fixed header\n\t * @param {Node} header The header\n\t * @return {Number} The height of the header\n\t */\n\tvar getHeaderHeight = function (header) {\n\t\treturn !header ? 0 : (getHeight(header) + header.offsetTop);\n\t};\n\n\t/**\n\t * Bring the anchored element into focus\n\t * @param {Node} anchor The anchor element\n\t * @param {Number} endLocation The end location to scroll to\n\t * @param {Boolean} isNum If true, scroll is to a position rather than an element\n\t */\n\tvar adjustFocus = function (anchor, endLocation, isNum) {\n\n\t\t// Don't run if scrolling to a number on the page\n\t\tif (isNum) return;\n\n\t\t// Otherwise, bring anchor element into focus\n\t\tanchor.focus();\n\t\tif (document.activeElement.id !== anchor.id) {\n\t\t\tanchor.setAttribute('tabindex', '-1');\n\t\t\tanchor.focus();\n\t\t\tanchor.style.outline = 'none';\n\t\t}\n\t\twindow.scrollTo(0 , endLocation);\n\n\t};\n\n\t/**\n\t * Check to see if user prefers reduced motion\n\t * @param {Object} settings Script settings\n\t */\n\tvar reduceMotion = function (settings) {\n\t\tif ('matchMedia' in window && window.matchMedia('(prefers-reduced-motion)').matches) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t};\n\n\n\t//\n\t// SmoothScroll Constructor\n\t//\n\n\tvar SmoothScroll = function (selector, options) {\n\n\t\t//\n\t\t// Variables\n\t\t//\n\n\t\tvar smoothScroll = {}; // Object for public APIs\n\t\tvar settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval;\n\n\n\t\t//\n\t\t// Methods\n\t\t//\n\n\t\t/**\n\t\t * Cancel a scroll-in-progress\n\t\t */\n\t\tsmoothScroll.cancelScroll = function () {\n\t\t\t// clearInterval(animationInterval);\n\t\t\tcancelAnimationFrame(animationInterval);\n\t\t};\n\n\t\t/**\n\t\t * Start/stop the scrolling animation\n\t\t * @param {Node|Number} anchor The element or position to scroll to\n\t\t * @param {Element} toggle The element that toggled the scroll event\n\t\t * @param {Object} options\n\t\t */\n\t\tsmoothScroll.animateScroll = function (anchor, toggle, options) {\n\n\t\t\t// Local settings\n\t\t\tvar animateSettings = extend(settings || defaults, options || {}); // Merge user options with defaults\n\n\t\t\t// Selectors and variables\n\t\t\tvar isNum = Object.prototype.toString.call(anchor) === '[object Number]' ? true : false;\n\t\t\tvar anchorElem = isNum || !anchor.tagName ? null : anchor;\n\t\t\tif (!isNum && !anchorElem) return;\n\t\t\tvar startLocation = window.pageYOffset; // Current location on the page\n\t\t\tif (animateSettings.header && !fixedHeader) {\n\t\t\t\t// Get the fixed header if not already set\n\t\t\t\tfixedHeader = document.querySelector( animateSettings.header );\n\t\t\t}\n\t\t\tif (!headerHeight) {\n\t\t\t\t// Get the height of a fixed header if one exists and not already set\n\t\t\t\theaderHeight = getHeaderHeight(fixedHeader);\n\t\t\t}\n\t\t\tvar endLocation = isNum ? anchor : getEndLocation(anchorElem, headerHeight, parseInt((typeof animateSettings.offset === 'function' ? animateSettings.offset() : animateSettings.offset), 10)); // Location to scroll to\n\t\t\tvar distance = endLocation - startLocation; // distance to travel\n\t\t\tvar documentHeight = getDocumentHeight();\n\t\t\tvar timeLapsed = 0;\n\t\t\tvar start, percentage, position;\n\n\t\t\t/**\n\t\t\t * Stop the scroll animation when it reaches its target (or the bottom/top of page)\n\t\t\t * @param {Number} position Current position on the page\n\t\t\t * @param {Number} endLocation Scroll to location\n\t\t\t * @param {Number} animationInterval How much to scroll on this loop\n\t\t\t */\n\t\t\tvar stopAnimateScroll = function (position, endLocation) {\n\n\t\t\t\t// Get the current location\n\t\t\t\tvar currentLocation = window.pageYOffset;\n\n\t\t\t\t// Check if the end location has been reached yet (or we've hit the end of the document)\n\t\t\t\tif ( position == endLocation || currentLocation == endLocation || ((startLocation < endLocation && window.innerHeight + currentLocation) >= documentHeight )) {\n\n\t\t\t\t\t// Clear the animation timer\n\t\t\t\t\tsmoothScroll.cancelScroll();\n\n\t\t\t\t\t// Bring the anchored element into focus\n\t\t\t\t\tadjustFocus(anchor, endLocation, isNum);\n\n\t\t\t\t\t// Run callback after animation complete\n\t\t\t\t\tanimateSettings.after(anchor, toggle);\n\n\t\t\t\t\t// Reset start\n\t\t\t\t\tstart = null;\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Loop scrolling animation\n\t\t\t */\n\t\t\tvar loopAnimateScroll = function (timestamp) {\n\t\t\t\tif (!start) { start = timestamp; }\n\t\t\t\ttimeLapsed += timestamp - start;\n\t\t\t\tpercentage = (timeLapsed / parseInt(animateSettings.speed, 10));\n\t\t\t\tpercentage = (percentage > 1) ? 1 : percentage;\n\t\t\t\tposition = startLocation + (distance * easingPattern(animateSettings, percentage));\n\t\t\t\twindow.scrollTo(0, Math.floor(position));\n\t\t\t\tif (!stopAnimateScroll(position, endLocation)) {\n\t\t\t\t\twindow.requestAnimationFrame(loopAnimateScroll);\n\t\t\t\t\tstart = timestamp;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Reset position to fix weird iOS bug\n\t\t\t * @link https://github.com/cferdinandi/smooth-scroll/issues/45\n\t\t\t */\n\t\t\tif (window.pageYOffset === 0) {\n\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t}\n\n\t\t\t// Run callback before animation starts\n\t\t\tanimateSettings.before(anchor, toggle);\n\n\t\t\t// Start scrolling animation\n\t\t\tsmoothScroll.cancelScroll();\n\t\t\twindow.requestAnimationFrame(loopAnimateScroll);\n\n\n\t\t};\n\n\t\t/**\n\t\t * Handle has change event\n\t\t */\n\t\tvar hashChangeHandler = function (event) {\n\n\t\t\t// Only run if there's an anchor element to scroll to\n\t\t\tif (!anchor) return;\n\n\t\t\t// Reset the anchor element's ID\n\t\t\tanchor.id = anchor.getAttribute('data-scroll-id');\n\n\t\t\t// Scroll to the anchored content\n\t\t\tsmoothScroll.animateScroll(anchor, toggle);\n\n\t\t\t// Reset anchor and toggle\n\t\t\tanchor = null;\n\t\t\ttoggle = null;\n\n\t\t};\n\n\t\t/**\n\t\t * If smooth scroll element clicked, animate scroll\n\t\t */\n\t\tvar clickHandler = function (event) {\n\n\t\t\t// Don't run if the user prefers reduced motion\n\t\t\tif (reduceMotion(settings)) return;\n\n\t\t\t// Don't run if right-click or command/control + click\n\t\t\tif (event.button !== 0 || event.metaKey || event.ctrlKey) return;\n\n\t\t\t// Check if a smooth scroll link was clicked\n\t\t\ttoggle = event.target.closest(selector);\n\t\t\tif (!toggle || toggle.tagName.toLowerCase() !== 'a' || event.target.closest(settings.ignore)) return;\n\n\t\t\t// Only run if link is an anchor and points to the current page\n\t\t\tif (toggle.hostname !== window.location.hostname || toggle.pathname !== window.location.pathname || !/#/.test(toggle.href)) return;\n\n\t\t\t// Get the sanitized hash\n\t\t\tvar hash;\n\t\t\ttry {\n\t\t\t\thash = escapeCharacters(decodeURIComponent(toggle.hash));\n\t\t\t} catch(e) {\n\t\t\t\thash = escapeCharacters(toggle.hash);\n\t\t\t}\n\n\t\t\t// If the hash is empty, scroll to the top of the page\n\t\t\tif (hash === '#') {\n\n\t\t\t\t// Prevent default link behavior\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// Set the anchored element\n\t\t\t\tanchor = document.body;\n\n\t\t\t\t// Save or create the ID as a data attribute and remove it (prevents scroll jump)\n\t\t\t\tvar id = anchor.id ? anchor.id : 'smooth-scroll-top';\n\t\t\t\tanchor.setAttribute('data-scroll-id', id);\n\t\t\t\tanchor.id = '';\n\n\t\t\t\t// If no hash change event will happen, fire manually\n\t\t\t\t// Otherwise, update the hash\n\t\t\t\tif (window.location.hash.substring(1) === id) {\n\t\t\t\t\thashChangeHandler();\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.hash = id;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\t// Get the anchored element\n\t\t\tanchor = document.querySelector(hash);\n\n\t\t\t// If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump)\n\t\t\tif (!anchor) return;\n\t\t\tanchor.setAttribute('data-scroll-id', anchor.id);\n\t\t\tanchor.id = '';\n\n\t\t\t// If no hash change event will happen, fire manually\n\t\t\tif (toggle.hash === window.location.hash) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\thashChangeHandler();\n\t\t\t}\n\n\t\t};\n\n\t\t/**\n\t\t * On window scroll and resize, only run events at a rate of 15fps for better performance\n\t\t */\n\t\tvar resizeThrottler = function (event) {\n\t\t\tif (!eventTimeout) {\n\t\t\t\teventTimeout = setTimeout((function() {\n\t\t\t\t\teventTimeout = null; // Reset timeout\n\t\t\t\t\theaderHeight = getHeaderHeight(fixedHeader); // Get the height of a fixed header if one exists\n\t\t\t\t}), 66);\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Destroy the current initialization.\n\t\t */\n\t\tsmoothScroll.destroy = function () {\n\n\t\t\t// If plugin isn't already initialized, stop\n\t\t\tif (!settings) return;\n\n\t\t\t// Remove event listeners\n\t\t\tdocument.removeEventListener('click', clickHandler, false);\n\t\t\twindow.removeEventListener('resize', resizeThrottler, false);\n\n\t\t\t// Cancel any scrolls-in-progress\n\t\t\tsmoothScroll.cancelScroll();\n\n\t\t\t// Reset variables\n\t\t\tsettings = null;\n\t\t\tanchor = null;\n\t\t\ttoggle = null;\n\t\t\tfixedHeader = null;\n\t\t\theaderHeight = null;\n\t\t\teventTimeout = null;\n\t\t\tanimationInterval = null;\n\t\t};\n\n\t\t/**\n\t\t * Initialize Smooth Scroll\n\t\t * @param {Object} options User settings\n\t\t */\n\t\tsmoothScroll.init = function (options) {\n\n\t\t\t// feature test\n\t\t\tif (!supports) return;\n\n\t\t\t// Destroy any existing initializations\n\t\t\tsmoothScroll.destroy();\n\n\t\t\t// Selectors and variables\n\t\t\tsettings = extend(defaults, options || {}); // Merge user options with defaults\n\t\t\tfixedHeader = settings.header ? document.querySelector(settings.header) : null; // Get the fixed header\n\t\t\theaderHeight = getHeaderHeight(fixedHeader);\n\n\t\t\t// When a toggle is clicked, run the click handler\n\t\t\tdocument.addEventListener('click', clickHandler, false);\n\n\t\t\t// Listen for hash changes\n\t\t\twindow.addEventListener('hashchange', hashChangeHandler, false);\n\n\t\t\t// If window is resized and there's a fixed header, recalculate its size\n\t\t\tif (fixedHeader) {\n\t\t\t\twindow.addEventListener('resize', resizeThrottler, false);\n\t\t\t}\n\n\t\t};\n\n\n\t\t//\n\t\t// Initialize plugin\n\t\t//\n\n\t\tsmoothScroll.init(options);\n\n\n\t\t//\n\t\t// Public APIs\n\t\t//\n\n\t\treturn smoothScroll;\n\n\t};\n\n\treturn SmoothScroll;\n\n}));","dmx.Component('smooth-scroll', {\r\n\r\n attributes: {\r\n selector: { // must be a valid CSS selector\r\n type: String,\r\n default: 'a[href*=\"#\"]'\r\n },\r\n\r\n ignore: { // must be a valid CSS selector\r\n type: String,\r\n default: '[data-scroll-ignore]'\r\n },\r\n\r\n header: { // must be a valid CSS selector\r\n type: String,\r\n default: null\r\n },\r\n\r\n speed: {\r\n type: Number,\r\n default: 500\r\n },\r\n\r\n offset: {\r\n type: Number,\r\n default: 0\r\n },\r\n\r\n easing: { // Linear, easeInQuad, easeInCubic, easeInQuart, easeInQuint, easeInOutQuad, easeInOutCubic, easeInOutQuart, easeInOutQuint, easeOutQuad, easeOutCubic, easeOutQuart, easeOutQuint\r\n type: String,\r\n default: 'easeInOutCubic'\r\n }\r\n },\r\n\r\n methods: {\r\n goto: function(location) { // location is selector or number\r\n if (typeof location == 'string') {\r\n location = document.querySelector(location);\r\n }\r\n this.scroll.animateScroll(location);\r\n }\r\n },\r\n\r\n render: function(node) {\r\n this.update({});\r\n },\r\n\r\n update: function(props) {\r\n if (JSON.stringify(this.props) != JSON.stringify(props)) {\r\n if (this.scroll) this.scroll.destroy();\r\n this.scroll = new SmoothScroll(this.props.selector, this.props);\r\n }\r\n },\r\n\r\n destroy: function() {\r\n this.scroll.destroy();\r\n }\r\n\r\n});\r\n"]}