//>>built
define("dojox/grid/bidi/_BidiMixin","../../main dojo/_base/lang ../_Builder dijit/_BidiSupport ../_Grid ../cells/_base ../cells/dijit".split(" "),function(k,e,l,h,p,m,n){e.extend(p,{setCellNodeTextDirection:function(a,b,c){this.getCell(a).getNode(b).style.direction=c||""},getCellNodeTextDirection:function(a,b){return this.getCell(a).getNode(b).style.direction},_setTextDirAttr:function(a){this.textDir=a;this.render()}});e.extend(l._ContentBuilder,{_getTextDirStyle:function(a,b,c){var g=this.grid.getItem(c);
"auto"===a&&(b=b.get?b.get(c,g):b.value||b.defaultValue)&&(a=h.prototype._checkContextual(b));return" direction:"+a+";"}});e.extend(l._HeaderBuilder,{_getTextDirStyle:function(a,b,c){"auto"===a&&(b=c||b.name||b.grid.getCellName(b))&&(a=h.prototype._checkContextual(b));return" direction:"+a+"; "}});e.extend(m.Cell,{LRE:"\u202a",RLE:"\u202b",PDF:"\u202c",KEY_HANDLER:'onkeyup\x3d\' javascript:(function(){var target; if (event.target) target \x3d event.target; else if (event.srcElement) target \x3d event.srcElement; if(!target) return;var regExMatch \x3d /[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(target.value);target.dir \x3d regExMatch ? ( regExMatch[0] \x3c\x3d "z" ? "ltr" : "rtl" ) : target.dir ? target.dir : "ltr"; })();\'',
_getTextDirMarkup:function(a){var b="",c=this.textDir||this.grid.textDir;c&&("auto"===c&&(b=this.KEY_HANDLER,c=h.prototype._checkContextual(a)),b+=" dir\x3d'"+c+"'; ");return b},formatEditing:function(a,b){this.needFormatNode(a,b);return'\x3cinput class\x3d"dojoxGridInput" '+this._getTextDirMarkup(a)+' type\x3d"text" value\x3d"'+a+'"\x3e'},_enforceTextDirWithUcc:function(a,b){a="auto"===a?h.prototype._checkContextual(b):a;return("rtl"===a?this.RLE:this.LRE)+b+this.PDF}});e.extend(m.Select,{_getValueCallOrig:k.grid.cells.Select.prototype.getValue,
getValue:function(a){(a=this._getValueCallOrig(a))&&(this.textDir||this.grid.textDir)&&(a=a.replace(/\u202A|\u202B|\u202C/g,""));return a},formatEditing:function(a,b){this.needFormatNode(a,b);for(var c=['\x3cselect dir \x3d "'+(this.grid.isLeftToRight()?"ltr":"rtl")+'" class\x3d"dojoxGridSelect"\x3e'],g=0,d,f;void 0!==(d=this.options[g])&&void 0!==(f=this.values[g]);g++){f=f.replace?f.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):f;d=d.replace?d.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;"):
d;if(this.textDir||this.grid.textDir)d=this._enforceTextDirWithUcc(this.textDir||this.grid.textDir,d);c.push("\x3coption",a==f?" selected":"",' value \x3d "'+f+'"',"\x3e",d,"\x3c/option\x3e")}c.push("\x3c/select\x3e");return c.join("")}});e.extend(n.ComboBox,{getWidgetPropsCallOrig:k.grid.cells.ComboBox.prototype.getWidgetProps,getWidgetProps:function(a){a=this.getWidgetPropsCallOrig(a);if(this.textDir||this.grid.textDir)a.textDir=this.textDir||this.grid.textDir;return a}});e.extend(n._Widget,{getWidgetPropsCallOrig:k.grid.cells._Widget.prototype.getWidgetProps,
getWidgetProps:function(a){a=this.getWidgetPropsCallOrig(a);if(this.textDir||this.grid.textDir)a.textDir=this.textDir||this.grid.textDir;return a}})});