"use strict";angular.module("ui.jq",[]).value("uiJqConfig",{}).directive("uiJq",["uiJqConfig","$timeout",function(n,t){return{restrict:"A",compile:function(i,r){if(!angular.isFunction(i[r.uiJq]))throw new Error('ui-jq: The "'+r.uiJq+'" function does not exist');var u=n&&n[r.uiJq];return function(n,i,r){function e(){t(function(){i[r.uiJq].apply(i,f)},0,!1)}var f=[];r.uiOptions?(f=n.$eval("["+r.uiOptions+"]"),angular.isObject(u)&&angular.isObject(f[0])&&(f[0]=angular.extend({},u,f[0]))):u&&(f=[u]);r.ngModel&&i.is("select,input,textarea")&&i.bind("change",function(){i.trigger("input")});r.uiRefresh&&n.$watch(r.uiRefresh,function(){e()});e()}}}}]);angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdownToggle","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]);angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/popup.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]);angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(n,t,i){function u(n){for(var t in n)if(f.style[t]!==undefined)return n[t]}var r=function(u,f,e){e=e||{};var s=n.defer(),o=r[e.animation?"animationEndEventName":"transitionEndEventName"],h=function(){i.$apply(function(){u.unbind(o,h);s.resolve(u)})};return o&&u.bind(o,h),t(function(){angular.isString(f)?u.addClass(f):angular.isFunction(f)?f(u):angular.isObject(f)&&u.css(f);o||s.resolve(u)}),s.promise.cancel=function(){o&&u.unbind(o,h);s.reject("Transition cancelled")},s.promise},f=document.createElement("trans");return r.transitionEndEventName=u({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}),r.animationEndEventName=u({WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"}),r}]);angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(n){return{link:function(t,i,r){function e(t){function f(){u===r&&(u=undefined)}var r=n(i,t);return u&&u.cancel(),u=r,r.then(f,f),r}function h(){f?(f=!1,o()):(i.removeClass("collapse").addClass("collapsing"),e({height:i[0].scrollHeight+"px"}).then(o))}function o(){i.removeClass("collapsing");i.addClass("collapse in");i.css({height:"auto"})}function c(){if(f)f=!1,s(),i.css({height:0});else{i.css({height:i[0].scrollHeight+"px"});var n=i[0].offsetWidth;i.removeClass("collapse in").addClass("collapsing");e({height:0}).then(s)}}function s(){i.removeClass("collapsing");i.addClass("collapse")}var f=!0,u;t.$watch(r.collapse,function(n){n?c():h()})}}}]);angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(n,t,i){this.groups=[];this.closeOthers=function(r){var u=angular.isDefined(t.closeOthers)?n.$eval(t.closeOthers):i.closeOthers;u&&angular.forEach(this.groups,function(n){n!==r&&(n.isOpen=!1)})};this.addGroup=function(n){var t=this;this.groups.push(n);n.$on("$destroy",function(){t.removeGroup(n)})};this.removeGroup=function(n){var t=this.groups.indexOf(n);t!==-1&&this.groups.splice(this.groups.indexOf(n),1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",["$parse",function(n){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@"},controller:function(){this.setHeading=function(n){this.heading=n}},link:function(t,i,r,u){var f,e;u.addGroup(t);t.isOpen=!1;r.isOpen&&(f=n(r.isOpen),e=f.assign,t.$parent.$watch(f,function(n){t.isOpen=!!n}));t.$watch("isOpen",function(n){n&&u.closeOthers(t);e&&e(t.$parent,n)})}}}]).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",compile:function(n,t,i){return function(n,t,r,u){u.setHeading(i(n,function(){}))}}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(n,t,i,r){n.$watch(function(){return r[i.accordionTransclude]},function(n){n&&(t.html(""),t.append(n))})}}});angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(n,t){n.closeable="close"in t}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"=",close:"&"}}});angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(n,t,i){t.addClass("ng-binding").data("$binding",i.bindHtmlUnsafe);n.$watch(i.bindHtmlUnsafe,function(n){t.html(n||"")})}});angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(n){this.activeClass=n.activeClass||"active";this.toggleEvent=n.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(n,t,i,r){var f=r[0],u=r[1];u.$render=function(){t.toggleClass(f.activeClass,angular.equals(u.$modelValue,n.$eval(i.btnRadio)))};t.bind(f.toggleEvent,function(){t.hasClass(f.activeClass)||n.$apply(function(){u.$setViewValue(n.$eval(i.btnRadio));u.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(n,t,i,r){function e(){return o(i.btnCheckboxTrue,!0)}function s(){return o(i.btnCheckboxFalse,!1)}function o(t,i){var r=n.$eval(t);return angular.isDefined(r)?r:i}var f=r[0],u=r[1];u.$render=function(){t.toggleClass(f.activeClass,angular.equals(u.$modelValue,e()))};t.bind(f.toggleEvent,function(){n.$apply(function(){u.$setViewValue(t.hasClass(f.activeClass)?s():e());u.$render()})})}}});angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition","$q",function(n,t,i){function s(){c();var i=+n.interval;!isNaN(i)&&i>=0&&(e=t(l,i))}function c(){e&&(t.cancel(e),e=null)}function l(){o?(n.next(),s()):n.pause()}var r=this,u=r.slides=[],f=-1,e,o,h;r.currentSlide=null;h=!1;r.select=function(e,o){function a(){if(!h){if(r.currentSlide&&angular.isString(o)&&!n.noTransition&&e.$element){e.$element.addClass(o);var t=e.$element[0].offsetWidth;angular.forEach(u,function(n){angular.extend(n,{direction:"",entering:!1,leaving:!1,active:!1})});angular.extend(e,{direction:o,active:!0,entering:!0});angular.extend(r.currentSlide||{},{direction:o,leaving:!0});n.$currentTransition=i(e.$element,{}),function(t,i){n.$currentTransition.then(function(){c(t,i)},function(){c(t,i)})}(e,r.currentSlide)}else c(e,r.currentSlide);r.currentSlide=e;f=l;s()}}function c(t,i){angular.extend(t,{direction:"",active:!0,leaving:!1,entering:!1});angular.extend(i||{},{direction:"",active:!1,leaving:!1,entering:!1});n.$currentTransition=null}var l=u.indexOf(e);o===undefined&&(o=l>f?"next":"prev");e&&e!==r.currentSlide&&(n.$currentTransition?(n.$currentTransition.cancel(),t(a)):a())};n.$on("$destroy",function(){h=!0});r.indexOfSlide=function(n){return u.indexOf(n)};n.next=function(){var t=(f+1)%u.length;if(!n.$currentTransition)return r.select(u[t],"next")};n.prev=function(){var t=f-1<0?u.length-1:f-1;if(!n.$currentTransition)return r.select(u[t],"prev")};n.select=function(n){r.select(n)};n.isActive=function(n){return r.currentSlide===n};n.slides=function(){return u};n.$watch("interval",s);n.$on("$destroy",c);n.play=function(){o||(o=!0,s())};n.pause=function(){n.noPause||(o=!1,c())};r.addSlide=function(t,i){t.$element=i;u.push(t);u.length===1||t.active?(r.select(u[u.length-1]),u.length==1&&n.play()):t.active=!1};r.removeSlide=function(n){var t=u.indexOf(n);u.splice(t,1);u.length>0&&n.active?t>=u.length?r.select(u[t-1]):r.select(u[t]):f>t&&f--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",["$parse",function(n){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{},link:function(t,i,r,u){if(r.active){var f=n(r.active),o=f.assign,e=t.active=f(t.$parent);t.$watch(function(){var n=f(t.$parent);return n!==t.active&&(n!==e?e=t.active=n:o(t.$parent,n=e=t.active)),n})}u.addSlide(t,i);t.$on("$destroy",function(){u.removeSlide(t)});t.$watch("active",function(n){n&&u.select(t)})}}}]);angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(n,t){function i(n,i){return n.currentStyle?n.currentStyle[i]:t.getComputedStyle?t.getComputedStyle(n)[i]:n.style[i]}function r(n){return(i(n,"position")||"static")==="static"}var u=function(t){for(var u=n[0],i=t.offsetParent||u;i&&i!==u&&r(i);)i=i.offsetParent;return i||u};return{position:function(t){var e=this.offset(t),r={top:0,left:0},i=u(t[0]),f;return i!=n[0]&&(r=this.offset(angular.element(i)),r.top+=i.clientTop-i.scrollTop,r.left+=i.clientLeft-i.scrollLeft),f=t[0].getBoundingClientRect(),{width:f.width||t.prop("offsetWidth"),height:f.height||t.prop("offsetHeight"),top:e.top-r.top,left:e.left-r.left}},offset:function(i){var r=i[0].getBoundingClientRect();return{width:r.width||i.prop("offsetWidth"),height:r.height||i.prop("offsetHeight"),top:r.top+(t.pageYOffset||n[0].body.scrollTop||n[0].documentElement.scrollTop),left:r.left+(t.pageXOffset||n[0].body.scrollLeft||n[0].documentElement.scrollLeft)}}}}]);angular.module("ui.bootstrap.datepicker",["ui.bootstrap.position"]).constant("datepickerConfig",{dayFormat:"dd",monthFormat:"MMMM",yearFormat:"yyyy",dayHeaderFormat:"EEE",dayTitleFormat:"MMMM yyyy",monthTitleFormat:"yyyy",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","dateFilter","datepickerConfig",function(n,t,i,r){function u(t,i){return angular.isDefined(t)?n.$parent.$eval(t):i}function h(n,t){return new Date(n,t,0).getDate()}function c(n,t){for(var r=new Array(t),i=n,u=0;u<t;)r[u++]=new Date(i),i.setDate(i.getDate()+1);return r}function o(n,t,r,u){return{date:n,label:i(n,t),selected:!!r,secondary:!!u}}var f={day:u(t.dayFormat,r.dayFormat),month:u(t.monthFormat,r.monthFormat),year:u(t.yearFormat,r.yearFormat),dayHeader:u(t.dayHeaderFormat,r.dayHeaderFormat),dayTitle:u(t.dayTitleFormat,r.dayTitleFormat),monthTitle:u(t.monthTitleFormat,r.monthTitleFormat)},s=u(t.startingDay,r.startingDay),e=u(t.yearRange,r.yearRange);this.minDate=r.minDate?new Date(r.minDate):null;this.maxDate=r.maxDate?new Date(r.maxDate):null;this.modes=[{name:"day",getVisibleDates:function(n,t){var b=n.getFullYear(),v=n.getMonth(),k=new Date(b,v,1),y=s-k.getDay(),p=y>0?7-y:-y,d=new Date(k),r=0,e,w,l,u,a;for(p>0&&(d.setDate(-p+1),r+=p),r+=h(b,v+1),r+=(7-r%7)%7,e=c(d,r),w=new Array(7),l=0;l<r;l++)u=new Date(e[l]),e[l]=o(u,f.day,t&&t.getDate()===u.getDate()&&t.getMonth()===u.getMonth()&&t.getFullYear()===u.getFullYear(),u.getMonth()!==v);for(a=0;a<7;a++)w[a]=i(e[a].date,f.dayHeader);return{objects:e,title:i(n,f.dayTitle),labels:w}},compare:function(n,t){return new Date(n.getFullYear(),n.getMonth(),n.getDate())-new Date(t.getFullYear(),t.getMonth(),t.getDate())},split:7,step:{months:1}},{name:"month",getVisibleDates:function(n,t){for(var s,u=new Array(12),e=n.getFullYear(),r=0;r<12;r++)s=new Date(e,r,1),u[r]=o(s,f.month,t&&t.getMonth()===r&&t.getFullYear()===e);return{objects:u,title:i(n,f.monthTitle)}},compare:function(n,t){return new Date(n.getFullYear(),n.getMonth())-new Date(t.getFullYear(),t.getMonth())},split:3,step:{years:1}},{name:"year",getVisibleDates:function(n,t){for(var u,i=new Array(e),s=n.getFullYear(),h=parseInt((s-1)/e,10)*e+1,r=0;r<e;r++)u=new Date(h+r,0,1),i[r]=o(u,f.year,t&&t.getFullYear()===u.getFullYear());return{objects:i,title:[i[0].label,i[e-1].label].join(" - ")}},compare:function(n,t){return n.getFullYear()-t.getFullYear()},split:5,step:{years:e}}];this.isDisabled=function(t,i){var r=this.modes[i||0];return this.minDate&&r.compare(t,this.minDate)<0||this.maxDate&&r.compare(t,this.maxDate)>0||n.dateDisabled&&n.dateDisabled({date:t,mode:r.name})}}]).directive("datepicker",["dateFilter","$parse","datepickerConfig","$log",function(n,t,i,r){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(n,u,f,e){function a(){n.showWeekNumbers=s===0&&v}function p(n,t){for(var i=[];n.length>0;)i.push(n.splice(0,t));return i}function l(t){var i=null,e=!0,f,u;o.$modelValue&&(i=new Date(o.$modelValue),isNaN(i)?(e=!1,r.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):t&&(c=i));o.$setValidity("date",e);f=h.modes[s];u=f.getVisibleDates(c,i);angular.forEach(u.objects,function(n){n.disabled=h.isDisabled(n.date,s)});o.$setValidity("date-disabled",!i||!h.isDisabled(i));n.rows=p(u.objects,f.split);n.labels=u.labels||[];n.title=u.title}function y(n){s=n;a();l()}function w(n){var t=new Date(n),i;return t.setDate(t.getDate()+4-(t.getDay()||7)),i=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((i-t)/864e5)/7)+1}var h=e[0],o=e[1];if(o){var s=0,c=new Date,v=i.showWeeks;f.showWeeks?n.$parent.$watch(t(f.showWeeks),function(n){v=!!n;a()}):a();f.min&&n.$parent.$watch(t(f.min),function(n){h.minDate=n?new Date(n):null;l()});f.max&&n.$parent.$watch(t(f.max),function(n){h.maxDate=n?new Date(n):null;l()});o.$render=function(){l(!0)};n.select=function(n){if(s===0){var t=o.$modelValue?new Date(o.$modelValue):new Date(0,0,0,0,0,0,0);t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate());o.$setViewValue(t);l(!0)}else c=n,y(s-1)};n.move=function(n){var t=h.modes[s].step;c.setMonth(c.getMonth()+n*(t.months||0));c.setFullYear(c.getFullYear()+n*(t.years||0));l()};n.toggleMode=function(){y((s+1)%h.modes.length)};n.getWeekNumber=function(t){return s===0&&n.showWeekNumbers&&t.length===7?w(t[0].date):null}}}}}]).constant("datepickerPopupConfig",{dateFormat:"yyyy-MM-dd",currentText:"Today",toggleWeeksText:"Weeks",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","datepickerPopupConfig","datepickerConfig",function(n,t,i,r,u,f,e){return{restrict:"EA",require:"ngModel",link:function(o,s,h,c){function b(n){v?v(o,!!n):l.isOpen=!!n}function et(n){if(n){if(angular.isDate(n))return c.$setValidity("date",!0),n;if(angular.isString(n)){var t=new Date(n);return isNaN(t)?(c.$setValidity("date",!1),undefined):(c.$setValidity("date",!0),t)}return c.$setValidity("date",!1),undefined}return c.$setValidity("date",!0),null}function d(n,i,r){n&&(o.$watch(t(n),function(n){l[i]=n}),y.attr(r||i,i))}function ot(){l.position=it?r.offset(s):r.position(s);l.position.top=l.position.top+s.prop("offsetHeight")}var l=o.$new(),tt,ft=angular.isDefined(h.closeOnDateSelection)?o.$eval(h.closeOnDateSelection):f.closeOnDateSelection,it=angular.isDefined(h.datepickerAppendToBody)?o.$eval(h.datepickerAppendToBody):f.appendToBody,a,v,y,p,g,nt,w;h.$observe("datepickerPopup",function(n){tt=n||f.dateFormat;c.$render()});l.showButtonBar=angular.isDefined(h.showButtonBar)?o.$eval(h.showButtonBar):f.showButtonBar;o.$on("$destroy",function(){w.remove();l.$destroy()});h.$observe("currentText",function(n){l.currentText=angular.isDefined(n)?n:f.currentText});h.$observe("toggleWeeksText",function(n){l.toggleWeeksText=angular.isDefined(n)?n:f.toggleWeeksText});h.$observe("clearText",function(n){l.clearText=angular.isDefined(n)?n:f.clearText});h.$observe("closeText",function(n){l.closeText=angular.isDefined(n)?n:f.closeText});h.isOpen&&(a=t(h.isOpen),v=a.assign,o.$watch(a,function(n){l.isOpen=!!n}));l.isOpen=a?a(o):!1;var rt=function(n){l.isOpen&&n.target!==s[0]&&l.$apply(function(){b(!1)})},ut=function(){l.$apply(function(){b(!0)})},k=angular.element("<div datepicker-popup-wrap><div datepicker><\/div><\/div>");k.attr({"ng-model":"date","ng-change":"dateSelection()"});y=angular.element(k.children()[0]);p={};h.datepickerOptions&&(p=o.$eval(h.datepickerOptions),y.attr(angular.extend({},p)));c.$parsers.unshift(et);l.dateSelection=function(n){angular.isDefined(n)&&(l.date=n);c.$setViewValue(l.date);c.$render();ft&&b(!1)};s.bind("input change keyup",function(){l.$apply(function(){l.date=c.$modelValue})});c.$render=function(){var n=c.$viewValue?u(c.$viewValue,tt):"";s.val(n);l.date=c.$modelValue};d(h.min,"min");d(h.max,"max");h.showWeeks?d(h.showWeeks,"showWeeks","show-weeks"):(l.showWeeks="show-weeks"in p?p["show-weeks"]:e.showWeeks,y.attr("show-weeks","showWeeks"));h.dateDisabled&&y.attr("date-disabled",h.dateDisabled);g=!1;nt=!1;l.$watch("isOpen",function(n){n?(ot(),i.bind("click",rt),nt&&s.unbind("focus",ut),s[0].focus(),g=!0):(g&&i.unbind("click",rt),s.bind("focus",ut),nt=!0);v&&v(o,n)});l.today=function(){l.dateSelection(new Date)};l.clear=function(){l.dateSelection(null)};w=n(k)(l);it?i.find("body").append(w):s.after(w)}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(n,t){t.bind("click",function(n){n.preventDefault();n.stopPropagation()})}}});angular.module("ui.bootstrap.dropdownToggle",[]).directive("dropdownToggle",["$document","$location",function(n){var i=null,t=angular.noop;return{restrict:"CA",link:function(r,u){r.$watch("$location.path",function(){t()});u.parent().bind("click",function(){t()});u.bind("click",function(r){var f=u===i;r.preventDefault();r.stopPropagation();!i||t();f||u.hasClass("disabled")||u.prop("disabled")||(u.parent().addClass("open"),i=u,t=function(r){r&&(r.preventDefault(),r.stopPropagation());n.unbind("click",t);u.parent().removeClass("open");t=angular.noop;i=null},n.bind("click",t))})}}}]);angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var n=[];return{add:function(t,i){n.push({key:t,value:i})},get:function(t){for(var i=0;i<n.length;i++)if(t==n[i].key)return n[i]},keys:function(){for(var i=[],t=0;t<n.length;t++)i.push(n[t].key);return i},top:function(){return n[n.length-1]},remove:function(t){for(var r=-1,i=0;i<n.length;i++)if(t==n[i].key){r=i;break}return n.splice(r,1)[0]},removeTop:function(){return n.splice(n.length-1,1)[0]},length:function(){return n.length}}}}}).directive("modalBackdrop",["$timeout",function(n){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(t){t.animate=!1;n(function(){t.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(n,t){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:"template/modal/window.html",link:function(i,r,u){i.windowClass=u.windowClass||"";t(function(){i.animate=!0;r[0].focus()});i.close=function(t){var i=n.getTop();i&&i.value.backdrop&&i.value.backdrop!="static"&&t.target===t.currentTarget&&(t.preventDefault(),t.stopPropagation(),n.dismiss(i.key,"backdrop click"))}}}}]).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(n,t,i,r,u,f){function c(){for(var t=-1,i=e.keys(),n=0;n<i.length;n++)e.get(i[n]).value.backdrop&&(t=n);return t}function a(n){var r=i.find("body").eq(0),t=e.get(n).value;e.remove(n);v(t.modalDomEl,t.modalScope,300,y);r.toggleClass(l,e.length()>0)}function y(){if(h&&c()==-1){var n=o;v(h,o,150,function(){n.$destroy();n=null});h=undefined;o=undefined}}function v(i,r,u,f){function e(){e.done||(e.done=!0,i.remove(),f&&f())}var o,s;r.animate=!1;o=n.transitionEndEventName;o?(s=t(e,u),i.bind(o,function(){t.cancel(s);e();r.$apply()})):t(e,0)}var l="modal-open",h,o,e=f.createNew(),s={};return u.$watch(c,function(n){o&&(o.index=n)}),i.bind("keydown",function(n){var t;n.which===27&&(t=e.top(),t&&t.value.keyboard&&u.$apply(function(){s.dismiss(t.key)}))}),s.open=function(n,t){var s,a,f,v;e.add(n,{deferred:t.deferred,modalScope:t.scope,backdrop:t.backdrop,keyboard:t.keyboard});s=i.find("body").eq(0);a=c();a>=0&&!h&&(o=u.$new(!0),o.index=a,h=r("<div modal-backdrop><\/div>")(o),s.append(h));f=angular.element("<div modal-window><\/div>");f.attr("window-class",t.windowClass);f.attr("index",e.length()-1);f.attr("animate","animate");f.html(t.content);v=r(f)(t.scope);e.top().value.modalDomEl=v;s.append(v);s.addClass(l)},s.close=function(n,t){var i=e.get(n).value;i&&(i.deferred.resolve(t),a(n))},s.dismiss=function(n,t){var i=e.get(n).value;i&&(i.deferred.reject(t),a(n))},s.dismissAll=function(n){for(var t=this.getTop();t;)this.dismiss(t.key,n),t=this.getTop()},s.getTop=function(){return e.top()},s}]).provider("$modal",function(){var n={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(t,i,r,u,f,e,o){function h(n){return n.template?r.when(n.template):u.get(n.templateUrl,{cache:f}).then(function(n){return n.data})}function c(n){var i=[];return angular.forEach(n,function(n){(angular.isFunction(n)||angular.isArray(n))&&i.push(r.when(t.invoke(n)))}),i}var s={};return s.open=function(t){var f=r.defer(),s=r.defer(),u={result:f.promise,opened:s.promise,close:function(n){o.close(u,n)},dismiss:function(n){o.dismiss(u,n)}},l;if(t=angular.extend({},n.options,t),t.resolve=t.resolve||{},!t.template&&!t.templateUrl)throw new Error("One of template or templateUrl options is required.");return l=r.all([h(t)].concat(c(t.resolve))),l.then(function(n){var s=(t.scope||i).$new(),c,r,h;s.$close=u.close;s.$dismiss=u.dismiss;r={};h=1;t.controller&&(r.$scope=s,r.$modalInstance=u,angular.forEach(t.resolve,function(t,i){r[i]=n[h++]}),c=e(t.controller,r));o.open(u,{scope:s,deferred:f,content:n[0],backdrop:t.backdrop,keyboard:t.keyboard,windowClass:t.windowClass})},function(n){f.reject(n)}),l.then(function(){s.resolve(!0)},function(){s.reject(!1)}),u},s}]};return n});angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse","$interpolate",function(n,t,i,r){var u=this,f=t.numPages?i(t.numPages).assign:angular.noop;this.init=function(r){t.itemsPerPage?n.$parent.$watch(i(t.itemsPerPage),function(t){u.itemsPerPage=parseInt(t,10);n.totalPages=u.calculateTotalPages()}):this.itemsPerPage=r};this.noPrevious=function(){return this.page===1};this.noNext=function(){return this.page===n.totalPages};this.isActive=function(n){return this.page===n};this.calculateTotalPages=function(){var t=this.itemsPerPage<1?1:Math.ceil(n.totalItems/this.itemsPerPage);return Math.max(t||0,1)};this.getAttributeValue=function(t,i,u){return angular.isDefined(t)?u?r(t)(n.$parent):n.$parent.$eval(t):i};this.render=function(){this.page=parseInt(n.page,10)||1;this.page>0&&this.page<=n.totalPages&&(n.pages=this.getPages(this.page,n.totalPages))};n.selectPage=function(t){if(!u.isActive(t)&&t>0&&t<=n.totalPages){n.page=t;n.onSelectPage({page:t})}};n.$watch("page",function(){u.render()});n.$watch("totalItems",function(){n.totalPages=u.calculateTotalPages()});n.$watch("totalPages",function(t){f(n.$parent,t);u.page>t?n.selectPage(t):u.render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(n,t){return{restrict:"EA",scope:{page:"=",totalItems:"=",onSelectPage:" &"},controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(i,r,u,f){function o(n,t,i,r){return{number:n,text:t,active:i,disabled:r}}var e,h=f.getAttributeValue(u.boundaryLinks,t.boundaryLinks),c=f.getAttributeValue(u.directionLinks,t.directionLinks),l=f.getAttributeValue(u.firstText,t.firstText,!0),a=f.getAttributeValue(u.previousText,t.previousText,!0),v=f.getAttributeValue(u.nextText,t.nextText,!0),y=f.getAttributeValue(u.lastText,t.lastText,!0),s=f.getAttributeValue(u.rotate,t.rotate);f.init(t.itemsPerPage);u.maxSize&&i.$parent.$watch(n(u.maxSize),function(n){e=parseInt(n,10);f.render()});f.getPages=function(n,t){var i=[],r=1,u=t,w=angular.isDefined(e)&&e<t,p,b,k,d,g,nt,tt,it;for(w&&(s?(r=Math.max(n-Math.floor(e/2),1),u=r+e-1,u>t&&(u=t,r=u-e+1)):(r=(Math.ceil(n/e)-1)*e+1,u=Math.min(r+e-1,t))),p=r;p<=u;p++)b=o(p,p,f.isActive(p),!1),i.push(b);return w&&!s&&(r>1&&(k=o(r-1,"...",!1,!1),i.unshift(k)),u<t&&(d=o(u+1,"...",!1,!1),i.push(d))),c&&(g=o(n-1,a,!1,f.noPrevious()),i.unshift(g),nt=o(n+1,v,!1,f.noNext()),i.push(nt)),h&&(tt=o(1,l,!1,f.noPrevious()),i.unshift(tt),it=o(t,y,!1,f.noNext()),i.push(it)),i}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(n){return{restrict:"EA",scope:{page:"=",totalItems:"=",onSelectPage:" &"},controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(t,i,r,u){function e(n,t,i,r,u){return{number:n,text:t,disabled:i,previous:f&&r,next:f&&u}}var o=u.getAttributeValue(r.previousText,n.previousText,!0),s=u.getAttributeValue(r.nextText,n.nextText,!0),f=u.getAttributeValue(r.align,n.align);u.init(n.itemsPerPage);u.getPages=function(n){return[e(n-1,o,u.noPrevious(),!0,!1),e(n+1,s,u.noNext(),!1,!0)]}}}}]);angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function r(n){var t="-";return n.replace(/[A-Z]/g,function(n,i){return(i?t:"")+n.toLowerCase()})}var i={placement:"top",animation:!0,popupDelay:0},n={mouseenter:"mouseleave",click:"click",focus:"blur"},t={};this.options=function(n){angular.extend(t,n)};this.setTriggers=function(t){angular.extend(n,t)};this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(u,f,e,o,s,h,c){return function(u,l,a){function w(t){var i=t||v.trigger||a,r=n[i]||i;return{show:i,hide:r}}var v=angular.extend({},i,t),b=r(u),y=c.startSymbol(),p=c.endSymbol(),k="<div "+b+'-popup title="'+y+"tt_title"+p+'" content="'+y+"tt_content"+p+'" placement="'+y+"tt_placement"+p+'" animation="tt_animation" is-open="tt_isOpen"><\/div>';return{restrict:"EA",scope:!0,compile:function(){var n=f(k);return function(t,i,r){function et(){t.tt_isOpen?d():k()}function k(){(!ft||t.$eval(r[l+"Enable"]))&&(t.tt_popupDelay?(p=e(ut,t.tt_popupDelay,!1),p.then(function(n){n()})):ut()())}function d(){t.$apply(function(){g()})}function ut(){return t.tt_content?(ot(),y&&e.cancel(y),f.css({top:0,left:0,display:"block"}),a?s.find("body").append(f):i.after(f),rt(),t.tt_isOpen=!0,t.$digest(),rt):angular.noop}function g(){t.tt_isOpen=!1;e.cancel(p);t.tt_animation?y=e(b,500):b()}function ot(){f&&b();f=n(t,function(){});t.$digest()}function b(){f&&(f.remove(),f=null)}var f,y,p,a=angular.isDefined(v.appendToBody)?v.appendToBody:!1,c=w(undefined),it=!1,ft=angular.isDefined(r[l+"Enable"]),rt=function(){var n,u,e,r;n=a?h.offset(i):h.position(i);u=f.prop("offsetWidth");e=f.prop("offsetHeight");switch(t.tt_placement){case"right":r={top:n.top+n.height/2-e/2,left:n.left+n.width};break;case"bottom":r={top:n.top+n.height,left:n.left+n.width/2-u/2};break;case"left":r={top:n.top+n.height/2-e/2,left:n.left-u};break;default:r={top:n.top-e,left:n.left+n.width/2-u/2}}r.top+="px";r.left+="px";f.css(r)},nt,tt;t.tt_isOpen=!1;r.$observe(u,function(n){t.tt_content=n;!n&&t.tt_isOpen&&g()});r.$observe(l+"Title",function(n){t.tt_title=n});r.$observe(l+"Placement",function(n){t.tt_placement=angular.isDefined(n)?n:v.placement});r.$observe(l+"PopupDelay",function(n){var i=parseInt(n,10);t.tt_popupDelay=isNaN(i)?v.popupDelay:i});nt=function(){it&&(i.unbind(c.show,k),i.unbind(c.hide,d))};r.$observe(l+"Trigger",function(n){nt();c=w(n);c.show===c.hide?i.bind(c.show,et):(i.bind(c.show,k),i.bind(c.hide,d));it=!0});tt=t.$eval(r[l+"Animation"]);t.tt_animation=angular.isDefined(tt)?!!tt:v.animation;r.$observe(l+"AppendToBody",function(n){a=angular.isDefined(n)?o(n)(t):a});a&&t.$on("$locationChangeSuccess",function(){t.tt_isOpen&&g()});t.$on("$destroy",function(){e.cancel(y);e.cancel(p);nt();b()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(n){return n("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(n){return n("tooltipHtmlUnsafe","tooltip","mouseenter")}]);angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(n){return n("popover","popover","click")}]);angular.module("ui.bootstrap.progressbar",["ui.bootstrap.transition"]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig","$transition",function(n,t,i,r){var f=this,u=[],e=angular.isDefined(t.max)?n.$parent.$eval(t.max):i.max,o=angular.isDefined(t.animate)?n.$parent.$eval(t.animate):i.animate;this.addBar=function(n,t){var r=0,i=n.$parent.$index;angular.isDefined(i)&&u[i]&&(r=u[i].value);u.push(n);this.update(t,n.value,r);n.$watch("value",function(n,i){n!==i&&f.update(t,n,i)});n.$on("$destroy",function(){f.removeBar(n)})};this.update=function(n,t,i){var u=this.getPercentage(t);o?(n.css("width",this.getPercentage(i)+"%"),r(n,{width:u+"%"})):n.css({transition:"none",width:u+"%"})};this.removeBar=function(n){u.splice(u.indexOf(n),1)};this.getPercentage=function(n){return Math.round(100*n/e)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},template:'<div class="progress" ng-transclude><\/div>'}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(n,t,i,r){r.addBar(n,t)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(n,t,i,r){r.addBar(n,angular.element(t.children()[0]))}}});angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","$parse","ratingConfig",function(n,t,i,r){this.maxRange=angular.isDefined(t.max)?n.$parent.$eval(t.max):r.max;this.stateOn=angular.isDefined(t.stateOn)?n.$parent.$eval(t.stateOn):r.stateOn;this.stateOff=angular.isDefined(t.stateOff)?n.$parent.$eval(t.stateOff):r.stateOff;this.createRateObjects=function(n){for(var i={stateOn:this.stateOn,stateOff:this.stateOff},t=0,r=n.length;t<r;t++)n[t]=angular.extend({index:t},i,n[t]);return n};n.range=angular.isDefined(t.ratingStates)?this.createRateObjects(angular.copy(n.$parent.$eval(t.ratingStates))):this.createRateObjects(new Array(this.maxRange));n.rate=function(t){n.value===t||n.readonly||(n.value=t)};n.enter=function(t){n.readonly||(n.val=t);n.onHover({value:t})};n.reset=function(){n.val=angular.copy(n.value);n.onLeave()};n.$watch("value",function(t){n.val=t});n.readonly=!1;t.readonly&&n.$parent.$watch(i(t.readonly),function(t){n.readonly=!!t})}]).directive("rating",function(){return{restrict:"EA",scope:{value:"=",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0}});angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(n){var i=this,t=i.tabs=n.tabs=[];i.select=function(n){angular.forEach(t,function(n){n.active=!1});n.active=!0};i.addTab=function(n){t.push(n);(t.length===1||n.active)&&i.select(n)};i.removeTab=function(n){var r=t.indexOf(n),u;n.active&&t.length>1&&(u=r==t.length-1?r-1:r+1,i.select(t[u]));t.splice(r,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(n,t,i){n.vertical=angular.isDefined(i.vertical)?n.$parent.$eval(i.vertical):!1;n.justified=angular.isDefined(i.justified)?n.$parent.$eval(i.justified):!1;n.type=angular.isDefined(i.type)?n.$parent.$eval(i.type):"tabs"}}}).directive("tab",["$parse",function(n){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(t,i,r){return function(t,i,u,f){var e,o;u.active?(e=n(u.active),o=e.assign,t.$parent.$watch(e,function(n,i){n!==i&&(t.active=!!n)}),t.active=e(t.$parent)):o=e=angular.noop;t.$watch("active",function(n){o(t.$parent,n);n?(f.select(t),t.onSelect()):t.onDeselect()});t.disabled=!1;u.disabled&&t.$parent.$watch(n(u.disabled),function(n){t.disabled=!!n});t.select=function(){t.disabled||(t.active=!0)};f.addTab(t);t.$on("$destroy",function(){f.removeTab(t)});t.$transcludeFn=r}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(n,t){n.$watch("headingElement",function(n){n&&(t.html(""),t.append(n))})}}}]).directive("tabContentTransclude",function(){function n(n){return n.tagName&&(n.hasAttribute("tab-heading")||n.hasAttribute("data-tab-heading")||n.tagName.toLowerCase()==="tab-heading"||n.tagName.toLowerCase()==="data-tab-heading")}return{restrict:"A",require:"^tabset",link:function(t,i,r){var u=t.$eval(r.tabContentTransclude);u.$transcludeFn(u.$parent,function(t){angular.forEach(t,function(t){n(t)?u.headingElement=t:i.append(t)})})}}});angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).directive("timepicker",["$parse","$log","timepickerConfig","$locale",function(n,t,i,r){return{restrict:"EA",require:"?^ngModel",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(u,f,e,o){function k(){var n=parseInt(u.hours,10),t=u.showMeridian?n>0&&n<13:n>=0&&n<24;return t?(u.showMeridian&&(n===12&&(n=0),u.meridian===v[1]&&(n=n+12)),n):undefined}function d(){var n=parseInt(u.minutes,10);return n>=0&&n<60?n:undefined}function l(n){return angular.isDefined(n)&&n.toString().length<2?"0"+n:n}function a(n){it();o.$setViewValue(new Date(s));b(n)}function it(){o.$setValidity("time",!0);u.invalidHours=!1;u.invalidMinutes=!1}function b(n){var t=s.getHours(),i=s.getMinutes();u.showMeridian&&(t=t===0||t===12?12:t%12);u.hours=n==="h"?t:l(t);u.minutes=n==="m"?i:l(i);u.meridian=s.getHours()<12?v[0]:v[1]}function h(n){var t=new Date(s.getTime()+n*6e4);s.setHours(t.getHours(),t.getMinutes());a()}var c,p,w;if(o){var s=new Date,v=angular.isDefined(e.meridians)?u.$parent.$eval(e.meridians):i.meridians||r.DATETIME_FORMATS.AMPMS,y=i.hourStep;e.hourStep&&u.$parent.$watch(n(e.hourStep),function(n){y=parseInt(n,10)});c=i.minuteStep;e.minuteStep&&u.$parent.$watch(n(e.minuteStep),function(n){c=parseInt(n,10)});u.showMeridian=i.showMeridian;e.showMeridian&&u.$parent.$watch(n(e.showMeridian),function(n){if(u.showMeridian=!!n,o.$error.time){var t=k(),i=d();angular.isDefined(t)&&angular.isDefined(i)&&(s.setHours(t),a())}else b()});var g=f.find("input"),nt=g.eq(0),tt=g.eq(1),rt=angular.isDefined(e.mousewheel)?u.$eval(e.mousewheel):i.mousewheel;rt&&(p=function(n){n.originalEvent&&(n=n.originalEvent);var t=n.wheelDelta?n.wheelDelta:-n.deltaY;return n.detail||t>0},nt.bind("mousewheel wheel",function(n){u.$apply(p(n)?u.incrementHours():u.decrementHours());n.preventDefault()}),tt.bind("mousewheel wheel",function(n){u.$apply(p(n)?u.incrementMinutes():u.decrementMinutes());n.preventDefault()}));u.readonlyInput=angular.isDefined(e.readonlyInput)?u.$eval(e.readonlyInput):i.readonlyInput;u.readonlyInput?(u.updateHours=angular.noop,u.updateMinutes=angular.noop):(w=function(n,t){o.$setViewValue(null);o.$setValidity("time",!1);angular.isDefined(n)&&(u.invalidHours=n);angular.isDefined(t)&&(u.invalidMinutes=t)},u.updateHours=function(){var n=k();angular.isDefined(n)?(s.setHours(n),a("h")):w(!0)},nt.bind("blur",function(){!u.validHours&&u.hours<10&&u.$apply(function(){u.hours=l(u.hours)})}),u.updateMinutes=function(){var n=d();angular.isDefined(n)?(s.setMinutes(n),a("m")):w(undefined,!0)},tt.bind("blur",function(){!u.invalidMinutes&&u.minutes<10&&u.$apply(function(){u.minutes=l(u.minutes)})}));o.$render=function(){var n=o.$modelValue?new Date(o.$modelValue):null;isNaN(n)?(o.$setValidity("time",!1),t.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(n&&(s=n),it(),b())};u.incrementHours=function(){h(y*60)};u.decrementHours=function(){h(-y*60)};u.incrementMinutes=function(){h(c)};u.decrementMinutes=function(){h(-c)};u.toggleMeridian=function(){h(720*(s.getHours()<12?1:-1))}}}}}]);angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(n){var t=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(i){var r=i.match(t);if(!r)throw new Error("Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_' but got '"+i+"'.");return{itemName:r[3],source:n(r[4]),viewMapper:n(r[2]||r[1]),modelMapper:n(r[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(n,t,i,r,u,f,e){var o=[9,13,27,38,40];return{require:"ngModel",link:function(s,h,c,l){var ut=s.$eval(c.typeaheadMinLength)||1,tt=s.$eval(c.typeaheadWaitMs)||0,ft=s.$eval(c.typeaheadEditable)!==!1,p=t(c.typeaheadLoading).assign||angular.noop,et=t(c.typeaheadOnSelect),it=c.typeaheadInputFormatter?t(c.typeaheadInputFormatter):undefined,rt=c.typeaheadAppendToBody?t(c.typeaheadAppendToBody):!1,ot=t(c.ngModel).assign,v=e.parse(c.typeahead),w,b=angular.element("<div typeahead-popup><\/div>"),a,y,k,d,g,nt;b.attr({matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"});angular.isDefined(c.typeaheadTemplateUrl)&&b.attr("template-url",c.typeaheadTemplateUrl);a=s.$new();s.$on("$destroy",function(){a.$destroy()});y=function(){a.matches=[];a.activeIdx=-1};k=function(n){var t={$viewValue:n};p(s,!0);i.when(v.source(s,t)).then(function(i){if(n===l.$viewValue&&w){if(i.length>0){a.activeIdx=0;a.matches.length=0;for(var r=0;r<i.length;r++)t[v.itemName]=i[r],a.matches.push({label:v.viewMapper(a,t),model:i[r]});a.query=n;a.position=rt?f.offset(h):f.position(h);a.position.top=a.position.top+h.prop("offsetHeight")}else y();p(s,!1)}},function(){y();p(s,!1)})};y();a.query=undefined;l.$parsers.unshift(function(n){return w=!0,n&&n.length>=ut?tt>0?(d&&r.cancel(d),d=r(function(){k(n)},tt)):k(n):(p(s,!1),y()),ft?n:n?(l.$setValidity("editable",!1),undefined):(l.$setValidity("editable",!0),n)});l.$formatters.push(function(n){var i,r,t={};return it?(t.$model=n,it(s,t)):(t[v.itemName]=n,i=v.viewMapper(s,t),t[v.itemName]=undefined,r=v.viewMapper(s,t),i!==r?i:n)});a.select=function(n){var t={},i,r;t[v.itemName]=r=a.matches[n].model;i=v.modelMapper(s,t);ot(s,i);l.$setValidity("editable",!0);et(s,{$item:r,$model:i,$label:v.viewMapper(s,t)});y();h[0].focus()};h.bind("keydown",function(n){a.matches.length!==0&&o.indexOf(n.which)!==-1&&(n.preventDefault(),n.which===40?(a.activeIdx=(a.activeIdx+1)%a.matches.length,a.$digest()):n.which===38?(a.activeIdx=(a.activeIdx?a.activeIdx:a.matches.length)-1,a.$digest()):n.which===13||n.which===9?a.$apply(function(){a.select(a.activeIdx)}):n.which===27&&(n.stopPropagation(),y(),a.$digest()))});h.bind("blur",function(){w=!1});g=function(n){h[0]!==n.target&&(y(),a.$digest())};u.bind("click",g);s.$on("$destroy",function(){u.unbind("click",g)});nt=n(b)(a);rt?u.find("body").append(nt):h.after(nt)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(n,t,i){n.templateUrl=i.templateUrl;n.isOpen=function(){return n.matches.length>0};n.isActive=function(t){return n.active==t};n.selectActive=function(t){n.active=t};n.selectMatch=function(t){n.select({activeIdx:t})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(n,t,i,r){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(u,f,e){var o=r(e.templateUrl)(u.$parent)||"template/typeahead/typeahead-match.html";n.get(o,{cache:t}).success(function(n){f.replaceWith(i(n.trim())(u))})}}}]).filter("typeaheadHighlight",function(){function n(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(t,i){return i?t.replace(new RegExp(n(i),"gi"),"<strong>$&<\/strong>"):t}});angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(n){n.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n  <div class="panel-heading">\n    <h4 class="panel-title">\n      <a class="accordion-toggle" ng-click="isOpen = !isOpen" accordion-transclude="heading">{{heading}}<\/a>\n    <\/h4>\n  <\/div>\n  <div class="panel-collapse" collapse="!isOpen">\n\t  <div class="panel-body" ng-transclude><\/div>\n  <\/div>\n<\/div>')}]);angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(n){n.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude><\/div>')}]);angular.module("template/alert/alert.html",[]).run(["$templateCache",function(n){n.put("template/alert/alert.html","<div class='alert' ng-class='\"alert-\" + (type || \"warning\")'>\n    <button ng-show='closeable' type='button' class='close' ng-click='close()'>&times;<\/button>\n    <div ng-transclude><\/div>\n<\/div>\n")}]);angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(n){n.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel">\n    <ol class="carousel-indicators" ng-show="slides().length > 1">\n        <li ng-repeat="slide in slides()" ng-class="{active: isActive(slide)}" ng-click="select(slide)"><\/li>\n    <\/ol>\n    <div class="carousel-inner" ng-transclude><\/div>\n    <a class="left carousel-control" ng-click="prev()" ng-show="slides().length > 1"><span class="icon-prev"><\/span><\/a>\n    <a class="right carousel-control" ng-click="next()" ng-show="slides().length > 1"><span class="icon-next"><\/span><\/a>\n<\/div>\n')}]);angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(n){n.put("template/carousel/slide.html","<div ng-class=\"{\n    'active': leaving || (active && !entering),\n    'prev': (next || active) && direction=='prev',\n    'next': (next || active) && direction=='next',\n    'right': direction=='prev',\n    'left': direction=='next'\n  }\" class=\"item text-center\" ng-transclude><\/div>\n")}]);angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(n){n.put("template/datepicker/datepicker.html",'<table>\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)"><i class="glyphicon glyphicon-chevron-left"><\/i><\/button><\/th>\n      <th colspan="{{rows[0].length - 2 + showWeekNumbers}}"><button type="button" class="btn btn-default btn-sm btn-block" ng-click="toggleMode()"><strong>{{title}}<\/strong><\/button><\/th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)"><i class="glyphicon glyphicon-chevron-right"><\/i><\/button><\/th>\n    <\/tr>\n    <tr ng-show="labels.length > 0" class="h6">\n      <th ng-show="showWeekNumbers" class="text-center">#<\/th>\n      <th ng-repeat="label in labels" class="text-center">{{label}}<\/th>\n    <\/tr>\n  <\/thead>\n  <tbody>\n    <tr ng-repeat="row in rows">\n      <td ng-show="showWeekNumbers" class="text-center"><em>{{ getWeekNumber(row) }}<\/em><\/td>\n      <td ng-repeat="dt in row" class="text-center">\n        <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected}" ng-click="select(dt.date)" ng-disabled="dt.disabled"><span ng-class="{\'text-muted\': dt.secondary}">{{dt.label}}<\/span><\/button>\n      <\/td>\n    <\/tr>\n  <\/tbody>\n<\/table>\n')}]);angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(n){n.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}">\n\t<li ng-transclude><\/li>\n\t<li ng-show="showButtonBar" style="padding:10px 9px 2px">\n\t\t<span class="btn-group">\n\t\t\t<button type="button" class="btn btn-sm btn-info" ng-click="today()">{{currentText}}<\/button>\n\t\t\t<button type="button" class="btn btn-sm btn-default" ng-click="showWeeks = ! showWeeks" ng-class="{active: showWeeks}">{{toggleWeeksText}}<\/button>\n\t\t\t<button type="button" class="btn btn-sm btn-danger" ng-click="clear()">{{clearText}}<\/button>\n\t\t<\/span>\n\t\t<button type="button" class="btn btn-sm btn-success pull-right" ng-click="isOpen = false">{{closeText}}<\/button>\n\t<\/li>\n<\/ul>\n')}]);angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(n){n.put("template/modal/backdrop.html",'<div class="modal-backdrop fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1040 + index*10}"><\/div>')}]);angular.module("template/modal/window.html",[]).run(["$templateCache",function(n){n.put("template/modal/window.html",'<div tabindex="-1" class="modal fade {{ windowClass }}" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n    <div class="modal-dialog"><div class="modal-content" ng-transclude><\/div><\/div>\n<\/div>')}]);angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(n){n.put("template/pagination/pager.html",'<ul class="pager">\n  <li ng-repeat="page in pages" ng-class="{disabled: page.disabled, previous: page.previous, next: page.next}"><a ng-click="selectPage(page.number)">{{page.text}}<\/a><\/li>\n<\/ul>')}]);angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(n){n.put("template/pagination/pagination.html",'<ul class="pagination">\n  <li ng-repeat="page in pages" ng-class="{active: page.active, disabled: page.disabled}"><a ng-click="selectPage(page.number)">{{page.text}}<\/a><\/li>\n<\/ul>')}]);angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(n){n.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n  <div class="tooltip-arrow"><\/div>\n  <div class="tooltip-inner" bind-html-unsafe="content"><\/div>\n<\/div>\n')}]);angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(n){n.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n  <div class="tooltip-arrow"><\/div>\n  <div class="tooltip-inner" ng-bind="content"><\/div>\n<\/div>\n')}]);angular.module("template/popover/popover.html",[]).run(["$templateCache",function(n){n.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n  <div class="arrow"><\/div>\n\n  <div class="popover-inner">\n      <h3 class="popover-title" ng-bind="title" ng-show="title"><\/h3>\n      <div class="popover-content" ng-bind="content"><\/div>\n  <\/div>\n<\/div>\n')}]);angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(n){n.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" ng-transclude><\/div>')}]);angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(n){n.put("template/progressbar/progress.html",'<div class="progress" ng-transclude><\/div>')}]);angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(n){n.put("template/progressbar/progressbar.html",'<div class="progress"><div class="progress-bar" ng-class="type && \'progress-bar-\' + type" ng-transclude><\/div><\/div>')}]);angular.module("template/rating/rating.html",[]).run(["$templateCache",function(n){n.put("template/rating/rating.html",'<span ng-mouseleave="reset()">\n    <i ng-repeat="r in range" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < val && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')"><\/i>\n<\/span>')}]);angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(n){n.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n  <a ng-click="select()" tab-heading-transclude>{{heading}}<\/a>\n<\/li>\n')}]);angular.module("template/tabs/tabset-titles.html",[]).run(["$templateCache",function(n){n.put("template/tabs/tabset-titles.html","<ul class=\"nav {{type && 'nav-' + type}}\" ng-class=\"{'nav-stacked': vertical}\">\n<\/ul>\n")}]);angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(n){n.put("template/tabs/tabset.html",'\n<div class="tabbable">\n  <ul class="nav {{type && \'nav-\' + type}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude><\/ul>\n  <div class="tab-content">\n    <div class="tab-pane" \n         ng-repeat="tab in tabs" \n         ng-class="{active: tab.active}"\n         tab-content-transclude="tab">\n    <\/div>\n  <\/div>\n<\/div>\n')}]);angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(n){n.put("template/timepicker/timepicker.html",'<table>\n\t<tbody>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"><\/span><\/a><\/td>\n\t\t\t<td>&nbsp;<\/td>\n\t\t\t<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"><\/span><\/a><\/td>\n\t\t\t<td ng-show="showMeridian"><\/td>\n\t\t<\/tr>\n\t\t<tr>\n\t\t\t<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n\t\t\t\t<input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t<\/td>\n\t\t\t<td>:<\/td>\n\t\t\t<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n\t\t\t\t<input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t<\/td>\n\t\t\t<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}<\/button><\/td>\n\t\t<\/tr>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"><\/span><\/a><\/td>\n\t\t\t<td>&nbsp;<\/td>\n\t\t\t<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"><\/span><\/a><\/td>\n\t\t\t<td ng-show="showMeridian"><\/td>\n\t\t<\/tr>\n\t<\/tbody>\n<\/table>\n')}]);angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(n){n.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"><\/a>')}]);angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(n){n.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-style="{display: isOpen()&&\'block\' || \'none\', top: position.top+\'px\', left: position.left+\'px\'}">\n    <li ng-repeat="match in matches" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)">\n        <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"><\/div>\n    <\/li>\n<\/ul>')}]),function(n){n.module("scaffolding",["ngResource","ui.select2","ui.jq"])}(angular),function(n){n.module("scaffolding").directive("scDatepicker",function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){t.datepicker({format:"dd.mm.yyyy",startView:0,language:i.lang||"bg",startDate:new Date(Date.parse(i.minDate))||new Date(-1),autoclose:!0}).on("changeDate",function(t){r.$setViewValue(t.date);n.$apply()});t.keydown(function(){function i(n){return/^-{0,1}\d*\.{0,1}\d+$/.test(n)}var t=$(this),n;if(t.val().length>10)$(this).val(t.val().substring(0,9));else for(n=0;n<t.val().length;n++)if(n===2||n===5){if(t.val()[n]!=="."){$(this).val(t.val().substring(0,n));break}}else if(!i(t.val()[n])){$(this).val(t.val().substring(0,n));break}});t.change(function(){/(^((([0][1-9]|1[0-9]|2[0-8])\.(0[1-9]|1[012]))|((29|30|31)\.(0[13578]|1[02]))|((29|30)\.(0[4,6,9]|11)))\.(19|[2-9][0-9])\d\d$)|(^29\.02\.(19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)/.test($(this).val())||$(this).val("")})}}})}(angular),function(n){n.module("scaffolding").directive("autoGrow",["$timeout","$window",function(t,i){return{require:"ngModel",restrict:"A, C",link:function(r,u,f,e){function it(){var t=k;tt=o;s=getComputedStyle(o);n.forEach(ot,function(n){t+=n+":"+s.getPropertyValue(n)+";"});h.setAttribute("style",t)}function y(){var u,i,n,f,e;tt!==o&&it();v||(v=!0,h.value=o.value+rt+" ",h.style.overflowY=o.style.overflowY,u=o.style.height===""?"auto":parseInt(o.style.height,10),i=getComputedStyle(o).getPropertyValue("width"),i.substr(i.length-2,2)==="px"&&(f=parseInt(i,10)-a.width,h.style.width=f+"px"),n=h.scrollHeight,n>c?(n=c,e="scroll"):n<nt&&(n=nt),n+=a.height,o.style.overflowY=e||"hidden",u!==n&&(o.style.height=n+"px",r.$emit("elastic:resize",l)),t(function(){v=!1},1))}function p(){v=!1;y()}var o=u[0],l=u,w;if(o.nodeName==="TEXTAREA"&&i.getComputedStyle){l.css({overflow:"hidden","overflow-y":"hidden","word-wrap":"break-word"});w=o.value;o.value="";o.value=w;var rt=f.msdElastic?f.msdElastic.replace(/\\n/g,"\n"):{append:""}.append,b=n.element(i),k="position: absolute; top: -999px; right: auto; bottom: auto;left: 0; overflow: hidden; -webkit-box-sizing: content-box;-moz-box-sizing: content-box; box-sizing: content-box;min-height: 0 !important; height: 0 !important; padding: 0;word-wrap: break-word; border: 0;",d=n.element('<textarea tabindex="-1" style="'+k+'"/>').data("elastic",!0),h=d[0],s=getComputedStyle(o),g=s.getPropertyValue("resize"),ut=s.getPropertyValue("box-sizing")==="border-box"||s.getPropertyValue("-moz-box-sizing")==="border-box"||s.getPropertyValue("-webkit-box-sizing")==="border-box",a=ut?{width:parseInt(s.getPropertyValue("border-right-width"),10)+parseInt(s.getPropertyValue("padding-right"),10)+parseInt(s.getPropertyValue("padding-left"),10)+parseInt(s.getPropertyValue("border-left-width"),10),height:parseInt(s.getPropertyValue("border-top-width"),10)+parseInt(s.getPropertyValue("padding-top"),10)+parseInt(s.getPropertyValue("padding-bottom"),10)+parseInt(s.getPropertyValue("border-bottom-width"),10)}:{width:0,height:0},ft=parseInt(parseInt(s.getPropertyValue("line-height"),10)+a.height,10),et=parseInt(s.getPropertyValue("height"),10),nt=Math.max(ft,et)-a.height,c=parseInt(s.getPropertyValue("max-height"),10),tt,v,ot=["font-family","font-size","font-weight","font-style","letter-spacing","line-height","text-transform","word-spacing","text-indent"];l.data("elastic")||(c=c&&c>0?c:9e4,h.parentNode!==document.body&&n.element(document.body).append(h),l.css({resize:g==="none"||g==="vertical"?"none":"horizontal"}).data("elastic",!0),o.oninput="onpropertychange"in o&&"oninput"in o?o.onkeyup=y:o.onkeyup=y,b.bind("resize",p),r.$watch(function(){return e.$modelValue},function(){p()}),r.$on("elastic:adjust",function(){it();p()}),t(y),r.$on("$destroy",function(){d.remove();b.unbind("resize",p)}))}}}}])}(angular),function(n){n.module("scaffolding").directive("scDisabled",function(){return{restrict:"A",priority:0,link:function(n,t,i){n.$watch(i.scDisabled,function(n){n?t.attr("disabled","disabled"):t.removeAttr("disabled")})}}})}(angular);angular.module("datepicker",[]).directive("picker",[function(){return{restrict:"A",require:"ngModel",link:function(n,t,i,r){t.datepicker($.extend({onSelect:function(t){r.$setViewValue(t);n.$apply()}},$.datepicker.regional[i.picker]));t.keydown(function(){function i(n){return/^-{0,1}\d*\.{0,1}\d+$/.test(n)}var t=$(this),n;if(t.val().length>10)$(this).val(t.val().substring(0,9));else for(n=0;n<t.val().length;n++)if(n===2||n===5){if(t.val()[n]!=="."){$(this).val(t.val().substring(0,n));break}}else if(!i(t.val()[n])){$(this).val(t.val().substring(0,n));break}});t.change(function(){/(^((([0][1-9]|1[0-9]|2[0-8])\.(0[1-9]|1[012]))|((29|30|31)\.(0[13578]|1[02]))|((29|30)\.(0[4,6,9]|11)))\.(19|[2-9][0-9])\d\d$)|(^29\.02\.(19|[2-9][0-9])(00|04|08|12|16|20|24|28|32|36|40|44|48|52|56|60|64|68|72|76|80|84|88|92|96)$)/.test($(this).val())||$(this).val("")})}}}]),function(n){n.module("scaffolding").constant("scNomenclatureConfig",{pageSize:20}).factory("nomenclatures",["$resource",function(n){return n("/bg/nomenclature/:alias/:params")}]).directive("scNomenclature",["nomenclatures","scNomenclatureConfig",function(t,i){return{restrict:"E",replace:!0,template:'<input type="hidden" ui-select2="select2Options" class="form-control" />',scope:{scAlias:"@",scParentId:"="},require:"ngModel",link:{pre:function(r,u,f,e){var o=n.isDefined(f.multiple),s=n.isDefined(f.scParentId);s&&r.$watch("scParentId",function(t,i){t!==i&&i&&e.$modelValue!=null&&(o?e.$modelValue.length>0&&(e.$setViewValue({}),e.$render()):r.scParentId==e.$modelValue.parentId&&n.isDefined(e.$modelValue.parentId)||(e.$setViewValue({id:"",text:""}),e.$render()))});r.select2Options={multiple:o,allowClear:!0,placeholder:" ",query:function(n){var u=i.pageSize,e=n.page-1,f={alias:r.scAlias,term:n.term,offset:e*u,limit:u};s&&(f.parentId=r.scParentId);t.query(f).$promise.then(function(t){n.callback({results:t,more:t.length===u})},function(n){console.log(n)})}}}}}}])}(angular),function(n){n.module("scaffolding").directive("confirmClick",[function(){return{link:function(n,t,i){var r=i.confirmClick;t.confirmation({container:"body",btnOkLabel:$("#res_yes").val(),btnCancelLabel:$("#res_no").val(),title:$("#res_confirm").val(),popout:!0,onConfirm:function(){n.$apply(function(){n.$eval(r)})}})}}}])}(angular),function(n){n.module("scaffolding").directive("scValidationPopover",[function(){return{restrict:"A",link:function(n,t){$(t).popover({container:"body",content:function(){if(typeof validationSummaryErrors!="undefined"){var n=this;return this.tagName==="DIV"?(n=$(this).parent().find("input.validation-error-key, select.validation-error-key").first(),typeof n=="undefined"):this.tagName==="SELECT"&&$(this).attr("ng-model")?n=$(this).parent().find(".input-validation-error[name], .validation-error-key[name]").first():this.tagName==="TD"&&(n=$(this).find("input.validation-error-key, select.validation-error-key").first()),validationSummaryErrors[$(n).attr("name")]}},placement:"top",trigger:"hover",template:'<div class="popover popover-error" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'})}}}])}(angular),function(n){n.module("scaffolding").directive("scFile",["$q",function(n){return{restrict:"E",priority:10,replace:!0,scope:{model:"=ngModel",path:"@",resources:"=",url:"@"},templateUrl:"/Scripts/angular/directives/file/fileDirective.html",link:{pre:function(t,i,r){t.progress=0;t.showLinks=r.showLinks?r.showLinks=="true":!0;t.model==null&&(t.model={});t.showUploader=(t.model.ElectronicDocumentWithUnstructuredContentUniqueIdentifier||"").length<=0;var u;t.add=function(i,r){t.model.ElectronicDocumentWithUnstructuredContentName=r.files[0].name;t.model.ElectronicDocumentWithUnstructuredContentSize=r.files[0].size;t.model.ElectronicDocumentWithUnstructuredContentMimeType=r.files[0].type;u=n.defer();u.promise.then(function(n){t.model.ElectronicDocumentWithUnstructuredContentUniqueIdentifier=n.result.fileKey;t.model.ElectronicDocumentWithUnstructuredContentHash=n.result.hash;t.showUploader=(n.result.fileKey||"").length<=0});r.submit()};t.done=function(n,t){u.resolve(t)};t.progressall=function(n,i){t.$apply(function(){t.progress=parseInt(i.loaded/i.total*100,10)})};t.delete=function(){t.showUploader=!0;t.progress=0;t.model.ElectronicDocumentWithUnstructuredContentName=null;t.model.ElectronicDocumentWithUnstructuredContentSize=null;t.model.ElectronicDocumentWithUnstructuredContentMimeType=null;t.model.ElectronicDocumentWithUnstructuredContentUniqueIdentifier=null;t.model.ElectronicDocumentWithUnstructuredContentHash=null};t.options={dataType:"json",url:t.url,add:t.add,done:t.done,progressall:t.progressall}}}}}])}(angular),function(n){n.module("scaffolding").directive("money",function(){return{require:"ngModel",link:function(n,t,i,r){function e(n){return RegExp("\\d|\\"+n,"g")}function o(n){return RegExp("((\\"+n+")|([0-9]{1,}\\"+n+"?))&?[0-9]*","g")}function s(n){return RegExp("\\"+n,"g")}function c(n){n=String(n);var i=",",t=null;return n.match(s(i))?(t=n.match(e(i)).join("").match(o(i)),t=t?t[0].replace(i,"."):null):n.match(s("."))?(t=n.match(e(".")).join("").match(o(".")),t=t?t[0]:null):(t=n.match(/\d/g),t=t?t.join(""):null),t}var u=i.minValue?parseFloat(i.minValue):null,f=i.maxValue?parseFloat(i.maxValue):null,h=i.digitsCount?parseInt(i.digitsCount):2;r.$parsers.push(function(n){var i=c(n),t=parseFloat(i);return u&&t<u&&(t=u),f&&t>f&&(t=f),isNaN(t)?"":t.toFixed(h)||""});t.on("blur",function(){t.val(r.$modelValue)})}}})}(angular)