nprogress-85851b89.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import{c as t,g as n}from"./@turf-e5dd68ad.js";var e={exports:{}};
  2. /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
  3. * @license MIT */e.exports=function(){var t,n,e={version:"0.2.0"},r=e.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};
  4. /**
  5. * Helpers
  6. */
  7. function i(t,n,e){return t<n?n:t>e?e:t}
  8. /**
  9. * (Internal) converts a percentage (`0..1`) to a bar translateX
  10. * percentage (`-100%..0%`).
  11. */function s(t){return 100*(-1+t)}
  12. /**
  13. * (Internal) returns the correct CSS for changing the bar's
  14. * position given an n percentage, and speed and ease from Settings
  15. */function o(t,n,e){var i;return(i="translate3d"===r.positionUsing?{transform:"translate3d("+s(t)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+s(t)+"%,0)"}:{"margin-left":s(t)+"%"}).transition="all "+n+"ms "+e,i}
  16. /**
  17. * (Internal) Queues a function to be executed.
  18. */
  19. /**
  20. * Updates configuration.
  21. *
  22. * NProgress.configure({
  23. * minimum: 0.1
  24. * });
  25. */
  26. e.configure=function(t){var n,e;for(n in t)void 0!==(e=t[n])&&t.hasOwnProperty(n)&&(r[n]=e);return this},
  27. /**
  28. * Last number.
  29. */
  30. e.status=null,
  31. /**
  32. * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`.
  33. *
  34. * NProgress.set(0.4);
  35. * NProgress.set(1.0);
  36. */
  37. e.set=function(t){var n=e.isStarted();t=i(t,r.minimum,1),e.status=1===t?null:t;var s=e.render(!n),c=s.querySelector(r.barSelector),l=r.speed,f=r.easing;return s.offsetWidth,/* Repaint */
  38. a((function(n){
  39. // Set positionUsing if it hasn't already been set
  40. ""===r.positionUsing&&(r.positionUsing=e.getPositioningCSS()),
  41. // Add transition
  42. u(c,o(t,l,f)),1===t?(
  43. // Fade out
  44. u(s,{transition:"none",opacity:1}),s.offsetWidth,/* Repaint */
  45. setTimeout((function(){u(s,{transition:"all "+l+"ms linear",opacity:0}),setTimeout((function(){e.remove(),n()}),l)}),l)):setTimeout(n,l)})),this},e.isStarted=function(){return"number"==typeof e.status},
  46. /**
  47. * Shows the progress bar.
  48. * This is the same as setting the status to 0%, except that it doesn't go backwards.
  49. *
  50. * NProgress.start();
  51. *
  52. */
  53. e.start=function(){e.status||e.set(0);var t=function(){setTimeout((function(){e.status&&(e.trickle(),t())}),r.trickleSpeed)};return r.trickle&&t(),this},
  54. /**
  55. * Hides the progress bar.
  56. * This is the *sort of* the same as setting the status to 100%, with the
  57. * difference being `done()` makes some placebo effect of some realistic motion.
  58. *
  59. * NProgress.done();
  60. *
  61. * If `true` is passed, it will show the progress bar even if its hidden.
  62. *
  63. * NProgress.done(true);
  64. */
  65. e.done=function(t){return t||e.status?e.inc(.3+.5*Math.random()).set(1):this},
  66. /**
  67. * Increments by a random amount.
  68. */
  69. e.inc=function(t){var n=e.status;return n?("number"!=typeof t&&(t=(1-n)*i(Math.random()*n,.1,.95)),n=i(n+t,0,.994),e.set(n)):e.start()},e.trickle=function(){return e.inc(Math.random()*r.trickleRate)},
  70. /**
  71. * Waits for all supplied jQuery promises and
  72. * increases the progress as the promises resolve.
  73. *
  74. * @param $promise jQUery Promise
  75. */
  76. t=0,n=0,e.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&e.start(),t++,n++,r.always((function(){0==--n?(t=0,e.done()):e.set((t-n)/t)})),this):this},
  77. /**
  78. * (Internal) renders the progress bar markup based on the `template`
  79. * setting.
  80. */
  81. e.render=function(t){if(e.isRendered())return document.getElementById("nprogress");l(document.documentElement,"nprogress-busy");var n=document.createElement("div");n.id="nprogress",n.innerHTML=r.template;var i,o=n.querySelector(r.barSelector),a=t?"-100":s(e.status||0),c=document.querySelector(r.parent);return u(o,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),r.showSpinner||(i=n.querySelector(r.spinnerSelector))&&d(i),c!=document.body&&l(c,"nprogress-custom-parent"),c.appendChild(n),n},
  82. /**
  83. * Removes the element. Opposite of render().
  84. */
  85. e.remove=function(){f(document.documentElement,"nprogress-busy"),f(document.querySelector(r.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&d(t)},
  86. /**
  87. * Checks if the progress bar is rendered.
  88. */
  89. e.isRendered=function(){return!!document.getElementById("nprogress")},
  90. /**
  91. * Determine which positioning CSS rule to use.
  92. */
  93. e.getPositioningCSS=function(){
  94. // Sniff on document.body.style
  95. var t=document.body.style,n="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";
  96. // Sniff prefixes
  97. return n+"Perspective"in t?"translate3d":n+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function n(){var e=t.shift();e&&e(n)}return function(e){t.push(e),1==t.length&&n()}}(),u=function(){var t=["Webkit","O","Moz","ms"],n={};function e(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,n){return n.toUpperCase()}))}function r(n){var e=document.body.style;if(n in e)return n;for(var r,i=t.length,s=n.charAt(0).toUpperCase()+n.slice(1);i--;)if((r=t[i]+s)in e)return r;return n}function i(t){return t=e(t),n[t]||(n[t]=r(t))}function s(t,n,e){n=i(n),t.style[n]=e}return function(t,n){var e,r,i=arguments;if(2==i.length)for(e in n)void 0!==(r=n[e])&&n.hasOwnProperty(e)&&s(t,e,r);else s(t,i[1],i[2])}}();
  98. /**
  99. * (Internal) Applies css properties to an element, similar to the jQuery
  100. * css method.
  101. *
  102. * While this helper does assist with vendor prefixed property names, it
  103. * does not perform any manipulation of values prior to setting styles.
  104. */
  105. /**
  106. * (Internal) Determines if an element or space separated list of class names contains a class name.
  107. */
  108. function c(t,n){return("string"==typeof t?t:m(t)).indexOf(" "+n+" ")>=0}
  109. /**
  110. * (Internal) Adds a class to an element.
  111. */function l(t,n){var e=m(t),r=e+n;c(e,n)||(
  112. // Trim the opening space.
  113. t.className=r.substring(1))}
  114. /**
  115. * (Internal) Removes a class from an element.
  116. */function f(t,n){var e,r=m(t);c(t,n)&&(
  117. // Replace the class name.
  118. e=r.replace(" "+n+" "," "),
  119. // Trim the opening and closing spaces.
  120. t.className=e.substring(1,e.length-1))}
  121. /**
  122. * (Internal) Gets a space separated list of the class names on the element.
  123. * The list is wrapped with a single space on each end to facilitate finding
  124. * matches within the list.
  125. */function m(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}
  126. /**
  127. * (Internal) Removes an element from the DOM.
  128. */function d(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return e}();const r=n(e.exports);export{r as N};
  129. //# sourceMappingURL=nprogress-85851b89.js.map