(function(NProgress) {

  this.NProgress = NProgress;

})(function($) {
  var NProgress = {};

  var Settings = NProgress.settings = {
    minimum: 0.05,
    easing: 'ease',
    speed: 300,
    template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner"><div class="spinner-icon"></div></div>'
  };

  /**
   * Updates configuration.
   *
   *     NProgress.configure({
   *       minimum: 0.1
   *     });
   */
  NProgress.configure = function(options) {
    $.extend(Settings, options);
    return this;
  };

  /**
   * Last number.
   */

  NProgress.status = null;

  /**
   * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
   *
   *     NProgress.set(0.4);
   *     NProgress.set(1.0);
   */

  NProgress.set = function(n) {
    n = clamp(n, Settings.minimum, 1);
    NProgress.status = (n === 1 ? null : n);

    var $progress = NProgress.render(),
        $bar      = $progress.find('[role~="bar"]'),
        speed     = Settings.speed,
        ease      = Settings.easing;

    setTimeout(function() {
      $progress.queue(function(next) {
        var perc = -1 + n; /* -1.0 ... 0.0 */

        $bar.css({
          transition: 'all '+speed+'ms '+ease,
          transform: 'translate3d('+(perc*100)+'%,0,0)'
        });

        if (n === 1) {
          $progress.css({ transition: 'none', opacity: 1 });

          setTimeout(function() {
            $progress.css({ transition: 'all '+speed+'ms linear', opacity: 0 });
            setTimeout(function() {
              $progress.remove();
              next();
            }, speed);
          }, speed);
        } else {
          setTimeout(next, speed);
        }
      });
    }, 0);

    return this;
  };

  /**
   * Shows the progress bar.
   * This is the same as setting the status to 0%, except that it doesn't go backwards.
   *
   *     NProgress.start();
   *
   */
  NProgress.start = function() {
    if (!NProgress.status) NProgress.set(0);
    return this;
  };

  /**
   * Hides the progress bar.
   * This is the *sort of* the same as setting the status to 100%, with the
   * difference being `done()` makes some placebo effect of some realistic motion.
   *
   *     NProgress.done();
   *
   * If `true` is passed, it will show the progress bar even if its hidden.
   *
   *     NProgress.done(true);
   */

  NProgress.done = function(force) {
    if (!force && !NProgress.status) return this;

    return NProgress.inc(0.3 + 0.5 * Math.random()).set(1);
  };

  /**
   * Increments by a random amount.
   */

  NProgress.inc = function(amount) {
    var n = NProgress.status;

    if (!n) {
      return NProgress.start();
    } else {
      if (typeof amount !== 'number')
        amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95);

      n = clamp(n + amount, 0, 0.994);
      return NProgress.set(n);
    }
  };

  /**
   * (Internal) renders the progress bar markup based on the `template`
   * setting.
   */

  NProgress.render = function() {
    if (NProgress.isRendered()) return $("#nprogress");

    var $el = $("<div id='nprogress'>")
      .html(Settings.template)
      .appendTo(document.body);

    $el.find('[role~="bar"]').css({
      transition: 'all 0 linear',
      transform: 'translate3d(-100%,0,0)'
    });

    return $el;
  };

  /**
   * Checks if the progress bar is rendered.
   */

  NProgress.isRendered = function() {
    return ($("#nprogress").length > 0);
  };

  /**
   * Helpers
   */

  function clamp(n, min, max) {
    if (n < min) return min;
    if (n > max) return max;
    return n;
  }

  return NProgress;
}(jQuery));


@@ -1984,32 +1984,327 @@
 urn this;%0A  %7D;%0A%0A
+  NProgress.start = function() %7B%0A    if (!NProgress.status) NProgress.set(0);%0A%0A    var work = function() %7B%0A      setTimeout(function() %7B%0A        if (!NProgress.status) return;%0A        NProgress.trickle();%0A        work();%0A      %7D, Settings.speed * 4);%0A    %7D;%0A%0A    work();%0A%0A    return this;%0A  %7D;%0A%0A
   /**%0A   * Hides
@@ -3004,17 +3004,19 @@
 number')
+ %7B
 %0A
-
         
@@ -3070,16 +3070,24 @@
 , 0.95);
+%0A      %7D
 %0A%0A      
@@ -3150,16 +3150,16 @@
 set(n);%0A
-
     %7D%0A  
@@ -3158,24 +3158,114 @@
     %7D%0A  %7D;%0A%0A
+  NProgress.trickle = function() %7B%0A    return NProgress.inc(Math.random() * 0.002);%0A  %7D;%0A%0A
   /**%0A   * (

Add trickling support.