text: /*! 
   * tcd-advanced-searchbox v1.2.5
   * https://github.com/TheCodeDestroyer/tcd-advanced-searchbox
   * Copyright (c) 2015 Nace Logar http://thecodedestroyer.com/
   * License: MIT
   */
  !function(){"use strict";angular.module("tcd-advanced-searchbox",[]).directive("tcdAdvancedSearchbox",function(){return{restrict:"E",scope:{model:"=ngModel",parameters:"="},replace:!0,templateUrl:"tcd-advanced-searchbox.html",controller:["$scope","$attrs","$element","$timeout","$filter",function(a,b,c,d,e){function f(){angular.forEach(a.model,function(b,c){if("query"===c)a.searchQuery=b;else{var d=e("filter")(a.parameters,function(a){return a.key===c})[0];void 0!==d&&a.addSearchParam(d,b,!1)}})}function g(){i&&d.cancel(i),i=d(function(){a.model={},a.searchQuery.length>0&&(a.model.query=a.searchQuery),angular.forEach(a.searchParams,function(b){void 0!==b.value&&b.value.length>0&&(_.isEmpty(a.model[b.key])&&(a.model[b.key]=[]),a.model[b.key].push({searchValue:b.value,type:b.type,equality:b.equality.value}))})},500)}function h(a){if(!a)return 0;if("number"==typeof a.selectionStart)return"backward"===a.selectionDirection?a.selectionStart:a.selectionEnd;if(document.selection){a.focus();var b=document.selection.createRange(),c=document.selection.createRange().text.length;return b.moveStart("character",-a.value.length),b.text.length-c}return 0}a.placeholder=b.placeholder||"Search ...",a.searchParams=[],a.searchQuery="",a.setSearchFocus=!1,a.equalityChoices=b.equalityChoices?b.equalityChoices:[{value:"Eq",text:"Equal"},{value:"Neq",text:"Not equal"},{value:"Lt",text:"Lower"},{value:"Gt",text:"Greater"},{value:"Lte",text:"Equal or Lower"},{value:"Gte",text:"Equal or Greater"},{value:"Con",text:"Contains"}],a.$watch("searchQuery",function(){g()}),a.$watch("searchParams",function(){g()},!0),a.enterEditMode=function(b){if(void 0!==b){var c=a.searchParams[b];c.editMode=!0}},a.leaveEditMode=function(b){if(void 0!==b){var c=a.searchParams[b];c.editMode=!1,c.value||a.removeSearchParam(b)}},a.typeaheadOnSelect=function(b,c,d){a.addSearchParam(b),a.searchQuery=""},a.addSearchParam=function(b,c,d){void 0===d&&(d=!0),b.equality||(b.equality=a.equalityChoices[0]),a.searchParams.push({key:b.key,name:b.name,equality:b.equality,type:b.type,placeholder:b.placeholder,value:c||"",editMode:d})},a.removeSearchParam=function(b){void 0!==b&&a.searchParams.splice(b,1)},a.removeAll=function(){a.searchParams=[],a.searchQuery=""},a.editPrevious=function(b){void 0!==b&&a.leaveEditMode(b),b>0?a.enterEditMode(b-1):a.searchParams.length>0&&a.enterEditMode(a.searchParams.length-1)},a.editNext=function(b){void 0!==b&&(a.leaveEditMode(b),b<a.searchParams.length-1?a.enterEditMode(b+1):a.setSearchFocus=!0)},a.keydown=function(b,c){var d=[8,9,13,37,39];if(-1!==d.indexOf(b.which)){var e=h(b.target);8==b.which?0===e&&a.editPrevious(c):9==b.which?b.shiftKey?(b.preventDefault(),a.editPrevious(c)):(b.preventDefault(),a.editNext(c)):13==b.which?a.editNext(c):37==b.which?0===e&&a.editPrevious(c):39==b.which&&e===b.target.value.length&&a.editNext(c)}},void 0===a.model?a.model={}:f();var i}]}}).directive("tcdSetFocus",["$timeout","$parse",function(a,b){return{restrict:"A",link:function(c,d,e){var f=b(e.tcdSetFocus);c.$watch(f,function(b){b===!0&&a(function(){d[0].focus()})}),d.bind("blur",function(){c.$apply(f.assign(c,!1))})}}}]).directive("tcdAutoSizeInput",[function(){return{restrict:"A",scope:{model:"=ngModel"},link:function(a,b){function c(){e.text(b.val()||b.attr("placeholder")),b.css("width",e.outerWidth()+10)}var d=angular.element('<div style="position: fixed; top: -9999px; left: 0px;"></div>'),e=angular.element('<span style="white-space:pre;"></span>'),f="none"===b.css("maxWidth")?b.parent().innerWidth():b.css("maxWidth");b.css("maxWidth",f),angular.forEach(["fontSize","fontFamily","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","boxSizing","borderLeftWidth","borderRightWidth","borderLeftStyle","borderRightStyle","paddingLeft","paddingRight","marginLeft","marginRight"],function(a){e.css(a,b.css(a))}),angular.element("body").append(d.append(e)),c(),a.model?a.$watch("model",function(){c()}):b.on("keypress keyup keydown focus input propertychange change",function(){c()})}}}])}(),angular.module("tcd-advanced-searchbox").run(["$templateCache",function(a){"use strict";a.put("tcd-advanced-searchbox.html",'<div class=advancedSearchBox ng-class="{ active: focus }" ng-init="focus = false"><i ng-show="searchParams.length < 1 && searchQuery.length === 0" class="search-icon fa fa-search"></i> <a ng-href="" ng-show="searchParams.length > 0 || searchQuery.length > 0" ng-click=removeAll() role=button><i class="remove-all-icon fa fa-trash-o"></i></a><div><div class=search-parameter ng-repeat="searchParam in searchParams"><a ng-href="" ng-click=removeSearchParam($index) role=button><i class="remove fa fa-trash-o"></i></a><div class=key>{{ searchParam.name }}</div><div class=value><span ng-show=!searchParam.editMode ng-click=enterEditMode($index)>{{ searchParam.value }}</span><div class=dropdown ng-show="searchParam.value && !searchParam.editMode"><button class="btn btn-default dropdown-toggle" type=button id=dropdownMenu1 data-toggle=dropdown aria-expanded=true style="line-height: 3px">{{ searchParam.equality.text }} <span class=caret></span></button><ul class=dropdown-menu role=menu aria-labelledby=dropdownMenu1><li ng-repeat="equalityChoice in equalityChoices" role=presentation><a role=menuitem tabindex=-1 ng-click="searchParam.equality = equalityChoice">{{ equalityChoice.text }}</a></li></ul></div><input name=value tcd-auto-size-input tcd-set-focus=searchParam.editMode ng-keydown="keydown($event, $index)" ng-blur=leaveEditMode($index) ng-show=searchParam.editMode ng-model=searchParam.value placeholder="{{ searchParam.placeholder }}"></div></div><input name=searchbox class=search-parameter-input tcd-set-focus=setSearchFocus ng-keydown=keydown($event) placeholder="{{ placeholder }}" ng-focus="focus = true" ng-blur="focus = false" typeahead-on-select="typeaheadOnSelect($item, $model, $label)" typeahead="parameter as parameter.name for parameter in parameters | filter:{name:$viewValue} | limitTo:8" ng-model="searchQuery"></div><div class=search-parameter-suggestions ng-show="parameters && focus"><span class=title>Parameter Suggestions:</span> <span class=search-parameter ng-repeat="param in parameters | limitTo:8" ng-mousedown=addSearchParam(param)>{{ param.name }}</span></div></div>')}]);