sogo/UI/WebServerResources/js/vendor/angular-ui-router.min.js
2017-06-30 01:28:54 -04:00

16 lines
108 KiB
JavaScript

/**
* State-based routing for AngularJS 1.x
* NOTICE: This monolithic bundle also bundles the @uirouter/core code.
* This causes it to be incompatible with plugins that depend on @uirouter/core.
* We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.
* For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles
* @version v1.0.5
* @link https://ui-router.github.io
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],e):e(t["@uirouter/angularjs"]=t["@uirouter/angularjs"]||{},t.angular)}(this,function(t,e){"use strict";function r(t){function e(r){return r.length>=n?t.apply(null,r):function(){return e(r.concat([].slice.apply(arguments)))}}var r=[].slice.apply(arguments,[1]),n=t.length;return e(r)}function n(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(null,[].slice.call(arguments).reverse())}function o(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)&&e.apply(null,r)}}function a(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.apply(null,r)||e.apply(null,r)}}function u(t,e){return function(r){return r[t].apply(r,e)}}function s(t){return function(e){for(var r=0;r<t.length;r++)if(t[r][0](e))return t[r][1](e)}}function c(t){if(re(t)&&t.length){var e=t.slice(0,-1),r=t.slice(-1);return!(e.filter(Dt(te)).length||r.filter(Dt(Zt)).length)}return Zt(t)}function f(t){return t}function l(){}function p(t,e,r,n,i){void 0===i&&(i=!1);var o=function(e){return t()[e].bind(r())},a=function(t){return function(){return e[t]=o(t),e[t].apply(null,arguments)}};return n=n||Object.keys(t()),n.reduce(function(t,e){return t[e]=i?a(e):o(e),t},e)}function h(t,e){return-1!==t.indexOf(e)}function d(t,e){var r=t.indexOf(e);return r>=0&&t.splice(r,1),t}function v(t,e){return t.push(e),e}function m(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=e.concat({}).reverse(),i=ve.apply(null,n);return ve({},i,g(t||{},Object.keys(i)))}function y(t,e){var r=[];for(var n in t.path){if(t.path[n]!==e.path[n])break;r.push(t.path[n])}return r}function g(t,e){var r={};for(var n in t)-1!==e.indexOf(n)&&(r[n]=t[n]);return r}function w(t,e){return Object.keys(t).filter(Dt(ge(e))).reduce(function(e,r){return e[r]=t[r],e},{})}function _(t,e){return b(t,At(e))}function $(t,e){var r=re(t),n=r?[]:{},i=r?function(t){return n.push(t)}:function(t,e){return n[e]=t};return de(t,function(t,r){e(t,r)&&i(t,r)}),n}function S(t,e){var r;return de(t,function(t,n){r||e(t,n)&&(r=t)}),r}function b(t,e){var r=re(t)?[]:{};return de(t,function(t,n){return r[n]=e(t,n)}),r}function R(t,e){return t.push(e),t}function E(t,e){return void 0===e&&(e="assert failure"),function(r){var n=t(r);if(!n)throw new Error(Zt(e)?e(r):e);return n}}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return[];var r,n=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991),i=[];for(r=0;r<n;r++)switch(t.length){case 1:i.push([t[0][r]]);break;case 2:i.push([t[0][r],t[1][r]]);break;case 3:i.push([t[0][r],t[1][r],t[2][r]]);break;case 4:i.push([t[0][r],t[1][r],t[2][r],t[3][r]]);break;default:i.push(t.map(function(t){return t[r]}))}return i}function T(t,e){var r,n;if(re(e)&&(r=e[0],n=e[1]),!te(r))throw new Error("invalid parameters to applyPairs");return t[r]=n,t}function P(t){return t.length&&t[t.length-1]||void 0}function k(t,e){return e&&Object.keys(e).forEach(function(t){return delete e[t]}),e||(e={}),ve(e,t)}function O(t,e,r){if(re(t))return t.forEach(e,r);Object.keys(t).forEach(function(r){return e(t[r],r)})}function x(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var n=Object.keys(r),i=0;i<n.length;i++)t[n[i]]=r[n[i]]}return t}function j(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var r=typeof t;if(r!==typeof e||"object"!==r)return!1;var n=[t,e];if(Nt(re)(n))return I(t,e);if(Nt(ne)(n))return t.getTime()===e.getTime();if(Nt(ie)(n))return t.toString()===e.toString();if(Nt(Zt)(n))return!0;if([Zt,re,ne,ie].map(Ft).reduce(function(t,e){return t||!!e(n)},!1))return!1;var i,o={};for(i in t){if(!j(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!o[i])return!1;return!0}function I(t,e){return t.length===e.length&&C(t,e).reduce(function(t,e){return t&&j(e[0],e[1])},!0)}function V(t){if(!t)return"ui-view (defunct)";var e=t.creationContext?t.creationContext.name||"(root)":"(none)";return"[ui-view#"+t.id+" "+t.$type+":"+t.fqn+" ("+t.name+"@"+e+")]"}function A(e){return Xt(e)?t.Category[e]:t.Category[t.Category[e]]}function H(t,e){function r(t){for(var e=n,r=0;r<e.length;r++){var i=new Bt(e[r]);if(i&&i.matches(t.name)||!i&&e[r]===t.name)return!0}return!1}var n=te(e)?[e]:e;return!!(Zt(n)?n:r)(t)}function q(t,e,r){function n(t,n,i){void 0===i&&(i={});var a=new Ye(e,r,n,t,i);return o.push(a),function(){a._deregistered=!0,we(o)(a)}}var i=t._registeredHooks=t._registeredHooks||{},o=i[r.name]=[];return t[r.name]=n,n}function D(t){return void 0===t&&(t=!1),function(e,r){var n=t?-1:1,i=(e.node.state.path.length-r.node.state.path.length)*n;return 0!==i?i:r.hook.priority-e.hook.priority}}function N(t,e){function r(t){return re(t)?t:Qt(t)?[t]:[]}function n(t){switch(t.length){case 0:return;case 1:return"auto"===e?t[0]:t;default:return t}}function i(t,e){return function(i){if(re(i)&&0===i.length)return i;var o=r(i),a=b(o,t);return!0===e?0===$(a,function(t){return!t}).length:n(a)}}function o(t){return function(e,n){var i=r(e),o=r(n);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(!t(i[a],o[a]))return!1;return!0}}var a=this;["encode","decode","equals","$normalize"].forEach(function(e){var r=t[e].bind(t),n="equals"===e?o:i;a[e]=n(r)}),ve(this,{dynamic:t.dynamic,name:t.name,pattern:t.pattern,inherit:t.inherit,is:i(t.is.bind(t),!0),$arrayMode:e})}function F(t){function e(){return t.value}return t=er(t)&&{value:t}||t,e.__cacheable=!0,ve(t,{$$fn:c(t.value)?t.value:e})}function U(e,r,n,i,o){if(e.type&&r&&"string"!==r.name)throw new Error("Param '"+i+"' has two type configurations.");if(e.type&&r&&"string"===r.name&&o.type(e.type))return o.type(e.type);if(r)return r;if(!e.type){var a=n===t.DefType.CONFIG?"any":n===t.DefType.PATH?"path":n===t.DefType.SEARCH?"query":"string";return o.type(a)}return e.type instanceof Xe?e.type:o.type(e.type)}function L(t,e,r){var n=t.squash;if(!e||!1===n)return!1;if(!Qt(n)||null==n)return r;if(!0===n||te(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function M(t,e,r,n){var i,o,a=[{from:"",to:r||e?void 0:""},{from:null,to:r||e?void 0:""}];return i=re(t.replace)?t.replace:[],te(n)&&i.push({from:n,to:void 0}),o=b(i,At("from")),$(a,function(t){return-1===o.indexOf(t.from)}).concat(i)}function B(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function G(t,e){for(;e.length<t;)e+=" ";return e}function W(t){return t.replace(/^([A-Z])/,function(t){return t.toLowerCase()}).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function z(t){var e=J(t),r=e.match(/^(function [^ ]+\([^)]*\))/),n=r?r[1]:e,i=t.name||"";return i&&n.match(/function \(/)?"function "+i+n.substr(9):n}function J(t){var e=re(t)?t.slice(-1)[0]:t;return e&&e.toString()||"undefined"}function Q(t){function e(t){if(ee(t)){if(-1!==r.indexOf(t))return"[circular ref]";r.push(t)}return yr(t)}var r=[];return JSON.stringify(t,function(t,r){return e(r)}).replace(/\\"/g,'"')}function K(t){var e=new RegExp("("+t+")","g");return function(t){return t.split(e).filter(f)}}function Y(t,e){return te(P(t))&&te(e)?t.slice(0,-1).concat(P(t)+e):R(t,e)}function Z(t){return t.name}function X(t){return t.self.$$state=function(){return t},t.self}function tt(t){return t.parent&&t.parent.data&&(t.data=t.self.data=ye(t.parent.data,t.data)),t.data}function et(t){return t.parent?t.parent.path.concat(t):[t]}function rt(t){var e=t.parent?ve({},t.parent.includes):{};return e[t.name]=!0,e}function nt(t){var e=function(t){var e=se.$injector;return t.$inject||e&&e.annotate(t,e.strictDi)||"deferred"},r=function(t){return!(!t.token||!t.resolveFn)},n=function(t){return!(!t.provide&&!t.token||!(t.useValue||t.useFactory||t.useExisting||t.useClass))},o=function(t){return!!(t&&t.val&&(te(t.val)||re(t.val)||Zt(t.val)))},a=function(t){return t.provide||t.token},u=s([[At("resolveFn"),function(t){return new ar(a(t),t.resolveFn,t.deps,t.policy)}],[At("useFactory"),function(t){return new ar(a(t),t.useFactory,t.deps||t.dependencies,t.policy)}],[At("useClass"),function(t){return new ar(a(t),function(){return new t.useClass},[],t.policy)}],[At("useValue"),function(t){return new ar(a(t),function(){return t.useValue},[],t.policy,t.useValue)}],[At("useExisting"),function(t){return new ar(a(t),f,[t.useExisting],t.policy)}]]),c=s([[i(At("val"),te),function(t){return new ar(t.token,f,[t.val],t.policy)}],[i(At("val"),re),function(t){return new ar(t.token,P(t.val),t.val.slice(0,-1),t.policy)}],[i(At("val"),Zt),function(t){return new ar(t.token,t.val,e(t.val),t.policy)}]]),l=s([[Ut(ar),function(t){return t}],[r,u],[n,u],[o,c],[Mt(!0),function(t){throw new Error("Invalid resolve value: "+Q(t))}]]),p=t.resolve;return(re(p)?p:function(t,e){return Object.keys(t||{}).map(function(r){return{token:r,val:t[r],deps:void 0,policy:e[r]}})}(p,t.resolvePolicy||{})).map(l)}function it(t,e){var r=["",""],n=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return n;switch(e.squash){case!1:r=["(",")"+(e.isOptional?"?":"")];break;case!0:n=n.replace(/\/$/,""),r=["(?:/(",")|/)?"];break;default:r=["("+e.squash+"|",")?"]}return n+r[0]+e.type.pattern.source+r[1]}function ot(t,e,r,n){return"/"===n?t:e?n.slice(0,-1)+t:r?n.slice(1)+t:t}function at(t){if(!(Zt(t)||te(t)||Ut(Je)(t)||Je.isDef(t)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return Zt(t)?t:Mt(t)}function ut(t){t.addResolvable({token:Jr,deps:[],resolveFn:function(){return t.router},data:t.router},""),t.addResolvable({token:vr,deps:[],resolveFn:function(){return t},data:t},""),t.addResolvable({token:"$transition$",deps:[],resolveFn:function(){return t},data:t},""),t.addResolvable({token:"$stateParams",deps:[],resolveFn:function(){return t.params()},data:t.params()},""),t.entering().forEach(function(e){t.addResolvable({token:"$state$",deps:[],resolveFn:function(){return e},data:e},e)})}function st(t){return function(e,r){return(0,r.$$state()[t])(e,r)}}function ct(t,e){function r(e){return e&&Array.isArray(e.states)&&e.states.forEach(function(e){return t.router.stateRegistry.register(e)}),e}var n=e.$$state().lazyLoad,i=n._promise;if(!i){var o=function(t){return delete e.lazyLoad,delete e.$$state().lazyLoad,delete n._promise,t},a=function(t){return delete n._promise,se.$q.reject(t)};i=n._promise=se.$q.when(n(t,e)).then(r).then(o,a)}return i}function ft(t){var e=t._ignoredReason();if(e){ze.traceTransitionIgnored(t);var r=t.router.globals.transition;return"SameAsCurrent"===e&&r&&r.abort(),Ue.ignored().toPromise()}}function lt(t){if(!t.valid())throw new Error(t.error())}function pt(t){var e=function(t){return t||""},r=xn(t).map(e),n=r[0],i=r[1],o=jn(n).map(e);return{path:o[0],search:o[1],hash:i,url:t}}function ht(t,e,r,n){return function(i){function o(t){t.dispose(a),t.dispose(u)}var a=i.locationService=new r(i),u=i.locationConfig=new n(i,e);return{name:t,service:a,configuration:u,dispose:o}}}function dt(t){return se.$injector=kn,se.$q=En,{name:"vanilla.services",$q:En,$injector:kn,dispose:function(){return null}}}function vt(){var t=null;return function(e,r){return t=t||se.$injector.get("$templateFactory"),[new ti(e,r,t)]}}function mt(t){if(!t.parent)return{};var e=["templateProvider","templateUrl","template","notify","async"],r=["controller","controllerProvider","controllerAs","resolveAs"],n=["component","bindings","componentProvider"],i=e.concat(r),o=n.concat(i);if(Qt(t.views)&&Zn(o,t))throw new Error("State '"+t.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+o.filter(function(e){return Qt(t[e])}).join(", "));var a={},u=t.views||{$default:g(t,o)};return de(u,function(e,r){if(r=r||"$default",te(e)&&(e={component:e}),e=ve({},e),Zn(n,e)&&Zn(i,e))throw new Error("Cannot combine: "+n.join("|")+" with: "+i.join("|")+" in stateview: '"+r+"@"+t.name+"'");e.resolveAs=e.resolveAs||"$resolve",e.$type="ng1",e.$context=t,e.$name=r;var o=Dr.normalizeUIViewTarget(e.$context,e.$name);e.$uiViewName=o.uiViewName,e.$uiViewContextAnchor=o.uiViewContextAnchor,a[r]=e}),a}function yt(t){var e=se.$injector.get(t+"Directive");if(!e||!e.length)throw new Error("Unable to find component named '"+t+"'");return e.map(ri).reduce(Te,[])}function gt(t){function e(t,e,n,i,o,a){return r._runtimeServices(i,t,n,e),delete hi.router,delete hi.$get,hi}hi=this.router=new Jr,hi.stateProvider=new ii(hi.stateRegistry,hi.stateService),hi.stateRegistry.decorator("views",mt),hi.stateRegistry.decorator("onExit",oi("onExit")),hi.stateRegistry.decorator("onRetain",oi("onRetain")),hi.stateRegistry.decorator("onEnter",oi("onEnter")),hi.viewService._pluginapi._viewConfigFactory("ng1",vt());var r=hi.locationService=hi.locationConfig=new ai(t);return ai.monkeyPatchPathParameterType(hi),hi.router=hi,hi.$get=e,e.$inject=["$location","$browser","$sniffer","$rootScope","$http","$templateCache"],hi}function wt(t,e,r){se.$injector=t,se.$q=e,r.stateRegistry.get().map(function(t){return t.$$state().resolvables}).reduce(Te,[]).filter(function(t){return"deferred"===t.deps}).forEach(function(e){return e.deps=t.annotate(e.resolveFn,t.strictDi)})}function _t(t){t.$watch(function(){ze.approximateDigests++})}function $t(t){var e,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t="("+r[1]+")"),!(e=t.replace(/\n/g," ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/))||4!==e.length)throw new Error("Invalid state ref '"+t+"'");return{state:e[1]||null,paramExpr:e[3]||null}}function St(t){var e=t.parent().inheritedData("$uiView"),r=qt("$cfg.path")(e);return r?P(r).state.name:void 0}function bt(t,e,r){var n=r.uiState||t.current.name,i=ve(Ct(e,t),r.uiStateOpts||{}),o=t.href(n,r.uiStateParams,i);return{uiState:n,uiStateParams:r.uiStateParams,uiStateOpts:i,href:o}}function Rt(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),r="FORM"===t[0].nodeName;return{attr:r?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!r}}function Et(t,e,r,n,i){return function(o){var a=o.which||o.button,u=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var s=r(function(){e.go(u.uiState,u.uiStateParams,u.uiStateOpts)});o.preventDefault();var c=n.isAnchor&&!u.href?1:0;o.preventDefault=function(){c--<=0&&r.cancel(s)}}}}function Ct(t,e){return{relative:St(t)||e.$current,inherit:!0,source:"sref"}}function Tt(t,e,r,n){var i;n&&(i=n.events),re(i)||(i=["click"]);for(var o=t.on?"on":"bind",a=0,u=i;a<u.length;a++){var s=u[a];t[o](s,r)}e.$on("$destroy",function(){for(var e=t.off?"off":"unbind",n=0,o=i;n<o.length;n++){var a=o[n];t[e](a,r)}})}function Pt(t){var e=function(e,r,n){return t.is(e,r,n)};return e.$stateful=!0,e}function kt(t){var e=function(e,r,n){return t.includes(e,r,n)};return e.$stateful=!0,e}function Ot(t,r,n,i,o,a){var u=qt("viewDecl.controllerAs"),s=qt("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(i){var a=i.html();return i.empty(),function(i,c){var f=c.data("$uiView");if(!f)return c.html(a),void t(c.contents())(i);var l=f.$cfg||{viewDecl:{},getTemplate:e.noop},p=l.path&&new pr(l.path);c.html(l.getTemplate(c,p)||a),ze.traceUIViewFill(f.$uiView,c.html());var h=t(c.contents()),d=l.controller,v=u(l),m=s(l),y=p&&gi(p);if(i[m]=y,d){var g=r(d,ve({},y,{$scope:i,$element:c}));v&&(i[v]=g,i[v][m]=y),c.data("$ngControllerController",g),c.children().data("$ngControllerController",g),xt(o,n,g,i,l)}if(te(l.viewDecl.component))var w=l.viewDecl.component,_=W(w),$=new RegExp("^(x-|data-)?"+_+"$","i"),S=function(){var t=[].slice.call(c[0].children).filter(function(t){return t&&t.tagName&&$.exec(t.tagName)});return t&&Vt.element(t).data("$"+w+"Controller")},b=i.$watch(S,function(t){t&&(xt(o,n,t,i,l),b())});h(i)}}}}function xt(t,e,r,n,i){!Zt(r.$onInit)||i.viewDecl.component&&Si||r.$onInit();var o=P(i.path).state.self,a={bind:r};if(Zt(r.uiOnParamsChanged)){var u=new pr(i.path),s=u.getResolvable("$transition$").data,c=function(t){if(t!==s&&-1===t.exiting().indexOf(o)){var e=t.params("to"),n=t.params("from"),i=t.treeChanges().to.map(function(t){return t.paramSchema}).reduce(Te,[]),a=t.treeChanges().from.map(function(t){return t.paramSchema}).reduce(Te,[]),u=i.filter(function(t){var r=a.indexOf(t);return-1===r||!a[r].type.equals(e[t.id],n[t.id])});if(u.length){var c=u.map(function(t){return t.id}),f=$(e,function(t,e){return-1!==c.indexOf(e)});r.uiOnParamsChanged(f,t)}}};n.$on("$destroy",e.onSuccess({},c,a))}if(Zt(r.uiCanExit)){var f=bi++,l=function(t){return!!t&&(t._uiCanExitIds&&!0===t._uiCanExitIds[f]||l(t.redirectedFrom()))},p=function(e){var n,i=e._uiCanExitIds=e._uiCanExitIds||{};return l(e)||(n=t.when(r.uiCanExit(e)),n.then(function(t){return i[f]=!1!==t})),n},h={exiting:o.name};n.$on("$destroy",e.onBefore(h,p,a))}}function jt(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,r){return t?e:function(t){return r(function(){t[0].scrollIntoView()},0,!1)}}]}var It=angular,Vt=e&&e.module?e:It,At=function(t){return function(e){return e&&e[t]}},Ht=r(function(t,e,r){return r&&r[t]===e}),qt=function(t){return i.apply(null,t.split(".").map(At))},Dt=function(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return!t.apply(null,e)}},Nt=function(t){return function(e){return e.reduce(function(e,r){return e&&!!t(r)},!0)}},Ft=function(t){return function(e){return e.reduce(function(e,r){return e||!!t(r)},!1)}},Ut=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},Lt=function(t){return function(e){return t===e}},Mt=function(t){return function(){return t}},Bt=function(){function t(t){this.text=t,this.glob=t.split(".");var e=this.text.split(".").map(function(t){return"**"===t?"(?:|(?:\\.[^.]*)*)":"*"===t?"\\.[^.]*":"\\."+t}).join("");this.regexp=new RegExp("^"+e+"$")}return t.prototype.matches=function(t){return this.regexp.test("."+t)},t.is=function(t){return!!/[!,*]+/.exec(t)},t.fromString=function(e){return t.is(e)?new t(e):null},t}(),Gt=function(){function t(e){return t.create(e||{})}return t.create=function(e){e=t.isStateClass(e)?new e:e;var r=ye(ye(e,t.prototype));return e.$$state=function(){return r},r.self=e,r.__stateObjectCache={nameGlob:Bt.fromString(r.name)},r},t.prototype.is=function(t){return this===t||this.self===t||this.fqn()===t},t.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var t=this.parent.fqn();return t?t+"."+this.name:this.name},t.prototype.root=function(){return this.parent&&this.parent.root()||this},t.prototype.parameters=function(t){return t=m(t,{inherit:!0,matchingKeys:null}),(t.inherit&&this.parent&&this.parent.parameters()||[]).concat(Re(this.params)).filter(function(e){return!t.matchingKeys||t.matchingKeys.hasOwnProperty(e.id)})},t.prototype.parameter=function(t,e){return void 0===e&&(e={}),this.url&&this.url.parameter(t,e)||S(Re(this.params),Ht("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t.isStateClass=function(t){return Zt(t)&&!0===t.__uiRouterState},t.isState=function(t){return ee(t.__stateObjectCache)},t}(),Wt=Object.prototype.toString,zt=function(t){return function(e){return typeof e===t}},Jt=zt("undefined"),Qt=Dt(Jt),Kt=function(t){return null===t},Yt=a(Kt,Jt),Zt=zt("function"),Xt=zt("number"),te=zt("string"),ee=function(t){return null!==t&&"object"==typeof t},re=Array.isArray,ne=function(t){return"[object Date]"===Wt.call(t)},ie=function(t){return"[object RegExp]"===Wt.call(t)},oe=Gt.isState,ae=o(ee,i(At("then"),Zt)),ue=function(t){return function(){throw new Error(t+"(): No coreservices implementation for UI-Router is loaded.")}},se={$q:void 0,$injector:void 0},ce="undefined"==typeof window?{}:window,fe=ce.angular||{},le=fe.fromJson||JSON.parse.bind(JSON),pe=fe.toJson||JSON.stringify.bind(JSON),he=fe.copy||k,de=fe.forEach||O,ve=Object.assign||x,me=fe.equals||j,ye=function(t,e){return ve(Object.create(t),e)},ge=r(h),we=r(d),_e=r(v),$e=function(t){return t.slice().forEach(function(e){"function"==typeof e&&e(),we(t,e)})},Se=function(t,e){return ve(t,e)},be=b,Re=function(t){return Object.keys(t).map(function(e){return t[e]})},Ee=function(t,e){return t&&e},Ce=function(t,e){return t||e},Te=function(t,e){return t.concat(e)},Pe=function(t,e){return re(e)?t.concat(e.reduce(Pe,[])):R(t,e)},ke=function(t,e){return ge(t,e)?t:R(t,e)},Oe=function(t){return t.reduce(Te,[])},xe=function(t){return t.reduce(Pe,[])},je=E,Ie=E,Ve=function(t){return Object.keys(t).map(function(e){return[e,t[e]]})},Ae=function(t,e){return void 0===e&&(e=Mt(!0)),function(r,n){return e(r)&&e(n)?t(r)-t(n):0}},He=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e,r){return t.reduce(function(t,n){return t||n(e,r)},0)}},qe=function(t){return t.catch(function(t){return 0})&&t},De=function(t){return qe(se.$q.reject(t))},Ne=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this._items=t,this._limit=e}return t.prototype.enqueue=function(t){var e=this._items;return e.push(t),this._limit&&e.length>this._limit&&e.shift(),t},t.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(t){var e=this._items.indexOf(t);return e>-1&&this._items.splice(e,1)[0]},t.prototype.peekTail=function(){return this._items[this._items.length-1]},t.prototype.peekHead=function(){if(this.size())return this._items[0]},t}();!function(t){t[t.SUPERSEDED=2]="SUPERSEDED",t[t.ABORTED=3]="ABORTED",t[t.INVALID=4]="INVALID",t[t.IGNORED=5]="IGNORED",t[t.ERROR=6]="ERROR"}(t.RejectType||(t.RejectType={}));var Fe=0,Ue=function(){function e(t,e,r){this.$id=Fe++,this.type=t,this.message=e,this.detail=r}return e.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():Q(t)}(this.detail),e=this;return"Transition Rejection($id: "+e.$id+" type: "+e.type+", message: "+e.message+", detail: "+t+")"},e.prototype.toPromise=function(){return ve(De(this),{_transitionRejection:this})},e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&Ut(e)(t._transitionRejection)},e.superseded=function(r,n){var i=new e(t.RejectType.SUPERSEDED,"The transition has been superseded by a different transition",r);return n&&n.redirected&&(i.redirected=!0),i},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(r){return new e(t.RejectType.INVALID,"This transition is invalid",r)},e.ignored=function(r){return new e(t.RejectType.IGNORED,"The transition was ignored",r)},e.aborted=function(r){return new e(t.RejectType.ABORTED,"The transition has been aborted",r)},e.errored=function(r){return new e(t.RejectType.ERROR,"The transition errored",r)},e.normalize=function(t){return Ut(e)(t)?t:e.errored(t)},e}(),Le=function(t){var e=t.viewDecl,r=e.$context.name||"(root)";return"[View#"+t.$id+" from '"+r+"' state]: target ui-view: '"+e.$uiViewName+"@"+e.$uiViewContextAnchor+"'"};!function(t){t[t.RESOLVE=0]="RESOLVE",t[t.TRANSITION=1]="TRANSITION",t[t.HOOK=2]="HOOK",t[t.UIVIEW=3]="UIVIEW",t[t.VIEWCONFIG=4]="VIEWCONFIG"}(t.Category||(t.Category={}));var Me=qt("$id"),Be=qt("router.$id"),Ge=function(t){return"Transition #"+Me(t)+"-"+Be(t)},We=function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,r){var n=this;r.length||(r=Object.keys(t.Category).map(function(t){return parseInt(t,10)}).filter(function(t){return!isNaN(t)}).map(function(e){return t.Category[e]})),r.map(A).forEach(function(t){return n._enabled[t]=e})},e.prototype.enable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._set(!0,t)},e.prototype.disable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._set(!1,t)},e.prototype.enabled=function(t){return!!this._enabled[A(t)]},e.prototype.traceTransitionStart=function(e){this.enabled(t.Category.TRANSITION)&&console.log(Ge(e)+": Started -> "+Q(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(t.Category.TRANSITION)&&console.log(Ge(e)+": Ignored <> "+Q(e))},e.prototype.traceHookInvocation=function(e,r,n){if(this.enabled(t.Category.HOOK)){var i=qt("traceData.hookType")(n)||"internal",o=qt("traceData.context.state.name")(n)||qt("traceData.context")(n)||"unknown",a=z(e.registeredHook.callback);console.log(Ge(r)+": Hook -> "+i+" context: "+o+", "+B(200,a))}},e.prototype.traceHookResult=function(e,r,n){this.enabled(t.Category.HOOK)&&console.log(Ge(r)+": <- Hook returned: "+B(200,Q(e)))},e.prototype.traceResolvePath=function(e,r,n){this.enabled(t.Category.RESOLVE)&&console.log(Ge(n)+": Resolving "+e+" ("+r+")")},e.prototype.traceResolvableResolved=function(e,r){this.enabled(t.Category.RESOLVE)&&console.log(Ge(r)+": <- Resolved "+e+" to: "+B(200,Q(e.data)))},e.prototype.traceError=function(e,r){this.enabled(t.Category.TRANSITION)&&console.log(Ge(r)+": <- Rejected "+Q(r)+", reason: "+e)},e.prototype.traceSuccess=function(e,r){this.enabled(t.Category.TRANSITION)&&console.log(Ge(r)+": <- Success "+Q(r)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,r,n){void 0===n&&(n=""),this.enabled(t.Category.UIVIEW)&&console.log("ui-view: "+G(30,e)+" "+V(r)+n)},e.prototype.traceUIViewConfigUpdated=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+r+"'")},e.prototype.traceUIViewFill=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+B(200,r))},e.prototype.traceViewSync=function(e){if(this.enabled(t.Category.VIEWCONFIG)){var r=e.map(function(t){var e=t[0],r=t[1];return{"ui-view fqn":e.$type+":"+e.fqn,"state: view name":r&&r.viewDecl.$context.name+": "+r.viewDecl.$name+" ("+r.viewDecl.$type+")"}}).sort(function(t,e){return t["ui-view fqn"].localeCompare(e["ui-view fqn"])});console.table(r)}},e.prototype.traceViewServiceEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+Le(r))},e.prototype.traceViewServiceUIViewEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+V(r))},e}(),ze=new We;!function(t){t[t.CREATE=0]="CREATE",t[t.BEFORE=1]="BEFORE",t[t.RUN=2]="RUN",t[t.SUCCESS=3]="SUCCESS",t[t.ERROR=4]="ERROR"}(t.TransitionHookPhase||(t.TransitionHookPhase={})),function(t){t[t.TRANSITION=0]="TRANSITION",t[t.STATE=1]="STATE"}(t.TransitionHookScope||(t.TransitionHookScope={}));var Je=function(){function t(t,e,r,n){void 0===n&&(n={}),this._identifier=t,this._definition=e,this._options=n,this._params=r||{}}return t.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},t.prototype.identifier=function(){return this._identifier},t.prototype.params=function(){return this._params},t.prototype.$state=function(){return this._definition},t.prototype.state=function(){return this._definition&&this._definition.self},t.prototype.options=function(){return this._options},t.prototype.exists=function(){return!(!this._definition||!this._definition.self)},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.options().relative;if(!this._definition&&t){var e=t.name?t.name:t;return"Could not resolve '"+this.name()+"' from state '"+e+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},t.prototype.toString=function(){return"'"+this.name()+"'"+pe(this.params())},t.isDef=function(t){return t&&t.state&&(te(t.state)||te(t.state.name))},t}(),Qe={current:l,transition:null,traceData:{},bind:null},Ke=function(){function e(e,r,n,i){var o=this;this.transition=e,this.stateContext=r,this.registeredHook=n,this.options=i,this.isSuperseded=function(){return o.type.hookPhase===t.TransitionHookPhase.RUN&&!o.options.transition.isActive()},this.options=m(i,Qe),this.type=n.eventType}return e.prototype.logError=function(t){this.transition.router.stateService.defaultErrorHandler()(t)},e.prototype.invokeHook=function(){var t=this,e=this.registeredHook;if(!e._deregistered){var r=this.getNotCurrentRejection();if(r)return r;var n=this.options;ze.traceHookInvocation(this,this.transition,n);var i=function(t){return Ue.normalize(t).toPromise()},o=function(r){return e.eventType.getErrorHandler(t)(r)},a=function(r){return e.eventType.getResultHandler(t)(r)};try{var u=function(){return e.callback.call(n.bind,t.transition,t.stateContext)}();return!this.type.synchronous&&ae(u)?u.catch(i).then(a,o):a(u)}catch(t){return o(Ue.normalize(t))}}},e.prototype.handleHookResult=function(t){var e=this,r=this.getNotCurrentRejection();return r||(ae(t)?t.then(function(t){return e.handleHookResult(t)}):(ze.traceHookResult(t,this.transition,this.options),!1===t?Ue.aborted("Hook aborted transition").toPromise():Ut(Je)(t)?Ue.redirected(t).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var t=this.transition.router;return t._disposed?Ue.aborted("UIRouter instance #"+t.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?Ue.aborted().toPromise():this.isSuperseded()?Ue.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var t=this,e=t.options,r=t.registeredHook;return(qt("traceData.hookType")(e)||"internal")+" context: "+(qt("traceData.context.state.name")(e)||qt("traceData.context")(e)||"unknown")+", "+B(200,J(r.callback))},e.chain=function(t,e){var r=function(t,e){return t.then(function(){return e.invokeHook()})};return t.reduce(r,e||se.$q.when())},e.invokeHooks=function(t,r){for(var n=0;n<t.length;n++){var i=t[n].invokeHook();if(ae(i)){var o=t.slice(n+1);return e.chain(o,i).then(r)}}return r()},e.runAllHooks=function(t){t.forEach(function(t){return t.invokeHook()})},e.HANDLE_RESULT=function(t){return function(e){return t.handleHookResult(e)}},e.LOG_REJECTED_RESULT=function(t){return function(e){ae(e)&&e.catch(function(e){return t.logError(Ue.normalize(e))})}},e.LOG_ERROR=function(t){return function(e){return t.logError(e)}},e.REJECT_ERROR=function(t){return function(t){return De(t)}},e.THROW_ERROR=function(t){return function(t){throw t}},e}(),Ye=function(){function e(t,e,r,n,i){void 0===i&&(i={}),this.tranSvc=t,this.eventType=e,this.callback=r,this.matchCriteria=n,this.priority=i.priority||0,this.bind=i.bind||null,this._deregistered=!1}return e.prototype._matchingNodes=function(t,e){if(!0===e)return t;var r=t.filter(function(t){return H(t.state,e)});return r.length?r:null},e.prototype._getDefaultMatchCriteria=function(){return b(this.tranSvc._pluginapi._getPathTypes(),function(){return!0})},e.prototype._getMatchingNodes=function(e){var r=this,n=ve(this._getDefaultMatchCriteria(),this.matchCriteria);return Re(this.tranSvc._pluginapi._getPathTypes()).reduce(function(i,o){var a=o.scope===t.TransitionHookScope.STATE,u=e[o.name]||[],s=a?u:[P(u)];return i[o.name]=r._matchingNodes(s,n[o.name]),i},{})},e.prototype.matches=function(t){var e=this._getMatchingNodes(t);return Re(e).every(f)?e:null},e}(),Ze=function(){function e(t){this.transition=t}return e.prototype.buildHooksForPhase=function(t){var e=this;return this.transition.router.transitionService._pluginapi._getEvents(t).map(function(t){return e.buildHooks(t)}).reduce(Te,[]).filter(f)},e.prototype.buildHooks=function(e){var r=this.transition,n=r.treeChanges(),i=this.getMatchingHooks(e,n);if(!i)return[];var o={transition:r,current:r.options().current},a=function(i){return i.matches(n)[e.criteriaMatchPath.name].map(function(n){var a=ve({bind:i.bind,traceData:{hookType:e.name,context:n}
},o),u=e.criteriaMatchPath.scope===t.TransitionHookScope.STATE?n.state.self:null,s=new Ke(r,u,i,a);return{hook:i,node:n,transitionHook:s}})};return i.map(a).reduce(Te,[]).sort(D(e.reverseSort)).map(function(t){return t.transitionHook})},e.prototype.getMatchingHooks=function(e,r){var n=e.hookPhase===t.TransitionHookPhase.CREATE,i=this.transition.router.transitionService;return(n?[i]:[this.transition,i]).map(function(t){return t.getHooks(e.name)}).filter(je(re,"broken event named: "+e.name)).reduce(Te,[]).filter(function(t){return t.matches(r)})},e}(),Xe=function(){function t(t){this.pattern=/.*/,this.inherit=!0,ve(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{ParamType:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new N(this,t)},t}(),tr=Object.prototype.hasOwnProperty,er=function(t){return 0===["value","type","squash","array","dynamic"].filter(tr.bind(t||{})).length};!function(t){t[t.PATH=0]="PATH",t[t.SEARCH=1]="SEARCH",t[t.CONFIG=2]="CONFIG"}(t.DefType||(t.DefType={}));var rr=function(){function e(e,r,n,i,o){n=F(n),r=U(n,r,i,e,o.paramTypes);var a=function(){var r={array:i===t.DefType.SEARCH&&"auto"},o=e.match(/\[\]$/)?{array:!0}:{};return ve(r,o,n).array}();r=a?r.$asArray(a,i===t.DefType.SEARCH):r;var u=void 0!==n.value||i===t.DefType.SEARCH,s=Qt(n.dynamic)?!!n.dynamic:!!r.dynamic,c=Qt(n.raw)?!!n.raw:!!r.raw,f=L(n,u,o.defaultSquashPolicy()),l=M(n,a,u,f),p=Qt(n.inherit)?!!n.inherit:!!r.inherit;ve(this,{id:e,type:r,location:i,isOptional:u,dynamic:s,raw:c,squash:f,replace:l,inherit:p,array:a,config:n})}return e.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},e.prototype.value=function(t){var e=this;return t=function(t){for(var r=0,n=e.replace;r<n.length;r++){var i=n[r];if(i.from===t)return i.to}return t}(t),Jt(t)?function(){if(e._defaultValueCache)return e._defaultValueCache.defaultValue;if(!se.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=se.$injector.invoke(e.config.$$fn);if(null!==t&&void 0!==t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of ParamType ("+e.type.name+")");return e.config.$$fn.__cacheable&&(e._defaultValueCache={defaultValue:t}),t}():this.type.$normalize(t)},e.prototype.isSearch=function(){return this.location===t.DefType.SEARCH},e.prototype.validates=function(t){if((Jt(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var r=this.type.encode(e);return!(te(r)&&!this.type.pattern.exec(r))},e.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},e.values=function(t,e){void 0===e&&(e={});for(var r={},n=0,i=t;n<i.length;n++){var o=i[n];r[o.id]=o.value(e[o.id])}return r},e.changed=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),t.filter(function(t){return!t.type.equals(e[t.id],r[t.id])})},e.equals=function(t,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),0===e.changed(t,r,n).length},e.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(Ee,!0)},e}(),nr=function(){function t(e){if(e instanceof t){var r=e;this.state=r.state,this.paramSchema=r.paramSchema.slice(),this.paramValues=ve({},r.paramValues),this.resolvables=r.resolvables.slice(),this.views=r.views&&r.views.slice()}else{var n=e;this.state=n,this.paramSchema=n.parameters({inherit:!1}),this.paramValues={},this.resolvables=n.resolvables.map(function(t){return t.clone()})}}return t.prototype.applyRawParams=function(t){var e=function(e){return[e.id,e.value(t[e.id])]};return this.paramValues=this.paramSchema.reduce(function(t,r){return T(t,e(r))},{}),this},t.prototype.parameter=function(t){return S(this.paramSchema,Ht("id",t))},t.prototype.equals=function(t,e){var r=this.diff(t,e);return r&&0===r.length},t.prototype.diff=function(t,e){if(this.state!==t.state)return!1;var r=e?e(this):this.paramSchema;return rr.changed(r,this.paramValues,t.paramValues)},t.clone=function(e){return new t(e)},t}(),ir=function(){function t(){}return t.makeTargetState=function(t){var e=P(t).state;return new Je(e,e,t.map(At("paramValues")).reduce(Se,{}))},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new nr(t).applyRawParams(e)})},t.buildToPath=function(e,r){var n=t.buildPath(r);return r.options().inherit?t.inheritParams(e,n,Object.keys(r.params())):n},t.applyViewConfigs=function(e,r,n){r.filter(function(t){return ge(n,t.state)}).forEach(function(n){var i=Re(n.state.views||{}),o=t.subPath(r,function(t){return t===n}),a=i.map(function(t){return e.createViewConfig(o,t)});n.views=a.reduce(Te,[])})},t.inheritParams=function(t,e,r){function n(t,e){var r=S(t,Ht("state",e));return ve({},r&&r.paramValues)}function i(e){var i=ve({},e&&e.paramValues),a=g(i,r);i=w(i,r);var u=w(n(t,e.state)||{},o),s=ve(i,u,a);return new nr(e.state).applyRawParams(s)}void 0===r&&(r=[]);var o=t.map(function(t){return t.paramSchema}).reduce(Te,[]).filter(function(t){return!t.inherit}).map(At("id"));return e.map(i)},t.treeChanges=function(e,r,n){function i(t,e){var n=nr.clone(t);return n.paramValues=r[e].paramValues,n}for(var o=0,a=Math.min(e.length,r.length);o<a&&e[o].state!==n&&function(e,r){return e.equals(r,t.nonDynamicParams)}(e[o],r[o]);)o++;var u,s,c,f,l;u=e,s=u.slice(0,o),c=u.slice(o);var p=s.map(i);return f=r.slice(o),l=p.concat(f),{from:u,to:l,retained:s,exiting:c,entering:f}},t.matching=function(t,e,r){var n=!1;return C(t,e).reduce(function(t,e){var i=e[0],o=e[1];return n=n||!i.equals(o,r),n?t:t.concat(i)},[])},t.equals=function(e,r,n){return e.length===r.length&&t.matching(e,r,n).length===e.length},t.subPath=function(t,e){var r=S(t,e),n=t.indexOf(r);return-1===n?void 0:t.slice(0,n+1)},t.nonDynamicParams=function(t){return t.state.parameters({inherit:!1}).filter(function(t){return!t.dynamic})},t.paramValues=function(t){return t.reduce(function(t,e){return ve(t,e.paramValues)},{})},t}(),or={when:"LAZY",async:"WAIT"},ar=function(){function t(e,r,n,i,o){if(this.resolved=!1,this.promise=void 0,e instanceof t)ve(this,e);else if(Zt(r)){if(Yt(e))throw new Error("new Resolvable(): token argument is required");if(!Zt(r))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=e,this.policy=i,this.resolveFn=r,this.deps=n||[],this.data=o,this.resolved=void 0!==o,this.promise=this.resolved?se.$q.when(this.data):void 0}else if(ee(e)&&e.token&&Zt(e.resolveFn)){var a=e;return new t(a.token,a.resolveFn,a.deps,a.policy,a.data)}}return t.prototype.getPolicy=function(t){var e=this.policy||{},r=t&&t.resolvePolicy||{};return{when:e.when||r.when||or.when,async:e.async||r.async||or.async}},t.prototype.resolve=function(t,e){var r=this,n=se.$q,i=function(){return n.all(t.getDependencies(r).map(function(r){return r.get(t,e)}))},o=function(t){return r.resolveFn.apply(null,t)},a=function(t){var e=t.cache(1);return e.take(1).toPromise().then(function(){return e})},u=t.findNode(this),s=u&&u.state,c="RXWAIT"===this.getPolicy(s).async?a:f,l=function(t){return r.data=t,r.resolved=!0,ze.traceResolvableResolved(r,e),r.data};return this.promise=n.when().then(i).then(o).then(c).then(l)},t.prototype.get=function(t,e){return this.promise||this.resolve(t,e)},t.prototype.toString=function(){return"Resolvable(token: "+Q(this.token)+", requires: ["+this.deps.map(Q)+"])"},t.prototype.clone=function(){return new t(this)},t.fromData=function(e,r){return new t(e,function(){return r},null,null,r)},t}(),ur={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT",RXWAIT:"RXWAIT"}},sr=ur.when,cr=[sr.EAGER,sr.LAZY],fr=[sr.EAGER],lr="Native Injector",pr=function(){function t(t){this._path=t}return t.prototype.getTokens=function(){return this._path.reduce(function(t,e){return t.concat(e.resolvables.map(function(t){return t.token}))},[]).reduce(ke,[])},t.prototype.getResolvable=function(t){return P(this._path.map(function(t){return t.resolvables}).reduce(Te,[]).filter(function(e){return e.token===t}))},t.prototype.getPolicy=function(t){var e=this.findNode(t);return t.getPolicy(e.state)},t.prototype.subContext=function(e){return new t(ir.subPath(this._path,function(t){return t.state===e}))},t.prototype.addResolvables=function(t,e){var r=S(this._path,Ht("state",e)),n=t.map(function(t){return t.token});r.resolvables=r.resolvables.filter(function(t){return-1===n.indexOf(t.token)}).concat(t)},t.prototype.resolvePath=function(t,e){var r=this;void 0===t&&(t="LAZY");var n=ge(cr,t)?t:"LAZY",i=n===ur.when.EAGER?fr:cr;ze.traceResolvePath(this._path,t,e);var o=function(t,e){return function(n){return ge(t,r.getPolicy(n)[e])}},a=this._path.reduce(function(t,n){var a=n.resolvables.filter(o(i,"when")),u=a.filter(o(["NOWAIT"],"async")),s=a.filter(Dt(o(["NOWAIT"],"async"))),c=r.subContext(n.state),f=function(t){return t.get(c,e).then(function(e){return{token:t.token,value:e}})};return u.forEach(f),t.concat(s.map(f))},[]);return se.$q.all(a)},t.prototype.injector=function(){return this._injector||(this._injector=new hr(this))},t.prototype.findNode=function(t){return S(this._path,function(e){return ge(e.resolvables,t)})},t.prototype.getDependencies=function(t){var e=this,r=this.findNode(t),n=ir.subPath(this._path,function(t){return t===r})||this._path,i=n.reduce(function(t,e){return t.concat(e.resolvables)},[]).filter(function(e){return e!==t}),o=function(t){var r=i.filter(function(e){return e.token===t});if(r.length)return P(r);var n=e.injector().getNative(t);if(!n)throw new Error("Could not find Dependency Injection token: "+Q(t));return new ar(t,function(){return n},[],n)};return t.deps.map(o)},t}(),hr=function(){function t(t){this.context=t,this.native=this.get(lr)||se.$injector}return t.prototype.get=function(t){var e=this.context.getResolvable(t);if(e){if("NOWAIT"===this.context.getPolicy(e).async)return e.get(this.context);if(!e.resolved)throw new Error("Resolvable async .get() not complete:"+Q(e.token));return e.data}return this.native&&this.native.get(t)},t.prototype.getAsync=function(t){var e=this.context.getResolvable(t);return e?e.get(this.context):se.$q.when(this.native.get(t))},t.prototype.getNative=function(t){return this.native&&this.native.get(t)},t}(),dr=At("self"),vr=function(){function e(e,r,n){var i=this;if(this._deferred=se.$q.defer(),this.promise=this._deferred.promise,this._registeredHooks={},this._hookBuilder=new Ze(this),this.isActive=function(){return i.router.globals.transition===i},this.router=n,this._targetState=r,!r.valid())throw new Error(r.error());this._options=ve({current:Mt(this)},r.options()),this.$id=n.transitionService._transitionCount++;var o=ir.buildToPath(e,r);this._treeChanges=ir.treeChanges(e,o,this._options.reloadState),this.createTransitionHookRegFns();var a=this._hookBuilder.buildHooksForPhase(t.TransitionHookPhase.CREATE);Ke.invokeHooks(a,function(){return null}),this.applyViewConfigs(n)}return e.prototype.onBefore=function(t,e,r){},e.prototype.onStart=function(t,e,r){},e.prototype.onExit=function(t,e,r){},e.prototype.onRetain=function(t,e,r){},e.prototype.onEnter=function(t,e,r){},e.prototype.onFinish=function(t,e,r){},e.prototype.onSuccess=function(t,e,r){},e.prototype.onError=function(t,e,r){},e.prototype.createTransitionHookRegFns=function(){var e=this;this.router.transitionService._pluginapi._getEvents().filter(function(e){return e.hookPhase!==t.TransitionHookPhase.CREATE}).forEach(function(t){return q(e,e.router.transitionService,t)})},e.prototype.getHooks=function(t){return this._registeredHooks[t]},e.prototype.applyViewConfigs=function(t){var e=this._treeChanges.entering.map(function(t){return t.state});ir.applyViewConfigs(t.transitionService.$view,this._treeChanges.to,e)},e.prototype.$from=function(){return P(this._treeChanges.from).state},e.prototype.$to=function(){return P(this._treeChanges.to).state},e.prototype.from=function(){return this.$from().self},e.prototype.to=function(){return this.$to().self},e.prototype.targetState=function(){return this._targetState},e.prototype.is=function(t){return t instanceof e?this.is({to:t.$to().name,from:t.$from().name}):!(t.to&&!H(this.$to(),t.to)||t.from&&!H(this.$from(),t.from))},e.prototype.params=function(t){return void 0===t&&(t="to"),Object.freeze(this._treeChanges[t].map(At("paramValues")).reduce(Se,{}))},e.prototype.injector=function(t,e){void 0===e&&(e="to");var r=this._treeChanges[e];return t&&(r=ir.subPath(r,function(e){return e.state===t||e.state.name===t})),new pr(r).injector()},e.prototype.getResolveTokens=function(t){return void 0===t&&(t="to"),new pr(this._treeChanges[t]).getTokens()},e.prototype.addResolvable=function(t,e){void 0===e&&(e=""),t=Ut(ar)(t)?t:new ar(t);var r="string"==typeof e?e:e.name,n=this._treeChanges.to,i=S(n,function(t){return t.state.name===r});new pr(n).addResolvables([t],i.state)},e.prototype.redirectedFrom=function(){return this._options.redirectedFrom||null},e.prototype.originalTransition=function(){var t=this.redirectedFrom();return t&&t.originalTransition()||this},e.prototype.options=function(){return this._options},e.prototype.entering=function(){return b(this._treeChanges.entering,At("state")).map(dr)},e.prototype.exiting=function(){return b(this._treeChanges.exiting,At("state")).map(dr).reverse()},e.prototype.retained=function(){return b(this._treeChanges.retained,At("state")).map(dr)},e.prototype.views=function(t,e){void 0===t&&(t="entering");var r=this._treeChanges[t];return r=e?r.filter(Ht("state",e)):r,r.map(At("views")).filter(f).reduce(Te,[])},e.prototype.treeChanges=function(t){return t?this._treeChanges[t]:this._treeChanges},e.prototype.redirect=function(t){for(var e=1,r=this;null!=(r=r.redirectedFrom());)if(++e>20)throw new Error("Too many consecutive Transition redirects (20+)");var n={redirectedFrom:this,source:"redirect"};"url"===this.options().source&&!1!==t.options().location&&(n.location="replace");var i=ve({},this.options(),t.options(),n);t=new Je(t.identifier(),t.$state(),t.params(),i);var o=this.router.transitionService.create(this._treeChanges.from,t),a=this._treeChanges.entering,u=o._treeChanges.entering;return ir.matching(u,a,ir.nonDynamicParams).filter(Dt(function(t){return function(e){return t&&e.state.includes[t.name]}}(t.options().reloadState))).forEach(function(t,e){t.resolvables=a[e].resolvables}),o},e.prototype._changedParams=function(){var t=this._treeChanges;if(!this._options.reload&&!t.exiting.length&&!t.entering.length&&t.to.length===t.from.length){if(!C(t.to,t.from).map(function(t){return t[0].state!==t[1].state}).reduce(Ce,!1)){var e=t.to.map(function(t){return t.paramSchema}),r=[t.to,t.from].map(function(t){return t.map(function(t){return t.paramValues})});return C(e,r[0],r[1]).map(function(t){var e=t[0],r=t[1],n=t[2];return rr.changed(e,r,n)}).reduce(Te,[])}}},e.prototype.dynamic=function(){var t=this._changedParams();return!!t&&t.map(function(t){return t.dynamic}).reduce(Ce,!1)},e.prototype.ignored=function(){return!!this._ignoredReason()},e.prototype._ignoredReason=function(){var t=this.router.globals.transition,e=this._options.reloadState,r=function(t,r){if(t.length!==r.length)return!1;var n=ir.matching(t,r);return t.length===n.filter(function(t){return!e||!t.state.includes[e.name]}).length},n=this.treeChanges(),i=t&&t.treeChanges();return i&&r(i.to,n.to)&&r(i.exiting,n.exiting)?"SameAsPending":0===n.exiting.length&&0===n.entering.length&&r(n.from,n.to)?"SameAsCurrent":void 0},e.prototype.run=function(){var e=this,r=Ke.runAllHooks,n=function(t){return e._hookBuilder.buildHooksForPhase(t)},i=function(){ze.traceSuccess(e.$to(),e),e.success=!0,e._deferred.resolve(e.to()),r(n(t.TransitionHookPhase.SUCCESS))},o=function(i){ze.traceError(i,e),e.success=!1,e._deferred.reject(i),e._error=i,r(n(t.TransitionHookPhase.ERROR))},a=function(){var e=n(t.TransitionHookPhase.RUN),r=function(){return se.$q.when(void 0)};return Ke.invokeHooks(e,r)},u=function(){var t=e.router.globals;return t.lastStartedTransitionId=e.$id,t.transition=e,t.transitionHistory.enqueue(e),ze.traceTransitionStart(e),se.$q.when(void 0)},s=n(t.TransitionHookPhase.BEFORE);return Ke.invokeHooks(s,u).then(a).then(i,o),this.promise},e.prototype.valid=function(){return!this.error()||void 0!==this.success},e.prototype.abort=function(){Jt(this.success)&&(this._aborted=!0)},e.prototype.error=function(){var t=this.$to();if(t.self.abstract)return"Cannot transition to abstract state '"+t.name+"'";var e=t.parameters(),r=this.params(),n=e.filter(function(t){return!t.validates(r[t.id])});return n.length?"Param values not valid for state '"+t.name+"'. Invalid params: [ "+n.map(function(t){return t.id}).join(", ")+" ]":!1===this.success?this._error:void 0},e.prototype.toString=function(){var t=this.from(),e=this.to(),r=function(t){return null!==t["#"]&&void 0!==t["#"]?t:w(t,["#"])};return"Transition#"+this.$id+"( '"+(ee(t)?t.name:t)+"'"+pe(r(this._treeChanges.from.map(At("paramValues")).reduce(Se,{})))+" -> "+(this.valid()?"":"(X) ")+"'"+(ee(e)?e.name:e)+"'"+pe(r(this.params()))+" )"},e.diToken=e,e}(),mr=null,yr=function(t){var e=Ue.isRejectionPromise;return(mr=mr||s([[Dt(Qt),Mt("undefined")],[Kt,Mt("null")],[ae,Mt("[Promise]")],[e,function(t){return t._transitionRejection.toString()}],[Ut(Ue),u("toString")],[Ut(vr),u("toString")],[Ut(ar),u("toString")],[c,z],[Mt(!0),f]]))(t)},gr=function(t){return function(e){if(!e)return["",""];var r=e.indexOf(t);return-1===r?[e,""]:[e.substr(0,r),e.substr(r+1)]}},wr=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=g(t.prototype,["hash","string","query","path","int","bool","date","json","any"]);var e=function(t,e){return new Xe(ve({name:e},t))};this.types=ye(b(this.defaultTypes,e),{})}return t.prototype.dispose=function(){this.types={}},t.prototype.type=function(t,e,r){if(!Qt(e))return this.types[t];if(this.types.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return this.types[t]=new Xe(ve({name:t},e)),r&&(this.typeQueue.push({name:t,def:r}),this.enqueue||this._flushTypeQueue()),this},t.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var t=this.typeQueue.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");ve(this.types[t.name],se.$injector.invoke(t.def))}},t}();!function(){var t=function(t){var e=function(t){return null!=t?t.toString():t},r={encode:e,decode:e,is:Ut(String),pattern:/.*/,equals:function(t,e){return t==e}};return ve({},r,t)};ve(wr.prototype,{string:t({}),path:t({pattern:/[^\/]*/}),query:t({}),hash:t({inherit:!1}),int:t({decode:function(t){return parseInt(t,10)},is:function(t){return!Yt(t)&&this.decode(t.toString())===t},pattern:/-?\d+/}),bool:t({encode:function(t){return t&&1||0},decode:function(t){return 0!==parseInt(t,10)},is:Ut(Boolean),pattern:/0|1/}),date:t({encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):void 0},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):void 0},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return["getFullYear","getMonth","getDate"].reduce(function(r,n){return r&&t[n]()===e[n]()},!0)},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:t({encode:pe,decode:le,is:Ut(Object),equals:me,pattern:/[^\/]*/}),any:t({encode:f,decode:f,is:function(){return!0},equals:me})})}();var _r,$r=function(){function t(t){void 0===t&&(t={}),ve(this,t)}return t.prototype.$inherit=function(t,e,r){var n,i=y(e,r),o={},a=[];for(var u in i)if(i[u]&&i[u].params&&(n=Object.keys(i[u].params),n.length))for(var s in n)a.indexOf(n[s])>=0||(a.push(n[s]),o[n[s]]=this[n[s]]);return ve({},o,t)},t}(),Sr=function(t){if(!te(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},br=function(t,e){return function(r){var n=r;n&&n.url&&n.name&&n.name.match(/\.\*\*$/)&&(n.url+="{remainder:any}");var i=Sr(n.url),o=r.parent,a=i?t.compile(i.val,{params:r.params||{},paramMap:function(t,e){return!1===n.reloadOnSearch&&e&&(t=ve(t||{},{dynamic:!0})),t}}):n.url;if(!a)return null;if(!t.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+r+"'");return i&&i.root?a:(o&&o.navigable||e()).url.append(a)}},Rr=function(t){return function(e){return!t(e)&&e.url?e:e.parent?e.parent.navigable:null}},Er=function(t){return function(e){var r=function(e,r){return t.fromConfig(r,null,e)},n=e.url&&e.url.parameters({inherit:!1})||[],i=Re(be(w(e.params||{},n.map(At("id"))),r));return n.concat(i).map(function(t){return[t.id,t]}).reduce(T,{})}},Cr=function(){function t(t,e){function r(e){return o(e)?null:t.find(n.parentName(e))||i()}this.matcher=t;var n=this,i=function(){return t.find("")},o=function(t){return""===t.name};this.builders={name:[Z],self:[X],parent:[r],data:[tt],url:[br(e,i)],navigable:[Rr(o)],params:[Er(e.paramFactory)],views:[],path:[et],includes:[rt],resolvables:[nt]}}return t.prototype.builder=function(t,e){var r=this.builders,n=r[t]||[];return te(t)&&!Qt(e)?n.length>1?n:n[0]:te(t)&&Zt(e)?(r[t]=n,r[t].push(e),function(){return r[t].splice(r[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,r=e.matcher,n=e.builders,i=this.parentName(t);if(i&&!r.find(i,void 0,!1))return null;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o].reduce(function(t,e){return function(r){return e(r,t)}},l);t[o]=a(t)}return t},t.prototype.parentName=function(t){var e=t.name||"",r=e.split(".");if("**"===r.pop()&&r.pop(),r.length){if(t.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+e+")");return r.join(".")}return t.parent?te(t.parent)?t.parent:t.parent.name:""},t.prototype.name=function(t){var e=t.name;if(-1!==e.indexOf(".")||!t.parent)return e;var r=te(t.parent)?t.parent:t.parent.name;return r?r+"."+e:e},t}(),Tr=function(){function t(t){this._states=t}return t.prototype.isRelative=function(t){return t=t||"",0===t.indexOf(".")||0===t.indexOf("^")},t.prototype.find=function(t,e,r){if(void 0===r&&(r=!0),t||""===t){var n=te(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];if(o&&(n||!(n||o!==t&&o.self!==t)))return o;if(n&&r){var a=Re(this._states),u=a.filter(function(t){return t.__stateObjectCache.nameGlob&&t.__stateObjectCache.nameGlob.matches(i)});return u.length>1&&console.log("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map(function(t){return t.name})),u[0]}}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var r=this.find(e),n=t.split("."),i=0,o=n.length,a=r;i<o;i++)if(""!==n[i]||0!==i){if("^"!==n[i])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+r.name+"'");a=a.parent}else a=r;var u=n.slice(i).join(".");return a.name+(a.name&&u?".":"")+u},t}(),Pr=function(){function t(t,e,r,n,i){this.$registry=t,this.$urlRouter=e,this.states=r,this.builder=n,this.listeners=i,this.queue=[],this.matcher=t.matcher}return t.prototype.dispose=function(){this.queue=[]},t.prototype.register=function(t){var e=this.queue,r=Gt.create(t),n=r.name;if(!te(n))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(n)||ge(e.map(At("name")),n))throw new Error("State '"+n+"' is already defined");return e.push(r),this.flush(),r},t.prototype.flush=function(){for(var t=this,e=this,r=e.queue,n=e.states,i=e.builder,o=[],a=[],u={},s=function(e){return t.states.hasOwnProperty(e)&&t.states[e]};r.length>0;){var c=r.shift(),f=c.name,l=i.build(c),p=a.indexOf(c);if(l){var h=s(f);if(h&&h.name===f)throw new Error("State '"+f+"' is already defined");var d=s(f+".**");d&&this.$registry.deregister(d),n[f]=c,this.attachRoute(c),p>=0&&a.splice(p,1),o.push(c)}else{var v=u[f];if(u[f]=r.length,p>=0&&v===r.length)return r.push(c),n;p<0&&a.push(c),r.push(c)}}return o.length&&this.listeners.forEach(function(t){return t("registered",o.map(function(t){return t.self}))}),n},t.prototype.attachRoute=function(t){!t.abstract&&t.url&&this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(t))},t}(),kr=function(){function t(t){this._router=t,this.states={},this.listeners=[],this.matcher=new Tr(this.states),this.builder=new Cr(this.matcher,t.urlMatcherFactory),this.stateQueue=new Pr(this,t.urlRouter,this.states,this.builder,this.listeners),this._registerRoot()}return t.prototype._registerRoot=function(){var t={name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0};(this._root=this.stateQueue.register(t)).navigable=null},t.prototype.dispose=function(){var t=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach(function(e){return t.get(e)&&t.deregister(e)})},t.prototype.onStatesChanged=function(t){return this.listeners.push(t),function(){we(this.listeners)(t)}.bind(this)},t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype._deregisterTree=function(t){var e=this,r=this.get().map(function(t){return t.$$state()}),n=function(t){var e=r.filter(function(e){return-1!==t.indexOf(e.parent)});return 0===e.length?e:e.concat(n(e))},i=n([t]),o=[t].concat(i).reverse();return o.forEach(function(t){var r=e._router.urlRouter;r.rules().filter(Ht("state",t)).forEach(r.removeRule.bind(r)),delete e.states[t.name]}),o},t.prototype.deregister=function(t){var e=this.get(t);if(!e)throw new Error("Can't deregister state; not found: "+t);var r=this._deregisterTree(e.$$state());return this.listeners.forEach(function(t){return t("deregistered",r.map(function(t){return t.self}))}),r},t.prototype.get=function(t,e){var r=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return r.states[t].self});var n=this.matcher.find(t,e);return n&&n.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}(),Or=function(t,e,r){return t[e]=t[e]||r()},xr=K("/"),jr=function(){function e(t,r,n,i){var o=this;this.config=i,this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.pattern=t,this.config=m(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:f});for(var a,u,s,c=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=0,h=[],d=function(r){if(!e.nameValidator.test(r))throw new Error("Invalid parameter name '"+r+"' in pattern '"+t+"'");if(S(o._params,Ht("id",r)))throw new Error("Duplicate parameter name '"+r+"' in pattern '"+t+"'")},v=function(e,n){var i=e[2]||e[3],a=n?e[4]:e[4]||("*"===e[1]?"[\\s\\S]*":null);return{id:i,regexp:a,cfg:o.config.params[i],segment:t.substring(p,e.index),type:a?r.type(a)||function(t){return ye(r.type(n?"query":"path"),{pattern:new RegExp(t,o.config.caseInsensitive?"i":void 0)})}(a):null}};(a=c.exec(t))&&(u=v(a,!1),!(u.segment.indexOf("?")>=0));)d(u.id),this._params.push(n.fromPath(u.id,u.type,this.config.paramMap(u.cfg,!1))),this._segments.push(u.segment),h.push([u.segment,P(this._params)]),p=c.lastIndex;s=t.substring(p);var y=s.indexOf("?");if(y>=0){var g=s.substring(y);if(s=s.substring(0,y),g.length>0)for(p=0;a=l.exec(g);)u=v(a,!0),d(u.id),this._params.push(n.fromSearch(u.id,u.type,this.config.paramMap(u.cfg,!0))),p=c.lastIndex}this._segments.push(s),this._compiled=h.map(function(t){return it.apply(null,t)}).concat(it(s))}return e.prototype.append=function(t){return this._children.push(t),t._cache={path:this._cache.path.concat(t),parent:this,pattern:null},t},e.prototype.isRoot=function(){return this._cache.path[0]===this},e.prototype.toString=function(){return this.pattern},e.prototype.exec=function(t,e,r,n){var i=this;void 0===e&&(e={}),void 0===n&&(n={});var o=Or(this._cache,"pattern",function(){return new RegExp(["^",Oe(i._cache.path.map(At("_compiled"))).join(""),!1===i.config.strict?"/?":"","$"].join(""),i.config.caseInsensitive?"i":void 0)}).exec(t);if(!o)return null;var a=this.parameters(),u=a.filter(function(t){return!t.isSearch()}),s=a.filter(function(t){return t.isSearch()}),c=this._cache.path.map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),f={};if(c!==o.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var l=0;l<c;l++){for(var p=u[l],h=o[l+1],d=0;d<p.replace.length;d++)p.replace[d].from===h&&(h=p.replace[d].to);h&&!0===p.array&&(h=function(t){var e=function(t){return t.split("").reverse().join("")},r=function(t){return t.replace(/\\-/g,"-")};return b(b(e(t).split(/-(?!\\)/),e),r).reverse()}(h)),Qt(h)&&(h=p.type.decode(h)),f[p.id]=p.value(h)}return s.forEach(function(t){for(var r=e[t.id],n=0;n<t.replace.length;n++)t.replace[n].from===r&&(r=t.replace[n].to);Qt(r)&&(r=t.type.decode(r)),f[t.id]=t.value(r)}),r&&(f["#"]=r),f},e.prototype.parameters=function(t){return void 0===t&&(t={}),!1===t.inherit?this._params:Oe(this._cache.path.map(function(t){return t._params}))},e.prototype.parameter=function(t,e){var r=this;void 0===e&&(e={});var n=this._cache.parent;return function(){for(var e=0,n=r._params;e<n.length;e++){var i=n[e];if(i.id===t)return i}}()||!1!==e.inherit&&n&&n.parameter(t,e)||null},e.prototype.validates=function(t){var e=function(t,e){return!t||t.validates(e)};return t=t||{},this.parameters().filter(function(e){return t.hasOwnProperty(e.id)}).map(function(r){return e(r,t[r.id])}).reduce(Ee,!0)},e.prototype.format=function(t){function r(e){var r=e.value(t[e.id]),n=e.validates(r),i=e.isDefaultValue(r);return{param:e,value:r,isValid:n,isDefaultValue:i,squash:!!i&&e.squash,encoded:e.type.encode(r)}}void 0===t&&(t={});var n=this._cache.path,i=n.map(e.pathSegmentsAndParams).reduce(Te,[]).map(function(t){return te(t)?t:r(t)}),o=n.map(e.queryParams).reduce(Te,[]).map(r),a=function(t){return!1===t.isValid};if(i.concat(o).filter(a).length)return null;var u=i.reduce(function(t,r){if(te(r))return t+r;var n=r.squash,i=r.encoded,o=r.param;return!0===n?t.match(/\/$/)?t.slice(0,-1):t:te(n)?t+n:!1!==n?t:null==i?t:re(i)?t+b(i,e.encodeDashes).join("-"):o.raw?t+i:t+encodeURIComponent(i)},""),s=o.map(function(t){var e=t.param,r=t.squash,n=t.encoded,i=t.isDefaultValue;if(!(null==n||i&&!1!==r)&&(re(n)||(n=[n]),0!==n.length))return e.raw||(n=b(n,encodeURIComponent)),n.map(function(t){return e.id+"="+t})}).filter(f).reduce(Te,[]).join("&");return u+(s?"?"+s:"")+(t["#"]?"#"+t["#"]:"")},e.encodeDashes=function(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})},e.pathSegmentsAndParams=function(e){return C(e._segments,e._params.filter(function(e){return e.location===t.DefType.PATH}).concat(void 0)).reduce(Te,[]).filter(function(t){return""!==t&&Qt(t)})},e.queryParams=function(e){return e._params.filter(function(e){return e.location===t.DefType.SEARCH})},e.compare=function(t,r){var n,i,o=function(t){return t._cache.segments=t._cache.segments||t._cache.path.map(e.pathSegmentsAndParams).reduce(Te,[]).reduce(Y,[]).map(function(t){return te(t)?xr(t):t}).reduce(Te,[])},a=function(t){return t._cache.weights=t._cache.weights||o(t).map(function(t){return"/"===t?1:te(t)?2:t instanceof rr?3:void 0})},u=C(a(t),a(r));for(i=0;i<u.length;i++)if(0!==(n=u[i][0]-u[i][1]))return n;return 0},e.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,e}(),Ir=function(){function e(){var e=this;this.paramTypes=new wr,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this._getConfig=function(t){return ve({strict:e._isStrictMode,
caseInsensitive:e._isCaseInsensitive},t)},this.paramFactory={fromConfig:function(r,n,i){return new rr(r,n,i,t.DefType.CONFIG,e)},fromPath:function(r,n,i){return new rr(r,n,i,t.DefType.PATH,e)},fromSearch:function(r,n,i){return new rr(r,n,i,t.DefType.SEARCH,e)}},ve(this,{UrlMatcher:jr,Param:rr})}return e.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=Qt(t)?t:this._isCaseInsensitive},e.prototype.strictMode=function(t){return this._isStrictMode=Qt(t)?t:this._isStrictMode},e.prototype.defaultSquashPolicy=function(t){if(Qt(t)&&!0!==t&&!1!==t&&!te(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=Qt(t)?t:this._defaultSquashPolicy},e.prototype.compile=function(t,e){return new jr(t,this.paramTypes,this.paramFactory,this._getConfig(e))},e.prototype.isMatcher=function(t){if(!ee(t))return!1;var e=!0;return de(jr.prototype,function(r,n){Zt(r)&&(e=e&&Qt(t[n])&&Zt(t[n]))}),e},e.prototype.type=function(t,e,r){var n=this.paramTypes.type(t,e,r);return Qt(e)?this:n},e.prototype.$get=function(){return this.paramTypes.enqueue=!1,this.paramTypes._flushTypeQueue(),this},e.prototype.dispose=function(){this.paramTypes.dispose()},e}(),Vr=function(){function t(t){this.router=t}return t.prototype.compile=function(t){return this.router.urlMatcherFactory.compile(t)},t.prototype.create=function(t,e){var r=this,n=s([[te,function(t){return n(r.compile(t))}],[Ut(jr),function(t){return r.fromUrlMatcher(t,e)}],[oe,function(t){return r.fromState(t,r.router)}],[Ut(RegExp),function(t){return r.fromRegExp(t,e)}],[Zt,function(t){return new Ar(t,e)}]]),i=n(t);if(!i)throw new Error("invalid 'what' in when()");return i},t.prototype.fromUrlMatcher=function(t,e){function r(e){var r=t.exec(e.path,e.search,e.hash);return t.validates(r)&&r}function n(e){var r=t.parameters().filter(function(t){return t.isOptional});return r.length?r.filter(function(t){return e[t.id]}).length/r.length:1e-6}var i=e;te(e)&&(e=this.router.urlMatcherFactory.compile(e)),Ut(jr)(e)&&(i=function(t){return e.format(t)});var o={urlMatcher:t,matchPriority:n,type:"URLMATCHER"};return ve(new Ar(r,i),o)},t.prototype.fromState=function(t,e){var r=function(r){var n=e.stateService,i=e.globals;n.href(t,r)!==n.href(i.current,i.params)&&n.transitionTo(t,r,{inherit:!0,source:"url"})},n={state:t,type:"STATE"};return ve(this.fromUrlMatcher(t.url,r),n)},t.prototype.fromRegExp=function(t,e){if(t.global||t.sticky)throw new Error("Rule RegExp must not be global or sticky");var r=function(t){return e.replace(/\$(\$|\d{1,2})/,function(e,r){return t["$"===r?0:Number(r)]})},n=te(e)?r:e,i=function(e){return t.exec(e.path)},o={regexp:t,type:"REGEXP"};return ve(new Ar(i,n),o)},t.isUrlRule=function(t){return t&&["type","match","handler"].every(function(e){return Qt(t[e])})},t}(),Ar=function(){function t(t,e){var r=this;this.match=t,this.type="RAW",this.matchPriority=function(t){return 0-r.$id},this.handler=e||f}return t}(),Hr=At("urlMatcher");_r=He(Ae(i(At("priority"),function(t){return-t})),Ae(i(At("type"),function(t){return{STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1}[t]})),function(t,e){return Hr(t)&&Hr(e)?jr.compare(Hr(t),Hr(e)):0},Ae(At("$id"),ge(["REGEXP","RAW","OTHER"])));var qr=function(){function t(e){this._sortFn=_r,this._rules=[],this.interceptDeferred=!1,this._id=0,this._sorted=!1,this._router=e,this.urlRuleFactory=new Vr(e),p(Mt(t.prototype),this,Mt(this))}return t.prototype.dispose=function(){this.listen(!1),this._rules=[],delete this._otherwiseFn},t.prototype.sort=function(t){this._rules.sort(this._sortFn=t||this._sortFn),this._sorted=!0},t.prototype.ensureSorted=function(){this._sorted||this.sort()},t.prototype.match=function(t){var e=this;this.ensureSorted(),t=ve({path:"",search:{},hash:""},t);var r=this.rules();this._otherwiseFn&&r.push(this._otherwiseFn);for(var n,i=0;i<r.length&&(!n||0===this._sortFn(r[i],n.rule));i++){var o=function(r){var n=r.match(t,e._router);return n&&{match:n,rule:r,weight:r.matchPriority(n)}}(r[i]);n=!n||o&&o.weight>n.weight?o:n}return n},t.prototype.sync=function(t){if(!t||!t.defaultPrevented){var e=this._router,r=e.urlService,n=e.stateService,i={path:r.path(),search:r.search(),hash:r.hash()},o=this.match(i);s([[te,function(t){return r.url(t,!0)}],[Je.isDef,function(t){return n.go(t.state,t.params,t.options)}],[Ut(Je),function(t){return n.go(t.state(),t.params(),t.options())}]])(o&&o.rule.handler(o.match,i,e))}},t.prototype.listen=function(t){var e=this;if(!1!==t)return this._stopFn=this._stopFn||this._router.urlService.onChange(function(t){return e.sync(t)});this._stopFn&&this._stopFn(),delete this._stopFn},t.prototype.update=function(t){var e=this._router.locationService;if(t)return void(this.location=e.path());e.path()!==this.location&&e.url(this.location,!0)},t.prototype.push=function(t,e,r){var n=r&&!!r.replace;this._router.urlService.url(t.format(e||{}),n)},t.prototype.href=function(t,e,r){var n=t.format(e);if(null==n)return null;r=r||{absolute:!1};var i=this._router.urlService.config,o=i.html5Mode();if(o||null===n||(n="#"+i.hashPrefix()+n),n=ot(n,o,r.absolute,i.baseHref()),!r.absolute||!n)return n;var a=!o&&n?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,a,n].join("")},t.prototype.rule=function(t){var e=this;if(!Vr.isUrlRule(t))throw new Error("invalid rule");return t.$id=this._id++,t.priority=t.priority||0,this._rules.push(t),this._sorted=!1,function(){return e.removeRule(t)}},t.prototype.removeRule=function(t){we(this._rules,t)},t.prototype.rules=function(){return this.ensureSorted(),this._rules.slice()},t.prototype.otherwise=function(t){var e=at(t);this._otherwiseFn=this.urlRuleFactory.create(Mt(!0),e),this._sorted=!1},t.prototype.initial=function(t){var e=at(t),r=function(t,e){return 0===e.globals.transitionHistory.size()&&!!/^\/?$/.exec(t.path)};this.rule(this.urlRuleFactory.create(r,e))},t.prototype.when=function(t,e,r){var n=this.urlRuleFactory.create(t,e);return Qt(r&&r.priority)&&(n.priority=r.priority),this.rule(n),n},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}(),Dr=function(){function t(){var t=this;this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs}}}return t.prototype._rootViewContext=function(t){return this._rootContext=t||this._rootContext},t.prototype._viewConfigFactory=function(t,e){this._viewConfigFactories[t]=e},t.prototype.createViewConfig=function(t,e){var r=this._viewConfigFactories[e.$type];if(!r)throw new Error("ViewService: No view config factory registered for type "+e.$type);var n=r(t,e);return re(n)?n:[n]},t.prototype.deactivateViewConfig=function(t){ze.traceViewServiceEvent("<- Removing",t),we(this._viewConfigs,t)},t.prototype.activateViewConfig=function(t){ze.traceViewServiceEvent("-> Registering",t),this._viewConfigs.push(t)},t.prototype.sync=function(){function e(t){var e=function(t){return t&&t.parent?e(t.parent)+1:1};return 1e4*t.fqn.split(".").length+e(t.creationContext)}function n(t){for(var e=t.viewDecl.$context,r=0;++r&&e.parent;)e=e.parent;return r}var i=this,o=this._uiViews.map(function(t){return[t.fqn,t]}).reduce(T,{}),a=r(function(t,e,r,n){return e*(t(r)-t(n))}),u=function(e){var r=i._viewConfigs.filter(t.matches(o,e));return r.length>1&&r.sort(a(n,-1)),[e,r[0]]},s=function(t){var e=t[0],r=t[1];-1!==i._uiViews.indexOf(e)&&e.configUpdated(r)},c=this._uiViews.sort(a(e,1)).map(u);ze.traceViewSync(c),c.forEach(s)},t.prototype.registerUIView=function(t){ze.traceViewServiceUIViewEvent("-> Registering",t);var e=this._uiViews,r=function(e){return e.fqn===t.fqn&&e.$type===t.$type};return e.filter(r).length&&ze.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){if(-1===e.indexOf(t))return void ze.traceViewServiceUIViewEvent("Tried removing non-registered uiView",t);ze.traceViewServiceUIViewEvent("<- Deregistering",t),we(e)(t)}},t.prototype.available=function(){return this._uiViews.map(At("fqn"))},t.prototype.active=function(){return this._uiViews.filter(At("$config")).map(At("name"))},t.normalizeUIViewTarget=function(t,e){void 0===e&&(e="");var r=e.split("@"),n=r[0]||"$default",i=te(r[1])?r[1]:"^",o=/^(\^(?:\.\^)*)\.(.*$)/.exec(n);(o&&(i=o[1],n=o[2]),"!"===n.charAt(0)&&(n=n.substr(1),i=""),/^(\^(?:\.\^)*)$/.exec(i))?i=i.split(".").reduce(function(t,e){return t.parent},t).name:"."===i&&(i=t.name);return{uiViewName:n,uiViewContextAnchor:i}},t.matches=function(t,e){return function(r){if(e.$type!==r.viewDecl.$type)return!1;var n=r.viewDecl,i=n.$uiViewName.split("."),o=e.fqn.split(".");if(!me(i,o.slice(0-i.length)))return!1;var a=1-i.length||void 0,u=o.slice(0,a).join("."),s=t[u].creationContext;return n.$uiViewContextAnchor===(s&&s.name)}},t}(),Nr=function(){function t(){this.params=new $r,this.lastStartedTransitionId=-1,this.transitionHistory=new Ne([],1),this.successfulTransitions=new Ne([],1)}return t.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},t}(),Fr=function(t){return t.reduce(function(t,e){return t[e]=ue(e),t},{dispose:l})},Ur=["url","path","search","hash","onChange"],Lr=["port","protocol","host","baseHref","html5Mode","hashPrefix"],Mr=["type","caseInsensitive","strictMode","defaultSquashPolicy"],Br=["sort","when","initial","otherwise","rules","rule","removeRule"],Gr=["deferIntercept","listen","sync","match"],Wr=function(){function t(t,e){void 0===e&&(e=!0),this.router=t,this.rules={},this.config={};var r=function(){return t.locationService};p(r,this,r,Ur,e);var n=function(){return t.locationConfig};p(n,this.config,n,Lr,e);var i=function(){return t.urlMatcherFactory};p(i,this.config,i,Mr);var o=function(){return t.urlRouter};p(o,this.rules,o,Br),p(o,this,o,Gr)}return t.prototype.url=function(t,e,r){},t.prototype.path=function(){},t.prototype.search=function(){},t.prototype.hash=function(){},t.prototype.onChange=function(t){},t.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},t.prototype.dispose=function(){},t.prototype.sync=function(t){},t.prototype.listen=function(t){},t.prototype.deferIntercept=function(t){},t.prototype.match=function(t){},t.locationServiceStub=Fr(Ur),t.locationConfigStub=Fr(Lr),t}(),zr=0,Jr=function(){function t(t,e){void 0===t&&(t=Wr.locationServiceStub),void 0===e&&(e=Wr.locationConfigStub),this.locationService=t,this.locationConfig=e,this.$id=zr++,this._disposed=!1,this._disposables=[],this.trace=ze,this.viewService=new Dr,this.transitionService=new bn(this),this.globals=new Nr,this.urlMatcherFactory=new Ir,this.urlRouter=new qr(this),this.stateRegistry=new kr(this),this.stateService=new Rn(this),this.urlService=new Wr(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlRouter),this.disposable(t),this.disposable(e)}return t.prototype.disposable=function(t){this._disposables.push(t)},t.prototype.dispose=function(t){var e=this;if(t&&Zt(t.dispose))return void t.dispose(this);this._disposed=!0,this._disposables.slice().forEach(function(t){try{"function"==typeof t.dispose&&t.dispose(e),we(e._disposables,t)}catch(t){}})},t.prototype.plugin=function(t,e){void 0===e&&(e={});var r=new t(this,e);if(!r.name)throw new Error("Required property `name` missing on plugin: "+r);return this._disposables.push(r),this._plugins[r.name]=r},t.prototype.getPlugin=function(t){return t?this._plugins[t]:Re(this._plugins)},t}(),Qr=function(t){return t.onCreate({},ut)},Kr=function(t){function e(e){if(e)return e instanceof Je?e:te(e)?n.target(e,t.params(),t.options()):e.state||e.params?n.target(e.state||t.to(),e.params||t.params(),t.options()):void 0}var r=t.to().redirectTo;if(r){var n=t.router.stateService;return Zt(r)?se.$q.when(r(t)).then(e):e(r)}},Yr=function(t){return t.onStart({to:function(t){return!!t.redirectTo}},Kr)},Zr=st("onExit"),Xr=function(t){return t.onExit({exiting:function(t){return!!t.onExit}},Zr)},tn=st("onRetain"),en=function(t){return t.onRetain({retained:function(t){return!!t.onRetain}},tn)},rn=st("onEnter"),nn=function(t){return t.onEnter({entering:function(t){return!!t.onEnter}},rn)},on=function(t){return new pr(t.treeChanges().to).resolvePath("EAGER",t).then(l)},an=function(t){return t.onStart({},on,{priority:1e3})},un=function(t,e){return new pr(t.treeChanges().to).subContext(e.$$state()).resolvePath("LAZY",t).then(l)},sn=function(t){return t.onEnter({entering:Mt(!0)},un,{priority:1e3})},cn=function(t){var e=se.$q,r=t.views("entering");if(r.length)return e.all(r.map(function(t){return e.when(t.load())})).then(l)},fn=function(t){return t.onFinish({},cn)},ln=function(t){var e=t.views("entering"),r=t.views("exiting");if(e.length||r.length){var n=t.router.viewService;r.forEach(function(t){return n.deactivateViewConfig(t)}),e.forEach(function(t){return n.activateViewConfig(t)}),n.sync()}},pn=function(t){return t.onSuccess({},ln)},hn=function(t){var e=t.router.globals,r=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,he(t.params(),e.params)},n=function(){e.transition===t&&(e.transition=null)};t.onSuccess({},r,{priority:1e4}),t.promise.then(n,n)},dn=function(t){return t.onCreate({},hn)},vn=function(t){var e=t.options(),r=t.router.stateService,n=t.router.urlRouter;if("url"!==e.source&&e.location&&r.$current.navigable){var i={replace:"replace"===e.location};n.push(r.$current.navigable.url,r.params,i)}n.update(!0)},mn=function(t){return t.onSuccess({},vn,{priority:9999})},yn=function(t){function e(){if("url"!==t.originalTransition().options().source){var e=t.targetState();return r.stateService.target(e.identifier(),e.params(),e.options())}var n=r.urlService,i=n.match(n.parts()),o=i&&i.rule;if(o&&"STATE"===o.type){var a=o.state,u=i.match;return r.stateService.target(a,u,t.options())}r.urlService.sync()}var r=t.router,n=t.entering().filter(function(t){return!!t.$$state().lazyLoad}).map(function(e){return ct(t,e)});return se.$q.all(n).then(e)},gn=function(t){return t.onBefore({entering:function(t){return!!t.lazyLoad}},yn)},wn=function(){function t(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=Ke.HANDLE_RESULT),void 0===a&&(a=Ke.REJECT_ERROR),void 0===u&&(u=!1),this.name=t,this.hookPhase=e,this.hookOrder=r,this.criteriaMatchPath=n,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=u}return t}(),_n=function(t){return t.onBefore({},ft,{priority:-9999})},$n=function(t){return t.onBefore({},lt,{priority:-1e4})},Sn={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null},source:"unknown"},bn=function(){function e(t){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=t,this.$view=t.viewService,this._deregisterHookFns={},this._pluginapi=p(Mt(this),{},Mt(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks()}return e.prototype.onCreate=function(t,e,r){},e.prototype.onBefore=function(t,e,r){},e.prototype.onStart=function(t,e,r){},e.prototype.onExit=function(t,e,r){},e.prototype.onRetain=function(t,e,r){},e.prototype.onEnter=function(t,e,r){},e.prototype.onFinish=function(t,e,r){},e.prototype.onSuccess=function(t,e,r){},e.prototype.onError=function(t,e,r){},e.prototype.dispose=function(t){Re(this._registeredHooks).forEach(function(t){return t.forEach(function(e){e._deregistered=!0,we(t,e)})})},e.prototype.create=function(t,e){return new vr(t,e,this._router)},e.prototype._defineCoreEvents=function(){var e=t.TransitionHookPhase,r=Ke,n=this._criteriaPaths;this._defineEvent("onCreate",e.CREATE,0,n.to,!1,r.LOG_REJECTED_RESULT,r.THROW_ERROR,!0),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0),this._defineEvent("onError",e.ERROR,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0)},e.prototype._defineCorePaths=function(){var e=t.TransitionHookScope.STATE,r=t.TransitionHookScope.TRANSITION;this._definePathType("to",r),this._definePathType("from",r),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=Ke.HANDLE_RESULT),void 0===a&&(a=Ke.REJECT_ERROR),void 0===u&&(u=!1);var s=new wn(t,e,r,n,i,o,a,u);this._eventTypes.push(s),q(this,this,s)},e.prototype._getEvents=function(t){return(Qt(t)?this._eventTypes.filter(function(e){return e.hookPhase===t}):this._eventTypes.slice()).sort(function(t,e){var r=t.hookPhase-e.hookPhase;return 0===r?t.hookOrder-e.hookOrder:r})},e.prototype._definePathType=function(t,e){this._criteriaPaths[t]={name:t,scope:e}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(t){return this._registeredHooks[t]},e.prototype._registerCoreTransitionHooks=function(){var t=this._deregisterHookFns;t.addCoreResolves=Qr(this),t.ignored=_n(this),t.invalid=$n(this),t.redirectTo=Yr(this),t.onExit=Xr(this),t.onRetain=en(this),t.onEnter=nn(this),t.eagerResolve=an(this),t.lazyResolve=sn(this),t.loadViews=fn(this),t.activateViews=pn(this),t.updateGlobals=dn(this),t.updateUrl=mn(this),t.lazyLoad=gn(this)},e}(),Rn=function(){function e(t){this.router=t,this.invalidCallbacks=[],this._defaultErrorHandler=function(t){t instanceof Error&&t.stack?(console.error(t),console.error(t.stack)):t instanceof Ue?(console.error(t.toString()),t.detail&&t.detail.stack&&console.error(t.detail.stack)):console.error(t)};var r=["current","$current","params","transition"],n=Object.keys(e.prototype).filter(Dt(ge(r)));p(Mt(e.prototype),this,Mt(this),n)}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.router.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"params",{get:function(){return this.router.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this.router.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$current",{get:function(){return this.router.globals.$current},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.defaultErrorHandler(l),this.invalidCallbacks=[]},e.prototype._handleInvalidTargetState=function(t,e){function r(){var t=s.dequeue();return void 0===t?Ue.invalid(e.error()).toPromise():se.$q.when(t(e,i,c)).then(f).then(function(t){return t||r()})}var n=this,i=ir.makeTargetState(t),o=this.router.globals,a=function(){return o.transitionHistory.peekTail()},u=a(),s=new Ne(this.invalidCallbacks.slice()),c=new pr(t).injector(),f=function(t){if(t instanceof Je){var e=t;return e=n.target(e.identifier(),e.params(),e.options()),e.valid()?a()!==u?Ue.superseded().toPromise():n.transitionTo(e.identifier(),e.params(),e.options()):Ue.invalid(e.error()).toPromise()}};return r()},e.prototype.onInvalid=function(t){return this.invalidCallbacks.push(t),function(){we(this.invalidCallbacks)(t)}.bind(this)},e.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:!Qt(t)||t,inherit:!1,notify:!1})},e.prototype.go=function(t,e,r){var n={relative:this.$current,inherit:!0},i=m(r,n,Sn);return this.transitionTo(t,e,i)},e.prototype.target=function(t,e,r){if(void 0===r&&(r={}),ee(r.reload)&&!r.reload.name)throw new Error("Invalid reload state object");var n=this.router.stateRegistry;if(r.reloadState=!0===r.reload?n.root():n.matcher.find(r.reload,r.relative),r.reload&&!r.reloadState)throw new Error("No such reload state '"+(te(r.reload)?r.reload:r.reload.name)+"'");var i=n.matcher.find(t,r.relative);return new Je(t,i,e,r)},e.prototype.getCurrentPath=function(){var t=this,e=this.router.globals,r=e.successfulTransitions.peekTail();return r?r.treeChanges().to:function(){return[new nr(t.router.stateRegistry.root())]}()},e.prototype.transitionTo=function(e,r,n){var i=this;void 0===r&&(r={}),void 0===n&&(n={});var o=this.router,a=o.globals;n=m(n,Sn),n=ve(n,{current:function(){return a.transition}});var u=this.target(e,r,n),s=this.getCurrentPath();if(!u.exists())return this._handleInvalidTargetState(s,u);if(!u.valid())return De(u.error());var c=function(e){return function(r){if(r instanceof Ue){var n=o.globals.lastStartedTransitionId===e.$id;if(r.type===t.RejectType.IGNORED)return n&&o.urlRouter.update(),se.$q.when(a.current);var u=r.detail;if(r.type===t.RejectType.SUPERSEDED&&r.redirected&&u instanceof Je){var s=e.redirect(u);return s.run().catch(c(s))}if(r.type===t.RejectType.ABORTED)return n&&o.urlRouter.update(),se.$q.reject(r)}return i.defaultErrorHandler()(r),se.$q.reject(r)}},f=this.router.transitionService.create(s,u),l=f.run().catch(c(f));return qe(l),ve(l,{transition:f})},e.prototype.is=function(t,e,r){r=m(r,{relative:this.$current});var n=this.router.stateRegistry.matcher.find(t,r.relative);if(Qt(n)){if(this.$current!==n)return!1;if(!e)return!0;var i=n.parameters({inherit:!0,matchingKeys:e});return rr.equals(i,rr.values(i,e),this.params)}},e.prototype.includes=function(t,e,r){r=m(r,{relative:this.$current});var n=te(t)&&Bt.fromString(t);if(n){if(!n.matches(this.$current.name))return!1;t=this.$current.name}var i=this.router.stateRegistry.matcher.find(t,r.relative),o=this.$current.includes;if(Qt(i)){if(!Qt(o[i.name]))return!1;if(!e)return!0;var a=i.parameters({inherit:!0,matchingKeys:e});return rr.equals(a,rr.values(a,e),this.params)}},e.prototype.href=function(t,e,r){r=m(r,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),e=e||{};var n=this.router.stateRegistry.matcher.find(t,r.relative);if(!Qt(n))return null;r.inherit&&(e=this.params.$inherit(e,this.$current,n));var i=n&&r.lossy?n.navigable:n;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,e,{absolute:r.absolute}):null},e.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},e.prototype.get=function(t,e){var r=this.router.stateRegistry;return 0===arguments.length?r.get():r.get(t,e||this.$current)},e.prototype.lazyLoad=function(t,e){var r=this.get(t);if(!r||!r.lazyLoad)throw new Error("Can not lazy load "+t);var n=this.getCurrentPath(),i=ir.makeTargetState(n);return e=e||this.router.transitionService.create(n,i),ct(e,r)},e}(),En={when:function(t){return new Promise(function(e,r){return e(t)})},reject:function(t){return new Promise(function(e,r){r(t)})},defer:function(){var t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),t},all:function(t){if(re(t))return Promise.all(t);if(ee(t)){var e=Object.keys(t).map(function(e){return t[e].then(function(t){return{key:e,val:t}})});return En.all(e).then(function(t){return t.reduce(function(t,e){return t[e.key]=e.val,t},{})})}}},Cn={},Tn=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Pn=/([^\s,]+)/g,kn={get:function(t){return Cn[t]},has:function(t){return null!=kn.get(t)},invoke:function(t,e,r){var n=ve({},Cn,r||{}),i=kn.annotate(t),o=je(function(t){return n.hasOwnProperty(t)},function(t){return"DI can't find injectable: '"+t+"'"}),a=i.filter(o).map(function(t){return n[t]});return Zt(t)?t.apply(e,a):t.slice(-1)[0].apply(e,a)},annotate:function(t){if(!c(t))throw new Error("Not an injectable function: "+t);if(t&&t.$inject)return t.$inject;if(re(t))return t.slice(0,-1);var e=t.toString().replace(Tn,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(Pn)||[]}},On=function(t){return function(e){if(!e)return["",""];var r=e.indexOf(t);return-1===r?[e,""]:[e.substr(0,r),e.substr(r+1)]}},xn=On("#"),jn=On("?"),In=On("="),Vn=function(t){return t?t.replace(/^#/,""):""},An=function(t,e){var r=e[0],n=e[1];return t.hasOwnProperty(r)?re(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n,t},Hn=function(t){return t.split("&").filter(f).map(In).reduce(An,{})},qn=function(t){var e=t.path(),r=t.search(),n=t.hash(),i=Object.keys(r).map(function(t){var e=r[t];return(re(e)?e:[e]).map(function(e){return t+"="+e})}).reduce(Te,[]).join("&");return e+(i?"?"+i:"")+(n?"#"+n:"")},Dn=function(){function t(t,e){var r=this;this.fireAfterUpdate=e,this._listener=function(t){return r._listeners.forEach(function(e){return e(t)})},this._listeners=[],this.hash=function(){return pt(r._get()).hash},this.path=function(){return pt(r._get()).path},this.search=function(){return Hn(pt(r._get()).search)},this._location=window&&window.location,this._history=window&&window.history}return t.prototype.url=function(t,e){if(void 0===e&&(e=!0),Qt(t)&&t!==this._get()&&(this._set(null,null,t,e),this.fireAfterUpdate)){var r=ve(new Event("locationchange"),{url:t});this._listeners.forEach(function(t){return t(r)})}return qn(this)},t.prototype.onChange=function(t){var e=this;return this._listeners.push(t),function(){return we(e._listeners,t)}},t.prototype.dispose=function(t){$e(this._listeners)},t}(),Nn=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fn=function(t){function e(e){var r=t.call(this,e,!1)||this;return window.addEventListener("hashchange",r._listener,!1),r}return Nn(e,t),e.prototype._get=function(){return Vn(this._location.hash)},e.prototype._set=function(t,e,r,n){this._location.hash=r},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),window.removeEventListener("hashchange",this._listener)},e}(Dn),Un=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ln=function(t){function e(e){return t.call(this,e,!0)||this}return Un(e,t),e.prototype._get=function(){return this._url},e.prototype._set=function(t,e,r,n){this._url=r},e}(Dn),Mn=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bn=function(t){function e(e){var r=t.call(this,e,!0)||this;return r._config=e.urlService.config,window.addEventListener("popstate",r._listener,!1),r}return Mn(e,t),e.prototype._get=function(){var t=this._location,e=t.pathname,r=t.hash,n=t.search;return n=jn(n)[1],r=xn(r)[1],e+(n?"?"+n:"")+(r?"$"+n:"")},e.prototype._set=function(t,e,r,n){var i=this,o=i._config,a=i._history,u=o.baseHref()+r;n?a.replaceState(t,e,u):a.pushState(t,e,u)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),window.removeEventListener("popstate",this._listener)},e}(Dn),Gn=function(){function t(){var t=this;this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return t._port},this.protocol=function(){return t._protocol},this.host=function(){return t._host},this.baseHref=function(){return t._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(e){return Qt(e)?t._hashPrefix=e:t._hashPrefix},this.dispose=l}return t}(),Wn=function(){function t(t,e){void 0===e&&(e=!1),this._isHtml5=e,this._baseHref=void 0,this._hashPrefix=""}return t.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},t.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},t.prototype.host=function(){return location.host},t.prototype.html5Mode=function(){return this._isHtml5},t.prototype.hashPrefix=function(t){return Qt(t)?this._hashPrefix=t:this._hashPrefix},t.prototype.baseHref=function(t){return Qt(t)?this._baseHref=t:this._baseHref||this.applyDocumentBaseHref()},t.prototype.applyDocumentBaseHref=function(){var t=document.getElementsByTagName("base");return this._baseHref=t.length?t[0].href.substr(location.origin.length):""},t.prototype.dispose=function(){},t}(),zn=ht("vanilla.hashBangLocation",!1,Fn,Wn),Jn=ht("vanilla.pushStateLocation",!0,Bn,Wn),Qn=ht("vanilla.memoryLocation",!1,Ln,Gn),Kn=function(){function t(){}return t.prototype.dispose=function(t){},t}(),Yn=Object.freeze({fromJson:le,toJson:pe,copy:he,forEach:de,extend:ve,equals:me,identity:f,noop:l,createProxyFunctions:p,inherit:ye,inArray:ge,_inArray:h,removeFrom:we,_removeFrom:d,pushTo:_e,_pushTo:v,deregAll:$e,defaults:m,mergeR:Se,ancestors:y,pick:g,omit:w,pluck:_,filter:$,find:S,mapObj:be,map:b,values:Re,allTrueR:Ee,anyTrueR:Ce,unnestR:Te,flattenR:Pe,pushR:R,uniqR:ke,unnest:Oe,flatten:xe,assertPredicate:je,assertMap:Ie,assertFn:E,pairs:Ve,arrayTuples:C,applyPairs:T,tail:P,_extend:x,sortBy:Ae,composeSort:He,silenceUncaughtInPromise:qe,silentRejection:De,notImplemented:ue,services:se,Glob:Bt,curry:r,compose:n,pipe:i,prop:At,propEq:Ht,parse:qt,not:Dt,and:o,or:a,all:Nt,any:Ft,is:Ut,eq:Lt,val:Mt,invoke:u,pattern:s,isUndefined:Jt,isDefined:Qt,isNull:Kt,isNullOrUndefined:Yt,isFunction:Zt,isNumber:Xt,isString:te,isObject:ee,isArray:re,isDate:ne,isRegExp:ie,isState:oe,isInjectable:c,isPromise:ae,Queue:Ne,maxLength:B,padString:G,kebobString:W,functionToString:z,fnToString:J,stringify:Q,beforeAfterSubstr:gr,splitOnDelim:K,joinNeighborsR:Y,get Category(){return t.Category},Trace:We,trace:ze,get DefType(){return t.DefType},Param:rr,ParamTypes:wr,StateParams:$r,ParamType:Xe,PathNode:nr,PathUtils:ir,resolvePolicies:ur,defaultResolvePolicy:or,Resolvable:ar,NATIVE_INJECTOR_TOKEN:lr,ResolveContext:pr,resolvablesBuilder:nt,StateBuilder:Cr,StateObject:Gt,StateMatcher:Tr,StateQueueManager:Pr,StateRegistry:kr,StateService:Rn,TargetState:Je,get TransitionHookPhase(){return t.TransitionHookPhase},get TransitionHookScope(){return t.TransitionHookScope},HookBuilder:Ze,matchState:H,RegisteredHook:Ye,makeEvent:q,get RejectType(){return t.RejectType},Rejection:Ue,Transition:vr,TransitionHook:Ke,TransitionEventType:wn,defaultTransOpts:Sn,TransitionService:bn,UrlMatcher:jr,UrlMatcherFactory:Ir,UrlRouter:qr,UrlRuleFactory:Vr,BaseUrlRule:Ar,UrlService:Wr,ViewService:Dr,UIRouterGlobals:Nr,UIRouter:Jr,$q:En,$injector:kn,BaseLocationServices:Dn,HashLocationService:Fn,MemoryLocationService:Ln,PushStateLocationService:Bn,MemoryLocationConfig:Gn,BrowserLocationConfig:Wn,splitHash:xn,splitQuery:jn,splitEqual:In,trimHashVal:Vn,keyValsToObjectR:An,getParams:Hn,parseUrl:pt,buildUrl:qn,locationPluginFactory:ht,servicesPlugin:dt,hashLocationPlugin:zn,pushStateLocationPlugin:Jn,memoryLocationPlugin:Qn,UIRouterPluginBase:Kn}),Zn=function(t,e){return t.reduce(function(t,r){return t||Qt(e[r])},!1)},Xn=0,ti=function(){function t(t,e,r){var n=this;this.path=t,this.viewDecl=e,this.factory=r,this.$id=Xn++,this.loaded=!1,this.getTemplate=function(t,e){return n.component?n.factory.makeComponentTemplate(t,e,n.component,n.viewDecl.bindings):n.template}}return t.prototype.load=function(){var t=this,e=se.$q,r=new pr(this.path),n=this.path.reduce(function(t,e){return ve(t,e.paramValues)},{}),i={template:e.when(this.factory.fromConfig(this.viewDecl,n,r)),controller:e.when(this.getController(r))};return e.all(i).then(function(e){return ze.traceViewServiceEvent("Loaded",t),t.controller=e.controller,ve(t,e.template),t})},
t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;if(!c(e))return this.viewDecl.controller;var r=se.$injector.annotate(e),n=re(e)?P(e):e;return new ar("",n,r).get(t)},t}(),ei=function(){function t(){var t=this;this._useHttp=Vt.version.minor<3,this.$get=["$http","$templateCache","$injector",function(e,r,n){return t.$templateRequest=n.has&&n.has("$templateRequest")&&n.get("$templateRequest"),t.$http=e,t.$templateCache=r,t}]}return t.prototype.useHttpService=function(t){this._useHttp=t},t.prototype.fromConfig=function(t,e,r){var n=function(t){return se.$q.when(t).then(function(t){return{template:t}})},i=function(t){return se.$q.when(t).then(function(t){return{component:t}})};return Qt(t.template)?n(this.fromString(t.template,e)):Qt(t.templateUrl)?n(this.fromUrl(t.templateUrl,e)):Qt(t.templateProvider)?n(this.fromProvider(t.templateProvider,e,r)):Qt(t.component)?i(t.component):Qt(t.componentProvider)?i(this.fromComponentProvider(t.componentProvider,e,r)):n("<ui-view></ui-view>")},t.prototype.fromString=function(t,e){return Zt(t)?t(e):t},t.prototype.fromUrl=function(t,e){return Zt(t)&&(t=t(e)),null==t?null:this._useHttp?this.$http.get(t,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(t){return t.data}):this.$templateRequest(t)},t.prototype.fromProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.fromComponentProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.makeComponentTemplate=function(t,e,r,n){n=n||{};var i=Vt.version.minor>=3?"::":"",o=function(t){var e=W(t);return/^(x|data)-/.exec(e)?"x-"+e:e},a=function(r){var a=r.name,u=r.type,s=o(a);if(t.attr(s)&&!n[a])return s+"='"+t.attr(s)+"'";var c=n[a]||a;if("@"===u)return s+"='{{"+i+"$resolve."+c+"}}'";if("&"===u){var f=e.getResolvable(c),l=f&&f.data,p=l&&se.$injector.annotate(l)||[];return s+"='$resolve."+c+(re(l)?"["+(l.length-1)+"]":"")+"("+p.join(",")+")'"}return s+"='"+i+"$resolve."+c+"'"},u=yt(r).map(a).join(" "),s=o(r);return"<"+s+" "+u+"></"+s+">"},t}(),ri=function(t){return ni(ee(t.bindToController)?t.bindToController:t.scope)},ni=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@&])[?]?(.*)/.exec(t[e])]}).filter(function(t){return Qt(t)&&re(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},ii=function(){function t(e,r){this.stateRegistry=e,this.stateService=r,p(Mt(t.prototype),this,Mt(this))}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return ee(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){return this.stateService.onInvalid(t)},t}(),oi=function(t){return function(e,r){function n(t,e){var r=new pr(t.treeChanges(o)),n=ve(gi(r),{$state$:e,$transition$:t});return se.$injector.invoke(i,this,n)}var i=e[t],o="onExit"===t?"from":"to";return i?n:void 0}},ai=function(){function t(t){this._urlListeners=[],this.$locationProvider=t;var e=Mt(t);p(e,this,e,["hashPrefix"])}return t.prototype.dispose=function(){},t.prototype.onChange=function(t){var e=this;return this._urlListeners.push(t),function(){return we(e._urlListeners)(t)}},t.prototype.html5Mode=function(){var t=this.$locationProvider.html5Mode();return(t=ee(t)?t.enabled:t)&&this.$sniffer.history},t.prototype.url=function(t,e,r){return void 0===e&&(e=!1),t&&this.$location.url(t),e&&this.$location.replace(),r&&this.$location.state(r),this.$location.url()},t.prototype._runtimeServices=function(t,e,r,n){var i=this;this.$location=e,this.$sniffer=r,t.$on("$locationChangeSuccess",function(t){return i._urlListeners.forEach(function(e){return e(t)})});var o=Mt(e),a=Mt(n);p(o,this,o,["replace","path","search","hash"]),p(o,this,o,["port","protocol","host"]),p(a,this,a,["baseHref"])},t.monkeyPatchPathParameterType=function(t){var e=t.urlMatcherFactory.type("path");e.encode=function(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t},e.decode=function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t}},t}(),ui=function(){function t(t){this._router=t,this._urlRouter=t.urlRouter}return t.prototype.$get=function(){var t=this._urlRouter;return t.update(!0),t.interceptDeferred||t.listen(),t},t.prototype.rule=function(t){var e=this;if(!Zt(t))throw new Error("'rule' must be a function");var r=function(){return t(se.$injector,e._router.locationService)},n=new Ar(r,f);return this._urlRouter.rule(n),this},t.prototype.otherwise=function(t){var e=this,r=this._urlRouter;if(te(t))r.otherwise(t);else{if(!Zt(t))throw new Error("'rule' must be a string or function");r.otherwise(function(){return t(se.$injector,e._router.locationService)})}return this},t.prototype.when=function(e,r){return(re(r)||Zt(r))&&(r=t.injectableHandler(this._router,r)),this._urlRouter.when(e,r),this},t.injectableHandler=function(t,e){return function(r){return se.$injector.invoke(e,null,{$match:r,$stateParams:t.globals.params})}},t.prototype.deferIntercept=function(t){this._urlRouter.deferIntercept(t)},t}();Vt.module("ui.router.angular1",[]);var si=Vt.module("ui.router.init",[]),ci=Vt.module("ui.router.util",["ng","ui.router.init"]),fi=Vt.module("ui.router.router",["ui.router.util"]),li=Vt.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),pi=Vt.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),hi=(Vt.module("ui.router.compat",["ui.router"]),null);gt.$inject=["$locationProvider"];var di=function(t){return["$uiRouterProvider",function(e){var r=e.router[t];return r.$get=function(){return r},r}]};wt.$inject=["$injector","$q","$uiRouter"];var vi=function(t){return t.urlRouterProvider=new ui(t)},mi=function(){return ve(hi.stateProvider,{$get:function(){return hi.stateService}})};_t.$inject=["$rootScope"],si.provider("$uiRouter",gt),fi.provider("$urlRouter",["$uiRouterProvider",vi]),ci.provider("$urlService",di("urlService")),ci.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return hi.urlMatcherFactory}]),ci.provider("$templateFactory",function(){return new ei}),li.provider("$stateRegistry",di("stateRegistry")),li.provider("$uiRouterGlobals",di("globals")),li.provider("$transitions",di("transitionService")),li.provider("$state",["$uiRouterProvider",mi]),li.factory("$stateParams",["$uiRouter",function(t){return t.globals.params}]),pi.factory("$view",function(){return hi.viewService}),pi.service("$trace",function(){return ze}),pi.run(_t),ci.run(["$urlMatcherFactory",function(t){}]),li.run(["$state",function(t){}]),fi.run(["$urlRouter",function(t){}]),si.run(wt);var yi,gi=function(t){return t.getTokens().filter(te).map(function(e){var r=t.getResolvable(e);return[e,"NOWAIT"===t.getPolicy(r).async?r.promise:r.data]}).reduce(T,{})};yi=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,a){function u(){var t=h();l&&l(),f&&(l=f.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(c.attr,t.href)}var s,c=Rt(i),f=a[1]||a[0],l=null,p={},h=function(){return bt(r,i,p)},d=$t(o.uiSref);p.uiState=d.state,p.uiStateOpts=o.uiSrefOpts?n.$eval(o.uiSrefOpts):{},d.paramExpr&&(n.$watch(d.paramExpr,function(t){p.uiStateParams=ve({},t),u()},!0),p.uiStateParams=ve({},n.$eval(d.paramExpr))),u(),n.$on("$destroy",t.stateRegistry.onStatesChanged(u)),n.$on("$destroy",t.transitionService.onSuccess({},u)),c.clickable&&(s=Et(i,r,e,c,h),Tt(i,n,s,p.uiStateOpts))}}}];var wi;wi=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,a){function u(){var t=d();p&&p(),f&&(p=f.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(c.attr,t.href)}var s,c=Rt(i),f=a[1]||a[0],p=null,h={},d=function(){return bt(r,i,h)},v=["uiState","uiStateParams","uiStateOpts"],m=v.reduce(function(t,e){return t[e]=l,t},{});v.forEach(function(t){h[t]=o[t]?n.$eval(o[t]):null,o.$observe(t,function(e){m[t](),m[t]=n.$watch(e,function(e){h[t]=e,u()},!0)})}),u(),n.$on("$destroy",t.stateRegistry.onStatesChanged(u)),n.$on("$destroy",t.transitionService.onSuccess({},u)),c.clickable&&(s=Et(i,r,e,c,d),Tt(i,n,s,h.uiStateOpts))}}}];var _i;_i=["$state","$stateParams","$interpolate","$uiRouter",function(t,e,r,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(e,i,o){function a(t){t.promise.then(s,l)}function u(e,r,n){var o=t.get(e,St(i)),a={state:o||{name:e},params:r,activeClass:n};return h.push(a),function(){we(h)(a)}}function s(){var r=function(t){return t.split(/\s/).filter(f)},n=function(t){return t.map(function(t){return t.activeClass}).map(r).reduce(Te,[])},o=n(h).concat(r(c)).reduce(ke,[]),a=n(h.filter(function(e){return t.includes(e.state.name,e.params)})),u=!!h.filter(function(e){return t.is(e.state.name,e.params)}).length,s=u?r(c):[],l=a.concat(s).reduce(ke,[]),p=o.filter(function(t){return!ge(l,t)});e.$evalAsync(function(){l.forEach(function(t){return i.addClass(t)}),p.forEach(function(t){return i.removeClass(t)})})}var c,p,h=[];c=r(o.uiSrefActiveEq||"",!1)(e);try{p=e.$eval(o.uiSrefActive)}catch(t){}p=p||r(o.uiSrefActive||"",!1)(e),ee(p)&&de(p,function(t,r){if(te(t)){var n=$t(t);u(n.state,e.$eval(n.paramExpr),r)}}),this.$$addStateInfo=function(t,e){if(!(ee(p)&&h.length>0)){var r=u(t,e,p);return s(),r}},e.$on("$stateChangeSuccess",s),e.$on("$destroy",n.transitionService.onStart({},a)),n.globals.transition&&a(n.globals.transition),s()}]}}],Vt.module("ui.router.state").directive("uiSref",yi).directive("uiSrefActive",_i).directive("uiSrefActiveEq",_i).directive("uiState",wi),Pt.$inject=["$state"],kt.$inject=["$state"],Vt.module("ui.router.state").filter("isState",Pt).filter("includedByState",kt);var $i;$i=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,r,n,i){function o(t,r){return{enter:function(t,r,n){Vt.version.minor>2?e.enter(t,null,r).then(n):e.enter(t,null,r,n)},leave:function(t,r){Vt.version.minor>2?e.leave(t).then(r):e.leave(t,r)}}}function a(t,e){return t===e}var u={$cfg:{viewDecl:{$context:t._pluginapi._rootViewContext()}},$uiView:{}},s={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,c,f){return function(e,c,l){function p(t){(!t||t instanceof ti)&&(a(S,t)||(ze.traceUIViewConfigUpdated(E,t&&t.viewDecl&&t.viewDecl.$context),S=t,d(t)))}function h(){if(v&&(ze.traceUIViewEvent("Removing (previous) el",v.data("$uiView")),v.remove(),v=null),y&&(ze.traceUIViewEvent("Destroying scope",E),y.$destroy(),y=null),m){var t=m.data("$uiViewAnim");ze.traceUIViewEvent("Animate out",t),$.leave(m,function(){t.$$animLeave.resolve(),v=null}),v=m,m=null}}function d(t){var n=e.$new(),o=i.defer(),a=i.defer(),u={$cfg:t,$uiView:E},s={$animEnter:o.promise,$animLeave:a.promise,$$animLeave:a};n.$emit("$viewContentLoading",R);var l=f(n,function(t){t.data("$uiViewAnim",s),t.data("$uiView",u),$.enter(t,c,function(){o.resolve(),y&&y.$emit("$viewContentAnimationEnded"),(Qt(_)&&!_||e.$eval(_))&&r(t)}),h()});m=l,y=n,y.$emit("$viewContentLoaded",t||S),y.$eval(w)}var v,m,y,g,w=l.onload||"",_=l.autoscroll,$=o(l,e),S=void 0,b=c.inheritedData("$uiView")||u,R=n(l.uiView||l.name||"")(e)||"$default",E={$type:"ng1",id:s.count++,name:R,fqn:b.$uiView.fqn?b.$uiView.fqn+"."+R:R,config:null,configUpdated:p,get creationContext(){var t=qt("$cfg.viewDecl.$context")(b),e=qt("$uiView.creationContext")(b);return t||e}};ze.traceUIViewEvent("Linking",E),c.data("$uiView",{$uiView:E}),d(),g=t.registerUIView(E),e.$on("$destroy",function(){ze.traceUIViewEvent("Destroying/Unregistering",E),g()})}}};return s}],Ot.$inject=["$compile","$controller","$transitions","$view","$q","$timeout"];var Si="function"==typeof Vt.module("ui.router").component,bi=0;Vt.module("ui.router.state").directive("uiView",$i),Vt.module("ui.router.state").directive("uiView",Ot),Vt.module("ui.router.state").provider("$uiViewScroll",jt);t.default="ui.router",t.core=Yn,t.watchDigests=_t,t.getLocals=gi,t.getNg1ViewConfigFactory=vt,t.ng1ViewsBuilder=mt,t.Ng1ViewConfig=ti,t.StateProvider=ii,t.UrlRouterProvider=ui,t.fromJson=le,t.toJson=pe,t.copy=he,t.forEach=de,t.extend=ve,t.equals=me,t.identity=f,t.noop=l,t.createProxyFunctions=p,t.inherit=ye,t.inArray=ge,t._inArray=h,t.removeFrom=we,t._removeFrom=d,t.pushTo=_e,t._pushTo=v,t.deregAll=$e,t.defaults=m,t.mergeR=Se,t.ancestors=y,t.pick=g,t.omit=w,t.pluck=_,t.filter=$,t.find=S,t.mapObj=be,t.map=b,t.values=Re,t.allTrueR=Ee,t.anyTrueR=Ce,t.unnestR=Te,t.flattenR=Pe,t.pushR=R,t.uniqR=ke,t.unnest=Oe,t.flatten=xe,t.assertPredicate=je,t.assertMap=Ie,t.assertFn=E,t.pairs=Ve,t.arrayTuples=C,t.applyPairs=T,t.tail=P,t._extend=x,t.sortBy=Ae,t.composeSort=He,t.silenceUncaughtInPromise=qe,t.silentRejection=De,t.notImplemented=ue,t.services=se,t.Glob=Bt,t.curry=r,t.compose=n,t.pipe=i,t.prop=At,t.propEq=Ht,t.parse=qt,t.not=Dt,t.and=o,t.or=a,t.all=Nt,t.any=Ft,t.is=Ut,t.eq=Lt,t.val=Mt,t.invoke=u,t.pattern=s,t.isUndefined=Jt,t.isDefined=Qt,t.isNull=Kt,t.isNullOrUndefined=Yt,t.isFunction=Zt,t.isNumber=Xt,t.isString=te,t.isObject=ee,t.isArray=re,t.isDate=ne,t.isRegExp=ie,t.isState=oe,t.isInjectable=c,t.isPromise=ae,t.Queue=Ne,t.maxLength=B,t.padString=G,t.kebobString=W,t.functionToString=z,t.fnToString=J,t.stringify=Q,t.beforeAfterSubstr=gr,t.splitOnDelim=K,t.joinNeighborsR=Y,t.Trace=We,t.trace=ze,t.Param=rr,t.ParamTypes=wr,t.StateParams=$r,t.ParamType=Xe,t.PathNode=nr,t.PathUtils=ir,t.resolvePolicies=ur,t.defaultResolvePolicy=or,t.Resolvable=ar,t.NATIVE_INJECTOR_TOKEN=lr,t.ResolveContext=pr,t.resolvablesBuilder=nt,t.StateBuilder=Cr,t.StateObject=Gt,t.StateMatcher=Tr,t.StateQueueManager=Pr,t.StateRegistry=kr,t.StateService=Rn,t.TargetState=Je,t.HookBuilder=Ze,t.matchState=H,t.RegisteredHook=Ye,t.makeEvent=q,t.Rejection=Ue,t.Transition=vr,t.TransitionHook=Ke,t.TransitionEventType=wn,t.defaultTransOpts=Sn,t.TransitionService=bn,t.UrlMatcher=jr,t.UrlMatcherFactory=Ir,t.UrlRouter=qr,t.UrlRuleFactory=Vr,t.BaseUrlRule=Ar,t.UrlService=Wr,t.ViewService=Dr,t.UIRouterGlobals=Nr,t.UIRouter=Jr,t.$q=En,t.$injector=kn,t.BaseLocationServices=Dn,t.HashLocationService=Fn,t.MemoryLocationService=Ln,t.PushStateLocationService=Bn,t.MemoryLocationConfig=Gn,t.BrowserLocationConfig=Wn,t.splitHash=xn,t.splitQuery=jn,t.splitEqual=In,t.trimHashVal=Vn,t.keyValsToObjectR=An,t.getParams=Hn,t.parseUrl=pt,t.buildUrl=qn,t.locationPluginFactory=ht,t.servicesPlugin=dt,t.hashLocationPlugin=zn,t.pushStateLocationPlugin=Jn,t.memoryLocationPlugin=Qn,t.UIRouterPluginBase=Kn,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=angular-ui-router.min.js.map