{"version":3,"file":"foundation.core.js","sources":["../../../../IREP.Web.Content/v7/node_modules/foundation-sites/js/foundation.core.js"],"sourcesContent":["import $ from 'jquery';\nimport { GetYoDigits } from './foundation.core.utils';\nimport { MediaQuery } from './foundation.util.mediaQuery';\n\nvar FOUNDATION_VERSION = '6.9.0';\n\n// Global Foundation object\n// This is attached to the window, or used as a module for AMD/Browserify\nvar Foundation = {\n version: FOUNDATION_VERSION,\n\n /**\n * Stores initialized plugins.\n */\n _plugins: {},\n\n /**\n * Stores generated unique ids for plugin instances\n */\n _uuids: [],\n\n /**\n * Defines a Foundation plugin, adding it to the `Foundation` namespace and the list of plugins to initialize when reflowing.\n * @param {Object} plugin - The constructor of the plugin.\n */\n plugin: function(plugin, name) {\n // Object key to use when adding to global Foundation object\n // Examples: Foundation.Reveal, Foundation.OffCanvas\n var className = (name || functionName(plugin));\n // Object key to use when storing the plugin, also used to create the identifying data attribute for the plugin\n // Examples: data-reveal, data-off-canvas\n var attrName = hyphenate(className);\n\n // Add to the Foundation object and the plugins list (for reflowing)\n this._plugins[attrName] = this[className] = plugin;\n },\n /**\n * @function\n * Populates the _uuids array with pointers to each individual plugin instance.\n * Adds the `zfPlugin` data-attribute to programmatically created plugins to allow use of $(selector).foundation(method) calls.\n * Also fires the initialization event for each plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @param {String} name - the name of the plugin, passed as a camelCased string.\n * @fires Plugin#init\n */\n registerPlugin: function(plugin, name){\n var pluginName = name ? hyphenate(name) : functionName(plugin.constructor).toLowerCase();\n plugin.uuid = GetYoDigits(6, pluginName);\n\n if(!plugin.$element.attr(`data-${pluginName}`)){ plugin.$element.attr(`data-${pluginName}`, plugin.uuid); }\n if(!plugin.$element.data('zfPlugin')){ plugin.$element.data('zfPlugin', plugin); }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n plugin.$element.trigger(`init.zf.${pluginName}`);\n\n this._uuids.push(plugin.uuid);\n\n return;\n },\n /**\n * @function\n * Removes the plugins uuid from the _uuids array.\n * Removes the zfPlugin data attribute, as well as the data-plugin-name attribute.\n * Also fires the destroyed event for the plugin, consolidating repetitive code.\n * @param {Object} plugin - an instance of a plugin, usually `this` in context.\n * @fires Plugin#destroyed\n */\n unregisterPlugin: function(plugin){\n var pluginName = hyphenate(functionName(plugin.$element.data('zfPlugin').constructor));\n\n this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);\n plugin.$element.removeAttr(`data-${pluginName}`).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */\n .trigger(`destroyed.zf.${pluginName}`);\n for(var prop in plugin){\n if(typeof plugin[prop] === 'function'){\n plugin[prop] = null; //clean up script to prep for garbage collection.\n }\n }\n return;\n },\n\n /**\n * @function\n * Causes one or more active plugins to re-initialize, resetting event listeners, recalculating positions, etc.\n * @param {String} plugins - optional string of an individual plugin key, attained by calling `$(element).data('pluginName')`, or string of a plugin class i.e. `'dropdown'`\n * @default If no argument is passed, reflow all currently active plugins.\n */\n reInit: function(plugins){\n var isJQ = plugins instanceof $;\n try{\n if(isJQ){\n plugins.each(function(){\n $(this).data('zfPlugin')._init();\n });\n }else{\n var type = typeof plugins,\n _this = this,\n fns = {\n 'object': function(plgs){\n plgs.forEach(function(p){\n p = hyphenate(p);\n $('[data-'+ p +']').foundation('_init');\n });\n },\n 'string': function(){\n plugins = hyphenate(plugins);\n $('[data-'+ plugins +']').foundation('_init');\n },\n 'undefined': function(){\n this.object(Object.keys(_this._plugins));\n }\n };\n fns[type](plugins);\n }\n }catch(err){\n console.error(err);\n }finally{\n return plugins;\n }\n },\n\n /**\n * Initialize plugins on any elements within `elem` (and `elem` itself) that aren't already initialized.\n * @param {Object} elem - jQuery object containing the element to check inside. Also checks the element itself, unless it's the `document` object.\n * @param {String|Array} plugins - A list of plugins to initialize. Leave this out to initialize everything.\n */\n reflow: function(elem, plugins) {\n\n // If plugins is undefined, just grab everything\n if (typeof plugins === 'undefined') {\n plugins = Object.keys(this._plugins);\n }\n // If plugins is a string, convert it to an array with one item\n else if (typeof plugins === 'string') {\n plugins = [plugins];\n }\n\n var _this = this;\n\n // Iterate through each plugin\n $.each(plugins, function(i, name) {\n // Get the current plugin\n var plugin = _this._plugins[name];\n\n // Localize the search to all elements inside elem, as well as elem itself, unless elem === document\n var $elem = $(elem).find('[data-'+name+']').addBack('[data-'+name+']').filter(function () {\n return typeof $(this).data(\"zfPlugin\") === 'undefined';\n });\n\n // For each plugin found, initialize it\n $elem.each(function() {\n var $el = $(this),\n opts = { reflow: true };\n\n if($el.attr('data-options')){\n $el.attr('data-options').split(';').forEach(function(option){\n var opt = option.split(':').map(function(el){ return el.trim(); });\n if(opt[0]) opts[opt[0]] = parseValue(opt[1]);\n });\n }\n try{\n $el.data('zfPlugin', new plugin($(this), opts));\n }catch(er){\n console.error(er);\n }finally{\n return;\n }\n });\n });\n },\n getFnName: functionName,\n\n addToJquery: function() {\n // TODO: consider not making this a jQuery function\n // TODO: need way to reflow vs. re-initialize\n /**\n * The Foundation jQuery method.\n * @param {String|Array} method - An action to perform on the current jQuery object.\n */\n var foundation = function(method) {\n var type = typeof method,\n $noJS = $('.no-js');\n\n if($noJS.length){\n $noJS.removeClass('no-js');\n }\n\n if(type === 'undefined'){//needs to initialize the Foundation object, or an individual plugin.\n MediaQuery._init();\n Foundation.reflow(this);\n }else if(type === 'string'){//an individual method to invoke on a plugin or group of plugins\n var args = Array.prototype.slice.call(arguments, 1);//collect all the arguments, if necessary\n var plugClass = this.data('zfPlugin');//determine the class of plugin\n\n if(typeof plugClass !== 'undefined' && typeof plugClass[method] !== 'undefined'){//make sure both the class and method exist\n if(this.length === 1){//if there's only one, call it directly.\n plugClass[method].apply(plugClass, args);\n }else{\n this.each(function(i, el){//otherwise loop through the jQuery collection and invoke the method on each\n plugClass[method].apply($(el).data('zfPlugin'), args);\n });\n }\n }else{//error for no class or no method\n throw new ReferenceError(\"We're sorry, '\" + method + \"' is not an available method for \" + (plugClass ? functionName(plugClass) : 'this element') + '.');\n }\n }else{//error for invalid argument type\n throw new TypeError(`We're sorry, ${type} is not a valid parameter. You must use a string representing the method you wish to invoke.`);\n }\n return this;\n };\n $.fn.foundation = foundation;\n return $;\n }\n};\n\nFoundation.util = {\n /**\n * Function for applying a debounce effect to a function call.\n * @function\n * @param {Function} func - Function to be called at end of timeout.\n * @param {Number} delay - Time in ms to delay the call of `func`.\n * @returns function\n */\n throttle: function (func, delay) {\n var timer = null;\n\n return function () {\n var context = this, args = arguments;\n\n if (timer === null) {\n timer = setTimeout(function () {\n func.apply(context, args);\n timer = null;\n }, delay);\n }\n };\n }\n};\n\nwindow.Foundation = Foundation;\n\n// Polyfill for requestAnimationFrame\n(function() {\n if (!Date.now || !window.Date.now)\n window.Date.now = Date.now = function() { return new Date().getTime(); };\n\n var vendors = ['webkit', 'moz'];\n for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {\n var vp = vendors[i];\n window.requestAnimationFrame = window[vp+'RequestAnimationFrame'];\n window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame']\n || window[vp+'CancelRequestAnimationFrame']);\n }\n if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)\n || !window.requestAnimationFrame || !window.cancelAnimationFrame) {\n var lastTime = 0;\n window.requestAnimationFrame = function(callback) {\n var now = Date.now();\n var nextTime = Math.max(lastTime + 16, now);\n return setTimeout(function() { callback(lastTime = nextTime); },\n nextTime - now);\n };\n window.cancelAnimationFrame = clearTimeout;\n }\n /**\n * Polyfill for performance.now, required by rAF\n */\n if(!window.performance || !window.performance.now){\n window.performance = {\n start: Date.now(),\n now: function(){ return Date.now() - this.start; }\n };\n }\n})();\nif (!Function.prototype.bind) {\n /* eslint-disable no-extend-native */\n Function.prototype.bind = function(oThis) {\n if (typeof this !== 'function') {\n // closest thing possible to the ECMAScript 5\n // internal IsCallable function\n throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');\n }\n\n var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function() {},\n fBound = function() {\n return fToBind.apply(this instanceof fNOP\n ? this\n : oThis,\n aArgs.concat(Array.prototype.slice.call(arguments)));\n };\n\n if (this.prototype) {\n // native functions don't have a prototype\n fNOP.prototype = this.prototype;\n }\n fBound.prototype = new fNOP();\n\n return fBound;\n };\n}\n// Polyfill to get the name of a function in IE9\nfunction functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = (funcNameRegex).exec((fn).toString());\n return (results && results.length > 1) ? results[1].trim() : \"\";\n }\n else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n }\n else {\n return fn.prototype.constructor.name;\n }\n}\nfunction parseValue(str){\n if ('true' === str) return true;\n else if ('false' === str) return false;\n else if (!isNaN(str * 1)) return parseFloat(str);\n return str;\n}\n// Convert PascalCase to kebab-case\n// Thank you: http://stackoverflow.com/a/8955580\nfunction hyphenate(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nexport {Foundation};\n"],"names":["Foundation","version","_plugins","_uuids","plugin","name","className","functionName","attrName","hyphenate","this","registerPlugin","pluginName","constructor","toLowerCase","uuid","GetYoDigits","$element","attr","data","trigger","push","unregisterPlugin","prop","splice","indexOf","removeAttr","removeData","reInit","plugins","isJQ","$","each","_init","_this","object","plgs","forEach","p","foundation","string","undefined","Object","keys","err","console","error","reflow","elem","i","find","addBack","filter","$el","opts","split","option","opt","map","el","trim","str","isNaN","parseFloat","parseValue","er","getFnName","addToJquery","fn","method","type","$noJS","length","removeClass","MediaQuery","TypeError","args","Array","prototype","slice","call","arguments","plugClass","ReferenceError","apply","Function","results","exec","toString","replace","util","throttle","func","delay","timer","context","setTimeout","window","Date","now","getTime","vendors","requestAnimationFrame","vp","cancelAnimationFrame","test","navigator","userAgent","lastTime","callback","nextTime","Math","max","clearTimeout","performance","start","bind","oThis","aArgs","fToBind","fNOP","fBound","concat"],"m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