YUI.add("widget-autohide",function(o,e){var t="visible";o.ClassNameManager.getClassName;function i(e){o.after(this._bindUIAutohide,this,"bindUI"),o.after(this._syncUIAutohide,this,"syncUI"),this.get("rendered")&&(this._bindUIAutohide(),this._syncUIAutohide())}i.ATTRS={hideOn:{validator:o.Lang.isArray,valueFn:function(){return[{node:o.one("document"),eventName:"key",keyCode:"esc"}]}}},i.prototype={_uiHandlesAutohide:null,destructor:function(){this._detachUIHandlesAutohide()},_bindUIAutohide:function(){this.after(t+"Change",this._afterHostVisibleChangeAutohide),this.after("hideOnChange",this._afterHideOnChange)},_syncUIAutohide:function(){this._uiSetHostVisibleAutohide(this.get(t))},_uiSetHostVisibleAutohide:function(e){e?o.later(1,this,"_attachUIHandlesAutohide"):this._detachUIHandlesAutohide()},_attachUIHandlesAutohide:function(){if(!this._uiHandlesAutohide){for(var e=this.get("boundingBox"),t=o.bind(this.hide,this),i=[],n=this.get("hideOn"),d=0,h={node:undefined,ev:undefined,keyCode:undefined};d<n.length;d++)h.node=n[d].node,h.ev=n[d].eventName,h.keyCode=n[d].keyCode,h.node||h.keyCode||!h.ev?h.node&&!h.keyCode&&h.ev?i.push(h.node.on(h.ev,t)):h.node&&h.keyCode&&h.ev&&i.push(h.node.on(h.ev,t,h.keyCode)):i.push(e.on(h.ev,t));this._uiHandlesAutohide=i}},_detachUIHandlesAutohide:function(){o.each(this._uiHandlesAutohide,function(e){e.detach()}),this._uiHandlesAutohide=null},_afterHostVisibleChangeAutohide:function(e){this._uiSetHostVisibleAutohide(e.newVal)},_afterHideOnChange:function(e){this._detachUIHandlesAutohide(),this.get(t)&&this._attachUIHandlesAutohide()}},o.WidgetAutohide=i},"patched-v3.18.4",{requires:["base-build","event-key","event-outside","widget"]});