Choices/src/scripts/dist/choices.min.js
2018-04-25 09:20:59 +01:00

2 lines
83 KiB
JavaScript

/*! choices.js v3.0.2 | (c) 2018 Josh Johnson | https://github.com/jshjohnson/Choices#readme */
!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="/src/scripts/dist/",t(t.s=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=(t.capitalise=function(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},t.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=c(0,36).toString(36)}return t}),o=(t.generateId=function(e,t){var n=e.id||e.name&&e.name+"-"+r(2)||r(4);return n=n.replace(/(:|\.|\[|\]|,)/g,""),n=t+n},t.getType=function(e){return Object.prototype.toString.call(e).slice(8,-1)}),s=t.isType=function(e,t){var n=o(t);return void 0!==t&&null!==t&&n===e},a=(t.isNode=function(e){return"object"===("undefined"==typeof Node?"undefined":i(Node))?e instanceof Node:e&&"object"===(void 0===e?"undefined":i(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},t.isElement=function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":i(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":i(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},t.extend=function e(){for(var t={},n=arguments.length,i=0;i<n;i++){var r=arguments[i];s("Object",r)&&function(n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(s("Object",n[i])?t[i]=e(!0,t[i],n[i]):t[i]=n[i])}(r)}return t},t.whichTransitionEvent=function(){var e=void 0,t=document.createElement("fakeelement"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in n)if(void 0!==t.style[e])return n[e]},t.whichAnimationEvent=function(){var e=void 0,t=document.createElement("fakeelement"),n={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(e in n)if(void 0!==t.style[e])return n[e]}),l=(t.getParentsUntil=function(e,t,n){for(var i=[];e&&e!==document;e=e.parentNode){if(t){var r=t.charAt(0);if("."===r&&e.classList.contains(t.substr(1)))break;if("#"===r&&e.id===t.substr(1))break;if("["===r&&e.hasAttribute(t.substr(1,t.length-1)))break;if(e.tagName.toLowerCase()===t)break}if(n){var o=n.charAt(0);"."===o&&e.classList.contains(n.substr(1))&&i.push(e),"#"===o&&e.id===n.substr(1)&&i.push(e),"["===o&&e.hasAttribute(n.substr(1,n.length-1))&&i.push(e),e.tagName.toLowerCase()===n&&i.push(e)}else i.push(e)}return 0===i.length?null:i},t.wrap=function(e,t){return t=t||document.createElement("div"),e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)},t.getSiblings=function(e){for(var t=[],n=e.parentNode.firstChild;n;n=n.nextSibling)1===n.nodeType&&n!==e&&t.push(n);return t},t.findAncestor=function(e,t){for(;(e=e.parentElement)&&!e.classList.contains(t););return e},t.findAncestorByAttrName=function(e,t){for(var n=e;n;){if(n.hasAttribute(t))return n;n=n.parentElement}return null},t.debounce=function(e,t,n){var i=void 0;return function(){var r=this,o=arguments,s=function(){i=null,n||e.apply(r,o)},a=n&&!i;clearTimeout(i),i=setTimeout(s,t),a&&e.apply(r,o)}},t.getElemDistance=function(e){var t=0;if(e.offsetParent)do{t+=e.offsetTop,e=e.offsetParent}while(e);return t>=0?t:0},t.getElementOffset=function(e,t){var n=t;return n>1&&(n=1),n>0&&(n=0),Math.max(e.offsetHeight*n)},t.getAdjacentEl=function(e,t){var n=arguments.length>2&&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.getScrollPosition=function(e){return"bottom"===e?Math.max((window.scrollY||window.pageYOffset)+(window.innerHeight||document.documentElement.clientHeight)):window.scrollY||window.pageYOffset},t.isInView=function(e,t,n){return this.getScrollPosition(t)>this.getElemDistance(e)+this.getElementOffset(e,n)},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,"&amp;").replace(/>/g,"&rt;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}),c=(t.addAnimation=function(e,t){var n=a(),i=function i(){e.classList.remove(t),e.removeEventListener(n,i,!1)};e.classList.add(t),e.addEventListener(n,i,!1)},t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)}),u=t.strToEl=function(){var e=document.createElement("div");return function(t){var n=t.trim(),i=void 0;for(e.innerHTML=n,i=e.children[0];e.firstChild;)e.removeChild(e.firstChild);return i}}();t.calcWidthOfInput=function(e){var t=e.value||e.placeholder,n=e.offsetWidth;if(t){var i=u("<span>"+l(t)+"</span>");if(i.style.position="absolute",i.style.padding="0",i.style.top="-9999px",i.style.left="-9999px",i.style.width="auto",i.style.whiteSpace="pre",document.body.contains(e)&&window.getComputedStyle){var r=window.getComputedStyle(e);r&&(i.style.fontSize=r.fontSize,i.style.fontFamily=r.fontFamily,i.style.fontWeight=r.fontWeight,i.style.fontStyle=r.fontStyle,i.style.letterSpacing=r.letterSpacing,i.style.textTransform=r.textTransform,i.style.padding=r.padding)}document.body.appendChild(i),t&&i.offsetWidth!==e.offsetWidth&&(n=i.offsetWidth+4),document.body.removeChild(i)}return n+"px"},t.sortByAlpha=function(e,t){var n=(e.label||e.value).toLowerCase(),i=(t.label||t.value).toLowerCase();return n<i?-1:n>i?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},[])}},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(0);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,duplicateItems:!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,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 <b>"'+(0,i.stripHTML)(e)+'"</b>'},maxItemText:function(e){return"Only "+e+" values can be added."},itemComparer:function(e,t){return e===t},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null},t.EVENTS={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem"},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){"use strict";function i(e){var t=C.call(e,T),n=e[T];try{e[T]=void 0;var i=!0}catch(e){}var r=w.call(e);return i&&(t?e[T]=n:delete e[T]),r}function r(e){return k.call(e)}function o(e){return null==e?void 0===e?P:x:D&&D in Object(e)?O(e):L(e)}function s(e,t){return function(n){return e(t(n))}}function a(e){return null!=e&&"object"==typeof e}function l(e){if(!H(e)||M(e)!=B)return!1;var t=F(e);if(null===t)return!0;var n=Y.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&R.call(n)==G}function c(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;n<t.length;n++){(0,t[n])()}return e}function a(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");h=e,s({type:z.INIT})}function l(){var e,t=o;return e={subscribe:function(e){function n(){e.next&&e.next(r())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[q.a]=function(){return this},e}var u;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(c)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var h=e,d=t,f=[],p=f,v=!1;return s({type:z.INIT}),u={dispatch:s,subscribe:o,getState:r,replaceReducer:a},u[q.a]=l,u}function u(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function h(e){Object.keys(e).forEach(function(t){var n=e[t];if(void 0===n(void 0,{type:z.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+z.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function d(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++){var r=t[i];"function"==typeof e[r]&&(n[r]=e[r])}var o=Object.keys(n),s=void 0;try{h(n)}catch(e){s=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(s)throw s;for(var i=!1,r={},a=0;a<o.length;a++){var l=o[a],c=n[l],h=e[l],d=c(h,t);if(void 0===d){var f=u(l,t);throw new Error(f)}r[l]=d,i=i||d!==h}return i?r:e}}function f(e,t){return function(){return t(e.apply(void 0,arguments))}}function p(e,t){if("function"==typeof e)return f(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var n=Object.keys(e),i={},r=0;r<n.length;r++){var o=n[r],s=e[o];"function"==typeof s&&(i[o]=f(s,t))}return i}function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function m(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,i,r){var o=e(n,i,r),s=o.dispatch,a=[],l={getState:o.getState,dispatch:function(e){return s(e)}};return a=t.map(function(e){return e(l)}),s=v.apply(void 0,a)(o.dispatch),$({},o,{dispatch:s})}}}Object.defineProperty(t,"__esModule",{value:!0});var g=n(10),y="object"==typeof self&&self&&self.Object===Object&&self,b=g.a||y||Function("return this")(),E=b,_=E.Symbol,S=_,I=Object.prototype,C=I.hasOwnProperty,w=I.toString,T=S?S.toStringTag:void 0,O=i,A=Object.prototype,k=A.toString,L=r,x="[object Null]",P="[object Undefined]",D=S?S.toStringTag:void 0,M=o,N=s,j=N(Object.getPrototypeOf,Object),F=j,H=a,B="[object Object]",V=Function.prototype,K=Object.prototype,R=V.toString,Y=K.hasOwnProperty,G=R.call(Object),W=l,U=n(11),q=n.n(U),z={INIT:"@@redux/INIT"},$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};n.d(t,"createStore",function(){return c}),n.d(t,"combineReducers",function(){return d}),n.d(t,"bindActionCreators",function(){return p}),n.d(t,"applyMiddleware",function(){return m}),n.d(t,"compose",function(){return v})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0),s=function(){function e(t,n,r){i(this,e),this.parentInstance=t,this.element=n,this.classNames=r,this.isDisabled=!1}return r(e,[{key:"conceal",value:function(){this.element.classList.add(this.classNames.input,this.classNames.hiddenState),this.element.tabIndex="-1";var e=this.element.getAttribute("style");e&&this.element.setAttribute("data-choice-orig-style",e),this.element.setAttribute("aria-hidden","true"),this.element.setAttribute("data-choice","active")}},{key:"reveal",value:function(){this.element.classList.remove(this.classNames.input,this.classNames.hiddenState),this.element.removeAttribute("tabindex");var e=this.element.getAttribute("data-choice-orig-style");e?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",e)):this.element.removeAttribute("style"),this.element.removeAttribute("aria-hidden"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value}},{key:"enable",value:function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1}},{key:"disable",value:function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0}},{key:"triggerEvent",value:function(e,t){(0,o.dispatchEvent)(this.element,e,t)}},{key:"value",get:function(){return this.element.value}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.TEMPLATES=void 0;var r=n(25),o=function(e){return e&&e.__esModule?e:{default:e}}(r),s=n(0),a=t.TEMPLATES={containerOuter:function(e,t,n,i,r,o){var a=i?'tabindex="0"':"",l=n?'role="listbox"':"",c="";return n&&r&&(l='role="combobox"',c='aria-autocomplete="list"'),(0,s.strToEl)('\n <div\n class="'+e.containerOuter+'"\n data-type="'+o+'"\n '+l+"\n "+a+"\n "+c+'\n aria-haspopup="true"\n aria-expanded="false"\n dir="'+t+'"\n >\n </div>\n ')},containerInner:function(e){return(0,s.strToEl)('\n <div class="'+e.containerInner+'"></div>\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 <div class="'+r+'"></div>\n ')},placeholder:function(e,t){return(0,s.strToEl)('\n <div class="'+e.placeholder+'">\n '+t+"\n </div>\n ")},item:function(e,t,n){var r,a=t.active?'aria-selected="true"':"",l=t.disabled?'aria-disabled="true"':"",c=(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 c=(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 <div\n class="'+c+'"\n data-item\n data-id="'+t.id+'"\n data-value="'+t.value+'"\n data-deletable\n '+a+"\n "+l+"\n >\n "+t.label+'\x3c!--\n --\x3e<button\n type="button"\n class="'+e.button+'"\n data-button\n aria-label="Remove item: \''+t.value+"'\"\n >\n Remove item\n </button>\n </div>\n ")}return(0,s.strToEl)('\n <div\n class="'+c+'"\n data-item\n data-id="'+t.id+'"\n data-value="'+t.value+'"\n '+a+"\n "+l+"\n >\n "+t.label+"\n </div>\n ")},choiceList:function(e,t){var n=t?"":'aria-multiselectable="true"';return(0,s.strToEl)('\n <div\n class="'+e.list+'"\n dir="ltr"\n role="listbox"\n '+n+"\n >\n </div>\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 <div\n class="'+r+'"\n data-group\n data-id="'+t.id+'"\n data-value="'+t.value+'"\n role="group"\n '+n+'\n >\n <div class="'+e.groupHeading+'">'+t.value+"</div>\n </div>\n ")},choice:function(e,t,n){var r,a=t.groupId>0?'role="treeitem"':'role="option"',l=(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 <div\n class="'+l+'"\n data-select-text="'+n+'"\n data-choice\n data-id="'+t.id+'"\n data-value="'+t.value+'"\n '+(t.disabled?'data-choice-disabled aria-disabled="true"':"data-choice-selectable")+'\n id="'+t.elementId+'"\n '+a+"\n >\n "+t.label+"\n </div>\n ")},input:function(e){var t=(0,o.default)(e.input,e.inputCloned);return(0,s.strToEl)('\n <input\n type="text"\n class="'+t+'"\n autocomplete="off"\n autocapitalize="off"\n spellcheck="false"\n role="textbox"\n aria-autocomplete="list"\n >\n ')},dropdown:function(e){var t=(0,o.default)(e.list,e.listDropdown);return(0,s.strToEl)('\n <div\n class="'+t+'"\n aria-expanded="false"\n >\n </div>\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 <div class="'+a+'">\n '+t+"\n </div>\n ")},option:function(e){return(0,s.strToEl)('\n <option value="'+e.value+'" '+(e.selected?"selected":"")+" "+(e.disabled?"disabled":"")+">"+e.label+"</option>\n ")}};t.default=a},function(e,t,n){e.exports=n(7)},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);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(8),u=i(c),h=n(9),d=i(h),f=n(19),p=i(f),v=n(20),m=i(v),g=n(21),y=i(g),b=n(22),E=i(b),_=n(23),S=i(_),I=n(24),C=i(I),w=n(1),T=n(5),O=n(26),A=n(27),k=n(28),L=n(29),x=n(0);n(30);var P=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[data-choice]",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,e),(0,x.isType)("String",t)){var i=document.querySelectorAll(t);if(i.length>1)for(var r=1;r<i.length;r+=1){var o=i[r];new e(o,n)}}var l=a({},w.DEFAULT_CONFIG,{items:[],choices:[],classNames:w.DEFAULT_CLASSNAMES,sortFn:x.sortByAlpha});this.config=(0,x.extend)(l,e.userDefaults,n),["auto","always"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices="auto"),this.store=new d.default(this.render),this.initialised=!1,this.currentState={},this.prevState={},this.currentValue="";var c=(0,x.isType)("String",t)?document.querySelector(t):t;if(this.isTextElement="text"===c.type,this.isSelectOneElement="select-one"===c.type,this.isSelectMultipleElement="select-multiple"===c.type,this.isSelectElement=this.isSelectOneElement||this.isSelectMultipleElement,this.isValidElementType=this.isTextElement||this.isSelectElement,this.isTextElement?this.passedElement=new S.default(this,c,this.config.classNames):this.isSelectElement&&(this.passedElement=new C.default(this,c,this.config.classNames)),!this.passedElement)return this.config.silent||console.error("Passed element not found"),!1;if(this.isIe11=!(!navigator.userAgent.match(/Trident/)||!navigator.userAgent.match(/rv[ :]11/)),this.isScrollingOnIe=!1,!0===this.config.shouldSortItems&&this.isSelectOneElement&&(this.config.silent||console.warn("shouldSortElements: Type of passed element is 'select-one', falling back to false.")),this.highlightPosition=0,this.canSearch=this.config.searchEnabled,this.placeholder=!1,this.isSelectOneElement||(this.placeholder=!!this.config.placeholder&&(this.config.placeholderValue||this.passedElement.element.getAttribute("placeholder"))),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.baseId=(0,x.generateId)(this.passedElement.element,"choices-"),this.idNames={itemChoice:"item-choice"},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.wasTap=!0,"classList"in document.documentElement||this.config.silent||console.error("Choices: Your browser doesn't support Choices"),(0,x.isElement)(this.passedElement.element)&&this.isValidElementType){if("active"===this.passedElement.element.getAttribute("data-choice"))return!1;this.init()}else this.config.silent||console.error("Incompatible input passed")}return l(e,[{key:"init",value:function(){if(!this.initialised){this.initialised=!0,this._createTemplates(),this._createElements(),this._createStructure(),this.store.subscribe(this.render),this.render(),this._addEventListeners();var e=this.config.callbackOnInit;e&&(0,x.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.initialised?(this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this):this}},{key:"disable",value:function(){return this.initialised?(this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this):this}},{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,l=s.searchResultLimit,c=s.renderChoiceLimit,u=this.isSearching?x.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=l:c>0&&!i&&(v=c);for(var g=0;g<v;g+=1)m[g]&&function(e){if("auto"!==a||(n.isSelectOneElement||!e.selected)){var t=n._getTemplate("choice",e,n.config.itemSelectText);r.appendChild(t)}}(m[g]);return r}},{key:"createItemsFragment",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=n||document.createDocumentFragment();this.config.shouldSortItems&&!this.isSelectOneElement&&e.sort(this.config.sortFn),this.isTextElement?this.passedElement.value=e:this.passedElement.options=e;var r=function(e){var n=t._getTemplate("item",e,t.config.removeItemButton);i.appendChild(n)};return e.forEach(function(e){return r(e)}),i}},{key:"render",value:function(){if(this.currentState=this.store.state,this.currentState.choices!==this.prevState.choices||this.currentState.groups!==this.prevState.groups||this.currentState.items!==this.prevState.items){if(this.isSelectElement){var e=this.store.activeGroups,t=this.store.activeChoices,n=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&this.choiceList.scrollTo(0),e.length>=1&&!this.isSearching){var i=t.filter(function(e){return!0===e.placeholder&&-1===e.groupId});i.length>=1&&(n=this.createChoicesFragment(i,n)),n=this.createGroupsFragment(e,t,n)}else t.length>=1&&(n=this.createChoicesFragment(t,n));if(n.childNodes&&n.childNodes.length>0){var r=this.store.activeItems,o=this._canAddItem(r,this.input.value);o.response?(this.choiceList.append(n),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",o.notice))}else{var s=void 0,a=void 0;this.isSearching?(a=(0,x.isType)("Function",this.config.noResultsText)?this.config.noResultsText():this.config.noResultsText,s=this._getTemplate("notice",a,"no-results")):(a=(0,x.isType)("Function",this.config.noChoicesText)?this.config.noChoicesText():this.config.noChoicesText,s=this._getTemplate("notice",a,"no-choices")),this.choiceList.append(s)}}if(this.currentState.items!==this.prevState.items){var l=this.store.activeItems||[];if(this.itemList.clear(),l.length){var c=this.createItemsFragment(l);c.childNodes&&this.itemList.append(c)}}this.prevState=this.currentState}}},{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,l=void 0===a?"":a,c=r>=0?this.store.getGroupById(r):null;return this.store.dispatch((0,A.highlightItem)(n,!0)),t&&this.passedElement.triggerEvent(w.EVENTS.highlightItem,{id:n,value:s,label:l,groupValue:c&&c.value?c.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,l=i>=0?this.store.getGroupById(i):null;return this.store.dispatch((0,A.highlightItem)(t,!1)),this.passedElement.triggerEvent(w.EVENTS.highlightItem,{id:t,value:o,label:a,groupValue:l&&l.value?l.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 e?(this.store.activeItems.forEach(function(n){n.value===e&&t._removeItem(n)}),this):this}},{key:"removeActiveItems",value:function(e){var t=this;return this.store.activeItems.forEach(function(n){e!==n.id&&t._removeItem(n)}),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){return this.dropdown.isActive?this:(this.dropdown.show(),this.containerOuter.open(this.dropdown.distanceFromTopWindow()),e&&this.canSearch&&this.input.focus(),this.passedElement.triggerEvent(w.EVENTS.showDropdown,{}),this)}},{key:"hideDropdown",value:function(e){return this.dropdown.isActive?(this.dropdown.hide(),this.containerOuter.close(),e&&this.canSearch&&(this.input.removeActiveDescendant(),this.input.blur()),this.passedElement.triggerEvent(w.EVENTS.hideDropdown,{}),this):this}},{key:"toggleDropdown",value:function(){return this.dropdown.isActive?this.hideDropdown():this.showDropdown(!0),this}},{key:"getValue",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.store.activeItems,n=t.reduce(function(t,n){var i=e?n.value:n;return t.push(i),t},[]);return this.isSelectOneElement?n[0]:n}},{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,x.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(e,e.id||null,t,i):n._addChoice(e[t],e[i],e.selected,e.disabled,void 0,e.customProperties,e.placeholder)};return e.forEach(o),this}},{key:"clearStore",value:function(){return this.store.dispatch((0,L.clearAll)()),this}},{key:"clearInput",value:function(){var e=!this.isSelectOneElement;return this.input.clear(e),!this.isTextElement&&this.config.searchEnabled&&(this.isSearching=!1,this.store.dispatch((0,O.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:"_triggerChange",value:function(e){void 0!==e&&null!==e&&this.passedElement.triggerEvent(w.EVENTS.change,{value:e})}},{key:"_selectPlaceholderChoice",value:function(){var e=this.store.placeholderChoice;e&&(this._addItem(e.value,e.label,e.id,e.groupId,null,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(w.EVENTS.choice,{choice:i}),i&&!i.selected&&!i.disabled){this._canAddItem(e,i.value).response&&(this._addItem(i.value,i.label,i.id,i.groupId,i.customProperties,i.placeholder,i.keyCode),this._triggerChange(i.value))}this.clearInput(),o&&this.isSelectOneElement&&(this.hideDropdown(),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.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.containerOuter.removeLoadingState(),this.isSelectOneElement?t.innerHTML=this.placeholder||"":this.input.placeholder=this.placeholder||"")}},{key:"_canAddItem",value:function(e,t){var n=!0,i=(0,x.isType)("Function",this.config.addItemText)?this.config.addItemText(t):this.config.addItemText;return(this.isSelectMultipleElement||this.isTextElement)&&this.config.maxItemCount>0&&this.config.maxItemCount<=e.length&&(n=!1,i=(0,x.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,x.regexFilter)(t,this.config.regexFilter)),!e.some(function(e){return(0,x.isType)("String",t)?e.value===t.trim():e.value===t})||this.config.duplicateItems||this.isSelectOneElement||!n||(n=!1,i=(0,x.isType)("Function",this.config.uniqueItemText)?this.config.uniqueItemText(t):this.config.uniqueItemText),{response:n,notice:i}}},{key:"_ajaxCallback",value:function(){var e=this;return function(t,n,i){if(t&&n){var r=(0,x.isType)("Object",t)?[t]:t;r&&(0,x.isType)("Array",r)&&r.length?(e._handleLoadingState(!1),r.forEach(function(t){if(t.choices){var r=t.id||null;e._addGroup(t,r,n,i)}else e._addChoice(t[n],t[i],t.selected,t.disabled,void 0,t.customProperties,t.placeholder)}),e.isSelectOneElement&&e._selectPlaceholderChoice()):e._handleLoadingState(!1)}}}},{key:"_searchChoices",value:function(e){var t=(0,x.isType)("String",e)?e.trim():e,n=(0,x.isType)("String",this.currentValue)?this.currentValue.trim():this.currentValue;if(t.length<1&&t===n+" ")return 0;var i=this.store.searchableChoices,r=t,o=(0,x.isType)("Array",this.config.searchFields)?this.config.searchFields:[this.config.searchFields],s=Object.assign(this.config.fuseOptions,{keys:o}),a=new u.default(i,s),l=a.search(r);return this.currentValue=t,this.highlightPosition=0,this.isSearching=!0,this.store.dispatch((0,O.filterChoices)(l)),l.length}},{key:"_handleSearch",value:function(e){if(e&&this.input.isFocussed){var t=this.store.choices,n=t.some(function(e){return!e.active});if(e&&e.length>=this.config.searchFloor){var i=this.config.searchChoices?this._searchChoices(e):0;this.passedElement.triggerEvent(w.EVENTS.search,{value:e,resultCount:i})}else n&&(this.isSearching=!1,this.store.dispatch((0,O.activateChoices)(!0)))}}},{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.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.removeEventListeners()}},{key:"_onKeyDown",value:function(e){var t,n=this;if(e.target===this.input.element||this.containerOuter.element.contains(e.target)){var i=e.target,o=this.store.activeItems,s=this.input.isFocussed,a=this.dropdown.isActive,l=this.itemList.hasChildren,c=String.fromCharCode(e.keyCode),u=w.KEY_CODES.BACK_KEY,h=w.KEY_CODES.DELETE_KEY,d=w.KEY_CODES.ENTER_KEY,f=w.KEY_CODES.A_KEY,p=w.KEY_CODES.ESC_KEY,v=w.KEY_CODES.UP_KEY,m=w.KEY_CODES.DOWN_KEY,g=w.KEY_CODES.PAGE_UP_KEY,y=w.KEY_CODES.PAGE_DOWN_KEY,b=e.ctrlKey||e.metaKey;!this.isTextElement&&/[a-zA-Z0-9-_ ]/.test(c)&&this.showDropdown(!0),this.canSearch=this.config.searchEnabled;var E=function(){b&&l&&(n.canSearch=!1,n.config.removeItems&&!n.input.value&&n.input.element===document.activeElement&&n.highlightAll())},_=function(){if(n.isTextElement&&i.value){var t=n.input.value;n._canAddItem(o,t).response&&(n.hideDropdown(),n._addItem(t),n._triggerChange(t),n.clearInput())}if(i.hasAttribute("data-button")&&(n._handleButtonAction(o,i),e.preventDefault()),a){e.preventDefault();var r=n.dropdown.getChild("."+n.config.classNames.highlightedState);r&&(o[0]&&(o[0].keyCode=d),n._handleChoiceAction(o,r))}else n.isSelectOneElement&&(n.showDropdown(!0),e.preventDefault())},S=function(){a&&(n.hideDropdown(),n.containerOuter.focus())},I=function(){if(a||n.isSelectOneElement){n.showDropdown(!0),n.canSearch=!1;var t=e.keyCode===m||e.keyCode===y?1:-1,i=e.metaKey||e.keyCode===y||e.keyCode===g,r=void 0;if(i)r=t>0?Array.from(n.dropdown.element.querySelectorAll("[data-choice-selectable]")).pop():n.dropdown.element.querySelector("[data-choice-selectable]");else{var o=n.dropdown.element.querySelector("."+n.config.classNames.highlightedState);r=o?(0,x.getAdjacentEl)(o,"[data-choice-selectable]",t):n.dropdown.element.querySelector("[data-choice-selectable]")}r&&((0,x.isScrolledIntoView)(r,n.choiceList.element,t)||n._scrollToChoice(r,t),n._highlightChoice(r)),e.preventDefault()}},C=function(){!s||e.target.value||n.isSelectOneElement||(n._handleBackspace(o),e.preventDefault())},T=(t={},r(t,f,E),r(t,d,_),r(t,p,S),r(t,v,I),r(t,g,I),r(t,m,I),r(t,y,I),r(t,h,C),r(t,u,C),t);T[e.keyCode]&&T[e.keyCode]()}}},{key:"_onKeyUp",value:function(e){if(e.target===this.input.element){var t=this.input.value,n=this.store.activeItems,i=this._canAddItem(n,t);if(this.isTextElement)if(t){if(i.notice){var r=this._getTemplate("notice",i.notice);this.dropdown.element.innerHTML=r.outerHTML}!0===i.response?this.showDropdown():i.notice||this.hideDropdown()}else this.hideDropdown();else{var o=w.KEY_CODES.BACK_KEY,s=w.KEY_CODES.DELETE_KEY;e.keyCode!==o&&e.keyCode!==s||e.target.value?this.canSearch&&i.response&&this._handleSearch(this.input.value):!this.isTextElement&&this.isSearching&&(this.isSearching=!1,this.store.dispatch((0,O.activateChoices)(!0)))}this.canSearch=this.config.searchEnabled}}},{key:"_onTouchMove",value:function(){!0===this.wasTap&&(this.wasTap=!1)}},{key:"_onTouchEnd",value:function(e){var t=e.target||e.touches[0].target;!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(!0)),e.stopPropagation()),this.wasTap=!0}},{key:"_onMouseDown",value:function(e){var t=e.target;if(t===this.choiceList&&this.isIe11&&(this.isScrollingOnIe=!0),this.containerOuter.element.contains(t)&&t!==this.input.element){var n=this.store.activeItems,i=e.shiftKey,r=(0,x.findAncestorByAttrName)(t,"data-button"),o=(0,x.findAncestorByAttrName)(t,"data-item"),s=(0,x.findAncestorByAttrName)(t,"data-choice");r?this._handleButtonAction(n,r):o?this._handleItemAction(n,o,i):s&&this._handleChoiceAction(n,s),e.preventDefault()}}},{key:"_onMouseOver",value:function(e){(e.target===this.dropdown||this.dropdown.element.contains(e.target))&&e.target.hasAttribute("data-choice")&&this._highlightChoice(e.target)}},{key:"_onClick",value:function(e){var t=e.target,n=this.dropdown.isActive,i=this.store.activeItems;if(this.containerOuter.element.contains(t))n?this.isSelectOneElement&&t!==this.input.element&&!this.dropdown.element.contains(t)&&this.hideDropdown(!0):this.isTextElement?document.activeElement!==this.input.element&&this.input.focus():this.canSearch?this.showDropdown(!0):(this.showDropdown(),this.containerOuter.focus());else{i.some(function(e){return e.highlighted})&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown()}}},{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()},"select-multiple":function(){n===t.input.element&&(t.containerOuter.addFocusState(),t.showDropdown(!0))}})[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())},"select-one":function(){t.containerOuter.removeFocusState(),(n===t.input.element||n===t.containerOuter.element&&!t.canSearch)&&t.hideDropdown()},"select-multiple":function(){n===t.input.element&&(t.containerOuter.removeFocusState(),t.hideDropdown(),r&&t.unhighlightAll())}})[this.passedElement.element.type]()}else this.isScrollingOnIe=!1,this.input.element.focus()}},{key:"_scrollToChoice",value:function(e,t){var n=this;if(e){var i=this.choiceList.element.offsetHeight,r=e.offsetHeight,o=e.offsetTop+r,s=this.choiceList.element.scrollTop+i,a=t>0?this.choiceList.element.scrollTop+o-s:e.offsetTop,l=function e(){var i=w.SCROLLING_SPEED,r=n.choiceList.element.scrollTop,o=!1,s=void 0,l=void 0;t>0?(s=(a-r)/i,l=s>1?s:1,n.choiceList.scrollTo(r+l),r<a&&(o=!0)):(s=(r-a)/i,l=s>1?s:1,n.choiceList.scrollTo(r-l),r>a&&(o=!0)),o&&requestAnimationFrame(function(n){e(n,a,t)})};requestAnimationFrame(function(e){l()})}}},{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,r=Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)),o=this.dropdown.isActive;r.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"),o&&(this.input.setActiveDescendant(i.id),this.containerOuter.setActiveDescendant(i.id))}}},{key:"_addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,a=(0,x.isType)("String",e)?e.trim():e,l=s,c=r,u=this.store.items,h=t||a,d=parseInt(n,10)||-1,f=i>=0?this.store.getGroupById(i):null,p=u?u.length+1:1;return this.config.prependValue&&(a=this.config.prependValue+a.toString()),this.config.appendValue&&(a+=this.config.appendValue.toString()),this.store.dispatch((0,A.addItem)(a,h,p,d,i,r,o,l)),this.isSelectOneElement&&this.removeActiveItems(p),f&&f.value?this.passedElement.triggerEvent(w.EVENTS.addItem,{id:p,value:a,label:h,customProperties:c,groupValue:f.value,keyCode:l}):this.passedElement.triggerEvent(w.EVENTS.addItem,{id:p,value:a,label:h,customProperties:c,keyCode:l}),this}},{key:"_removeItem",value:function(e){if(!e||!(0,x.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,A.removeItem)(t,r)),s&&s.value?this.passedElement.triggerEvent(w.EVENTS.removeItem,{id:t,value:n,label:i,groupValue:s.value}):this.passedElement.triggerEvent(w.EVENTS.removeItem,{id:t,value:n,label:i}),this}},{key:"_addChoice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(void 0!==e&&null!==e){var l=this.store.choices,c=t||e,u=l?l.length+1:1,h=this.baseId+"-"+this.idNames.itemChoice+"-"+u;this.store.dispatch((0,O.addChoice)(e,c,u,r,i,h,o,s,a)),n&&this._addItem(e,c,u,void 0,o,s,a)}}},{key:"_clearChoices",value:function(){this.store.dispatch((0,O.clearChoices)())}},{key:"_addGroup",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"label",o=(0,x.isType)("Object",e)?e.choices:Array.from(e.getElementsByTagName("OPTION")),s=t||Math.floor((new Date).valueOf()*Math.random()),a=!!e.disabled&&e.disabled;if(o){this.store.dispatch((0,k.addGroup)(e.label,s,!0,a));var l=function(e){var t=e.disabled||e.parentNode&&e.parentNode.disabled;n._addChoice(e[i],(0,x.isType)("Object",e)?e[r]:e.innerHTML,e.selected,t,s,e.customProperties,e.placeholder)};o.forEach(l)}else this.store.dispatch((0,k.addGroup)(e.label,e.id,!1,e.disabled))}},{key:"_getTemplate",value:function(e){var t;if(!e)return null;for(var n=this.config.templates,i=this.config.classNames,r=arguments.length,o=Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return(t=n[e]).call.apply(t,[this,i].concat(o))}},{key:"_createTemplates",value:function(){var e=this.config.callbackOnCreateTemplates,t={};e&&(0,x.isType)("Function",e)&&(t=e.call(this,x.strToEl)),this.config.templates=(0,x.extend)(T.TEMPLATES,t)}},{key:"_createElements",value:function(){var e=this.passedElement.element.getAttribute("dir")||"ltr",t=this._getTemplate("containerOuter",e,this.isSelectElement,this.isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),n=this._getTemplate("containerInner"),i=this._getTemplate("itemList",this.isSelectOneElement),r=this._getTemplate("choiceList",this.isSelectOneElement),o=this._getTemplate("input"),s=this._getTemplate("dropdown");this.containerOuter=new m.default(this,t,this.config.classNames),this.containerInner=new m.default(this,n,this.config.classNames),this.input=new y.default(this,o,this.config.classNames),this.choiceList=new E.default(this,r,this.config.classNames),this.itemList=new E.default(this,i,this.config.classNames),this.dropdown=new p.default(this,s,this.config.classNames)}},{key:"_createStructure",value:function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this.isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this.placeholder&&(this.input.placeholder=this.placeholder,this.input.setWidth(!0)),this.config.addItems||this.disable(),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this.isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this.isSelectOneElement?this.canSearch&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this.isSelectElement?this._addPredefinedChoices():this.isTextElement&&this._addPredefinedItems()}},{key:"_addPredefinedChoices",value:function(){var e=this,t=this.passedElement.optionGroups;if(this.highlightPosition=0,this.isSearching=!1,t&&t.length){var n=this.passedElement.placeholderOption;n&&"SELECT"===n.parentNode.tagName&&this._addChoice(n.value,n.innerHTML,n.selected,n.disabled,void 0,void 0,!0),t.forEach(function(t){e._addGroup(t,t.id||null)})}else{var i=this.passedElement.options,r=this.config.sortFn,o=this.presetChoices;i.forEach(function(e){o.push({value:e.value,label:e.innerHTML,selected:e.selected,disabled:e.disabled||e.parentNode.disabled,placeholder:e.hasAttribute("placeholder")})}),this.config.shouldSort&&o.sort(r);var s=o.some(function(e){return e.selected}),a=function(t,n){if(e.isSelectElement)if(t.choices)e._addGroup(t,t.id||null);else{var i=e.isSelectOneElement&&!s&&0===n,r=!!i||t.selected,o=!i&&t.disabled;e._addChoice(t.value,t.label,r,o,void 0,t.customProperties,t.placeholder)}else e._addChoice(t.value,t.label,t.selected,t.disabled,void 0,t.customProperties,t.placeholder)};o.forEach(function(e,t){return a(e,t)})}}},{key:"_addPredefinedItems",value:function(){var e=this,t=function(t){var n=(0,x.getType)(t);if("Object"===n){if(!t.value)return;e._addItem(t.value,t.label,t.id,void 0,t.customProperties,t.placeholder)}else"String"===n&&e._addItem(t)};this.presetItems.forEach(function(e){return t(e)})}},{key:"_setChoiceOrItem",value:function(e){var t=this,n=(0,x.getType)(e).toLowerCase();({object:function(){e.value&&(t.isTextElement?t._addItem(e.value,e.label,e.id,void 0,e.customProperties,e.placeholder):t._addChoice(e.value,e.label,!0,!1,-1,e.customProperties,e.placeholder))},string:function(){t.isTextElement?t._addItem(e):t._addChoice(e,e,!0,!1,-1,null)}})[n]()}},{key:"_findAndSelectChoiceByValue",value:function(e){var t=this,n=this.store.choices,i=n.find(function(n){return t.config.itemComparer(n.value,e)});i&&!i.selected&&this._addItem(i.value,i.label,i.id,i.groupId,i.customProperties,i.placeholder,i.keyCode)}}]),e}();P.userDefaults={},e.exports=P},function(e,t,n){!function(t,n){e.exports=n()}(0,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.i=function(e){return e},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="",t(t.s=8)}([function(e,t,n){"use strict";e.exports=function(e){return"[object Array]"===Object.prototype.toString.call(e)}},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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(5),s=n(7),a=n(4),l=function(){function e(t,n){var r=n.location,o=void 0===r?0:r,s=n.distance,l=void 0===s?100:s,c=n.threshold,u=void 0===c?.6:c,h=n.maxPatternLength,d=void 0===h?32:h,f=n.isCaseSensitive,p=void 0!==f&&f,v=n.tokenSeparator,m=void 0===v?/ +/g:v,g=n.findAllMatches,y=void 0!==g&&g,b=n.minMatchCharLength,E=void 0===b?1:b;i(this,e),this.options={location:o,distance:l,threshold:u,maxPatternLength:d,isCaseSensitive:p,tokenSeparator:m,findAllMatches:y,minMatchCharLength:E},this.pattern=this.options.isCaseSensitive?t:t.toLowerCase(),this.pattern.length<=d&&(this.patternAlphabet=a(this.pattern))}return r(e,[{key:"search",value:function(e){if(this.options.isCaseSensitive||(e=e.toLowerCase()),this.pattern===e)return{isMatch:!0,score:0,matchedIndices:[[0,e.length-1]]};var t=this.options,n=t.maxPatternLength,i=t.tokenSeparator;if(this.pattern.length>n)return o(e,this.pattern,i);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(e,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),e}();e.exports=l},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 l=t[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(i(l))for(var c=0,u=l.length;c<u;c+=1)e(l[c],a,r);else a&&e(l,a,r);else r.push(l.toString())}else r.push(t);return r};e.exports=function(e,t){return r(e,t,[])}},function(e,t,n){"use strict";e.exports=function(){for(var e=arguments.length>0&&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<s;o+=1){var a=e[o];a&&-1===i?i=o:a||-1===i||(r=o-1,r-i+1>=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;i<n;i+=1)t[e.charAt(i)]=0;for(var r=0;r<n;r+=1)t[e.charAt(r)]|=1<<n-r-1;return t}},function(e,t,n){"use strict";var i=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e.exports=function(e,t){var n=arguments.length>2&&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 l=0,c=o.length;l<c;l+=1){var u=o[l];a.push([e.indexOf(u),u.length-1])}return{score:s?.5:1,isMatch:s,matchedIndices:a}}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.errors,i=void 0===n?0:n,r=t.currentLocation,o=void 0===r?0:r,s=t.expectedLocation,a=void 0===s?0:s,l=t.distance,c=void 0===l?100:l,u=i/e.length,h=Math.abs(a-o);return c?u+h/c:h?1:u}},function(e,t,n){"use strict";var i=n(6),r=n(3);e.exports=function(e,t,n,o){for(var s=o.location,a=void 0===s?0:s,l=o.distance,c=void 0===l?100:l,u=o.threshold,h=void 0===u?.6:u,d=o.findAllMatches,f=void 0!==d&&d,p=o.minMatchCharLength,v=void 0===p?1:p,m=a,g=e.length,y=h,b=e.indexOf(t,m),E=t.length,_=[],S=0;S<g;S+=1)_[S]=0;if(-1!==b){var I=i(t,{errors:0,currentLocation:b,expectedLocation:m,distance:c});if(y=Math.min(I,y),-1!==(b=e.lastIndexOf(t,m+E))){var C=i(t,{errors:0,currentLocation:b,expectedLocation:m,distance:c});y=Math.min(C,y)}}b=-1;for(var w=[],T=1,O=E+g,A=1<<E-1,k=0;k<E;k+=1){for(var L=0,x=O;L<x;){i(t,{errors:k,currentLocation:m+x,expectedLocation:m,distance:c})<=y?L=x:O=x,x=Math.floor((O-L)/2+L)}O=x;var P=Math.max(1,m-x+1),D=f?g:Math.min(m+x,g)+E,M=Array(D+2);M[D+1]=(1<<k)-1;for(var N=D;N>=P;N-=1){var j=N-1,F=n[e.charAt(j)];if(F&&(_[j]=1),M[N]=(M[N+1]<<1|1)&F,0!==k&&(M[N]|=(w[N+1]|w[N])<<1|1|w[N+1]),M[N]&A&&(T=i(t,{errors:k,currentLocation:j,expectedLocation:m,distance:c}))<=y){if(y=T,(b=j)<=m)break;P=Math.max(1,2*m-b)}}if(i(t,{errors:k+1,currentLocation:m,expectedLocation:m,distance:c})>y)break;w=M}return{isMatch:b>=0,score:0===T?.001:T,matchedIndices:r(_,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;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),s=n(2),a=n(0),l=function(){function e(t,n){var r=n.location,o=void 0===r?0:r,a=n.distance,l=void 0===a?100:a,c=n.threshold,u=void 0===c?.6:c,h=n.maxPatternLength,d=void 0===h?32:h,f=n.caseSensitive,p=void 0!==f&&f,v=n.tokenSeparator,m=void 0===v?/ +/g:v,g=n.findAllMatches,y=void 0!==g&&g,b=n.minMatchCharLength,E=void 0===b?1:b,_=n.id,S=void 0===_?null:_,I=n.keys,C=void 0===I?[]:I,w=n.shouldSort,T=void 0===w||w,O=n.getFn,A=void 0===O?s:O,k=n.sortFn,L=void 0===k?function(e,t){return e.score-t.score}:k,x=n.tokenize,P=void 0!==x&&x,D=n.matchAllTokens,M=void 0!==D&&D,N=n.includeMatches,j=void 0!==N&&N,F=n.includeScore,H=void 0!==F&&F,B=n.verbose,V=void 0!==B&&B;i(this,e),this.options={location:o,distance:l,threshold:u,maxPatternLength:d,isCaseSensitive:p,tokenSeparator:m,findAllMatches:y,minMatchCharLength:E,id:S,keys:C,includeMatches:j,includeScore:H,shouldSort:T,getFn:A,sortFn:L,verbose:V,tokenize:P,matchAllTokens:M},this.setCollection(t)}return r(e,[{key:"setCollection",value:function(e){return this.list=e,e}},{key:"search",value:function(e){this._log('---------\nSearch pattern: "'+e+'"');var t=this._prepareSearchers(e),n=t.tokenSearchers,i=t.fullSearcher,r=this._search(n,i),o=r.weights,s=r.results;return this._computeScore(o,s),this.options.shouldSort&&this._sort(s),this._format(s)}},{key:"_prepareSearchers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[];if(this.options.tokenize)for(var n=e.split(this.options.tokenSeparator),i=0,r=n.length;i<r;i+=1)t.push(new o(n[i],this.options));return{tokenSearchers:t,fullSearcher:new o(e,this.options)}}},{key:"_search",value:function(){var e=arguments.length>0&&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;o<s;o+=1)this._analyze({key:"",value:n[o],record:o,index:o},{resultMap:i,results:r,tokenSearchers:e,fullSearcher:t});return{weights:null,results:r}}for(var a={},l=0,c=n.length;l<c;l+=1)for(var u=n[l],h=0,d=this.options.keys.length;h<d;h+=1){var f=this.options.keys[h];if("string"!=typeof f){if(a[f.name]={weight:1-f.weight||1},f.weight<=0||f.weight>1)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:l},{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,l=e.index,c=t.tokenSearchers,u=void 0===c?[]:c,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,b=0;if("string"==typeof o){this._log("\nKey: "+(""===n?"-":n));var E=d.search(o);if(this._log('Full text: "'+o+'", score: '+E.score),this.options.tokenize){for(var _=o.split(this.options.tokenSeparator),S=[],I=0;I<u.length;I+=1){var C=u[I];this._log('\nPattern: "'+C.pattern+'"');for(var w=!1,T=0;T<_.length;T+=1){var O=_[T],A=C.search(O),k={};A.isMatch?(k[O]=A.score,g=!0,w=!0,S.push(A.score)):(k[O]=1,this.options.matchAllTokens||S.push(1)),this._log('Token: "'+O+'", score: '+k[O])}w&&(b+=1)}y=S[0];for(var L=S.length,x=1;x<L;x+=1)y+=S[x];y/=L,this._log("Token score average:",y)}var P=E.score;y>-1&&(P=(P+y)/2),this._log("Score average:",P);var D=!this.options.tokenize||!this.options.matchAllTokens||b>=u.length;if(this._log("\nCheck Matches: "+D),(g||E.isMatch)&&D){var M=p[l];M?M.output.push({key:n,arrayIndex:r,value:o,score:P,matchedIndices:E.matchedIndices}):(p[l]={item:s,output:[{key:n,arrayIndex:r,value:o,score:P,matchedIndices:E.matchedIndices}]},m.push(p[l]))}}else if(a(o))for(var N=0,j=o.length;N<j;N+=1)this._analyze({key:n,arrayIndex:N,value:o[N],record:s,index:l},{resultMap:p,results:m,tokenSearchers:u,fullSearcher:d})}}},{key:"_computeScore",value:function(e,t){this._log("\n\nComputing score:\n");for(var n=0,i=t.length;n<i;n+=1){for(var r=t[n].output,o=r.length,s=0,a=1,l=0;l<o;l+=1){var c=e?e[r[l].key].weight:1,u=1===c?r[l].score:r[l].score||.001,h=u*c;1!==c?a=Math.min(a,h):(r[l].nScore=h,s+=h)}t[n].score=1===a?s/o:a,this._log(t[n])}}},{key:"_sort",value:function(e){this._log("\n\nSorting...."),e.sort(this.options.sortFn)}},{key:"_format",value:function(e){var t=[];this._log("\n\nOutput:\n\n",JSON.stringify(e));var n=[];this.options.includeMatches&&n.push(function(e,t){var n=e.output;t.matches=[];for(var i=0,r=n.length;i<r;i+=1){var o=n[i];if(0!==o.matchedIndices.length){var s={indices:o.matchedIndices,value:o.value};o.key&&(s.key=o.key),o.hasOwnProperty("arrayIndex")&&o.arrayIndex>-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;i<r;i+=1){var o=e[i];if(this.options.id&&(o.item=this.options.getFn(o.item,this.options.id)[0]),n.length){for(var s={item:o.item},a=0,l=n.length;a<l;a+=1)n[a](o,s);t.push(s)}else t.push(o.item)}return t}},{key:"_log",value:function(){if(this.options.verbose){var e;(e=console).log.apply(e,arguments)}}}]),e}();e.exports=l}])})},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=n(2),a=n(15),l=function(e){return e&&e.__esModule?e:{default:e}}(a),c=function(){function e(){r(this,e),this.store=(0,s.createStore)(l.default,window.devToolsExtension?window.devToolsExtension():void 0)}return o(e,[{key:"subscribe",value:function(e){this.store.subscribe(e)}},{key:"dispatch",value:function(e){this.store.dispatch(e)}},{key:"getChoiceById",value:function(e){if(e){return this.activeChoices.find(function(t){return t.id===parseInt(e,10)})}return!1}},{key:"getGroupById",value:function(e){return this.groups.find(function(t){return t.id===parseInt(e,10)})}},{key:"state",get:function(){return this.store.getState()}},{key:"items",get:function(){return this.state.items}},{key:"activeItems",get:function(){return this.items.filter(function(e){return!0===e.active})}},{key:"highlightedActiveItems",get:function(){return this.items.filter(function(e){return e.active&&e.highlighted})}},{key:"choices",get:function(){return this.state.choices}},{key:"activeChoices",get:function(){return this.choices.filter(function(e){return!0===e.active})}},{key:"selectableChoices",get:function(){return this.choices.filter(function(e){return!0!==e.disabled})}},{key:"searchableChoices",get:function(){return this.selectableChoices.filter(function(e){return!0!==e.placeholder})}},{key:"placeholderChoice",get:function(){return[].concat(i(this.choices)).reverse().find(function(e){return!0===e.placeholder})}},{key:"groups",get:function(){return this.state.groups}},{key:"activeGroups",get:function(){var e=this.groups,t=this.choices;return e.filter(function(e){var n=!0===e.active&&!1===e.disabled,i=t.some(function(e){return!0===e.active&&!1===e.disabled});return n&&i},[])}}]),e}();t.default=c},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(t,n(3))},function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";(function(e,i){Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(14),s=function(e){return e&&e.__esModule?e:{default:e}}(o);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:i;var a=(0,s.default)(r);t.default=a}).call(t,n(3),n(13)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function i(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(16),s=i(o),a=n(17),l=i(a),c=n(18),u=i(c),h=(0,r.combineReducers)({items:s.default,groups:l.default,choices:u.default}),d=function(e,t){var n=e;return"CLEAR_ALL"===t.type&&(n=void 0),h(n,t)};t.default=d},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case"ADD_ITEM":return[].concat(i(e),[{id:t.id,choiceId:t.choiceId,groupId:t.groupId,value:t.value,label:t.label,active:!0,highlighted:!1,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]).map(function(e){var t=e;return t.highlighted=!1,t});case"REMOVE_ITEM":return e.map(function(e){var n=e;return n.id===t.id&&(n.active=!1),n});case"HIGHLIGHT_ITEM":return e.map(function(e){var n=e;return n.id===t.id&&(n.highlighted=t.highlighted),n});default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=t.defaultState=[]},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case"ADD_GROUP":return[].concat(i(e),[{id:t.id,value:t.value,active:t.active,disabled:t.disabled}]);case"CLEAR_CHOICES":return[];default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=t.defaultState=[]},function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case"ADD_CHOICE":return[].concat(i(e),[{id:t.id,elementId:t.elementId,groupId:t.groupId,value:t.value,label:t.label||t.value,disabled:t.disabled||!1,selected:!1,active:!0,score:9999,customProperties:t.customProperties,placeholder:t.placeholder||!1,keyCode:null}]);case"ADD_ITEM":return t.activateOptions?e.map(function(e){var n=e;return n.active=t.active,n}):t.choiceId>-1?e.map(function(e){var n=e;return n.id===parseInt(t.choiceId,10)&&(n.selected=!0),n}):e;case"REMOVE_ITEM":return t.choiceId>-1?e.map(function(e){var n=e;return n.id===parseInt(t.choiceId,10)&&(n.selected=!1),n}):e;case"FILTER_CHOICES":return e.map(function(e){var n=e;return n.active=t.results.some(function(e){var t=e.item,i=e.score;return t.id===n.id&&(n.score=i,!0)}),n});case"ACTIVATE_CHOICES":return e.map(function(e){var n=e;return n.active=t.active,n});case"CLEAR_CHOICES":return o;default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=t.defaultState=[]},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t,n,r){i(this,e),this.parentInstance=t,this.element=n,this.classNames=r,this.dimensions=null,this.position=null,this.isActive=!1}return r(e,[{key:"distanceFromTopWindow",value:function(){return this.dimensions=this.element.getBoundingClientRect(),this.position=Math.ceil(this.dimensions.top+window.pageYOffset+this.element.offsetHeight),this.position}},{key:"getChild",value:function(e){return this.element.querySelector(e)}},{key:"show",value:function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this.parentInstance}},{key:"hide",value:function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this.parentInstance}}]),e}();t.default=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0),s=function(){function e(t,n,r){i(this,e),this.parentInstance=t,this.element=n,this.classNames=r,this.config=t.config,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return r(e,[{key:"addEventListeners",value:function(){this.element.addEventListener("focus",this.onFocus),this.element.addEventListener("blur",this.onBlur)}},{key:"removeEventListeners",value:function(){this.element.removeEventListener("focus",this.onFocus),this.element.removeEventListener("blur",this.onBlur)}},{key:"onFocus",value:function(){this.isFocussed=!0}},{key:"onBlur",value:function(){this.isFocussed=!1}},{key:"shouldFlip",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,o.getWindowHeight)();if(void 0===e)return!1;var n=!1;return"auto"===this.config.position?n=e>=t:"top"===this.config.position&&(n=!0),n}},{key:"setActiveDescendant",value:function(e){this.element.setAttribute("aria-activedescendant",e)}},{key:"removeActiveDescendant",value:function(){this.element.removeAttribute("aria-activedescendant")}},{key:"open",value:function(e){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)}},{key:"close",value:function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)}},{key:"focus",value:function(){this.isFocussed||this.element.focus()}},{key:"addFocusState",value:function(){this.element.classList.add(this.classNames.focusState)}},{key:"removeFocusState",value:function(){this.element.classList.remove(this.classNames.focusState)}},{key:"enable",value:function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.parentInstance.isSelectOneElement&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1}},{key:"disable",value:function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.parentInstance.isSelectOneElement&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0}},{key:"wrap",value:function(e){(0,o.wrap)(e,this.element)}},{key:"unwrap",value:function(e){this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element)}},{key:"addLoadingState",value:function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0}},{key:"removeLoadingState",value:function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0),s=function(){function e(t,n,r){i(this,e),this.parentInstance=t,this.element=n,this.classNames=r,this.isFocussed=this.element===document.activeElement,this.isDisabled=!1,this.onPaste=this.onPaste.bind(this),this.onInput=this.onInput.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return r(e,[{key:"addEventListeners",value:function(){this.element.addEventListener("input",this.onInput),this.element.addEventListener("paste",this.onPaste),this.element.addEventListener("focus",this.onFocus),this.element.addEventListener("blur",this.onBlur)}},{key:"removeEventListeners",value:function(){this.element.removeEventListener("input",this.onInput),this.element.removeEventListener("paste",this.onPaste),this.element.removeEventListener("focus",this.onFocus),this.element.removeEventListener("blur",this.onBlur)}},{key:"onInput",value:function(){this.parentInstance.isSelectOneElement||this.setWidth()}},{key:"onPaste",value:function(e){e.target!==this.element||this.parentInstance.config.paste||e.preventDefault()}},{key:"onFocus",value:function(){this.isFocussed=!0}},{key:"onBlur",value:function(){this.isFocussed=!1}},{key:"enable",value:function(){this.element.removeAttribute("disabled"),this.isDisabled=!1}},{key:"disable",value:function(){this.element.setAttribute("disabled",""),this.isDisabled=!0}},{key:"focus",value:function(){this.isFocussed||this.element.focus()}},{key:"blur",value:function(){this.isFocussed&&this.element.blur()}},{key:"clear",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.element.value&&(this.element.value=""),e&&this.setWidth(),this.parentInstance}},{key:"setWidth",value:function(e){this.parentInstance.placeholder?(this.element.value&&this.element.value.length>=this.parentInstance.placeholder.length/1.25||e)&&(this.element.style.width=this.calcWidth()):this.element.style.width=this.calcWidth()}},{key:"calcWidth",value:function(){return(0,o.calcWidthOfInput)(this.element)}},{key:"setActiveDescendant",value:function(e){this.element.setAttribute("aria-activedescendant",e)}},{key:"removeActiveDescendant",value:function(){this.element.removeAttribute("aria-activedescendant")}},{key:"placeholder",set:function(e){this.element.placeholder=e}},{key:"value",set:function(e){this.element.value=e},get:function(){return this.element.value}}]),e}();t.default=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=function(){function e(t,n,r){i(this,e),this.parentInstance=t,this.element=n,this.classNames=r,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight,this.hasChildren=!!this.element.children}return r(e,[{key:"clear",value:function(){this.element.innerHTML=""}},{key:"scrollTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.element.scrollTop=e}},{key:"append",value:function(e){this.element.appendChild(e)}},{key:"getChild",value:function(e){return this.element.querySelector(e)}}]),e}();t.default=o},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),a=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,i)}if("value"in r)return r.value;var s=r.get;if(void 0!==s)return s.call(i)},l=n(4),c=function(e){return e&&e.__esModule?e:{default:e}}(l),u=n(0),h=function(e){function t(e,n,o){i(this,t);var s=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,o));return s.parentInstance=e,s.element=n,s.classNames=o,s}return o(t,e),s(t,[{key:"value",set:function(e){var t=(0,u.reduceToValues)(e),n=t.join(this.parentInstance.config.delimiter);this.element.setAttribute("value",n),this.element.value=n},get:function(){return a(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"value",this)}}]),t}(c.default);t.default=h},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),l=n(4),c=i(l),u=n(5),h=i(u),d=function(e){function t(e,n,i){r(this,t);var s=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,i));return s.parentInstance=e,s.element=n,s.classNames=i,s}return s(t,e),a(t,[{key:"appendDocFragment",value:function(e){this.element.innerHTML="",this.element.appendChild(e)}},{key:"placeholderOption",get:function(){return this.element.querySelector("option[placeholder]")}},{key:"optionGroups",get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))}},{key:"options",get:function(){return Array.from(this.element.options)},set:function(e){var t=document.createDocumentFragment(),n=function(e){var n=h.default.option(e);t.appendChild(n)};e.forEach(function(e){return n(e)}),this.appendDocFragment(t)}}]),t}(c.default);t.default=d},function(e,t,n){var i,r;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var r=typeof i;if("string"===r||"number"===r)e.push(i);else if(Array.isArray(i))e.push(n.apply(null,i));else if("object"===r)for(var s in i)o.call(i,s)&&i[s]&&e.push(s)}}return e.join(" ")}var o={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(i=[],void 0!==(r=function(){return n}.apply(t,i))&&(e.exports=r))}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearChoices=t.activateChoices=t.filterChoices=t.addChoice=void 0;var i=n(1);t.addChoice=function(e,t,n,r,o,s,a,l,c){return{type:i.ACTION_TYPES.ADD_CHOICE,value:e,label:t,id:n,groupId:r,disabled:o,elementId:s,customProperties:a,placeholder:l,keyCode:c}},t.filterChoices=function(e){return{type:i.ACTION_TYPES.FILTER_CHOICES,results:e}},t.activateChoices=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:i.ACTION_TYPES.ACTIVATE_CHOICES,active:e}},t.clearChoices=function(){return{type:i.ACTION_TYPES.CLEAR_CHOICES}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highlightItem=t.removeItem=t.addItem=void 0;var i=n(1);t.addItem=function(e,t,n,r,o,s,a,l){return{type:i.ACTION_TYPES.ADD_ITEM,value:e,label:t,id:n,choiceId:r,groupId:o,customProperties:s,placeholder:a,keyCode:l}},t.removeItem=function(e,t){return{type:i.ACTION_TYPES.REMOVE_ITEM,id:e,choiceId:t}},t.highlightItem=function(e,t){return{type:i.ACTION_TYPES.HIGHLIGHT_ITEM,id:e,highlighted:t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addGroup=void 0;var i=n(1);t.addGroup=function(e,t,n,r){return{type:i.ACTION_TYPES.ADD_GROUP,value:e,id:t,active:n,disabled:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.clearAll=function(){return{type:"CLEAR_ALL"}}},function(e,t,n){"use strict";!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}Array.from||(Array.from=function(){var e=Object.prototype.toString,t=function(t){return"function"==typeof t||"[object Function]"===e.call(t)},n=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},i=Math.pow(2,53)-1,r=function(e){var t=n(e);return Math.min(Math.max(t,0),i)};return function(e){var n=this,i=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o=arguments.length>1?arguments[1]:void 0,s=void 0;if(void 0!==o){if(!t(o))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(s=arguments[2])}for(var a=r(i.length),l=t(n)?Object(new n(a)):new Array(a),c=0,u=void 0;c<a;)u=i[c],l[c]=o?void 0===s?o(u,c):o.call(s,u,c):u,c+=1;return l.length=a,l}}()),Array.prototype.find||(Array.prototype.find=function(e){if(null==this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var t=Object(this),n=t.length>>>0,i=arguments[1],r=void 0,o=0;o<n;o++)if(r=t[o],e.call(i,r,o,t))return r}),e.prototype=window.Event.prototype,window.CustomEvent=e}()}])});