barbajs-1.0.0-alpha1/dist/router/barba-router.umd.min.js
dist/router/barba-router.umd.min.js
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t||self).barbaRouter=i()}(this,function(){return new(/*#__PURE__*/function(){function t(){this.name="@barba/router",this.version="2.1.11",this.barba=void 0,this.logger=void 0,this.routeNames=[],this.routesByName={}}var i=t.prototype;return i.install=function(t,i){var n=this,e=(void 0===i?{}:i).routes,o=void 0===e?[]:e;this.logger=new t.Logger(this.name),this.logger.info(this.version),this.barba=t,o.forEach(function(t){var i=t.name,e=t.path,o=[],s=n.barba.helpers.pathToRegexp(e,o);n.routeNames.indexOf(i)>-1?console.warn("[@barba/router] Duplicated route name ("+i+")"):(n.routeNames.push(i),n.routesByName[i]={keys:o,path:e,regex:s})}),t.schemaPage.route=void 0},i.init=function(){this.barba.transitions.store.add("rule",{position:1,value:{name:"route",type:"object"}}),this.barba.hooks.page(this.resolveRoutes,this),this.barba.hooks.reset(this.resolveRoutes,this)},i.resolveUrl=function(t){for(var i=this,n=this.barba.url.parse(t).path,e={name:"",params:{}},o=function(){var t=i.routeNames[s],o=i.routesByName[t],r=o.keys,u=o.regex.exec(n);if(null!==u)return e.name=t,r.forEach(function(t,i){e.params[t.name]=u[i+1]}),{v:e}},s=0,r=this.routeNames.length;s<r;s++){var u=o();if("object"==typeof u)return u.v}return null},i.resolveRoutes=function(t){var i=t.current,n=t.next;i.route=i.url.href?this.resolveUrl(i.url.href):void 0,n.route=n.url.href?this.resolveUrl(n.url.href):void 0},t}())});
