/** * 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;ethis._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 "+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.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 "+(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 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 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;nr.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("")},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+">"},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