text: !function(n,e){function r(){return n.invalidate(),!1}function t(n,r){var t=e.location;r?(j=n,t.hash=n.substring(1),O++):t.href=n}function a(n,r){var t=e.location;r?(j=n,t.replace(t.pathname+t.search+n)):t.replace(n)}function i(){O--,e.history.back()}function u(n){return encodeURIComponent(n).replace(/%20/g,"+")}function l(n){return decodeURIComponent(n.replace(/\+/g," "))}function o(n){return(n+"").split("/").map(u).join("/")}function c(n){if(!(n in T)){var e=[],r=n.replace(I,function(n,r){return r?(e.push(r),"([^/?#]+)"):"*"===n?(e.push("splat"),"(.*?)"):"\\"+n});T[n]={matcher:RegExp("^"+r+"$","i"),paramNames:e}}return T[n]}function f(n,e){var r=c(n),t=l(e).match(r.matcher);if(!t)return null;for(var a={},i=r.paramNames,u=i.length,o=0;u>o;o++)a[i[o]]=t[o+1];return a}function s(n,e){e=e||{};var r=0;return n.replace(M,function(t,a){if(a=a||"splat","?"!==a.slice(-1)){if(null==e[a])throw Error('Missing "'+a+'" parameter for path "'+n+'"')}else if(a=a.slice(0,-1),null==e[a])return"";var i;if("splat"===a&&Array.isArray(e[a])){if(i=e[a][r++],null==i)throw Error("Missing splat # "+r+' for path "'+n+'"')}else i=e[a];return o(i)})}function p(n,e,r){for(var t,a,i,u=e.length,l=0;u>l;l++){var o=e[l];if(o.isNotFound)t=o;else if(o.isDefault)a=o;else{if(o.children){var c=p(n,o.children,r);if(c)return c.push(o),c}if(o.url&&(i=f(o.url,n)))return r.p=i,[o]}}return a&&(i=f(a.url,n))?(r.p=i,[a]):t&&(i=f(t.url,n))?(r.p=i,[t]):null}function d(n){return!J.test(n)}function h(n){return"/"===n[0]}function v(){return null}function m(n){for(;n>=G.length;)G.push(function(n,e){return function(r){r&&(n[e]=r)}}(q,n));return G[n]}function g(){var r=e.location.hash,t=r.substr(1);h(t)||(t="/"+t);var a={p:{}},i=p(t,_,a)||[];if(K?(K=!1,L={inApp:!0,type:2,name:null,params:null},S=-1,j=r):!L&&i.length>0&&r!=j&&Z(D(i[0].name,a.p)),L&&2===L.type&&0>S)return L.inApp=!0,null==L.name&&i.length>0&&(L.name=i[0].name,L.params=a.p,F()),null;if(null==L){for(U=i;q.length>U.length;)q.pop();for(;q.length<U.length;)q.push(null);H=a.p}for(var u=v,l=0;l<U.length;l++)!function(e,r,t,a){u=function(i){var u=r.data||{};n.assign(u,i),u.activeRouteHandler=e,u.routeParams=t;var l,o=r.handler;return l="function"==typeof o?o(u):{key:void 0,ref:void 0,data:u,component:o},l.key=r.keyBuilder?r.keyBuilder(t):r.name,l.ref=m(a),l}}(u,U[l],H,l);return u()}function y(n,e){return h(e)?e:"/"===n[n.length-1]?n+e:n+"/"+e}function A(n,e){for(var r=e.length,t=0;r>t;t++){var a=e[t],i=n,u=a.name;u||"/"!==n?u&&(x[u]=a,i=y(i,u)):(u="root",a.name=u,x[u]=a),a.isDefault?i=n:a.isNotFound?i=y(n,"*"):a.url&&(i=y(n,a.url)),a.url=i,a.children&&A(i,a.children)}}function k(e){n.isArray(e)||(e=[e]),A("/",e),_=e,n.init(g)}function b(n,e){return{name:n.name,url:n.url,data:n.data,handler:n.handler,keyBuilder:n.keyBuilder,children:e}}function B(n){return{name:n.name,data:n.data,handler:n.handler,keyBuilder:n.keyBuilder,isDefault:!0}}function N(n){return{name:n.name,data:n.data,handler:n.handler,keyBuilder:n.keyBuilder,isNotFound:!0}}function R(n,e){if(e)for(var r in e)if(e.hasOwnProperty(r)&&H[r]!==e[r])return!1;for(var t=0,a=U.length;a>t;t++)if(U[t].name===n)return!0;return!1}function w(n,e){if(d(n)){var r=x[n];return"#"+s(r.url,e)}return n}function $(e,r,t){return e.data=e.data||{},e.data.active=R(r,t),e.data.url=w(r,t),e.data.transition=D(r,t),n.postEnhance(e,{render:function(n,e){e.attrs=e.attrs||{},"a"===e.tag&&(e.attrs.href=n.data.url),e.className=e.className||"",n.data.active&&(e.className+=" active")},onClick:function(n){return Z(n.data.transition),!0}}),e}function D(n,e){return{inApp:d(n),type:0,name:n,params:e||{}}}function E(n,e){return{inApp:d(n),type:1,name:n,params:e||{}}}function P(){return{inApp:O>0,type:2,name:null,params:{}}}function z(e){switch(e.type){case 0:t(w(e.name,e.params),e.inApp);break;case 1:a(w(e.name,e.params),e.inApp);break;case 2:i()}n.invalidate()}function F(){for(;;){if(S>=0&&S<U.length){var e=q[S];if(S++,!e)continue;var r=e.component;if(!r)continue;var a=r.canDeactivate;if(!a)continue;var i=a.call(r,e.ctx,L);return void Promise.resolve(i).then(function(n){if(n===!0);else{if(n===!1)return L=null,void(Q=null);Q=n}F()})["catch"](console.log.bind(console))}if(S==U.length){if(Q&&(L&&0==L.type&&t(w(L.name,L.params),L.inApp),L=Q,Q=null),S=-1,!L.inApp||2===L.type)return void z(L)}else{if(-1!==S){if(S===-2-C.length){if(Q){S=U.length;continue}return 2!==L.type?z(L):n.invalidate(),void(L=null)}if(Q){S=U.length;continue}var u=C[C.length+1+S];S--;var l=u.handler,r=null;if("function"==typeof l){var e=l({});if(!e)continue;r=e.component}else r=l;if(!r)continue;var a=r.canActivate;if(!a)continue;var i=a.call(r,L);return void Promise.resolve(i).then(function(n){if(n===!0);else{if(n===!1)return L=null,void(Q=null);Q=n}F()})["catch"](console.log.bind(console))}var o={p:{}};C=L.inApp?p(w(L.name,L.params).substring(1),_,o)||[]:[],S=-2}}}function Z(n){return null!=L?void(Q=n):(K=!1,L=n,S=0,void F())}n.addEvent("hashchange",10,r);var _,C,O=0,j="",x={},I=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g,M=/:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g,T={},U=[],H=Object.create(null),q=[],G=[],J=/\:|\//g,K=!0,L=null,Q=null,S=0;n.routes=k,n.route=b,n.routeDefault=B,n.routeNotFound=N,n.isRouteActive=R,n.urlOfRoute=w,n.createRedirectPush=D,n.createRedirectReplace=E,n.createBackTransition=P,n.runTransition=Z,n.link=$}(b,window);