/* * * 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 u=function(u){function f(t,i){this._dataFromServer=arguments[2],n.StringCache.SuspendSurrogateCharCheck();try{u.call(this,t,i,this._dataFromServer)}finally{n.StringCache.ResumeSurrogateCharCheck()}}return __extends(f,u),f.prototype._getComponentType=function(){return n.IMControlType.Combo},f.prototype._beginInit=function(){u.prototype._beginInit.call(this),this._autoSelect=!1,this._dropDownStyle=n.DropDownStyle.DropDown,this._textBoxStyle=n.TextBoxStyle.TextOnly,this._oldSelectedIndex=-1,this._lastValue="",this._oldPostText="",this._focusStatus=new n.ComboFocusStatus,this._focusIsOnCombo=!1,this._isMethodCall=!1,this._unSelectedImageUrl="",this._unSelectedImageWidth="16px",this._unSelectedImageHeight="16px",this._autoFilterSetting=new r,this._autoFilterSetting.MatchingFilter=f.MatchStartWidth,this._editHighlighted=!1,this._canSynSelection=!0,this._suspendEventCounter=0,this._serverListData=null,this._setSelectionFromCode=!1,this._keepFocus=!1,this._itemCache=undefined,this._itemTemplateCahce=[],this._shortcuts="Clear,113",this._selectedIndex=-1,this._preNotFilteredInputText=""},f.prototype._getDefaultDropDownVisible=function(){return!0},f.prototype._endInit=function(){this._focusType=n.FocusType.Click,u.prototype._endInit.call(this)},f.prototype.GetDropDownObj=function(){return this._dropDownObj===undefined&&(this._initialListBox(this._getId()),this.InitDropDownObj()),this._dropDownObj},f.prototype.InitDropDownObj=function(){var r,n,i,t;for(u.prototype.InitDropDownObj.call(this),this._serverListData!=null&&(this._dropDownObj._initWithServerData(this._serverListData),this._serverListData=null),r=this._itemTemplateCahce.length,n=0;n=this._serverListData.TotalItemsCount;return t&&!n}return!0},f.prototype._createUIProcessObject=function(t){return new n.ComboUIProcess(t)},f.prototype._initialListBox=function(t){var u=this,i=new n.ComboListBox(this,t,document.getElementById(this._getId()+"_ServerTable")),r;this._dropDownObj=i,i._data._isComboDropDownList=this.GetDropDownStyle()===n.DropDownStyle.Simple?!1:!0,r=i._dropDownElement,n.ComboListBox.IsDebugList||(r.style.visibility="hidden"),i.SetHorizontalLineStyle(n.LineStyle.None),i.SetBorderWidth(0),i.OnSelectedIndexChanged(function(){u._onDropDownListBoxSelectedIndexChanged()}),r=this.GetDropDownObj()._dropDownElement,r.parentElement!==null&&r.parentElement.removeChild(r),document.body.appendChild(r),r.style.position="absolute",i.HideContents(),i.SetBackColor(this.GetBackColor()),this._updateBorder()},f.prototype._onDropDownListBoxSelectedIndexChanged=function(){this._isMethodCall===!0&&(this._methodCallRasiedSelectedIndexChanged=!0);try{this._synListSelectionToCombo();var t=this.GetSelectedIndex();this._dropDownObj&&this.GetDropDownObj()._command.RealHoverCell(t),this._canSynSelection&&!this._initingServerData&&(this.FireClientEvent("SelectedIndexChanged",this.GetSelectedIndex().toString()),n.Utility.IsPad()&&(this.FireClientEvent("TextChanged",null),this.FireClientEvent("ValueChanged",null),this._getAutoPostBack()&&n.Utility.DoPostBack(this._getServerUniqueId(),"SelectedIndexChanged",this._causesValidation,this._validationGroup,"",!1,!0))),this.SearchAddressOnValueChanged(this._getId(),this._GetValueText()),this.GetReadOnly()||n.Utility.ValidateControl(this._getId())}finally{this._methodCallRasiedSelectedIndexChanged=!1}},f.prototype._synListSelectionToCombo=function(){var t=this.GetSelectedIndex(),i;this._canSynSelection?t!==-1?(this._selectItem(t),i=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(i)):this.Clear():t===-1&&this._dropDownStyle.toString()!==n.TextBoxStyle.TextOnly.toString()&&this._updateUI()},f.prototype._GetRealForeColor=function(t,i){return this.GetDropDownStyle()==n.DropDownStyle.DropDownList&&t&&this._editHighlighted?"white":u.prototype._GetRealForeColor.call(this,t,i)},f.prototype.DropDownBtnMouseDown=function(t,i){if(t!=n.MouseButton.Left&&t!=null){this._focusStatus.IsSetByDropDown=!0;return}this._focusStatus.IsSetByDropDown=!0,u.prototype.DropDownBtnMouseDown.call(this,t),i&&n.Utility.PreventDefault(i)},f.prototype._dropDownClick=function(){var n=this._dropDownBtnPressed;this.DropDownBtnMouseDown(),this._dropDownBtnPressed=n},f.prototype.ShowDropDown=function(){this.GetDropDownStyle()!==n.DropDownStyle.Simple&&u.prototype.ShowDropDown.call(this)},f.prototype._showDropDownInternal=function(){var i=this.GetDropDownObj(),r,t;if(i._data._filtering){r=i._data.GetTotalVisibleCount();if(r==0)return!1}return t=i.Show(null,this._getInnerTouchDropDownScale()),t&&(this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this._clearEditHighlight(),this._droppedDown===!0&&this.SetLastClientValues()),t},f.prototype.CloseDropDown=function(t){this.GetDropDownStyle()!==n.DropDownStyle.Simple&&(this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this._setEditHighlight(),u.prototype.CloseDropDown.call(this)),n.Utility.IPad&&this.GetRealControlEffect()!=n.ControlEffect.JQueryUI&&(this.GetBorderContainer().style.borderColor="rgb(76,76,76)")},f.prototype._selectItem=function(t){if(!this.GetEnabled()&&!this._isMethodCall)return!1;if(this.GetReadOnly()&&!this._isMethodCall)return this._droppedDown&&this.CloseDropDown(),!1;this._validatedSelectedItem(t),this._dropDownBtnPressed=!1,this.GetDropDownStyle()!==n.DropDownStyle.Simple&&(this._droppedDown||(this._mouseIsOnDropDownList=!1)),this._getAutoPostBack()&&(this._mouseIsOnSpinDown===!0&&(this._mouseIsOnSpinDown=!1),this._mouseIsOnSpinUp===!0&&(this._mouseIsOnSpinUp=!1),this._mouseIsOnDropDownList===!0&&(this._mouseIsOnDropDownList=!1),this._initingServerData||this.LoseFocus())},f.prototype._selectItemBySpin=function(n,t,i,r){this.SetSelectedIndex(n,!0);return},f.prototype.SelectAll=function(){if(this.GetDropDownStyle()!=n.DropDownStyle.DropDownList){var t=this._focusType;u.prototype.SelectAll.call(this),this._isMethodCall&&(this._focusType=t)}return this},f.prototype._validatedSelectedItem=function(t,i){var s=this.GetSelectedIndex(),u=this.GetItem(t),f,o,r,e;return u===null||u!==null&&u._enabled===!1?!1:((i===null||i===undefined)&&(i=!0),this._focusIsOnCombo===!1&&this.GetDropDownStyle()===n.DropDownStyle.Simple&&(this._focusIsOnCombo=!0),this._focusStatus.IsSetByDropDownList=!0,this._oldText=this._uIProcess.GetShowText2(this.GetShowLiterals(),!0,!0),f={},f.valid=!0,f.cancel=!1,this._newSelectionStart=0,o=0,r=this._getTextSubItemIndex(),r>-1&&u._subItems.length>r&&(o=u._subItems[r].GetValue().GetLength()),this._newSelectionEnd=o,e="",this._formatIsNull===!0||this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly?(r>-1&&u._subItems.length>r&&(e=u._subItems[r].GetValue()),f=this.SetDisplayText(e),f.valid=!0):(r>-1&&u._subItems.length>r&&(e=u._subItems[r].GetValue()),f=this.SetDisplayText(e)),f.valid==!0&&f.cancel==!1?(this._updateUI(),i&&(n.Utility.IsPad()||this.SelectAll()),s!=t,!0):(this._canSynSelection=!1,this.SetSelectedIndex(-1),this._canSynSelection=!0,i&&this.SelectAll(),this.FireClientEvent("InvalidInput",null),!1))},f.prototype._CanShowContextMenu=function(){return this.GetDropDownStyle()===n.DropDownStyle.DropDownList||this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly?!1:u.prototype._CanShowContextMenu.call(this)},f.prototype.Cut=function(){u.prototype.Cut.call(this),this.Text!=this._lastValue&&(this._lastValue=this.Text,this._oldText!=this.Text&&(this.GetSelectedIndex()<0||this._resetSelected()),this._autoSelectItem()),this._closeFilter()},f.prototype.Focus=function(){this._focusIsOnCombo=!0;if(this._focusStatus.IsFromInner()===!0)this._dropDownBtnPressed===!0&&(this._focusType=n.FocusType.DropDown),(this._mouseIsOnSpinDown===!0||this._mouseIsOnSpinUp===!0)&&(this._focusType=n.FocusType.SpinButton);else{this._IsDrop?this._oldText==this.Text||this.GetSelectedIndex()<0||this._resetSelected():(this._oldText=this._uIProcess.GetShowText2(this.GetShowLiterals(),!0,!1),this._oldFocusText=this._oldText);if(this._mouseButton==n.MouseButton.Right){this.SetSelection(0,0);if(this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly)return!1}if(this._contextMenu.IsShow())return!1;if(this.GetAutoDropDown()===!0&&this.GetDropDownStyle()===n.DropDownStyle.DropDown&&this._mouseButton!=n.MouseButton.Right&&this._focusStatus.IsSetByDropDown===!1&&this._focusStatus.IsSetBySpin===!1){this._droppedDown||this._dropDownClick();if(this.GetSelectedIndex()>=0)return!1}else this.GetDropDownStyle()!==n.DropDownStyle.DropDownList||this._focusStatus.IsSetByMouse||(this._setEditHighlight(),n.Utility.ClearSelection(this._realInputElement))}u.prototype.Focus.call(this)},f.prototype.GetOldValue=function(){return this._uIProcess._format.Fields.GetOldValue()},f.prototype.KeyDown=function(t){var v=this,i=t.keyCode,e={},p,o,it,r,l,b,tt,y,s,h,a,c,nt,g,f,d;e.Shift=!1,e.Ctrl=!1,e.Alt=!1,t.shiftKey&&(e.Shift=!0),t.ctrlKey&&(e.Ctrl=!0),t.altKey&&(e.Alt=!0),p=n.Key,this._performSpinOnKeyDown=!1;if(this.__closeDropDownByEnter===!0){this.__closeDropDownByEnter=undefined;if(i===p.Z&&e.Ctrl)return}clearTimeout(this._autoFilterSetting.AutoFilterTimer),this._oldText=this.Text;var rt=this._droppedDown,w=this.SelectionStart,k=this.SelectionEnd;if(i===p.Z&&e.Ctrl)if(this.GetSelectedIndex()>-1)return!1;if(this.GetDropDownStyle()===n.DropDownStyle.DropDownList)if(i===n.Key.BackSpace||i===n.Key.Delete)return!1;o={},it=this._imeMode,this._imeMode=!1;if(i===229)return n.Utility.IsIE8OrBelow&&(this._imeMode=!0),!0;this._imeMode||!it||e.Shift||e.Ctrl||i!=n.Key.Tab&&i!=65545&&(this.ImeInput("ReInput",!0),this._imeSelectTimes=0),o.KeyCode=i,o.Text=this.Text,o.DisplayText=this._uIUpdate.GetText(),o.FuncKeysPressed=e,o.SelectionStart=this.SelectionStart,o.SelectionEnd=this.SelectionEnd,o.EditMode=this._getEditModeInternal(),o.ReadOnly=this.GetReadOnly(),o.ClipContent=this.GetClipContent(),o.ExitOnLastChar=this.GetExitOnLastChar(),o.ExitOnLeftRightKey=this.GetExitOnLeftRightKey(),o.TabAction=this.GetTabAction(),r=n.BaseInputControl.prototype.KeyDown.call(this,o);if(r!==null&&r!==undefined&&r.System===!1&&rt&&this._droppedDown&&i!==262182&&i!==262184&&i!==27&&i!==118&&i!==9){l=this._uIProcess.GetKeyActionName(i,this._shortcuts),f=this.GetDropDownObj(),l!=null&&f.IsShortcut(i)&&(l=null);if(l==null){b=!1,this.GetSpinEnabled()&&(this.SetSpinEnabled(!1),b=!0),this._droppedDown=!1,this._canFireClientEvent=!1;try{tt=u.prototype.KeyDown.call(this,t),r.System=tt}finally{this._droppedDown=!0,this._canFireClientEvent=!0}b&&this.SetSpinEnabled(!0)}}if(r==null||r.KeyAction==null)if(i==n.Key.Return){if(this._contextMenu.IsShow())return r.System;y=!1,this._droppedDown&&(f=this.GetDropDownObj(),f._data._hoverRowIndex<0||(y=!0));if(!y)if(this.GetTextboxValue()==this.Text)return this.SetHideValue(),this._mouseIsOnDropDownList===!0&&(this._mouseIsOnDropDownList=!1,this._droppedDown&&(this.__closeDropDownByEnter=!0),this.CloseDropDown()),!0}if(r!=null&&r.KeyAction!=null)switch(r.KeyAction.toLowerCase()){case n.KeyActions.Clear:f=this.GetDropDownObj(),this.GetDropDownStyle()!==n.DropDownStyle.DropDownList&&(f.GetSelectedIndex()<0||f.SetSelectedIndex(-1),this._updateUI(),f.SetSelectedIndex(-1));default:break}if(r!=null&&r.KeyAction==null){e.Alt&&(i|=262144),e.Ctrl&&(i|=131072),e.Shift&&(i|=65536);switch(i){case n.Key.Return:return this._droppedDown?(this._droppedDown&&(this.__closeDropDownByEnter=!0),this.CloseDropDown(),f=this.GetDropDownObj(),f._data._hoverRowIndex<0||f.SetSelectedIndex(f._data._hoverRowIndex),n.Utility.IsIE&&this._mouseIsOnDropDownList===!0&&(this._mouseIsOnDropDownList=!1),!1):!0;case n.Key.PageUp:return this.PerformSpin("PageUp"),!1;case n.Key.PageDown:return this.PerformSpin("PageDown"),!1;case n.Key.Home:return this.GetDropDownStyle()!==n.DropDownStyle.Simple&&this._droppedDown&&this.PerformSpin("Home"),!1;case n.Key.End:return this.GetDropDownStyle()!==n.DropDownStyle.Simple&&this._droppedDown&&this.PerformSpin("End"),!1;case n.Key.Up:return(this.GetSpinEnabled()&&this._droppedDown&&this.GetDropDownStyle()!==n.DropDownStyle.Simple||!this.GetSpinEnabled()&&this.GetDropDownStyle()===n.DropDownStyle.Simple)&&this.PerformSpin("up"),!1;case n.Key.Down:return(this.GetSpinEnabled()&&this._droppedDown&&this.GetDropDownStyle()!==n.DropDownStyle.Simple||!this.GetSpinEnabled()&&this.GetDropDownStyle()===n.DropDownStyle.Simple)&&this.PerformSpin("down"),!1;default:break}}if(this.GetDropDownStyle()===n.DropDownStyle.DropDownList)switch(i){case 196643:case 196644:case 196645:case 196647:case 65569:case 196641:case 65570:case 196642:case 65571:case 65572:case 65573:case 65575:this.SelectionStart=0,this.SelectionEnd=0,this.SetSelection(this.SelectionStart,this.SelectionEnd);default:break}if(r.inputChar!=null){if(this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly||this.GetDropDownStyle()===n.DropDownStyle.DropDownList){s={},s.Text="";if(!this.UpdateText(s))return this.SelectionStart=w,this.SelectionEnd=k,!1;this.UpdateDisplayText(""),this.SetSelection(this.SelectionStart,this.SelectionEnd);if(this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly)return!1}return!0}if(i==131158)if(this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly)return s={},s.Text="",this.UpdateText(s)?(this.UpdateDisplayText(""),this.SetSelection(this.SelectionStart,this.SelectionEnd),!1):(this.SelectionStart=w,this.SelectionEnd=k,!1);r.Value!=null&&(this.Value=r.Value);if(r.Text!=null){if(!this.UpdateText(r))return this.SelectionStart=w,this.SelectionEnd=k,!1;this.GetDropDownStyle()!==n.DropDownStyle.DropDownList&&(this.UpdateDisplayText(this.Text),r!=null&&r.FocusExit!=null&&r.FocusExit||this.SetSelection(this.SelectionStart,this.SelectionEnd)),this._autoSelectItem()}h=this.GetSelectedItem(),a=!1,this.GetSelectedIndex()<0||h==null||(c=this._getTextSubItemIndex(),c>-1&&h._subItems.length>c?(nt=h._subItems[c].GetValue(),nt==""&&(a=!0)):h._subItems.length==0&&(a=!0)),(this._performSpinOnKeyDown!=!1||this._oldText==this.Text)&&(this._oldText!=this.Text||this.Text!=""||a||this.GetTextBoxStyle()===n.TextBoxStyle.ImageOnly)||this.GetSelectedIndex()<0||this._resetSelected();if(this._autoSelect===!0&&this.GetDropDownEnabled()&&(i===8||i===46||r.KeyAction=="Clear")){g=this._uIProcess._format.Fields.GetValue();if(g.GetLength()>0){if(this._droppedDown===!1){this._keepFocus=!0;try{this.ShowDropDown()}finally{this._keepFocus=!1}}this._autoSelectItem()}else this._droppedDown&&this.CloseDropDown(),f=this.GetDropDownObj(),this._autoSelect===!0&&this._uIUpdate.GetText()!=""?this._getLoadDataDynamically()&&!f._data.IsLoadComplete()?this._autoSelectFromServer(this._uIUpdate.GetText(),function(){var n=v._autoGetSelectedIndex(!1);v._autoSelectItemProcess(n)}):(d=this._autoGetSelectedIndex(!1),this._autoSelectItemProcess(d)):f.GetSelectedIndex()<0?this._clearAllHighlightItem():this._resetSelected();this.GetAutoFilterEnabled()===!0&&(this._autoFilterSetting.AutoFilterTimer=setTimeout(function(){v._autoFilterItem()},this.GetAutoFilterInterval()))}return this.GetAutoFilterEnabled()&&(i==n.Key.BackSpace||i==n.Key.Delete||r.KeyAction=="Clear")&&(this.GetReadOnly()||(this._autoFilterSetting.AutoFilterTimer=setTimeout(function(){v._autoFilterItem()},this.GetAutoFilterInterval()))),r.System},f.prototype.KeyPress=function(t,i){clearTimeout(this._autoFilterSetting.AutoFilterTimer);var r=u.prototype.KeyPress.call(this,t,i);return i!=null&&i.keyCode==n.Key.Return?!0:r},f.prototype.KeyUp=function(n){u.prototype.KeyUp.call(this,n);var t=this._getShortcutObj();t&&(t.GetBlockKeyMessage()||(t._uiProcess.ProcessGcComboAction(this,n),t._uiProcess.ProcessTriggerAll(this,n)))},f.prototype._updateText=function(t){if(this.GetDropDownStyle()!==n.DropDownStyle.DropDownList)if(t.Text!=null){if(!this.UpdateText(t))return!1;this.UpdateDisplayText(this.Text)}return!0},f.prototype._doExtraWorkForKeyPress=function(t){var f=this,i=this.GetDropDownObj(),u,r;if(this.GetDropDownStyle()!==n.DropDownStyle.DropDownList)this.UpdateDisplayText(this.Text);else return u=t,r=this._autoGetSelectedIndex(!1,u),r!=-1?(this._selectItemBySpin(r),this._synListSelectionToCombo(),this.SelectAll()):i.GetSelectedIndex()>-1?(this._selectItemBySpin(i.GetSelectedIndex()),this._synListSelectionToCombo()):this.Clear(),!0;this._oldText!=this.Text&&(i.GetSelectedIndex()<0||this._resetSelected());if(this._uIProcess._format.Fields.GetValue()=="")i.SetSelectedIndex(-1),this._droppedDown&&this.CloseDropDown();else{if(this._autoSelect===!0&&this.GetDropDownEnabled()){if(this._droppedDown===!1){this._keepFocus=!0;try{this.ShowDropDown()}finally{this._keepFocus=!1}}this._autoSelectItem()}if(this.GetAutoFilterEnabled()==!0&&this.GetDropDownEnabled()){if(this._droppedDown===!1){this._keepFocus=!0;try{(this._preNotFilteredInputText==""||this._preNotFilteredInputText!=""&&(this.Text+t).startWith(this._preNotFilteredInputText)==!1)&&this.ShowDropDown()}finally{this._keepFocus=!1}}this._autoFilterSetting.AutoFilterTimer=setTimeout(function(){f._autoFilterItem()},this.GetAutoFilterInterval())}}},f.prototype.LoseFocus=function(){var e,o,s,f,t,i,r;clearTimeout(this._autoFilterSetting.AutoFilterTimer);if(this._droppedDown)try{if(this._dropDownObj._dropDownElement.contains(document.activeElement))if(!n.Utility.IsPad()){this.SetFocus();return}}catch(h){}this._focusType==n.FocusType.KeyExit&&((this._oldPostText!=this.Text||this._oldSelectedIndex!==this.GetSelectedIndex())&&this._getAutoPostBack()&&typeof window.__doPostBack!="undefined"&&(e="SelectedIndexChanged",this._oldPostText!=this.Text&&(e="TextChanged"),this._oldSelectedIndex=this.GetSelectedIndex(),this._oldPostText=this.Text,n.Utility.DoPostBack(this._getServerUniqueId(),e,this._causesValidation,this._validationGroup,"",!1,!0)),this._droppedDown===!0&&this.CloseDropDown(),this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this._clearEditHighlight(),this._resetFlag(),this._focusStatus.Reset());if(this._dropDownBtnPressed===!0||this._mouseIsOnSpinDown===!0||this._mouseIsOnSpinUp===!0||this._mouseIsOnDropDownList===!0)return this._focusType=n.FocusType.DropDownClose,n.Utility.IsPad()||this.SetInnerFocus(),this._focusType=n.FocusType.None,!1;else this._droppedDown===!0&&this.CloseDropDown(),this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this._clearEditHighlight(),this._resetFlag(),this._focusStatus.Reset();o=this._imeMode,s=n.Utility.__ignorePostBack,n.Utility.__ignorePostBack=!0,u.prototype.LoseFocus.call(this),n.Utility.__ignorePostBack=s,this.GetTextBoxStyle()!==n.TextBoxStyle.ImageOnly&&this.GetDropDownStyle()!==n.DropDownStyle.DropDownList&&((n.Utility.IsIE||!o)&&this.UpdateDisplayText(this.DisplayText),o&&this._autoSelectItem()),typeof window.__doPostBack!="undefined"&&(f=this._specialClientEvents.SelectedIndexChanged,t=!1,f&&f.IndexOf(n.GcMask.AjaxEventHandlerName)>-1&&(t=!0),i=!0,t&&this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&(i=!1),this._getAutoPostBack()&&i&&!n.Utility.__ignorePostBack&&this._focusIsOnCombo===!1&&(r=this._oldPostText!=this.Text,(r||this._oldSelectedIndex!==this.GetDropDownObj().GetSelectedIndex())&&(this._oldSelectedIndex=this.GetSelectedIndex(),this._oldPostText=this.Text,n.Utility.DoPostBack(this._getServerUniqueId(),r?"TextChanged":"SelectedIndexChanged",this._causesValidation,this._validationGroup,"",!1,!0)))),this._focusType=n.FocusType.None},f.prototype.MouseDown=function(t){var s,u,e,o,r,f,i;if(n.Utility.IsTouchMouseDown==!0&&this._focused){s=this._getInnerShowTouchToolBarValue()&n.TouchToolBarDisplayOptions.TapSelection;if(s!=0&&this._touchToolBar!=null)if(n.Utility.IsClickInSelection(t)){n.Utility.PreventDefault(t);return}}u=n.Utility.GetMouseButton(t),this._focusedWhenMouseDown=document.activeElement==t.target,this._mouseDownOnClearButton=n.Utility.IsMouseDownOnClearButton(t),this._dropDownOpenWhenMouseDown=this._mouseDownOnClearButton&&this._droppedDown?!0:!1,this._oldSelectionStart=this.SelectionStart,this._oldSelectionEnd=this.SelectionEnd,this._mouseDownX=t.x,this._focusStatus.IsSetByMouse=!0,this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close(),e=this._droppedDown,u==n.MouseButton.Right?(this._mouseButton=n.MouseButton.Right,this._focusType=n.FocusType.ContextMenu):(this._mouseButton=n.MouseButton.Left,this._focusType=n.FocusType.Click,this._droppedDown||this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this.GetDropDownEnabled()&&(this.ShowDropDown(),o=this.GetDisplayText(),r=this.GetSelectedIndex(),r>-1&&r-1&&this.GetSubItemsCount(r)>this._getTextSubItemIndex()&&(f=this.GetSubItem(r,this._getTextSubItemIndex()).GetValue()),f==o?this._selectItemBySpin(r):this._autoGetSelectedIndex(!0)!==-1&&this._selectItemBySpin(this._autoGetSelectedIndex(!0))):this._autoGetSelectedIndex(!0)!==-1&&this._selectItemBySpin(this._autoGetSelectedIndex(!0)))),this._mouseButton==n.MouseButton.Left&&(n.Utility.IsIE||n.Utility.firefox)&&n.Utility.ClearSelection(this.GetInputElement()),e&&this.CloseDropDown(),i=this._uIProcess.MouseDown(u),this._uIProcess.isDblClick=!1,i!=null&&(i.SelectionStart!=null&&(this.SelectionStart=i.SelectionStart),i.SelectionEnd!=null&&(this.SelectionEnd=i.SelectionEnd,this.SetSelection(this.SelectionStart,this.SelectionEnd))),!n.Utility.IsIE&&this._imeMode&&u==n.MouseButton.Left&&(this._isImplementImeInput=!0)},f.prototype._buttonMouseOver=function(n){if(n!=null)switch(n){case"1":break;case"2":this._mouseIsOnSpinUp=!0;break;case"3":this._mouseIsOnSpinDown=!0;break;case"4":this._mouseIsOnDropDownList=!0;break}},f.prototype._buttonMouseOut=function(n){if(n!=null)switch(n){case"1":this._dropDownBtnPressed=!1;case"2":this._mouseIsOnSpinUp=!1;case"3":this._mouseIsOnSpinDown=!1;case"4":this._mouseIsOnDropDownList=!1;break}},f.prototype.SetValue=function(t){t=n.Utility.CheckString(t),u.prototype.SetValue.call(this,t),this._canSynSelection=!1;try{var i=this.GetSelectedIndex();this.SetSelectedIndex(-1),i!==-1&&this.FireClientEvent("SelectedIndexChanged",this.GetSelectedIndex().toString())}finally{this._canSynSelection=!0}return this._closeFilter(),this},f.prototype.Paste=function(n,t,i,r){u.prototype.Paste.call(this,n,t,i,r),this._oldText!=this.Text&&(this.GetSelectedIndex()<0||this._resetSelected())},f.prototype.SetSelectedText=function(n){u.prototype.SetSelectedText.call(this,n),this._canSynSelection=!1;try{var t=this.GetSelectedIndex();this.SetSelectedIndex(-1),t!==-1&&this.FireClientEvent("SelectedIndexChanged",this.GetSelectedIndex().toString())}finally{this._canSynSelection=!0}return this},f.prototype.SetSelection=function(n,t,i){if(this._setSelectionFromCode){if(n==null||t==null||isNaN(n)||isNaN(t))return;this.SelectionStart=n,this.SelectionEnd=t,n==t&&(this._uIProcess.isMulSelected=!1)}else u.prototype.SetSelection.call(this,n,t,i)},f.prototype.SetText=function(t){t=n.Utility.CheckString(t),u.prototype.SetText.call(this,t),this._canSynSelection=!1;try{var i=this.GetSelectedIndex();this.SetSelectedIndex(-1),i!==-1&&this.FireClientEvent("SelectedIndexChanged",this.GetSelectedIndex().toString())}finally{this._canSynSelection=!0}return this},f.prototype.PerformSpin=function(n,t){var r,i;if(this.GetReadOnly())return;r=n===!0||n===!1?n?"up":"down":n.toString(),i=this._uIProcess.Focus(this._focusType,this.GetInputElement(),this.GetHighlightText(),this._cursorPosition,this.SelectionStart),i!=null&&i.SelectionStart!=null&&i.SelectionEnd!=null&&(this.SelectionStart=i.SelectionStart,this.SelectionEnd=i.SelectionEnd),this._focusStatus.IsSetBySpin=!0,this.PerformSpinProcess(r,t,this.GetSpinIncrement()),this._performSpinOnKeyDown=!0},f.prototype.PerformSpinProcess=function(t,i,r,u){var o=this,e,f;if(this._focusIsOnCombo===!1&&this.GetAutoDropDown()){this._dropDownClick(),this._focusIsOnCombo=!0;return}else if(this._droppedDown===!0)i&&this.CloseDropDown();else if(this.GetDropDownStyle()!==n.DropDownStyle.Simple&&this.GetSpinEnabled()===!1&&!this._droppedDown)if(!this._isMethodCall)return;e=r,(this._droppedDown||this.GetDropDownStyle()===n.DropDownStyle.Simple)&&t!=""&&(e=1),this.GetSelectedIndex()===-1&&(e=1),f="",t=="up"?f="SpinUp":t=="down"&&(f="SpinDown"),this._hasMoreDataToLoad()?this._spinFromServer(function(){o.RealDoSpin(t,e,f,u)}):this.RealDoSpin(t,e,f,u)},f.prototype.RealDoSpin=function(t,i,r,u){var e,o,h,c,f,s;if(t==="up"||t==="down"){e=this.GetSelectedIndex(),e==-1&&(this._droppedDown||this._dropDownStyle==n.DropDownStyle.Simple)&&(e=this.GetDropDownObj()._data._hoverRowIndex),o=0,h=this.GetItemsCount();do o++,i>0?(f=this._getNextSpinableItemIndex(e,r==="SpinUp",i),t=="PageUp"||t=="up"?this._selectItemBySpin(f,"Up",u):this._selectItemBySpin(f,"key",u)):(f=this._getNextSpinableItemIndex(e,r!=="SpinUp",-i),t=="PageUp"||t=="up"?this._selectItemBySpin(f,"Up",u):this._selectItemBySpin(f,"key",u)),c=this.GetSelectedIndex(),e=f;while(c===-1&&o-1&&r!=""&&this.GetDropDownStyle()!==n.DropDownStyle.Simple&&(this._droppedDown||this.FireClientEvent(r,""))},f.prototype._getRealSpinWrap=function(){return this.GetDropDownStyle()===n.DropDownStyle.Simple?!1:this._droppedDown?!1:this.GetSpinWrap()},f.prototype._getNextSpinableItemIndex=function(n,t,i){var r=n,u=this.GetItemsCount();if(t){n--;while(n>=0&&n0){if(this.GetItem(n).GetVisible()&&this.GetItem(n).GetEnabled()){i--;if(i==0)break}n++}if(n>=u)if(this._getRealSpinWrap()){n=0;while(nf.GetLength()&&(t=t.Substring(0,f.GetLength()),u=this._uIProcess._format.Fields.SetText(t,!0));if(this._formatIsNull===!0)if(i)this.Text=this.GetDisplayText();else return s=this.GetDisplayText(),e={},e.Text=s,this.UpdateText(e)?(this.UpdateDisplayText(this.Text),this._lastValue=t,r):(this.UpdateDisplayText(this.Text),r.cancel=!0,r);else if(u!=null&&u.isValid==!0)if(i)this.Text=this.GetDisplayText();else return e={},e.Text=this.GetDisplayText(),this.UpdateText(e)?(this.UpdateDisplayText(this.Text),this._lastValue=t,r):(this.UpdateDisplayText(this.Text),r.cancel=!0,r);else return this._uIProcess._format.Fields.ClearContent(),this._uIProcess._format.Fields.SetText(h,!0),this.Text=this.GetDisplayText(),this.UpdateDisplayText(this.Text),r.valid=!1,r}return r.valid=!1,r},f.prototype.SetReadOnly=function(t){return u.prototype.SetReadOnly.call(this,t),this.GetDropDownStyle()===n.DropDownStyle.DropDownList&&this._uIUpdate.SetReadOnly(!0),this},f.prototype.Clear=function(){return u.prototype.Clear.call(this),this._updateUI(),this._closeFilter(),this},f.prototype._clearWhenFocus=function(){var n=this.GetSelectedIndex();this.SetValue(""),n<0||this._updateUI(),this.UpdateDisplayText(this._uIProcess.GetShowText2(this.GetShowLiterals(),!0,!0))},f.prototype._doDeleteExtraWork=function(){this._oldText!=this.Text&&(this.GetSelectedIndex()<0||this._resetSelected()),this._autoSelectItem()},f.prototype._autoGetSelectedIndex=function(n,t){var i=t;return(t===undefined||t===null)&&(i=this._uIUpdate.GetText()),this.GetDropDownObj()._getSelectedIndexByText(n,i)},f.prototype.GetSelectedIndex=function(){return this._dropDownObj?this.GetDropDownObj().GetSelectedIndex():this._selectedIndex},f.prototype.GetSelectedItem=function(){if(this._dropDownObj)return this.GetDropDownObj().GetSelectedItem();else{var n=this.GetSelectedIndex();return this.GetItem(n)}},f.prototype.SetSelectedIndex=function(t,i){i===void 0&&(i=!1),t=n.Utility.CheckInt(t,-1,this.GetItemsCount()-1),this._setSelectionFromCode=!0,i&&(this._setSelectionFromCode=!1),this._isMethodCall=!0;try{var r=this.Text;this._dropDownObj?this.GetDropDownObj().SetSelectedIndex(t):(this._selectedIndex>=0&&this._selectedIndex=0&&this._selectedIndex0?this.PerformSpin("up"):i<0&&this.PerformSpin("down"))},f.prototype._updateUI=function(){var r;if(this._imageElement){var u=this.GetSelectedItem(),s=this.GetSelectedIndex(),t=this._imageElement.style,e="window";n.Utility.IPad&&(e="transparent"),this._imageCell.style.backgroundColor=this.GetBackColor()||e;if(u){var i=u.GetImageUrl(),o=u.GetImageSize().Width+"px",f=u.GetImageSize().Height+"px";i===""&&this.GetItemTemplatesCount()>0&&(r=this.GetItemTemplate(s%this.GetItemTemplatesCount()),i=r.GetImageUrl(),o=r.GetImageSize().Width+"px",f=r.GetImageSize().Height+"px"),this._imageElement.src=i,t.width=o,t.height=f,t.visibility="",i||(t.visibility="hidden")}else this._unSelectedImageUrl!==""?(i=this._unSelectedImageUrl,this._imageElement.src=i,t.width=this._unSelectedImageWidth,t.height=this._unSelectedImageHeight,t.visibility="",i||(t.visibility="hidden")):t.visibility="hidden"}},f.prototype.SetInnerText=function(t){if(this.GetTextBoxStyle()!==n.TextBoxStyle.ImageOnly){this.Clear();var i;return i=this._uIProcess._format.Fields.SetText(t,!0),this._formatIsNull===!0?(i={},i.Text=this._uIProcess.GetShowText2(this.GetShowLiterals(),null,!1),this.UpdateText(i)?(this._uIUpdate.SetText(this.Text),this._lastValue=t,!0):!1):i!=null&&i.isValid==!0?(this._uIProcess._format.Fields.SaveOldState(),i={},i.Text=this._uIProcess.GetShowText2(this.GetShowLiterals(),null,!1),this.UpdateText(i)?(this.UpdateDisplayText(this.Text),!0):!1):(this._uIProcess._format.Fields.RollBack(),!1)}return!1},f.prototype.SetDroppedDown=function(t){return t=n.Utility.CheckBool(t),this.GetEnabled()&&this.GetDropDownEnabled()&&this._droppedDown!==t&&(t?(this.PerformDropDown(),n.Utility.IsPad()||this.SetInnerFocus()):this.CloseDropDown()),this},f.prototype.PerformDropDown=function(){if(this.GetDropDownStyle()===n.DropDownStyle.Simple)return;if(!this.GetVisible())return;u.prototype.PerformDropDown.call(this);var i=this.GetDropDownObj(),t=i.GetSelectedIndex();t===-1&&(t=this._autoGetSelectedIndex(!1)),i._command.SetHoverRow(t),i._selectItemScroll(t),this._formatIsNull!==!0&&(this.UpdateDisplayText(this.Text),this.SelectAll())},f.prototype._resetSelected=function(){this._canSynSelection=!1;try{var n=this.GetSelectedIndex();this.SetSelectedIndex(-1),n!==-1&&this.FireClientEvent("SelectedIndexChanged",this.GetSelectedIndex().toString()),this._updateUI(),this._clearAllHighlightItem()}finally{this._canSynSelection=!0}},f.prototype.DoSpinDown=function(n,t){return this._DoSpin("down",n),this},f.prototype.DoSpinUp=function(n,t){return this._DoSpin("up",n),this},f.prototype._DoSpin=function(t,i){i=i===undefined?this.GetSpinIncrement():n.Utility.CheckInt(i);var r=this.Text;this._isMethodCall=!0;try{this.PerformSpinProcess(t,!1,i,!0)}finally{this._isMethodCall=!1}},f.prototype.UpdateText=function(t){var f,i,u,r,e;if(t==null)return!1;f="",t.Text!=null&&(f=t.Text);if(f!=this.Text&&this._specialClientEvents.TextChanging){i={},u={},u.Result=f,u.Cancel=!1,i.Name=this._specialClientEvents.TextChanging,i.Args=u,t.SelectionStart!=null&&(this._newSelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this._newSelectionEnd=t.SelectionEnd),r=this._uIProcess.GetSepText(),this.RollBack(),this.SetHideValue(),i.Name.IndexOf!=null&&i.Name.IndexOf(n.GcMask.AjaxEventHandlerName)>-1&&(this._uIProcess._format.Fields.ClearContent(),this._formatIsNull?this._uIProcess._format.Fields.SetText(r,!0):this._uIProcess.SetSepText(r)),e=this._uIProcess.FireEvent(this,i.Name,i.Args,"TextChanging"),i.Name.IndexOf!=null&&i.Name.IndexOf(n.GcMask.AjaxEventHandlerName)>-1&&(this._needSetHideValue=!1),e!=null&&(this._focusType=e);if(u.Cancel)return this.UpdateDisplayText(this.Text),this.SetSelection(this.SelectionStart,this.SelectionEnd),!1;this._uIProcess._format.Fields.ClearContent(),this._formatIsNull?this._uIProcess._format.Fields.SetText(r,!0):this._uIProcess.SetSepText(r)}return this.Text=f,this.Value=this._uIProcess._format.Fields.GetValue(),t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd),!0},f.prototype.UpdateDisplayText=function(t){this.GetTextBoxStyle()!==n.TextBoxStyle.ImageOnly&&(typeof this._needSetHideValue=="undefined"&&(this._needSetHideValue=!0),this._needSetHideValue&&u.prototype.UpdateDisplayText.call(this,t))},f.prototype.RollBack=function(){this._uIProcess._format.Fields.RollBack()},f.prototype.SetHideValue=function(){if(this._helpID!=null){var n=this._uIProcess.GetSepText();this._uIUpdate.SetHideText(n)}},f.prototype.GetCurrentValuesForAjax=function(){(this.SelectionStart>this.Text.GetLength()||this.SelectionEnd>this.Text.GetLength())&&(this.SelectionStart=0),this.SelectionEnd>this.Text.GetLength()&&(this.SelectionEnd=this.Text.GetLength());return this._uIProcess._format.Fields.GetText()+n.Utility.Sep4+this.SelectionStart+n.Utility.Sep4+this.SelectionEnd+n.Utility.Sep4+this.GetSelectedText()+n.Utility.Sep4+this.GetDroppedDown()+n.Utility.Sep4+this.GetCurrentField()+n.Utility.Sep4+this.GetEditMode()+n.Utility.Sep4+this._newSelectionStart+n.Utility.Sep4+this._newSelectionEnd},f.prototype._setEditHighlight=function(){if(n.Utility.IsPad())return;if(this._editHighlighted)return;this._editHighlighted=!0,this._highlighColorBackUp=this._realInputElement.style.backgroundColor,this._highlighBackgroundImageBackUp=this._realInputElement.style.backgroundImage,this._realInputElement.style.backgroundColor="transparent",this._realInputElement.style.backgroundImage="",n.Utility.IPad&&(this._realInputElement.style.webkitAppearance="none");var t=this._inputElementContainer.style;this.GetRealControlEffect()===n.ControlEffect.JQueryUI?(n.Utility.AddClass(this._inputElementContainer,"ui-state-highlight"),n.Utility.AddClass(this._realInputElement,"ui-state-highlight"),t.border="dotted 0px black"):(t.backgroundColor=n.Utility.HighlightColor,t.border=n.Utility.IsIE10OrLater?"dotted 0px black":"dotted 1px black",this._uIUpdate.SetForeColor("white")),this._layout()},f.prototype._clearEditHighlight=function(){if(n.Utility.IsPad())return;if(this._editHighlighted==!1)return;this._editHighlighted=!1,this._realInputElement.style.backgroundColor=this._highlighColorBackUp,this._realInputElement.style.backgroundImage=this._highlighBackgroundImageBackUp;var t=this._inputElementContainer.style;this.GetRealControlEffect()===n.ControlEffect.JQueryUI?(n.Utility.RemoveClass(this._inputElementContainer,"ui-state-highlight"),n.Utility.RemoveClass(this._realInputElement,"ui-state-highlight"),t.border=""):(t.backgroundColor="",t.border="",this._uIUpdate.SetForeColor(this.GetForeColor())),this.GetBorderContainer()==this._inputElementContainer&&u.prototype._updateBorder.call(this),this._layout()},f.prototype.SetInnerFocus=function(){this.GetDropDownStyle()!==n.DropDownStyle.DropDownList?u.prototype.SetInnerFocus.call(this):(this._focusType=n.FocusType.ClientEvent,this.SetFocus())},f.prototype._autoFilterItem=function(){var i=this,n=this._uIProcess.GetShowText2("PostDisplay",!0,!0),t;if(n==""||n.length-1&&s>r&&(f=n.GetSubItem(r).GetValue()),e=this._autoFilterSetting.MatchingFilter(f,t);else for(u=0;u0}return!1},f.ExactMatchStartWith=function(n,t){return n?n.startWith(t):!1},f.ExactMatchAll=function(n,t){return n?n.indexOf(t)!==-1:!1},f.prototype._closeFilter=function(){if(this._dropDownObj){var t=this.GetDropDownObj();t._data._filtering&&(t._data._filtering=!1,this._resetFilterState(),this.GetDropDownStyle()===n.DropDownStyle.DropDown&&t._adjustPositionAndHeightWhenFilter())}},f.prototype._resetFilterState=function(){if(this._dropDownObj===undefined)return;for(var n=0;n-1&&i0)for(f=0;f0)for(s+=r[0],o=1;o0)while(i=this._data._rowCount)break;this.GetItem(t).GetVisible()&&i++,t++}if(this._data._rowCount>0)while(ithis.GetTextSubItemIndex()&&this.GetTextSubItemIndex()>-1&&(e=this._items[r]._subItems[this.GetTextSubItemIndex()].GetValue()),u=e,n==!1&&(u=e.Substring(0,f.GetLength()));try{u=u.toLowerCase(),f=f.toLowerCase()}catch(s){}if(f==u)return r}for(r=0;rthis.GetTextSubItemIndex()&&this.GetTextSubItemIndex()>-1&&(e=this._items[r]._subItems[this.GetTextSubItemIndex()].GetValue()),u=e,n==!1&&(u=e.Substring(0,f.GetLength()));try{u=u.toLowerCase(),f=f.toLowerCase()}catch(s){}if(f==u)return r}}return-1},i.prototype._selectItemScroll=function(n){this._command.ScrollRowIntoView(n)},i.prototype.KeyDown=function(){},i.prototype.IsShortcut=function(n){return!0},i.prototype._overFlowTipClose=function(){this._command.CloseOverflowTip()},i.prototype.ResetLocation=function(n,t){this.Left=n,this.Top=t,this._dropDownElement&&this.AdjustPosition()},i.prototype.AdjustPosition=function(){var r=this._getDropDownHeight(),n=this._getDropDownWidth();this._resized&&(n=t.prototype.GetWidth.call(this),r=t.prototype.GetHeight.call(this),n+=2);var i=this._owner._getDropDownPos(n,r,this.GetAlign(),this._realZoom),f=i.Top.toString(),u=i.Left.toString();this._dropDownElement.style.left=u+"px",this._dropDownElement.style.top=f+"px"},i.prototype._ShouldJudgeEnabledStatus=function(){return this._owner._isMethodCall?!1:t.prototype._ShouldJudgeEnabledStatus.call(this)},i.prototype._getRealCSSWidth=function(){return this._resized?t.prototype.GetWidth.call(this)+2:this.DropDownWidth===""?this._owner._getRealCSSWidth():n.Utility.GetCSSLength(this.DropDownWidth)},i.prototype._getRealCSSHeight=function(){return this.GetHeight()+this._getRealBorderwidth()*2},i.prototype._MouseWheelProcess=function(n,t){for(var r=t,i=0;i0?this._command.GetPreviousSelectableItem(t):this._command.GetNextSelectableItem(t);this.SetTopIndex(r)},i.IsDebugList=!1,i}(n.GcListBox);n.ComboListBox=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(t){function i(n){t.call(this,n)}return __extends(i,t),i.prototype.ProcessShortcutKey=function(i,r,u){var f={};if(i!=null)switch(i.toLowerCase()){case n.KeyActions.Clear:return this._owner.GetDropDownStyle()!==n.DropDownStyle.DropDownList&&this._owner.GetReadOnly()!=!0&&this._owner.Clear(),f}return t.prototype.ProcessShortcutKey.call(this,i,r,u)},i.prototype.Cut=function(i,r,u){var f={};return this._owner.GetDropDownStyle()===n.DropDownStyle.DropDownList?f:f=t.prototype.Cut.call(this,i,r,u)},i.prototype.CompareShortcut=function(n,t){var i,r;if(t.toString().indexOf("|")==-1)return t==n?!0:!1;else{i=null;while(i!=-1){i=t.toString().indexOf("|"),r=t.length;if(t.substring(0,i==-1?r:i)==n)return!0;else t=t.substring(i+1,r)}return!1}},i.prototype.Paste=function(i,r,u,f,e){var o={};return this._owner.GetDropDownStyle()===n.DropDownStyle.DropDownList?o:(o=t.prototype.Paste.call(this,i,r,u,f,e),this._owner._closeFilter(),o)},i.prototype.KeyDown=function(i){var r=t.prototype.KeyDown.call(this,i);switch(i.KeyCode){case n.Key.Escape:this._owner.GetDroppedDown()||(r==null&&(r={}),r.System=!0);break}return r},i}(n.MaskUIProcess);n.ComboUIProcess=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var h=function(){function n(){}return n.GetEigenVector=function(n){var u=n.length,i,r,t;if(u==0)return null;for(i=[],i.push(0),r=1;r0&&!n[r].Equals(n[t]))t=i[t-1];n[r].Equals(n[t])?i.push(t+1):i.push(0)}return i},n.KMPSearching=function(n,t,i,r){var e=n.length,o=t.length,s=e-o,f,u;if(s-r<0)return-1;for(u=0,f=r;f0)u=i[u-1];t[u].Equals(n[f])&&u++;if(u==o)return f-u+1}return-1},n.StrToCharElements=function(n,t){var u=[],i,r;i=t!=null?new e(n.Substring(t)):new e(n);while(i.MoveNext())t!=null?(r=i.GetCurrent(),r.Offset(t),u.push(r)):u.push(i.GetCurrent());return u},n.MatchString=function(t,i,r){var h,o,s,u,c,e;if(t==null||t==""||i==null||i=="")return null;if(r!=null&&(r>=t.length||r<0))return null;h=n.StrToCharElements(i),o=r!=null?n.StrToCharElements(t,r):n.StrToCharElements(t),s=n.IndexOf(o,h,0);if(s>=0){for(u=[],u.length=h.length,c=s,e=0;e=0);return a},n.StartWith=function(t,i,r){var f,e,u;if(t==null||t==""||i==null||i=="")return!1;if(r!=null&&(r<0||r>=t.length))return!1;r==null&&(r=0),f=n.StrToCharElements(i),e=n.StrToCharElements(t);if(f.length>e.length-r)return!1;for(u=0;u=t.length)return u;o=n.StrToCharElements(i),f=n.StrToCharElements(t);if(o.length>f.length-r)return u;for(e=0;e=i)return!1;return this._currentStart+=this._currentLength,this._currentLength=1,this._currentStart>=i?!1:this._currentStart==i-1?!0:(n=this._str[this._currentStart],(n<"\uff76"||n>"\uff84")&&(n<"\uff8a"||n>"\uff8e")&&n!="\uff73"||(t=this._str[this._currentStart+1],(t=="\uff9e"||t=="\uff9f")&&this._currentLength++),!0)},n}(),u=function(){function n(n,t){n==null||n.length!=1&&n.length!=2||t<0||(this._element=n,this._startIndex=t)}return n.prototype.GetStartIndex=function(){return this._startIndex},n.prototype.GetElementLength=function(){return this._element.length},n.prototype.GetElement=function(){return this._element},n.prototype.Equals=function(t){var o,f,i,e,s,u;if(t!=null){o=this._element.length;switch(o){case 1:if(this._element.charCodeAt(0)-t.GetElement().charCodeAt(0)==0&&t.GetElementLength()==1)return!0;break;case 2:if(t.GetElementLength()==2&&(this._element.charCodeAt(0)-t.GetElement().charCodeAt(0)==0||this._element.charCodeAt(1)-t.GetElement().charCodeAt(1)==0))return!0;break;default:break}f=this.GetHashCode(),i=n._charElementConvertTableCachePool[f];if(i==null){i=[],e=o==1?r.CreateConvertedCharSet(this._element[0]).GetEnumerator():r.CreateConvertedCharSet(this._element[0],this._element[1]).GetEnumerator();while(e.MoveNext())i.push(e.GetCurrent());n._charElementConvertTableCachePool[f]=i}for(s=i.length,u=0;u>22)},n.prototype.Offset=function(n){this._startIndex+=n},n._charElementConvertTableCachePool={},n}(),n.CharElement=u,f=function(){function n(n){this._startIndex=-1,this._length=-1,n!=null&&n.length>0&&(this._elements=n)}return n.prototype.GetStartIndex=function(){return this._startIndex<0&&(this._startIndex=this._elements[0].GetStartIndex()),this._startIndex},n.prototype.GetLength=function(){return this._length<0&&this.GetCachedData(),this._length},n.prototype.GetMatchString=function(){return this._matchString!=null&&this._matchString!=""&&this.GetCachedData(),this._matchString},n.prototype.GetCachedData=function(){for(var i=0,r="",t,n=0;n=i.End?(this._step=i.End,!1):!0},t.prototype.GetCurrent=function(){var u=n.CharProcess.CharEx,r=this._owner.GetSeed(),t;switch(this._step){case i.Start:case i.End:return null;case i.HalfFull:return t=u.IsFullWidth(r)?u.ToHalfWidth(r):u.ToFullWidth(r).text;default:return null}},t}(),v=function(){function i(n){this._step=t.Start,n!=null&&(this._owner=n)}return i.prototype.Reset=function(){this._step=t.Start},i.prototype.MoveNext=function(){return this._step++,this._step>=t.End?(this._step=t.End,!1):!0},i.prototype.GetCurrent=function(){var r=n.CharProcess.CharEx,i=this._owner.GetSeed(),u;switch(this._step){case t.Start:case t.End:return null;case t.LowerUpper:return r.IsLower(i)?i.toUpperCase():i.toLowerCase();case t.HalfFull:return r.IsFullWidth(i)?r.ToHalfWidth(i):r.ToFullWidth(i).text;case t.LowerUpperThenHalfFull:return u=r.IsLower(i)?i.toUpperCase():i.toLowerCase(),r.IsFullWidth(u)?r.ToHalfWidth(u):r.ToFullWidth(u).text;default:return null}},i}(),s=function(){function t(t){var i,u,f,r;t!=null&&(i=[],u=t.GetSeed(),n.CharProcess.CharEx.IsHiragana(u[0])?(f=u[0],this.AddHiraganaItems(f,i),f=n.CharProcess.CharEx.ToKatakana(f),this.AddFullKatakana(f,i),this.AddHalfKatakana(n.CharProcess.CharEx.ToHalfWidthEx(f),i)):n.CharProcess.CharEx.IsFullWidth(u[0])?(r=u[0],this.AddFullKatakana(r,i),this.AddHalfKatakana(n.CharProcess.CharEx.ToHalfWidthEx(r),i),r=n.CharProcess.CharEx.ToHiragana(r),this.AddHiraganaItems(r,i)):(this.AddHalfKatakana(u,i),r=n.CharProcess.CharEx.ToFullWidth(u).text,this.AddFullKatakana(r,i),u.length==2&&u[0]=="\uff73"&&u[1]=="\uff9e"?i.push("\u3046\u309b"):(r=n.CharProcess.CharEx.ToHiragana(r),this.AddHiraganaItems(r,i))),this._items=i,this._currentIndex=-1)}return t.prototype.AddHiraganaItems=function(t,i){i.push(t),n.CharProcess.CharEx.IsLowerKana(t)?i.push(n.CharProcess.CharEx.ToUpperKana(t)):n.CharProcess.CharEx.HasLowerKana(t)&&i.push(n.CharProcess.CharEx.ToLowerKana(t))},t.prototype.AddFullKatakana=function(t,i){i.push(t),n.CharProcess.CharEx.IsLowerKana(t)?i.push(n.CharProcess.CharEx.ToUpperKana(t)):n.CharProcess.CharEx.HasLowerKana(t)&&i.push(n.CharProcess.CharEx.ToLowerKana(t))},t.prototype.AddHalfKatakana=function(t,i){i.push(t),n.CharProcess.CharEx.IsLowerKana(t[0])?(t[0]=n.CharProcess.CharEx.ToUpperKana(t[0]),i.push(t)):n.CharProcess.CharEx.HasLowerKana(t[0])&&(t[0]=n.CharProcess.CharEx.ToLowerKana(t[0]),i.push(t))},t.prototype.GetCurrent=function(){return this._currentIndex<0||this._currentIndex>=this._items.length?null:this._items[this._currentIndex]},t.prototype.Reset=function(){this._currentIndex=-1},t.prototype.MoveNext=function(){return this._currentIndex++,this._currentIndex