function xg(){this.Init()}v("AdfDhtmlDialogManager",xg);z.l(xg);xg.prototype.Init=function(){xg.f.Init.call(this);this.KN=[];this.qsa=[];this.Zq=n;var a=w.b,b=a.w().documentElement;a.R();this.G8a=b.scrollLeft;this.H8a=b.scrollTop;this.HB={};this.HB.Nh=function(){var a=this.D_a;a?O.ra(a):O.ufa()};this.HB.X1=ca();this.HB.nS=ca()};z.a("AdfDhtmlDialogManager.prototype.Init",{Init:xg.prototype.Init});xg.prototype.wi=function(){return this.KN.length};
z.a("AdfDhtmlDialogManager.prototype.getElementCount",{wi:xg.prototype.wi});xg.prototype.Nha=function(a){this.KN[this.KN.length]=a;delete this.YH};z.a("AdfDhtmlDialogManager.prototype.registerDialog",{Nha:xg.prototype.Nha});
function zg(a){var b=-1,d=a.Zq,e=a.YH;if(e)return d&&(b=ya.indexOf(e,d)),b;for(var e=[],f=a.KN,g=p,h=f.length-1;-1<h;h--){var m=f[h];if(g){var q=a,s=m.IC(),y=q.gZa;if(!y){var y=F.c,y=y.j(y.mi),A=y.k();A.bind(y);y=q.gZa=A.Nu()}if(s==y){e.splice(e.length-1,0,m);m.bk();d=e[e.length-1];d.Ip()&&(f={},f.msgDialog=m,f.modalDialog=d,d.h_(xg.G0a,f));break}}else{if(m.getModal()&&(g=l,2==m.w0()))break;-1==b&&d&&m==d&&(b=e.length);e[e.length]=m}}e.reverse();-1<b&&(b=e.length-1-b);g||(e[e.length]=a.HB);a.YH=e;
return b}xg.G0a=function(a){B.zc(a,"params is required");var b=a.msgDialog;a=a.modalDialog;B.J(b,wg,"params.msgDialog]");B.J(a,wg,"params.modalDialog");a=a.Re();b.Fia(a&&a.id?a.id:n)};xg.prototype.TQ=function(a){a&&(this.HB.D_a=a);a=zg(this);var b=this.YH,d=0;if(b&&!(1>=b.length)&&(d=-1==a||a+1==b.length?0:a+1,a=b[d]))this.BQ(a),a.Nh()};z.a("AdfDhtmlDialogManager.prototype.focusNextModelessDialog",{TQ:xg.prototype.TQ});
xg.prototype.jja=function(a){var b=this.qsa,d=this.KN;zg(this);ya.Of(d,a);ya.Of(b,a);if(a.getModal())for(var e=F.c,f=this.YH,g=f.length-1;0<g;g--){var h=f[g];if(h!=this.HB){var m=h.IC(),q=e.j(m);if(q&&q instanceof AdfRichDialog){var s=q.getParent();if(s&&s instanceof AdfRichDocument&&s.k().Nu()==m)continue;m=q.k();m.bind(q);m.L_()}else q=h.iJ(),(q=e.j(q))&&q instanceof AdfRichPopup&&q.cancel();ya.Of(d,h);ya.Of(b,h)}}delete this.YH;this.Zq==a&&(this.Zq=n,a=b.length,1<=a&&(this.Zq=b[a-1]).Nh())};
z.a("AdfDhtmlDialogManager.prototype.unregisterDialog",{jja:xg.prototype.jja});xg.prototype.BQ=function(a){var b=this.Zq;if(b==a)return p;zg(this);var d=this.YH;if(d&&0>ya.indexOf(d,a))return p;b&&this.B_();if(a==this.HB)return p;this.Zq=a;b=this.qsa;ya.Of(b,a);b.push(a);a.nS();return l};z.a("AdfDhtmlDialogManager.prototype.activateDialog",{BQ:xg.prototype.BQ});xg.prototype.B_=function(){this.Zq&&(this.Zq.X1(),this.Zq=n)};z.a("AdfDhtmlDialogManager.prototype.deactivateCurrentDialog",{B_:xg.prototype.B_});
xg.O=function(){this.Nj==n&&(this.Nj=new xg);return this.Nj};v("AdfDhtmlDialogManager.getInstance",xg.O);xg.prototype.WQ=r("Zq");z.a("AdfDhtmlDialogManager.prototype.getActiveDialog",{WQ:xg.prototype.WQ});