Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
Maintainers
1
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-router - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

lib/directives/link.js

4

dist/vue-router.min.js
/*!
* vue-router v0.5.0
* vue-router v0.5.1
* (c) 2015 Evan You
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),o=n(5);o.install=function(t){return o.installed?void r.warn("already installed."):(n(9)(t,o),n(10)(t,o),n(14)(t),n(15)(t),n(16)(t),r.Vue=t,void(o.installed=!0))},window.Vue&&o.install(window.Vue),t.exports=o},function(t,e,n){function r(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var o=n(2),i=o.prototype.generateQueryString;e.warn=function(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))},e.resolvePath=function(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")},e.isPromise=function(t){return t&&"function"==typeof t.then},e.getRouteConfig=function(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]};var a;e.resolveAsyncComponent=function(t,n){a?a.$options.components._=t.component:a={resolve:e.Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},a.resolve("_",function(e){t.component=e,n(e)})},e.mapParams=function(t,e,n){for(var o in e)t=r(t,e,o);return n&&(t+=i(n)),t}},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function i(t){this.routes={},this.children={},this.target=t}function a(t,e,n){return function(r,i){var s=t+r;return i?void i(a(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,i=t.length;i>o;o++)r+=t[o].path.length;e=e.substr(r);var a={path:e,handler:n};t.push(a)}function h(t,e,n,r){var o=e.routes;for(var i in o)if(o.hasOwnProperty(i)){var a=t.slice();s(a,i,o[i]),e.children[i]?h(a,e.children[i],n,r):n.call(r,a)}}function u(t){return"[object Array]"===Object.prototype.toString.call(t)}function c(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var i=0,a=r.length;a>i;i++){var s,h=r[i];(s=h.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=h.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===h?(o.push(new d),n.val+="1"):(o.push(new c(h)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function m(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];n=n.concat(i.match(e))}return n}function _(t){this.queryParams=t||{}}function y(t,e,n){for(var r=t.handlers,o=t.regex,i=e.match(o),a=1,s=new _(n),h=0,u=r.length;u>h;h++){for(var c=r[h],l=c.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=i[a++];s.push({handler:c.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},i.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new i(e);this.children[t]=o;var s=a(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var C=function(t,e){var n=new i;t(a("",n,this.delegate)),h([],n,function(t){e?e(this,t):this.add(t)},this)},x=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],R=new RegExp("(\\"+x.join("|\\")+")","g");c.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(R,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],i=o.charSpec.validChars===t.validChars;if(i=i&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,i=[],a=0,s=o.length;s>a;a++)e=o[a],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&i.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&i.push(e);return i}};var $=Object.create||function(t){function e(){}return e.prototype=t,new e};_.prototype=$({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var P=function(){this.rootState=new v,this.names={}};P.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",i={},a=[],s=[],h=!0,u=0,c=t.length;c>u;u++){var l=t[u],f=[],v=p(l.path,f,i);s=s.concat(v);for(var g=0,m=v.length;m>g;g++){var _=v[g];_ instanceof d||(h=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,_),o+=_.regex())}var y={handler:l.handler,names:f};a.push(y)}h&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=a,r.regex=new RegExp(o+"$"),r.specificity=i,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:a})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,i=0,a=o.length;a>i;i++){var s=o[i];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var i=0,a=r.length;a>i;i++){o=r[i];var s=t[o];if(null!=s){var h=encodeURIComponent(o);if(u(s))for(var c=0,l=s.length;l>c;c++){var f=o+"[]="+encodeURIComponent(s[c]);n.push(f)}else h+="="+encodeURIComponent(s),n.push(h)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,i=e[r].split("="),a=b(i[0]),s=a.length,h=!1;1===i.length?o="true":(s>2&&"[]"===a.slice(s-2)&&(h=!0,a=a.slice(0,s-2),n[a]||(n[a]=[])),o=i[1]?b(i[1]):""),h?n[a].push(o):n[a]=o}return n},recognize:function(t){var e,n,r,o,i=[this.rootState],a={},s=!1;if(o=t.indexOf("?"),-1!==o){var h=t.substr(o+1,t.length);t=t.substr(0,o),a=this.parseQueryString(h)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(i=m(i,t.charAt(n)),i.length);n++);var u=[];for(n=0,r=i.length;r>n;n++)i[n].handlers&&u.push(i[n]);i=g(u);var c=u[0];return c&&c.handlers?(s&&"(.+)$"===c.regex.source.slice(-5)&&(t+="/"),y(c,t,a)):void 0}},P.prototype.map=C,P.VERSION="0.1.9";var A=P;n(4).amd?(r=function(){return A}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=A:"undefined"!=typeof this&&(this.RouteRecognizer=A)}).call(this)}).call(e,n(3)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){function r(t){if(!r.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");t=t||{},this.app=null,this._views=[],this._children=[],this._recognizer=new o,this._guardRecognizer=new o,this._started=!1,this._currentRoute={},this._currentTransition=null,this._notFoundHandler=null,this._beforeEachHook=null,this._hasPushState="undefined"!=typeof history&&history.pushState,this._rendered=!1,this._transitionOnLoad=t.transitionOnLoad,this._abstract=!!t["abstract"],this._hashbang=t.hashbang!==!1,this._history=!(!this._hasPushState||!t.history),this._saveScrollPosition=!!t.saveScrollPosition,this._linkActiveClass=t.linkActiveClass||"v-link-active",this._suppress=!!t.suppressTransitionError,this.mode=this._abstract?"abstract":this._history?"html5":"hash";var e=i[this.mode],n=this;this.history=new e({root:t.root,hashbang:this._hashbang,onChange:function(t,e,r){n._match(t,e,r)}})}var o=n(2),i={"abstract":n(6),hash:n(7),html5:n(8)};r.installed=!1,t.exports=r},function(t,e,n){function r(t){this.onChange=t.onChange,this.currentPath="/"}var o=n(1),i=r.prototype;i.start=function(){this.onChange("/")},i.stop=function(){},i.go=function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)},i.formatPath=function(t){return"/"===t.charAt(0)?t:o.resolvePath(this.currentPath,t)},t.exports=r},function(t,e,n){function r(t){this.hashbang=t.hashbang,this.onChange=t.onChange}var o=n(1),i=r.prototype;i.start=function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()},i.stop=function(){window.removeEventListener("hashchange",this.listener)},i.go=function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t},i.formatPath=function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+o.resolvePath(location.hash.replace(/^#!?/,""),t)},t.exports=r},function(t,e,n){function r(t){var e=t.root;e?("/"!==e.charAt(0)&&(e="/"+e),this.root=e.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=t.onChange;var n=document.querySelector("base");this.base=n&&n.getAttribute("href")}var o=n(1),i=/#.*$/,a=r.prototype;a.start=function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);this.root&&(n=n.replace(this.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()},a.stop=function(){window.removeEventListener("popstate",this.listener)},a.go=function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(i),a=o&&o[0];t=r.replace(i,"").replace(this.rootRE,""),this.onChange(t,null,a)},a.formatPath=function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:o.resolvePath(this.base||location.pathname,t)},t.exports=r},function(t,e,n){var r=n(1);t.exports=function(t,e){var n=e.prototype;n.map=function(t){for(var e in t)this.on(e,t[e])},n.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},n.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},n.alias=function(t){for(var e in t)this._addAlias(e,t[e])},n.beforeEach=function(t){this._beforeEachHook=t},n.go=function(t,e){this.history.go(t+"",e)},n.replace=function(t){this.go(t,!0)},n.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},n.stop=function(){this.history.stop(),this._started=!1}}},function(t,e,n){var r=n(1),o=n(11),i=n(12);t.exports=function(t,e){function n(e){var n=e.component;a.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,r.warn('invalid component for route "'+e.path+'"'))}var a=t.util,s=e.prototype;s._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r),e.subRoutes)for(var o in e.subRoutes)if("*"!==o)this._addRoute(o,e.subRoutes[o],r.slice());else{var i=e.subRoutes[o];n(i),e.defaultChildHandler=i}},s._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},s._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},s._addAlias=function(t,e){this._addGuard(t,e,this._match)},s._addGuard=function(t,e,n){var o=this;this._guardRecognizer.add([{path:t,handler:function(t,i){var a=r.mapParams(e,t.params,i);n.call(o,a)}}])},s._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},s._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var a=this._currentRoute,s=this._currentTransition;if(s&&t!==s.to.path&&(s.aborted=!0),!s||t!==a.path){var h=new o(t,this),u=this._currentTransition=new i(this,h,a);this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:h}}));var c=this._beforeEachHook,l=function(){u.start(function(){r._postTransition(h,e,n)})};c?u.callHook(c,null,l,!0):l(),this._rendered=!0}}},s._updateRoute=function(t){this._currentRoute=t,this.app.$route!==t&&(this.app.$route=t,this._children.forEach(function(e){e.$route=t}))},s._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})}}},function(t,e){function n(t,e){this.path=t;var n=e._recognizer.recognize(t);this.query=n?n.queryParams:{},this.params=n?[].reduce.call(n,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{}):{},this._aborted=!1,r(this,"_matched",n||e._notFoundHandler),r(this,"_router",e)}function r(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1})}t.exports=n},function(t,e,n){function r(t,e,n){this.router=t,this.to=e,this.from=n,this.next=null,this.aborted=!1,this.deactivateQueue=t._views;var r=e._matched?Array.prototype.slice.call(e._matched):[],o=r[r.length-1];o&&o.handler.defaultChildHandler&&r.push({handler:o.handler.defaultChildHandler}),this.activateQueue=r.map(function(t){return t.handler})}var o=n(1),i=n(13),a=r.prototype;a.abort=function(){this.aborted||(this.aborted=!0,this.router.replace(this.from.path||"/"))},a.redirect=function(t){this.aborted||(this.aborted=!0,t=o.mapParams(t,this.to.params,this.to.query),this.router.replace(t))},a.start=function(t){for(var e,n=this,r=this.deactivateQueue,o=this.activateQueue,a=r.slice().reverse(),s=0;s<a.length&&i.canReuse(a[s],o[s],n);s++);s>0&&(e=a.slice(0,s),r=a.slice(s).reverse(),o=o.slice(s)),n.runQueue(r,i.canDeactivate,function(){n.runQueue(o,i.canActivate,function(){n.runQueue(r,i.deactivate,function(){if(n.router._updateRoute(n.to),e&&e.forEach(function(t){i.reuse(t,n)}),r.length){var o=r[r.length-1],a=e?e.length:0;i.activate(o,n,a,t)}else t()})})})},a.runQueue=function(t,e,n){function r(i){i>=t.length?n():e(t[i],o,function(){r(i+1)})}var o=this;r(0)},a.callHook=function(t,e,n,r,i){var a,s=this,h=!1,u=function(t){return h?void o.warn("transition.next() should be called only once."):(h=!0,void(n&&!s.aborted&&n(t)))},c=function(){i&&i(),s.abort()},l=function(t){if(i?u():c(),t&&!s.router._suppress)throw o.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},f={to:s.to,from:s.from,abort:c,next:u,redirect:function(){s.redirect.apply(s,arguments)}};try{a=t.call(e,f)}catch(d){return l(d)}var p=o.isPromise(a);r?"boolean"==typeof a?a?u():c():p&&a.then(function(t){t?u():c()},l):p&&a.then(u,l)},t.exports=r},function(t,e,n){function r(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e){for(var n in e)t.$set(n,e[n]);t.$loadingRouteData=!1,r&&r(e)},!1,o)}var o=n(1);e.canReuse=function(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var i=o.getRouteConfig(r,"canReuse");return"boolean"==typeof i?i:i?i.call(r,{to:n.to,from:n.from}):!0},e.canDeactivate=function(t,e,n){var r=t.childVM,i=o.getRouteConfig(r,"canDeactivate");i?e.callHook(i,r,n,!0):n()},e.canActivate=function(t,e,n){o.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=o.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,!0):n()}})},e.deactivate=function(t,e,n){var r=t.childVM,i=o.getRouteConfig(r,"deactivate");i?e.callHook(i,r,n):n()},e.activate=function(t,n,i,a){var s=n.activateQueue[i];if(!s)return t.setComponent(null),void(a&&a());var h=t.Component=s.component,u=o.getRouteConfig(h,"activate"),c=o.getRouteConfig(h,"data"),l=o.getRouteConfig(h,"waitForData");t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!c||l)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent(f),f.$before(t.anchor,null,!1)),a&&a()},v=function(){t.childView&&e.activate(t.childView,n,i+1),c&&l?r(f,n,c,p,d):(c&&r(f,n,c),p())};u?n.callHook(u,f,v,!1,d):v()},e.reuse=function(t,e){var n=t.childVM,i=o.getRouteConfig(n,"data");i&&r(n,e,i)}},function(t,e,n){t.exports=function(t){var e=t.util,r=n(1),o=t.directive("_component"),i=e.extend({},o);e.extend(i,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,o.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive."));var e=this.router=t._router;e._views.unshift(this);var n=e._views[1];n&&(n.childView=this)},unbind:function(){this.router._views.$remove(this),o.unbind.call(this)}}),t.elementDirective("router-view",i)}},function(t,e,n){t.exports=function(t){var e=t.util,r=n(1);t.directive("link",{isLiteral:!0,bind:function(){var t=this.vm;if(!t.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var n=this,o=t.$route._router;this.handler=function(t){0===t.button&&(t.preventDefault(),null!=n.destination&&o.go(n.destination))},this.el.addEventListener("click",this.handler),this._isDynamicLiteral||this.update(this.expression),this.unwatch=t.$watch("$route.path",e.bind(this.updateClasses,this))},updateClasses:function(t){var n=this.el,r=this.destination,o=this.vm.$route._router,i=o._linkActiveClass,a=i+"-exact";0===t.indexOf(r)?e.addClass(n,i):e.removeClass(n,i),t===r?e.addClass(n,a):e.removeClass(n,a)},update:function(t){this.destination=t,this.updateClasses(this.vm.$route.path),t=t||"";var e=this.vm.$route._router,n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})}},function(t,e){t.exports=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r._router;if(o){t=t||{};var i=t._meta=t._meta||{};i.$route=r,t._isRouterView&&(i.$loadingRouteData=i.$loadingRouteData||!1)}var a=e.call(this,t,n);return o&&(o._children.push(a),a.$on("hook:beforeDestroy",function(){o._children.$remove(a)})),a}}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(6),a=r(i);a["default"].install=function(t){return a["default"].installed?void o.warn("already installed."):(n(15)(t,a["default"]),n(16)(t,a["default"]),n(20)(t),n(21)(t),n(22)(t),a["default"].Vue=t,void(a["default"].installed=!0))},"undefined"!=typeof window&&window.Vue&&a["default"].install(window.Vue),e["default"]=a["default"],t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";function r(t,e){window.console&&(console.warn("[vue-router] "+t),e&&console.warn(e.stack))}function o(t,e){var n=t.match(/(\?.*)$/);if(n&&(n=n[1],t=t.slice(0,-n.length)),"?"===e.charAt(0))return t+e;var r=t.split("/");r.pop();for(var o=e.split("/"),i=0;i<o.length;i++){var a=o[i];"."!==a&&(".."===a?r.pop():r.push(a))}return""!==r[0]&&r.unshift(""),r.join("/")}function i(t){return t&&"function"==typeof t.then}function a(t,e){var n=t&&(t.$options||t.options);return n&&n.route&&n.route[e]}function s(t,e){p?p.$options.components._=t.component:p={resolve:n(6).Vue.prototype._resolveComponent,$options:{components:{_:t.component}}},p.resolve("_",function(n){t.component=n,e(n)})}function u(t,e,n){for(var r in e)t=c(t,e,r);return n&&(t+=d(n)),t}function c(t,e,n){var r=new RegExp(":"+n+"(\\/|$)"),o=e[n];return t.replace(r,function(t){return"/"===t.charAt(t.length-1)?o+"/":o})}var h=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0}),e.warn=r,e.resolvePath=o,e.isPromise=i,e.getRouteConfig=a,e.resolveAsyncComponent=s,e.mapParams=u;var l=n(3),f=h(l),d=f["default"].prototype.generateQueryString,p=void 0},function(t,e,n){var r;(function(t){(function(){"use strict";function o(t,e,n){this.path=t,this.matcher=e,this.delegate=n}function i(t){this.routes={},this.children={},this.target=t}function a(t,e,n){return function(r,i){var s=t+r;return i?void i(a(s,e,n)):new o(t+r,e,n)}}function s(t,e,n){for(var r=0,o=0,i=t.length;i>o;o++)r+=t[o].path.length;e=e.substr(r);var a={path:e,handler:n};t.push(a)}function u(t,e,n,r){var o=e.routes;for(var i in o)if(o.hasOwnProperty(i)){var a=t.slice();s(a,i,o[i]),e.children[i]?u(a,e.children[i],n,r):n.call(r,a)}}function c(t){return"[object Array]"===Object.prototype.toString.call(t)}function h(t){this.string=t}function l(t){this.name=t}function f(t){this.name=t}function d(){}function p(t,e,n){"/"===t.charAt(0)&&(t=t.substr(1));var r=t.split("/"),o=[];n.val="";for(var i=0,a=r.length;a>i;i++){var s,u=r[i];(s=u.match(/^:([^\/]+)$/))?(o.push(new l(s[1])),e.push(s[1]),n.val+="3"):(s=u.match(/^\*([^\/]+)$/))?(o.push(new f(s[1])),n.val+="2",e.push(s[1])):""===u?(o.push(new d),n.val+="1"):(o.push(new h(u)),n.val+="4")}return n.val=+n.val,o}function v(t){this.charSpec=t,this.nextStates=[]}function g(t){return t.sort(function(t,e){return e.specificity.val-t.specificity.val})}function y(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];n=n.concat(i.match(e))}return n}function m(t){this.queryParams=t||{}}function _(t,e,n){for(var r=t.handlers,o=t.regex,i=e.match(o),a=1,s=new m(n),u=0,c=r.length;c>u;u++){for(var h=r[u],l=h.names,f={},d=0,p=l.length;p>d;d++)f[l[d]]=i[a++];s.push({handler:h.handler,params:f,isDynamic:!!l.length})}return s}function w(t,e){return e.eachChar(function(e){t=t.put(e)}),t}function b(t){return t=t.replace(/\+/gm,"%20"),decodeURIComponent(t)}o.prototype={to:function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}return this}},i.prototype={add:function(t,e){this.routes[t]=e},addChild:function(t,e,n,r){var o=new i(e);this.children[t]=o;var s=a(t,o,r);r&&r.contextEntered&&r.contextEntered(e,s),n(s)}};var C=function(t,e){var n=new i;t(a("",n,this.delegate)),u([],n,function(t){e?e(this,t):this.add(t)},this)},x=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],P=new RegExp("(\\"+x.join("|\\")+")","g");h.prototype={eachChar:function(t){for(var e,n=this.string,r=0,o=n.length;o>r;r++)e=n.charAt(r),t({validChars:e})},regex:function(){return this.string.replace(P,"\\$1")},generate:function(){return this.string}},l.prototype={eachChar:function(t){t({invalidChars:"/",repeat:!0})},regex:function(){return"([^/]+)"},generate:function(t){return t[this.name]}},f.prototype={eachChar:function(t){t({invalidChars:"",repeat:!0})},regex:function(){return"(.+)"},generate:function(t){return t[this.name]}},d.prototype={eachChar:function(){},regex:function(){return""},generate:function(){return""}},v.prototype={get:function(t){for(var e=this.nextStates,n=0,r=e.length;r>n;n++){var o=e[n],i=o.charSpec.validChars===t.validChars;if(i=i&&o.charSpec.invalidChars===t.invalidChars)return o}},put:function(t){var e;return(e=this.get(t))?e:(e=new v(t),this.nextStates.push(e),t.repeat&&e.nextStates.push(e),e)},match:function(t){for(var e,n,r,o=this.nextStates,i=[],a=0,s=o.length;s>a;a++)e=o[a],n=e.charSpec,"undefined"!=typeof(r=n.validChars)?-1!==r.indexOf(t)&&i.push(e):"undefined"!=typeof(r=n.invalidChars)&&-1===r.indexOf(t)&&i.push(e);return i}};var R=Object.create||function(t){function e(){}return e.prototype=t,new e};m.prototype=R({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var k=function(){this.rootState=new v,this.names={}};k.prototype={add:function(t,e){for(var n,r=this.rootState,o="^",i={},a=[],s=[],u=!0,c=0,h=t.length;h>c;c++){var l=t[c],f=[],v=p(l.path,f,i);s=s.concat(v);for(var g=0,y=v.length;y>g;g++){var m=v[g];m instanceof d||(u=!1,r=r.put({validChars:"/"}),o+="/",r=w(r,m),o+=m.regex())}var _={handler:l.handler,names:f};a.push(_)}u&&(r=r.put({validChars:"/"}),o+="/"),r.handlers=a,r.regex=new RegExp(o+"$"),r.specificity=i,(n=e&&e.as)&&(this.names[n]={segments:s,handlers:a})},handlersFor:function(t){var e=this.names[t],n=[];if(!e)throw new Error("There is no route named "+t);for(var r=0,o=e.handlers.length;o>r;r++)n.push(e.handlers[r]);return n},hasRoute:function(t){return!!this.names[t]},generate:function(t,e){var n=this.names[t],r="";if(!n)throw new Error("There is no route named "+t);for(var o=n.segments,i=0,a=o.length;a>i;i++){var s=o[i];s instanceof d||(r+="/",r+=s.generate(e))}return"/"!==r.charAt(0)&&(r="/"+r),e&&e.queryParams&&(r+=this.generateQueryString(e.queryParams,n.handlers)),r},generateQueryString:function(t,e){var n=[],r=[];for(var o in t)t.hasOwnProperty(o)&&r.push(o);r.sort();for(var i=0,a=r.length;a>i;i++){o=r[i];var s=t[o];if(null!=s){var u=encodeURIComponent(o);if(c(s))for(var h=0,l=s.length;l>h;h++){var f=o+"[]="+encodeURIComponent(s[h]);n.push(f)}else u+="="+encodeURIComponent(s),n.push(u)}}return 0===n.length?"":"?"+n.join("&")},parseQueryString:function(t){for(var e=t.split("&"),n={},r=0;r<e.length;r++){var o,i=e[r].split("="),a=b(i[0]),s=a.length,u=!1;1===i.length?o="true":(s>2&&"[]"===a.slice(s-2)&&(u=!0,a=a.slice(0,s-2),n[a]||(n[a]=[])),o=i[1]?b(i[1]):""),u?n[a].push(o):n[a]=o}return n},recognize:function(t){var e,n,r,o,i=[this.rootState],a={},s=!1;if(o=t.indexOf("?"),-1!==o){var u=t.substr(o+1,t.length);t=t.substr(0,o),a=this.parseQueryString(u)}for(t=decodeURI(t),"/"!==t.charAt(0)&&(t="/"+t),e=t.length,e>1&&"/"===t.charAt(e-1)&&(t=t.substr(0,e-1),s=!0),n=0,r=t.length;r>n&&(i=y(i,t.charAt(n)),i.length);n++);var c=[];for(n=0,r=i.length;r>n;n++)i[n].handlers&&c.push(i[n]);i=g(c);var h=c[0];return h&&h.handlers?(s&&"(.+)$"===h.regex.source.slice(-5)&&(t+="/"),_(h,t,a)):void 0}},k.prototype.map=C,k.VERSION="0.1.9";var $=k;n(5).amd?(r=function(){return $}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))):"undefined"!=typeof t&&t.exports?t.exports=$:"undefined"!=typeof this&&(this.RouteRecognizer=$)}).call(this)}).call(e,n(4)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e,n){"use strict";var r=n(7)["default"],o=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),a=o(i),s={"abstract":n(8),hash:n(13),html5:n(14)},u=function c(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=t.hashbang,n=void 0===e?!0:e,o=t["abstract"],i=void 0===o?!1:o,u=t.history,h=void 0===u?!1:u,l=t.saveScrollPosition,f=void 0===l?!1:l,d=t.transitionOnLoad,p=void 0===d?!1:d,v=t.suppressTransitionError,g=void 0===v?!1:v,y=t.root,m=void 0===y?null:y,_=t.linkActiveClass,w=void 0===_?"v-link-active":_;if(r(this,c),!c.installed)throw new Error("Please install the Router with Vue.use() before creating an instance.");this.app=null,this._views=[],this._children=[],this._recognizer=new a["default"],this._guardRecognizer=new a["default"],this._started=!1,this._currentRoute={},this._currentTransition=null,this._previousTransition=null,this._notFoundHandler=null,this._beforeEachHook=null,this._hasPushState="undefined"!=typeof window&&window.history&&window.history.pushState,this._rendered=!1,this._transitionOnLoad=p,this._abstract=i,this._hashbang=n,this._history=this._hasPushState&&h,this._saveScrollPosition=f,this._linkActiveClass=w,this._suppress=g;var b=c.Vue.util.inBrowser;this.mode=!b||this._abstract?"abstract":this._history?"html5":"hash";var C=s[this.mode],x=this;this.history=new C({root:m,hashbang:this._hashbang,onChange:function(t,e,n){x._match(t,e,n)}})};e["default"]=u,u.installed=!1,t.exports=e["default"]},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.onChange;o(this,t),this.onChange=n,this.currentPath="/"}return r(t,[{key:"start",value:function(){this.onChange("/")}},{key:"stop",value:function(){}},{key:"go",value:function(t){t=this.currentPath=this.formatPath(t),this.onChange(t)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?t:i.resolvePath(this.currentPath,t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(10)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(11),__esModule:!0}},function(t,e,n){var r=n(12);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=function(){function t(e){var n=e.hashbang,r=e.onChange;o(this,t),this.hashbang=n,this.onChange=r}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(){var e=location.hash,n=t.formatPath(e,!0);if(n!==e)return void location.replace(n);var r=decodeURI(e.replace(/^#!?/,"")+location.search);t.onChange(r)},window.addEventListener("hashchange",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("hashchange",this.listener)}},{key:"go",value:function(t,e){t=this.formatPath(t),e?location.replace(t):location.hash=t}},{key:"formatPath",value:function(t,e){t=t.replace(/^#!?/,"");var n="/"===t.charAt(0);e&&!n&&(t="/"+t);var r="#"+(this.hashbang?"!":"");return n||e?r+t:r+i.resolvePath(location.hash.replace(/^#!?/,""),t)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=/#.*$/,s=function(){function t(e){var n=e.root,r=e.onChange;o(this,t),n?("/"!==n.charAt(0)&&(n="/"+n),this.root=n.replace(/\/$/,""),this.rootRE=new RegExp("^\\"+this.root)):this.root=null,this.onChange=r;var i=document.querySelector("base");this.base=i&&i.getAttribute("href")}return r(t,[{key:"start",value:function(){var t=this;this.listener=function(e){var n=decodeURI(location.pathname+location.search);this.root&&(n=n.replace(this.rootRE,"")),t.onChange(n,e&&e.state,location.hash)},window.addEventListener("popstate",this.listener),this.listener()}},{key:"stop",value:function(){window.removeEventListener("popstate",this.listener)}},{key:"go",value:function(t,e){var n=this.root,r=this.formatPath(t,n);e?history.replaceState({},"",r):(history.replaceState({pos:{x:window.pageXOffset,y:window.pageYOffset}},""),history.pushState({},"",r));var o=t.match(a),i=o&&o[0];t=r.replace(a,"").replace(this.rootRE,""),this.onChange(t,null,i)}},{key:"formatPath",value:function(t){return"/"===t.charAt(0)?this.root?this.root+"/"+t.replace(/^\//,""):t:i.resolvePath(this.base||location.pathname,t)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t,e){e.prototype.map=function(t){for(var e in t)this.on(e,t[e])},e.prototype.on=function(t,e){"*"===t?this._notFound(e):this._addRoute(t,e,[])},e.prototype.redirect=function(t){for(var e in t)this._addRedirect(e,t[e])},e.prototype.alias=function(t){for(var e in t)this._addAlias(e,t[e])},e.prototype.beforeEach=function(t){this._beforeEachHook=t},e.prototype.go=function(t,e){this.history.go(t+"",e)},e.prototype.replace=function(t){this.go(t,!0)},e.prototype.start=function(e,n){if(this._started)return void r.warn("already started.");if(this._started=!0,!this.app){if(!e||!n)throw new Error("Must start vue-router with a component and a root container.");this._appContainer=n,this._appConstructor="function"==typeof e?e:t.extend(e)}this.history.start()},e.prototype.stop=function(){this.history.stop(),this._started=!1}},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(1)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(17),a=r(i),s=n(18),u=r(s);e["default"]=function(t,e){function n(e){var n=e.component;r.isPlainObject(n)&&(n=e.component=t.extend(n)),"function"!=typeof n&&(e.component=null,o.warn('invalid component for route "'+e.path+'"'))}var r=t.util;e.prototype._addRoute=function(t,e,r){if(n(e),r.push({path:t,handler:e}),this._recognizer.add(r),e.subRoutes)for(var o in e.subRoutes)this._addRoute(o,e.subRoutes[o],r.slice())},e.prototype._notFound=function(t){n(t),this._notFoundHandler=[{handler:t}]},e.prototype._addRedirect=function(t,e){this._addGuard(t,e,this.replace)},e.prototype._addAlias=function(t,e){this._addGuard(t,e,this._match)},e.prototype._addGuard=function(t,e,n){var r=this;this._guardRecognizer.add([{path:t,handler:function(t,i){var a=o.mapParams(e,t.params,i);n.call(r,a)}}])},e.prototype._checkGuard=function(t){var e=this._guardRecognizer.recognize(t);return e?(e[0].handler(e[0],e.queryParams),!0):void 0},e.prototype._match=function(t,e,n){var r=this;if(!this._checkGuard(t)){var o=this._currentRoute,i=this._currentTransition;if(!i||t!==o.path){var s=new a["default"](t,this),c=new u["default"](this,s,o);this._prevTransition=i,this._currentTransition=c,this.app||(this.app=new this._appConstructor({el:this._appContainer,_meta:{$route:s}}));var h=this._beforeEachHook,l=function(){c.start(function(){r._postTransition(s,e,n)})};h?c.callHook(h,null,l,!0):l(),this._rendered=!0}}},e.prototype._onTransitionValidated=function(t){var e=this._prevTransition;e&&(e.aborted=!0);var n=this._currentRoute=t.to;this.app.$route!==n&&(this.app.$route=n,this._children.forEach(function(t){t.$route=n}))},e.prototype._postTransition=function(e,n,r){var o=n&&n.pos;o&&this._saveScrollPosition?t.nextTick(function(){window.scrollTo(o.x,o.y)}):r&&t.nextTick(function(){var t=document.getElementById(r.slice(1));t&&window.scrollTo(window.scrollX,t.offsetTop)})}},t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){i(t,e,{value:n,enumerable:!1})}var o=n(7)["default"],i=n(10)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=function s(t,e){o(this,s),this.path=t;var n=e._recognizer.recognize(t);this.query=n?n.queryParams:{},this.params=n?[].reduce.call(n,function(t,e){if(e.params)for(var n in e.params)t[n]=e.params[n];return t},{}):{},this._aborted=!1,r(this,"_matched",n||e._notFoundHandler),r(this,"_router",e)};e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(9)["default"],o=n(7)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(19),s=function(){function t(e,n,r){o(this,t),this.router=e,this.to=n,this.from=r,this.next=null,this.aborted=!1,this.deactivateQueue=e._views;var i=n._matched?Array.prototype.slice.call(n._matched):[];this.activateQueue=i.map(function(t){return t.handler})}return r(t,[{key:"abort",value:function(){if(!this.aborted){this.aborted=!0;var t=!this.from.path&&"/"===this.to.path;t||this.router.replace(this.from.path||"/")}}},{key:"redirect",value:function(t){this.aborted||(this.aborted=!0,t=i.mapParams(t,this.to.params,this.to.query),this.router.replace(t))}},{key:"start",value:function(t){var e=this,n=this.deactivateQueue,r=this.activateQueue,o=n.slice().reverse(),i=void 0,s=void 0;for(s=0;s<o.length&&a.canReuse(o[s],r[s],e);s++);s>0&&(i=o.slice(0,s),n=o.slice(s).reverse(),r=r.slice(s)),e.runQueue(n,a.canDeactivate,function(){e.runQueue(r,a.canActivate,function(){e.runQueue(n,a.deactivate,function(){if(e.router._onTransitionValidated(e),i&&i.forEach(function(t){a.reuse(t,e)}),n.length){var r=n[n.length-1],o=i?i.length:0;a.activate(r,e,o,t)}else t()})})})}},{key:"runQueue",value:function(t,e,n){function r(i){i>=t.length?n():e(t[i],o,function(){r(i+1)})}var o=this;r(0)}},{key:"callHook",value:function(t,e,n,r,o){var a=this,s=!1,u=function(t){return s?void i.warn("transition.next() should be called only once."):(s=!0,void(n&&!a.aborted&&n(t)))},c=function(t){o&&o(),a.abort(t)},h=function(t){if(o?u():c(),t&&!a.router._suppress)throw i.warn("Uncaught error during transition: "),t instanceof Error?t:new Error(t)},l={to:a.to,from:a.from,abort:c,next:u,redirect:function(){a.redirect.apply(a,arguments)}},f=void 0;try{f=t.call(e,l)}catch(d){return h(d)}var p=i.isPromise(f);r?"boolean"==typeof f?f?u():c():p&&f.then(function(t){t?u():c()},h):p&&f.then(u,h)}}]),t}();e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";function r(t,e,n){var r=t.childVM;if(!r||!e)return!1;if(t.Component!==e.component)return!1;var o=h.getRouteConfig(r,"canReuse");return"boolean"==typeof o?o:o?o.call(r,{to:n.to,from:n.from}):!0}function o(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"canDeactivate");o?e.callHook(o,r,n,!0):n()}function i(t,e,n){h.resolveAsyncComponent(t,function(t){if(!e.aborted){var r=h.getRouteConfig(t,"canActivate");r?e.callHook(r,null,n,!0):n()}})}function a(t,e,n){var r=t.childVM,o=h.getRouteConfig(r,"deactivate");o?e.callHook(o,r,n):n()}function s(t,n,r,o){var i=n.activateQueue[r];if(!i)return t.setComponent(null),void(o&&o());var a=t.Component=i.component,s=h.getRouteConfig(a,"activate"),u=h.getRouteConfig(a,"data"),l=h.getRouteConfig(a,"waitForData");t.unbuild(!0);var f=t.build({_meta:{$loadingRouteData:!(!u||l)}}),d=function(){f.$destroy()},p=function(){var e=n.router;e._rendered||e._transitionOnLoad?t.transition(f):(t.setCurrent(f),f.$before(t.anchor,null,!1)),o&&o()},v=function(){t.childView&&e.activate(t.childView,n,r+1),u&&l?c(f,n,u,p,d):(u&&c(f,n,u),p())};s?n.callHook(s,f,v,!1,d):v()}function u(t,e){var n=t.childVM,r=h.getRouteConfig(n,"data");r&&c(n,e,r)}function c(t,e,n,r,o){t.$loadingRouteData=!0,e.callHook(n,t,function(e){for(var n in e)t.$set(n,e[n]);t.$loadingRouteData=!1,r&&r(e)},!1,o)}Object.defineProperty(e,"__esModule",{value:!0}),e.canReuse=r,e.canDeactivate=o,e.canActivate=i,e.deactivate=a,e.activate=s,e.reuse=u;var h=n(2)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util,n=t.directive("_component"),o=e.extend({},n);e.extend(o,{_isRouterView:!0,bind:function(){var t=this.vm.$route;if(!t)return void r.warn("<router-view> can only be used inside a router-enabled app.");this._isDynamicLiteral=!0,n.bind.call(this),this.keepAlive&&(this.keepAlive=!1,r.warn("<router-view> does not support keep-alive."));var e=this.router=t._router;e._views.unshift(this);var o=e._views[1];o&&(o.childView=this)},unbind:function(){this.router._views.$remove(this),n.unbind.call(this)}}),t.elementDirective("router-view",o)},t.exports=e["default"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2);e["default"]=function(t){var e=t.util;t.directive("link",{isLiteral:!0,bind:function(){var t=this,n=this.vm;if(!n.$route)return void r.warn("v-link can only be used inside a router-enabled app.");var o=n.$route._router;this.handler=function(e){0===e.button&&(e.preventDefault(),null!=t.destination&&o.go(t.destination))},this.el.addEventListener("click",this.handler),this._isDynamicLiteral||this.update(this.expression),this.unwatch=n.$watch("$route.path",e.bind(this.updateClasses,this))},updateClasses:function(t){var n=this.el,r=this.destination,o=this.vm.$route._router,i=o._linkActiveClass,a=i+"-exact";0===t.indexOf(r)&&"/"!==t?e.addClass(n,i):e.removeClass(n,i),t===r?e.addClass(n,a):e.removeClass(n,a)},update:function(t){this.destination=t,this.updateClasses(this.vm.$route.path),t=t||"";var e=this.vm.$route._router,n="/"===t.charAt(0),r="hash"===e.mode||n?e.history.formatPath(t):t;"A"===this.el.tagName&&(r?this.el.href=r:this.el.removeAttribute("href"))},unbind:function(){this.el.removeEventListener("click",this.handler),this.unwatch&&this.unwatch()}})},t.exports=e["default"]},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t){var e=t.prototype.$addChild;t.prototype.$addChild=function(t,n){var r=this.$route,o=r&&r._router;if(o){t=t||{};var i=t._meta=t._meta||{};i.$route=r,t._isRouterView&&(i.$loadingRouteData=i.$loadingRouteData||!1)}var a=e.call(this,t,n);return o&&(o._children.push(a),a.$on("hook:beforeDestroy",function(){o._children.$remove(a)})),a}},t.exports=e["default"]}])});
{
"name": "vue-router",
"version": "0.5.0",
"version": "0.5.1",
"description": "A router for Vue.js",
"main": "src/index.js",
"main": "lib/index.js",
"scripts": {

@@ -10,4 +10,4 @@ "dev": "npm run serve & npm run serve-test",

"unit": "./node_modules/karma/bin/karma start build/karma.config.js",
"build": "webpack --config build/webpack.build.dev.config.js && webpack --config build/webpack.build.min.config.js",
"serve": "webpack-dev-server --hot --config example/webpack.config.js --content-base example --history-api-fallback --host 0.0.0.0",
"build": "babel ./src --optional runtime --out-dir lib && webpack --config build/webpack.build.dev.config.js && webpack --config build/webpack.build.min.config.js",
"serve": "webpack-dev-server --hot --config example/advanced/webpack.config.js --content-base example/advanced --history-api-fallback --host 0.0.0.0",
"serve-test": "webpack-dev-server --quiet --config test/unit/webpack.config.js --content-base test/unit --history-api-fallback --host 0.0.0.0 --port 8081",

@@ -37,2 +37,4 @@ "e2e-sauce": "nightwatch -c build/nightwatch.sauce.json -e chrome,firefox,ie10,ie11",

"devDependencies": {
"babel": "^5.8.21",
"babel-loader": "^5.3.2",
"chromedriver": "2.16.0",

@@ -62,4 +64,5 @@ "css-loader": "^0.15.4",

"dependencies": {
"babel-runtime": "^5.8.20",
"route-recognizer": "0.1.9"
}
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc