function Cr(){this.Init()}m("AdfServerEventQueue",Cr);r.v(Cr);Cr.prototype.Init=function(){Cr.h.Init.call(this);this.RG=[]};r.a("AdfServerEventQueue.prototype.Init",{Init:Cr.prototype.Init});Cr.prototype.push=function(a){var b=a.fk(),d=0>b?-1:(new Date).getTime()+b;0<b&&A.c.FT(b);this.RG.push({event:a,tsb:d})};r.a("AdfServerEventQueue.prototype.push",{push:Cr.prototype.push});Cr.prototype.oZ=function(){return 0==this.lZ()};r.a("AdfServerEventQueue.prototype.hasEventsToDeliver",{oZ:Cr.prototype.oZ});
Cr.prototype.Zua=function(a,b){for(var d=[];0<this.RG.length;){var e=this.RG[0].event,f=!e.PP(),g=f||e.h$();if(g&&(0<d.length||a))break;if(f&&b)break;this.RG.shift();d.push(e);if(g)break}return d};r.a("AdfServerEventQueue.prototype.shiftEvents",{Zua:Cr.prototype.Zua});Cr.prototype.lZ=function(){var a=-1,b=this.RG.length;if(0<b)for(var d=(new Date).getTime(),e=0;e<b;e++){var f=this.RG[e].tsb;0<=f&&(f-=d,a=0>a?f:Math.min(a,f),a=Math.max(0,a))}return a};
r.a("AdfServerEventQueue.prototype.getWaitingTimeout",{lZ:Cr.prototype.lZ});Cr.prototype.Wi=function(){Cr.fmb(this.RG)};r.a("AdfServerEventQueue.prototype.validate",{Wi:Cr.prototype.Wi});Cr.fmb=function(a){for(var b=A.c,d=0;d<a.length;d++){var e=a[d].event,f=e.getSource();f.o()||((f=b.m(f.g()))?e.setSource(f):a.splice(d--,1))}};