!function(e,t,i){"use strict";function n(e){return e?String(e).replace(/[&<>"']/g,(function(e){return{"&":"&","<":"<",">":">",'"':""","'":"'"}[e]})):""}var r=i("#single-select-box").find("option").map((function(){return this.textContent})).get(),l=i("#multiple-select-box").find("optgroup").map((function(){return{text:this.getAttribute("label"),children:i(this).find("option").map((function(){return{id:parseInt(this.getAttribute("value"),10),text:this.textContent}})).get()}})).get(),s=i("#multiple-select-box").find("option").map((function(){return{id:this.textContent,timezone:this.getAttribute("data-timezone")}})).get(),o=i.fn.selectivity.transformText;function u(e){var t,i=e.selectivity,n=e.term,l=e.offset||0;if("single-input-with-submenus"===i.$el.attr("id")){if(!i.dropdown)return void e.callback({more:!1,results:[]});var u=i.dropdown.highlightedResult.id;t=s.filter((function(e){return o(e.id).indexOf(o(n))>-1&&e.timezone===u})).map((function(e){return e.id}))}else t=r.filter((function(e){return o(e).indexOf(o(n))>-1}));t.sort((function(e,t){e=o(e),t=o(t);var i=e.slice(0,n.length)===n,r=t.slice(0,n.length)===n;return i?r&&e>t?1:-1:r?1:e>t?1:-1})),setTimeout((function(){e.callback({more:t.length>l+10,results:t.slice(l,l+10)})}),500)}i(".single-input").selectivity({allowClear:!0,placeholder:"No city selected",query:u,searchInputPlaceholder:"Type to search a city"}),i(".single-input-without-search").selectivity({allowClear:!0,items:r,placeholder:"No city selected"}),i(".single-input-with-labels").selectivity({allowClear:!0,items:l,placeholder:"No city selected",searchInputPlaceholder:"Type to search a city"});var a={query:u,showSearchInput:!0};i(".single-input-with-submenus").selectivity({allowClear:!0,items:[{text:"Western European Time Zone",id:"+00:00",submenu:a},{text:"Central European Time Zone",id:"+01:00",submenu:a},{text:"Eastern European Time Zone",id:"+02:00",submenu:a}],placeholder:"No city selected",showSearchInputInDropdown:!1}),i(".multiple-input").selectivity({multiple:!0,placeholder:"Type to search cities",query:u}),i(".tags-input").selectivity({items:["red","green","blue"],multiple:!0,tokenSeparators:[" "],value:["brown","red","green"]}),i(".emails-input").selectivity({inputType:"Email",placeholder:"Type or paste email addresses"}),i(".single-select-box").selectivity(),i(".multiple-select-box").selectivity(),i(".repository-input").selectivity({ajax:{url:"https://api.github.com/search/repositories",dataType:"json",minimumInputLength:3,quietMillis:250,params:function(e,t){return{q:e,page:1+Math.floor(t/30)}},processItem:function(e){return{id:e.id,text:e.name,description:e.description}},results:function(e,t){return{results:e.items,more:e.total_count>t+e.items.length}}},placeholder:"Search for a repository",templates:{resultItem:function(e){return'