define(["require","jquery.tiny","angular","jquery.vclick","angularElementScroll","angularAnimate","angularElement","polyfills","jquery.ripple"],function(e){e(["nouislider"]);var t=e("polyfills"),n=e("angular"),i=e("jquery.tiny"),r=t.isEmpty,o=t.String.isEmpty,l=t.Number.isNumber,a=t.Number.toNumber,s=e("jquery.ripple");Number.prototype.formatMoney=function(e,n,i,r){return t.Number.formatMoney(this,e,n,i,r)},n.module("extra",["duScroll"]).constant("date",t.Date).constant("$viewport",function(){var e={},t={},i={body:n.element(document).cssSelect("#viewport").eq(0),data:function(t,n){if(void 0==n)return e[t];e[t]=n},scrolling:!1,scrollTop:function(e){if(void 0==e)return this.body.prop("scrollTop");this.body.prop("scrollTop",e)},scrollStop:function(e){setTimeout(function(){for(var t=i.data("scrollTop");i.scrollTop()!=t;)i.scrollTop(t);e&&e()})},scrollHeight:function(){return this.body.prop("scrollHeight")},scrollTopFixed:function(e,t){var n,r=function(e){i.scrollTop()!==n&&i.scrollTop(n),e.preventDefault(),e.stopImmediatePropagation()};n=t||this.scrollTop(),this.body.off("scroll",r),e&&this.body.on("scroll",r)},setBody:function(e){i.body=e},setup:function(){i.data("scrollTop",0),i.body.on("scroll",function(){i.data("scrollTop",i.scrollTop()),n.element(document).trigger("scrolling")})},scrollSave:function(e){t.scrl=void 0!==e?e:this.body.prop("scrollTop")},scrollRestore:function(){this.data("scrollTo",t.scrl||1),t.scrl=1}};return i}()).run(["$viewport","$rootScope",function(e,t){e.setup()}]).directive("ngDropdown",["$timeout","$viewport","$document","$rootScope",function(e,i,r,o){return{restrict:"A",scope:{modelValue:"=ngModel",disabled:"=disabled",listItems:"=?ngDrpListItems",afterSelect:"=?ngDrpAfterSelect",onSelect:"=?ngDrpOnSelect",tabindex:"=?ngDrpTabindex",labelId:"=?ngDrpLabelId"},transclude:!0,template:'<span tabindex="{{tabindex || 0}}" role="button" aria-haspopup="listbox" aria-expanded="{{list_opened}}" class="{{selected_class}}" ng-if="!no_select && !empty_select && !disabled" ng-aria-label="label_value" hm-highlight data-sel-id="dropdown-selected">{{display_value}}</span><span tabindex="{{tabindex || 0}}" role="button" aria-haspopup="listbox" aria-expanded="{{list_opened}}" class="{{placeholder_class}}" ng-if="(no_select || empty_select) && placeholder && !disabled"  hm-highlight>{{placeholder}}</span><span tabindex="0" role="text" class="{{selected_class}}" ng-if="disabled" data-sel-id="dropdown-selected">{{display_value || placeholder}}</span><ul aria-labelledby="{{list_label}}" aria-activedescendant="{{activedescendant}}" role="listbox" tabindex="0" class="ng-animate-enabled basic-trans ng-hide" ng-class="[list_class,{ fast: !$root.isAndroid, enter : !$root.isAndroid }]" ng-show="list_opened" ng-keydown="ListOnKey($event)" hm-tap="preventEv($event)" hm-options="{ ripple: false, delay : 0 }"><li ng-attr-id="{{optionid+\'-\'+$index}}" ng-attr-aria-selected="{{value == display_value || false}}" role="option" ng-class="[item_class,{ active : value == display_value  }]" ng-repeat="value in displayList track by $index" hm-tap="select($event,value,$index)" hm-options="{ ripple: false, delay : 0 }" ng-focus-when="(!(no_select || empty_select) && display_value == value) || ((no_select || empty_select) && $index == 0)" ng-bind-html="value" ng-aria-label="labelList[$index]" data-sel-id="dropdown-item"></li></ul>',compile:function(l,a){return{pre:function(e,t,n){var i=e.$eval(n.ngDropdown)||{};e.list_opened=!1,e.preventEv=function(e){e.stopPropagation()},e.displayList=[];var r=void 0!==i.arrowClass?i.arrowClass:"ng-dropdown-arrow bf-icon-down-open";r&&t.append('<span class="'+r+'" tabindex="-1" aria-hidden="true"></span>')},post:function(l,a,s){var c=l.$eval(s.ngDropdown)||{},u=[],d=[],f=null,p={ENTER:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},v=0;l.activedescendant=null,l.optionid=t.uniqid("option-"),l.$watch("listItems",function(e){d=e||[],u=[],l.displayList=[],l.labelList=[];for(var i in d)n.isArray(d[i])?(u[i]=d[i][1],n.isArray(d[i][0])?(l.displayList[i]=d[i][0][0],l.labelList[i]=d[i][0][1]):(l.displayList[i]=d[i][0],l.labelList[i]=d[i][0])):(u[i]=d[i],l.displayList[i]=d[i],l.labelList[i]=d[i]);t.Array.forEach(l.displayList,function(e,t){if(l.display_value==e)return l.activedescendant=l.optionid+"-"+t.toString(),v=t,l.label_value=(f?f+". ":"")+l.labelList[t],!1}),l.activedescendant||(l.activedescendant=l.optionid+"-0",v=0)},!0),l.$watch(s.ngDropdown,function(e){if(e=l.$eval(s.ngDropdown)||{},!l.listItems&&e.list){d=e.list||[],u=[],l.displayList=[],l.labelList=[];for(var t in d)n.isArray(d[t])?(u[t]=d[t][1],l.displayList[t]=d[t][0],n.isArray(d[t][0])?(l.displayList[t]=d[t][0][0],l.labelList[t]=d[t][0][1]):(l.displayList[t]=d[t][0],l.labelList[t]=d[t][0])):(u[t]=d[t],l.displayList[t]=d[t],l.labelList[t]=d[t])}if(l.list_label=l.labelId||e["list-label-id"]||"",l.list_class=e.listClass||"ng-dropdown-list",l.item_class=e.itemClass||"ng-dropdown-item",l.placeholder_class=e.placeholderClass||"ng-dropdown-placeholder",l.selected_class=e.selectedClass||"ng-dropdown-selected",l.no_select=void 0!==e.noSelect&&e.noSelect,l.placeholder=void 0!==e.placeholder?e.placeholder:"Choose",l.change_list_position=e.changeListPosition,null==f)if(e.listTitle)f=e.listTitle;else if(l.list_label){var i=document.querySelector("#"+l.list_label);i&&(f=i.textContent)}},!0),l.$watch("modelValue",function(e){var t,i,r=u.indexOf(e);r>-1?(t=l.displayList[r],i=l.labelList[r],l.label_value=(f?f+". ":"")+i,n.equals(l.display_value,t)||(l.display_value=t),l.empty_select=!1):l.empty_select=!0,l.list_opened=!1,l.afterSelect&&l.afterSelect(t,r,e);var o=l.$eval(s.ngDropdown)||{};o.afterSelect&&o.afterSelect(t,r,e)});var g;l.$watch("list_opened",function(n){e.cancel(g);var o=a.find("ul"),s=c.offsetParent?a.find("ul").parents(c.offsetParent).prop("scrollHeight"):i.body.prop("scrollHeight"),u=c.offsetParent?a.find("ul").parents(c.offsetParent).prop("clientWidth"):i.body.prop("clientWidth");g=e(function(){if(n){if(l.change_list_position){var e=0,i=t.Number.toNumber(u)-(a.offset().left+a.prop("clientWidth")),d=o.prop("clientWidth");a.prop("clientWidth")+i<d&&(e=a.prop("clientWidth")+i-d-15),o.css({left:e+"px"})}var f=o.offset(!!c.offsetParent&&a.find("ul").parents(c.offsetParent)).top+o.prop("offsetHeight");s<f?o.addClass("upwards"):o.removeClass("upwards"),r.one("vclick",m),r.one("click",m)}else o.removeClass("upwards"),r.off("vclick",m),r.off("click",m)},50)});var h=!1;l.select=function(t,n,i){h=!0;var r=u[i],c=l.labelList[i];l.display_value=n,l.label_value=(f?f+". ":"")+c,l.modelValue=r,a[0].querySelector('[aria-haspopup="listbox"]').focus(),setTimeout(function(){a[0].querySelector('[aria-haspopup="listbox"]').focus()}),e(function(){l.onSelect&&l.onSelect(n,i,r);var e=l.$eval(s.ngDropdown)||{};e.onSelect&&e.onSelect(n,i,r),l.list_opened=!1},o.isAndroid?1:100),v=i,l.activedescendant=l.optionid+"-"+v,t&&t.stopPropagation(),setTimeout(function(){h=!1},50)},l.indexSelect=function(e){l.display_value=l.displayList[e],l.label_value=(f?f+". ":"")+l.labelList[e],l.modelValue=u[e]};var m=function(e){l.$applyAsync(function(){l.list_opened=!1})};a.on("vclick",function(t){l.disabled||(t.stopPropagation(),e(function(){if(!h){var t=l.$eval(s.ngDropdown)||{};if(!1===t.enabled)return!1;l.list_opened||t.noBubble||r.trigger("vclick"),e(function(){l.list_opened=!l.list_opened},i.data("android")?200:0)}}))}),l.ListOnKey=function(e){var n=e.keyCode;switch(n){case p.ENTER:i=v;t.Number.isNumber(i)&&l.select(null,l.displayList[i],i);break;case p.UP:case p.DOWN:var i=v;v=n==p.DOWN?i<l.displayList.length-1?i+1:0:i>0?i-1:l.displayList.length-1,l.activedescendant=l.optionid+"-"+v,e.preventDefault()}};var $=function(){r.off("vclick",m),a.off("vclick"),a.off("keydown")};l.$on("$destroy",$),a.one("$destroy",$)}}}}}]).directive("ngSlider",["$document",function(n){return{restrict:"AE",require:"ngModel",link:function(n,i,r,o){var s=i[0],c=!1,u=r.ngModel;e(["nouislider"],function(e){var d=n.$watch(r.ngSlider,function(i){var r=t.Object.assign({start:0,step:1,orientation:"horizontal",connect:"lower",range:{min:0,max:100}},i||{});r.range.min||(r.range.min=0),s.noUiSlider&&s.noUiSlider.destroy(),e.create(s,r),s.noUiSlider.off("slide"),s.noUiSlider.on("slide",function(){c=!0}),s.noUiSlider.off("change"),s.noUiSlider.on("change",function(e){c=!1,n.$applyAsync(function(){o.$setViewValue(a(e[0])),o.$render()})}),s.noUiSlider.set(n.$eval(u))},!0),f=n.$watch(r.ngModel,function(e){c||s.noUiSlider&&s.noUiSlider.set(l(e)?e:0)});i.one("$destroy",function(){d(),f(),s.noUiSlider&&s.noUiSlider.destroy()})})}}}]).directive("ngHtmlContent",["$compile","$injector","$timeout","$parse",function(e,t,n,i){return{restrict:"A",link:function(r,o,l){r.$watch(l.ngHtmlContent,function(a,s){var c;t.has("$sanitize")?t.invoke(["$sanitize",function(e){var t=r.$eval(l.ngHtmlSanitize);c=t?e(a):a}]):c=a;var u=i(l.ngHtmlContentBefore).bind(null,r),d=i(l.ngHtmlContentAfter).bind(null,r);u({$element:o[0]}),o.html(c),e(o.contents())(r),n(function(){d({$element:o[0]})})})}}}]).directive("ngSrcSafe",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngSrcSafe,function(e){t[0].setAttribute("src",e)})}}}).directive("ngNoAutoFocus",["$timeout",function(e){return{restrict:"A",compile:function(t,n){return{pre:function(e,t,n){t.attr("readonly","true")},post:function(t,n,i){e(function(){n.removeAttr("readonly")},500)}}}}}]).directive("ngFocusWhen",["$timeout",function(e){return{restrict:"A",link:function(e,t,n){var i=e.$eval(n.ngFocusClick);e.$watch(n.ngFocusWhen,function(e){e&&(i&&t[0].click(),t[0].focus(),setTimeout(function(){i&&t[0].click(),t[0].focus()}))})}}}]).directive("ngFocusToggle",function(){return{restrict:"A",scope:{flag:"=ngFocusToggle"},link:function(e,t,n){function i(){e.$applyAsync(function(){e.flag=!0})}function r(){e.$applyAsync(function(){e.flag=!1})}t.on("focus",i),t.on("blur",r),e.$on("$destroy",function(){t.off("focus",i),t.off("blur",r)})}}}).directive("ngTabNext",["$timeout",function(e){return{restrict:"A",link:function(e,i,r){var o=function(o){if(8==o.keyCode)return!1;var l=t.String.trim(i.val()).length,s=e.$eval(r.ngTabNext),c=(s.length||a(i.attr("maxlength")))<=l,u=n.element().cssSelect(s.selector);c&&u.focus().caret(0)};i.on("keyup",o),e.$on("$destroy",function(){i.off("keyup",o)})}}}]).directive("ngTabPrevious",["$timeout",function(e){return{restrict:"A",link:function(e,i,r){var o=function(o){var l=e.$eval(r.ngTabPrevious),a=n.element().cssSelect(l.selector),s=t.String.trim(i.val()).length;8==o.keyCode&&(0==s||i.caret()<=0)&&a.focus().caret(a.val().length)},l=function(o){var l=e.$eval(r.ngTabPrevious),a=n.element().cssSelect(l.selector),s=t.String.trim(i.val()).length;8==o.keyCode&&0==s&&0==s&&a.focus().caret(a.val().length)};i.on("keyup",o).on("keydown",l),e.$on("$destroy",function(){i.off("keyup",o).off("keydown",l)})}}}]).directive("ngTabOnEnter",["$timeout",function(e){return{restrict:"A",link:function(e,t,i){var r=function(r){if(r.preventDefault(),13===r.keyCode){var o=e.$eval(i.ngTabOnEnter),l=n.element().cssSelect(o.selector);return t[0].blur(),setTimeout(function(){l&&l.focus()},700),!1}};t.on("keyup",r),e.$on("$destroy",function(){t.off("keyup",r)})}}}]).directive("ngTogglePassword",["$animate","$viewport","$compile","$document","$window","$timeout",function(e,t,i,r,o,l){return{restrict:"A",scope:{onShow:"=?ngShow",onHide:"=?ngHide"},link:function(e,t,i){function r(e){l(function(){e.target&&e.target.value?c():a&&a.css("visibility","hidden")})}t.append("<span class='ng-toggle-btn-pass semi-bold-font' style='visibility:hidden;'>show</span>"),t.css({position:"relative"});var a=t.find(".ng-toggle-btn-pass"),s=t.find("input[type='password']");a&&a.css("visibility","hidden"),s&&s.css({"padding-right":"55px"});var c=function(){l(function(){if(a&&s){var e=s.outerHeight(),t=s.position().top,n=s.outerWidth()+s.position().left-55;a.css({position:"absolute","font-size":"13px",right:"auto",display:"block",width:"55px",height:e+"px","line-height":e-2+"px",top:t+"px",left:n+"px",cursor:"pointer","text-align":"center"}),s&&!s.val()?a&&a.css("visibility","hidden"):a.css("visibility","")}})};c(),n.element(o).on("resize",c),s&&s[0]&&s[0].addEventListener("input",r,!0),e.$watch("onShow",function(e){e&&c()}),e.$watch("onHide",function(e){e||c()}),a.on("vclick",function(e){s&&"password"==s.attr("type")?(s.attr("type","text"),a.prop("innerHTML","hide")):s&&(s.attr("type","password"),a.prop("innerHTML","show"))});var u=function(){n.element(o).off("resize",c),a&&(a.off("vclick"),a.remove()),s&&s[0]&&s[0].removeEventListener("input",r),t.off("vclick"),a=void 0};e.$on("$destroy",u),t.one("$destroy",u)}}}]).directive("ngToolTip",["$animate","$viewport","$compile","$document","$window","$timeout",function(e,t,i,r,o,c){return{restrict:"A",scope:{open_flag:"=?ngToolTipToggle",tipcontent:"=?ngToolTip"},link:function(u,d,f){var p=document.createElement("div"),v=n.element(p),g=n.merge({ripple:!0,width:400,offsetParent:t.body,offset:{top:0,left:0},class:"ng-tooltip",closeClass:"close-bt bf-icon-cross",preventDef:!1},u.$eval(f.ngToolTipOptions)),h=g.offsetParent,m="string"==typeof h?n.element(document).cssSelect(h):h,$=g.useparent?d.parent():m;v.addClass(g.class).addClass("ng-animate-enabled").append('<div class="tail"></div><div tooltip-content-holder></div><div class="'+g.closeClass+'"></div>');var b=v.children("div").eq(2);b.css({"touch-action":"manipulation","-webkit-user-select":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),b.attr("role","button"),b.attr("aria-label","Close Popup"),b.attr("tabindex","0"),d.css({"touch-action":"manipulation","-webkit-user-select":"none","-webkit-user-drag":"none","-webkit-tap-highlight-color":"rgba(0, 0, 0, 0)"}),"static"==d.getStyle("position")&&d.css("position","relative");var y=function(e){e.preventDefault(),e.stopPropagation()},w=function(){u.$applyAsync(function(){v&&e.leave(v),g.onClose&&g.onClose(),A=!1,u.open_flag=!1})},A=!1;t.data("android")&&g.ripple&&s.add(d,!0),d.on("vclick",function(s){var p=u.$eval(f.ngToolTipEnabled);void 0==p&&(p=!0),p&&(s.stopPropagation(),g.preventDef&&s.preventDefault(),c(function(){if(A)return A=!1,w(),!1;A=!0,r.trigger("vclick"),u.open_flag=!0;var s=document.createElement("div");s.setAttribute("tooltip-content",""),s.setAttribute("class","content"),n.element(s).prop("innerHTML",u.tipcontent);var c=i(n.element(s))(u.$parent);v.cssSelect("[tooltip-content-holder]").after(c),v.cssSelect("[tooltip-content-holder]").remove(),n.forEach(v.find("input"),function(e,t,n){n.data("disabled",n.attr("disabled")),n.attr("disabled","disabled")}),v.css({width:"0px",left:"-999px",top:"-999px"}),e.on("leave",v,function(e,t){v&&(v.off("vclick"),v.find(".close-bt").off("vclick")),r.off("vclick",w),n.element(o).off("resize",w),v.cssSelect("[tooltip-content]").after("<div tooltip-content-holder></div>"),v.cssSelect("[tooltip-content]").remove()}),e.on("enter",v,function(e,i){if(v&&"start"==i&&(n.element(o).one("resize",w),setTimeout(function(){var e=m.prop("scrollHeight");if(function(){if(m.css("overflow-y","scroll"),v){v.css({width:g.width+"px"});var e,i=Math.min(d.offset(parent).left+g.offset.left,m.prop("clientWidth")-v.prop("offsetWidth")-15);i<15?(e=g.width+(i-15),i=15):e=g.width;var r=d[0].getBoundingClientRect(),o=r.top+m.prop("scrollTop");if(g.useparent){var s=d[0].parentNode;o=s.offsetHeight+g.offset.top,i=s.offsetWidth+g.offset.left}else{if(m.is("body")&&!g.useparent){var c=d[0].offsetParent;for(o=r.top;c;)o+=n.element(c).prop("scrollTop"),c=c.offsetParent}var u=a(m.css("border-top-width"));l(u)||(u=0),o-=u;var f=a(t.body.css("padding-top"));l(f)||(f=0),o-=f}var p=Math.min(o+d.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15);!g.useparent&&m.is("body")&&p<d.offset().top?p=Math.min(d.offset().top+d.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15):p<o&&(p=Math.min(o+d.prop("offsetHeight")+g.offset.top,m.prop("scrollHeight")-15)),v.css({width:e+"px",left:i+"px",top:p+"px"}),m.css("overflow-y","")}}(),m.prop("scrollHeight")>e&&v.css({top:v.getStyle("top",!0)-(m.prop("scrollHeight")-e+15)+"px"}),v&&v[0]){var i=v[0].getBoundingClientRect(),r=i.left+i.width,o=v.getStyle("left",!0);r>window.innerWidth&&(o-=r-window.innerWidth+15),null!=o&&v.css({left:o+"px"})}}),v.attr("role","dialog"),v.attr("tabindex","0"),null!==g.role&&v&&v[0])){var r=v[0].querySelector("[tooltip-content]");r&&(r.setAttribute("role",g.role||"tooltip"),r.setAttribute("ng-speak","'header'"),r.setAttribute("tabindex","0"))}}),e.enter(v,$[0]||null,$[0]&&$[0].lastChild||null).then(function(){v&&(n.forEach(v.find("input"),function(e,t,n){n.data("disabled")?n.attr("disabled",n.data("disabled")):n.removeAttr("disabled")}),v.on("vclick",y),b.one("vclick",function(e){w(),y(e)}),r.one("vclick",w))})}))});var k=function(){v&&(v.off("vclick"),b.off("vclick",w),w(),e.off(v),v.remove()),r.off("vclick",w),n.element(o).off("resize",w),d.off("vclick"),s.remove(d),v=void 0,p=void 0,b=void 0};u.$on("$destroy",k),d.one("$destroy",k)}}}]).directive("ngAutocomplete",["$animate","$http","$q","$parse","$viewport","$document","$timeout","$injector",function(e,i,r,o,l,a,s,c){return{restrict:"A",scope:{key:"=ngKey",selectHandler:"=?ngAutoselect",progress:"=?ngAutoprogress",responseHandler:"=?ngAutoresponse",cancelHandler:"=?ngAutocanceled",autoDisplay:"=?ngAutodisplay",responseData:"=?ngAutoData",activedescendant:"=?ngAcActive",focusHandler:"=?ngAcHighlight",blurOnLimit:"=?ngAcBlurOnLimit",stopCall:"=?ngAcStopCall"},transclude:!0,template:'<ul tabindex="0" role="listbox" ng-attr-id="{{ listid || \'\' }}" class="ng-autocomplete-list ng-animate-enabled basic-trans enter fast ng-hide" ng-show="hasResult" ng-focus="GoToFirst(0)" ng-keydown="AcOnKey($event)" aria-labelledby="{{list_label}}" ng-aria-activedescendant="activedescendant"><li role="option" tabindex="-1" ng-attr-id="{{acid+\'-\'+$index}}" class="ng-autocomplete-item" data-ng-repeat="value in ul track by $index" hm-tap="select($event,$index)" ng-bind-html="value" aria-selected="false" ng-class="{\'selected\' : activedescendant == acid+\'-\'+$index}" ng-focus="GoToFirst($index)"></li></ul>',link:function(e,o,l){var u,d,f,p;u=n.extend({minlength:1,url:!1,list:"list",method:"GET",keyName:"key"},e.$eval(l.ngAutocomplete)),e.listid=u["list-id"]||"",e.list_label=u["list-label"]||"",e.select=function(t,n){e.key=e.list[0][n],d=e.key;var i=[t];for(var r in e.list)i.push(e.list[r][n]);e.selectHandler&&e.selectHandler.apply(this,i),f=!0,setTimeout(function(){f=!1,a.off("vclick",p)},100),e.hasResult=!1},d=e.key,p=function(t){e.$applyAsync(function(){e.hasResult=!1,e.$emit("$autocomplete:listdisplay",!1),e.cancelHandler&&!f&&e.cancelHandler()})};var v,g;e.$watch("key",function(t){if(e.stopCall)return e.hasResult=!1,void s.cancel(g);s.cancel(g),g=s(function(){if(e.progress=!1,e.autoDisplay=!1,!t||t.length<u.minlength||t==d)return v&&v.resolve(!0),void((!t||t.length<u.minlength)&&(e.hasResult=!1));d=t,v?v.resolve(!0):v=r.defer(),v=r.defer();var n={};n[u.keyName]=t;var o={url:u.url,method:u.method,timeout:v.promise,id:"auto-complete-list",events:!1,ignore_connection:!0,anonymous:!0,required:!1};"POST"==u.method?o.data=n:o.params=n,e.progress=!0;var l;c.has("$api")&&(i=c.get("$api").http,l=!0),(e.responseData?e.responseData(o):u.url?i(o):r.resolve({})).then(function(t){var n,i=l?t:t.data,r=e.responseHandler?e.responseHandler(i):i;e.ul=[],n=u.list.indexOf("|")>-1?u.list.split("|"):[u.list],e.ul=r[n[0]]||[],e.list=function(){for(var e=[],t=0,i=n.length;t<i;t++)e.push(r[n[t]]);return e}(),e.activedescendant=null,$=0,e.ul.length>0?e.hasResult=!0:e.hasResult=!1,e.progress=!1,e.$emit("$autocomplete:listdisplay",e.hasResult)},function(t){e.hasResult=!1,t.xhrStatus&&"abort"==t.xhrStatus||(e.progress=!1),e.$emit("$autocomplete:listdisplay",!1),e.ul=[]})},150)});var h=200;e.$watch("autoDisplay",function(t){t?e.ul&&e.ul.length>0&&s(function(){e.hasResult=!0,h=200}):h=0});var m={ENTER:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},$=0;e.GoToFirst=function(t){t&&($=t),e.activedescendant=e.acid+"-"+$,e.focusHandler&&e.focusHandler(null,e.ul[$])},e.activedescendant=null,e.acid=t.uniqid("ac-"),e.AcOnKey=function(n){var i=n.keyCode;switch(i){case m.ENTER:r=$;t.Number.isNumber(r)&&e.select(null,r);break;case m.UP:case m.DOWN:var r=$;if(i==m.DOWN){if(r<e.ul.length-1)$=r+1;else if($=0,e.blurOnLimit)return e.blurOnLimit(n),void(e.activedescendant=null)}else if(r>0)$=r-1;else if($=e.ul.length-1,e.blurOnLimit)return e.blurOnLimit(n),void(e.activedescendant=null);e.activedescendant=e.acid+"-"+$,e.focusHandler&&e.focusHandler(null,e.ul[$]),n.preventDefault()}},e.$watch("hasResult",function(e){setTimeout(function(){e&&(a.off("vclick",p),a.one("vclick",p))},h)}),e.$on("$destroy",function(){v&&v.resolve(!0),a.off("vclick",p),e.progress=!1})}}}]).directive("ngScrollTo",["$viewport","$parse","$timeout","$rootScope",function(e,t,i,r){return{restrict:"A",link:function(i,o,l){var s=l.ngScrollTo,c=l.ngScrollBefore,u=l.ngScrollAfter,d=i.$watch(s,function(e){e&&setTimeout(function(){(function(e){return!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)})(o[0])||o.triggerHandler("scrollToMeAnim")})}),f=function(){var t=n.merge({offset:0,parent:e.body},i.$eval(l.ngScrollOptions)),s="string"==typeof t.parent?"document"==t.parent?n.element().cssSelect("body"):n.element(document).cssSelect(t.parent):t.parent;t.offset+=a(s.css("border-top-width"));if(o[0].getBoundingClientRect().top<0&&t.offset==a(s.css("border-top-width"))&&r.isWeb){var c=document.querySelector("#viewport>header");c&&(t.offset=c.offsetHeight)}return t};o.on("scrollToMeAnim",function(){var r=f(),l="string"==typeof r.parent?"document"==r.parent?n.element(document):n.element(document).cssSelect(r.parent):r.parent;u&&(u=t(u).bind(null,i)),c&&i.$eval(c),void 0!==r.speed&&0==r.speed?(e.body.css("overflow-y","hidden"),l.duScrollToElement(o,r.offset,0).then(function(){var t=l.prop("scrollTop");i.$applyAsync(function(){u&&u({scrollY:t})}),e.body.css("overflow-y","")})):l.duScrollToElementAnimated(o,r.offset,void 0!==r.speed&&r.speed).then(function(){var e=l.prop("scrollTop");i.$applyAsync(function(){u&&u({scrollY:e})}),l.duScrollToElement(o,r.offset,0)})}),o.on("scrollToMe",function(){var e=f(),r=l.ngScrollBefore,a="string"==typeof e.parent?n.element(document).cssSelect(e.parent):e.parent;r&&i.$eval(r),u&&(u=t(u).bind(null,i)),a.duScrollToElement(o,e.offset,0).then(function(){var t=a.prop("scrollTop");i.$applyAsync(function(){u&&u({scrollY:t})}),a.duScrollToElement(o,e.offset,0)})});var p=function(){o.off("scrollToMeAnim"),o.off("scrollToMe"),d()};i.$on("$destroy",p),o.on("$destroy",p)}}}]).directive("ngScrollControl",["$animate",function(e){return function(t,i,r){e.on("enter",i,function(e,t){n.equals(i,e)&&"close"==t&&e.prev().triggerHandler("scrollToMe")});var o=function(){e.off(i)};t.$on("$destroy",o),i.on("$destroy",o)}}]).directive("ngScrollInView",["$parse","$timeout",function(e,t){return{restrict:"A",scope:{inView:"&ngScrollInView",offView:"&ngScrollOffView",offset:"<ngScrollOffset"},link:function(n,r,o){var l=e(n.inView),a=e(n.offView),s=function(){var e=n.offset||{},i=function(e,t){var n=e.getBoundingClientRect().top+(t?t.top||0:0),i=e.getBoundingClientRect().bottom+(t?t.bottom||0:0),r=e.getBoundingClientRect().height,o=window.innerHeight,l=Math.round(.45*o),a=Math.round(.55*o),s=r>Math.round(.45*o);return r>0&&(n>=0&&i<=o||s&&(i>=a&&i<=o||n>=0&&n<=l||n<=0&&i>=o))}(r[0],e);t(i?function(){l()}:function(){a()})},c=function(){i(window).off("scrollend",s)};r.one("$destroy",c),n.$on("$destroy",c),s(),i(window).on("scrollend",s)}}}]).directive("ngMaxChar",function(){return{require:"ngModel",link:function(e,t,n,i){function r(e){if(e.length>o){var t=e.substring(0,o);return i.$setViewValue(t),i.$render(),t}return e}var o=Number(n.ngMaxChar);i.$parsers.push(r),e.$on("$destroy",function(){i.$parsers.indexOf(r)>-1&&i.$parsers.splice(r,1)})}}}).directive("ngMin",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch(n.ngMin,function(){i.$setViewValue(i.$viewValue)});var o=function(t){var o=e.$eval(n.ngMin)||0;return!r(t)&&t<o?void i.$setValidity("ngMin",!1):(i.$setValidity("ngMin",!0),t)};i.$parsers.push(o),i.$formatters.push(o),e.$on("$destroy",function(){var e=i.$parsers.indexOf(o),t=i.$formatters.indexOf(o);e>-1&&i.$parsers.splice(o,1),t>-1&&i.$formatters.splice(o,1)})}}}).directive("ngMax",function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,i){e.$watch(n.ngMax,function(){i.$setViewValue(i.$viewValue)});var o=function(t){var o=e.$eval(n.ngMax)||1/0;return!r(t)&&t>o?void i.$setValidity("ngMax",!1):(i.$setValidity("ngMax",!0),t)};i.$parsers.push(o),i.$formatters.push(o),e.$on("$destroy",function(){var e=i.$parsers.indexOf(o),t=i.$formatters.indexOf(o);e>-1&&i.$parsers.splice(o,1),t>-1&&i.$formatters.splice(o,1)})}}}).directive("ngModelSum",function(){return{require:"?ngModelSumOptions",scope:{total:"=ngModelSum",options:"=ngModelSumOptions"},controller:["$scope",function(e){var t=[],i={min:-1/0,max:1/0};e.$watch("options",function(e){n.extend(i,e)},!0),this.register=function(n,r,o,l){t.push({ctrl:r,el:n,focused:!1});var a=t[t.length-1],s=function(){a.focused=!0},c=function(){a.focused=!1},u=function(){n.off("focus",s).off("blur",c),delete t[t.indexOf(a)]};n.on("focus",s).on("blur",c),n.one("$destroy",u),l.$watch(o,function(){a.focused&&(e.total=function(e){var n,r,o=0,l=i.max;for(var a in t)o+=isNaN(t[a].ctrl.$modelValue)?0:t[a].ctrl.$modelValue;if(o>l){o=l,r=0;for(var a in t)t[a].ctrl!=e?r+=t[a].ctrl.$modelValue:n=t[a];n&&(n.focused?(n.ctrl.$setViewValue(o-r),n.ctrl.$render(),n.el[0].blur(),setTimeout(function(){n.el[0].focus()})):(n.ctrl.$setViewValue(o-r),n.ctrl.$commitViewValue()))}return o}(r))}),e.$on("$destroy",u),l.$on("$destroy",u)},e.$on("$destroy",function(){i={},t=[]})}]}}).directive("ngSum",function(){return{require:["^ngModelSum","ngModel"],link:function(e,t,n,i){var r=i[0],o=i[1];r.register(t,o,n.ngModel,e)}}}).directive("onlyNumbers",function(){return{require:"ngModel",restrict:"A",link:function(e,t,n,i){var r=n.onlyNumbers;r="string"==r;var l=function(e){if(void 0==e)return"";var t=e.toString().trim();if(o(t))return"";var n=t.replace(/[^0-9]/g,"");return n!=t&&(i.$setViewValue(n),i.$render()),r?n:parseFloat(n)};i.$parsers.push(l),e.$on("$destroy",function(){i.$parsers.indexOf(l)>-1&&i.$parsers.splice(l,1)})}}}).directive("modelMatch",[function(){return{restrict:"A",require:"ngModel",link:function(e,t,i,r){e.$watch(function(){var t=e.$eval(i.ngModel),r=e.$eval(i.modelMatch);return n.equals(t,r)},function(e){r.$setValidity("match",e)})}}}]).directive("passMask",["$timeout",function(e){return{require:"ngModel",restrict:"A",link:function(t,i,r,o){var l,a,s,c=null,u=t.$eval(r.ngModel),d=t.$eval(r.passMask)||"•",f=function(e){e.preventDefault()};i.on("paste",f);var p=function(t){if(void 0==t)return"";if(a)return u;u=void 0!==u?u.toString():"",c&&(t.length,c.length),c=t;var r=t.toString(),f=i.caret(),p=r.substring(f-1,f),v=r.substring(0,f-1),g=r.substring(f),h=u.substring(0,v.length),m=u.substring(u.length-g.length),$=p;$==d&&($=""),u=h+$+m;var b=v.replace(/(.)/g,d)+p+g.replace(/(.)/g,d);s=function(){n.element(document.activeElement).is(i)&&i.caret(f),o.$setViewValue(b),o.$render(),n.element(document.activeElement).is(i)&&i.caret(f)},l&&(e.cancel(l),s());return(l=e(function(){a=!0,b=b.replace(/(.)/g,d),s()},1e3)).then(function(){a=!1}),u},v=function(){i.off("paste",f);var e=o.$parsers.indexOf(p);e>-1&&o.$parsers.splice(e,1)};o.$parsers.push(p),t.$on("$destroy",v),i.one("$destroy",v)}}}]).directive("customOnChange",function(){return{restrict:"A",link:function(e,t,n){var i=e.$eval(n.customOnChange);t.on("change",i),e.$on("$destroy",function(){t.unbind("change",i)}),t.one("$destroy",function(){t.off("change",i)})}}}).directive("ngComposed",["$parse",function(e){return{require:"ngModel",restrict:"A",link:function(t,n,i){t.$watch(i.ngComposed,function(n){e(i.ngModel).assign(t,n.join(""))})}}}]).directive("fallbackSrc",[function(){return{restrict:"A",link:function(e,t,n){t.on("error",function(){var i=e.$eval(n.fallbackSrc);t.attr("src",i),t.off("error")}),e.$on("$destroy",function(){t.off("error")})}}}]).directive("ngError",["$parse",function(e){return{restrict:"A",link:function(t,n,i){n.on("error",function(r){var o=e(i.ngError).bind(null,t);t.$applyAsync(function(){o({$event:r,$element:n})})})}}}]).directive("unfocusPlaceholder",[function(){return{restrict:"A",link:function(e,t,n){var i,r=function(){(i=t.attr("placeholder"))&&t.prop("placeholder","")},o=function(){t.prop("placeholder",i||"")};t.on("focus",r),t.on("blur",o),e.$on("$destroy",function(){t.off("focus",r),t.off("blur",o)})}}}]).directive("windowScroll",[function(){return{restrict:"A",link:function(e,t,i){var r=t.scrollEnd&&!t.data("hasScrollEnd")?t.scrollEnd():null,o=t.data("hasScrollEnd")?"scrollend":"scrollstop";t.on("scrollstart",function(){n.element(window).trigger("scrollstart")}),t.on(o,function(){n.element(window).trigger(o)}),t.on("$destroy",function(){t.off("scrollstart"),t.off(o);try{r&&(r.destroy(),r=null)}catch(e){}}),e.$on("$destroy",function(){t.off("scrollstart"),t.off(o);try{r&&(r.destroy(),r=null)}catch(e){}})}}}]).directive("ngObserve",["$parse",function(e){return{restrict:"A",priority:1e3,link:function(t,n,i){t.$watch(i.ngObserve,function(n){e(i.ngObserveDo).bind(null,t)({$value:n})})}}}]).directive("ngObserveAttr",["$parse",function(e){return{restrict:"A",priority:999,link:function(n,i,o){var l=o.ngObserveAttr,a=t.String.trim;t.String.isString(l)&&!r(l)&&(l=l.split(","),t.Array.isArray(l)&&n.$watch(function(){var e=!0;return t.Array.forEach(l,function(t){if(!n.$eval(o[a(t)]))return e=!1,!1}),e},function(t){e(o.ngObserveDo).bind(null,n)({$value:t})},!0))}}}]).directive("forceBlur",["$timeout",function(e){return{restrict:"A",link:function(t,n,i){e(function(){n.val().length>0&&n.triggerHandler("blur")})}}}]).directive("dateFieldCorrect",function(){return{require:"ngModel",restrict:"A",link:function(e,t,n,i){var r=function(e){if(void 0==e)return"";var t=e.toString().trim();if(o(t))return"";var n=t.replace(/[^0-9]/g,"");return 1==n.length&&parseFloat(n)>1&&(n="0"+n,i.$setViewValue(n),i.$render()),n};i.$parsers.push(r),e.$on("$destroy",function(){i.$parsers.indexOf(r)>-1&&i.$parsers.splice(r,1)})}}}).directive("ngHidden",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngHidden,function(e){e?t.attr("hidden","hidden"):t.removeAttr("hidden")})}}}).directive("ngFormOnChange",["$parse",function(e){return{require:"form",link:function(t,n,i){var r=e(i.formOnChange);n.on("change",function(){r(t)})}}}]).directive("ngGetElement",["$parse",function(e){return{restrict:"A",scope:!1,priority:1,link:function(t,n,i){e(i.ngGetElement).bind(null,t)({$element:n,$scope:t})}}}]).value("duScrollCancelOnEvents",!1).filter("truncate",function(){return function(e,t,n){if(void 0!==e)return isNaN(t)&&(t=10),n=n||"...",e.length<=t||e.length-n.length<=t?e:String(e).substring(0,t-n.length)+n}}).filter("capitalize",function(){return function(e){return t.String.capitalize(e)}}).directive("ngBindValue",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngBindValue,function(e){t.attr("value",e)})}}}).directive("ngScroll",["$parse",function(e){return{restrict:"A",link:function(t,n,i){n.on("scroll",function(){e(i.ngScroll).bind(null,t)({$event:n[0].scrollTop})})}}}]).directive("ngAriaHidden",function(){return{restrict:"A",link:function(e,t,n){var i=t.attr("tabindex"),r=e.$eval(n.ngAriaHidden);void 0===r||void 0===r?(t.attr("tabindex","-1"),t.attr("aria-hidden","true")):e.$watch(n.ngAriaHidden,function(e){e?(t.attr("tabindex","-1"),t.attr("aria-hidden","true")):(i?t.attr("tabindex",i):t.removeAttr("tabindex"),t.attr("aria-hidden","false"))})}}}).directive("ngAriaLabelledby",function(){return{restrict:"A",priority:100,link:function(e,n,r){function o(e){if("ngAriaHideText"in r)for(var t=n[0],o=0,l=t.childNodes.length;o<l;o++){var a=t.childNodes[o];if(3==a.nodeType){var s=document.createElement(r.ngAriaHideText||"p");i(s).addClass("inline"),a.after(s),s.appendChild(a),s.setAttribute("aria-hidden","true"),s.setAttribute("tabindex","-1")}else 1==a.nodeType&&(a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex","-1"))}}function l(e){var l=n.attr("aria-label"),a=l?l+". ":"";if("_self"==e||"_self_split"==e)if("ngAriaTextLinks"in r)!function(){for(var e=n[0],t=0,r=e.childNodes.length;t<r;t++){var o=e.childNodes[t];if(3==o.nodeType){var l=document.createElement("p");i(l).addClass("inline"),o.after(l),l.appendChild(o),l.setAttribute("aria-hidden","true"),l.setAttribute("tabindex","-1")}}var a=e.querySelector(".inline");a&&(a.setAttribute("aria-label",e.innerText),a.setAttribute("tabindex","0"),a.removeAttribute("aria-hidden"))}();else{if(n.attr("aria-label",a+n[0].innerText),"_self_split"==e){for(var s=[],c=0,u=n[0].childNodes.length;c<u;c++){var d=n[0].childNodes[c],f="";1==d.nodeType?d.hasAttribute("aria-label")?(f=t.String.trim(d.getAttribute("aria-label")),d.removeAttribute("aria-label")):f=t.String.trim(d.innerText):3==d.nodeType&&(f=t.String.trim(d.wholeText)),f&&s.push(f)}n.attr("aria-label",a+s.join(". "))}else n.attr("aria-label",a+n[0].innerText);o()}else{var p=document.getElementById(e);p&&n.attr("aria-label",a+p.innerText),o()}}var a=r.ngAriaLabelledbyDelay?e.$eval(r.ngAriaLabelledbyDelay):null,s=e.$eval(r.ngAriaLabelledby);"none"!==s&&(a?setTimeout(function(){l(s)},a):l(s))}}}).directive("ngRoleAlert",["$rootScope",function(e){return{restrict:"A",link:function(n,i,r){function o(){i.attr("tabindex","0"),e.isWeb?i[0].hasAttribute("aria-live")||(i.attr("aria-live","assertive"),i.attr("aria-atomic","true")):i.attr("role","alert")}var l=n.$eval(r.ngRoleAlert);if(t.isNullorUndefined(l))o();else var a=n.$watch(r.ngRoleAlert,function(e){e&&(o(),a())})}}}]).directive("ngAriaLive",function(){var e=navigator.userAgent,t=navigator.platform?navigator.platform:"";return{restrict:"A",link:function(n,i,r){i.addClass("a11y-visually-hidden");var o=null,l=null!=e.match(/Android/i)||t&&null!=t.match(/Android/i),a=n.$eval(r.liveType)||"assertive";i.attr("aria-live",a),i.attr("aria-atomic","true"),i.attr("role","status"),l&&(i.attr("aria-hidden","true"),i.attr("tabindex","-1")),n.$watch(r.ngAriaLive,function(e){clearTimeout(o),o=setTimeout(function(){i.prop("innerHTML",e||""),l?i.attr("aria-label",e||""):(i[0].style.display="none",i[0].style.display="inline")})})}}}).directive("ngAriaExpanded",function(){return{restrict:"A",link:function(e,t,n){t.attr("aria-expanded","false"),e.$watch(n.ngAriaExpanded,function(e){t.attr("aria-expanded",e?"true":"false")})}}}).directive("ngAriaSelected",function(){return{restrict:"A",link:function(e,t,n){t.attr("aria-selected","false"),e.$watch(n.ngAriaSelected,function(e){t.attr("aria-selected",e?"true":"false")})}}}).directive("ngAriaLabel",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngAriaLabel,function(e){t.attr("aria-label",e)})}}}).directive("ngAriaActivedescendant",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngAriaActivedescendant,function(e){t.attr("aria-activedescendant",e)})}}}).directive("ngTabIndex",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngTabIndex,function(e){"disabled"==e?t.removeAttr("tabindex"):t.attr("tabindex",e?"0":"-1")})}}}).directive("ngDesktopRoleText",function(){var e=navigator.userAgent,t=navigator.platform?navigator.platform:"";return{restrict:"A",link:function(n,i,r){n.$watch(r.ngTabIndex,function(n){null!=e.match(/iPhone|iPad|iPod/i)||t&&null!=t.match(/iPhone|iPad|iPod/i)||null!=e.match(/Android/i)||t&&null!=t.match(/Android/i)||(i.attr("role","text"),i.attr("tabindex","0"))})}}}).directive("ngRoleText",function(){return{restrict:"A",link:function(e,t,n){e.$watch(n.ngRoleText,function(e){e?(t.attr("role","text"),t.attr("tabindex","0")):(t.removeAttr("role"),t.removeAttr("tabindex"))})}}})});