(function(){var r,n;r=function(){function r(r){"function"==typeof r&&this.draw(r)}var n,t,e,a,o,u,i;return t=/:([\w\d]+)/g,i=/\*([\w\d]+)/g,a=function(r){var n,t;return n="([^/]+)",t=".*",o(r,n,t)},u=function(r){var n,t;return n="[^/]+",t="(.*)",o(r,n,t)},o=function(r,n,e){return r=r.replace(t,n).replace(i,e),RegExp("^"+r+"$","i")},n=function(r){var n,t,e,a;for(t=/[:|\*]([\w\d]+)/g,a=[];n=t.exec(r);)a.push(e=n[1]);return a},e=function(r){var n,t,e;if(t={},null!=r)for(e=/[\?&]([^=&]+)=?([^&$]+)?/g;n=e.exec(r);)t[n[1]]=n[2];return t},r.prototype.draw=function(r){return r.call(this)},r.prototype.map=function(r,n){var t;if(null==(t=this.mappings)&&(this.mappings=[]),"string"!=typeof r)throw Error("route must be a string");if("function"!=typeof n)throw Error("callback must be a function");return this.mappings.push({route:r,callback:n})},r.prototype.match=function(r,n){var t,e,a,o,u,i,p,l,c;for(l=this.mappings,c=[],i=0,p=l.length;p>i;i++){if(e=l[i],a=this.scan(r,e.route)){if(null!=n){o=n.params,delete n.params;for(t in n)u=n[t],a[t]=u;if(null!=o&&null==a.params)a.params=o;else for(t in o)u=o[t],a.params[t]=u}e.callback(a);break}c.push(void 0)}return c},r.prototype.matchLocation=function(r){var n,t,a;null==r&&(r=window.location),t={},null!=r.search&&(t.params=e(r.search));for(n in r)a=r[n],t[n]=a;return this.match(r.pathname,t)},r.prototype.scan=function(r,t,e){var o,i,p,l,c,s,f,m,h,d,g;if(null==e&&(e={}),s=e.param_regexp||a(t),e.param_regexp=s,!s.test(r))return!1;for(h=e.splat_regexp||u(t),e.splat_regexp=h,l=s.exec(r),m=h.exec(r),c=e.param_names||n(t),e.param_names=c,f={},o=d=0,g=c.length;g>d;o=++d)p=c[o],f[p]=l[o+1];return f.splats=m.slice(1),i={params:f}},r.prototype.namespace=function(r,n){var t,e;return e=this,t={map:function(n,t){return e.map(r+n,t)}},n.call(t)},r}(),n!==void 0&&null!==n?("undefined"!=typeof module&&null!==module&&null!=module.exports&&(n=module.exports=r),n.Cartograph=r):"function"==typeof define&&define.amd?define(function(){return r}):this.Cartograph=r}).call(this);
(function(){var r,n;r=function(){function r(r){"function"==typeof r&&this.draw(r)}var n,t,e,a,o,u,i;return t=/:([\w\d]+)/g,i=/\*/g,a=function(r){var n,t;return n="([^/]+)",t=".*",o(r,n,t)},u=function(r){var n,t;return n="[^/]+",t="(.*)",o(r,n,t)},o=function(r,n,e){return r=r.replace(t,n).replace(i,e),RegExp("^"+r+"$","i")},n=function(r){var n,t,e,a;for(t=/[:|\*]([\w\d]+)/g,a=[];n=t.exec(r);)a.push(e=n[1]);return a},e=function(r){var n,t,e;if(t={},null!=r)for(e=/[\?&]([^=&]+)=?([^&$]+)?/g;n=e.exec(r);)t[n[1]]=n[2];return t},r.prototype.draw=function(r){return r.call(this)},r.prototype.map=function(r,n){var t;if(null==(t=this.mappings)&&(this.mappings=[]),"string"!=typeof r)throw Error("route must be a string");if("function"!=typeof n)throw Error("callback must be a function");return this.mappings.push({route:r,callback:n})},r.prototype.match=function(r,n){var t,e,a,o,u,i,p,l,c;for(l=this.mappings,c=[],i=0,p=l.length;p>i;i++){if(e=l[i],a=this.scan(r,e.route)){if(null!=n){o=n.params,delete n.params;for(t in n)u=n[t],a[t]=u;if(null!=o&&null==a.params)a.params=o;else for(t in o)u=o[t],a.params[t]=u}e.callback(a);break}c.push(void 0)}return c},r.prototype.matchLocation=function(r){var n,t,a;null==r&&(r=window.location),t={},null!=r.search&&(t.params=e(r.search));for(n in r)a=r[n],t[n]=a;return this.match(r.pathname,t)},r.prototype.scan=function(r,t,e){var o,i,p,l,c,s,f,m,h,g,d;if(null==e&&(e={}),s=e.param_regexp||a(t),e.param_regexp=s,!s.test(r))return!1;for(h=e.splat_regexp||u(t),e.splat_regexp=h,l=s.exec(r),m=h.exec(r),c=e.param_names||n(t),e.param_names=c,f={},o=g=0,d=c.length;d>g;o=++g)p=c[o],f[p]=l[o+1];return f.splats=m.slice(1),i={params:f}},r.prototype.namespace=function(r,n){var t,e;return e=this,t={map:function(n,t){return e.map(r+n,t)}},n.call(t)},r}(),n!==void 0&&null!==n?("undefined"!=typeof module&&null!==module&&null!=module.exports&&(n=module.exports=r),n.Cartograph=r):"function"==typeof define&&define.amd?define(function(){return r}):this.Cartograph=r}).call(this);
update minified version