{"remainingRequest":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/buble-loader/index.js??ref--2-1!/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.smoothScroll.js","dependencies":[{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.smoothScroll.js","mtime":1560429080762},{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/cache-loader/dist/cjs.js","mtime":1560429090832},{"path":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/buble-loader/index.js","mtime":1560429088235}],"contextDependencies":[],"result":["'use strict';\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.util.core';\nimport { Plugin } from './foundation.plugin';\n\n/**\n * SmoothScroll module.\n * @module foundation.smooth-scroll\n */\nvar SmoothScroll = (function (Plugin) {\n  function SmoothScroll () {\n    Plugin.apply(this, arguments);\n  }\n\n  if ( Plugin ) SmoothScroll.__proto__ = Plugin;\n  SmoothScroll.prototype = Object.create( Plugin && Plugin.prototype );\n  SmoothScroll.prototype.constructor = SmoothScroll;\n\n  SmoothScroll.prototype._setup = function _setup (element, options) {\n        this.$element = element;\n        this.options = $.extend({}, SmoothScroll.defaults, this.$element.data(), options);\n        this.className = 'SmoothScroll'; // ie9 back compat\n\n        this._init();\n    };\n\n    /**\n     * Initialize the SmoothScroll plugin\n     * @private\n     */\n    SmoothScroll.prototype._init = function _init () {\n        var id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll');\n        var _this = this;\n        this.$element.attr({\n            'id': id\n        });\n\n        this._events();\n    };\n\n    /**\n     * Initializes events for SmoothScroll.\n     * @private\n     */\n    SmoothScroll.prototype._events = function _events () {\n        var _this = this;\n\n        // click handler function.\n        var handleLinkClick = function(e) {\n            // exit function if the event source isn't coming from an anchor with href attribute starts with '#'\n            if(!$(this).is('a[href^=\"#\"]'))  {\n                return false;\n            }\n\n            var arrival = this.getAttribute('href');\n\n            _this._inTransition = true;\n\n            SmoothScroll.scrollToLoc(arrival, _this.options, function() {\n                _this._inTransition = false;\n            });\n\n            e.preventDefault();\n        };\n\n        this.$element.on('click.zf.smoothScroll', handleLinkClick)\n        this.$element.on('click.zf.smoothScroll', 'a[href^=\"#\"]', handleLinkClick);\n    };\n\n    /**\n     * Function to scroll to a given location on the page.\n     * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'\n     * @param {Object} options - The options to use.\n     * @param {Function} callback - The callback function.\n     * @static\n     * @function\n     */\n    SmoothScroll.scrollToLoc = function scrollToLoc (loc, options, callback) {\n        if ( options === void 0 ) options = SmoothScroll.defaults;\n\n        // Do nothing if target does not exist to prevent errors\n        if (!$(loc).length) {\n            return false;\n        }\n\n        var scrollPos = Math.round($(loc).offset().top - options.threshold / 2 - options.offset);\n\n        $('html, body').stop(true).animate(\n            { scrollTop: scrollPos },\n            options.animationDuration,\n            options.animationEasing,\n            function() {\n                if(callback && typeof callback == \"function\"){\n                    callback();\n                }\n            }\n        );\n    };\n\n  return SmoothScroll;\n}(Plugin));\n\n/**\n * Default settings for plugin.\n */\nSmoothScroll.defaults = {\n  /**\n   * Amount of time, in ms, the animated scrolling should take between locations.\n   * @option\n   * @type {number}\n   * @default 500\n   */\n  animationDuration: 500,\n  /**\n   * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n   * @option\n   * @type {string}\n   * @default 'linear'\n   * @see {@link https://api.jquery.com/animate|Jquery animate}\n   */\n  animationEasing: 'linear',\n  /**\n   * Number of pixels to use as a marker for location changes.\n   * @option\n   * @type {number}\n   * @default 50\n   */\n  threshold: 50,\n  /**\n   * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n   * @option\n   * @type {number}\n   * @default 0\n   */\n  offset: 0\n}\n\nexport {SmoothScroll}\n",{"version":3,"file":"/Users/dev/Sites/belavistasaude/wp-content/themes/belavistasaude/node_modules/foundation-sites/js/foundation.smoothScroll.js","sources":["node_modules/foundation-sites/js/foundation.smoothScroll.js"],"sourcesContent":["'use strict';\n\nimport $ from 'jquery';\nimport { GetYoDigits } from './foundation.util.core';\nimport { Plugin } from './foundation.plugin';\n\n/**\n * SmoothScroll module.\n * @module foundation.smooth-scroll\n */\nclass SmoothScroll extends Plugin {\n  /**\n   * Creates a new instance of SmoothScroll.\n   * @class\n   * @name SmoothScroll\n   * @fires SmoothScroll#init\n   * @param {Object} element - jQuery object to add the trigger to.\n   * @param {Object} options - Overrides to the default plugin settings.\n   */\n    _setup(element, options) {\n        this.$element = element;\n        this.options = $.extend({}, SmoothScroll.defaults, this.$element.data(), options);\n        this.className = 'SmoothScroll'; // ie9 back compat\n\n        this._init();\n    }\n\n    /**\n     * Initialize the SmoothScroll plugin\n     * @private\n     */\n    _init() {\n        var id = this.$element[0].id || GetYoDigits(6, 'smooth-scroll');\n        var _this = this;\n        this.$element.attr({\n            'id': id\n        });\n\n        this._events();\n    }\n\n    /**\n     * Initializes events for SmoothScroll.\n     * @private\n     */\n    _events() {\n        var _this = this;\n\n        // click handler function.\n        var handleLinkClick = function(e) {\n            // exit function if the event source isn't coming from an anchor with href attribute starts with '#'\n            if(!$(this).is('a[href^=\"#\"]'))  {\n                return false;\n            }\n\n            var arrival = this.getAttribute('href');\n\n            _this._inTransition = true;\n\n            SmoothScroll.scrollToLoc(arrival, _this.options, function() {\n                _this._inTransition = false;\n            });\n\n            e.preventDefault();\n        };\n\n        this.$element.on('click.zf.smoothScroll', handleLinkClick)\n        this.$element.on('click.zf.smoothScroll', 'a[href^=\"#\"]', handleLinkClick);\n    }\n\n    /**\n     * Function to scroll to a given location on the page.\n     * @param {String} loc - A properly formatted jQuery id selector. Example: '#foo'\n     * @param {Object} options - The options to use.\n     * @param {Function} callback - The callback function.\n     * @static\n     * @function\n     */\n    static scrollToLoc(loc, options = SmoothScroll.defaults, callback) {\n        // Do nothing if target does not exist to prevent errors\n        if (!$(loc).length) {\n            return false;\n        }\n\n        var scrollPos = Math.round($(loc).offset().top - options.threshold / 2 - options.offset);\n\n        $('html, body').stop(true).animate(\n            { scrollTop: scrollPos },\n            options.animationDuration,\n            options.animationEasing,\n            function() {\n                if(callback && typeof callback == \"function\"){\n                    callback();\n                }\n            }\n        );\n    }\n}\n\n/**\n * Default settings for plugin.\n */\nSmoothScroll.defaults = {\n  /**\n   * Amount of time, in ms, the animated scrolling should take between locations.\n   * @option\n   * @type {number}\n   * @default 500\n   */\n  animationDuration: 500,\n  /**\n   * Animation style to use when scrolling between locations. Can be `'swing'` or `'linear'`.\n   * @option\n   * @type {string}\n   * @default 'linear'\n   * @see {@link https://api.jquery.com/animate|Jquery animate}\n   */\n  animationEasing: 'linear',\n  /**\n   * Number of pixels to use as a marker for location changes.\n   * @option\n   * @type {number}\n   * @default 50\n   */\n  threshold: 50,\n  /**\n   * Number of pixels to offset the scroll of the page on item click if using a sticky nav bar.\n   * @option\n   * @type {number}\n   * @default 0\n   */\n  offset: 0\n}\n\nexport {SmoothScroll}\n"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,SAAS,WAAW,QAAQ,wBAAwB,CAAC;AACrD,SAAS,MAAM,QAAQ,qBAAqB,CAAC;;;;;;AAM7C,IAAM,YAAY,GAAe;EAAC;;;;;;;;EAAA,AAS9B,uBAAA,MAAM,mBAAA,CAAC,OAAO,EAAE,OAAO,EAAE;QACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC;;QAEhC,IAAI,CAAC,KAAK,EAAE,CAAC;KAChB,CAAA;;;;;;IAMD,uBAAA,KAAK,kBAAA,GAAG;QACJ,IAAI,EAAE,GAAG,IAAI,CAAC,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