var pB=I.ea(I,"AdfDhtmlToolbarPeer",!1);m("AdfDhtmlToolbarPeer",pB);pB.C=function(){r.bb(Vq);I.ra(this,D.Bc,D.gh,D.Oc)};m("AdfDhtmlToolbarPeer.InitSubclass",pB.C);pB.prototype.G=function(a,b){pB.h.G.call(this,a,b);var d=a.g(),e=I.j(d,"eoc"),f=q.b;if(this.Qk=(this.oe=f.getElementById(e))?!0:!1)e=I.j(d,"eoi"),this.Mn=f.getElementById(e),A.c.pr(a);this.lF=f.Cm(f.Ay(b.getElementsByTagName("table")[0],0));(this.kG=null==J.pSa(b))?this.Pa=J.mVa(b):this.Qk&&this.Mn.setAttribute("tabIndex","0")};
r.a("AdfDhtmlToolbarPeer.prototype.InitDomElement",{G:pB.prototype.G});pB.prototype.ue=function(){return!0};r.a("AdfDhtmlToolbarPeer.prototype.needsChildVisibilityChanges",{ue:pB.prototype.ue});pB.prototype.ya=function(){return!0};r.a("AdfDhtmlToolbarPeer.prototype.needsResizeNotify",{ya:pB.prototype.ya});pB.prototype.Cd=function(a,b){b||(b=[]);pB.h.Cd.call(this,a,b);1==this.Qk&&pl.ksa(a,b);return b};r.a("AdfDhtmlToolbarPeer.prototype.getDescendantComponents",{Cd:pB.prototype.Cd});
pB.prototype.ah=function(){this.kG&&(this.Pa&&this.Pa.setAttribute("tabIndex","-1"),this.Pa=J.oI(this.i()))};r.a("AdfDhtmlToolbarPeer.prototype.resetActiveDescendant",{ah:pB.prototype.ah});
pB.prototype.Sa=function(){var a=this.i(),b=this.f(),d=b.g();if(0!=this.Qk||b.getStretchId()){this.cY();if(1==this.Qk){if(!this.Va)for(this.Va=new pl(d,this,"end",null,null,this.kG),b=q.b,a=b.Cm(b.Ay(a.getElementsByTagName("table")[0],0)),b=0,d=a[0];d;)this.Va.Lp(),this.Va.addElement(d),d=C.pa(d),Vq.Bta(d)&&(d=this.rF(d),this.Va.Vr(d)),b++,d=a[b];this.Va.te()}this.fX();this.Pa&&(0<this.Pa.offsetWidth||0<this.Pa.offsetHeight)||this.ah()}};r.a("AdfDhtmlToolbarPeer.prototype.ResizeNotify",{Sa:pB.prototype.Sa});
pB.prototype.le=function(){A.c.Kc(this.f());return!1};r.a("AdfDhtmlToolbarPeer.prototype.ChildVisibilityChanged",{le:pB.prototype.le});pB.prototype.yk=function(){if(this.lu)v.l.fine("toolbar#GetPreferredWidth called, returned cached value of: "+this.lu);else{var a=this.i().firstChild;this.cY();this.Va&&this.Va.iI();this.lu=a.offsetWidth;this.fX();v.l.fine("toolbar#GetPreferredWidth called, returned calculated value of: "+this.lu)}return this.lu};
r.a("AdfDhtmlToolbarPeer.prototype.GetPreferredWidth",{yk:pB.prototype.yk});pB.prototype.wJ=function(){if(!this.Sj)if(0==this.Qk)this.Sj=this.yk();else if(this.lF&&0<this.lF.length){var a=this.Mn.style.display,b=this.Mn;b.style.display="block";var d=q.b.getComputedStyle(b);this.Sj=b.offsetWidth+q.Ma(d.marginLeft)+q.Ma(d.marginRight);b.style.display=a;a=this.yk();this.Sj>a&&(this.Sj=a)}else this.Sj=0;return this.Sj};r.a("AdfDhtmlToolbarPeer.prototype.GetMinimumWidth",{wJ:pB.prototype.wJ});
pB.prototype.ka=function(a){this.Va&&(this.Va.Yy(),delete this.Va);delete this.oe;delete this.Mn;delete this.lF;delete this.Qk;delete this.lu;delete this.Sj;A.c.bp(a);pB.h.ka.call(this,a)};r.a("AdfDhtmlToolbarPeer.prototype.ComponentRemoved",{ka:pB.prototype.ka});pB.prototype.ma=function(a){if(!a.Aa()){var b=q.b,d=a.na();b.wC()==D.Bc&&this.rp(d,a)}};r.a("AdfDhtmlToolbarPeer.prototype.HandleComponentKeyDown",{ma:pB.prototype.ma});
pB.prototype.Yb=function(a){if(!a.Aa()&&q.b.wC()==D.gh){var b=a.na();this.rp(b,a)}};r.a("AdfDhtmlToolbarPeer.prototype.HandleComponentKeyPress",{Yb:pB.prototype.Yb});pB.prototype.Ta=function(a){if(this.kG){var b=a.getSource(),d=a.U(),d=q.b.ca(d),e=b.g(),e=q.b.getElementById(e);e==this.i()&&(e=d);d==this.Mn?this.Pa!=d&&this.$x(d):Vq.lk(e)?(b=J.ym(e))&&this.Va.Taa(b):Vq.FTa(b)&&(b=J.ym(e))&&b!=this.Pa&&this.$x(b);a.cancel()}};r.a("AdfDhtmlToolbarPeer.prototype.HandleComponentFocus",{Ta:pB.prototype.Ta});
pB.prototype.Gj=function(a,b,d){pB.h.Gj.call(this,a,b,d);this.Qk&&this.Va.lk(b)&&this.Va.Baa()};r.a("AdfDhtmlToolbarPeer.prototype.SimulateMouseOnDescendant",{Gj:pB.prototype.Gj});pB.prototype.ad=function(a){this.bind(a);this.Sj=this.lu=null;a=this.af(a);var b=null!=a?a.o():null;b&&b.ad&&b.ad(a)};r.a("AdfDhtmlToolbarPeer.prototype.__preferredSizeChangeNotify",{ad:pB.prototype.ad});k=pB.prototype;k.cY=function(){var a=this.nM();a&&(a.parentNode.style.width="")};
k.fX=function(){var a=this.nM();if(a)if(Vq.lk(a))a.parentNode.style.width="100%";else{var b=q.b.getWindowWidth()+"px";a.parentNode.style.width=b}};k.rF=function(a){var b=this.nM(),b=a==b?"auto":"100%",d=a.ownerDocument.createElement("table");d.cellPadding=0;d.cellSpacing=0;d.style.width="100%";d.zo="presentation";var e=d.insertRow(-1),f=e.insertCell(-1);f.setAttribute(Vq.cE,"true");f.setAttribute("role","presentation");C.w(f,Vq.DR);a=this.Va.wY(a);f.appendChild(a);e.insertCell(-1).style.width=b;return d};
k.nM=function(){var a=this.f(),b=a.getStretchId();if(b){if(a=a.m(b))return b=a.g(),q.b.getElementById(b);v.l.warning("Unable to find client component for stretch id "+b)}return null};
k.rp=function(a,b){var d=b.U();if(!(d.ctrlKey||d.altKey||d.shiftKey||d.metaKey)){var d=q.b.ca(d),e=b.getSource().g(),e=q.b.getElementById(e);e==this.i()&&(e=d);if(Vq.lk(e))if(this.kG)switch(a){case w.ab:case w.ub:this.Va.P8(this.oe);b.cancel();break;case w.Ra:case w.vb:this.Va.O8(this.oe),b.cancel()}else switch(a){case w.ab:case w.ub:J.ni(d,this.oe);b.cancel();break;case w.Ra:case w.vb:J.be(d,this.oe),b.cancel()}else switch(a){case w.ub:this.kG&&this.LA()?(d=this.i(),(d=J.EO(d,this.Pa))?this.Pa=d:
pB.k6(this.Pa,!0)):(d=b.U(),d=q.b.ca(d),pB.k6(d,!0));b.cancel();break;case w.vb:this.kG&&this.LA()?(d=this.i(),(d=J.DO(d,this.Pa))?this.Pa=d:pB.k6(this.Pa)):(d=b.U(),d=q.b.ca(d),pB.k6(d)),b.cancel()}}};pB.k6=function(a,b){var d=b?J.rsa(a):J.tC(a);d&&J.va(d)};
pB.prototype.LA=function(){u.u(this.Pa);u.assert("0"==this.Pa.getAttribute("tabindex"),"The toolbar's active descendant should have tabindex 0");this.Pa||(v.l.warning("Toolbar has lost its assigned activeDescendant!"),this.ah());return null!=this.Pa};pB.prototype.$x=function(a){u.u(a);this.Pa&&this.Pa.setAttribute("tabIndex","-1");a.setAttribute("tabIndex","0");this.Pa=a};