function Er(){this.Init()}m("AdfServerEventQueue",Er);r.v(Er);Er.prototype.Init=function(){Er.h.Init.call(this);this.RG=[]};r.a("AdfServerEventQueue.prototype.Init",{Init:Er.prototype.Init});Er.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:Er.prototype.push});Er.prototype.oZ=function(){return 0==this.lZ()};r.a("AdfServerEventQueue.prototype.hasEventsToDeliver",{oZ:Er.prototype.oZ});
Er.prototype.cva=function(a,b){for(var d=[];0<this.RG.length;){var e=this.RG[0].event,f=!e.PP(),g=f||e.i$();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",{cva:Er.prototype.cva});Er.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:Er.prototype.lZ});Er.prototype.Xi=function(){Er.gmb(this.RG)};r.a("AdfServerEventQueue.prototype.validate",{Xi:Er.prototype.Xi});Er.gmb=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))}};