{"version":3,"sources":["webpack:///select-typeahead.min.js","webpack:///webpack/bootstrap 2de66ff9accce0c62ed2","webpack:///./select-typeahead.js","webpack:///./node_modules/custom-event-polyfill/custom-event-polyfill.js","webpack:///./node_modules/classlist-polyfill/src/index.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","__webpack_exports__","removeLocale","str","replace","simpleMatch","input","entry","toLowerCase","words","split","filter","w","indexOf","length","getElementFromArg","el","substr","document","getElementById","body","querySelector","forEach","arr","cb","find","match","mapNodes","fn","e","children","querySelectorAll","data","push","index","value","label","textContent","text","String","trim","fillNodes","datas","option","frag","createDocumentFragment","Option","appendChild","innerHTML","getEventTarget","ev","row","target","tagName","parentNode","createDropdown","dropdown","v","createElement","setAttribute","createTextNode","scrollIntoView","scrollTop","offsetTop","findMostSignificant","found","currentScore","Number","MAX_VALUE","idx","iw","score","reduce","current","wordScore","SelectTypeahead","opts","fnDataFilter","fnInputFilter","fnMatch","keyTimeout","buttonLabel","className","calcWidth","autoSelect","tabSelect","TypeError","getAttribute","classNames","unshift","this","loaded","options","currentList","tempIndex","currentIndex","currentText","$element","$dropdown","$button","$target","_$selected","_$previousSelected","_init","create","q","__WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__","__WEBPACK_IMPORTED_MODULE_1_classlist_polyfill__","self","addEventListener","_setSelectedIndex","detail","selectedIndex","join","offsetWidth","style","width","stopPropagation","_onEntryClick","tabIndex","$input","type","timeout","ignore","keyCode","_onKeyEnter","clearTimeout","wasVisible","_onKeyPress","_onKeyUp","_onKeyDown","preventDefault","_onKeyEsc","setTimeout","_filter","_onInputFocus","_onInputBlur","_hideDropdown","offsetParent","_onButtonClick","insertBefore","placeholder","debug","display","_showDropdown","visible","_blur","_focus","setSelectionRange","_selectEntry","setActive","setText","triggerEvent","parseInt","isNaN","classList","remove","add","entryData","CustomEvent","dispatchEvent","reset","checkFor","select","setFocused","child","focus","sel","getSelectedIndex","getSelectedValue","setSelectedIndex","setSelectedValue","iter","blur","destroy","removeAttribute","removeChild","window","$","jQuery","a","inst","typeahead","ce","defaultPrevented","Error","event","params","evt","origPrevent","bubbles","cancelable","undefined","createEvent","initCustomEvent","Event","createElementNS","view","elemCtrProto","Element","objCtr","strTrim","arrIndexOf","Array","item","len","DOMEx","message","code","DOMException","checkTokenAndGetIndex","token","test","ClassList","elem","trimmedClasses","classes","_updateClassName","toString","classListProto","classListGetter","contains","tokens","arguments","updated","splice","toggle","force","result","method","classListPropDesc","ex","number","__defineGetter__","testElement","createMethod","original","DOMTokenList","_toggle"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,EAASH,GAEjCA,EAAoB,GACpBI,EAAOD,QAAUH,EAAoB,IAK/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A,EACAA,GAEAC,GAGAT,EAAAD,SAAA,WACA,MAAAhI,MAAAuB,KAAA,MAGAuF,EAAAnN,eAAA,CACA,GAAAiP,IACA9O,IAAAoO,EACArO,YAAA,EACAD,cAAA,EAEA,KACAkN,EAAAnN,eAAAiN,EAlJA,YAkJAgC,GACE,MAAAC,OAGFvC,KAAAuC,EAAAC,SAAA,aAAAD,EAAAC,SACAF,EAAA/O,YAAA,EACAiN,EAAAnN,eAAAiN,EAxJA,YAwJAgC,SAGC9B,GAAA,UAAAiC,kBACDnC,EAAAmC,iBA5JA,YA4JAb,KAGC3C,OAAArE,MAOD,WACA,YAEA,IAAA8H,GAAAxN,SAAAwC,cAAA,IAMA,IAJAgL,EAAA/E,UAAAE,IAAA,YAIA6E,EAAA/E,UAAAkE,SAAA,OACA,GAAAc,GAAA,SAAAN,GACA,GAAAO,GAAAC,aAAAhP,UAAAwO,EAEAQ,cAAAhP,UAAAwO,GAAA,SAAAlB,GACA,GAAAxO,GAAAkO,EAAAkB,UAAAjN,MAEA,KAAAnC,EAAA,EAAeA,EAAAkO,EAASlO,IACxBwO,EAAAY,UAAApP,GACAiQ,EAAA/P,KAAA6G,KAAAyH,IAIAwB,GAAA,OACAA,EAAA,UAOA,GAJAD,EAAA/E,UAAAuE,OAAA,SAIAQ,EAAA/E,UAAAkE,SAAA,OACA,GAAAiB,GAAAD,aAAAhP,UAAAqO,MAEAW,cAAAhP,UAAAqO,OAAA,SAAAf,EAAAgB,GACA,WAAAJ,aAAArI,KAAAmI,SAAAV,KAAAgB,EACAA,EAEAW,EAAAjQ,KAAA6G,KAAAyH,IAMAuB,EAAA,UJu+BM,SAAUhQ,EAAQD","file":"select-typeahead.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n__webpack_require__(1);\nmodule.exports = __webpack_require__(4);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (immutable) */ __webpack_exports__[\"create\"] = create;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_custom_event_polyfill__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classlist_polyfill__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classlist_polyfill___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_classlist_polyfill__);\n/*!\n * SelectTypeahead\n *\n * A configurable, super simple and extremely fast typeahead solution\n * for <select> elements.\n *\n * Copyright 2017 Anders Evenrud <andersevenrud@gmail.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @version 0.7.3\n * @package SelectTypeahead\n * @author Anders Evenrud <andersevenrud@gmail.com>\n * @license MIT\n */\n\n\n\n\n\n/*\n * Replace localized characters\n */\nfunction removeLocale(str) {\n  return str.replace(/[ÀÁÂÃÄÅÅÆ]/g, 'A').replace(/[àáâãäåæ]/g, 'a').replace(/[ÈÉÊË]/g, 'E').replace(/[èéêë]/g, 'e').replace(/[ØÖ]/g, 'O').replace(/[øö]/g, 'o').replace(/\\s+/g, ' '); //.replace(/[^a-z0-9\\s]/gi, '');\n}\n\n/*\n * The simplest string matching function\n */\nfunction simpleMatch(input, entry) {\n  input = input.toLowerCase();\n  entry = entry.toLowerCase();\n\n  var words = input.replace(/\\s+/, ' ').split(' ');\n  var matches = words.filter(function (w) {\n    return entry.indexOf(w) !== -1;\n  });\n\n  return matches.length === words.length;\n}\n\n/*\n * Returns a Node based on input query\n */\nfunction getElementFromArg(el) {\n  if (typeof el === 'string') {\n    if (el.substr(0, 1) === '#') {\n      el = document.getElementById(el);\n    } else {\n      el = document.body.querySelector(el);\n    }\n  }\n  return el;\n}\n\n/*\n * Faster then V8's internal .forEach, especially\n * when bound with `Node` object.\n */\nfunction forEach(arr, cb) {\n  var i = 0;\n  var l = arr.length;\n\n  for (i; i < l; i++) {\n    if (cb(arr[i], i) === false) {\n      break;\n    }\n  }\n}\n\n/*\n * Faster then V8's internal .find(), also\n * a polyfill\n */\nfunction find(arr, match) {\n  var i = 0;\n  var l = arr.length;\n\n  for (i; i < l; i++) {\n    if (match(arr[i], i)) {\n      return arr[i];\n    }\n  }\n\n  return null;\n}\n\n/*\n * Fastest Node mapping\n */\nfunction mapNodes(el, fn) {\n  var children = el.querySelectorAll('option');\n  var data = [];\n  var i = 0,\n      l = children.length,\n      e;\n  for (i; i < l; i++) {\n    e = children[i];\n    data.push({\n      index: i,\n      value: e.value,\n      label: e.textContent,\n      text: String(fn(e.textContent)).trim()\n    });\n  }\n  return data;\n}\n\n/*\n * Fills Nodes and returns data\n */\nfunction fillNodes(el, fn, datas) {\n  var option, text;\n  var data = [];\n  var frag = document.createDocumentFragment();\n  for (var i in datas) {\n    var text = datas[i];\n    var option = new Option(text, i);\n    frag.appendChild(option);\n\n    data.push({\n      index: data.length,\n      value: i,\n      label: text,\n      text: String(fn(text)).trim()\n    });\n  }\n\n  el.innerHTML = '';\n  el.appendChild(frag);\n  return data;\n}\n\n/*\n * Figure out event target\n */\nfunction getEventTarget(ev) {\n  var row = ev.target;\n  if (ev.target.tagName === 'SPAN') {\n    row = ev.target.parentNode;\n  } else if (ev.target.tagName !== 'LI') {\n    row = null;\n  }\n  return row;\n}\n\n/*\n * Creates a new document fragment with entries\n * for the dropdown\n */\nfunction createDropdown(data, dropdown) {\n  var frag = document.createDocumentFragment();\n\n  var i = 0,\n      l = data.length,\n      v,\n      e,\n      s;\n  for (i; i < l; i++) {\n    v = data[i];\n\n    e = document.createElement('li');\n    e.setAttribute('data-index', String(i));\n    e.setAttribute('data-value', String(v.value));\n\n    s = document.createElement('span');\n    s.appendChild(document.createTextNode(v.label));\n\n    e.appendChild(s);\n    frag.appendChild(e);\n  }\n\n  dropdown.appendChild(frag);\n}\n\n/*\n * Scroll an element into view\n */\nfunction scrollIntoView(el) {\n  //This apparently makes screen jump\n  //el.scrollIntoView();\n\n  var target = el.parentNode;\n  target.scrollTop = el.offsetTop;\n}\n\n/*\n * Finds most significant entry out of a list\n */\nfunction findMostSignificant(input, arr) {\n  if (!input) {\n    return false;\n  }\n\n  input = input.toLowerCase();\n\n  var found = 0;\n  var currentScore = Number.MAX_VALUE;\n\n  // We find the entry that has the match as early in the string as possible.\n  forEach(arr, function (entry, idx) {\n    var iw = entry.text.toLowerCase().replace(/\\s\\(.*\\)$/, '');\n\n    var score = iw.split(' ').reduce(function (current, w) {\n      var wordScore = w.indexOf(input);\n      if ((current === -1 || wordScore < current) && wordScore !== -1) {\n        return wordScore;\n      }\n      return current;\n    }, -1);\n\n    if (score !== -1 && score < currentScore) {\n      currentScore = score;\n      found = idx;\n    }\n  });\n\n  return found;\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// WIDGET\n/////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a new SelectTypeahead instance\n *\n * @param {String|Node}   el                        The <SELECT> to use\n * @param {Object}        [opts]                    Options\n * @param {Object}        [opts.data]               A key/value paired object instead of select data\n * @param {Function}      [opts.fnDataFilter]       A function that filters the dropdown values\n * @param {Function}      [opts.fnInputFilter]      A function that filters the input value\n * @param {Function}      [opts.fnMatch]            A function that performs A->B matching\n * @param {Number}        [opts.keyTimeout=100]     A timeout for key presses\n * @param {String}        [opts.buttonLabel='>']    A label for the button\n * @param {Array|String}  [opts.className]          A className to give the instance (or array)\n * @param {Boolean}       [opts.calcWidth=true]     Set the width of the widget\n * @param {Boolean}       [opts.tabSelect=false]    Tab-ing out from dropdown acts as enter\n * @param {Boolean}       [opts.autoSelect=false]   Automatically select the first filter result\n * @param {String}        [opts.placeholder=true]   Placeholder string (or true for autodetect)\n */\nfunction SelectTypeahead(el, opts) {\n  opts = opts || {};\n  opts.fnDataFilter = opts.fnDataFilter || removeLocale;\n  opts.fnInputFilter = opts.fnInputFilter || removeLocale;\n  opts.fnMatch = opts.fnMatch || simpleMatch;\n  opts.keyTimeout = opts.keyTimeout || 100;\n  opts.buttonLabel = opts.buttonLabel || '>';\n  opts.className = opts.className || [];\n  opts.calcWidth = opts.calcWidth !== false;\n  opts.autoSelect = opts.autoSelect === true;\n  opts.tabSelect = opts.tabSelect === true;\n\n  el = getElementFromArg(el);\n  if (!el || el.tagName !== 'SELECT') {\n    throw new TypeError('Invalid element given');\n  }\n  if (el.getAttribute('data-select-typeahead') === 'true') {\n    return;\n  }\n\n  var classNames = typeof opts.className === 'string' ? opts.className.replace(/\\s+/g, ' ').split(' ') : opts.className;\n  classNames.unshift('SelectTypeahead');\n\n  var data = [];\n  if (opts.data) {\n    data = fillNodes(el, opts.fnDataFilter, opts.data);\n  } else {\n    data = mapNodes(el, opts.fnDataFilter);\n  }\n\n  this.loaded = false;\n  this.options = opts;\n  this.data = data; // Original data list\n  this.currentList = data; // Currently used list\n  this.tempIndex = -1; // Used when using keyboard\n  this.currentIndex = -1; // The actual index we use\n  this.currentText = null;\n  this.classNames = classNames;\n  this.$element = null;\n  this.$dropdown = null;\n  this.$button = null;\n  this.$target = el;\n  this._$selected = null;\n  this._$previousSelected = null;\n\n  this._init();\n}\n\n/*\n * Initializes stuff\n */\nSelectTypeahead.prototype._init = function () {\n  // TODO: These events leak when instance is destroyed, better clean up!\n  var self = this;\n  var el = this.$target;\n  var opts = this.options;\n\n  this.$target.addEventListener('setSelectedIndex', function (ev) {\n    self._setSelectedIndex(ev.detail, true, true, true);\n  }, false);\n\n  this.$target.addEventListener('_update', function (ev) {\n    var selectedIndex = this.selectedIndex;\n    if (selectedIndex >= 0) {\n      self._setSelectedIndex(selectedIndex, false, false, true, false);\n    }\n  });\n\n  this.$element = document.createElement('div');\n  this.$element.className = this.classNames.join(' ');\n  if (opts.calcWidth && el.offsetWidth) {\n    this.$element.style.width = String(el.offsetWidth) + 'px';\n  }\n\n  this.$dropdown = document.createElement('ul');\n  this.$dropdown.addEventListener('click', function (ev) {\n    ev.stopPropagation();\n  });\n  this.$dropdown.addEventListener('mousedown', function (ev) {\n    ev.stopPropagation();\n\n    var row = getEventTarget(ev);\n    self._onEntryClick(ev, row);\n  }, true);\n\n  this.$target.tabIndex = -1;\n\n  this.$input = document.createElement('input');\n  this.$input.type = 'text';\n  this.$input.setAttribute('autocomplete', 'off');\n  this.$input.setAttribute('autocorrect', 'off');\n  this.$input.setAttribute('spellcheck', 'false');\n\n  var timeout;\n  var ignore = [9, 17, 16, 18, 39, 37]; // tab, ctrl, shift, alt, right, left\n\n  if (this.options.autoSelect || this.options.tabSelect) {\n    this.$input.addEventListener('keydown', function (ev) {\n      if (ev.keyCode === 9) {\n        self._onKeyEnter();\n      }\n    });\n  }\n\n  this.$input.addEventListener('keydown', function (ev) {\n    timeout = clearTimeout(timeout);\n    if (ignore.indexOf(ev.keyCode) !== -1) {\n      return;\n    }\n\n    var wasVisible = self._onKeyPress();\n\n    if (ev.keyCode === 38) {\n      self._onKeyUp(wasVisible);\n    } else if (ev.keyCode === 40) {\n      self._onKeyDown(wasVisible);\n    } else if (ev.keyCode === 13) {\n      ev.preventDefault();\n      self._onKeyEnter();\n    } else if (ev.keyCode === 27) {\n      ev.preventDefault(); // Needed for FF and IE\n      self._onKeyEsc();\n    } else {\n      timeout = setTimeout(function keyTimeout() {\n        self._filter(false);\n      }, opts.keyTimeout);\n    }\n  });\n  this.$input.addEventListener('focus', function (ev) {\n    self._onInputFocus();\n  });\n\n  this.$input.addEventListener('blur', function (ev) {\n    self._onInputBlur();\n  });\n\n  document.body.addEventListener('click', function (ev) {\n    if (ev.target === self.$input || ev.target === self.$dropdown) {\n      return;\n    }\n    self._hideDropdown();\n  });\n\n  this.$button = document.createElement('button');\n  this.$button.tabIndex = -1;\n  if (opts.buttonLabel) {\n    this.$button.appendChild(document.createTextNode(opts.buttonLabel));\n  }\n  this.$button.addEventListener('mousedown', function (ev) {\n    if (self.$dropdown && self.$dropdown.offsetParent) {\n      ev.stopPropagation();\n      ev.preventDefault();\n    }\n  });\n  this.$button.addEventListener('click', function (ev) {\n    ev.stopPropagation();\n    ev.preventDefault();\n    self._onButtonClick();\n  });\n\n  // Render\n  this.$element.appendChild(this.$dropdown);\n  this.$element.appendChild(this.$input);\n  this.$element.appendChild(this.$button);\n  createDropdown(this.data, this.$dropdown);\n  el.parentNode.insertBefore(this.$element, el);\n  if (el.selectedIndex >= 0) {\n    if (!(el.selectedIndex === 0 && this.options.placeholder && el.value === '')) {\n      this._setSelectedIndex(el.selectedIndex, true, false, true, true);\n    }\n  }\n\n  if (!opts.debug) {\n    el.style.display = 'none';\n  }\n  el.setAttribute('data-select-typeahead', 'true');\n\n  if (this.options.placeholder !== false) {\n    var placeholder;\n\n    if (this.options.placeholder === true || typeof this.options.placeholder === 'undefined') {\n      placeholder = this.$target.getAttribute('placeholder') || this.$target.getAttribute('data-placeholder');\n    } else {\n      placeholder = this.options.placeholder;\n    }\n\n    this.$input.placeholder = placeholder || '';\n  }\n\n  this.tempIndex = this.currentIndex;\n  this.loaded = true;\n};\n\n/*\n * Show the dropdown\n */\nSelectTypeahead.prototype._showDropdown = function () {\n  var visible = this.$dropdown.offsetParent !== null;\n  this.$dropdown.style.display = 'block';\n  return visible;\n};\n\n/*\n * Hide the dropdown\n */\nSelectTypeahead.prototype._hideDropdown = function () {\n  this.$dropdown.style.display = 'none';\n};\n\n/*\n * Blur function\n */\nSelectTypeahead.prototype._blur = function () {\n  this._setSelectedIndex(this.$target.selectedIndex, true, false);\n  this._hideDropdown();\n\n  this._filter(true);\n};\n\n/*\n * Focus function\n */\nSelectTypeahead.prototype._focus = function () {\n  this.$input.setSelectionRange(0, this.$input.value.length);\n};\n\n/*\n * Internal for setting selected entry\n */\nSelectTypeahead.prototype._selectEntry = function (entry, setActive, setText, triggerEvent) {\n  var idx = entry ? parseInt(entry.getAttribute('data-index'), 10) : -1;\n  var value = entry ? entry.getAttribute('data-value') : null;\n  var text = idx !== null && idx >= 0 ? this.data[idx].label : '';\n\n  if (value !== null && !isNaN(Number(value))) {\n    value = parseInt(value, 10);\n  }\n\n  this._$previousSelected = this._$selected;\n  if (this._$previousSelected) {\n    this._$previousSelected.classList.remove('active');\n  }\n\n  this._$selected = entry;\n  if (this._$selected) {\n    this._$selected.classList.add('active');\n    scrollIntoView(this._$selected);\n  }\n\n  this.currentIndex = idx;\n  if (setText) {\n    this.$input.value = text;\n  }\n\n  if (setActive) {\n    this.$target.selectedIndex = idx;\n    this.$target.value = value;\n    this.tempIndex = idx;\n    this.currentText = text;\n  }\n\n  var entryData = {\n    index: idx,\n    value: value,\n    text: text\n  };\n\n  if (triggerEvent) {\n    var ev = new CustomEvent('select', {\n      detail: entryData\n    });\n\n    this.$target.dispatchEvent(ev);\n  }\n\n  return entryData;\n};\n\n/*\n * Filters the dropdown\n */\nSelectTypeahead.prototype._filter = function (reset) {\n  var self = this;\n  if (!this.loaded) {\n    return;\n  }\n\n  var input = reset ? '' : String(this.options.fnInputFilter(this.$input.value)).trim();\n  var checkFor = null;\n  if (input !== this.currentText) {\n    checkFor = input;\n  }\n\n  var currentList = [];\n  var fn = this.options.fnMatch;\n  forEach(this.$dropdown.children, function (e, i) {\n    var data = self.data[i];\n    if (checkFor && !fn(checkFor, data.text)) {\n      e.classList.add('invisible');\n    } else {\n      e.classList.remove('invisible');\n      currentList.push(data);\n    }\n  });\n\n  //simpleSort(checkFor, currentList);\n\n  this.currentList = currentList;\n\n  if (!reset && this.options.autoSelect && currentList.length) {\n    var found = findMostSignificant(checkFor, currentList);\n    if (found !== false) {\n      var select = currentList[found].index;\n      this._setSelectedIndex(select, false, false, false);\n      this.tempIndex = found;\n    } else {\n      this.tempIndex = -1;\n    }\n  } else {\n    this.$dropdown.scrollTop = 0;\n\n    if (!reset) {\n      this.currentIndex = -1;\n      this.tempIndex = -1;\n    }\n  }\n};\n\n/*\n * Select entry by value, text or index\n */\nSelectTypeahead.prototype._setSelectedIndex = function (index, setActive, setFocused, setText, triggerEvent) {\n  setActive = setActive !== false;\n  setFocused = setFocused !== false;\n  setText = setText !== false;\n  triggerEvent = triggerEvent === true;\n\n  var child = this.$dropdown.children[index];\n  var entry = this._selectEntry(child, setActive, setText, triggerEvent);\n\n  // Deffer the text selection\n  var self = this;\n  if (setFocused) {\n    setTimeout(function selectTimeout() {\n      self.$input.setSelectionRange(0, self.$input.value.length);\n    }, 1);\n  }\n};\n\n/*\n * When input is focused\n */\nSelectTypeahead.prototype._onInputFocus = function () {\n  this._focus();\n};\n\n/*\n * When input is blurred\n */\nSelectTypeahead.prototype._onInputBlur = function () {\n  this._blur();\n};\n\n/*\n * When button is clicked\n */\nSelectTypeahead.prototype._onButtonClick = function () {\n  var visible = this.$dropdown.offsetParent !== null;\n  this.$dropdown.style.display = visible ? 'none' : 'block';\n\n  this._focus();\n\n  this.$input.focus();\n\n  if (this._$selected) {\n    scrollIntoView(this._$selected);\n  }\n};\n\n/*\n * When enter key is pressed\n */\nSelectTypeahead.prototype._onKeyEnter = function () {\n  if (this.currentIndex >= 0) {\n    this._setSelectedIndex(this.currentIndex, true, true, true, true);\n  }\n  this._hideDropdown();\n  this._filter(true);\n};\n\n/*\n * When esc key is pressed\n */\nSelectTypeahead.prototype._onKeyEsc = function () {\n  this._filter(true);\n\n  this._blur();\n};\n\n/*\n * When up key is pressed\n */\nSelectTypeahead.prototype._onKeyUp = function (wasVisible) {\n  if (!this.currentList.length) {\n    return;\n  }\n\n  var idx = this.tempIndex;\n  if (idx <= 0) {\n    idx = this.currentList.length - 1;\n  } else {\n    if (wasVisible) {\n      idx--;\n    }\n  }\n\n  var sel = this.currentList[idx];\n  if (sel) {\n    this._setSelectedIndex(sel.index, false);\n  }\n  this.tempIndex = idx;\n};\n\n/*\n * When down key is pressed\n */\nSelectTypeahead.prototype._onKeyDown = function (wasVisible) {\n  if (!this.currentList.length) {\n    return;\n  }\n\n  var idx = this.tempIndex;\n  if (idx >= this.currentList.length - 1) {\n    idx = 0;\n  } else {\n    if (wasVisible) {\n      idx++;\n    }\n  }\n\n  var sel = this.currentList[idx];\n  if (sel) {\n    this._setSelectedIndex(sel.index, false);\n  }\n  this.tempIndex = idx;\n};\n\n/*\n * When a key is pressed\n */\nSelectTypeahead.prototype._onKeyPress = function () {\n  return this._showDropdown();\n};\n\n/*\n * When an entry was clicked\n */\nSelectTypeahead.prototype._onEntryClick = function (ev, entry) {\n  if (entry) {\n    this._selectEntry(entry, true, true, true);\n    this._hideDropdown();\n  }\n};\n\n/**\n * Get selected by index\n *\n * @function getSelectedIndex\n * @memberof SelectTypeahead#\n * @return {Number}\n */\nSelectTypeahead.prototype.getSelectedIndex = function () {\n  return this.$target.selectedIndex;\n};\n\n/**\n * Get selected by value\n *\n * @param {Boolean} [text=false]  Return the text label, not actual value\n * @function getSelectedValue\n * @memberof SelectTypeahead#\n * @return {Number|String}\n */\nSelectTypeahead.prototype.getSelectedValue = function (text) {\n  var idx = this.getSelectedIndex();\n  if (idx >= 0) {\n    var found = this.data[idx];\n    if (found) {\n      return text ? found.label : found.value;\n    }\n  }\n  return null;\n};\n\n/**\n * Set selected by index\n *\n * @param {Number} idx Index\n * @function setSelectedIndex\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.setSelectedIndex = function (idx) {\n  this._setSelectedIndex(idx);\n};\n\n/**\n * Set selected by value\n *\n * @param {String} value Value\n * @param {Boolean} [text=false] Set selected based on text not actual value\n * @function setSelectedValue\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.setSelectedValue = function (value, text) {\n  var found = find(this.data, function (iter) {\n    if (text) {\n      return iter.text === value || iter.label === value;\n    }\n    return String(iter.value) === String(value);\n  });\n\n  if (found) {\n    this.setSelectedIndex(found.index);\n  }\n};\n\n/**\n * Focus the element\n *\n * @function focus\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.focus = function () {\n  this.$input.focus();\n  this._focus();\n};\n\n/**\n * Blur the element\n *\n * @function blur\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.blur = function () {\n  this.$input.blur();\n  this._blur();\n};\n\n/**\n * Destroy the instance\n *\n * @function destroy\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.destroy = function () {\n  this.$target.removeAttribute('data-select-typeahead');\n  this.$target.style.display = 'block';\n\n  if (this.$element && this.$element.parentNode) {\n    this.$element.parentNode.removeChild(this.$element);\n  }\n\n  this.$element = null;\n  this.$dropdown = null;\n  this.$button = null;\n  this.$target = null;\n  this._$selected = null;\n  this._$previousSelected = null;\n};\n\n/////////////////////////////////////////////////////////////////////////////\n// EXPORTS\n/////////////////////////////////////////////////////////////////////////////\n\nif (typeof window !== 'undefined') {\n  window.SelectTypeahead = function (e, q) {\n    return new SelectTypeahead(e, q);\n  };\n\n  // Make jQuery compatible export\n  var $ = window.$ || window.jQuery;\n  if ($) {\n    $.fn.SelectTypeahead = function (a) {\n      var inst = this.get(0);\n      if (!inst.typeahead) {\n        inst.typeahead = new SelectTypeahead($(this).get(0), a);\n      }\n      return inst.typeahead;\n    };\n  }\n}\n\nfunction create(e, q) {\n  return new SelectTypeahead(e, q);\n}\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\ntry {\n    var ce = new window.CustomEvent('test');\n    ce.preventDefault();\n    if (ce.defaultPrevented !== true) {\n        // IE has problems with .preventDefault() on custom events\n        // http://stackoverflow.com/questions/23349191\n        throw new Error('Could not prevent default');\n    }\n} catch(e) {\n  var CustomEvent = function(event, params) {\n    var evt, origPrevent;\n    params = params || {\n      bubbles: false,\n      cancelable: false,\n      detail: undefined\n    };\n\n    evt = document.createEvent(\"CustomEvent\");\n    evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n    origPrevent = evt.preventDefault;\n    evt.preventDefault = function () {\n      origPrevent.call(this);\n      try {\n        Object.defineProperty(this, 'defaultPrevented', {\n          get: function () {\n            return true;\n          }\n        });\n      } catch(e) {\n        this.defaultPrevented = true;\n      }\n    };\n    return evt;\n  };\n\n  CustomEvent.prototype = window.Event.prototype;\n  window.CustomEvent = CustomEvent; // expose definition to window\n}\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n *   See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif (\"document\" in window.self) {\n\n// Full polyfill for browsers with no classList support\n// Including IE < Edge missing SVGElement.classList\nif (!(\"classList\" in document.createElement(\"_\")) \n\t|| document.createElementNS && !(\"classList\" in document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"))) {\n\n(function (view) {\n\n\"use strict\";\n\nif (!('Element' in view)) return;\n\nvar\n\t  classListProp = \"classList\"\n\t, protoProp = \"prototype\"\n\t, elemCtrProto = view.Element[protoProp]\n\t, objCtr = Object\n\t, strTrim = String[protoProp].trim || function () {\n\t\treturn this.replace(/^\\s+|\\s+$/g, \"\");\n\t}\n\t, arrIndexOf = Array[protoProp].indexOf || function (item) {\n\t\tvar\n\t\t\t  i = 0\n\t\t\t, len = this.length\n\t\t;\n\t\tfor (; i < len; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\t// Vendors: please allow content code to instantiate DOMExceptions\n\t, DOMEx = function (type, message) {\n\t\tthis.name = type;\n\t\tthis.code = DOMException[type];\n\t\tthis.message = message;\n\t}\n\t, checkTokenAndGetIndex = function (classList, token) {\n\t\tif (token === \"\") {\n\t\t\tthrow new DOMEx(\n\t\t\t\t  \"SYNTAX_ERR\"\n\t\t\t\t, \"An invalid or illegal string was specified\"\n\t\t\t);\n\t\t}\n\t\tif (/\\s/.test(token)) {\n\t\t\tthrow new DOMEx(\n\t\t\t\t  \"INVALID_CHARACTER_ERR\"\n\t\t\t\t, \"String contains an invalid character\"\n\t\t\t);\n\t\t}\n\t\treturn arrIndexOf.call(classList, token);\n\t}\n\t, ClassList = function (elem) {\n\t\tvar\n\t\t\t  trimmedClasses = strTrim.call(elem.getAttribute(\"class\") || \"\")\n\t\t\t, classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : []\n\t\t\t, i = 0\n\t\t\t, len = classes.length\n\t\t;\n\t\tfor (; i < len; i++) {\n\t\t\tthis.push(classes[i]);\n\t\t}\n\t\tthis._updateClassName = function () {\n\t\t\telem.setAttribute(\"class\", this.toString());\n\t\t};\n\t}\n\t, classListProto = ClassList[protoProp] = []\n\t, classListGetter = function () {\n\t\treturn new ClassList(this);\n\t}\n;\n// Most DOMException implementations don't allow calling DOMException's toString()\n// on non-DOMExceptions. Error's toString() is sufficient here.\nDOMEx[protoProp] = Error[protoProp];\nclassListProto.item = function (i) {\n\treturn this[i] || null;\n};\nclassListProto.contains = function (token) {\n\ttoken += \"\";\n\treturn checkTokenAndGetIndex(this, token) !== -1;\n};\nclassListProto.add = function () {\n\tvar\n\t\t  tokens = arguments\n\t\t, i = 0\n\t\t, l = tokens.length\n\t\t, token\n\t\t, updated = false\n\t;\n\tdo {\n\t\ttoken = tokens[i] + \"\";\n\t\tif (checkTokenAndGetIndex(this, token) === -1) {\n\t\t\tthis.push(token);\n\t\t\tupdated = true;\n\t\t}\n\t}\n\twhile (++i < l);\n\n\tif (updated) {\n\t\tthis._updateClassName();\n\t}\n};\nclassListProto.remove = function () {\n\tvar\n\t\t  tokens = arguments\n\t\t, i = 0\n\t\t, l = tokens.length\n\t\t, token\n\t\t, updated = false\n\t\t, index\n\t;\n\tdo {\n\t\ttoken = tokens[i] + \"\";\n\t\tindex = checkTokenAndGetIndex(this, token);\n\t\twhile (index !== -1) {\n\t\t\tthis.splice(index, 1);\n\t\t\tupdated = true;\n\t\t\tindex = checkTokenAndGetIndex(this, token);\n\t\t}\n\t}\n\twhile (++i < l);\n\n\tif (updated) {\n\t\tthis._updateClassName();\n\t}\n};\nclassListProto.toggle = function (token, force) {\n\ttoken += \"\";\n\n\tvar\n\t\t  result = this.contains(token)\n\t\t, method = result ?\n\t\t\tforce !== true && \"remove\"\n\t\t:\n\t\t\tforce !== false && \"add\"\n\t;\n\n\tif (method) {\n\t\tthis[method](token);\n\t}\n\n\tif (force === true || force === false) {\n\t\treturn force;\n\t} else {\n\t\treturn !result;\n\t}\n};\nclassListProto.toString = function () {\n\treturn this.join(\" \");\n};\n\nif (objCtr.defineProperty) {\n\tvar classListPropDesc = {\n\t\t  get: classListGetter\n\t\t, enumerable: true\n\t\t, configurable: true\n\t};\n\ttry {\n\t\tobjCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n\t} catch (ex) { // IE 8 doesn't support enumerable:true\n\t\t// adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n\t\t// modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n\t\tif (ex.number === undefined || ex.number === -0x7FF5EC54) {\n\t\t\tclassListPropDesc.enumerable = false;\n\t\t\tobjCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n\t\t}\n\t}\n} else if (objCtr[protoProp].__defineGetter__) {\n\telemCtrProto.__defineGetter__(classListProp, classListGetter);\n}\n\n}(window.self));\n\n}\n\n// There is full or partial native classList support, so just check if we need\n// to normalize the add/remove and toggle APIs.\n\n(function () {\n\t\"use strict\";\n\n\tvar testElement = document.createElement(\"_\");\n\n\ttestElement.classList.add(\"c1\", \"c2\");\n\n\t// Polyfill for IE 10/11 and Firefox <26, where classList.add and\n\t// classList.remove exist but support only one argument at a time.\n\tif (!testElement.classList.contains(\"c2\")) {\n\t\tvar createMethod = function(method) {\n\t\t\tvar original = DOMTokenList.prototype[method];\n\n\t\t\tDOMTokenList.prototype[method] = function(token) {\n\t\t\t\tvar i, len = arguments.length;\n\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\ttoken = arguments[i];\n\t\t\t\t\toriginal.call(this, token);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tcreateMethod('add');\n\t\tcreateMethod('remove');\n\t}\n\n\ttestElement.classList.toggle(\"c3\", false);\n\n\t// Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n\t// support the second argument.\n\tif (testElement.classList.contains(\"c3\")) {\n\t\tvar _toggle = DOMTokenList.prototype.toggle;\n\n\t\tDOMTokenList.prototype.toggle = function(token, force) {\n\t\t\tif (1 in arguments && !this.contains(token) === !force) {\n\t\t\t\treturn force;\n\t\t\t} else {\n\t\t\t\treturn _toggle.call(this, token);\n\t\t\t}\n\t\t};\n\n\t}\n\n\ttestElement = null;\n}());\n\n}\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// select-typeahead.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2de66ff9accce0c62ed2","/*!\n * SelectTypeahead\n *\n * A configurable, super simple and extremely fast typeahead solution\n * for <select> elements.\n *\n * Copyright 2017 Anders Evenrud <andersevenrud@gmail.com>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * @version 0.7.3\n * @package SelectTypeahead\n * @author Anders Evenrud <andersevenrud@gmail.com>\n * @license MIT\n */\n'use strict';\n\nimport 'custom-event-polyfill';\nimport 'classlist-polyfill';\n\n/*\n * Replace localized characters\n */\nfunction removeLocale(str) {\n  return str.replace(/[ÀÁÂÃÄÅÅÆ]/g, 'A')\n    .replace(/[àáâãäåæ]/g, 'a')\n    .replace(/[ÈÉÊË]/g, 'E')\n    .replace(/[èéêë]/g, 'e')\n    .replace(/[ØÖ]/g, 'O')\n    .replace(/[øö]/g, 'o')\n    .replace(/\\s+/g, ' ')\n    ;//.replace(/[^a-z0-9\\s]/gi, '');\n}\n\n/*\n * The simplest string matching function\n */\nfunction simpleMatch(input, entry) {\n  input = input.toLowerCase();\n  entry = entry.toLowerCase();\n\n  var words = input.replace(/\\s+/, ' ').split(' ');\n  var matches = words.filter(function(w) {\n    return entry.indexOf(w) !== -1;\n  });\n\n  return matches.length === words.length;\n}\n\n/*\n * Returns a Node based on input query\n */\nfunction getElementFromArg(el) {\n  if ( typeof el === 'string' ) {\n    if ( el.substr(0, 1) === '#' ) {\n      el = document.getElementById(el);\n    } else {\n      el = document.body.querySelector(el);\n    }\n  }\n  return el;\n}\n\n/*\n * Faster then V8's internal .forEach, especially\n * when bound with `Node` object.\n */\nfunction forEach(arr, cb) {\n  var i = 0;\n  var l = arr.length;\n\n  for ( i; i < l; i++ ) {\n    if ( cb(arr[i], i) === false ) {\n      break;\n    }\n  }\n}\n\n/*\n * Faster then V8's internal .find(), also\n * a polyfill\n */\nfunction find(arr, match) {\n  var i = 0;\n  var l = arr.length;\n\n  for ( i; i < l; i++ ) {\n    if ( match(arr[i], i) ) {\n      return arr[i];\n    }\n  }\n\n  return null;\n}\n\n/*\n * Fastest Node mapping\n */\nfunction mapNodes(el, fn) {\n  var children = el.querySelectorAll('option');\n  var data = [];\n  var i = 0, l = children.length, e;\n  for ( i; i < l; i++ ) {\n    e = children[i];\n    data.push({\n      index: i,\n      value: e.value,\n      label: e.textContent,\n      text: String(fn(e.textContent)).trim()\n    });\n  }\n  return data;\n}\n\n/*\n * Fills Nodes and returns data\n */\nfunction fillNodes(el, fn, datas) {\n  var option, text;\n  var data = [];\n  var frag = document.createDocumentFragment();\n  for ( var i in datas ) {\n    var text = datas[i];\n    var option = new Option(text, i);\n    frag.appendChild(option);\n\n    data.push({\n      index: data.length,\n      value: i,\n      label: text,\n      text: String(fn(text)).trim()\n    });\n  }\n\n  el.innerHTML = '';\n  el.appendChild(frag);\n  return data;\n}\n\n/*\n * Figure out event target\n */\nfunction getEventTarget(ev) {\n  var row = ev.target;\n  if ( ev.target.tagName === 'SPAN' ) {\n    row = ev.target.parentNode;\n  } else if ( ev.target.tagName !== 'LI' ) {\n    row = null;\n  }\n  return row;\n}\n\n/*\n * Creates a new document fragment with entries\n * for the dropdown\n */\nfunction createDropdown(data, dropdown) {\n  var frag = document.createDocumentFragment();\n\n  var i = 0, l = data.length, v, e, s;\n  for ( i; i < l; i++ ) {\n    v = data[i];\n\n    e = document.createElement('li');\n    e.setAttribute('data-index', String(i));\n    e.setAttribute('data-value', String(v.value));\n\n    s = document.createElement('span');\n    s.appendChild(document.createTextNode(v.label));\n\n    e.appendChild(s);\n    frag.appendChild(e);\n  }\n\n  dropdown.appendChild(frag);\n}\n\n/*\n * Scroll an element into view\n */\nfunction scrollIntoView(el) {\n  //This apparently makes screen jump\n  //el.scrollIntoView();\n\n  var target = el.parentNode;\n  target.scrollTop = el.offsetTop;\n}\n\n/*\n * Finds most significant entry out of a list\n */\nfunction findMostSignificant(input, arr) {\n  if ( !input ) {\n    return false;\n  }\n\n  input = input.toLowerCase();\n\n  var found = 0;\n  var currentScore = Number.MAX_VALUE;\n\n  // We find the entry that has the match as early in the string as possible.\n  forEach(arr, function(entry, idx) {\n    var iw = entry.text.toLowerCase().replace(/\\s\\(.*\\)$/, '');\n\n    var score = iw.split(' ').reduce(function(current, w) {\n      var wordScore = w.indexOf(input);\n      if ( (current === -1 || wordScore < current) && wordScore !== -1 ) {\n        return wordScore;\n      }\n      return current;\n    }, -1);\n\n    if ( score !== -1 && score < currentScore ) {\n      currentScore = score;\n      found = idx;\n    }\n  });\n\n  return found;\n}\n\n/////////////////////////////////////////////////////////////////////////////\n// WIDGET\n/////////////////////////////////////////////////////////////////////////////\n\n/**\n * Create a new SelectTypeahead instance\n *\n * @param {String|Node}   el                        The <SELECT> to use\n * @param {Object}        [opts]                    Options\n * @param {Object}        [opts.data]               A key/value paired object instead of select data\n * @param {Function}      [opts.fnDataFilter]       A function that filters the dropdown values\n * @param {Function}      [opts.fnInputFilter]      A function that filters the input value\n * @param {Function}      [opts.fnMatch]            A function that performs A->B matching\n * @param {Number}        [opts.keyTimeout=100]     A timeout for key presses\n * @param {String}        [opts.buttonLabel='>']    A label for the button\n * @param {Array|String}  [opts.className]          A className to give the instance (or array)\n * @param {Boolean}       [opts.calcWidth=true]     Set the width of the widget\n * @param {Boolean}       [opts.tabSelect=false]    Tab-ing out from dropdown acts as enter\n * @param {Boolean}       [opts.autoSelect=false]   Automatically select the first filter result\n * @param {String}        [opts.placeholder=true]   Placeholder string (or true for autodetect)\n */\nfunction SelectTypeahead(el, opts) {\n  opts = opts || {};\n  opts.fnDataFilter = opts.fnDataFilter || removeLocale;\n  opts.fnInputFilter = opts.fnInputFilter || removeLocale;\n  opts.fnMatch = opts.fnMatch || simpleMatch;\n  opts.keyTimeout = opts.keyTimeout || 100;\n  opts.buttonLabel = opts.buttonLabel || '>';\n  opts.className = opts.className || [];\n  opts.calcWidth = opts.calcWidth !== false;\n  opts.autoSelect = opts.autoSelect === true;\n  opts.tabSelect = opts.tabSelect === true;\n\n  el = getElementFromArg(el);\n  if ( !el || el.tagName !== 'SELECT' ) {\n    throw new TypeError('Invalid element given');\n  }\n  if ( el.getAttribute('data-select-typeahead') === 'true' ) {\n    return;\n  }\n\n  var classNames = typeof opts.className === 'string'\n    ? opts.className.replace(/\\s+/g, ' ').split(' ')\n    : opts.className;\n  classNames.unshift('SelectTypeahead');\n\n  var data = [];\n  if ( opts.data ) {\n    data = fillNodes(el, opts.fnDataFilter, opts.data);\n  } else {\n    data = mapNodes(el, opts.fnDataFilter);\n  }\n\n  this.loaded = false;\n  this.options = opts;\n  this.data = data; // Original data list\n  this.currentList = data; // Currently used list\n  this.tempIndex = -1; // Used when using keyboard\n  this.currentIndex = -1; // The actual index we use\n  this.currentText = null;\n  this.classNames = classNames;\n  this.$element = null;\n  this.$dropdown = null;\n  this.$button = null;\n  this.$target = el;\n  this._$selected = null;\n  this._$previousSelected = null;\n\n  this._init();\n}\n\n/*\n * Initializes stuff\n */\nSelectTypeahead.prototype._init = function() {\n  // TODO: These events leak when instance is destroyed, better clean up!\n  var self = this;\n  var el = this.$target;\n  var opts = this.options;\n\n  this.$target.addEventListener('setSelectedIndex', function(ev) {\n    self._setSelectedIndex(ev.detail, true, true, true);\n  }, false);\n\n  this.$target.addEventListener('_update', function(ev) {\n    var selectedIndex = this.selectedIndex;\n    if ( selectedIndex >= 0 ) {\n      self._setSelectedIndex(selectedIndex, false, false, true, false);\n    }\n  });\n\n  this.$element = document.createElement('div');\n  this.$element.className = this.classNames.join(' ');\n  if ( opts.calcWidth && el.offsetWidth ) {\n    this.$element.style.width = String(el.offsetWidth) + 'px';\n  }\n\n  this.$dropdown = document.createElement('ul');\n  this.$dropdown.addEventListener('click', function(ev) {\n    ev.stopPropagation();\n  });\n  this.$dropdown.addEventListener('mousedown', function(ev) {\n    ev.stopPropagation();\n\n    var row = getEventTarget(ev);\n    self._onEntryClick(ev, row);\n  }, true);\n\n  this.$target.tabIndex = -1;\n\n  this.$input = document.createElement('input');\n  this.$input.type = 'text';\n  this.$input.setAttribute('autocomplete', 'off');\n  this.$input.setAttribute('autocorrect', 'off');\n  this.$input.setAttribute('spellcheck', 'false');\n\n  var timeout;\n  var ignore = [9, 17, 16, 18, 39, 37]; // tab, ctrl, shift, alt, right, left\n\n  if ( this.options.autoSelect || this.options.tabSelect ) {\n    this.$input.addEventListener('keydown', function(ev) {\n      if ( ev.keyCode === 9 ) {\n        self._onKeyEnter();\n      }\n    });\n  }\n\n  this.$input.addEventListener('keydown', function(ev) {\n    timeout = clearTimeout(timeout);\n    if ( ignore.indexOf(ev.keyCode) !== -1 ) {\n      return;\n    }\n\n    var wasVisible = self._onKeyPress();\n\n    if ( ev.keyCode === 38 ) {\n      self._onKeyUp(wasVisible);\n    } else if ( ev.keyCode === 40 ) {\n      self._onKeyDown(wasVisible);\n    } else if ( ev.keyCode === 13 ) {\n      ev.preventDefault();\n      self._onKeyEnter();\n    } else if ( ev.keyCode === 27 ) {\n      ev.preventDefault(); // Needed for FF and IE\n      self._onKeyEsc();\n    } else {\n      timeout = setTimeout(function keyTimeout() {\n        self._filter(false);\n      }, opts.keyTimeout);\n    }\n  });\n  this.$input.addEventListener('focus', function(ev) {\n    self._onInputFocus();\n  });\n\n  this.$input.addEventListener('blur', function(ev) {\n    self._onInputBlur();\n  });\n\n  document.body.addEventListener('click', function(ev) {\n    if ( ev.target === self.$input || ev.target === self.$dropdown ) {\n      return;\n    }\n    self._hideDropdown();\n  });\n\n  this.$button = document.createElement('button');\n  this.$button.tabIndex = -1;\n  if ( opts.buttonLabel ) {\n    this.$button.appendChild(document.createTextNode(opts.buttonLabel));\n  }\n  this.$button.addEventListener('mousedown', function(ev) {\n    if ( self.$dropdown && self.$dropdown.offsetParent ) {\n      ev.stopPropagation();\n      ev.preventDefault();\n    }\n  });\n  this.$button.addEventListener('click', function(ev) {\n    ev.stopPropagation();\n    ev.preventDefault();\n    self._onButtonClick();\n  });\n\n  // Render\n  this.$element.appendChild(this.$dropdown);\n  this.$element.appendChild(this.$input);\n  this.$element.appendChild(this.$button);\n  createDropdown(this.data, this.$dropdown);\n  el.parentNode.insertBefore(this.$element, el);\n  if ( el.selectedIndex >= 0 ) {\n    if ( !(el.selectedIndex === 0 && this.options.placeholder && el.value === '') ) {\n      this._setSelectedIndex(el.selectedIndex, true, false, true, true);\n    }\n  }\n\n  if ( !opts.debug ) {\n    el.style.display = 'none';\n  }\n  el.setAttribute('data-select-typeahead', 'true');\n\n  if ( this.options.placeholder !== false ) {\n    var placeholder;\n\n    if ( this.options.placeholder === true || (typeof this.options.placeholder === 'undefined') ) {\n      placeholder = this.$target.getAttribute('placeholder') ||\n        this.$target.getAttribute('data-placeholder');\n    } else {\n      placeholder = this.options.placeholder;\n    }\n\n    this.$input.placeholder = placeholder || '';\n  }\n\n  this.tempIndex = this.currentIndex;\n  this.loaded = true;\n};\n\n/*\n * Show the dropdown\n */\nSelectTypeahead.prototype._showDropdown = function() {\n  var visible = this.$dropdown.offsetParent !== null;\n  this.$dropdown.style.display = 'block';\n  return visible;\n};\n\n/*\n * Hide the dropdown\n */\nSelectTypeahead.prototype._hideDropdown = function() {\n  this.$dropdown.style.display = 'none';\n};\n\n/*\n * Blur function\n */\nSelectTypeahead.prototype._blur = function() {\n  this._setSelectedIndex(this.$target.selectedIndex, true, false);\n  this._hideDropdown();\n\n  this._filter(true);\n};\n\n/*\n * Focus function\n */\nSelectTypeahead.prototype._focus = function() {\n  this.$input.setSelectionRange(0, this.$input.value.length);\n};\n\n/*\n * Internal for setting selected entry\n */\nSelectTypeahead.prototype._selectEntry = function(entry, setActive, setText, triggerEvent) {\n  var idx = entry ? parseInt(entry.getAttribute('data-index'), 10) : -1;\n  var value = entry ? entry.getAttribute('data-value') : null;\n  var text = (idx !== null && idx >= 0) ? this.data[idx].label : '';\n\n  if ( value !== null && !isNaN(Number(value)) ) {\n    value = parseInt(value, 10);\n  }\n\n  this._$previousSelected = this._$selected;\n  if ( this._$previousSelected ) {\n    this._$previousSelected.classList.remove('active');\n  }\n\n  this._$selected = entry;\n  if ( this._$selected ) {\n    this._$selected.classList.add('active');\n    scrollIntoView(this._$selected);\n  }\n\n  this.currentIndex = idx;\n  if ( setText ) {\n    this.$input.value = text;\n  }\n\n  if ( setActive ) {\n    this.$target.selectedIndex = idx;\n    this.$target.value = value;\n    this.tempIndex = idx;\n    this.currentText = text;\n  }\n\n  var entryData = {\n    index: idx,\n    value: value,\n    text: text\n  };\n\n  if ( triggerEvent ) {\n    var ev = new CustomEvent('select', {\n      detail: entryData\n    });\n\n    this.$target.dispatchEvent(ev);\n  }\n\n  return entryData;\n};\n\n/*\n * Filters the dropdown\n */\nSelectTypeahead.prototype._filter = function(reset) {\n  var self = this;\n  if ( !this.loaded ) {\n    return;\n  }\n\n  var input = reset ? '' : String(this.options.fnInputFilter(this.$input.value)).trim();\n  var checkFor = null;\n  if ( input !== this.currentText ) {\n    checkFor = input;\n  }\n\n  var currentList = [];\n  var fn = this.options.fnMatch;\n  forEach(this.$dropdown.children, function(e, i) {\n    var data = self.data[i];\n    if ( checkFor && !fn(checkFor, data.text) ) {\n      e.classList.add('invisible');\n    } else {\n      e.classList.remove('invisible');\n      currentList.push(data);\n    }\n  });\n\n  //simpleSort(checkFor, currentList);\n\n  this.currentList = currentList;\n\n  if ( !reset && (this.options.autoSelect && currentList.length) ) {\n    var found = findMostSignificant(checkFor, currentList);\n    if ( found !== false ) {\n      var select = currentList[found].index;\n      this._setSelectedIndex(select, false, false, false);\n      this.tempIndex = found;\n    } else {\n      this.tempIndex = -1;\n    }\n  } else {\n    this.$dropdown.scrollTop = 0;\n\n    if ( !reset ) {\n      this.currentIndex = -1;\n      this.tempIndex = -1;\n    }\n  }\n};\n\n/*\n * Select entry by value, text or index\n */\nSelectTypeahead.prototype._setSelectedIndex = function(index, setActive, setFocused, setText, triggerEvent) {\n  setActive = setActive !== false;\n  setFocused = setFocused !== false;\n  setText = setText !== false;\n  triggerEvent = triggerEvent === true;\n\n  var child = this.$dropdown.children[index];\n  var entry = this._selectEntry(child, setActive, setText, triggerEvent);\n\n  // Deffer the text selection\n  var self = this;\n  if ( setFocused ) {\n    setTimeout(function selectTimeout() {\n      self.$input.setSelectionRange(0, self.$input.value.length);\n    }, 1);\n  }\n};\n\n/*\n * When input is focused\n */\nSelectTypeahead.prototype._onInputFocus = function() {\n  this._focus();\n};\n\n/*\n * When input is blurred\n */\nSelectTypeahead.prototype._onInputBlur = function() {\n  this._blur();\n};\n\n/*\n * When button is clicked\n */\nSelectTypeahead.prototype._onButtonClick = function() {\n  var visible = this.$dropdown.offsetParent !== null;\n  this.$dropdown.style.display = visible ? 'none' : 'block';\n\n  this._focus();\n\n  this.$input.focus();\n\n  if ( this._$selected ) {\n    scrollIntoView(this._$selected);\n  }\n};\n\n/*\n * When enter key is pressed\n */\nSelectTypeahead.prototype._onKeyEnter = function() {\n  if ( this.currentIndex >= 0 ) {\n    this._setSelectedIndex(this.currentIndex, true, true, true, true);\n  }\n  this._hideDropdown();\n  this._filter(true);\n};\n\n/*\n * When esc key is pressed\n */\nSelectTypeahead.prototype._onKeyEsc = function() {\n  this._filter(true);\n\n  this._blur();\n};\n\n/*\n * When up key is pressed\n */\nSelectTypeahead.prototype._onKeyUp = function(wasVisible) {\n  if ( !this.currentList.length ) {\n    return;\n  }\n\n  var idx = this.tempIndex;\n  if ( idx <= 0 ) {\n    idx = this.currentList.length - 1;\n  } else {\n    if ( wasVisible ) {\n      idx--;\n    }\n  }\n\n  var sel = this.currentList[idx];\n  if ( sel ) {\n    this._setSelectedIndex(sel.index, false);\n  }\n  this.tempIndex = idx;\n};\n\n/*\n * When down key is pressed\n */\nSelectTypeahead.prototype._onKeyDown = function(wasVisible) {\n  if ( !this.currentList.length ) {\n    return;\n  }\n\n  var idx = this.tempIndex;\n  if ( idx >= this.currentList.length - 1 ) {\n    idx = 0;\n  } else {\n    if ( wasVisible ) {\n      idx++;\n    }\n  }\n\n  var sel = this.currentList[idx];\n  if ( sel ) {\n    this._setSelectedIndex(sel.index, false);\n  }\n  this.tempIndex = idx;\n};\n\n/*\n * When a key is pressed\n */\nSelectTypeahead.prototype._onKeyPress = function() {\n  return this._showDropdown();\n};\n\n/*\n * When an entry was clicked\n */\nSelectTypeahead.prototype._onEntryClick = function(ev, entry) {\n  if ( entry ) {\n    this._selectEntry(entry, true, true, true);\n    this._hideDropdown();\n  }\n};\n\n/**\n * Get selected by index\n *\n * @function getSelectedIndex\n * @memberof SelectTypeahead#\n * @return {Number}\n */\nSelectTypeahead.prototype.getSelectedIndex = function() {\n  return this.$target.selectedIndex;\n};\n\n/**\n * Get selected by value\n *\n * @param {Boolean} [text=false]  Return the text label, not actual value\n * @function getSelectedValue\n * @memberof SelectTypeahead#\n * @return {Number|String}\n */\nSelectTypeahead.prototype.getSelectedValue = function(text) {\n  var idx = this.getSelectedIndex();\n  if ( idx >= 0 ) {\n    var found = this.data[idx];\n    if ( found ) {\n      return text ? found.label : found.value;\n    }\n  }\n  return null;\n};\n\n/**\n * Set selected by index\n *\n * @param {Number} idx Index\n * @function setSelectedIndex\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.setSelectedIndex = function(idx) {\n  this._setSelectedIndex(idx);\n};\n\n/**\n * Set selected by value\n *\n * @param {String} value Value\n * @param {Boolean} [text=false] Set selected based on text not actual value\n * @function setSelectedValue\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.setSelectedValue = function(value, text) {\n  var found = find(this.data, function(iter) {\n    if ( text ) {\n      return iter.text === value || iter.label === value;\n    }\n    return String(iter.value) === String(value);\n  });\n\n  if ( found ) {\n    this.setSelectedIndex(found.index);\n  }\n};\n\n/**\n * Focus the element\n *\n * @function focus\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.focus = function() {\n  this.$input.focus();\n  this._focus();\n};\n\n/**\n * Blur the element\n *\n * @function blur\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.blur = function() {\n  this.$input.blur();\n  this._blur();\n};\n\n/**\n * Destroy the instance\n *\n * @function destroy\n * @memberof SelectTypeahead#\n */\nSelectTypeahead.prototype.destroy = function() {\n  this.$target.removeAttribute('data-select-typeahead');\n  this.$target.style.display = 'block';\n\n  if ( this.$element && this.$element.parentNode ) {\n    this.$element.parentNode.removeChild(this.$element);\n  }\n\n  this.$element = null;\n  this.$dropdown = null;\n  this.$button = null;\n  this.$target = null;\n  this._$selected = null;\n  this._$previousSelected = null;\n};\n\n/////////////////////////////////////////////////////////////////////////////\n// EXPORTS\n/////////////////////////////////////////////////////////////////////////////\n\nif ( typeof window !== 'undefined' ) {\n  window.SelectTypeahead = function(e, q) {\n    return new SelectTypeahead(e, q);\n  };\n\n  // Make jQuery compatible export\n  var $ = window.$ || window.jQuery;\n  if ( $ ) {\n    $.fn.SelectTypeahead = function(a) {\n      var inst = this.get(0);\n      if ( !inst.typeahead ) {\n        inst.typeahead = new SelectTypeahead($(this).get(0), a);\n      }\n      return inst.typeahead;\n    };\n  }\n}\n\nexport function create(e, q) {\n  return new SelectTypeahead(e, q);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./select-typeahead.js","// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\ntry {\n    var ce = new window.CustomEvent('test');\n    ce.preventDefault();\n    if (ce.defaultPrevented !== true) {\n        // IE has problems with .preventDefault() on custom events\n        // http://stackoverflow.com/questions/23349191\n        throw new Error('Could not prevent default');\n    }\n} catch(e) {\n  var CustomEvent = function(event, params) {\n    var evt, origPrevent;\n    params = params || {\n      bubbles: false,\n      cancelable: false,\n      detail: undefined\n    };\n\n    evt = document.createEvent(\"CustomEvent\");\n    evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n    origPrevent = evt.preventDefault;\n    evt.preventDefault = function () {\n      origPrevent.call(this);\n      try {\n        Object.defineProperty(this, 'defaultPrevented', {\n          get: function () {\n            return true;\n          }\n        });\n      } catch(e) {\n        this.defaultPrevented = true;\n      }\n    };\n    return evt;\n  };\n\n  CustomEvent.prototype = window.Event.prototype;\n  window.CustomEvent = CustomEvent; // expose definition to window\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/custom-event-polyfill/custom-event-polyfill.js\n// module id = 2\n// module chunks = 0","/*\n * classList.js: Cross-browser full element.classList implementation.\n * 1.1.20170427\n *\n * By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n *   See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */\n\nif (\"document\" in window.self) {\n\n// Full polyfill for browsers with no classList support\n// Including IE < Edge missing SVGElement.classList\nif (!(\"classList\" in document.createElement(\"_\")) \n\t|| document.createElementNS && !(\"classList\" in document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"))) {\n\n(function (view) {\n\n\"use strict\";\n\nif (!('Element' in view)) return;\n\nvar\n\t  classListProp = \"classList\"\n\t, protoProp = \"prototype\"\n\t, elemCtrProto = view.Element[protoProp]\n\t, objCtr = Object\n\t, strTrim = String[protoProp].trim || function () {\n\t\treturn this.replace(/^\\s+|\\s+$/g, \"\");\n\t}\n\t, arrIndexOf = Array[protoProp].indexOf || function (item) {\n\t\tvar\n\t\t\t  i = 0\n\t\t\t, len = this.length\n\t\t;\n\t\tfor (; i < len; i++) {\n\t\t\tif (i in this && this[i] === item) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\t// Vendors: please allow content code to instantiate DOMExceptions\n\t, DOMEx = function (type, message) {\n\t\tthis.name = type;\n\t\tthis.code = DOMException[type];\n\t\tthis.message = message;\n\t}\n\t, checkTokenAndGetIndex = function (classList, token) {\n\t\tif (token === \"\") {\n\t\t\tthrow new DOMEx(\n\t\t\t\t  \"SYNTAX_ERR\"\n\t\t\t\t, \"An invalid or illegal string was specified\"\n\t\t\t);\n\t\t}\n\t\tif (/\\s/.test(token)) {\n\t\t\tthrow new DOMEx(\n\t\t\t\t  \"INVALID_CHARACTER_ERR\"\n\t\t\t\t, \"String contains an invalid character\"\n\t\t\t);\n\t\t}\n\t\treturn arrIndexOf.call(classList, token);\n\t}\n\t, ClassList = function (elem) {\n\t\tvar\n\t\t\t  trimmedClasses = strTrim.call(elem.getAttribute(\"class\") || \"\")\n\t\t\t, classes = trimmedClasses ? trimmedClasses.split(/\\s+/) : []\n\t\t\t, i = 0\n\t\t\t, len = classes.length\n\t\t;\n\t\tfor (; i < len; i++) {\n\t\t\tthis.push(classes[i]);\n\t\t}\n\t\tthis._updateClassName = function () {\n\t\t\telem.setAttribute(\"class\", this.toString());\n\t\t};\n\t}\n\t, classListProto = ClassList[protoProp] = []\n\t, classListGetter = function () {\n\t\treturn new ClassList(this);\n\t}\n;\n// Most DOMException implementations don't allow calling DOMException's toString()\n// on non-DOMExceptions. Error's toString() is sufficient here.\nDOMEx[protoProp] = Error[protoProp];\nclassListProto.item = function (i) {\n\treturn this[i] || null;\n};\nclassListProto.contains = function (token) {\n\ttoken += \"\";\n\treturn checkTokenAndGetIndex(this, token) !== -1;\n};\nclassListProto.add = function () {\n\tvar\n\t\t  tokens = arguments\n\t\t, i = 0\n\t\t, l = tokens.length\n\t\t, token\n\t\t, updated = false\n\t;\n\tdo {\n\t\ttoken = tokens[i] + \"\";\n\t\tif (checkTokenAndGetIndex(this, token) === -1) {\n\t\t\tthis.push(token);\n\t\t\tupdated = true;\n\t\t}\n\t}\n\twhile (++i < l);\n\n\tif (updated) {\n\t\tthis._updateClassName();\n\t}\n};\nclassListProto.remove = function () {\n\tvar\n\t\t  tokens = arguments\n\t\t, i = 0\n\t\t, l = tokens.length\n\t\t, token\n\t\t, updated = false\n\t\t, index\n\t;\n\tdo {\n\t\ttoken = tokens[i] + \"\";\n\t\tindex = checkTokenAndGetIndex(this, token);\n\t\twhile (index !== -1) {\n\t\t\tthis.splice(index, 1);\n\t\t\tupdated = true;\n\t\t\tindex = checkTokenAndGetIndex(this, token);\n\t\t}\n\t}\n\twhile (++i < l);\n\n\tif (updated) {\n\t\tthis._updateClassName();\n\t}\n};\nclassListProto.toggle = function (token, force) {\n\ttoken += \"\";\n\n\tvar\n\t\t  result = this.contains(token)\n\t\t, method = result ?\n\t\t\tforce !== true && \"remove\"\n\t\t:\n\t\t\tforce !== false && \"add\"\n\t;\n\n\tif (method) {\n\t\tthis[method](token);\n\t}\n\n\tif (force === true || force === false) {\n\t\treturn force;\n\t} else {\n\t\treturn !result;\n\t}\n};\nclassListProto.toString = function () {\n\treturn this.join(\" \");\n};\n\nif (objCtr.defineProperty) {\n\tvar classListPropDesc = {\n\t\t  get: classListGetter\n\t\t, enumerable: true\n\t\t, configurable: true\n\t};\n\ttry {\n\t\tobjCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n\t} catch (ex) { // IE 8 doesn't support enumerable:true\n\t\t// adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36\n\t\t// modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected\n\t\tif (ex.number === undefined || ex.number === -0x7FF5EC54) {\n\t\t\tclassListPropDesc.enumerable = false;\n\t\t\tobjCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);\n\t\t}\n\t}\n} else if (objCtr[protoProp].__defineGetter__) {\n\telemCtrProto.__defineGetter__(classListProp, classListGetter);\n}\n\n}(window.self));\n\n}\n\n// There is full or partial native classList support, so just check if we need\n// to normalize the add/remove and toggle APIs.\n\n(function () {\n\t\"use strict\";\n\n\tvar testElement = document.createElement(\"_\");\n\n\ttestElement.classList.add(\"c1\", \"c2\");\n\n\t// Polyfill for IE 10/11 and Firefox <26, where classList.add and\n\t// classList.remove exist but support only one argument at a time.\n\tif (!testElement.classList.contains(\"c2\")) {\n\t\tvar createMethod = function(method) {\n\t\t\tvar original = DOMTokenList.prototype[method];\n\n\t\t\tDOMTokenList.prototype[method] = function(token) {\n\t\t\t\tvar i, len = arguments.length;\n\n\t\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\t\ttoken = arguments[i];\n\t\t\t\t\toriginal.call(this, token);\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tcreateMethod('add');\n\t\tcreateMethod('remove');\n\t}\n\n\ttestElement.classList.toggle(\"c3\", false);\n\n\t// Polyfill for IE 10 and Firefox <24, where classList.toggle does not\n\t// support the second argument.\n\tif (testElement.classList.contains(\"c3\")) {\n\t\tvar _toggle = DOMTokenList.prototype.toggle;\n\n\t\tDOMTokenList.prototype.toggle = function(token, force) {\n\t\t\tif (1 in arguments && !this.contains(token) === !force) {\n\t\t\t\treturn force;\n\t\t\t} else {\n\t\t\t\treturn _toggle.call(this, token);\n\t\t\t}\n\t\t};\n\n\t}\n\n\ttestElement = null;\n}());\n\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/classlist-polyfill/src/index.js\n// module id = 3\n// module chunks = 0"],"sourceRoot":""}