/* * * 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(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.UpdateUndoText=function(){throw"abstract method called";},t.prototype.CanUndo=function(n){throw"abstract method called";},t.prototype.UpdateField=function(n,t,i){throw"abstract method called";},t.prototype.BackupData=function(){throw"abstract method called";},t.prototype.RecoverData=function(){throw"abstract method called";},t.prototype.SetRange=function(n,t){throw"abstract method called";},t.prototype.GetRange=function(){throw"abstract method called";},t.prototype.GetValue=function(){throw"abstract method called";},t.prototype.GetStatus=function(){throw"abstract method called";},t.prototype.SetValue=function(n){throw"abstract method called";},t.prototype.GetRealLength=function(){throw"abstract method called";},t}(n.Field),f,i,u,r;n.DateTimeField=t,f=function(t){function i(n,i,r,u,f,e,o){t.call(this,f);var s=r.toString().GetLength();this.ID=n,this.maxLength=s,this.minLength=s,this.realLength=u,this.minValue=i,this.maxValue=r,this.holder=String.fromCharCode(255),this.undoText=this.text,this.undoBuffer=this.text,this.promptChar=e!=null?e:"_",this.max=0,this.min=0,this.DisplayFirstYearAsStart=o}return __extends(i,t),i.prototype.SetPromptChar=function(n){this.promptChar=n},i.prototype.Snap=function(){var n={};return n.FieldSnapResult=t.prototype.Snap.call(this),n.maxLength=this.maxLength,n.minLength=this.minLength,n.realLength=this.realLength,n.minValue=this.minValue,n.maxValue=this.maxValue,n.undoText=this.undoText,n.undoBuffer=this.undoBuffer,n.max=this.max,n.min=this.min,n.DisplayFirstYearAsStart=this.DisplayFirstYearAsStart,n},i.prototype.Revert=function(n){t.prototype.Revert.call(this,n.FieldSnapResult),this.maxLength=n.maxLength,this.minLength=n.minLength,this.realLength=n.realLength,this.minValue=n.minValue,this.maxValue=n.maxValue,this.undoText=n.undoText,this.undoBuffer=n.undoBuffer,this.max=n.max,this.min=n.min,this.DisplayFirstYearAsStart=n.DisplayFirstYearAsStart},i.prototype.GetValue=function(){return this.GetStatus()==n.FieldStatus.Null?-1:this.GetStatus()==n.FieldStatus.Part?-2:parseInt(this.text,10)},i.prototype.SetValue=function(n){if(n==-1){this.Clear();return}nthis.maxValue&&(n=this.maxValue);var t=n.toString();while(t.GetLength()"9")break;if(r==i.GetLength())e=Number(i),ethis.maxValue?u.existInvalid=!0:(t="",this.text=i);else{for(o=r;oh?u.existInvalid=!0:(t="",this.text=i)}else u.existInvalid=!0}return u.text=t,u},i.prototype.GetRealLength=function(){return this.realLength},i.prototype.GetCurrentLength=function(){var n=this.text.IndexOf(this.holder);return n==-1?this.text.GetLength():n},i.prototype.GetText=function(){var n=this.text;while(n.IndexOf(this.holder)!=-1)n=n.replace(this.holder,this.promptChar);return n},i.prototype.GetOldText=function(){return this.oldText.replace(this.holder,this.promptChar)},i.prototype.GetStatus=function(){var r=this.text.GetLength(),i=0,u,t;if(this._previousText)if(this._previousText==this.text)return this._cacheStatus;u=r!=this.text.length;if(u)for(t=0;tthis.maxValue)return this.SetValue(this.maxValue),!0}else if(this.GetStatus()==n.FieldStatus.Part)for(e=this.text,u=0,r=0;e.CharAt(u)!=this.holder;u++){f=e.CharAt(u),r*=10,this.IsValidChar(f)&&(r+=+f),t=this.RightShiftNumber(this.minValue,o-u-1),i=this.RightShiftNumber(this.maxValue,o-u-1);if(ri){this.ResetFrom(u);break}}return!1},i.prototype.RightShiftNumber=function(n,t){for(var i=0;n>0&&i="0"&&n<="9"},i.prototype.Delete=function(t,i){var h=this.maxLength,u,r,a,v,e,c,l;if(t<0||i<0||t+i>h)return t;var s=this.text,y=n.Utility.ToString(this.minValue,this.maxLength,"0"),f=s,o=s.Substring(0,t);for(f=f.Substring(0,t)+f.Substring(t+i,f.GetLength()),u=0,r=0;rv?(u-=parseFloat(f.CharAt(r)),u/=10,c=!0):(o+=f.CharAt(r),e++);return t==0&&u==0&&c?this.ResetFrom(0):(l=this.maxLength-o.GetLength(),l>0&&(o+=n.Utility.ToString(this.holder,l)),this.text=o),t},i.prototype.Put=function(t,i,r){var s=this.maxLength,h={},l,c,o,f;h.offset=t,h.isSuccess=!1;if(!this.IsValidChar(i))return h;var a=n.Utility.ToString(this.minValue,this.maxLength,"0"),e=0,u=this.text;for(f=0;fc){if(e==parseFloat(i)&&i!="0"){if(a.CharAt(t)!="0")return t!=0&&(h.isSuccess=!0,h.offset=t),h;else while(e>c||e=u.GetLength()-1)break}for(e=0,o=t;oc||ec||ec||e=i);if(s.isSuccess){t=s.offset;if(t==this.maxLength)break}else u.existInvalid=!0}return o==t?u:(h=i+o-t,e=this.text,e.GetLength()0&&(this.text=e.Substring(0,t)+e.Substring(o+i,e.GetLength())+n.Utility.ToString(this.holder,h)),r=f+1this.max))return;n!=this.current&&(this.current=n,this.value=n),this.text=this.GetText()},r.prototype.SetText=function(t){var r={},u,i,f;r.existInvalid=!0,r.text=t,u=t.GetLength();if(uthis.maxLength)return r;for(this.ClearKeyBuffer(),i=this.items.length-1;i>=0;i--){f=Math.min(u,this.items[i].length);if(n.Utility.Match(t,0,this.items[i],0,f,!0)){t=t.Substring(f,u),r.existInvalid=!1,r.text=t,this.SetValue(i);break}}return r},r.prototype.GetText=function(){return this.GetString(this.current)},r.prototype.GetFieldText=function(){return this.GetString(this.oldValue)},r.prototype.GetStatus=function(){return this.value==-1?n.FieldStatus.Null:n.FieldStatus.Full},r.prototype.UpdateField=function(n,t,i){if(n)this.oldValue=this.value;else if(t){var r=this.value;this.value=i?this.undoBuffer:this.undoValue,this.current=this.value,this.undoValue=r}else this.value=this.oldValue,this.current=this.oldValue},r.prototype.UpdateUndoText=function(){this.undoValue=this.value,this.undoBuffer=this.value},r.prototype.CanUndo=function(n){return n?this.undoBuffer!=this.value:this.undoValue!=this.value},r.prototype.BackupData=function(){this.oldkeyBuffer=this.keyBuffer},r.prototype.RecoverData=function(){this.keyBuffer=this.oldkeyBuffer,this.oldkeyBuffer=""},r.prototype.GetString=function(t){return t==-1?n.Utility.ToString(this.promptChar,this.minLength):tthis.max?"Invalid index":this.items[t]},r.prototype.Clear=function(){this.SetValue(-1)},r.prototype.GetItem=function(n){return this.items[n]},r.prototype.UpdateItems=function(n){if(n.length!=this.items.length)return;for(var t=0;t=this.items.length||t>i)return!1;this.min=t,this.max=i;if(this.GetStatus()==n.FieldStatus.Full){var r=this.GetValue();rthis.max&&this.SetValue(this.max)}return!0},r.prototype.GetFillingString=function(n){var i,t;if(this.current==-1){for(i="",t=0;tthis.maxLength||Number(i)==0)return-1;var u=this.GetText().Substring(0,t)+i,r=this.current;r!=-1&&(n.Utility.Match(u,0,this.items[r],0,t+1,!0)||(r=-1));if(r==-1)for(r=this.min;r<=this.max;r++)if(n.Utility.Match(u,0,this.items[r],0,t+1,!0))break;return r>this.max?-1:r},r.prototype.GetIndexInItems=function(t){for(var u=-1,f=0,r={},e,i=0;i1)break}return e=f>1,r.index=u,r.more=e,r},r.prototype.GetIndexByChar=function(n){var i=this.keyBuffer+n,t=this.GetIndex(i);return n!="0"&&t.index==-1&&this.keyBuffer.length>0&&(i=n.toString(),t=this.GetIndex(i)),t},r.prototype.GetIndex=function(t){for(var u={},f=-1,r=0,e,i=0;i=this.min&&this.keys[i].index<=this.max){f==-1&&(f=this.keys[i].index),r++;if(r>1)break}return e=r>1,u.index=f,u.more=e,u},r.prototype.SetKeyList=function(n,t){var u,r;if(n==null||t==null||n.length==0||t.length==0||n.length!=t.length)return!1;for(u=n.length,this.keys=new Array(u),r=0;r=this.maxLength||t=="")return r;f=this.GetIndexByChar(t),i=f.index;if(i!=-1)u=f.more,u&&(this.keyBuffer+=t,t=="0"&&this.keyBuffer.length==1&&(i=this.current),n--),this.keyBuffer.length==2&&(u=!1),this.SetValue(i);else if((i=this.Compare(n,t))!=-1)this.SetValue(i),e=this.GetIndexInItems(this.GetItem(i).Substring(0,n+1)),u=e.more;else if((i=this.GetIndexInItems(t.toString()).index)!=-1)n=0,this.SetValue(i),u=this.GetIndexInItems(t.toString()).more;else return r;return u?n++:this.ClearKeyBuffer(),r.offset=n,r.isSuccess=!0,r.more=u,r},r.prototype.Insert=function(t,i){var o=t,e=!1,r,u={},f;u.existInvalid=!1,u.offset=t,u.text=i;if(i==null||i.GetLength()==0)return u;for(r=0;r0&&t==this.GetLength())break;if(f.more==!1){for(;t+1=1)return new n.IntField(n.DateFieldID.ID_Day,1,31,2,"IntField",r);break;case"e":if(i>=1)return new n.IntField(n.DateFieldID.ID_EraYear,1,n.DateTimeInfo.EraYearMax,n.DateTimeInfo.Digits,"IntField",r);break;case"g":if(i>=1){e=new Array(n.DateTimeInfo.EraCount);if(i==1)for(f=0;f=3?3:i,"ValueEnumField",r),o.SetKeyList(n.DateTimeInfo.EraKeys,n.DateTimeInfo.EraIndices),o}break;case"h":if(i>=1)return new n.IntField(n.DateFieldID.ID_ShortHour,0,11,2,"IntField",r);break;case"H":if(i>=1)return new n.IntField(n.DateFieldID.ID_Hour,0,23,2,"IntField",r);break;case"m":if(i>=1)return new n.IntField(n.DateFieldID.ID_Minute,0,59,2,"IntField",r);break;case"M":if(i>=1)return i<1||i>2?(o=new n.ValueEnumField(n.DateFieldID.ID_Month,i>3?n.DateTimeInfo.MonthNames:n.DateTimeInfo.ShortMonthNames,i>3?4:3,"ValueEnumField",r),o.SetKeyList(["01","02","03","04","05","06","07","08","09","1","2","3","4","5","6","7","8","9","10","11","12"],[0,1,2,3,4,5,6,7,8,0,1,2,3,4,5,6,7,8,9,10,11]),o):new n.IntField(n.DateFieldID.ID_Month,1,12,2,"IntField",r);break;case"s":if(i>=1)return new n.IntField(n.DateFieldID.ID_Second,0,59,2,"IntField",r);break;case"t":if(i>=1)return e=[],i==1?(e[0]=u[0].Substring(0,1),e[1]=u[1].Substring(0,1)):(e[0]=u[0],e[1]=u[1]),s=new n.ValueEnumField(n.DateFieldID.ID_AMPM,e,i==1?1:2,"ValueEnumField",r),s.SetKeyList(["1","2","a","p"],[0,1,0,1]),s;break;case"y":if(i<1||i>2){if(i>=3)return new n.IntField(n.DateFieldID.ID_Year,1,9999,4,"IntField",r)}else return new n.IntField(n.DateFieldID.ID_Year,0,99,2,"IntField",r);break}return null}function i(t,i,r,u){var f,e,o;switch(t){case"d":if(i>=1)return i==1||i==2?new n.IntField(n.DateFieldID.ID_Day,1,31,i,"IntField",r):new n.ValueEnumField(n.DateFieldID.ID_Day,i==3?n.DateTimeInfo.ShortWeekDays:n.DateTimeInfo.WeekDays,i==3?3:4,"ValueEnumField",r);break;case"e":if(i>=1)return new n.IntField(n.DateFieldID.ID_EraYear,1,n.DateTimeInfo.EraYearMax,i==1?1:n.DateTimeInfo.Digits,"IntField",r);break;case"E":if(i>=1)return new n.IntField(n.DateFieldID.ID_EraYear,1,n.DateTimeInfo.EraYearMax,i==1?1:n.DateTimeInfo.Digits,"IntField",r,!0);break;case"g":if(i>=1){e=new Array(n.DateTimeInfo.EraCount);if(i==1)for(f=0;f=3?3:i,"ValueEnumField",r)}break;case"h":if(i>=1)return new n.IntField(n.DateFieldID.ID_ShortHour,0,11,i==1?1:2,"IntField",r);break;case"H":if(i>=1)return new n.IntField(n.DateFieldID.ID_Hour,0,23,i==1?1:2,"IntField",r);break;case"m":if(i>=1)return new n.IntField(n.DateFieldID.ID_Minute,0,59,i==1?1:2,"IntField",r);break;case"M":if(i>=1)return i<1||i>2?new n.ValueEnumField(n.DateFieldID.ID_Month,i>3?n.DateTimeInfo.MonthNames:n.DateTimeInfo.ShortMonthNames,i>3?4:3,"ValueEnumField",r):new n.IntField(n.DateFieldID.ID_Month,1,12,i,"IntField",r);break;case"s":if(i>=1)return new n.IntField(n.DateFieldID.ID_Second,0,59,i==1?1:2,"IntField",r);break;case"t":if(i>=1)return e=[],i==1?(e[0]=u[0].Substring(0,1),e[1]=u[1].Substring(0,1)):(e[0]=u[0],e[1]=u[1]),o=new n.ValueEnumField(n.DateFieldID.ID_AMPM,e,i==1?1:2,"ValueEnumField",r);break;case"y":if(i>=1)return i==1?new n.IntField(n.DateFieldID.ID_Year,0,99,1,"IntField",r):i==2?new n.IntField(n.DateFieldID.ID_Year,0,99,2,"IntField",r):i==3?new n.IntField(n.DateFieldID.ID_Year,1,9999,3,"IntField",r):new n.IntField(n.DateFieldID.ID_Year,1,9999,4,"IntField",r);break;case"A":if(i>=1)return new n.ADField(n.DateFieldID.ID_AD,"ADField");break;default:break}return null}function r(i,r){var u=null,f=11;(r.IsjqDate==!0||r.IsjqTime==!0)&&(f=5);if(i=="Format")u=new t(f,r),r.IsjqTime!=!0&&(u.Add(new n.IntField(n.DateFieldID.ID_Year,1,9999,4,"IntField",r.PromptChar)),u.Add(new n.PromptField("/")),u.Add(new n.IntField(n.DateFieldID.ID_Month,1,12,2,"IntField",r.PromptChar)),u.Add(new n.PromptField("/")),u.Add(new n.IntField(n.DateFieldID.ID_Day,1,31,2,"IntField",r.PromptChar))),r.IsjqDate==!0||r.IsjqTime==!0||u.Add(new n.PromptField(" ")),r.IsjqDate!=!0&&(u.Add(new n.IntField(n.DateFieldID.ID_Hour,0,23,2,"IntField",r.PromptChar)),u.Add(new n.PromptField(":")),u.Add(new n.IntField(n.DateFieldID.ID_Minute,0,59,2,"IntField",r.PromptChar)),u.Add(new n.PromptField(":")),u.Add(new n.IntField(n.DateFieldID.ID_Second,0,59,2,"IntField",r.PromptChar)));else return u=new t(f,r),r.IsjqTime!=!0&&(u.Add(new n.IntField(n.DateFieldID.ID_Year,1,9999,3,"IntField",r.PromptChar)),u.Add(new n.PromptField("/")),u.Add(new n.IntField(n.DateFieldID.ID_Month,1,12,1,"IntField",r.PromptChar)),u.Add(new n.PromptField("/")),u.Add(new n.IntField(n.DateFieldID.ID_Day,1,31,1,"IntField",r.PromptChar))),r.IsjqDate==!0||r.IsjqTime==!0||u.Add(new n.PromptField(" ")),r.IsjqDate!=!0&&(u.Add(new n.IntField(n.DateFieldID.ID_Hour,0,23,1,"IntField",r.PromptChar)),u.Add(new n.PromptField(":")),u.Add(new n.IntField(n.DateFieldID.ID_Minute,0,59,2,"IntField",r.PromptChar)),u.Add(new n.PromptField(":")),u.Add(new n.IntField(n.DateFieldID.ID_Second,0,59,2,"IntField",r.PromptChar))),u;return u}var t=function(t){function i(i,r){t.call(this,i),this._oldHiddenEra=-1,this._oldHiddenEraYear=-1,this._oldHiddenAMPM=-1,this._oldHiddenYear=-1,this._oldHiddenMonth=-1,this._oldHiddenDay=-1,this._oldHiddenHour=-1,this._oldHiddenMinute=-1,this._oldHiddenSecond=-1,this.hideEra=-1,this.hideEraYear=-1,this.hideAMPM=-1,this.hideYear=-1,this.hideMonth=-1,this.hideDay=-1,this.hideHour=-1,this.hideMinute=-1,this.hideSecond=-1,this.maxDate=new Date(9999,11,31,23,59,59),this.minDate=new Date(100,0,1),this._value=new Date,this._amDesignator="AM",this._pmDesignator="PM",this._hour12Mode=n.Hour12Mode.Hour0As12,this._midnightAs24=!1,this._promptChar="_",this._twoDigitYearMax=2029,this._validateMode=n.ValidateDate.ValidateEx,this.isUndoAfterEdit=!1,r!=null&&r.AmDesignator!=null&&(this._amDesignator=r.AmDesignator),r!=null&&r.PmDesignator!=null&&(this._pmDesignator=r.PmDesignator),r!=null&&r.Hour12Mode!=null&&(this._hour12Mode=r.Hour12Mode),r!=null&&r.MidnightAs24!=null&&(this._midnightAs24=r.MidnightAs24),r!=null&&r.PromptChar!=null&&(this._promptChar=r.PromptChar),r!=null&&r.TwoDigitYearMax!=null&&(this._twoDigitYearMax=r.TwoDigitYearMax),r!=null&&r.ValidateMode!=null&&(this._validateMode=r.ValidateMode),this.realMaxDate=r!=null&&r.MaxDate!=null?new Date(r.MaxDate):this.maxDate,this.realMinDate=r!=null&&r.MinDate!=null?new Date(r.MinDate):this.minDate,this.IsjqTime=r.IsjqTime!=null?r.IsjqTime:!1,this.IsjqDate=r.IsjqDate!=null?r.IsjqDate:!1}return __extends(i,t),i.prototype.GetDateTimeFieldByIndex=function(n){return this.GetFieldByIndex(n)},i.prototype.SetMaxDate=function(n){this.maxDate=n,this.realMaxDate=n},i.prototype.SetMinDate=function(n){this.minDate=n,this.realMinDate=n},i.prototype.SetHour12Mode=function(n){this._hour12Mode=n},i.prototype.SetMidnightAs24=function(n){this._midnightAs24=n},i.prototype.SetPromptChar=function(t){var i,u,r;for(this._promptChar=t,i=0;ii?(this.realMaxDate=this.realMinDate,this.RangeInvalid=!0):(this.realMaxDate>i&&(this.realMaxDate=i),this.realMinDaten.DateTimeInfo.EraMax?(this.realMinDate=this.realMaxDate,this.RangeInvalid=!0):this.realMaxDaten.DateTimeInfo.EraMax&&(this.realMaxDate=n.DateTimeInfo.EraMax),this.realMinDate=this.realMinDate&&n<=this.realMaxDate},i.prototype.AdjustValueForSpin=function(){if(this.EnhanceSpinBehavior()){if(this.JQueryTimeReachToBound!=null&&this.JQueryTimeReachToBound!=0){this.JQueryTimeReachToBound>0?this.SetValue(this.realMaxDate):this.JQueryTimeReachToBound<0&&this.SetValue(this.realMinDate);return}var n=this.GetValue(!1);n!=null&&i._isNotInvalidDate(n)&&(this.IsValueInMaxMinRange(n)||(n>this.realMaxDate?this.SetValue(this.realMaxDate):this.SetValue(this.realMinDate)))}},i.prototype.TwoDigitYearMax=function(){return this._twoDigitYearMax},i.prototype.InternalTwoDigitYearMax=function(){var n=this.TwoDigitYearMax();return n==99&&(n=100),n},i.prototype.HasDayField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Day);return t!=null&&(t.GetRealLength()==1||t.GetRealLength()==2)?!0:!1},i.prototype.HasWeekField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Day);return t!=null&&(t.GetRealLength()==3||t.GetRealLength()==4)?!0:!1},i.prototype.HasEraYearField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_EraYear);return t==null?!1:!0},i.prototype.HasJapanEraField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Era);return t==null?!1:!0},i.prototype.HasHourField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Hour);return t==null?!1:!0},i.prototype.HasShortHourField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_ShortHour);return t==null?!1:!0},i.prototype.HasMinuteField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Minute);return t==null?!1:!0},i.prototype.HasIntMonthField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Month);return t!=null&&(t.GetRealLength()==1||t.GetRealLength()==2)?!0:!1},i.prototype.HasEnumMonthField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Month);return t!=null&&(t.GetRealLength()==3||t.GetRealLength()==4)?!0:!1},i.prototype.HasSecondField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Second);return t==null?!1:!0},i.prototype.HasAMPMField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_AMPM);return t==null?!1:!0},i.prototype.HasFourDigitYearField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Year);return t!=null&&(t.GetRealLength()==3||t.GetRealLength()==4)?!0:!1},i.prototype.HasTwoDigitYearField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_Year);return t!=null&&(t.GetRealLength()==1||t.GetRealLength()==2)?!0:!1},i.prototype.HasADField=function(){var t=this.GetFieldByID(n.DateFieldID.ID_AD);return t==null?!1:!0},i.prototype.HasEraItem=function(){for(var t,i=0;ithis.GetLength())return t;for(r=0,i=0;i=0&&i.getHours()<12?(this.hideAMPM=0,this.hideHour=i.getHours()):(this.hideAMPM=1,this.hideHour=i.getHours()-12):i.getHours()>=0&&i.getHours()<12?(this.hideAMPM=0,this.hideHour=i.getHours()==0?12:i.getHours()):(this.hideAMPM=1,this.hideHour=i.getHours()==12?12:i.getHours()-12):(this._midnightAs24?(u=i.getHours(),this.hideHour=u==0?24:u):this.hideHour=i.getHours(),this.hideAMPM=i.getHours()>=0&&i.getHours()<12?0:1),this.IsjqTime==!0?(this.hideYear=1900,this.hideMonth=1,this.hideDay=1):(this.hideYear=i.getFullYear(),this.hideMonth=i.getMonth()+1,this.hideDay=i.getDate()),this.hideMinute=i.getMinutes(),this.hideSecond=i.getSeconds(),this.hideEra=r.era,this.hideEraYear=r.eraYear},i.prototype.UpdateUndoText=function(){for(var i,t=0;tthis.InternalTwoDigitYearMax()||ithis.InternalTwoDigitYearMax()||rt&&(this.hideYear=t),this.hideYear=1&&r=1&&u=30&&o<3||e.min>=20&&o<2||e.max>=10&&o<1)&&(f=!0))),f&&(this.HasJapanEraField()?(l.SetRange(0,n.DateTimeInfo.EraCount-1),l.SetValue(t-1)):this.hideEra=t-1,this.HasEraYearField()?(a.SetRange(1,n.DateTimeInfo.EraYears[t-1]),a.SetValue(n.DateTimeInfo.EraYears[t-1])):this.hideEraYear=n.DateTimeInfo.EraYears[t-1])):i==n.DateTimeInfo.EraYears[t]&&(f=!1,r>s.max&&r<=12&&(f=!0),r==-2&&(h=v.GetText(),s.max<10&&parseInt(h[0],10)==1&&(f=!0)),r==s.max&&(u>e.max&&(f=!0),u==-2&&(c=y.GetText(),o=parseInt(c[0],10),(e.max<30&&o==3||e.max<20&&o==2||e.max<10&&o==1)&&(f=!0))),f&&(this.HasJapanEraField()?(l.SetRange(0,n.DateTimeInfo.EraCount-1),l.SetValue(t+1)):this.hideEra=t+1,this.HasEraYearField()?(a.SetRange(1,n.DateTimeInfo.EraYears[t+1]),a.SetValue(1)):this.hideEraYear=1))},i.prototype.SetJapanEraAndEraYearRangeAndValue=function(){var s=0,h=n.DateTimeInfo.EraCount,e=1,r=1,t,u,f,c,a=this.GetFieldByID(n.DateFieldID.ID_Era),v=this.GetFieldByID(n.DateFieldID.ID_EraYear),l=this.GetFieldByID(n.DateFieldID.ID_Month),y=this.GetFieldByID(n.DateFieldID.ID_Day),i,o;if(this._validateMode==n.ValidateDate.ValidateNone||this._validateMode==n.ValidateDate.Validate)e=this._validateMode==n.ValidateDate.ValidateNone?0:1,r=n.DateTimeInfo.EraYearMax,this.HasJapanEraField()?a.SetRange(s,h):this.hideEra!=-1&&(this.hideErah&&(this.hideEra=h)),this.HasEraYearField()?v.SetRange(e,r):this.hideEraYear!=-1&&(this.hideEraYearr&&(this.hideEraYear=r));else{t=this.HasJapanEraField()&&a.GetStatus()==n.FieldStatus.Part?-2:this.GetJapanEra(),u=this.HasEraYearField()&&v.GetStatus()==n.FieldStatus.Part?-2:this.GetEraYear(),f=(this.HasEnumMonthField()||this.HasIntMonthField())&&l.GetStatus()==n.FieldStatus.Part?-2:this.GetMonth(),c=this.HasDayField()&&y.GetStatus()==n.FieldStatus.Part?-2:this.GetDay(),t==-2||t==-1?r=n.DateTimeInfo.EraYearMax:th&&(this.hideEra=h)),this.HasEraYearField()?v.SetRange(e,r):this.hideEraYear!=-1&&(this.hideEraYearr&&(this.hideEraYear=r));if(t==-1||t==-2)return;i=n.DateTimeInfo.GetValidMonthRange(t,u),o=n.DateTimeInfo.GetValidDayRange(t,u,f);if(t==0&&u==1){(f>=1&&f=1&&ce&&(this.hideMonth=e),this.hideMonthe&&(this.hideMonth=e),this.hideMonth=1&&iu.max&&i<=12?(o=!0,i=u.max):i==-2&&t!=n.ActionType.Delete&&(l=r.GetText(),c=parseInt(l[0],10),cu.max.toString().Substring(0,1)-0&&(o=!0,i=u.max)),o&&(this.HasEnumMonthField()?r.SetValue(i-1):this.HasIntMonthField()?r.SetValue(i):this.hideMonth=i)):this.HasEnumMonthField()?r.SetRange(0,11):this.HasIntMonthField?r.SetRange(1,12):this.hideMonth!=-1&&(this.hideMonth>12&&(this.hideMonth=12),this.hideMonth<1&&(this.hideMonth=1))},i.prototype.GetDay=function(){if(this.HasDayField()){var t=this.GetFieldByID(n.DateFieldID.ID_Day);return t.GetValue()}else return this.hideDay},i.prototype.SetDayRangeAndValue=function(t){var o=this.GetFieldByID(n.DateFieldID.ID_Day),f,i,u,r,h,s,a,l,v;if(this._validateMode==n.ValidateDate.ValidateNone||this._validateMode==n.ValidateDate.Validate)u=this._validateMode==n.ValidateDate.ValidateNone?0:1,r=this._validateMode==n.ValidateDate.ValidateNone?99:31,this.HasDayField()?o.SetRange(u,r):this.hideDay!=-1&&(this.hideDay>r&&(this.hideDay=r),this.hideDayr&&(this.hideDay=r),this.hideDay=1&&ie.max&&i<=r&&(c=!0,i=e.max),i==-2&&t!=n.ActionType.Delete&&(a=o.GetText(),l=parseInt(a[0],10),l>e.max.toString().Substring(0,1)-0&&(c=!0,i=e.max))),c&&(this.HasDayField()?o.SetValue(i):this.hideDay=i)}else v=(this.HasTwoDigitYearField()||this.HasFourDigitYearField())&&this.GetFieldByID(n.DateFieldID.ID_Year).GetStatus()==n.FieldStatus.Part?-2:this.GetGregorianYear(),f=(this.HasEnumMonthField()||this.HasIntMonthField())&&this.GetFieldByID(n.DateFieldID.ID_Month).GetStatus()==n.FieldStatus.Part?-2:this.GetMonth(),u=1,r=n.DateTimeInfo.DaysInMonth(v,f),this.HasDayField()?o.SetRange(u,r):this.hideDay!=-1&&(this.hideDay>r&&(this.hideDay=r),this.hideDayt&&(this.hideHour=t),this.hideHourt&&(this.hideHour=t),this.hideHourt&&(this.hideAMPM=t),this.hideAMPMt&&(this.hideMinute=t)},i.prototype.GetSecond=function(){if(this.HasSecondField()){var t=this.GetFieldByID(n.DateFieldID.ID_Second);return t.GetValue()}else return this.hideSecond},i.prototype.SetSecondRangeAndValue=function(){var i=0,t=this._validateMode==n.ValidateDate.ValidateNone?99:59;if(this.HasSecondField()){this.GetFieldByID(n.DateFieldID.ID_Second).SetRange(i,t);return}if(this.hideSecond==-1)return;this.hideSecondt&&(this.hideSecond=t)},i.prototype.ProcessDayBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Day),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,o.GetStatus()!=n.FieldStatus.Part&&this.SetDayRangeAndValue(t),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Delete&&(f.offset=o.Delete(i,r)),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?((this.HasJapanEraField()||this.HasEraYearField())&&o.GetStatus()!=n.FieldStatus.Part&&this.SetJapanEraAndEraYearRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.ProcessEraYearBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_EraYear),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetJapanEraAndEraYearRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?(this.SetMonthRangeAndValue(),this.SetDayRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.ProcessHour24Behavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Hour),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetHourRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",f.isChanged=t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?!0:!1,f},i.prototype.ProcessMinuteBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Minute),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetMinuteRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",f.isChanged=t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?!0:!1,f},i.prototype.ProcessIntMonthBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Month),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetMonthRangeAndValue(t),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?((this.HasJapanEraField()||this.HasEraYearField())&&this.SetJapanEraAndEraYearRangeAndValue(),this.SetDayRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.ProcessSecondBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Second),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetSecondRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",f.isChanged=t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?!0:!1,f},i.prototype.ProcessHour12Behavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_ShortHour),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetShortHourRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",f.isChanged=t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?!0:!1,f},i.prototype.ProcessYearBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Year),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetYearRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?(this.SetDayRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.ProcessAmpmBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_AMPM),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetAmpmRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",f.isChanged=t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?!0:!1,f},i.prototype.ProcessEraBehavior=function(t,i,r,u){var s=i,o=this.GetFieldByID(n.DateFieldID.ID_Era),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetJapanEraAndEraYearRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.offset||t==n.ActionType.Delete?(this.SetJapanEraAndEraYearRangeAndValue(),this.SetMonthRangeAndValue(),this.SetDayRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.ProcessEnumMonthBehavior=function(t,i,r,u){var s=u,o=this.GetFieldByID(n.DateFieldID.ID_Month),e={},f={};return f.offset=i,f.text=u,f.inChanged=!1,this.SetMonthRangeAndValue(),t==n.ActionType.Insert?(e=o.Insert(i,u),f.offset=e.offset,f.text=e.text):t==n.ActionType.Replace?(e=o.Replace(i,r,u),f.offset=e.offset,f.text=e.text):f.offset=o.Delete(i,r),f.OperationResult=e.existInvalid?"HasInvalid":"Success",t!=n.ActionType.Delete&&s!=f.text||t==n.ActionType.Delete?((this.HasJapanEraField()||this.HasEraYearField())&&this.SetJapanEraAndEraYearRangeAndValue(),this.SetDayRangeAndValue(),f.isChanged=!0):f.isChanged=!1,f},i.prototype.SetPromptText=function(n,t,i){var u=n.GetText().Substring(t,n.GetText().GetLength()-t),r={},f;return i.GetLength()>u.GetLength()?(f=i.Substring(0,u.GetLength()),f==u?(r.text=i.Substring(u.GetLength(),i.GetLength()),r.start=n.GetText().GetLength(),r.isSuccess=!0):(r.text="",r.isSuccess=!1)):i.GetLength()==u.GetLength()?i==u?(r.text="",r.start=n.GetText().GetLength(),r.isSuccess=!0):(r.text="",r.isSuccess=!1):(f=u.Substring(0,i.GetLength()),f==i?(r.text="",r.start=t+f.GetLength(),r.isSuccess=!0):(r.text="",r.isSuccess=!1)),r},i.prototype.Insert=function(t,i,r){var d=t,h,w,b={},c=0,p=!1,f={},e={},u,a,k,v,y;e.cursorPos=t,e.text=i,e.OperationResult="Success";if(this.fieldCount==0||i==null||i==""||t<0||t>=this.GetLength())return e;for(b=this.GetFieldIndexByPos(t),h=b.index,w=b.offset,c=h;ch&&(o=0);if(u instanceof n.PromptField)if(r)a=this.SetPromptText(u,o,i),a.isSuccess?(t=l+a.start,i=a.text,p=!0):e.OperationResult="HasInvalid";else if(s==this.fieldCount-1){e.OperationResult="HasInvalid";break}else t=l+u.GetLength();else{u instanceof n.IntField?f=u.ID==n.DateFieldID.ID_Day?this.ProcessDayBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_EraYear?this.ProcessEraYearBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_Hour?this.ProcessHour24Behavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_Minute?this.ProcessMinuteBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_Month?this.ProcessIntMonthBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_Second?this.ProcessSecondBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_ShortHour?this.ProcessHour12Behavior(n.ActionType.Insert,o,0,i):this.ProcessYearBehavior(n.ActionType.Insert,o,0,i):u instanceof n.ValueEnumField&&(f=u.ID==n.DateFieldID.ID_AMPM?this.ProcessAmpmBehavior(n.ActionType.Insert,o,0,i):u.ID==n.DateFieldID.ID_Era?this.ProcessEraBehavior(n.ActionType.Insert,o,0,i):this.ProcessEnumMonthBehavior(n.ActionType.Insert,o,0,i)),f.OperationResult=="HasInvalid"&&(e.OperationResult="HasInvalid");if(f.isChanged)t=l+f.offset,i=f.text,p=!0;else break}if(i==null||i=="")break;if(s==this.fieldCount-1){e.OperationResult="HasInvalid";break}l+=u.GetLength()}return p?(y=this.GetFieldIndexByPos(t),k=y.offset,v=y.index,this.GetFieldByIndex(v)instanceof n.PromptField&&v=this.GetLength()||i<=0)return h;w=this.GetFieldIndexByPos(t),l=w.index,a=w.offset,p=this.GetFieldIndexByPos(t+i),s=p.index,y=p.offset,y==0&&(s--,y=this.GetFieldByIndex(s).GetLength());if(l==-1||s==-1)return h;for(v=l;v<=s;v++)if(!(this.GetFieldByIndex(v)instanceof n.PromptField))break;if(v==s+1)return h;var r,f,b=!1,d=t-a,o="";for(c=l;c<=s;c++)e=this.GetDateTimeFieldByIndex(c),l==s?(r=a,f=y-a):c==l?(r=a,f=e.GetLength()-a):c==s?(r=0,f=y):(r=0,f=e.GetLength()),e instanceof n.IntField?e.ID==n.DateFieldID.ID_Day?(u=this.ProcessDayBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_EraYear?(u=this.ProcessEraYearBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_Hour?(u=this.ProcessHour24Behavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_Minute?(u=this.ProcessMinuteBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_Month?(u=this.ProcessIntMonthBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_Second?(u=this.ProcessSecondBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_ShortHour?(u=this.ProcessHour12Behavior(n.ActionType.Delete,r,f,o),r=u.offset):(u=this.ProcessYearBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e instanceof n.ValueEnumField?e.ID==n.DateFieldID.ID_AMPM?(u=this.ProcessAmpmBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e.ID==n.DateFieldID.ID_Era?(u=this.ProcessEraBehavior(n.ActionType.Delete,r,f,o),r=u.offset):(u=this.ProcessEnumMonthBehavior(n.ActionType.Delete,r,f,o),r=u.offset):e instanceof n.PromptField&&(u.isChanged=!1),u.isChanged&&(b=!0,h.isSucceed=!0),c==l&&(t=d+r);return b?this.isUndoAfterEdit=!0:t=k,h.cursorPos=t,h},i.prototype.Replace=function(t,i,r,u){var st=t,o,rt,b,p,ut={},it={},s={},l={},f=0,ft,ot,y,v,e,nt,k,g;l.cursorPos=t,l.text=r,l.OperationResult="Success";if(this.fieldCount==0||r==null||r==""||t<0||t>=this.GetLength()||i<=0)return l;for(ut=this.GetFieldIndexByPos(t),o=ut.index,rt=ut.offset,ft=t-rt,it=this.GetFieldIndexByPos(t+i),p=it.index,b=it.offset,b==0&&(p--,b=this.GetFieldByIndex(p).GetLength()),ot=t+i-b,f=o;f0?n.ActionType.Replace:n.ActionType.Insert;if(e instanceof n.PromptField){if(e instanceof n.PromptField)if(u)k=this.SetPromptText(e,h,r),k.isSuccess?(t=d+k.start,r=k.text,w=!0):(this.RollBack(),l.OperationResult="HasInvalid");else if(v==this.fieldCount-1){l.OperationResult="HasInvalid";break}else t=d+e.GetLength()}else{e instanceof n.IntField?s=e.ID==n.DateFieldID.ID_Day?this.ProcessDayBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_EraYear?this.ProcessEraYearBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_Hour?this.ProcessHour24Behavior(a,h,c,r):e.ID==n.DateFieldID.ID_Minute?this.ProcessMinuteBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_Month?this.ProcessIntMonthBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_Second?this.ProcessSecondBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_ShortHour?this.ProcessHour12Behavior(a,h,c,r):this.ProcessYearBehavior(a,h,c,r):e instanceof n.ValueEnumField&&(s=e.ID==n.DateFieldID.ID_AMPM?this.ProcessAmpmBehavior(a,h,c,r):e.ID==n.DateFieldID.ID_Era?this.ProcessEraBehavior(a,h,c,r):this.ProcessEnumMonthBehavior(a,h,c,r)),s.OperationResult=="HasInvalid"&&(l.OperationResult="HasInvalid");if(s.isChanged)t=d+s.offset,r=s.text,w=!0;else if(w){if(v-o=f.maxLength?f.maxLength:t.GetLength()),y=f.SetText(o);if(y.existInvalid){for(o=t.Substring(0,f.minLength),v=0;v0)return this.RollBack(),!1;if(this._validateMode==n.ValidateDate.ValidateNone||this._validateMode==n.ValidateDate.Validate)return!0;else if(this.HasEraYearField()||this.HasJapanEraField()){var a=this.GetJapanEra(),c=this.GetEraYear(),u=this.GetMonth(),r=this.GetDay();if(a==-1){if((u==4||u==6||u==9||u==11)&&r==31)return this.RollBack(),!1;else if(u==2){if(this.HasDayField()){e=this.GetFieldByID(n.DateFieldID.ID_Day);if(e.GetStatus()==n.FieldStatus.Part){s=e.GetText();if(s[0]=="3")return this.RollBack(),!1}}if(r<1||r>29)return this.RollBack(),!1}}else{k=1,d=n.DateTimeInfo.EraYears[a];if(c==-1){if(this.HasEraYearField()){g=this.GetFieldByID(n.DateFieldID.ID_EraYear);if(g.GetStatus()==n.FieldStatus.Part){var h=parseInt(g.GetText().Substring(0,1),10),w=k/10,p=d/10;if(hp)return this.RollBack(),!1}}if(u!=-1)if((u==4||u==6||u==9||u==11)&&r==31)return this.RollBack(),!1;else if(u==2){if(this.HasDayField()){e=this.GetFieldByID(n.DateFieldID.ID_Day);if(e.GetStatus()==n.FieldStatus.Part){s=e.GetText();if(s[0]=="3")return this.RollBack(),!1}}if(r<1||r>29)return this.RollBack(),!1}}else{if(cd)return this.RollBack(),!1;var ut=n.DateTimeInfo.GetValidMonthRange(a,c),ft=ut.min,et=ut.max;if(u==-1){if(this.HasIntMonthField()){b=this.GetFieldByID(n.DateFieldID.ID_Month);if(b.GetStatus()==n.FieldStatus.Part){var h=parseInt(b.GetText().Substring(0,1),10),w=ft/10,p=et/10;if(hp)return this.RollBack(),!1}}}else{if(uet)return this.RollBack(),!1;var rt=n.DateTimeInfo.GetValidDayRange(a,c,u),tt=rt.min,it=rt.max;if(r==-1){if(this.HasDayField()){e=this.GetFieldByID(n.DateFieldID.ID_Day);if(e.GetStatus()==n.FieldStatus.Part){var h=parseInt(e.GetText().Substring(0,1),10),w=tt/10,p=it/10;if(hp)return this.RollBack(),!1}}}else if(rit)return this.RollBack(),!1}}}}else{var nt=this.GetGregorianYear(),u=this.GetMonth(),r=this.GetDay();if(u!=-1)if((u==4||u==6||u==9||u==11)&&r==31)return this.RollBack(),!1;else if(u==2){if(this.HasDayField()){e=this.GetFieldByID(n.DateFieldID.ID_Day);if(e.GetStatus()==n.FieldStatus.Part){s=e.GetText();if(s[0]=="3")return this.RollBack(),!1}}if(r!=-1)if(nt!=-1&&n.DateTimeInfo.IsLeapYear(nt)){if(r<1||r>29)if(this.HasDayField)return this.RollBack(),!1;else r<1&&(r=1),r>29&&(r=29),this.hideDay=r}else if(r<1||r>28)if(this.HasDayField())return this.RollBack(),!1;else r<1&&(r=1),r>28&&(r=28),this.hideDay=r}}return!0},i.prototype.ClearFieldsContent=function(){for(var t,u,r,i=0;i=0&&r<12?(e=r,f=0):(e=r-12,f=1):r>=0&&r<12?(f=0,e=r==0?12:r):(f=1,e=r==12?12:r-12),this._midnightAs24&&r==0&&(r=24),i="",o=0;o=0&&u<12?(f=u,s=0):(f=u-12,s=1):u>=0&&u<12?(s=0,f=u==0?12:u):(s=1,f=u==12?12:u-12),this._midnightAs24&&u==0&&(u=24);var b=l%100,d=t.getDay(),r="";for(h=0;h=0||t==-2)return!1}else if(i instanceof n.ValueEnumField){u=i.GetValue(),t=parseInt(u.toString(),10);if(t>-1)return!1}}return!0},i.prototype.ValueIsEmptyEra=function(){var i=this.GetJapanEra(),t=this.GetEraYear();return this._value==null?!1:i<0||i>n.DateTimeInfo.EraCount-1?!0:(t<0&&t!=-2||t>n.DateTimeInfo.EraYears[i],!1)},i.prototype.GetHideValue=function(){return this._value},i.prototype.GetValue=function(t){var f,e,o,r,l,u,h,s,a,c;try{if(t==!0)return this._value;if(this.fieldCount==0)return this._value;e=this.GetMonth(),o=this.GetDay(),this.HasAMPMField()||this.HasShortHourField()?(l=this.GetAmpm(),u=this.GetHour12(),r=this._hour12Mode!=n.Hour12Mode.Hour12As0||u<12?this._hour12Mode==n.Hour12Mode.Hour0As12&&u==0||u>12?-1:l==-1||u<0?-1:this._hour12Mode==n.Hour12Mode.Hour12As0?l==0?u:u+12:l==0?u==12?0:u:u==12?12:u+12:-1):(r=this.GetHour24(),this._midnightAs24&&r===24&&(r=0)),h=this.GetMinute(),s=this.GetSecond();if(this.HasJapanEraField()||this.HasEraYearField()){a=!0,this._validateMode!=n.ValidateDate.ValidateEx&&(a=!1);if(this.ValueIsNull())return null;var y=this.GetJapanEra(),v=this.GetEraYear(),c=n.DateTimeInfo.ConvertToGregorianDate(y,v,e,o,r,h,s,a,this.HasMonthField(),this.HasDayField());return c==null?this._value==null?i.InvaildDate:this._value:(this._value=c,c)}else return this.ValueIsNull()?null:(f=this.GetGregorianYear(),c=new Date(f,e-1,o,r,h,s),f==-1&&e==-1&&o==-1&&r==-1&&h==-1&&s==-1?null:f==-1||e>12||o>n.DateTimeInfo.DaysInMonth(f,e)||r>23||h>59||s>59||f==0&&e==0&&o==0||f==-2||e==-2||o==-2||r==-2||h==-2||s==-2?i.InvaildDate:fthis.maxDate.getFullYear()?i.InvaildDate:e<=0||o<=0||r<0||h<0||s<0?i.InvaildDate:(this._value=c,c))}catch(p){}},i.prototype.SetValue=function(t){var d=!0,r,f,p,u,b,l,i,k,h,s,e,o,a,w,v,y;if(this.fieldCount==0)return this._value=t,!1;p={},this._value=t,this.ClearFieldsContent(),this.UpdateHiddenValue(t==null?new Date:t);if(t==null)return this.Delete(0,this.GetLength()),!0;if((this.HasJapanEraField()||this.HasEraYearField())&&!n.DateTimeInfo.IsValidEraDate(t))return this._value=t,!1;p=n.DateTimeInfo.GetEraDate(t),r=p.era,f=p.eraYear,this.HasFourDigitYearField()?(u=this.GetFieldByID(n.DateFieldID.ID_Year),this._validateMode==n.ValidateDate.ValidateNone?u.SetRange(0,9999):u.SetRange(1,9999),u.SetValue(t.getFullYear())):this.HasTwoDigitYearField()?(u=this.GetFieldByID(n.DateFieldID.ID_Year),u.SetRange(0,99),u.SetValue(t.getFullYear()%100),t.getFullYear()>this.TwoDigitYearMax()&&(d=!1)):this.HasJapanEraField()||this.HasEraYearField()?(this.HasJapanEraField()?(b=this.GetFieldByID(n.DateFieldID.ID_Era),b.SetRange(0,n.DateTimeInfo.EraCount-1),b.SetValue(r)):this.hideEra=r,this.HasEraYearField()?(l=this.GetFieldByID(n.DateFieldID.ID_EraYear),this._validateMode==n.ValidateDate.ValidateNone?l.SetRange(0,n.DateTimeInfo.EraYearMax):this._validateMode==n.ValidateDate.Validate?l.SetRange(1,n.DateTimeInfo.EraYearMax):l.SetRange(1,n.DateTimeInfo.EraYears[r]),l.SetValue(f)):this.hideEraYear=f):this.hideYear=t.getFullYear(),this.HasIntMonthField()?(i=this.GetFieldByID(n.DateFieldID.ID_Month),this._validateMode==n.ValidateDate.ValidateNone?i.SetRange(0,99):this._validateMode==n.ValidateDate.Validate?i.SetRange(1,12):(this.HasJapanEraField()||this.HasEraYearField())&&r==0&&f==1?i.SetRange(n.DateTimeInfo.EraDates[0].getMonth()+1,12):i.SetRange(1,12),i.SetValue(t.getMonth()+1)):this.HasEnumMonthField()?(i=this.GetFieldByID(n.DateFieldID.ID_Month),this._validateMode==n.ValidateDate.ValidateEx&&(this.HasJapanEraField()||this.HasEraYearField())&&r==0&&f==1?i.SetRange(n.DateTimeInfo.EraDates[0].getMonth(),11):i.SetRange(0,11),i.SetValue(t.getMonth())):this.hideMonth=t.getMonth()+1;if(this.HasDayField()){var c=this.GetFieldByID(n.DateFieldID.ID_Day),nt=t.getFullYear(),g=t.getMonth()+1;this._validateMode==n.ValidateDate.ValidateNone?c.SetRange(0,99):this._validateMode==n.ValidateDate.Validate?c.SetRange(1,31):(k=n.DateTimeInfo.GetValidDayRange(r,f,g),(this.HasEraYearField()||this.HasJapanEraField())&&r==0&&f==1&&t.getMonth()==n.DateTimeInfo.EraDates[r].getMonth()?c.SetRange(k.min,k.max):c.SetRange(1,n.DateTimeInfo.DaysInMonth(nt,g))),c.SetValue(t.getDate())}else this.hideDay=t.getDate();return this.HasHourField()?(h=this.GetFieldByID(n.DateFieldID.ID_Hour),s=t.getHours(),this._midnightAs24&&(s=s===0?24:s),this._validateMode==n.ValidateDate.ValidateNone?h.SetRange(0,99):this._midnightAs24?h.SetRange(1,24):h.SetRange(0,23),h.SetValue(s)):this.HasShortHourField()||this.HasAMPMField()?(this._hour12Mode==n.Hour12Mode.Hour12As0?t.getHours()>=0&&t.getHours()<12?(o=0,e=t.getHours()):(o=1,e=t.getHours()-12):t.getHours()>=0&&t.getHours()<12?(o=0,e=t.getHours()==0?12:t.getHours()):(o=1,e=t.getHours()==12?12:t.getHours()-12),this.HasShortHourField()?(a=this.GetFieldByID(n.DateFieldID.ID_ShortHour),this._validateMode==n.ValidateDate.ValidateNone?a.SetRange(0,99):this._hour12Mode==n.Hour12Mode.Hour12As0?a.SetRange(0,11):a.SetRange(1,12),a.SetValue(e)):this.hideHour=e,this.HasAMPMField()?(w=this.GetFieldByID(n.DateFieldID.ID_AMPM),w.SetRange(0,1),w.SetValue(o)):this.hideAMPM=o):this.hideHour=t.getHours(),this.HasMinuteField()?(v=this.GetFieldByID(n.DateFieldID.ID_Minute),this._validateMode==n.ValidateDate.ValidateNone?v.SetRange(0,99):v.SetRange(0,59),v.SetValue(t.getMinutes())):this.hideMinute=t.getMinutes(),this.HasSecondField()?(y=this.GetFieldByID(n.DateFieldID.ID_Second),this._validateMode==n.ValidateDate.ValidateNone?y.SetRange(0,99):y.SetRange(0,59),y.SetValue(t.getSeconds())):this.hideSecond=t.getSeconds(),d},i.prototype.GetFieldValue=function(t){var r,i,u;if(t instanceof n.IntField){t.GetStatus()==n.FieldStatus.Part?(i=t.GetText(),i=i.Substring(0,i.IndexOf(t.promptChar)),r=parseFloat(i)):r=t.GetValue();if(t.ID==n.DateFieldID.ID_Year&&this.HasTwoDigitYearField()){var f=r,e=parseInt((this.InternalTwoDigitYearMax()/100).toString(),10),o=this.InternalTwoDigitYearMax()%100;return f>o&&e--,e*100+f}else return r}else if(t instanceof n.ValueEnumField)return u=t.GetValue(),t.ID==n.DateFieldID.ID_Month&&u++,u;return-1},i.prototype.SetFieldValue=function(t,i){t instanceof n.IntField?(t.ID==n.DateFieldID.ID_Year&&this.HasTwoDigitYearField()&&(i%=100),t.SetValue(i)):t instanceof n.ValueEnumField&&(i!=-1&&t.ID==n.DateFieldID.ID_Month&&i--,t.SetValue(i))},i.prototype.GetEraRange=function(t){var i={};return t<0||t>=n.DateTimeInfo.EraCount?null:(i.startDate=n.DateTimeInfo.EraDates[t],i.endDate=t0&&o==0&&r.fieldLabel=="PromptField"&&u--,r=this.GetFieldByIndex(u),r!=null&&r.ID!=null&&(f=r.ID);switch(f){case n.DateFieldID.ID_Era:i=n.DateCursorPosition.Era;break;case n.DateFieldID.ID_EraYear:case n.DateFieldID.ID_Year:i=n.DateCursorPosition.Year;break;case n.DateFieldID.ID_Month:i=n.DateCursorPosition.Month;break;case n.DateFieldID.ID_Day:i=n.DateCursorPosition.Day;break;case n.DateFieldID.ID_AMPM:i=n.DateCursorPosition.AMPM;break;case n.DateFieldID.ID_ShortHour:case n.DateFieldID.ID_Hour:i=n.DateCursorPosition.Hour;break;case n.DateFieldID.ID_Minute:i=n.DateCursorPosition.Minute;break;case n.DateFieldID.ID_Second:i=n.DateCursorPosition.Second;break}return i},i.prototype.GetPosByCurrentField=function(t,i){var r="",u;switch(t){case n.DateCursorPosition.Era:r=n.DateFieldID.ID_Era;break;case n.DateCursorPosition.Year:r=this.HasEraYearField()?n.DateFieldID.ID_EraYear:n.DateFieldID.ID_Year;break;case n.DateCursorPosition.Month:r=n.DateFieldID.ID_Month;break;case n.DateCursorPosition.Day:r=n.DateFieldID.ID_Day;break;case n.DateCursorPosition.AMPM:r=n.DateFieldID.ID_AMPM;break;case n.DateCursorPosition.Hour:r=this.HasShortHourField()?n.DateFieldID.ID_ShortHour:n.DateFieldID.ID_Hour;break;case n.DateCursorPosition.Minute:r=n.DateFieldID.ID_Minute;break;case n.DateCursorPosition.Second:r=n.DateFieldID.ID_Second;break}u=t!=0?this.GetFieldIndexByID(r):this.GetFieldIndexByPos(i).index;if(u!=-1&&typeof u!="undefined")return this.GetFieldByIndex(u)instanceof n.PromptField&&(u==0?u++:u--),this.GetFieldRange(u);else if(i!=null)return this.GetFieldRange(0);return-1},i.prototype.PerformSpin=function(t,r,u){var s,e,c,o,f;if(r==0)return t;s=this.GetFieldIndexByPos(t),e=s.index,c=s.offset,o=this.GetFieldByIndex(e),e>0&&c==0&&o.fieldLabel=="PromptField"&&e--,o=this.GetFieldByIndex(e);if(o.fieldLabel=="PromptField")return t;this.InitMaxMinComplete||(this.InitMaxMin(),this.InitMaxMinComplete=!0);if(this.RangeInvalid)return t;f=this.GetValue(!1);if(this.EnhanceSpinBehavior()&&f!=null&&i._isNotInvalidDate(f)&&f.getFullYear){if(this.IsjqDate==!0){var h=new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),a=new Date(this.realMaxDate.getFullYear(),this.realMaxDate.getMonth(),this.realMaxDate.getDate(),0,0,0),l=new Date(this.realMinDate.getFullYear(),this.realMinDate.getMonth(),this.realMinDate.getDate(),0,0,0);if(this.EqualDate(h,a)&&r>0)return u&&this.SetValue(this.realMinDate),t;else if(this.EqualDate(h,l)&&r<0)return u&&this.SetValue(this.realMaxDate),t}else if(this.EqualDate(f,this.realMaxDate)&&r>0)return u&&this.SetValue(this.realMinDate),t;else if(this.EqualDate(f,this.realMinDate)&&r<0)return u&&this.SetValue(this.realMaxDate),t;if(!this.IsValueInMaxMinRange(f)){if(this.HasEraItem()&&(f>n.DateTimeInfo.EraMax||f0)return this.SetValue(this.realMinDate),t;else if(r<0)return this.SetValue(this.realMaxDate),t}}return this.RealPerformSpin(t,r,u)},i.prototype.EqualDate=function(t,i){if(!this.HasJapanEraField()&&!this.HasEraYearField())return(t.getFullYear()==i.getFullYear()||!this.HasYearField())&&(t.getMonth()==i.getMonth()||!this.HasMonthField())&&(t.getDate()==i.getDate()||!this.HasDayField())&&(t.getHours()==i.getHours()||!this.HasHourField()&&!this.HasShortHourField())&&(t.getMinutes()==i.getMinutes()||!this.HasMinuteField())&&(t.getSeconds()==i.getSeconds()||!this.HasSecondField());var u=n.DateTimeInfo.GetEraDate(t),r=n.DateTimeInfo.GetEraDate(i);return(u.era==r.era||!this.HasJapanEraField())&&(u.eraYear==r.eraYear||!this.HasEraYearField())&&(t.getMonth()==i.getMonth()||!this.HasMonthField())&&(t.getDate()==i.getDate()||!this.HasDayField())&&(t.getHours()==i.getHours()||!this.HasHourField()&&!this.HasShortHourField())&&(t.getMinutes()==i.getMinutes()||!this.HasMinuteField())&&(t.getSeconds()==i.getSeconds()||!this.HasSecondField())},i.prototype.RealPerformSpin=function(t,i,r){var vt,c,si,l,u,h,pt,oi,e,o,st,f,s,fi,ei,lt,rt,y;if(i==0)return t;vt=this.GetFieldIndexByPos(t),c=vt.index,si=vt.offset,l=this.GetFieldByIndex(c),c>0&&si==0&&l.fieldLabel=="PromptField"&&c--,u=this.GetFieldRange(c),h=t-u.start,l=this.GetFieldByIndex(c);if(l.fieldLabel=="PromptField")return t;l.ID==n.DateFieldID.ID_Era&&(i=i>0?1:-1);if(this.GetFieldsState()==n.DateFieldState.Null)if(i!=0)return this.SetFieldsLimitValue(i<0),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h);pt=this.FinishCurrentFieldForSpin(l,i),pt&&(i<0?i++:i>0&&i--);if(i==0)return u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h);oi=!this.HasHiddenField();if(oi&&this._validateMode==n.ValidateDate.ValidateEx&&this.GetFieldsState()==n.DateFieldState.Valid)return pt&&(r=!1),this.SpinValue(l,i,r),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h);if(this.GetFieldsState()==n.DateFieldState.Valid){var it=this.GetFieldByID(n.DateFieldID.ID_Year),y=this.GetFieldByID(n.DateFieldID.ID_Era),nt=this.GetFieldByID(n.DateFieldID.ID_EraYear),v=this.GetFieldByID(n.DateFieldID.ID_Month),g=this.GetFieldByID(n.DateFieldID.ID_Day),p=this.GetFieldByID(n.DateFieldID.ID_AMPM),a=this.GetFieldByID(n.DateFieldID.ID_Hour),tt=this.GetFieldByID(n.DateFieldID.ID_Minute),b=this.GetFieldByID(n.DateFieldID.ID_Second);a==null&&(a=this.GetFieldByID(n.DateFieldID.ID_ShortHour));var yt,ot,ct,et,bt,dt,at,gt,ut,kt,ni=0,ri=0,ti=0,ii=0,ft=99,ui=99,wt=99,ht=1;this._validateMode==n.ValidateDate.ValidateNone?(yt=0,ot=0,ct=0,et=0,bt=0,dt=9999,at=n.DateTimeInfo.EraCount-1,gt=n.DateTimeInfo.EraYearMax,ut=99,kt=99,ni=0,ft=99,ri=0,ui=99,ti=0,wt=99,ii=0,ht=1,v!=null&&v instanceof n.ValueEnumField&&(ut=12,et=1)):(yt=100,ot=0,ct=1,et=1,bt=1,dt=9999,at=n.DateTimeInfo.EraCount-1,gt=n.DateTimeInfo.EraYearMax,ut=12,kt=31,ni=0,ft=p!=null?11:23,ri=0,ui=59,ti=0,wt=59,ii=0,ht=1),e=!0,o=!0,it==null?(nt==null||y==null)&&(e=!1):(v==null||g==null)&&(e=!1),tt==null||b==null?o=!1:a==null?o=!1:p==null&&a.ID==n.DateFieldID.ID_ShortHour&&(o=!1),st=e&&o,i>0&&st?(e&&it!=null&&this.GetFieldValue(it)!=dt&&(e=!1),e&&y!=null&&this.GetFieldValue(y)!=at&&(e=!1),e&&nt!=null&&this.GetFieldValue(nt)!=gt&&(e=!1),e&&v!=null&&this.GetFieldValue(v)!=ut&&(e=!1),e&&g!=null&&this.GetFieldValue(g)!=kt&&(e=!1),o&&p!=null&&this.GetFieldValue(p)!=ht&&(o=!1),o&&a!=null&&this.GetFieldValue(a)!=ft&&(o=!1),o&&tt!=null&&this.GetFieldValue(tt)!=ui&&(o=!1),o&&b!=null&&this.GetFieldValue(b)!=wt&&(o=!1)):st&&(e&&it!=null&&this.GetFieldValue(it)!=yt&&(e=!1),e&&y!=null&&this.GetFieldValue(y)!=ot&&(e=!1),e&&nt!=null&&this.GetFieldValue(nt)!=ct&&(e=!1),e&&v!=null&&this.GetFieldValue(v)!=et&&(e=!1),e&&g!=null&&this.GetFieldValue(g)!=bt&&(e=!1),o&&p!=null&&this.GetFieldValue(p)!=ii&&(o=!1),o&&a!=null&&this.GetFieldValue(a)!=ni&&(o=!1),o&&tt!=null&&this.GetFieldValue(tt)!=ri&&(o=!1),o&&b!=null&&this.GetFieldValue(b)!=ti&&(o=!1));if(e&&o)return r&&this.SetFieldsLimitValue(i<0),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h)}if(this._validateMode==n.ValidateDate.ValidateEx&&this.GetFieldsState()==n.DateFieldState.Valid)if(this.HasEraItem()){f=this.GetValue(),s=f;switch(l.ID){case n.DateFieldID.ID_Second:f.setSeconds(f.getSeconds()+i),s=new Date(f.valueOf());break;case n.DateFieldID.ID_Minute:f.setMinutes(f.getMinutes()+i),s=new Date(f.valueOf());break;case n.DateFieldID.ID_Hour:case n.DateFieldID.ID_ShortHour:f.setHours(f.getHours()+i),s=new Date(f.valueOf());break;case n.DateFieldID.ID_AMPM:f.setHours(f.getHours()+i*12),s=new Date(f.valueOf());break;case n.DateFieldID.ID_Day:f.setDate(f.getDate()+i),s=new Date(f.valueOf());break;case n.DateFieldID.ID_Month:var k=f.getMonth()+1,w=f.getDate(),d=f.getFullYear(),hi=s.getHours(),ci=s.getMinutes(),li=s.getSeconds(),ai=n.DateTimeInfo.DaysInMonth(d,k+i);w>n.DateTimeInfo.DaysInMonth(d,k+i)&&(w=ai),s=new Date(d,k+i-1,w,hi,ci,li);break;case n.DateFieldID.ID_EraYear:var k=f.getMonth()+1,w=f.getDate(),d=f.getFullYear(),hi=s.getHours(),ci=s.getMinutes(),li=s.getSeconds();k==2&&(n.DateTimeInfo.IsLeapYear(d+i)||w>28&&(w=28)),s=new Date(d+i,k-1,w,hi,ci,li);break;case n.DateFieldID.ID_Era:return this.SpinEra(f,i,r),this.OnFieldChanged(l),this.AdjustValueForSpin(),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h)}return lt=n.DateTimeInfo.GetEraDate(s),fi=lt.era,ei=lt.eraYear,fi==-1||ei==-1?i>0?n.DateTimeInfo.Equal(f,n.DateTimeInfo.EraMax)&&r?this.SetValue(n.DateTimeInfo.EraMin):this.SetValue(n.DateTimeInfo.EraMax):(n.DateTimeInfo.Equal(f,n.DateTimeInfo.EraMin)&&r?this.SetValue(n.DateTimeInfo.EraMax):this.SetValue(n.DateTimeInfo.EraMin),l.ID==n.DateFieldID.ID_Day&&(rt=new Date(rt.setDate(rt.getDate()-i)),n.DateTimeInfo.Equal(rt,n.DateTimeInfo.EraMin)&&r&&this.SetValue(n.DateTimeInfo.EraMax))):this.SetValue(s),this.AdjustValueForSpin(),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h)}this.JQueryTimeReachToBound=0;switch(l.ID){case n.DateFieldID.ID_Second:i=this.SpinSecond(i);case n.DateFieldID.ID_Minute:i=this.SpinMinute(i);case n.DateFieldID.ID_Hour:i=this.SpinHour(i);case n.DateFieldID.ID_ShortHour:i=this.SpinHour(i);case n.DateFieldID.ID_AMPM:i=this.SpinAMPM(i);case n.DateFieldID.ID_Day:i=this.SpinDay(i,r);case n.DateFieldID.ID_Month:i=this.SpinMonth(i);case n.DateFieldID.ID_EraYear:this.HasEraItem()&&(i=this.SpinEraYear(i,r));case n.DateFieldID.ID_Era:this.HasEraItem()&&(y=this.GetFieldByID(n.DateFieldID.ID_Era),i=this.SpinEra1(i,r),this.OnFieldChanged(y));case n.DateFieldID.ID_Year:i=this.SpinYear(i,r);break}return this.AdjustValueForSpin(),u=this.GetFieldRange(c),t=u.start+(h>u.length?u.length:h)},i.prototype.IsTimeLimit=function(t){var i,e,o,s,u,f,r,h;o=this.GetFieldByID(n.DateFieldID.ID_Second),u=o==null?this.hideSecond:this.GetFieldValue(o);if(u>0&&!t||u<59&&t)return!1;e=this.GetFieldByID(n.DateFieldID.ID_Minute),f=e==null?this.hideMinute:this.GetFieldValue(e);if(f>0&&!t||f<59&&t)return!1;i=this.GetFieldByID(n.DateFieldID.ID_Hour);if(i!=null)r=this.GetFieldValue(i);else{i=this.GetFieldByID(n.DateFieldID.ID_ShortHour),s=this.GetFieldByID(n.DateFieldID.ID_AMPM),i==null?r=this.hideHour:(h=s==null?this.hideAMPM:this.GetFieldValue(s),r=this.GetFieldValue(i)%12+h*12);if(r>0&&!t||r<23&&t)return!1}return!0},i.prototype.IsFieldsLimitValue=function(t){var y=this.GetFieldByID(n.DateFieldID.ID_EraYear),f=this.GetFieldByID(n.DateFieldID.ID_Month),w=this.GetFieldByID(n.DateFieldID.ID_Day),a=this.GetFieldByID(n.DateFieldID.ID_AMPM),u=this.GetFieldByID(n.DateFieldID.ID_Hour),p=this.GetFieldByID(n.DateFieldID.ID_Minute),v=this.GetFieldByID(n.DateFieldID.ID_Second),e,r,s,o,l,h,c,i;u==null&&(u=this.GetFieldByID(n.DateFieldID.ID_ShortHour)),t?this._validateMode==n.ValidateDate.ValidateNone?(o=99,l=99,h=99,c=1):(o=23,(a!=null||u!=null&&u.ID==n.DateFieldID.ID_ShortHour)&&(o=11),l=59,h=59,c=1):(o=0,l=0,h=0,c=0),this._validateMode==n.ValidateDate.ValidateNone?t?(e=n.DateTimeInfo.EraYearMax,r=99,s=99,f!=null&&f instanceof n.ValueEnumField&&(r=12)):(e=0,r=0,s=0,f!=null&&f instanceof n.ValueEnumField&&(r=1)):t?(e=n.DateTimeInfo.EraYearMax,r=12,s=31):(e=1,r=1,s=1),i=v==null?this.hideSecond:this.GetFieldValue(v);if(i!=h)return!1;i=p==null?this.hideMinute:this.GetFieldValue(p);if(i!=l)return!1;i=a==null?this.hideAMPM:this.GetFieldValue(a);if(i!=c)return!1;i=u==null?this.hideHour:this.GetFieldValue(u);if(i!=o)return!1;i=w==null?this.hideDay:this.GetFieldValue(w);if(i!=s)return!1;i=f==null?this.hideMonth:this.GetFieldValue(f);if(i!=r)return!1;return i=y==null?this.hideEraYear:this.GetFieldValue(y),i!=e?!1:!0},i.prototype.SetFieldsLimitValue=function(t){var p=this.GetFieldByID(n.DateFieldID.ID_Era),w=this.GetFieldByID(n.DateFieldID.ID_EraYear),y=this.GetFieldByID(n.DateFieldID.ID_Year),l=this.GetFieldByID(n.DateFieldID.ID_Month),g=this.GetFieldByID(n.DateFieldID.ID_Day),b=this.GetFieldByID(n.DateFieldID.ID_AMPM),a=this.GetFieldByID(n.DateFieldID.ID_Hour),d=this.GetFieldByID(n.DateFieldID.ID_Minute),k=this.GetFieldByID(n.DateFieldID.ID_Second),u,e,o,i,f,s,c,h,v,r;a==null&&(a=this.GetFieldByID(n.DateFieldID.ID_ShortHour)),t?this._validateMode==n.ValidateDate.ValidateNone?(s=99,c=99,h=99,v=1):(s=23,(b!=null||a!=null&&a.ID==n.DateFieldID.ID_ShortHour)&&(s=11),c=59,h=59,v=1):(s=0,c=0,h=0,v=0),this._validateMode!=n.ValidateDate.ValidateEx&&(k==null?this.hideSecond=h:this.SetFieldValue(k,h),d==null?this.hideMinute=c:this.SetFieldValue(d,c),a==null?this.hideHour=s:this.SetFieldValue(a,s),b==null?this.hideAMPM=v:this.SetFieldValue(b,v)),this._validateMode==n.ValidateDate.ValidateNone?t?(u=9999,e=n.DateTimeInfo.EraCount-1,o=n.DateTimeInfo.EraYearMax,i=99,f=99,l!=null&&l instanceof n.ValueEnumField&&(i=12)):(u=0,e=0,o=0,i=0,f=0,l!=null&&l instanceof n.ValueEnumField&&(i=1)):t?(p!=null||w!=null)&&this._validateMode!=n.ValidateDate.Validate?(u=9999,e=n.DateTimeInfo.EraCount-1,o=n.DateTimeInfo.EraYears[e],i=12,f=31):(u=9999,e=n.DateTimeInfo.EraCount-1,o=n.DateTimeInfo.EraYearMax,i=12,f=31):(p!=null||w!=null)&&this._validateMode!=n.ValidateDate.Validate?(u=100,e=0,o=1,i=n.DateTimeInfo.EraMin.getMonth()+1,f=n.DateTimeInfo.EraMin.getDate()):(u=100,e=0,o=1,i=1,f=1),this.IsjqTime==!0&&(u=1900,i=1,f=1),this._validateMode!=n.ValidateDate.ValidateEx&&(y==null?this.hideYear=u:y.maxLength==4?this.SetFieldValue(y,u):this.SetFieldValue(y,u%100),p==null?this.hideEra=e:this.SetFieldValue(p,e),w==null?this.hideEraYear=o:this.SetFieldValue(w,o),l==null?this.hideMonth=i:this.SetFieldValue(l,i),g==null?this.hideDay=f:this.SetFieldValue(g,f)),this._validateMode==n.ValidateDate.ValidateEx&&(r=new Date,s=t?23:0,this.HasEraItem()?(r=n.DateTimeInfo.MakeDate(e,o,i,f),t&&(r=new Date(r.setDate(r.getDate()+1)),r=new Date(r.setSeconds(r.getSeconds()-1)))):r=new Date(u,i-1,f,s,c,h),this.EnhanceSpinBehavior()&&!this.IsValueInMaxMinRange(r)?t?this.SetValue(this.realMaxDate):this.SetValue(this.realMinDate):this.SetValue(r))},i.prototype.FinishCurrentFieldForSpin=function(t,i){var c=!1,f,e,y={},s=0,o=0,r=0,l,v,u,b;y=t.GetRange(),s=y.min,o=y.max;if(t.GetStatus()!=n.FieldStatus.Full){if(t instanceof n.ValueEnumField)t.GetStatus()==n.FieldStatus.Null&&(i<0?r=o:i>0&&(r=s)),t.SetValue(r),this.OnFieldChanged(t),c=!0;else if(t instanceof n.IntField){t.GetStatus()==n.FieldStatus.Null||this.GetFieldValue(t)o?i<0?r=o:i>0&&(r=s):r=this.GetFieldValue(t);if(t.ID==n.DateFieldID.ID_EraYear){l=this.GetFieldByID(n.DateFieldID.ID_Era),v=l==null?this.hideEra:l.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(l):-1;if(v!=-1){b=r==o;if(r==s||r==o){f=this.GetFieldByID(n.DateFieldID.ID_Month),e=this.GetFieldByID(n.DateFieldID.ID_Day);if(f!=null&&f.GetStatus()==n.FieldStatus.Full){var h=this.GetFieldValue(f),a=e!=null&&e.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(e):-1,k,p,w=this.GetEraRange(v);k=w.startDate,p=w.endDate,b?(u=p,(h>u.getMonth()+1||h==u.getMonth()+1&&a>u.getDate())&&this.SetValue(u)):(u=k,(h0?(e&&w!=null&&this.GetFieldValue(w)!=ti&&(e=!1),e&&h!=null&&this.GetFieldValue(h)!=pt&&(e=!1),e&&k!=null&&this.GetFieldValue(k)!=ni&&(e=!1),e&&nt!=null&&this.GetFieldValue(nt)!=ui&&(e=!1),f&&p!=null&&this.GetFieldValue(p)!=vt&&(f=!1),f&&a!=null&&this.GetFieldValue(a)!=ri&&(f=!1),f&&y!=null&&this.GetFieldValue(y)!=lt&&(f=!1),f&&g!=null&&this.GetFieldValue(g)!=yt&&(f=!1),f&&d!=null&&this.GetFieldValue(d)!=ct&&(f=!1)):(e&&w!=null&&this.GetFieldValue(w)!=gt&&(e=!1),e&&h!=null&&this.GetFieldValue(h)!=fi&&(e=!1),e&&k!=null&&this.GetFieldValue(k)!=dt&&(e=!1),e&&nt!=null&&this.GetFieldValue(nt)!=ii&&(e=!1),f&&p!=null&&this.GetFieldValue(p)!=wt&&(f=!1),f&&a!=null&&this.GetFieldValue(a)!=kt&&(f=!1),f&&y!=null&&this.GetFieldValue(y)!=bt&&(f=!1),f&&g!=null&&this.GetFieldValue(g)!=st&&(f=!1),f&&d!=null&&this.GetFieldValue(d)!=at&&(f=!1)),this.HasTwoDigitYearField()?(s=new Date(this.InternalTwoDigitYearMax(),11,31,23,59,59),o=new Date(this.InternalTwoDigitYearMax()-99,0,1)):(s=this.maxDate,o=this.minDate),a!=null&&y!=null&&(s>n.DateTimeInfo.EraMax&&(s=n.DateTimeInfo.EraMax),othis.realMaxDate&&(s=this.realMaxDate),o0,u=b?s:o):e&&(b=i>0,u=b?new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59):new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0));if(i<0&&n.DateTimeInfo.Equal(u,o,!0))if(r)u=s;else return;else if(i>0&&n.DateTimeInfo.Equal(u,s,!0))if(r)u=o;else return;else{switch(t.ID){case n.DateFieldID.ID_Second:u=new Date(u.setSeconds(u.getSeconds()+i));break;case n.DateFieldID.ID_Minute:u=new Date(u.setMinutes(u.getMinutes()+i));break;case n.DateFieldID.ID_Hour:u=new Date(u.setHours(u.getHours()+i));break;case n.DateFieldID.ID_ShortHour:u=new Date(u.setHours(u.getHours()+i));break;case n.DateFieldID.ID_Day:u=new Date(u.setDate(u.getDate()+i));break;case n.DateFieldID.ID_Month:var v=u.getMonth()+1,c=u.getDate(),l=u.getFullYear(),ot=u.getHours(),et=u.getMinutes(),ft=u.getSeconds(),ht=n.DateTimeInfo.DaysInMonth(l,v+i);c>ht&&(c=ht),u=new Date(l,v+i-1,c,ot,et,ft);break;case n.DateFieldID.ID_Year:var v=u.getMonth()+1,c=u.getDate(),l=u.getFullYear(),ot=u.getHours(),et=u.getMinutes(),ft=u.getSeconds();v==2&&(n.DateTimeInfo.IsLeapYear(l+i)||c>28&&(c=28)),u=l+i<100?o:new Date(l+i,v-1,c,ot,et,ft);break;case n.DateFieldID.ID_EraYear:var v=u.getMonth()+1,c=u.getDate(),l=u.getFullYear(),ot=u.getHours(),et=u.getMinutes(),ft=u.getSeconds();v==2&&(n.DateTimeInfo.IsLeapYear(l+i)||c>28&&(c=28)),u=new Date(l+i,v-1,c,ot,et,ft);break;case n.DateFieldID.ID_AMPM:u=new Date(u.setHours(u.getHours()+i*12));break;case n.DateFieldID.ID_Era:this.SpinEra(u,i,r),this.OnFieldChanged(t),this.AdjustValueForSpin();return}us&&(u=s)}this.SetValue(u)},i.prototype.SpinEraYear=function(t,i){var o,d,k,v,g,f,e,h,b,l,w,p;if(t==0)return 0;o=this.GetFieldByID(n.DateFieldID.ID_EraYear);if(o!=null&&o.GetStatus()!=n.FieldStatus.Full)return 0;var r=o==null?this.hideEraYear:this.GetFieldValue(o),a=this.GetFieldByID(n.DateFieldID.ID_Era),u=a==null?this.hideEra:a.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(a):-1,c=1,s=n.DateTimeInfo.EraYearMax;if(this._validateMode==n.ValidateDate.ValidateNone)c=0;else if(this._validateMode==n.ValidateDate.ValidateEx)if(u!=-1){d=this.GetFieldByID(n.DateFieldID.ID_Month),k=this.GetFieldByID(n.DateFieldID.ID_Day),v=d==null?this.hideMonth:this.GetFieldValue(d),g=k==null?this.hideDay:this.GetFieldValue(k),a==null?(b=this.GetEraRange(u),e=b.endDate,h=b.startDate):(h=n.DateTimeInfo.EraMin,e=n.DateTimeInfo.EraMax),f=n.DateTimeInfo.MakeDate(u,r,v,g);if(f!=-1){var it=f,nt=f.getMonth()+1,y=f.getDate(),tt=f.getFullYear(),rt=f.getHours(),ut=f.getMinutes(),ft=f.getSeconds();return nt==2&&(n.DateTimeInfo.IsLeapYear(tt+t)||y>28&&(y=28)),f=new Date(tt+t,nt-1,y,rt,ut,ft),f>h?fe?i&&it==e&&this.IsTimeLimit(!0)?this.SetValue(h):this.SetValue(e):this.SetValue(e):i&&r==1&&this.IsTimeLimit(!1)?this.SetValue(e):this.SetValue(h),0}else{c=1,s=n.DateTimeInfo.EraYears[u],p=this.GetEraRange(u),h=p.startDate,e=p.endDate;if(r+t>s)this.SetValue(e);else if(r+th.getMonth()+1){if(r==s&&v>=e.getMonth()+1)return this.SetValue(e),0}else return this.SetValue(h),0;o==null?this.hideEraYear=r:this.SetFieldValue(o,r)}return 0}}r+=t;if(u!=-1&&this._validateMode!=n.ValidateDate.ValidateEx){if(u==0&&rs)return this.IsFieldsLimitValue(!0)?i&&this.SetFieldsLimitValue(!1):this.SetFieldsLimitValue(!0),0}if(rs)for(t=0;r>s;t++)u!=-1&&this._validateMode==n.ValidateDate.ValidateEx&&(s=n.DateTimeInfo.EraYears[u]),r-=s-c+1;else t=0;return o==null?this.hideEraYear=r:this.SetFieldValue(o,r),t},i.prototype.SpinEra=function(t,i,r){var u,o,s,c,l,f,a,h,e;if(i==0)return;if(i>0&&n.DateTimeInfo.Equal(t,n.DateTimeInfo.EraMax,!0)){r&&this.SetValue(n.DateTimeInfo.EraMin);return}if(i<0&&n.DateTimeInfo.Equal(t,n.DateTimeInfo.EraMin,!0)){r&&this.SetValue(n.DateTimeInfo.EraMax);return}s=n.DateTimeInfo.GetEraDate(t),u=s.era,o=s.eraYear,c=0,l=n.DateTimeInfo.EraCount-1,u+=i,i>0&&u>l?t=n.DateTimeInfo.EraMax:i<0&&u0&&e>s?this._validateMode==n.ValidateDate.ValidateEx?(u=this.GetValue(),i._isInvalidDate(u)||u==null?this.SetValue(n.DateTimeInfo.EraMax):n.DateTimeInfo.Equal(u,n.DateTimeInfo.EraMax)?r&&this.SetValue(n.DateTimeInfo.EraMin):this.SetValue(n.DateTimeInfo.EraMax)):this.IsFieldsLimitValue(!0)?r&&this.SetFieldsLimitValue(!1):this.SetFieldsLimitValue(!0):t<0&&ethis.InternalTwoDigitYearMax()||ithis.InternalTwoDigitYearMax()||t0&&p>w?(f=this.GetValue(!0),f==null||n.DateTimeInfo.Equal(f,this.realMaxDate)?i&&this.SetValue(this.realMinDate):this.SetValue(this.realMaxDate),s=!0):t<0&&p0&&e>y&&!s?this._validateMode==n.ValidateDate.ValidateEx?(f=this.GetValue(),f==null||n.DateTimeInfo.Equal(f,this.maxDate)?i&&this.SetValue(this.minDate):this.SetValue(this.maxDate)):this.SetFieldsLimitValue(!0):t<0&&ec&&(r=c),this.SetFieldValue(o,r))):o.GetStatus()==n.FieldStatus.Part&&h==2&&(v=o.GetText(),v.CharAt(0)=="3"&&v.CharAt(1)==this.promptChar&&(r=3,this.SetFieldValue(o,r)))):(r=this.hideDay,r!=-1&&(r>c&&(r=c),this.hideDay=r)))),0},i.prototype.SpinMonth=function(t){var u,h,s,r,e,a,l,c,f,p;if(t==0)return 0;u=this.GetFieldByID(n.DateFieldID.ID_Month);if(u!=null&&u.GetStatus()!=n.FieldStatus.Full)return 0;h=1,s=12,r=u==null?this.hideMonth:this.GetFieldValue(u),this._validateMode!=n.ValidateDate.ValidateNone||u instanceof n.ValueEnumField||(h=0,s=99),r+=t,a=s-h+1,e=rs?Math.ceil((r-s)/a):0,r-=e*a,u==null?this.hideMonth=r:this.SetFieldValue(u,r);if(this._validateMode==n.ValidateDate.ValidateEx){var w=this.GetFieldByID(n.DateFieldID.ID_Era),b=this.GetFieldByID(n.DateFieldID.ID_EraYear),y=this.GetFieldByID(n.DateFieldID.ID_Year),o=-1;y!=null?o=y.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(y):-1:y==null&&w==null&&b==null?o=this.hideYear:(l=w==null?this.hideEra:this.GetFieldValue(w),c=b==null?this.hideEraYear:this.GetFieldValue(b),o=l==-1||c==-1?-1:n.DateTimeInfo.ConvertToGregorianYear(l,c,!0));var k=r,v=n.DateTimeInfo.DaysInMonth(o,k),i=-1;this.HasDayField()?(f=this.GetFieldByID(n.DateFieldID.ID_Day),f.GetStatus()==n.FieldStatus.Full?(i=this.GetFieldValue(f),i!=-1&&(i>v&&(i=v),this.SetFieldValue(f,i))):f.GetStatus()==n.FieldStatus.Part&&k==2&&(p=f.GetText(),p.CharAt(0)=="3"&&p.CharAt(1)==this.promptChar&&(i=3,this.SetFieldValue(f,i)))):(i=this.hideDay,i!=-1&&(i>v&&(i=v),this.hideDay=i))}return e!=0&&this.GetFieldByID(n.DateFieldID.ID_Year)==null&&this.GetFieldByID(n.DateFieldID.ID_EraYear)==null&&(e=0),e},i.prototype.SpinDay=function(t,i){var o,f,a,v,p,w,y,s,r,h;if(t==0)return 0;o=this.GetFieldByID(n.DateFieldID.ID_Day);if(o!=null&&o.GetStatus()!=n.FieldStatus.Full)return 0;f=o==null?this.hideDay:this.GetFieldValue(o),f+=t;var c=this.GetFieldByID(n.DateFieldID.ID_Year),u=c==null?this.hideYear:c.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(c):-1,l=this.GetFieldByID(n.DateFieldID.ID_Month),e=l==null?this.hideMonth:l.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(l):-1,b=29;this._validateMode==n.ValidateDate.ValidateEx&&e==2&&(u=-1,c!=null?u=c.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(c):-1:this.HasEraItem()?(a=this.GetFieldByID(n.DateFieldID.ID_Era),v=this.GetFieldByID(n.DateFieldID.ID_EraYear),p=a==null?this.hideEra:a.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(a):-1,w=v==null?this.hideEraYear:v.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(v):-1,y=n.DateTimeInfo.MakeDate(p,w,12,31),u=y!=-1?y.getFullYear():this.hideYear):u=this.hideYear,b=u==-1||n.DateTimeInfo.IsLeapYear(u)?29:28),s=1,r=31,this._validateMode==n.ValidateDate.ValidateNone?(s=0,r=99):this._validateMode==n.ValidateDate.ValidateEx&&(r=n.DateTimeInfo.DaysInMonth(u,e));if(fr)for(t=0;f>r;t++)e!=-1&&this._validateMode==n.ValidateDate.ValidateEx&&(h=e+t,l==null&&(h=e),r=n.DateTimeInfo.DaysInMonth(u,h)),f-=r-s+1;else t=0;return o==null?this.hideDay=f:(o.SetRange(s,r),this.SetFieldValue(o,f)),t!=0&&this.GetFieldByID(n.DateFieldID.ID_Month)==null&&(t=0),t},i.prototype.SpinHour=function(t){var r,c,o;if(t==0)return 0;r=this.GetFieldByID(n.DateFieldID.ID_Hour),r==null&&(r=this.GetFieldByID(n.DateFieldID.ID_ShortHour));if(r!=null&&r.GetStatus()!=n.FieldStatus.Full)return 0;var s=0,e=23,i,u,f=r!=null&&r.ID==n.DateFieldID.ID_ShortHour,h=this.GetFieldByID(n.DateFieldID.ID_AMPM);return i=r==null?this.hideHour:this.GetFieldValue(r),c=this.hideAMPM,h!=null&&(c=h.GetValue(),f=!0),this._validateMode==n.ValidateDate.ValidateNone?e=99:f&&(e=11,s=0,i%=12),i+=t,o=e-s+1,u=ie?Math.ceil((i-e)/o):0,i-=u*o,r!=null?(f?this._validateMode!=n.ValidateDate.ValidateNone&&(this._hour12Mode==n.Hour12Mode.Hour0As12?i==0&&(i=12):this._hour12Mode==n.Hour12Mode.Hour12As0&&i==12&&(i=0)):this._validateMode!=n.ValidateDate.ValidateNone&&(this._midnightAs24?i==0&&(i=24):i==24&&(i=0)),this.SetFieldValue(r,i)):this.hideHour=i,u!=0&&(this.IsjqTime&&(this.JQueryTimeReachToBound=u),f||this.GetFieldByID(n.DateFieldID.ID_Day)!=null?f&&this.GetFieldByID(n.DateFieldID.ID_AMPM)==null&&(u=0):u=0),u},i.prototype.SpinMinute=function(t){var r,o,f,i,u,e;if(t==0)return 0;return r=this.GetFieldByID(n.DateFieldID.ID_Minute),r!=null&&r.GetStatus()!=n.FieldStatus.Full?0:(o=0,f=59,i=r==null?this.hideMinute:this.GetFieldValue(r),this._validateMode==n.ValidateDate.ValidateNone&&(f=99),i+=t,e=f-o+1,u=if?Math.ceil((i-f)/e):0,i-=u*e,r==null?this.hideMinute=i:this.SetFieldValue(r,i),u!=0&&this.GetFieldByID(n.DateFieldID.ID_Hour)==null&&this.GetFieldByID(n.DateFieldID.ID_ShortHour)==null&&(u=0),u)},i.prototype.SpinSecond=function(t){var r,o,f,i,u,e;if(t==0)return 0;return r=this.GetFieldByID(n.DateFieldID.ID_Second),r!=null&&r.GetStatus()!=n.FieldStatus.Full?0:(o=0,f=59,i=r==null?this.hideSecond:this.GetFieldValue(r),this._validateMode==n.ValidateDate.ValidateNone&&(f=99),i+=t,e=f-o+1,u=if?Math.ceil((i-f)/e):0,i-=u*e,r==null?this.hideSecond=i:this.SetFieldValue(r,i),u!=0&&this.GetFieldByID(n.DateFieldID.ID_Minute)==null&&(u=0),u)},i.prototype.SpinAMPM=function(t){var u,o,f,i,e,r;if(t==0)return 0;return u=this.GetFieldByID(n.DateFieldID.ID_AMPM),u!=null&&u.GetStatus()!=n.FieldStatus.Full?0:(o=0,f=1,i=u==null?this.hideAMPM:this.GetFieldValue(u),i+=t,e=f-o+1,r=if?Math.ceil((i-f)/e):0,i-=r*e,u==null?this.hideAMPM=i:this.SetFieldValue(u,i),r!=0&&this.GetFieldByID(n.DateFieldID.ID_Day)==null&&(r=0),r)},i.prototype.HasHiddenField=function(){if(this.GetFieldByID(n.DateFieldID.ID_Year)==null)if(this.GetFieldByID(n.DateFieldID.ID_Era)==null||this.GetFieldByID(n.DateFieldID.ID_EraYear)==null)return!0;if(this.GetFieldByID(n.DateFieldID.ID_Month)==null)return!0;if(this.GetFieldByID(n.DateFieldID.ID_Day)==null)return!0;if(this.GetFieldByID(n.DateFieldID.ID_Hour)==null)if(this.GetFieldByID(n.DateFieldID.ID_ShortHour)==null||this.GetFieldByID(n.DateFieldID.ID_AMPM)==null)return!0;return this.GetFieldByID(n.DateFieldID.ID_Minute)==null?!0:this.GetFieldByID(n.DateFieldID.ID_Second)==null?!0:!1},i.prototype.OnFieldChanged=function(t){if(t==null||t instanceof n.PromptField)return;if(t.GetStatus()!=n.FieldStatus.Full)return;if(this._validateMode==n.ValidateDate.ValidateEx)switch(t.ID){case n.DateFieldID.ID_Year:this.AdjustOtherFieldForYear(t);break;case n.DateFieldID.ID_Era:this.AdjustOtherFieldForEra(t);break;case n.DateFieldID.ID_EraYear:this.AdjustOtherFieldForEraYear(t);break;case n.DateFieldID.ID_Month:this.AdjustOtherFieldForMonth(t);break;case n.DateFieldID.ID_Day:this.AdjustOtherFieldForDay(t);break;default:break}},i.prototype.AdjustOtherFieldForYear=function(t){var o,f,s,u,i,r,e;if(t.GetStatus()!=n.FieldStatus.Full)return;o=this.GetFieldValue(t);if(o==-1)return;f=-1,s=this.GetFieldByID(n.DateFieldID.ID_Month),f=s==null?this.hideMonth:this.GetFieldValue(s),u=n.DateTimeInfo.DaysInMonth(o,f),i=-1,this.HasDayField()?(r=this.GetFieldByID(n.DateFieldID.ID_Day),r.GetStatus()==n.FieldStatus.Full?(i=this.GetFieldValue(r),i!=-1&&(i>u&&(i=u),this.SetFieldValue(r,i))):r.GetStatus()==n.FieldStatus.Part&&f==2&&(e=r.GetText(),e.CharAt(0)=="3"&&e.CharAt(1)==this.promptChar&&(i=3,this.SetFieldValue(r,i)))):(i=this.hideDay,i!=-1&&(i>u&&(i=u),this.hideDay=i))},i.prototype.AdjustOtherFieldForEra=function(t){var l,o,h,s,a,v;if(t.GetStatus()!=n.FieldStatus.Full)return;l=this.GetFieldValue(t),h=this.GetFieldByID(n.DateFieldID.ID_EraYear);if(h==null)o=this.hideEraYear;else{if(h.GetStatus()!=n.FieldStatus.Full)return;o=this.GetFieldValue(h)}if(h!=null){var w=0,y=0,p=h.GetRange();w=p.min,y=p.max,(w!=1||y!=n.DateTimeInfo.EraYears[l])&&h.SetRange(1,n.DateTimeInfo.EraYears[l])}v=this.GetEraRange(l),s=v.startDate,a=v.endDate;var f=s,c=!1,e=this.GetFieldByID(n.DateFieldID.ID_Month),r=this.GetFieldByID(n.DateFieldID.ID_Day),i,u;o<1?(f=s,c=!0):o==1?(i=e==null?this.hideMonth:e.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(e):-1,i!=-1&&in.DateTimeInfo.EraYears[l]?(f=a,c=!0):o==n.DateTimeInfo.EraYears[l]&&(i=e==null?this.hideMonth:e.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(e):-1,i!=-1&&i>a.getMonth()+1?(f=a,c=!0):i!=-1&&i==a.getMonth()+1&&(u=r==null?this.hideDay:r.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(r):-1,u!=-1&&u>a.getDate()&&(f=a,c=!0)));if(c){o=f.getFullYear()-s.getFullYear()+1,h==null?this.hideEraYear=o:this.SetFieldValue(h,o),i=f.getMonth()+1,e==null?this.hideMonth=i:this.SetFieldValue(e,i),u=f.getDate(),r==null?this.hideDay=u:this.SetFieldValue(r,u);return}i=e==null?this.hideMonth:e.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(e):-1,u=r==null?this.hideDay:r.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(r):-1;if(i==-1||u==-1)return;f=n.DateTimeInfo.MakeDate(l,o,1,1),f!=-1&&!n.DateTimeInfo.IsLeapYear(f.getFullYear())&&i==2&&u>28&&(r==null?this.hideDay=28:this.SetFieldValue(r,28))},i.prototype.AdjustOtherFieldForEraYear=function(t){var l,h,a,o,s,v;if(t.GetStatus()!=n.FieldStatus.Full)return;l=this.GetFieldValue(t),a=this.GetFieldByID(n.DateFieldID.ID_Era);if(a==null)h=this.hideEra;else{if(a.GetStatus()!=n.FieldStatus.Full)return;h=this.GetFieldValue(a)}v=this.GetEraRange(h),o=v.startDate,s=v.endDate;var e=o,c=!1,f=this.GetFieldByID(n.DateFieldID.ID_Month),r=this.GetFieldByID(n.DateFieldID.ID_Day),i=-1,u;l==1?(i=f==null?this.hideMonth:f.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(f):-1,i!=-1&&is.getMonth()+1?(e=s,c=!0):i!=-1&&i==s.getMonth()+1&&(u=r==null?this.hideDay:r.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(r):-1,u!=-1&&u>s.getDate()&&(e=s,c=!0)));if(c){i=e.getMonth()+1,f==null?this.hideMonth=i:this.SetFieldValue(f,i),u=e.getDate(),r==null?this.hideDay=u:this.SetFieldValue(r,u);return}i=f==null?this.hideMonth:f.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(f):-1,u=r==null?this.hideDay:r.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(r):-1;if(i==-1||u==-1)return;e=n.DateTimeInfo.MakeDate(h,l,1,1),e!=-1&&!n.DateTimeInfo.IsLeapYear(e.Year)&&i==2&&u>28&&(r==null?this.hideDay=28:this.SetFieldValue(r,28))},i.prototype.AdjustOtherFieldForMonth=function(t){var h,c,i,s,v,y,r,u,a;if(t.GetStatus()!=n.FieldStatus.Full)return;h=this.GetFieldValue(t);if(h==-1)return;var o=this.GetFieldByID(n.DateFieldID.ID_Era),e=this.GetFieldByID(n.DateFieldID.ID_EraYear),l=this.GetFieldByID(n.DateFieldID.ID_Year),f=-1;l!=null?f=l.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(l):-1:l==null&&o==null&&e==null?f=this.hideYear:(r=o==null?this.hideEra:this.GetFieldValue(o),u=e==null?this.hideEraYear:this.GetFieldValue(e),f=r==-1||u==-1?-1:n.DateTimeInfo.ConvertToGregorianYear(r,u,!0)),c=n.DateTimeInfo.DaysInMonth(f,h),i=-1,this.HasDayField()?(s=this.GetFieldByID(n.DateFieldID.ID_Day),s.GetStatus()==n.FieldStatus.Full?(i=this.GetFieldValue(s),i!=-1&&(i>c&&(i=c),this.SetFieldValue(s,i))):s.GetStatus()==n.FieldStatus.Part&&h==2&&(v=s.GetText(),v.CharAt(0)=="3"&&v.CharAt(1)==this.promptChar&&(i=3,this.SetFieldValue(s,i)))):(i=this.hideDay,i!=-1&&(i>c&&(i=c),this.hideDay=i));if(f<=0||h<=0||i<=0)return;o!=null&&e!=null&&(y=new Date(f,h-1,i),a=n.DateTimeInfo.GetEraDate(y),r=a.era,u=a.eraYear,r!=-1&&u!=-1&&(o!=null&&this.GetFieldValue(o)!=r?this.SetFieldValue(o,r):this.hideEra=r,e!=null&&this.GetFieldValue(e)!=u?(e.SetRange(1,n.DateTimeInfo.EraYears[r]),this.SetFieldValue(e,u)):this.hideEraYear=u))},i.prototype.AdjustOtherFieldForDay=function(t){var a=this.GetFieldValue(t),o=this.GetFieldByID(n.DateFieldID.ID_Era),f=this.GetFieldByID(n.DateFieldID.ID_EraYear),c=this.GetFieldByID(n.DateFieldID.ID_Year),i=-1,u,r,e,h,s,l;o==null&&f==null&&c==null?i=this.hideYear:c!=null?i=c.GetStatus()==n.FieldStatus.Full?this.GetFieldValue(c):-1:(u=o==null?this.hideEra:this.GetFieldValue(o),r=f==null?this.hideEraYear:this.GetFieldValue(f),u==-1&&r==-1?i=-1:(e=n.DateTimeInfo.MakeDate(u,r+1,1,1),r==1&&e!=-1?i=e.getFullYear()-1:e!=-1&&(i=e.getFullYear()))),h=this.GetFieldByID(n.DateFieldID.ID_Month),s=-1,h==null?s=this.hideMonth:h.GetStatus()==n.FieldStatus.Full&&(s=this.GetFieldValue(h));if(i<=0||s<=0)return;(o!=null||f!=null)&&i!=-1&&(e=new Date(i,s-1,a),l=n.DateTimeInfo.GetEraDate(e),u=l.era,r=l.eraYear,u!=-1&&r!=-1&&(o!=null?this.SetFieldValue(o,u):this.hideEra=u,f!=null?(f.SetRange(1,n.DateTimeInfo.EraYears[u]),this.SetFieldValue(f,r)):this.hideEraYear=r))},i.prototype.GetFieldRangeByPos=function(n){var r=this.GetFieldIndexByPos(n),t=r.index,u=r.offset,i;return u==0&&t!=0&&t--,i=this.GetFieldRange(t)},i.prototype.MoveField=function(t,i){var e=this.GetFieldIndexByPos(t),r=e.index,o=e.offset,f,u;if(r==-1)return-1;if(i){if(r==this.fieldCount-1)return-1;r++;if(this.GetFieldByIndex(r)instanceof n.PromptField)if(r==this.fieldCount-1)return-1;else r++;for(f=0,u=0;uthis.MaxDate||ithis.MaxDate||uthis.MaxDate||tthis.MaxDate||tthis.MaxDate&&(this.Value=new Date(this.MaxDate.valueOf()),this.UpdateFormatRangeAndValue()),this._uIProcess.SetMaxDate(this.MaxDate),this.UpdateFormatField(),this.UpdateDisplayFormatField(),this.UpdateDisplayText(this.GetDisplayText2()))},e.prototype.GetMaxDate=function(){return this.MaxDate},e.prototype.SetMinDate=function(t){n.Utility.CheckDate(t,this.DefaultMinDate(),this.MaxDate),this.MinDate!==t&&(this.MinDate=new Date(t.valueOf()),this.Value1)throw"Invalid PromptChar.";this.PromptChar=t,this._uIProcess.SetPromptChar(this.PromptChar),this._format.Fields.SetPromptChar(this.PromptChar),this._displayFormat.Fields.SetPromptChar(this.PromptChar),this.UpdateDisplayText(this.GetDisplayText2())},e.prototype.GetPromptChar=function(){return this.PromptChar},e.prototype.SetShowLiterals=function(t){n.Utility.CheckString(t),this.ShowLiterals.toLowerCase()!==t.toLowerCase()&&(this.ShowLiterals=t.toLowerCase(),this._uIProcess.SetShowLiterals(this.ShowLiterals))},e.prototype.GetShowLiterals=function(){return this.ShowLiterals},e.prototype.SetTabAction=function(t){n.Utility.CheckString(t),this.TabAction.toLowerCase()!==t.toLowerCase()&&(this.TabAction=t.toLowerCase())},e.prototype.GetTabAction=function(){return this.TabAction},e.prototype._setSystemTwoDigitYearMax=function(t){n.Utility.CheckInt(t,199,9999),this.SystemTwoDigitYearMax!==t&&(this.SystemTwoDigitYearMax=t,this.UpdateFormatField(),this.UpdateDisplayFormatField(),this.UpdateDisplayText(this.GetDisplayText2()))},e.prototype.SetTwoDigitYearMax=function(t){n.Utility.CheckInt(t,199,9999),this.TwoDigitYearMax!==t&&(this.TwoDigitYearMax=t,this.UpdateFormatField(),this.UpdateDisplayFormatField(),this.UpdateDisplayText(this.GetDisplayText2()))},e.prototype.GetTwoDigitYearMax=function(){return this.TwoDigitYearMax},e.prototype.SetUseTwoDigitYearMax=function(t){t=n.Utility.CheckBool(t),this.UseTwoDigitYearMax=t,this.UpdateFormatField(),this.UpdateDisplayFormatField()},e.prototype.GetUseTwoDigitYearMax=function(){return this.UseTwoDigitYearMax},e.prototype.SetValidateMode=function(t){n.Utility.CheckString(t),this.ValidateMode.toLowerCase()!==t.toLowerCase()&&(this.ValidateMode=t.toLowerCase(),this.UpdateFormatField(),this.UpdateDisplayFormatField(),this.UpdateDisplayText(this.GetDisplayText2()))},e.prototype.GetValidateMode=function(){return this.ValidateMode},e.prototype.SetSelectedText=function(n){var u=Math.min(this.SelectionStart,this.SelectionEnd),r=Math.max(this.SelectionStart,this.SelectionEnd),i,t;if(this.IsNullFormat())return i=this.Text.Substring(0,u)+n+this.Text.Substring(r,this.Text.GetLength()),this.SetText(i),this;if(this.GetReadOnly())return this;t=this._uIProcess.Paste(this.SelectionStart,this.SelectionEnd,n,this.GetExitOnLastChar(),!0);if(t==null)return this;if(t.Text!=null)if(!this.UpdateText(t))return this;return t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd),this.UpdateDisplayText(this.GetDisplayText2()),t.EventInfo!=null&&this._uIProcess.FireEvent(this,t.EventInfo.Name,t.EventInfo.Args,t.EventInfo.Type),this},e.prototype.GetSelectedText=function(){var r="",t=Math.min(this.SelectionStart,this.SelectionEnd),f=Math.max(this.SelectionStart,this.SelectionEnd),u=f-t,i;if(u!=0){i=this._IsUseWatermarkText(!0);if(i.IsUseWatermarkText)r=i.WatermarkText;else return this.GetClipContent()==n.ClipContent.IncludeLiterals||this.IsNullFormat()?this.Text.Substring(t,f):this._format.Fields.GetNonLiteralsText(t,u)}return r},e.prototype.GetCurrentField=function(){return this._uIProcess.GetCurrentField(this.SelectionEnd)},e.prototype.Clear=function(){return this.SetValue(null,!1,!1),this},e.prototype._protectedGetRealDoSpinArgments=function(t,i){return typeof t=="string"&&(t=n.Utility.EnumParser(t,n.DateCursorPosition)),u.prototype._protectedGetRealDoSpinArgments.call(this,t,i)},e.prototype._GetSpinPosition=function(t){var i;return i=t==n.DateCursorPosition.Default?this.SelectionEnd:this._uIProcess.GetPosByCurrentField(t).SelectionStart,{Start:i,End:i}},e.prototype._protectedDoSpinFinished=function(){this._focused||(this.Value=this._uIProcess.GetValue().Value);var t=this._format.Fields.GetValue();n.DateFieldCollection._isNotInvalidDate(t)&&(this.DisplayText=this._uIProcess.GetDisplayFormatText(this._format.Fields.GetValue()),this.UpdateDisplayText(this.DisplayText))},e.prototype._protectedFireEventOnDoSpin=function(n,t){u.prototype._protectedFireEventOnDoSpin.call(this,n,t),t&&this._FireClientEvent("NumberChanged",null)},e.prototype.Drop=function(){return this.PerformDropDown(),this.SetFocus(),this},e.prototype._OnFocusInternal=function(){u.prototype._OnFocusInternal.call(this,{FocusType:this._focusType,Element:this._realInputElement,HighlightText:this.GetHighlightText(),CursorPosition:this.CursorPosition,Text:this._getTextInternal()}),this._oldValue=this.Value,this.BackupValue(!0)},e.prototype.UpdateFormatField=function(){var i=[],t;this._format.Pattern!==null&&(i=this.ParsePattern(this._format.Pattern,!0)),t=this.GetDataObject(),this._format.Fields=n.CreateDateFormatFieldCollection(i,t),this.UpdateFormatRangeAndValue(),this._format.Fields.SetHour12Mode(this.Hour12Mode),this._format.Fields.SetMidnightAs24(this.MidnightAs24),this._format.Fields.SetValidateMode(this.ValidateMode),this._format.Fields.SetPromptChar(this.PromptChar),this._format.Fields.UpdateAMPMField(this.InnerAMDesignator(),this.InnerPMDesignator()),this.UseTwoDigitYearMax?this._format.Fields.SetTwoDigitYearMax(this.TwoDigitYearMax):this._format.Fields.SetTwoDigitYearMax(this.SystemTwoDigitYearMax)},e.prototype.UpdateDisplayFormatField=function(){var i=[],t;this._displayFormat.Pattern!==null&&(i=this.ParsePattern(this._displayFormat.Pattern)),t=this.GetDataObject(),this._displayFormat.Fields=n.CreateDateDisplayFormatFieldCollection(i,t),this._displayFormat.Fields.SetHour12Mode(this.Hour12Mode),this._displayFormat.Fields.SetMidnightAs24(this.MidnightAs24),this._displayFormat.Fields.SetValidateMode(this.ValidateMode),this._displayFormat.Fields.SetPromptChar(this.PromptChar),this._displayFormat.Fields.UpdateAMPMField(this.InnerAMDesignator(),this.InnerPMDesignator()),this.UseTwoDigitYearMax?this._displayFormat.Fields.SetTwoDigitYearMax(this.TwoDigitYearMax):this._displayFormat.Fields.SetTwoDigitYearMax(this.SystemTwoDigitYearMax)},e.prototype.UpdateSettingToUIProcess=function(){this._uIProcess.SetMinDate(new Date(this.MinDate.valueOf())),this._uIProcess.SetMaxDate(new Date(this.MaxDate.valueOf())),this._uIProcess.SetPromptChar(this.PromptChar),this._uIProcess.SetShowLiterals(this.ShowLiterals),this._uIProcess.SetMaxMinBehavior(this.MaxMinBehavior),this._uIProcess.SetAdjustValueOnFocus(this.AdjustValueOnFocus)},e.prototype.UpdateFormatRangeAndValue=function(){this._format.Fields.SetValue(this.Value),this._format.Fields.BeginTransaction(),this._format.Fields.UpdateUndoText(),this._format.Fields.HasEraItem()?this._format.Fields.SetJapanEraAndEraYearRangeAndValue():this._format.Fields.HasYearField()&&this._format.Fields.SetYearRangeAndValue(),this._format.Fields.HasMonthField()&&this._format.Fields.SetMonthRangeAndValue(),this._format.Fields.HasDayField()&&this._format.Fields.SetDayRangeAndValue()},e.prototype.GetDataObject=function(){var n={};return n.Designators=[],n.Designators[0]=this.InnerAMDesignator(),n.Designators[1]=this.InnerPMDesignator(),n.AMDesignator=this.InnerAMDesignator(),n.PMDesignator=this.InnerPMDesignator(),n.AdjustValueOnFocus=this.AdjustValueOnFocus,n.CursorPosition=this.CursorPosition,n.ExitOnLastChar=this.ExitOnLastChar,n.Hour12Mode=this.Hour12Mode,n.MidnightAs24=this.MidnightAs24,n.ImeMode=this._imeMode,n.MinDate=this.MinDate,n.MaxDate=this.MaxDate,n.MaxMinBehavior=this.MaxMinBehavior,n.PromptChar=this.PromptChar,n.ShowLiterals=this.ShowLiterals,n.TabAction=this.TabAction,n.TouchDropDownScale=this._getInnerTouchDropDownScale(),n.ValidateMode=this.ValidateMode,n.TwoDigitYearMax=this.TwoDigitYearMax,n.IsjqDate=this.IsjqDate,n.IsjqTime=this.IsjqTime,n},e.prototype.RemoveEscapeChar=function(n){var u=n,i,r,t;if(n.IndexOf("\\")!=-1){for(i="",r=n.length,t=0;t0&&n.substring(t-1,t)=="\\")t=n.IndexOf("{",t+1);while(r>0&&n.substring(r-1,r)=="\\")r=n.IndexOf("}",r+1);if(t0&&(r={},r.isPrompt=!0,r.strResult=f,e.push(r),f=""),l=1;while(i+10&&(r={},r.isPrompt=!0,r.strResult=f,e.push(r));if(t===!0)if(e.length==1&&e[0].isPrompt)throw"Invalid Format Patten";if(o)throw"Invalid Format Patten";return e},e.prototype.ValueToString=function(){return this.Value!=null?n.DateTimeInfo.Date2String(this.Value,!1,this.IsjqDate,this.IsjqTime):""},e.prototype.GetDisplayText=function(){return this._uIProcess.GetDisplayFormatText2(this.GetValue())},e.prototype.GetDisplayText2=function(n){return n?this.GetDisplayText():this._uIProcess.GetDisplayFormatText(this.GetValue())},e.prototype.GetDateByTimeSpan=function(n){for(var t="hour",e="",f="",u="",s=n.IndexOf(".")+1,i="",o,r=s;r57)&&(i<96||i>105)?i==n.Key.Space?this._imeSelect==!1&&(this.ImeSelectTimes==1?this._imeSelect=!0:this.ImeSelectTimes++):i<65||i>90?(i==n.Key.Down||i==n.Key.Up)&&this._imeSelect==!1&&this.ImeSelectTimes==1&&(this._imeSelect=!0):(this.ImeSelectTimes<1||(u=this._getImeInputText("ReInput"),o=!0),this.ImeSelectTimes=0):(i<96||(i=i-48),e=this.GetTextboxValue(),u=e,this.SelectionEndthis.MaxDate||ithis.MaxDate||tthis.MaxDate?this.MaxDate:this.MinDate;break;case n.MaxMinBehavior.CancelInput:r=i?this.GetValue():t;break;case n.MaxMinBehavior.Clear:r=null;break;case n.MaxMinBehavior.Keep:r=t;break;case n.MaxMinBehavior.Restore:r=i?this.GetValue():this.CacheValue;break}}return r},e.prototype.ProcessMaxMinBehavior=function(t,i,r){var f=!1,u;if(i||this.ValidateMode==n.ValidateDate.ValidateEx&&this.AdjustValueOnFocus){r==undefined&&(r=this._format.Fields.GetValue(!1));if(r&&n.DateFieldCollection._isNotInvalidDate(r)&&r!=null)if(r>this.MaxDate||rthis.MaxDate?this._format.Fields.SetValue(this.MaxDate):this._format.Fields.SetValue(this.MinDate),u=this._getTextInternal(),this.UpdateDisplayText(u),this.Text=u,this.SelectionStart=this.SelectionEnd=this._format.Fields.GetEditableFieldIndex(),i||this.SetSelection(this.SelectionStart,this.SelectionEnd),f=!0;break;case n.MaxMinBehavior.CancelInput:i?(this._format.Fields.SetValue(this.Value),this.UpdateDisplayText(this._getTextInternal()),this.SelectionStart=this.SelectionEnd=this._format.Fields.GetEditableFieldIndex(),i||this.SetSelection(this.SelectionStart,this.SelectionEnd)):t!=null&&(this.Revert(t),this.SetSelection(this.SelectionStart,this.SelectionEnd)),f=!0;break;case n.MaxMinBehavior.Clear:this._format.Fields.SetValue(null),u=this._getTextInternal(),this.UpdateDisplayText(u),this.Text=u,this.SelectionStart=this.SelectionEnd=this._format.Fields.GetEditableFieldIndex(),i||this.SetSelection(this.SelectionStart,this.SelectionEnd),f=!0;break;case n.MaxMinBehavior.Keep:break;case n.MaxMinBehavior.Restore:i?this._format.Fields.SetValue(this.Value):this._format.Fields.SetValue(this.CacheValue),u=this._getTextInternal(),this.UpdateDisplayText(u),this.Text=u,this.SelectionStart=this.SelectionEnd=this._format.Fields.GetEditableFieldIndex(),i||this.SetSelection(this.SelectionStart,this.SelectionEnd),f=!0;break}i||(this.PreviousText=this.__paintingText!=undefined?this.__paintingText:this.GetTextboxValue())}}return f},e.prototype.FireInvalidRangeEventForMaxMin=function(){this._uIProcess.FireEvent(this,this._specialClientEvents.InvalidRange,null,"InvalidRange")},e.prototype.Snap=function(){var n={};return n.UIProcessSnapResult=this._uIProcess.Snap(),n.BaseInputControlSnapResult=u.prototype.Snap.call(this),n.RealTimeText=this.GetTextboxValue(),n},e.prototype.Revert=function(n){this._uIProcess.Revert(n.UIProcessSnapResult),u.prototype.Revert.call(this,n.BaseInputControlSnapResult),this.UpdateDisplayText(n.RealTimeText)},e.prototype.BackupValue=function(t){var i=this._format.Fields.GetValue(!1);n.DateFieldCollection._isInvalidDate(i)||i==null?t&&(this.CacheValue=null):ithis.MaxDate||(this.CacheValue=i)},e.prototype.CompositionEnd=function(t){if(!(n.Utility.IsIE||n.Utility.chrome&&n.Utility.ChromeVersion>=53))return;this.ImeInput()},e.prototype.ImeInput=function(){var n,t;try{n={},n.keyCode=13,this._imeMode=!0,this.KeyUp(n)}finally{t=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(t),this._imeMode=!1}},e.prototype.Input=function(){this.ImeInput()},e.prototype.MouseDown=function(t){if(n.Utility.IsTouchMouseDown==!0&&this._focused)if((this._getInnerShowTouchToolBarValue()&n.TouchToolBarDisplayOptions.TapSelection)!=0&&this._touchToolBar!=null)if(n.Utility.IsClickInSelection(t)){n.Utility.PreventDefault(t);return}if(n.Utility.GetMouseButton(t)!=n.MouseButton.Left){this._droppedDown&&this.CloseDropDown();return}u.prototype.MouseDown.call(this,t),this.FocusedWhenMouseDown=document.activeElement==window.event.srcElement,this.MouseDownOnClearButton=n.Utility.IsMouseDownOnClearButton(t)},e.prototype.MSPointerUp=function(n){n!=null&&(this._mouseUpPointerType=n.pointerType,this.MouseUpHasValue=n.srcElement.value.length>0)},e.prototype.MouseUp=function(t){var i=this,f,e,r;u.prototype.MouseUp.call(this,t),n.Utility.IsIE10OrLater&&this.FocusedWhenMouseDown&&this.MouseDownOnClearButton&&(this._mouseUpPointerType==undefined&&(this.MouseUpHasValue=t.srcElement.value.length>0),t.srcElement==this._realInputElement&&(f=document.activeElement==t.srcElement,e=n.Utility.IsMouseDownOnClearButton(t),this.MouseUpHasValue&&f&&e&&(this._format.Fields.SetValue(null),r=this._getTextInternal(),setTimeout(function(){i.UpdateDisplayText(r);var n=i._GetRealForeColor(!0,!0);i._uIUpdate.SetForeColor(n),i.Text=r,i.SelectionStart=i.SelectionEnd=i._format.Fields.GetEditableFieldIndex(),i.SetSelection(i.SelectionStart,i.SelectionEnd)},0))))},e.prototype.OnDropDownClose=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.DropDownClose=t},e.prototype.OnDropDownOpen=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.DropDownOpen=t},e.prototype.OnEditStatusChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.EditStatusChanged=t},e.prototype.OnInvalidInput=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidInput=t},e.prototype.OnInvalidRange=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidRange=t},e.prototype.OnInvalidValue=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidValue=t},e.prototype.OnKeyExit=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyExit=t},e.prototype.OnNumberChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.NumberChanged=t},e.prototype.OnSpinDown=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.SpinDown=t},e.prototype.OnSpinUp=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.SpinUp=t},e.prototype.OnTextChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.TextChanged=t},e.prototype.OnValueChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.ValueChanged=t},e.prototype.DefaultAMDesignator=function(){return n.Utility.IsJapan()?"\u5348\u524d":n.Utility.IsChina()?"\u4e0a\u5348":"AM"},e.prototype.DefaultPMDesignator=function(){return n.Utility.IsJapan()?"\u5348\u5f8c":n.Utility.IsChina()?"\u4e0b\u5348":"PM"},e.prototype.InnerAMDesignator=function(){return this.AMDesignator==""?this.DefaultAMDesignator():this.AMDesignator},e.prototype.InnerPMDesignator=function(){return this.PMDesignator==""?this.DefaultPMDesignator():this.PMDesignator},e.prototype._resoreToInitialValueOnFormReset=function(){try{var t=this._initializedFormData==null?null:new Date(this._initializedFormData.valueOf());this.GetValue()!=t&&n.DateTimeInfo.Equal(this.Value,t,!0)&&(this.Value=null),this.SetValue(t,!0,!1)}catch(i){this.SetValue(null)}},e.prototype._backupInitialFormValue=function(){var n=this.GetValue();this._initializedFormData=n==null?null:new Date(n.valueOf())},e.prototype._getDisplayedText=function(){return this._focused?u.prototype._getDisplayedText.call(this):this.GetDisplayText2()},e.prototype._getDropPos=function(){return this.GetFormatPattern()!==this.GetDisplayFormatPattern()?0:u.prototype._getDropPos.call(this)},e.prototype._CreateWatermark=function(){return new r},e.prototype._CreateDisplayWatermark=function(){return new r},e.prototype._GetWatermark=function(){return u.prototype._GetWatermark.call(this)},e.prototype._GetDisplayWatermark=function(){return u.prototype._GetDisplayWatermark.call(this)},e.prototype._OnWatermarkNullTextChanged=function(n,t){this._format.Null=t,this._format.NullExpressionString="",this._format.NullExpressionFillChar="";if(t!==""){var i=this.ParseFillingString(t);this._format.NullExpressionString=i.fillChar==""?i.format:"",this._format.NullExpressionFillChar=i.fillChar}this._GetWatermark().NullTextReal=this._generatetWatermarkRealText(!0,t,this._format.NullExpressionString,this._format.NullExpressionFillChar),this._IsValueNull()&&this._focused&&this._updateUIForeColor2(this._focused,!1)},e.prototype._OnWatermarkDisplayNullTextChanged=function(n,t){this._displayFormat.Null=t,this._displayFormat.NullExpressionString="",this._displayFormat.NullExpressionFillChar="";if(t!==""){var i=this.ParseFillingString(t);this._displayFormat.NullExpressionString=i.fillChar==""?i.format:"",this._displayFormat.NullExpressionFillChar=i.fillChar}this._GetDisplayWatermark().NullTextReal=this._generatetWatermarkRealText(!1,t,this._displayFormat.NullExpressionString,this._displayFormat.NullExpressionFillChar),this._IsValueNull()&&!this._focused&&(this.UpdateDisplayText(this.GetDisplayText2()),this._updateUIForeColor2(this._focused,!1))},e.prototype.GetWatermarkEmptyEraText=function(){return this._GetWatermark().EmptyEraText},e.prototype.SetWatermarkEmptyEraText=function(t){t=n.Utility.CheckString(t);if(t===this.GetWatermarkEmptyEraText())return;var i=this._GetWatermark().EmptyEraText;this._GetWatermark().EmptyEraText=t,this._OnWatermarkEmptyEraTextChanged(i,t)},e.prototype._OnWatermarkEmptyEraTextChanged=function(n,t){this._format.EmptyEras=t,this._format.EmptyErasString="",this._format.EmptyErasFillChar="";if(t!==""){var i=this.ParseFillingString(t);this._format.EmptyErasString=i.fillChar==""?i.format:"",this._format.EmptyErasFillChar=i.fillChar}this._GetWatermark().EmptyEraTextReal=this._generatetWatermarkRealText(!0,t,this._format.EmptyErasString,this._format.EmptyErasFillChar),this._focused&&this._isInvalidEraDate(this.GetValue(),this._focused)&&this._updateUIForeColor2(this._focused,!1)},e.prototype.GetWatermarkEmptyEraForeColor=function(){return this._GetWatermark().EmptyEraTextForeColor},e.prototype.SetWatermarkEmptyEraForeColor=function(t){t=n.Utility.CheckColor(t);if(t===this.GetWatermarkEmptyEraForeColor())return;var i=this._GetWatermark().EmptyEraTextForeColor;this._GetWatermark().EmptyEraTextForeColor=t,this._OnWatermarkEmptyEraForeColorChanged(i,t)},e.prototype._OnWatermarkEmptyEraForeColorChanged=function(n,t){this._focused&&this._isInvalidEraDate(this.GetValue(),this._focused)&&this._updateUIForeColor2(this._focused,!1)},e.prototype.GetWatermarkDisplayEmptyEraText=function(){return this._GetDisplayWatermark().EmptyEraText},e.prototype.SetWatermarkDisplayEmptyEraText=function(t){t=n.Utility.CheckString(t);if(t===this.GetWatermarkDisplayEmptyEraText())return;var i=this._GetDisplayWatermark().EmptyEraText;this._GetDisplayWatermark().EmptyEraText=t,this._OnWatermarkDisplayEmptyEraTextChanged(i,t)},e.prototype._OnWatermarkDisplayEmptyEraTextChanged=function(n,t){this._displayFormat.EmptyEras=t,this._displayFormat.EmptyErasString="",this._displayFormat.EmptyErasFillChar="";if(t!==""){var i=this.ParseFillingString(t);this._displayFormat.EmptyErasString=i.fillChar==""?i.format:"",this._displayFormat.EmptyErasFillChar=i.fillChar}this._GetDisplayWatermark().EmptyEraTextReal=this._generatetWatermarkRealText(!1,t,this._displayFormat.EmptyErasString,this._displayFormat.EmptyErasFillChar),!this._focused&&this._isInvalidEraDate(this.GetValue(),this._focused)&&(this.UpdateDisplayText(this.GetDisplayText2()),this._updateUIForeColor2(this._focused,!1))},e.prototype.GetWatermarkDisplayEmptyEraForeColor=function(){return this._GetDisplayWatermark().EmptyEraTextForeColor},e.prototype.SetWatermarkDisplayEmptyEraForeColor=function(t){t=n.Utility.CheckColor(t);if(t===this.GetWatermarkDisplayEmptyEraForeColor())return;var i=this._GetDisplayWatermark().EmptyEraTextForeColor;this._GetDisplayWatermark().EmptyEraTextForeColor=t,this._OnWatermarkDisplayEmptyEraForeColorChanged(i,t)},e.prototype._OnWatermarkDisplayEmptyEraForeColorChanged=function(n,t){!this._focused&&this._isInvalidEraDate(this.GetValue(),this._focused)&&this._updateUIForeColor2(this._focused,!1)},e.prototype._getShownWatermarkText=function(t){var r=this.GetValue(),f,i;if(r!=null){i=!1,t?(f=this._GetWatermark(),i=!n.DateTimeInfo.IsValidEraDate(r)&&this._format.Fields.HasJapanEraField()):(f=this._GetDisplayWatermark(),i=!n.DateTimeInfo.IsValidEraDate(r)&&this._displayFormat.Fields.HasJapanEraField());if(i)return f.EmptyEraTextReal}return u.prototype._getShownWatermarkText.call(this,t)},e.prototype._getShownWatermarkTextForeColor=function(t){var f=this.GetValue(),i,r;if(f!=null){r=!1,t?(i=this._GetWatermark(),r=!n.DateTimeInfo.IsValidEraDate(f)&&this._format.Fields.HasJapanEraField()):(i=this._GetDisplayWatermark(),r=!n.DateTimeInfo.IsValidEraDate(f)&&this._displayFormat.Fields.HasJapanEraField());if(r)if(i.EmptyEraTextReal!=null&&i.EmptyEraTextReal!=="")return i.EmptyEraTextForeColor}return u.prototype._getShownWatermarkTextForeColor.call(this,t)},e.prototype._generatetWatermarkRealText=function(n,t,i,r){return i!=null&&i!=""?t=i:r!=null&&r!=""&&(t=n?this._format.Fields.GetFillingString(r):this._displayFormat.Fields.GetFillingString(r)),t},e.prototype.UpdateWatermarkRealText=function(n){n?(this._updateWatermarkNullTextReal(),this._updateWatermarkEmptyEraTextReal()):(this._updateWatermarkDisplayNullTextReal(),this._updateWatermarkDisplayEmptyEraTextReal())},e.prototype._updateWatermarkNullTextReal=function(){this._GetWatermark().NullTextReal=this._generatetWatermarkRealText(!0,this._GetWatermark().NullText,this._format.NullExpressionString,this._format.NullExpressionFillChar)},e.prototype._updateWatermarkEmptyEraTextReal=function(){this._GetWatermark().EmptyEraTextReal=this._generatetWatermarkRealText(!0,this._GetWatermark().EmptyEraText,this._format.EmptyErasString,this._format.EmptyErasFillChar)},e.prototype._updateWatermarkDisplayNullTextReal=function(){this._GetDisplayWatermark().NullTextReal=this._generatetWatermarkRealText(!1,this._GetDisplayWatermark().NullText,this._displayFormat.NullExpressionString,this._displayFormat.NullExpressionFillChar)},e.prototype._updateWatermarkDisplayEmptyEraTextReal=function(){this._GetDisplayWatermark().EmptyEraTextReal=this._generatetWatermarkRealText(!1,this._GetDisplayWatermark().EmptyEraText,this._displayFormat.EmptyErasString,this._displayFormat.EmptyErasFillChar)},e.prototype._isInvalidEraDate=function(t,i){return i?!n.DateTimeInfo.IsValidEraDate(t)&&this._format.Fields.HasJapanEraField():!n.DateTimeInfo.IsValidEraDate(t)&&this._displayFormat.Fields.HasJapanEraField()},e}(n.BaseInputControl),n.GcDateTime=u,f=function(n){function t(t,i){this._dataFromServer=arguments[2],n.call(this,t,i,this._dataFromServer)}return __extends(t,n),t.prototype._GetFormatPatternKeyList=function(){return["e","g","y","M","d"]},t}(u),n.GcDate=f,t=function(n){function t(t,r){this._dataFromServer=arguments[2],n.call(this,t,r,this._dataFromServer),this.SetDropDownType(i.Picker)}return __extends(t,n),t.prototype._GetFormatPatternKeyList=function(){return["h","H","m","s","t"]},t}(u),n.GcTime=t,r=function(n){function t(){n.apply(this,arguments),this.EmptyEraText="",this.EmptyEraTextReal="",this.EmptyEraTextForeColor=""}return __extends(t,n),t}(n.Watermark),n.DateTimeWatermark=r})(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(i){t.call(this,i),this.isDeleteInNullOrEmptyEra=!1,this.isSelectionDeterminedByHighlightText=!1,this.NeedRefBaseValue=!1,this.Index=0,this.PromptChar=i.PromptChar!=null?i.PromptChar:"_",this.ShowLiterals=i.ShowLiterals!=null?i.ShowLiterals:n.ShowLiterals.Always,this.oldDate=i.Value,this.maxDate=i.MaxDate,this.minDate=i.MinDate,this.MaxMinBehavior=i.MaxMinBehavior,this.AdjustValueOnFocus=i.AdjustValueOnFocus,this._owner=i.Owner}return __extends(i,t),i.prototype.SetFormat=function(n){this._format=n},i.prototype.SetDisplayFormat=function(n){this._displayFormat=n},i.prototype.SetPromptChar=function(n){this.PromptChar=n},i.prototype.SetMaxDate=function(n){this.maxDate=n},i.prototype.SetMinDate=function(n){this.minDate=n},i.prototype.SetShowLiterals=function(n){this.ShowLiterals=n},i.prototype.SetMaxMinBehavior=function(n){this.MaxMinBehavior=n},i.prototype.SetAdjustValueOnFocus=function(n){this.AdjustValueOnFocus=n},i.prototype.Snap=function(){var n={};return n.isDeleteInNullOrEmptyEra=this.isDeleteInNullOrEmptyEra,n.isSelectionDeterminedByHighlightText=this.isSelectionDeterminedByHighlightText,n.NeedRefBaseValue=this.NeedRefBaseValue,n.Index=this.Index,n.oldDate=this.oldDate,n.FiledCollection=this._format.Fields.Snap(),n},i.prototype.Revert=function(n){this.isDeleteInNullOrEmptyEra=n.isDeleteInNullOrEmptyEra,this.isSelectionDeterminedByHighlightText=n.isSelectionDeterminedByHighlightText,this.NeedRefBaseValue=n.NeedRefBaseValue,this.Index=n.Index,this.oldDate=n.oldDate,this._format.Fields.Revert(n.FiledCollection)},i.prototype.Clear=function(){var t={};return t.SelectionStart=this._format.Fields.GetEditableFieldIndex(),t.SelectionEnd=t.SelectionStart,this.SetValue(null)==!0?(t.Text=this.GetShowText(n.FieldStatus.Null,!0),(this._format.NullExpressionString!=""||this._format.NullExpressionFillChar!="")&&(this.isDeleteInNullOrEmptyEra=!0)):t.Text=this._format.NullExpressionString,t},i.prototype.GetValue=function(t){var i=this._format.Fields.GetValue(this.NeedRefBaseValue),r={};return r.CurrentValue=i,n.DateFieldCollection._isInvalidDate(i)?(t||(this._format.Fields.RollBack(),i=this._format.Fields.GetValue()),r.InvalidValue=!0):(i>this.maxDate||ithis.maxDate||ithis.maxDate||rthis.maxDate||rt.Owner.MaxDate||i65600&&t<65627&&(t-=65536),47=65&&t<=90||o!=null?(l=String.fromCharCode(t),o!=null&&(l=o),this.isDeleteInNullOrEmptyEra&&(this._format.NullExpressionString!=""||this._format.EmptyErasString!="")&&(i=0,r=0),h=this.ProcessCharKey(i,r,l,u),h.success?(s.SelectionStart=h.start,s.SelectionEnd=s.SelectionStart,s.Text=this.GetShowText(n.FieldStatus.Full,!0),this.isMulSelected=!1,this.isDeleteInNullOrEmptyEra=!1,this.NeedRefBaseValue=!1,this.moveFocusExitOnLastChar&&(c=this.MoveControl(this._owner.GetInputElement().id,!0,!1,"CharInput"),c!=null&&(s.SelectionStart=null,s.SelectionEnd=null,s.EventInfo=c.EventInfo,s.FocusType=c.FocusType,s.FocusExit=!0),this.moveFocusExitOnLastChar=!1)):h.EventInfo!=null&&(s.EventInfo=h.EventInfo),s):null},i.prototype.KeyDown=function(n){var i=t.prototype.KeyDown.call(this,n);return(n.KeyCode==65581||n.KeyCode==131158)&&(this.isDeleteInNullOrEmptyEra=!1),i},i.prototype.KeyUp=function(n,t,i,r,u){return this.ProcessCharKeyInput(n,t,i,r,null,null,u)},i.prototype.Undo=function(){var i={},t;return this._format.Fields.CanUndo()&&(this._format.Fields.RollBack(!0),t=this._format.Fields.GetValue(this.NeedRefBaseValue),this.NeedRefBaseValue=!1,i.Text=t==null||this._format.Fields.HasEraItem()&&!n.DateTimeInfo.IsValidEraDate(t)?this.GetShowText(n.FieldStatus.Null,!0):this.GetShowText(n.FieldStatus.Full,!0)),i},i.prototype.Paste=function(t,i,r,u,f){var y,s,o,p,h;u==null&&(u=this._owner.GetExitOnLastChar());var e={},l=Math.min(t,i),c=Math.abs(i-t);this.isDeleteInNullOrEmptyEra&&(l=this._format.Fields.GetEditableFieldIndex(),c=0),!f&&this._owner&&(r=n.BaseUIProcess.UpdateCrLfString(r,this._owner.GetAcceptsCrlf()));if(r==null||r=="")return e;y=this._owner.Snap(),this.FireClientEvent("OnBeforePaste");try{s=c>0?this._format.Fields.Replace(l,c,r,!1):this._format.Fields.Insert(l,r,!1),e.SelectionStart=s.cursorPos,s.OperationResult=="HasInvalid"&&this._owner._specialClientEvents.InvalidInput&&(o={},o.Name=this._owner._specialClientEvents.InvalidInput,o.Args=null,o.Type="InvalidInput",e.EventInfo=o)}catch(b){this._owner._specialClientEvents.InvalidInput&&(o={},o.Name=this._owner._specialClientEvents.InvalidInput,o.Args=null,o.Type="InvalidInput",e.EventInfo=o)}p=this._owner.ProcessMaxMinBehavior(y,document.activeElement!=this._owner._realInputElement),this.NeedRefBaseValue=!1,e.Text=this.GetShowText(n.FieldStatus.Full,!0),p?(e.SelectionStart=this._owner.SelectionStart,e.SelectionEnd=this._owner.SelectionEnd):s.text&&s.OperationResult=="HasInvalid"?(e.SelectionStart=this._owner.SelectionStart,e.SelectionEnd=this._owner.SelectionEnd):e.SelectionEnd=e.SelectionStart;if(u)if(e.SelectionStart==this._format.Fields.GetLength())this.moveFocusExitOnLastChar=!0;else{var v=this._format.Fields.GetFieldIndexByPos(e.SelectionStart),a=v.index,w=v.offset;a==this._format.Fields.fieldCount-1&&w==0&&this._format.Fields.GetFieldByIndex(a)instanceof n.PromptField&&(this.moveFocusExitOnLastChar=!0)}return this.moveFocusExitOnLastChar&&(h=this.MoveControl(this._owner.GetInputElement().id,!0,!1,"CharInput"),h!=null&&(e.EventInfo=h.EventInfo,e.FocusType=h.FocusType,e.FocusExit=!0),this.moveFocusExitOnLastChar=!1),t!=e.SelectionStart&&this.FireClientEvent("OnPaste"),e},i.prototype.SetCursorPositionAndSelection=function(t,i,r,u){var f={};if(t===n.HighlightText.All)f.SelectionStart=0,f.SelectionEnd=i.GetLength(),this.isMulSelected=!0;else if(t===n.HighlightText.Field){this.isMulSelected=!0;if(this._format.Fields.fieldCount==0)return f.SelectionStart=0,f.SelectionEnd=i.GetLength(),f;f=this.GetPosByCurrentField(r,u)}else f=this.GetPosByCurrentField(r),f!=null&&(f.SelectionStart=f.SelectionStart,f.SelectionEnd=f.SelectionStart);return f},i.prototype.SetValue=function(n){return this._format.Fields.fieldCount!=0?(this.NeedRefBaseValue=this._format.Fields.SetValue(n),!0):!1},i.prototype.GetFormatText=function(t){var i="";return i=this._format.Fields.fieldCount==0?t==null?this._format.NullExpressionString:n.DateTimeInfo.Date2String(t,!0,this._owner.IsjqDate,this._owner.IsjqTime):t==null?this._format.NullExpressionString!=null&&this._format.NullExpressionString!=""?this._format.NullExpressionString:this._format.NullExpressionFillChar!=null&&this._format.NullExpressionFillChar!=""?this._format.Fields.GetFillingString(this._format.NullExpressionFillChar):this.ShowLiterals===n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":(this._format.Fields.HasJapanEraField()||this._format.Fields.HasEraYearField())&&!n.DateTimeInfo.IsValidEraDate(t)?this._format.EmptyErasString!=null&&this._format.EmptyErasString!=""?this._format.EmptyErasString:this._format.EmptyErasFillChar!=null&&this._format.EmptyErasFillChar!=""?this._format.Fields.GetFillingString(this._format.EmptyErasFillChar):this.ShowLiterals==n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":this._format.Fields.GetFormatText(t)},i.prototype.GetFormatText2=function(t){var i="";return i=this._format.Fields.fieldCount==0?t==null?"":n.DateTimeInfo.Date2String(t,!0,this._owner.IsjqDate,this._owner.IsjqTime):t==null?this.ShowLiterals===n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":(this._format.Fields.HasJapanEraField()||this._format.Fields.HasEraYearField())&&!n.DateTimeInfo.IsValidEraDate(t)?this.ShowLiterals==n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":this._format.Fields.GetFormatText(t)},i.prototype.GetDisplayFormatText=function(t){return this._displayFormat.Fields.fieldCount==0?t==null?this._displayFormat.NullExpressionString!=null&&this._displayFormat.NullExpressionString!=""?this._displayFormat.NullExpressionString:this.GetFormatText(t):this._displayFormat.EmptyErasString!=null&&this._displayFormat.EmptyErasString!=""&&(this._format.Fields.HasJapanEraField()||this._format.Fields.HasEraYearField())&&n.DateTimeInfo.IsValidEraDate(t)?this._displayFormat.EmptyErasString:this.GetFormatText(t):t==null?this._displayFormat.NullExpressionString!=null&&this._displayFormat.NullExpressionString!=""?this._displayFormat.NullExpressionString:this._displayFormat.NullExpressionFillChar!=null&&this._displayFormat.NullExpressionFillChar!=""?this._displayFormat.Fields.GetFillingString(this._displayFormat.NullExpressionFillChar):this._displayFormat.Null!=null&&this._displayFormat.Null!=""?"":this._displayFormat.Fields.GetFillingString(this.PromptChar):!n.DateTimeInfo.IsValidEraDate(t)&&this._displayFormat.Fields.HasJapanEraField()?this._displayFormat.EmptyErasString!=null&&this._displayFormat.EmptyErasString!=""?this._displayFormat.EmptyErasString:this._displayFormat.EmptyErasFillChar!=null&&this._displayFormat.EmptyErasFillChar!=""?this._displayFormat.Fields.GetFillingString(this._displayFormat.EmptyErasFillChar):this._displayFormat.EmptyEras!=null&&this._displayFormat.EmptyEras!=""?"":this._displayFormat.Fields.GetFillingString(this.PromptChar):this._displayFormat.Fields.GetDisplayFormatText(t)},i.prototype.GetDisplayFormatText2=function(t){return this._displayFormat.Fields.fieldCount==0?this.GetFormatText2(t):t==null?this._displayFormat.Fields.GetFillingString(this.PromptChar):!n.DateTimeInfo.IsValidEraDate(t)&&this._displayFormat.Fields.HasJapanEraField()?this._displayFormat.Fields.GetFillingString(this.PromptChar):this._displayFormat.Fields.GetDisplayFormatText(t)},i.prototype.GetShowText=function(t,i){var e="",r=0,f=0,h,u,o,s;if(t==n.FieldStatus.Null)return h=this._format.Fields.GetValue(this.NeedRefBaseValue),h==null?this._format.NullExpressionString==null||this._format.NullExpressionString==""||i?this._format.NullExpressionFillChar==null||this._format.NullExpressionFillChar==""||i?this.ShowLiterals==n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":this._format.Fields.GetFillingString(this._format.NullExpressionFillChar):this._format.NullExpressionString:this._format.EmptyErasString==null||this._format.EmptyErasString==""||i?this._format.EmptyErasFillChar==null||this._format.EmptyErasFillChar==""||i?this.ShowLiterals==n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"":this._format.Fields.GetFillingString(this._format.EmptyErasFillChar):this._format.EmptyErasString;else{u=null;if(this.ShowLiterals==n.ShowLiterals.Always)for(r=0;r=0;r--){u=this._format.Fields.GetFieldByIndex(r);if(u instanceof n.DateTimeField&&u.GetStatus()!=n.FieldStatus.Null){o=u;break}}for(f=0;f=0;f--)if(u instanceof n.IntField&&s.CharAt(f)!=u.holder)break;e+=s.Substring(0,f+1)}}}return e},i.prototype.GetShowText2=function(t,i){var e="",u=0,f=0,r,o,s;if(t==n.FieldStatus.Null)return this.ShowLiterals==n.ShowLiterals.Always?this._format.Fields.GetFillingString(this.PromptChar):"";else{r=null;if(this.ShowLiterals==n.ShowLiterals.Always)for(u=0;u=0;u--){r=this._format.Fields.GetFieldByIndex(u);if(r instanceof n.DateTimeField&&r.GetStatus()!=n.FieldStatus.Null){o=r;break}}for(f=0;f=0;f--)if(r instanceof n.IntField&&s.CharAt(f)!=r.holder)break;e+=s.Substring(0,f+1)}}}return e},i.prototype.ProcessBackSpaceKey=function(t,i){var f=Math.min(t,i),e=Math.abs(t-i),r={},u,s,o,h,v,a,c,y,l;if(f==0&&e==0)return r;o=this._format.Fields.GetFieldIndexByPos(f),u=o.index,s=o.offset;if(u==-1)return r;if(e==0){if(u==0&&this._format.Fields.GetFieldByIndex(u)instanceof n.PromptField||u==1&&s==0&&this._format.Fields.GetFieldByIndex(u-1)instanceof n.PromptField)return r;s==0&&(u--,s=this._format.Fields.GetFieldByIndex(u).GetLength()),this._format.Fields.GetFieldByIndex(u)instanceof n.PromptField?(e=s+1,f=f-e):(e=1,f--),f=this._format.Fields.Delete(f,e).cursorPos,r.SelectionStart=f,r.SelectionEnd=r.SelectionStart}else{o=this._format.Fields.GetFieldIndexByPos(f+e),h=o.index,v=o.offset;if(h==-1)return r;if((u==0||u==1&&s==0)&&this._format.Fields.GetFieldByIndex(u)instanceof n.PromptField&&(h==0||h==1&&v==0)&&this._format.Fields.GetFieldByIndex(h)instanceof n.PromptField)return r;a=this._format.Fields.Delete(f,e);if(!a.isSucceed)return r;r.SelectionStart=a.cursorPos,r.SelectionEnd=r.SelectionStart,l=this._format.Fields.GetFieldIndexByPos(r.SelectionStart),y=l.index,c=l.offset,c!=0&&this._format.Fields.GetFieldByIndex(y)instanceof n.PromptField&&(r.SelectionStart=r.SelectionStart-c,r.SelectionEnd=r.SelectionStart)}return r},i.prototype.PerformSpin=function(t,i,r,u){var f={};return f.SelectionStart=this._format.Fields.PerformSpin(t,r,u),f.Text=this.GetShowText(n.FieldStatus.Full,!0),this.isDeleteInNullOrEmptyEra=!1,this.NeedRefBaseValue=!1,f.DeleteInNullOrEmptyEra=this.isDeleteInNullOrEmptyEra,f},i.prototype.ProcessBackSpace=function(t,i){var r={};return this.isDeleteInNullOrEmptyEra||(r=this.ProcessBackSpaceKey(t,i)),this._format.Fields.ValueIsNull()?this.isDeleteInNullOrEmptyEra?t>0&&(r=this.ProcessBackSpaceKey(t,i),r.Text=this.GetShowText(n.FieldStatus.Null,!0)):(r.Value=null,r.Text=this.GetShowText(n.FieldStatus.Null,!0),this._format.Fields.UpdateHiddenValue(r.Value),(this._format.NullExpressionString!=""||this._format.NullExpressionFillChar!="")&&(r.SelectionStart=0,r.SelectionEnd=0,this.isDeleteInNullOrEmptyEra=!0)):(r.Text=this.GetShowText(n.FieldStatus.Full,!0),this.isDeleteInNullOrEmptyEra=!1),r.SelectionStart!=null&&r.SelectionEnd!=null&&r.SelectionStart==r.SelectionEnd&&(this.isMulSelected=!1),this.NeedRefBaseValue=!1,r},i.prototype.ProcessDelete=function(t,i){var r={};return this.isDeleteInNullOrEmptyEra||(r=this.ProcessDeleteKey(t,i)),this._format.Fields.ValueIsNull()?this.isDeleteInNullOrEmptyEra?t=0;u--)if(!(f.GetFieldByIndex(u)instanceof n.PromptField)){e=f.GetFieldRange(u),s=e.start+e.length;break}return t.prototype.GetCaretPosition.call(this,i,r,o,s,"PromptField")},i.prototype.GetNullCasePosition=function(n,t){switch(t){case 36:case 65572:case 131109:case 196645:case 196644:case 131108:n=0;break;case 35:case 65571:n=this._owner._uIUpdate.GetText().length;break;case 65573:case 37:n!=0&&n--;break;case 39:case 65575:n!=this._owner._uIUpdate.GetText().length&&n++;break;case 131111:case 196647:case 196643:case 131107:n=this._owner._uIUpdate.GetText().length;break;case 131118:case 131080:case 196616:return n}return n},i.prototype.ProcessTabKey=function(i,r,u){var f;return f=u==n.TabAction.Control?t.prototype.ProcessTabKey.call(this,i,r,u):this.MoveFieldAndControl(i,r)},i.prototype.ProcessLeftDirection=function(t,i,r){var u={};return this.CurrentNullOrEmptyEraString()==""?(this.isMulSelected&&r!=n.Key.Home&&r!=131108?(u.SelectionStart=Math.min(t,i),u.SelectionEnd=u.SelectionStart,this.isMulSelected=!1):(u.SelectionStart=this.GetCaretPosition(i,r),u.SelectionEnd=u.SelectionStart),u):r==37||r==131109?(t>0&&(u.SelectionStart=t-1,u.SelectionEnd=u.SelectionStart),u):(this._format.NullExpressionString!=""?(u.SelectionStart=0,u.SelectionEnd=0):this.isMulSelected&&r!=n.Key.Home&&r!=131108?(u.SelectionStart=Math.min(t,i),u.SelectionEnd=u.SelectionStart,this.isMulSelected=!1):(u.SelectionStart=this.GetCaretPosition(i,r),u.SelectionEnd=u.SelectionStart),u)},i.prototype.ProcessRightDirection=function(t,i,r){var u={};return this.isMulSelected&&r!=n.Key.End&&r!=131107?(u.SelectionStart=Math.max(t,i),u.SelectionEnd=u.SelectionStart):(u.SelectionStart=this.GetCaretPosition(i,r),u.SelectionEnd=u.SelectionStart),this.isMulSelected=!1,u},i.prototype.GetCurrentField=function(n){return this._format.Fields.GetCurrentFieldByPos(n)},i.prototype.GetPosByCurrentField=function(n,t){var r={},i;if(this._format.Fields.fieldCount==0)return null;return i=this._format.Fields.GetPosByCurrentField(n,t),i!=null&&i!=-1?(r.SelectionStart=i.start,r.SelectionEnd=i.start+i.length,r):null},i.prototype.CurrentNullOrEmptyEraString=function(){return this.isDeleteInNullOrEmptyEra?this._owner._getShownWatermarkText(this._owner._focused):""},i.prototype._isFieldVisible=function(t){if(this.GetShowLiterals()!=n.ShowLiterals.Always){var r=this._format.Fields.GetFieldIndexByPos(t).index,i=this._format.Fields.GetFieldByIndex(r);if(i!=null)return i.GetStatus()===n.FieldStatus.Full}return!0},i}(n.BaseUIProcess);n.DateUIProcess=t})(GCIM||(GCIM={})) if(typeof(Sys)!='undefined' && typeof(Sys.Application) != 'undefined'){Sys.Application.notifyScriptLoaded();};