define(["angular"],function(){"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,R,F){"use strict";var N,D=R.isDefined,v=R.isFunction,U=R.isString,T=R.isObject,z=R.isArray,L=R.forEach,J=R.extend,K=R.copy,$=R.toJson;function Y(e,t){return J(new(J(function(){},{prototype:e})),t)}function b(r){return L(arguments,function(e){e!==r&&L(e,function(e,t){r.hasOwnProperty(t)||(r[t]=e)})}),r}function _(e){if(Object.keys)return Object.keys(e);var r=[];return L(e,function(e,t){r.push(t)}),r}function B(e,t,r){if(Array.prototype.indexOf)return e.indexOf(t,Number(r)||0);var n=e.length>>>0,a=Number(r)||0;for((a=a<0?Math.ceil(a):Math.floor(a))<0&&(a+=n);a<n;a++)if(a in e&&e[a]===t)return a;return-1}function G(e,t,r,n){var a,i=function(e,t){var r=[];for(var n in e.path){if(e.path[n]!==t.path[n])break;r.push(e.path[n])}return r}(r,n),o={},u=[];for(var s in i)if(i[s]&&i[s].params&&(a=_(i[s].params)).length)for(var l in a)0<=B(u,a[l])||(u.push(a[l]),o[a[l]]=e[a[l]]);return J({},o,t)}function s(e,t,r){if(!r)for(var n in r=[],e)r.push(n);for(var a=0;a<r.length;a++){var i=r[a];if(e[i]!=t[i])return!1}return!0}function H(e,t){var r={};return L(e,function(e){r[e]=t[e]}),r}function X(t){var r={},e=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return L(e,function(e){e in t&&(r[e]=t[e])}),r}function S(e){var t={},r=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var n in e)-1==B(r,n)&&(t[n]=e[n]);return t}function d(e,r){var n=z(e),a=n?[]:{};return L(e,function(e,t){r(e,t)&&(a[n?a.length:t]=e)}),a}function Z(e,r){var n=z(e)?[]:{};return L(e,function(e,t){n[t]=r(e,t)}),n}function r(e){return e.then(F,function(){})&&e}function t(m,g){var e={},u=[],y=e,w=J(m.when(e),{$$promises:e,$$values:e});this.study=function(a){if(!T(a))throw new Error("'invocables' must be an object");var $=_(a||{}),v=[],i=[],o={};function d(e){return T(e)&&e.then&&e.$$promises}return L(a,function t(e,r){if(2!==o[r]){if(i.push(r),1===o[r])throw i.splice(0,B(i,r)),new Error("Cyclic dependency: "+i.join(" -> "));if(o[r]=1,U(e))v.push(r,[function(){return g.get(e)}],u);else{var n=g.annotate(e);L(n,function(e){e!==r&&a.hasOwnProperty(e)&&t(a[e],e)}),v.push(r,e,n)}i.pop(),o[r]=2}}),a=i=o=null,function(u,e,s){if(d(u)&&s===F&&(s=e,e=u,u=null),u){if(!T(u))throw new Error("'locals' must be an object")}else u=y;if(e){if(!d(e))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else e=w;var t=m.defer(),l=t.promise,c=l.$$promises={},f=J({},u),r=1+v.length/3,n=!1;function p(){--r||(n||b(f,e.$$values),l.$$values=f,l.$$promises=l.$$promises||!0,delete l.$$inheritedValues,t.resolve(f))}function h(e){l.$$failure=e,t.reject(e)}if(D(e.$$failure))return h(e.$$failure),l;e.$$inheritedValues&&b(f,S(e.$$inheritedValues,$)),J(c,e.$$promises),e.$$values?(n=b(f,S(e.$$values,$)),l.$$inheritedValues=S(e.$$values,$),p()):(e.$$inheritedValues&&(l.$$inheritedValues=S(e.$$inheritedValues,$)),e.then(p,h));for(var a=0,i=v.length;a<i;a+=3)u.hasOwnProperty(v[a])?p():o(v[a],v[a+1],v[a+2]);function o(t,e,r){var n=m.defer(),a=0;function i(e){n.reject(e),h(e)}function o(){if(!D(l.$$failure))try{n.resolve(g.invoke(e,s,f)),n.promise.then(function(e){f[t]=e,p()},i)}catch(e){i(e)}}L(r,function(t){c.hasOwnProperty(t)&&!u.hasOwnProperty(t)&&(a++,c[t].then(function(e){f[t]=e,--a||o()},i))}),a||o(),c[t]=n.promise}return l}},this.resolve=function(e,t,r,n){return this.study(e)(t,r,n)}}function n(r,n,a){this.fromConfig=function(e,t,r){return D(e.template)?this.fromString(e.template,t):D(e.templateUrl)?this.fromUrl(e.templateUrl,t):D(e.templateProvider)?this.fromProvider(e.templateProvider,t,r):null},this.fromString=function(e,t){return v(e)?e(t):e},this.fromUrl=function(e,t){return v(e)&&(e=e(t)),null==e?null:r.get(e,{cache:n,headers:{Accept:"text/html"}}).then(function(e){return e.data})},this.fromProvider=function(e,t,r){return a.invoke(e,null,r||{params:t})}}function l(u,s,e){s=J({params:{}},T(s)?s:{});var t,r,n,a,i=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,o=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",c=0,f=this.segments=[],p=e?e.params:{},h=this.params=e?e.params.$$new():new N.ParamSet,$=[];function v(e,t,r,n){if($.push(e),p[e])return p[e];if(!/^\w+([-.]+\w+)*(?:\[\])?$/.test(e))throw new Error("Invalid parameter name '"+e+"' in pattern '"+u+"'");if(h[e])throw new Error("Duplicate parameter name '"+e+"' in pattern '"+u+"'");return h[e]=new N.Param(e,t,r,n),h[e]}function d(e,t,r,n){var a=["",""],i=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return i;switch(r){case!1:a=["(",")"+(n?"?":"")];break;case!0:i=i.replace(/\/$/,""),a=["(?:/(",")|/)?"];break;default:a=["("+r+"|",")?"]}return i+a[0]+t+a[1]}function m(e,t){var r,n,a,i,o;return r=e[2]||e[3],o=s.params[r],a=u.substring(c,e.index),(n=t?e[4]:e[4]||("*"==e[1]?".*":null))&&(i=N.type(n)||Y(N.type("string"),{pattern:new RegExp(n,s.caseInsensitive?"i":F)})),{id:r,regexp:n,segment:a,type:i,cfg:o}}for(this.source=u;(t=i.exec(u))&&!(0<=(r=m(t,!1)).segment.indexOf("?"));)n=v(r.id,r.type,r.cfg,"path"),l+=d(r.segment,n.type.pattern.source,n.squash,n.isOptional),f.push(r.segment),c=i.lastIndex;var g=(a=u.substring(c)).indexOf("?");if(0<=g){var y=this.sourceSearch=a.substring(g);if(a=a.substring(0,g),this.sourcePath=u.substring(0,c+g),0<y.length)for(c=0;t=o.exec(y);)n=v((r=m(t,!0)).id,r.type,r.cfg,"search"),c=i.lastIndex}else this.sourcePath=u,this.sourceSearch="";l+=d(a)+(!1===s.strict?"/?":"")+"$",f.push(a),this.regexp=new RegExp(l,s.caseInsensitive?"i":F),this.prefix=f[0],this.$$paramNames=$}function m(e){J(this,e)}function a(c,u){var f,p=[],h=null,$=!1;function s(e,t,r){if(!r)return!1;var n=e.invoke(t,t,{$match:r});return!D(n)||n}function e(u,e,a,t,s){var i,l=t.baseHref(),r=u.url();function n(e){if(!e||!e.defaultPrevented){i&&u.url();i=F;var t,r=p.length;for(t=0;t<r;t++)if(n(p[t]))return;h&&n(h)}function n(e){var t=e(a,u);return!!t&&(U(t)&&u.replace().url(t),!0)}}function o(){return f=f||e.$on("$locationChangeSuccess",n)}return $||o(),{sync:function(){n()},listen:function(){return o()},update:function(e){e?r=u.url():u.url()!==r&&(u.url(r),u.replace())},push:function(e,t,r){var n=e.format(t||{});null!==n&&t&&t["#"]&&(n+="#"+t["#"]),u.url(n),i=r&&r.$$avoidResync?u.url():F,r&&r.replace&&u.replace()},href:function(e,t,r){if(!e.validates(t))return null;var n=c.html5Mode();R.isObject(n)&&(n=n.enabled),n=n&&s.history;var a=e.format(t);if(r=r||{},n||null===a||(a="#"+c.hashPrefix()+a),null!==a&&t&&t["#"]&&(a+="#"+t["#"]),a=function(e,t,r){return"/"===l?e:t?l.slice(0,-1)+e:r?l.slice(1)+e:e}(a,n,r.absolute),!r.absolute||!a)return a;var i=!n&&a?"/":"",o=u.port();return o=80===o||443===o?"":":"+o,[u.protocol(),"://",u.host(),o,i,a].join("")}}}this.rule=function(e){if(!v(e))throw new Error("'rule' must be a function");return p.push(e),this},this.otherwise=function(e){if(U(e)){var t=e;e=function(){return t}}else if(!v(e))throw new Error("'rule' must be a function");return h=e,this},this.when=function(e,t){var a,i=U(t);if(U(e)&&(e=u.compile(e)),!i&&!v(t)&&!z(t))throw new Error("invalid 'handler' in when()");var r={matcher:function(r,n){return i&&(a=u.compile(n),n=["$match",function(e){return a.format(e)}]),J(function(e,t){return s(e,n,r.exec(t.path(),t.search()))},{prefix:U(r.prefix)?r.prefix:""})},regex:function(r,n){if(r.global||r.sticky)throw new Error("when() RegExp must not be global or sticky");return i&&(a=n,n=["$match",function(e){return function(e,r){return e.replace(/\$(\$|\d{1,2})/,function(e,t){return r["$"===t?0:Number(t)]})}(a,e)}]),J(function(e,t){return s(e,n,r.exec(t.path()))},{prefix:function(e){var t=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(e.source);return null!=t?t[1].replace(/\\(.)/g,"$1"):""}(r)})}},n={matcher:u.isMatcher(e),regex:e instanceof RegExp};for(var o in n)if(n[o])return this.rule(r[o](e,t));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(e){e===F&&(e=!0),$=e},(this.$get=e).$inject=["$location","$rootScope","$injector","$browser","$sniffer"]}function i(a,n){var q,I,f={},i={},V="abstract",o={parent:function(e){if(D(e.parent)&&e.parent)return M(e.parent);var t=/^(.+)\.[^.]+$/.exec(e.name);return t?M(t[1]):q},data:function(e){return e.parent&&e.parent.data&&(e.data=e.self.data=Y(e.parent.data,e.data)),e.data},url:function(e){var t=e.url,r={params:e.params||{}};if(U(t))return"^"==t.charAt(0)?n.compile(t.substring(1),r):(e.parent.navigable||q).url.concat(t,r);if(!t||n.isMatcher(t))return t;throw new Error("Invalid url '"+t+"' in state '"+e+"'")},navigable:function(e){return e.url?e:e.parent?e.parent.navigable:null},ownParams:function(e){var r=e.url&&e.url.params||new N.ParamSet;return L(e.params||{},function(e,t){r[t]||(r[t]=new N.Param(t,null,e,"config"))}),r},params:function(e){var t=X(e.ownParams,e.ownParams.$$keys());return e.parent&&e.parent.params?J(e.parent.params.$$new(),t):new N.ParamSet},views:function(r){var n={};return L(D(r.views)?r.views:{"":r},function(e,t){t.indexOf("@")<0&&(t+="@"+r.parent.name),e.resolveAs=e.resolveAs||r.resolveAs||"$resolve",n[t]=e}),n},path:function(e){return e.parent?e.parent.path.concat(e):[]},includes:function(e){var t=e.parent?J({},e.parent.includes):{};return t[e.name]=!0,t},$delegates:{}};function M(e,t){if(!e)return F;var r=U(e),n=r?e:e.name;if(function(e){return 0===e.indexOf(".")||0===e.indexOf("^")}(n)){if(!t)throw new Error("No reference point given for path '"+n+"'");t=M(t);for(var a=n.split("."),i=0,o=a.length,u=t;i<o;i++)if(""!==a[i]||0!==i){if("^"!==a[i])break;if(!u.parent)throw new Error("Path '"+n+"' not valid for state '"+t.name+"'");u=u.parent}else u=t;a=a.slice(i).join("."),n=u.name+(u.name&&a?".":"")+a}var s=f[n];return!s||!r&&(r||s!==e&&s.self!==e)?F:s}function u(r){var e=(r=Y(r,{self:r,resolve:r.resolve||{},toString:function(){return this.name}})).name;if(!U(e)||0<=e.indexOf("@"))throw new Error("State must have a valid name");if(f.hasOwnProperty(e))throw new Error("State '"+e+"' is already defined");var t=-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):U(r.parent)?r.parent:T(r.parent)&&U(r.parent.name)?r.parent.name:"";if(t&&!f[t])return function(e,t){i[e]||(i[e]=[]),i[e].push(t)}(t,r.self);for(var n in o)v(o[n])&&(r[n]=o[n](r,o.$delegates[n]));return!(f[e]=r)[V]&&r.url&&a.when(r.url,["$match","$stateParams",function(e,t){I.$current.navigable==r&&s(e,t)||I.transitionTo(r,e,{inherit:!0,location:!1})}]),function(e){for(var t=i[e]||[];t.length;)u(t.shift())}(e),r}function e(w,b,l,S,c,E,x,e,t){var P=new Error("transition superseded"),j=r(b.reject(P)),A=r(b.reject(new Error("transition prevented"))),C=r(b.reject(new Error("transition aborted"))),k=r(b.reject(new Error("transition failed")));function O(i,e,t,r,o,u){var s=t?e:H(i.params.$$keys(),e),n={$stateParams:s};o.resolve=c.resolve(i.resolve,n,o.resolve,i);var a=[o.resolve.then(function(e){o.globals=e})];return r&&a.push(r),b.all(a).then(function(){var e=[];return L(i.views,function(r,n){var a=r.resolve&&r.resolve!==i.resolve?r.resolve:{};a.$template=[function(){return l.load(n,{view:r,locals:o.globals,params:s,notify:u.notify})||""}],e.push(c.resolve(a,o.globals,o.resolve,i).then(function(e){if(v(r.controllerProvider)||z(r.controllerProvider)){var t=R.extend({},a,o.globals);e.$$controller=S.invoke(r.controllerProvider,null,t)}else e.$$controller=r.controller;e.$$state=i,e.$$controllerAs=r.controllerAs,e.$$resolveAs=r.resolveAs,o[n]=e}))}),b.all(e).then(function(){return o.globals})}).then(function(e){return o})}return q.locals={resolve:null,globals:{$stateParams:{}}},(I={params:{},current:q.self,$current:q,transition:null,reload:function(e){return I.transitionTo(I.current,E,{reload:e||!0,inherit:!1,notify:!0})},go:function(e,t,r){return I.transitionTo(e,t,J({inherit:!0,relative:I.$current},r))}}).transitionTo=function(n,a,i){a=a||{},i=J({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},i||{});var o=I.$current,u=I.params,s=o.path,e=M(n,i.relative),t=a["#"];if(!D(e)){var r={to:n,toParams:a,options:i},l=function(e,t,r,n){var a=w.$broadcast("$stateNotFound",e,t,r);if(a.defaultPrevented)return x.update(),C;if(!a.retry)return null;if(n.$retry)return x.update(),k;var i=I.transition=b.when(a.retry);return i.then(function(){return i!==I.transition?(w.$broadcast("$stateChangeCancel",e.to,e.toParams,t,r),j):(e.options.$retry=!0,I.transitionTo(e.to,e.toParams,e.options))},function(){return C}),x.update(),i}(r,o.self,u,i);if(l)return l;if(a=r.toParams,e=M(n=r.to,(i=r.options).relative),!D(e)){if(!i.relative)throw new Error("No such state '"+n+"'");throw new Error("Could not resolve '"+n+"' from state '"+i.relative+"'")}}if(e[V])throw new Error("Cannot transition to abstract state '"+n+"'");if(i.inherit&&(a=G(E,a||{},I.$current,e)),!e.params.$$validates(a))return k;a=e.params.$$values(a);var c=(n=e).path,f=0,p=c[f],h=q.locals,$=[];if(i.reload){if(U(i.reload)||T(i.reload)){if(T(i.reload)&&!i.reload.name)throw new Error("Invalid reload state object");var v=!0===i.reload?s[0]:M(i.reload);if(i.reload&&!v)throw new Error("No such reload state '"+(U(i.reload)?i.reload:i.reload.name)+"'");for(;p&&p===s[f]&&p!==v;)h=$[f]=p.locals,p=c[++f]}}else for(;p&&p===s[f]&&p.ownParams.$$equals(a,u);)h=$[f]=p.locals,p=c[++f];if(function(e,t,r,n,a,i){if(!i.reload&&e===r&&(a===r.locals||!1===e.self.reloadOnSearch&&function(t,e,r){var n=t.params.$$keys().filter(function(e){return"search"!=t.params[e].location}),a=X.apply({},[t.params].concat(n));return new N.ParamSet(a).$$equals(e,r)}(r,n,t)))return!0}(n,a,o,u,h,i))return t&&(a["#"]=t),I.params=a,K(I.params,E),K(H(n.params.$$keys(),E),n.locals.globals.$stateParams),i.location&&n.navigable&&n.navigable.url&&(x.push(n.navigable.url,a,{$$avoidResync:!0,replace:"replace"===i.location}),x.update(!0)),I.transition=null,b.when(I.current);if(a=H(n.params.$$keys(),a||{}),t&&(a["#"]=t),i.notify&&!i.skip_start){var d=w.$broadcast("$stateChangeStart",n.self,a,o.self,u,i);if(d.defaultPrevented)return w.$broadcast("$stateChangeCancel",n.self,a,o.self,u),null!=I.transition||d.noResync||x.update(),A}for(var m=b.when(h),g=f;g<c.length;p=c[++g])h=$[g]=Y(h),m=O(p,a,p===n,m,h,i);var y=I.transition=m.then(function(){var e,t,r;if(I.transition!==y)return w.$broadcast("$stateChangeCancel",n.self,a,o.self,u),j;for(e=s.length-1;f<=e;e--)(r=s[e]).self.onExit&&S.invoke(r.self.onExit,r.self,r.locals.globals),r.locals=null;for(e=f;e<c.length;e++)(t=c[e]).locals=$[e],t.self.onEnter&&S.invoke(t.self.onEnter,t.self,t.locals.globals);return I.transition!==y?(w.$broadcast("$stateChangeCancel",n.self,a,o.self,u),j):(I.$current=n,I.current=n.self,I.params=a,K(I.params,E),I.transition=null,i.location&&n.navigable&&x.push(n.navigable.url,n.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===i.location}),i.notify&&w.$broadcast("$stateChangeSuccess",n.self,a,o.self,u),x.update(!0),I.current)}).then(null,function(e){return e===P?j:I.transition!==y?(w.$broadcast("$stateChangeCancel",n.self,a,o.self,u),j):(I.transition=null,w.$broadcast("$stateChangeError",n.self,a,o.self,u,e).defaultPrevented||x.update(),b.reject(e))});return y},I.is=function(e,t,r){var n=M(e,(r=J({relative:I.$current},r||{})).relative);return D(n)?I.$current===n&&(!t||s(n.params.$$values(t),E)):F},I.includes=function(e,t,r){if(r=J({relative:I.$current},r||{}),U(e)&&function(e){return-1<e.indexOf("*")}(e)){if(!function(e){for(var t=e.split("."),r=I.$current.name.split("."),n=0,a=t.length;n<a;n++)"*"===t[n]&&(r[n]="*");return"**"===t[0]&&(r=r.slice(B(r,t[1]))).unshift("**"),"**"===t[t.length-1]&&(r.splice(B(r,t[t.length-2])+1,Number.MAX_VALUE),r.push("**")),t.length==r.length&&r.join("")===t.join("")}(e))return!1;e=I.$current.name}var n=M(e,r.relative);if(!D(n))return F;if(!D(I.$current.includes[n.name]))return!1;if(!t)return!0;for(var a=_(t),i=0;i<a.length;i++){var o=a[i],u=n.params[o];if(u&&!u.type.equals(E[o],t[o]))return!1}return!0},I.href=function(e,t,r){var n=M(e,(r=J({lossy:!0,inherit:!0,absolute:!1,relative:I.$current},r||{})).relative);if(!D(n))return null;r.inherit&&(t=G(E,t||{},I.$current,n));var a=n&&r.lossy?n.navigable:n;return a&&a.url!==F&&null!==a.url?x.href(a.url,H(n.params.$$keys().concat("#"),t||{}),{absolute:r.absolute}):null},I.get=function(e,t){if(0===arguments.length)return Z(_(f),function(e){return f[e].self});var r=M(e,t||I.$current);return r&&r.self?r.self:null},I}(q=u({name:"",url:"^",views:null,abstract:!0})).navigable=null,this.decorator=function(e,t){if(U(e)&&!D(t))return o[e];if(!v(t)||!U(e))return this;o[e]&&!o.$delegates[e]&&(o.$delegates[e]=o[e]);return o[e]=t,this},this.state=function(e,t){T(e)?t=e:t.name=e;return u(t),this},(this.$get=e).$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function o(){function e(e,n){return{load:function(e,t){var r;return(t=J({template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}},t)).view&&(r=n.fromConfig(t.view,t.params,t.locals)),r}}}(this.$get=e).$inject=["$rootScope","$templateFactory"]}function u(v,t,d,m,g){var e=t.has?function(e){return t.has(e)?t.get(e):null}:function(e){try{return t.get(e)}catch(e){return null}},r=e("$animator"),y=e("$animate");return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,t,$){return function(a,i,o){var u,s,l,c,f=o.onload||"",p=o.autoscroll,h=function(e,t){if(y)return{enter:function(e,t,r){2<R.version.minor?y.enter(e,null,t).then(r):y.enter(e,null,t,r)},leave:function(e,t){2<R.version.minor?y.leave(e).then(t):y.leave(e,t)}};if(r){var n=r&&r(t,e);return{enter:function(e,t,r){n.enter(e,null,t),r()},leave:function(e,t){n.leave(e),t()}}}return{enter:function(e,t,r){t.after(e),r()},leave:function(e,t){e.remove(),t()}}}(o,a);i.inheritedData("$uiView");function e(e){var t,r=w(a,o,i,m),n=r&&v.$current&&v.$current.locals[r];!e&&n===c||(t=a.$new(),c=v.$current.locals[r],t.$emit("$viewContentLoading",r),s=$(t,function(e){var t=g.defer(),r=g.defer(),n={$animEnter:t.promise,$animLeave:r.promise,$$animLeave:r};e.data("$uiViewAnim",n),h.enter(e,i,function(){t.resolve(),l&&l.$emit("$viewContentAnimationEnded"),(R.isDefined(p)&&!p||a.$eval(p))&&d(e)}),function(){if(u&&(u.remove(),u=null),l&&(l.$destroy(),l=null),s){var e=s.data("$uiViewAnim");h.leave(s,function(){e.$$animLeave.resolve(),u=null}),u=s,s=null}}()}),(l=t).$emit("$viewContentLoaded",r),l.$eval(f))}a.$on("$stateChangeSuccess",function(){e(!1)}),e(!0)}}}}function c(c,f,p,h){return{restrict:"ECA",priority:-400,compile:function(e){var l=e.html();return function(e,t,r){var n=p.$current,a=w(e,r,t,h),i=n&&n.locals[a];if(i){t.data("$uiView",{name:a,state:i.$$state}),t.html(i.$template?i.$template:l);var o=R.extend({},i);e[i.$$resolveAs]=o;var u=c(t.contents());if(i.$$controller){i.$scope=e,i.$element=t;var s=f(i.$$controller,i);i.$$controllerAs&&(e[i.$$controllerAs]=s,e[i.$$controllerAs][i.$$resolveAs]=o),v(s.$onInit)&&s.$onInit(),t.data("$ngControllerController",s),t.children().data("$ngControllerController",s)}u(e)}}}}}function w(e,t,r,n){var a=n(t.uiView||t.name||"")(e),i=r.inheritedData("$uiView");return 0<=a.indexOf("@")?a:a+"@"+(i?i.state.name:"")}function g(e,t){var r,n=e.match(/^\s*({[^}]*})\s*$/);if(n&&(e=t+"("+n[1]+")"),!(r=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/))||4!==r.length)throw new Error("Invalid state ref '"+e+"'");return{state:r[1],paramExpr:r[3]||null}}function y(e){var t=e.parent().inheritedData("$uiView");if(t&&t.state&&t.state.name)return t.state}function h(e){var t="[object SVGAnimatedString]"===Object.prototype.toString.call(e.prop("href")),r="FORM"===e[0].nodeName;return{attr:r?"action":t?"xlink:href":"href",isAnchor:"A"===e.prop("tagName").toUpperCase(),clickable:!r}}function E(i,o,u,s,l){return function(e){var t=e.which||e.button,r=l();if(!(1<t||e.ctrlKey||e.metaKey||e.shiftKey||i.attr("target"))){var n=u(function(){o.go(r.state,r.params,r.options)});e.preventDefault();var a=s.isAnchor&&!r.href?1:0;e.preventDefault=function(){a--<=0&&u.cancel(n)}}}}function f(f,p){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,t,r,n){var a,i=g(r.uiSref,f.current.name),o={state:i.state,href:null,params:null},u=h(t),s=n[1]||n[0],l=null;o.options=J(function(e,t){return{relative:y(e)||t.$current,inherit:!0}}(t,f),r.uiSrefOpts?e.$eval(r.uiSrefOpts):{});function c(e){e&&(o.params=R.copy(e)),o.href=f.href(i.state,o.params,o.options),l&&l(),s&&(l=s.$$addStateInfo(i.state,o.params)),null!==o.href&&r.$set(u.attr,o.href)}i.paramExpr&&(e.$watch(i.paramExpr,function(e){e!==o.params&&c(e)},!0),o.params=R.copy(e.$eval(i.paramExpr))),c(),u.clickable&&(a=E(t,f,p,u,function(){return o}),t[t.on?"on":"bind"]("click",a),e.$on("$destroy",function(){t[t.off?"off":"unbind"]("click",a)}))}}}function p(f,p){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,t,r,n){var a,i=h(t),o=n[1]||n[0],u="["+[r.uiState,r.uiStateParams||null,r.uiStateOpts||null].map(function(e){return e||"null"}).join(", ")+"]",s={state:null,params:null,options:null,href:null},l=null;function c(e){s.state=e[0],s.params=e[1],s.options=e[2],s.href=f.href(s.state,s.params,s.options),l&&l(),o&&(l=o.$$addStateInfo(s.state,s.params)),s.href&&r.$set(i.attr,s.href)}e.$watch(u,c,!0),c(e.$eval(u)),i.clickable&&(a=E(t,f,p,i,function(){return s}),t[t.on?"on":"bind"]("click",a),e.$on("$destroy",function(){t[t.off?"off":"unbind"]("click",a)}))}}}function x(h,e,t){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(o,u,e,r){var i,n,s=[],l={};i=t(e.uiSrefActiveEq||"",!1)(o);try{n=o.$eval(e.uiSrefActive)}catch(e){}function a(e,t,r){var n=h.get(e,y(u)),a=function(e,t){if(!U(e))throw new Error("state should be a string");if(T(t))return e+$(t);if(t=o.$eval(t),T(t))return e+$(t);return e}(e,t),i={state:n||{name:e},params:t,hash:a};return s.push(i),l[a]=r,function(){var e=s.indexOf(i);-1!==e&&s.splice(e,1)}}function c(){for(var e=0;e<s.length;e++)n=s[e].state,a=s[e].params,h.includes(n.name,a)?f(u,l[s[e].hash]):p(u,l[s[e].hash]),t=s[e].state,r=s[e].params,h.is(t.name,r)?f(u,i):p(u,i);var t,r,n,a}function f(e,t){r(function(){e.addClass(t)})}function p(e,t){e.removeClass(t)}n=n||t(e.uiSrefActive||"",!1)(o),T(n)&&L(n,function(e,t){if(U(e)){var r=g(e,h.current.name);a(r.state,o.$eval(r.paramExpr),t)}}),this.$$addStateInfo=function(e,t){if(!(T(n)&&0<s.length)){var r=a(e,t,n);return c(),r}},o.$on("$stateChangeSuccess",c),c()}]}}function P(r){function e(e,t){return r.is(e,t)}return e.$stateful=!0,e}function j(n){function e(e,t,r){return n.includes(e,t,r)}return e.$stateful=!0,e}R.module("ui.router.util",["ng"]),R.module("ui.router.router",["ui.router.util"]),R.module("ui.router.state",["ui.router.router","ui.router.util"]),R.module("ui.router",["ui.router.state"]),R.module("ui.router.compat",["ui.router"]),t.$inject=["$q","$injector"],R.module("ui.router.util").service("$resolve",t),n.$inject=["$http","$templateCache","$injector"],R.module("ui.router.util").service("$templateFactory",n),l.prototype.concat=function(e,t){var r={caseInsensitive:N.caseInsensitive(),strict:N.strictMode(),squash:N.defaultSquashPolicy()};return new l(this.sourcePath+e+this.sourceSearch,J(r,t),this)},l.prototype.toString=function(){return this.source},l.prototype.exec=function(e,t){var r=this.regexp.exec(e);if(!r)return null;t=t||{};var n,a,i,o,u,s=this.parameters(),l=s.length,c=this.segments.length-1,f={};if(c!=r.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(n=0;n<c;n++){for(i=s[n],o=this.params[i],u=r[n+1],a=0;a<o.replace.length;a++)o.replace[a].from===u&&(u=o.replace[a].to);u&&!0===o.array&&(u=Z(Z(p(u).split(/-(?!\\)/),p),function(e){return e.replace(/\\-/g,"-")}).reverse()),D(u)&&(u=o.type.decode(u)),f[i]=o.value(u)}function p(e){return e.split("").reverse().join("")}for(;n<l;n++){for(f[i=s[n]]=this.params[i].value(t[i]),o=this.params[i],u=t[i],a=0;a<o.replace.length;a++)o.replace[a].from===u&&(u=o.replace[a].to);D(u)&&(u=o.type.decode(u)),f[i]=o.value(u)}return f},l.prototype.parameters=function(e){return D(e)?this.params[e]||null:this.$$paramNames},l.prototype.validates=function(e){return this.params.$$validates(e)},l.prototype.format=function(e){e=e||{};var t=this.segments,r=this.parameters(),n=this.params;if(!this.validates(e))return null;var a,i=!1,o=t.length-1,u=r.length,s=t[0];function l(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}for(a=0;a<u;a++){var c=a<o,f=r[a],p=n[f],h=p.value(e[f]),$=p.isOptional&&p.type.equals(p.value(),h),v=!!$&&p.squash,d=p.type.encode(h);if(c){var m=t[a+1],g=a+1===o;if(!1===v)null!=d&&(z(d)?s+=Z(d,l).join("-"):s+=encodeURIComponent(d)),s+=m;else if(!0===v){var y=s.match(/\/$/)?/\/?(.*)/:/(.*)/;s+=m.match(y)[1]}else U(v)&&(s+=v+m);g&&!0===p.squash&&"/"===s.slice(-1)&&(s=s.slice(0,-1))}else{if(null==d||$&&!1!==v)continue;if(z(d)||(d=[d]),0===d.length)continue;s+=(i?"&":"?")+f+"="+(d=Z(d,encodeURIComponent).join("&"+f+"=")),i=!0}}return s},m.prototype.is=function(e,t){return!0},m.prototype.encode=function(e,t){return e},m.prototype.decode=function(e,t){return e},m.prototype.equals=function(e,t){return e==t},m.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},m.prototype.pattern=/.*/,m.prototype.toString=function(){return"{Type:"+this.name+"}"},m.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},m.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new function(e,a){function t(e,t){return function(){return e[t].apply(e,arguments)}}function i(e){return z(e)?e:D(e)?[e]:[]}function o(e){return!e}function r(r,n){return function(e){if(z(e)&&0===e.length)return e;var t=Z(e=i(e),r);return!0===n?0===d(t,o).length:function(e){switch(e.length){case 0:return F;case 1:return"auto"===a?e[0]:e;default:return e}}(t)}}var u;this.encode=r(t(e,"encode")),this.decode=r(t(e,"decode")),this.is=r(t(e,"is"),!0),this.equals=(u=t(e,"equals"),function(e,t){var r=i(e),n=i(t);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++)if(!u(r[a],n[a]))return!1;return!0}),this.pattern=e.pattern,this.$normalize=r(t(e,"$normalize")),this.name=e.name,this.$arrayMode=a}(this,e)},R.module("ui.router.util").provider("$urlMatcherFactory",function e(){N=this;var r=!1,n=!0,f=!1;function t(e){return null!=e?e.toString().replace(/(~|\/)/g,function(e){return{"~":"~~","/":"~2F"}[e]}):e}var p,h={},a=!0,i=[],o={string:{encode:t,decode:function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,function(e){return{"~~":"~","~2F":"/"}[e]}):e},is:function(e){return null==e||!D(e)||"string"==typeof e},pattern:/[^/]*/},int:{encode:t,decode:function(e){return parseInt(e,10)},is:function(e){return D(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return!0===e||!1===e},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):F},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):F},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:R.toJson,decode:R.fromJson,is:R.isObject,equals:R.equals,pattern:/[^/]*/},any:{encode:R.identity,decode:R.identity,equals:R.equals,pattern:/.*/}};function $(e){return v(e)||z(e)&&v(e[e.length-1])}function u(){for(;i.length;){var e=i.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");R.extend(h[e.name],p.invoke(e.def))}}function s(e){J(this,e||{})}e.$$getDefaultValue=function(e){if(!$(e.value))return e.value;if(!p)throw new Error("Injectable functions cannot be called at configuration time");return p.invoke(e.value)},this.caseInsensitive=function(e){return D(e)&&(r=e),r},this.strictMode=function(e){return D(e)&&(n=e),n},this.defaultSquashPolicy=function(e){if(!D(e))return f;if(!0!==e&&!1!==e&&!U(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return f=e},this.compile=function(e,t){return new l(e,J({strict:n,caseInsensitive:r},t))},this.isMatcher=function(r){if(!T(r))return!1;var n=!0;return L(l.prototype,function(e,t){v(e)&&(n=n&&D(r[t])&&v(r[t]))}),n},this.type=function(e,t,r){if(!D(t))return h[e];if(h.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return h[e]=new m(J({name:e},t)),r&&(i.push({name:e,def:r}),a||u()),this},L(o,function(e,t){h[t]=new m(J({name:t},e))}),h=Y(h,{}),this.$get=["$injector",function(e){return p=e,a=!1,u(),L(o,function(e,t){h[t]||(h[t]=new m(e))}),this}],this.Param=function(n,e,a,t){var i=this;a=function(e){var t=T(e)?_(e):[];return-1===B(t,"value")&&-1===B(t,"type")&&-1===B(t,"squash")&&-1===B(t,"array")&&(e={value:e}),e.$$fn=$(e.value)?e.value:function(){return e.value},e}(a),e=function(e,t,r){if(e.type&&t)throw new Error("Param '"+n+"' has two type configurations.");return t||(e.type?R.isString(e.type)?h[e.type]:e.type instanceof m?e.type:new m(e.type):"config"===r?h.any:h.string)}(a,e,t);var r,o,u=(r={array:"search"===t&&"auto"},o=n.match(/\[\]$/)?{array:!0}:{},J(r,o,a).array);"string"!==(e=u?e.$asArray(u,"search"===t):e).name||u||"path"!==t||a.value!==F||(a.value="");var s=a.value!==F,l=function(e,t){var r=e.squash;if(!t||!1===r)return!1;if(!D(r)||null==r)return f;if(!0===r||U(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}(a,s),c=function(e,t,r,n){var a,i,o=[{from:"",to:r||t?F:""},{from:null,to:r||t?F:""}];return a=z(e.replace)?e.replace:[],U(n)&&a.push({from:n,to:F}),i=Z(a,function(e){return e.from}),d(o,function(e){return-1===B(i,e.from)}).concat(a)}(a,u,s,l);J(this,{id:n,type:e,location:t,array:u,squash:l,replace:c,isOptional:s,value:function(e){var t,r;return t=e,e=(r=Z(d(i.replace,function(t){return function(e){return e.from===t}}(t)),function(e){return e.to})).length?r[0]:t,D(e)?i.type.$normalize(e):function(){if(!p)throw new Error("Injectable functions cannot be called at configuration time");var e=p.invoke(a.$$fn);if(null!==e&&e!==F&&!i.type.is(e))throw new Error("Default value ("+e+") for parameter '"+i.id+"' is not an instance of Type ("+i.type.name+")");return e}()},dynamic:F,config:a,toString:function(){return"{Param:"+n+" "+e+" squash: '"+l+"' optional: "+s+"}"}})},s.prototype={$$new:function(){return Y(this,J(new s,{$$parent:this}))},$$keys:function(){for(var t=[],e=[],r=this,n=_(s.prototype);r;)e.push(r),r=r.$$parent;return e.reverse(),L(e,function(e){L(_(e),function(e){-1===B(t,e)&&-1===B(n,e)&&t.push(e)})}),t},$$values:function(t){var r={},n=this;return L(n.$$keys(),function(e){r[e]=n[e].value(t&&t[e])}),r},$$equals:function(n,a){var i=!0,o=this;return L(o.$$keys(),function(e){var t=n&&n[e],r=a&&a[e];o[e].type.equals(t,r)||(i=!1)}),i},$$validates:function(e){var t,r,n,a,i,o=this.$$keys();for(t=0;t<o.length&&(r=this[o[t]],(n=e[o[t]])!==F&&null!==n||!r.isOptional);t++){if(a=r.type.$normalize(n),!r.type.is(a))return!1;if(i=r.type.encode(a),R.isString(i)&&!r.type.pattern.exec(i))return!1}return!0},$$parent:F},this.ParamSet=s}),R.module("ui.router.util").run(["$urlMatcherFactory",function(e){}]),a.$inject=["$locationProvider","$urlMatcherFactoryProvider"],R.module("ui.router.router").provider("$urlRouter",a),i.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],R.module("ui.router.state").factory("$stateParams",function(){return{}}).constant("$state.runtime",{autoinject:!0}).provider("$state",i).run(["$injector",function(e){e.get("$state.runtime").autoinject&&e.get("$state")}]),o.$inject=[],R.module("ui.router.state").provider("$view",o),R.module("ui.router.state").provider("$uiViewScroll",function(){var r=!1;this.useAnchorScroll=function(){r=!0},this.$get=["$anchorScroll","$timeout",function(e,t){return r?e:function(e){return t(function(){e[0].scrollIntoView()},0,!1)}}]}),u.$inject=["$state","$injector","$uiViewScroll","$interpolate","$q"],c.$inject=["$compile","$controller","$state","$interpolate"],R.module("ui.router.state").directive("uiView",u),R.module("ui.router.state").directive("uiView",c),f.$inject=["$state","$timeout"],p.$inject=["$state","$timeout"],x.$inject=["$state","$stateParams","$interpolate"],R.module("ui.router.state").directive("uiSref",f).directive("uiSrefActive",x).directive("uiSrefActiveEq",x).directive("uiState",p),P.$inject=["$state"],j.$inject=["$state"],R.module("ui.router.state").filter("isState",P).filter("includedByState",j)}(window,window.angular)});