/** * AngularUI - The companion suite for AngularJS * @version v0.2.1 - 2012-09-19 * @link http://angular-ui.github.com * @license MIT License, http://www.opensource.org/licenses/MIT */ angular.module("ui.config",[]).value("ui.config",{}),angular.module("ui.filters",["ui.config"]),angular.module("ui.directives",["ui.config"]),angular.module("ui",["ui.filters","ui.directives","ui.config"]),angular.module("ui.directives").directive("uiAnimate",["ui.config","$timeout",function(e,t){var n={};return angular.isString(e.animate)?n["class"]=e.animate:e.animate&&(n=e.animate),{restrict:"A",link:function(e,r,i){var s={};i.uiAnimate&&(s=e.$eval(i.uiAnimate),angular.isString(s)&&(s={"class":s})),s=angular.extend({"class":"ui-animate"},n,s),r.addClass(s["class"]),t(function(){r.removeClass(s["class"])},20,!1)}}}]),angular.module("ui.directives").directive("uiCodemirror",["ui.config","$parse",function(e,t){"use strict";return e.codemirror=e.codemirror||{},{require:"ngModel",link:function(n,r,i,s){if(!r.is("textarea"))throw new Error("ui-codemirror can only be applied to a textarea element");var o,u=t(i.uiCodemirror),a=function(e){var t=e.getValue();t!==s.$viewValue&&(s.$setViewValue(t),n.$apply())},f=function(t){t=angular.extend({},t,e.codemirror);var n=t.onChange;n?t.onChange=function(e){a(e),n(e)}:t.onChange=a,o&&o.toTextArea(),o=CodeMirror.fromTextArea(r[0],t)};f(u()),n.$watch(u,f,!0),s.$formatters.push(function(e){if(angular.isUndefined(e)||e===null)return"";if(angular.isObject(e)||angular.isArray(e))throw new Error("ui-codemirror cannot use an object or an array as a model");return e}),s.$render=function(){o.setValue(s.$viewValue)}}}}]),angular.module("ui.directives").directive("uiCurrency",["ui.config","currencyFilter",function(e,t){var n={pos:"ui-currency-pos",neg:"ui-currency-neg",zero:"ui-currency-zero"};return e.currency&&angular.extend(n,e.currency),{restrict:"EAC",require:"ngModel",link:function(e,r,i,s){var o,u,a;o=angular.extend({},n,e.$eval(i.uiCurrency)),u=function(e){var n;return n=e*1,n>0?r.addClass(o.pos):r.removeClass(o.pos),n<0?r.addClass(o.neg):r.removeClass(o.neg),n===0?r.addClass(o.zero):r.removeClass(o.zero),e===""?r.text(""):r.text(t(n,o.symbol)),!0},s.$render=function(){a=s.$viewValue,r.val(a),u(a)}}}}]),angular.module("ui.directives").directive("uiDate",["ui.config",function(e){"use strict";var t;return t={},angular.isObject(e.date)&&angular.extend(t,e.date),{require:"?ngModel",link:function(t,n,r,i){var s=function(){return angular.extend({},e.date,t.$eval(r.uiDate))},o=function(){var e=s();if(i){var r=function(){t.$apply(function(){i.$setViewValue(n.datepicker("getDate"))})};if(e.onSelect){var o=e.onSelect;e.onSelect=function(e,t){return r(),o(e,t)}}else e.onSelect=r;n.bind("change",r),i.$render=function(){var e=i.$viewValue;n.datepicker("setDate",e),angular.isString(e)&&i.$setViewValue(n.datepicker("getDate"))}}n.datepicker("destroy"),n.datepicker(e),i.$render()};t.$watch(s,o,!0)}}}]),angular.module("ui.directives").directive("uiEvent",["$parse",function(e){return function(t,n,r){var i=t.$eval(r.uiEvent);angular.forEach(i,function(r,i){var s=e(r);n.bind(i,function(e){var n=Array.prototype.slice.call(arguments);n=n.splice(1),t.$apply(function(){s(t,{$event:e,$params:n})})})})}}]),angular.module("ui.directives").directive("uiIf",[function(){return{transclude:"element",priority:1e3,terminal:!0,restrict:"A",compile:function(e,t,n){return function(e,t,r){t[0].doNotMove=!0;var i=r.uiIf,s,o;e.$watch(i,function(r){s&&(s.remove(),s=null),o&&(o.$destroy(),o=null),r&&(o=e.$new(),n(o,function(e){s=e,t.after(e)})),t.parent().trigger("$childrenChanged")})}}}}]),angular.module("ui.directives").directive("uiJq",["ui.config",function(e){return{restrict:"A",compile:function(t,n){if(!angular.isFunction(t[n.uiJq]))throw new Error('ui-jq: The "'+n.uiJq+'" function does not exist');var r=e.jq&&e.jq[n.uiJq];return function(e,t,n){var i=[],s="change";n.uiOptions?(i=e.$eval("["+n.uiOptions+"]"),angular.isObject(r)&&angular.isObject(i[0])&&(i[0]=angular.extend(r,i[0]))):r&&(i=[r]),n.ngModel&&t.is("select,input,textarea")&&(i&&angular.isObject(i[0])&&i[0].ngChange!==undefined&&(s=i[0].ngChange),s&&t.on(s,function(){t.trigger("input")})),t[n.uiJq].apply(t,i)}}}}]),angular.module("ui.directives").directive("uiKeypress",["$parse",function(e){return{link:function(t,n,r){var i={8:"backspace",9:"tab",13:"enter",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"},s,o,u,a,f=[];try{s=t.$eval(r.uiKeypress),o=!0}catch(l){s=r.uiKeypress.split(/\s+and\s+/i),o=!1}angular.forEach(s,function(t,n){var r={};o?(r.expression=e(t),r.keys=n):(t=t.split(/\s+on\s+/i),r.expression=e(t[0]),r.keys=t[1]),a={},angular.forEach(r.keys.split("-"),function(e){a[e]=!0}),r.keys=a,f.push(r)}),n.bind("keydown",function(e){var n=e.metaKey||e.altKey,r=e.ctrlKey,s=e.shiftKey;angular.forEach(f,function(o){var u=o.keys[i[e.keyCode]]||o.keys[e.keyCode.toString()]||!1,a=o.keys.alt||!1,f=o.keys.ctrl||!1,l=o.keys.shift||!1;u&&a==n&&f==r&&l==s&&t.$apply(function(){o.expression(t,{$event:e})})})})}}}]),function(){function t(e,t,n,r){angular.forEach(t.split(" "),function(t){var i={type:"map-"+t};google.maps.event.addListener(n,t,function(t){r.trigger(angular.extend({},i,t)),e.$$phase||e.$apply()})})}function n(n,r){e.directive(n,[function(){return{restrict:"A",link:function(e,i,s){e.$watch(s[n],function(n){t(e,r,n,i)})}}}])}var e=angular.module("ui.directives");e.directive("uiMap",["ui.config","$parse",function(e,n){var r="bounds_changed center_changed click dblclick drag dragend dragstart heading_changed idle maptypeid_changed mousemove mouseout mouseover projection_changed resize rightclick tilesloaded tilt_changed zoom_changed",i=e.map||{};return{restrict:"A",link:function(e,s,o){var u=angular.extend({},i,e.$eval(o.uiOptions)),a=new google.maps.Map(s[0],u),f=n(o.uiMap);f.assign(e,a),t(e,r,a,s)}}}]),e.directive("uiMapInfoWindow",["ui.config","$parse","$compile",function(e,n,r){var i="closeclick content_change domready position_changed zindex_changed",s=e.mapInfoWindow||{};return{link:function(e,o,u){var a=angular.extend({},s,e.$eval(u.uiOptions));a.content=o[0];var f=n(u.uiMapInfoWindow),l=f(e);l||(l=new google.maps.InfoWindow(a),f.assign(e,l)),t(e,i,l,o),o.replaceWith("
");var c=l.open;l.open=function(n,i,s,u,a,f){r(o.contents())(e),c.call(l,n,i,s,u,a,f)}}}}]),n("uiMapMarker","animation_changed click clickable_changed cursor_changed dblclick drag dragend draggable_changed dragstart flat_changed icon_changed mousedown mouseout mouseover mouseup position_changed rightclick shadow_changed shape_changed title_changed visible_changed zindex_changed"),n("uiMapPolyline","click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapPolygon","click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapRectangle","bounds_changed click dblclick mousedown mousemove mouseout mouseover mouseup rightclick"),n("uiMapCircle","center_changed click dblclick mousedown mousemove mouseout mouseover mouseup radius_changed rightclick"),n("uiMapGroundOverlay","click dblclick")}(),angular.module("ui.directives").directive("uiMask",[function(){return{require:"ngModel",scope:{uiMask:"="},link:function(e,t,n,r){return r.$render=function(){var n;return n=r.$viewValue||"",t.val(n),t.mask(e.uiMask)},r.$parsers.push(function(e){var n;return n=t.data("mask-isvalid"),r.$setValidity("mask",n),t.mask()}),t.bind("keyup",function(){return e.$apply(function(){return r.$setViewValue(t.mask())})})}}}]),angular.module("ui.directives").directive("uiModal",["$timeout",function(e){return{restrict:"EAC",require:"ngModel",link:function(t,n,r,i){n.addClass("modal hide"),t.$watch(r.ngModel,function(e){n.modal(e&&"show"||"hide")}),n.on(jQuery.support.transition&&"shown"||"show",function(){e(function(){i.$setViewValue(!0)})}),n.on(jQuery.support.transition&&"hidden"||"hide",function(){e(function(){i.$setViewValue(!1)})})}}}]),angular.module("ui.directives").directive("uiReset",["$parse",function(e){return{require:"ngModel",link:function(e,t,n,r){var i=angular.element('');t.wrap('').after(i),i.bind("click",function(t){t.preventDefault(),e.$apply(function(){r.$setViewValue(null),r.$render()})})}}}]),angular.module("ui.directives").directive("uiScrollfix",["$window",function(e){"use strict";return{link:function(t,n,r){var i=n.offset().top;r.uiScrollfix?r.uiScrollfix.charAt(0)==="-"?r.uiScrollfix=i-r.uiScrollfix.substr(1):r.uiScrollfix.charAt(0)==="+"&&(r.uiScrollfix=i+parseFloat(r.uiScrollfix.substr(1))):r.uiScrollfix=i,angular.element(e).on("scroll.ui-scrollfix",function(){var t;if(angular.isDefined(e.pageYOffset))t=e.pageYOffset;else{var i=document.compatMode&&document.compatMode!=="BackCompat"?document.documentElement:document.body;t=i.scrollTop}!n.hasClass("ui-scrollfix")&&t>r.uiScrollfix?n.addClass("ui-scrollfix"):n.hasClass("ui-scrollfix")&&t'+t+""):e.replace(new RegExp(t,"gi"),'$&')):e}}),angular.module("ui.filters").filter("inflector",function(){function e(e){return e.replace(/^([a-z])|\s+([a-z])/g,function(e){return e.toUpperCase()})}function t(e,t){return e.replace(/[A-Z]/g,function(e){return t+e})}var n={humanize:function(n){return e(t(n," ").split("_").join(" "))},underscore:function(e){return e.substr(0,1).toLowerCase()+t(e.substr(1),"_").toLowerCase().split(" ").join("_")},variable:function(t){return t=t.substr(0,1).toLowerCase()+e(t.split("_").join(" ")).substr(1).split(" ").join(""),t}};return function(e,t,r){return t!==!1&&angular.isString(e)?(t=t||"humanize",n[t](e)):e}}),angular.module("ui.filters").filter("unique",function(){return function(e,t){if(t===!1)return e;if((t||angular.isUndefined(t))&&angular.isArray(e)){var n={},r=[],i=function(e){return angular.isObject(e)&&angular.isString(t)?e[t]:e};angular.forEach(e,function(e){var t,n=!1;for(var s=0;s