/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(){function t(n,t){this._include=t,this._owner=n}return t.prototype.Check=function(n,t){var i={},r,u;i.success=!1,i.strValue="",i.index=t,r=n.Substring(t,t+1),u=this.IsValid(r);if(u)return n=n.Substring(t,t+1),t++,i.strValue=n,i.index=t,i;if(this._owner.GetAutoConvert()&&(r.length==1||r.length==3)){i=this.Convert(n,t);if(i.success==!0)return i}return i},t.prototype.IsValid=function(t){if(t.length==2&&(t.charCodeAt(1)==65438||t.charCodeAt(1)==65439))if(!n.CharProcess.CharEx.IsFullWidth(t)&&n.CharProcess.CharEx.IsKatakana(t))return this.IsValidTwoByte(t);return t.length>1?this.IsValidMoreByte(t):this.IsValidTwoByte(t)},t.prototype.IsValidTwoByte=function(n){return!1},t.prototype.IsValidMoreByte=function(n){return!1},t.prototype.Convert=function(t,i){var r={},e,u,f,l,o,a,c,v,h,s;r.success=!0,r.strValue="",r.index=i,e=t.Substring(i,i+1),f=n.CharProcess.CharEx;if(f.IsAlphabet(e)){o=f.IsLower(e)?e.toUpperCase():e.toLowerCase(),u=this.IsValid(o);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=o,r;e=f.IsFullWidth(e)?f.ToHalfWidth(e):f.ToFullWidth(e).text,u=this.IsValid(e);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=e,r;return o=f.IsFullWidth(o)?f.ToHalfWidth(o):f.ToFullWidth(o).text,u=this.IsValid(o),u&&this._include||!u&&!this._include?(i++,r.index=i,r.strValue=o,r):(r.success=!1,r)}if(f.IsHiragana(e)){if(f.IsLowerKana(e)){h=f.ToUpperKana(e),u=this.IsValid(h);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=h,r}else if(f.HasLowerKana(e)){s=f.ToLowerKana(e),u=this.IsValid(s);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=s,r}e=f.ToKatakana(e),u=this.IsValid(e);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=e,r;if(f.IsLowerKana(e)){h=f.ToUpperKana(e),u=this.IsValid(h);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=h,r}else if(f.HasLowerKana(e)){s=f.ToLowerKana(e),u=this.IsValid(s);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=s,r}l=f.ToHalfWidthEx(e),u=this.IsValid(l);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=l,r;if(f.IsLowerKana(l)){l=f.ToUpperKana(l),u=this.IsValid(l);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=l,r}else if(f.HasLowerKana(l)){l=f.ToLowerKana(l),u=this.IsValid(l);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=l,r}return r.success=!1,r}if(f.IsKatakana(e)){if(f.IsLowerKana(e)){h=f.ToUpperKana(e),u=this.IsValid(h);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=h,r}else if(f.HasLowerKana(e)){s=f.ToLowerKana(e),u=this.IsValid(s);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=s,r}o=e,a=!1;if(f.IsFullWidth(e)){c=f.ToHalfWidthEx(e);if(c.GetLength()>0){u=this.IsValid(c);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=c,r}if(f.IsLowerKana(c)){c=f.ToUpperKana(c),u=this.IsValid(c);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=c,r}else if(f.HasLowerKana(c)){c=f.ToLowerKana(c),u=this.IsValid(c);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=c,r}}else{if(i==null){o=f.ToFullWidth(e).text;if(!f.IsKatakana(o))return r;u=this.IsValid(o);if(u&&this._include||!u&&!this._include)return i++,r.index=i,r.strValue=o,r}else{i+10){e=this.IsValid(f);if(e)return r++,u.index=r,u.strValue=f,u}return t.prototype.Convert.call(this,i,r)},i}(t),n.IVSFilter=i,e=function(t){function i(){t.apply(this,arguments)}return __extends(i,t),i.prototype.IsValidTwoByte=function(t){return n.CharProcess.CharEx.IsSurrogatePair(t)?!0:t=="\r"||t=="\n"?!0:!1},i.prototype.IsValidMoreByte=function(t){if(t.length>=3)return!1;for(var i=0;i-1||this._excludeChars!=""&&this._excludeChars.IndexOf(n)==-1?!0:n=="\r"||n=="\n"?!0:!1},t}(t),n.LimitedFilter=o,h=function(n){function t(t,i,r,u){n.call(this,r,u),this._startChar=t,this._endChar=i}return __extends(t,n),t.prototype.IsValidTwoByte=function(n){return n>=this._startChar&&n<=this._endChar?!0:n=="\r"||n=="\n"?!0:!1},t}(t),n.RangeFilter=h,s=function(t){function f(n,i){t.call(this,n),this._include=i,this._filterArray=[]}return __extends(f,t),f.prototype.Add=function(n){if(n==null)return;n instanceof u?this._hiranagaFilter=n:n instanceof r&&(this._katakanaFilter=n),this._filterArray.push(n)},f.prototype.IsValidTwoByte=function(n){var r,i,u,t;if(this._filterArray.length==0)return n=="\r"||n=="\n"?!0:!1;for(r=!1,i=!1,t=0;t0){e=this.IsValid(f);if(e)return r++,u.index=r,u.strValue=f,u}}return t.prototype.Convert.call(this,i,r)},f.prototype.IsContainIVSFilter=function(){for(var n=0;nt)return!1;if(i==null)return!1;this._minLength=n,this._maxLength=t,this._filter=i,this._bitState=r,this._oldBitState=r,this._undoBitState=r,this._trueLength=0,f=0;if(this._bitState!=null){while(this._bitState[f]!=null)f++;for(u=f;u>=0;u--)if(this._bitState[u]!=null)this._bitState[u]==!1&&this._trueLength--;else if(this._bitState[u]==null)this._trueLength--;else break}return this.Clear(),!0},i.prototype.InitialText=function(n){while(n.IndexOf("@#GCD#@")!=-1)n=n.replace("@#GCD#@","'");while(n.IndexOf("@#GCM#@")!=-1)n=n.replace("@#GCM#@",'"');this.text=n,this.oldText=n,this._undoText=n,this._undoTempText=n},i.prototype.GetStatus=function(){return this._trueLength>=this._minLength&&this._trueLength>0?n.FieldStatus.Full:this._trueLength>0&&this._trueLength=this._minLength&&this._trueLength>0){for(var n=0;nthis._maxLength||i==""||i.GetLength()==0)return c;var e="",h=0,l=[],o=t;for(v=0;v=this._minLength&&t+e.GetLength()==this._trueLength+e.GetLength())break;y=!0,h++;break}else{a!=""?(u&&u!=""&&u.Substring(o,o+1)==n.Utility.MaskValChar[0]?(e+=this.GetPromptChar(),l[o]=!1):a=="\r"||a=="\n"?(e+=this.GetPromptChar(),l[o]=!1):(e+=a,l[o]=!0),o++,a.GetLength()==2&&(l[o]=!0,o++)):(e+=this.GetPromptChar(),h++,l[o]=!1,o++);if(t+e.GetLength()==this._maxLength)break;else if(t+e.GetLength()>this._maxLength){e=e.Substring(0,e.GetLength()-1);break}}}t+e.GetLength()this._maxLength&&(s=s.Substring(0,this._maxLength));if(s.GetLength()>t+e.GetLength())for(f=1;f<=s.GetLength()-t-e.GetLength();f++)this._bitState[t+f]!=null&&(l[o]=this._bitState[t+f],o++);for(this._bitState=new Array(o),this._bitState=l,this._trueLength=o,f=o-1;f>=0;f--)if(this._bitState[f]==!1)this._trueLength--;else break;if(s.GetLength()this._minLength;f--)if(s.Substring(f-1,f)==this.GetPromptChar()&&f>this._trueLength)s=s.Substring(0,f-1);else break;return this.text=s,i=h==i.GetLength()?"":i.Substring(h,i.GetLength()),t+=e.GetLength(),c.offset=t,c.text=i,c},i.prototype.SaveOldState=function(){this.oldText=this.text,this._oldBitState=this._bitState},i.prototype.SaveUndoState=function(){this._undoText=this.text,this._undoTempText=this.text,this._undoBitState=this._bitState},i.prototype.GetValue=function(){},i.prototype.UpdateState=function(){},i.prototype.RollBack=function(){var t,n;if(this.oldText==this.text)return;else for(t=this.oldText,this.text=t,this._bitState=this._oldBitState,this._trueLength=t.GetLength(),n=t.GetLength()-1;n>=0;n--)if(this._bitState[n]==!1)this._trueLength--;else break},i.prototype.Undo=function(){var t,i,n;if(this._undoTempText==this.text)return!1;else{t=this._undoTempText,this._undoTempText=this.text,i=this._bitState,this.text=t,this._bitState=this._undoBitState,this._trueLength=t.GetLength();if(this._bitState.length==0)this._trueLength=0;else for(n=t.GetLength()-1;n>=0;n--)if(this._bitState[n]==!1)this._trueLength--;else break;return this._undoBitState=i,!0}},i.prototype.Clear=function(){var t,i,n;this._trueLength=0,t="",i=[];if(this._minLength>0){for(n=0;nthis._maxLength||t==""||t.GetLength()==0)return h;for(c=[],e=n,a=0;a=this._minLength&&n+f.GetLength()>=this._trueLength+f.GetLength())break;v=!0,s++;continue}else{l!=""||r||t.CharAt(s)!=" "?l=="\r"||l=="\n"?(f+=this.GetPromptChar(),c[e]=!1,e++):(f+=l,c[e]=!0,e++,l.GetLength()==2&&(c[e]=!0,e++)):(f+=this.GetPromptChar(),c[e]=!1,e++,s++);if(n+f.GetLength()==this._maxLength)break;else if(n+f.GetLength()>this._maxLength){f=f.Substring(0,f.GetLength()-1);break}}}if(f.GetLength()==0)return t=t.Substring(s,t.GetLength()-s),h.existInvalid=v,h.exception=!0,h;o=this.text.Substring(0,n)+f+this.text.Substring(n,this.text.GetLength()),o.GetLength()>this._maxLength&&(o=o.Substring(0,this._maxLength));if(o.GetLength()>n+f.GetLength())for(u=0;u=0;u--)if(this._bitState[u]==!1)this._trueLength--;else break;if(o.GetLength()this._minLength;u--)if(o.Substring(u-1,u)==this.GetPromptChar()&&u>this._trueLength)o=o.Substring(0,u-1);else break;return this.text=o,t=s==t.GetLength()?"":t.Substring(s,t.GetLength()),n+=f.GetLength(),h.offset=n,h.text=t,h},i.prototype.Replace=function(n,t,i,r){var u={},e,o,f;return u.offset=n,u.text=i,t==0?u:(e=i.charCodeAt(0),o=[12364,12460,12366,12462,12376,12472],o.indexOf(e)!==-1&&t===1&&(f=this._filter.Check(i,0),f.strValue&&f.strValue.length===2&&(t=2)),n=this.Delete(n,t),u=this.Insert(n,i,r))},i.prototype.Delete=function(n,t){var u,r,e,f,o,i;if(t==0||n>=this.text.GetLength())return n;for(n+t>this.text.GetLength()&&(t=this.text.GetLength()-n),u=[],r=n,e=0;e=0;i--)if(this._bitState[i]==!1)this._trueLength--;else break;if(f.GetLength()0&&v.Substring(0,y.GetLength())!=y)continue;while(o[r]=v.length)break;b=this.JudgeIfValid(v,s[r],t,o[r]),s[r]=b.index1,o[r]=b.index2,b.isValid?h[r]==99999&&(h[r]=o[r]):o[r]++}}var u=0,w=0,g=!1,c=s[u];for(e=0;e=this.text.GetLength())return n;n=0,this._activeItem=-1,this.text="";if(this._minLength>0)for(var i=0;i=0&&t0;n--)if(this.text.Substring(n-1,n)==this.GetPromptChar())i++;else break;this._trueLength=this.text.GetLength()-i}},i.prototype.SaveUndoState=function(){this._undoText=this.text,this._undoTempText=this.text,this._undoItem=this._activeItem},i.prototype.Undo=function(){var i,t,n;if(this._undoTempText==this.text)return;else{this._undoTempText=this.text,i=this._activeItem,this._activeItem=this._undoItem,this._undoItem=i;if(this._activeItem>=0&&this._activeItem0;n--)if(this.text.Substring(n-1,n)==this.GetPromptChar())t++;else break;this._trueLength=this.text.GetLength()-t}},i.prototype.SetText=function(n,t,i){var o,l,f,c,u,a;t!=null&&(t=t.replace(/[\r\n]/g,""));for(var e=new Array(this._itemCount),h=new Array(this._itemCount),s=new Array(this._itemCount),r=0;re[r]){s[r]=!0;break}if(h[r].toString().GetLength()==f.GetLength()&&e[r].toString().GetLength()=this._maxLength){l=r;break}}c=l,u={},u.existInvalid=!1,u.exception=!1;if(c1)while(u1)while(u<-t)t+=u;else t=-1;return t==0?n:(this._activeItem==-1?r=t>0?0:u-1:(r=this._activeItem+t,(r<0||r>=u)&&(i?(r=t>0?r-u:r+u,t>0&&rthis._activeItem&&(r=this._activeItem>0?0:u-1)):r=t>0?u-1:0)),f=this._items[r].toString().GetLength(),n=Math.min(n,f),this._activeItem=r,this.text=this._items[r].toString(),this._trueLength=this._activeItem==-1?0:this.text.GetLength(),n)},i.prototype.Clear=function(){this._activeItem=-1},i.prototype.JudgeIfValid=function(t,i,r,u){var e=n.CharProcess.CharEx,f={},a,v,c,l,y,o,w,h,s,k,b;f.index1=i,f.index2=u,f.isValid=!1;if(i>=t.GetLength())return f;if(t.Substring(i,i+1)==r.Substring(u,u+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;else{if(this._owner.GetAutoConvert()==!1)return f;if(r.Substring(u,u+1).charCodeAt(0)<65345||r.Substring(u,u+1).charCodeAt(0)>65370)if(r.Substring(u,u+1).charCodeAt(0)<65313||r.Substring(u,u+1).charCodeAt(0)>65338)if(e.IsUpper(r.Substring(u,u+1))){a=r.Substring(u,u+1).toLowerCase();if(a==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;l=e.ToFullWidth(r.Substring(u,u+1)).text;if(l==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;return c=e.ToFullWidth(a).text,c==t.Substring(i,i+1)?(i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f):f}else if(e.IsLower(r.Substring(u,u+1))){v=r.Substring(u,u+1).toUpperCase();if(v==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;c=e.ToFullWidth(r.Substring(u,u+1)).text;if(c==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;return l=e.ToFullWidth(c).text,l==t.Substring(i,i+1)?(i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f):f}else if(e.IsHiragana(r.Substring(u,u+1))){h=e.ToKatakana(r.Substring(u,u+1));if(h==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;y=e.ToKatakana(h),o=e.ToHalfWidthEx(y);if(o.length==1&&o==t.Substring(i,i+1))return i++,u++,f.index1=i,f.index2=u,f.isValid=!0,f;else if(o.length==2&&o.Substring(0,1)==t.Substring(i,i+1)&&i+10){t=this._uIProcess.Focus(this._focusType,this._realInputElement,this.GetHighlightText(),this._cursorPosition,this.SelectionStart);if(t==null)return;t.Text!=null&&(this.Text=t.Text,i=this._GetRealForeColor(!0,!1),this._uIUpdate.SetForeColor(i)),t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd),this._japInput==!0&&(this._truePosition!=-1&&(this.SelectionStart=this._truePosition,this.SelectionEnd=this._truePosition),this._japInput=!1),this.GetReadOnly()==!0&&this._focusType==n.FocusType.None&&(this.SelectionStart=0,this.SelectionEnd=this.Text.length),this.UpdateDisplayText(this.Text),this.SetSelection(this.SelectionStart,this.SelectionEnd,!0),this._IsDrop||this._focusType==n.FocusType.ClientEvent||this._focusType==n.FocusType.SpinButton||this._focusType==n.FocusType.DropDown||(this._oldValue=this.Value)}else this.UpdateDisplayText(this.Text),this.SetSelection(this.SelectionStart,this.SelectionEnd),this._oldValue=this.Value},i.prototype.LoseFocus=function(){var u=this,r,i,f,t;this.FireKeyExit(),r=this._imeMode,n.Utility.IsIE?this.ImeInput("LoseFocusInput"):this.ImeInput("ReInput",!0),this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close();if(this._spinBtnPressed)return;this.SetLastClientValues(),i=this._uIProcess.LoseFocus(),this.DisplayText=i.Text,this.Value=i.Value,this.Text=this._uIProcess._format.Fields.GetText(),(n.Utility.IsIE||!r)&&this.UpdateDisplayText(this.DisplayText),!n.Utility.IsIE&&r&&this.UpdateDisplayText(this.DisplayText),f=this._GetRealForeColor(!1,!1),this._uIUpdate.SetForeColor(f),this._focusType=n.FocusType.None,i.EventInfo!=null&&(t=this._uIProcess.FireEvent(this,i.EventInfo.Name,i.EventInfo.Args,i.EventInfo.Type),t!=null&&(this._focusType=t)),!n.Utility.IsIE&&this.DisplayText!=this._uIUpdate.GetText()&&r&&window.setTimeout(function(){u.UpdateDisplayText(u.DisplayText)},0),this.GetHighlightText()==n.HighlightText.All&&(this.SelectionStart=0),this._shouldFireValueChangedEvent()&&(t=this.FireClientEvent("TextChanged",null),t!=null&&(this._focusType=t),t=this.FireClientEvent("ValueChanged",null),t!=null&&(this._focusType=t),this._oldText=this._uIProcess._format.Fields.GetText(),this._oldFocusText=this._uIProcess._format.Fields.GetText(),n.Utility.FireSystemEvent(this._realInputElement,"onchange",this._standardClientEvents.onchange),this._getAutoPostBack()&&!n.Utility.__ignorePostBack&&typeof window.__doPostBack!="undefined"&&n.Utility.DoPostBack(this._getServerUniqueId(),"TextChanged",this.GetCausesValidation(),this.GetValidationGroup(),"",!1,!0)),this._shouldFireOnLeaveEvent=!0},i.prototype._shouldFireValueChangedEvent=function(){return this._oldText!=this.Text},i.prototype.MouseDown=function(i){var u,r;if(n.Utility.IsTouchMouseDown==!0&&this._focused){u=this._getInnerShowTouchToolBarValue()&n.TouchToolBarDisplayOptions.TapSelection;if(u!=0&&this._touchToolBar!=null)if(n.Utility.IsClickInSelection(i)){n.Utility.PreventDefault(i);return}}r=n.Utility.GetMouseButton(i),this._focusedWhenMouseDown=document.activeElement==i.srcElement,this._mouseDownOnClearButton=n.Utility.IsMouseDownOnClearButton(i),t.prototype.MouseDown.call(this,i),this._mouseButton==n.MouseButton.Right?this._focusType=n.FocusType.ContextMenu:this._mouseButton=n.MouseButton.Left,this._uIProcess.isDblClick=!1,!n.Utility.IsIE&&this._imeMode&&r==n.MouseButton.Left&&(this._isImplementImeInput=!0)},i.prototype.MouseUp=function(i){var r=this;if(!n.Utility.IsIE&&this._imeMode){if(!this._isImplementImeInput)return;this._isImplementImeInput=!1}this._lastStart=this.SelectionStart,this._lastEnd=this.SelectionEnd,t.prototype.MouseUp.call(this,i),this._imeMode&&(this.SelectionStart=this._lastStart,this.SelectionEnd=this._lastEnd,n.Utility.IsIE?this.ImeInput("ClickInput"):this.ImeInput("ReInput",!0),n.Utility.IsIE||this.Text==this._uIUpdate.GetText()||window.setTimeout(function(){r.UpdateDisplayText(r.Text)},0)),this._mouseUpPointerType==undefined&&(this._mouseUpHasValue=i.srcElement.value.length>0),this.HandleClearButton(i)},i.prototype.KeyDown=function(r){var o=r.keyCode,f={},u,h,e,s;f.Shift=!1,f.Ctrl=!1,f.Alt=!1,r.shiftKey&&(f.Shift=!0),r.ctrlKey&&(f.Ctrl=!0),r.altKey&&(f.Alt=!0),u={},h=this._imeMode,this._imeMode=!1;if(o==229)return n.Utility.IsIE8OrBelow&&(this._imeMode=!0),!0;return this._imeMode||!h||f.Shift||f.Ctrl||o!=n.Key.Tab&&o!=65545&&(this.ImeInput("ReInput",!0),this._imeSelectTimes=0),u.KeyCode=o,u.Text=this.Text,u.DisplayText=this._uIUpdate.GetText(),u.FuncKeysPressed=f,u.SelectionStart=this.SelectionStart,u.SelectionEnd=this.SelectionEnd,u.EditMode=this._getEditModeInternal(),u.ReadOnly=this.GetReadOnly(),u.ClipContent=this.GetClipContent(),u.ExitOnLastChar=this.GetExitOnLastChar(),u.ExitOnLeftRightKey=this.GetExitOnLeftRightKey(),u.TabAction=this.GetTabAction(),e=t.prototype.KeyDown.call(this,u),n.Utility.IsIE8OrBelow&&(this.IsJapanConvertKeyPress&&(s=i.Mask_ImeResponse,this._imeMode=!1,this.IsJapanConvertKeyPress=!1,this.ImeInput("ReInput",!0),this._imeSelectTimes=0,i.Mask_ImeResponse=s),this._imeMode==!0&&(i.Mask_ImeResponse=!0)),o==n.Key.Escape?(e==null&&(e={}),e.isShortcutKey!==!0&&(e.System=!0),e.System):e.inputChar!=null?!0:(f.Shift||f.Ctrl||f.Alt)&&e==null?!0:e.System},i.prototype.KeyPress=function(t,i){var o=i.keyCode||i.charCode,s=o==192&&i.altKey,h,r,f,e,u;if(!n.Utility.IsIE&&this._imeMode)if(s)return this.ImeInput("ReInput",!0),!1;if(!n.Utility.IsIE&&(o==229||s))return!1;h=t,r=this._uIProcess.KeyPress(this._realInputElement,this.SelectionStart,this.SelectionEnd,this.GetExitOnLastChar(),h);if(this._japInput!=!0){r.SelectionStart!=null&&(this._newSelectionStart=r.SelectionStart),r.SelectionEnd!=null&&(this._newSelectionEnd=r.SelectionEnd),f=this._updateText(r);if(!f)return;e=this._doExtraWorkForKeyPress(t);if(e===!0)return;r.SelectionStart!=null&&(this.SelectionStart=r.SelectionStart),r.SelectionEnd!=null&&(this.SelectionEnd=r.SelectionEnd,r.FocusExit!=!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)),r.exception!=null&&(this.UpdateDisplayText(this.Text),this.SetSelection(this.SelectionStart,this.SelectionEnd)),u=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(u),r.EventInfo!=null&&(this._uIProcess.FireEvent(this,r.EventInfo.Name,r.EventInfo.Args,r.EventInfo.Type),this._focusType=n.FocusType.ClientEvent);if(i.keyCode==n.Key.Return)return!0}else{if(i.keyCode==n.Key.Return)return!0;r.SelectionStart!=null&&(this._truePosition=r.SelectionStart),r.EventInfo!=null&&this._uIProcess.FireEvent(this,r.EventInfo.Name,r.EventInfo.Args,r.EventInfo.Type)}},i.prototype._doExtraWorkForKeyPress=function(n){return!1},i.prototype._updateText=function(n){if(n.Text!=null)return this.UpdateText(n)?(this.UpdateDisplayText(this.Text),this._uIUpdate.SetForeColor(n.ForeColor),!0):!1},i.prototype.innerKeyPress=function(t,i,r){var f=t,u;i=i==null?!1:i,u=this._uIProcess.KeyPress(this._realInputElement,this.SelectionStart,this.SelectionEnd,this.GetExitOnLastChar(),f);if(this._japInput!=!0){if(u.Text!=null){if(!this.UpdateText(u))return!1;r||this.UpdateDisplayText(this.Text)}u.SelectionStart!=null&&(this.SelectionStart=u.SelectionStart),u.SelectionEnd!=null&&(this.SelectionEnd=u.SelectionEnd,u.FocusExit==!0||i||r||u.FocusExit!=!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)),u.exception!=null&&(r||this.UpdateDisplayText(this.Text),u.FocusExit!=!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)),u.EventInfo!=null&&(this._uIProcess.FireEvent(this,u.EventInfo.Name,u.EventInfo.Args,u.EventInfo.Type),this._focusType=n.FocusType.ClientEvent);if(window.event!=null&&event.keyCode==n.Key.Return)return!0}else{if(window.event!=null&&event.keyCode==n.Key.Return)return!0;u.SelectionStart!=null&&(this._truePosition=u.SelectionStart),u.EventInfo!=null&&this._uIProcess.FireEvent(this,u.EventInfo.Name,u.EventInfo.Args,u.EventInfo.Type)}},i.prototype.CheckPropertyChange=function(n){var t=this._GetValueText();t!==this._previousText&&(this.SearchAddressOnValueChanged(this._getId(),t),this._previousText=t)},i.prototype.SearchAddressOnValueChanged=function(n,t){this._addressObj!=null&&this._addressObj.SearchByAutocomplete(n,t,this._settingIndex)},i.prototype.KeyUp=function(t){var f,e,s;this.SearchAddressOnValueChanged(this._getId(),this.GetValue());if(this._imeMode==!0)if(!n.Utility.IsIE8OrBelow)return;n.Utility.IsIE8OrBelow||(f=this._getShortcutObj(),f!=null&&(f.GetBlockKeyMessage()||this._getComponentType()!==n.IMControlType.Mask||(f._uiProcess.ProcessGcMaskAction(this,t),f._uiProcess.ProcessTriggerAll(this,t))));if(this._imeMode===!0&&n.Utility.IsIE8OrBelow){var i=t.keyCode,o=n.CharProcess.CharEx,u=this.GetTextboxValue(),r=u;this.SelectionEnd57)&&(i<96||i>105)?i===32?this._imeSelect===!1&&(this._imeSelectTimes===1?this._imeSelect=!0:o.ToHalfWidth(r)!=String.fromCharCode(i)?this._imeSelectTimes++:(s=u.Substring(this.SelectionStart,u.GetLength()-e),o.ToHalfWidth(s)===String.fromCharCode(i)&&this.ImeInput("DirectInput"))):i<65||i>90?i!==32&&i!==106&&i!==107&&i!==109&&i!==110&&i!==111&&i!==219&&i!==220&&i!==221&&i!==222&&(i<186||i>192)?i===40||i===38?this._imeSelect===!1&&this._imeSelectTimes===1&&(this._imeSelect=!0):i===8||i===46||i===27?this._imeSelectTimes=0:i===244&&(this.IsJapanConvertKeyPress=!0):(this._imeSelectTimes<1||this.ImeInput("ReInput"),this._imeSelectTimes=0):this._imeSelectTimes=0:(i<96||(i=i-48),r=o.ToHalfWidth(r),r==String.fromCharCode(i)&&(r===String.fromCharCode(i)&&this._imeSelectTimes<1||this._imeSelect||this.ImeInput("ReInput")),this._imeSelectTimes=0)}t.keyCode!=n.Key.Return},i.prototype.SpinBtnMouseDown=function(i,r){if(this._focusType==n.FocusType.None){var u=this._uIProcess.Focus(this._focusType,this._realInputElement,this.GetHighlightText(),this._cursorPosition,this.SelectionStart);u!=null&&u.SelectionStart!=null&&u.SelectionEnd!=null&&(this.SelectionStart=u.SelectionStart,this.SelectionEnd=u.SelectionEnd)}t.prototype.SpinBtnMouseDown.call(this,i,r)},i.prototype.PerformSpin=function(n){var i=this._spin.Increment,t=!0;n=="down"&&(t=!1),this.PerformSpinProcess(this.SelectionStart,this.SelectionEnd,i,this._spin.Wrap,t,!0),this.SetFocus(),this.SetSelection(this.SelectionStart,this.SelectionEnd)},i.prototype.PerformSpinProcess=function(t,i,r,u,f,e){var o,l,v,c,h,s,a;if(this.GetReadOnly()&&e)return;o=this._uIProcess.PerformSpin(t,i,r,u,f),this._focusType=n.FocusType.SpinButton;if(o==null){this.SetFocus();return}l=o.Text!=null,o.Text===""&&(v=this._IsUseWatermarkText(this._focused),v.IsUseWatermarkText&&(l=!1));if(l)if(!this.UpdateText(o))return;o.SelectionStart!=null&&(this.SelectionStart=o.SelectionStart),o.SelectionEnd!=null&&(this.SelectionEnd=o.SelectionEnd),o.EventInfo!=null&&(c=this._uIProcess.FireEvent(this,o.EventInfo.Name,o.EventInfo.Args,o.EventInfo.Type),c!=null&&(this._focusType=c));if(this.Text!=this.GetTextboxValue()){for(h=this._format.Fields.fieldArray,s=0;sf+1){var p=u.Substring(f+1,f+2),y=new n.CharCategory,l=p.charCodeAt(0)-(y.KATAKANA_VOICED.charCodeAt(0)-1);l==1||l==2?(this.innerKeyPress(u.Substring(f,f+2),e),f++):t=="ReInput"?this.innerKeyPress(u.Substring(f,f+1),e,!0):this.innerKeyPress(u.Substring(f,f+1),e)}else t=="ReInput"?this.innerKeyPress(u.Substring(f,f+1),e,!0):this.innerKeyPress(u.Substring(f,f+1),e)}this._japInput=!1,this._imeMode=!1,this._imeSelect=!1,(t=="ReInput"||t=="ClickInput")&&(this._truePosition=this.SelectionStart,this._focusType=n.FocusType.ImeInput)},i.prototype.SetInnerText=function(n){this.Clear(),this._uIProcess._format.Fields.SetText(n,!0).isValid==!1?this._uIProcess._format.Fields.RollBack():this._uIProcess._format.Fields.SaveOldState();var t={};t.Text=this.GetDisplayText2(this._focused,!1);if(!this.UpdateText(t))return;this.UpdateDisplayText(this.Text)},i.prototype.Copy=function(){this.SetSelection(this.SelectionStart,this.SelectionEnd),t.prototype.Copy.call(this)},i.prototype.Cut=function(){this.SetSelection(this.SelectionStart,this.SelectionEnd),t.prototype.Cut.call(this),this.SearchAddressOnValueChanged(this._getId(),this._GetValueText())},i.prototype.Delete=function(){t.prototype.Delete.call(this),this.SearchAddressOnValueChanged(this._getId(),this._GetValueText())},i.prototype.Undo=function(){t.prototype.Undo.call(this),this.SearchAddressOnValueChanged(this._getId(),this._GetValueText())},i.prototype.Paste=function(t,i,r,u){var o="",f,e;t!=null&&(o=t),r==null&&(r=this.SelectionStart),u==null&&(u=this.SelectionEnd),f=this._uIProcess.Paste(r,u,o,this.GetExitOnLastChar(),i);if(f==null)return;f.Value!=null&&(this.Value=f.Value);if(f.Text!=null){if(!this.UpdateText(f))return;this.UpdateDisplayText(this.Text),n.Utility.IsIE||this.SetInnerFocus()}f.SelectionStart!=null&&(this.SelectionStart=f.SelectionStart),f.SelectionEnd!=null&&(this.SelectionEnd=f.SelectionEnd),f.FocusExit!=null&&f.FocusExit||this.SetSelection(this.SelectionStart,this.SelectionEnd),e=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(e),f.EventInfo!=null&&this._uIProcess.FireEvent(this,f.EventInfo.Name,f.EventInfo.Args,f.EventInfo.Type),this.SearchAddressOnValueChanged(this._getId(),this._GetValueText())},i.prototype.SetHideValue=function(){if(this._helpID!=null){var n=this._uIProcess.GetSepText();this._uIUpdate.SetHideText(n)}},i.prototype.GetHideValue=function(){if(this._helpID!=null){var n=this._uIUpdate.GetHideText();return n&&(n=n.replace(/@#GCX0D#@/g,"\r").replace(/@#GCX0A#@/g,"\n")),n}return""},i.prototype.CanUndo=function(){return this._format.Fields.CanUndo()?!0:!1},i.prototype.GetRealSpinIncrement=function(n,t){return n==="up"&&(t*=-1),t},i.prototype._GetSpinPosition=function(t){var r=this.SelectionStart,u=this.SelectionEnd,i;return t!=undefined&&(t=n.Utility.CheckInt(t,0),i={},i.start=0,i.length=0,i=this._format.Fields.GetRealFieldRange(t),r=i.start,u=i.start+i.length),{Start:r,End:u}},i.prototype._protectedDoSpinFinished=function(){this.UpdateDisplayText(this.Text)},i.prototype.UpdateText=function(n){var f,t,u,r,e;if(n==null)return!1;f="",n.Text!=null&&(f=n.Text);if(f!=this.Text&&this._specialClientEvents.TextChanging){t={},u={},u.Result=f,u.Cancel=!1,t.Name=this._specialClientEvents.TextChanging,t.Args=u,n.SelectionStart!=null&&(this._newSelectionStart=n.SelectionStart),n.SelectionEnd!=null&&(this._newSelectionEnd=n.SelectionEnd),r=this._uIProcess.GetSepText(),this.RollBack(),typeof this._needSetHideValue=="undefined"&&(this._needSetHideValue=!0),this._needSetHideValue&&this.SetHideValue(),t.Name.IndexOf!=null&&t.Name.IndexOf(i.AjaxEventHandlerName)>-1&&(this._uIProcess._format.Fields.ClearContent(),this._formatIsNull?this._uIProcess._format.Fields.SetText(r,!0):this._uIProcess.SetSepText(r)),e=this._uIProcess.FireEvent(this,t.Name,t.Args,"TextChanging"),t.Name.IndexOf!=null&&t.Name.IndexOf(i.AjaxEventHandlerName)>-1,e!=null&&(this._focusType=e),this._specialClientEvents.TextChanging&&this._specialClientEvents.TextChanging.IndexOf!=null&&this._specialClientEvents.TextChanging.IndexOf(i.AjaxEventHandlerName)!=-1&&(this._needSetHideValue=!1);if(u.Cancel)return this.UpdateDisplayText(this.Text),this.SetSelection(this.SelectionStart,this.SelectionEnd),!1;this._uIProcess._format.Fields.ClearContent(),this._formatIsNull?this._uIProcess._format.Fields.SetText(r,!0):this._uIProcess.SetSepText(r)}return this.Text=f,this.Value=this._uIProcess._format.Fields.GetValue(),!0},i.prototype.UpdateDisplayText=function(n){typeof this._needSetHideValue=="undefined"&&(this._needSetHideValue=!0),this._needSetHideValue&&t.prototype.UpdateDisplayText.call(this,n)},i.prototype.RollBack=function(){this._uIProcess._format.Fields.RollBack()},i.prototype.ProcessReservedKey=function(i){var r=t.prototype.ProcessReservedKey.call(this,i);if(r)return!0;else switch(i){case n.Key.F7:case n.Key.F8:return!0}return!1},i.prototype.GetCurrentValuesForAjax=function(){return this._uIProcess._format.Fields.GetText()+n.Utility.Sep4+this.SelectionStart+n.Utility.Sep4+this.SelectionEnd+n.Utility.Sep4+this.GetSelectedText()+n.Utility.Sep4+this.GetCurrentField()+n.Utility.Sep4+this._newSelectionStart+n.Utility.Sep4+this._newSelectionEnd+n.Utility.Sep4+this.GetEditMode()},i.prototype.PropertyChange=function(t){t!=null&&(!n.Utility.IsIE11OrLater&&t.propertyName==="value"||n.Utility.IsIE11OrLater&&t.type==="textinput")&&this.SearchAddressOnValueChanged(this._getId(),this.GetValue())},i.prototype.CompositionEnd=function(t){if(!(n.Utility.IsIE||n.Utility.chrome&&n.Utility.ChromeVersion>=53))return;try{this.ImeInput("DirectInput")}finally{var i=this._GetRealForeColor(this._focused,!0);this._uIUpdate.SetForeColor(i),this._imeMode=!1}},i.prototype.MSPointerUp=function(n){n!=null&&(this._mouseUpPointerType=n.pointerType,this._mouseUpHasValue=n.srcElement.value.length>0)},i.prototype.Input=function(n){try{this.ImeInput("DirectInput")}finally{this._imeMode=!1}},i.prototype.HandleClearButton=function(t){var i=this,f,e,r,u;n.Utility.IsIE10OrLater&&this._focusedWhenMouseDown&&this._mouseDownOnClearButton&&t.srcElement==this._realInputElement&&(f=document.activeElement==t.srcElement,e=n.Utility.IsMouseDownOnClearButton(t),this._mouseUpHasValue&&f&&e&&(r=this._oldText,this.Clear(),u=this.GetDisplayText2(this._focused,!0),setTimeout(function(){i.UpdateDisplayText(u);var n=i._GetRealForeColor(i._focused,!0);i._uIUpdate.SetForeColor(n),i._oldText=r,i.SelectionStart=i.SelectionEnd=i._format.Fields.GetFirstInputPosition(),i.SetSelection(i.SelectionStart,i.SelectionEnd)},0)))},i.prototype.OnPropertyChanged=function(n){},i.prototype.OnEditStatusChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.EditStatusChanged=t},i.prototype.OnInvalidInput=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidInput=t},i.prototype.OnKeyExit=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyExit=t},i.prototype.OnSpinDown=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.SpinDown=t},i.prototype.OnSpinUp=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.SpinUp=t},i.prototype.OnTextChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.TextChanged=t},i.prototype.OnTextChanging=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.TextChanging=t},i.prototype.OnValueChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.ValueChanged=t},i.prototype._initWithServerData=function(n){t.prototype._initWithServerData.call(this,n),n.FormatPattern!==undefined&&this.SetFormatPattern(n.FormatPattern),n.ExitOnLastChar!==undefined&&this.SetExitOnLastChar(n.ExitOnLastChar),n.TabAction!==undefined&&this.SetTabAction(n.TabAction),n.AutoConvert!==undefined&&this.SetAutoConvert(n.AutoConvert),n.ImeMode!==undefined&&this.SetImeMode(n.ImeMode),n.PromptChar!==undefined&&this.SetPromptChar(n.PromptChar),n.ShowLiterals!==undefined&&this.SetShowLiterals(n.ShowLiterals),n.CursorPosition!==undefined&&this.SetCursorPosition(n.CursorPosition),n.Value!==undefined&&this.SetValue(n.Value),n.Text!==undefined&&n.Value!=undefined&&(n.Text!=this._GetValueText()||n.Value!=this.GetValue())&&(n.Text!==undefined?this.SetText(n.Text):n.Value!==undefined&&this.SetValue(n.Value)),this._format.Fields.SaveUndoState(),n.ClientEvents!==undefined&&(n.ClientEvents.EditStatusChanged!==undefined&&this.OnEditStatusChanged(n.ClientEvents.EditStatusChanged),n.ClientEvents.InvalidInput!==undefined&&this.OnInvalidInput(n.ClientEvents.InvalidInput),n.ClientEvents.KeyExit!==undefined&&this.OnKeyExit(n.ClientEvents.KeyExit),n.ClientEvents.SpinDown!==undefined&&this.OnSpinDown(n.ClientEvents.SpinDown),n.ClientEvents.SpinUp!==undefined&&this.OnSpinUp(n.ClientEvents.SpinUp),n.ClientEvents.TextChanging!==undefined&&this.OnTextChanging(n.ClientEvents.TextChanging),n.ClientEvents.TextChanged!==undefined&&this.OnTextChanged(n.ClientEvents.TextChanged),n.ClientEvents.ValueChanged!==undefined&&this.OnValueChanged(n.ClientEvents.ValueChanged))},i.prototype._updateServerData=function(){var r,i;t.prototype._updateServerData.call(this),r=document.getElementById(n.Utility.GetHelperId(this._getId())),r!=null&&(i={},i.InputElementValue=this._GetTemporaryControlValue(),i.HelperValue=this._uIUpdate.GetHideText(),r.value=JSON.stringify(i))},i.prototype.SetAddressObj=function(n,t){this._addressObj=n,this._settingIndex=t},i.prototype._resoreToInitialValueOnFormReset=function(){try{this.SetText(this._initializedFormData)}catch(n){this.SetValue(null)}},i.prototype._backupInitialFormValue=function(){this._initializedFormData=this._GetValueText()},i.prototype._getDisplayedText=function(){return this._focused?t.prototype._getDisplayedText.call(this):this.GetDisplayText2(this._focused,!0)},i.prototype._IsValueNull=function(){return this.GetValue()==null||this.GetValue()===""},i.prototype._OnWatermarkNullTextChanged=function(i,r){var u=n.MaskFormat.ParseFillExpression(r,this._format.Fields);u.Expression!=null&&(r=u.Expression),t.prototype._OnWatermarkNullTextChanged.call(this,i,r)},i.prototype._OnWatermarkDisplayNullTextChanged=function(i,r){var u=n.MaskFormat.ParseFillExpression(r,this._format.Fields);u.Expression!=null&&(r=u.Expression),t.prototype._OnWatermarkDisplayNullTextChanged.call(this,i,r),this.AfterSetTextValue()},i.prototype.UpdateWatermarkRealText=function(){this._updateWatermarkNullTextReal(),this._updateWatermarkDisplayNullTextReal()},i.prototype._updateWatermarkNullTextReal=function(){var t=this.GetWatermarkNullText(),i=n.MaskFormat.ParseFillExpression(t,this._format.Fields);i.Expression!=null&&(t=i.Expression),this._GetWatermark().NullTextReal=t},i.prototype._updateWatermarkDisplayNullTextReal=function(){var t=this.GetWatermarkDisplayNullText(),i=n.MaskFormat.ParseFillExpression(t,this._format.Fields);i.Expression!=null&&(t=i.Expression),this._GetDisplayWatermark().NullTextReal=t},i.AjaxEventHandlerName="GCIM.Utility.HandleAjaxEvent",i}(n.BaseInputControl);n.GcMask=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(t){function i(n,i,r){t.call(this,i),this._oldStart=-1,this._oldLength=0,this._newStart=-1,this._newLength=0,this._formatIsNull=r,this._owner=n}return __extends(i,t),i.prototype.GetShowLiterals=function(){return this._owner.GetShowLiterals()},i.prototype.GetFieldByIndex=function(n){return this.fieldArray[n]},i.prototype.GetLength=function(){var u=this._owner._IsUseWatermarkText(),r,t,n,i;if(u.IsUseWatermarkText)return u.WatermarkText.length;for(r=this.GetLastVisibleFieldIndex(this.GetShowLiterals()),t=0,n=0;n<=r;n++)i=this.GetFieldByIndex(n),t+=i.GetLength();return t},i.prototype.GetInputFieldIndexByPos=function(t){var r=null,o=0,i,c=this.GetFieldIndex(t),f,u,h,e,s;i=c.index,o=c.offset,i==0||o!=0||this.fieldArray[i-1]instanceof n.PromptField||(i--,o=this.fieldArray[i].text.GetLength()),f=this.fieldArray[i];if(o==f.text.GetLength()){if(o=0;n--){t=this.fieldArray[n];if(t.fieldLabel=="PromptField")continue;else{r=n;break}}for(i=0,n=0;n<=r;n++)t=this.fieldArray[n],n==r?i<21474e3?i+=t._maxLength:i=t._maxLength:i+=t.text.GetLength();return i},i.prototype.GetNonLiteralsText=function(t,i){var u="",c=0,h,s=this.GetFieldIndex(t),o,f,e,r;for(h=s.index,c=s.offset,o=0,s=this.GetFieldIndex(t+i),f=s.index,o=s.offset,f!=0&&o==0&&(f--,o=this.fieldArray[f].text.GetLength()),e=h;e<=f;e++)r=this.fieldArray[e],r instanceof n.PromptField||(h==f?(u=r.text.Substring(c,o),u.GetLength()>r._trueLength&&(u=u.Substring(0,r._trueLength))):u+=e==h?r.text.Substring(c,r.text.GetLength()):e==f?r.text.Substring(0,o):r.text.Substring(0,r.text.GetLength()));return u},i.prototype.GetNonPromptText=function(t,i){var o="",c=0,h,s=this.GetFieldIndex(t),e,u,f,r;for(h=s.index,c=s.offset,e=0,s=this.GetFieldIndex(t+i),u=s.index,e=s.offset,u!=0&&e==0&&(u--,e=this.fieldArray[u].text.GetLength()),f=h;f<=u;f++)r=this.fieldArray[f],r instanceof n.PromptField||(h==u?o=r.text.Substring(c,e):o+=f==h?r.text.Substring(c,r.text.GetLength()):f==u?r.text.Substring(0,e):r.text);return o},i.prototype.ValueIsNull=function(){for(var i,t=0;t=0;i--){r=this.fieldArray[i];if(r instanceof n.PromptField)continue;else if(r._trueLength==0){f=!1;continue}else if(r._trueLength>0&&r._trueLength=0;i--){t=this.fieldArray[i];if(!(t.fieldLabel=="PromptField")&&t._trueLength!=0)break}if(i<0)return"";for(s="",e=0;e<=i;e++){t=this.fieldArray[e];if(t.fieldLabel=="PromptField")continue;var c=t._trueLength,l=t.text,n=l;if(t.fieldLabel=="FilterField"){for(n=n.Substring(0,c),u=0;uh)if(e!=i){for(r="",f=0;f0)for(u=!0,i=t._undoBitState.length-1;i>=0;i--)t._undoBitState[i]==!1?n=u?n.Substring(0,n.GetLength()-1):n.Substring(0,i)+" "+n.Substring(i+1,n.GetLength()):u=!1;else n=""}else n=t._undoItem!=-1?t.undoText:"";f+=n}return f},i.prototype.SetValue=function(n,t){if(n==undefined||n==""||n.GetLength()==0)return this.ClearContent(),!0;var i=!1;return t!=null&&(i=t),this.SetFieldCollectionValue(n,i)?!0:(this.RollBack(),!1)},i.prototype.SetFieldCollectionValue=function(n,t){this.ClearContent();var i=!1;return t!=null&&(i=t),n.GetLength()!=0&&this.Insert(0,n,i,!1),!0},i.prototype.ClearContent=function(){var t,n;this._oldStart=-1,this._oldLength=0,this._newStart=-1,this._newLength=0,this._formatIsNull&&this.SaveUndoState();if(this.fieldCount>0)for(t=0;t0)for(n=0;n0)for(t=0;t0?Math.min(this._oldStart,t):t,this._oldLength+=this._newLength;else if(this.fieldCount>0)for(r=0;r0)for(t=0;t0||this.fieldArray[s]instanceof n.EnumField){for(u=this.fieldArray[s].PerformSpin(u,i,r),o=0,f=0;f0){e=this.fieldArray[s-1],u=e.text.GetLength(),uthis.fieldArray[e].text.GetLength()-r&&(t+=this.fieldArray[e].text.GetLength()-r,i-=this.fieldArray[e].text.GetLength()-r,e++,r=0),this._newStart=t,this._newLength=i,this._formatIsNull&&this.SaveUndoState(),o=0,h=this.GetFieldIndex(t+i),u=h.index,o=h.offset;while(u!=0&&o==0){f=this.fieldArray[u-1];if(f instanceof n.PromptField)break;else u--,o=this.fieldArray[u].text.GetLength()>this.fieldArray[u]._minLength?this.fieldArray[u].text.GetLength():this.fieldArray[u]._minLength}for(s=e;s<=u;s++)f=this.fieldArray[s],l=r,e==u?o>r?r=f.Delete(r,o-r):r-=r-o:s==e?(c=f.text.GetLength()-r,c>0&&(r=f.Delete(r,f.text.GetLength()-r))):r=s==u?f.Delete(r,o):f.Delete(r,f.text.GetLength()),r!=null&&(t+=r-l),r=0;return t},i.prototype.Replace=function(t,i,r,u){var b={},v,h,g,s,y,ft,ut,d,p,o,it,a,rt,nt,f,w;b.cursorPos=t,b.text=r;var e=0,c=0,k={};for(k=this.GetFieldIndex(t),c=k.index,e=k.offset,this.SaveOldState();c0||f.text.GetLength()>0)break}while(c!=0&&e==0)if(this.fieldArray[c]instanceof n.PromptField)c--,f=this.fieldArray[c],e=f.text.GetLength(),e=f._maxLength)break;else h--,v=this.fieldArray[h].text.GetLength()}var et=r,l=!1,tt=t-e;for(s=c;s<=this.fieldCount-1;s++){l=!1,f=this.fieldArray[s],w=f.text.GetLength()>f._minLength?f.text.GetLength():f._minLength;if(f instanceof n.PromptField){w=f.GetLength();if(u){y=f.text.Substring(e,f.text.GetLength()),ft=r.GetLength(),r.GetLength()h?(d={},p=s==this.fieldCount-1?!0:!1,d=f.Insert(e,r,p),e=d.offset,r=d.text,l=d.existInvalid):c==h?(o={},o=f.Replace(e,v-e,r,p),e=o.offset,r=o.text,l=o.existInvalid):s==c?(o={},o=f.Replace(e,w-e,r,p),e=o.offset,r=o.text,l=o.existInvalid):s==h?(o={},v-e>0?o=f.Replace(e,v-e,r,p):i>0&&(o=f.Replace(e,i,r,p)),e=o.offset,r=o.text,l=o.existInvalid):(o={},o=f.Replace(e,w,r),e=o.offset,r=o.text,l=o.existInvalid),it=f.GetStatus()!=n.FieldStatus.Full;if(it&&l)break;t+=e-ut,tt+=f._minLength>f.text.GetLength()?f._minLength:f.text.GetLength()}e=0;if(r==""){if(s=f._maxLength)break;else s--,r=this.fieldArray[s]._trueLength,r=this.fieldCount&&t!=""&&t.GetLength()>0)return u.isValid=!1,u;else{var p=this.GetFieldIndex(e),b=p.index,k=p.offset;return o=s._maxLength)break;else{f--,e=this.fieldArray[f]._trueLength;if(e=this.fieldCount&&u!=""&&u.GetLength()>0&&u==c.text)return c;else{var y=this.GetFieldIndex(r),k=y.index,b=y.offset;return o0)r--;if(r==0)return-1;r--;if(this.GetFieldByIndex(r)instanceof n.PromptField)if(r==0)return-1;else r--;for(f=0,u=0;u0)for(t=0;t0)for(i=0;i0)try{var u=n,f="\x00",e=i.ParseFillingString(u);u=e.Format,f=e.FillingChar;if(f!=="\x00"){if(!i.NullParse(u))throw"argument exception";r.Expression=t!==undefined&&t!==null&&t.fieldCount>0?t.GetFillingString(f):n}else r.Expression=u}catch(o){throw"argument exception";}else r.Expression=null;return r},i.ParseFillingString=function(n){var t={},r,u;t.Format=n,t.FillingChar="\x00",t.Result=!1;if(n===undefined||n===null||n.length===0)return t.Result=!1,t;r=n.indexOf("{"),u=n.indexOf("}");if(r===-1&&u===-1)return n=i.RemoveEscapeChar(n),t.Format=n,t.Result=!1,t;else{while(r>0&&n.charAt(r-1)==="\\")r=n.indexOf("{",r+1);while(u>0&&n.charAt(u-1)==="\\")u=n.indexOf("}",u+1);if(r-1&&t>-1)if(t>r){if(i.FindSpecialCh(n,"{",r+1)>-1)return!1;if(i.FindSpecialCh(n,"}",t+1)>-1)return!1}return!0},i.FindSpecialCh=function(n,t,i){var f=0,r=i-1,u;do{r=n.indexOf(t,r+1);if(r==0||r==-1)return r;for(u=r-1;u>0;u--){if(n.charAt(u)!="\\")break;f++}}while(n.charAt(r-1)==="\\"&&f%2!=0);return r},i.ParseFormat=function(r,u){var o=new n.MaskFieldCollection(u,0,!1),b,ot,ct,ht,st,ft,y,ut,et,nt,c,w,rt,tt,it,a,d;if(String.prototype.IsNulOrEmpty(r))return b=new n.FilterField(u),ot=[],b._bitState=ot,y=new n.UnionFilter(u,!0),ct=new n.FullWidthFilter(u,!0),y.Add(ct),ht=new n.HalfWidthFilter(u,!0),y.Add(ht),st=new n.SurrogateFilter(u,!0),y.Add(st),b.FilterField(0,2147483647,y,ot),b.InitialText(""),b._trueLength=0,o.PushBack(b),o._formatIsNull=!0,o;var l=0,v="",s=t.PromptChar,k=t.CharSubset,h=i.GetKeyWord(r,l),f=h.KeyWord,g=h.KeyType,p=h.KeyLen,e;while(r.length>l){switch(g){case t.Unknow:throw"InvalidParameter";case t.CharSubset:ft=i.AnalyseCharSubset(u,f),y=ft.uf;if(!ft.Result)throw"Invalid parameter";e=y,s=t.CharSubset;break;case t.DefinedCharAddition:if(f==="\\K")e=new n.HalfWidthKatakanaFilter(u,!0);else if(f==="\\H")e=new n.HalfWidthFilter(u,!0);else if(f==="\\N")e=new n.SBCSKatakanaFilter(u,!0);else if(f==="\\"+i.DBCS_K)e=new n.FullWidthKatakanaFilter(u,!0);else if(f==="\\"+i.DBCS_J)e=new n.HiraganaFilter(u,!0);else if(f==="\\"+i.DBCS_M)e=new n.ShiftJISFilter(u,!0);else if(f==="\\"+i.DBCS_I)e=new n.JISX0208Filter(u,!0);else if(f==="\\"+i.DBCS_G)e=new n.DBCSHiraganaFilter(u,!0);else if(f==="\\"+i.DBCS_N)e=new n.DBCSKatakanaFilter(u,!0);else if(f==="\\"+i.DBCS_Z)e=new n.FullWidthFilter(u,!0);else if(f==="\\"+i.DBCS_T)e=new n.SurrogateFilter(u,!0);else if(f==="\\"+i.DBCS_E)e=new n.EmojiFilter(u,!0);else if(f==="\\"+i.DBCS_V)e=new n.IVSFilter(u,!0);else throw"argument null";s=t.CharSubset;break;case t.EnumGroup:ut=[];if(i.AnalyseEnumGroup(f,ut)){et=new n.EnumField(u),et.Init(ut),o.PushBack(et),s=t.EnumGroup,l+=p,nt=i.GetKeyWord(r,l),f=nt.KeyWord,g=nt.KeyType,p=nt.KeyLen;continue}else throw"invalid parameter";case t.OctalAscII:try{c=f.Substring(1),c=parseInt(c,8);if(c==0)throw"argument exception";w=String.fromCharCode(c),s==t.PromptChar?v+=w:(v=w,s=t.PromptChar)}catch(lt){throw"invalid parameter";}break;case t.HexAscII:case t.HexUnicode:try{c=f.Substring(2),c=parseInt(c,16);if(c==0)throw"argument exception";w=String.fromCharCode(c),s==t.PromptChar?v+=w:(v=w,s=t.PromptChar)}catch(lt){throw"invalid parameter";}break;case t.PromptChar:s==t.PromptChar?v+=f:(v=f,s=t.PromptChar);break;case t.Quantifier:throw"invalid parameter";default:throw"invalid parameter";}l+=p,rt=1,tt=1;if(l=n.length)return u;l=n.charAt(r);switch(l){case"\\":return h=i.GetEscapeCharLength(n.Substring(r),u.KeyType,u.KeyLen),h.Result?(u.KeyLen=h.Length,u.KeyType=h.KeyType,u.KeyWord=n.substr(r,u.KeyLen),u):(f=n.charAt(r+1),f=="A"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[A-Z]",u):f==i.DBCS_A?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_A+"-"+i.DBCS_Z+"]",u):f=="a"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[a-z]",u):f==i.DBCS_a?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_a+"-"+i.DBCS_z+"]",u):f=="D"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[0-9]",u):f==i.DBCS_D?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_0+"-"+i.DBCS_9+"]",u):f=="B"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[0-1]",u):f==i.DBCS_B?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_0+"-"+i.DBCS_1+"]",u):f=="X"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[0-9A-Fa-f]",u):f==i.DBCS_X?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_0+"-"+i.DBCS_9+i.DBCS_A+"-"+i.DBCS_F+i.DBCS_a+"-"+i.DBCS_f+"]",u):f=="W"?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="[a-zA-Z_0-9]",u):f==i.DBCS_W?(u.KeyLen=2,u.KeyType=t.CharSubset,u.KeyWord="["+i.DBCS_a+"-"+i.DBCS_z+i.DBCS_A+"-"+i.DBCS_Z+i.DBCS__+i.DBCS_0+"-"+i.DBCS_9+"]",u):f=="K"||f==i.DBCS_K||f==i.DBCS_J||f==i.DBCS_Z||f=="H"||f==i.DBCS_T||f==i.DBCS_M||f==i.DBCS_I||f==i.DBCS_G||f==i.DBCS_N||f=="N"||f==i.DBCS_E||f==i.DBCS_V?(u.KeyLen=2,u.KeyType=t.DefinedCharAddition,u.KeyWord=n.substr(r,2),u):i.IsSpecialChar(f)?(u.KeyLen=2,u.KeyType=t.PromptChar,u.KeyWord=n.substr(r+1,1),u):(u.KeyWord="",u));case"{":return e=n.indexOf("}",r+1),e==-1?(u.KeyWord="",u):(u.KeyType=t.Quantifier,u.KeyLen=e+1-r,u.KeyWord=n.substr(r,u.KeyLen),u);case"[":e=r,c=0;do{e=n.indexOf("]",e+1);if(e==-1)return"";for(s=e-1;s>0;s--){if(n.charAt(s)!=="\\")break;c++}}while(n.charAt(e-1)==="\\"&&c%2!=0);return u.KeyType=t.CharSubset,u.KeyLen=e+1-r,u.KeyWord=n.substr(r,u.KeyLen),u;case"(":e=r;do{e=n.indexOf(")",e+1);if(e==-1)return""}while(n.charAt(e-1)=="\\");return u.KeyType=t.EnumGroup,u.KeyLen=e+1-r,u.KeyWord=n.substr(r,u.KeyLen),u;case"*":return u.KeyLen=1,u.KeyType=t.Quantifier,u.KeyWord="{0,}",u;case"+":return u.KeyLen=1,u.KeyType=t.Quantifier,u.KeyWord="{1,}",u;case"?":return u.KeyLen=1,u.KeyType=t.Quantifier,u.KeyWord="{0,1}",u;default:for(o=r+1;o="0"&&n<="7"},i.AnalyseQuantifier=function(n){var t={},i;t.Min=-1,t.Max=-1,t.Result=!1,i=n.indexOf(",",1);if(i==-1)try{return t.Min=parseInt(n.substr(1,n.length-2),10),t.Max=t.Min,t.Result=t.Max>0,t}catch(r){return t.Result=!1,t}try{return t.Min=parseInt(n.substr(1,i-1),10),t.Max=i==n.length-2?Math.pow(2,31):parseInt(n.substr(i+1,n.length-i-2),10),t.Min<0||t.Min>t.Max||t.Max==0?(t.Result=!1,t):(t.Result=!0,t)}catch(r){return t.Result=!1,t}},i.AnalyseCharSubset=function(r,u,f){var s={uf:new n.UnionFilter(null,!0)},rt,ut,g,h,d,v,y,w,k,tt,nt,et,ft,c;s.uf=f,s.Result=!1;var o=[],e=1,b=!0,a="";if(u=="[]"){o.push(new n.FullWidthFilter(r,!0)),o.push(new n.HalfWidthFilter(r,!0)),o.push(new n.SurrogateFilter(r,!0));if(s.uf!=null&&s.uf._filterArray.length>0)for(c=0;c0)for(c=0;c0&&(rt=new n.LimitedFilter(a,""),rt._include=b,o.push(rt));if(o.length>0){for(s.uf=new n.UnionFilter(r,!0),s.uf.AddRange(o),c=0;ce+2)if(u.charAt(e+1)==="-"){d=i.GetEscapeCharLength(u.substr(e+2),p,l),p=d.KeyType,l=d.Length,d.Result&&(v=null,y=16,p==t.OctalAscII?(y=8,v=u.substr(e+2+1,l-1)):v=u.substr(e+2+2,l-2),w=e+2,u=u.substring(0,w)+u.substr(w+l),k=String.fromCharCode(parseInt(v,y)),u=u.substring(0,w)+k+u.substr(w)),u.charAt(e)>u.charAt(e+2)?(tt=u.charAt(e+2),nt=u.charAt(e)):(tt=u.charAt(e),nt=u.charAt(e+2)),et=new n.RangeFilter(tt,nt,r,!0),o.push(et),e+=2;break}if(a.indexOf(it)!=-1){e++;continue}a+=it;break}e++}a.length>0&&o.push(new n.LimitedFilter(a,"",r,!0)),ft=o.length;if(s.uf!=null&&s.uf._filterArray.length>0)for(c=0;ce.Text.GetLength())&&(e.SelectionStart=0,e.SelectionEnd=0),t==n.FocusType.Left?(e.SelectionStart=0,e.SelectionEnd=0):t==n.FocusType.Right&&(e.SelectionStart=e.Text.GetLength(),e.SelectionEnd=e.Text.GetLength()),s=e.SelectionStart,t==n.FocusType.SpinButton||t==n.FocusType.ContextMenu||t==n.FocusType.ClientEvent||t==n.FocusType.ImeInput||r==n.HighlightText.None&&u==-1||(o=this.SetCursorPositionAndSelection(r,u,s),o!=null&&(e.SelectionStart=o.SelectionStart,e.SelectionEnd=o.SelectionEnd)),e.SelectionStart!=null&&(this._oldPosition=e.SelectionStart),e},i.prototype.SetCursorPositionAndSelection=function(t,i,r){var u,f,o,e;return t==n.HighlightText.All?u=this.SelectAll():t==n.HighlightText.Field?i>-1?u=this.GetPosByCurrentField(i):r>0?(f=this._format.Fields.GetFieldIndex(r).index,o=this._format.Fields.fieldArray[f],o instanceof n.PromptField&&(f==this._format.Fields.fieldCount-1?f--:f++),e=this._format.Fields.GetFieldRange(f),u={},u.SelectionStart=e.start,u.SelectionEnd=e.length+e.start):u=this.GetPosByCurrentField(r):(u=this.GetPosByCurrentField(i),u!=null&&(u.SelectionStart=u.SelectionStart,u.SelectionEnd=u.SelectionStart)),u},i.prototype.GetPosByCurrentField=function(n){var i={},t=this._format.Fields.GetPosByCurrentField(n);return t!=null&&t!=-1?(i.SelectionStart=t.start,i.SelectionEnd=t.start+t.length,i):null},i.prototype.LoseFocus=function(){var n={};return this._owner._getFormatIsNull()!=!0&&this._format.Fields.SaveUndoState(),n.Text=this.GetShowText2(this.GetShowLiterals(),!1,!1),n.Value=this._format.Fields.GetValue(),n},i.prototype.GetSepText=function(){var s,h,o,r,e,u,f,i,t;if(this._owner._getFormatIsNull())return this._format.Fields.GetText();for(s="",h=this._format.Fields.fieldCount-1,o=0;o<=h;o++){r=this._format.Fields.fieldArray[o];if(r instanceof n.PromptField)continue;e=r._trueLength,u=r.text;if(r instanceof n.FilterField)for(t=0;t1){o=y[1];if(o&&o!=""&&i!=o){a=0,f=i.IndexOf(" ",a);while(f!=-1)o.Substring(f,f+1)==n.Utility.MaskValChar[0]&&(i=i.Substring(0,f)+this._owner.GetPromptChar()+i.Substring(f+1,i.GetLength())),a=f,f=i.IndexOf(" ",a)}}l=h==this._format.Fields.fieldCount-1?!0:!1,v=i.GetLength();if(v=48&&r<=57||r>=65&&r<=90||r>=96&&r<=105||r==0||r==229||r==231)return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f;if(r==n.Key.Space||r==n.Key.Multiply||r==n.Key.Add||r==n.Key.Subtract||r==n.Key.Decimal||r==n.Key.Divide||r==219||r==220||r==221||r==222||r>=186&&r<=192||r==226)return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f;if(!n.Utility.IsIE&&(r==61||r==59))return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f;u=r,i.FuncKeysPressed.Shift&&r!=65552&&(u=r-65536),r>65600&&r<65627&&(u=r-65536);if(u>=48&&u<=57||u>=65&&u<=90||u>=96&&u<=105||u==229||u==0||u==231)return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f;e=(r==173||r==64||r==160||r==65594||r==58||r==65709||r==65600||r==65696)&&n.Utility.firefox;if(u==n.Key.Space||u==n.Key.Multiply||u==n.Key.Add||u==n.Key.Subtract||u==n.Key.Decimal||u==n.Key.Divide||u==219||u==220||u==221||u==222||u>=186&&u<=192||u==226||e)return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f;if(!n.Utility.IsIE&&(u==61||u==59))return f==null&&(f={}),n.GcMask.Mask_ImeResponse=!0,f.inputChar=!0,f}return f},i.prototype.KeyPress=function(t,i,r,u,f){var e,h,o,s;return n.GcMask.Mask_ImeResponse==!0?(n.GcMask.Mask_ImeResponse=!1,e={},h=this._owner._GetWatermark().NullTextReal,this._format.Fields.ValueIsNull()&&h!=""&&(i=0,r=0),o=this.ProcessCharKey(i,r,f,u),o.success?(e.SelectionStart=o.start,e.SelectionEnd=e.SelectionStart,e.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0),this.isMulSelected=!1,this.moveFocusExitOnLastChar&&(s=this.MoveControl(this.GetElementId(),!0,!1,"CharInput"),s!=null&&(e.EventInfo=s.EventInfo,e.FocusType=s.FocusType,e.FocusExit=!0),this.moveFocusExitOnLastChar=!1)):(e.SelectionStart=o.start,e.SelectionEnd=Math.max(i,r),e.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0),e.EventInfo=o.EventInfo,e.exception=!0,this.moveFocusExitOnLastChar&&(e.FocusExit=!0,this.moveFocusExitOnLastChar=!1)),e):!1},i.prototype.ProcessCharKey=function(n,i,r,u){var f=t.prototype.ProcessCharKey.call(this,n,i,r,u),e=Math.min(n,i);return f.success&&(e=f.start),u&&(this.moveFocusExitOnLastChar=!1,e==this._format.Fields.GetExistLength()&&(this.moveFocusExitOnLastChar=!0)),f},i.prototype.KeyUp=function(n,t,i,r){},i.prototype.ContextMenu=function(){},i.prototype.Click=function(){},i.prototype.Undo=function(n){var t={};return this._format.Fields.Undo(),t.SelectionStart=this._oldPosition,t.SelectionEnd=this._oldPosition,this._oldPosition=n,t.Value=this._format.Fields.GetText(),t.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0),t},i.prototype.Paste=function(t,i,r,u,f){var e={},o,l,h,y,c,a;e.SelectionStart=t,e.SelectionEnd=i,f!=null&&f==!0?o=r:this._owner?(o=n.Utility.GetPasteData(this._owner.GetUseClipboard()),o=this.UpdateCrLfString(o,this._owner.GetAcceptsCrlf())):o=n.Utility.GetPasteData(!0),l=null,o!=null&&(o.IndexOf("\r")!=-1&&(o=o.Substring(0,o.IndexOf("\r"))),o.IndexOf("\n")!=-1&&(o=o.Substring(0,o.IndexOf("\n"))));if(o==null||o=="")return e;this.FireClientEvent("OnBeforePaste");var s=Math.min(t,i),v=Math.max(t,i),b=v-s;s==v?(e.SelectionStart=this._format.Fields.Insert(s,o,!1).cursorPos,e.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0),e.SelectionEnd=e.SelectionStart):(h=this.GetShowText2(this.GetShowLiterals(),!0,!0),y=this._owner._GetWatermark().NullTextReal,l=h!=null&&y!=""&&h==y&&this._format.Fields.fieldArray[0].text!=h?this._format.Fields.Insert(0,o,!1):this._format.Fields.Replace(s,b,o,!1),e.SelectionStart=l.cursorPos,e.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0),h==e.Text&&l.success==!1?(e.SelectionStart=s,e.SelectionEnd=v):e.SelectionEnd=e.SelectionStart),e.Text.Substring(s,s+o.GetLength())!=o&&e.SelectionStart-s0)u--,e+=o,s=this._format.Fields.GetFieldByIndex(u),o=s.GetLength(),s instanceof n.PromptField&&(e+=o,o=0);if(u==0){if(this._format.Fields.GetFieldByIndex(u)instanceof n.PromptField)return r;if(this._format.Fields.GetFieldByIndex(u).GetLength()==0)return r}if(this._format.Fields.GetFieldByIndex(u)instanceof n.FilterField)e=e+1,f=f-e,e=1;else if(this._format.Fields.GetFieldByIndex(u)instanceof n.EnumField)e=e+this._format.Fields.GetFieldByIndex(u).GetLength(),f=f-e,f=f>0?f:0;else return r;f=this._format.Fields.Delete(f,e),r.SelectionStart=f,r.SelectionEnd=r.SelectionStart}else{h=this._format.Fields.GetFieldIndex(f+e),c=h.index;if(c==-1)return r;o==0&&u!=0&&u--;if(u==c&&this._format.Fields.GetFieldByIndex(c)instanceof n.PromptField)return r;r.SelectionStart=this._format.Fields.Delete(f,e),r.SelectionEnd=r.SelectionStart}return r},i.prototype.PerformSpin=function(t,i,r,u,f){var e,o;if(this._format.Fields.fieldCount<=0)return null;e={},e.SelectionStart=t,e.SelectionEnd=i,e.Text=this.GetShowText2(this.GetShowLiterals(),!0,!0);var h=this._format.Fields.GetFieldIndex(i),s=h.index,c=h.offset;return s!=0&&c==0&&(t==i?this._format.Fields.fieldArray[s]instanceof n.EnumField||s--:t=0;u--)f.GetFieldByIndex(u)instanceof n.PromptField||(c+=f.GetFieldByIndex(u)._trueLength);else for(u=s;u>=0;u--)if(!(f.GetFieldByIndex(u)instanceof n.PromptField)){o=f.GetFieldRange(u),c=o.start+o.length;break}h=i,i=t.prototype.GetCaretPosition.call(this,i,r,a,c,"PromptField"),l=f.GetFieldIndexByPos(h),e=l.index;if(r==196647&&i==h){for(;ea)break}e==s&&(i=i+o.length)}if(r==131111)if(!(f.GetFieldByIndex(e)instanceof n.PromptField)&&f.GetFieldRange(e).length==0){while(f.GetFieldRange(e).length==0&&e0){var f=this._format.Fields.GetFieldIndex(u.SelectionStart),o=f.index,e=f.offset;this._format.Fields.GetFieldByIndex(o)instanceof n.PromptField&&this.isMulSelected==!1&&(u.SelectionStart-=e),u.SelectionEnd=u.SelectionStart}return this.isMulSelected=!1,u}this.isMulSelected=!1;if(this.isMulSelected&&r!=36&&r!=131108){u.SelectionStart=Math.min(t,i);var f=this._format.Fields.GetFieldIndex(u.SelectionStart),o=f.index,e=f.offset;this._format.Fields.GetFieldByIndex(o)instanceof n.PromptField&&(u.SelectionStart-=e),u.SelectionEnd=u.SelectionStart}else u.SelectionStart=this.GetCaretPosition(i,r),u.SelectionEnd=u.SelectionStart;return u},i.prototype.ProcessRightDirection=function(t,i,r){var u={},s,e,h,f,o;return this.isMulSelected&&r!=n.Key.End&&r!=131107?(u.SelectionStart=Math.max(t,i),s=this._owner._GetWatermark().NullTextReal,this._format.Fields.ValueIsNull()==!0&&s!=""?(u.SelectionEnd=u.SelectionStart,this.isMulSelected=!1,u):(f=this._format.Fields.GetFieldIndex(u.SelectionStart),e=f.index,h=f.offset,this._format.Fields.GetFieldByIndex(e)instanceof n.PromptField&&this.isMulSelected==!1&&(o=this._format.Fields.fieldArray[e],u.SelectionStart+=o.text.GetLength()-h),u.SelectionEnd=u.SelectionStart,this.isMulSelected=!1,u)):(u.SelectionStart=this.GetCaretPosition(i,r),u.SelectionEnd=u.SelectionStart,this.isMulSelected=!1,u)},i.prototype.IsLastInputField=function(t,i){var f=this._format.Fields.GetFieldIndex(t),r=f.index,u;if(i){while(rr;u--)if(!(this._format.Fields.fieldArray[u]instanceof n.PromptField))break;return u==r?!0:!1}else{while(r>0&&!(this._format.Fields.fieldArray[r-1]instanceof n.PromptField)&&this._format.Fields.fieldArray[r-1].text.GetLength()==0)r--;for(u=0;u