sogo/UI/WebServerResources/js/vendor/angular-ui-router.min.js
2019-10-03 01:13:07 -04:00

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