{"version":3,"file":"application.c8dfbdb3.js","sources":["../../../node_modules/classlist-polyfill/src/index.js","../../../node_modules/nodelist-foreach-polyfill/index.js","../../../node_modules/element-closest/element-closest.js","../../../node_modules/array.findindex/src/array-find-index-polyfill.js","../../../node_modules/object-fit-images/dist/ofi.common-js.js","../../../assets/javascripts/application/utils/dom.js","../../../assets/javascripts/application/base/polyfills.js","../../../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","../../../assets/javascripts/application/base/rails.js","../../../node_modules/svg4everybody/dist/svg4everybody.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/base/svg4everybody.js","../../../node_modules/@oddcamp/js-utils/src/selector.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/base/tabs.js","../../../node_modules/@oddcamp/js-utils/src/event.js","../../../node_modules/@oddcamp/js-utils/src/smart-outline.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/base/smart-outline.js","../../../node_modules/animated-scroll-to/animated-scroll-to.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/base/smooth-anchors.js","../../../node_modules/choices.js/public/assets/scripts/choices.min.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/components/choices.js","../../../node_modules/@oddcamp/js-utils/src/position.js","../../../node_modules/@oddcamp/js-utils/src/function.js","../../../node_modules/@oddcamp/bilda-common-assets/src/js/components/pagination.js","../../../node_modules/object-to-formdata/index.js","../../../node_modules/ahoy.js/dist/ahoy.esm.js","../../../node_modules/lodash/lodash.js","../../../node_modules/@oddcamp/analytics/src/index.js","../../../assets/javascripts/application/components/analytics.js","../../../assets/javascripts/application/components/header/toggle.js","../../../node_modules/js-cookie/src/js.cookie.js","../../../assets/javascripts/application/components/header/message.js","../../../assets/javascripts/application/components/header/dropdown.js","../../../node_modules/ev-emitter/ev-emitter.js","../../../node_modules/get-size/get-size.js","../../../node_modules/desandro-matches-selector/matches-selector.js","../../../node_modules/fizzy-ui-utils/utils.js","../../../node_modules/flickity/js/cell.js","../../../node_modules/flickity/js/slide.js","../../../node_modules/flickity/js/animate.js","../../../node_modules/flickity/js/flickity.js","../../../node_modules/unipointer/unipointer.js","../../../node_modules/unidragger/unidragger.js","../../../node_modules/flickity/js/drag.js","../../../node_modules/tap-listener/tap-listener.js","../../../node_modules/flickity/js/prev-next-button.js","../../../node_modules/flickity/js/page-dots.js","../../../node_modules/flickity/js/player.js","../../../node_modules/flickity/js/add-remove-cell.js","../../../node_modules/flickity/js/lazyload.js","../../../node_modules/flickity/js/index.js","../../../node_modules/a11y-dialog/a11y-dialog.js","../../../assets/javascripts/application/components/imglightbox.js","../../../node_modules/@oddcamp/js-utils/src/attribute.js","../../../node_modules/scroll-into-view/scrollIntoView.js","../../../assets/javascripts/application/components/venues-list/toggling.js","../../../node_modules/fuse.js/dist/fuse.js","../../../assets/javascripts/application/components/venues-list/search.js","../../../assets/javascripts/application/components/people-list/toggling.js","../../../assets/javascripts/application/components/people-list/search.js","../../../assets/javascripts/application/components/regional-contacts.js","../../../node_modules/iframe-resizer/js/iframeResizer.js","../../../assets/javascripts/application/components/embedded-form.js","../../../assets/javascripts/application/components/search-form/optgroup-toggling.js","../../../assets/javascripts/application/components/search-form/ctas-visibility.js","../../../assets/javascripts/application/components/search-form/checkboxes-tree.js","../../../assets/javascripts/application/components/search-form/query.js","../../../assets/javascripts/application/components/search-form/omasks.js","../../../assets/javascripts/application/components/search-form/filter-cards.js","../../../assets/javascripts/application/components/search-form/smooth-anchor.js","../../../assets/javascripts/application/components/search-form/filter-tabs.js","../../../assets/javascripts/application/components/search-form/filter-summary.js","../../../node_modules/popper.js/dist/esm/popper.js","../../../assets/javascripts/application/components/content-grid/index.js","../../../node_modules/load-google-maps-api/index.js","../../../assets/javascripts/application/components/maps.js","../../../assets/javascripts/application/components/cookie-consent.js","../../../assets/javascripts/application/pages/arr-form.js","../../../assets/javascripts/application/pages/digitaljakten.js","../../../assets/javascripts/application/pages/poster-print-tool.js"],"sourcesContent":["/*\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","if (window.NodeList && !NodeList.prototype.forEach) {\r\n NodeList.prototype.forEach = function (callback, thisArg) {\r\n thisArg = thisArg || window;\r\n for (var i = 0; i < this.length; i++) {\r\n callback.call(thisArg, this[i], i, this);\r\n }\r\n };\r\n}\r\n","// element-closest | CC0-1.0 | github.com/jonathantneal/closest\n\n(function (ElementProto) {\n\tif (typeof ElementProto.matches !== 'function') {\n\t\tElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {\n\t\t\tvar element = this;\n\t\t\tvar elements = (element.document || element.ownerDocument).querySelectorAll(selector);\n\t\t\tvar index = 0;\n\n\t\t\twhile (elements[index] && elements[index] !== element) {\n\t\t\t\t++index;\n\t\t\t}\n\n\t\t\treturn Boolean(elements[index]);\n\t\t};\n\t}\n\n\tif (typeof ElementProto.closest !== 'function') {\n\t\tElementProto.closest = function closest(selector) {\n\t\t\tvar element = this;\n\n\t\t\twhile (element && element.nodeType === 1) {\n\t\t\t\tif (element.matches(selector)) {\n\t\t\t\t\treturn element;\n\t\t\t\t}\n\n\t\t\t\telement = element.parentNode;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\t}\n})(window.Element.prototype);\n",";(function() {\n \"use strict\";\n\n if (typeof Array.prototype.findIndex !== \"function\") {\n Array.prototype.findIndex = function(predicate, thisArg) {\n if (this === null) {\n throw new TypeError('Cannot read property \\'findIndex\\' of null');\n }\n\n if (typeof predicate !== \"function\") {\n throw new TypeError(typeof predicate + ' is not a function');\n }\n\n var arrLength = this.length;\n var index = -1;\n\n for (var i = 0; i < arrLength; i++) {\n if (predicate.call(thisArg, this[i], i, this)) {\n index = i;\n break;\n }\n }\n\n return index;\n };\n }\n})();","/*! npm.im/object-fit-images 3.2.4 */\n'use strict';\n\nvar OFI = 'bfred-it:object-fit-images';\nvar propRegex = /(object-fit|object-position)\\s*:\\s*([-.\\w\\s%]+)/g;\nvar testImg = typeof Image === 'undefined' ? {style: {'object-position': 1}} : new Image();\nvar supportsObjectFit = 'object-fit' in testImg.style;\nvar supportsObjectPosition = 'object-position' in testImg.style;\nvar supportsOFI = 'background-size' in testImg.style;\nvar supportsCurrentSrc = typeof testImg.currentSrc === 'string';\nvar nativeGetAttribute = testImg.getAttribute;\nvar nativeSetAttribute = testImg.setAttribute;\nvar autoModeEnabled = false;\n\nfunction createPlaceholder(w, h) {\n\treturn (\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='\" + w + \"' height='\" + h + \"'%3E%3C/svg%3E\");\n}\n\nfunction polyfillCurrentSrc(el) {\n\tif (el.srcset && !supportsCurrentSrc && window.picturefill) {\n\t\tvar pf = window.picturefill._;\n\t\t// parse srcset with picturefill where currentSrc isn't available\n\t\tif (!el[pf.ns] || !el[pf.ns].evaled) {\n\t\t\t// force synchronous srcset parsing\n\t\t\tpf.fillImg(el, {reselect: true});\n\t\t}\n\n\t\tif (!el[pf.ns].curSrc) {\n\t\t\t// force picturefill to parse srcset\n\t\t\tel[pf.ns].supported = false;\n\t\t\tpf.fillImg(el, {reselect: true});\n\t\t}\n\n\t\t// retrieve parsed currentSrc, if any\n\t\tel.currentSrc = el[pf.ns].curSrc || el.src;\n\t}\n}\n\nfunction getStyle(el) {\n\tvar style = getComputedStyle(el).fontFamily;\n\tvar parsed;\n\tvar props = {};\n\twhile ((parsed = propRegex.exec(style)) !== null) {\n\t\tprops[parsed[1]] = parsed[2];\n\t}\n\treturn props;\n}\n\nfunction setPlaceholder(img, width, height) {\n\t// Default: fill width, no height\n\tvar placeholder = createPlaceholder(width || 1, height || 0);\n\n\t// Only set placeholder if it's different\n\tif (nativeGetAttribute.call(img, 'src') !== placeholder) {\n\t\tnativeSetAttribute.call(img, 'src', placeholder);\n\t}\n}\n\nfunction onImageReady(img, callback) {\n\t// naturalWidth is only available when the image headers are loaded,\n\t// this loop will poll it every 100ms.\n\tif (img.naturalWidth) {\n\t\tcallback(img);\n\t} else {\n\t\tsetTimeout(onImageReady, 100, img, callback);\n\t}\n}\n\nfunction fixOne(el) {\n\tvar style = getStyle(el);\n\tvar ofi = el[OFI];\n\tstyle['object-fit'] = style['object-fit'] || 'fill'; // default value\n\n\t// Avoid running where unnecessary, unless OFI had already done its deed\n\tif (!ofi.img) {\n\t\t// fill is the default behavior so no action is necessary\n\t\tif (style['object-fit'] === 'fill') {\n\t\t\treturn;\n\t\t}\n\n\t\t// Where object-fit is supported and object-position isn't (Safari < 10)\n\t\tif (\n\t\t\t!ofi.skipTest && // unless user wants to apply regardless of browser support\n\t\t\tsupportsObjectFit && // if browser already supports object-fit\n\t\t\t!style['object-position'] // unless object-position is used\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// keep a clone in memory while resetting the original to a blank\n\tif (!ofi.img) {\n\t\tofi.img = new Image(el.width, el.height);\n\t\tofi.img.srcset = nativeGetAttribute.call(el, \"data-ofi-srcset\") || el.srcset;\n\t\tofi.img.src = nativeGetAttribute.call(el, \"data-ofi-src\") || el.src;\n\n\t\t// preserve for any future cloneNode calls\n\t\t// https://github.com/bfred-it/object-fit-images/issues/53\n\t\tnativeSetAttribute.call(el, \"data-ofi-src\", el.src);\n\t\tif (el.srcset) {\n\t\t\tnativeSetAttribute.call(el, \"data-ofi-srcset\", el.srcset);\n\t\t}\n\n\t\tsetPlaceholder(el, el.naturalWidth || el.width, el.naturalHeight || el.height);\n\n\t\t// remove srcset because it overrides src\n\t\tif (el.srcset) {\n\t\t\tel.srcset = '';\n\t\t}\n\t\ttry {\n\t\t\tkeepSrcUsable(el);\n\t\t} catch (err) {\n\t\t\tif (window.console) {\n\t\t\t\tconsole.warn('https://bit.ly/ofi-old-browser');\n\t\t\t}\n\t\t}\n\t}\n\n\tpolyfillCurrentSrc(ofi.img);\n\n\tel.style.backgroundImage = \"url(\\\"\" + ((ofi.img.currentSrc || ofi.img.src).replace(/\"/g, '\\\\\"')) + \"\\\")\";\n\tel.style.backgroundPosition = style['object-position'] || 'center';\n\tel.style.backgroundRepeat = 'no-repeat';\n\tel.style.backgroundOrigin = 'content-box';\n\n\tif (/scale-down/.test(style['object-fit'])) {\n\t\tonImageReady(ofi.img, function () {\n\t\t\tif (ofi.img.naturalWidth > el.width || ofi.img.naturalHeight > el.height) {\n\t\t\t\tel.style.backgroundSize = 'contain';\n\t\t\t} else {\n\t\t\t\tel.style.backgroundSize = 'auto';\n\t\t\t}\n\t\t});\n\t} else {\n\t\tel.style.backgroundSize = style['object-fit'].replace('none', 'auto').replace('fill', '100% 100%');\n\t}\n\n\tonImageReady(ofi.img, function (img) {\n\t\tsetPlaceholder(el, img.naturalWidth, img.naturalHeight);\n\t});\n}\n\nfunction keepSrcUsable(el) {\n\tvar descriptors = {\n\t\tget: function get(prop) {\n\t\t\treturn el[OFI].img[prop ? prop : 'src'];\n\t\t},\n\t\tset: function set(value, prop) {\n\t\t\tel[OFI].img[prop ? prop : 'src'] = value;\n\t\t\tnativeSetAttribute.call(el, (\"data-ofi-\" + prop), value); // preserve for any future cloneNode\n\t\t\tfixOne(el);\n\t\t\treturn value;\n\t\t}\n\t};\n\tObject.defineProperty(el, 'src', descriptors);\n\tObject.defineProperty(el, 'currentSrc', {\n\t\tget: function () { return descriptors.get('currentSrc'); }\n\t});\n\tObject.defineProperty(el, 'srcset', {\n\t\tget: function () { return descriptors.get('srcset'); },\n\t\tset: function (ss) { return descriptors.set(ss, 'srcset'); }\n\t});\n}\n\nfunction hijackAttributes() {\n\tfunction getOfiImageMaybe(el, name) {\n\t\treturn el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el;\n\t}\n\tif (!supportsObjectPosition) {\n\t\tHTMLImageElement.prototype.getAttribute = function (name) {\n\t\t\treturn nativeGetAttribute.call(getOfiImageMaybe(this, name), name);\n\t\t};\n\n\t\tHTMLImageElement.prototype.setAttribute = function (name, value) {\n\t\t\treturn nativeSetAttribute.call(getOfiImageMaybe(this, name), name, String(value));\n\t\t};\n\t}\n}\n\nfunction fix(imgs, opts) {\n\tvar startAutoMode = !autoModeEnabled && !imgs;\n\topts = opts || {};\n\timgs = imgs || 'img';\n\n\tif ((supportsObjectPosition && !opts.skipTest) || !supportsOFI) {\n\t\treturn false;\n\t}\n\n\t// use imgs as a selector or just select all images\n\tif (imgs === 'img') {\n\t\timgs = document.getElementsByTagName('img');\n\t} else if (typeof imgs === 'string') {\n\t\timgs = document.querySelectorAll(imgs);\n\t} else if (!('length' in imgs)) {\n\t\timgs = [imgs];\n\t}\n\n\t// apply fix to all\n\tfor (var i = 0; i < imgs.length; i++) {\n\t\timgs[i][OFI] = imgs[i][OFI] || {\n\t\t\tskipTest: opts.skipTest\n\t\t};\n\t\tfixOne(imgs[i]);\n\t}\n\n\tif (startAutoMode) {\n\t\tdocument.body.addEventListener('load', function (e) {\n\t\t\tif (e.target.tagName === 'IMG') {\n\t\t\t\tfix(e.target, {\n\t\t\t\t\tskipTest: opts.skipTest\n\t\t\t\t});\n\t\t\t}\n\t\t}, true);\n\t\tautoModeEnabled = true;\n\t\timgs = 'img'; // reset to a generic selector for watchMQ\n\t}\n\n\t// if requested, watch media queries for object-fit change\n\tif (opts.watchMQ) {\n\t\twindow.addEventListener('resize', fix.bind(null, imgs, {\n\t\t\tskipTest: opts.skipTest\n\t\t}));\n\t}\n}\n\nfix.supportsObjectFit = supportsObjectFit;\nfix.supportsObjectPosition = supportsObjectPosition;\n\nhijackAttributes();\n\nmodule.exports = fix;\n","const domReady = (fn) => {\n if (document.readyState === `loading`) {\n document.addEventListener(`DOMContentLoaded`, fn)\n } else {\n fn()\n }\n}\n\nexport { domReady }\n","import objectFitImages from \"object-fit-images\"\n\nimport { domReady } from \"../utils/dom\"\n\ndomReady(() => {\n objectFitImages()\n})\n","/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\n (function() {\n (function() {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\n nonce = null;\n\n Rails.loadCSPNonce = function() {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function() {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n\n }).call(this);\n (function() {\n var expando, m;\n\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function(element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function(element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function(element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function(xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function() {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n }\n return result;\n };\n }\n\n fire = Rails.fire = function(obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function(e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function(element, selector, eventType, handler) {\n return element.addEventListener(eventType, function(e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function(options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function() {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n\n Rails.href = function(element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function(url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (error) {\n e = error;\n return true;\n }\n };\n\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function(option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function(param) {\n if (param.name != null) {\n return (encodeURIComponent(param.name)) + \"=\" + (encodeURIComponent(param.value));\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function(form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function(el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function(e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function(message, element) {\n return confirm(message);\n };\n\n allowAction = function(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function(e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n\n }).call(this);\n (function() {\n var stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function(e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"\";\n }\n formContent += '';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n\n }).call(this);\n (function() {\n var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function(element) {\n var value;\n value = element.getAttribute('data-remote');\n return (value != null) && value !== 'false';\n };\n\n Rails.handleRemote = function(e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: (withCredentials != null) && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function(e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function(e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = (e.button != null) && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if ((typeof jQuery !== \"undefined\" && jQuery !== null) && (jQuery.ajax != null)) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function() {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function() {\n $(Rails.formEnableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function(e) {\n return setTimeout((function() {\n return disableElement(e);\n }), 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n\n }).call(this);\n }).call(this);\n\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);\n","import Rails from \"@rails/ujs\"\n\nif (!window._rails_loaded) Rails.start()\n","!function(root, factory) {\n \"function\" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set\n define([], function() {\n return root.svg4everybody = factory();\n }) : \"object\" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory() : root.svg4everybody = factory();\n}(this, function() {\n /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */\n function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }\n function loadreadystatechange(xhr) {\n // listen to changes in the request\n xhr.onreadystatechange = function() {\n // if the request is ready\n if (4 === xhr.readyState) {\n // get the cached html document\n var cachedDocument = xhr._cachedDocument;\n // ensure the cached html document based on the xhr response\n cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(\"\"), \n cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item\n xhr._embeds.splice(0).map(function(item) {\n // get the cached target\n var target = xhr._cachedTarget[item.id];\n // ensure the cached target\n target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), \n // embed the target into the svg\n embed(item.parent, item.svg, target);\n });\n }\n }, // test the ready state change immediately\n xhr.onreadystatechange();\n }\n function svg4everybody(rawopts) {\n function oninterval() {\n // while the index exists in the live collection\n for (// get the cached index\n var index = 0; index < uses.length; ) {\n // get the current \n var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute(\"xlink:href\") || use.getAttribute(\"href\");\n if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)), \n svg && src) {\n if (polyfill) {\n if (!opts.validate || opts.validate(src, svg, use)) {\n // remove the element\n parent.removeChild(use);\n // parse the src and get the url and id\n var srcSplit = src.split(\"#\"), url = srcSplit.shift(), id = srcSplit.join(\"#\");\n // if the link is external\n if (url.length) {\n // get the cached xhr request\n var xhr = requests[url];\n // ensure the xhr request exists\n xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open(\"GET\", url), xhr.send(), \n xhr._embeds = []), // add the svg and id as an item to the xhr embeds list\n xhr._embeds.push({\n parent: parent,\n svg: svg,\n id: id\n }), // prepare the xhr ready state change event\n loadreadystatechange(xhr);\n } else {\n // embed the local id into the svg\n embed(parent, svg, document.getElementById(id));\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index, ++numberOfSvgUseElementsToBypass;\n }\n }\n } else {\n // increase the index when the previous value was not \"valid\"\n ++index;\n }\n }\n // continue the interval\n (!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);\n }\n var polyfill, opts = Object(rawopts), newerIEUA = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/, webkitUA = /\\bAppleWebKit\\/(\\d+)\\b/, olderEdgeUA = /\\bEdge\\/12\\.(\\d+)\\b/, edgeUA = /\\bEdge\\/.(\\d+)\\b/, inIframe = window.top !== window.self;\n polyfill = \"polyfill\" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;\n // create xhr requests object\n var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName(\"use\"), numberOfSvgUseElementsToBypass = 0;\n // conditionally start the interval if the polyfill is active\n polyfill && oninterval();\n }\n function getSVGAncestor(node) {\n for (var svg = node; \"svg\" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}\n return svg;\n }\n return svg4everybody;\n});","import svg4everybody from 'svg4everybody';\n\nconst init = () => {\n svg4everybody();\n};\n\nif(typeof Turbolinks !== 'undefined') {\n document.addEventListener('turbolinks:load', init);\n}\nelse {\n document.readyState === 'loading'\n ? document.addEventListener('DOMContentLoaded', init)\n : init();\n}\n","/*\n ------------------------------------------------------------------------------\n Accepts String, Element, NodeList, Array and returns Array of elements\n\n @param {String|Array|Element|NodeList} elements\n @returns {Array}\n*/\n\nconst getElements = (elements, source = document) => {\n if (typeof elements === `string`) {\n return [...source.querySelectorAll(elements)]\n }\n\n if (isNodeList(elements)) {\n return [...elements]\n }\n\n if (Array.isArray(elements)) {\n return elements\n }\n\n // Element\n return [elements]\n}\n\n/*\n ------------------------------------------------------------------------------\n Based on how Element.closest() works. Returns true if `element` has the\n closest ancestor (or is itself) that matches the `matches` (element|selector)\n\n @param {String|Element} element\n @param {String|Element} matches\n @returns {Bool}\n*/\n\nconst hasClosest = (element, matches) => {\n element = getElements(element)[0]\n\n if (typeof matches === `string`) {\n return element.closest(matches) ? true : false\n } else {\n while (element) {\n if (element === matches) {\n return true\n }\n element = element.parentNode\n }\n return false\n }\n}\n\n/*\n ------------------------------------------------------------------------------\n Returns an Array of parents of `element` that matches the given `selector`\n up until the `until` matching element|selector\n\n @param {String|Element} element\n @param {String} selector [optional]\n @param {String|Element} until [optional]\n @returns {Array}\n*/\n\nconst getParents = (element, selector = ``, until = null) => {\n element = getElements(element)[0]\n element = element.parentNode\n const parents = []\n\n while (element) {\n if (element === document) {\n break\n }\n\n if (!selector || element.matches(selector)) {\n parents.push(element)\n }\n\n if (until) {\n if (typeof until === `string`) {\n if (element.matches(until)) {\n break\n }\n } else if (element === until) {\n break\n }\n }\n\n element = element.parentNode\n }\n return parents\n}\n\n/*\n ------------------------------------------------------------------------------\n Checks if provided `nodes` is a type of NodeList\n\n @param {Any} nodes\n @returns {Bool}\n*/\n\nconst isNodeList = (nodes) => {\n const stringRepr = Object.prototype.toString.call(nodes)\n\n return (\n typeof nodes === `object` &&\n /^\\[object (HTMLCollection|NodeList|Object)\\]$/.test(stringRepr) &&\n typeof nodes.length === `number` &&\n (nodes.length === 0 ||\n (typeof nodes[0] === `object` && nodes[0].nodeType > 0))\n )\n}\n\n/*\n ------------------------------------------------------------------------------\n*/\n\nexport { getElements, hasClosest, getParents, isNodeList }\n","// TODO: a11y: attributes, focus\n// TODO: auto-select by hash in URL\n\nimport { getElements } from \"@oddcamp/js-utils/src/selector\";\n\nconst init = () => {\n const tgls = getElements(\".js--tab-tgl\");\n if (!tgls.length) return;\n\n tgls.forEach((tgl) => {\n tgl.addEventListener(\"click\", (e) => {\n e.preventDefault();\n\n const id = tgl.getAttribute(\"href\").replace(\"#\", \"\");\n const [groupId /*, itemId*/] = id.split(\":\");\n\n const groupTgls = getElements(`.js--tab-tgl[href^=\"#${groupId}:\"]`);\n groupTgls.forEach((groupTgl) => {\n const groupTglTab = groupTgl.closest(\".js--tab\");\n if (groupTglTab) groupTglTab.classList.remove(\"--active\");\n });\n\n const idTgls = getElements(`.js--tab-tgl[href=\"#${id}\"]`);\n idTgls.forEach((idTgl) => {\n const idTglTab = idTgl.closest(\".js--tab\");\n if (idTglTab) idTglTab.classList.add(\"--active\");\n });\n\n const groupPanes = getElements(`.js--tab-pane[id^=\"${groupId}:\"]`);\n groupPanes.forEach((groupPane) => {\n groupPane.classList.remove(\"--active\");\n });\n\n const pane = document.getElementById(id);\n pane.classList.add(\"--active\");\n pane.classList.add(\"--interacted\");\n });\n });\n};\n\nif (typeof Turbolinks !== \"undefined\") {\n document.addEventListener(\"turbolinks:load\", init);\n} else {\n document.readyState === \"loading\"\n ? document.addEventListener(\"DOMContentLoaded\", init)\n : init();\n}\n","import { getElements } from \"./selector.js\"\n\n// local variables\n\nconst nativeEvents = [`click`, `focus`, `blur`]\n\n/*\n ------------------------------------------------------------------------------\n Adds event listener to an element. Using namespaces is available.\n\n @param {String|Element|NodeList|Array} elements Selector, single or multiple elements\n @param {String} eventNames Space separated event names with optional namespaces\n @param {Function} callback The function to execute when the event occurs\n @param {Object} options [optional] Optional options\n*/\n\nconst addEventListener = (elements, eventNames, callback, options = false) => {\n elements = getElements(elements)\n\n elements.forEach((element) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!element.hasOwnProperty(`registeredEvents`)) {\n element.registeredEvents = []\n }\n\n eventNames.split(` `).forEach((eventName) => {\n const [eventNameType] = eventName.split(`.`)\n\n const theCallback = (...args) => callback(...args, element)\n\n element.registeredEvents.push({\n eventName: eventName,\n callback: theCallback,\n options: options,\n })\n\n element.addEventListener(eventNameType, theCallback, options)\n })\n })\n}\n\n/*\n ------------------------------------------------------------------------------\n Delegates event listener to an element. Using namespaces is available.\n\n @param {String} elements Selector\n @param {String} eventNames Space separated event names with optional namespaces\n @param {Function} callback The function to execute when the event occurs\n*/\n\nconst delegateEventListener = (selector, eventNames, callback) => {\n addEventListener(document, eventNames, (e) => {\n const element = e.target.closest(selector)\n if (element) {\n callback(e, element)\n }\n })\n}\n\n/*\n ------------------------------------------------------------------------------\n Removes event listener from an element. Using namespaces is available.\n\n @param {String|Element|NodeList|Array} elements Selector, single or multiple elements\n @param {String} eventNames Space separated event names with optional namespaces\n @param {Function} callback The function to execute when the event occurs\n @param {Object} options [optional] Optional options\n*/\n\nconst removeEventListener = (\n elements,\n eventName = false,\n callback = false,\n options = false\n) => {\n elements = getElements(elements)\n\n elements.forEach((element) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!element.hasOwnProperty(`registeredEvents`)) {\n return\n }\n\n // remove all event listeners\n\n if (!eventName && !callback && !options) {\n element.registeredEvents.forEach((regEvent) => {\n element.removeEventListener(\n regEvent.eventName.split(`.`)[0],\n regEvent.callback,\n regEvent.options\n )\n })\n\n element.registeredEvents = []\n return\n }\n\n // remove specific and/or namespaced event listeners\n\n const [eventNameType, eventNameSpace] = eventName.split(`.`)\n\n element.registeredEvents.forEach((regEvent) => {\n const [regEventNameType, regEventNameSpace] =\n regEvent.eventName.split(`.`)\n const regEventNameMatch =\n regEvent.eventName === eventName ||\n (!eventNameSpace &&\n eventNameType &&\n eventNameType === regEventNameType) ||\n (!eventNameType &&\n eventNameSpace &&\n eventNameSpace === regEventNameSpace)\n let doRemove = false\n\n // only 'eventName' provided\n if (eventName && !callback && !options) {\n if (regEventNameMatch) {\n doRemove = true\n }\n }\n\n // only 'callback' provided\n else if (!eventName && callback && !options) {\n if (callback === regEvent.callback) {\n doRemove = true\n }\n }\n\n // only 'options' provided\n else if (!eventName && !callback && options) {\n if (options === regEvent.options) {\n doRemove = true\n }\n }\n\n // 'eventName' and 'callback' provided\n else if (eventName && callback && !options) {\n if (regEventNameMatch && callback === regEvent.callback) {\n doRemove = true\n }\n }\n\n // 'callback' and 'options' provided\n else if (!eventName && callback && options) {\n if (callback === regEvent.callback && options === regEvent.options) {\n doRemove = true\n }\n }\n\n // everything's provided\n else {\n if (\n regEventNameMatch &&\n callback === regEvent.callback &&\n options === regEvent.options\n ) {\n doRemove = true\n }\n }\n\n if (doRemove) {\n element.removeEventListener(\n regEventNameType,\n regEvent.callback,\n regEvent.options\n )\n element.registeredEvents = element.registeredEvents.filter(\n (e) => e !== regEvent\n )\n }\n })\n })\n}\n\n/*\n ------------------------------------------------------------------------------\n Triggers event on an element. Using namespaces is available.\n\n @param {String|Element|NodeList|Array} elements Selector, single or multiple elements\n @param {String} eventNames Space separated event names with optional namespaces\n @param {Mixed} data The data to pass. Not available for `nativeEvents` events\n*/\n\nconst triggerEvent = (elements, eventNames, data = null) => {\n elements = getElements(elements)\n\n elements.forEach((element) => {\n eventNames.split(` `).forEach((eventName) => {\n const [eventNameType, eventNameSpace] = eventName.split(`.`)\n let eventTriggered = false\n\n // trigger registered event\n // eslint-disable-next-line no-prototype-builtins\n if (element.hasOwnProperty(`registeredEvents`)) {\n const eventsTriggered = []\n\n element.registeredEvents.forEach((registeredEvent) => {\n const [regEventNameType, regEventNameSpace] =\n registeredEvent.eventName.split(`.`)\n\n // do not trigger the exact events more than once\n if (eventsTriggered.includes(registeredEvent.eventName)) {\n return\n }\n\n if (\n // type (and namespace) trigger (e.g. 'click.goBaby')\n eventName === registeredEvent.eventName ||\n // type only trigger (e.g. 'click')\n (!eventNameSpace && eventNameType === regEventNameType) ||\n // namespace only trigger (e.g. '.goBaby')\n (!eventNameType && eventNameSpace === regEventNameSpace)\n ) {\n // trigger native event\n if (nativeEvents.includes(regEventNameType)) {\n element[regEventNameType]()\n }\n // trigger custom event\n else {\n const event = new CustomEvent(registeredEvent.eventName, {\n detail: data,\n })\n element.dispatchEvent(event)\n }\n\n eventsTriggered.push(registeredEvent.eventName)\n eventTriggered = true\n }\n })\n }\n\n // trigger non-registered event\n if (!eventTriggered && eventNameType) {\n // trigger native event\n if (nativeEvents.includes(eventNameType)) {\n element[eventNameType]()\n }\n // trigger custom event\n else {\n const event = new CustomEvent(eventNameType, {\n detail: data,\n })\n element.dispatchEvent(event)\n }\n }\n })\n })\n}\n\n/*\n ------------------------------------------------------------------------------\n*/\n\nexport {\n addEventListener,\n delegateEventListener,\n removeEventListener,\n triggerEvent,\n}\n","import { addEventListener, removeEventListener } from \"./event.js\"\n\n// local functions\n\nconst insertStyles = (selectors) => {\n const css = `\n ${selectors.join(`, `)} {\n outline: none !important;\n }\n `\n\n const newStyle = document.createElement(`style`)\n newStyle.setAttribute(`data-smart-outline`, ``)\n newStyle.appendChild(document.createTextNode(css))\n document.head.appendChild(newStyle)\n}\n\nconst removeOldStyles = () => {\n const oldStyle = getOldStylesEl()\n if (oldStyle) {\n oldStyle.parentNode.removeChild(oldStyle)\n }\n}\n\nconst getOldStylesEl = () => {\n return document.head.querySelector(`style[data-smart-outline]`)\n}\n\n/*\n ------------------------------------------------------------------------------\n Disables outline on mouse and re-enables on keyboard activity\n\n @param {Array} selectors The list of selectors to disable outline for\n*/\n\nconst initSmartOutline = (selectors) => {\n selectors = selectors || [\n `input:focus`,\n `button:focus`,\n `textarea:focus`,\n `select:focus`,\n ]\n\n haltSmartOutline()\n insertStyles(selectors)\n\n addEventListener(document, `mousedown.smartOutline`, function () {\n if (!getOldStylesEl()) {\n insertStyles(selectors)\n }\n })\n\n addEventListener(document, `keyup.smartOutline`, function (e) {\n if (e.which == 9) {\n // tab\n removeOldStyles()\n }\n })\n}\n\n/*\n ------------------------------------------------------------------------------\n Temporarily reveals outline\n*/\n\nconst showSmartOutline = () => {\n removeOldStyles()\n}\n\n/*\n ------------------------------------------------------------------------------\n Halts Smart Outline\n*/\n\nconst haltSmartOutline = () => {\n removeOldStyles()\n removeEventListener(document, `mousedown.smartOutline`)\n removeEventListener(document, `keyup.smartOutline`)\n}\n\n/*\n ------------------------------------------------------------------------------\n*/\n\nexport { initSmartOutline as default, haltSmartOutline, showSmartOutline }\n","import initSmartOutline from \"@oddcamp/js-utils/src/smart-outline\";\n\ninitSmartOutline([\n \"a:focus\",\n \"input:focus\",\n \"select:focus\",\n \"button:focus\",\n \"textarea:focus\",\n \".choices.is-focused\",\n \".choices__item.is-highlighted\",\n '*[role=\"button\"]:focus',\n]);\n","(function() {\n 'use strict';\n\n // desiredOffset - page offset to scroll to\n // speed - duration of the scroll per 1000px\n function __ANIMATE_SCROLL_TO(desiredOffset) {\n var userOptions = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\n var options = {\n speed: 500,\n minDuration: 250,\n maxDuration: 1500,\n cancelOnUserAction: true,\n element: window,\n horizontal: false,\n onComplete: undefined,\n passive: true,\n offset: 0\n };\n\n var optionsKeys = Object.keys(options);\n\n // Override default options\n for (var i = 0; i < optionsKeys.length; i++) {\n var key = optionsKeys[i];\n\n if (typeof userOptions[key] !== 'undefined') {\n options[key] = userOptions[key];\n }\n }\n\n if (!options.cancelOnUserAction && options.passive) {\n options.passive = false;\n if (userOptions.passive) {\n console && console.warn(\n 'animated-scroll-to:\\n \"passive\" was set to \"false\" to prevent errors, ' +\n 'as using \"cancelOnUserAction: false\" doesn\\'t work with passive events.')\n }\n }\n\n if (desiredOffset instanceof HTMLElement) {\n if (userOptions.element && userOptions.element instanceof HTMLElement) {\n if (options.horizontal) {\n desiredOffset = (desiredOffset.getBoundingClientRect().left + userOptions.element.scrollLeft)\n - userOptions.element.getBoundingClientRect().left;\n } else {\n desiredOffset = (desiredOffset.getBoundingClientRect().top + userOptions.element.scrollTop)\n - userOptions.element.getBoundingClientRect().top;\n }\n } else if (options.horizontal) {\n var scrollLeft = window.scrollX || document.documentElement.scrollLeft;\n desiredOffset = scrollLeft + desiredOffset.getBoundingClientRect().left;\n } else {\n var scrollTop = window.scrollY || document.documentElement.scrollTop;\n desiredOffset = scrollTop + desiredOffset.getBoundingClientRect().top;\n }\n }\n\n // Add additonal user offset\n desiredOffset += options.offset\n\n options.isWindow = options.element === window;\n\n var initialScrollPosition = null;\n var initialAxisScollPosition = 0;\n var maxScroll = null;\n\n if (options.isWindow) {\n if (options.horizontal) {\n // get cross browser scroll positions\n initialScrollPosition = window.scrollX || document.documentElement.scrollLeft;\n initialAxisScollPosition = window.scrollY || document.documentElement.scrollTop;\n // cross browser document height minus window height\n maxScroll = Math.max(\n document.body.scrollWidth, document.documentElement.scrollWidth,\n document.body.offsetWidth, document.documentElement.offsetWidth,\n document.body.clientWidth, document.documentElement.clientWidth\n ) - window.innerWidth;\n } else {\n // get cross browser scroll positions\n initialScrollPosition = window.scrollY || document.documentElement.scrollTop;\n initialAxisScollPosition = window.scrollX || document.documentElement.scrollLeft;\n // cross browser document width minus window width\n maxScroll = Math.max(\n document.body.scrollHeight, document.documentElement.scrollHeight,\n document.body.offsetHeight, document.documentElement.offsetHeight,\n document.body.clientHeight, document.documentElement.clientHeight\n ) - window.innerHeight;\n }\n } else {\n // DOM element\n if (options.horizontal) {\n initialScrollPosition = options.element.scrollLeft;\n maxScroll = options.element.scrollWidth - options.element.clientWidth;\n } else {\n initialScrollPosition = options.element.scrollTop;\n maxScroll = options.element.scrollHeight - options.element.clientHeight;\n }\n }\n\n // If the scroll position is greater than maximum available scroll\n if (desiredOffset > maxScroll) {\n desiredOffset = maxScroll;\n }\n\n // Calculate diff to scroll\n var diff = desiredOffset - initialScrollPosition;\n\n // Do nothing if the page is already there\n if (diff === 0) {\n // Execute callback if there is any\n if (options.onComplete && typeof options.onComplete === 'function') {\n options.onComplete()\n }\n\n return;\n }\n\n // Calculate duration of the scroll\n var duration = Math.abs(Math.round((diff / 1000) * options.speed));\n\n // Set minimum and maximum duration\n if (duration < options.minDuration) {\n duration = options.minDuration;\n } else if (duration > options.maxDuration) {\n duration = options.maxDuration;\n }\n\n var startingTime = Date.now();\n\n // Request animation frame ID\n var requestID = null;\n\n // Method handler\n var handleUserEvent = null;\n var userEventOptions = { passive: options.passive };\n\n if (options.cancelOnUserAction) {\n // Set handler to cancel scroll on user action\n handleUserEvent = function() {\n removeListeners();\n cancelAnimationFrame(requestID);\n };\n window.addEventListener('keydown', handleUserEvent, userEventOptions);\n window.addEventListener('mousedown', handleUserEvent, userEventOptions);\n } else {\n // Set handler to prevent user actions while scroll is active\n handleUserEvent = function(e) { e.preventDefault(); };\n window.addEventListener('scroll', handleUserEvent, userEventOptions);\n }\n\n window.addEventListener('wheel', handleUserEvent, userEventOptions);\n window.addEventListener('touchstart', handleUserEvent, userEventOptions);\n\n var removeListeners = function () {\n window.removeEventListener('wheel', handleUserEvent, userEventOptions);\n window.removeEventListener('touchstart', handleUserEvent, userEventOptions);\n\n if (options.cancelOnUserAction) {\n window.removeEventListener('keydown', handleUserEvent, userEventOptions);\n window.removeEventListener('mousedown', handleUserEvent, userEventOptions);\n } else {\n window.removeEventListener('scroll', handleUserEvent, userEventOptions);\n }\n };\n\n var step = function () {\n var timeDiff = Date.now() - startingTime;\n var t = (timeDiff / duration) - 1;\n var easing = t * t * t + 1;\n var scrollPosition = Math.round(initialScrollPosition + (diff * easing));\n\n var doScroll = function(position) {\n if (options.isWindow) {\n if (options.horizontal) {\n options.element.scrollTo(position, initialAxisScollPosition);\n } else {\n options.element.scrollTo(initialAxisScollPosition, position);\n }\n } else if (options.horizontal) {\n options.element.scrollLeft = position;\n } else {\n options.element.scrollTop = position;\n }\n }\n\n if (timeDiff < duration && scrollPosition !== desiredOffset) {\n // If scroll didn't reach desired offset or time is not elapsed\n // Scroll to a new position\n // And request a new step\n doScroll(scrollPosition);\n\n requestID = requestAnimationFrame(step);\n } else {\n // If the time elapsed or we reached the desired offset\n // Set scroll to the desired offset (when rounding made it to be off a pixel or two)\n // Clear animation frame to be sure\n doScroll(desiredOffset);\n\n cancelAnimationFrame(requestID);\n\n // Remove listeners\n removeListeners();\n\n // Animation is complete, execute callback if there is any\n if (options.onComplete && typeof options.onComplete === 'function') {\n options.onComplete()\n }\n }\n };\n\n // Start animating scroll\n requestID = requestAnimationFrame(step);\n }\n\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = __ANIMATE_SCROLL_TO;\n exports = module.exports;\n }\n exports.default = __ANIMATE_SCROLL_TO;\n } else if (window) {\n window.animateScrollTo = __ANIMATE_SCROLL_TO;\n }\n}).call(this);\n","import animateScrollTo from \"animated-scroll-to\";\nimport { getElements } from \"@oddcamp/js-utils/src/selector\";\n\nconst onClick = (e) => {\n e.preventDefault();\n\n const targetID = e.currentTarget.getAttribute(\"href\");\n let targetEl = document.body;\n\n if (targetID != \"#\") {\n targetEl = document.querySelector(targetID) || document.body;\n }\n\n const tabIndex = parseInt(targetEl.getAttribute(\"tabindex\")) || null;\n\n animateScrollTo(targetEl, {\n speed: 300,\n minDuration: 200,\n maxDuration: 800,\n onComplete: () => {\n if (!tabIndex) targetEl.tabIndex = 0;\n targetEl.focus();\n setTimeout(() => {\n if (!tabIndex) targetEl.removeAttribute(\"tabindex\");\n else targetEl.setAttribute(\"tabindex\", tabIndex);\n }, 10);\n window.history.pushState(\"\", \"\", targetID);\n },\n });\n};\n\nconst init = () => {\n const elements = getElements(\".smooth-anchor\");\n if (!elements.length) return;\n\n elements.forEach((element) => {\n element.setAttribute(\"data-turbolinks\", false);\n element.addEventListener(\"click\", onClick);\n });\n};\n\nif (typeof Turbolinks !== \"undefined\") {\n document.addEventListener(\"turbolinks:load\", init);\n} else {\n document.readyState === \"loading\"\n ? document.addEventListener(\"DOMContentLoaded\", init)\n : init();\n}\n","/*! choices.js v4.1.3 | (c) 2018 Josh Johnson | https://github.com/jshjohnson/Choices#readme */ \n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.Choices=t():e.Choices=t()}(\"undefined\"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,\"a\",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p=\"/public/assets/scripts/\",t(t.s=37)}([function(e,t,n){var i=n(26)(\"wks\"),r=n(13),o=n(3).Symbol,s=\"function\"==typeof o;(e.exports=function(e){return i[e]||(i[e]=s&&o[e]||(s?o:r)(\"Symbol.\"+e))}).store=i},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var i=t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},r=t.generateChars=function(e){for(var t=\"\",n=0;n2&&void 0!==arguments[2]?arguments[2]:1;if(e&&t){var i=e.parentNode.parentNode,r=Array.from(i.querySelectorAll(t));return r[r.indexOf(e)+(n>0?1:-1)]}},t.isScrolledIntoView=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(e){return n>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop}},t.stripHTML=function(e){return e.replace(/&/g,\"&\").replace(/>/g,\"&rt;\").replace(/\"+a(n)+\"\");if(r.style.position=\"absolute\",r.style.padding=\"0\",r.style.top=\"-9999px\",r.style.left=\"-9999px\",r.style.width=\"auto\",r.style.whiteSpace=\"pre\",document.body.contains(e)&&window.getComputedStyle){var o=window.getComputedStyle(e);o&&(r.style.fontSize=o.fontSize,r.style.fontFamily=o.fontFamily,r.style.fontWeight=o.fontWeight,r.style.fontStyle=o.fontStyle,r.style.letterSpacing=o.letterSpacing,r.style.textTransform=o.textTransform,r.style.padding=o.padding)}document.body.appendChild(r),requestAnimationFrame(function(){n&&r.offsetWidth!==e.offsetWidth&&(i=r.offsetWidth+4),document.body.removeChild(r),t.call(void 0,i+\"px\")})}else t.call(void 0,i+\"px\")},t.sortByAlpha=function(e,t){var n=(e.label||e.value).toLowerCase(),i=(t.label||t.value).toLowerCase();return ni?1:0},t.sortByScore=function(e,t){return e.score-t.score},t.dispatchEvent=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0});return e.dispatchEvent(i)},t.regexFilter=function(e,t){return!(!e||!t)&&new RegExp(t.source,\"i\").test(e)},t.getWindowHeight=function(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)},t.reduceToValues=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"value\";return e.reduce(function(e,n){return e.push(n[t]),e},[])},t.fetchFromObject=function e(t,n){var i=n.indexOf(\".\");return i>-1?e(t[n.substring(0,i)],n.substr(i+1)):t[n]},t.isIE11=function(){return!(!navigator.userAgent.match(/Trident/)||!navigator.userAgent.match(/rv[ :]11/))},t.existsInArray=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"value\";return e.some(function(e){return s(\"String\",t)?e[n]===t.trim():e[n]===t})},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.doKeysMatch=function(e,t){var n=Object.keys(e).sort(),i=Object.keys(t).sort();return JSON.stringify(n)===JSON.stringify(i)}},function(e,t){var n=e.exports={version:\"2.5.7\"};\"number\"==typeof __e&&(__e=n)},function(e,t){var n=e.exports=\"undefined\"!=typeof window&&window.Math==Math?window:\"undefined\"!=typeof self&&self.Math==Math?self:Function(\"return this\")();\"number\"==typeof __g&&(__g=n)},function(e,t,n){var i=n(7),r=n(12);e.exports=n(10)?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.SCROLLING_SPEED=t.KEY_CODES=t.ACTION_TYPES=t.EVENTS=t.DEFAULT_CONFIG=t.DEFAULT_CLASSNAMES=void 0;var i=n(1),r=t.DEFAULT_CLASSNAMES={containerOuter:\"choices\",containerInner:\"choices__inner\",input:\"choices__input\",inputCloned:\"choices__input--cloned\",list:\"choices__list\",listItems:\"choices__list--multiple\",listSingle:\"choices__list--single\",listDropdown:\"choices__list--dropdown\",item:\"choices__item\",itemSelectable:\"choices__item--selectable\",itemDisabled:\"choices__item--disabled\",itemChoice:\"choices__item--choice\",placeholder:\"choices__placeholder\",group:\"choices__group\",groupHeading:\"choices__heading\",button:\"choices__button\",activeState:\"is-active\",focusState:\"is-focused\",openState:\"is-open\",disabledState:\"is-disabled\",highlightedState:\"is-highlighted\",hiddenState:\"is-hidden\",flippedState:\"is-flipped\",loadingState:\"is-loading\",noResults:\"has-no-results\",noChoices:\"has-no-choices\"};t.DEFAULT_CONFIG={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!0,delimiter:\",\",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:[\"label\",\"value\"],position:\"auto\",resetScrollPosition:!0,regexFilter:null,shouldSort:!0,shouldSortItems:!1,sortFn:i.sortByAlpha,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:\"auto\",loadingText:\"Loading...\",noResultsText:\"No results found\",noChoicesText:\"No choices to choose from\",itemSelectText:\"Press to select\",uniqueItemText:\"Only unique values can be added\",addItemText:function(e){return'Press Enter to add \"'+(0,i.stripHTML)(e)+'\"'},maxItemText:function(e){return\"Only \"+e+\" values can be added\"},itemComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:r},t.EVENTS={showDropdown:\"showDropdown\",hideDropdown:\"hideDropdown\",change:\"change\",choice:\"choice\",search:\"search\",addItem:\"addItem\",removeItem:\"removeItem\",highlightItem:\"highlightItem\",highlightChoice:\"highlightChoice\"},t.ACTION_TYPES={ADD_CHOICE:\"ADD_CHOICE\",FILTER_CHOICES:\"FILTER_CHOICES\",ACTIVATE_CHOICES:\"ACTIVATE_CHOICES\",CLEAR_CHOICES:\"CLEAR_CHOICES\",ADD_GROUP:\"ADD_GROUP\",ADD_ITEM:\"ADD_ITEM\",REMOVE_ITEM:\"REMOVE_ITEM\",HIGHLIGHT_ITEM:\"HIGHLIGHT_ITEM\",CLEAR_ALL:\"CLEAR_ALL\"},t.KEY_CODES={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},t.SCROLLING_SPEED=4},function(e,t,n){var i=n(3),r=n(2),o=n(4),s=n(24),a=n(14),c=function(e,t,n){var l,u,h,d,f=e&c.F,p=e&c.G,v=e&c.S,m=e&c.P,g=e&c.B,y=p?i:v?i[t]||(i[t]={}):(i[t]||{}).prototype,_=p?r:r[t]||(r[t]={}),b=_.prototype||(_.prototype={});p&&(n=t);for(l in n)u=!f&&y&&void 0!==y[l],h=(u?y:n)[l],d=g&&u?a(h,i):m&&\"function\"==typeof h?a(Function.call,h):h,y&&s(y,l,h,e&c.U),_[l]!=h&&o(_,l,d),m&&b[l]!=h&&(b[l]=h)};i.core=r,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t,n){var i=n(8),r=n(44),o=n(45),s=Object.defineProperty;t.f=n(10)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return s(e,t,n)}catch(e){}if(\"get\"in n||\"set\"in n)throw TypeError(\"Accessors not supported!\");return\"value\"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(9);e.exports=function(e){if(!i(e))throw TypeError(e+\" is not an object!\");return e}},function(e,t){e.exports=function(e){return\"object\"==typeof e?null!==e:\"function\"==typeof e}},function(e,t,n){e.exports=!n(22)(function(){return 7!=Object.defineProperty({},\"a\",{get:function(){return 7}}).a})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,i=Math.random();e.exports=function(e){return\"Symbol(\".concat(void 0===e?\"\":e,\")_\",(++n+i).toString(36))}},function(e,t,n){var i=n(46);e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var i=n(17);e.exports=function(e){return Object(i(e))}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError(\"Can't call method on \"+e);return e}},function(e,t,n){var i=n(19),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},function(e,t){var n=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},function(e,t){e.exports={}},function(e,t,n){var i=n(26)(\"keys\"),r=n(13);e.exports=function(e){return i[e]||(i[e]=r(e))}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var i=n(9),r=n(3).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},function(e,t,n){var i=n(3),r=n(4),o=n(11),s=n(13)(\"src\"),a=Function.toString,c=(\"\"+a).split(\"toString\");n(2).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,a){var l=\"function\"==typeof n;l&&(o(n,\"name\")||r(n,\"name\",t)),e[t]!==n&&(l&&(o(n,s)||r(n,s,e[t]?\"\"+e[t]:c.join(String(t)))),e===i?e[t]=n:a?e[t]?e[t]=n:r(e,t,n):(delete e[t],r(e,t,n)))})(Function.prototype,\"toString\",function(){return\"function\"==typeof this&&this[s]||a.call(this)})},function(e,t,n){var i=n(15);e.exports=Object(\"z\").propertyIsEnumerable(0)?Object:function(e){return\"String\"==i(e)?e.split(\"\"):Object(e)}},function(e,t,n){var i=n(2),r=n(3),o=r[\"__core-js_shared__\"]||(r[\"__core-js_shared__\"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})(\"versions\",[]).push({version:i.version,mode:n(27)?\"pure\":\"global\",copyright:\"© 2018 Denis Pushkarev (zloirock.ru)\"})},function(e,t){e.exports=!1},function(e,t,n){var i=n(0)(\"unscopables\"),r=Array.prototype;void 0==r[i]&&n(4)(r,i,{}),e.exports=function(e){r[i][e]=!0}},function(e,t,n){var i=n(25),r=n(17);e.exports=function(e){return i(r(e))}},function(e,t,n){var i=n(29),r=n(18),o=n(60);e.exports=function(e){return function(t,n,s){var a,c=i(t),l=r(c.length),u=o(s,l);if(e&&n!=n){for(;l>u;)if((a=c[u++])!=a)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},function(e,t){e.exports=\"constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\".split(\",\")},function(e,t,n){var i=n(7).f,r=n(11),o=n(0)(\"toStringTag\");e.exports=function(e,t,n){e&&!r(e=n?e:e.prototype,o)&&i(e,o,{configurable:!0,value:t})}},function(e,t,n){\"use strict\";function i(e){var t=I.call(e,w),n=e[w];try{e[w]=void 0;var i=!0}catch(e){}var r=C.call(e);return i&&(t?e[w]=n:delete e[w]),r}function r(e){return k.call(e)}function o(e){return null==e?void 0===e?P:L:D&&D in Object(e)?A(e):x(e)}function s(e,t){return function(n){return e(t(n))}}function a(e){return null!=e&&\"object\"==typeof e}function c(e){if(!K(e)||j(e)!=R)return!1;var t=N(e);if(null===t)return!0;var n=Y.call(t,\"constructor\")&&t.constructor;return\"function\"==typeof n&&n instanceof n&&B.call(n)==G}function l(e,t,n){function i(){p===f&&(p=f.slice())}function r(){return d}function o(e){if(\"function\"!=typeof e)throw new Error(\"Expected listener to be a function.\");var t=!0;return i(),p.push(e),function(){if(t){t=!1,i();var n=p.indexOf(e);p.splice(n,1)}}}function s(e){if(!W(e))throw new Error(\"Actions must be plain objects. Use custom middleware for async actions.\");if(void 0===e.type)throw new Error('Actions may not have an undefined \"type\" property. Have you misspelled a constant?');if(v)throw new Error(\"Reducers may not dispatch actions.\");try{v=!0,d=h(d,e)}finally{v=!1}for(var t=f=p,n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(s)throw s;for(var i=!1,r={},a=0;a\\n \\n ')},containerInner:function(e){return(0,s.strToEl)('\\n
\\n ')},itemList:function(e,t){var n,r=(0,o.default)(e.list,(n={},i(n,e.listSingle,t),i(n,e.listItems,!t),n));return(0,s.strToEl)('\\n
\\n ')},placeholder:function(e,t){return(0,s.strToEl)('\\n
\\n '+t+\"\\n
\\n \")},item:function(e,t,n){var r,a=t.active?'aria-selected=\"true\"':\"\",c=t.disabled?'aria-disabled=\"true\"':\"\",l=(0,o.default)(e.item,(r={},i(r,e.highlightedState,t.highlighted),i(r,e.itemSelectable,!t.highlighted),i(r,e.placeholder,t.placeholder),r));if(n){var u;return l=(0,o.default)(e.item,(u={},i(u,e.highlightedState,t.highlighted),i(u,e.itemSelectable,!t.disabled),i(u,e.placeholder,t.placeholder),u)),(0,s.strToEl)('\\n \\n \"+t.label+'\\x3c!--\\n --\\x3e\\n Remove item\\n \\n \\n \")}return(0,s.strToEl)('\\n \\n \"+t.label+\"\\n \\n \")},choiceList:function(e,t){var n=t?\"\":'aria-multiselectable=\"true\"';return(0,s.strToEl)('\\n \\n \\n \")},choiceGroup:function(e,t){var n=t.disabled?'aria-disabled=\"true\"':\"\",r=(0,o.default)(e.group,i({},e.itemDisabled,t.disabled));return(0,s.strToEl)('\\n \\n
'+t.value+\"
\\n \\n \")},choice:function(e,t,n){var r,a=t.groupId>0?'role=\"treeitem\"':'role=\"option\"',c=(0,o.default)(e.item,e.itemChoice,(r={},i(r,e.itemDisabled,t.disabled),i(r,e.itemSelectable,!t.disabled),i(r,e.placeholder,t.placeholder),r));return(0,s.strToEl)('\\n \\n \"+t.label+\"\\n \\n \")},input:function(e){var t=(0,o.default)(e.input,e.inputCloned);return(0,s.strToEl)('\\n \\n ')},dropdown:function(e){var t=(0,o.default)(e.list,e.listDropdown);return(0,s.strToEl)('\\n \\n \\n ')},notice:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\",a=(0,o.default)(e.item,e.itemChoice,(n={},i(n,e.noResults,\"no-results\"===r),i(n,e.noChoices,\"no-choices\"===r),n));return(0,s.strToEl)('\\n
\\n '+t+\"\\n
\\n \")},option:function(e){return(0,s.strToEl)('\\n \\n \")}};t.default=a},function(e,t,n){e.exports=n(38)},function(e,t,n){\"use strict\";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:\"[data-choice]\",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),(0,E.isType)(\"String\",t)){var i=Array.from(document.querySelectorAll(t));if(i.length>1)return this._generateInstances(i,n)}this.config=h.default.all([v.DEFAULT_CONFIG,e.userDefaults,n]),(0,E.doKeysMatch)(this.config,v.DEFAULT_CONFIG)||console.warn(\"Unknown config option(s) passed\"),[\"auto\",\"always\"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices=\"auto\");var r=(0,E.isType)(\"String\",t)?document.querySelector(t):t;return r?(this._isTextElement=\"text\"===r.type,this._isSelectOneElement=\"select-one\"===r.type,this._isSelectMultipleElement=\"select-multiple\"===r.type,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this._isTextElement?this.passedElement=new p.WrappedInput({element:r,classNames:this.config.classNames,delimiter:this.config.delimiter}):this._isSelectElement&&(this.passedElement=new p.WrappedSelect({element:r,classNames:this.config.classNames})),r?(!0===this.config.shouldSortItems&&this._isSelectOneElement&&!this.config.silent&&console.warn(\"shouldSortElements: Type of passed element is 'select-one', falling back to false.\"),this.initialised=!1,this._store=new f.default(this.render),this._initialState={},this._currentState={},this._prevState={},this._currentValue=\"\",this._canSearch=this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=(0,E.generateId)(this.passedElement.element,\"choices-\"),this._direction=this.passedElement.element.getAttribute(\"dir\")||\"ltr\",this._idNames={itemChoice:\"item-choice\"},this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&(this._presetItems=this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onAKey=this._onAKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),\"active\"===this.passedElement.element.getAttribute(\"data-choice\")&&console.warn(\"Trying to initialise Choices on element already initialised\"),void this.init()):console.error(\"Passed element was of an invalid type\")):console.error(\"Could not find passed element or passed element was of an invalid type\")}return a(e,[{key:\"init\",value:function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._initialState=(0,E.cloneObject)(this._store.state),this._store.subscribe(this._render),this._render(),this._addEventListeners();(!this.config.addItems||this.passedElement.element.hasAttribute(\"disabled\"))&&this.disable(),this.initialised=!0;var e=this.config.callbackOnInit;e&&(0,E.isType)(\"Function\",e)&&e.call(this)}}},{key:\"destroy\",value:function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._isSelectElement&&(this.passedElement.options=this._presetChoices),this.clearStore(),this.config.templates=null,this.initialised=!1)}},{key:\"enable\",value:function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this}},{key:\"disable\",value:function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this}},{key:\"highlightItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return this;var n=e.id,i=e.groupId,r=void 0===i?-1:i,o=e.value,s=void 0===o?\"\":o,a=e.label,c=void 0===a?\"\":a,l=r>=0?this._store.getGroupById(r):null;return this._store.dispatch((0,y.highlightItem)(n,!0)),t&&this.passedElement.triggerEvent(v.EVENTS.highlightItem,{id:n,value:s,label:c,groupValue:l&&l.value?l.value:null}),this}},{key:\"unhighlightItem\",value:function(e){if(!e)return this;var t=e.id,n=e.groupId,i=void 0===n?-1:n,r=e.value,o=void 0===r?\"\":r,s=e.label,a=void 0===s?\"\":s,c=i>=0?this._store.getGroupById(i):null;return this._store.dispatch((0,y.highlightItem)(t,!1)),this.passedElement.triggerEvent(v.EVENTS.highlightItem,{id:t,value:o,label:a,groupValue:c&&c.value?c.value:null}),this}},{key:\"highlightAll\",value:function(){var e=this;return this._store.items.forEach(function(t){return e.highlightItem(t)}),this}},{key:\"unhighlightAll\",value:function(){var e=this;return this._store.items.forEach(function(t){return e.unhighlightItem(t)}),this}},{key:\"removeActiveItemsByValue\",value:function(e){var t=this;return this._store.activeItems.filter(function(t){return t.value===e}).forEach(function(e){return t._removeItem(e)}),this}},{key:\"removeActiveItems\",value:function(e){var t=this;return this._store.activeItems.filter(function(t){return t.id!==e}).forEach(function(e){return t._removeItem(e)}),this}},{key:\"removeHighlightedItems\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._store.highlightedActiveItems.forEach(function(n){e._removeItem(n),t&&e._triggerChange(n.value)}),this}},{key:\"showDropdown\",value:function(e){var t=this;return this.dropdown.isActive?this:(requestAnimationFrame(function(){t.dropdown.show(),t.containerOuter.open(t.dropdown.distanceFromTopWindow()),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(v.EVENTS.showDropdown,{})}),this)}},{key:\"hideDropdown\",value:function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(v.EVENTS.hideDropdown,{})}),this):this}},{key:\"toggleDropdown\",value:function(){return this.dropdown.isActive?this.hideDropdown():this.showDropdown(),this}},{key:\"getValue\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this._store.activeItems.reduce(function(t,n){var i=e?n.value:n;return t.push(i),t},[]);return this._isSelectOneElement?t[0]:t}},{key:\"setValue\",value:function(e){var t=this;return this.initialised?([].concat(o(e)).forEach(function(e){return t._setChoiceOrItem(e)}),this):this}},{key:\"setChoiceByValue\",value:function(e){var t=this;return!this.initialised||this._isTextElement?this:(((0,E.isType)(\"Array\",e)?e:[e]).forEach(function(e){return t._findAndSelectChoiceByValue(e)}),this)}},{key:\"setChoices\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this._isSelectElement||!e.length||!t)return this;r&&this._clearChoices(),this.containerOuter.removeLoadingState();var o=function(e){e.choices?n._addGroup({group:e,id:e.id||null,valueKey:t,labelKey:i}):n._addChoice({value:e[t],label:e[i],isSelected:e.selected,isDisabled:e.disabled,customProperties:e.customProperties,placeholder:e.placeholder})};return e.forEach(o),this}},{key:\"clearStore\",value:function(){return this._store.dispatch((0,b.clearAll)()),this}},{key:\"clearInput\",value:function(){var e=!this._isSelectOneElement;return this.input.clear(e),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch((0,g.activateChoices)(!0))),this}},{key:\"ajax\",value:function(e){var t=this;return this.initialised&&this._isSelectElement&&e?(requestAnimationFrame(function(){return t._handleLoadingState(!0)}),e(this._ajaxCallback()),this):this}},{key:\"_render\",value:function(){this._currentState=this._store.state;var e=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,t=this._isSelectElement,n=this._currentState.items!==this._prevState.items;e&&(t&&this._renderChoices(),n&&this._renderItems(),this._prevState=this._currentState)}},{key:\"_renderChoices\",value:function(){var e=this,t=this._store,n=t.activeGroups,i=t.activeChoices,r=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame(function(){return e.choiceList.scrollToTop()}),n.length>=1&&!this._isSearching){var o=i.filter(function(e){return!0===e.placeholder&&-1===e.groupId});o.length>=1&&(r=this._createChoicesFragment(o,r)),r=this._createGroupsFragment(n,i,r)}else i.length>=1&&(r=this._createChoicesFragment(i,r));if(r.childNodes&&r.childNodes.length>0){var s=this._store.activeItems,a=this._canAddItem(s,this.input.value);a.response?(this.choiceList.append(r),this._highlightChoice()):this.choiceList.append(this._getTemplate(\"notice\",a.notice))}else{var c=void 0,l=void 0;this._isSearching?(l=(0,E.isType)(\"Function\",this.config.noResultsText)?this.config.noResultsText():this.config.noResultsText,c=this._getTemplate(\"notice\",l,\"no-results\")):(l=(0,E.isType)(\"Function\",this.config.noChoicesText)?this.config.noChoicesText():this.config.noChoicesText,c=this._getTemplate(\"notice\",l,\"no-choices\")),this.choiceList.append(c)}}},{key:\"_renderItems\",value:function(){var e=this._store.activeItems||[];this.itemList.clear();var t=this._createItemsFragment(e);t.childNodes&&this.itemList.append(t)}},{key:\"_createGroupsFragment\",value:function(e,t,n){var i=this,r=n||document.createDocumentFragment(),o=function(e){return t.filter(function(t){return i._isSelectOneElement?t.groupId===e.id:t.groupId===e.id&&(\"always\"===i.config.renderSelectedChoices||!t.selected)})};return this.config.shouldSort&&e.sort(this.config.sortFn),e.forEach(function(e){var t=o(e);if(t.length>=1){var n=i._getTemplate(\"choiceGroup\",e);r.appendChild(n),i._createChoicesFragment(t,r,!0)}}),r}},{key:\"_createChoicesFragment\",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t||document.createDocumentFragment(),s=this.config,a=s.renderSelectedChoices,c=s.searchResultLimit,l=s.renderChoiceLimit,u=this._isSearching?E.sortByScore:this.config.sortFn,h=e;\"auto\"!==a||this._isSelectOneElement||(h=e.filter(function(e){return!e.selected}));var d=h.reduce(function(e,t){return t.placeholder?e.placeholderChoices.push(t):e.normalChoices.push(t),e},{placeholderChoices:[],normalChoices:[]}),f=d.placeholderChoices,p=d.normalChoices;(this.config.shouldSort||this._isSearching)&&p.sort(u);var v=h.length,m=[].concat(o(f),o(p));this._isSearching?v=c:l>0&&!i&&(v=l);for(var g=0;g1&&void 0!==arguments[1]?arguments[1]:null,i=this.config,r=i.shouldSortItems,o=i.sortFn,s=i.removeItemButton,a=n||document.createDocumentFragment();r&&!this._isSelectOneElement&&e.sort(o),this._isTextElement?this.passedElement.value=e:this.passedElement.options=e;var c=function(e){var n=t._getTemplate(\"item\",e,s);a.appendChild(n)};return e.forEach(function(e){return c(e)}),a}},{key:\"_triggerChange\",value:function(e){void 0!==e&&null!==e&&this.passedElement.triggerEvent(v.EVENTS.change,{value:e})}},{key:\"_selectPlaceholderChoice\",value:function(){var e=this._store.placeholderChoice;e&&(this._addItem({value:e.value,label:e.label,choiceId:e.id,groupId:e.groupId,placeholder:e.placeholder}),this._triggerChange(e.value))}},{key:\"_handleButtonAction\",value:function(e,t){if(e&&t&&this.config.removeItems&&this.config.removeItemButton){var n=t.parentNode.getAttribute(\"data-id\"),i=e.find(function(e){return e.id===parseInt(n,10)});this._removeItem(i),this._triggerChange(i.value),this._isSelectOneElement&&this._selectPlaceholderChoice()}}},{key:\"_handleItemAction\",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e&&t&&this.config.removeItems&&!this._isSelectOneElement){var r=t.getAttribute(\"data-id\");e.forEach(function(e){e.id!==parseInt(r,10)||e.highlighted?!i&&e.highlighted&&n.unhighlightItem(e):n.highlightItem(e)}),this.input.focus()}}},{key:\"_handleChoiceAction\",value:function(e,t){if(e&&t){var n=t.getAttribute(\"data-id\"),i=this._store.getChoiceById(n),r=e[0]&&e[0].keyCode?e[0].keyCode:null,o=this.dropdown.isActive;if(i.keyCode=r,this.passedElement.triggerEvent(v.EVENTS.choice,{choice:i}),i&&!i.selected&&!i.disabled){this._canAddItem(e,i.value).response&&(this._addItem({value:i.value,label:i.label,choiceId:i.id,groupId:i.groupId,customProperties:i.customProperties,placeholder:i.placeholder,keyCode:i.keyCode}),this._triggerChange(i.value))}this.clearInput(),o&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},{key:\"_handleBackspace\",value:function(e){if(this.config.removeItems&&e){var t=e[e.length-1],n=e.some(function(e){return e.highlighted});this.config.editItems&&!n&&t?(this.input.value=t.value,this.input.setWidth(),this._removeItem(t),this._triggerChange(t.value)):(n||this.highlightItem(t,!1),this.removeHighlightedItems(!0))}}},{key:\"_handleLoadingState\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.itemList.getChild(\".\"+this.config.classNames.placeholder);e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t?t.innerHTML=this.config.loadingText:(t=this._getTemplate(\"placeholder\",this.config.loadingText),this.itemList.append(t)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?t.innerHTML=this._placeholderValue||\"\":this.input.placeholder=this._placeholderValue||\"\")}},{key:\"_handleSearch\",value:function(e){if(e&&this.input.isFocussed){var t=this._store.choices,n=this.config,i=n.searchFloor,r=n.searchChoices,o=t.some(function(e){return!e.active});if(e&&e.length>=i){var s=r?this._searchChoices(e):0;this.passedElement.triggerEvent(v.EVENTS.search,{value:e,resultCount:s})}else o&&(this._isSearching=!1,this._store.dispatch((0,g.activateChoices)(!0)))}}},{key:\"_canAddItem\",value:function(e,t){var n=!0,i=(0,E.isType)(\"Function\",this.config.addItemText)?this.config.addItemText(t):this.config.addItemText;if(!this._isSelectOneElement){var r=(0,E.existsInArray)(e,t);this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,i=(0,E.isType)(\"Function\",this.config.maxItemText)?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),this.config.regexFilter&&this._isTextElement&&this.config.addItems&&n&&(n=(0,E.regexFilter)(t,this.config.regexFilter)),!this.config.duplicateItemsAllowed&&r&&n&&(n=!1,i=(0,E.isType)(\"Function\",this.config.uniqueItemText)?this.config.uniqueItemText(t):this.config.uniqueItemText)}return{response:n,notice:i}}},{key:\"_ajaxCallback\",value:function(){var e=this;return function(t,n,i){if(t&&n){var r=(0,E.isType)(\"Object\",t)?[t]:t;r&&(0,E.isType)(\"Array\",r)&&r.length?(e._handleLoadingState(!1),r.forEach(function(t){t.choices?e._addGroup({group:t,id:t.id||null,valueKey:n,labelKey:i}):e._addChoice({value:(0,E.fetchFromObject)(t,n),label:(0,E.fetchFromObject)(t,i),isSelected:t.selected,isDisabled:t.disabled,customProperties:t.customProperties,placeholder:t.placeholder})}),e._isSelectOneElement&&e._selectPlaceholderChoice()):e._handleLoadingState(!1)}}}},{key:\"_searchChoices\",value:function(e){var t=(0,E.isType)(\"String\",e)?e.trim():e,n=(0,E.isType)(\"String\",this._currentValue)?this._currentValue.trim():this._currentValue;if(t.length<1&&t===n+\" \")return 0;var i=this._store.searchableChoices,r=t,s=[].concat(o(this.config.searchFields)),a=Object.assign(this.config.fuseOptions,{keys:s}),c=new l.default(i,a),u=c.search(r);return this._currentValue=t,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch((0,g.filterChoices)(u)),u.length}},{key:\"_addEventListeners\",value:function(){document.addEventListener(\"keyup\",this._onKeyUp),document.addEventListener(\"keydown\",this._onKeyDown),document.addEventListener(\"click\",this._onClick),document.addEventListener(\"touchmove\",this._onTouchMove),document.addEventListener(\"touchend\",this._onTouchEnd),document.addEventListener(\"mousedown\",this._onMouseDown),document.addEventListener(\"mouseover\",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.addEventListener(\"focus\",this._onFocus),this.containerOuter.element.addEventListener(\"blur\",this._onBlur)),this.input.element.addEventListener(\"focus\",this._onFocus),this.input.element.addEventListener(\"blur\",this._onBlur),this.input.element.form&&this.input.element.form.addEventListener(\"reset\",this._onFormReset),this.input.addEventListeners()}},{key:\"_removeEventListeners\",value:function(){document.removeEventListener(\"keyup\",this._onKeyUp),document.removeEventListener(\"keydown\",this._onKeyDown),document.removeEventListener(\"click\",this._onClick),document.removeEventListener(\"touchmove\",this._onTouchMove),document.removeEventListener(\"touchend\",this._onTouchEnd),document.removeEventListener(\"mousedown\",this._onMouseDown),document.removeEventListener(\"mouseover\",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener(\"focus\",this._onFocus),this.containerOuter.element.removeEventListener(\"blur\",this._onBlur)),this.input.element.removeEventListener(\"focus\",this._onFocus),this.input.element.removeEventListener(\"blur\",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener(\"reset\",this._onFormReset),this.input.removeEventListeners()}},{key:\"_onKeyDown\",value:function(e){var t,n=e.target,i=e.keyCode,o=e.ctrlKey,s=e.metaKey;if(n===this.input.element||this.containerOuter.element.contains(n)){var a=this._store.activeItems,c=this.input.isFocussed,l=this.dropdown.isActive,u=this.itemList.hasChildren,h=String.fromCharCode(i),d=v.KEY_CODES.BACK_KEY,f=v.KEY_CODES.DELETE_KEY,p=v.KEY_CODES.ENTER_KEY,m=v.KEY_CODES.A_KEY,g=v.KEY_CODES.ESC_KEY,y=v.KEY_CODES.UP_KEY,_=v.KEY_CODES.DOWN_KEY,b=v.KEY_CODES.PAGE_UP_KEY,E=v.KEY_CODES.PAGE_DOWN_KEY,S=o||s;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(h)&&this.showDropdown();var O=(t={},r(t,m,this._onAKey),r(t,p,this._onEnterKey),r(t,g,this._onEscapeKey),r(t,y,this._onDirectionKey),r(t,b,this._onDirectionKey),r(t,_,this._onDirectionKey),r(t,E,this._onDirectionKey),r(t,f,this._onDeleteKey),r(t,d,this._onDeleteKey),t);O[i]&&O[i]({event:e,target:n,keyCode:i,metaKey:s,activeItems:a,hasFocusedInput:c,hasActiveDropdown:l,hasItems:u,hasCtrlDownKeyPressed:S})}}},{key:\"_onKeyUp\",value:function(e){var t=e.target,n=e.keyCode;if(t===this.input.element){var i=this.input.value,r=this._store.activeItems,o=this._canAddItem(r,i);if(this._isTextElement)if(i){if(o.notice){var s=this._getTemplate(\"notice\",o.notice);this.dropdown.element.innerHTML=s.outerHTML}!0===o.response?this.showDropdown(!0):o.notice||this.hideDropdown(!0)}else this.hideDropdown(!0);else{var a=v.KEY_CODES.BACK_KEY,c=v.KEY_CODES.DELETE_KEY;n!==a&&n!==c||t.value?this._canSearch&&o.response&&this._handleSearch(this.input.value):!this._isTextElement&&this._isSearching&&(this._isSearching=!1,this._store.dispatch((0,g.activateChoices)(!0)))}this._canSearch=this.config.searchEnabled}}},{key:\"_onAKey\",value:function(e){var t=e.hasItems;e.hasCtrlDownKeyPressed&&t&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())}},{key:\"_onEnterKey\",value:function(e){var t=e.event,n=e.target,i=e.activeItems,r=e.hasActiveDropdown,o=v.KEY_CODES.ENTER_KEY;if(this._isTextElement&&n.value){var s=this.input.value;this._canAddItem(i,s).response&&(this.hideDropdown(!0),this._addItem({value:s}),this._triggerChange(s),this.clearInput())}if(n.hasAttribute(\"data-button\")&&(this._handleButtonAction(i,n),t.preventDefault()),r){var a=this.dropdown.getChild(\".\"+this.config.classNames.highlightedState);a&&(i[0]&&(i[0].keyCode=o),this._handleChoiceAction(i,a)),t.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),t.preventDefault())}},{key:\"_onEscapeKey\",value:function(e){e.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())}},{key:\"_onDirectionKey\",value:function(e){var t=e.event,n=e.hasActiveDropdown,i=e.keyCode,r=e.metaKey,o=v.KEY_CODES.DOWN_KEY,s=v.KEY_CODES.PAGE_UP_KEY,a=v.KEY_CODES.PAGE_DOWN_KEY;if(n||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var c=i===o||i===a?1:-1,l=r||i===a||i===s,u=void 0;if(l)u=c>0?Array.from(this.dropdown.element.querySelectorAll(\"[data-choice-selectable]\")).pop():this.dropdown.element.querySelector(\"[data-choice-selectable]\");else{var h=this.dropdown.element.querySelector(\".\"+this.config.classNames.highlightedState);u=h?(0,E.getAdjacentEl)(h,\"[data-choice-selectable]\",c):this.dropdown.element.querySelector(\"[data-choice-selectable]\")}u&&((0,E.isScrolledIntoView)(u,this.choiceList.element,c)||this.choiceList.scrollToChoice(u,c),this._highlightChoice(u)),t.preventDefault()}}},{key:\"_onDeleteKey\",value:function(e){var t=e.event,n=e.target,i=e.hasFocusedInput,r=e.activeItems;!i||n.value||this._isSelectOneElement||(this._handleBackspace(r),t.preventDefault())}},{key:\"_onTouchMove\",value:function(){!0===this._wasTap&&(this._wasTap=!1)}},{key:\"_onTouchEnd\",value:function(e){var t=e.target||e.touches[0].target;if(!0===this._wasTap&&this.containerOuter.element.contains(t)){(t===this.containerOuter.element||t===this.containerInner.element)&&!this._isSelectOneElement&&(this._isTextElement?this.input.focus():this.showDropdown()),e.stopPropagation()}this._wasTap=!0}},{key:\"_onMouseDown\",value:function(e){var t=e.target,n=e.shiftKey;if(t===this.choiceList&&(0,E.isIE11)()&&(this._isScrollingOnIe=!0),this.containerOuter.element.contains(t)&&t!==this.input.element){var i=this._store.activeItems,r=n,o=(0,E.findAncestorByAttrName)(t,\"data-button\"),s=(0,E.findAncestorByAttrName)(t,\"data-item\"),a=(0,E.findAncestorByAttrName)(t,\"data-choice\");o?this._handleButtonAction(i,o):s?this._handleItemAction(i,s,r):a&&this._handleChoiceAction(i,a),e.preventDefault()}}},{key:\"_onMouseOver\",value:function(e){var t=e.target;(t===this.dropdown||this.dropdown.element.contains(t))&&t.hasAttribute(\"data-choice\")&&this._highlightChoice(t)}},{key:\"_onClick\",value:function(e){var t=e.target;if(this.containerOuter.element.contains(t))this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus());else{this._store.highlightedActiveItems&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0)}}},{key:\"_onFocus\",value:function(e){var t=this,n=e.target;if(this.containerOuter.element.contains(n)){({text:function(){n===t.input.element&&t.containerOuter.addFocusState()},\"select-one\":function(){t.containerOuter.addFocusState(),n===t.input.element&&t.showDropdown(!0)},\"select-multiple\":function(){n===t.input.element&&(t.showDropdown(!0),t.containerOuter.addFocusState())}})[this.passedElement.element.type]()}}},{key:\"_onBlur\",value:function(e){var t=this,n=e.target;if(this.containerOuter.element.contains(n)&&!this._isScrollingOnIe){var i=this._store.activeItems,r=i.some(function(e){return e.highlighted});({text:function(){n===t.input.element&&(t.containerOuter.removeFocusState(),r&&t.unhighlightAll(),t.hideDropdown(!0))},\"select-one\":function(){t.containerOuter.removeFocusState(),(n===t.input.element||n===t.containerOuter.element&&!t._canSearch)&&t.hideDropdown(!0)},\"select-multiple\":function(){n===t.input.element&&(t.containerOuter.removeFocusState(),t.hideDropdown(!0),r&&t.unhighlightAll())}})[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()}},{key:\"_onFormReset\",value:function(){this._store.dispatch((0,b.resetTo)(this._initialState))}},{key:\"_highlightChoice\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=Array.from(this.dropdown.element.querySelectorAll(\"[data-choice-selectable]\"));if(n.length){var i=t;Array.from(this.dropdown.element.querySelectorAll(\".\"+this.config.classNames.highlightedState)).forEach(function(t){t.classList.remove(e.config.classNames.highlightedState),t.setAttribute(\"aria-selected\",\"false\")}),i?this._highlightPosition=n.indexOf(i):(i=n.length>this._highlightPosition?n[this._highlightPosition]:n[n.length-1])||(i=n[0]),i.classList.add(this.config.classNames.highlightedState),i.setAttribute(\"aria-selected\",\"true\"),this.passedElement.triggerEvent(v.EVENTS.highlightChoice,{el:i}),this.dropdown.isActive&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}}},{key:\"_addItem\",value:function(e){var t=e.value,n=e.label,i=void 0===n?null:n,r=e.choiceId,o=void 0===r?-1:r,s=e.groupId,a=void 0===s?-1:s,c=e.customProperties,l=void 0===c?null:c,u=e.placeholder,h=void 0!==u&&u,d=e.keyCode,f=void 0===d?null:d,p=(0,E.isType)(\"String\",t)?t.trim():t,m=f,g=l,_=this._store.items,b=i||p,S=parseInt(o,10)||-1,O=a>=0?this._store.getGroupById(a):null,I=_?_.length+1:1;return this.config.prependValue&&(p=this.config.prependValue+p.toString()),this.config.appendValue&&(p+=this.config.appendValue.toString()),this._store.dispatch((0,y.addItem)({value:p,label:b,id:I,choiceId:S,groupId:a,customProperties:l,placeholder:h,keyCode:m})),this._isSelectOneElement&&this.removeActiveItems(I),this.passedElement.triggerEvent(v.EVENTS.addItem,{id:I,value:p,label:b,customProperties:g,groupValue:O&&O.value?O.value:void 0,keyCode:m}),this}},{key:\"_removeItem\",value:function(e){if(!e||!(0,E.isType)(\"Object\",e))return this;var t=e.id,n=e.value,i=e.label,r=e.choiceId,o=e.groupId,s=o>=0?this._store.getGroupById(o):null;return this._store.dispatch((0,y.removeItem)(t,r)),s&&s.value?this.passedElement.triggerEvent(v.EVENTS.removeItem,{id:t,value:n,label:i,groupValue:s.value}):this.passedElement.triggerEvent(v.EVENTS.removeItem,{id:t,value:n,label:i}),this}},{key:\"_addChoice\",value:function(e){var t=e.value,n=e.label,i=void 0===n?null:n,r=e.isSelected,o=void 0!==r&&r,s=e.isDisabled,a=void 0!==s&&s,c=e.groupId,l=void 0===c?-1:c,u=e.customProperties,h=void 0===u?null:u,d=e.placeholder,f=void 0!==d&&d,p=e.keyCode,v=void 0===p?null:p;if(void 0!==t&&null!==t){var m=this._store.choices,y=i||t,_=m?m.length+1:1,b=this._baseId+\"-\"+this._idNames.itemChoice+\"-\"+_;this._store.dispatch((0,g.addChoice)({value:t,label:y,id:_,groupId:l,disabled:a,elementId:b,customProperties:h,placeholder:f,keyCode:v})),o&&this._addItem({value:t,label:y,choiceId:_,customProperties:h,placeholder:f,keyCode:v})}}},{key:\"_clearChoices\",value:function(){this._store.dispatch((0,g.clearChoices)())}},{key:\"_addGroup\",value:function(e){var t=this,n=e.group,i=e.id,r=e.valueKey,o=void 0===r?\"value\":r,s=e.labelKey,a=void 0===s?\"label\":s,c=(0,E.isType)(\"Object\",n)?n.choices:Array.from(n.getElementsByTagName(\"OPTION\")),l=i||Math.floor((new Date).valueOf()*Math.random()),u=!!n.disabled&&n.disabled;if(c){this._store.dispatch((0,_.addGroup)(n.label,l,!0,u));var h=function(e){var n=e.disabled||e.parentNode&&e.parentNode.disabled;t._addChoice({value:e[o],label:(0,E.isType)(\"Object\",e)?e[a]:e.innerHTML,isSelected:e.selected,isDisabled:n,groupId:l,customProperties:e.customProperties,placeholder:e.placeholder})};c.forEach(h)}else this._store.dispatch((0,_.addGroup)(n.label,n.id,!1,n.disabled))}},{key:\"_getTemplate\",value:function(e){var t;if(!e)return null;for(var n=this.config,i=n.templates,r=n.classNames,o=arguments.length,s=Array(o>1?o-1:0),a=1;an)return o(e,this.pattern,i);var r=this.options,a=r.location,c=r.distance,l=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:c,threshold:l,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=c},function(e,t,n){\"use strict\";var i=n(0),r=function e(t,n,r){if(n){var o=n.indexOf(\".\"),s=n,a=null;-1!==o&&(s=n.slice(0,o),a=n.slice(o+1));var c=t[s];if(null!==c&&void 0!==c)if(a||\"string\"!=typeof c&&\"number\"!=typeof c)if(i(c))for(var l=0,u=c.length;l0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],i=-1,r=-1,o=0,s=e.length;o=t&&n.push([i,r]),i=-1)}return e[o-1]&&o-i>=t&&n.push([i,o-1]),n}},function(e,t,n){\"use strict\";e.exports=function(e){for(var t={},n=e.length,i=0;i2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(t.replace(i,\"\\\\$&\").replace(n,\"|\")),o=e.match(r),s=!!o,a=[];if(s)for(var c=0,l=o.length;c=P;M-=1){var F=M-1,N=n[e.charAt(F)];if(N&&(E[F]=1),j[M]=(j[M+1]<<1|1)&N,0!==k&&(j[M]|=(C[M+1]|C[M])<<1|1|C[M+1]),j[M]&T&&(w=i(t,{errors:k,currentLocation:F,expectedLocation:m,distance:l}))<=y){if(y=w,(_=F)<=m)break;P=Math.max(1,2*m-_)}}if(i(t,{errors:k+1,currentLocation:m,expectedLocation:m,distance:l})>y)break;C=j}return{isMatch:_>=0,score:0===w?.001:w,matchedIndices:r(E,v)}}},function(e,t,n){\"use strict\";function i(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:\"\",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),i=0,r=n.length;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=this.list,i={},r=[];if(\"string\"==typeof n[0]){for(var o=0,s=n.length;o1)throw new Error(\"Key weight has to be > 0 and <= 1\");f=f.name}else a[f]={weight:1};this._analyze({key:f,value:this.options.getFn(u,f),record:u,index:c},{resultMap:i,results:r,tokenSearchers:e,fullSearcher:t})}return{weights:a,results:r}}},{key:\"_analyze\",value:function(e,t){var n=e.key,i=e.arrayIndex,r=void 0===i?-1:i,o=e.value,s=e.record,c=e.index,l=t.tokenSearchers,u=void 0===l?[]:l,h=t.fullSearcher,d=void 0===h?[]:h,f=t.resultMap,p=void 0===f?{}:f,v=t.results,m=void 0===v?[]:v;if(void 0!==o&&null!==o){var g=!1,y=-1,_=0;if(\"string\"==typeof o){this._log(\"\\nKey: \"+(\"\"===n?\"-\":n));var b=d.search(o);if(this._log('Full text: \"'+o+'\", score: '+b.score),this.options.tokenize){for(var E=o.split(this.options.tokenSeparator),S=[],O=0;O-1&&(P=(P+y)/2),this._log(\"Score average:\",P);var D=!this.options.tokenize||!this.options.matchAllTokens||_>=u.length;if(this._log(\"\\nCheck Matches: \"+D),(g||b.isMatch)&&D){var j=p[c];j?j.output.push({key:n,arrayIndex:r,value:o,score:P,matchedIndices:b.matchedIndices}):(p[c]={item:s,output:[{key:n,arrayIndex:r,value:o,score:P,matchedIndices:b.matchedIndices}]},m.push(p[c]))}}else if(a(o))for(var M=0,F=o.length;M-1&&(s.arrayIndex=o.arrayIndex),t.matches.push(s)}}}),this.options.includeScore&&n.push(function(e,t){t.score=e.score});for(var i=0,r=e.length;i1?arguments[1]:void 0)}}),n(28)(\"find\")},function(e,t,n){e.exports=!n(10)&&!n(22)(function(){return 7!=Object.defineProperty(n(23)(\"div\"),\"a\",{get:function(){return 7}}).a})},function(e,t,n){var i=n(9);e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&\"function\"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if(\"function\"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&\"function\"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError(\"Can't convert object to primitive value\")}},function(e,t){e.exports=function(e){if(\"function\"!=typeof e)throw TypeError(e+\" is not a function!\");return e}},function(e,t,n){var i=n(14),r=n(25),o=n(16),s=n(18),a=n(48);e.exports=function(e,t){var n=1==e,c=2==e,l=3==e,u=4==e,h=6==e,d=5==e||h,f=t||a;return function(t,a,p){for(var v,m,g=o(t),y=r(g),_=i(a,p,3),b=s(y.length),E=0,S=n?f(t,b):c?f(t,0):void 0;b>E;E++)if((d||E in y)&&(v=y[E],m=_(v,E,g),e))if(n)S[E]=m;else if(m)switch(e){case 3:return!0;case 5:return v;case 6:return E;case 2:S.push(v)}else if(u)return!1;return h?-1:l||u?u:S}}},function(e,t,n){var i=n(49);e.exports=function(e,t){return new(i(e))(t)}},function(e,t,n){var i=n(9),r=n(50),o=n(0)(\"species\");e.exports=function(e){var t;return r(e)&&(t=e.constructor,\"function\"!=typeof t||t!==Array&&!r(t.prototype)||(t=void 0),i(t)&&null===(t=t[o])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var i=n(15);e.exports=Array.isArray||function(e){return\"Array\"==i(e)}},function(e,t,n){n(52),n(63),e.exports=n(2).Array.from},function(e,t,n){\"use strict\";var i=n(53)(!0);n(54)(String,\"String\",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var i=n(19),r=n(17);e.exports=function(e){return function(t,n){var o,s,a=String(r(t)),c=i(n),l=a.length;return c<0||c>=l?e?\"\":void 0:(o=a.charCodeAt(c),o<55296||o>56319||c+1===l||(s=a.charCodeAt(c+1))<56320||s>57343?e?a.charAt(c):o:e?a.slice(c,c+2):s-56320+(o-55296<<10)+65536)}}},function(e,t,n){\"use strict\";var i=n(27),r=n(6),o=n(24),s=n(4),a=n(20),c=n(55),l=n(32),u=n(62),h=n(0)(\"iterator\"),d=!([].keys&&\"next\"in[].keys()),f=function(){return this};e.exports=function(e,t,n,p,v,m,g){c(n,t,p);var y,_,b,E=function(e){if(!d&&e in C)return C[e];switch(e){case\"keys\":case\"values\":return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+\" Iterator\",O=\"values\"==v,I=!1,C=e.prototype,w=C[h]||C[\"@@iterator\"]||v&&C[v],A=w||E(v),T=v?O?E(\"entries\"):A:void 0,k=\"Array\"==t?C.entries||w:w;if(k&&(b=u(k.call(new e)))!==Object.prototype&&b.next&&(l(b,S,!0),i||\"function\"==typeof b[h]||s(b,h,f)),O&&w&&\"values\"!==w.name&&(I=!0,A=function(){return w.call(this)}),i&&!g||!d&&!I&&C[h]||s(C,h,A),a[t]=A,a[S]=f,v)if(y={values:O?A:E(\"values\"),keys:m?A:E(\"keys\"),entries:T},g)for(_ in y)_ in C||o(C,_,y[_]);else r(r.P+r.F*(d||I),t,y);return y}},function(e,t,n){\"use strict\";var i=n(56),r=n(12),o=n(32),s={};n(4)(s,n(0)(\"iterator\"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(s,{next:r(1,n)}),o(e,t+\" Iterator\")}},function(e,t,n){var i=n(8),r=n(57),o=n(31),s=n(21)(\"IE_PROTO\"),a=function(){},c=function(){var e,t=n(23)(\"iframe\"),i=o.length;for(t.style.display=\"none\",n(61).appendChild(t),t.src=\"javascript:\",e=t.contentWindow.document,e.open(),e.write(\"