| Current Path : /home/jeromecohp/www/aesecure/third/pace/ |
| Current File : /home/jeromecohp/www/aesecure/third/pace/pace.min.js |
/*! pace 0.4.17 */
(function(){var aY,aX,aW,aV,aU,aT,aS,aR,aQ,aP,aO,aN,aM,aL,aK,aJ,aI,aH,aG,aF,aE,aD,aC,aB,aA,az,ay,ax,aw,av,au,at,ar,aq,ap,ao,an,am,al,ak,aj,ai,ah,ag,af,ae,ad,ac=[].slice,ab={}.hasOwnProperty,aa=function(f,e){function h(){this.constructor=f}for(var g in e){ab.call(e,g)&&(f[g]=e[g])}return h.prototype=e.prototype,f.prototype=new h,f.__super__=e.prototype,f},Z=[].indexOf||function(e){for(var d=0,f=this.length;f>d;d++){if(d in this&&this[d]===e){return d}}return -1};for(aF={catchupTime:500,initialRate:0.03,minTime:500,ghostTime:500,maxProgressPerFrame:10,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!1}},ax=function(){var b;return null!=(b="undefined"!=typeof performance&&null!==performance?"function"==typeof performance.now?performance.now():void 0:void 0)?b:+new Date},av=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,aG=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==av&&(av=function(b){return setTimeout(b,50)},aG=function(b){return clearTimeout(b)}),at=function(e){var d,f;return d=ax(),(f=function(){var a;return a=ax()-d,a>=33?(d=ax(),e(a,function(){return av(f)})):setTimeout(f,33-a)})()},au=function(){var e,d,f;return f=arguments[0],d=arguments[1],e=3<=arguments.length?ac.call(arguments,2):[],"function"==typeof f[d]?f[d].apply(f,e):f[d]},aE=function(){var i,h,n,m,l,k,j;for(h=arguments[0],m=2<=arguments.length?ac.call(arguments,1):[],k=0,j=m.length;j>k;k++){if(n=m[k]){for(i in n){ab.call(n,i)&&(l=n[i],null!=h[i]&&"object"==typeof h[i]&&null!=l&&"object"==typeof l?aE(h[i],l):h[i]=l)}}}return h},aJ=function(h){var g,l,k,j,i;for(l=g=0,j=0,i=h.length;i>j;j++){k=h[j],l+=Math.abs(k),g++}return l/g},aC=function(h,g){var l,k,j;if(null==h&&(h="options"),null==g&&(g=!0),j=document.querySelector("[data-pace-"+h+"]")){if(l=j.getAttribute("data-pace-"+h),!g){return l}try{return JSON.parse(l)}catch(i){return k=i,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",k):void 0}}},aS=function(){function b(){}return b.prototype.on=function(g,f,j,i){var h;return null==i&&(i=!1),null==this.bindings&&(this.bindings={}),null==(h=this.bindings)[g]&&(h[g]=[]),this.bindings[g].push({handler:f,ctx:j,once:i})},b.prototype.once=function(e,d,f){return this.on(e,d,f,!0)},b.prototype.off=function(g,f){var j,i,h;if(null!=(null!=(i=this.bindings)?i[g]:void 0)){if(null==f){return delete this.bindings[g]}for(j=0,h=[];j<this.bindings[g].length;){this.bindings[g][j].handler===f?h.push(this.bindings[g].splice(j,1)):h.push(j++)}return h}},b.prototype.trigger=function(){var r,q,p,o,n,m,l,k,j;if(p=arguments[0],r=2<=arguments.length?ac.call(arguments,1):[],null!=(l=this.bindings)?l[p]:void 0){for(n=0,j=[];n<this.bindings[p].length;){k=this.bindings[p][n],o=k.handler,q=k.ctx,m=k.once,o.apply(null!=q?q:this,r),m?j.push(this.bindings[p].splice(n,1)):j.push(n++)}return j}},b}(),null==window.Pace&&(window.Pace={}),aE(Pace,aS.prototype),aw=Pace.options=aE({},aF,window.paceOptions,aC()),af=["ajax","document","eventLag","elements"],aj=0,ah=af.length;ah>aj;aj++){ap=af[aj],aw[ap]===!0&&(aw[ap]=aF[ap])}aQ=function(d){function c(){return ae=c.__super__.constructor.apply(this,arguments)}return aa(c,d),c}(Error),aX=function(){function b(){this.progress=0}return b.prototype.getElement=function(){var c;if(null==this.el){if(c=document.querySelector(aw.target),!c){throw new aQ}this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace("pace-done",""),document.body.className+=" pace-running",this.el.innerHTML='<div class="pace-progress">\n <div class="pace-progress-inner"></div>\n</div>\n<div class="pace-activity"></div>',null!=c.firstChild?c.insertBefore(this.el,c.firstChild):c.appendChild(this.el)}return this.el},b.prototype.finish=function(){var c;return c=this.getElement(),c.className=c.className.replace("pace-active",""),c.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},b.prototype.update=function(c){return this.progress=c,this.render()},b.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(c){aQ=c}return this.el=void 0},b.prototype.render=function(){var d,c;return null==document.querySelector(aw.target)?!1:(d=this.getElement(),d.children[0].style.width=""+this.progress+"%",(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(d.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?c="99":(c=this.progress<10?"0":"",c+=0|this.progress),d.children[0].setAttribute("data-progress",""+c)),this.lastRenderedProgress=this.progress)},b.prototype.done=function(){return this.progress>=100},b}(),aR=function(){function b(){this.bindings={}}return b.prototype.trigger=function(i,h){var n,m,l,k,j;if(null!=this.bindings[i]){for(k=this.bindings[i],j=[],m=0,l=k.length;l>m;m++){n=k[m],j.push(n.call(this,h))}return j}},b.prototype.on=function(e,d){var f;return null==(f=this.bindings)[e]&&(f[e]=[]),this.bindings[e].push(d)},b}(),ak=window.XMLHttpRequest,al=window.XDomainRequest,am=window.WebSocket,aD=function(i,h){var n,m,l,k;k=[];for(m in h.prototype){try{l=h.prototype[m],null==i[m]&&"function"!=typeof l?k.push(i[m]=l):k.push(void 0)}catch(j){n=j}}return k},az=[],Pace.ignore=function(){var e,d,f;return d=arguments[0],e=2<=arguments.length?ac.call(arguments,1):[],az.unshift("ignore"),f=d.apply(null,e),az.shift(),f},Pace.track=function(){var e,d,f;return d=arguments[0],e=2<=arguments.length?ac.call(arguments,1):[],az.unshift("track"),f=d.apply(null,e),az.shift(),f},aq=function(d){var c;if(null==d&&(d="GET"),"track"===az[0]){return"force"}if(!az.length&&aw.ajax){if("socket"===d&&aw.ajax.trackWebSockets){return !0}if(c=d.toUpperCase(),Z.call(aw.ajax.trackMethods,c)>=0){return !0}}return !1},aP=function(d){function c(){var b,e=this;c.__super__.constructor.apply(this,arguments),b=function(g){var f;return f=g.open,g.open=function(h,a){return aq(h)&&e.trigger("request",{type:h,url:a,request:g}),f.apply(g,arguments)}},window.XMLHttpRequest=function(a){var f;return f=new ak(a),b(f),f},aD(window.XMLHttpRequest,ak),null!=al&&(window.XDomainRequest=function(){var a;return a=new al,b(a),a},aD(window.XDomainRequest,al)),null!=am&&aw.ajax.trackWebSockets&&(window.WebSocket=function(g,f){var h;return h=new am(g,f),aq("socket")&&e.trigger("request",{type:"socket",url:g,protocols:f,request:h}),h},aD(window.WebSocket,am))}return aa(c,d),c}(aR),ai=null,aB=function(){return null==ai&&(ai=new aP),ai},aB().on("request",function(a){var j,i,h,g;return g=a.type,h=a.request,Pace.running||aw.restartOnRequestAfter===!1&&"force"!==aq(g)?void 0:(i=arguments,j=aw.restartOnRequestAfter||0,"boolean"==typeof j&&(j=0),setTimeout(function(){var d,m,l,k,f,e;if(d="socket"===g?h.readyState<2:0<(k=h.readyState)&&4>k){for(Pace.restart(),f=Pace.sources,e=[],m=0,l=f.length;l>m;m++){if(ap=f[m],ap instanceof aY){ap.watch.apply(ap,i);break}e.push(void 0)}return e}},j))}),aY=function(){function b(){var c=this;this.elements=[],aB().on("request",function(){return c.watch.apply(c,arguments)})}return b.prototype.watch=function(f){var e,h,g;return g=f.type,e=f.request,h="socket"===g?new aM(e):new aL(e),this.elements.push(h)},b}(),aL=function(){function b(j){var i,p,o,n,m,l,k=this;if(this.progress=0,null!=window.ProgressEvent){for(p=null,j.addEventListener("progress",function(c){return k.progress=c.lengthComputable?100*c.loaded/c.total:k.progress+(100-k.progress)/2}),l=["load","abort","timeout","error"],o=0,n=l.length;n>o;o++){i=l[o],j.addEventListener(i,function(){return k.progress=100})}}else{m=j.onreadystatechange,j.onreadystatechange=function(){var a;return 0===(a=j.readyState)||4===a?k.progress=100:3===j.readyState&&(k.progress=50),"function"==typeof m?m.apply(null,arguments):void 0}}}return b}(),aM=function(){function b(h){var g,l,k,j,i=this;for(this.progress=0,j=["error","open"],l=0,k=j.length;k>l;l++){g=j[l],h.addEventListener(g,function(){return i.progress=100})}}return b}(),aV=function(){function b(g){var e,j,i,h;for(null==g&&(g={}),this.elements=[],null==g.selectors&&(g.selectors=[]),h=g.selectors,j=0,i=h.length;i>j;j++){e=h[j],this.elements.push(new aU(e))}}return b}(),aU=function(){function b(c){this.selector=c,this.progress=0,this.check()}return b.prototype.check=function(){var c=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return c.check()},aw.elements.checkInterval)},b.prototype.done=function(){return this.progress=100},b}(),aW=function(){function b(){var e,d,f=this;this.progress=null!=(d=this.states[document.readyState])?d:100,e=document.onreadystatechange,document.onreadystatechange=function(){return null!=f.states[document.readyState]&&(f.progress=f.states[document.readyState]),"function"==typeof e?e.apply(null,arguments):void 0}}return b.prototype.states={loading:0,interactive:50,complete:100},b}(),aT=function(){function b(){var h,g,l,k,j,i=this;this.progress=0,h=0,j=[],k=0,l=ax(),g=setInterval(function(){var a;return a=ax()-l-50,l=ax(),j.push(a),j.length>aw.eventLag.sampleCount&&j.shift(),h=aJ(j),++k>=aw.eventLag.minSamples&&h<aw.eventLag.lagThreshold?(i.progress=100,clearInterval(g)):i.progress=100*(3/(h+3))},50)}return b}(),aN=function(){function b(c){this.source=c,this.last=this.sinceLastUpdate=0,this.rate=aw.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=au(this.source,"progress"))}return b.prototype.tick=function(e,d){var f;return null==d&&(d=au(this.source,"progress")),d>=100&&(this.done=!0),d===this.last?this.sinceLastUpdate+=e:(this.sinceLastUpdate&&(this.rate=(d-this.last)/this.sinceLastUpdate),this.catchup=(d-this.progress)/aw.catchupTime,this.sinceLastUpdate=0,this.last=d),d>this.progress&&(this.progress+=this.catchup*e),f=1-Math.pow(this.progress/100,aw.easeFactor),this.progress+=f*this.rate*e,this.progress=Math.min(this.lastProgress+aw.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},b}(),ao=null,ar=null,aI=null,an=null,aK=null,aH=null,Pace.running=!1,aA=function(){return aw.restartOnPushState?Pace.restart():void 0},null!=window.history.pushState&&(ag=window.history.pushState,window.history.pushState=function(){return aA(),ag.apply(window.history,arguments)}),null!=window.history.replaceState&&(ad=window.history.replaceState,window.history.replaceState=function(){return aA(),ad.apply(window.history,arguments)}),aO={ajax:aY,elements:aV,document:aW,eventLag:aT},(ay=function(){var b,p,o,n,m,l,k,j;for(Pace.sources=ao=[],l=["ajax","elements","document","eventLag"],p=0,n=l.length;n>p;p++){b=l[p],aw[b]!==!1&&ao.push(new aO[b](aw[b]))}for(j=null!=(k=aw.extraSources)?k:[],o=0,m=j.length;m>o;o++){ap=j[o],ao.push(new ap(aw))}return Pace.bar=aI=new aX,ar=[],an=new aN})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,aI.destroy(),aH=!0,null!=aK&&("function"==typeof aG&&aG(aK),aK=null),ay()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){return Pace.running=!0,aI.render(),aH=!1,aK=at(function(L,K){var J,I,H,G,F,E,D,C,B,A,z,y,x,w,r,q,l;for(C=100-aI.progress,I=y=0,H=!0,E=x=0,r=ao.length;r>x;E=++x){for(ap=ao[E],A=null!=ar[E]?ar[E]:ar[E]=[],F=null!=(l=ap.elements)?l:[ap],D=w=0,q=F.length;q>w;D=++w){G=F[D],B=null!=A[D]?A[D]:A[D]=new aN(G),H&=B.done,B.done||(I++,y+=B.tick(L))}}return J=y/I,aI.update(an.tick(L,J)),z=ax(),aI.done()||H||aH?(aI.update(100),Pace.trigger("done"),setTimeout(function(){return aI.finish(),Pace.running=!1,Pace.trigger("hide")},Math.max(aw.ghostTime,Math.min(aw.minTime,ax()-z)))):K()})},Pace.start=function(d){aE(aw,d),Pace.running=!0;try{aI.render()}catch(c){aQ=c}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define(function(){return Pace}):"object"==typeof exports?module.exports=Pace:aw.startOnPageLoad&&Pace.start()}).call(this);