function Gp(){this.Init()}v("AdfServerEventQueue",Gp);z.l(Gp);Gp.prototype.Init=function(){Gp.f.Init.call(this);this.SB=[]};z.a("AdfServerEventQueue.prototype.Init",{Init:Gp.prototype.Init});Gp.prototype.push=function(a){var b=a.Zi(),d=0>b?-1:(new Date).getTime()+b;0<b&&F.c.KM(b);this.SB.push({event:a,D5a:d})};z.a("AdfServerEventQueue.prototype.push",{push:Gp.prototype.push});Gp.prototype.AR=function(){return 0==this.zR()};z.a("AdfServerEventQueue.prototype.hasEventsToDeliver",{AR:Gp.prototype.AR});
Gp.prototype.Jia=function(a,b){for(var d=[];0<this.SB.length;){var e=this.SB[0].event,f=!e.GJ(),g=f||e.O0();if(g&&(0<d.length||a))break;if(f&&b)break;this.SB.shift();d.push(e);if(g)break}return d};z.a("AdfServerEventQueue.prototype.shiftEvents",{Jia:Gp.prototype.Jia});Gp.prototype.zR=function(){var a=-1,b=this.SB.length;if(0<b)for(var d=(new Date).getTime(),e=0;e<b;e++){var f=this.SB[e].D5a;0<=f&&(f-=d,a=0>a?f:Math.min(a,f),a=Math.max(0,a))}return a};
z.a("AdfServerEventQueue.prototype.getWaitingTimeout",{zR:Gp.prototype.zR});Gp.prototype.Ei=function(){Gp.A0a(this.SB)};z.a("AdfServerEventQueue.prototype.validate",{Ei:Gp.prototype.Ei});Gp.A0a=function(a){for(var b=F.c,d=0;d<a.length;d++){var e=a[d].event,f=e.getSource();f.k()||((f=b.j(f.e()))?e.setSource(f):a.splice(d--,1))}};