var jm=M.U(M,"AdfDhtmlCommandToolbarButtonPeer");v("AdfDhtmlCommandToolbarButtonPeer",jm);
jm.m=function(){M.ha(this,I.ec,I.jb,I.Xc,I.Xf);w.b.cd()[w.Vc]==w.Wc&&M.ha(this,I.Qd,I.Ve);M.hb(this,AdfRichCommandToolbarButton.DISABLED,AdfRichCommandToolbarButton.SELECTED,AdfRichCommandToolbarButton.SHORT_DESC,AdfRichCommandToolbarButton.TEXT);M.$b(this,AdfRichCommandToolbarButton.TEXT);this.jM="popEl";this.hM="popCtr";this.iM="popArea";this.Y6="popup";this.rf="_afrPopId";this.yL="_afrGrp";this.Zf="p_AFDepressed";this.ii="p_AFSelected";this.ve="_busy"};
v("AdfDhtmlCommandToolbarButtonPeer.InitSubclass",jm.m);jm.prototype.Za=function(a,b){jm.f.Za.call(this,a,b);this.CA=H.ta(b,"p_AFActionDisabled")};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.BindToComponent",{Za:jm.prototype.Za});jm.prototype.ba=function(a){if(!a.na()){var b=a.ia(),d=this.d(),e=this.an();if(this.Bl(a)){var f=this.CA&&(b==E.$a||b==E.zd);b==E.Ja||f?this.uP(e,l,a):b==E.zd&&(f=d.r(jm.ve),!d.getDisabled()&&!f&&(this.Xm(),a.cancel()))}b==E.xh&&(e||(e=d.e()),this.ob(d,e))}};
z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentKeyDown",{ba:jm.prototype.ba});jm.prototype.C=function(a){if(a.Jb()&&!this.CA&&!this.SO(a)&&this.Bl(a)){a=this.d();var b=a.r(jm.ve);!a.getDisabled()&&!b&&this.Xm()}};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentClick",{C:jm.prototype.C});jm.prototype.Ka=function(a){!this.d().getDisabled()&&this.Bl(a)&&this.wk(this.d())};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseOver",{Ka:jm.prototype.Ka});
jm.prototype.vb=function(a){var b=this.d();!b.getDisabled()&&this.Bl(a)&&(b.getSelected()?(this.Hb(b,l),this.vk(b)):(this.Hb(b,p),this.Gh(b)))};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseOut",{vb:jm.prototype.vb});jm.prototype.cc=function(a){var b=this.d();!b.getDisabled()&&(a.Jb()&&this.Bl(a))&&(this.Hb(b,p),this.wk(b))};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseUp",{cc:jm.prototype.cc});
jm.prototype.qa=function(a){var b=this.d(),d=a.Jb();if(!b.getDisabled()&&(d&&this.Bl(a))&&(this.Hb(b,l),this.vk(b),this.CA||this.SO(a)))b=this.an(),this.uP(b,p,a)};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.HandleComponentMouseDown",{qa:jm.prototype.qa});jm.prototype.Od=function(a,b,d){var e=H.Ua(b,"A");d==l?(H.n(b,M.gb),e.removeAttribute("href"),this.Yw(a),this.TB(a),e.setAttribute(O.Jg,"false")):(H.F(b,M.gb),e.setAttribute("href","#"),this.Gh(a),this.IB(a),e.setAttribute(O.Jg,"true"))};
z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentDisabledChanged",{Od:jm.prototype.Od});jm.prototype.Zn=function(a,b,d){var e=a.getType();d?(this.Hb(a,l),H.n(b,jm.ii),this.vk(a),"radio"==e&&(this.Px(),this.n$(a)),"check"==e&&this.o$(a)):(this.Hb(a,p),H.F(b,jm.ii),this.Gh(a),"radio"==e&&this.U9(a),"check"==e&&this.V9(a))};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentSelectedChanged",{Zn:jm.prototype.Zn});
jm.prototype.Jv=function(a,b,d){b.setAttribute("title",d);if(a=this.zk(a))a.setAttribute("title",d),a.setAttribute("alt",d)};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.ComponentShortDescChanged",{Jv:jm.prototype.Jv});jm.prototype.Qf=H.yA;jm.prototype.Aa=function(){return ng.Hc()};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.GetInlineEditor",{Aa:jm.prototype.Aa});
jm.prototype.Xb=function(a,b){var d=M.g(a.e(),jm.iM);if(d=(d=w.b.getElementById(d))?H.nc(d):b){if(d=H.Ua(d,"span"))if(d=w.b.Mb(d),""!=d)return d;return n}B.assert(p,"Unable to find the element containing the text")};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.GetComponentText",{Xb:jm.prototype.Xb});jm.prototype.gd=function(a){var b=this.d(),d=this.h();H.Se(d)&&(!b.getDisabled()&&!F.c.Dg())&&(H.td(a,d,M.gb),b.setProperty(jm.ve,a,p,J.Pc))};
z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.SetBusy",{gd:jm.prototype.gd});jm.prototype.Va=function(a,b,d){jm.f.Va.call(this,a,b);a=a.e();d==a&&(d=M.Na(a,jm.hM),(d=w.b.getElementById(d))&&d.appendChild(b))};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.PopupClosed",{Va:jm.prototype.Va});jm.prototype.uc=function(a){this.bind(a);a=this.Ee(a);var b=a!=n?a.k():n;b&&b.uc&&b.uc(a)};z.a("AdfDhtmlCommandToolbarButtonPeer.prototype.__preferredSizeChangeNotify",{uc:jm.prototype.uc});u=jm.prototype;
u.Xm=function(){var a=this.d(),b=new bb(a);b.v(a.getPartialSubmit());b.na()||(b=a.getType(),"check"==b?a.setSelected(!a.getSelected()):"radio"==b&&this.Px())};
u.uP=function(a,b,d){var e=this.d(),f=e.e(),g=M.Na(f,jm.jM);if(w.b.getElementById(g))if(g=this.h(),a!=n)e=F.c.j(a).k(),a={},a.alignElement=g,a[AdfRichPopup.fd]=AdfRichPopup.of,a.focus=b,e.show(a),d.cancel();else{a=M.Na(f,jm.hM);var h=w.b.getElementById(a);if(h!=n){for(var m=h.firstChild;m&&8==m.nodeType;)m=m.nextSibling;if(m!=n){a={};var q=M.Na(f,jm.Y6);m.id!=q&&(h=h.ownerDocument.createElement("div"),h.appendChild(m),m=h,m.id=q);a.autodismiss="autodismissAlways";a.alignElement=g;a[AdfRichPopup.fd]=
AdfRichPopup.of;a.focus=b;this.fe(e,m,a,f);d.cancel()}}}};u.Px=function(){for(var a=this.d(),b=this.h(),b=this.Pt(b),d=a.getParent(),d=d.k().ce(d),e=0;e<d.length;e++){var f=d[e],g=M.Ib(f),g=this.Pt(g);b==g&&f!=a&&(f.getType&&"radio"==f.getType())&&this.Rda(f)}a.setSelected(l)};u.Pt=function(a){return a.getAttribute(jm.yL)};u.Rda=function(a){a.setSelected(p);this.Hb(a,p);this.Gh(a)};u.zk=function(a){a=a.e();a=M.Na(a,"icon");return w.b.getElementById(a)};u.Gh=function(a){this.$c(a,n)};
u.vk=function(a){this.$c(a,a.getDepressedIcon())};u.wk=function(a){a.getSelected()||this.$c(a,a.getHoverIcon())};u.Yw=function(a){this.$c(a,a.getDisabledIcon())};u.$c=function(a,b){var d=a.getIcon(),e=this.zk(a);e&&d&&(e.src=b||d)};u.Hb=function(a,b){var d=M.Ib(a),e=jm.Zf;b?H.n(d,e):H.F(d,e)};u.SO=function(a){var b=this.d().e(),d=M.Na(b,jm.iM);for(a=a.Q();a!=n&&a.id!=b;){if(a.id==d)return l;a=a.parentNode}return p};
u.an=function(){var a=this.d(),a=M.Na(a.e(),jm.jM),a=w.b.getElementById(a);if(!a)return n;var a=a.parentNode,b=a.getAttribute(jm.rf);b==n&&(b=a.parentNode.getAttribute(jm.rf));return b};u.Bl=function(a){var b=a.Q();a=this.an();for(var d=a!=n,e=this.h();b.parentNode&&!(d&&a==b.id);b=b.parentNode)if(b==e)return l;return p};u.o$=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-pressed","true")};
u.V9=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-pressed","false")};u.n$=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"true")};u.U9=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));var b="button"==a.getAttribute("role").toLowerCase()?"aria-pressed":"aria-checked";a.setAttribute(b,"false")};
u.TB=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.setAttribute("aria-disabled","true")};u.IB=function(){var a=this.h();"A"!=a.tagName&&(a=H.qc(a,"a",0));a.removeAttribute("aria-disabled")};