!function(){function e(t){var i;(i=t._upload)&&(t._uplder=new zul.Upload(t,null,i))}function n(t){var i;(i=t._uplder)&&(t._uplder=null,i.destroy())}var t,i=zul.wgt.Button=zk.$extends(zul.LabelImageWidget,{_orient:"horizontal",_dir:"normal",_type:"button",$define:{href:null,target:null,dir:t=function(){this.updateDomContent_()},orient:t,type:t,disabled:[function(t,i){if(i&&i.adbs?this._adbs=!0:i&&void 0!==i.adbs||(this._adbs=!1),!t)if(this._adbs)this._adbs=!1;else if(i&&!1===i.adbs)return this._disabled;return t},function(t){function i(){s.desktop&&(jq(s.$n()).attr("disabled",t?"disabled":null),s._upload&&(t?n:e)(s))}var s=this;"submit"==this._type?setTimeout(i,50):i()}],autodisable:null,upload:function(t){this.$n()&&!this._disabled&&(n(this),t&&"false"!=t&&e(this))}},focus_:function(t){var i=this,s=this.$n();return s&&s.disabled?(this._delayFocus||(this._delayFocus=!0,zk.currentFocus=this,setTimeout(function(){i.desktop&&!i.isDisabled()&&zk.currentFocus==i&&(zk.focusBackFix&&i._upload||zk(i.$n()).focus(t)),i._delayFocus=null},0)),!1):(zk.focusBackFix&&this._upload||zk(s).focus(t),!0)},domContent_:function(){var t=zUtl.encodeXML(this.getLabel()),i=this.getImage(),s=this.domIcon_();if(!i&&!s)return t;i=i?'<img class="'.concat(this.$s("image"),'" src="').concat(i,'" alt="" aria-hidden="true" />').concat(s?" "+s:""):s,s="vertical"==this.getOrient()?"<br/>":" ";return"reverse"==this.getDir()?t+s+i:i+s+t},onShow:function(){this.$n()&&!this._disabled&&this._uplder&&this._uplder.sync()},bind_:function(){this.$supers(i,"bind_",arguments);var t=this.$n();this.domListen_(t,"onFocus","doFocus_").domListen_(t,"onBlur","doBlur_"),zWatch.listen({onShow:this}),!this._disabled&&this._upload&&e(this)},unbind_:function(){n(this);var t=this.$n();this.domUnlisten_(t,"onFocus","doFocus_").domUnlisten_(t,"onBlur","doBlur_"),zWatch.unlisten({onShow:this}),this.$supers(i,"unbind_",arguments)},doClick_:function(t){var i,s;t.domEvent&&(this._disabled||(this._upload?(!zk.ie||10<zk.ie)&&this._uplder.openFileDialog():zul.wgt.ADBS.autodisable(this),this.fireX(t),t.stopped||(s=!!(i=this._href)&&i.toLowerCase().startsWith("mailto:"),i&&(s?(s=jq.newFrame("mailtoFrame",i,null),jq(s).remove()):zUtl.go(i,{target:this._target||(t.data.ctrlKey?"_blank":"")})),this.$super("doClick_",t,!0))))},setFlexSize_:function(t){var i=this.$n();void 0!==t.height&&("auto"==t.height?i.style.height="":""!=t.height?i.style.height=jq.px0(parseInt(t.height)):i.style.height=this._height||""),void 0!==t.width&&("auto"==t.width?i.style.width="":""!=t.width?i.style.width=jq.px0(parseInt(t.width)):i.style.width=this._width||"")},shallIgnoreClick_:function(t){return this.isDisabled()}});zul.wgt.ADBS=zk.$extends(zk.Object,{$init:function(t){this._ads=t},onResponse:function(){for(var t,i=this._ads;t=i.shift();)t.setDisabled(!1,{adbs:!1,skip:!0}),zk.chrome&&t.domListen_(t.$n(),"onBlur","doBlur_");zWatch.unlisten({onResponse:this})}},{autodisable:function(t){var i,s,e;if(n=t._autodisable){zk.chrome&&t.domUnlisten_(t.$n(),"onBlur","doBlur_");for(var n,o=(n=n.split(",")).length;o--;){var l,d=n[o].trim();d&&((d="self"==(d=(l="+"==d.charAt(0))?d.substring(1):d)?t:t.$f(d))==t&&(s=t._uplder,t._uplder=null,t._autodisable_self=!0),d&&!d._disabled&&(d.setDisabled(!0,{adbs:!0,skip:!0}),t.inServer&&(l?d.smartUpdate("disabled",!0):i?i.push(d):i=[d])))}}i&&(e=new zul.wgt.ADBS(i),s?(s._aded=e,t._uplder=s):t.isListen("onClick",{asapOnly:!0})?zWatch.listen({onResponse:e}):setTimeout(function(){return e.onResponse()},800))}})}();