{"version":3,"file":"application-B98-277C.js","sources":["../../../node_modules/foundation-sites/dist/js/foundation.esm.js","../../../app/frontend/packs/boldSelectedOption.js","../../../app/frontend/packs/embedly.js","../../../node_modules/js-cookie/src/js.cookie.js","../../../app/frontend/packs/cookieOptions.js","../../../app/frontend/packs/banner.js","../../../app/frontend/packs/firefoxEqualizerBugFix.js","../../../app/frontend/packs/hideExploreDropdownContainer.js","../../../app/frontend/packs/itemDetails.js","../../../node_modules/es-errors/type.js","../../../__vite-browser-external","../../../node_modules/object-inspect/index.js","../../../node_modules/side-channel-list/index.js","../../../node_modules/es-object-atoms/index.js","../../../node_modules/es-errors/index.js","../../../node_modules/es-errors/eval.js","../../../node_modules/es-errors/range.js","../../../node_modules/es-errors/ref.js","../../../node_modules/es-errors/syntax.js","../../../node_modules/es-errors/uri.js","../../../node_modules/math-intrinsics/abs.js","../../../node_modules/math-intrinsics/floor.js","../../../node_modules/math-intrinsics/max.js","../../../node_modules/math-intrinsics/min.js","../../../node_modules/math-intrinsics/pow.js","../../../node_modules/math-intrinsics/round.js","../../../node_modules/math-intrinsics/isNaN.js","../../../node_modules/math-intrinsics/sign.js","../../../node_modules/gopd/gOPD.js","../../../node_modules/gopd/index.js","../../../node_modules/es-define-property/index.js","../../../node_modules/has-symbols/shams.js","../../../node_modules/has-symbols/index.js","../../../node_modules/get-proto/Reflect.getPrototypeOf.js","../../../node_modules/get-proto/Object.getPrototypeOf.js","../../../node_modules/function-bind/implementation.js","../../../node_modules/function-bind/index.js","../../../node_modules/call-bind-apply-helpers/functionCall.js","../../../node_modules/call-bind-apply-helpers/functionApply.js","../../../node_modules/call-bind-apply-helpers/reflectApply.js","../../../node_modules/call-bind-apply-helpers/actualApply.js","../../../node_modules/call-bind-apply-helpers/index.js","../../../node_modules/dunder-proto/get.js","../../../node_modules/get-proto/index.js","../../../node_modules/hasown/index.js","../../../node_modules/get-intrinsic/index.js","../../../node_modules/call-bound/index.js","../../../node_modules/side-channel-map/index.js","../../../node_modules/side-channel-weakmap/index.js","../../../node_modules/side-channel/index.js","../../../node_modules/qs/lib/formats.js","../../../node_modules/qs/lib/utils.js","../../../node_modules/qs/lib/stringify.js","../../../node_modules/qs/lib/parse.js","../../../node_modules/qs/lib/index.js","../../../node_modules/linkifyjs/dist/linkify.es.js","../../../node_modules/linkify-html/dist/linkify-html.es.js","../../../app/frontend/packs/linkifyTextUrl.js","../../../app/frontend/packs/detectRobot.js","../../../app/frontend/packs/openCulturalWarning.js","../../../app/frontend/packs/openModalByDefault.js","../../../app/frontend/packs/tooltip.js","../../../app/frontend/packs/scrollTo.js","../../../app/frontend/packs/locationButton.js","../../../app/frontend/packs/showMaps.js","../../../app/frontend/packs/submitFormOnChange.js","../../../app/frontend/packs/switchControl.js","../../../app/frontend/packs/viewMore.js","../../../app/frontend/packs/waveColourPicker.js","../../../app/frontend/packs/defaultResultView.js","../../../app/frontend/packs/sortOnChange.js","../../../app/frontend/packs/handleCardImageError.js","../../../app/frontend/packs/copyToClipboard.js","../../../app/frontend/packs/scrollToUsageRightsAccordion.js","../../../app/frontend/entrypoints/application.js"],"sourcesContent":["import $ from 'jquery';\n\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nfunction _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nfunction _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nfunction _callSuper(t, o, e) {\n return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));\n}\nfunction _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nfunction _get() {\n return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {\n var p = _superPropBase(e, t);\n if (p) {\n var n = Object.getOwnPropertyDescriptor(p, t);\n return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;\n }\n }, _get.apply(null, arguments);\n}\nfunction _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nfunction _inherits(t, e) {\n if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n t.prototype = Object.create(e && e.prototype, {\n constructor: {\n value: t,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e && _setPrototypeOf(t, e);\n}\nfunction _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function () {\n return !!t;\n })();\n}\nfunction _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _possibleConstructorReturn(t, e) {\n if (e && (\"object\" == typeof e || \"function\" == typeof e)) return e;\n if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return _assertThisInitialized(t);\n}\nfunction _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nfunction _slicedToArray(r, e) {\n return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _superPropBase(t, o) {\n for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););\n return t;\n}\nfunction _superPropGet(t, e, o, r) {\n var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), e, o);\n return 2 & r && \"function\" == typeof p ? function (t) {\n return p.apply(o, t);\n } : p;\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n }\n}\n\n// Core Foundation Utilities, utilized in a number of places.\n\n/**\n * Returns a boolean for RTL support\n */\nfunction rtl() {\n return $('html').attr('dir') === 'rtl';\n}\n\n/**\n * returns a random base-36 uid with namespacing\n * @function\n * @param {Number} length - number of random base-36 digits desired. Increase for more random strings.\n * @param {String} namespace - name of plugin to be incorporated in uid, optional.\n * @default {String} '' - if no plugin name is provided, nothing is appended to the uid.\n * @returns {String} - unique id\n */\nfunction GetYoDigits() {\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 6;\n var namespace = arguments.length > 1 ? arguments[1] : undefined;\n var str = '';\n var chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var charsLength = chars.length;\n for (var i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * charsLength)];\n }\n return namespace ? \"\".concat(str, \"-\").concat(namespace) : str;\n}\n\n/**\n * Escape a string so it can be used as a regexp pattern\n * @function\n * @see https://stackoverflow.com/a/9310752/4317384\n *\n * @param {String} str - string to escape.\n * @returns {String} - escaped string\n */\nfunction RegExpEscape(str) {\n return str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\nfunction transitionend($elem) {\n var transitions = {\n 'transition': 'transitionend',\n 'WebkitTransition': 'webkitTransitionEnd',\n 'MozTransition': 'transitionend',\n 'OTransition': 'otransitionend'\n };\n var elem = document.createElement('div'),\n end;\n for (var transition in transitions) {\n if (typeof elem.style[transition] !== 'undefined') {\n end = transitions[transition];\n }\n }\n if (end) {\n return end;\n } else {\n setTimeout(function () {\n $elem.triggerHandler('transitionend', [$elem]);\n }, 1);\n return 'transitionend';\n }\n}\n\n/**\n * Return an event type to listen for window load.\n *\n * If `$elem` is passed, an event will be triggered on `$elem`. If window is already loaded, the event will still be triggered.\n * If `handler` is passed, attach it to the event on `$elem`.\n * Calling `onLoad` without handler allows you to get the event type that will be triggered before attaching the handler by yourself.\n * @function\n *\n * @param {Object} [] $elem - jQuery element on which the event will be triggered if passed.\n * @param {Function} [] handler - function to attach to the event.\n * @returns {String} - event type that should or will be triggered.\n */\nfunction onLoad($elem, handler) {\n var didLoad = document.readyState === 'complete';\n var eventType = (didLoad ? '_didLoad' : 'load') + '.zf.util.onLoad';\n var cb = function cb() {\n return $elem.triggerHandler(eventType);\n };\n if ($elem) {\n if (handler) $elem.one(eventType, handler);\n if (didLoad) setTimeout(cb);else $(window).one('load', cb);\n }\n return eventType;\n}\n\n/**\n * Retuns an handler for the `mouseleave` that ignore disappeared mouses.\n *\n * If the mouse \"disappeared\" from the document (like when going on a browser UI element, See https://git.io/zf-11410),\n * the event is ignored.\n * - If the `ignoreLeaveWindow` is `true`, the event is ignored when the user actually left the window\n * (like by switching to an other window with [Alt]+[Tab]).\n * - If the `ignoreReappear` is `true`, the event will be ignored when the mouse will reappear later on the document\n * outside of the element it left.\n *\n * @function\n *\n * @param {Function} [] handler - handler for the filtered `mouseleave` event to watch.\n * @param {Object} [] options - object of options:\n * - {Boolean} [false] ignoreLeaveWindow - also ignore when the user switched windows.\n * - {Boolean} [false] ignoreReappear - also ignore when the mouse reappeared outside of the element it left.\n * @returns {Function} - filtered handler to use to listen on the `mouseleave` event.\n */\nfunction ignoreMousedisappear(handler) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$ignoreLeaveWindo = _ref.ignoreLeaveWindow,\n ignoreLeaveWindow = _ref$ignoreLeaveWindo === void 0 ? false : _ref$ignoreLeaveWindo,\n _ref$ignoreReappear = _ref.ignoreReappear,\n ignoreReappear = _ref$ignoreReappear === void 0 ? false : _ref$ignoreReappear;\n return function leaveEventHandler(eLeave) {\n for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n rest[_key - 1] = arguments[_key];\n }\n var callback = handler.bind.apply(handler, [this, eLeave].concat(rest));\n\n // The mouse left: call the given callback if the mouse entered elsewhere\n if (eLeave.relatedTarget !== null) {\n return callback();\n }\n\n // Otherwise, check if the mouse actually left the window.\n // In firefox if the user switched between windows, the window sill have the focus by the time\n // the event is triggered. We have to debounce the event to test this case.\n setTimeout(function leaveEventDebouncer() {\n if (!ignoreLeaveWindow && document.hasFocus && !document.hasFocus()) {\n return callback();\n }\n\n // Otherwise, wait for the mouse to reeapear outside of the element,\n if (!ignoreReappear) {\n $(document).one('mouseenter', function reenterEventHandler(eReenter) {\n if (!$(eLeave.currentTarget).has(eReenter.target).length) {\n // Fill where the mouse finally entered.\n eLeave.relatedTarget = eReenter.target;\n callback();\n }\n });\n }\n }, 0);\n };\n}\n\nvar foundation_core_utils = /*#__PURE__*/Object.freeze({\n __proto__: null,\n rtl: rtl,\n GetYoDigits: GetYoDigits,\n RegExpEscape: RegExpEscape,\n transitionend: transitionend,\n onLoad: onLoad,\n ignoreMousedisappear: ignoreMousedisappear\n});\n\n// Default set of media queries\n// const defaultQueries = {\n// 'default' : 'only screen',\n// landscape : 'only screen and (orientation: landscape)',\n// portrait : 'only screen and (orientation: portrait)',\n// retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +\n// 'only screen and (min--moz-device-pixel-ratio: 2),' +\n// 'only screen and (-o-min-device-pixel-ratio: 2/1),' +\n// 'only screen and (min-device-pixel-ratio: 2),' +\n// 'only screen and (min-resolution: 192dpi),' +\n// 'only screen and (min-resolution: 2dppx)'\n// };\n\n// matchMedia() polyfill - Test a CSS media type/query in JS.\n// Authors & copyright © 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. MIT license\n/* eslint-disable */\nwindow.matchMedia || (window.matchMedia = function () {\n\n // For browsers that support matchMedium api such as IE 9 and webkit\n var styleMedia = window.styleMedia || window.media;\n\n // For those that don't support matchMedium\n if (!styleMedia) {\n var style = document.createElement('style'),\n script = document.getElementsByTagName('script')[0],\n info = null;\n style.type = 'text/css';\n style.id = 'matchmediajs-test';\n if (!script) {\n document.head.appendChild(style);\n } else {\n script.parentNode.insertBefore(style, script);\n }\n\n // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers\n info = 'getComputedStyle' in window && window.getComputedStyle(style, null) || style.currentStyle;\n styleMedia = {\n matchMedium: function matchMedium(media) {\n var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';\n\n // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers\n if (style.styleSheet) {\n style.styleSheet.cssText = text;\n } else {\n style.textContent = text;\n }\n\n // Test if media query is true or false\n return info.width === '1px';\n }\n };\n }\n return function (media) {\n return {\n matches: styleMedia.matchMedium(media || 'all'),\n media: media || 'all'\n };\n };\n}());\n/* eslint-enable */\n\nvar MediaQuery = {\n queries: [],\n current: '',\n /**\n * Initializes the media query helper, by extracting the breakpoint list from the CSS and activating the breakpoint watcher.\n * @function\n * @private\n */\n _init: function _init() {\n // make sure the initialization is only done once when calling _init() several times\n if (this.isInitialized === true) {\n return this;\n } else {\n this.isInitialized = true;\n }\n var self = this;\n var $meta = $('meta.foundation-mq');\n if (!$meta.length) {\n $('').appendTo(document.head);\n }\n var extractedStyles = $('.foundation-mq').css('font-family');\n var namedQueries;\n namedQueries = parseStyleToObject(extractedStyles);\n self.queries = []; // reset\n\n for (var key in namedQueries) {\n if (namedQueries.hasOwnProperty(key)) {\n self.queries.push({\n name: key,\n value: \"only screen and (min-width: \".concat(namedQueries[key], \")\")\n });\n }\n }\n this.current = this._getCurrentSize();\n this._watcher();\n },\n /**\n * Reinitializes the media query helper.\n * Useful if your CSS breakpoint configuration has just been loaded or has changed since the initialization.\n * @function\n * @private\n */\n _reInit: function _reInit() {\n this.isInitialized = false;\n this._init();\n },\n /**\n * Checks if the screen is at least as wide as a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's smaller.\n */\n atLeast: function atLeast(size) {\n var query = this.get(size);\n if (query) {\n return window.matchMedia(query).matches;\n }\n return false;\n },\n /**\n * Checks if the screen is within the given breakpoint.\n * If smaller than the breakpoint of larger than its upper limit it returns false.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` otherwise.\n */\n only: function only(size) {\n return size === this._getCurrentSize();\n },\n /**\n * Checks if the screen is within a breakpoint or smaller.\n * @function\n * @param {String} size - Name of the breakpoint to check.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it's larger.\n */\n upTo: function upTo(size) {\n var nextSize = this.next(size);\n\n // If the next breakpoint does not match, the screen is smaller than\n // the upper limit of this breakpoint.\n if (nextSize) {\n return !this.atLeast(nextSize);\n }\n\n // If there is no next breakpoint, the \"size\" breakpoint does not have\n // an upper limit and the screen will always be within it or smaller.\n return true;\n },\n /**\n * Checks if the screen matches to a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to check, either 'small only' or 'small'. Omitting 'only' falls back to using atLeast() method.\n * @returns {Boolean} `true` if the breakpoint matches, `false` if it does not.\n */\n is: function is(size) {\n var parts = size.trim().split(' ').filter(function (p) {\n return !!p.length;\n });\n var _parts = _slicedToArray(parts, 2),\n bpSize = _parts[0],\n _parts$ = _parts[1],\n bpModifier = _parts$ === void 0 ? '' : _parts$;\n\n // Only the breakpont\n if (bpModifier === 'only') {\n return this.only(bpSize);\n }\n // At least the breakpoint (included)\n if (!bpModifier || bpModifier === 'up') {\n return this.atLeast(bpSize);\n }\n // Up to the breakpoint (included)\n if (bpModifier === 'down') {\n return this.upTo(bpSize);\n }\n throw new Error(\"\\n Invalid breakpoint passed to MediaQuery.is().\\n Expected a breakpoint name formatted like \\\" \\\", got \\\"\".concat(size, \"\\\".\\n \"));\n },\n /**\n * Gets the media query of a breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint to get.\n * @returns {String|null} - The media query of the breakpoint, or `null` if the breakpoint doesn't exist.\n */\n get: function get(size) {\n for (var i in this.queries) {\n if (this.queries.hasOwnProperty(i)) {\n var query = this.queries[i];\n if (size === query.name) return query.value;\n }\n }\n return null;\n },\n /**\n * Get the breakpoint following the given breakpoint.\n * @function\n * @param {String} size - Name of the breakpoint.\n * @returns {String|null} - The name of the following breakpoint, or `null` if the passed breakpoint was the last one.\n */\n next: function next(size) {\n var _this = this;\n var queryIndex = this.queries.findIndex(function (q) {\n return _this._getQueryName(q) === size;\n });\n if (queryIndex === -1) {\n throw new Error(\"\\n Unknown breakpoint \\\"\".concat(size, \"\\\" passed to MediaQuery.next().\\n Ensure it is present in your Sass \\\"$breakpoints\\\" setting.\\n \"));\n }\n var nextQuery = this.queries[queryIndex + 1];\n return nextQuery ? nextQuery.name : null;\n },\n /**\n * Returns the name of the breakpoint related to the given value.\n * @function\n * @private\n * @param {String|Object} value - Breakpoint name or query object.\n * @returns {String} Name of the breakpoint.\n */\n _getQueryName: function _getQueryName(value) {\n if (typeof value === 'string') return value;\n if (_typeof(value) === 'object') return value.name;\n throw new TypeError(\"\\n Invalid value passed to MediaQuery._getQueryName().\\n Expected a breakpoint name (String) or a breakpoint query (Object), got \\\"\".concat(value, \"\\\" (\").concat(_typeof(value), \")\\n \"));\n },\n /**\n * Gets the current breakpoint name by testing every breakpoint and returning the last one to match (the biggest one).\n * @function\n * @private\n * @returns {String} Name of the current breakpoint.\n */\n _getCurrentSize: function _getCurrentSize() {\n var matched;\n for (var i = 0; i < this.queries.length; i++) {\n var query = this.queries[i];\n if (window.matchMedia(query.value).matches) {\n matched = query;\n }\n }\n return matched && this._getQueryName(matched);\n },\n /**\n * Activates the breakpoint watcher, which fires an event on the window whenever the breakpoint changes.\n * @function\n * @private\n */\n _watcher: function _watcher() {\n var _this2 = this;\n $(window).on('resize.zf.trigger', function () {\n var newSize = _this2._getCurrentSize(),\n currentSize = _this2.current;\n if (newSize !== currentSize) {\n // Change the current media query\n _this2.current = newSize;\n\n // Broadcast the media query change on the window\n $(window).trigger('changed.zf.mediaquery', [newSize, currentSize]);\n }\n });\n }\n};\n\n// Thank you: https://github.com/sindresorhus/query-string\nfunction parseStyleToObject(str) {\n var styleObject = {};\n if (typeof str !== 'string') {\n return styleObject;\n }\n str = str.trim().slice(1, -1); // browsers re-quote string style values\n\n if (!str) {\n return styleObject;\n }\n styleObject = str.split('&').reduce(function (ret, param) {\n var parts = param.replace(/\\+/g, ' ').split('=');\n var key = parts[0];\n var val = parts[1];\n key = decodeURIComponent(key);\n\n // missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n val = typeof val === 'undefined' ? null : decodeURIComponent(val);\n if (!ret.hasOwnProperty(key)) {\n ret[key] = val;\n } else if (Array.isArray(ret[key])) {\n ret[key].push(val);\n } else {\n ret[key] = [ret[key], val];\n }\n return ret;\n }, {});\n return styleObject;\n}\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 * Stores initialized plugins.\n */\n _plugins: {},\n /**\n * Stores generated unique ids for plugin instances\n */\n _uuids: [],\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(_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$1(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 registerPlugin(plugin, name) {\n var pluginName = name ? hyphenate$1(name) : functionName(plugin.constructor).toLowerCase();\n plugin.uuid = GetYoDigits(6, pluginName);\n if (!plugin.$element.attr(\"data-\".concat(pluginName))) {\n plugin.$element.attr(\"data-\".concat(pluginName), plugin.uuid);\n }\n if (!plugin.$element.data('zfPlugin')) {\n plugin.$element.data('zfPlugin', plugin);\n }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n plugin.$element.trigger(\"init.zf.\".concat(pluginName));\n this._uuids.push(plugin.uuid);\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 unregisterPlugin(plugin) {\n var pluginName = hyphenate$1(functionName(plugin.$element.data('zfPlugin').constructor));\n this._uuids.splice(this._uuids.indexOf(plugin.uuid), 1);\n plugin.$element.removeAttr(\"data-\".concat(pluginName)).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */.trigger(\"destroyed.zf.\".concat(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 * @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 reInit(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 object(plgs) {\n plgs.forEach(function (p) {\n p = hyphenate$1(p);\n $('[data-' + p + ']').foundation('_init');\n });\n },\n 'string': function string() {\n plugins = hyphenate$1(plugins);\n $('[data-' + plugins + ']').foundation('_init');\n },\n 'undefined': function undefined$1() {\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 * 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 reflow(elem, plugins) {\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 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 = {\n 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) {\n return el.trim();\n });\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 addToJquery: function addToJquery() {\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 foundation(method) {\n var type = _typeof(method),\n $noJS = $('.no-js');\n if ($noJS.length) {\n $noJS.removeClass('no-js');\n }\n if (type === 'undefined') {\n //needs to initialize the Foundation object, or an individual plugin.\n MediaQuery._init();\n Foundation.reflow(this);\n } else if (type === 'string') {\n //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') {\n //make sure both the class and method exist\n if (this.length === 1) {\n //if there's only one, call it directly.\n plugClass[method].apply(plugClass, args);\n } else {\n this.each(function (i, el) {\n //otherwise loop through the jQuery collection and invoke the method on each\n plugClass[method].apply($(el).data('zfPlugin'), args);\n });\n }\n } else {\n //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 {\n //error for invalid argument type\n throw new TypeError(\"We're sorry, \".concat(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};\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 throttle(func, delay) {\n var timer = null;\n return function () {\n var context = this,\n args = arguments;\n if (timer === null) {\n timer = setTimeout(function () {\n func.apply(context, args);\n timer = null;\n }, delay);\n }\n };\n }\n};\nwindow.Foundation = Foundation;\n\n// Polyfill for requestAnimationFrame\n(function () {\n if (!Date.now || !window.Date.now) window.Date.now = Date.now = function () {\n 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'] || window[vp + 'CancelRequestAnimationFrame'];\n }\n if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) || !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 () {\n 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 now() {\n return Date.now() - this.start;\n }\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 var aArgs = Array.prototype.slice.call(arguments, 1),\n fToBind = this,\n fNOP = function fNOP() {},\n fBound = function fBound() {\n return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));\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 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 } else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}\nfunction parseValue(str) {\n if ('true' === str) return true;else if ('false' === str) return false;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$1(str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n\nvar Box = {\n ImNotTouchingYou: ImNotTouchingYou,\n OverlapArea: OverlapArea,\n GetDimensions: GetDimensions,\n GetExplicitOffsets: GetExplicitOffsets\n};\n\n/**\n * Compares the dimensions of an element to a container and determines collision events with container.\n * @function\n * @param {jQuery} element - jQuery object to test for collisions.\n * @param {jQuery} parent - jQuery object to use as bounding container.\n * @param {Boolean} lrOnly - set to true to check left and right values only.\n * @param {Boolean} tbOnly - set to true to check top and bottom values only.\n * @default if no parent object passed, detects collisions with `window`.\n * @returns {Boolean} - true if collision free, false if a collision in any direction.\n */\nfunction ImNotTouchingYou(element, parent, lrOnly, tbOnly, ignoreBottom) {\n return OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) === 0;\n}\nfunction OverlapArea(element, parent, lrOnly, tbOnly, ignoreBottom) {\n var eleDims = GetDimensions(element),\n topOver,\n bottomOver,\n leftOver,\n rightOver;\n if (parent) {\n var parDims = GetDimensions(parent);\n bottomOver = parDims.height + parDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - parDims.offset.top;\n leftOver = eleDims.offset.left - parDims.offset.left;\n rightOver = parDims.width + parDims.offset.left - (eleDims.offset.left + eleDims.width);\n } else {\n bottomOver = eleDims.windowDims.height + eleDims.windowDims.offset.top - (eleDims.offset.top + eleDims.height);\n topOver = eleDims.offset.top - eleDims.windowDims.offset.top;\n leftOver = eleDims.offset.left - eleDims.windowDims.offset.left;\n rightOver = eleDims.windowDims.width - (eleDims.offset.left + eleDims.width);\n }\n bottomOver = ignoreBottom ? 0 : Math.min(bottomOver, 0);\n topOver = Math.min(topOver, 0);\n leftOver = Math.min(leftOver, 0);\n rightOver = Math.min(rightOver, 0);\n if (lrOnly) {\n return leftOver + rightOver;\n }\n if (tbOnly) {\n return topOver + bottomOver;\n }\n\n // use sum of squares b/c we care about overlap area.\n return Math.sqrt(topOver * topOver + bottomOver * bottomOver + leftOver * leftOver + rightOver * rightOver);\n}\n\n/**\n * Uses native methods to return an object of dimension values.\n * @function\n * @param {jQuery || HTML} element - jQuery object or DOM element for which to get the dimensions. Can be any element other that document or window.\n * @returns {Object} - nested object of integer pixel values\n * TODO - if element is window, return only those values.\n */\nfunction GetDimensions(elem) {\n elem = elem.length ? elem[0] : elem;\n if (elem === window || elem === document) {\n throw new Error(\"I'm sorry, Dave. I'm afraid I can't do that.\");\n }\n var rect = elem.getBoundingClientRect(),\n parRect = elem.parentNode.getBoundingClientRect(),\n winRect = document.body.getBoundingClientRect(),\n winY = window.pageYOffset,\n winX = window.pageXOffset;\n return {\n width: rect.width,\n height: rect.height,\n offset: {\n top: rect.top + winY,\n left: rect.left + winX\n },\n parentDims: {\n width: parRect.width,\n height: parRect.height,\n offset: {\n top: parRect.top + winY,\n left: parRect.left + winX\n }\n },\n windowDims: {\n width: winRect.width,\n height: winRect.height,\n offset: {\n top: winY,\n left: winX\n }\n }\n };\n}\n\n/**\n * Returns an object of top and left integer pixel values for dynamically rendered elements,\n * such as: Tooltip, Reveal, and Dropdown. Maintained for backwards compatibility, and where\n * you don't know alignment, but generally from\n * 6.4 forward you should use GetExplicitOffsets, as GetOffsets conflates position and alignment.\n * @function\n * @param {jQuery} element - jQuery object for the element being positioned.\n * @param {jQuery} anchor - jQuery object for the element's anchor point.\n * @param {String} position - a string relating to the desired position of the element, relative to it's anchor\n * @param {Number} vOffset - integer pixel value of desired vertical separation between anchor and element.\n * @param {Number} hOffset - integer pixel value of desired horizontal separation between anchor and element.\n * @param {Boolean} isOverflow - if a collision event is detected, sets to true to default the element to full width - any desired offset.\n * TODO alter/rewrite to work with `em` values as well/instead of pixels\n */\nfunction GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffset, isOverflow) {\n var $eleDims = GetDimensions(element),\n $anchorDims = anchor ? GetDimensions(anchor) : null;\n var topVal, leftVal;\n if ($anchorDims !== null) {\n // set position related attribute\n switch (position) {\n case 'top':\n topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);\n break;\n case 'bottom':\n topVal = $anchorDims.offset.top + $anchorDims.height + vOffset;\n break;\n case 'left':\n leftVal = $anchorDims.offset.left - ($eleDims.width + hOffset);\n break;\n case 'right':\n leftVal = $anchorDims.offset.left + $anchorDims.width + hOffset;\n break;\n }\n\n // set alignment related attribute\n switch (position) {\n case 'top':\n case 'bottom':\n switch (alignment) {\n case 'left':\n leftVal = $anchorDims.offset.left + hOffset;\n break;\n case 'right':\n leftVal = $anchorDims.offset.left - $eleDims.width + $anchorDims.width - hOffset;\n break;\n case 'center':\n leftVal = isOverflow ? hOffset : $anchorDims.offset.left + $anchorDims.width / 2 - $eleDims.width / 2 + hOffset;\n break;\n }\n break;\n case 'right':\n case 'left':\n switch (alignment) {\n case 'bottom':\n topVal = $anchorDims.offset.top - vOffset + $anchorDims.height - $eleDims.height;\n break;\n case 'top':\n topVal = $anchorDims.offset.top + vOffset;\n break;\n case 'center':\n topVal = $anchorDims.offset.top + vOffset + $anchorDims.height / 2 - $eleDims.height / 2;\n break;\n }\n break;\n }\n }\n return {\n top: topVal,\n left: leftVal\n };\n}\n\n/**\n * Runs a callback function when images are fully loaded.\n * @param {Object} images - Image(s) to check if loaded.\n * @param {Func} callback - Function to execute when image is fully loaded.\n */\nfunction onImagesLoaded(images, callback) {\n var unloaded = images.length;\n if (unloaded === 0) {\n callback();\n }\n images.each(function () {\n // Check if image is loaded\n if (this.complete && typeof this.naturalWidth !== 'undefined') {\n singleImageLoaded();\n } else {\n // If the above check failed, simulate loading on detached element.\n var image = new Image();\n // Still count image as loaded if it finalizes with an error.\n var events = \"load.zf.images error.zf.images\";\n $(image).one(events, function me() {\n // Unbind the event listeners. We're using 'one' but only one of the two events will have fired.\n $(this).off(events, me);\n singleImageLoaded();\n });\n image.src = $(this).attr('src');\n }\n });\n function singleImageLoaded() {\n unloaded--;\n if (unloaded === 0) {\n callback();\n }\n }\n}\n\n/*******************************************\n * *\n * This util was created by Marius Olbertz *\n * Please thank Marius on GitHub /owlbertz *\n * or the web http://www.mariusolbertz.de/ *\n * *\n ******************************************/\nvar keyCodes = {\n 9: 'TAB',\n 13: 'ENTER',\n 27: 'ESCAPE',\n 32: 'SPACE',\n 35: 'END',\n 36: 'HOME',\n 37: 'ARROW_LEFT',\n 38: 'ARROW_UP',\n 39: 'ARROW_RIGHT',\n 40: 'ARROW_DOWN'\n};\nvar commands = {};\n\n// Functions pulled out to be referenceable from internals\nfunction findFocusable($element) {\n if (!$element) {\n return false;\n }\n return $element.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]').filter(function () {\n if (!$(this).is(':visible') || $(this).attr('tabindex') < 0) {\n return false;\n } //only have visible elements and those that have a tabindex greater or equal 0\n return true;\n }).sort(function (a, b) {\n if ($(a).attr('tabindex') === $(b).attr('tabindex')) {\n return 0;\n }\n var aTabIndex = parseInt($(a).attr('tabindex'), 10),\n bTabIndex = parseInt($(b).attr('tabindex'), 10);\n // Undefined is treated the same as 0\n if (typeof $(a).attr('tabindex') === 'undefined' && bTabIndex > 0) {\n return 1;\n }\n if (typeof $(b).attr('tabindex') === 'undefined' && aTabIndex > 0) {\n return -1;\n }\n if (aTabIndex === 0 && bTabIndex > 0) {\n return 1;\n }\n if (bTabIndex === 0 && aTabIndex > 0) {\n return -1;\n }\n if (aTabIndex < bTabIndex) {\n return -1;\n }\n if (aTabIndex > bTabIndex) {\n return 1;\n }\n });\n}\nfunction parseKey(event) {\n var key = keyCodes[event.which || event.keyCode] || String.fromCharCode(event.which).toUpperCase();\n\n // Remove un-printable characters, e.g. for `fromCharCode` calls for CTRL only events\n key = key.replace(/\\W+/, '');\n if (event.shiftKey) key = \"SHIFT_\".concat(key);\n if (event.ctrlKey) key = \"CTRL_\".concat(key);\n if (event.altKey) key = \"ALT_\".concat(key);\n\n // Remove trailing underscore, in case only modifiers were used (e.g. only `CTRL_ALT`)\n key = key.replace(/_$/, '');\n return key;\n}\nvar Keyboard = {\n keys: getKeyCodes(keyCodes),\n /**\n * Parses the (keyboard) event and returns a String that represents its key\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n * @param {Event} event - the event generated by the event handler\n * @return String key - String that represents the key pressed\n */\n parseKey: parseKey,\n /**\n * Handles the given (keyboard) event\n * @param {Event} event - the event generated by the event handler\n * @param {String} component - Foundation component's name, e.g. Slider or Reveal\n * @param {Objects} functions - collection of functions that are to be executed\n */\n handleKey: function handleKey(event, component, functions) {\n var commandList = commands[component],\n keyCode = this.parseKey(event),\n cmds,\n command,\n fn;\n if (!commandList) return console.warn('Component not defined!');\n\n // Ignore the event if it was already handled\n if (event.zfIsKeyHandled === true) return;\n\n // This component does not differentiate between ltr and rtl\n if (typeof commandList.ltr === 'undefined') {\n cmds = commandList; // use plain list\n } else {\n // merge ltr and rtl: if document is rtl, rtl overwrites ltr and vice versa\n if (rtl()) cmds = $.extend({}, commandList.ltr, commandList.rtl);else cmds = $.extend({}, commandList.rtl, commandList.ltr);\n }\n command = cmds[keyCode];\n fn = functions[command];\n // Execute the handler if found\n if (fn && typeof fn === 'function') {\n var returnValue = fn.apply();\n\n // Mark the event as \"handled\" to prevent future handlings\n event.zfIsKeyHandled = true;\n\n // Execute function when event was handled\n if (functions.handled || typeof functions.handled === 'function') {\n functions.handled(returnValue);\n }\n } else {\n // Execute function when event was not handled\n if (functions.unhandled || typeof functions.unhandled === 'function') {\n functions.unhandled();\n }\n }\n },\n /**\n * Finds all focusable elements within the given `$element`\n * @param {jQuery} $element - jQuery object to search within\n * @return {jQuery} $focusable - all focusable elements within `$element`\n */\n\n findFocusable: findFocusable,\n /**\n * Returns the component name name\n * @param {Object} component - Foundation component, e.g. Slider or Reveal\n * @return String componentName\n */\n register: function register(componentName, cmds) {\n commands[componentName] = cmds;\n },\n // TODO9438: These references to Keyboard need to not require global. Will 'this' work in this context?\n //\n /**\n * Traps the focus in the given element.\n * @param {jQuery} $element jQuery object to trap the foucs into.\n */\n trapFocus: function trapFocus($element) {\n var $focusable = findFocusable($element),\n $firstFocusable = $focusable.eq(0),\n $lastFocusable = $focusable.eq(-1);\n $element.on('keydown.zf.trapfocus', function (event) {\n if (event.target === $lastFocusable[0] && parseKey(event) === 'TAB') {\n event.preventDefault();\n $firstFocusable.focus();\n } else if (event.target === $firstFocusable[0] && parseKey(event) === 'SHIFT_TAB') {\n event.preventDefault();\n $lastFocusable.focus();\n }\n });\n },\n /**\n * Releases the trapped focus from the given element.\n * @param {jQuery} $element jQuery object to release the focus for.\n */\n releaseFocus: function releaseFocus($element) {\n $element.off('keydown.zf.trapfocus');\n }\n};\n\n/*\n * Constants for easier comparing.\n * Can be used like Foundation.parseKey(event) === Foundation.keys.SPACE\n */\nfunction getKeyCodes(kcs) {\n var k = {};\n for (var kc in kcs) {\n if (kcs.hasOwnProperty(kc)) k[kcs[kc]] = kcs[kc];\n }\n return k;\n}\n\n/**\n * Motion module.\n * @module foundation.motion\n */\n\nvar initClasses = ['mui-enter', 'mui-leave'];\nvar activeClasses = ['mui-enter-active', 'mui-leave-active'];\nvar Motion = {\n animateIn: function animateIn(element, animation, cb) {\n animate(true, element, animation, cb);\n },\n animateOut: function animateOut(element, animation, cb) {\n animate(false, element, animation, cb);\n }\n};\nfunction Move(duration, elem, fn) {\n var anim,\n prog,\n start = null;\n if (duration === 0) {\n fn.apply(elem);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n return;\n }\n function move(ts) {\n if (!start) start = ts;\n prog = ts - start;\n fn.apply(elem);\n if (prog < duration) {\n anim = window.requestAnimationFrame(move, elem);\n } else {\n window.cancelAnimationFrame(anim);\n elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);\n }\n }\n anim = window.requestAnimationFrame(move);\n}\n\n/**\n * Animates an element in or out using a CSS transition class.\n * @function\n * @private\n * @param {Boolean} isIn - Defines if the animation is in or out.\n * @param {Object} element - jQuery or HTML object to animate.\n * @param {String} animation - CSS class to use.\n * @param {Function} cb - Callback to run when animation is finished.\n */\nfunction animate(isIn, element, animation, cb) {\n element = $(element).eq(0);\n if (!element.length) return;\n var initClass = isIn ? initClasses[0] : initClasses[1];\n var activeClass = isIn ? activeClasses[0] : activeClasses[1];\n\n // Set up the animation\n reset();\n element.addClass(animation).css('transition', 'none');\n requestAnimationFrame(function () {\n element.addClass(initClass);\n if (isIn) element.show();\n });\n\n // Start the animation\n requestAnimationFrame(function () {\n // will trigger the browser to synchronously calculate the style and layout\n // also called reflow or layout thrashing\n // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a\n element[0].offsetWidth;\n element.css('transition', '').addClass(activeClass);\n });\n\n // Clean up the animation when it finishes\n element.one(transitionend(element), finish);\n\n // Hides the element (for out animations), resets the element, and runs a callback\n function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n }\n\n // Resets transitions and removes motion-specific classes\n function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(\"\".concat(initClass, \" \").concat(activeClass, \" \").concat(animation));\n }\n}\n\nvar Nest = {\n Feather: function Feather(menu) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';\n menu.attr('role', 'menubar');\n menu.find('a').attr({\n 'role': 'menuitem'\n });\n var items = menu.find('li').attr({\n 'role': 'none'\n }),\n subMenuClass = \"is-\".concat(type, \"-submenu\"),\n subItemClass = \"\".concat(subMenuClass, \"-item\"),\n hasSubClass = \"is-\".concat(type, \"-submenu-parent\"),\n applyAria = type !== 'accordion'; // Accordions handle their own ARIA attriutes.\n\n items.each(function () {\n var $item = $(this),\n $sub = $item.children('ul');\n if ($sub.length) {\n $item.addClass(hasSubClass);\n if (applyAria) {\n var firstItem = $item.children('a:first');\n firstItem.attr({\n 'aria-haspopup': true,\n 'aria-label': firstItem.attr('aria-label') || firstItem.text()\n });\n // Note: Drilldowns behave differently in how they hide, and so need\n // additional attributes. We should look if this possibly over-generalized\n // utility (Nest) is appropriate when we rework menus in 6.4\n if (type === 'drilldown') {\n $item.attr({\n 'aria-expanded': false\n });\n }\n }\n $sub.addClass(\"submenu \".concat(subMenuClass)).attr({\n 'data-submenu': '',\n 'role': 'menubar'\n });\n if (type === 'drilldown') {\n $sub.attr({\n 'aria-hidden': true\n });\n }\n }\n if ($item.parent('[data-submenu]').length) {\n $item.addClass(\"is-submenu-item \".concat(subItemClass));\n }\n });\n return;\n },\n Burn: function Burn(menu, type) {\n var\n //items = menu.find('li'),\n subMenuClass = \"is-\".concat(type, \"-submenu\"),\n subItemClass = \"\".concat(subMenuClass, \"-item\"),\n hasSubClass = \"is-\".concat(type, \"-submenu-parent\");\n menu.find('>li, > li > ul, .menu, .menu > li, [data-submenu] > li').removeClass(\"\".concat(subMenuClass, \" \").concat(subItemClass, \" \").concat(hasSubClass, \" is-submenu-item submenu is-active\")).removeAttr('data-submenu').css('display', '');\n }\n};\n\nfunction Timer(elem, options, cb) {\n var _this = this,\n duration = options.duration,\n //options is an object for easily adding features later.\n nameSpace = Object.keys(elem.data())[0] || 'timer',\n remain = -1,\n start,\n timer;\n this.isPaused = false;\n this.restart = function () {\n remain = -1;\n clearTimeout(timer);\n this.start();\n };\n this.start = function () {\n this.isPaused = false;\n // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n remain = remain <= 0 ? duration : remain;\n elem.data('paused', false);\n start = Date.now();\n timer = setTimeout(function () {\n if (options.infinite) {\n _this.restart(); //rerun the timer.\n }\n if (cb && typeof cb === 'function') {\n cb();\n }\n }, remain);\n elem.trigger(\"timerstart.zf.\".concat(nameSpace));\n };\n this.pause = function () {\n this.isPaused = true;\n //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.\n clearTimeout(timer);\n elem.data('paused', true);\n var end = Date.now();\n remain = remain - (end - start);\n elem.trigger(\"timerpaused.zf.\".concat(nameSpace));\n };\n}\n\nvar Touch = {};\nvar startPosX,\n startTime,\n elapsedTime,\n startEvent,\n isMoving = false,\n didMoved = false;\nfunction onTouchEnd(e) {\n this.removeEventListener('touchmove', onTouchMove);\n this.removeEventListener('touchend', onTouchEnd);\n\n // If the touch did not move, consider it as a \"tap\"\n if (!didMoved) {\n var tapEvent = $.Event('tap', startEvent || e);\n $(this).trigger(tapEvent);\n }\n startEvent = null;\n isMoving = false;\n didMoved = false;\n}\nfunction onTouchMove(e) {\n if (true === $.spotSwipe.preventDefault) {\n e.preventDefault();\n }\n if (isMoving) {\n var x = e.touches[0].pageX;\n // var y = e.touches[0].pageY;\n var dx = startPosX - x;\n // var dy = startPosY - y;\n var dir;\n didMoved = true;\n elapsedTime = new Date().getTime() - startTime;\n if (Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n dir = dx > 0 ? 'left' : 'right';\n }\n // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {\n // dir = dy > 0 ? 'down' : 'up';\n // }\n if (dir) {\n e.preventDefault();\n onTouchEnd.apply(this, arguments);\n $(this).trigger($.Event('swipe', Object.assign({}, e)), dir).trigger($.Event(\"swipe\".concat(dir), Object.assign({}, e)));\n }\n }\n}\nfunction onTouchStart(e) {\n if (e.touches.length === 1) {\n startPosX = e.touches[0].pageX;\n startEvent = e;\n isMoving = true;\n didMoved = false;\n startTime = new Date().getTime();\n this.addEventListener('touchmove', onTouchMove, {\n passive: true === $.spotSwipe.preventDefault\n });\n this.addEventListener('touchend', onTouchEnd, false);\n }\n}\nfunction init() {\n this.addEventListener && this.addEventListener('touchstart', onTouchStart, {\n passive: true\n });\n}\n\n// function teardown() {\n// this.removeEventListener('touchstart', onTouchStart);\n// }\nvar SpotSwipe = /*#__PURE__*/function () {\n function SpotSwipe() {\n _classCallCheck(this, SpotSwipe);\n this.version = '1.0.0';\n this.enabled = 'ontouchstart' in document.documentElement;\n this.preventDefault = false;\n this.moveThreshold = 75;\n this.timeThreshold = 200;\n this._init();\n }\n return _createClass(SpotSwipe, [{\n key: \"_init\",\n value: function _init() {\n $.event.special.swipe = {\n setup: init\n };\n $.event.special.tap = {\n setup: init\n };\n $.each(['left', 'up', 'down', 'right'], function () {\n $.event.special[\"swipe\".concat(this)] = {\n setup: function setup() {\n $(this).on('swipe', $.noop);\n }\n };\n });\n }\n }]);\n}();\n/****************************************************\n * As far as I can tell, both setupSpotSwipe and *\n * setupTouchHandler should be idempotent, *\n * because they directly replace functions & *\n * values, and do not add event handlers directly. *\n ****************************************************/\nTouch.setupSpotSwipe = function () {\n $.spotSwipe = new SpotSwipe($);\n};\n\n/****************************************************\n * Method for adding pseudo drag events to elements *\n ***************************************************/\nTouch.setupTouchHandler = function () {\n $.fn.addTouch = function () {\n this.each(function (i, el) {\n $(el).bind('touchstart touchmove touchend touchcancel', function (event) {\n //we pass the original event object because the jQuery event\n //object is normalized to w3c specs and does not provide the TouchList\n handleTouch(event);\n });\n });\n var handleTouch = function handleTouch(event) {\n var touches = event.changedTouches,\n first = touches[0],\n eventTypes = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup'\n },\n type = eventTypes[event.type],\n simulatedEvent;\n if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {\n simulatedEvent = new window.MouseEvent(type, {\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': first.screenX,\n 'screenY': first.screenY,\n 'clientX': first.clientX,\n 'clientY': first.clientY\n });\n } else {\n simulatedEvent = document.createEvent('MouseEvent');\n simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 /*left*/, null);\n }\n first.target.dispatchEvent(simulatedEvent);\n };\n };\n};\nTouch.init = function () {\n if (typeof $.spotSwipe === 'undefined') {\n Touch.setupSpotSwipe($);\n Touch.setupTouchHandler($);\n }\n};\n\nvar MutationObserver = function () {\n var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''];\n for (var i = 0; i < prefixes.length; i++) {\n if (\"\".concat(prefixes[i], \"MutationObserver\") in window) {\n return window[\"\".concat(prefixes[i], \"MutationObserver\")];\n }\n }\n return false;\n}();\nvar triggers = function triggers(el, type) {\n el.data(type).split(' ').forEach(function (id) {\n $(\"#\".concat(id))[type === 'close' ? 'trigger' : 'triggerHandler'](\"\".concat(type, \".zf.trigger\"), [el]);\n });\n};\nvar Triggers = {\n Listeners: {\n Basic: {},\n Global: {}\n },\n Initializers: {}\n};\nTriggers.Listeners.Basic = {\n openListener: function openListener() {\n triggers($(this), 'open');\n },\n closeListener: function closeListener() {\n var id = $(this).data('close');\n if (id) {\n triggers($(this), 'close');\n } else {\n $(this).trigger('close.zf.trigger');\n }\n },\n toggleListener: function toggleListener() {\n var id = $(this).data('toggle');\n if (id) {\n triggers($(this), 'toggle');\n } else {\n $(this).trigger('toggle.zf.trigger');\n }\n },\n closeableListener: function closeableListener(e) {\n var animation = $(this).data('closable');\n\n // Only close the first closable element. See https://git.io/zf-7833\n e.stopPropagation();\n if (animation !== '') {\n Motion.animateOut($(this), animation, function () {\n $(this).trigger('closed.zf');\n });\n } else {\n $(this).fadeOut().trigger('closed.zf');\n }\n },\n toggleFocusListener: function toggleFocusListener() {\n var id = $(this).data('toggle-focus');\n $(\"#\".concat(id)).triggerHandler('toggle.zf.trigger', [$(this)]);\n }\n};\n\n// Elements with [data-open] will reveal a plugin that supports it when clicked.\nTriggers.Initializers.addOpenListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.openListener);\n $elem.on('click.zf.trigger', '[data-open]', Triggers.Listeners.Basic.openListener);\n};\n\n// Elements with [data-close] will close a plugin that supports it when clicked.\n// If used without a value on [data-close], the event will bubble, allowing it to close a parent component.\nTriggers.Initializers.addCloseListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.closeListener);\n $elem.on('click.zf.trigger', '[data-close]', Triggers.Listeners.Basic.closeListener);\n};\n\n// Elements with [data-toggle] will toggle a plugin that supports it when clicked.\nTriggers.Initializers.addToggleListener = function ($elem) {\n $elem.off('click.zf.trigger', Triggers.Listeners.Basic.toggleListener);\n $elem.on('click.zf.trigger', '[data-toggle]', Triggers.Listeners.Basic.toggleListener);\n};\n\n// Elements with [data-closable] will respond to close.zf.trigger events.\nTriggers.Initializers.addCloseableListener = function ($elem) {\n $elem.off('close.zf.trigger', Triggers.Listeners.Basic.closeableListener);\n $elem.on('close.zf.trigger', '[data-closeable], [data-closable]', Triggers.Listeners.Basic.closeableListener);\n};\n\n// Elements with [data-toggle-focus] will respond to coming in and out of focus\nTriggers.Initializers.addToggleFocusListener = function ($elem) {\n $elem.off('focus.zf.trigger blur.zf.trigger', Triggers.Listeners.Basic.toggleFocusListener);\n $elem.on('focus.zf.trigger blur.zf.trigger', '[data-toggle-focus]', Triggers.Listeners.Basic.toggleFocusListener);\n};\n\n// More Global/complex listeners and triggers\nTriggers.Listeners.Global = {\n resizeListener: function resizeListener($nodes) {\n if (!MutationObserver) {\n //fallback for IE 9\n $nodes.each(function () {\n $(this).triggerHandler('resizeme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a resize event\n $nodes.attr('data-events', \"resize\");\n },\n scrollListener: function scrollListener($nodes) {\n if (!MutationObserver) {\n //fallback for IE 9\n $nodes.each(function () {\n $(this).triggerHandler('scrollme.zf.trigger');\n });\n }\n //trigger all listening elements and signal a scroll event\n $nodes.attr('data-events', \"scroll\");\n },\n closeMeListener: function closeMeListener(e, pluginId) {\n var plugin = e.namespace.split('.')[0];\n var plugins = $(\"[data-\".concat(plugin, \"]\")).not(\"[data-yeti-box=\\\"\".concat(pluginId, \"\\\"]\"));\n plugins.each(function () {\n var _this = $(this);\n _this.triggerHandler('close.zf.trigger', [_this]);\n });\n }\n};\n\n// Global, parses whole document.\nTriggers.Initializers.addClosemeListener = function (pluginName) {\n var yetiBoxes = $('[data-yeti-box]'),\n plugNames = ['dropdown', 'tooltip', 'reveal'];\n if (pluginName) {\n if (typeof pluginName === 'string') {\n plugNames.push(pluginName);\n } else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {\n plugNames = plugNames.concat(pluginName);\n } else {\n console.error('Plugin names must be strings');\n }\n }\n if (yetiBoxes.length) {\n var listeners = plugNames.map(function (name) {\n return \"closeme.zf.\".concat(name);\n }).join(' ');\n $(window).off(listeners).on(listeners, Triggers.Listeners.Global.closeMeListener);\n }\n};\nfunction debounceGlobalListener(debounce, trigger, listener) {\n var timer,\n args = Array.prototype.slice.call(arguments, 3);\n $(window).on(trigger, function () {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(function () {\n listener.apply(null, args);\n }, debounce || 10); //default time to emit scroll event\n });\n}\nTriggers.Initializers.addResizeListener = function (debounce) {\n var $nodes = $('[data-resize]');\n if ($nodes.length) {\n debounceGlobalListener(debounce, 'resize.zf.trigger', Triggers.Listeners.Global.resizeListener, $nodes);\n }\n};\nTriggers.Initializers.addScrollListener = function (debounce) {\n var $nodes = $('[data-scroll]');\n if ($nodes.length) {\n debounceGlobalListener(debounce, 'scroll.zf.trigger', Triggers.Listeners.Global.scrollListener, $nodes);\n }\n};\nTriggers.Initializers.addMutationEventsListener = function ($elem) {\n if (!MutationObserver) {\n return false;\n }\n var $nodes = $elem.find('[data-resize], [data-scroll], [data-mutate]');\n\n //element callback\n var listeningElementsMutation = function listeningElementsMutation(mutationRecordsList) {\n var $target = $(mutationRecordsList[0].target);\n\n //trigger the event handler for the element depending on type\n switch (mutationRecordsList[0].type) {\n case \"attributes\":\n if ($target.attr(\"data-events\") === \"scroll\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('scrollme.zf.trigger', [$target, window.pageYOffset]);\n }\n if ($target.attr(\"data-events\") === \"resize\" && mutationRecordsList[0].attributeName === \"data-events\") {\n $target.triggerHandler('resizeme.zf.trigger', [$target]);\n }\n if (mutationRecordsList[0].attributeName === \"style\") {\n $target.closest(\"[data-mutate]\").attr(\"data-events\", \"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n }\n break;\n case \"childList\":\n $target.closest(\"[data-mutate]\").attr(\"data-events\", \"mutate\");\n $target.closest(\"[data-mutate]\").triggerHandler('mutateme.zf.trigger', [$target.closest(\"[data-mutate]\")]);\n break;\n default:\n return false;\n //nothing\n }\n };\n if ($nodes.length) {\n //for each element that needs to listen for resizing, scrolling, or mutation add a single observer\n for (var i = 0; i <= $nodes.length - 1; i++) {\n var elementObserver = new MutationObserver(listeningElementsMutation);\n elementObserver.observe($nodes[i], {\n attributes: true,\n childList: true,\n characterData: false,\n subtree: true,\n attributeFilter: [\"data-events\", \"style\"]\n });\n }\n }\n};\nTriggers.Initializers.addSimpleListeners = function () {\n var $document = $(document);\n Triggers.Initializers.addOpenListener($document);\n Triggers.Initializers.addCloseListener($document);\n Triggers.Initializers.addToggleListener($document);\n Triggers.Initializers.addCloseableListener($document);\n Triggers.Initializers.addToggleFocusListener($document);\n};\nTriggers.Initializers.addGlobalListeners = function () {\n var $document = $(document);\n Triggers.Initializers.addMutationEventsListener($document);\n Triggers.Initializers.addResizeListener(250);\n Triggers.Initializers.addScrollListener();\n Triggers.Initializers.addClosemeListener();\n};\nTriggers.init = function (__, Foundation) {\n onLoad($(window), function () {\n if ($.triggersInitialized !== true) {\n Triggers.Initializers.addSimpleListeners();\n Triggers.Initializers.addGlobalListeners();\n $.triggersInitialized = true;\n }\n });\n if (Foundation) {\n Foundation.Triggers = Triggers;\n // Legacy included to be backwards compatible for now.\n Foundation.IHearYou = Triggers.Initializers.addGlobalListeners;\n }\n};\n\n// Abstract class for providing lifecycle hooks. Expect plugins to define AT LEAST\n// {function} _setup (replaces previous constructor),\n// {function} _destroy (replaces previous destroy)\nvar Plugin = /*#__PURE__*/function () {\n function Plugin(element, options) {\n _classCallCheck(this, Plugin);\n this._setup(element, options);\n var pluginName = getPluginName(this);\n this.uuid = GetYoDigits(6, pluginName);\n if (!this.$element.attr(\"data-\".concat(pluginName))) {\n this.$element.attr(\"data-\".concat(pluginName), this.uuid);\n }\n if (!this.$element.data('zfPlugin')) {\n this.$element.data('zfPlugin', this);\n }\n /**\n * Fires when the plugin has initialized.\n * @event Plugin#init\n */\n this.$element.trigger(\"init.zf.\".concat(pluginName));\n }\n return _createClass(Plugin, [{\n key: \"destroy\",\n value: function destroy() {\n this._destroy();\n var pluginName = getPluginName(this);\n this.$element.removeAttr(\"data-\".concat(pluginName)).removeData('zfPlugin')\n /**\n * Fires when the plugin has been destroyed.\n * @event Plugin#destroyed\n */.trigger(\"destroyed.zf.\".concat(pluginName));\n for (var prop in this) {\n if (this.hasOwnProperty(prop)) {\n this[prop] = null; //clean up script to prep for garbage collection.\n }\n }\n }\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}\nfunction getPluginName(obj) {\n return hyphenate(obj.className);\n}\n\n/**\n * Abide module.\n * @module foundation.abide\n */\nvar Abide = /*#__PURE__*/function (_Plugin) {\n function Abide() {\n _classCallCheck(this, Abide);\n return _callSuper(this, Abide, arguments);\n }\n _inherits(Abide, _Plugin);\n return _createClass(Abide, [{\n key: \"_setup\",\n value:\n /**\n * Creates a new instance of Abide.\n * @class\n * @name Abide\n * @fires Abide#init\n * @param {Object} element - jQuery object to add the trigger to.\n * @param {Object} options - Overrides to the default plugin settings.\n */\n function _setup(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.$element = element;\n this.options = $.extend(true, {}, Abide.defaults, this.$element.data(), options);\n this.isEnabled = true;\n this.formnovalidate = null;\n this.className = 'Abide'; // ie9 back compat\n this._init();\n }\n\n /**\n * Initializes the Abide plugin and calls functions to get Abide functioning on load.\n * @private\n */\n }, {\n key: \"_init\",\n value: function _init() {\n var _this2 = this;\n this.$inputs = $.merge(\n // Consider as input to validate:\n this.$element.find('input').not('[type=\"submit\"]'),\n // * all input fields expect submit\n this.$element.find('textarea, select') // * all textareas and select fields\n );\n this.$submits = this.$element.find('[type=\"submit\"]');\n var $globalErrors = this.$element.find('[data-abide-error]');\n\n // Add a11y attributes to all fields\n if (this.options.a11yAttributes) {\n this.$inputs.each(function (i, input) {\n return _this2.addA11yAttributes($(input));\n });\n $globalErrors.each(function (i, error) {\n return _this2.addGlobalErrorA11yAttributes($(error));\n });\n }\n this._events();\n }\n\n /**\n * Initializes events for Abide.\n * @private\n */\n }, {\n key: \"_events\",\n value: function _events() {\n var _this3 = this;\n this.$element.off('.abide').on('reset.zf.abide', function () {\n _this3.resetForm();\n }).on('submit.zf.abide', function () {\n return _this3.validateForm();\n });\n this.$submits.off('click.zf.abide keydown.zf.abide').on('click.zf.abide keydown.zf.abide', function (e) {\n if (!e.key || e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n _this3.formnovalidate = e.target.getAttribute('formnovalidate') !== null;\n _this3.$element.submit();\n }\n });\n if (this.options.validateOn === 'fieldChange') {\n this.$inputs.off('change.zf.abide').on('change.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n if (this.options.liveValidate) {\n this.$inputs.off('input.zf.abide').on('input.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n if (this.options.validateOnBlur) {\n this.$inputs.off('blur.zf.abide').on('blur.zf.abide', function (e) {\n _this3.validateInput($(e.target));\n });\n }\n }\n\n /**\n * Calls necessary functions to update Abide upon DOM change\n * @private\n */\n }, {\n key: \"_reflow\",\n value: function _reflow() {\n this._init();\n }\n\n /**\n * Checks whether the submitted form should be validated or not, consodering formnovalidate and isEnabled\n * @returns {Boolean}\n * @private\n */\n }, {\n key: \"_validationIsDisabled\",\n value: function _validationIsDisabled() {\n if (this.isEnabled === false) {\n // whole validation disabled\n return true;\n } else if (typeof this.formnovalidate === 'boolean') {\n // triggered by $submit\n return this.formnovalidate;\n }\n // triggered by Enter in non-submit input\n return this.$submits.length ? this.$submits[0].getAttribute('formnovalidate') !== null : false;\n }\n\n /**\n * Enables the whole validation\n */\n }, {\n key: \"enableValidation\",\n value: function enableValidation() {\n this.isEnabled = true;\n }\n\n /**\n * Disables the whole validation\n */\n }, {\n key: \"disableValidation\",\n value: function disableValidation() {\n this.isEnabled = false;\n }\n\n /**\n * Checks whether or not a form element has the required attribute and if it's checked or not\n * @param {Object} element - jQuery object to check for required attribute\n * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty\n */\n }, {\n key: \"requiredCheck\",\n value: function requiredCheck($el) {\n if (!$el.attr('required')) return true;\n var isGood = true;\n switch ($el[0].type) {\n case 'checkbox':\n isGood = $el[0].checked;\n break;\n case 'select':\n case 'select-one':\n case 'select-multiple':\n var opt = $el.find('option:selected');\n if (!opt.length || !opt.val()) isGood = false;\n break;\n default:\n if (!$el.val() || !$el.val().length) isGood = false;\n }\n return isGood;\n }\n\n /**\n * Get:\n * - Based on $el, the first element(s) corresponding to `formErrorSelector` in this order:\n * 1. The element's direct sibling('s).\n * 2. The element's parent's children.\n * - Element(s) with the attribute `[data-form-error-for]` set with the element's id.\n *\n * This allows for multiple form errors per input, though if none are found, no form errors will be shown.\n *\n * @param {Object} $el - jQuery object to use as reference to find the form error selector.\n * @param {String[]} [failedValidators] - List of failed validators.\n * @returns {Object} jQuery object with the selector.\n */\n }, {\n key: \"findFormError\",\n value: function findFormError($el, failedValidators) {\n var _this4 = this;\n var id = $el.length ? $el[0].id : '';\n var $error = $el.siblings(this.options.formErrorSelector);\n if (!$error.length) {\n $error = $el.parent().find(this.options.formErrorSelector);\n }\n if (id) {\n $error = $error.add(this.$element.find(\"[data-form-error-for=\\\"\".concat(id, \"\\\"]\")));\n }\n if (!!failedValidators) {\n $error = $error.not('[data-form-error-on]');\n failedValidators.forEach(function (v) {\n $error = $error.add($el.siblings(\"[data-form-error-on=\\\"\".concat(v, \"\\\"]\")));\n $error = $error.add(_this4.$element.find(\"[data-form-error-for=\\\"\".concat(id, \"\\\"][data-form-error-on=\\\"\").concat(v, \"\\\"]\")));\n });\n }\n return $error;\n }\n\n /**\n * Get the first element in this order:\n * 2. The