text: /* =========================================================
   * bootstrap-datepicker.js
   * Repo: https://github.com/eternicode/bootstrap-datepicker/
   * Demo: http://eternicode.github.io/bootstrap-datepicker/
   * Docs: http://bootstrap-datepicker.readthedocs.org/
   * Forked from http://www.eyecon.ro/bootstrap-datepicker
   * =========================================================
   * Started by Stefan Petre; improvements by Andrew Rowls + contributors
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ========================================================= */
  
  (function($, undefined){
  
  	var $window = $(window);
  
  	function UTCDate(){
  		return new Date(Date.UTC.apply(Date, arguments));
  	}
  	function UTCToday(){
  		var today = new Date();
  		return UTCDate(today.getFullYear(), today.getMonth(), today.getDate());
  	}
  	function alias(method){
  		return function(){
  			return this[method].apply(this, arguments);
  		};
  	}
  
  	var DateArray = (function(){
  		var extras = {
  			get: function(i){
  				return this.slice(i)[0];
  			},
  			contains: function(d){
  				// Array.indexOf is not cross-browser;
  				// $.inArray doesn't work with Dates
  				var val = d && d.valueOf();
  				for (var i=0, l=this.length; i < l; i++)
  					if (this[i].valueOf() === val)
  						return i;
  				return -1;
  			},
  			remove: function(i){
  				this.splice(i,1);
  			},
  			replace: function(new_array){
  				if (!new_array)
  					return;
  				if (!$.isArray(new_array))
  					new_array = [new_array];
  				this.clear();
  				this.push.apply(this, new_array);
  			},
  			clear: function(){
  				this.splice(0);
  			},
  			copy: function(){
  				var a = new DateArray();
  				a.replace(this);
  				return a;
  			}
  		};
  
  		return function(){
  			var a = [];
  			a.push.apply(a, arguments);
  			$.extend(a, extras);
  			return a;
  		};
  	})();
  
  
  	// Picker object
  
  	var Datepicker = function(element, options){
  		this.dates = new DateArray();
  		this.viewDate = UTCToday();
  		this.focusDate = null;
  
  		this._process_options(options);
  
  		this.element = $(element);
  		this.isInline = false;
  		this.isInput = this.element.is('input');
  		this.component = this.element.is('.date') ? this.element.find('.add-on, .input-group-addon, .btn') : false;
  		this.hasInput = this.component && this.element.find('input').length;
  		if (this.component && this.component.length === 0)
  			this.component = false;
  
  		this.picker = $(DPGlobal.template);
  		this._buildEvents();
  		this._attachEvents();
  
  		if (this.isInline){
  			this.picker.addClass('datepicker-inline').appendTo(this.element);
  		}
  		else {
  			this.picker.addClass('datepicker-dropdown dropdown-menu');
  		}
  
  		if (this.o.rtl){
  			this.picker.addClass('datepicker-rtl');
  		}
  
  		this.viewMode = this.o.startView;
  
  		if (this.o.calendarWeeks)
  			this.picker.find('tfoot th.today')
  						.attr('colspan', function(i, val){
  							return parseInt(val) + 1;
  						});
  
  		this._allow_update = false;
  
  		this.setStartDate(this._o.startDate);
  		this.setEndDate(this._o.endDate);
  		this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);
  
  		this.fillDow();
  		this.fillMonths();
  
  		this._allow_update = true;
  
  		this.update();
  		this.showMode();
  
  		if (this.isInline){
  			this.show();
  		}
  	};
  
  	Datepicker.prototype = {
  		constructor: Datepicker,
  
  		_process_options: function(opts){
  			// Store raw options for reference
  			this._o = $.extend({}, this._o, opts);
  			// Processed options
  			var o = this.o = $.extend({}, this._o);
  
  			// Check if "de-DE" style date is available, if not language should
  			// fallback to 2 letter code eg "de"
  			var lang = o.language;
  			if (!dates[lang]){
  				lang = lang.split('-')[0];
  				if (!dates[lang])
  					lang = defaults.language;
  			}
  			o.language = lang;
  
  			switch (o.startView){
  				case 2:
  				case 'decade':
  					o.startView = 2;
  					break;
  				case 1:
  				case 'year':
  					o.startView = 1;
  					break;
  				default:
  					o.startView = 0;
  			}
  
  			switch (o.minViewMode){
  				case 1:
  				case 'months':
  					o.minViewMode = 1;
  					break;
  				case 2:
  				case 'years':
  					o.minViewMode = 2;
  					break;
  				default:
  					o.minViewMode = 0;
  			}
  
  			o.startView = Math.max(o.startView, o.minViewMode);
  
  			// true, false, or Number > 0
  			if (o.multidate !== true){
  				o.multidate = Number(o.multidate) || false;
  				if (o.multidate !== false)
  					o.multidate = Math.max(0, o.multidate);
  				else
  					o.multidate = 1;
  			}
  			o.multidateSeparator = String(o.multidateSeparator);
  
  			o.weekStart %= 7;
  			o.weekEnd = ((o.weekStart + 6) % 7);
  
  			var format = DPGlobal.parseFormat(o.format);
  			if (o.startDate !== -Infinity){
  				if (!!o.startDate){
  					if (o.startDate instanceof Date)
  						o.startDate = this._local_to_utc(this._zero_time(o.startDate));
  					else
  						o.startDate = DPGlobal.parseDate(o.startDate, format, o.language);
  				}
  				else {
  					o.startDate = -Infinity;
  				}
  			}
  			if (o.endDate !== Infinity){
  				if (!!o.endDate){
  					if (o.endDate instanceof Date)
  						o.endDate = this._local_to_utc(this._zero_time(o.endDate));
  					else
  						o.endDate = DPGlobal.parseDate(o.endDate, format, o.language);
  				}
  				else {
  					o.endDate = Infinity;
  				}
  			}
  
  			o.daysOfWeekDisabled = o.daysOfWeekDisabled||[];
  			if (!$.isArray(o.daysOfWeekDisabled))
  				o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/);
  			o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){
  				return parseInt(d, 10);
  			});
  
  			var plc = String(o.orientation).toLowerCase().split(/\s+/g),
  				_plc = o.orientation.toLowerCase();
  			plc = $.grep(plc, function(word){
  				return (/^auto|left|right|top|bottom$/).test(word);
  			});
  			o.orientation = {x: 'auto', y: 'auto'};
  			if (!_plc || _plc === 'auto')
  				; // no action
  			else if (plc.length === 1){
  				switch (plc[0]){
  					case 'top':
  					case 'bottom':
  						o.orientation.y = plc[0];
  						break;
  					case 'left':
  					case 'right':
  						o.orientation.x = plc[0];
  						break;
  				}
  			}
  			else {
  				_plc = $.grep(plc, function(word){
  					return (/^left|right$/).test(word);
  				});
  				o.orientation.x = _plc[0] || 'auto';
  
  				_plc = $.grep(plc, function(word){
  					return (/^top|bottom$/).test(word);
  				});
  				o.orientation.y = _plc[0] || 'auto';
  			}
  		},
  		_events: [],
  		_secondaryEvents: [],
  		_applyEvents: function(evs){
  			for (var i=0, el, ch, ev; i < evs.length; i++){
  				el = evs[i][0];
  				if (evs[i].length === 2){
  					ch = undefined;
  					ev = evs[i][1];
  				}
  				else if (evs[i].length === 3){
  					ch = evs[i][1];
  					ev = evs[i][2];
  				}
  				el.on(ev, ch);
  			}
  		},
  		_unapplyEvents: function(evs){
  			for (var i=0, el, ev, ch; i < evs.length; i++){
  				el = evs[i][0];
  				if (evs[i].length === 2){
  					ch = undefined;
  					ev = evs[i][1];
  				}
  				else if (evs[i].length === 3){
  					ch = evs[i][1];
  					ev = evs[i][2];
  				}
  				el.off(ev, ch);
  			}
  		},
  		_buildEvents: function(){
  			if (this.isInput){ // single input
  				this._events = [
  					[this.element, {
  						focus: $.proxy(this.show, this),
  						keyup: $.proxy(function(e){
  							if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
  								this.update();
  						}, this),
  						keydown: $.proxy(this.keydown, this)
  					}]
  				];
  			}
  			else if (this.component && this.hasInput){ // component: input + button
  				this._events = [
  					// For components that are not readonly, allow keyboard nav
  					[this.element.find('input'), {
  						focus: $.proxy(this.show, this),
  						keyup: $.proxy(function(e){
  							if ($.inArray(e.keyCode, [27,37,39,38,40,32,13,9]) === -1)
  								this.update();
  						}, this),
  						keydown: $.proxy(this.keydown, this)
  					}],
  					[this.component, {
  						click: $.proxy(this.show, this)
  					}]
  				];
  			}
  			else if (this.element.is('div')){  // inline datepicker
  				this.isInline = true;
  			}
  			else {
  				this._events = [
  					[this.element, {
  						click: $.proxy(this.show, this)
  					}]
  				];
  			}
  			this._events.push(
  				// Component: listen for blur on element descendants
  				[this.element, '*', {
  					blur: $.proxy(function(e){
  						this._focused_from = e.target;
  					}, this)
  				}],
  				// Input: listen for blur on element
  				[this.element, {
  					blur: $.proxy(function(e){
  						this._focused_from = e.target;
  					}, this)
  				}]
  			);
  
  			this._secondaryEvents = [
  				[this.picker, {
  					click: $.proxy(this.click, this)
  				}],
  				[$(window), {
  					resize: $.proxy(this.place, this)
  				}],
  				[$(document), {
  					'mousedown touchstart': $.proxy(function(e){
  						// Clicked outside the datepicker, hide it
  						if (!(
  							this.element.is(e.target) ||
  							this.element.find(e.target).length ||
  							this.picker.is(e.target) ||
  							this.picker.find(e.target).length
  						)){
  							this.hide();
  						}
  					}, this)
  				}]
  			];
  		},
  		_attachEvents: function(){
  			this._detachEvents();
  			this._applyEvents(this._events);
  		},
  		_detachEvents: function(){
  			this._unapplyEvents(this._events);
  		},
  		_attachSecondaryEvents: function(){
  			this._detachSecondaryEvents();
  			this._applyEvents(this._secondaryEvents);
  		},
  		_detachSecondaryEvents: function(){
  			this._unapplyEvents(this._secondaryEvents);
  		},
  		_trigger: function(event, altdate){
  			var date = altdate || this.dates.get(-1),
  				local_date = this._utc_to_local(date);
  
  			this.element.trigger({
  				type: event,
  				date: local_date,
  				dates: $.map(this.dates, this._utc_to_local),
  				format: $.proxy(function(ix, format){
  					if (arguments.length === 0){
  						ix = this.dates.length - 1;
  						format = this.o.format;
  					}
  					else if (typeof ix === 'string'){
  						format = ix;
  						ix = this.dates.length - 1;
  					}
  					format = format || this.o.format;
  					var date = this.dates.get(ix);
  					return DPGlobal.formatDate(date, format, this.o.language);
  				}, this)
  			});
  		},
  
  		show: function(){
  			if (!this.isInline)
  				this.picker.appendTo('body');
  			this.picker.show();
  			this.place();
  			this._attachSecondaryEvents();
  			this._trigger('show');
  		},
  
  		hide: function(){
  			if (this.isInline)
  				return;
  			if (!this.picker.is(':visible'))
  				return;
  			this.focusDate = null;
  			this.picker.hide().detach();
  			this._detachSecondaryEvents();
  			this.viewMode = this.o.startView;
  			this.showMode();
  
  			if (
  				this.o.forceParse &&
  				(
  					this.isInput && this.element.val() ||
  					this.hasInput && this.element.find('input').val()
  				)
  			)
  				this.setValue();
  			this._trigger('hide');
  		},
  
  		remove: function(){
  			this.hide();
  			this._detachEvents();
  			this._detachSecondaryEvents();
  			this.picker.remove();
  			delete this.element.data().datepicker;
  			if (!this.isInput){
  				delete this.element.data().date;
  			}
  		},
  
  		_utc_to_local: function(utc){
  			return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000));
  		},
  		_local_to_utc: function(local){
  			return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000));
  		},
  		_zero_time: function(local){
  			return local && new Date(local.getFullYear(), local.getMonth(), local.getDate());
  		},
  		_zero_utc_time: function(utc){
  			return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate()));
  		},
  
  		getDates: function(){
  			return $.map(this.dates, this._utc_to_local);
  		},
  
  		getUTCDates: function(){
  			return $.map(this.dates, function(d){
  				return new Date(d);
  			});
  		},
  
  		getDate: function(){
  			return this._utc_to_local(this.getUTCDate());
  		},
  
  		getUTCDate: function(){
  			return new Date(this.dates.get(-1));
  		},
  
  		setDates: function(){
  			var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
  			this.update.apply(this, args);
  			this._trigger('changeDate');
  			this.setValue();
  		},
  
  		setUTCDates: function(){
  			var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
  			this.update.apply(this, $.map(args, this._utc_to_local));
  			this._trigger('changeDate');
  			this.setValue();
  		},
  
  		setDate: alias('setDates'),
  		setUTCDate: alias('setUTCDates'),
  
  		setValue: function(){
  			var formatted = this.getFormattedDate();
  			if (!this.isInput){
  				if (this.component){
  					this.element.find('input').val(formatted).change();
  				}
  			}
  			else {
  				this.element.val(formatted).change();
  			}
  		},
  
  		getFormattedDate: function(format){
  			if (format === undefined)
  				format = this.o.format;
  
  			var lang = this.o.language;
  			return $.map(this.dates, function(d){
  				return DPGlobal.formatDate(d, format, lang);
  			}).join(this.o.multidateSeparator);
  		},
  
  		setStartDate: function(startDate){
  			this._process_options({startDate: startDate});
  			this.update();
  			this.updateNavArrows();
  		},
  
  		setEndDate: function(endDate){
  			this._process_options({endDate: endDate});
  			this.update();
  			this.updateNavArrows();
  		},
  
  		setDaysOfWeekDisabled: function(daysOfWeekDisabled){
  			this._process_options({daysOfWeekDisabled: daysOfWeekDisabled});
  			this.update();
  			this.updateNavArrows();
  		},
  
  		place: function(){
  			if (this.isInline)
  				return;
  			var calendarWidth = this.picker.outerWidth(),
  				calendarHeight = this.picker.outerHeight(),
  				visualPadding = 10,
  				windowWidth = $window.width(),
  				windowHeight = $window.height(),
  				scrollTop = $window.scrollTop();
  
  			var zIndex = parseInt(this.element.parents().filter(function(){
  					return $(this).css('z-index') !== 'auto';
  				}).first().css('z-index'))+1070;
  			var offset = this.component ? this.component.parent().offset() : this.element.offset();
  			var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false);
  			var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false);
  			var left = offset.left,
  				top = offset.top;
  
  			this.picker.removeClass(
  				'datepicker-orient-top datepicker-orient-bottom '+
  				'datepicker-orient-right datepicker-orient-left'
  			);
  
  			if (this.o.orientation.x !== 'auto'){
  				this.picker.addClass('datepicker-orient-' + this.o.orientation.x);
  				if (this.o.orientation.x === 'right')
  					left -= calendarWidth - width;
  			}
  			// auto x orientation is best-placement: if it crosses a window
  			// edge, fudge it sideways
  			else {
  				// Default to left
  				this.picker.addClass('datepicker-orient-left');
  				if (offset.left < 0)
  					left -= offset.left - visualPadding;
  				else if (offset.left + calendarWidth > windowWidth)
  					left = windowWidth - calendarWidth - visualPadding;
  			}
  
  			// auto y orientation is best-situation: top or bottom, no fudging,
  			// decision based on which shows more of the calendar
  			var yorient = this.o.orientation.y,
  				top_overflow, bottom_overflow;
  			if (yorient === 'auto'){
  				top_overflow = -scrollTop + offset.top - calendarHeight;
  				bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight);
  				if (Math.max(top_overflow, bottom_overflow) === bottom_overflow)
  					yorient = 'top';
  				else
  					yorient = 'bottom';
  			}
  			this.picker.addClass('datepicker-orient-' + yorient);
  			if (yorient === 'top')
  				top += height;
  			else
  				top -= calendarHeight + parseInt(this.picker.css('padding-top'));
  
  			this.picker.css({
  				top: top,
  				left: left,
  				zIndex: zIndex
  			});
  		},
  
  		_allow_update: true,
  		update: function(){
  			if (!this._allow_update)
  				return;
  
  			var oldDates = this.dates.copy(),
  				dates = [],
  				fromArgs = false;
  			if (arguments.length){
  				$.each(arguments, $.proxy(function(i, date){
  					if (date instanceof Date)
  						date = this._local_to_utc(date);
  					dates.push(date);
  				}, this));
  				fromArgs = true;
  			}
  			else {
  				dates = this.isInput
  						? this.element.val()
  						: this.element.data('date') || this.element.find('input').val();
  				if (dates && this.o.multidate)
  					dates = dates.split(this.o.multidateSeparator);
  				else
  					dates = [dates];
  				delete this.element.data().date;
  			}
  
  			dates = $.map(dates, $.proxy(function(date){
  				return DPGlobal.parseDate(date, this.o.format, this.o.language);
  			}, this));
  			dates = $.grep(dates, $.proxy(function(date){
  				return (
  					date < this.o.startDate ||
  					date > this.o.endDate ||
  					!date
  				);
  			}, this), true);
  			this.dates.replace(dates);
  
  			if (this.dates.length)
  				this.viewDate = new Date(this.dates.get(-1));
  			else if (this.viewDate < this.o.startDate)
  				this.viewDate = new Date(this.o.startDate);
  			else if (this.viewDate > this.o.endDate)
  				this.viewDate = new Date(this.o.endDate);
  
  			if (fromArgs){
  				// setting date by clicking
  				this.setValue();
  			}
  			else if (dates.length){
  				// setting date by typing
  				if (String(oldDates) !== String(this.dates))
  					this._trigger('changeDate');
  			}
  			if (!this.dates.length && oldDates.length)
  				this._trigger('clearDate');
  
  			this.fill();
  		},
  
  		fillDow: function(){
  			var dowCnt = this.o.weekStart,
  				html = '<tr>';
  			if (this.o.calendarWeeks){
  				var cell = '<th class="cw">&nbsp;</th>';
  				html += cell;
  				this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
  			}
  			while (dowCnt < this.o.weekStart + 7){
  				html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>';
  			}
  			html += '</tr>';
  			this.picker.find('.datepicker-days thead').append(html);
  		},
  
  		fillMonths: function(){
  			var html = '',
  			i = 0;
  			while (i < 12){
  				html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>';
  			}
  			this.picker.find('.datepicker-months td').html(html);
  		},
  
  		setRange: function(range){
  			if (!range || !range.length)
  				delete this.range;
  			else
  				this.range = $.map(range, function(d){
  					return d.valueOf();
  				});
  			this.fill();
  		},
  
  		getClassNames: function(date){
  			var cls = [],
  				year = this.viewDate.getUTCFullYear(),
  				month = this.viewDate.getUTCMonth(),
  				today = new Date();
  			if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){
  				cls.push('old');
  			}
  			else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){
  				cls.push('new');
  			}
  			if (this.focusDate && date.valueOf() === this.focusDate.valueOf())
  				cls.push('focused');
  			// Compare internal UTC date with local today, not UTC today
  			if (this.o.todayHighlight &&
  				date.getUTCFullYear() === today.getFullYear() &&
  				date.getUTCMonth() === today.getMonth() &&
  				date.getUTCDate() === today.getDate()){
  				cls.push('today');
  			}
  			if (this.dates.contains(date) !== -1)
  				cls.push('active');
  			if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate ||
  				$.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1){
  				cls.push('disabled');
  			}
  			if (this.range){
  				if (date > this.range[0] && date < this.range[this.range.length-1]){
  					cls.push('range');
  				}
  				if ($.inArray(date.valueOf(), this.range) !== -1){
  					cls.push('selected');
  				}
  			}
  			return cls;
  		},
  
  		fill: function(){
  			var d = new Date(this.viewDate),
  				year = d.getUTCFullYear(),
  				month = d.getUTCMonth(),
  				startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity,
  				startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity,
  				endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity,
  				endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity,
  				todaytxt = dates[this.o.language].today || dates['en'].today || '',
  				cleartxt = dates[this.o.language].clear || dates['en'].clear || '',
  				tooltip;
  			this.picker.find('.datepicker-days thead th.datepicker-switch')
  						.text(dates[this.o.language].months[month]+' '+year);
  			this.picker.find('tfoot th.today')
  						.text(todaytxt)
  						.toggle(this.o.todayBtn !== false);
  			this.picker.find('tfoot th.clear')
  						.text(cleartxt)
  						.toggle(this.o.clearBtn !== false);
  			this.updateNavArrows();
  			this.fillMonths();
  			var prevMonth = UTCDate(year, month-1, 28),
  				day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
  			prevMonth.setUTCDate(day);
  			prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7);
  			var nextMonth = new Date(prevMonth);
  			nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
  			nextMonth = nextMonth.valueOf();
  			var html = [];
  			var clsName;
  			while (prevMonth.valueOf() < nextMonth){
  				if (prevMonth.getUTCDay() === this.o.weekStart){
  					html.push('<tr>');
  					if (this.o.calendarWeeks){
  						// ISO 8601: First week contains first thursday.
  						// ISO also states week starts on Monday, but we can be more abstract here.
  						var
  							// Start of current week: based on weekstart/current date
  							ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5),
  							// Thursday of this week
  							th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5),
  							// First Thursday of year, year from thursday
  							yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5),
  							// Calendar week: ms between thursdays, div ms per day, div 7 days
  							calWeek =  (th - yth) / 864e5 / 7 + 1;
  						html.push('<td class="cw">'+ calWeek +'</td>');
  
  					}
  				}
  				clsName = this.getClassNames(prevMonth);
  				clsName.push('day');
  
  				if (this.o.beforeShowDay !== $.noop){
  					var before = this.o.beforeShowDay(this._utc_to_local(prevMonth));
  					if (before === undefined)
  						before = {};
  					else if (typeof(before) === 'boolean')
  						before = {enabled: before};
  					else if (typeof(before) === 'string')
  						before = {classes: before};
  					if (before.enabled === false)
  						clsName.push('disabled');
  					if (before.classes)
  						clsName = clsName.concat(before.classes.split(/\s+/));
  					if (before.tooltip)
  						tooltip = before.tooltip;
  				}
  
  				clsName = $.unique(clsName);
  				html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
  				if (prevMonth.getUTCDay() === this.o.weekEnd){
  					html.push('</tr>');
  				}
  				prevMonth.setUTCDate(prevMonth.getUTCDate()+1);
  			}
  			this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
  
  			var months = this.picker.find('.datepicker-months')
  						.find('th:eq(1)')
  							.text(year)
  							.end()
  						.find('span').removeClass('active');
  
  			$.each(this.dates, function(i, d){
  				if (d.getUTCFullYear() === year)
  					months.eq(d.getUTCMonth()).addClass('active');
  			});
  
  			if (year < startYear || year > endYear){
  				months.addClass('disabled');
  			}
  			if (year === startYear){
  				months.slice(0, startMonth).addClass('disabled');
  			}
  			if (year === endYear){
  				months.slice(endMonth+1).addClass('disabled');
  			}
  
  			html = '';
  			year = parseInt(year/10, 10) * 10;
  			var yearCont = this.picker.find('.datepicker-years')
  								.find('th:eq(1)')
  									.text(year + '-' + (year + 9))
  									.end()
  								.find('td');
  			year -= 1;
  			var years = $.map(this.dates, function(d){
  					return d.getUTCFullYear();
  				}),
  				classes;
  			for (var i = -1; i < 11; i++){
  				classes = ['year'];
  				if (i === -1)
  					classes.push('old');
  				else if (i === 10)
  					classes.push('new');
  				if ($.inArray(year, years) !== -1)
  					classes.push('active');
  				if (year < startYear || year > endYear)
  					classes.push('disabled');
  				html += '<span class="' + classes.join(' ') + '">'+year+'</span>';
  				year += 1;
  			}
  			yearCont.html(html);
  		},
  
  		updateNavArrows: function(){
  			if (!this._allow_update)
  				return;
  
  			var d = new Date(this.viewDate),
  				year = d.getUTCFullYear(),
  				month = d.getUTCMonth();
  			switch (this.viewMode){
  				case 0:
  					if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){
  						this.picker.find('.prev').css({visibility: 'hidden'});
  					}
  					else {
  						this.picker.find('.prev').css({visibility: 'visible'});
  					}
  					if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){
  						this.picker.find('.next').css({visibility: 'hidden'});
  					}
  					else {
  						this.picker.find('.next').css({visibility: 'visible'});
  					}
  					break;
  				case 1:
  				case 2:
  					if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()){
  						this.picker.find('.prev').css({visibility: 'hidden'});
  					}
  					else {
  						this.picker.find('.prev').css({visibility: 'visible'});
  					}
  					if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()){
  						this.picker.find('.next').css({visibility: 'hidden'});
  					}
  					else {
  						this.picker.find('.next').css({visibility: 'visible'});
  					}
  					break;
  			}
  		},
  
  		click: function(e){
  			e.preventDefault();
  			var target = $(e.target).closest('span, td, th'),
  				year, month, day;
  			if (target.length === 1){
  				switch (target[0].nodeName.toLowerCase()){
  					case 'th':
  						switch (target[0].className){
  							case 'datepicker-switch':
  								this.showMode(1);
  								break;
  							case 'prev':
  							case 'next':
  								var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
  								switch (this.viewMode){
  									case 0:
  										this.viewDate = this.moveMonth(this.viewDate, dir);
  										this._trigger('changeMonth', this.viewDate);
  										break;
  									case 1:
  									case 2:
  										this.viewDate = this.moveYear(this.viewDate, dir);
  										if (this.viewMode === 1)
  											this._trigger('changeYear', this.viewDate);
  										break;
  								}
  								this.fill();
  								break;
  							case 'today':
  								var date = new Date();
  								date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  
  								this.showMode(-2);
  								var which = this.o.todayBtn === 'linked' ? null : 'view';
  								this._setDate(date, which);
  								break;
  							case 'clear':
  								var element;
  								if (this.isInput)
  									element = this.element;
  								else if (this.component)
  									element = this.element.find('input');
  								if (element)
  									element.val("").change();
  								this.update();
  								this._trigger('changeDate');
  								if (this.o.autoclose)
  									this.hide();
  								break;
  						}
  						break;
  					case 'span':
  						if (!target.is('.disabled')){
  							this.viewDate.setUTCDate(1);
  							if (target.is('.month')){
  								day = 1;
  								month = target.parent().find('span').index(target);
  								year = this.viewDate.getUTCFullYear();
  								this.viewDate.setUTCMonth(month);
  								this._trigger('changeMonth', this.viewDate);
  								if (this.o.minViewMode === 1){
  									this._setDate(UTCDate(year, month, day));
  								}
  							}
  							else {
  								day = 1;
  								month = 0;
  								year = parseInt(target.text(), 10)||0;
  								this.viewDate.setUTCFullYear(year);
  								this._trigger('changeYear', this.viewDate);
  								if (this.o.minViewMode === 2){
  									this._setDate(UTCDate(year, month, day));
  								}
  							}
  							this.showMode(-1);
  							this.fill();
  						}
  						break;
  					case 'td':
  						if (target.is('.day') && !target.is('.disabled')){
  							day = parseInt(target.text(), 10)||1;
  							year = this.viewDate.getUTCFullYear();
  							month = this.viewDate.getUTCMonth();
  							if (target.is('.old')){
  								if (month === 0){
  									month = 11;
  									year -= 1;
  								}
  								else {
  									month -= 1;
  								}
  							}
  							else if (target.is('.new')){
  								if (month === 11){
  									month = 0;
  									year += 1;
  								}
  								else {
  									month += 1;
  								}
  							}
  							this._setDate(UTCDate(year, month, day));
  						}
  						break;
  				}
  			}
  			if (this.picker.is(':visible') && this._focused_from){
  				$(this._focused_from).focus();
  			}
  			delete this._focused_from;
  		},
  
  		_toggle_multidate: function(date){
  			var ix = this.dates.contains(date);
  			if (!date){
  				this.dates.clear();
  			}
  			else if (ix !== -1){
  				this.dates.remove(ix);
  			}
  			else {
  				this.dates.push(date);
  			}
  			if (typeof this.o.multidate === 'number')
  				while (this.dates.length > this.o.multidate)
  					this.dates.remove(0);
  		},
  
  		_setDate: function(date, which){
  			if (!which || which === 'date')
  				this._toggle_multidate(date && new Date(date));
  			if (!which || which  === 'view')
  				this.viewDate = date && new Date(date);
  
  			this.fill();
  			this.setValue();
  			this._trigger('changeDate');
  			var element;
  			if (this.isInput){
  				element = this.element;
  			}
  			else if (this.component){
  				element = this.element.find('input');
  			}
  			if (element){
  				element.change();
  			}
  			if (this.o.autoclose && (!which || which === 'date')){
  				this.hide();
  			}
  		},
  
  		moveMonth: function(date, dir){
  			if (!date)
  				return undefined;
  			if (!dir)
  				return date;
  			var new_date = new Date(date.valueOf()),
  				day = new_date.getUTCDate(),
  				month = new_date.getUTCMonth(),
  				mag = Math.abs(dir),
  				new_month, test;
  			dir = dir > 0 ? 1 : -1;
  			if (mag === 1){
  				test = dir === -1
  					// If going back one month, make sure month is not current month
  					// (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
  					? function(){
  						return new_date.getUTCMonth() === month;
  					}
  					// If going forward one month, make sure month is as expected
  					// (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
  					: function(){
  						return new_date.getUTCMonth() !== new_month;
  					};
  				new_month = month + dir;
  				new_date.setUTCMonth(new_month);
  				// Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
  				if (new_month < 0 || new_month > 11)
  					new_month = (new_month + 12) % 12;
  			}
  			else {
  				// For magnitudes >1, move one month at a time...
  				for (var i=0; i < mag; i++)
  					// ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
  					new_date = this.moveMonth(new_date, dir);
  				// ...then reset the day, keeping it in the new month
  				new_month = new_date.getUTCMonth();
  				new_date.setUTCDate(day);
  				test = function(){
  					return new_month !== new_date.getUTCMonth();
  				};
  			}
  			// Common date-resetting loop -- if date is beyond end of month, make it
  			// end of month
  			while (test()){
  				new_date.setUTCDate(--day);
  				new_date.setUTCMonth(new_month);
  			}
  			return new_date;
  		},
  
  		moveYear: function(date, dir){
  			return this.moveMonth(date, dir*12);
  		},
  
  		dateWithinRange: function(date){
  			return date >= this.o.startDate && date <= this.o.endDate;
  		},
  
  		keydown: function(e){
  			if (this.picker.is(':not(:visible)')){
  				if (e.keyCode === 27) // allow escape to hide and re-show picker
  					this.show();
  				return;
  			}
  			var dateChanged = false,
  				dir, newDate, newViewDate,
  				focusDate = this.focusDate || this.viewDate;
  			switch (e.keyCode){
  				case 27: // escape
  					if (this.focusDate){
  						this.focusDate = null;
  						this.viewDate = this.dates.get(-1) || this.viewDate;
  						this.fill();
  					}
  					else
  						this.hide();
  					e.preventDefault();
  					break;
  				case 37: // left
  				case 39: // right
  					if (!this.o.keyboardNavigation)
  						break;
  					dir = e.keyCode === 37 ? -1 : 1;
  					if (e.ctrlKey){
  						newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
  						newViewDate = this.moveYear(focusDate, dir);
  						this._trigger('changeYear', this.viewDate);
  					}
  					else if (e.shiftKey){
  						newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
  						newViewDate = this.moveMonth(focusDate, dir);
  						this._trigger('changeMonth', this.viewDate);
  					}
  					else {
  						newDate = new Date(this.dates.get(-1) || UTCToday());
  						newDate.setUTCDate(newDate.getUTCDate() + dir);
  						newViewDate = new Date(focusDate);
  						newViewDate.setUTCDate(focusDate.getUTCDate() + dir);
  					}
  					if (this.dateWithinRange(newDate)){
  						this.focusDate = this.viewDate = newViewDate;
  						this.setValue();
  						this.fill();
  						e.preventDefault();
  					}
  					break;
  				case 38: // up
  				case 40: // down
  					if (!this.o.keyboardNavigation)
  						break;
  					dir = e.keyCode === 38 ? -1 : 1;
  					if (e.ctrlKey){
  						newDate = this.moveYear(this.dates.get(-1) || UTCToday(), dir);
  						newViewDate = this.moveYear(focusDate, dir);
  						this._trigger('changeYear', this.viewDate);
  					}
  					else if (e.shiftKey){
  						newDate = this.moveMonth(this.dates.get(-1) || UTCToday(), dir);
  						newViewDate = this.moveMonth(focusDate, dir);
  						this._trigger('changeMonth', this.viewDate);
  					}
  					else {
  						newDate = new Date(this.dates.get(-1) || UTCToday());
  						newDate.setUTCDate(newDate.getUTCDate() + dir * 7);
  						newViewDate = new Date(focusDate);
  						newViewDate.setUTCDate(focusDate.getUTCDate() + dir * 7);
  					}
  					if (this.dateWithinRange(newDate)){
  						this.focusDate = this.viewDate = newViewDate;
  						this.setValue();
  						this.fill();
  						e.preventDefault();
  					}
  					break;
  				case 32: // spacebar
  					// Spacebar is used in manually typing dates in some formats.
  					// As such, its behavior should not be hijacked.
  					break;
  				case 13: // enter
  					focusDate = this.focusDate || this.dates.get(-1) || this.viewDate;
  					this._toggle_multidate(focusDate);
  					dateChanged = true;
  					this.focusDate = null;
  					this.viewDate = this.dates.get(-1) || this.viewDate;
  					this.setValue();
  					this.fill();
  					if (this.picker.is(':visible')){
  						e.preventDefault();
  						if (this.o.autoclose)
  							this.hide();
  					}
  					break;
  				case 9: // tab
  					this.focusDate = null;
  					this.viewDate = this.dates.get(-1) || this.viewDate;
  					this.fill();
  					this.hide();
  					break;
  			}
  			if (dateChanged){
  				if (this.dates.length)
  					this._trigger('changeDate');
  				else
  					this._trigger('clearDate');
  				var element;
  				if (this.isInput){
  					element = this.element;
  				}
  				else if (this.component){
  					element = this.element.find('input');
  				}
  				if (element){
  					element.change();
  				}
  			}
  		},
  
  		showMode: function(dir){
  			if (dir){
  				this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir));
  			}
  			this.picker
  				.find('>div')
  				.hide()
  				.filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName)
  					.css('display', 'block');
  			this.updateNavArrows();
  		}
  	};
  
  	var DateRangePicker = function(element, options){
  		this.element = $(element);
  		this.inputs = $.map(options.inputs, function(i){
  			return i.jquery ? i[0] : i;
  		});
  		delete options.inputs;
  
  		$(this.inputs)
  			.datepicker(options)
  			.bind('changeDate', $.proxy(this.dateUpdated, this));
  
  		this.pickers = $.map(this.inputs, function(i){
  			return $(i).data('datepicker');
  		});
  		this.updateDates();
  	};
  	DateRangePicker.prototype = {
  		updateDates: function(){
  			this.dates = $.map(this.pickers, function(i){
  				return i.getUTCDate();
  			});
  			this.updateRanges();
  		},
  		updateRanges: function(){
  			var range = $.map(this.dates, function(d){
  				return d.valueOf();
  			});
  			$.each(this.pickers, function(i, p){
  				p.setRange(range);
  			});
  		},
  		dateUpdated: function(e){
  			// `this.updating` is a workaround for preventing infinite recursion
  			// between `changeDate` triggering and `setUTCDate` calling.  Until
  			// there is a better mechanism.
  			if (this.updating)
  				return;
  			this.updating = true;
  
  			var dp = $(e.target).data('datepicker'),
  				new_date = dp.getUTCDate(),
  				i = $.inArray(e.target, this.inputs),
  				l = this.inputs.length;
  			if (i === -1)
  				return;
  
  			$.each(this.pickers, function(i, p){
  				if (!p.getUTCDate())
  					p.setUTCDate(new_date);
  			});
  
  			if (new_date < this.dates[i]){
  				// Date being moved earlier/left
  				while (i >= 0 && new_date < this.dates[i]){
  					this.pickers[i--].setUTCDate(new_date);
  				}
  			}
  			else if (new_date > this.dates[i]){
  				// Date being moved later/right
  				while (i < l && new_date > this.dates[i]){
  					this.pickers[i++].setUTCDate(new_date);
  				}
  			}
  			this.updateDates();
  
  			delete this.updating;
  		},
  		remove: function(){
  			$.map(this.pickers, function(p){ p.remove(); });
  			delete this.element.data().datepicker;
  		}
  	};
  
  	function opts_from_el(el, prefix){
  		// Derive options from element data-attrs
  		var data = $(el).data(),
  			out = {}, inkey,
  			replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])');
  		prefix = new RegExp('^' + prefix.toLowerCase());
  		function re_lower(_,a){
  			return a.toLowerCase();
  		}
  		for (var key in data)
  			if (prefix.test(key)){
  				inkey = key.replace(replace, re_lower);
  				out[inkey] = data[key];
  			}
  		return out;
  	}
  
  	function opts_from_locale(lang){
  		// Derive options from locale plugins
  		var out = {};
  		// Check if "de-DE" style date is available, if not language should
  		// fallback to 2 letter code eg "de"
  		if (!dates[lang]){
  			lang = lang.split('-')[0];
  			if (!dates[lang])
  				return;
  		}
  		var d = dates[lang];
  		$.each(locale_opts, function(i,k){
  			if (k in d)
  				out[k] = d[k];
  		});
  		return out;
  	}
  
  	var old = $.fn.datepicker;
  	$.fn.datepicker = function(option){
  		var args = Array.apply(null, arguments);
  		args.shift();
  		var internal_return;
  		this.each(function(){
  			var $this = $(this),
  				data = $this.data('datepicker'),
  				options = typeof option === 'object' && option;
  			if (!data){
  				var elopts = opts_from_el(this, 'date'),
  					// Preliminary otions
  					xopts = $.extend({}, defaults, elopts, options),
  					locopts = opts_from_locale(xopts.language),
  					// Options priority: js args, data-attrs, locales, defaults
  					opts = $.extend({}, defaults, locopts, elopts, options);
  				if ($this.is('.input-daterange') || opts.inputs){
  					var ropts = {
  						inputs: opts.inputs || $this.find('input').toArray()
  					};
  					$this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts))));
  				}
  				else {
  					$this.data('datepicker', (data = new Datepicker(this, opts)));
  				}
  			}
  			if (typeof option === 'string' && typeof data[option] === 'function'){
  				internal_return = data[option].apply(data, args);
  				if (internal_return !== undefined)
  					return false;
  			}
  		});
  		if (internal_return !== undefined)
  			return internal_return;
  		else
  			return this;
  	};
  
  	var defaults = $.fn.datepicker.defaults = {
  		autoclose: false,
  		beforeShowDay: $.noop,
  		calendarWeeks: false,
  		clearBtn: false,
  		daysOfWeekDisabled: [],
  		endDate: Infinity,
  		forceParse: true,
  		format: 'mm/dd/yyyy',
  		keyboardNavigation: true,
  		language: 'en',
  		minViewMode: 0,
  		multidate: false,
  		multidateSeparator: ',',
  		orientation: "auto",
  		rtl: false,
  		startDate: -Infinity,
  		startView: 0,
  		todayBtn: false,
  		todayHighlight: false,
  		weekStart: 0
  	};
  	var locale_opts = $.fn.datepicker.locale_opts = [
  		'format',
  		'rtl',
  		'weekStart'
  	];
  	$.fn.datepicker.Constructor = Datepicker;
  	var dates = $.fn.datepicker.dates = {
  		en: {
  			days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
  			daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
  			daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
  			months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
  			monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  			today: "Today",
  			clear: "Clear"
  		}
  	};
  
  	var DPGlobal = {
  		modes: [
  			{
  				clsName: 'days',
  				navFnc: 'Month',
  				navStep: 1
  			},
  			{
  				clsName: 'months',
  				navFnc: 'FullYear',
  				navStep: 1
  			},
  			{
  				clsName: 'years',
  				navFnc: 'FullYear',
  				navStep: 10
  		}],
  		isLeapYear: function(year){
  			return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0));
  		},
  		getDaysInMonth: function(year, month){
  			return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
  		},
  		validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
  		nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
  		parseFormat: function(format){
  			// IE treats \0 as a string end in inputs (truncating the value),
  			// so it's a bad format delimiter, anyway
  			var separators = format.replace(this.validParts, '\0').split('\0'),
  				parts = format.match(this.validParts);
  			if (!separators || !separators.length || !parts || parts.length === 0){
  				throw new Error("Invalid date format.");
  			}
  			return {separators: separators, parts: parts};
  		},
  		parseDate: function(date, format, language){
  			if (!date)
  				return undefined;
  			if (date instanceof Date)
  				return date;
  			if (typeof format === 'string')
  				format = DPGlobal.parseFormat(format);
  			var part_re = /([\-+]\d+)([dmwy])/,
  				parts = date.match(/([\-+]\d+)([dmwy])/g),
  				part, dir, i;
  			if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){
  				date = new Date();
  				for (i=0; i < parts.length; i++){
  					part = part_re.exec(parts[i]);
  					dir = parseInt(part[1]);
  					switch (part[2]){
  						case 'd':
  							date.setUTCDate(date.getUTCDate() + dir);
  							break;
  						case 'm':
  							date = Datepicker.prototype.moveMonth.call(Datepicker.prototype, date, dir);
  							break;
  						case 'w':
  							date.setUTCDate(date.getUTCDate() + dir * 7);
  							break;
  						case 'y':
  							date = Datepicker.prototype.moveYear.call(Datepicker.prototype, date, dir);
  							break;
  					}
  				}
  				return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0);
  			}
  			parts = date && date.match(this.nonpunctuation) || [];
  			date = new Date();
  			var parsed = {},
  				setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'],
  				setters_map = {
  					yyyy: function(d,v){
  						return d.setUTCFullYear(v);
  					},
  					yy: function(d,v){
  						return d.setUTCFullYear(2000+v);
  					},
  					m: function(d,v){
  						if (isNaN(d))
  							return d;
  						v -= 1;
  						while (v < 0) v += 12;
  						v %= 12;
  						d.setUTCMonth(v);
  						while (d.getUTCMonth() !== v)
  							d.setUTCDate(d.getUTCDate()-1);
  						return d;
  					},
  					d: function(d,v){
  						return d.setUTCDate(v);
  					}
  				},
  				val, filtered;
  			setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
  			setters_map['dd'] = setters_map['d'];
  			date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  			var fparts = format.parts.slice();
  			// Remove noop parts
  			if (parts.length !== fparts.length){
  				fparts = $(fparts).filter(function(i,p){
  					return $.inArray(p, setters_order) !== -1;
  				}).toArray();
  			}
  			// Process remainder
  			function match_part(){
  				var m = this.slice(0, parts[i].length),
  					p = parts[i].slice(0, m.length);
  				return m === p;
  			}
  			if (parts.length === fparts.length){
  				var cnt;
  				for (i=0, cnt = fparts.length; i < cnt; i++){
  					val = parseInt(parts[i], 10);
  					part = fparts[i];
  					if (isNaN(val)){
  						switch (part){
  							case 'MM':
  								filtered = $(dates[language].months).filter(match_part);
  								val = $.inArray(filtered[0], dates[language].months) + 1;
  								break;
  							case 'M':
  								filtered = $(dates[language].monthsShort).filter(match_part);
  								val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
  								break;
  						}
  					}
  					parsed[part] = val;
  				}
  				var _date, s;
  				for (i=0; i < setters_order.length; i++){
  					s = setters_order[i];
  					if (s in parsed && !isNaN(parsed[s])){
  						_date = new Date(date);
  						setters_map[s](_date, parsed[s]);
  						if (!isNaN(_date))
  							date = _date;
  					}
  				}
  			}
  			return date;
  		},
  		formatDate: function(date, format, language){
  			if (!date)
  				return '';
  			if (typeof format === 'string')
  				format = DPGlobal.parseFormat(format);
  			var val = {
  				d: date.getUTCDate(),
  				D: dates[language].daysShort[date.getUTCDay()],
  				DD: dates[language].days[date.getUTCDay()],
  				m: date.getUTCMonth() + 1,
  				M: dates[language].monthsShort[date.getUTCMonth()],
  				MM: dates[language].months[date.getUTCMonth()],
  				yy: date.getUTCFullYear().toString().substring(2),
  				yyyy: date.getUTCFullYear()
  			};
  			val.dd = (val.d < 10 ? '0' : '') + val.d;
  			val.mm = (val.m < 10 ? '0' : '') + val.m;
  			date = [];
  			var seps = $.extend([], format.separators);
  			for (var i=0, cnt = format.parts.length; i <= cnt; i++){
  				if (seps.length)
  					date.push(seps.shift());
  				date.push(val[format.parts[i]]);
  			}
  			return date.join('');
  		},
  		headTemplate: '<thead>'+
  							'<tr>'+
  								'<th class="prev">&laquo;</th>'+
  								'<th colspan="5" class="datepicker-switch"></th>'+
  								'<th class="next">&raquo;</th>'+
  							'</tr>'+
  						'</thead>',
  		contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
  		footTemplate: '<tfoot>'+
  							'<tr>'+
  								'<th colspan="7" class="today"></th>'+
  							'</tr>'+
  							'<tr>'+
  								'<th colspan="7" class="clear"></th>'+
  							'</tr>'+
  						'</tfoot>'
  	};
  	DPGlobal.template = '<div class="datepicker">'+
  							'<div class="datepicker-days">'+
  								'<table class=" table-condensed">'+
  									DPGlobal.headTemplate+
  									'<tbody></tbody>'+
  									DPGlobal.footTemplate+
  								'</table>'+
  							'</div>'+
  							'<div class="datepicker-months">'+
  								'<table class="table-condensed">'+
  									DPGlobal.headTemplate+
  									DPGlobal.contTemplate+
  									DPGlobal.footTemplate+
  								'</table>'+
  							'</div>'+
  							'<div class="datepicker-years">'+
  								'<table class="table-condensed">'+
  									DPGlobal.headTemplate+
  									DPGlobal.contTemplate+
  									DPGlobal.footTemplate+
  								'</table>'+
  							'</div>'+
  						'</div>';
  
  	$.fn.datepicker.DPGlobal = DPGlobal;
  
  
  	/* DATEPICKER NO CONFLICT
  	* =================== */
  
  	$.fn.datepicker.noConflict = function(){
  		$.fn.datepicker = old;
  		return this;
  	};
  
  
  	/* DATEPICKER DATA-API
  	* ================== */
  
  	$(document).on(
  		'focus.datepicker.data-api click.datepicker.data-api',
  		'[data-provide="datepicker"]',
  		function(e){
  			var $this = $(this);
  			if ($this.data('datepicker'))
  				return;
  			e.preventDefault();
  			// component click requires us to explicitly show it
  			$this.datepicker('show');
  		}
  	);
  	$(function(){
  		$('[data-provide="datepicker-inline"]').datepicker();
  	});
  
  }(window.jQuery));
  
  /**
   * Traditional Chinese translation for bootstrap-datepicker
   * Rung-Sheng Jang <daniel@i-trend.co.cc>
   * FrankWu  <frankwu100@gmail.com> Fix more appropriate use of Traditional Chinese habit
   */
  ;(function($){
  	$.fn.datepicker.dates['zh-TW'] = {
  		days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
  		daysShort: ["週日", "週一", "週二", "週三", "週四", "週五", "週六", "週日"],
  		daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
  		months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  		monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
  		today: "今天",
  		format: "yyyy年mm月dd日",
  		weekStart: 1
  	};
  }(jQuery));
  
  /* Copyright (c) 2013-2014, Null McNull https://github.com/McNull, LICENSE: MIT */
  angular.module("blockUI",["templates-angularBlockUI"]),angular.module("blockUI").config(["$provide","$httpProvider",function(a,b){a.decorator("$exceptionHandler",["$delegate","$injector",function(a,b){var c,d;return function(e,f){d=d||b.get("blockUIConfig"),d.resetOnException&&(c=c||b.get("blockUI"),c.instances.reset()),a(e,f)}}]),b.interceptors.push("blockUIHttpInterceptor")}]),angular.module("blockUI").run(["$document",function(a){a.find("body").append('<div block-ui="main"></div>')}]),angular.module("blockUI").provider("blockUIConfig",function(){var a={templateUrl:"angular-block-ui/angular-block-ui.tmpl.html",delay:250,message:"Loading ...",autoBlock:!0,resetOnException:!0,requestFilter:angular.noop};this.templateUrl=function(b){a.templateUrl=b},this.template=function(b){a.template=b},this.delay=function(b){a.delay=b},this.message=function(b){a.message=b},this.autoBlock=function(b){a.autoBlock=b},this.resetOnException=function(b){a.resetOnException=b},this.requestFilter=function(b){a.requestFilter=b},this.$get=function(){return a}}),angular.module("blockUI").directive("blockUi",["blockUI","blockUIConfig","blockUiLinkFn",function(a,b,c){return{scope:!0,restrict:"A",templateUrl:b.template?void 0:b.templateUrl,template:b.template,link:c}}]).factory("blockUiLinkFn",["blockUI","blockUIUtils",function(a,b){return function(c,d,e){var f=d.parent();if(f.length){var g=a;if("BODY"===f[0].tagName)var h=c.$on("$viewContentLoaded",function(){h(),c.$on("$locationChangeStart",function(a){c.state.blockCount>0&&a.preventDefault()})});else{f.css("position","relative");var i=e.blockUi?e.blockUi:"_"+c.$id;g=a.instances.get(i);var j=d.inheritedData("block-ui");j&&(g._parent=j);var k=e.blockUiPattern;if(k){var l=b.buildRegExp(k);g.pattern(l)}c.$on("$destroy",function(){g.release()}),g.addRef()}d.addClass("block-ui"),f.data("block-ui",g),c.state=g.state()}}}]),angular.module("blockUI").factory("blockUIHttpInterceptor",["$q","$injector","blockUIConfig",function(a,b,c){function d(){g=g||b.get("blockUI")}function e(a){c.autoBlock&&!a.$_noBlock&&a.$_blocks&&(d(),a.$_blocks.stop())}function f(b){return e(b.config),a.reject(b)}var g;return{request:function(a){return c.autoBlock&&(c.requestFilter(a)===!1?a.$_noBlock=!0:(d(),a.$_blocks=g.instances.locate(a),a.$_blocks.start())),a},requestError:f,response:function(a){return e(a.config),a},responseError:f}}]),angular.module("blockUI").factory("blockUI",["blockUIConfig","$timeout","blockUIUtils","$document",function(a,b,c,d){function e(e){var g,i=this,j={id:e,blockCount:0,message:a.message,blocking:!1},k=[];this._refs=0,this.start=function(e){j.message=e||a.message,j.blockCount++;var f=angular.element(d[0].activeElement);f.length&&c.isElementInBlockScope(f,i)&&(i._restoreFocus=f[0],i._restoreFocus.blur()),g||(g=b(function(){g=null,j.blocking=!0},a.delay))},this._cancelStartTimeout=function(){g&&(b.cancel(g),g=null)},this.stop=function(){j.blockCount=Math.max(0,--j.blockCount),0===j.blockCount&&this.reset(!0)},this.message=function(a){j.message=a},this.pattern=function(a){return void 0!==a&&(i._pattern=a),i._pattern},this.reset=function(a){i._cancelStartTimeout(),j.blockCount=0,j.blocking=!1,!i._restoreFocus||d[0].activeElement&&d[0].activeElement!==f[0]||(i._restoreFocus.focus(),i._restoreFocus=null);try{a&&angular.forEach(k,function(a){a()})}finally{k.length=0}},this.done=function(a){k.push(a)},this.state=function(){return j},this.addRef=function(){i._refs+=1},this.release=function(){--i._refs<=0&&h.instances._destroy(i)}}var f=d.find("body"),g=[];g.get=function(a){var b=g[a];return b||(b=g[a]=new e(a),g.push(b)),b},g._destroy=function(a){if(angular.isString(a)&&(a=g[a]),a){a.reset(),delete g[a.state().id];for(var b=g.length;--b;)if(g[b]===a){g.splice(b,1);break}}},g.locate=function(a){var b=[];c.forEachFnHook(b,"start"),c.forEachFnHook(b,"stop");for(var d=g.length;d--;){var e=g[d],f=e._pattern;f&&f.test(a.url)&&b.push(e)}return 0===b.length&&b.push(h),b},c.forEachFnHook(g,"reset");var h=g.get("main");return h.addRef(),h.instances=g,h}]),angular.module("blockUI").factory("blockUIUtils",function(){var a={buildRegExp:function(a){var b,c=a.match(/^\/(.*)\/([gim]*)$/);if(!c)throw Error("Incorrect regular expression format: "+a);return b=new RegExp(c[1],c[2])},forEachFn:function(a,b,c){for(var d=a.length;d--;){var e=a[d];e[b].apply(e,c)}},forEachFnHook:function(b,c){b[c]=function(){a.forEachFn(this,c,arguments)}},isElementInBlockScope:function(a,b){for(var c=a.inheritedData("block-ui");c;){if(c===b)return!0;c=c._parent}return!1}};return a}),angular.module("templates-angularBlockUI",["angular-block-ui/angular-block-ui.tmpl.html"]),angular.module("angular-block-ui/angular-block-ui.tmpl.html",[]).run(["$templateCache",function(a){a.put("angular-block-ui/angular-block-ui.tmpl.html",'<div ng-show="state.blockCount > 0" class="block-ui-overlay" ng-class="{ \'block-ui-visible\': state.blocking }"></div>\n<div ng-show="state.blocking" class="block-ui-message-container">\n  <div class="block-ui-message">{{ state.message }}</div>  \n</div>\n')}]);
  /*! 1.5.0 */
  !function(){function a(a){if(!a.__listeners){a.upload||(a.upload={}),a.__listeners=[];var b=a.upload.addEventListener;a.upload.addEventListener=function(c,d){a.__listeners[c]=d,b&&b.apply(this,arguments)}}}var b=function(){try{var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(a)return!0}catch(b){if(void 0!=navigator.mimeTypes["application/x-shockwave-flash"])return!0}return!1},c=function(a,b){window.XMLHttpRequest.prototype[a]=b(window.XMLHttpRequest.prototype[a])};if(window.XMLHttpRequest&&(!window.FormData||window.FileAPI&&FileAPI.forceLoad?(c("open",function(b){return function(c,d,e){a(this),this.__url=d,b.apply(this,[c,d,e])}}),c("getResponseHeader",function(a){return function(b){return this.__fileApiXHR?this.__fileApiXHR.getResponseHeader(b):a.apply(this,[b])}}),c("getAllResponseHeaders",function(a){return function(){return this.__fileApiXHR?this.__fileApiXHR.abort():null==a?null:a.apply(this)}}),c("abort",function(a){return function(){return this.__fileApiXHR?this.__fileApiXHR.abort():null==a?null:a.apply(this)}}),c("setRequestHeader",function(b){return function(c,d){if("__setXHR_"===c){a(this);var e=d(this);e instanceof Function&&e(this)}else this.__requestHeaders=this.__requestHeaders||{},this.__requestHeaders[c]=d,b.apply(this,arguments)}}),c("send",function(a){return function(){var c=this;if(arguments[0]&&arguments[0].__isShim){var d=arguments[0],e={url:c.__url,complete:function(a,b){!a&&c.__listeners.load&&c.__listeners.load({type:"load",loaded:c.__loaded,total:c.__total,target:c,lengthComputable:!0}),!a&&c.__listeners.loadend&&c.__listeners.loadend({type:"loadend",loaded:c.__loaded,total:c.__total,target:c,lengthComputable:!0}),"abort"===a&&c.__listeners.abort&&c.__listeners.abort({type:"abort",loaded:c.__loaded,total:c.__total,target:c,lengthComputable:!0}),void 0!==b.status&&Object.defineProperty(c,"status",{get:function(){return b.status}}),void 0!==b.statusText&&Object.defineProperty(c,"statusText",{get:function(){return b.statusText}}),Object.defineProperty(c,"readyState",{get:function(){return 4}}),void 0!==b.response&&Object.defineProperty(c,"response",{get:function(){return b.response}}),Object.defineProperty(c,"responseText",{get:function(){return b.responseText}}),c.__fileApiXHR=b,c.onreadystatechange()},fileprogress:function(a){a.target=c,c.__listeners.progress&&c.__listeners.progress(a),c.__total=a.total,c.__loaded=a.loaded},headers:c.__requestHeaders};e.data={},e.files={};for(var f=0;f<d.data.length;f++){var g=d.data[f];null!=g.val&&null!=g.val.name&&null!=g.val.size&&null!=g.val.type?e.files[g.key]=g.val:e.data[g.key]=g.val}setTimeout(function(){if(!b())throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';c.__fileApiXHR=FileAPI.upload(e)},1)}else a.apply(c,arguments)}})):c("setRequestHeader",function(a){return function(b,c){if("__setXHR_"===b){var d=c(this);d instanceof Function&&d(this)}else a.apply(this,arguments)}}),window.XMLHttpRequest.__isShim=!0),!window.FormData||window.FileAPI&&FileAPI.forceLoad){var d=function(a){if(!b())throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';if(!a.__isWrapped&&(null!=a.getAttribute("ng-file-select")||null!=a.getAttribute("data-ng-file-select"))){var c=document.createElement("div");c.innerHTML='<div class="js-fileapi-wrapper" style="position:relative; overflow:hidden"></div>',c=c.firstChild;var d=a.parentNode;d.insertBefore(c,a),d.removeChild(a),c.appendChild(a),a.__isWrapped=!0}},e=function(a){return function(b){for(var c=FileAPI.getFiles(b),d=0;d<c.length;d++)void 0===c[d].size&&(c[d].size=0),void 0===c[d].name&&(c[d].name="file"),void 0===c[d].type&&(c[d].type="undefined");b.target||(b.target={}),b.target.files=c,b.target.files.item=function(a){return b.target.files[a]||null},a(b)}},f=function(a,b){return("change"===b.toLowerCase()||"onchange"===b.toLowerCase())&&"file"==a.getAttribute("type")};HTMLInputElement.prototype.addEventListener&&(HTMLInputElement.prototype.addEventListener=function(a){return function(b,c,g,h){f(this,b)?(d(this),a.apply(this,[b,e(c),g,h])):a.apply(this,[b,c,g,h])}}(HTMLInputElement.prototype.addEventListener)),HTMLInputElement.prototype.attachEvent&&(HTMLInputElement.prototype.attachEvent=function(a){return function(b,c){f(this,b)?(d(this),a.apply(this,[b,e(c)])):a.apply(this,[b,c])}}(HTMLInputElement.prototype.attachEvent)),window.FormData=FormData=function(){return{append:function(a,b,c){this.data.push({key:a,val:b,name:c})},data:[],__isShim:!0}},function(){if(window.FileAPI||(window.FileAPI={}),!FileAPI.upload){var a,c,d,e,f,g=document.createElement("script"),h=document.getElementsByTagName("script");if(window.FileAPI.jsUrl)a=window.FileAPI.jsUrl;else if(window.FileAPI.jsPath)c=window.FileAPI.jsPath;else for(d=0;d<h.length;d++)if(f=h[d].src,e=f.indexOf("angular-file-upload-shim.js"),-1==e&&(e=f.indexOf("angular-file-upload-shim.min.js")),e>-1){c=f.substring(0,e);break}null==FileAPI.staticPath&&(FileAPI.staticPath=c),g.setAttribute("src",a||c+"FileAPI.min.js"),document.getElementsByTagName("head")[0].appendChild(g),FileAPI.hasFlash=b()}}()}window.FileReader||(window.FileReader=function(){function a(a,c){var d={type:a,target:b,loaded:c.loaded,total:c.total,error:c.error};return null!=c.result&&(d.target.result=c.result),d}var b=this,c=!1;this.listeners={},this.addEventListener=function(a,c){b.listeners[a]=b.listeners[a]||[],b.listeners[a].push(c)},this.removeEventListener=function(a,c){b.listeners[a]&&b.listeners[a].splice(b.listeners[a].indexOf(c),1)},this.dispatchEvent=function(a){var c=b.listeners[a.type];if(c)for(var d=0;d<c.length;d++)c[d].call(b,a)},this.onabort=this.onerror=this.onload=this.onloadstart=this.onloadend=this.onprogress=null;var d=function(d){if(c||(c=!0,b.onloadstart&&this.onloadstart(a("loadstart",d))),"load"===d.type){b.onloadend&&b.onloadend(a("loadend",d));var e=a("load",d);b.onload&&b.onload(e),b.dispatchEvent(e)}else if("progress"===d.type){var e=a("progress",d);b.onprogress&&b.onprogress(e),b.dispatchEvent(e)}else{var e=a("error",d);b.onerror&&b.onerror(e),b.dispatchEvent(e)}};this.readAsArrayBuffer=function(a){FileAPI.readAsBinaryString(a,d)},this.readAsBinaryString=function(a){FileAPI.readAsBinaryString(a,d)},this.readAsDataURL=function(a){FileAPI.readAsDataURL(a,d)},this.readAsText=function(a){FileAPI.readAsText(a,d)}})}();
  /*! 1.5.0 */
  !function(){var a=angular.module("angularFileUpload",[]);a.service("$upload",["$http","$q","$timeout",function(a,b,c){function d(d){d.method=d.method||"POST",d.headers=d.headers||{},d.transformRequest=d.transformRequest||function(b,c){return window.ArrayBuffer&&b instanceof window.ArrayBuffer?b:a.defaults.transformRequest[0](b,c)};var e=b.defer();window.XMLHttpRequest.__isShim&&(d.headers.__setXHR_=function(){return function(a){a&&(d.__XHR=a,d.xhrFn&&d.xhrFn(a),a.upload.addEventListener("progress",function(a){e.notify(a)},!1),a.upload.addEventListener("load",function(a){a.lengthComputable&&e.notify(a)},!1))}}),a(d).then(function(a){e.resolve(a)},function(a){e.reject(a)},function(a){e.notify(a)});var f=e.promise;return f.success=function(a){return f.then(function(b){a(b.data,b.status,b.headers,d)}),f},f.error=function(a){return f.then(null,function(b){a(b.data,b.status,b.headers,d)}),f},f.progress=function(a){return f.then(null,null,function(b){a(b)}),f},f.abort=function(){return d.__XHR&&c(function(){d.__XHR.abort()}),f},f.xhr=function(a){return d.xhrFn=function(b){return function(){b&&b.apply(f,arguments),a.apply(f,arguments)}}(d.xhrFn),f},f}this.upload=function(b){b.headers=b.headers||{},b.headers["Content-Type"]=void 0,b.transformRequest=b.transformRequest||a.defaults.transformRequest;var c=new FormData,e=b.transformRequest,f=b.data;return b.transformRequest=function(a,c){if(f)if(b.formDataAppender)for(var d in f){var g=f[d];b.formDataAppender(a,d,g)}else for(var d in f){var g=f[d];if("function"==typeof e)g=e(g,c);else for(var h=0;h<e.length;h++){var i=e[h];"function"==typeof i&&(g=i(g,c))}a.append(d,g)}if(null!=b.file){var j=b.fileFormDataName||"file";if("[object Array]"===Object.prototype.toString.call(b.file))for(var k="[object String]"===Object.prototype.toString.call(j),h=0;h<b.file.length;h++)a.append(k?j:j[h],b.file[h],b.fileName&&b.fileName[h]||b.file[h].name);else a.append(j,b.file,b.fileName||b.file.name)}return a},b.data=c,d(b)},this.http=function(a){return d(a)}}]),a.directive("ngFileSelect",["$parse","$timeout",function(a,b){return function(c,d,e){var f=a(e.ngFileSelect);d.bind("change",function(a){var d,e,g=[];if(d=a.target.files,null!=d)for(e=0;e<d.length;e++)g.push(d.item(e));b(function(){f(c,{$files:g,$event:a})})}),("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&d.bind("touchend",function(a){a.preventDefault(),a.target.click()})}}]),a.directive("ngFileDropAvailable",["$parse","$timeout",function(a,b){return function(c,d,e){if("draggable"in document.createElement("span")){var f=a(e.ngFileDropAvailable);b(function(){f(c)})}}}]),a.directive("ngFileDrop",["$parse","$timeout","$location",function(a,b,c){return function(d,e,f){function g(a){return/^[\000-\177]*$/.test(a)}function h(a,d){var e=[],f=a.dataTransfer.items;if(f&&f.length>0&&f[0].webkitGetAsEntry&&"file"!=c.protocol())for(var h=0;h<f.length;h++){var j=f[h].webkitGetAsEntry();null!=j&&(g(j.name)?i(e,j):e.push(f[h].getAsFile()))}else{var k=a.dataTransfer.files;if(null!=k)for(var h=0;h<k.length;h++)e.push(k.item(h))}!function m(a){b(function(){l?m(10):d(e)},a||0)}()}function i(a,b){if(null!=b)if(b.isDirectory){var c=b.createReader();l++,c.readEntries(function(b){for(var c=0;c<b.length;c++)i(a,b[c]);l--})}else l++,b.file(function(b){l--,a.push(b)})}if("draggable"in document.createElement("span")){var j=null;e[0].addEventListener("dragover",function(c){if(c.stopPropagation(),c.preventDefault(),e.addClass(e[0].__drag_over_class_),b.cancel(j),!e[0].__drag_entered_){e[0].__drag_entered_=!0;var g=a(f.ngFileDragOverClass);if(g instanceof Function){var h=g(d,{$event:c});e[0].__drag_over_class_=h,e.addClass(e[0].__drag_over_class_)}else e[0].__drag_over_class_=f.ngFileDragOverClass||"dragover",e.addClass(e[0].__drag_over_class_)}},!1),e[0].addEventListener("dragenter",function(a){a.stopPropagation(),a.preventDefault()},!1),e[0].addEventListener("dragleave",function(){j=b(function(){e[0].__drag_entered_=!1,e.removeClass(e[0].__drag_over_class_)})},!1);var k=a(f.ngFileDrop);e[0].addEventListener("drop",function(a){a.stopPropagation(),a.preventDefault(),e[0].__drag_entered_=!1,e.removeClass(e[0].__drag_over_class_),h(a,function(b){k(d,{$files:b,$event:a})})},!1);var l=0}}}])}();
  /*
   * angular-ui-bootstrap
   * http://angular-ui.github.io/bootstrap/
  
   * Version: 0.11.0 - 2014-05-01
   * License: MIT
   */
  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.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","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/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.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(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).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(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).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",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var d={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.createParser=function(a){var c=[],e=a.split("");return angular.forEach(d,function(b,d){var f=a.indexOf(d);if(f>-1){a=a.split(""),e[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+d.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+e.join("")+"$"),map:b(c,"index")}},this.parse=function(b,d){if(!angular.isString(b))return b;d=a.DATETIME_FORMATS[d]||d,this.parsers[d]||(this.parsers[d]=this.createParser(d));var e=this.parsers[d],f=e.regex,g=e.map,h=b.match(f);if(h&&h.length){for(var i,j={year:1900,month:0,date:1,hours:0},k=1,l=h.length;l>k;k++){var m=g[k-1];m.apply&&m.apply.call(j,h[k])}return c(j.year,j.month,j.date)&&(i=new Date(j.year,j.month,j.date,j.hours)),i}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.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.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)<p;);}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),angular.forEach(["minDate","maxDate"],function(a){j[a]&&(h.$parent.$watch(b(j[a]),function(b){h[a]=b}),r.attr(l(a),a))}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){a&&a.isDefaultPrevented()||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(b){b.animate=!1,a(function(){b.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,b(function(){c.animate=!0,d[0].focus()}),c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))}}}}]).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=n.keys(),c=0;c<b.length;c++)n.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=n.get(a).value;n.remove(a),j(d.modalDomEl,d.modalScope,300,function(){d.modalScope.$destroy(),b.toggleClass(m,n.length()>0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g,0)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();h>=0&&!k&&(l=e.$new(!0),l.index=h,k=d("<div modal-backdrop></div>")(l),f.append(k));var i=angular.element("<div modal-window></div>");i.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var j=d(i)(b.scope);n.top().value.modalDomEl=j,f.append(j),f.addClass(m)},o.close=function(a,b){var c=n.get(a).value;c&&(c.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a).value;c&&(c.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()});var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";
  return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="<div "+p+'-popup title="'+q+"tt_title"+r+'" content="'+q+"tt_content"+r+'" placement="'+q+"tt_placement"+r+'" animation="tt_animation" is-open="tt_isOpen"></div>';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("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(a){return a("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(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.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.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("<div typeahead-popup></div>");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e<c.length;e++)b[v.itemName]=c[e],w.matches.push({id:A(e),label:v.viewMapper(w,b),model:c[e]});w.query=a,w.position=t?f.offset(j):f.position(j),w.position.top=w.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else z();d&&q(i,!1)},function(){z(),q(i,!1)})};z(),w.query=void 0;var C;l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(C&&d.cancel(C),C=d(function(){B(a)},o)):B(a):(q(i,!1),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var D=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",D),i.$on("$destroy",function(){e.unbind("click",D)});var E=a(y)(w);t?e.find("body").append(E):j.after(E)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.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="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n    </h4>\n  </div>\n  <div class="panel-collapse" collapse="!isOpen">\n	  <div class="panel-body" ng-transclude></div>\n  </div>\n</div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="{\'alert-{{type || \'warning\'}}\': true, \'alert-dismissable\': closeable}" role="alert">\n    <button ng-show="closeable" type="button" class="close" ng-click="close()">\n        <span aria-hidden="true">&times;</span>\n        <span class="sr-only">Close</span>\n    </button>\n    <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n    <ol class="carousel-indicators" ng-show="slides.length > 1">\n        <li ng-repeat="slide in slides track by $index" 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="glyphicon glyphicon-chevron-left"></span></a>\n    <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.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(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n  <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n  <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n  <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n    <tr>\n      <th ng-show="showWeeks" class="text-center"></th>\n      <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n        <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n        <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n	<li ng-transclude></li>\n	<li ng-if="showButtonBar" style="padding:10px 9px 2px">\n		<span class="btn-group">\n			<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n			<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n		</span>\n		<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n	</li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n  <thead>\n    <tr>\n      <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n      <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n      <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr ng-repeat="row in rows track by $index">\n      <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n        <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n      </td>\n    </tr>\n  </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop fade"\n     ng-class="{in: animate}"\n     ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n    <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" ng-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n  <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n  <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n  <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n  <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n  <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n  <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n  <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.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(a){a.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(a){a.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(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n  <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n    <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n        <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n    </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.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(a){a.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(a){a.put("template/tabs/tabset.html",'\n<div>\n  <ul class="nav nav-{{type || \'tabs\'}}" 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(a){a.put("template/timepicker/timepicker.html",'<table>\n	<tbody>\n		<tr class="text-center">\n			<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n			<td>&nbsp;</td>\n			<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n			<td ng-show="showMeridian"></td>\n		</tr>\n		<tr>\n			<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n				<input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n			</td>\n			<td>:</td>\n			<td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n				<input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n			</td>\n			<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n		</tr>\n		<tr class="text-center">\n			<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n			<td>&nbsp;</td>\n			<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n			<td ng-show="showMeridian"></td>\n		</tr>\n	</tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.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(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-if="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n    <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n        <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n    </li>\n</ul>')
  }]);