-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.092e78c5749aba36.js
1 lines (1 loc) · 12 KB
/
scripts.092e78c5749aba36.js
1
(function(){var N,J,K,Q,V,Y,Z,$,L,u,tt,et,_,nt,rt,v,st,f,x,P,F,w,T,ot,C,U,m,it,g,c,R,W,ut,b,X,j,h,y,D,k,E,H,O,M,at,ct,I,lt,S=[].slice,pt={}.hasOwnProperty,ht=function(e,t){function n(){this.constructor=e}for(var r in t)pt.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},yt=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};for(F={catchupTime:100,initialRate:.03,minTime:250,ghostTime:100,maxProgressPerFrame:20,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:!0,ignoreURLs:[]}},g=function(){var e;return null!=(e=typeof performance<"u"&&null!==performance&&"function"==typeof performance.now?performance.now():void 0)?e:+new Date},R=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,P=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==R&&(R=function(e){return setTimeout(e,50)},P=function(e){return clearTimeout(e)}),ut=function(e){var t,n;return t=g(),(n=function(){var r;return(r=g()-t)>=33?(t=g(),e(r,function(){return R(n)})):setTimeout(n,33-r)})()},W=function(){var e,t,n;return n=arguments[0],t=arguments[1],e=3<=arguments.length?S.call(arguments,2):[],"function"==typeof n[t]?n[t].apply(n,e):n[t]},w=function(){var e,t,n,r,s,o,i;for(t=arguments[0],o=0,i=(r=2<=arguments.length?S.call(arguments,1):[]).length;i>o;o++)if(n=r[o])for(e in n)pt.call(n,e)&&(s=n[e],null!=t[e]&&"object"==typeof t[e]&&null!=s&&"object"==typeof s?w(t[e],s):t[e]=s);return t},st=function(e){var t,n,s,o;for(n=t=0,s=0,o=e.length;o>s;s++)n+=Math.abs(e[s]),t++;return n/t},ot=function(e,t){var n,s;if(null==e&&(e="options"),null==t&&(t=!0),s=document.querySelector("[data-pace-"+e+"]")){if(n=s.getAttribute("data-pace-"+e),!t)return n;try{return JSON.parse(n)}catch(o){return typeof console<"u"&&null!==console?console.error("Error parsing inline pace options",o):void 0}}},Z=function(){function e(){}return e.prototype.on=function(t,n,r,s){var o;return null==s&&(s=!1),null==this.bindings&&(this.bindings={}),null==(o=this.bindings)[t]&&(o[t]=[]),this.bindings[t].push({handler:n,ctx:r,once:s})},e.prototype.once=function(t,n,r){return this.on(t,n,r,!0)},e.prototype.off=function(t,n){var r,s,o;if(null!=(null!=(s=this.bindings)?s[t]:void 0)){if(null==n)return delete this.bindings[t];for(r=0,o=[];r<this.bindings[t].length;)o.push(this.bindings[t][r].handler===n?this.bindings[t].splice(r,1):r++);return o}},e.prototype.trigger=function(){var t,r,o,i,a,l,p;if(r=arguments[0],t=2<=arguments.length?S.call(arguments,1):[],null!=(a=this.bindings)?a[r]:void 0){for(o=0,p=[];o<this.bindings[r].length;)i=(l=this.bindings[r][o]).once,l.handler.apply(l.ctx??this,t),p.push(i?this.bindings[r].splice(o,1):o++);return p}},e}(),u=window.Pace||{},window.Pace=u,w(u,Z.prototype),c=u.options=w({},F,window.paceOptions,ot()),O=0,at=(I=["ajax","document","eventLag","elements"]).length;at>O;O++)!0===c[h=I[O]]&&(c[h]=F[h]);L=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return ht(t,e),t}(Error),J=function(){function e(){this.progress=0}return e.prototype.getElement=function(){var t;if(null==this.el){if(!(t=document.querySelector(c.target)))throw new L;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace(/pace-done/g,""),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!=t.firstChild?t.insertBefore(this.el,t.firstChild):t.appendChild(this.el)}return this.el},e.prototype.finish=function(){var t;return(t=this.getElement()).className=t.className.replace("pace-active",""),t.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},e.prototype.update=function(t){return this.progress=t,this.render()},e.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(t){L=t}return this.el=void 0},e.prototype.render=function(){var t,r,s,o,i,a;if(null==document.querySelector(c.target))return!1;for(t=this.getElement(),s="translate3d("+this.progress+"%, 0, 0)",o=0,i=(a=["webkitTransform","msTransform","transform"]).length;i>o;o++)t.children[0].style[a[o]]=s;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(t.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?r="99":(r=this.progress<10?"0":"",r+=0|this.progress),t.children[0].setAttribute("data-progress",""+r)),this.lastRenderedProgress=this.progress},e.prototype.done=function(){return this.progress>=100},e}(),$=function(){function e(){this.bindings={}}return e.prototype.trigger=function(t,n){var s,o,i,a;if(null!=this.bindings[t]){for(a=[],s=0,o=(i=this.bindings[t]).length;o>s;s++)a.push(i[s].call(this,n));return a}},e.prototype.on=function(t,n){var r;return null==(r=this.bindings)[t]&&(r[t]=[]),this.bindings[t].push(n)},e}(),H=window.XMLHttpRequest,E=window.XDomainRequest,k=window.WebSocket,T=function(e,t){var r,s;for(r in s=[],t.prototype)try{s.push(null==e[r]&&"function"!=typeof t[r]?"function"==typeof Object.defineProperty?Object.defineProperty(e,r,{get:function(){return t.prototype[r]},configurable:!0,enumerable:!0}):e[r]=t.prototype[r]:void 0)}catch(o){}return s},m=[],u.ignore=function(){var e,t,n;return t=arguments[0],e=2<=arguments.length?S.call(arguments,1):[],m.unshift("ignore"),n=t.apply(null,e),m.shift(),n},u.track=function(){var e,t,n;return t=arguments[0],e=2<=arguments.length?S.call(arguments,1):[],m.unshift("track"),n=t.apply(null,e),m.shift(),n},j=function(e){var t;return null==e&&(e="GET"),"track"===m[0]?"force":!(m.length||!c.ajax||!("socket"===e&&c.ajax.trackWebSockets||(t=e.toUpperCase(),yt.call(c.ajax.trackMethods,t)>=0)))},tt=function(e){function t(){var n,r=this;t.__super__.constructor.apply(this,arguments),n=function(s){var o;return o=s.open,s.open=function(i,a){return j(i)&&r.trigger("request",{type:i,url:a,request:s}),o.apply(s,arguments)}},window.XMLHttpRequest=function(s){var o;return o=new H(s),n(o),o};try{T(window.XMLHttpRequest,H)}catch{}if(null!=E){window.XDomainRequest=function(){var s;return s=new E,n(s),s};try{T(window.XDomainRequest,E)}catch{}}if(null!=k&&c.ajax.trackWebSockets){window.WebSocket=function(s,o){var i;return i=null!=o?new k(s,o):new k(s),j("socket")&&r.trigger("request",{type:"socket",url:s,protocols:o,request:i}),i};try{T(window.WebSocket,k)}catch{}}}return ht(t,e),t}($),M=null,X=function(e){var t,n,r,s;for(n=0,r=(s=c.ajax.ignoreURLs).length;r>n;n++)if("string"==typeof(t=s[n])){if(-1!==e.indexOf(t))return!0}else if(t.test(e))return!0;return!1},(C=function(){return null==M&&(M=new tt),M})().on("request",function(e){var t,n,r,s;return s=e.type,r=e.request,X(e.url)||u.running||!1===c.restartOnRequestAfter&&"force"!==j(s)?void 0:(n=arguments,"boolean"==typeof(t=c.restartOnRequestAfter||0)&&(t=0),setTimeout(function(){var a,l,p,q,d;if("socket"===s?r.readyState<2:0<(p=r.readyState)&&4>p){for(u.restart(),d=[],a=0,l=(q=u.sources).length;l>a;a++){if((h=q[a])instanceof N){h.watch.apply(h,n);break}d.push(void 0)}return d}},t))}),N=function(){function e(){var t=this;this.elements=[],C().on("request",function(){return t.watch.apply(t,arguments)})}return e.prototype.watch=function(t){var n,r,s;return s=t.type,n=t.request,X(t.url)?void 0:(r="socket"===s?new nt(n):new rt(n),this.elements.push(r))},e}(),rt=function e(t){var s,o,i,a,l=this;if(this.progress=0,null!=window.ProgressEvent)for(t.addEventListener("progress",function(p){return l.progress=p.lengthComputable?100*p.loaded/p.total:l.progress+(100-l.progress)/2},!1),s=0,o=(a=["load","abort","timeout","error"]).length;o>s;s++)t.addEventListener(a[s],function(){return l.progress=100},!1);else i=t.onreadystatechange,t.onreadystatechange=function(){var p;return 0===(p=t.readyState)||4===p?l.progress=100:3===t.readyState&&(l.progress=50),"function"==typeof i?i.apply(null,arguments):void 0}},nt=function e(t){var r,s,o,i=this;for(this.progress=0,r=0,s=(o=["error","open"]).length;s>r;r++)t.addEventListener(o[r],function(){return i.progress=100},!1)},Q=function e(t){var r,s,o;for(null==t&&(t={}),this.elements=[],null==t.selectors&&(t.selectors=[]),r=0,s=(o=t.selectors).length;s>r;r++)this.elements.push(new V(o[r]))},V=function(){function e(t){this.selector=t,this.progress=0,this.check()}return e.prototype.check=function(){var t=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return t.check()},c.elements.checkInterval)},e.prototype.done=function(){return this.progress=100},e}(),K=function(){function e(){var t,n,r=this;this.progress=null!=(n=this.states[document.readyState])?n:100,t=document.onreadystatechange,document.onreadystatechange=function(){return null!=r.states[document.readyState]&&(r.progress=r.states[document.readyState]),"function"==typeof t?t.apply(null,arguments):void 0}}return e.prototype.states={loading:0,interactive:50,complete:100},e}(),Y=function e(){var t,n,r,s,o,i=this;this.progress=0,t=0,o=[],s=0,r=g(),n=setInterval(function(){var a;return a=g()-r-50,r=g(),o.push(a),o.length>c.eventLag.sampleCount&&o.shift(),t=st(o),++s>=c.eventLag.minSamples&&t<c.eventLag.lagThreshold?(i.progress=100,clearInterval(n)):i.progress=3/(t+3)*100},50)},_=function(){function e(t){this.source=t,this.last=this.sinceLastUpdate=0,this.rate=c.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=W(this.source,"progress"))}return e.prototype.tick=function(t,n){var r;return null==n&&(n=W(this.source,"progress")),n>=100&&(this.done=!0),n===this.last?this.sinceLastUpdate+=t:(this.sinceLastUpdate&&(this.rate=(n-this.last)/this.sinceLastUpdate),this.catchup=(n-this.progress)/c.catchupTime,this.sinceLastUpdate=0,this.last=n),n>this.progress&&(this.progress+=this.catchup*t),r=1-Math.pow(this.progress/100,c.easeFactor),this.progress+=r*this.rate*t,this.progress=Math.min(this.lastProgress+c.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},e}(),y=null,b=null,f=null,D=null,v=null,x=null,u.running=!1,U=function(){return c.restartOnPushState?u.restart():void 0},null!=window.history.pushState&&(ct=window.history.pushState,window.history.pushState=function(){return U(),ct.apply(window.history,arguments)}),null!=window.history.replaceState&&(lt=window.history.replaceState,window.history.replaceState=function(){return U(),lt.apply(window.history,arguments)}),et={ajax:N,elements:Q,document:K,eventLag:Y},(it=function(){var e,t,n,r,s,o,i,a;for(u.sources=y=[],t=0,r=(o=["ajax","elements","document","eventLag"]).length;r>t;t++)!1!==c[e=o[t]]&&y.push(new et[e](c[e]));for(n=0,s=(a=null!=(i=c.extraSources)?i:[]).length;s>n;n++)y.push(new(h=a[n])(c));return u.bar=f=new J,b=[],D=new _})(),u.stop=function(){return u.trigger("stop"),u.running=!1,f.destroy(),x=!0,null!=v&&("function"==typeof P&&P(v),v=null),it()},u.restart=function(){return u.trigger("restart"),u.stop(),u.start()},u.go=function(){var e;return u.running=!0,f.render(),e=g(),x=!1,v=ut(function(t,n){var s,o,a,l,p,d,A,z,G,B,ft,gt,dt;for(s=z=0,o=!0,l=G=0,ft=y.length;ft>G;l=++G)for(h=y[l],A=null!=b[l]?b[l]:b[l]=[],p=B=0,gt=(a=null!=(dt=h.elements)?dt:[h]).length;gt>B;p=++B)o&=(d=null!=A[p]?A[p]:A[p]=new _(a[p])).done,d.done||(s++,z+=d.tick(t));return f.update(D.tick(t,z/s)),f.done()||o||x?(f.update(100),u.trigger("done"),setTimeout(function(){return f.finish(),u.running=!1,u.trigger("hide")},Math.max(c.ghostTime,Math.max(c.minTime-(g()-e),0)))):n()})},u.start=function(e){w(c,e),u.running=!0;try{f.render()}catch(t){L=t}return document.querySelector(".pace")?(u.trigger("start"),u.go()):setTimeout(u.start,50)},"function"==typeof define&&define.amd?define(["pace"],function(){return u}):"object"==typeof exports?module.exports=u:c.startOnPageLoad&&u.start()}).call(this);