//>>built
define("dijit/_HasDropDown","dojo/_base/declare,dojo/_base/Deferred,dojo/_base/event,dojo/dom,dojo/dom-attr,dojo/dom-class,dojo/dom-geometry,dojo/dom-style,dojo/has,dojo/keys,dojo/_base/lang,dojo/on,./registry,./focus,./popup,./_FocusMixin,./Viewport".split(","),function(r,s,g,t,n,i,j,o,p,k,h,l,u,q,m,v,w){return r("dijit._HasDropDown",v,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:!0,forceWidth:!1,maxHeight:0,dropDownPosition:["below","above"],
_stopClickEvents:!0,_onDropDownMouseDown:function(a){if(!this.disabled&&!this.readOnly)"MSPointerDown"!=a.type&&"pointerdown"!=a.type&&a.preventDefault(),this._docHandler=this.connect(this.ownerDocument,"mouseup","_onDropDownMouseUp"),this.toggleDropDown()},_onDropDownMouseUp:function(a){a&&this._docHandler&&this.disconnect(this._docHandler);var b=this.dropDown,f=!1;if(a&&this._opened){var c=j.position(this._buttonNode,!0);if(!(a.pageX>=c.x&&a.pageX<=c.x+c.w)||!(a.pageY>=c.y&&a.pageY<=c.y+c.h)){for(c=
a.target;c&&!f;)i.contains(c,"dijitPopup")?f=!0:c=c.parentNode;if(f){c=a.target;if(b.onItemClick){for(var d;c&&!(d=u.byNode(c));)c=c.parentNode;if(d&&d.onClick&&d.getParent)d.getParent().onItemClick(d,a)}return}}}if(this._opened){if(b.focus&&(!1!==b.autoFocus||"mouseup"==a.type&&!this.hovering))this._focusDropDownTimer=this.defer(function(){b.focus();delete this._focusDropDownTimer})}else this.focus&&this.defer("focus");if(p("touch"))this._justGotMouseUp=!0,this.defer(function(){this._justGotMouseUp=
!1})},_onDropDownClick:function(a){p("touch")&&!this._justGotMouseUp&&(this._onDropDownMouseDown(a),this._onDropDownMouseUp(a));this._stopClickEvents&&g.stop(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||
this.dropDownPosition[0]||"Down";i.add(this._arrowWrapperNode||this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);var a=this.focusNode||this.domNode;this.own(l(this._buttonNode,"mousedown",h.hitch(this,"_onDropDownMouseDown")),l(this._buttonNode,"click",h.hitch(this,"_onDropDownClick")),l(a,"keydown",h.hitch(this,"_onKey")),l(a,"keyup",h.hitch(this,"_onKeyUp")))},destroy:function(){this.dropDown&&(this.dropDown._destroyed||this.dropDown.destroyRecursive(),delete this.dropDown);
this.inherited(arguments)},_onKey:function(a){if(!this.disabled&&!this.readOnly){var b=this.dropDown,f=a.target;if(b&&this._opened&&b.handleKey&&!1===b.handleKey(a))g.stop(a);else if(b&&this._opened&&a.keyCode==k.ESCAPE)this.closeDropDown(),g.stop(a);else if(!this._opened&&(a.keyCode==k.DOWN_ARROW||(a.keyCode==k.ENTER||a.keyCode==k.SPACE)&&("input"!==(f.tagName||"").toLowerCase()||f.type&&"text"!==f.type.toLowerCase())))this._toggleOnKeyUp=!0,g.stop(a)}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&this.defer(h.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(q.curNode&&this.dropDown&&t.isDescendant(q.curNode,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return!0},loadDropDown:function(a){a()},loadAndOpenDropDown:function(){var a=new s,b=h.hitch(this,function(){this.openDropDown();a.resolve(this.dropDown)});this.isLoaded()?b():this.loadDropDown(b);return a},toggleDropDown:function(){!this.disabled&&!this.readOnly&&
(this._opened?this.closeDropDown():this.loadAndOpenDropDown())},openDropDown:function(){var a=this.dropDown,b=a.domNode,f=this._aroundNode||this.domNode,c=this;if(!this._preparedNode){this._preparedNode=!0;if(b.style.width)this._explicitDDWidth=!0;if(b.style.height)this._explicitDDHeight=!0}if(this.maxHeight||this.forceWidth||this.autoWidth){var d={display:"",visibility:"hidden"};if(!this._explicitDDWidth)d.width="";if(!this._explicitDDHeight)d.height="";o.set(b,d);d=this.maxHeight;if(-1==d)var d=
w.getEffectiveBox(this.ownerDocument),e=j.position(f,!1),d=Math.floor(Math.max(e.y,d.h-(e.y+e.h)));m.moveOffScreen(a);a.startup&&!a._started&&a.startup();var e=j.getMarginSize(b),g=d&&e.h>d;o.set(b,{overflow:g?"auto":"visible"});g?(e.h=d,"w"in e&&(e.w+=16)):delete e.h;this.forceWidth?e.w=f.offsetWidth:this.autoWidth?e.w=Math.max(e.w,f.offsetWidth):delete e.w;h.isFunction(a.resize)?a.resize(e):j.setMarginBox(b,e)}f=m.open({parent:this,popup:a,around:f,orient:this.dropDownPosition,onExecute:function(){c.closeDropDown(!0)},
onCancel:function(){c.closeDropDown(!0)},onClose:function(){n.set(c._popupStateNode,"popupActive",!1);i.remove(c._popupStateNode,"dijitHasDropDownOpen");c._set("_opened",!1)}});n.set(this._popupStateNode,"popupActive","true");i.add(this._popupStateNode,"dijitHasDropDownOpen");this._set("_opened",!0);this._popupStateNode.setAttribute("aria-expanded","true");this._popupStateNode.setAttribute("aria-owns",a.id);"presentation"!==b.getAttribute("role")&&!b.getAttribute("aria-labelledby")&&b.setAttribute("aria-labelledby",
this.id);return f},closeDropDown:function(a){this._focusDropDownTimer&&(this._focusDropDownTimer.remove(),delete this._focusDropDownTimer);if(this._opened)this._popupStateNode.setAttribute("aria-expanded","false"),a&&this.focus(),m.close(this.dropDown),this._opened=!1}})});