text: !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.selectivity=e()}}(function(){return function e(t,i,s){function n(r,l){if(!i[r]){if(!t[r]){var u="function"==typeof require&&require;if(!l&&u)return u(r,!0);if(o)return o(r,!0);var h=new Error("Cannot find module '"+r+"'");throw h.code="MODULE_NOT_FOUND",h}var a=i[r]={exports:{}};t[r][0].call(a.exports,function(e){var i=t[r][1][e];return n(i?i:e)},a,a.exports,e,t,i,s)}return i[r].exports}for(var o="function"==typeof require&&require,r=0;r<s.length;r++)n(s[r]);return n}({1:[function(e,t,i){e(5),e(6),e(7),e(9),e(10),e(11),e(12),e(13),e(14),e(15),e(16),e(17),e(18),e(19),t.exports=e(8)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,5:5,6:6,7:7,8:8,9:9}],2:[function(e,t,i){"use strict";function s(){this._events=[],this.delegateEvents()}var n=window.jQuery||window.Zepto;n.extend(s.prototype,{delegateEvents:function(){this.undelegateEvents(),n.each(this.events,function(e,t){var i,s=e.indexOf(" ");s>-1&&(i=e.slice(s+1),e=e.slice(0,s)),"string"===n.type(t)&&(t=this[t]),t=t.bind(this),i?this.$el.on(e,i,t):this.$el.on(e,t),this._events.push({event:e,selector:i,listener:t})}.bind(this))},undelegateEvents:function(){this._events.forEach(function(e){e.selector?this.$el.off(e.event,e.selector,e.listener):this.$el.off(e.event,e.listener)},this),this._events=[]}}),t.exports=s},{jquery:"jquery"}],3:[function(e,t,i){"use strict";function s(e,t){function i(){var s=t-(n()-l);if(0>=s||s>t){var c=h;u=h=void 0,c&&(a=n(),r=e.apply(null,o),u||(o=null))}else u=setTimeout(i,s)}function s(){return o=arguments,l=n(),h=!0,u||(u=setTimeout(i,t)),r}var o,r,l,u,h,a=0;return t=0>t?0:+t||0,s}var n=Date.now;t.exports=s},{}],4:[function(e,t,i){"use strict";function s(e){return o[e]}function n(e){return e?String(e).replace(r,s):""}var o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},r=new RegExp("["+Object.keys(o).join("")+"]","g");t.exports=n},{}],5:[function(e,t,i){"use strict";var s=window.jQuery||window.Zepto,n=e(3),o=e(8);e(13),o.OptionListeners.unshift(function(e,t){var i=t.ajax;if(i&&i.url){var r=i.formatError||o.Locale.ajaxError,l=i.minimumInputLength||0,u=i.params,h=i.processItem||function(e){return e},a=i.quietMillis||0,c=i.results||function(e){return{results:e,more:!1}},d=i.transport||s.ajax;a&&(d=n(d,a)),t.query=function(e){var t=e.offset,n=e.term;if(n.length<l)e.error(o.Locale.needMoreCharacters(l-n.length));else{var a=i.url instanceof Function?i.url(e):i.url;u&&(a+=(a.indexOf("?")>-1?"&":"?")+s.param(u(n,t)));var p=i.success,f=i.error;d(s.extend({},i,{url:a,success:function(i,s,n){p&&p(i,s,n);var o=c(i,t);o.results=o.results.map(h),e.callback(o)},error:function(t,i,s){f&&f(t,i,s),e.error(r(n,t,i,s),{escape:!1})}}))}}}})},{13:13,3:3,8:8,jquery:"jquery"}],6:[function(e,t,i){"use strict";var s=e(8),n=0;s.OptionListeners.push(function(e,t){var i=t.query;i&&!i._async&&(t.query=function(e){n++;var t=n,s=e.callback,o=e.error;e.callback=function(){t===n&&s.apply(null,arguments)},e.error=function(){t===n&&o.apply(null,arguments)},i(e)},t.query._async=!0)})},{8:8}],7:[function(e,t,i){"use strict";var s=window.jQuery||window.Zepto,n=e(10);s.extend(n.prototype,{removeCloseHandler:function(){this._$backdrop&&!this.parentMenu&&(this._$backdrop.remove(),this._$backdrop=null)},setupCloseHandler:function(){var e;this.parentMenu?e=this.parentMenu._$backdrop:(e=s("<div>").addClass("selectivity-backdrop"),s("body").append(e)),e.on("click",this.close.bind(this)),this._$backdrop=e}})},{10:10,jquery:"jquery"}],8:[function(e,t,i){"use strict";function s(e,t){var i,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var r=this.selectivity;if(r){if("string"!==o.type(e)&&(s=[e],e="setOptions"),"function"!==o.type(r[e]))throw new Error("Unknown method: "+e);void 0===i&&(i=r[e].apply(r,s))}else if("string"===o.type(e)){if("destroy"!==e)throw new Error("Cannot call method on element without Selectivity instance")}else{t=o.extend({},e,{element:this});var l=o(this);l.is("select")&&l.prop("multiple")&&(t.multiple=!0);var u=n.InputTypes,h=t.inputType||(t.multiple?"Multiple":"Single");if("function"!==o.type(h)){if(!u[h])throw new Error("Unknown Selectivity input type: "+h);h=u[h]}this.selectivity=new h(t)}}),void 0===i?this:i}function n(e){return this instanceof n?(this.$el=o(e.element),this.$searchInput=null,this.dropdown=null,this.enabled=!0,this.hasTouch="undefined"!=typeof window&&"ontouchstart"in window,this.hasKeyboard=!this.hasTouch,this.items=null,this.matcher=n.matcher,this.options={},this.searchInputListeners=n.SearchInputListeners,this.templates=o.extend({},n.Templates),this.term="",this.setOptions(e),e.value?this.value(e.value,{triggerChange:!1}):this.data(e.data||null,{triggerChange:!1}),this.$el.on("mouseover",this._mouseover.bind(this)),this.$el.on("mouseleave",this._mouseout.bind(this)),this.$el.on("selectivity-close",this._closed.bind(this)),void r.call(this)):s.apply(this,arguments)}var o=window.jQuery||window.Zepto,r=e(2);o.extend(n.prototype,r.prototype,{$:function(e){return this.$el.find(e)},close:function(){this.dropdown&&this.dropdown.close()},data:function(e,t){return t=t||{},void 0===e?this._data:(e=this.validateData(e),this._data=e,this._value=this.getValueForData(e),t.triggerChange!==!1&&this.triggerChange(),void 0)},destroy:function(){this.undelegateEvents();var e=this.$el;e.children().remove(),e[0].selectivity=null,e=null},filterResults:function(e){return e},focus:function(){this.$searchInput&&this.$searchInput.focus()},getItemForId:function(e){var t=this.items;return t?n.findNestedById(t,e):{id:e,text:""+e}},initSearchInput:function(e,t){this.$searchInput=e,this.searchInputListeners.forEach(function(t){t(this,e)}.bind(this)),t&&t.noSearch||e.on("keyup",function(e){e.isDefaultPrevented()||this.search()}.bind(this))},open:function(e){if(e=e||{},!this.dropdown){if(this.triggerEvent("selectivity-opening")){var t=this.options.dropdown||n.Dropdown;t&&(this.dropdown=new t({items:this.items,position:this.options.positionDropdown,query:this.options.query,selectivity:this,showSearchInput:e.showSearchInput})),e.search!==!1&&this.search("")}this.$el.children().toggleClass("open",!0)}},positionDropdown:function(){this.dropdown&&this.dropdown.position()},search:function(e){void 0===e&&(e=this.$searchInput?this.$searchInput.val():""),this.open({search:!1}),this.dropdown&&this.dropdown.search(e)},setOptions:function(e){e=e||{},n.OptionListeners.forEach(function(t){t(this,e)}.bind(this)),o.extend(this.options,e);var t=o.extend({closeOnSelect:"boolean",dropdown:"function|null",initSelection:"function|null",matcher:"function|null",placeholder:"string",positionDropdown:"function|null",query:"function|null",readOnly:"boolean",removeOnly:"boolean",searchInputListeners:"array"},e.allowedTypes);o.each(e,function(e,i){var s=t[e];if(s&&!s.split("|").some(function(e){return o.type(i)===e}))throw new Error(e+" must be of type "+s);switch(e){case"items":this.items=null===i?i:n.processItems(i);break;case"matcher":this.matcher=i;break;case"searchInputListeners":this.searchInputListeners=i;break;case"templates":o.extend(this.templates,i)}}.bind(this)),this.enabled=!this.options.readOnly&&!this.options.removeOnly},template:function(e,t){var i=this.templates[e];if(i)return"function"===o.type(i)?i(t):i.render?i.render(t):i.toString();throw new Error("Unknown Category: "+e)},triggerChange:function(e){this.triggerEvent("change",o.extend({value:this._value},e))},triggerEvent:function(e,t){var i=o.Event(e,t||{});return this.$el.trigger(i),!i.isDefaultPrevented()},val:function(e){return this.value(e)},validateItem:function(e){if(e&&n.isValidId(e.id)&&"string"===o.type(e.text))return e;throw new Error("Item should have id (number or string) and text (string) properties")},value:function(e,t){return t=t||{},void 0===e?this._value:(e=this.validateValue(e),this._value=e,this.options.initSelection?this.options.initSelection(e,function(i){this._value===e&&(this._data=this.validateData(i),t.triggerChange!==!1&&this.triggerChange())}.bind(this)):(this._data=this.getDataForValue(e),t.triggerChange!==!1&&this.triggerChange()),void 0)},_closed:function(){this.dropdown=null,this.$el.children().toggleClass("open",!1)},_getItemId:function(e){var t;t=e.target?o(e.target).closest("[data-item-id]"):e.length?e:o(e);var i=t.data("item-id");if("string"===o.type(i))return i;if(n.findById(this._data||[],i))return i;for(var s=this.dropdown;s;){if(n.findNestedById(s.results,i))return i;s=s.submenu}return""+i},_mouseout:function(){this.$el.children().toggleClass("hover",!1)},_mouseover:function(){this.$el.children().toggleClass("hover",!0)}}),n.Dropdown=null,n.InputTypes={},n.OptionListeners=[],n.SearchInputListeners=[],n.Templates={},n.findById=function(e,t){var i=n.findIndexById(e,t);return i>-1?e[i]:null},n.findIndexById=function(e,t){for(var i=0,s=e.length;s>i;i++)if(e[i].id===t)return i;return-1},n.findNestedById=null,n.inherits=function(e,t,i){return 2===arguments.length&&(i=t,t=n),e.prototype=o.extend(Object.create(t.prototype),{constructor:e},i),function(e,i){t.prototype[i].apply(e,Array.prototype.slice.call(arguments,2))}},n.isValidId=function(e){var t=o.type(e);return"number"===t||"string"===t},n.matcher=function(e,t){var i=null;if(n.transformText(e.text).indexOf(t)>-1)i=e;else if(e.children){var s=e.children.map(function(e){return n.matcher(e,t)}).filter(function(e){return!!e});s.length&&(i={id:e.id,text:e.text,children:s})}return i},n.processItem=function(e){if(n.isValidId(e))return{id:e,text:""+e};if(e&&(n.isValidId(e.id)||e.children)&&"string"===o.type(e.text))return e.children&&(e.children=n.processItems(e.children)),e;throw new Error("invalid item")},n.processItems=function(e){if("array"===o.type(e))return e.map(n.processItem);throw new Error("invalid items")},n.quoteCssAttr=function(e){return'"'+(""+e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},n.transformText=function(e){return e.toLowerCase()},t.exports=o.fn.selectivity=n},{2:2,jquery:"jquery"}],9:[function(e,t,i){"use strict";var s={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A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"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},n=e(8),o=n.transformText;n.transformText=function(e){for(var t="",i=0,n=e.length;n>i;i++){var r=e[i];t+=s[r]||r}return o(t)}},{8:8}],10:[function(e,t,i){"use strict";function s(e){var t=e.selectivity;this.$el=n(t.template("dropdown",{dropdownCssClass:t.options.dropdownCssClass,searchInputPlaceholder:t.options.searchInputPlaceholder,showSearchInput:e.showSearchInput})),this.$results=this.$(".selectivity-results-container"),this.hasMore=!1,this.highlightedResult=null,this.loadMoreHighlighted=!1,this.options=e,this.results=[],this.selectivity=t,this._closed=!1,this._closeProxy=this.close.bind(this),t.options.closeOnSelect!==!1&&t.$el.on("selectivity-selecting",this._closeProxy),this._lastMousePosition={},this.addToDom(),this.position(),this.setupCloseHandler(),this._suppressMouseWheel(),e.showSearchInput&&(t.initSearchInput(this.$(".selectivity-search-input")),t.focus()),r.call(this),this.$results.on("scroll touchmove touchend",o(this._scrolled.bind(this),50)),this.showLoading(),setTimeout(this.triggerOpen.bind(this),1)}var n=window.jQuery||window.Zepto,o=e(3),r=e(2),l=e(8);n.extend(s.prototype,r.prototype,{$:function(e){return this.$el.find(e)},addToDom:function(){for(var e,t=this.selectivity.$el;(e=t.next(".selectivity-dropdown")).length;)t=e;this.$el.insertAfter(t)},close:function(){this._closed||(this._closed=!0,this.$el.remove(),this.removeCloseHandler(),this.selectivity.$el.off("selectivity-selecting",this._closeProxy),this.triggerClose())},events:{"click .selectivity-load-more":"_loadMoreClicked","click .selectivity-result-item":"_resultClicked","mouseenter .selectivity-load-more":"_loadMoreHovered","mouseenter .selectivity-result-item":"_resultHovered"},highlight:function(e){this.loadMoreHighlighted&&this.$(".selectivity-load-more").removeClass("highlight"),this.$(".selectivity-result-item").removeClass("highlight").filter("[data-item-id="+l.quoteCssAttr(e.id)+"]").addClass("highlight"),this.highlightedResult=e,this.loadMoreHighlighted=!1,this.selectivity.triggerEvent("selectivity-highlight",{item:e,id:e.id})},highlightLoadMore:function(){this.$(".selectivity-result-item").removeClass("highlight"),this.$(".selectivity-load-more").addClass("highlight"),this.highlightedResult=null,this.loadMoreHighlighted=!0},loadMore:function(){this.options.query({callback:function(e){if(!e||!e.results)throw new Error("callback must be passed a response object");this._showResults(l.processItems(e.results),{add:!0,hasMore:!!e.more})}.bind(this),error:this._showResults.bind(this,[],{add:!0}),offset:this.results.length,selectivity:this.selectivity,term:this.term})},position:function(){var e=this.options.position;e&&e(this.$el,this.selectivity.$el),this._scrolled()},removeCloseHandler:function(){n("body").off("click",this._closeProxy)},renderItems:function(e){var t=this.selectivity;return e.map(function(e){var i=t.template(e.id?"resultItem":"resultLabel",e);return e.children&&(i+=t.template("resultChildren",{childrenHtml:this.renderItems(e.children)})),i},this).join("")},search:function(e){var t=this;if(e=e||"",t.term=e,t.options.items){e=l.transformText(e);var i=t.selectivity.matcher;t._showResults(t.options.items.map(function(t){return i(t,e)}).filter(function(e){return!!e}),{term:e})}else t.options.query&&t.options.query({callback:function(i){if(!i||!i.results)throw new Error("callback must be passed a response object");t._showResults(l.processItems(i.results),{hasMore:!!i.more,term:e})},error:t.showError.bind(t),offset:0,selectivity:t.selectivity,term:e})},selectHighlight:function(){this.highlightedResult?this.selectItem(this.highlightedResult.id):this.loadMoreHighlighted&&this._loadMoreClicked()},selectItem:function(e){var t=l.findNestedById(this.results,e);if(t&&!t.disabled){var i={id:e,item:t};this.selectivity.triggerEvent("selectivity-selecting",i)&&this.selectivity.triggerEvent("selectivity-selected",i)}},setupCloseHandler:function(){n("body").on("click",this._closeProxy)},showError:function(e,t){t=t||{},this.$results.html(this.selectivity.template("error",{escape:t.escape!==!1,message:e})),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showLoading:function(){this.$results.html(this.selectivity.template("loading")),this.hasMore=!1,this.results=[],this.highlightedResult=null,this.loadMoreHighlighted=!1,this.position()},showResults:function(e,t){var i=this.renderItems(e);t.hasMore?i+=this.selectivity.template("loadMore"):i||t.add||(i=this.selectivity.template("noResults",{term:t.term})),t.add?(this.$(".selectivity-loading").replaceWith(i),this.results=this.results.concat(e)):(this.$results.html(i),this.results=e),this.hasMore=t.hasMore,(!t.add||this.loadMoreHighlighted)&&this._highlightFirstItem(e),this.position()},triggerClose:function(){this.selectivity.$el.trigger("selectivity-close")},triggerOpen:function(){this.selectivity.$el.trigger("selectivity-open")},_highlightFirstItem:function(e){function t(e){for(var i=0,s=e.length;s>i;i++){var n=e[i];if(n.id)return n;if(n.children){var o=t(n.children);if(o)return o}}}var i=t(e);i?this.highlight(i):(this.highlightedResult=null,this.loadMoreHighlighted=!1)},_loadMoreClicked:function(){return this.$(".selectivity-load-more").replaceWith(this.selectivity.template("loading")),this.loadMore(),this.selectivity.focus(),!1},_loadMoreHovered:function(e){(void 0===e.screenX||e.screenX!==this._lastMousePosition.x||void 0===e.screenY||e.screenY!==this._lastMousePosition.y)&&(this.highlightLoadMore(),this._recordMousePosition(e))},_recordMousePosition:function(e){this._lastMousePosition={x:e.screenX,y:e.screenY}},_resultClicked:function(e){return this.selectItem(this.selectivity._getItemId(e)),!1},_resultHovered:function(e){if(void 0===e.screenX||e.screenX!==this._lastMousePosition.x||void 0===e.screenY||e.screenY!==this._lastMousePosition.y){var t=this.selectivity._getItemId(e),i=l.findNestedById(this.results,t);i&&!i.disabled&&this.highlight(i),this._recordMousePosition(e)}},_scrolled:function(){var e=this.$(".selectivity-load-more");e.length&&e[0].offsetTop-this.$results[0].scrollTop<this.$el.height()&&this._loadMoreClicked()},_showResults:function(e,t){this.showResults(this.selectivity.filterResults(e),t)},_suppressMouseWheel:function(){var e=this.selectivity.options.suppressMouseWheelSelector;if(null!==e){var t=e||".selectivity-results-container";this.$el.on("DOMMouseScroll mousewheel",t,function(e){function t(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1,!1}var i=n(this),s=this.scrollTop,o=this.scrollHeight,r=i.height(),l=e.originalEvent,u="DOMMouseScroll"===e.type?-40*l.detail:l.wheelDelta,h=u>0;if(o>r){if(!h&&-u>o-r-s)return i.scrollTop(o),t();if(h&&u>s)return i.scrollTop(0),t()}})}}}),t.exports=l.Dropdown=s},{2:2,3:3,8:8,jquery:"jquery"}],11:[function(e,t,i){"use strict";function s(e){var t=e.indexOf("@"),i=e.lastIndexOf("."),s=e.indexOf(" ");return t>0&&i>t+1&&i<e.length-2&&-1===s}function n(e,t){t=void 0===t?e.length:t;for(var i=t-1;i>=0;i--)if(/\s/.test(e[i]))return e.slice(i+1,t);return e.slice(0,t)}function o(e,t){return e.slice(0,1)===t[0]&&e.slice(-1)===t[1]?e.slice(1,-1).trim():e.trim()}function r(e){var t=n(e),i=e.slice(0,-t.length).trim();return s(t)?(t=o(o(t,"()"),"<>"),i=o(i,'""').trim()||t,{id:t,text:i}):e.trim()?{id:e,text:e}:null}function l(e,t,i){function o(e){if(e)for(var t=0,i=e.length;i>t;t++)switch(e[t]){case";":case",":case"\n":return!0;case" ":case"	":if(s(n(e,t)))return!0;break;case'"':do t++;while(i>t&&'"'!==e[t]);break;default:continue}return!1}function l(e){for(var t=0,i=e.length;i>t;t++)switch(e[t]){case";":case",":case"\n":return{term:e.slice(0,t),input:e.slice(t+1)};case" ":case"	":if(s(n(e,t)))return{term:e.slice(0,t),input:e.slice(t+1)};break;case'"':do t++;while(i>t&&'"'!==e[t]);break;default:continue}return{}}for(;o(e);){var u=l(e);if(u.term){var h=r(u.term);!h||h.id&&a.findById(t,h.id)||i(h)}e=u.input}return e}function u(e){c.call(this,e)}var h=window.jQuery||window.Zepto,a=e(8),c=e(14),d=a.inherits(u,c,{initSearchInput:function(e){d(this,"initSearchInput",e),e.on("blur",function(){var t=e.val();s(n(t))&&this.add(r(t))}.bind(this))},setOptions:function(e){e=h.extend({createTokenItem:r,showDropdown:!1,tokenizer:l},e),d(this,"setOptions",e)}});t.exports=a.InputTypes.Email=u},{14:14,8:8,jquery:"jquery"}],12:[function(e,t,i){"use strict";function s(e,t){function i(t,s){function o(e,t){for(var i=0,s=e.length;s>i;i++)if(e.eq(i).is(t))return i;return-1}function r(){var e;if(t.highlightedResult){var i=n.quoteCssAttr(t.highlightedResult.id);e=t.$(".selectivity-result-item[data-item-id="+i+"]")}else{if(!t.loadMoreHighlighted)return;e=t.$(".selectivity-load-more")}var o=e.position();if(o){var r=o.top,l=t.$results.height(),u=e.outerHeight?e.outerHeight():e.height();(0>r||r>l-u)&&(r+=t.$results.scrollTop(),t.$results.scrollTop(0>s?r:r-l+u))}}if(t.submenu)return void i(t.submenu,s);var l=t.results;if(l.length){var u=t.$(".selectivity-result-item"),h=s>0?0:u.length-1,a=h,c=t.highlightedResult;if(c){var d=n.quoteCssAttr(c.id);if(a=o(u,"[data-item-id="+d+"]")+s,s>0?a>=u.length:0>a){if(t.hasMore)return t.highlightLoadMore(),void r();a=h}}var p=n.findNestedById(l,e._getItemId(u[a]));p&&(t.highlight(p,{delay:!!p.submenu}),r())}}function s(s){var n=e.dropdown;if(n)if(s.keyCode===o){if(!t.val()){if(n.submenu){for(var u=n.submenu;u.submenu;)u=u.submenu;p=u}s.preventDefault(),d=!0}}else s.keyCode===r?i(n,1):s.keyCode===a?i(n,-1):s.keyCode===h?setTimeout(function(){e.close({keepFocus:!1})},1):s.keyCode===l&&s.preventDefault()}function c(t){function i(){e.options.showDropdown!==!1&&e.open()}var s=e.dropdown;d?(t.preventDefault(),d=!1,p&&(p.close(),e.focus(),p=null)):t.keyCode===o?!s&&e.options.allowClear&&e.clear():t.keyCode!==l||t.ctrlKey?t.keyCode===u?(e.close(),t.preventDefault()):t.keyCode===r||t.keyCode===a?(i(),t.preventDefault()):i():(s?s.selectHighlight():e.options.showDropdown!==!1&&i(),t.preventDefault())}var d=!1,p=null;t.on("keydown",s).on("keyup",c)}var n=e(8),o=8,r=40,l=13,u=27,h=9,a=38;n.SearchInputListeners.push(s)},{8:8}],13:[function(e,t,i){"use strict";var s=e(4),n=e(8);n.Locale={ajaxError:function(e){return"Failed to fetch results for <b>"+s(e)+"</b>"},loading:"Loading...",loadMore:"Load more...",needMoreCharacters:function(e){return"Enter "+e+" more characters to search"},noResults:"No results found",noResultsForTerm:function(e){return"No results for <b>"+s(e)+"</b>"}}},{4:4,8:8}],14:[function(e,t,i){"use strict";function s(e){o.call(this,e),this.$el.html(this.template("multipleSelectInput",{enabled:this.enabled})).trigger("selectivity-init","multiple"),this._highlightedItemId=null,this.initSearchInput(this.$(".selectivity-multiple-input:not(.selectivity-width-detector)")),this.rerenderSelection(),e.positionDropdown||(this.options.positionDropdown=function(e,t){var i=t.position(),s=e.height(),o=t.height(),r=t[0].getBoundingClientRect().top,l=r+o+s,u="undefined"!=typeof window&&l>n(window).height()&&r-s>0,h=t.outerWidth?t.outerWidth():t.width();e.css({left:i.left+"px",top:i.top+(u?-s:o)+"px"}).width(h)})}var n=window.jQuery||window.Zepto,o=e(8),r=8,l=46,u=13,h=o.inherits(s,{add:function(e){var t=o.isValidId(e),i=t?e:this.validateItem(e)&&e.id;-1===this._value.indexOf(i)&&(this._value.push(i),t&&this.options.initSelection?this.options.initSelection([i],function(t){this._value.indexOf(i)>-1&&(e=this.validateItem(t[0]),this._data.push(e),this.triggerChange({added:e}))}.bind(this)):(t&&(e=this.getItemForId(i)),this._data.push(e),this.triggerChange({added:e}))),this.$searchInput.val("")},clear:function(){this.data([])},events:{change:"rerenderSelection","change .selectivity-multiple-input":function(){return!1},click:"_clicked","click .selectivity-multiple-selected-item":"_itemClicked","keydown .selectivity-multiple-input":"_keyHeld","keyup .selectivity-multiple-input":"_keyReleased","paste .selectivity-multiple-input":"_onPaste","selectivity-selected":"_resultSelected"},filterResults:function(e){return e.filter(function(e){return!o.findById(this._data,e.id)},this)},getDataForValue:function(e){return e.map(this.getItemForId,this).filter(function(e){return!!e})},getValueForData:function(e){return e.map(function(e){return e.id})},remove:function(e){var t,i="object"===n.type(e)?e.id:e,s=o.findIndexById(this._data,i);s>-1&&(t=this._data[s],this._data.splice(s,1)),this._value[s]!==i&&(s=this._value.indexOf(i)),s>-1&&this._value.splice(s,1),t&&this.triggerChange({removed:t}),i===this._highlightedItemId&&(this._highlightedItemId=null)},rerenderSelection:function(e){if(e=e||{},e.added)this._renderSelectedItem(e.added),this._scrollToBottom();else if(e.removed){var t=o.quoteCssAttr(e.removed.id);this.$(".selectivity-multiple-selected-item[data-item-id="+t+"]").remove()}else this.$(".selectivity-multiple-selected-item").remove(),this._data.forEach(this._renderSelectedItem,this),this._updateInputWidth();(e.added||e.removed)&&(this.dropdown&&this.dropdown.showResults(this.filterResults(this.dropdown.results),{hasMore:this.dropdown.hasMore}),this.hasKeyboard&&this.focus()),this.positionDropdown(),this._updatePlaceholder()},search:function(){var e=this.$searchInput.val();this.options.tokenizer&&(e=this.options.tokenizer(e,this._data,this.add.bind(this),this.options),"string"===n.type(e)&&e!==this.$searchInput.val()&&this.$searchInput.val(e)),this.dropdown&&h(this,"search")},setOptions:function(e){e=e||{};var t="backspaceHighlightsBeforeDelete";void 0===e[t]&&(e[t]=this.hasTouch),e.allowedTypes=e.allowedTypes||{},e.allowedTypes[t]="boolean";var i=this.enabled;h(this,"setOptions",e),i!==this.enabled&&this.$el.html(this.template("multipleSelectInput",{enabled:this.enabled}))},validateData:function(e){if(null===e)return[];if("array"===n.type(e))return e.map(this.validateItem,this);throw new Error("Data for MultiSelectivity instance should be array")},validateValue:function(e){if(null===e)return[];if("array"===n.type(e)){if(e.every(o.isValidId))return e;throw new Error("Value contains invalid IDs")}throw new Error("Value for MultiSelectivity instance should be an array")},_backspacePressed:function(){this.options.backspaceHighlightsBeforeDelete?this._highlightedItemId?this._deletePressed():this._value.length&&this._highlightItem(this._value.slice(-1)[0]):this._value.length&&this.remove(this._value.slice(-1)[0])},_clicked:function(){return this.enabled?(this.focus(),this._open(),!1):void 0},_createToken:function(){var e=this.$searchInput.val(),t=this.options.createTokenItem;if(e&&t){var i=t(e);i&&this.add(i)}},_deletePressed:function(){this._highlightedItemId&&this.remove(this._highlightedItemId)},_highlightItem:function(e){this._highlightedItemId=e,this.$(".selectivity-multiple-selected-item").removeClass("highlighted").filter("[data-item-id="+o.quoteCssAttr(e)+"]").addClass("highlighted"),this.hasKeyboard&&this.focus()},_itemClicked:function(e){this.enabled&&this._highlightItem(this._getItemId(e))},_itemRemoveClicked:function(e){return this.remove(this._getItemId(e)),this._updateInputWidth(),!1},_keyHeld:function(e){this._originalValue=this.$searchInput.val(),
  e.keyCode!==u||e.ctrlKey||e.preventDefault()},_keyReleased:function(e){var t=!!this._originalValue;e.keyCode!==u||e.ctrlKey?e.keyCode!==r||t?e.keyCode!==l||t||this._deletePressed():this._backspacePressed():this.options.createTokenItem&&this._createToken(),this._updateInputWidth()},_onPaste:function(){setTimeout(function(){this.search(),this.options.createTokenItem&&this._createToken()}.bind(this),10)},_open:function(){this.options.showDropdown!==!1&&this.open()},_renderSelectedItem:function(e){this.$searchInput.before(this.template("multipleSelectedItem",n.extend({highlighted:e.id===this._highlightedItemId,removable:!this.options.readOnly},e)));var t=o.quoteCssAttr(e.id);this.$(".selectivity-multiple-selected-item[data-item-id="+t+"]").find(".selectivity-multiple-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))},_resultSelected:function(e){-1===this._value.indexOf(e.id)?this.add(e.item):this.remove(e.item)},_scrollToBottom:function(){var e=this.$(".selectivity-multiple-input-container");e.scrollTop(e.height())},_updateInputWidth:function(){if(this.enabled){var e=this.$searchInput,t=this.$(".selectivity-width-detector");t.text(e.val()||!this._data.length&&this.options.placeholder||""),e.width(t.width()+20),this.positionDropdown()}},_updatePlaceholder:function(){var e=this._data.length?"":this.options.placeholder;this.enabled?this.$searchInput.attr("placeholder",e):this.$(".selectivity-placeholder").text(e)}});t.exports=o.InputTypes.Multiple=s},{8:8,jquery:"jquery"}],15:[function(e,t,i){"use strict";function s(e){o.call(this,e),this.$el.html(this.template("singleSelectInput",this.options)).trigger("selectivity-init","single"),this.rerenderSelection(),e.positionDropdown||(this.options.positionDropdown=function(e,t){var i=t.position(),s=e.height(),o=t.height(),r=t[0].getBoundingClientRect().top,l=r+o+s,u=0;"undefined"!=typeof window&&(u=Math.min(Math.max(l-n(window).height(),0),r+o));var h=t.outerWidth?t.outerWidth():t.width();e.css({left:i.left+"px",top:i.top+o-u+"px"}).width(h)}),e.showSearchInputInDropdown===!1&&this.initSearchInput(this.$(".selectivity-single-select-input"),{noSearch:!0})}var n=window.jQuery||window.Zepto,o=e(8),r=o.inherits(s,{events:{change:"rerenderSelection",click:"_clicked","focus .selectivity-single-select-input":"_focused","selectivity-selected":"_resultSelected"},clear:function(){this.data(null)},close:function(e){this._closing=!0,r(this,"close"),e&&e.keepFocus===!1||this.$searchInput.focus(),this._closing=!1},getDataForValue:function(e){return this.getItemForId(e)},getValueForData:function(e){return e?e.id:null},open:function(e){this._opening=!0;var t=this.options.showSearchInputInDropdown!==!1;r(this,"open",n.extend({showSearchInput:t},e)),t||this.focus(),this._opening=!1},rerenderSelection:function(){var e=this.$(".selectivity-single-result-container");this._data?(e.html(this.template("singleSelectedItem",n.extend({removable:this.options.allowClear&&!this.options.readOnly},this._data))),e.find(".selectivity-single-selected-item-remove").on("click",this._itemRemoveClicked.bind(this))):e.html(this.template("singleSelectPlaceholder",{placeholder:this.options.placeholder}))},setOptions:function(e){e=e||{},e.allowedTypes=n.extend(e.allowedTypes||{},{allowClear:"boolean",showSearchInputInDropdown:"boolean"}),r(this,"setOptions",e)},validateData:function(e){return null===e?e:this.validateItem(e)},validateValue:function(e){if(null===e||o.isValidId(e))return e;throw new Error("Value for SingleSelectivity instance should be a valid ID or null")},_clicked:function(){return this.enabled?(this.dropdown?this.close():this.options.showDropdown!==!1&&this.open(),!1):void 0},_focused:function(){!this.enabled||this._closing||this._opening||this.options.showDropdown===!1||this.open()},_itemRemoveClicked:function(){return this.data(null),!1},_resultSelected:function(e){this.data(e.item),this.close()}});t.exports=o.InputTypes.Single=s},{8:8,jquery:"jquery"}],16:[function(e,t,i){"use strict";function s(e){this.parentMenu=e.parentMenu,o.call(this,e),this._closeSubmenuTimeout=0,this._openSubmenuTimeout=0}var n=e(8),o=e(10),r=n.inherits(s,o,{close:function(){this.submenu&&this.submenu.close(),r(this,"close"),this.parentMenu&&(this.parentMenu.submenu=null,this.parentMenu=null),clearTimeout(this._closeSubmenuTimeout),clearTimeout(this._openSubmenuTimeout)},highlight:function(e,t){t&&t.delay?(r(this,"highlight",e),clearTimeout(this._openSubmenuTimeout),this._openSubmenuTimeout=setTimeout(this._doHighlight.bind(this,e),300)):this.submenu?this.highlightedResult&&this.highlightedResult.id===e.id?this._doHighlight(e):(clearTimeout(this._closeSubmenuTimeout),this._closeSubmenuTimeout=setTimeout(this._closeSubmenuAndHighlight.bind(this,e),100)):(this.parentMenu&&this.parentMenu._closeSubmenuTimeout&&(clearTimeout(this.parentMenu._closeSubmenuTimeout),this.parentMenu._closeSubmenuTimeout=0),this._doHighlight(e))},search:function(e){this.submenu?this.submenu.search(e):r(this,"search",e)},selectHighlight:function(){this.submenu?this.submenu.selectHighlight():r(this,"selectHighlight")},selectItem:function(e){var t=n.findNestedById(this.results,e);if(t&&!t.disabled&&!t.submenu){var i={id:e,item:t};this.selectivity.triggerEvent("selectivity-selecting",i)&&this.selectivity.triggerEvent("selectivity-selected",i)}},showResults:function(e,t){this.submenu?this.submenu.showResults(e,t):r(this,"showResults",e,t)},triggerClose:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-close-submenu"):r(this,"triggerClose")},triggerOpen:function(){this.parentMenu?this.selectivity.$el.trigger("selectivity-open-submenu"):r(this,"triggerOpen")},_closeSubmenuAndHighlight:function(e){this.submenu&&this.submenu.close(),this._doHighlight(e)},_doHighlight:function(e){if(r(this,"highlight",e),e.submenu&&!this.submenu){var t=this.selectivity,i=t.options.dropdown||n.Dropdown;if(i){var s=n.quoteCssAttr(e.id),o=this.$(".selectivity-result-item[data-item-id="+s+"]"),l=this.$el;this.submenu=new i({items:e.submenu.items||null,parentMenu:this,position:e.submenu.positionDropdown||function(e){var t=l.position(),i=l.width();e.css({left:t.left+i+"px",top:o.position().top+t.top+"px"}).width(i)},query:e.submenu.query||null,selectivity:t,showSearchInput:e.submenu.showSearchInput}),this.submenu.search("")}}}});n.Dropdown=s,n.findNestedById=function(e,t){for(var i=0,s=e.length;s>i;i++){var o,r=e[i];if(r.id===t?o=r:r.children?o=n.findNestedById(r.children,t):r.submenu&&r.submenu.items&&(o=n.findNestedById(r.submenu.items,t)),o)return o}return null},t.exports=s},{10:10,8:8}],17:[function(e,t,i){"use strict";var s=e(4),n=e(8);e(13),n.Templates={dropdown:function(e){var t=e.dropdownCssClass?" "+e.dropdownCssClass:"",i="";if(e.showSearchInput){t+=" has-search-input";var n=e.searchInputPlaceholder;i='<div class="selectivity-search-input-container"><input type="text" class="selectivity-search-input"'+(n?' placeholder="'+s(n)+'"':"")+"></div>"}return'<div class="selectivity-dropdown'+t+'">'+i+'<div class="selectivity-results-container"></div></div>'},error:function(e){return'<div class="selectivity-error">'+(e.escape?s(e.message):e.message)+"</div>"},loading:function(){return'<div class="selectivity-loading">'+n.Locale.loading+"</div>"},loadMore:function(){return'<div class="selectivity-load-more">'+n.Locale.loadMore+"</div>"},multipleSelectInput:function(e){return'<div class="selectivity-multiple-input-container">'+(e.enabled?'<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" class="selectivity-multiple-input"><span class="selectivity-multiple-input selectivity-width-detector"></span>':'<div class="selectivity-multiple-input selectivity-placeholder"></div>')+'<div class="selectivity-clearfix"></div></div>'},multipleSelectedItem:function(e){var t=e.highlighted?" highlighted":"";return'<span class="selectivity-multiple-selected-item'+t+'" data-item-id="'+s(e.id)+'">'+(e.removable?'<a class="selectivity-multiple-selected-item-remove"><i class="la la-remove"></i></a>':"")+s(e.text)+"</span>"},noResults:function(e){var t=n.Locale;return'<div class="selectivity-error">'+(e.term?t.noResultsForTerm(e.term):t.noResults)+"</div>"},resultChildren:function(e){return'<div class="selectivity-result-children">'+e.childrenHtml+"</div>"},resultItem:function(e){return'<div class="selectivity-result-item'+(e.disabled?" disabled":"")+'" data-item-id="'+s(e.id)+'">'+s(e.text)+(e.submenu?'<i class="selectivity-submenu-icon la la-chevron-right"></i>':"")+"</div>"},resultLabel:function(e){return'<div class="selectivity-result-label">'+s(e.text)+"</div>"},singleSelectInput:'<div class="selectivity-single-select"><input type="text" class="selectivity-single-select-input"><div class="selectivity-single-result-container"></div><i class="la la-sort-desc selectivity-caret"></i></div>',singleSelectPlaceholder:function(e){return'<div class="selectivity-placeholder">'+s(e.placeholder)+"</div>"},singleSelectedItem:function(e){return'<span class="selectivity-single-selected-item" data-item-id="'+s(e.id)+'">'+(e.removable?'<a class="selectivity-single-selected-item-remove"><i class="la la-remove"></i></a>':"")+s(e.text)+"</span>"},selectCompliance:function(e){var t=e.mode,i=e.name;return"multiple"===t&&"[]"!==i.slice(-2)&&(i+="[]"),'<select name="'+i+'"'+("multiple"===t?" multiple":"")+"></select>"},selectOptionCompliance:function(e){return'<option value="'+s(e.id)+'" selected>'+s(e.text)+"</option>"}}},{13:13,4:4,8:8}],18:[function(e,t,i){"use strict";function s(e,t,i,s){function n(e){return e?u.some(function(t){return e.indexOf(t)>-1}):!1}function r(e){for(var t=0,i=e.length;i>t;t++)if(u.indexOf(e[t])>-1)return{term:e.slice(0,t),input:e.slice(t+1)};return{}}for(var l=s.createTokenItem||function(e){return e?{id:e,text:e}:null},u=s.tokenSeparators;n(e);){var h=r(e);if(h.term){var a=l(h.term);a&&!o.findById(t,a.id)&&i(a)}e=h.input}return e}var n=window.jQuery||window.Zepto,o=e(8);o.OptionListeners.push(function(e,t){t.tokenSeparators&&(t.allowedTypes=n.extend({tokenSeparators:"array"},t.allowedTypes),t.tokenizer=t.tokenizer||s)})},{8:8,jquery:"jquery"}],19:[function(e,t,i){"use strict";function s(e,t){var i=t.multiple?[]:null,s=function(){var e=o(this);if(e.is("option")){var n=e.text(),r=e.attr("value")||n;if(e.prop("selected")){var l={id:r,text:n};t.multiple?i.push(l):i=l}return{id:r,text:e.attr("label")||n}}return{text:e.attr("label"),children:e.children("option,optgroup").map(s).get()}};t.allowClear="allowClear"in t?t.allowClear:!e.prop("required");var n=e.children("option,optgroup").map(s).get();t.items=t.query?null:n,t.placeholder=t.placeholder||e.data("placeholder")||"",t.data=i;var r=(e.attr("class")||"selectivity-input").split(" ");-1===r.indexOf("selectivity-input")&&r.push("selectivity-input");var l=o("<div>").attr({id:e.attr("id"),"class":r.join(" "),style:e.attr("style"),"data-name":e.attr("name")});return e.replaceWith(l),l}function n(e){var t=e.$el;t.on("selectivity-init",function(i,s){t.append(e.template("selectCompliance",{mode:s,name:t.attr("data-name")})).removeAttr("data-name")}).on("selectivity-init change",function(){var i=e._data,s=t.find("select");i instanceof Array?(s.empty(),i.forEach(function(t){s.append(e.template("selectOptionCompliance",t))})):i?s.html(e.template("selectOptionCompliance",i)):s.empty()})}var o=window.jQuery||window.Zepto,r=e(8);r.OptionListeners.push(function(e,t){var i=e.$el;i.is("select")&&(i.attr("autofocus")&&setTimeout(function(){e.focus()},1),e.$el=s(i,t),e.$el[0].selectivity=e,n(e))})},{8:8,jquery:"jquery"}]},{},[1])(1)});
  