(function(e){var t={method:"GET",contentType:"json",queryParam:"name",searchDelay:300,minChars:1,propertyToSearch:"name",jsonContainer:null,hintText:"Type in a search term",noResultsText:"No results",searchingText:"Searching...",deleteText:"×",animateDropdown:true,tokenLimit:null,tokenDelimiter:",",preventDuplicates:false,tokenValue:"id",prePopulate:null,processPrePopulate:false,idPrefix:"token-input-",resultsFormatter:function(e){return"
  • "+e[this.propertyToSearch]+"
  • "},tokenFormatter:function(e){return"
  • "+e[this.propertyToSearch]+"

  • "},onResult:null,onAdd:null,onDelete:null,onReady:null};var n={tokenList:"token-input-list",token:"token-input-token",tokenDelete:"token-input-delete-token",selectedToken:"token-input-selected-token",highlightedToken:"token-input-highlighted-token",dropdown:"token-input-dropdown",dropdownItem:"token-input-dropdown-item",dropdownItem2:"token-input-dropdown-item2",selectedDropdownItem:"token-input-selected-dropdown-item",inputToken:"token-input-input-token"};var r={BEFORE:0,AFTER:1,END:2};var i={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUMPAD_ENTER:108,COMMA:188};var s={init:function(n,r){var i=e.extend({},t,r||{});return this.each(function(){e(this).data("tokenInputObject",new e.TokenList(this,n,i))})},clear:function(){this.data("tokenInputObject").clear();return this},add:function(e){this.data("tokenInputObject").add(e);return this},remove:function(e){this.data("tokenInputObject").remove(e);return this},get:function(){return this.data("tokenInputObject").getTokens()}};e.fn.tokenInput=function(e){if(s[e]){return s[e].apply(this,Array.prototype.slice.call(arguments,1))}else{return s.init.apply(this,arguments)}};e.TokenList=function(t,s,o){function x(){if(o.tokenLimit!==null&&f>=o.tokenLimit){p.hide();D();return}}function T(){if(h===(h=p.val())){return}var e=h.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">");E.html(e);p.width(E.width()+30)}function N(e){return e>=48&&e<=90||e>=96&&e<=111||e>=186&&e<=192||e>=219&&e<=222}function C(t){var n=o.tokenFormatter(t);n=e(n).addClass(o.classes.token).insertBefore(b);e(""+o.deleteText+"").addClass(o.classes.tokenDelete).appendTo(n).click(function(){M(e(this).parent());d.change();return false});var r={id:t.id};r[o.propertyToSearch]=t[o.propertyToSearch];e.data(n.get(0),"tokeninput",t);a=a.slice(0,m).concat([r]).concat(a.slice(m));m++;_(a,d);f+=1;if(o.tokenLimit!==null&&f>=o.tokenLimit){p.hide();D()}return n}function k(t){var n=o.onAdd;if(f>0&&o.preventDuplicates){var r=null;y.children().each(function(){var n=e(this);var i=e.data(n.get(0),"tokeninput");if(i&&i.id===t.id){r=n;return false}});if(r){L(r);b.insertAfter(r);return}}if(o.tokenLimit==null||fm)i--;t.remove();v=null;p.focus();a=a.slice(0,i).concat(a.slice(i+1));if(i"+o.searchingText+"

    ");P()}}function B(){if(o.hintText){w.html("

    "+o.hintText+"

    ");P()}}function j(e,t){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1")}function F(e,t,n){return e.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+t+")(?![^<>]*>)(?![^&;]+;)","g"),j(t,n))}function I(t,n){if(n&&n.length){w.empty();var r=e("