text: /**
   * UI-Router Core: Framework agnostic, State-based routing for JavaScript Single Page Apps
   * @version v5.0.8
   * @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):"function"==typeof define&&define.amd?define(["exports"],e):e(t["@uirouter/core"]=t["@uirouter/core"]||{})}(this,function(t){"use strict";function e(t){function e(n){return n.length>=r?t.apply(null,n):function(){return e(n.concat([].slice.apply(arguments)))}}var n=[].slice.apply(arguments,[1]),r=t.length;return e(n)}function n(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(null,[].slice.call(arguments).reverse())}function i(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(null,n)&&e.apply(null,n)}}function o(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.apply(null,n)||e.apply(null,n)}}function a(t,e){return function(n){return n[t].apply(n,e)}}function s(t){return function(e){for(var n=0;n<t.length;n++)if(t[n][0](e))return t[n][1](e)}}function u(t){if(At(t)&&t.length){var e=t.slice(0,-1),n=t.slice(-1);return!(e.filter(mt(jt)).length||n.filter(mt(Ht)).length)}return Ht(t)}function c(t){return t}function f(){}function h(t,e,n,r,i){void 0===i&&(i=!1);var o=function(e){return t()[e].bind(n())},a=function(t){return function(){return e[t]=o(t),e[t].apply(null,arguments)}};return r=r||Object.keys(t()),r.reduce(function(t,e){return t[e]=i?a(e):o(e),t},e)}function p(t,e){return-1!==t.indexOf(e)}function l(t,e){var n=t.indexOf(e);return n>=0&&t.splice(n,1),t}function d(t,e){return t.push(e),e}function v(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=e.concat({}).reverse(),i=Jt.apply(null,r);return Jt({},i,g(t||{},Object.keys(i)))}function y(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function g(t,e){var n={};for(var r in t)-1!==e.indexOf(r)&&(n[r]=t[r]);return n}function m(t,e){return Object.keys(t).filter(mt(Yt(e))).reduce(function(e,n){return e[n]=t[n],e},{})}function _(t,e){return E(t,vt(e))}function w(t,e){var n=At(t),r=n?[]:{},i=n?function(t){return r.push(t)}:function(t,e){return r[e]=t};return zt(t,function(t,n){e(t,n)&&i(t,n)}),r}function b(t,e){var n;return zt(t,function(t,r){n||e(t,r)&&(n=t)}),n}function E(t,e){var n=At(t)?[]:{};return zt(t,function(t,r){return n[r]=e(t,r)}),n}function R(t,e){return t.push(e),t}function S(t,e){return void 0===e&&(e="assert failure"),function(n){var r=t(n);if(!r)throw new Error(Ht(e)?e(n):e);return r}}function T(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)return[];var n,r=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991),i=[];for(n=0;n<r;n++)switch(t.length){case 1:i.push([t[0][n]]);break;case 2:i.push([t[0][n],t[1][n]]);break;case 3:i.push([t[0][n],t[1][n],t[2][n]]);break;case 4:i.push([t[0][n],t[1][n],t[2][n],t[3][n]]);break;default:i.push(t.map(function(t){return t[n]}))}return i}function C(t,e){var n,r;if(At(e)&&(n=e[0],r=e[1]),!jt(n))throw new Error("invalid parameters to applyPairs");return t[n]=r,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={}),Jt(e,t)}function O(t,e,n){if(At(t))return t.forEach(e,n);Object.keys(t).forEach(function(n){return e(t[n],n)})}function $(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];if(n)for(var r=Object.keys(n),i=0;i<r.length;i++)t[r[i]]=n[r[i]]}return t}function x(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var n=typeof t;if(n!==typeof e||"object"!==n)return!1;var r=[t,e];if(_t(At)(r))return H(t,e);if(_t(qt)(r))return t.getTime()===e.getTime();if(_t(Nt)(r))return t.toString()===e.toString();if(_t(Ht)(r))return!0;if([Ht,At,qt,Nt].map(wt).reduce(function(t,e){return t||!!e(r)},!1))return!1;var i,o={};for(i in t){if(!x(t[i],e[i]))return!1;o[i]=!0}for(i in e)if(!o[i])return!1;return!0}function H(t,e){return t.length===e.length&&T(t,e).reduce(function(t,e){return t&&x(e[0],e[1])},!0)}function I(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 j(e){return It(e)?t.Category[e]:t.Category[t.Category[e]]}function V(t,e){function n(t){for(var e=r,n=0;n<e.length;n++){var i=new St(e[n]);if(i&&i.matches(t.name)||!i&&e[n]===t.name)return!0}return!1}var r=jt(e)?[e]:e;return!!(Ht(r)?r:n)(t)}function A(t,e,n){function r(t,r,i){void 0===i&&(i={});var a=new Oe(e,n,r,t,i);return o.push(a),function(){a._deregistered=!0,Zt(o)(a)}}var i=t._registeredHooks=t._registeredHooks||{},o=i[n.name]=[];return t[n.name]=r,r}function q(t){return void 0===t&&(t=!1),function(e,n){var r=t?-1:1,i=(e.node.state.path.length-n.node.state.path.length)*r;return 0!==i?i:n.hook.priority-e.hook.priority}}function N(t,e){function n(t){return At(t)?t:Ot(t)?[t]:[]}function r(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(At(i)&&0===i.length)return i;var o=n(i),a=E(o,t);return!0===e?0===w(a,function(t){return!t}).length:r(a)}}function o(t){return function(e,r){var i=n(e),o=n(r);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 n=t[e].bind(t),r="equals"===e?o:i;a[e]=r(n)}),Jt(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=Ie(t)&&{value:t}||t,e.__cacheable=!0,Jt(t,{$$fn:u(t.value)?t.value:e})}function D(e,n,r,i,o){if(e.type&&n&&"string"!==n.name)throw new Error("Param '"+i+"' has two type configurations.");if(e.type&&n&&"string"===n.name&&o.type(e.type))return o.type(e.type);if(n)return n;if(!e.type){var a=r===t.DefType.CONFIG?"any":r===t.DefType.PATH?"path":r===t.DefType.SEARCH?"query":"string";return o.type(a)}return e.type instanceof xe?e.type:o.type(e.type)}function U(t,e,n){var r=t.squash;if(!e||!1===r)return!1;if(!Ot(r)||null==r)return n;if(!0===r||jt(r))return r;throw new Error("Invalid squash policy: '"+r+"'. Valid policies: false, true, or arbitrary string")}function L(t,e,n,r){var i,o,a=[{from:"",to:n||e?void 0:""},{from:null,to:n||e?void 0:""}];return i=At(t.replace)?t.replace:[],jt(r)&&i.push({from:r,to:void 0}),o=E(i,vt("from")),w(a,function(t){return-1===o.indexOf(t.from)}).concat(i)}function M(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function G(t,e){for(;e.length<t;)e+=" ";return e}function B(t){return t.replace(/^([A-Z])/,function(t){return t.toLowerCase()}).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function W(t){var e=z(t),n=e.match(/^(function [^ ]+\([^)]*\))/),r=n?n[1]:e,i=t.name||"";return i&&r.match(/function \(/)?"function "+i+r.substr(9):r}function z(t){var e=At(t)?t.slice(-1)[0]:t;return e&&e.toString()||"undefined"}function J(t){function e(t){if(Vt(t)){if(-1!==n.indexOf(t))return"[circular ref]";n.push(t)}return Qe(t)}var n=[];return JSON.stringify(t,function(t,n){return e(n)}).replace(/\\"/g,'"')}function Q(t){var e=new RegExp("("+t+")","g");return function(t){return t.split(e).filter(c)}}function K(t,e){return jt(P(t))&&jt(e)?t.slice(0,-1).concat(P(t)+e):R(t,e)}function Y(t){return t.name}function Z(t){return t.self.$$state=function(){return t},t.self}function X(t){return t.parent&&t.parent.data&&(t.data=t.self.data=Kt(t.parent.data,t.data)),t.data}function tt(t){return t.parent?t.parent.path.concat(t):[t]}function et(t){var e=t.parent?Jt({},t.parent.includes):{};return e[t.name]=!0,e}function nt(t){var e=function(t){var e=Lt.$injector;return t.$inject||e&&e.annotate(t,e.strictDi)||"deferred"},n=function(t){return!(!t.token||!t.resolveFn)},i=function(t){return!(!t.provide&&!t.token||!(t.useValue||t.useFactory||t.useExisting||t.useClass))},o=function(t){return!!(t&&t.val&&(jt(t.val)||At(t.val)||Ht(t.val)))},a=function(t){return t.provide||t.token},u=s([[vt("resolveFn"),function(t){return new Ne(a(t),t.resolveFn,t.deps,t.policy)}],[vt("useFactory"),function(t){return new Ne(a(t),t.useFactory,t.deps||t.dependencies,t.policy)}],[vt("useClass"),function(t){return new Ne(a(t),function(){return new t.useClass},[],t.policy)}],[vt("useValue"),function(t){return new Ne(a(t),function(){return t.useValue},[],t.policy,t.useValue)}],[vt("useExisting"),function(t){return new Ne(a(t),c,[t.useExisting],t.policy)}]]),f=s([[r(vt("val"),jt),function(t){return new Ne(t.token,c,[t.val],t.policy)}],[r(vt("val"),At),function(t){return new Ne(t.token,P(t.val),t.val.slice(0,-1),t.policy)}],[r(vt("val"),Ht),function(t){return new Ne(t.token,t.val,e(t.val),t.policy)}]]),h=s([[bt(Ne),function(t){return t}],[n,u],[i,u],[o,f],[Rt(!0),function(t){throw new Error("Invalid resolve value: "+J(t))}]]),p=t.resolve;return(At(p)?p:function(t,e){return Object.keys(t||{}).map(function(n){return{token:n,val:t[n],deps:void 0,policy:e[n]}})}(p,t.resolvePolicy||{})).map(h)}function rt(t,e){var n=["",""],r=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return r;switch(e.squash){case!1:n=["(",")"+(e.isOptional?"?":"")];break;case!0:r=r.replace(/\/$/,""),n=["(?:/(",")|/)?"];break;default:n=["("+e.squash+"|",")?"]}return r+n[0]+e.type.pattern.source+n[1]}function it(t,e,n,r){return"/"===r?t:e?Ze(r)+t:n?r.slice(1)+t:t}function ot(t){if(!(Ht(t)||jt(t)||bt(Ce)(t)||Ce.isDef(t)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return Ht(t)?t:Rt(t)}function at(t){t.addResolvable({token:An,deps:[],resolveFn:function(){return t.router},data:t.router},""),t.addResolvable({token:ze,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,n){return(0,n.$$state()[t])(e,n)}}function ut(t,e){function n(e){return e&&Array.isArray(e.states)&&e.states.forEach(function(e){return t.router.stateRegistry.register(e)}),e}var r=e.$$state().lazyLoad,i=r._promise;if(!i){var o=function(t){return delete e.lazyLoad,delete e.$$state().lazyLoad,delete r._promise,t},a=function(t){return delete r._promise,Lt.$q.reject(t)};i=r._promise=Lt.$q.when(r(t,e)).then(n).then(o,a)}return i}function ct(t){var e=t._ignoredReason();if(e){Te.traceTransitionIgnored(t);var n=t.router.globals.transition;return"SameAsCurrent"===e&&n&&n.abort(),me.ignored().toPromise()}}function ft(t){if(!t.valid())throw new Error(t.error())}function ht(t){var e=function(t){return t||""},n=Xe(t).map(e),r=n[0],i=n[1],o=tn(r).map(e);return{path:o[0],search:o[1],hash:i,url:t}}function pt(t,e,n,r){return function(i){function o(t){t.dispose(a),t.dispose(s)}var a=i.locationService=new n(i),s=i.locationConfig=new r(i,e);return{name:t,service:a,configuration:s,dispose:o}}}function lt(){function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}t.prototype=Event.prototype;try{return new CustomEvent("foo"),CustomEvent}catch(e){return t}}function dt(t){return Lt.$injector=yr,Lt.$q=pr,{name:"vanilla.services",$q:pr,$injector:yr,dispose:function(){return null}}}var vt=function(t){return function(e){return e&&e[t]}},yt=e(function(t,e,n){return n&&n[t]===e}),gt=function(t){return r.apply(null,t.split(".").map(vt))},mt=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},_t=function(t){return function(e){return e.reduce(function(e,n){return e&&!!t(n)},!0)}},wt=function(t){return function(e){return e.reduce(function(e,n){return e||!!t(n)},!1)}},bt=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},Et=function(t){return function(e){return t===e}},Rt=function(t){return function(){return t}},St=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}(),Tt=function(){function t(e){return t.create(e||{})}return t.create=function(e){e=t.isStateClass(e)?new e:e;var n=Kt(Kt(e,t.prototype));return e.$$state=function(){return n},n.self=e,n.__stateObjectCache={nameGlob:St.fromString(n.name)},n},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=v(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)||b(re(this.params),yt("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t.isStateClass=function(t){return Ht(t)&&!0===t.__uiRouterState},t.isState=function(t){return Vt(t.__stateObjectCache)},t}(),Ct=Object.prototype.toString,Pt=function(t){return function(e){return typeof e===t}},kt=Pt("undefined"),Ot=mt(kt),$t=function(t){return null===t},xt=o($t,kt),Ht=Pt("function"),It=Pt("number"),jt=Pt("string"),Vt=function(t){return null!==t&&"object"==typeof t},At=Array.isArray,qt=function(t){return"[object Date]"===Ct.call(t)},Nt=function(t){return"[object RegExp]"===Ct.call(t)},Ft=Tt.isState,Dt=i(Vt,r(vt("then"),Ht)),Ut=function(t){return function(){throw new Error(t+"(): No coreservices implementation for UI-Router is loaded.")}},Lt={$q:void 0,$injector:void 0},Mt="undefined"==typeof window?{}:window,Gt=Mt.angular||{},Bt=Gt.fromJson||JSON.parse.bind(JSON),Wt=Gt.toJson||JSON.stringify.bind(JSON),zt=Gt.forEach||O,Jt=Object.assign||$,Qt=Gt.equals||x,Kt=function(t,e){return Jt(Object.create(t),e)},Yt=e(p),Zt=e(l),Xt=e(d),te=function(t){return t.slice().forEach(function(e){"function"==typeof e&&e(),Zt(t,e)})},ee=function(t,e){return Jt(t,e)},ne=E,re=function(t){return Object.keys(t).map(function(e){return t[e]})},ie=function(t,e){return t&&e},oe=function(t,e){return t||e},ae=function(t,e){return t.concat(e)},se=function(t,e){return At(e)?t.concat(e.reduce(se,[])):R(t,e)},ue=function(t,e){return Yt(t,e)?t:R(t,e)},ce=function(t){return t.reduce(ae,[])},fe=function(t){return t.reduce(se,[])},he=S,pe=S,le=function(t){return Object.keys(t).map(function(e){return[e,t[e]]})},de=function(t){return t.catch(function(t){return 0})&&t},ve=function(t){return de(Lt.$q.reject(t))},ye=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 ge=0,me=function(){function e(t,e,n){this.$id=ge++,this.type=t,this.message=e,this.detail=n}return e.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():J(t)}(this.detail),e=this;return"Transition Rejection($id: "+e.$id+" type: "+e.type+", message: "+e.message+", detail: "+t+")"},e.prototype.toPromise=function(){return Jt(ve(this),{_transitionRejection:this})},e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&bt(e)(t._transitionRejection)},e.superseded=function(n,r){var i=new e(t.RejectType.SUPERSEDED,"The transition has been superseded by a different transition",n);return r&&r.redirected&&(i.redirected=!0),i},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(n){return new e(t.RejectType.INVALID,"This transition is invalid",n)},e.ignored=function(n){return new e(t.RejectType.IGNORED,"The transition was ignored",n)},e.aborted=function(n){return new e(t.RejectType.ABORTED,"The transition has been aborted",n)},e.errored=function(n){return new e(t.RejectType.ERROR,"The transition errored",n)},e.normalize=function(t){return bt(e)(t)?t:e.errored(t)},e}(),_e=function(t){var e=t.viewDecl,n=e.$context.name||"(root)";return"[View#"+t.$id+" from '"+n+"' state]: target ui-view: '"+e.$uiViewName+"@"+e.$uiViewContextAnchor+"'"},we=Ht(console.table)?console.table.bind(console):console.log.bind(console);!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 be=gt("$id"),Ee=gt("router.$id"),Re=function(t){return"Transition #"+be(t)+"-"+Ee(t)},Se=function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,n){var r=this;n.length||(n=Object.keys(t.Category).map(function(t){return parseInt(t,10)}).filter(function(t){return!isNaN(t)}).map(function(e){return t.Category[e]})),n.map(j).forEach(function(t){return r._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[j(t)]},e.prototype.traceTransitionStart=function(e){this.enabled(t.Category.TRANSITION)&&console.log(Re(e)+": Started  -> "+J(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(t.Category.TRANSITION)&&console.log(Re(e)+": Ignored  <> "+J(e))},e.prototype.traceHookInvocation=function(e,n,r){if(this.enabled(t.Category.HOOK)){var i=gt("traceData.hookType")(r)||"internal",o=gt("traceData.context.state.name")(r)||gt("traceData.context")(r)||"unknown",a=W(e.registeredHook.callback);console.log(Re(n)+":   Hook -> "+i+" context: "+o+", "+M(200,a))}},e.prototype.traceHookResult=function(e,n,r){this.enabled(t.Category.HOOK)&&console.log(Re(n)+":   <- Hook returned: "+M(200,J(e)))},e.prototype.traceResolvePath=function(e,n,r){this.enabled(t.Category.RESOLVE)&&console.log(Re(r)+":         Resolving "+e+" ("+n+")")},e.prototype.traceResolvableResolved=function(e,n){this.enabled(t.Category.RESOLVE)&&console.log(Re(n)+":               <- Resolved  "+e+" to: "+M(200,J(e.data)))},e.prototype.traceError=function(e,n){this.enabled(t.Category.TRANSITION)&&console.log(Re(n)+": <- Rejected "+J(n)+", reason: "+e)},e.prototype.traceSuccess=function(e,n){this.enabled(t.Category.TRANSITION)&&console.log(Re(n)+": <- Success  "+J(n)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,n,r){void 0===r&&(r=""),this.enabled(t.Category.UIVIEW)&&console.log("ui-view: "+G(30,e)+" "+I(n)+r)},e.prototype.traceUIViewConfigUpdated=function(e,n){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+n+"'")},e.prototype.traceUIViewFill=function(e,n){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+M(200,n))},e.prototype.traceViewSync=function(e){if(this.enabled(t.Category.VIEWCONFIG)){var n=e.map(function(t){var e=t[0],n=t[1];return{"ui-view fqn":e.$type+":"+e.fqn,"state: view name":n&&n.viewDecl.$context.name+": "+n.viewDecl.$name+" ("+n.viewDecl.$type+")"}}).sort(function(t,e){return t["ui-view fqn"].localeCompare(e["ui-view fqn"])});we(n)}},e.prototype.traceViewServiceEvent=function(e,n){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+_e(n))},e.prototype.traceViewServiceUIViewEvent=function(e,n){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+I(n))},e}(),Te=new Se;!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 Ce=function(){function t(t,e,n,r){this._stateRegistry=t,this._identifier=e,this._identifier=e,this._params=Jt({},n||{}),this._options=Jt({},r||{}),this._definition=t.matcher.find(e,this._options.relative)}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()+"'"+J(this.params())},t.prototype.withState=function(e){return new t(this._stateRegistry,e,this._params,this._options)},t.prototype.withParams=function(e,n){void 0===n&&(n=!1);var r=n?e:Jt({},this._params,e);return new t(this._stateRegistry,this._identifier,r,this._options)},t.prototype.withOptions=function(e,n){void 0===n&&(n=!1);var r=n?e:Jt({},this._options,e);return new t(this._stateRegistry,this._identifier,this._params,r)},t.isDef=function(t){return t&&t.state&&(jt(t.state)||jt(t.state.name))},t}(),Pe={current:f,transition:null,traceData:{},bind:null},ke=function(){function e(e,n,r,i){var o=this;this.transition=e,this.stateContext=n,this.registeredHook=r,this.options=i,this.isSuperseded=function(){return o.type.hookPhase===t.TransitionHookPhase.RUN&&!o.options.transition.isActive()},this.options=v(i,Pe),this.type=r.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 n=this.getNotCurrentRejection();if(n)return n;var r=this.options;Te.traceHookInvocation(this,this.transition,r);var i=function(t){return me.normalize(t).toPromise()},o=function(n){return e.eventType.getErrorHandler(t)(n)},a=function(n){return e.eventType.getResultHandler(t)(n)};try{var s=function(){return e.callback.call(r.bind,t.transition,t.stateContext)}();return!this.type.synchronous&&Dt(s)?s.catch(i).then(a,o):a(s)}catch(t){return o(me.normalize(t))}}},e.prototype.handleHookResult=function(t){var e=this,n=this.getNotCurrentRejection();return n||(Dt(t)?t.then(function(t){return e.handleHookResult(t)}):(Te.traceHookResult(t,this.transition,this.options),!1===t?me.aborted("Hook aborted transition").toPromise():bt(Ce)(t)?me.redirected(t).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var t=this.transition.router;return t._disposed?me.aborted("UIRouter instance #"+t.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?me.aborted().toPromise():this.isSuperseded()?me.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var t=this,e=t.options,n=t.registeredHook;return(gt("traceData.hookType")(e)||"internal")+" context: "+(gt("traceData.context.state.name")(e)||gt("traceData.context")(e)||"unknown")+", "+M(200,z(n.callback))},e.chain=function(t,e){var n=function(t,e){return t.then(function(){return e.invokeHook()})};return t.reduce(n,e||Lt.$q.when())},e.invokeHooks=function(t,n){for(var r=0;r<t.length;r++){var i=t[r].invokeHook();if(Dt(i)){var o=t.slice(r+1);return e.chain(o,i).then(n)}}return n()},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){Dt(e)&&e.catch(function(e){return t.logError(me.normalize(e))})}},e.LOG_ERROR=function(t){return function(e){return t.logError(e)}},e.REJECT_ERROR=function(t){return function(t){return ve(t)}},e.THROW_ERROR=function(t){return function(t){throw t}},e}(),Oe=function(){function e(t,e,n,r,i){void 0===i&&(i={}),this.tranSvc=t,this.eventType=e,this.callback=n,this.matchCriteria=r,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 n=t.filter(function(t){return V(t.state,e)});return n.length?n:null},e.prototype._getDefaultMatchCriteria=function(){return E(this.tranSvc._pluginapi._getPathTypes(),function(){return!0})},e.prototype._getMatchingNodes=function(e){var n=this,r=Jt(this._getDefaultMatchCriteria(),this.matchCriteria);return re(this.tranSvc._pluginapi._getPathTypes()).reduce(function(i,o){var a=o.scope===t.TransitionHookScope.STATE,s=e[o.name]||[],u=a?s:[P(s)];return i[o.name]=n._matchingNodes(u,r[o.name]),i},{})},e.prototype.matches=function(t){var e=this._getMatchingNodes(t);return re(e).every(c)?e:null},e}(),$e=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(ae,[]).filter(c)},e.prototype.buildHooks=function(e){var n=this.transition,r=n.treeChanges(),i=this.getMatchingHooks(e,r);if(!i)return[];var o={transition:n,current:n.options().current},a=function(i){return i.matches(r)[e.criteriaMatchPath.name].map(function(r){var a=Jt({bind:i.bind,traceData:{hookType:e.name,context:r}},o),s=e.criteriaMatchPath.scope===t.TransitionHookScope.STATE?r.state.self:null,u=new ke(n,s,i,a);return{hook:i,node:r,transitionHook:u}})};return i.map(a).reduce(ae,[]).sort(q(e.reverseSort)).map(function(t){return t.transitionHook})},e.prototype.getMatchingHooks=function(e,n){var r=e.hookPhase===t.TransitionHookPhase.CREATE,i=this.transition.router.transitionService;return(r?[i]:[this.transition,i]).map(function(t){return t.getHooks(e.name)}).filter(he(At,"broken event named: "+e.name)).reduce(ae,[]).filter(function(t){return t.matches(n)})},e}(),xe=function(){function t(t){this.pattern=/.*/,this.inherit=!0,Jt(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}(),He=Object.prototype.hasOwnProperty,Ie=function(t){return 0===["value","type","squash","array","dynamic"].filter(He.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 je=function(){function e(e,n,r,i,o){r=F(r),n=D(r,n,i,e,o.paramTypes);var a=function(){var n={array:i===t.DefType.SEARCH&&"auto"},o=e.match(/\[\]$/)?{array:!0}:{};return Jt(n,o,r).array}();n=a?n.$asArray(a,i===t.DefType.SEARCH):n;var s=void 0!==r.value||i===t.DefType.SEARCH,u=Ot(r.dynamic)?!!r.dynamic:!!n.dynamic,c=Ot(r.raw)?!!r.raw:!!n.raw,f=U(r,s,o.defaultSquashPolicy()),h=L(r,a,s,f),p=Ot(r.inherit)?!!r.inherit:!!n.inherit;Jt(this,{id:e,type:n,location:i,isOptional:s,dynamic:u,raw:c,squash:f,replace:h,inherit:p,array:a,config:r})}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 n=0,r=e.replace;n<r.length;n++){var i=r[n];if(i.from===t)return i.to}return t}(t),kt(t)?function(){if(e._defaultValueCache)return e._defaultValueCache.defaultValue;if(!Lt.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=Lt.$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((kt(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var n=this.type.encode(e);return!(jt(n)&&!this.type.pattern.exec(n))},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 n={},r=0,i=t;r<i.length;r++){var o=i[r];n[o.id]=o.value(e[o.id])}return n},e.changed=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),t.filter(function(t){return!t.type.equals(e[t.id],n[t.id])})},e.equals=function(t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),0===e.changed(t,n,r).length},e.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(ie,!0)},e}(),Ve=function(){function t(e){if(e instanceof t){var n=e;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=Jt({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=e;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.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,n){return C(t,e(n))},{}),this},t.prototype.parameter=function(t){return b(this.paramSchema,yt("id",t))},t.prototype.equals=function(t,e){var n=this.diff(t,e);return n&&0===n.length},t.prototype.diff=function(t,e){if(this.state!==t.state)return!1;var n=e?e(this):this.paramSchema;return je.changed(n,this.paramValues,t.paramValues)},t.clone=function(e){return new t(e)},t}(),Ae=function(){function t(){}return t.makeTargetState=function(t,e){var n=P(e).state;return new Ce(t,n,e.map(vt("paramValues")).reduce(ee,{}),{})},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new Ve(t).applyRawParams(e)})},t.buildToPath=function(e,n){var r=t.buildPath(n);return n.options().inherit?t.inheritParams(e,r,Object.keys(n.params())):r},t.applyViewConfigs=function(e,n,r){n.filter(function(t){return Yt(r,t.state)}).forEach(function(r){var i=re(r.state.views||{}),o=t.subPath(n,function(t){return t===r}),a=i.map(function(t){return e.createViewConfig(o,t)});r.views=a.reduce(ae,[])})},t.inheritParams=function(t,e,n){function r(t,e){var n=b(t,yt("state",e));return Jt({},n&&n.paramValues)}function i(e){var i=Jt({},e&&e.paramValues),a=g(i,n);i=m(i,n);var s=m(r(t,e.state)||{},o),u=Jt(i,s,a);return new Ve(e.state).applyRawParams(u)}void 0===n&&(n=[]);var o=t.map(function(t){return t.paramSchema
  }).reduce(ae,[]).filter(function(t){return!t.inherit}).map(vt("id"));return e.map(i)},t.treeChanges=function(e,n,r){function i(t,e){var r=Ve.clone(t);return r.paramValues=n[e].paramValues,r}for(var o=0,a=Math.min(e.length,n.length);o<a&&e[o].state!==r&&function(e,n){return e.equals(n,t.nonDynamicParams)}(e[o],n[o]);)o++;var s,u,c,f,h;s=e,u=s.slice(0,o),c=s.slice(o);var p=u.map(i);return f=n.slice(o),h=p.concat(f),{from:s,to:h,retained:u,exiting:c,entering:f}},t.matching=function(t,e,n){var r=!1;return T(t,e).reduce(function(t,e){var i=e[0],o=e[1];return r=r||!i.equals(o,n),r?t:t.concat(i)},[])},t.equals=function(e,n,r){return e.length===n.length&&t.matching(e,n,r).length===e.length},t.subPath=function(t,e){var n=b(t,e),r=t.indexOf(n);return-1===r?void 0:t.slice(0,r+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 Jt(t,e.paramValues)},{})},t}(),qe={when:"LAZY",async:"WAIT"},Ne=function(){function t(e,n,r,i,o){if(this.resolved=!1,this.promise=void 0,e instanceof t)Jt(this,e);else if(Ht(n)){if(xt(e))throw new Error("new Resolvable(): token argument is required");if(!Ht(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=e,this.policy=i,this.resolveFn=n,this.deps=r||[],this.data=o,this.resolved=void 0!==o,this.promise=this.resolved?Lt.$q.when(this.data):void 0}else if(Vt(e)&&e.token&&Ht(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||{},n=t&&t.resolvePolicy||{};return{when:e.when||n.when||qe.when,async:e.async||n.async||qe.async}},t.prototype.resolve=function(t,e){var n=this,r=Lt.$q,i=function(){return r.all(t.getDependencies(n).map(function(n){return n.get(t,e)}))},o=function(t){return n.resolveFn.apply(null,t)},a=function(t){var e=t.cache(1);return e.take(1).toPromise().then(function(){return e})},s=t.findNode(this),u=s&&s.state,f="RXWAIT"===this.getPolicy(u).async?a:c,h=function(t){return n.data=t,n.resolved=!0,Te.traceResolvableResolved(n,e),n.data};return this.promise=r.when().then(i).then(o).then(f).then(h)},t.prototype.get=function(t,e){return this.promise||this.resolve(t,e)},t.prototype.toString=function(){return"Resolvable(token: "+J(this.token)+", requires: ["+this.deps.map(J)+"])"},t.prototype.clone=function(){return new t(this)},t.fromData=function(e,n){return new t(e,function(){return n},null,null,n)},t}(),Fe={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT",RXWAIT:"RXWAIT"}},De=Fe.when,Ue=[De.EAGER,De.LAZY],Le=[De.EAGER],Me="Native Injector",Ge=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(ue,[])},t.prototype.getResolvable=function(t){return P(this._path.map(function(t){return t.resolvables}).reduce(ae,[]).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(Ae.subPath(this._path,function(t){return t.state===e}))},t.prototype.addResolvables=function(t,e){var n=b(this._path,yt("state",e)),r=t.map(function(t){return t.token});n.resolvables=n.resolvables.filter(function(t){return-1===r.indexOf(t.token)}).concat(t)},t.prototype.resolvePath=function(t,e){var n=this;void 0===t&&(t="LAZY");var r=Yt(Ue,t)?t:"LAZY",i=r===Fe.when.EAGER?Le:Ue;Te.traceResolvePath(this._path,t,e);var o=function(t,e){return function(r){return Yt(t,n.getPolicy(r)[e])}},a=this._path.reduce(function(t,r){var a=r.resolvables.filter(o(i,"when")),s=a.filter(o(["NOWAIT"],"async")),u=a.filter(mt(o(["NOWAIT"],"async"))),c=n.subContext(r.state),f=function(t){return t.get(c,e).then(function(e){return{token:t.token,value:e}})};return s.forEach(f),t.concat(u.map(f))},[]);return Lt.$q.all(a)},t.prototype.injector=function(){return this._injector||(this._injector=new Be(this))},t.prototype.findNode=function(t){return b(this._path,function(e){return Yt(e.resolvables,t)})},t.prototype.getDependencies=function(t){var e=this,n=this.findNode(t),r=Ae.subPath(this._path,function(t){return t===n})||this._path,i=r.reduce(function(t,e){return t.concat(e.resolvables)},[]).filter(function(e){return e!==t}),o=function(t){var n=i.filter(function(e){return e.token===t});if(n.length)return P(n);var r=e.injector().getNative(t);if(kt(r))throw new Error("Could not find Dependency Injection token: "+J(t));return new Ne(t,function(){return r},[],r)};return t.deps.map(o)},t}(),Be=function(){function t(t){this.context=t,this.native=this.get(Me)||Lt.$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:"+J(e.token));return e.data}return this.getNative(t)},t.prototype.getAsync=function(t){var e=this.context.getResolvable(t);return e?e.get(this.context):Lt.$q.when(this.native.get(t))},t.prototype.getNative=function(t){return this.native&&this.native.get(t)},t}(),We=vt("self"),ze=function(){function e(e,n,r){var i=this;if(this._deferred=Lt.$q.defer(),this.promise=this._deferred.promise,this._registeredHooks={},this._hookBuilder=new $e(this),this.isActive=function(){return i.router.globals.transition===i},this.router=r,this._targetState=n,!n.valid())throw new Error(n.error());this._options=Jt({current:Rt(this)},n.options()),this.$id=r.transitionService._transitionCount++;var o=Ae.buildToPath(e,n);this._treeChanges=Ae.treeChanges(e,o,this._options.reloadState),this.createTransitionHookRegFns();var a=this._hookBuilder.buildHooksForPhase(t.TransitionHookPhase.CREATE);ke.invokeHooks(a,function(){return null}),this.applyViewConfigs(r)}return e.prototype.onBefore=function(t,e,n){},e.prototype.onStart=function(t,e,n){},e.prototype.onExit=function(t,e,n){},e.prototype.onRetain=function(t,e,n){},e.prototype.onEnter=function(t,e,n){},e.prototype.onFinish=function(t,e,n){},e.prototype.onSuccess=function(t,e,n){},e.prototype.onError=function(t,e,n){},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 A(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});Ae.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&&!V(this.$to(),t.to)||t.from&&!V(this.$from(),t.from))},e.prototype.params=function(t){return void 0===t&&(t="to"),Object.freeze(this._treeChanges[t].map(vt("paramValues")).reduce(ee,{}))},e.prototype.injector=function(t,e){void 0===e&&(e="to");var n=this._treeChanges[e];return t&&(n=Ae.subPath(n,function(e){return e.state===t||e.state.name===t})),new Ge(n).injector()},e.prototype.getResolveTokens=function(t){return void 0===t&&(t="to"),new Ge(this._treeChanges[t]).getTokens()},e.prototype.addResolvable=function(t,e){void 0===e&&(e=""),t=bt(Ne)(t)?t:new Ne(t);var n="string"==typeof e?e:e.name,r=this._treeChanges.to,i=b(r,function(t){return t.state.name===n});new Ge(r).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 E(this._treeChanges.entering,vt("state")).map(We)},e.prototype.exiting=function(){return E(this._treeChanges.exiting,vt("state")).map(We).reverse()},e.prototype.retained=function(){return E(this._treeChanges.retained,vt("state")).map(We)},e.prototype.views=function(t,e){void 0===t&&(t="entering");var n=this._treeChanges[t];return n=e?n.filter(yt("state",e)):n,n.map(vt("views")).filter(c).reduce(ae,[])},e.prototype.treeChanges=function(t){return t?this._treeChanges[t]:this._treeChanges},e.prototype.redirect=function(t){for(var e=1,n=this;null!=(n=n.redirectedFrom());)if(++e>20)throw new Error("Too many consecutive Transition redirects (20+)");var r={redirectedFrom:this,source:"redirect"};"url"===this.options().source&&!1!==t.options().location&&(r.location="replace");var i=Jt({},this.options(),t.options(),r);t=t.withOptions(i,!0);var o=this.router.transitionService.create(this._treeChanges.from,t),a=this._treeChanges.entering,s=o._treeChanges.entering;return Ae.matching(s,a,Ae.nonDynamicParams).filter(mt(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(!T(t.to,t.from).map(function(t){return t[0].state!==t[1].state}).reduce(oe,!1)){var e=t.to.map(function(t){return t.paramSchema}),n=[t.to,t.from].map(function(t){return t.map(function(t){return t.paramValues})});return T(e,n[0],n[1]).map(function(t){var e=t[0],n=t[1],r=t[2];return je.changed(e,n,r)}).reduce(ae,[])}}},e.prototype.dynamic=function(){var t=this._changedParams();return!!t&&t.map(function(t){return t.dynamic}).reduce(oe,!1)},e.prototype.ignored=function(){return!!this._ignoredReason()},e.prototype._ignoredReason=function(){var t=this.router.globals.transition,e=this._options.reloadState,n=function(t,n){if(t.length!==n.length)return!1;var r=Ae.matching(t,n);return t.length===r.filter(function(t){return!e||!t.state.includes[e.name]}).length},r=this.treeChanges(),i=t&&t.treeChanges();return i&&n(i.to,r.to)&&n(i.exiting,r.exiting)?"SameAsPending":0===r.exiting.length&&0===r.entering.length&&n(r.from,r.to)?"SameAsCurrent":void 0},e.prototype.run=function(){var e=this,n=ke.runAllHooks,r=function(t){return e._hookBuilder.buildHooksForPhase(t)},i=function(){Te.traceSuccess(e.$to(),e),e.success=!0,e._deferred.resolve(e.to()),n(r(t.TransitionHookPhase.SUCCESS))},o=function(i){Te.traceError(i,e),e.success=!1,e._deferred.reject(i),e._error=i,n(r(t.TransitionHookPhase.ERROR))},a=function(){var e=r(t.TransitionHookPhase.RUN),n=function(){return Lt.$q.when(void 0)};return ke.invokeHooks(e,n)},s=function(){var t=e.router.globals;return t.lastStartedTransitionId=e.$id,t.transition=e,t.transitionHistory.enqueue(e),Te.traceTransitionStart(e),Lt.$q.when(void 0)},u=r(t.TransitionHookPhase.BEFORE);return ke.invokeHooks(u,s).then(a).then(i,o),this.promise},e.prototype.valid=function(){return!this.error()||void 0!==this.success},e.prototype.abort=function(){kt(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(),n=this.params(),r=e.filter(function(t){return!t.validates(n[t.id])});return r.length?"Param values not valid for state '"+t.name+"'. Invalid params: [ "+r.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(),n=function(t){return null!==t["#"]&&void 0!==t["#"]?t:m(t,["#"])};return"Transition#"+this.$id+"( '"+(Vt(t)?t.name:t)+"'"+J(n(this._treeChanges.from.map(vt("paramValues")).reduce(ee,{})))+" -> "+(this.valid()?"":"(X) ")+"'"+(Vt(e)?e.name:e)+"'"+J(n(this.params()))+" )"},e.diToken=e,e}(),Je=null,Qe=function(t){var e=me.isRejectionPromise;return(Je=Je||s([[mt(Ot),Rt("undefined")],[$t,Rt("null")],[Dt,Rt("[Promise]")],[e,function(t){return t._transitionRejection.toString()}],[bt(me),a("toString")],[bt(ze),a("toString")],[bt(Ne),a("toString")],[u,W],[Rt(!0),c]]))(t)},Ke=function(t){return function(e){if(!e)return["",""];var n=e.indexOf(t);return-1===n?[e,""]:[e.substr(0,n),e.substr(n+1)]}},Ye=new RegExp("^(?:[a-z]+:)?//[^/]+/"),Ze=function(t){return t.replace(/\/[^\/]*$/,"")},Xe=Ke("#"),tn=Ke("?"),en=Ke("="),nn=function(t){return t?t.replace(/^#/,""):""},rn=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(Jt({name:e},t))};this.types=Kt(E(this.defaultTypes,e),{})}return t.prototype.dispose=function(){this.types={}},t.prototype.type=function(t,e,n){if(!Ot(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(Jt({name:t},e)),n&&(this.typeQueue.push({name:t,def:n}),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.");Jt(this.types[t.name],Lt.$injector.invoke(t.def))}},t}();!function(){var t=function(t){var e=function(t){return null!=t?t.toString():t},n={encode:e,decode:e,is:bt(String),pattern:/.*/,equals:function(t,e){return t==e}};return Jt({},n,t)};Jt(rn.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!xt(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:bt(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(n,r){return n&&t[r]()===e[r]()},!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:Wt,decode:Bt,is:bt(Object),equals:Qt,pattern:/[^\/]*/}),any:t({encode:c,decode:c,is:function(){return!0},equals:Qt})})}();var on,an=function(){function t(t){void 0===t&&(t={}),Jt(this,t)}return t.prototype.$inherit=function(t,e,n){var r,i=y(e,n),o={},a=[];for(var s in i)if(i[s]&&i[s].params&&(r=Object.keys(i[s].params),r.length))for(var u in r)a.indexOf(r[u])>=0||(a.push(r[u]),o[r[u]]=this[r[u]]);return Jt({},o,t)},t}(),sn=function(t){if(!jt(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},un=function(t,e){return function(n){var r=n;r&&r.url&&r.name&&r.name.match(/\.\*\*$/)&&(r.url+="{remainder:any}");var i=sn(r.url),o=n.parent,a=i?t.compile(i.val,{params:n.params||{},paramMap:function(t,e){return!1===r.reloadOnSearch&&e&&(t=Jt(t||{},{dynamic:!0})),t}}):r.url;if(!a)return null;if(!t.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+n+"'");return i&&i.root?a:(o&&o.navigable||e()).url.append(a)}},cn=function(t){return function(e){return!t(e)&&e.url?e:e.parent?e.parent.navigable:null}},fn=function(t){return function(e){var n=function(e,n){return t.fromConfig(n,null,e)},r=e.url&&e.url.parameters({inherit:!1})||[],i=re(ne(m(e.params||{},r.map(vt("id"))),n));return r.concat(i).map(function(t){return[t.id,t]}).reduce(C,{})}},hn=function(){function t(t,e){function n(e){return o(e)?null:t.find(r.parentName(e))||i()}this.matcher=t;var r=this,i=function(){return t.find("")},o=function(t){return""===t.name};this.builders={name:[Y],self:[Z],parent:[n],data:[X],url:[un(e,i)],navigable:[cn(o)],params:[fn(e.paramFactory)],views:[],path:[tt],includes:[et],resolvables:[nt]}}return t.prototype.builder=function(t,e){var n=this.builders,r=n[t]||[];return jt(t)&&!Ot(e)?r.length>1?r:r[0]:jt(t)&&Ht(e)?(n[t]=r,n[t].push(e),function(){return n[t].splice(n[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,n=e.matcher,r=e.builders,i=this.parentName(t);if(i&&!n.find(i,void 0,!1))return null;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o].reduce(function(t,e){return function(n){return e(n,t)}},f);t[o]=a(t)}return t},t.prototype.parentName=function(t){var e=t.name||"",n=e.split(".");if("**"===n.pop()&&n.pop(),n.length){if(t.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+e+")");return n.join(".")}return t.parent?jt(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 n=jt(t.parent)?t.parent:t.parent.name;return n?n+"."+e:e},t}(),pn=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,n){if(void 0===n&&(n=!0),t||""===t){var r=jt(t),i=r?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];if(o&&(r||!(r||o!==t&&o.self!==t)))return o;if(r&&n){var a=re(this._states),s=a.filter(function(t){return t.__stateObjectCache.nameGlob&&t.__stateObjectCache.nameGlob.matches(i)});return s.length>1&&console.log("stateMatcher.find: Found multiple matches for "+i+" using glob: ",s.map(function(t){return t.name})),s[0]}}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var n=this.find(e),r=t.split("."),i=0,o=r.length,a=n;i<o;i++)if(""!==r[i]||0!==i){if("^"!==r[i])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var s=r.slice(i).join(".");return a.name+(a.name&&s?".":"")+s},t}(),ln=function(){function t(t,e,n,r,i){this.$registry=t,this.$urlRouter=e,this.states=n,this.builder=r,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,n=Tt.create(t),r=n.name;if(!jt(r))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(r)||Yt(e.map(vt("name")),r))throw new Error("State '"+r+"' is already defined");return e.push(n),this.flush(),n},t.prototype.flush=function(){for(var t=this,e=this,n=e.queue,r=e.states,i=e.builder,o=[],a=[],s={},u=function(e){return t.states.hasOwnProperty(e)&&t.states[e]};n.length>0;){var c=n.shift(),f=c.name,h=i.build(c),p=a.indexOf(c);if(h){var l=u(f);if(l&&l.name===f)throw new Error("State '"+f+"' is already defined");var d=u(f+".**");d&&this.$registry.deregister(d),r[f]=c,this.attachRoute(c),p>=0&&a.splice(p,1),o.push(c)}else{var v=s[f];if(s[f]=n.length,p>=0&&v===n.length)return n.push(c),r;p<0&&a.push(c),n.push(c)}}return o.length&&this.listeners.forEach(function(t){return t("registered",o.map(function(t){return t.self}))}),r},t.prototype.attachRoute=function(t){!t.abstract&&t.url&&this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(t))},t}(),dn=function(){function t(t){this._router=t,this.states={},this.listeners=[],this.matcher=new pn(this.states),this.builder=new hn(this.matcher,t.urlMatcherFactory),this.stateQueue=new ln(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(){Zt(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,n=this.get().map(function(t){return t.$$state()}),r=function(t){var e=n.filter(function(e){return-1!==t.indexOf(e.parent)});return 0===e.length?e:e.concat(r(e))},i=r([t]),o=[t].concat(i).reverse();return o.forEach(function(t){var n=e._router.urlRouter;n.rules().filter(yt("state",t)).forEach(n.removeRule.bind(n)),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 n=this._deregisterTree(e.$$state());return this.listeners.forEach(function(t){return t("deregistered",n.map(function(t){return t.self}))}),n},t.prototype.get=function(t,e){var n=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return n.states[t].self});var r=this.matcher.find(t,e);return r&&r.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}(),vn=function(t,e,n){return t[e]=t[e]||n()},yn=Q("/"),gn=function(){function e(t,n,r,i){var o=this;this.config=i,this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.pattern=t,this.config=v(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:c});for(var a,s,u,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=0,l=[],d=function(n){if(!e.nameValidator.test(n))throw new Error("Invalid parameter name '"+n+"' in pattern '"+t+"'");if(b(o._params,yt("id",n)))throw new Error("Duplicate parameter name '"+n+"' in pattern '"+t+"'")},y=function(e,r){var i=e[2]||e[3],a=r?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?n.type(a)||function(t){return Kt(n.type(r?"query":"path"),{pattern:new RegExp(t,o.config.caseInsensitive?"i":void 0)})}(a):null}};(a=f.exec(t))&&(s=y(a,!1),!(s.segment.indexOf("?")>=0));)d(s.id),this._params.push(r.fromPath(s.id,s.type,this.config.paramMap(s.cfg,!1))),this._segments.push(s.segment),l.push([s.segment,P(this._params)]),p=f.lastIndex;u=t.substring(p);var g=u.indexOf("?");if(g>=0){var m=u.substring(g);if(u=u.substring(0,g),m.length>0)for(p=0;a=h.exec(m);)s=y(a,!0),d(s.id),this._params.push(r.fromSearch(s.id,s.type,this.config.paramMap(s.cfg,!0))),p=f.lastIndex}this._segments.push(u),this._compiled=l.map(function(t){return rt.apply(null,t)}).concat(rt(u))}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,n,r){var i=this;void 0===e&&(e={}),void 0===r&&(r={});var o=vn(this._cache,"pattern",function(){return new RegExp(["^",ce(i._cache.path.map(vt("_compiled"))).join(""),!1===i.config.strict?"/?":"","$"].join(""),i.config.caseInsensitive?"i":void 0)}).exec(t);if(!o)return null;var a=this.parameters(),s=a.filter(function(t){return!t.isSearch()}),u=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 h=0;h<c;h++){for(var p=s[h],l=o[h+1],d=0;d<p.replace.length;d++)p.replace[d].from===l&&(l=p.replace[d].to);l&&!0===p.array&&(l=function(t){var e=function(t){return t.split("").reverse().join("")},n=function(t){return t.replace(/\\-/g,"-")};return E(E(e(t).split(/-(?!\\)/),e),n).reverse()}(l)),Ot(l)&&(l=p.type.decode(l)),f[p.id]=p.value(l)}return u.forEach(function(t){for(var n=e[t.id],r=0;r<t.replace.length;r++)t.replace[r].from===n&&(n=t.replace[r].to);Ot(n)&&(n=t.type.decode(n)),f[t.id]=t.value(n)}),n&&(f["#"]=n),f},e.prototype.parameters=function(t){return void 0===t&&(t={}),!1===t.inherit?this._params:ce(this._cache.path.map(function(t){return t._params}))},e.prototype.parameter=function(t,e){var n=this;void 0===e&&(e={});var r=this._cache.parent;return function(){for(var e=0,r=n._params;e<r.length;e++){var i=r[e];if(i.id===t)return i}}()||!1!==e.inherit&&r&&r.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(n){return e(n,t[n.id])}).reduce(ie,!0)},e.prototype.format=function(t){function n(e){var n=e.value(t[e.id]),r=e.validates(n),i=e.isDefaultValue(n);return{param:e,value:n,isValid:r,isDefaultValue:i,squash:!!i&&e.squash,encoded:e.type.encode(n)}}void 0===t&&(t={});var r=this._cache.path,i=r.map(e.pathSegmentsAndParams).reduce(ae,[]).map(function(t){return jt(t)?t:n(t)}),o=r.map(e.queryParams).reduce(ae,[]).map(n),a=function(t){return!1===t.isValid};if(i.concat(o).filter(a).length)return null;var s=i.reduce(function(t,n){if(jt(n))return t+n;var r=n.squash,i=n.encoded,o=n.param;return!0===r?t.match(/\/$/)?t.slice(0,-1):t:jt(r)?t+r:!1!==r?t:null==i?t:At(i)?t+E(i,e.encodeDashes).join("-"):o.raw?t+i:t+encodeURIComponent(i)},""),u=o.map(function(t){var e=t.param,n=t.squash,r=t.encoded,i=t.isDefaultValue;if(!(null==r||i&&!1!==n)&&(At(r)||(r=[r]),0!==r.length))return e.raw||(r=E(r,encodeURIComponent)),r.map(function(t){return e.id+"="+t})}).filter(c).reduce(ae,[]).join("&");return s+(u?"?"+u:"")+(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 T(e._segments,e._params.filter(function(e){return e.location===t.DefType.PATH}).concat(void 0)).reduce(ae,[]).filter(function(t){return""!==t&&Ot(t)})},e.queryParams=function(e){return e._params.filter(function(e){return e.location===t.DefType.SEARCH})},e.compare=function(t,n){var r=function(t){return t._cache.segments=t._cache.segments||t._cache.path.map(e.pathSegmentsAndParams).reduce(ae,[]).reduce(K,[]).map(function(t){return jt(t)?yn(t):t}).reduce(ae,[])},i=function(t){return t._cache.weights=t._cache.weights||r(t).map(function(t){return"/"===t?1:jt(t)?2:t instanceof je?3:void 0})},o=i(t),a=i(n);!function(t,e,n){for(var r=Math.max(t.length,e.length);t.length<r;)t.push(n);for(;e.length<r;)e.push(n)}(o,a,0);var s,u,c=T(o,a);for(u=0;u<c.length;u++)if(0!==(s=c[u][0]-c[u][1]))return s;return 0},e.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,e}(),mn=function(){function e(){var e=this;this.paramTypes=new rn,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this._getConfig=function(t){return Jt({strict:e._isStrictMode,caseInsensitive:e._isCaseInsensitive},t)},this.paramFactory={fromConfig:function(n,r,i){return new je(n,r,i,t.DefType.CONFIG,e)},fromPath:function(n,r,i){return new je(n,r,i,t.DefType.PATH,e)},fromSearch:function(n,r,i){return new je(n,r,i,t.DefType.SEARCH,e)}},Jt(this,{UrlMatcher:gn,Param:je})}return e.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=Ot(t)?t:this._isCaseInsensitive},e.prototype.strictMode=function(t){return this._isStrictMode=Ot(t)?t:this._isStrictMode},e.prototype.defaultSquashPolicy=function(t){if(Ot(t)&&!0!==t&&!1!==t&&!jt(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=Ot(t)?t:this._defaultSquashPolicy},e.prototype.compile=function(t,e){return new gn(t,this.paramTypes,this.paramFactory,this._getConfig(e))},e.prototype.isMatcher=function(t){if(!Vt(t))return!1;var e=!0;return zt(gn.prototype,function(n,r){Ht(n)&&(e=e&&Ot(t[r])&&Ht(t[r]))}),e},e.prototype.type=function(t,e,n){var r=this.paramTypes.type(t,e,n);return Ot(e)?this:r},e.prototype.$get=function(){return this.paramTypes.enqueue=!1,this.paramTypes._flushTypeQueue(),this},e.prototype.dispose=function(){this.paramTypes.dispose()},e}(),_n=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 n=this,r=s([[jt,function(t){return r(n.compile(t))}],[bt(gn),function(t){return n.fromUrlMatcher(t,e)}],[Ft,function(t){return n.fromState(t,n.router)}],[bt(RegExp),function(t){return n.fromRegExp(t,e)}],[Ht,function(t){return new wn(t,e)}]]),i=r(t);if(!i)throw new Error("invalid 'what' in when()");return i},t.prototype.fromUrlMatcher=function(t,e){function n(e){var n=t.exec(e.path,e.search,e.hash);return t.validates(n)&&n}function r(e){var n=t.parameters().filter(function(t){return t.isOptional});return n.length?n.filter(function(t){return e[t.id]}).length/n.length:1e-6}var i=e;jt(e)&&(e=this.router.urlMatcherFactory.compile(e)),bt(gn)(e)&&(i=function(t){return e.format(t)});var o={urlMatcher:t,matchPriority:r,type:"URLMATCHER"};return Jt(new wn(n,i),o)},t.prototype.fromState=function(t,e){var n=function(n){var r=e.stateService,i=e.globals;r.href(t,n)!==r.href(i.current,i.params)&&r.transitionTo(t,n,{inherit:!0,source:"url"})},r={state:t,type:"STATE"};return Jt(this.fromUrlMatcher(t.url,n),r)},t.prototype.fromRegExp=function(t,e){if(t.global||t.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=function(t){return e.replace(/\$(\$|\d{1,2})/,function(e,n){return t["$"===n?0:Number(n)]})},r=jt(e)?n:e,i=function(e){return t.exec(e.path)},o={regexp:t,type:"REGEXP"};return Jt(new wn(i,r),o)},t.isUrlRule=function(t){return t&&["type","match","handler"].every(function(e){return Ot(t[e])})},t}(),wn=function(){function t(t,e){var n=this;this.match=t,this.type="RAW",this.matchPriority=function(t){return 0-n.$id},this.handler=e||c}return t}(),bn=function(t,e){return(e.priority||0)-(t.priority||0)},En=function(t,e){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[t.type]||0)-(n[e.type]||0)},Rn=function(t,e){return t.urlMatcher&&e.urlMatcher?gn.compare(t.urlMatcher,e.urlMatcher):0},Sn=function(t,e){var n={STATE:!0,URLMATCHER:!0};return n[t.type]&&n[e.type]?0:(t.$id||0)-(e.$id||0)};on=function(t,e){var n=bn(t,e);return 0!==n?n:0!==(n=En(t,e))?n:(n=Rn(t,e),0!==n?n:Sn(t,e))};var Tn=function(){function t(e){this._sortFn=on,this._rules=[],this.interceptDeferred=!1,this._id=0,this._sorted=!1,this._router=e,this.urlRuleFactory=new _n(e),h(Rt(t.prototype),this,Rt(this))}return t.prototype.dispose=function(){this.listen(!1),this._rules=[],delete this._otherwiseFn},t.prototype.sort=function(t){this._rules=this.stableSort(this._rules,this._sortFn=t||this._sortFn),this._sorted=!0},t.prototype.ensureSorted=function(){this._sorted||this.sort()},t.prototype.stableSort=function(t,e){var n=t.map(function(t,e){return{elem:t,idx:e}});return n.sort(function(t,n){var r=e(t.elem,n.elem);return 0===r?t.idx-n.idx:r}),n.map(function(t){return t.elem})},t.prototype.match=function(t){var e=this;this.ensureSorted(),t=Jt({path:"",search:{},hash:""},t);var n=this.rules();this._otherwiseFn&&n.push(this._otherwiseFn);for(var r,i=0;i<n.length&&(!r||0===this._sortFn(n[i],r.rule));i++){var o=function(n){var r=n.match(t,e._router);return r&&{match:r,rule:n,weight:n.matchPriority(r)}}(n[i]);r=!r||o&&o.weight>r.weight?o:r}return r},t.prototype.sync=function(t){if(!t||!t.defaultPrevented){var e=this._router,n=e.urlService,r=e.stateService,i={path:n.path(),search:n.search(),hash:n.hash()},o=this.match(i);s([[jt,function(t){return n.url(t,!0)}],[Ce.isDef,function(t){return r.go(t.state,t.params,t.options)}],[bt(Ce),function(t){return r.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,n){var r=n&&!!n.replace;this._router.urlService.url(t.format(e||{}),r)},t.prototype.href=function(t,e,n){var r=t.format(e);if(null==r)return null;n=n||{absolute:!1};var i=this._router.urlService.config,o=i.html5Mode();if(o||null===r||(r="#"+i.hashPrefix()+r),r=it(r,o,n.absolute,i.baseHref()),!n.absolute||!r)return r;var a=!o&&r?"/":"",s=i.port();return s=80===s||443===s?"":":"+s,[i.protocol(),"://",i.host(),s,a,r].join("")},t.prototype.rule=function(t){var e=this;if(!_n.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){Zt(this._rules,t)},t.prototype.rules=function(){return this.ensureSorted(),this._rules.slice()},t.prototype.otherwise=function(t){var e=ot(t);this._otherwiseFn=this.urlRuleFactory.create(Rt(!0),e),this._sorted=!1},t.prototype.initial=function(t){var e=ot(t),n=function(t,e){return 0===e.globals.transitionHistory.size()&&!!/^\/?$/.exec(t.path)};this.rule(this.urlRuleFactory.create(n,e))},t.prototype.when=function(t,e,n){var r=this.urlRuleFactory.create(t,e);return Ot(n&&n.priority)&&(r.priority=n.priority),this.rule(r),r},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}(),Cn=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 n=this._viewConfigFactories[e.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+e.$type);var r=n(t,e);return At(r)?r:[r]},t.prototype.deactivateViewConfig=function(t){Te.traceViewServiceEvent("<- Removing",t),Zt(this._viewConfigs,t)},t.prototype.activateViewConfig=function(t){Te.traceViewServiceEvent("-> Registering",t),this._viewConfigs.push(t)},t.prototype.sync=function(){function n(t){var e=function(t){return t&&t.parent?e(t.parent)+1:1};return 1e4*t.fqn.split(".").length+e(t.creationContext)}function r(t){for(var e=t.viewDecl.$context,n=0;++n&&e.parent;)e=e.parent;return n}var i=this,o=this._uiViews.map(function(t){return[t.fqn,t]}).reduce(C,{}),a=e(function(t,e,n,r){return e*(t(n)-t(r))}),s=function(e){var n=i._viewConfigs.filter(t.matches(o,e));return n.length>1&&n.sort(a(r,-1)),[e,n[0]]},u=function(t){var e=t[0],n=t[1];-1!==i._uiViews.indexOf(e)&&e.configUpdated(n)},c=this._uiViews.sort(a(n,1)).map(s);Te.traceViewSync(c),c.forEach(u)},t.prototype.registerUIView=function(t){Te.traceViewServiceUIViewEvent("-> Registering",t);var e=this._uiViews,n=function(e){return e.fqn===t.fqn&&e.$type===t.$type};return e.filter(n).length&&Te.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){if(-1===e.indexOf(t))return void Te.traceViewServiceUIViewEvent("Tried removing non-registered uiView",t);Te.traceViewServiceUIViewEvent("<- Deregistering",t),Zt(e)(t)}},t.prototype.available=function(){return this._uiViews.map(vt("fqn"))},t.prototype.active=function(){return this._uiViews.filter(vt("$config")).map(vt("name"))},t.normalizeUIViewTarget=function(t,e){void 0===e&&(e="");var n=e.split("@"),r=n[0]||"$default",i=jt(n[1])?n[1]:"^",o=/^(\^(?:\.\^)*)\.(.*$)/.exec(r);(o&&(i=o[1],r=o[2]),"!"===r.charAt(0)&&(r=r.substr(1),i=""),/^(\^(?:\.\^)*)$/.exec(i))?i=i.split(".").reduce(function(t,e){return t.parent},t).name:"."===i&&(i=t.name);return{uiViewName:r,uiViewContextAnchor:i}},t.matches=function(t,e){return function(n){if(e.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,i=r.$uiViewName.split("."),o=e.fqn.split(".");if(!Qt(i,o.slice(0-i.length)))return!1;var a=1-i.length||void 0,s=o.slice(0,a).join("."),u=t[s].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},t}(),Pn=function(){function t(){this.params=new an,this.lastStartedTransitionId=-1,this.transitionHistory=new ye([],1),this.successfulTransitions=new ye([],1)}return t.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},t}(),kn=function(t){return t.reduce(function(t,e){return t[e]=Ut(e),t},{dispose:f})},On=["url","path","search","hash","onChange"],$n=["port","protocol","host","baseHref","html5Mode","hashPrefix"],xn=["type","caseInsensitive","strictMode","defaultSquashPolicy"],Hn=["sort","when","initial","otherwise","rules","rule","removeRule"],In=["deferIntercept","listen","sync","match"],jn=function(){function t(t,e){void 0===e&&(e=!0),this.router=t,this.rules={},this.config={};var n=function(){return t.locationService};h(n,this,n,On,e);var r=function(){return t.locationConfig};h(r,this.config,r,$n,e);var i=function(){return t.urlMatcherFactory};h(i,this.config,i,xn);var o=function(){return t.urlRouter};h(o,this.rules,o,Hn),h(o,this,o,In)}return t.prototype.url=function(t,e,n){},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=kn(On),t.locationConfigStub=kn($n),t}(),Vn=0,An=function(){function t(t,e){void 0===t&&(t=jn.locationServiceStub),void 0===e&&(e=jn.locationConfigStub),this.locationService=t,this.locationConfig=e,this.$id=Vn++,this._disposed=!1,this._disposables=[],this.trace=Te,this.viewService=new Cn,this.transitionService=new fr(this),this.globals=new Pn,this.urlMatcherFactory=new mn,this.urlRouter=new Tn(this),this.stateRegistry=new dn(this),this.stateService=new hr(this),this.urlService=new jn(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&&Ht(t.dispose))return void t.dispose(this);this._disposed=!0,this._disposables.slice().forEach(function(t){try{"function"==typeof t.dispose&&t.dispose(e),Zt(e._disposables,t)}catch(t){}})},t.prototype.plugin=function(t,e){void 0===e&&(e={});var n=new t(this,e);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},t.prototype.getPlugin=function(t){return t?this._plugins[t]:re(this._plugins)},t}(),qn=function(t){return t.onCreate({},at)},Nn=function(t){function e(e){if(e)return e instanceof Ce?e:jt(e)?r.target(e,t.params(),t.options()):e.state||e.params?r.target(e.state||t.to(),e.params||t.params(),t.options()):void 0}var n=t.to().redirectTo;if(n){var r=t.router.stateService;return Ht(n)?Lt.$q.when(n(t)).then(e):e(n)}},Fn=function(t){return t.onStart({to:function(t){return!!t.redirectTo}},Nn)},Dn=st("onExit"),Un=function(t){return t.onExit({exiting:function(t){return!!t.onExit}},Dn)},Ln=st("onRetain"),Mn=function(t){return t.onRetain({retained:function(t){return!!t.onRetain}},Ln)},Gn=st("onEnter"),Bn=function(t){return t.onEnter({entering:function(t){return!!t.onEnter}},Gn)},Wn=function(t){return new Ge(t.treeChanges().to).resolvePath("EAGER",t).then(f)},zn=function(t){return t.onStart({},Wn,{priority:1e3})},Jn=function(t,e){return new Ge(t.treeChanges().to).subContext(e.$$state()).resolvePath("LAZY",t).then(f)},Qn=function(t){return t.onEnter({entering:Rt(!0)},Jn,{priority:1e3})},Kn=function(t){var e=Lt.$q,n=t.views("entering");if(n.length)return e.all(n.map(function(t){return e.when(t.load())})).then(f)},Yn=function(t){return t.onFinish({},Kn)},Zn=function(t){var e=t.views("entering"),n=t.views("exiting");if(e.length||n.length){var r=t.router.viewService;n.forEach(function(t){return r.deactivateViewConfig(t)}),e.forEach(function(t){return r.activateViewConfig(t)}),r.sync()}},Xn=function(t){return t.onSuccess({},Zn)},tr=function(t){var e=t.router.globals,n=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,k(t.params(),e.params)},r=function(){e.transition===t&&(e.transition=null)};t.onSuccess({},n,{priority:1e4}),t.promise.then(r,r)},er=function(t){return t.onCreate({},tr)},nr=function(t){var e=t.options(),n=t.router.stateService,r=t.router.urlRouter;if("url"!==e.source&&e.location&&n.$current.navigable){var i={replace:"replace"===e.location};r.push(n.$current.navigable.url,n.params,i)}r.update(!0)},rr=function(t){return t.onSuccess({},nr,{priority:9999})},ir=function(t){function e(){if("url"!==t.originalTransition().options().source){var e=t.targetState();return n.stateService.target(e.identifier(),e.params(),e.options())}var r=n.urlService,i=r.match(r.parts()),o=i&&i.rule;if(o&&"STATE"===o.type){var a=o.state,s=i.match;return n.stateService.target(a,s,t.options())}n.urlService.sync()}var n=t.router,r=t.entering().filter(function(t){return!!t.$$state().lazyLoad}).map(function(e){return ut(t,e)});return Lt.$q.all(r).then(e)},or=function(t){return t.onBefore({entering:function(t){return!!t.lazyLoad}},ir)},ar=function(){function t(t,e,n,r,i,o,a,s){void 0===i&&(i=!1),void 0===o&&(o=ke.HANDLE_RESULT),void 0===a&&(a=ke.REJECT_ERROR),void 0===s&&(s=!1),this.name=t,this.hookPhase=e,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=s}return t}(),sr=function(t){return t.onBefore({},ct,{priority:-9999})},ur=function(t){return t.onBefore({},ft,{priority:-1e4})},cr={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null},source:"unknown"},fr=function(){function e(t){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=t,this.$view=t.viewService,this._deregisterHookFns={},this._pluginapi=h(Rt(this),{},Rt(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks()}return e.prototype.onCreate=function(t,e,n){},e.prototype.onBefore=function(t,e,n){},e.prototype.onStart=function(t,e,n){},e.prototype.onExit=function(t,e,n){},e.prototype.onRetain=function(t,e,n){},e.prototype.onEnter=function(t,e,n){},e.prototype.onFinish=function(t,e,n){},e.prototype.onSuccess=function(t,e,n){},e.prototype.onError=function(t,e,n){},e.prototype.dispose=function(t){re(this._registeredHooks).forEach(function(t){return t.forEach(function(e){e._deregistered=!0,Zt(t,e)})})},e.prototype.create=function(t,e){return new ze(t,e,this._router)},e.prototype._defineCoreEvents=function(){var e=t.TransitionHookPhase,n=ke,r=this._criteriaPaths;this._defineEvent("onCreate",e.CREATE,0,r.to,!1,n.LOG_REJECTED_RESULT,n.THROW_ERROR,!0),this._defineEvent("onBefore",e.BEFORE,0,r.to),this._defineEvent("onStart",e.RUN,0,r.to),this._defineEvent("onExit",e.RUN,100,r.exiting,!0),this._defineEvent("onRetain",e.RUN,200,r.retained),this._defineEvent("onEnter",e.RUN,300,r.entering),this._defineEvent("onFinish",e.RUN,400,r.to),this._defineEvent("onSuccess",e.SUCCESS,0,r.to,!1,n.LOG_REJECTED_RESULT,n.LOG_ERROR,!0),this._defineEvent("onError",e.ERROR,0,r.to,!1,n.LOG_REJECTED_RESULT,n.LOG_ERROR,!0)},e.prototype._defineCorePaths=function(){var e=t.TransitionHookScope.STATE,n=t.TransitionHookScope.TRANSITION;this._definePathType("to",n),this._definePathType("from",n),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(t,e,n,r,i,o,a,s){void 0===i&&(i=!1),void 0===o&&(o=ke.HANDLE_RESULT),void 0===a&&(a=ke.REJECT_ERROR),void 0===s&&(s=!1);var u=new ar(t,e,n,r,i,o,a,s);this._eventTypes.push(u),A(this,this,u)},e.prototype._getEvents=function(t){return(Ot(t)?this._eventTypes.filter(function(e){return e.hookPhase===t}):this._eventTypes.slice()).sort(function(t,e){var n=t.hookPhase-e.hookPhase;return 0===n?t.hookOrder-e.hookOrder:n})},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=qn(this),t.ignored=sr(this),t.invalid=ur(this),t.redirectTo=Fn(this),t.onExit=Un(this),t.onRetain=Mn(this),t.onEnter=Bn(this),t.eagerResolve=zn(this),t.lazyResolve=Qn(this),t.loadViews=Yn(this),t.activateViews=Xn(this),t.updateGlobals=er(this),t.updateUrl=rr(this),t.lazyLoad=or(this)},e}(),hr=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 me?(console.error(t.toString()),t.detail&&t.detail.stack&&console.error(t.detail.stack)):console.error(t)};var n=["current","$current","params","transition"],r=Object.keys(e.prototype).filter(mt(Yt(n)));h(Rt(e.prototype),this,Rt(this),r)}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(f),this.invalidCallbacks=[]},e.prototype._handleInvalidTargetState=function(t,e){function n(){var t=u.dequeue();return void 0===t?me.invalid(e.error()).toPromise():Lt.$q.when(t(e,i,c)).then(f).then(function(t){return t||n()})}var r=this,i=Ae.makeTargetState(this.router.stateRegistry,t),o=this.router.globals,a=function(){return o.transitionHistory.peekTail()},s=a(),u=new ye(this.invalidCallbacks.slice()),c=new Ge(t).injector(),f=function(t){if(t instanceof Ce){var e=t;return e=r.target(e.identifier(),e.params(),e.options()),e.valid()?a()!==s?me.superseded().toPromise():r.transitionTo(e.identifier(),e.params(),e.options()):me.invalid(e.error()).toPromise()}};return n()},e.prototype.onInvalid=function(t){return this.invalidCallbacks.push(t),function(){Zt(this.invalidCallbacks)(t)}.bind(this)},e.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:!Ot(t)||t,inherit:!1,notify:!1})},e.prototype.go=function(t,e,n){var r={relative:this.$current,inherit:!0},i=v(n,r,cr);return this.transitionTo(t,e,i)},e.prototype.target=function(t,e,n){if(void 0===n&&(n={}),Vt(n.reload)&&!n.reload.name)throw new Error("Invalid reload state object");var r=this.router.stateRegistry;if(n.reloadState=!0===n.reload?r.root():r.matcher.find(n.reload,n.relative),n.reload&&!n.reloadState)throw new Error("No such reload state '"+(jt(n.reload)?n.reload:n.reload.name)+"'");return new Ce(this.router.stateRegistry,t,e,n)},e.prototype.getCurrentPath=function(){var t=this,e=this.router.globals,n=e.successfulTransitions.peekTail();return n?n.treeChanges().to:function(){return[new Ve(t.router.stateRegistry.root())]}()},e.prototype.transitionTo=function(e,n,r){var i=this;void 0===n&&(n={}),void 0===r&&(r={});var o=this.router,a=o.globals;r=v(r,cr),r=Jt(r,{current:function(){return a.transition}});var s=this.target(e,n,r),u=this.getCurrentPath();if(!s.exists())return this._handleInvalidTargetState(u,s);if(!s.valid())return ve(s.error());var c=function(e){return function(n){if(n instanceof me){var r=o.globals.lastStartedTransitionId===e.$id;if(n.type===t.RejectType.IGNORED)return r&&o.urlRouter.update(),Lt.$q.when(a.current);var s=n.detail;if(n.type===t.RejectType.SUPERSEDED&&n.redirected&&s instanceof Ce){var u=e.redirect(s);return u.run().catch(c(u))}if(n.type===t.RejectType.ABORTED)return r&&o.urlRouter.update(),Lt.$q.reject(n)}return i.defaultErrorHandler()(n),Lt.$q.reject(n)}},f=this.router.transitionService.create(u,s),h=f.run().catch(c(f));return de(h),Jt(h,{transition:f})},e.prototype.is=function(t,e,n){n=v(n,{relative:this.$current});var r=this.router.stateRegistry.matcher.find(t,n.relative);if(Ot(r)){if(this.$current!==r)return!1;if(!e)return!0;var i=r.parameters({inherit:!0,matchingKeys:e});return je.equals(i,je.values(i,e),this.params)}},e.prototype.includes=function(t,e,n){n=v(n,{relative:this.$current});var r=jt(t)&&St.fromString(t);if(r){if(!r.matches(this.$current.name))return!1;t=this.$current.name}var i=this.router.stateRegistry.matcher.find(t,n.relative),o=this.$current.includes;if(Ot(i)){if(!Ot(o[i.name]))return!1;if(!e)return!0;var a=i.parameters({inherit:!0,matchingKeys:e});return je.equals(a,je.values(a,e),this.params)}},e.prototype.href=function(t,e,n){n=v(n,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),e=e||{};var r=this.router.stateRegistry.matcher.find(t,n.relative);if(!Ot(r))return null;n.inherit&&(e=this.params.$inherit(e,this.$current,r));var i=r&&n.lossy?r.navigable:r;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,e,{absolute:n.absolute}):null},e.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},e.prototype.get=function(t,e){var n=this.router.stateRegistry;return 0===arguments.length?n.get():n.get(t,e||this.$current)},e.prototype.lazyLoad=function(t,e){var n=this.get(t);if(!n||!n.lazyLoad)throw new Error("Can not lazy load "+t);var r=this.getCurrentPath(),i=Ae.makeTargetState(this.router.stateRegistry,r);return e=e||this.router.transitionService.create(r,i),ut(e,n)},e}(),pr={when:function(t){return new Promise(function(e,n){return e(t)})},reject:function(t){return new Promise(function(e,n){n(t)})},defer:function(){var t={};return t.promise=new Promise(function(e,n){t.resolve=e,t.reject=n}),t},all:function(t){if(At(t))return Promise.all(t);if(Vt(t)){var e=Object.keys(t).map(function(e){return t[e].then(function(t){return{key:e,val:t}})});return pr.all(e).then(function(t){return t.reduce(function(t,e){return t[e.key]=e.val,t},{})})}}},lr={},dr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,vr=/([^\s,]+)/g,yr={get:function(t){return lr[t]},has:function(t){return null!=yr.get(t)},invoke:function(t,e,n){var r=Jt({},lr,n||{}),i=yr.annotate(t),o=he(function(t){return r.hasOwnProperty(t)},function(t){return"DI can't find injectable: '"+t+"'"}),a=i.filter(o).map(function(t){return r[t]});return Ht(t)?t.apply(e,a):t.slice(-1)[0].apply(e,a)},annotate:function(t){if(!u(t))throw new Error("Not an injectable function: "+t);if(t&&t.$inject)return t.$inject;if(At(t))return t.slice(0,-1);var e=t.toString().replace(dr,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(vr)||[]}},gr=function(t,e){var n=e[0],r=e[1];return t.hasOwnProperty(n)?At(t[n])?t[n].push(r):t[n]=[t[n],r]:t[n]=r,t},mr=function(t){return t.split("&").filter(c).map(en).reduce(gr,{})},_r=function(t){var e=t.path(),n=t.search(),r=t.hash(),i=Object.keys(n).map(function(t){var e=n[t];return(At(e)?e:[e]).map(function(e){return t+"="+e})}).reduce(ae,[]).join("&");return e+(i?"?"+i:"")+(r?"#"+r:"")},wr=lt(),br=function(){function t(t,e){var n=this;this.fireAfterUpdate=e,this._listener=function(t){return n._listeners.forEach(function(e){return e(t)})},this._listeners=[],this.hash=function(){return ht(n._get()).hash},this.path=function(){return ht(n._get()).path},this.search=function(){return mr(ht(n._get()).search)},this._location=self&&self.location,this._history=self&&self.history}return t.prototype.url=function(t,e){if(void 0===e&&(e=!0),Ot(t)&&t!==this._get()&&(this._set(null,null,t,e),this.fireAfterUpdate)){var n=Jt(new wr("locationchange"),{url:t});this._listeners.forEach(function(t){return t(n)})}return _r(this)},t.prototype.onChange=function(t){var e=this;return this._listeners.push(t),function(){return Zt(e._listeners,t)}},t.prototype.dispose=function(t){te(this._listeners)},t}(),Er=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Rr=function(t){function e(e){var n=t.call(this,e,!1)||this;return self.addEventListener("hashchange",n._listener,!1),n}return Er(e,t),e.prototype._get=function(){return nn(this._location.hash)},e.prototype._set=function(t,e,n,r){this._location.hash=n},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),self.removeEventListener("hashchange",this._listener)},e}(br),Sr=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tr=function(t){function e(e){return t.call(this,e,!0)||this}return Sr(e,t),e.prototype._get=function(){return this._url},e.prototype._set=function(t,e,n,r){this._url=n},e}(br),Cr=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pr=function(t){function e(e){var n=t.call(this,e,!0)||this;return n._config=e.urlService.config,self.addEventListener("popstate",n._listener,!1),n}return Cr(e,t),e.prototype._getBasePrefix=function(){return Ze(this._config.baseHref())},e.prototype._get=function(){var t=this._location,e=t.pathname,n=t.hash,r=t.search;r=tn(r)[1],n=Xe(n)[1];var i=this._getBasePrefix(),o=e===this._config.baseHref(),a=e.startsWith(i);return(e=o?"/":a?e.substring(i.length):e)+(r?"?"+r:"")+(n?"#"+n:"")},e.prototype._set=function(t,e,n,r){var i=this._getBasePrefix()+n;r?this._history.replaceState(t,e,i):this._history.pushState(t,e,i)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),self.removeEventListener("popstate",this._listener)},e}(br),kr=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 Ot(e)?t._hashPrefix=e:t._hashPrefix},this.dispose=f}return t}(),Or=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.hostname},t.prototype.html5Mode=function(){return this._isHtml5},t.prototype.hashPrefix=function(t){return Ot(t)?this._hashPrefix=t:this._hashPrefix},t.prototype.baseHref=function(t){return Ot(t)?this._baseHref=t:Ot(this._baseHref)?this._baseHref:this.applyDocumentBaseHref()},t.prototype.applyDocumentBaseHref=function(){var t=document.getElementsByTagName("base")[0];return this._baseHref=t?t.href.substr(location.origin.length):""},t.prototype.dispose=function(){},t}(),$r=pt("vanilla.hashBangLocation",!1,Rr,Or),xr=pt("vanilla.pushStateLocation",!0,Pr,Or),Hr=pt("vanilla.memoryLocation",!1,Tr,kr),Ir=function(){function t(){}return t.prototype.dispose=function(t){},t}();t.fromJson=Bt,t.toJson=Wt,t.forEach=zt,t.extend=Jt,t.equals=Qt,t.identity=c,t.noop=f,t.createProxyFunctions=h,t.inherit=Kt,t.inArray=Yt,t._inArray=p,t.removeFrom=Zt,t._removeFrom=l,t.pushTo=Xt,t._pushTo=d,t.deregAll=te,t.defaults=v,t.mergeR=ee,t.ancestors=y,t.pick=g,t.omit=m,t.pluck=_,t.filter=w,t.find=b,t.mapObj=ne,t.map=E,t.values=re,t.allTrueR=ie,t.anyTrueR=oe,t.unnestR=ae,t.flattenR=se,t.pushR=R,t.uniqR=ue,t.unnest=ce,t.flatten=fe,t.assertPredicate=he,t.assertMap=pe,t.assertFn=S,t.pairs=le,t.arrayTuples=T,t.applyPairs=C,t.tail=P,t.copy=k,t._extend=$,t.silenceUncaughtInPromise=de,t.silentRejection=ve,t.notImplemented=Ut,t.services=Lt,t.Glob=St,t.curry=e,t.compose=n,t.pipe=r,t.prop=vt,t.propEq=yt,t.parse=gt,t.not=mt,t.and=i,t.or=o,t.all=_t,t.any=wt,t.is=bt,t.eq=Et,t.val=Rt,t.invoke=a,t.pattern=s,t.isUndefined=kt,t.isDefined=Ot,t.isNull=$t,t.isNullOrUndefined=xt,t.isFunction=Ht,t.isNumber=It,t.isString=jt,t.isObject=Vt,t.isArray=At,t.isDate=qt,t.isRegExp=Nt,t.isState=Ft,t.isInjectable=u,t.isPromise=Dt,t.Queue=ye,t.maxLength=M,t.padString=G,t.kebobString=B,t.functionToString=W,t.fnToString=z,t.stringify=J,t.beforeAfterSubstr=Ke,t.hostRegex=Ye,t.stripFile=Ze,t.splitHash=Xe,t.splitQuery=tn,t.splitEqual=en,t.trimHashVal=nn,t.splitOnDelim=Q,t.joinNeighborsR=K,t.Trace=Se,t.trace=Te,t.Param=je,t.ParamTypes=rn,t.StateParams=an,t.ParamType=xe,t.PathNode=Ve,t.PathUtils=Ae,t.resolvePolicies=Fe,t.defaultResolvePolicy=qe,t.Resolvable=Ne,t.NATIVE_INJECTOR_TOKEN=Me,t.ResolveContext=Ge,t.resolvablesBuilder=nt,t.StateBuilder=hn,t.StateObject=Tt,t.StateMatcher=pn,t.StateQueueManager=ln,t.StateRegistry=dn,t.StateService=hr,t.TargetState=Ce,t.HookBuilder=$e,t.matchState=V,t.RegisteredHook=Oe,t.makeEvent=A,t.Rejection=me,t.Transition=ze,t.TransitionHook=ke,t.TransitionEventType=ar,t.defaultTransOpts=cr,t.TransitionService=fr,t.UrlMatcher=gn,t.UrlMatcherFactory=mn,t.UrlRouter=Tn,t.UrlRuleFactory=_n,t.BaseUrlRule=wn,t.UrlService=jn,t.ViewService=Cn,t.UIRouterGlobals=Pn,t.UIRouter=An,t.$q=pr,t.$injector=yr,t.BaseLocationServices=br,t.HashLocationService=Rr,t.MemoryLocationService=Tr,t.PushStateLocationService=Pr,t.MemoryLocationConfig=kr,t.BrowserLocationConfig=Or,t.keyValsToObjectR=gr,t.getParams=mr,t.parseUrl=ht,t.buildUrl=_r,t.locationPluginFactory=pt,t.getCustomEventCtor=lt,t.servicesPlugin=dt,t.hashLocationPlugin=$r,t.pushStateLocationPlugin=xr,t.memoryLocationPlugin=Hr,t.UIRouterPluginBase=Ir,Object.defineProperty(t,"__esModule",{value:!0})});
  //# sourceMappingURL=ui-router-core.min.js.map
  