\n ')},containerInner:function(){return(0,c.strToEl)('\n \n ')},itemList:function(){return(0,c.strToEl)('\n \n ')},item:function(i){return e.config.removeItemButton&&"select-one"!==e.passedElement.type?(0,c.strToEl)('\n \n "+i.label+'\n \n
\n '):(0,c.strToEl)('\n \n "+i.label+"\n
\n ")},choiceList:function(){return(0,c.strToEl)('\n \n ")},choiceGroup:function(e){return(0,c.strToEl)('\n \n ")},choice:function(e){return(0,c.strToEl)('\n 0?'role="treeitem"':'role="option"')+">\n "+e.label+"\n
\n ")},input:function(){return(0,c.strToEl)('\n \n ')},dropdown:function(){return(0,c.strToEl)('\n \n ')},notice:function(e,i){return(0,c.strToEl)('\n '+e+"
\n ")},option:function(e){return(0,c.strToEl)('\n \n ")}};this.config.templates=i}},{key:"_createInput",value:function(){var e=this,t=this._getTemplate("containerOuter"),i=this._getTemplate("containerInner"),n=this._getTemplate("itemList"),s=this._getTemplate("choiceList"),o=this._getTemplate("input"),r=this._getTemplate("dropdown");if(this.containerOuter=t,this.containerInner=i,this.input=o,this.choiceList=s,this.itemList=n,this.dropdown=r,this.passedElement.classList.add(this.config.classNames.input,this.config.classNames.hiddenState),this.passedElement.tabIndex="-1",this.passedElement.setAttribute("style","display:none;"),this.passedElement.setAttribute("aria-hidden","true"),this.passedElement.setAttribute("data-choice","active"),(0,c.wrap)(this.passedElement,i),(0,c.wrap)(i,t),this.config.placeholder&&(this.config.placeholderValue||this.passedElement.getAttribute("placeholder"))){var a=this.config.placeholderValue||this.passedElement.getAttribute("placeholder");o.placeholder=a,"select-one"!==this.passedElement.type&&(o.style.width=(0,c.getWidthOfInput)(o))}if(this.config.addItems||this.disable(),t.appendChild(i),t.appendChild(r),i.appendChild(n),"text"!==this.passedElement.type&&r.appendChild(s),"select-multiple"===this.passedElement.type||"text"===this.passedElement.type?i.appendChild(o):this.canSearch&&r.insertBefore(o,r.firstChild),"select-multiple"===this.passedElement.type||"select-one"===this.passedElement.type){var l=Array.from(this.passedElement.getElementsByTagName("OPTGROUP"));this.highlightPosition=0,this.isSearching=!1,l&&l.length?l.forEach(function(t,i){var n=0===i;e._addGroup(t,i,n)}):!function(){var t=Array.from(e.passedElement.options),i=[];t.forEach(function(e){i.push({value:e.value,label:e.innerHTML,selected:e.selected,disabled:e.disabled||e.parentNode.disabled})}),i.concat(e.presetChoices).forEach(function(t,i){0===i?e._addChoice(!0,!!t.disabled&&t.disabled,t.value,t.label):e._addChoice(!!t.selected&&t.selected,!!t.disabled&&t.disabled,t.value,t.label)})}()}else"text"===this.passedElement.type&&this.presetItems.forEach(function(t){if((0,c.isType)("Object",t)){if(!t.value)return;e._addItem(t.value,t.label,t.id)}else(0,c.isType)("String",t)&&e._addItem(t)})}},{key:"renderGroups",value:function(e,t,i){var n=this,s=i||document.createDocumentFragment(),o=this.config.sortFilter;return e.sort(o).forEach(function(e,i){var o=t.filter(function(t){return"select-one"===n.passedElement.type?t.groupId===e.id:t.groupId===e.id&&!t.selected});if(o.length>=1){var r=n._getTemplate("choiceGroup",e);s.appendChild(r),n.renderChoices(o,s)}}),s}},{key:"renderChoices",value:function(e,t){var i=this,n=t||document.createDocumentFragment(),s=this.isSearching?c.sortByScore:this.config.sortFilter;return e.sort(s).forEach(function(e,t){var s=i._getTemplate("choice",e);
"select-one"===i.passedElement.type?n.appendChild(s):e.selected||n.appendChild(s)}),n}},{key:"renderItems",value:function(e,t){var i=this,n=t||document.createDocumentFragment(),s=this.store.getItemsReducedToValues(e);return"text"===this.passedElement.type?this.passedElement.setAttribute("value",s.join(this.config.delimiter)):!function(){var t=document.createDocumentFragment();e.forEach(function(e){var n=i._getTemplate("option",e);t.appendChild(n)}),i.passedElement.innerHTML="",i.passedElement.appendChild(t)}(),e.forEach(function(e){var t=i._getTemplate("item",e);n.appendChild(t)}),n}},{key:"render",value:function(){if(this.currentState=this.store.getState(),this.currentState!==this.prevState){if(!(this.currentState.choices===this.prevState.choices&&this.currentState.groups===this.prevState.groups||"select-multiple"!==this.passedElement.type&&"select-one"!==this.passedElement.type)){var e=this.store.getGroupsFilteredByActive(),t=this.store.getChoicesFilteredByActive(),i=document.createDocumentFragment();if(this.choiceList.innerHTML="",this.choiceList.scrollTop=0,e.length>=1&&this.isSearching!==!0?i=this.renderGroups(e,t,i):t.length>=1&&(i=this.renderChoices(t,i)),i.childNodes&&i.childNodes.length>0)this.choiceList.appendChild(i),this._highlightChoice();else{var n=this.isSearching?this._getTemplate("notice",this.config.noResultsText):this._getTemplate("notice",this.config.noChoicesText);this.choiceList.appendChild(n)}}if(this.currentState.items!==this.prevState.items){var s=this.store.getItemsFilteredByActive();if(s){var o=this.renderItems(s);this.itemList.innerHTML="",o.children&&o.children.length&&this.itemList.appendChild(o)}}this.prevState=this.currentState}}}]),e}();window.Choices=e.exports=p},function(e,t){"use strict";Array.from||(Array.from=function(){var e=Object.prototype.toString,t=function(t){return"function"==typeof t||"[object Function]"===e.call(t)},i=function(e){var t=Number(e);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t},n=Math.pow(2,53)-1,s=function(e){var t=i(e);return Math.min(Math.max(t,0),n)};return function(e){var i=this,n=Object(e);if(null==e)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,r=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof r){if(!t(r))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var a,c=s(n.length),l=t(i)?Object(new i(c)):new Array(c),h=0;h>>0,s=arguments[1],o=0;o=0?t:0},t.getElementOffset=function(e,t){var i=t;return i>1&&(i=1),i>0&&(i=0),Math.max(e.offsetHeight*i)},t.getAdjacentEl=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(e&&t){var n=e.parentNode.parentNode,s=Array.from(n.querySelectorAll(t)),o=s.indexOf(e),r=i>0?1:-1;return s[o+r]}},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,i){return this.getScrollPosition(t)>this.getElemDistance(e)+this.getElementOffset(e,i)},t.isScrolledIntoView=function(e,t){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(e){var n=void 0;return n=i>0?t.scrollTop+t.offsetHeight>=e.offsetTop+e.offsetHeight:e.offsetTop>=t.scrollTop}},t.stripHTML=function(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""},t.addAnimation=function(e,t){var i=s(),n=function o(){e.classList.remove(t),e.removeEventListener(i,o,!1)};e.classList.add(t),e.addEventListener(i,n,!1)},t.getRandomNumber=function(e,t){return Math.floor(Math.random()*(t-e)+e)},t.strToEl=function(){var e=document.createElement("div");return function(t){var i;for(e.innerHTML=t,i=e.children[0];e.firstChild;)e.removeChild(e.firstChild);return i}}());t.getWidthOfInput=function(e){var t=e.value||e.placeholder,i=e.offsetWidth;if(t){var n=o(""+t+"");n.style.position="absolute",n.style.padding="0",n.style.top="-9999px",n.style.left="-9999px",n.style.width="auto",n.style.whiteSpace="pre",document.body.appendChild(n),t&&n.offsetWidth!==e.offsetWidth&&(i=n.offsetWidth+4),document.body.removeChild(n)}return i+"px"},t.sortByAlpha=function(e,t){var i=(e.label||e.value).toLowerCase(),n=(t.label||t.value).toLowerCase();return in?1:0},t.sortByScore=function(e,t){return e.score-t.score}},function(e,t,i){!function(t){"use strict";function i(){console.log.apply(console,arguments)}function n(e,t){var i,n,s,o;for(this.list=e,this.options=t=t||{},i=0,o=["sort","shouldSort","verbose","tokenize"],n=o.length;i1)throw new Error("Key weight has to be > 0 and <= 1");e=e.name}else this._keyMap[e]={weight:1};this._analyze(e,o(h,e,[]),h,i)}},n.prototype._analyze=function(e,t,n,s){var r,a,c,l,h,u,d,p,f,v,m,g,y,b=this.options,E=!1;if(void 0!==t&&null!==t)if(a=[],"string"==typeof t){if(r=t.split(b.tokenSeparator),b.verbose&&i("---------\nKey:",e),this.options.tokenize){for(g=0;g0){if(t={item:r.item},h.indexOf("matches")!==-1)for(n=r.output,t.matches=[],i=0;iI.maxPatternLength){if(g=e.match(new RegExp(this.pattern.replace(I.tokenSeparator,"|"))),y=!!g)for(E=[],t=0,_=g.length;t<_;t++)w=g[t],E.push([e.indexOf(w),w.length-1]);return{isMatch:y,score:y?.5:1,matchedIndices:E}}for(s=I.location,n=e.length,o=I.threshold,r=e.indexOf(this.pattern,s),b=[],t=0;t=h;i--)if(f=this.patternAlphabet[e.charAt(i-1)],f&&(b[i-1]=1),0===t?d[i]=(d[i+1]<<1|1)&f:d[i]=(d[i+1]<<1|1)&f|((p[i+1]|p[i])<<1|1)|p[i+1],d[i]&this.matchmask&&(v=this._bitapScore(t,i-1),v<=o)){if(o=v,r=i-1,m.push(r),!(r>s))break;h=Math.max(1,2*s-r)}if(this._bitapScore(t+1,s)>o)break;p=d}return E=this._getMatchedIndices(b),{isMatch:r>=0,score:0===v?.001:v,matchedIndices:E}},r.prototype._getMatchedIndices=function(e){for(var t,i=[],n=-1,s=-1,o=0,r=e.length;o-1&&(n=e.map(function(e){return e.id===parseInt(t.choiceId)&&(e.selected=!0),e})),{v:n};case"REMOVE_ITEM":return t.choiceId>-1?{v:e.map(function(e){return e.id===parseInt(t.choiceId)&&(e.selected=!1),e})}:{v:e};case"FILTER_CHOICES":var s=t.results,o=e.map(function(e,t){return e.active=s.some(function(t){if(t.item.id===e.id)return e.score=t.score,!0}),e});return{v:o};case"ACTIVATE_CHOICES":return{v:e.map(function(e){return e.active=t.active,e})};default:return{v:e}}}();if("object"===("undefined"==typeof s?"undefined":n(s)))return s.v};t.default=s}]);
//# sourceMappingURL=choices.min.js.map
\ No newline at end of file
diff --git a/index.html b/index.html
index dfbe860..a65c22b 100644
--- a/index.html
+++ b/index.html
@@ -5,14 +5,24 @@
Choices
+
+
+
+
+
+
+
+
+
+