{"version":3,"sources":["forms-api.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","obj","_conditionalElements","_conditionalElements2","__esModule","default","form","action","errors","data","timeStart","pageHeight","mc4wp","window","Gator","forms","config","mc4wp_forms_config","scrollToElement","scrollToForm","animate","auto_scroll","element","duration","alignment","document","body","on","event","getByElement","target","srcElement","trigger","id","started","init","listeners","callback","submitted_form","formConfig","getElementById","element_id","Date","now","clientHeight","setData","scrollY","addEventListener","timeElapsed","./forms/conditional-elements.js","./forms/forms.js","gator","scroll-to-element","2","toggleElement","el","show","getAttribute","conditions","split","fieldName","expectedValues","values","inputs","querySelectorAll","input","type","checked","push","value","getFieldValues","bubbleElement","parentElement","tagName","findForm","conditionMet","indexOf","style","display","forEach","required","removeAttribute","setAttribute","evaluate","elements","handleInputEvent","evt","className","Object","defineProperty","3","serialize","populate","Form","this","createElement","name","prototype","console","error","getData","hash","empty","getSerializedData","setResponse","msg","querySelector","innerHTML","reset","form-serialize","populate.js","4","EventEmitter","events","createFromElement","formElement","parseInt","all","get","formId","bind","eventName","eventArgs","setTimeout","off","./form.js","wolfy87-eventemitter","5","k_r_submitter","k_r_success_contrls","brackets","hash_serializer","result","key","match","hash_assign","keys","shift","between","Array","isArray","_values","string","index","isNaN","children","RegExp","exec","parse_keys","existing","str_serialize","replace","encodeURIComponent","options","serializer","radio_store","create","disabled","test","nodeName","val","selectOptions","isSelectedOptions","j","option","allowedEmpty","hasValue","selected","slice","6","_matcher","_level","_id","_handlers","_gatorInstances","_matchesSelector","selector","boundElement","matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","matchesSelector","parentNode","_removeHandler","splice","hasOwnProperty","_bind","remove","addEvent","_getGlobalCallback","matchesEvent","stopPropagation","cancelBubble","cancel","_handleEvent","preventDefault","useCapture","7","root","basename","constructor","namedItem","k","toString","toISOString","amd","8","scroll","elem","additionalOffset","scrollPosition","html","documentElement","elemRect","getBoundingClientRect","documentHeight","Math","max","scrollHeight","offsetHeight","bottom","height","top","maxScrollPosition","min","pageYOffset","calculateScrollOffset","offset","align","scroll-to","9","_","clone","copy","l","flags","multiline","global","ignoreCase","source","getTime","component-type","10","Emitter","mixin","fn","_callbacks","once","apply","arguments","removeListener","removeAllListeners","removeEventListener","cb","callbacks","emit","args","len","hasListeners","11","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","curr","ms","prev","req","cancelAnimationFrame","webkitCancelAnimationFrame","mozCancelAnimationFrame","clearTimeout","12","ease","Tween","_from","_curr","_done","_start","to","_to","_duration","TypeError","_ease","stop","stopped","step","_update","from","update","emitter","13","nodeType","valueOf","14","linear","inQuad","outQuad","inOutQuad","inCube","outCube","inOutCube","inQuart","outQuart","inOutQuart","inQuint","outQuint","inOutQuint","inSine","cos","PI","outSine","sin","inOutSine","inExpo","pow","outExpo","inOutExpo","inCirc","sqrt","outCirc","inOutCirc","inBack","outBack","inOutBack","s","inBounce","outBounce","inOutBounce","15","raf","x","y","start","scrollTop","pageXOffset","scrollLeft","left","tween","scrollTo","16","proto","originalGlobalValue","indexOfListener","listener","alias","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","addListener","isValidListener","listenerIsWrapped","addOnceListener","defineEvent","defineEvents","evts","addListeners","manipulateListeners","removeListeners","single","multiple","removeEvent","_events","emitEvent","listenersMap","_getOnceReturnValue","setOnceReturnValue","_onceReturnValue","noConflict"],"mappings":"CAAA,WAAe,IAA6BA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,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aoQ,WAAa,WAEtB,OADAzX,EAAQqH,aAAeuO,EAChBvO,GAIW,mBAAXpI,GAAyBA,EAAOmO,IACvCnO,EAAO,WACH,OAAOoI,IAGY,iBAAXhH,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUqH,EAGjBrH,EAAQqH,aAAeA,EA5d9B,CA8dmB,oBAAXnG,OAAyBA,OAASiF,MAAQ,KAEjD,KAAK,GAAG,CAAC,IArwEX","file":"forms-api.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 1000 && timeElapsed < 2000 && document.body.clientHeight != pageHeight) {\n\t\t\tscrollToForm(form);\n\t\t}\n\t});\n}\n\n// Bind browser events to form events (using delegation)\nGator(document.body).on('submit', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('submit', [form, event]);\n\tforms.trigger(form.id + '.submit', [form, event]);\n});\n\nGator(document.body).on('focus', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\n\tif (!form.started) {\n\t\tforms.trigger('started', [form, event]);\n\t\tforms.trigger(form.id + '.started', [form, event]);\n\t\tform.started = true;\n\t}\n});\n\nGator(document.body).on('change', '.mc4wp-form', function (event) {\n\tvar form = forms.getByElement(event.target || event.srcElement);\n\tforms.trigger('change', [form, event]);\n\tforms.trigger(form.id + '.change', [form, event]);\n});\n\n// init conditional elements\n_conditionalElements2.default.init();\n\n// register early listeners\nif (mc4wp.listeners) {\n\tvar listeners = mc4wp.listeners;\n\tfor (var i = 0; i < listeners.length; i++) {\n\t\tforms.on(listeners[i].event, listeners[i].callback);\n\t}\n\n\t// delete temp listeners array, so we don't bind twice\n\tdelete mc4wp[\"listeners\"];\n}\n\n// expose forms object\nmc4wp.forms = forms;\n\n// handle submitted form\nif (config.submitted_form) {\n\tvar formConfig = config.submitted_form,\n\t element = document.getElementById(formConfig.element_id),\n\t form = forms.getByElement(element);\n\n\thandleFormRequest(form, formConfig.action, formConfig.errors, formConfig.data);\n}\n\n// expose mc4wp object globally\nwindow.mc4wp = mc4wp;\n\n},{\"./forms/conditional-elements.js\":2,\"./forms/forms.js\":4,\"gator\":6,\"scroll-to-element\":8}],2:[function(require,module,exports){\n'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction getFieldValues(form, fieldName) {\n var values = [];\n var inputs = form.querySelectorAll('input[name=\"' + fieldName + '\"], select[name=\"' + fieldName + '\"], textarea[name=\"' + fieldName + '\"]');\n\n for (var i = 0; i < inputs.length; i++) {\n var input = inputs[i];\n var type = input.getAttribute(\"type\");\n\n if ((type === \"radio\" || type === \"checkbox\") && !input.checked) {\n continue;\n }\n\n values.push(input.value);\n }\n\n return values;\n}\n\nfunction findForm(element) {\n var bubbleElement = element;\n\n while (bubbleElement.parentElement) {\n bubbleElement = bubbleElement.parentElement;\n\n if (bubbleElement.tagName === 'FORM') {\n return bubbleElement;\n }\n }\n\n return null;\n}\n\nfunction toggleElement(el) {\n var show = !!el.getAttribute('data-show-if');\n var conditions = show ? el.getAttribute('data-show-if').split(':') : el.getAttribute('data-hide-if').split(':');\n var fieldName = conditions[0];\n var expectedValues = (conditions.length > 1 ? conditions[1] : \"*\").split('|');\n var form = findForm(el);\n var values = getFieldValues(form, fieldName);\n\n // determine whether condition is met\n var conditionMet = false;\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n\n // condition is met when value is in array of expected values OR expected values contains a wildcard and value is not empty\n conditionMet = expectedValues.indexOf(value) > -1 || expectedValues.indexOf('*') > -1 && value.length > 0;\n\n if (conditionMet) {\n break;\n }\n }\n\n // toggle element display\n if (show) {\n el.style.display = conditionMet ? '' : 'none';\n } else {\n el.style.display = conditionMet ? 'none' : '';\n }\n\n // find all inputs inside this element and toggle [required] attr (to prevent HTML5 validation on hidden elements)\n var inputs = el.querySelectorAll('input, select, textarea');\n [].forEach.call(inputs, function (el) {\n if ((conditionMet || show) && el.getAttribute('data-was-required')) {\n el.required = true;\n el.removeAttribute('data-was-required');\n }\n\n if ((!conditionMet || !show) && el.required) {\n el.setAttribute('data-was-required', \"true\");\n el.required = false;\n }\n });\n}\n\n// evaluate conditional elements globally\nfunction evaluate() {\n var elements = document.querySelectorAll('.mc4wp-form [data-show-if], .mc4wp-form [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n}\n\n// re-evaluate conditional elements for change events on forms\nfunction handleInputEvent(evt) {\n if (!evt.target || !evt.target.form || evt.target.form.className.indexOf('mc4wp-form') < 0) {\n return;\n }\n\n var form = evt.target.form;\n var elements = form.querySelectorAll('[data-show-if], [data-hide-if]');\n [].forEach.call(elements, toggleElement);\n}\n\nexports.default = {\n 'init': function init() {\n document.addEventListener('keyup', handleInputEvent, true);\n document.addEventListener('change', handleInputEvent, true);\n document.addEventListener('mc4wp-refresh', evaluate, true);\n window.addEventListener('load', evaluate);\n evaluate();\n }\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar serialize = require('form-serialize');\nvar populate = require('populate.js');\n\nvar Form = function Form(id, element) {\n\tthis.id = id;\n\tthis.element = element || document.createElement('form');\n\tthis.name = this.element.getAttribute('data-name') || \"Form #\" + this.id;\n\tthis.errors = [];\n\tthis.started = false;\n};\n\nForm.prototype.setData = function (data) {\n\ttry {\n\t\tpopulate(this.element, data);\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n};\n\nForm.prototype.getData = function () {\n\treturn serialize(this.element, { hash: true, empty: true });\n};\n\nForm.prototype.getSerializedData = function () {\n\treturn serialize(this.element, { hash: false, empty: true });\n};\n\nForm.prototype.setResponse = function (msg) {\n\tthis.element.querySelector('.mc4wp-response').innerHTML = msg;\n};\n\n// revert back to original state\nForm.prototype.reset = function () {\n\tthis.setResponse('');\n\tthis.element.querySelector('.mc4wp-form-fields').style.display = '';\n\tthis.element.reset();\n};\n\nmodule.exports = Form;\n\n},{\"form-serialize\":5,\"populate.js\":7}],4:[function(require,module,exports){\n'use strict';\n\n// deps\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar Form = require('./form.js');\n\n// variables\nvar events = new EventEmitter();\nvar forms = [];\n\n// get form by its id\n// please note that this will get the FIRST occurence of the form with that ID on the page\nfunction get(formId) {\n\n\t// do we have form for this one already?\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].id == formId) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\t// try to create from first occurence of this element\n\tvar formElement = document.querySelector('.mc4wp-form-' + formId);\n\treturn createFromElement(formElement, formId);\n}\n\n// get form by
element (or any input in form)\nfunction getByElement(element) {\n\tvar formElement = element.form || element;\n\n\tfor (var i = 0; i < forms.length; i++) {\n\t\tif (forms[i].element == formElement) {\n\t\t\treturn forms[i];\n\t\t}\n\t}\n\n\treturn createFromElement(formElement);\n}\n\n// create form object from element\nfunction createFromElement(formElement, id) {\n\tid = id || parseInt(formElement.getAttribute('data-id')) || 0;\n\tvar form = new Form(id, formElement);\n\tforms.push(form);\n\treturn form;\n}\n\nfunction all() {\n\treturn forms;\n}\n\nfunction triggerEvent(eventName, eventArgs) {\n\tif (eventName === 'submit') {\n\t\t// don't spin up new thread for submit event as we want to preventDefault()... \n\t\t// TODO: Fix that in Premium.\n\t\tevents.trigger(eventName, eventArgs);\n\t} else {\n\t\t// process in separate thread to prevent errors from breaking core functionality\n\t\twindow.setTimeout(function () {\n\t\t\tevents.trigger(eventName, eventArgs);\n\t\t}, 1);\n\t}\n}\n\nmodule.exports = {\n\t\"all\": all,\n\t\"get\": get,\n\t\"getByElement\": getByElement,\n\t\"on\": events.on.bind(events),\n\t\"trigger\": triggerEvent,\n\t\"off\": events.off.bind(events)\n};\n\n},{\"./form.js\":3,\"wolfy87-eventemitter\":16}],5:[function(require,module,exports){\n// get successful control from form and assemble into object\n// http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2\n\n// types which indicate a submit action and are not successful controls\n// these will be ignored\nvar k_r_submitter = /^(?:submit|button|image|reset|file)$/i;\n\n// node names which could be successful controls\nvar k_r_success_contrls = /^(?:input|select|textarea|keygen)/i;\n\n// Matches bracket notation.\nvar brackets = /(\\[[^\\[\\]]*\\])/g;\n\n// serializes form fields\n// @param form MUST be an HTMLForm element\n// @param options is an optional argument to configure the serialization. Default output\n// with no options specified is a url encoded string\n// - hash: [true | false] Configure the output type. If true, the output will\n// be a js object.\n// - serializer: [function] Optional serializer function to override the default one.\n// The function takes 3 arguments (result, key, value) and should return new result\n// hash and url encoded str serializers are provided with this module\n// - disabled: [true | false]. If true serialize disabled fields.\n// - empty: [true | false]. If true serialize empty fields\nfunction serialize(form, options) {\n if (typeof options != 'object') {\n options = { hash: !!options };\n }\n else if (options.hash === undefined) {\n options.hash = true;\n }\n\n var result = (options.hash) ? {} : '';\n var serializer = options.serializer || ((options.hash) ? hash_serializer : str_serialize);\n\n var elements = form && form.elements ? form.elements : [];\n\n //Object store each radio and set if it's empty or not\n var radio_store = Object.create(null);\n\n for (var i=0 ; i tag but there\n // is a inside of the a tag that it is the target,\n // it should still work\n if (element.parentNode) {\n _level++;\n return _matchesSelector(element.parentNode, selector, boundElement);\n }\n }\n\n function _addHandler(gator, event, selector, callback) {\n if (!_handlers[gator.id]) {\n _handlers[gator.id] = {};\n }\n\n if (!_handlers[gator.id][event]) {\n _handlers[gator.id][event] = {};\n }\n\n if (!_handlers[gator.id][event][selector]) {\n _handlers[gator.id][event][selector] = [];\n }\n\n _handlers[gator.id][event][selector].push(callback);\n }\n\n function _removeHandler(gator, event, selector, callback) {\n\n // if there are no events tied to this element at all\n // then don't do anything\n if (!_handlers[gator.id]) {\n return;\n }\n\n // if there is no event type specified then remove all events\n // example: Gator(element).off()\n if (!event) {\n for (var type in _handlers[gator.id]) {\n if (_handlers[gator.id].hasOwnProperty(type)) {\n _handlers[gator.id][type] = {};\n }\n }\n return;\n }\n\n // if no callback or selector is specified remove all events of this type\n // example: Gator(element).off('click')\n if (!callback && !selector) {\n _handlers[gator.id][event] = {};\n return;\n }\n\n // if a selector is specified but no callback remove all events\n // for this selector\n // example: Gator(element).off('click', '.sub-element')\n if (!callback) {\n delete _handlers[gator.id][event][selector];\n return;\n }\n\n // if we have specified an event type, selector, and callback then we\n // need to make sure there are callbacks tied to this selector to\n // begin with. if there aren't then we can stop here\n if (!_handlers[gator.id][event][selector]) {\n return;\n }\n\n // if there are then loop through all the callbacks and if we find\n // one that matches remove it from the array\n for (var i = 0; i < _handlers[gator.id][event][selector].length; i++) {\n if (_handlers[gator.id][event][selector][i] === callback) {\n _handlers[gator.id][event][selector].splice(i, 1);\n break;\n }\n }\n }\n\n function _handleEvent(id, e, type) {\n if (!_handlers[id][type]) {\n return;\n }\n\n var target = e.target || e.srcElement,\n selector,\n match,\n matches = {},\n i = 0,\n j = 0;\n\n // find all events that match\n _level = 0;\n for (selector in _handlers[id][type]) {\n if (_handlers[id][type].hasOwnProperty(selector)) {\n match = _matchesSelector(target, selector, _gatorInstances[id].element);\n\n if (match && Gator.matchesEvent(type, _gatorInstances[id].element, match, selector == '_root', e)) {\n _level++;\n _handlers[id][type][selector].match = match;\n matches[_level] = _handlers[id][type][selector];\n }\n }\n }\n\n // stopPropagation() fails to set cancelBubble to true in Webkit\n // @see http://code.google.com/p/chromium/issues/detail?id=162270\n e.stopPropagation = function() {\n e.cancelBubble = true;\n };\n\n for (i = 0; i <= _level; i++) {\n if (matches[i]) {\n for (j = 0; j < matches[i].length; j++) {\n if (matches[i][j].call(matches[i].match, e) === false) {\n Gator.cancel(e);\n return;\n }\n\n if (e.cancelBubble) {\n return;\n }\n }\n }\n }\n }\n\n /**\n * binds the specified events to the element\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @param {boolean=} remove\n * @returns {Object}\n */\n function _bind(events, selector, callback, remove) {\n\n // fail silently if you pass null or undefined as an alement\n // in the Gator constructor\n if (!this.element) {\n return;\n }\n\n if (!(events instanceof Array)) {\n events = [events];\n }\n\n if (!callback && typeof(selector) == 'function') {\n callback = selector;\n selector = '_root';\n }\n\n var id = this.id,\n i;\n\n function _getGlobalCallback(type) {\n return function(e) {\n _handleEvent(id, e, type);\n };\n }\n\n for (i = 0; i < events.length; i++) {\n if (remove) {\n _removeHandler(this, events[i], selector, callback);\n continue;\n }\n\n if (!_handlers[id] || !_handlers[id][events[i]]) {\n Gator.addEvent(this, events[i], _getGlobalCallback(events[i]));\n }\n\n _addHandler(this, events[i], selector, callback);\n }\n\n return this;\n }\n\n /**\n * Gator object constructor\n *\n * @param {Node} element\n */\n function Gator(element, id) {\n\n // called as function\n if (!(this instanceof Gator)) {\n // only keep one Gator instance per node to make sure that\n // we don't create a ton of new objects if you want to delegate\n // multiple events from the same node\n //\n // for example: Gator(document).on(...\n for (var key in _gatorInstances) {\n if (_gatorInstances[key].element === element) {\n return _gatorInstances[key];\n }\n }\n\n _id++;\n _gatorInstances[_id] = new Gator(element, _id);\n\n return _gatorInstances[_id];\n }\n\n this.element = element;\n this.id = id;\n }\n\n /**\n * adds an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.on = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback);\n };\n\n /**\n * removes an event\n *\n * @param {string|Array} events\n * @param {string} selector\n * @param {Function} callback\n * @returns {Object}\n */\n Gator.prototype.off = function(events, selector, callback) {\n return _bind.call(this, events, selector, callback, true);\n };\n\n Gator.matchesSelector = function() {};\n Gator.cancel = _cancel;\n Gator.addEvent = _addEvent;\n Gator.matchesEvent = function() {\n return true;\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Gator;\n }\n\n window.Gator = Gator;\n}) ();\n\n},{}],7:[function(require,module,exports){\n/*! populate.js v1.0.2 by @dannyvankooten | MIT license */\n;(function(root) {\n\n\t/**\n\t * Populate form fields from a JSON object.\n\t *\n\t * @param form object The form element containing your input fields.\n\t * @param data array JSON data to populate the fields with.\n\t * @param basename string Optional basename which is added to `name` attributes\n\t */\n\tvar populate = function( form, data, basename) {\n\n\t\tfor(var key in data) {\n\n\t\t\tif( ! data.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar name = key;\n\t\t\tvar value = data[key];\n\n if ('undefined' === typeof value) {\n value = '';\n }\n\n if (null === value) {\n value = '';\n }\n\n\t\t\t// handle array name attributes\n\t\t\tif(typeof(basename) !== \"undefined\") {\n\t\t\t\tname = basename + \"[\" + key + \"]\";\n\t\t\t}\n\n\t\t\tif(value.constructor === Array) {\n\t\t\t\tname += '[]';\n\t\t\t} else if(typeof value == \"object\") {\n\t\t\t\tpopulate( form, value, name);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only proceed if element is set\n\t\t\tvar element = form.elements.namedItem( name );\n\t\t\tif( ! element ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar type = element.type || element[0].type;\n\n\t\t\tswitch(type ) {\n\t\t\t\tdefault:\n\t\t\t\t\telement.value = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'radio':\n\t\t\t\tcase 'checkbox':\n\t\t\t\t\tfor( var j=0; j < element.length; j++ ) {\n\t\t\t\t\t\telement[j].checked = ( value.indexOf(element[j].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select-multiple':\n\t\t\t\t\tvar values = value.constructor == Array ? value : [value];\n\n\t\t\t\t\tfor(var k = 0; k < element.options.length; k++) {\n\t\t\t\t\t\telement.options[k].selected |= (values.indexOf(element.options[k].value) > -1 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'select':\n\t\t\t\tcase 'select-one':\n\t\t\t\t\telement.value = value.toString() || value;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date':\n \t\t\t\telement.value = new Date(value).toISOString().split('T')[0];\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t};\n\n\t// Play nice with AMD, CommonJS or a plain global object.\n\tif ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) {\n\t\tdefine(function() {\n\t\t\treturn populate;\n\t\t});\n\t}\telse if ( typeof module !== 'undefined' && module.exports ) {\n\t\tmodule.exports = populate;\n\t} else {\n\t\troot.populate = populate;\n\t}\n\n}(this));\n\n},{}],8:[function(require,module,exports){\nvar scroll = require('scroll-to');\n\nfunction calculateScrollOffset(elem, additionalOffset, alignment) {\n var body = document.body,\n html = document.documentElement;\n\n var elemRect = elem.getBoundingClientRect();\n var clientHeight = html.clientHeight;\n var documentHeight = Math.max( body.scrollHeight, body.offsetHeight, \n html.clientHeight, html.scrollHeight, html.offsetHeight );\n\n additionalOffset = additionalOffset || 0;\n\n var scrollPosition;\n if (alignment === 'bottom') {\n scrollPosition = elemRect.bottom - clientHeight;\n } else if (alignment === 'middle') {\n scrollPosition = elemRect.bottom - clientHeight / 2 - elemRect.height / 2;\n } else { // top and default\n scrollPosition = elemRect.top;\n }\n\n var maxScrollPosition = documentHeight - clientHeight;\n return Math.min(scrollPosition + additionalOffset + window.pageYOffset,\n maxScrollPosition);\n}\n\nmodule.exports = function (elem, options) {\n options = options || {};\n if (typeof elem === 'string') elem = document.querySelector(elem);\n if (elem) return scroll(0, calculateScrollOffset(elem, options.offset, options.align), options);\n};\n\n},{\"scroll-to\":15}],9:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar type;\ntry {\n type = require('component-type');\n} catch (_) {\n type = require('type');\n}\n\n/**\n * Module exports.\n */\n\nmodule.exports = clone;\n\n/**\n * Clones objects.\n *\n * @param {Mixed} any object\n * @api public\n */\n\nfunction clone(obj){\n switch (type(obj)) {\n case 'object':\n var copy = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n copy[key] = clone(obj[key]);\n }\n }\n return copy;\n\n case 'array':\n var copy = new Array(obj.length);\n for (var i = 0, l = obj.length; i < l; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n\n case 'regexp':\n // from millermedeiros/amd-utils - MIT\n var flags = '';\n flags += obj.multiline ? 'm' : '';\n flags += obj.global ? 'g' : '';\n flags += obj.ignoreCase ? 'i' : '';\n return new RegExp(obj.source, flags);\n\n case 'date':\n return new Date(obj.getTime());\n\n default: // string, number, boolean, …\n return obj;\n }\n}\n\n},{\"component-type\":13,\"type\":13}],10:[function(require,module,exports){\n\n/**\n * Expose `Emitter`.\n */\n\nmodule.exports = Emitter;\n\n/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nfunction Emitter(obj) {\n if (obj) return mixin(obj);\n};\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1)\n , callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n\n},{}],11:[function(require,module,exports){\n/**\n * Expose `requestAnimationFrame()`.\n */\n\nexports = module.exports = window.requestAnimationFrame\n || window.webkitRequestAnimationFrame\n || window.mozRequestAnimationFrame\n || fallback;\n\n/**\n * Fallback implementation.\n */\n\nvar prev = new Date().getTime();\nfunction fallback(fn) {\n var curr = new Date().getTime();\n var ms = Math.max(0, 16 - (curr - prev));\n var req = setTimeout(fn, ms);\n prev = curr;\n return req;\n}\n\n/**\n * Cancel.\n */\n\nvar cancel = window.cancelAnimationFrame\n || window.webkitCancelAnimationFrame\n || window.mozCancelAnimationFrame\n || window.clearTimeout;\n\nexports.cancel = function(id){\n cancel.call(window, id);\n};\n\n},{}],12:[function(require,module,exports){\n\n/**\n * Module dependencies.\n */\n\nvar Emitter = require('emitter');\nvar clone = require('clone');\nvar type = require('type');\nvar ease = require('ease');\n\n/**\n * Expose `Tween`.\n */\n\nmodule.exports = Tween;\n\n/**\n * Initialize a new `Tween` with `obj`.\n *\n * @param {Object|Array} obj\n * @api public\n */\n\nfunction Tween(obj) {\n if (!(this instanceof Tween)) return new Tween(obj);\n this._from = obj;\n this.ease('linear');\n this.duration(500);\n}\n\n/**\n * Mixin emitter.\n */\n\nEmitter(Tween.prototype);\n\n/**\n * Reset the tween.\n *\n * @api public\n */\n\nTween.prototype.reset = function(){\n this.isArray = 'array' === type(this._from);\n this._curr = clone(this._from);\n this._done = false;\n this._start = Date.now();\n return this;\n};\n\n/**\n * Tween to `obj` and reset internal state.\n *\n * tween.to({ x: 50, y: 100 })\n *\n * @param {Object|Array} obj\n * @return {Tween} self\n * @api public\n */\n\nTween.prototype.to = function(obj){\n this.reset();\n this._to = obj;\n return this;\n};\n\n/**\n * Set duration to `ms` [500].\n *\n * @param {Number} ms\n * @return {Tween} self\n * @api public\n */\n\nTween.prototype.duration = function(ms){\n this._duration = ms;\n return this;\n};\n\n/**\n * Set easing function to `fn`.\n *\n * tween.ease('in-out-sine')\n *\n * @param {String|Function} fn\n * @return {Tween}\n * @api public\n */\n\nTween.prototype.ease = function(fn){\n fn = 'function' == typeof fn ? fn : ease[fn];\n if (!fn) throw new TypeError('invalid easing function');\n this._ease = fn;\n return this;\n};\n\n/**\n * Stop the tween and immediately emit \"stop\" and \"end\".\n *\n * @return {Tween}\n * @api public\n */\n\nTween.prototype.stop = function(){\n this.stopped = true;\n this._done = true;\n this.emit('stop');\n this.emit('end');\n return this;\n};\n\n/**\n * Perform a step.\n *\n * @return {Tween} self\n * @api private\n */\n\nTween.prototype.step = function(){\n if (this._done) return;\n\n // duration\n var duration = this._duration;\n var now = Date.now();\n var delta = now - this._start;\n var done = delta >= duration;\n\n // complete\n if (done) {\n this._from = this._to;\n this._update(this._to);\n this._done = true;\n this.emit('end');\n return this;\n }\n\n // tween\n var from = this._from;\n var to = this._to;\n var curr = this._curr;\n var fn = this._ease;\n var p = (now - this._start) / duration;\n var n = fn(p);\n\n // array\n if (this.isArray) {\n for (var i = 0; i < from.length; ++i) {\n curr[i] = from[i] + (to[i] - from[i]) * n;\n }\n\n this._update(curr);\n return this;\n }\n\n // objech\n for (var k in from) {\n curr[k] = from[k] + (to[k] - from[k]) * n;\n }\n\n this._update(curr);\n return this;\n};\n\n/**\n * Set update function to `fn` or\n * when no argument is given this performs\n * a \"step\".\n *\n * @param {Function} fn\n * @return {Tween} self\n * @api public\n */\n\nTween.prototype.update = function(fn){\n if (0 == arguments.length) return this.step();\n this._update = fn;\n return this;\n};\n},{\"clone\":9,\"ease\":14,\"emitter\":10,\"type\":13}],13:[function(require,module,exports){\n/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object Error]': return 'error';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val !== val) return 'nan';\n if (val && val.nodeType === 1) return 'element';\n\n val = val.valueOf\n ? val.valueOf()\n : Object.prototype.valueOf.apply(val)\n\n return typeof val;\n};\n\n},{}],14:[function(require,module,exports){\n\n// easing functions from \"Tween.js\"\n\nexports.linear = function(n){\n return n;\n};\n\nexports.inQuad = function(n){\n return n * n;\n};\n\nexports.outQuad = function(n){\n return n * (2 - n);\n};\n\nexports.inOutQuad = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n;\n return - 0.5 * (--n * (n - 2) - 1);\n};\n\nexports.inCube = function(n){\n return n * n * n;\n};\n\nexports.outCube = function(n){\n return --n * n * n + 1;\n};\n\nexports.inOutCube = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n;\n return 0.5 * ((n -= 2 ) * n * n + 2);\n};\n\nexports.inQuart = function(n){\n return n * n * n * n;\n};\n\nexports.outQuart = function(n){\n return 1 - (--n * n * n * n);\n};\n\nexports.inOutQuart = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n;\n return -0.5 * ((n -= 2) * n * n * n - 2);\n};\n\nexports.inQuint = function(n){\n return n * n * n * n * n;\n}\n\nexports.outQuint = function(n){\n return --n * n * n * n * n + 1;\n}\n\nexports.inOutQuint = function(n){\n n *= 2;\n if (n < 1) return 0.5 * n * n * n * n * n;\n return 0.5 * ((n -= 2) * n * n * n * n + 2);\n};\n\nexports.inSine = function(n){\n return 1 - Math.cos(n * Math.PI / 2 );\n};\n\nexports.outSine = function(n){\n return Math.sin(n * Math.PI / 2);\n};\n\nexports.inOutSine = function(n){\n return .5 * (1 - Math.cos(Math.PI * n));\n};\n\nexports.inExpo = function(n){\n return 0 == n ? 0 : Math.pow(1024, n - 1);\n};\n\nexports.outExpo = function(n){\n return 1 == n ? n : 1 - Math.pow(2, -10 * n);\n};\n\nexports.inOutExpo = function(n){\n if (0 == n) return 0;\n if (1 == n) return 1;\n if ((n *= 2) < 1) return .5 * Math.pow(1024, n - 1);\n return .5 * (-Math.pow(2, -10 * (n - 1)) + 2);\n};\n\nexports.inCirc = function(n){\n return 1 - Math.sqrt(1 - n * n);\n};\n\nexports.outCirc = function(n){\n return Math.sqrt(1 - (--n * n));\n};\n\nexports.inOutCirc = function(n){\n n *= 2\n if (n < 1) return -0.5 * (Math.sqrt(1 - n * n) - 1);\n return 0.5 * (Math.sqrt(1 - (n -= 2) * n) + 1);\n};\n\nexports.inBack = function(n){\n var s = 1.70158;\n return n * n * (( s + 1 ) * n - s);\n};\n\nexports.outBack = function(n){\n var s = 1.70158;\n return --n * n * ((s + 1) * n + s) + 1;\n};\n\nexports.inOutBack = function(n){\n var s = 1.70158 * 1.525;\n if ( ( n *= 2 ) < 1 ) return 0.5 * ( n * n * ( ( s + 1 ) * n - s ) );\n return 0.5 * ( ( n -= 2 ) * n * ( ( s + 1 ) * n + s ) + 2 );\n};\n\nexports.inBounce = function(n){\n return 1 - exports.outBounce(1 - n);\n};\n\nexports.outBounce = function(n){\n if ( n < ( 1 / 2.75 ) ) {\n return 7.5625 * n * n;\n } else if ( n < ( 2 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 1.5 / 2.75 ) ) * n + 0.75;\n } else if ( n < ( 2.5 / 2.75 ) ) {\n return 7.5625 * ( n -= ( 2.25 / 2.75 ) ) * n + 0.9375;\n } else {\n return 7.5625 * ( n -= ( 2.625 / 2.75 ) ) * n + 0.984375;\n }\n};\n\nexports.inOutBounce = function(n){\n if (n < .5) return exports.inBounce(n * 2) * .5;\n return exports.outBounce(n * 2 - 1) * .5 + .5;\n};\n\n// aliases\n\nexports['in-quad'] = exports.inQuad;\nexports['out-quad'] = exports.outQuad;\nexports['in-out-quad'] = exports.inOutQuad;\nexports['in-cube'] = exports.inCube;\nexports['out-cube'] = exports.outCube;\nexports['in-out-cube'] = exports.inOutCube;\nexports['in-quart'] = exports.inQuart;\nexports['out-quart'] = exports.outQuart;\nexports['in-out-quart'] = exports.inOutQuart;\nexports['in-quint'] = exports.inQuint;\nexports['out-quint'] = exports.outQuint;\nexports['in-out-quint'] = exports.inOutQuint;\nexports['in-sine'] = exports.inSine;\nexports['out-sine'] = exports.outSine;\nexports['in-out-sine'] = exports.inOutSine;\nexports['in-expo'] = exports.inExpo;\nexports['out-expo'] = exports.outExpo;\nexports['in-out-expo'] = exports.inOutExpo;\nexports['in-circ'] = exports.inCirc;\nexports['out-circ'] = exports.outCirc;\nexports['in-out-circ'] = exports.inOutCirc;\nexports['in-back'] = exports.inBack;\nexports['out-back'] = exports.outBack;\nexports['in-out-back'] = exports.inOutBack;\nexports['in-bounce'] = exports.inBounce;\nexports['out-bounce'] = exports.outBounce;\nexports['in-out-bounce'] = exports.inOutBounce;\n\n},{}],15:[function(require,module,exports){\n/**\n * Module dependencies.\n */\n\nvar Tween = require('tween');\nvar raf = require('raf');\n\n/**\n * Expose `scrollTo`.\n */\n\nmodule.exports = scrollTo;\n\n/**\n * Scroll to `(x, y)`.\n *\n * @param {Number} x\n * @param {Number} y\n * @api public\n */\n\nfunction scrollTo(x, y, options) {\n options = options || {};\n\n // start position\n var start = scroll();\n\n // setup tween\n var tween = Tween(start)\n .ease(options.ease || 'out-circ')\n .to({ top: y, left: x })\n .duration(options.duration || 1000);\n\n // scroll\n tween.update(function(o){\n window.scrollTo(o.left | 0, o.top | 0);\n });\n\n // handle end\n tween.on('end', function(){\n animate = function(){};\n });\n\n // animate\n function animate() {\n raf(animate);\n tween.update();\n }\n\n animate();\n \n return tween;\n}\n\n/**\n * Return scroll position.\n *\n * @return {Object}\n * @api private\n */\n\nfunction scroll() {\n var y = window.pageYOffset || document.documentElement.scrollTop;\n var x = window.pageXOffset || document.documentElement.scrollLeft;\n return { top: y, left: x };\n}\n\n},{\"raf\":11,\"tween\":12}],16:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.5 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n })();"]}