// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/lang dojo/on dojo/query dojo/aspect dojo/_base/array dojo/_base/html jimu/utils dojo/keys".split(" "),function(c,m,e,n,l,d,h,k){return{a11y_init:function(){d.setAttr(this.domNode,"aria-label",this.nls._widgetLabel)},a11y_updateFocusNodes:function(b){if(this._dijitDirections&&this._dijitDirections._widgetContainer){var a=e(".esriResultsSummary",this._dijitDirections._resultsNode);a&&a[0]&&(d.setAttr(a[0],"tabindex","0"),d.setAttr(a[0],"role","document"));a=e("input",this._dijitDirections._widgetContainer);
l.some(a,c.hitch(this,function(f){if(h.isDomFocusable(f))return h.initFirstFocusNode(this.domNode,f),b&&b.isFouceToFirstNode&&f.focus(),!0}));"none"===d.getStyle(this._dijitDirections._savePrintBtnContainer,"display")?h.initLastFocusNode(this.domNode,this._dijitDirections._clearDirectionsButtonNode):(a=null,(a=e(".esriPrintFooter",this._dijitDirections._resultsNode))&&a[0]?(d.setAttr(a[0],"tabindex","0"),a=a[0]):(a=e('[tabindex $\x3d"0"]',this._dijitDirections._resultsNode),a=a[a.length-1]),h.initLastFocusNode(this.domNode,
a));(a=e("[data-blur-on-click]",this._dijitDirections.domNode))&&!1===d.hasClass(this._dijitDirections.domNode,"WAB-508")&&(l.forEach(a,c.hitch(this,function(f){this.own(m(f,"keydown",c.hitch(this,function(g){g.keyCode!==k.ENTER&&g.keyCode!==k.SPACE||this._delayFocus(g.target)})))})),this.own(n.after(this._dijitDirections._travelModeSelector,"openDropDown",c.hitch(this,function(){var f=e(".dijitMenuItem",this._dijitDirections._travelModeSelector.dropDown.domNode);l.forEach(f,c.hitch(this,function(g){d.removeAttr(g,
"aria-label")}))}),this)),d.addClass(this._dijitDirections.domNode,"WAB-508"))}},a11y_initEvents:function(){this._dijitDirections&&this._dijitDirections._clearResultsHTML&&this.own(n.after(this._dijitDirections,"_clearResultsHTML",c.hitch(this,this.a11y_updateFocusNodes),this));this.own(m(this._dijitDirections._clearDirectionsButtonNode,"keydown",c.hitch(this,function(b){b.keyCode!==k.ENTER&&b.keyCode!==k.SPACE||setTimeout(c.hitch(this,function(){this._dijitDirections._clearDirectionsButtonNode.focus()}),
150)})))},a11y_focusWhenFinish:function(){var b=e(".esriResultsSummary",this._dijitDirections._resultsNode);b&&b[0]&&this._delayFocus(b[0])},_delayFocus:function(b){setTimeout(c.hitch(this,function(){b.focus()}),80)},a11y_hackAttr:function(){}}});