@magic-xpa/gui 4.702.0 → 4.800.0-dev000.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/magic-xpa-gui.umd.js +1100 -7518
- package/bundles/magic-xpa-gui.umd.js.map +1 -1
- package/bundles/magic-xpa-gui.umd.min.js +2 -2
- package/bundles/magic-xpa-gui.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/magic-xpa-gui.js +1 -4
- package/esm2015/src/Commands.js +11 -114
- package/esm2015/src/Events.js +1 -517
- package/esm2015/src/EventsProcessor.js +1 -51
- package/esm2015/src/FocusManager.js +1 -13
- package/esm2015/src/GuiConstants.js +2 -11
- package/esm2015/src/GuiEnums.js +127 -130
- package/esm2015/src/GuiEnvironment.js +1 -1
- package/esm2015/src/IFlowMonitorQueue.js +1 -1
- package/esm2015/src/Manager.js +10 -148
- package/esm2015/src/UIBridge.js +1 -6
- package/esm2015/src/env/IEnvironment.js +1 -1
- package/esm2015/src/gui/ControlBase.js +1 -1
- package/esm2015/src/gui/GuiMgControl.js +1 -94
- package/esm2015/src/gui/GuiMgForm.js +1 -1
- package/esm2015/src/gui/KeyboardItem.js +5 -46
- package/esm2015/src/gui/LastFocusedVal.js +1 -5
- package/esm2015/src/gui/MgValue.js +1 -1
- package/esm2015/src/gui/PropParentInterface.js +1 -1
- package/esm2015/src/gui/low/DialogHandler.js +1 -10
- package/esm2015/src/gui/low/GuiCommand.js +1 -12
- package/esm2015/src/gui/low/GuiCommandQueue.js +1 -66
- package/esm2015/src/gui/low/GuiInteractive.js +8 -465
- package/esm2015/src/gui/low/Style.js +1 -9
- package/esm2015/src/management/RuntimeContextBase.js +11 -14
- package/esm2015/src/management/data/BlobType.js +0 -0
- package/esm2015/src/management/data/DcValues.js +8 -67
- package/esm2015/src/management/data/DcValuesBuilderBase.js +2 -37
- package/esm2015/src/management/data/FieldDef.js +1 -95
- package/esm2015/src/management/data/FieldsTable.js +2 -28
- package/esm2015/src/management/data/GuiDataViewBase.js +33 -72
- package/esm2015/src/management/data/GuiFieldBase.js +4 -39
- package/esm2015/src/management/data/IRecord.js +1 -1
- package/esm2015/src/management/data/IReferencedObject.js +1 -8
- package/esm2015/src/management/data/NUM_TYPE.js +14 -485
- package/esm2015/src/management/data/ObjectReferenceBase.js +1 -3
- package/esm2015/src/management/data/ObjectReferencesCollection.js +1 -2
- package/esm2015/src/management/data/RecordUtils.js +6 -112
- package/esm2015/src/management/data/VectorType.js +17 -252
- package/esm2015/src/management/data/VectorTypeBase.js +1 -35
- package/esm2015/src/management/events/IActionManager.js +1 -1
- package/esm2015/src/management/events/IGuiEventsManager.js +1 -1
- package/esm2015/src/management/exp/ExpressionInterface.js +5 -3
- package/esm2015/src/management/exp/GuiExpressionEvaluator.js +38 -155
- package/esm2015/src/management/gui/ControlTable.js +18 -72
- package/esm2015/src/management/gui/DisplayConvertor.js +43 -493
- package/esm2015/src/management/gui/FieldValidator.js +58 -339
- package/esm2015/src/management/gui/GuiControlPropertyAdapter.js +1 -1
- package/esm2015/src/management/gui/GuiFormPropertyAdapter.js +1 -8
- package/esm2015/src/management/gui/HebrewDate.js +3 -140
- package/esm2015/src/management/gui/Helps.js +2 -48
- package/esm2015/src/management/gui/MgControlBase.js +160 -874
- package/esm2015/src/management/gui/MgFormBase.js +68 -407
- package/esm2015/src/management/gui/PIC.js +58 -285
- package/esm2015/src/management/gui/PropDefaults.js +13 -48
- package/esm2015/src/management/gui/PropInterface.js +3 -4
- package/esm2015/src/management/gui/PropTable.js +72 -183
- package/esm2015/src/management/gui/Property.js +40 -373
- package/esm2015/src/management/gui/ValidationDetails.js +10 -52
- package/esm2015/src/management/gui/ValidationDetailsBase.js +12 -45
- package/esm2015/src/management/gui/WrongFormatException.js +1 -15
- package/esm2015/src/management/tasks/GuiDataCollection.js +1 -1
- package/esm2015/src/management/tasks/GuiTaskBase.js +38 -383
- package/esm2015/src/management/tasks/IMGDataTable.js +1 -1
- package/esm2015/src/management/tasks/ITask.js +1 -1
- package/esm2015/src/management/tasks/MgTimer.js +1 -16
- package/esm2015/src/management/tasks/TaskDefinitionId.js +8 -18
- package/esm2015/src/management/tasks/TaskDefinitionIdTableSaxHandler.js +1 -13
- package/esm2015/src/util/AuthenticationDialogHandler.js +1 -4
- package/esm2015/src/util/MemoryUtil.js +1 -41
- package/esm2015/src/util/ObjectReference.js +1 -8
- package/esm2015/src/util/ProcessLauncher.js +3 -21
- package/esm2015/src/util/UsernamePasswordCredentials.js +1 -9
- package/fesm2015/magic-xpa-gui.js +881 -7051
- package/fesm2015/magic-xpa-gui.js.map +1 -1
- package/magic-xpa-gui.d.ts +0 -3
- package/package.json +2 -2
- package/src/Commands.d.ts +2 -0
- package/src/Events.d.ts +0 -2
- package/src/GuiEnums.d.ts +127 -129
- package/src/env/IEnvironment.d.ts +3 -0
- package/src/gui/GuiMgControl.d.ts +1 -0
- package/src/gui/PropParentInterface.d.ts +1 -1
- package/src/gui/low/GuiInteractive.d.ts +3 -1
- package/src/gui/low/Style.d.ts +0 -3
- package/src/management/RuntimeContextBase.d.ts +2 -0
- package/src/management/data/GuiDataViewBase.d.ts +4 -4
- package/src/management/data/IRecord.d.ts +1 -1
- package/src/management/exp/ExpressionInterface.d.ts +4 -0
- package/src/management/exp/GuiExpressionEvaluator.d.ts +4 -6
- package/src/management/gui/ControlTable.d.ts +1 -1
- package/src/management/gui/DisplayConvertor.d.ts +1 -1
- package/src/management/gui/GuiControlPropertyAdapter.d.ts +1 -1
- package/src/management/gui/MgControlBase.d.ts +8 -7
- package/src/management/gui/MgFormBase.d.ts +6 -6
- package/src/management/gui/PIC.d.ts +1 -0
- package/src/management/gui/PropInterface.d.ts +3 -4
- package/src/management/gui/PropTable.d.ts +4 -5
- package/src/management/gui/Property.d.ts +1 -1
- package/src/management/tasks/GuiTaskBase.d.ts +8 -14
- package/src/management/tasks/TaskDefinitionId.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@magic-xpa/mscorelib"),require("@magic-xpa/utils"),require("util"),require("rxjs")):"function"==typeof define&&define.amd?define("@magic-xpa/gui",["exports","@magic-xpa/mscorelib","@magic-xpa/utils","util","rxjs"],e):e(((t=t||self)["magic-xpa"]=t["magic-xpa"]||{},t["magic-xpa"].gui={}),t.mscorelib,t.utils,t.util,t.rxjs)}(this,(function(t,e,r,n,i){"use strict";
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@magic-xpa/mscorelib"),require("@magic-xpa/utils"),require("util"),require("rxjs")):"function"==typeof define&&define.amd?define("@magic-xpa/gui",["exports","@magic-xpa/mscorelib","@magic-xpa/utils","util","rxjs"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self)["magic-xpa"]=t["magic-xpa"]||{},t["magic-xpa"].gui={}),t.mscorelib,t.utils,t.util,t.rxjs)}(this,(function(t,e,r,n,i){"use strict";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function a(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function s(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{_(n.next(t))}catch(t){o(t)}}function s(t){try{_(n.throw(t))}catch(t){o(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}_((n=n.apply(t,e||[])).next())}))}function _(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}var P=function(){this.str=null,this.caption=null,this.title=null,this.path=null,this.filter=null,this.boolVal=!1,this.bool1=!1,this.style=0,this.number=0,this.obj=null,this.listOfIntArr=null},h=function(){},T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(h),E=function(){function t(){}return t.OnFocus=function(r,n,i,o){e.Debug.Assert(null!==t.FocusEvent),t.FocusEvent(r,n,i,o)},t.OnFocusOnNonMagicControl=function(r){e.Debug.Assert(null!==t.FocusOnNonMagicControlEvent),t.FocusOnNonMagicControlEvent(r)},t.OnMouseDown=function(r,n,i,o,a,s,_){e.Debug.Assert(null!==t.MouseDownEvent),t.MouseDownEvent(r,n,i,o,a,s,_)},t.OnNonParkableLastParkedCtrl=function(e){null!==t.NonParkableLastParkedCtrlEvent&&t.NonParkableLastParkedCtrlEvent(e)},t.OnTableReorder=function(e,r){null!==t.TableReorderEvent&&t.TableReorderEvent(e,r)},t.OnMouseUp=function(e,r){null!==t.MouseUpEvent&&t.MouseUpEvent(e,r)},t.OnComboDroppingDown=function(r,n){e.Debug.Assert(null!==t.ComboDroppingDownEvent),t.ComboDroppingDownEvent(r,n)},t.OnSelection=function(r,n,i,o){e.Debug.Assert(null!==t.SelectionEvent),t.SelectionEvent(r,n,i,o)},t.OnDblClick=function(r,n){e.Debug.Assert(null!==t.DblClickEvent),t.DblClickEvent(r,n)},t.OnKeyDown=function(e,r,n,i,o,a,s,_,l,u,c){11===arguments.length?t.OnKeyDown_0(e,r,n,i,o,a,s,_,l,u,c):10===arguments.length?t.OnKeyDown_1(e,r,n,i,o,a,s,_,l,u):t.OnKeyDown_2(e,r,n,i,o,a,s)},t.OnKeyDown_0=function(r,n,i,o,a,s,_,l,u,c,P){e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,a,s,_,l,u,c,P)},t.OnMultiMarkHit=function(r,n,i){e.Debug.Assert(null!==t.MultimarkHitEvent),t.MultimarkHitEvent(r,n,i)},t.OnKeyDown_1=function(r,n,i,o,a,s,_,l,u,c){return e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,a,s,_,l,u,!1,c)},t.OnKeyDown_2=function(r,n,i,o,a,s,_){return e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,0,0,null,!1,a,s,_)},t.OnFormClose=function(r){return e.Debug.Assert(null!==t.CloseFormEvent),t.CloseFormEvent(r)},t.OnDispose=function(r){e.Debug.Assert(null!==t.DisposeEvent),t.DisposeEvent(r)},t.OnTimer=function(r){e.Debug.Assert(null!==t.TimerEvent),t.TimerEvent(r)},t.OnTableResize=function(e,r){null!==t.TableResizeEvent&&t.TableResizeEvent(e,r)},t.OnGetRowsData=function(e,r,n,i){null!==t.GetRowsDataEvent&&t.GetRowsDataEvent(e,r,n,i)},t.OnColumnClick=function(r,n,i){e.Debug.Assert(null!==t.ColumnClickEvent),t.ColumnClickEvent(r,n,i)},t.RefreshTables=function(){null!==t.RefreshTablesEvent&&t.RefreshTablesEvent()},t.OnCloseHelp=function(e){null!==t.HelpCloseEvent&&t.HelpCloseEvent(e)},t.IsBatchRunningInMainContext=function(){var e=!1;return null!==t.IsBatchRunningInMainContextEvent&&(e=t.IsBatchRunningInMainContextEvent()),e},t.Translate=function(r){return e.Debug.Assert(null!==t.TranslateEvent),null!==r&&r.length>0?t.TranslateEvent(r):r},t.OnPrintPreviewStart=function(e,r,n,i,o){null!==t.PrintPreviewStartEvent&&t.PrintPreviewStartEvent(e,r,n,i,o)},t.OnPrintPreviewSetCursor=function(e){null!==t.PrintPreviewSetCursorEvent&&t.PrintPreviewSetCursorEvent(e)},t.InvokeUDP=function(e){var r=0;return null!==t.InvokeUDPEvent&&(r=t.InvokeUDPEvent(e)),r},t.OnPrintPreviewUpdate=function(e){null!==t.PrintPreviewUpdateEvent&&t.PrintPreviewUpdateEvent(e)},t.OnCreateRichWindow=function(e,r,n,i,o){null!==t.CreateRichWindowEvent&&t.CreateRichWindowEvent(e,r,n,i,o)},t.OnCreateGuiWindow=function(e,r,n,i,o,a,s,_,l,u,c,P){var h=0;return null!==t.CreateGuiWindowEvent&&(h=t.CreateGuiWindowEvent(e,r,n,i,o,a,s,_,l,u,c,P)),h},t.OnDestroyGuiWindow=function(e){null!==t.DestroyGuiWindowEvent&&t.DestroyGuiWindowEvent(e)},t.OnPrintPreviewClose=function(e){null!==t.PrintPreviewCloseEvent&&t.PrintPreviewCloseEvent(e)},t.OnShowPrintDialog=function(e){var r=0;return null!==t.ShowPrintDialogEvent&&(r=t.ShowPrintDialogEvent(e)),r},t.DisplaySessionStatistics=function(){null!==t.DisplaySessionStatisticsEvent&&t.DisplaySessionStatisticsEvent()},t.ShouldBlockMouseEvents=function(e){return null!==t.ShouldBlockMouseEventsEvent&&t.ShouldBlockMouseEventsEvent(e)},t.PeekEndOfWork=function(){return null!==t.PeekEndOfWorkEvent&&t.PeekEndOfWorkEvent()},t.GetEventTime=function(){return null!==t.GetEventTimeEvent?t.GetEventTimeEvent():0},t.OnScrollTable=function(e,r,n,i,o,a){var s=!1;return null!==t.ScrollTableEvent&&(s=t.ScrollTableEvent(e,r,n,i,o,a)),s},t.GetDropUserFormats=function(){return e.Debug.Assert(null!==t.GetDropUserFormatsEvent),t.GetDropUserFormatsEvent()},t.GetContextID=function(r){var n=-1;return e.Debug.Assert(null!==r),null!==t.GetContextIDEvent&&(n=t.GetContextIDEvent(r)),n},t.SetModal=function(e,r){null!==t.SetModalEvent&&t.SetModalEvent(e,r)},t.OnShowForm=function(e){null!==t.ShowFormEvent&&t.ShowFormEvent(e)},t.OnFormActivate=function(e){null!==t.OnFormActivateEvent&&t.OnFormActivateEvent(e)},t.OnNCActivate=function(e){null!==t.OnNCActivateEvent&&t.OnNCActivateEvent(e)},t.HandleKeyUpMessage=function(e,r){null!==t.HandleKeyUpMessageEvent&&t.HandleKeyUpMessageEvent(e,r)},t.IsLogonRTL=function(){var e=!1;return null!==t.OnIsLogonRTLEvent&&(e=t.OnIsLogonRTLEvent()),e},t.IsSpecialEngLogon=function(){var e=!1;return null!==t.OnIsSpecialEngLogonEvent&&(e=t.OnIsSpecialEngLogonEvent()),e},t.IsSpecialIgnoreButtonFormat=function(){var e=!1;return null!==t.OnIsSpecialIgnoreButtonFormatEvent&&(e=t.OnIsSpecialIgnoreButtonFormatEvent()),e},t.GetMainProgram=function(r,n){return e.Debug.Assert(null!==t.GetMainProgramEvent),t.GetMainProgramEvent(r,n)},t.TranslateLogicalName=function(r){return e.Debug.Assert(null!==t.TranslateLogicalNameEvent),t.TranslateLogicalNameEvent(r)},t.GetMessageString=function(r){e.Debug.Assert(null!==t.GetMessageStringEvent);var n=t.GetMessageStringEvent(r),i=t.Translate(n);if(null!==i&&i.endsWith(":")){var o=void 0;(o=new e.StringBuilder(i)).Insert(i.length," "),i=o.ToString()}return i},t.OnCtrlFocus=function(e,r){null!==t.CtrlFocusEvent&&t.CtrlFocusEvent(e,r)},t.GetCurrentTask=function(){return null!==t.GetCurrentTaskEvent?t.GetCurrentTaskEvent():null},t.GetRuntimeContext=function(r){return e.Debug.Assert(null!==t.GetRuntimeContextEvent),t.GetRuntimeContextEvent(r)},t.SaveLastClickedCtrlName=function(e,r){null!==t.SaveLastClickedCtrlEvent&&t.SaveLastClickedCtrlEvent(e,r)},t.SaveLastClickInfo=function(e,r,n,i,o,a,s){null!==t.SaveLastClickInfoEvent&&t.SaveLastClickInfoEvent(e,r,n,i,o,a,s)},t.WriteErrorToLog=function(r){e.Debug.Assert(null!==t.WriteErrorToLogEvent),t.WriteErrorToLogEvent(r)},t.WriteExceptionToLog=function(e){1!==arguments.length||null!==e&&e.constructor!==String?t.WriteExceptionToLog_1(e):t.WriteExceptionToLog_0(e)},t.WriteExceptionToLog_0=function(r){e.Debug.Assert(null!==t.WriteErrorToLogEvent),t.WriteErrorToLogEvent(r)},t.WriteExceptionToLog_1=function(n){t.WriteExceptionToLog(e.NString.Format("{0} : {1}{2}{3}{4}",[n.GetType(),r.OSEnvironment.EolSeq,n.StackTrace,r.OSEnvironment.EolSeq,n.Message]))},t.WriteWarningToLog=function(e){1!==arguments.length||null!==e&&e.constructor!==String?t.WriteWarningToLog_1(e):t.WriteWarningToLog_0(e)},t.WriteWarningToLog_0=function(r){e.Debug.Assert(null!==t.WriteWarningToLogEvent),t.WriteWarningToLogEvent(r)},t.WriteWarningToLog_1=function(e){t.WriteWarningToLog(e.GetType()+" : "+r.OSEnvironment.EolSeq+e.StackTrace+r.OSEnvironment.EolSeq+e.Message)},t.ShouldLog=function(r){return e.Debug.Assert(null!==t.ShouldLogEvent),t.ShouldLogEvent(r)},t.WriteGuiToLog=function(r){e.Debug.Assert(null!==t.WriteGuiToLogEvent),t.WriteGuiToLogEvent("GUI: "+r)},t.WriteDevToLog=function(r){e.Debug.Assert(null!==t.WriteDevToLogEvent),t.WriteDevToLogEvent(r)},t.OnClear=function(e){null!==t.ClearEvent&&t.ClearEvent(e)},t.OnUndo=function(e){null!==t.UndoEvent&&t.UndoEvent(e)},t.AddEnterAsKeyEvent=function(){return null!==t.ShouldAddEnterAsKeyEvent&&t.ShouldAddEnterAsKeyEvent()},t.ShowSessionStatisticsForm=function(){null!==t.ShowSessionStatisticsEvent&&t.ShowSessionStatisticsEvent()},t.OnCopyData=function(e,r){null!==t.CopyDataEvent&&t.CopyDataEvent(e,r)},t}();E.NonParkableLastParkedCtrlEvent=null,E.IsBatchRunningInMainContextEvent=null,E.TranslateEvent=null,E.PrintPreviewStartEvent=null,E.PrintPreviewSetCursorEvent=null,E.InvokeUDPEvent=null,E.PrintPreviewUpdateEvent=null,E.CreateRichWindowEvent=null,E.CreateGuiWindowEvent=null,E.DestroyGuiWindowEvent=null,E.PrintPreviewCloseEvent=null,E.ShowPrintDialogEvent=null,E.SetModalEvent=null,E.CtrlFocusEvent=null,E.GetCurrentTaskEvent=null,E.GetRuntimeContextEvent=null,E.SaveLastClickedCtrlEvent=null,E.SaveLastClickInfoEvent=null,E.WriteErrorToLogEvent=null,E.WriteExceptionToLogEvent=null,E.WriteWarningToLogEvent=null,E.ShouldLogEvent=null,E.WriteGuiToLogEvent=null,E.WriteDevToLogEvent=null,E.ClearEvent=null,E.UndoEvent=null,E.ShouldAddEnterAsKeyEvent=null,E.ShowSessionStatisticsEvent=null,E.CopyDataEvent=null,E.FocusEvent=null,E.FocusOnNonMagicControlEvent=null,E.MouseDownEvent=null,E.TableReorderEvent=null,E.MouseUpEvent=null,E.ComboDroppingDownEvent=null,E.SelectionEvent=null,E.DblClickEvent=null,E.KeyDownEvent=null,E.MultimarkHitEvent=null,E.CloseFormEvent=null,E.DisposeEvent=null,E.TimerEvent=null,E.TableResizeEvent=null,E.GetRowsDataEvent=null,E.EnableCutCopyEvent=null,E.EnablePasteEvent=null,E.ColumnClickEvent=null,E.RefreshTablesEvent=null,E.HelpCloseEvent=null,E.DisplaySessionStatisticsEvent=null,E.ShouldBlockMouseEventsEvent=null,E.PeekEndOfWorkEvent=null,E.GetEventTimeEvent=null,E.ScrollTableEvent=null,E.GetDropUserFormatsEvent=null,E.GetContextIDEvent=null,E.ShowFormEvent=null,E.OnFormActivateEvent=null,E.OnNCActivateEvent=null,E.HandleKeyUpMessageEvent=null,E.OnIsLogonRTLEvent=null,E.OnIsSpecialEngLogonEvent=null,E.OnIsSpecialIgnoreButtonFormatEvent=null,E.GetMainProgramEvent=null,E.TranslateLogicalNameEvent=null,E.GetMessageStringEvent=null;var p,I=function(){function t(){this.getInteractiveCallback=null,this.executeCommandsCallback=null}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.ExecuteInteractiveCommand=function(t){return null!=this.getInteractiveCallback?this.getInteractiveCallback(t):""},t.prototype.executeCommands=function(t){null!=this.executeCommandsCallback&&null!=t&&this.executeCommandsCallback(t)},t.prototype.registerInteractiveCallback=function(t){this.getInteractiveCallback=t},t.prototype.registerExecuteCommandsCallback=function(t){this.executeCommandsCallback=t},t.prototype.saveData=function(t){console.log(t)},t}(),f=function(){function t(){this._commandsQueue=null,this._executingGuiCommands=!1,this.init()}return t.getInstance=function(){return null===t._instance&&(t._instance=new t),t._instance},t.prototype.init=function(){this._commandsQueue=new Array},t.prototype.addCommand=function(t){this.put(t)},t.prototype.put=function(t){this._commandsQueue.push(t)},t.prototype.beginInvoke=function(){this.invoke()},t.prototype.invoke=function(){this._executingGuiCommands||(this._executingGuiCommands=!0,I.getInstance().executeCommands(this._commandsQueue),this._commandsQueue.length=0,this._executingGuiCommands=!1)},t}();f._instance=null,(p=t.InteractiveCommandType||(t.InteractiveCommandType={}))[p.GET_FONT_METRICS=0]="GET_FONT_METRICS",p[p.GET_RESOLUTION=1]="GET_RESOLUTION",p[p.GET_BOUNDS=2]="GET_BOUNDS",p[p.GET_VALUE=3]="GET_VALUE",p[p.SET_BROWSER_TEXT=4]="SET_BROWSER_TEXT",p[p.GET_BROWSER_TEXT=5]="GET_BROWSER_TEXT",p[p.BROWSER_EXECUTE=6]="BROWSER_EXECUTE",p[p.GET_TOP_INDEX=7]="GET_TOP_INDEX",p[p.MESSAGE_BOX=8]="MESSAGE_BOX",p[p.SET_TITLE=9]="SET_TITLE",p[p.DIRECTORY_DIALOG_BOX=10]="DIRECTORY_DIALOG_BOX",p[p.GET_CLIENT_BOUNDS=11]="GET_CLIENT_BOUNDS",p[p.SET_EDIT_TEXT=12]="SET_EDIT_TEXT",p[p.INSERT_EDIT_TEXT=13]="INSERT_EDIT_TEXT",p[p.SET_SELECTION=14]="SET_SELECTION",p[p.GET_SELECTION=15]="GET_SELECTION",p[p.GET_CARET_POS=16]="GET_CARET_POS",p[p.REFRESH_PAGE=17]="REFRESH_PAGE",p[p.GET_IS_TOP_OF_TEXTBOX=18]="GET_IS_TOP_OF_TEXTBOX",p[p.GET_IS_END_OF_TEXTBOX=19]="GET_IS_END_OF_TEXTBOX",p[p.CLIPBOARD_GET_CONTENT=20]="CLIPBOARD_GET_CONTENT",p[p.CLIPBOARD_SET_CONTENT=21]="CLIPBOARD_SET_CONTENT",p[p.CLIPBOARD_PASTE=22]="CLIPBOARD_PASTE",p[p.POST_KEY_EVENT=23]="POST_KEY_EVENT",p[p.POST_CHAR_EVENT=24]="POST_CHAR_EVENT",p[p.SET_CURSOR=25]="SET_CURSOR",p[p.DISPOSE_ALL_FORMS=26]="DISPOSE_ALL_FORMS",p[p.GET_ROWS_IN_PAGE=27]="GET_ROWS_IN_PAGE",p[p.GET_HIDDEN_ROWS_COUNT_IN_TABLE=28]="GET_HIDDEN_ROWS_COUNT_IN_TABLE",p[p.FILE_OPEN_DIALOG_BOX=29]="FILE_OPEN_DIALOG_BOX",p[p.FILE_SAVE_DIALOG_BOX=30]="FILE_SAVE_DIALOG_BOX",p[p.CREATE_DIALOG=31]="CREATE_DIALOG",p[p.OPEN_DIALOG=32]="OPEN_DIALOG",p[p.CLOSE_DIALOG=33]="CLOSE_DIALOG",p[p.SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA=34]="SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA",p[p.REFLECTION_INVOKE=35]="REFLECTION_INVOKE",p[p.REFLECTION_SET=36]="REFLECTION_SET",p[p.GET_LAST_WINDOW_STATE=37]="GET_LAST_WINDOW_STATE",p[p.GET_FRAMES_BOUNDS=38]="GET_FRAMES_BOUNDS",p[p.GET_LINKED_PARENT_IDX=39]="GET_LINKED_PARENT_IDX",p[p.GET_FORM_BOUNDS=40]="GET_FORM_BOUNDS",p[p.GET_COLUMNS_STATE=41]="GET_COLUMNS_STATE",p[p.GET_FORM_HANDLE=42]="GET_FORM_HANDLE",p[p.GET_CTRL_HANDLE=43]="GET_CTRL_HANDLE",p[p.IS_FORM_ACTIVE=44]="IS_FORM_ACTIVE",p[p.SET_MARKED_TEXT_ON_RICH_EDIT=45]="SET_MARKED_TEXT_ON_RICH_EDIT",p[p.SEND_IME_MSG=46]="SEND_IME_MSG",p[p.CAN_FOCUS=47]="CAN_FOCUS",p[p.INVOKE_OSCOMMAND=48]="INVOKE_OSCOMMAND",p[p.GET_SELECTED_INDICE=49]="GET_SELECTED_INDICE",p[p.SET_SUGGESTED_VALUE=50]="SET_SUGGESTED_VALUE",p[p.MAP_WIDGET_TO_GUI_OBJECT=51]="MAP_WIDGET_TO_GUI_OBJECT",p[p.REMOVE_DN_CONTROL_VALUE_CHANGED_HANDLER=52]="REMOVE_DN_CONTROL_VALUE_CHANGED_HANDLER",p[p.ADD_DN_CONTROL_VALUE_CHANGED_HANDLER=53]="ADD_DN_CONTROL_VALUE_CHANGED_HANDLER",p[p.GET_RTF_VALUE_BEFORE_ENTERING_CONTROL=54]="GET_RTF_VALUE_BEFORE_ENTERING_CONTROL",p[p.ATTACH_DNKEY_TO_OBJECT=55]="ATTACH_DNKEY_TO_OBJECT",p[p.GET_DVCONTROL_POSITION_ISN=56]="GET_DVCONTROL_POSITION_ISN",p[p.CLEAR_DATA_TABLE=57]="CLEAR_DATA_TABLE",p[p.SET_DATA_SOURCE_TO_DVCONTROL=58]="SET_DATA_SOURCE_TO_DVCONTROL",p[p.ACTIVATE_FORM=59]="ACTIVATE_FORM",p[p.IS_COMBO_DROPPED_DOWN=60]="IS_COMBO_DROPPED_DOWN",p[p.OPEN_FORM_DESIGNER=61]="OPEN_FORM_DESIGNER",p[p.INVOKE_UDPCOMMAND=62]="INVOKE_UDPCOMMAND",p[p.GET_HASINDENT=63]="GET_HASINDENT",p[p.GET_IS_ROW_EDITING=64]="GET_IS_ROW_EDITING",p[p.GET_MAX_ROWS_IN_PAGINATED_TABLE=65]="GET_MAX_ROWS_IN_PAGINATED_TABLE",p[p.CALL_JS=66]="CALL_JS";var O=function(){function e(){this._commandType=0,this.TaskTag=null,this.controlName=null,this._x=0,this._y=0,this._char=null,this._str=String.fromCharCode(0),this._intVal1=0,this._line=0,this._obj1=null,this._parameters=null,this._boolVal=!1,this._obj2=null,this._mgValue=null,this._setValue=!1,this.resultString=String.fromCharCode(0)}return e.prototype.canFocus=function(e){return this._commandType=t.InteractiveCommandType.CAN_FOCUS,this._obj1=e,this._mgValue=new P,this.Invoke(),this._mgValue.boolVal},e.prototype.GetSelectedIndice=function(e){return this._commandType=t.InteractiveCommandType.GET_SELECTED_INDICE,this._obj1=e,this._mgValue=new P,this.Invoke(),this._mgValue.str},e.prototype.GetHasIndent=function(e){return this._commandType=t.InteractiveCommandType.GET_HASINDENT,this._obj1=e,this.Invoke(),this._boolVal},e.prototype.setGetSuggestedValueOfChoiceControlOnTagData=function(e,r,n){this._commandType=t.InteractiveCommandType.SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA,this._obj2=e,this._line=r,this._boolVal=n,this.Invoke()},e.prototype.getValue=function(e,r){return this._commandType=t.InteractiveCommandType.GET_VALUE,this._obj2=e,this._line=r,this._mgValue=new P,this.Invoke(),this._mgValue.obj},e.prototype.getTopIndex=function(e){return this._commandType=t.InteractiveCommandType.GET_TOP_INDEX,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getIsRowEditing=function(e,r,n){return this._commandType=t.InteractiveCommandType.GET_IS_ROW_EDITING,this._obj2=e,this._intVal1=r,this._boolVal=n,this.Invoke(),this._boolVal},e.prototype.browserExecute=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.BROWSER_EXECUTE,this._obj2=e,this._mgValue=new P,this._mgValue.str=r,this._mgValue.obj=i,!n||(this.Invoke(),this._mgValue.boolVal)},e.prototype.messageBox=function(e,r,n){return this._commandType=t.InteractiveCommandType.MESSAGE_BOX,this._mgValue=new P,this._mgValue.title=e,this._mgValue.str=null===r?"":r,this._mgValue.style=n,E.RefreshTables(),this.Invoke(),this._mgValue.number},e.prototype.setTitle=function(e,r){this._commandType=t.InteractiveCommandType.SET_TITLE,this._mgValue=new P,this._obj2=e,this._mgValue.title=null===r?"":r,this.Invoke()},e.prototype.invokeUDP=function(e){return this._commandType=t.InteractiveCommandType.INVOKE_UDPCOMMAND,this._mgValue=new P,this._mgValue.obj=e,this.Invoke(),this._mgValue.number},e.prototype.directoryDialogBox=function(e,r,n){return this._commandType=t.InteractiveCommandType.DIRECTORY_DIALOG_BOX,this._mgValue=new P,this._mgValue.caption=e,this._mgValue.path=r,this._mgValue.bool1=n,this.Invoke(),this._mgValue.str},e.prototype.fileOpenDialogBox=function(e,r,n,i,o,a){return this._commandType=t.InteractiveCommandType.FILE_OPEN_DIALOG_BOX,this._mgValue=new P,this._mgValue.title=e,this._mgValue.path=r,this._mgValue.str=n,this._mgValue.filter=i,this._mgValue.boolVal=o,this._mgValue.bool1=a,this.Invoke(),this._mgValue.str},e.prototype.fileSaveDialogBox=function(e,r,n,i,o,a){return this._commandType=t.InteractiveCommandType.FILE_SAVE_DIALOG_BOX,this._mgValue=new P,this._mgValue.title=e,this._mgValue.path=r,this._mgValue.str=n,this._mgValue.filter=i,this._mgValue.caption=o,this._mgValue.bool1=a,this.Invoke(),this._mgValue.str},e.prototype.createDialog=function(e,r){this._commandType=t.InteractiveCommandType.CREATE_DIALOG,this._parameters=r,this._obj2=e,this.Invoke()},e.prototype.closeDialog=function(e){this._commandType=t.InteractiveCommandType.CLOSE_DIALOG,this._obj2=e,this.Invoke()},e.prototype.setEditText=function(e,r,n){return this._commandType=t.InteractiveCommandType.SET_EDIT_TEXT,this._obj2=e,this._line=r,this._mgValue=new P,this._mgValue.str=n,this.Invoke(),this._mgValue.boolVal},e.prototype.insertEditText=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.INSERT_EDIT_TEXT,this._obj2=e,this._line=r,this._mgValue=new P,this._mgValue.str=i,this._intVal1=n,this.Invoke(),this._mgValue.boolVal},e.prototype.setSelection=function(e,r,n,i,o){this._commandType=t.InteractiveCommandType.SET_SELECTION,this._obj2=e,this._line=r,this._x=n,this._y=i,this._mgValue=new P,this._mgValue.number=o,this.Invoke()},e.prototype.setSuggestedValue=function(e,r){this._commandType=t.InteractiveCommandType.SET_SUGGESTED_VALUE,this._obj2=e,this._mgValue=new P,this._mgValue.str=r,this.Invoke()},e.prototype.caretPosGet=function(e,r){return this._commandType=t.InteractiveCommandType.GET_CARET_POS,this._obj2=e,this._line=r,this._mgValue=new P,this.Invoke(),this._mgValue.number},e.prototype.RefreshPage=function(e,r){this._commandType=t.InteractiveCommandType.REFRESH_PAGE,this._boolVal=e,this._obj1=r,this.Invoke()},e.prototype.getIsTopOfTextBox=function(e,r){return this._commandType=t.InteractiveCommandType.GET_IS_TOP_OF_TEXTBOX,this._obj2=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.getIsEndOfTextBox=function(e,r){return this._commandType=t.InteractiveCommandType.GET_IS_END_OF_TEXTBOX,this._obj2=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.postKeyEvent=function(e,r,n,i,o){this._commandType=t.InteractiveCommandType.POST_KEY_EVENT,this._obj2=e,this._line=r,this._mgValue=new P,this._mgValue.str=n,this._mgValue.bool1=o,this._boolVal=i,this.Invoke()},e.prototype.postCharEvent=function(e,r,n){this._commandType=t.InteractiveCommandType.POST_CHAR_EVENT,this._obj2=e,this._line=r,this._char=n,this.Invoke()},e.prototype.disposeAllForms=function(){this._commandType=t.InteractiveCommandType.DISPOSE_ALL_FORMS,this.Invoke()},e.prototype.getRowsInPage=function(e){return this._commandType=t.InteractiveCommandType.GET_ROWS_IN_PAGE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getMaxRowsInPaginatedTable=function(e){return this._commandType=t.InteractiveCommandType.GET_MAX_ROWS_IN_PAGINATED_TABLE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.GetHiddenRowsCountInTable=function(e){return this._commandType=t.InteractiveCommandType.GET_HIDDEN_ROWS_COUNT_IN_TABLE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getLastWindowState=function(e){return this._commandType=t.InteractiveCommandType.GET_LAST_WINDOW_STATE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getLinkedParentIdx=function(e){return this._commandType=t.InteractiveCommandType.GET_LINKED_PARENT_IDX,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getColumnsState=function(e){return this._commandType=t.InteractiveCommandType.GET_COLUMNS_STATE,this._obj2=e,this._mgValue=new P,this.Invoke(),this._mgValue.listOfIntArr},e.prototype.MapWidget=function(t){1===arguments.length?this.MapWidget_0(t):this.MapWidget_1()},e.prototype.MapWidget_0=function(e){this._commandType=t.InteractiveCommandType.MAP_WIDGET_TO_GUI_OBJECT,this._obj1=e,this.Invoke()},e.prototype.ActivateForm=function(e){this._commandType=t.InteractiveCommandType.ACTIVATE_FORM,this._obj1=e,this.Invoke()},e.prototype.isFormActive=function(t){if(1===arguments.length)return this.isFormActive_0(t);this.isFormActive_1()},e.prototype.isFormActive_0=function(t){return this._boolVal},e.prototype.GetRtfValueBeforeEnteringControl=function(e,r){return this._commandType=t.InteractiveCommandType.GET_RTF_VALUE_BEFORE_ENTERING_CONTROL,this._obj2=e,this._line=r,this._mgValue=new P,this.Invoke(),this._mgValue.str},e.prototype.GetDVControlPositionIsn=function(e,r){return this._commandType=t.InteractiveCommandType.GET_DVCONTROL_POSITION_ISN,this._obj1=e,this._line=r,this.Invoke(),this._intVal1},e.prototype.ClearDatatable=function(e,r){this._commandType=t.InteractiveCommandType.CLEAR_DATA_TABLE,this._obj1=e,this._obj2=r,this.Invoke()},e.prototype.SetDataSourceToDataViewControl=function(e,r,n){this._commandType=t.InteractiveCommandType.SET_DATA_SOURCE_TO_DVCONTROL,this._obj1=e,this._obj2=r,this._str=n,this.Invoke()},e.prototype.IsComboBoxInDroppedDownState=function(e,r){return this._commandType=t.InteractiveCommandType.IS_COMBO_DROPPED_DOWN,this._obj1=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.ExecuteCallJS=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.CALL_JS,this._obj2=e,this.controlName=r,this._str=n,this.arguments=i,this.Invoke(),this.resultString},e.prototype.Invoke=function(){if(f.getInstance().invoke(),this._obj2 instanceof h){var t=this._obj2;this.TaskTag=t.TaskTag,this.controlName=t.UniqueName}else if(this._obj2 instanceof T){var e=this._obj2;this.TaskTag=e.TaskTag}else this.TaskTag="0";I.getInstance().ExecuteInteractiveCommand(this)},e.prototype.OnRemoveDNControlValueChangedHandler=function(){E.WriteExceptionToLog("RemoveDNControlValueChangedHandler - Not Implemented Yet")},e.prototype.OnAddDNControlValueChangedHandler=function(){E.WriteExceptionToLog("AddDNControlValueChangedHandler - Not Implemented Yet")},e.prototype.OnGetRtfValueBeforeEnteringControl=function(){E.WriteExceptionToLog("OnGetOrgRtfValue - Not Implemented Yet")},e.prototype.onInvokeUDP=function(){},e.prototype.onFileOpenDialogBox=function(){},e.prototype.onFileSaveDialogBox=function(){},e.prototype.onCreateDialog=function(){},e.prototype.onOpenDialog=function(){},e.prototype.onCloseDialog=function(){},e.prototype.isFormActive_1=function(){},e.prototype.onDisposeAllForms=function(){},e.prototype.onGetFontMetrics=function(){},e.prototype.onGetResolution=function(){},e.prototype.onCaretPosGet=function(){},e.prototype.onGetIsTopOfTextBox=function(){return this._boolVal},e.prototype.onGetIsEndOfTextBox=function(){return this._boolVal},e.prototype.onSelectionGet=function(){},e.prototype.onSetEditText=function(){},e.prototype.onInsertEditText=function(){},e.prototype.onSetBrowserText=function(){},e.prototype.onSetSelection=function(){},e.prototype.onSetSuggestedValue=function(){},e.prototype.onGetRowsInPage=function(){},e.prototype.onGetHiddenRowsCountInTable=function(){},e.prototype.onGetTopIndex=function(){},e.prototype.getClientBounds_1=function(){},e.prototype.onPostKeyEvent=function(){},e.prototype.onPostCharEvent=function(){},e.prototype.OnSetGetSuggestedValueOfChoiceControlOnTagData=function(){},e.prototype.onSendImeMsg=function(){},e.prototype.onSetCursor=function(){},e.prototype.invokeRequired=function(){return!1},e.prototype.onGetLastWindowState=function(){},e.prototype.onGetLinkedParentIdx=function(){},e.prototype.onGetColumnsState=function(){},e.prototype.onCanFocus=function(){},e.prototype.OnGetSelectedIndice=function(){},e.prototype.OnGetHasIndent=function(){},e.prototype.MapWidget_1=function(){},e.prototype.OnGetDVControlPositionIsn=function(){},e.prototype.OnActivateForm=function(){},e.prototype.OnIsComboDroppedDowndState=function(){},e}();O.lockObject=null;var g,R,S,C,d,A,L,m,N,y,M,D,b,v,B,Y,U,G=function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.OnGetRtfValueBeforeEnteringControl=function(){},e.prototype.onGetBrowserText=function(){},e.prototype.onBrowserExecute=function(){},e.prototype.onDirectoryDialogBox=function(){},e}(O),k=function(t){function n(){var e=t.apply(this,c(arguments))||this;return e._type=r.MgControlType.CTRL_TYPE_NONE,e.ForceRefreshPropertyWidth=!1,e.ForceRefreshPropertyHight=!1,e.ButtonStyle=r.CtrlButtonTypeGui.None,e.IsRepeatable=!1,e.Layer=0,e.CheckBoxMainStyle=r.CheckboxMainStyle.None,e.RadioButtonAppearance=r.RbAppearance.None,e.Name=null,e.GuiMgForm=null,e}return a(n,t),Object.defineProperty(n.prototype,"Type",{get:function(){return this._type},set:function(t){this._type===r.MgControlType.CTRL_TYPE_NONE?this._type=t:e.Debug.Assert(!1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsTableChild",{get:function(){var t=this.getParent()instanceof n?this.getParent():null;return null!==t&&t.isTableControl()&&!this.isColumnControl()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsTableHeaderChild",{get:function(){return!this.IsRepeatable&&this.IsTableChild},enumerable:!1,configurable:!0}),n.prototype.getName=function(t){return this.IsRepeatable?t>e.Int32.MinValue?this.Name+"_"+t:this.Name+"_0":this.Name},Object.defineProperty(n.prototype,"UniqueName",{get:function(){return this.Name},enumerable:!1,configurable:!0}),n.prototype.isStatic=function(){return this._type===r.MgControlType.CTRL_TYPE_LABEL||this._type===r.MgControlType.CTRL_TYPE_GROUP||this._type===r.MgControlType.CTRL_TYPE_TABLE||this._type===r.MgControlType.CTRL_TYPE_COLUMN||this._type===r.MgControlType.CTRL_TYPE_STATUS_BAR||this._type===r.MgControlType.CTRL_TYPE_SB_IMAGE||this._type===r.MgControlType.CTRL_TYPE_SB_LABEL||this._type===r.MgControlType.CTRL_TYPE_LINE},n.prototype.isTableControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TABLE},n.prototype.isTabControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TAB},n.prototype.isLineControl=function(){return this._type===r.MgControlType.CTRL_TYPE_LINE},n.prototype.isTextControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TEXT},n.prototype.isImageControl=function(){return this._type===r.MgControlType.CTRL_TYPE_IMAGE},n.prototype.isSubform=function(){return this._type===r.MgControlType.CTRL_TYPE_SUBFORM},n.prototype.isRadio=function(){return this._type===r.MgControlType.CTRL_TYPE_RADIO},n.prototype.isComboBox=function(){return this._type===r.MgControlType.CTRL_TYPE_COMBO},n.prototype.isListBox=function(){return this._type===r.MgControlType.CTRL_TYPE_LIST},n.prototype.isButton=function(){return this._type===r.MgControlType.CTRL_TYPE_BUTTON},n.prototype.isLabel=function(){return this._type===r.MgControlType.CTRL_TYPE_LABEL},n.prototype.isGroup=function(){return this._type===r.MgControlType.CTRL_TYPE_GROUP},n.prototype.isSelectionCtrl=function(){return this._type===r.MgControlType.CTRL_TYPE_COMBO||this._type===r.MgControlType.CTRL_TYPE_LIST},n.prototype.isBrowserControl=function(){return this._type===r.MgControlType.CTRL_TYPE_BROWSER},n.prototype.isCheckBox=function(){return this._type===r.MgControlType.CTRL_TYPE_CHECKBOX},n.prototype.isColumnControl=function(){return this._type===r.MgControlType.CTRL_TYPE_COLUMN},n.prototype.isChoiceControl=function(){var t=!1;switch(this._type){case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_RADIO:t=!0}return t},n.prototype.isContainer=function(){switch(this._type){case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_CONTAINER:return!0;default:return!1}},n.prototype.SupportGradient=function(){return this.isButton()||this.isLabel()||this.isTabControl()||this.isGroup()||this.IsCheckBoxMainStyleButton()||this.IsRadioAppearanceButton()},n.prototype.IsImageButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Image),t},n.prototype.IsButtonPushButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Push),t},n.prototype.IsHyperTextButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Hypertext),t},n.prototype.IsCheckBoxMainStyleButton=function(){var t=!1;return this.isCheckBox()&&(t=this.CheckBoxMainStyle===r.CheckboxMainStyle.Button),t},n.prototype.IsRadioAppearanceButton=function(){var t=!1;return this.isRadio()&&(t=this.RadioButtonAppearance===r.RbAppearance.Button),t},n.prototype.getControlTypeName=function(){var t=null;switch(this._type){case r.MgControlType.CTRL_TYPE_STATUS_BAR:t="Status bar";break;case r.MgControlType.CTRL_TYPE_SB_LABEL:t="Status bar label";break;case r.MgControlType.CTRL_TYPE_SB_IMAGE:t="Status bar image";break;case r.MgControlType.CTRL_TYPE_TABLE:t="Table";break;case r.MgControlType.CTRL_TYPE_BUTTON:t="Button";break;case r.MgControlType.CTRL_TYPE_CHECKBOX:t="Checkbox";break;case r.MgControlType.CTRL_TYPE_COMBO:t="Combo";break;case r.MgControlType.CTRL_TYPE_LIST:t="List";break;case r.MgControlType.CTRL_TYPE_SUBFORM:t="Subform";break;case r.MgControlType.CTRL_TYPE_GROUP:t="Groupbox";break;case r.MgControlType.CTRL_TYPE_IMAGE:t="Image";break;case r.MgControlType.CTRL_TYPE_TAB:t="Tab";break;case r.MgControlType.CTRL_TYPE_COLUMN:t="Column";break;case r.MgControlType.CTRL_TYPE_LABEL:t="Label";break;case r.MgControlType.CTRL_TYPE_FRAME_SET:t="Frame set";break;case r.MgControlType.CTRL_TYPE_CONTAINER:t="Container";break;case r.MgControlType.CTRL_TYPE_RADIO:t="Radio";break;case r.MgControlType.CTRL_TYPE_TEXT:t="Text";break;case r.MgControlType.CTRL_TYPE_FRAME_FORM:t="Frame form";break;case r.MgControlType.CTRL_TYPE_BROWSER:t="Browser";break;case r.MgControlType.CTRL_TYPE_LINE:t="Line"}return t},n}(h);(g=t.DateElement||(t.DateElement={})).YEAR="Y",g.MONTH="M",g.DAY="D",g.DOW="W",(R=t.MenuEntryProgram_SrcContext||(t.MenuEntryProgram_SrcContext={})).Main="M",R.Current="C",(S=t.EditReturnCode||(t.EditReturnCode={}))[S.EDIT_CONTINUE=0]="EDIT_CONTINUE",S[S.EDIT_AUTOSKIP=1]="EDIT_AUTOSKIP",S[S.EDIT_RESTART=2]="EDIT_RESTART",(C=t.GuiExpressionEvaluator_ControlsPersistencyClearOption||(t.GuiExpressionEvaluator_ControlsPersistencyClearOption={}))[C.All=1]="All",C[C.CurrentForm=2]="CurrentForm",(d=t.DataModificationTypes||(t.DataModificationTypes={})).Update="u",d.Insert="i",d.Delete="d",d.None=" ",(A=t.MgCheckState||(t.MgCheckState={}))[A.UNCHECKED=1]="UNCHECKED",A[A.CHECKED=2]="CHECKED",A[A.INDETERMINATE=3]="INDETERMINATE",(L=t.MarkMode||(t.MarkMode={}))[L.MARK_ALL_TEXT=1]="MARK_ALL_TEXT",L[L.UNMARK_ALL_TEXT=2]="UNMARK_ALL_TEXT",L[L.MARK_SELECTION_TEXT=3]="MARK_SELECTION_TEXT",(m=t.MgCursors||(t.MgCursors={}))[m.ARROW=1]="ARROW",m[m.WAITCURSOR=2]="WAITCURSOR",m[m.HAND=3]="HAND",m[m.APPSTARTING=4]="APPSTARTING",m[m.CROSS=5]="CROSS",m[m.HELP=6]="HELP",m[m.IBEAM=7]="IBEAM",m[m.NO=8]="NO",m[m.SIZEALL=9]="SIZEALL",m[m.SIZENESW=10]="SIZENESW",m[m.SIZENS=11]="SIZENS",m[m.SIZENWSE=12]="SIZENWSE",m[m.SIZEWE=13]="SIZEWE",m[m.UPARROW=14]="UPARROW",(N=t.Modifiers||(t.Modifiers={})).MODIFIER_ALT="A",N.MODIFIER_CTRL="C",N.MODIFIER_SHIFT="S",N.MODIFIER_NONE=" ",N.MODIFIER_SHIFT_CTRL="X",N.MODIFIER_ALT_CTRL="Y",N.MODIFIER_ALT_SHIFT="Z",(y=t.CommandType||(t.CommandType={}))[y.OPEN_FORM=0]="OPEN_FORM",y[y.CREATE_FORM=1]="CREATE_FORM",y[y.INITIAL_FORM_LAYOUT=2]="INITIAL_FORM_LAYOUT",y[y.SHOW_FORM=3]="SHOW_FORM",y[y.CREATE_LABEL=4]="CREATE_LABEL",y[y.CREATE_EDIT=5]="CREATE_EDIT",y[y.CREATE_BUTTON=6]="CREATE_BUTTON",y[y.CREATE_COMBO_BOX=7]="CREATE_COMBO_BOX",y[y.CREATE_LIST_BOX=8]="CREATE_LIST_BOX",y[y.CREATE_RADIO_CONTAINER=9]="CREATE_RADIO_CONTAINER",y[y.CREATE_RADIO_BUTTON=10]="CREATE_RADIO_BUTTON",y[y.CREATE_IMAGE=11]="CREATE_IMAGE",y[y.CREATE_CHECK_BOX=12]="CREATE_CHECK_BOX",y[y.CREATE_TAB=13]="CREATE_TAB",y[y.CREATE_TABLE=14]="CREATE_TABLE",y[y.CREATE_COLUMN=15]="CREATE_COLUMN",y[y.CREATE_SUB_FORM=16]="CREATE_SUB_FORM",y[y.CLOSE_SUB_FORM=17]="CLOSE_SUB_FORM",y[y.CREATE_BROWSER=18]="CREATE_BROWSER",y[y.CREATE_GROUP=19]="CREATE_GROUP",y[y.CREATE_RICH_EDIT=20]="CREATE_RICH_EDIT",y[y.CREATE_RICH_TEXT=21]="CREATE_RICH_TEXT",y[y.CREATE_LINE=22]="CREATE_LINE",y[y.DISPOSE_OBJECT=23]="DISPOSE_OBJECT",y[y.PROP_SET_CONTROL_NAME=24]="PROP_SET_CONTROL_NAME",y[y.PROP_SET_TEXT=25]="PROP_SET_TEXT",y[y.PROP_SET_READ_ONLY=26]="PROP_SET_READ_ONLY",y[y.PROP_SET_TEXT_SIZE_LIMIT=27]="PROP_SET_TEXT_SIZE_LIMIT",y[y.PROP_SET_ITEMS_LIST=28]="PROP_SET_ITEMS_LIST",y[y.PROP_SET_IMAGE_FILE_NAME=29]="PROP_SET_IMAGE_FILE_NAME",y[y.PROP_SET_IMAGE_DATA=30]="PROP_SET_IMAGE_DATA",y[y.PROP_SET_IMAGE_LIST=31]="PROP_SET_IMAGE_LIST",y[y.PROP_SET_DEFAULT_BUTTON=32]="PROP_SET_DEFAULT_BUTTON",y[y.PROP_SET_TOOLTIP=33]="PROP_SET_TOOLTIP",y[y.PROP_SET_VISIBLE=34]="PROP_SET_VISIBLE",y[y.PROP_SET_ENABLE=35]="PROP_SET_ENABLE",y[y.PROP_SET_MENU_ENABLE=36]="PROP_SET_MENU_ENABLE",y[y.PROP_SET_VISIBLE_LINES=37]="PROP_SET_VISIBLE_LINES",y[y.PROP_SET_RIGHT_TO_LEFT=38]="PROP_SET_RIGHT_TO_LEFT",y[y.PROP_SET_CHECKED=39]="PROP_SET_CHECKED",y[y.PROP_SET_SELECTION=40]="PROP_SET_SELECTION",y[y.PROP_SET_LAYOUT_NUM_COLUMN=41]="PROP_SET_LAYOUT_NUM_COLUMN",y[y.PROP_SET_LINE_VISIBLE=42]="PROP_SET_LINE_VISIBLE",y[y.PROP_SET_RESIZABLE=43]="PROP_SET_RESIZABLE",y[y.PROP_SET_ALLOW_REORDER=44]="PROP_SET_ALLOW_REORDER",y[y.PROP_SET_SORTABLE_COLUMN=45]="PROP_SET_SORTABLE_COLUMN",y[y.PROP_SET_COLUMN_PLACMENT=46]="PROP_SET_COLUMN_PLACMENT",y[y.PROP_SET_ICON_FILE_NAME=47]="PROP_SET_ICON_FILE_NAME",y[y.SET_WINDOW_STATE=48]="SET_WINDOW_STATE",y[y.SET_COLUMN_ORG_WIDTH=49]="SET_COLUMN_ORG_WIDTH",y[y.SET_COLUMN_START_POS=50]="SET_COLUMN_START_POS",y[y.SET_TABLE_ITEMS_COUNT=51]="SET_TABLE_ITEMS_COUNT",y[y.SET_TABLE_VIRTUAL_ITEMS_COUNT=52]="SET_TABLE_VIRTUAL_ITEMS_COUNT",y[y.SET_TABLE_VSCROLL_THUMB_POS=53]="SET_TABLE_VSCROLL_THUMB_POS",y[y.SET_TABLE_VSCROLL_PAGE_SIZE=54]="SET_TABLE_VSCROLL_PAGE_SIZE",y[y.SET_TABLE_INCLUDES_FIRST=55]="SET_TABLE_INCLUDES_FIRST",y[y.SET_TABLE_INCLUDES_LAST=56]="SET_TABLE_INCLUDES_LAST",y[y.SET_TABLE_TOP_INDEX=57]="SET_TABLE_TOP_INDEX",y[y.SET_SELECTION_INDEX=58]="SET_SELECTION_INDEX",y[y.INVALIDATE_TABLE=59]="INVALIDATE_TABLE",y[y.REFRESH_TABLE=60]="REFRESH_TABLE",y[y.REFRESH_TMP_EDITOR=61]="REFRESH_TMP_EDITOR",y[y.UPDATE_TMP_EDITOR_INDEX=62]="UPDATE_TMP_EDITOR_INDEX",y[y.CREATE_TABLE_ROW=63]="CREATE_TABLE_ROW",y[y.UNDO_CREATE_TABLE_ROW=64]="UNDO_CREATE_TABLE_ROW",y[y.SET_TABLE_ROW_VISIBILITY=65]="SET_TABLE_ROW_VISIBILITY",y[y.VALIDATE_TABLE_ROW=66]="VALIDATE_TABLE_ROW",y[y.INSERT_ROWS=67]="INSERT_ROWS",y[y.REMOVE_ROWS=68]="REMOVE_ROWS",y[y.CLEAR_TABLE_COLUMNS_SORT_MARK=69]="CLEAR_TABLE_COLUMNS_SORT_MARK",y[y.PROP_SET_URL=70]="PROP_SET_URL",y[y.MOVE_ABOVE=71]="MOVE_ABOVE",y[y.SET_FOCUS=72]="SET_FOCUS",y[y.WRITE_TO_MESSAGE_BOX=73]="WRITE_TO_MESSAGE_BOX",y[y.CLOSE_FORM=74]="CLOSE_FORM",y[y.REMOVE_SUBFORM_CONTROLS=75]="REMOVE_SUBFORM_CONTROLS",y[y.START_TIMER=76]="START_TIMER",y[y.STOP_TIMER=77]="STOP_TIMER",y[y.BEEP=78]="BEEP",y[y.CREATE_TOOLBAR=79]="CREATE_TOOLBAR",y[y.DELETE_TOOLBAR=80]="DELETE_TOOLBAR",y[y.CREATE_TOOLBAR_ITEM=81]="CREATE_TOOLBAR_ITEM",y[y.DELETE_TOOLBAR_ITEM=82]="DELETE_TOOLBAR_ITEM",y[y.CREATE_STATUS_BAR=83]="CREATE_STATUS_BAR",y[y.PROP_SET_SB_PANE_WIDTH=84]="PROP_SET_SB_PANE_WIDTH",y[y.CREATE_SB_LABEL=85]="CREATE_SB_LABEL",y[y.CREATE_SB_IMAGE=86]="CREATE_SB_IMAGE",y[y.SHOW_TMP_EDITOR=87]="SHOW_TMP_EDITOR",y[y.PROP_SET_TRANSLATOR=88]="PROP_SET_TRANSLATOR",y[y.PROP_SET_PASSWORD_EDIT=89]="PROP_SET_PASSWORD_EDIT",y[y.PROP_SET_TITLE_BAR=90]="PROP_SET_TITLE_BAR",y[y.PROP_SHOW_FULL_ROW=91]="PROP_SHOW_FULL_ROW",y[y.PROP_SHOW_BUTTONS=92]="PROP_SHOW_BUTTONS",y[y.PROP_SHOW_LINES=93]="PROP_SHOW_LINES",y[y.PROP_SHOW_SCROLLBAR=94]="PROP_SHOW_SCROLLBAR",y[y.SET_ENV_ACCESS_TEST=95]="SET_ENV_ACCESS_TEST",y[y.SET_ENV_TOOLTIP_TIMEOUT=96]="SET_ENV_TOOLTIP_TIMEOUT",y[y.SET_ENV_SPECIAL_TEXT_SIZE_FACTORING=97]="SET_ENV_SPECIAL_TEXT_SIZE_FACTORING",y[y.SET_ENV_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME=98]="SET_ENV_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME",y[y.PROP_SET_STARTUP_POSITION=99]="PROP_SET_STARTUP_POSITION",y[y.PROP_SET_CHECK_BOX_CHECKED=100]="PROP_SET_CHECK_BOX_CHECKED",y[y.COMBO_DROP_DOWN=101]="COMBO_DROP_DOWN",y[y.SET_ACTIVETE_KEYBOARD_LAYOUT=102]="SET_ACTIVETE_KEYBOARD_LAYOUT",y[y.SET_TAG_DATA_LINK_VISITED=103]="SET_TAG_DATA_LINK_VISITED",y[y.ALLOW_UPDATE=104]="ALLOW_UPDATE",y[y.SET_ALIGNMENT=105]="SET_ALIGNMENT",y[y.BULLET=106]="BULLET",y[y.INDENT=107]="INDENT",y[y.UNINDENT=108]="UNINDENT",y[y.CHANGE_COLUMN_SORT_MARK=109]="CHANGE_COLUMN_SORT_MARK",y[y.SET_CURRENT_CURSOR=110]="SET_CURRENT_CURSOR",y[y.REORDER_COLUMNS=111]="REORDER_COLUMNS",y[y.RESTORE_COLUMNS=112]="RESTORE_COLUMNS",y[y.ACTIVATE_FORM=113]="ACTIVATE_FORM",y[y.LOCK_WINDOW_UPDATE=114]="LOCK_WINDOW_UPDATE",y[y.ENABLE_XPTHEMES=115]="ENABLE_XPTHEMES",y[y.TOGGLE_ALTERNATE_COLOR_FOR_FIRST_ROW=116]="TOGGLE_ALTERNATE_COLOR_FOR_FIRST_ROW",y[y.REGISTER_DN_CTRL_VALUE_CHANGED_EVENT=117]="REGISTER_DN_CTRL_VALUE_CHANGED_EVENT",y[y.SET_TABLE_ORG_ROW_HEIGHT=118]="SET_TABLE_ORG_ROW_HEIGHT",y[y.SET_TOOLBAR=119]="SET_TOOLBAR",y[y.CREATE_ENTRY_IN_CONTROLS_MAP=120]="CREATE_ENTRY_IN_CONTROLS_MAP",y[y.REMOVE_ENTRY_FROM_CONTROLS_MAP=121]="REMOVE_ENTRY_FROM_CONTROLS_MAP",y[y.PROCESS_PRESS_EVENT=122]="PROCESS_PRESS_EVENT",y[y.SET_MARKED_ITEM_STATE=123]="SET_MARKED_ITEM_STATE",y[y.ACCEPT_DVCONTROL_CHANGES=124]="ACCEPT_DVCONTROL_CHANGES",y[y.UPDATE_DVCONTROL_ROW=125]="UPDATE_DVCONTROL_ROW",y[y.ADD_DVCONTROL_HANDLER=126]="ADD_DVCONTROL_HANDLER",y[y.REMOVE_DVCONTROL_HANDLER=127]="REMOVE_DVCONTROL_HANDLER",y[y.CREATE_ROW_IN_DVCONTROL=128]="CREATE_ROW_IN_DVCONTROL",y[y.UPDATE_DVCONTROL_COLUMN=129]="UPDATE_DVCONTROL_COLUMN",y[y.DELETE_DVCONTROL_ROW=130]="DELETE_DVCONTROL_ROW",y[y.SET_DVCONTROL_ROW_POSITION=131]="SET_DVCONTROL_ROW_POSITION",y[y.REJECT_DVCONTROL_COLUMN_CHANGES=132]="REJECT_DVCONTROL_COLUMN_CHANGES",y[y.SET_DESIGNER_VALUES=133]="SET_DESIGNER_VALUES",y[y.PROP_SET_EDIT_HINT=134]="PROP_SET_EDIT_HINT",y[y.PROP_SET_MULTI_COLUMN_DISPLAY=135]="PROP_SET_MULTI_COLUMN_DISPLAY",y[y.SET_ENV_LAMGUAGE=136]="SET_ENV_LAMGUAGE",y[y.SET_LAST_IN_CONTEXT=137]="SET_LAST_IN_CONTEXT",y[y.SET_CARET=138]="SET_CARET",y[y.SET_RECORDS_BEFORE_CURRENT_VIEW=139]="SET_RECORDS_BEFORE_CURRENT_VIEW",y[y.SET_VALUE=140]="SET_VALUE",y[y.SET_ATTRIBUTE=141]="SET_ATTRIBUTE",y[y.SET_PROPERTY=142]="SET_PROPERTY",y[y.SET_CLASS=143]="SET_CLASS",y[y.SET_STYLE=144]="SET_STYLE",y[y.REFRESH_TASK=145]="REFRESH_TASK",y[y.PROP_SET_USER_PROPERTY=146]="PROP_SET_USER_PROPERTY",y[y.PROP_SET_CUSTOM_VALIDATOR=147]="PROP_SET_CUSTOM_VALIDATOR",y[y.SET_IS_ROW_EDITING=148]="SET_IS_ROW_EDITING",y[y.SET_NOT_IS_ROW_EDITING=149]="SET_NOT_IS_ROW_EDITING",y[y.SET_EMPTY_DATAVIEW=150]="SET_EMPTY_DATAVIEW",y[y.SET_IS_LOGGED_IN=151]="SET_IS_LOGGED_IN",y[y.RELOAD_PAGE=152]="RELOAD_PAGE",y[y.EXIT_MAGIC=153]="EXIT_MAGIC",y[y.CALL_JS=154]="CALL_JS",y[y.PROP_SET_BINDING_LEVEL=155]="PROP_SET_BINDING_LEVEL",y[y.SHOW_SPINNER=156]="SHOW_SPINNER",(M=t.HtmlProperties||(t.HtmlProperties={})).Visible="visible",M.Enabled="enabled",M.Text="text",M.ItemsList="itemslist",M.Image="image",M.Tooltip="tooltip",M.SelectedValue="selectedvalue",M.ShowBorder="showborder",M.PlaceHolder="placeholder",M.Password="password",M.TabIndex="tabindex",M.SelectedRow="selectedRow",M.ReadOnly="readOnly",M.MustInput="mustInput",M.SelectedLayer="SelectedLayer",M.BindingLevel="bindingLevel",(D=t.MenuStyle||(t.MenuStyle={}))[D.MENU_STYLE_PULLDOWN=1]="MENU_STYLE_PULLDOWN",D[D.MENU_STYLE_CONTEXT=2]="MENU_STYLE_CONTEXT",D[D.MENU_STYLE_TOOLBAR=3]="MENU_STYLE_TOOLBAR",(b=t.DockingStyle||(t.DockingStyle={}))[b.NONE=0]="NONE",b[b.BOTTOM=1]="BOTTOM",b[b.FILL=2]="FILL",b[b.LEFT=3]="LEFT",b[b.RIGHT=4]="RIGHT",b[b.TOP=5]="TOP",(v=t.RaisedBy||(t.RaisedBy={}))[v.USER_ACTION=0]="USER_ACTION",v[v.CLOSE_SYSTEM_MENU=1]="CLOSE_SYSTEM_MENU",v[v.CTRL_GOTO=2]="CTRL_GOTO",v[v.MOUSE_WHEEL=3]="MOUSE_WHEEL",v[v.INTERNAL=4]="INTERNAL",v[v.KBPUT=5]="KBPUT",(B=t.TraverseMode||(t.TraverseMode={}))[B.NONE=1]="NONE",B[B.WITHIN_CONTROL=2]="WITHIN_CONTROL",B[B.BETWEEN_CONTROLS=3]="BETWEEN_CONTROLS",(Y=t.ClipFormats||(t.ClipFormats={}))[Y.FORMAT_USER=0]="FORMAT_USER",Y[Y.FORMAT_TEXT=1]="FORMAT_TEXT",Y[Y.FORMAT_OEM_TEXT=2]="FORMAT_OEM_TEXT",Y[Y.FORMAT_RICH_TEXT=3]="FORMAT_RICH_TEXT",Y[Y.FORMAT_HTML_TEXT=4]="FORMAT_HTML_TEXT",Y[Y.FORMAT_HYPERLINK_TEXT=5]="FORMAT_HYPERLINK_TEXT",Y[Y.FORMAT_DROP_FILES=6]="FORMAT_DROP_FILES",Y[Y.FORMAT_UNICODE_TEXT=7]="FORMAT_UNICODE_TEXT",Y.FORMAT_UNKNOWN="c",(U=t.OverlayType||(t.OverlayType={}))[U.Overlay=0]="Overlay",U[U.Alert=1]="Alert",U[U.ConfirmationBox=2]="ConfirmationBox";var V,w=function(){function t(t,e,r){this.TaskTag=null,this.CommandType=0,this.options=null,this.Bool1=!1,this.params=null,this.fileName=null,this.height=0,this.layer=0,this.line=0,this.number=0,this.obj=null,this.parentObject=null,this.obj1=null,this.str=null,this.value=null,this.stringList=null,this.style=0,this.width=0,this.x=0,this.y=0,this.userDropFormat=null,this.contextID="\0",1!==arguments.length||null!==t&&t.constructor!==Number?2!==arguments.length||null!==t&&t.constructor!==Number||null!==e&&e.constructor!==String?2!==arguments.length?this.constructor_3(t,e,r):this.constructor_2(t,e):this.constructor_1(t,e):this.constructor_0(t)}return t.prototype.constructor_0=function(t){this.CommandType=t},t.prototype.constructor_1=function(t,e){this.constructor_0(t),this.str=e},t.prototype.constructor_2=function(t,e){this.constructor_0(e),this.obj=t,this.obj instanceof h?(this.CtrlName=this.obj.UniqueName,this.TaskTag=this.obj.TaskTag):null===t&&(this.TaskTag="0")},t.prototype.constructor_3=function(t,e,r){this.constructor_2(e,r),this.parentObject=t},t.prototype.toString=function(){return"{"+this.CommandType+"}"},t}(),F=function(){function r(){}return r.SetResolveCallback=function(t){this.resolveCallback=t},r.ResolvePromise=function(t){this.resolveCallback(t)},r.messageBox=function(t,e,r){return s(this,void 0,void 0,(function(){var n,i,o=this;return _(this,(function(a){switch(a.label){case 0:return n=new G,[4,new Promise((function(i,a){o.SetResolveCallback(i),n.messageBox(t,e,r)})).then((function(t){i=t}))];case 1:return a.sent(),[2,i]}}))}))},r.setTitle=function(t,e){(new G).setTitle(t,e)},r.setGetSuggestedValueOfChoiceControlOnTagData=function(t,e,r){(new G).setGetSuggestedValueOfChoiceControlOnTagData(t,e,r)},r.getValue=function(t,e){return(new G).getValue(t,e)},r.getTopIndex=function(t){return(new G).getTopIndex(t)},r.getIsRowEditing=function(t,e,r){return(new G).getIsRowEditing(t,e,r)},r.browserExecute=function(t,e,r,n){return(new G).browserExecute(t,e,r,n)},r.directoryDialogBox=function(t,e,r){return(new G).directoryDialogBox(t,e,r)},r.fileOpenDialogBox=function(t,e,r,n,i,o){return(new G).fileOpenDialogBox(t,e,r,n,i,o)},r.setEditText=function(t,e,r){return(new G).setEditText(t,e,r)},r.insertEditText=function(t,e,r,n){return(new G).insertEditText(t,e,r,n)},r.caretPosGet=function(t,e){return(new G).caretPosGet(t,e)},r.addRefreshPage=function(t,e){(new G).RefreshPage(t,e)},r.getRowsInPage=function(t){var e=(new G).getRowsInPage(t);return 0===e?1:e},r.getMaxRowsInPaginatedTable=function(t){return(new G).getMaxRowsInPaginatedTable(t)},r.addBoolWithLine=function(t,e,r,n){var i=new w(e,t);i.Bool1=n,i.line=r,f.getInstance().addCommand(i)},r.addNoParameters=function(t,e){var r=new w(e,t);f.getInstance().addCommand(r)},r.addWithNumber=function(t,e,r){var n=new w(e,t);n.number=r,f.getInstance().addCommand(n)},r.addValueWithLine=function(e,r,n,i){var o=new w(r,e);o.value=i,o.line=n,e===t.CommandType.SET_VALUE&&r instanceof k&&r.isChoiceControl()&&i<0&&(o.value=""),f.getInstance().addCommand(o)},r.addOperationWithLine=function(t,e,r,n,i){var o=new w(e,t);o.obj1=i,o.line=r,o.Operation=n,f.getInstance().addCommand(o)},r.addOpensubform=function(t,e,r,n,i,o,a,s,_){var l=new w(e,t);l.str=r,l.obj1=n,l.userDropFormat=i,l.fileName=o,l.Bool1=_,l.contextID=a,l.params=s,f.getInstance().addCommand(l)},r.addClosesubform=function(t,e,r,n,i){var o=new w(e,t);o.str=r,o.obj1=n,o.userDropFormat=i,f.getInstance().addCommand(o)},r.addOpenForm=function(r,n,i,o,a,s){var _=new w(r,t.CommandType.OPEN_FORM);_.TaskTag=i,_.str=n,_.stringList=new e.List,_.stringList.push(o),_.stringList.push(a),_.Bool1=s,f.getInstance().addCommand(_)},r.addCloseForm=function(e,r,n){var i=new w(e,t.CommandType.CLOSE_FORM);i.TaskTag=r,i.str=n,f.getInstance().addCommand(i)},r.addCallJS=function(t,e,r,n){return(new G).ExecuteCallJS(t,e,r,n)},r.addIsLoggedIn=function(e){var r=new w(null,t.CommandType.SET_IS_LOGGED_IN);r.Bool1=e,f.getInstance().addCommand(r)},r.addShowSpinner=function(e){var r=new w(null,t.CommandType.SHOW_SPINNER);r.Bool1=e,f.getInstance().addCommand(r)},r.addGlobalCommand=function(t){var e=new w(null,t);f.getInstance().addCommand(e)},r.beginInvoke=function(){f.getInstance().beginInvoke()},r.invoke=function(){f.getInstance().invoke()},r}();F.resolveCallback=null,(V=t.PropInterface||(t.PropInterface={}))[V.PROP_TYPE_LINES_IN_TABLE=3]="PROP_TYPE_LINES_IN_TABLE",V[V.PROP_TYPE_HYPERLINK=14]="PROP_TYPE_HYPERLINK",V[V.PROP_TYPE_TEXT=19]="PROP_TYPE_TEXT",V[V.PROP_TYPE_PLACEMENT=20]="PROP_TYPE_PLACEMENT",V[V.PROP_TYPE_LEFT=21]="PROP_TYPE_LEFT",V[V.PROP_TYPE_TOP=22]="PROP_TYPE_TOP",V[V.PROP_TYPE_WIDTH=23]="PROP_TYPE_WIDTH",V[V.PROP_TYPE_HEIGHT=24]="PROP_TYPE_HEIGHT",V[V.PROP_TYPE_LAYER=25]="PROP_TYPE_LAYER",V[V.PROP_TYPE_TITLE_BAR=26]="PROP_TYPE_TITLE_BAR",V[V.PROP_TYPE_SYSTEM_MENU=27]="PROP_TYPE_SYSTEM_MENU",V[V.PROP_TYPE_MINBOX=28]="PROP_TYPE_MINBOX",V[V.PROP_TYPE_MAXBOX=29]="PROP_TYPE_MAXBOX",V[V.PROP_TYPE_UOM=33]="PROP_TYPE_UOM",V[V.PROP_TYPE_VER_FAC=34]="PROP_TYPE_VER_FAC",V[V.PROP_TYPE_HOR_FAC=35]="PROP_TYPE_HOR_FAC",V[V.PROP_TYPE_WALLPAPER=42]="PROP_TYPE_WALLPAPER",V[V.PROP_TYPE_DATA=43]="PROP_TYPE_DATA",V[V.PROP_TYPE_LABEL=45]="PROP_TYPE_LABEL",V[V.PROP_TYPE_NAME=46]="PROP_TYPE_NAME",V[V.PROP_TYPE_FONT=50]="PROP_TYPE_FONT",V[V.PROP_TYPE_COLOR=51]="PROP_TYPE_COLOR",V[V.PROP_TYPE_MUST_INPUT=52]="PROP_TYPE_MUST_INPUT",V[V.PROP_TYPE_MODIFIABLE=53]="PROP_TYPE_MODIFIABLE",V[V.PROP_TYPE_HELP_SCR=54]="PROP_TYPE_HELP_SCR",V[V.PROP_TYPE_TOOLTIP=56]="PROP_TYPE_TOOLTIP",V[V.PROP_TYPE_PROMPT=57]="PROP_TYPE_PROMPT",V[V.PROP_TYPE_SELECT_PROGRAM=58]="PROP_TYPE_SELECT_PROGRAM",V[V.PROP_TYPE_SELECT_MODE=59]="PROP_TYPE_SELECT_MODE",V[V.PROP_TYPE_MODIFY_IN_QUERY=60]="PROP_TYPE_MODIFY_IN_QUERY",V[V.PROP_TYPE_VISIBLE=61]="PROP_TYPE_VISIBLE",V[V.PROP_TYPE_ENABLED=62]="PROP_TYPE_ENABLED",V[V.PROP_TYPE_STYLE_3D=63]="PROP_TYPE_STYLE_3D",V[V.PROP_TYPE_BORDER_STYLE=64]="PROP_TYPE_BORDER_STYLE",V[V.PROP_TYPE_HORIZONTAL_ALIGNMENT=65]="PROP_TYPE_HORIZONTAL_ALIGNMENT",V[V.PROP_TYPE_VERTICAL_ALIGNMENT=66]="PROP_TYPE_VERTICAL_ALIGNMENT",V[V.PROP_TYPE_CHOICE_COLUMNS=67]="PROP_TYPE_CHOICE_COLUMNS",V[V.PROP_TYPE_VISIBLE_LINES=68]="PROP_TYPE_VISIBLE_LINES",V[V.PROP_TYPE_STATIC_TYPE=70]="PROP_TYPE_STATIC_TYPE",V[V.PROP_TYPE_MULTILINE=71]="PROP_TYPE_MULTILINE",V[V.PROP_TYPE_MULTILINE_VERTICAL_SCROLL=73]="PROP_TYPE_MULTILINE_VERTICAL_SCROLL",V[V.PROP_TYPE_MULTILINE_ALLOW_CR=74]="PROP_TYPE_MULTILINE_ALLOW_CR",V[V.PROP_TYPE_LINE_STYLE=75]="PROP_TYPE_LINE_STYLE",V[V.PROP_TYPE_LINE_WIDTH=76]="PROP_TYPE_LINE_WIDTH",V[V.PROP_TYPE_SCROLL_BAR=77]="PROP_TYPE_SCROLL_BAR",V[V.PROP_TYPE_LINE_DIVIDER=78]="PROP_TYPE_LINE_DIVIDER",V[V.PROP_TYPE_TITLE_HEIGHT=79]="PROP_TYPE_TITLE_HEIGHT",V[V.PROP_TYPE_ROW_HEIGHT=80]="PROP_TYPE_ROW_HEIGHT",V[V.PROP_TYPE_FORMAT=82]="PROP_TYPE_FORMAT",V[V.PROP_TYPE_ATTRIBUTE=83]="PROP_TYPE_ATTRIBUTE",V[V.PROP_TYPE_EXPAND_WINDOW=84]="PROP_TYPE_EXPAND_WINDOW",V[V.PROP_TYPE_PASSWORD=85]="PROP_TYPE_PASSWORD",V[V.PROP_TYPE_TAB_CONTROL_SIDE=87]="PROP_TYPE_TAB_CONTROL_SIDE",V[V.PROP_TYPE_IMAGE_FILENAME=88]="PROP_TYPE_IMAGE_FILENAME",V[V.PROP_TYPE_IMAGE_STYLE=89]="PROP_TYPE_IMAGE_STYLE",V[V.PROP_TYPE_BUTTON_STYLE=96]="PROP_TYPE_BUTTON_STYLE",V[V.PROP_TYPE_RETURN_ACTION=97]="PROP_TYPE_RETURN_ACTION",V[V.PROP_TYPE_RANGE=98]="PROP_TYPE_RANGE",V[V.PROP_TYPE_PARAMETERS=126]="PROP_TYPE_PARAMETERS",V[V.PROP_TYPE_FRAME_NAME=127]="PROP_TYPE_FRAME_NAME",V[V.PROP_TYPE_HEBREW=130]="PROP_TYPE_HEBREW",V[V.PROP_TYPE_TRANSLATOR=132]="PROP_TYPE_TRANSLATOR",V[V.PROP_TYPE_SORT_COLUMN=134]="PROP_TYPE_SORT_COLUMN",V[V.PROP_TYPE_COLUMN_PLACEMENT=138]="PROP_TYPE_COLUMN_PLACEMENT",V[V.PROP_TYPE_COLUMN_TITLE=139]="PROP_TYPE_COLUMN_TITLE",V[V.PROP_TYPE_SUBFORM_TYPE=156]="PROP_TYPE_SUBFORM_TYPE",V[V.PROP_TYPE_PRGTSK_NUM=183]="PROP_TYPE_PRGTSK_NUM",V[V.PROP_TYPE_COLUMN_DIVIDER=189]="PROP_TYPE_COLUMN_DIVIDER",V[V.PROP_TYPE_ALLOW_COL_RESIZE=191]="PROP_TYPE_ALLOW_COL_RESIZE",V[V.PROP_TYPE_TASK_MODE=197]="PROP_TYPE_TASK_MODE",V[V.PROP_TYPE_END_CONDITION=198]="PROP_TYPE_END_CONDITION",V[V.PROP_TYPE_EVAL_END_CONDITION=199]="PROP_TYPE_EVAL_END_CONDITION",V[V.PROP_TYPE_SELECTION=200]="PROP_TYPE_SELECTION",V[V.PROP_TYPE_ALLOW_MODIFY=201]="PROP_TYPE_ALLOW_MODIFY",V[V.PROP_TYPE_ALLOW_CREATE=202]="PROP_TYPE_ALLOW_CREATE",V[V.PROP_TYPE_ALLOW_DELETE=203]="PROP_TYPE_ALLOW_DELETE",V[V.PROP_TYPE_CONFIRM_UPDATE=204]="PROP_TYPE_CONFIRM_UPDATE",V[V.PROP_TYPE_CONFIRM_CANCEL=205]="PROP_TYPE_CONFIRM_CANCEL",V[V.PROP_TYPE_FORCE_SUFFIX=206]="PROP_TYPE_FORCE_SUFFIX",V[V.PROP_TYPE_TRASACTION_BEGIN=207]="PROP_TYPE_TRASACTION_BEGIN",V[V.PROP_TYPE_REPEATABLE=208]="PROP_TYPE_REPEATABLE",V[V.PROP_TYPE_HIGHLIGHTING=216]="PROP_TYPE_HIGHLIGHTING",V[V.PROP_TYPE_SELECTION_ROWS=217]="PROP_TYPE_SELECTION_ROWS",V[V.PROP_TYPE_BEFORE_900_VERSION=225]="PROP_TYPE_BEFORE_900_VERSION",V[V.PROP_TYPE_FORCE_DELETE=233]="PROP_TYPE_FORCE_DELETE",V[V.PROP_TYPE_TRIGGER=234]="PROP_TYPE_TRIGGER",V[V.PROP_TYPE_TOP_BORDER=237]="PROP_TYPE_TOP_BORDER",V[V.PROP_TYPE_RIGHT_BORDER=238]="PROP_TYPE_RIGHT_BORDER",V[V.PROP_TYPE_WINDOW_WIDTH=241]="PROP_TYPE_WINDOW_WIDTH",V[V.PROP_TYPE_NODE_ID=247]="PROP_TYPE_NODE_ID",V[V.PROP_TYPE_NODE_PARENTID=248]="PROP_TYPE_NODE_PARENTID",V[V.PROP_TYPE_SHOW_BUTTONS=249]="PROP_TYPE_SHOW_BUTTONS",V[V.PROP_TYPE_SHOW_LINES=250]="PROP_TYPE_SHOW_LINES",V[V.PROP_TYPE_SHOW_FULL_ROW=252]="PROP_TYPE_SHOW_FULL_ROW",V[V.PROP_TYPE_TRACK_SELECTION=253]="PROP_TYPE_TRACK_SELECTION",V[V.PROP_TYPE_EXPANDED_IMAGEIDX=256]="PROP_TYPE_EXPANDED_IMAGEIDX",V[V.PROP_TYPE_COLLAPSED_IMAGEIDX=257]="PROP_TYPE_COLLAPSED_IMAGEIDX",V[V.PROP_TYPE_PARKED_IMAGEIDX=258]="PROP_TYPE_PARKED_IMAGEIDX",V[V.PROP_TYPE_LINES_AT_ROOT=267]="PROP_TYPE_LINES_AT_ROOT",V[V.PROP_TYPE_TAB_IN=269]="PROP_TYPE_TAB_IN",V[V.PROP_TYPE_STARTUP_POSITION=275]="PROP_TYPE_STARTUP_POSITION",V[V.PROP_TYPE_ALLOW_DRAGGING=283]="PROP_TYPE_ALLOW_DRAGGING",V[V.PROP_TYPE_ALLOW_DROPPING=284]="PROP_TYPE_ALLOW_DROPPING",V[V.PROP_TYPE_IS_CACHED=286]="PROP_TYPE_IS_CACHED",V[V.PROP_TYPE_SELECTION_MODE=288]="PROP_TYPE_SELECTION_MODE",V[V.PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX=290]="PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX",V[V.PROP_TYPE_DISPLAY_LIST=303]="PROP_TYPE_DISPLAY_LIST",V[V.PROP_TYPE_FORM_NAME=311]="PROP_TYPE_FORM_NAME",V[V.PROP_TYPE_AUTO_REFRESH=312]="PROP_TYPE_AUTO_REFRESH",V[V.PROP_TYPE_AUTO_FIT=313]="PROP_TYPE_AUTO_FIT",V[V.PROP_TYPE_TAB_ORDER=314]="PROP_TYPE_TAB_ORDER",V[V.PROP_TYPE_ALLOW_PARKING=315]="PROP_TYPE_ALLOW_PARKING",V[V.PROP_TYPE_ALLOWED_DIRECTION=317]="PROP_TYPE_ALLOWED_DIRECTION",V[V.PROP_TYPE_TABBING_ORDER=318]="PROP_TYPE_TABBING_ORDER",V[V.PROP_TYPE_HOT_TRACK=354]="PROP_TYPE_HOT_TRACK",V[V.PROP_TYPE_TAB_CONTROL_TABS_WIDTH=355]="PROP_TYPE_TAB_CONTROL_TABS_WIDTH",V[V.PROP_TYPE_IMAGE_LIST_INDEXES=356]="PROP_TYPE_IMAGE_LIST_INDEXES",V[V.PROP_TYPE_WINDOW_TYPE=358]="PROP_TYPE_WINDOW_TYPE",V[V.PROP_TYPE_DISPLAY_TOOLBAR=360]="PROP_TYPE_DISPLAY_TOOLBAR",V[V.PROP_TYPE_DISPLAY_STATUS_BAR=361]="PROP_TYPE_DISPLAY_STATUS_BAR",V[V.PROP_TYPE_STARTUP_MODE=362]="PROP_TYPE_STARTUP_MODE",V[V.PROP_TYPE_THREE_STATES=390]="PROP_TYPE_THREE_STATES",V[V.PROP_TYPE_CHECKBOX_MAIN_STYLE=391]="PROP_TYPE_CHECKBOX_MAIN_STYLE",V[V.PROP_TYPE_RAISE_AT=395]="PROP_TYPE_RAISE_AT",V[V.PROP_TYPE_DISPLAY_MENU=396]="PROP_TYPE_DISPLAY_MENU",V[V.PROP_TYPE_RADIO_BUTTON_APPEARANCE=401]="PROP_TYPE_RADIO_BUTTON_APPEARANCE",V[V.PROP_TYPE_DEFAULT_BUTTON=408]="PROP_TYPE_DEFAULT_BUTTON",V[V.PROP_TYPE_ROW_HIGHLIGHT_STYLE=409]="PROP_TYPE_ROW_HIGHLIGHT_STYLE",V[V.PROP_TYPE_ROW_HIGHLIGHT_COLOR=410]="PROP_TYPE_ROW_HIGHLIGHT_COLOR",V[V.PROP_TYPE_BOTTOM_POSITION_INTERVAL=411]="PROP_TYPE_BOTTOM_POSITION_INTERVAL",V[V.PROP_TYPE_MINIMUM_WIDTH=418]="PROP_TYPE_MINIMUM_WIDTH",V[V.PROP_TYPE_MINIMUM_HEIGHT=419]="PROP_TYPE_MINIMUM_HEIGHT",V[V.PROP_TYPE_SHOW_IN_WINDOW_MENU=422]="PROP_TYPE_SHOW_IN_WINDOW_MENU",V[V.PROP_TYPE_SET_COLOR_BY=428]="PROP_TYPE_SET_COLOR_BY",V[V.PROP_TYPE_ALTERNATING_BG_COLOR=429]="PROP_TYPE_ALTERNATING_BG_COLOR",V[V.PROP_TYPE_ALLOW_REORDER=430]="PROP_TYPE_ALLOW_REORDER",V[V.PROP_TYPE_PARK_ON_CLICK=433]="PROP_TYPE_PARK_ON_CLICK",V[V.PROP_TYPE_TASK_ID=440]="PROP_TYPE_TASK_ID",V[V.PROP_TYPE_PULLDOWN_MENU=441]="PROP_TYPE_PULLDOWN_MENU",V[V.PROP_TYPE_CONTEXT_MENU=442]="PROP_TYPE_CONTEXT_MENU",V[V.PROP_TYPE_DISPLAY_FIELD=443]="PROP_TYPE_DISPLAY_FIELD",V[V.PROP_TYPE_LINK_FIELD=444]="PROP_TYPE_LINK_FIELD",V[V.PROP_TYPE_INDEX=445]="PROP_TYPE_INDEX",V[V.PROP_TYPE_PRELOAD_VIEW=446]="PROP_TYPE_PRELOAD_VIEW",V[V.PROP_TYPE_WALLPAPER_STYLE=448]="PROP_TYPE_WALLPAPER_STYLE",V[V.PROP_TYPE_PART_OF_DATAVIEW=449]="PROP_TYPE_PART_OF_DATAVIEW",V[V.PROP_TYPE_BORDER=452]="PROP_TYPE_BORDER",V[V.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL=455]="PROP_TYPE_MULTILINE_WORDWRAP_SCROLL",V[V.PROP_TYPE_ALLOW_QUERY=456]="PROP_TYPE_ALLOW_QUERY",V[V.PROP_TYPE_MAIN_DISPLAY=457]="PROP_TYPE_MAIN_DISPLAY",V[V.PROP_TYPE_DEST_SUBFORM=458]="PROP_TYPE_DEST_SUBFORM",V[V.PROP_TYPE_HORIZONTAL_PLACEMENT=459]="PROP_TYPE_HORIZONTAL_PLACEMENT",V[V.PROP_TYPE_VERTICAL_PLACEMENT=460]="PROP_TYPE_VERTICAL_PLACEMENT",V[V.PROP_TYPE_FRAMESET_STYLE=461]="PROP_TYPE_FRAMESET_STYLE",V[V.PROP_TYPE_FRAME_TYPE=462]="PROP_TYPE_FRAME_TYPE",V[V.PROP_TYPE_ALLOW_EMPTY_DATAVIEW=463]="PROP_TYPE_ALLOW_EMPTY_DATAVIEW",V[V.PROP_TYPE_SHOW_TITLE=464]="PROP_TYPE_SHOW_TITLE",V[V.PROP_TYPE_TABBING_CYCLE=465]="PROP_TYPE_TABBING_CYCLE",V[V.PROP_TYPE_REFRESH_WHEN_HIDDEN=472]="PROP_TYPE_REFRESH_WHEN_HIDDEN",V[V.PROP_TYPE_HOVERING_COLOR=473]="PROP_TYPE_HOVERING_COLOR",V[V.PROP_TYPE_VISITED_COLOR=474]="PROP_TYPE_VISITED_COLOR",V[V.PROP_TYPE_ALLOW_OPTION=475]="PROP_TYPE_ALLOW_OPTION",V[V.PROP_TYPE_VISIBLE_LAYERS_LIST=476]="PROP_TYPE_VISIBLE_LAYERS_LIST",V[V.PROP_TYPE_INTERACTIVE=477]="PROP_TYPE_INTERACTIVE",V[V.PROP_TYPE_OBJECT_TYPE=478]="PROP_TYPE_OBJECT_TYPE",V[V.PROP_TYPE_OBJECT_PROPERTIES=479]="PROP_TYPE_OBJECT_PROPERTIES",V[V.PROP_TYPE_GRADIENT_COLOR=480]="PROP_TYPE_GRADIENT_COLOR",V[V.PROP_TYPE_GRADIENT_STYLE=481]="PROP_TYPE_GRADIENT_STYLE",V[V.PROP_TYPE_RETAIN_FOCUS=482]="PROP_TYPE_RETAIN_FOCUS",V[V.PROP_TYPE_REAL_OBJECT_TYPE=483]="PROP_TYPE_REAL_OBJECT_TYPE",V[V.PROP_TYPE_ALLOW_LOCATE_IN_QUERY=486]="PROP_TYPE_ALLOW_LOCATE_IN_QUERY",V[V.PROP_TYPE_LOAD_IMAGE_FROM=487]="PROP_TYPE_LOAD_IMAGE_FROM",V[V.PROP_TYPE_PRINT_DATA=488]="PROP_TYPE_PRINT_DATA",V[V.PROP_TYPE_ALLOW_RANGE=489]="PROP_TYPE_ALLOW_RANGE",V[V.PROP_TYPE_ALLOW_LOCATE=490]="PROP_TYPE_ALLOW_LOCATE",V[V.PROP_TYPE_ALLOW_SORT=491]="PROP_TYPE_ALLOW_SORT",V[V.PROP_TYPE_DEST_SUBFORM_NAME=492]="PROP_TYPE_DEST_SUBFORM_NAME",V[V.PROP_TYPE_PERSISTENT_FORMSTATE=493]="PROP_TYPE_PERSISTENT_FORMSTATE",V[V.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU=496]="PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU",V[V.PROP_TYPE_ROW_PLACEMENT=572]="PROP_TYPE_ROW_PLACEMENT",V[V.PROP_TYPE_ADDITIONAL_INFORMATION=573]="PROP_TYPE_ADDITIONAL_INFORMATION",V[V.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS=592]="PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS",V[V.PROP_TYPE_TASK_PROPERTIES_RETURN_VALUE=596]="PROP_TYPE_TASK_PROPERTIES_RETURN_VALUE",V[V.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE=604]="PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE",V[V.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW=619]="PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW",V[V.PROP_TYPE_TASK_PROPERTIES_MAIN_DISPLAY=621]="PROP_TYPE_TASK_PROPERTIES_MAIN_DISPLAY",V[V.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX=630]="PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX",V[V.PROP_TYPE_TASK_PROPERTIES_LOCATE=634]="PROP_TYPE_TASK_PROPERTIES_LOCATE",V[V.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER=635]="PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER",V[V.PROP_TYPE_TASK_PROPERTIES_POSITION=636]="PROP_TYPE_TASK_PROPERTIES_POSITION",V[V.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE=637]="PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE",V[V.PROP_TYPE_TASK_PROPERTIES_RANGE=638]="PROP_TYPE_TASK_PROPERTIES_RANGE",V[V.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER=639]="PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER",V[V.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE=640]="PROP_TYPE_TASK_PROPERTIES_SQL_RANGE",V[V.PROP_TYPE_TASK_PROPERTIES_DB_SQL_RANGE=641]="PROP_TYPE_TASK_PROPERTIES_DB_SQL_RANGE",V[V.PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE=645]="PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE",V[V.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION=653]="PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION",V[V.PROP_TYPE_DATAVIEWCONTROL=656]="PROP_TYPE_DATAVIEWCONTROL",V[V.PROP_TYPE_DATAVIEWCONTROL_FIELDS=657]="PROP_TYPE_DATAVIEWCONTROL_FIELDS",V[V.PROP_TYPE_POP_UP=658]="PROP_TYPE_POP_UP",V[V.PROP_TYPE_ORIENTATION_LOCK=659]="PROP_TYPE_ORIENTATION_LOCK",V[V.PROP_TYPE_ENTER_ANIMATION=660]="PROP_TYPE_ENTER_ANIMATION",V[V.PROP_TYPE_EXIT_ANIMATION=661]="PROP_TYPE_EXIT_ANIMATION",V[V.PROP_TYPE_NAVIGATION_DRAWER_MENU=662]="PROP_TYPE_NAVIGATION_DRAWER_MENU",V[V.PROP_TYPE_TITLE_BAR_COLOR=663]="PROP_TYPE_TITLE_BAR_COLOR",V[V.PROP_TYPE_MOBILE_BORDER_WIDTH=664]="PROP_TYPE_MOBILE_BORDER_WIDTH",V[V.PROP_TYPE_BORDER_COLOR=665]="PROP_TYPE_BORDER_COLOR",V[V.PROP_TYPE_BORDER_FOCUS_WIDTH=666]="PROP_TYPE_BORDER_FOCUS_WIDTH",V[V.PROP_TYPE_BORDER_FOCUS_COLOR=667]="PROP_TYPE_BORDER_FOCUS_COLOR",V[V.PROP_TYPE_CORNER_RADIUS=668]="PROP_TYPE_CORNER_RADIUS",V[V.PROP_TYPE_OPEN_PICKER=669]="PROP_TYPE_OPEN_PICKER",V[V.PROP_TYPE_OPEN_EDIT_DIALOG=670]="PROP_TYPE_OPEN_EDIT_DIALOG",V[V.PROP_TYPE_DEFAULT_ALIGNMENT=671]="PROP_TYPE_DEFAULT_ALIGNMENT",V[V.PROP_TYPE_HINT=672]="PROP_TYPE_HINT",V[V.PROP_TYPE_KEYBOARD_TYPE=673]="PROP_TYPE_KEYBOARD_TYPE",V[V.PROP_TYPE_KEYBOARD_RETURN_KEY=674]="PROP_TYPE_KEYBOARD_RETURN_KEY",V[V.PROP_TYPE_ALLOW_SUGGESTIONS=675]="PROP_TYPE_ALLOW_SUGGESTIONS",V[V.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME=676]="PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME",V[V.PROP_TYPE_TITLE_COLOR=677]="PROP_TYPE_TITLE_COLOR",V[V.PROP_TYPE_FOCUS_COLOR=678]="PROP_TYPE_FOCUS_COLOR",V[V.PROP_TYPE_SWIPE_REFRESH=679]="PROP_TYPE_SWIPE_REFRESH",V[V.PROP_TYPE_ACTION_BAR_MENU=683]="PROP_TYPE_ACTION_BAR_MENU",V[V.PROP_TYPE_TOP_BORDER_MARGIN=684]="PROP_TYPE_TOP_BORDER_MARGIN",V[V.PROP_TYPE_DIVIDER_COLOR=685]="PROP_TYPE_DIVIDER_COLOR",V[V.PROP_TYPE_HOT_TRACK_COLOR=686]="PROP_TYPE_HOT_TRACK_COLOR",V[V.PROP_TYPE_COL_ALLOW_FILTERING=687]="PROP_TYPE_COL_ALLOW_FILTERING",V[V.PROP_TYPE_FILL_WIDTH=688]="PROP_TYPE_FILL_WIDTH",V[V.PROP_TYPE_TITLE_PADDING=689]="PROP_TYPE_TITLE_PADDING",V[V.PROP_TYPE_HINT_COLOR=691]="PROP_TYPE_HINT_COLOR",V[V.PROP_TYPE_MULTI_COLUMN_DISPLAY=692]="PROP_TYPE_MULTI_COLUMN_DISPLAY",V[V.PROP_TYPE_SELECTED_TAB_COLOR=694]="PROP_TYPE_SELECTED_TAB_COLOR",V[V.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION=696]="PROP_TYPE_PERSISTENT_FORM_STATE_VERSION",V[V.PROP_TYPE_INACTIVE_ROW_HIGHLIGHT_COLOR=697]="PROP_TYPE_INACTIVE_ROW_HIGHLIGHT_COLOR",V[V.PROP_TYPE_ROW_BG_COLOR=698]="PROP_TYPE_ROW_BG_COLOR",V[V.PROP_TYPE_SHOW_ELLIPISIS=699]="PROP_TYPE_SHOW_ELLIPISIS",V[V.PROP_TYPE_SCROLL_BAR_THUMB=700]="PROP_TYPE_SCROLL_BAR_THUMB",V[V.PROP_TYPE_IS_ROUTER_OUTLET=707]="PROP_TYPE_IS_ROUTER_OUTLET",V[V.PROP_TYPE_DEFAULT_OUTLET=712]="PROP_TYPE_DEFAULT_OUTLET",V[V.PROP_TYPE_CUSTOM_PROPERTIES=713]="PROP_TYPE_CUSTOM_PROPERTIES",V[V.PROP_TYPE_CUSTOM_VALIDATORS=732]="PROP_TYPE_CUSTOM_VALIDATORS",V[V.PROP_TYPE_BINDING_LEVEL=733]="PROP_TYPE_BINDING_LEVEL",V[V.PROP_TYPE_SERVER_READ_AHEAD=736]="PROP_TYPE_SERVER_READ_AHEAD";var x=function(){};x.Environment=null;var X=function(){function n(){}return n.SetCurrentContextID=function(t){n._currentContextID=t},n.GetCurrentContextID=function(){return n._currentContextID},n.GetDelayWait=function(){return n._delayWait},n.CanFocus=function(t){return!1},n.Init=function(t){},n.Abort=function(t,e){if(null===t.getSubFormCtrl()&&t.Opened){if(t.isDialog()){this.IsOverlayOpen=!1;var r=t.getTopMostFrameForm();null!==r&&r.UpdateModalFormsCount(t,!1)}F.addCloseForm(t,"0",t.getTask().getTaskTag()),F.beginInvoke()}},n.GetCtrlVal=function(t){return F.getValue(t,t.getDisplayLine(!0))},n.SetReadOnlyControl=function(e,n){return s(this,void 0,void 0,(function(){return _(this,(function(i){switch(i.label){case 0:return e.isTextControl()||e.IsRepeatable?r.UtilStrByteMode.isLocaleDefLangDBCS()?[4,e.getForm().getTask().checkProp(t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY,!1)]:[3,2]:[3,3];case 1:if(i.sent())return[2];i.label=2;case 2:F.addOperationWithLine(t.CommandType.SET_PROPERTY,e,e.getDisplayLine(!1),t.HtmlProperties.ReadOnly,n),F.beginInvoke(),i.label=3;case 3:return[2]}}))}))},n.OpenForm=function(t){if(!t.Opened&&(t.getTask().IsInteractive||t.getTask().isOpenWin())){if(!t.isSubForm()&&t.isDialog()){this.IsOverlayOpen=!0;var e=t.getTopMostFrameForm();null!==e&&e.UpdateModalFormsCount(t,!0)}t.Opened=!0,F.beginInvoke()}},n.DoFirstRefreshTable=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return null===t||t.ignoreFirstRefreshTable?[3,2]:(t.ignoreFirstRefreshTable=!0,[4,t.firstTableRefresh()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.CaretPosGet=function(t){var e=0;return t.isTextControl()&&(e=F.caretPosGet(t,t.getDisplayLine(!0))),e},n.ClearStatusBar=function(t){var r=t.getLastParkedCtrl();null===r||e.NString.IsNullOrEmpty(r.PromptHelp)?n.CleanMessagePane(t):t.WriteToMessagePane(r.PromptHelp,!1)},n.CleanMessagePane=function(t){t.WriteToMessagePane(n.GetCurrentRuntimeContext().DefaultStatusMsg,!1)},n.GetMessage=function(t){if(null===t)t="";else if(t.length>0){var e=t.indexOf("\r");-1!==e&&(t=t.substr(0,e));var r=t.indexOf("\n");-1!==r&&(t=t.substr(0,r))}return t},n.SetEditText=function(t,e){F.setEditText(t,t.getDisplayLine(!0),e)},n.InsertEditText=function(t,e,r){F.insertEditText(t,t.getDisplayLine(!0),e,r)},n.GetTooltipTimeout=function(){return x.Environment.GetTooltipTimeout()},n.GetSpecialEditLeftAlign=function(){return x.Environment.GetSpecialEditLeftAlign()},n.GetDefaultDateFormat=function(){var t="",e=x.Environment.GetDate();switch(x.Environment.GetDateMode(0)){case"S":t="YYYY"+e+"MM"+e+"DD";break;case"B":case"E":t="DD"+e+"MM"+e+"YYYY";break;case"A":t="MM"+e+"DD"+e+"YYYY"}return t},n.GetDefaultTimeFormat=function(){var t=x.Environment.GetTime();return"HH"+t+"MM"+t+"SS"},n.GetCurrentRuntimeContext=function(){return E.GetRuntimeContext(n.GetCurrentContextID())},n.GetContextID=function(t){var e=null;return t instanceof k?e=t.GuiMgForm:t instanceof T&&(e=t),E.GetContextID(e)},n.ShowWindowHelp=function(t,e,r){},n.GetSpecialValNewPolicy=function(){return x.Environment.GetSpecialValNewPolicy()},n}();X.IsOverlayOpen=!1,X._delayWait=new Object,X._clipboardData="",X._currentContextID="\0",X.DefaultProtocol=null,X.DefaultServerName=null,X.UtilImeJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new r.UtilImeJpn:null,X.EventsManager=null;var H=function(){function t(t){this._prevContextID="\0",this._fileName=null,0!==arguments.length?this.constructor_1(t):this.constructor_0()}return t.prototype.constructor_0=function(){this._prevContextID=X.GetCurrentContextID(),this.SaveFilename()},t.prototype.constructor_1=function(t){this.SetCurrent(t),this.SaveFilename()},t.prototype.SetCurrent=function(t){t!==this._prevContextID&&(this._prevContextID=t,X.SetCurrentContextID(t))},t.prototype.SaveFilename=function(){var t=new e.StackFrame(1,!0);this._fileName=t.GetFileName()},t.prototype.Dispose=function(){this._prevContextID!==X.GetCurrentContextID()&&X.SetCurrentContextID(this._prevContextID)},t}(),W=function(){};W.DEFAULT_LIST_VALUE=-1,W.DEFAULT_VALUE_INT=-999999,W.ALL_LINES=-1,W.NO_ROW_SELECTED=e.Int32.MinValue,W.RIA_MOBILE_UNSUPPORTED_CONTROL_ERROR="control is not supported for mobile RIA deployment",W.RIA_MOBILE_UNSUPPORTED_CONTROL_ERROR_WINDOW_6="control is not supported for mobile RIA deployment on Window 6 standard",W.TOOL_HEIGHT=17,W.TOOL_WIDTH=16,W.STR_DISPLAY_MEMBER="DisplayMember",W.STR_VALUE_MEMBER="ValueMember",W.PARENT_TYPE_TASK="T",W.PARENT_TYPE_FORM="F",W.PARENT_TYPE_CONTROL="C",W.GENERIC_PROPERTY_BASE_ID=1e4,W.TABBING_CYCLE_REMAIN_IN_CURRENT_RECORD="R",W.TABBING_CYCLE_MOVE_TO_NEXT_RECORD="N",W.TABBING_CYCLE_MOVE_TO_PARENT_TASK="P",W.BLOB_PREFIX_ELEMENTS_COUNT=5,W.KEY_DOWN=40,W.KEY_RIGHT=39,W.KEY_UP=38,W.KEY_LEFT=37,W.KEY_HOME=36,W.KEY_END=35,W.KEY_PG_DOWN=34,W.KEY_PG_UP=33,W.KEY_SPACE=32,W.KEY_F12=123,W.KEY_F1=112,W.KEY_9=57,W.KEY_0=48,W.KEY_Z=90,W.KEY_A=65,W.KEY_DELETE=46,W.KEY_INSERT=45,W.KEY_BACKSPACE=8,W.KEY_TAB=9,W.KEY_RETURN=13,W.KEY_ESC=27,W.KEY_CAPS_LOCK=20,W.KEY_POINT1=190,W.KEY_POINT2=110,W.KEY_COMMA=188,W.KEY_CTRL=17,W.KEY_ALT=18,W.LOGON_CAPTION="Logon - ",W.ENTER_UID_TTL="Please enter your user ID and password.",W.GROUP_BOX_TITLE_MAX_SIZE=62,W.MSG_CAPTION_MAX_SIZE=56,W.LABEL_CAPTION_MAX_SIZE=9,W.PASSWORD_CAPTION_MAX_SIZE=19,W.REPLACE_ALL_TEXT=-1,W.STR_LOGON_RTL="LogonRTL",W.STR_LOGO_WIN_ICON_URL="LogonWindowIconURL",W.STR_LOGON_IMAGE_URL="LogonImageURL",W.STR_LOGON_WIN_TITLE="LogonWindowTitle",W.STR_LOGON_GROUP_TITLE="LogonGroupTitle",W.STR_LOGON_MSG_CAPTION="LogonMessageCaption",W.STR_LOGON_USER_ID_CAPTION="LogonUserIDCaption",W.STR_LOGON_PASS_CAPTION="LogonPasswordCaption",W.STR_LOGON_OK_CAPTION="LogonOKCaption",W.STR_LOGON_CANCEL_CAPTION="LogonCancelCaption";var K=function(){function t(){}return t.getContentType=function(t){try{return r.StrUtil.tokenize(t,/,|;/)[4].charAt(0)}catch(t){throw new e.ApplicationException(" in BlobType.getContentType blob is in invalid format")}},t.getEmptyBlobPrefix=function(t){return e.NString.Format("0,0,{0},{1},0","\0",t)},t.getBlobPrefixForContentType=function(t){return e.NString.Format("0,0,{0},{0},{1};","\0",t)},t.getPrefix=function(t){var e=t.indexOf(";");return t.substr(0,e+1)},t.getEncodingFromContentType=function(r){return r===t.CONTENT_TYPE_UNICODE?e.Encoding.Unicode:r===t.CONTENT_TYPE_ANSI?x.Environment.GetEncoding():e.ISO_8859_1_Encoding.ISO_8859_1},t.MbToUnicode=function(t){var r=null;try{var n=x.Environment.GetEncoding().GetString(t,0,t.length);r=e.Encoding.Unicode.GetBytes(n)}catch(t){r=null}return r},t.UnicodeToMb=function(t){var r=null;try{var n=e.Encoding.Unicode.GetString(t,0,t.length);r=x.Environment.GetEncoding().GetBytes(n)}catch(t){r=null}return r},t.getString=function(r){var n=null,i=null;if(t.isValidBlob(r)){var o=t.getContentType(r);o!==t.CONTENT_TYPE_UNICODE&&(o=t.CONTENT_TYPE_ANSI);try{i=t.getBytes(r);var a=(n=t.getEncodingFromContentType(o).GetString(i,0,i.length)).indexOf("\0");-1!==a&&(n=n.substr(0,a))}catch(t){n=null}}else e.Debug.Assert(!1);return n},t.createFromString=function(e,r){var n=null,i=r,o=null;r!==t.CONTENT_TYPE_UNICODE&&(i=t.CONTENT_TYPE_ANSI);try{if(e.constructor===ArrayBuffer)o=new Uint8Array(e);else o=t.getEncodingFromContentType(i).GetBytes(e);n=t.createFromBytes(o,r)}catch(t){n=null}return n},t.getBytes=function(r){var n=null,i=t.removeBlobPrefix(r);try{n=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(i)}catch(t){n=null}return n},t.createFromBytes=function(r,n){var i,o;i=t.getBlobPrefixForContentType(n);try{o=e.ISO_8859_1_Encoding.ISO_8859_1.GetString(r,0,r.length)}catch(t){o=null}return i+o},t.copyBlob=function(e,r){var n,i;if(null===r)return null;if(null===e)return r;n=t.getBytes(r);var o=t.getContentType(e),a=t.getContentType(r);return i=a===t.CONTENT_TYPE_ANSI&&o===t.CONTENT_TYPE_UNICODE?t.MbToUnicode(n):a===t.CONTENT_TYPE_UNICODE&&o===t.CONTENT_TYPE_ANSI?t.UnicodeToMb(n):n,e=t.createFromBytes(i,o)},t.removeBlobPrefix=function(t){var e;return null!==t?((e=t.indexOf(";"))<0&&r.Logger.Instance.WriteToLog("Error: invalid blob prefix",!0),t.substr(e+1)):null},t.isValidBlob=function(e){var r=!0;if((null===e||e.indexOf(";")<0)&&(r=!1),r){var n=t.getContentType(e);n!==t.CONTENT_TYPE_ANSI&&n!==t.CONTENT_TYPE_BINARY&&n!==t.CONTENT_TYPE_UNICODE&&n!==t.CONTENT_TYPE_UNKNOWN&&(r=!1)}return r},t.setContentType=function(t,n){var i="";try{for(var o=t.indexOf(";"),a=t.substr(0,o),s=t.length-(a.length+1),_=t.substr(o+1,s),l=r.StrUtil.tokenize(a,/,|;/),u=0;u<W.BLOB_PREFIX_ELEMENTS_COUNT;u+=1)i=4===u?i+n+",":i+l[u]+",";return i.substr(0,i.length-1)+";"+_}catch(t){throw new e.ApplicationException(" in BlobType.setContentType : invalid format")}},t.SetVecCellAttr=function(t,n){var i="";try{for(var o=t.indexOf(";"),a=t.substr(0,o),s=t.substr(o+1),_=r.StrUtil.tokenize(a,/,|;/),l=0;l<W.BLOB_PREFIX_ELEMENTS_COUNT;l+=1)i=3===l?i+n+",":i+_[l]+",";return i.substr(0,i.length-1)+";"+s}catch(t){throw new e.ApplicationException(" in XMLparser.blobPrefixLength invalid format")}},t.GetVecCellAttr=function(t){try{return r.StrUtil.tokenize(t,/,|;/)[3].charAt(0)}catch(t){throw new e.ApplicationException(" in BlobType.GetVecCellAttr(): blob is in invalid format")}},t.blobPrefixLength=function(t){try{var n=t.indexOf(";")+1,i=t.substr(0,n);if(n>0)if(r.StrUtil.tokenize(i,",").length===W.BLOB_PREFIX_ELEMENTS_COUNT)return n}catch(t){}throw new e.ApplicationException(" in XMLparser.blobPrefixLength invalid format")},t.getKey=function(t){var n=r.StrUtil.tokenize(t,/,|;/),i=0;if(n.length>5)try{i=e.NNumber.Parse(n[0])}catch(t){}return i},t.getBlobSize=function(t){var e=0;try{var n=r.StrUtil.tokenize(t,/,|;/);if(n.length>5){e=t.length;for(var i=0;i<5;i+=1)e-=n[i].length,e-=1}}catch(t){}return e},t.ParseContentType=function(e){var r=" ";switch(e){case 0:r=t.CONTENT_TYPE_UNKNOWN;break;case 1:r=t.CONTENT_TYPE_ANSI;break;case 2:r=t.CONTENT_TYPE_UNICODE;break;case 3:r=t.CONTENT_TYPE_BINARY}return r},t}();K.CONTENT_TYPE_UNKNOWN="0",K.CONTENT_TYPE_ANSI="1",K.CONTENT_TYPE_UNICODE="2",K.CONTENT_TYPE_BINARY="3";var z=function(){function t(t,n,i){this._mskLen=0,this._negPref=new e.StringBuilder,this._negSuff=new e.StringBuilder,this._picAttr=r.StorageAttribute.NONE,this._posPref=new e.StringBuilder,this._posSuff=new e.StringBuilder,this._autoSkip_=!1,this._padFill=!1,this._zeroFill=!1,this._comma=!1,this._decimalDigits=0,this._decPointIsFirst=!1,this._decimal=!1,this._embeded=!1,this._formatIdx=0,this._format=null,this.hebrew=!1,this._imeMode=-1,this._left=!1,this._maskLength=0,this._maskChars=0,this._maskSize=0,this._mixed=!1,this._msk=null,this._needLength=!1,this._negative=!1,this._pad="\0",this._prefLen=0,this._size=0,this._suffLen=0,this._termFlag=!1,this._trim=!1,this._whole=0,this._zero="\0",this._picAttr=n,this._picAttr!==r.StorageAttribute.BLOB&&this._picAttr!==r.StorageAttribute.BLOB_VECTOR?(this._format=e.NString.ToCharArray(t),this._formatIdx=0,this._mskLen=this.getMaskLen(i),this.prs_all(i)):t.trim().length>0&&E.WriteDevToLog("PIC.PIC the picture of BLOB must be empty string")}return t.prototype.isHebrew=function(){return this.hebrew},t.prototype.isMixed=function(){return this._mixed},t.prototype.embededChars=function(){return this._embeded},t.prototype.isNegative=function(){return this._negative},t.prototype.withComa=function(){return this._comma},t.prototype.isLeft=function(){return this._left},t.prototype.padFill=function(){return this._padFill},t.prototype.getPad=function(){return this._pad},t.prototype.zeroFill=function(){return this._zeroFill},t.prototype.getZeroPad=function(){return this._zero},t.prototype.isTrimed=function(){return this._trim},t.prototype.autoSkip=function(){return this._autoSkip_},t.prototype.withDecimal=function(){return this._decimal},t.prototype.withTerm=function(){return this._termFlag},t.prototype.getMaskChars=function(){return this._maskChars},t.prototype.getWholes=function(){return this._whole},t.prototype.getDec=function(){return this._decimalDigits},t.prototype.getSize=function(){return this._size},t.prototype.getMaskSize=function(){return this._maskSize},t.prototype.getMaskLength=function(){return this._maskLength},t.prototype.decInFirstPos=function(){return this._decPointIsFirst},t.prototype.getPosPref_=function(){return this._posPref.ToString()},t.prototype.getPosSuff_=function(){return this._posSuff.ToString()},t.prototype.getNegPref_=function(){return this._negPref.ToString()},t.prototype.getNegSuff_=function(){return this._negSuff.ToString()},t.prototype.getMask=function(){return e.NString.FromChars(this._msk)},t.prototype.getFormat=function(){return e.NString.FromChars(this._format)},t.prototype.getAttr=function(){return this._picAttr},t.prototype.setAttr=function(t){this._picAttr},t.prototype.getImeMode=function(){return this._imeMode},t.prototype.prs_all=function(t){if(!this._needLength){this._msk=new Array(this._mskLen);for(var e=0;e<this._msk.length;++e)this._msk[e]="\0"}switch(this._picAttr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:this.alpha_prs();break;case r.StorageAttribute.NUMERIC:this.num_prs();break;case r.StorageAttribute.DATE:this.date_prs(t);break;case r.StorageAttribute.TIME:this.time_prs();break;case r.StorageAttribute.BOOLEAN:this.bool_prs();break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:}},t.prototype.alpha_prs=function(){for(var t,e,n;this._formatIdx<this._format.length;)switch(t=this._format[this._formatIdx]){case"H":this._formatIdx++,this.setHebrew();break;case"A":this._autoSkip_=!0,this._formatIdx++;break;case"#":case"L":case"U":case"X":switch(e=0,t){case"#":e=r.PICInterface.PIC_N;break;case"L":e=r.PICInterface.PIC_L;break;case"U":e=r.PICInterface.PIC_U;break;case"X":e=r.PICInterface.PIC_X}this._formatIdx++,n=this.pik_count(),this.pik_drv_fill(e,n);break;default:if(r.UtilStrByteMode.isLocaleDefLangDBCS()){var i=r.UtilStrByteMode.isLocaleDefLangJPN();if("K"===t&&i&&this.pic_kanji())break;if(x.Environment.GetLocalAs400Set()&&(e=0,"J"===t?e=r.PICInterface.PIC_J:"T"===t?e=r.PICInterface.PIC_T:"G"===t?e=r.PICInterface.PIC_G:"S"===t&&(e=r.PICInterface.PIC_S),0!==e)){-1===this._imeMode&&i&&(e===r.PICInterface.PIC_J||e===r.PICInterface.PIC_G?this._imeMode=r.UtilImeJpn.IME_ZEN_HIRAGANA_ROMAN:e===r.PICInterface.PIC_S&&(this._imeMode=r.UtilImeJpn.IME_FORCE_OFF)),this._formatIdx++,n=this.pik_count(),this.pik_drv_fill(e,n);break}}r.UtilStrByteMode.isDigit(t)?(n=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,n)):this.pik_mask()}0===this._maskSize&&this.pik_drv_fill(r.PICInterface.PIC_X,this._mskLen),this._size=this._maskSize,this._embeded||(this._size-=this._maskChars)},t.prototype.num_prs=function(){var t,e,n,i,o,a,s=0,_=!0;for(this._zero=" ",this._pad=" ",this._negPref.Append("-"),t=0;t<this._format.length&&("+"!==this._format[t]&&"-"!==this._format[t]);t+=1)"\\"!==this._format[t]&&"P"!==this._format[t]||(t+=1),"C"===this._format[t]&&(this._comma=!0);for(;this._formatIdx<this._format.length;)switch(n=this._format[this._formatIdx]){case"N":this._formatIdx++,this._negative=!0;break;case"C":this._formatIdx++,this._comma=!0;break;case"L":this._formatIdx++,this._left=!0;break;case"P":this._formatIdx++,this._padFill=!0,this._formatIdx<this._format.length&&(this._pad=this._format[this._formatIdx++]);break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case".":this._formatIdx++,this._needLength&&this._maskLength++,this._decimal=!0,this._maskSize<this._mskLen&&(this._msk[this._maskSize]=String.fromCharCode(r.PICInterface.PIC_N)),0===this._maskSize&&(this._decPointIsFirst=!0),this._maskSize++;break;case"+":case"-":this.pik_sign();break;default:r.UtilStrByteMode.isDigit(n)||"#"===n?(o=this._formatIdx,"#"===n&&this._formatIdx++,i=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_N,i),"#"===this._format[o]?(1===i&&(a=this._formatIdx,this._formatIdx=o,s=this.pik_dup(),this._formatIdx=a),_&&(s>0||i>1)&&(i>1&&(s=i),this._comma&&!this._decimal&&this.pik_drv_fill(r.PICInterface.PIC_N,Math.floor((s-1)/3)),_=!1)):this._comma&&!this._decimal&&this.pik_drv_fill(r.PICInterface.PIC_N,Math.floor((i-1)/3)),this._decimal?this._decimalDigits+=i:this._whole+=i):this.pik_mask()}if(this._prefLen=this._posPref.Length,this._suffLen=this._posSuff.Length,this._negative&&(this._negPref.Length>this._prefLen&&(this._prefLen=this._negPref.Length),this._negSuff.Length>this._suffLen&&(this._suffLen=this._negSuff.Length)),0===this._whole&&0===this._decimalDigits&&(i=r.PICInterface.PIC_MAX_MSK_LEN-this._prefLen-this._suffLen,this._maskSize<i&&(this._whole=i-this._maskSize,this._comma&&(this._whole-=Math.floor(this._whole/4)),this.pik_drv_fill(r.PICInterface.PIC_N,this._whole))),this._comma&&(i=Math.floor((this._whole-1)/3),this.pik_drv_fill(r.PICInterface.PIC_N,i),this._maskSize-=i),(t=this._prefLen)>0&&null!=this._msk){if(this._maskSize+t<=this._mskLen){for(e=this._maskSize-1;e>=0;e--)this._msk[e+t]=this._msk[e];for(e=0;e<t;e++)null!=this._msk&&e<this._msk.length&&(this._msk[e]=String.fromCharCode(r.PICInterface.PIC_N))}this._maskSize+=t}if((t=this._suffLen)>0&&null!=this._msk){if(this._maskSize+this._suffLen<=this._mskLen)for(e=0;e<this._suffLen;e++)this._msk[this._maskSize+e]=String.fromCharCode(r.PICInterface.PIC_N);this._maskSize+=t}},t.prototype.date_prs=function(n){var i,o,a,s=0,_=!1,l=!1,u=!1;this._zero=" ",o=0,0!==this._format.length&&"\0"!==this._format[0]||(this._format=e.NString.ToCharArray(t.getDefaultDateMask(x.Environment.GetDateMode(n))));for(var c=0;c<this._format.length;c++)"H"===this._format[c]&&this.setHebrew();for(;this._formatIdx<this._format.length;)switch(this._format[this._formatIdx]){case"H":this._formatIdx++;break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"T":this._formatIdx++,this._trim=!0;break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"L":this.hebrew?(this._formatIdx++,this.pik_drv_fill(r.PICInterface.PIC_HL,1)):this.pik_mask();break;case"Y":switch(s=0,i=a=this.pik_dup(),a){case 1:break;case 2:this.hebrew||(s=r.PICInterface.PIC_YY);break;case 4:s=this.hebrew?r.PICInterface.PIC_HYYYYY:r.PICInterface.PIC_YYYY;break;case 5:case 6:this.hebrew&&(s=r.PICInterface.PIC_HYYYYY)}0!==s?(this._formatIdx+=a,this.pik_drv_fill(s,i)):this.pik_mask();break;case"M":s=0,2===(a=this.pik_dup())?s=r.PICInterface.PIC_MMD:a>2&&(s=r.PICInterface.PIC_MMM,a>10&&(s=0)),0!==s?(this._formatIdx+=a,this.pik_drv_fill(s,a)):this.pik_mask();break;case"D":switch(s=0,a=this.pik_dup()){case 2:if(!this.hebrew){s=r.PICInterface.PIC_DD;break}case 3:s=this.hebrew?r.PICInterface.PIC_HDD:r.PICInterface.PIC_DDD;break;case 4:this.hebrew?this.pik_mask():s=r.PICInterface.PIC_DDDD;break;default:this.pik_mask()}0!==s&&(this.pik_drv_fill(s,a),this._formatIdx+=a);break;case"#":if(2===(a=this.pik_dup())){if(s=0,o++,!this.hebrew)switch(x.Environment.GetDateMode(n)){case"B":case"E":switch(o){case 1:s=r.PICInterface.PIC_DD;break;case 2:s=r.PICInterface.PIC_MMD;break;case 3:s=r.PICInterface.PIC_YY}break;case"A":switch(o){case 1:s=r.PICInterface.PIC_MMD;break;case 2:s=r.PICInterface.PIC_DD;break;case 3:s=r.PICInterface.PIC_YY}break;case"J":case"S":switch(o){case 1:l||(_=e.NString.FromChars(this._format).indexOf("####")>-1,l=!0),_?this.pik_drv_fill(r.PICInterface.PIC_YYYY,4):s=r.PICInterface.PIC_YY;break;case 2:s=r.PICInterface.PIC_MMD;break;case 3:s=r.PICInterface.PIC_DD}}0!==s&&this.pik_drv_fill(s,2)}else if(4===a){if(s=0,o++,!this.hebrew)switch(x.Environment.GetDateMode(n)){case"B":case"E":case"A":3===o&&(s=r.PICInterface.PIC_YYYY);break;case"J":case"S":1===o?s=r.PICInterface.PIC_YYYY:(l||(_=e.NString.FromChars(this._format).indexOf("####")>-1,l=!0),_&&3===o&&this.pik_drv_fill(r.PICInterface.PIC_DD,2))}0!==s&&this.pik_drv_fill(s,4)}this._formatIdx+=a;break;case"W":i=a=this.pik_dup(),1===a?s=r.PICInterface.PIC_W:this.hebrew?5===a?s=r.PICInterface.PIC_WWW:i=0:a>2&&a<=10?s=r.PICInterface.PIC_WWW:i=0,this._formatIdx+=a,this.pik_drv_fill(s,i);break;case"/":this._formatIdx++,this.pik_drv_fill(x.Environment.GetDate().charCodeAt(0),1);break;case"S":r.UtilStrByteMode.isLocaleDefLangJPN()?(i=a=this.pik_dup(),2!==a&&4!==a&&6!==a&&(i=0),s=r.PICInterface.PIC_BB,this._formatIdx+=a,this.pik_drv_fill(s,i)):this.pik_mask();break;case"J":if(r.UtilStrByteMode.isLocaleDefLangJPN()){switch(i=a=this.pik_dup(),u=!0,a){case 1:s=r.PICInterface.PIC_JY1;break;case 2:s=r.PICInterface.PIC_JY2;break;case 4:s=r.PICInterface.PIC_JY4;break;default:i=0,u=!1}this._formatIdx+=a,this.pik_drv_fill(s,i)}else this.pik_mask();break;default:this.pik_mask()}if(!this._needLength&&u)for(i=0;i<this._msk.length;i++)this._msk[i].charCodeAt(0)===r.PICInterface.PIC_YY?this._msk[i]=String.fromCharCode(r.PICInterface.PIC_YJ):this._msk[i].charCodeAt(0)===r.PICInterface.PIC_YYYY&&(this._msk[i]="Y")},t.prototype.time_prs=function(){var t,n,i;for(this._zero=" ",0!==this._format.length&&0!==this._format[0].charCodeAt(0)||(n="HH:MM:SS",this._mskLen<8&&(n=n.substr(0,this._mskLen)),this._format=e.NString.ToCharArray(n));this._formatIdx<this._format.length;){var o=void 0;switch(i=this._format[this._formatIdx]){case"H":case"M":case"S":if(o=2,this._formatIdx+1<this._format.length&&this._format[this._formatIdx]===this._format[this._formatIdx+1]){switch(i){case"H":t=r.PICInterface.PIC_HH;break;case"M":t=r.PICInterface.PIC_MMT;break;case"S":t=r.PICInterface.PIC_SS;break;default:t=r.PICInterface.NULL_CHAR}this._formatIdx+=o,this.pik_drv_fill(t,o)}else this.pik_mask();break;case"m":o=3,this._formatIdx+2<this._format.length&&this._format[this._formatIdx]===this._format[this._formatIdx+1]&&this._format[this._formatIdx+1]===this._format[this._formatIdx+2]?(t=r.PICInterface.PIC_MS,this._formatIdx+=o,this.pik_drv_fill(t,o)):this.pik_mask();break;case":":this._formatIdx++,this.pik_drv_fill(x.Environment.GetTime().charCodeAt(0),1);break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"P":"M"===this._format[this._formatIdx+1]?(this._formatIdx+=2,this.pik_drv_fill(r.PICInterface.PIC_PM,2)):this.pik_mask();break;default:this.pik_mask()}}},t.buildPicture=function(n,i,o,a){var s,_,l,u,c,P,h,T,p,I,f=null,O=new e.StringBuilder(10);switch(n){case r.StorageAttribute.NUMERIC:if(s=x.Environment.GetDecimal(),_=x.Environment.GetThousands(),P=h=0,T=!1,p=!1,I=!1,null===i||0===i.length)P=h=1;else{for(c=i.length,u=0;u<c;){switch(l=i[u]){case"+":case"-":I=!0;break;default:a&&l===s?T=!0:l===_?p=!0:T?h++:P++}u++}O.Append(""+P+s+h),I&&O.Append("N"),p&&O.Append("C")}break;case r.StorageAttribute.DATE:O.Append(this.getDefaultDateMask(x.Environment.GetDateMode(o)));break;case r.StorageAttribute.TIME:O.Append("HH"+x.Environment.GetTime()+"MM"+x.Environment.GetTime()+"SS");break;default:return E.WriteDevToLog("Event.buildPicture() there is no PICTURE building for type :"+n+" and value :"+i),f}return f=new t(O.ToString(),n,o)},t.prototype.setHebrew=function(){"H"===x.Environment.Language&&(this.hebrew=!0)},t.getDefaultDateMask=function(t){var e;switch(t){case"J":case"S":e="####/##/##";break;case"B":case"E":case"A":default:e="##/##/####"}return e},t.prototype.bool_prs=function(){for(var t,e;this._formatIdx<this._format.length;)switch(e=this._format[this._formatIdx]){case"H":this._formatIdx++,this.setHebrew();break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"X":this._formatIdx++,t=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,t);break;default:r.UtilStrByteMode.isDigit(e)?(t=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,t)):this.pik_mask()}0===this._maskSize&&this.pik_drv_fill(r.PICInterface.PIC_X,this._mskLen)},t.prototype.pik_sign=function(){var t,e,r;for(t="+"===this._format[this._formatIdx],this._formatIdx++,t?e=this._posPref:(this._negPref.Remove(0,this._negPref.Length),e=this._negPref);this._formatIdx<this._format.length;)switch(r=this._format[this._formatIdx]){case";":return void this._formatIdx++;case",":this._formatIdx++,e=t?this._posSuff:this._negSuff;break;case"\\":if(this._formatIdx++,this._formatIdx>=this._format.length)return;r=this._format[this._formatIdx];default:e.Append(r),this._formatIdx++}},t.prototype.pik_count=function(){var t,n=x.Environment.GetSpecialValNewPolicy(),i=!1;for(t=0;this._formatIdx<this._format.length&&r.UtilStrByteMode.isDigit(this._format[this._formatIdx]);)t*=10,i=!0,t+=this._format[this._formatIdx].charCodeAt(0)-"0".charCodeAt(0),this._formatIdx++;if(t>32e3)t=32e3;else if(t<=0){if(n&&i&&0===t)return 0;t=1}if(t>e.Int32.MaxValue)throw new e.ApplicationException(E.GetMessageString(r.MsgInterface.STR_ERR_MAX_VAR_SIZE));return t},t.prototype.pik_drv_fill=function(t,e){var r,n=0;if(this._needLength)this._maskLength+=e;else if(r=this._maskSize,this._maskSize+=e,r+e>this._mskLen&&(e=this._mskLen-r),e>0)for(n=0;n<e;n++)this._msk[r+n]=String.fromCharCode(t);else;},t.prototype.pik_mask=function(){var t,e;"\\"===this._format[this._formatIdx]&&this._formatIdx++,this._formatIdx<this._format.length&&(t=this._format[this._formatIdx],this._formatIdx++,e=this.pik_count(),this.pik_drv_fill(t.charCodeAt(0),e),this._maskChars+=e)},t.prototype.pik_dup=function(){var t,e=1,r=this._formatIdx;for(t=this._format[r],r++;r<this._format.length&&t===this._format[r];)e++,r++;return e},t.prototype.pic_kanji=function(){var t;return!(this._formatIdx+1>=this._format.length)&&(!!r.UtilStrByteMode.isDigit(this._format[this._formatIdx+1])&&(this._formatIdx++,"0"===this._format[this._formatIdx]?(this._imeMode=r.UtilImeJpn.IME_FORCE_OFF,this._formatIdx++):1<=(t=this.pik_count())&&t<=9&&(this._imeMode=t),!0))},t.prototype.getMaskLen=function(t){return this._needLength=!0,this._maskLength=0,this._formatIdx=0,this.prs_all(t),this._picAttr===r.StorageAttribute.NUMERIC&&(this._prefLen>0||this._suffLen>0)&&(this._maskLength+=this._prefLen+this._suffLen),this._needLength=!1,this._formatIdx=this._maskChars=this._whole=this._decimalDigits=this._size=this._maskSize=this._prefLen=this._suffLen=0,this._pad=this._zero=String.fromCharCode(0),this.hebrew=this._mixed=this._embeded=this._negative=this._comma=this._left=this._padFill=this._zeroFill=this._trim=this._autoSkip_=this._decimal=this._termFlag=this._decPointIsFirst=!1,this._posPref.Remove(0,this._posPref.Length),this._posSuff.Remove(0,this._posSuff.Length),this._negPref.Remove(0,this._negPref.Length),this._negSuff.Remove(0,this._negSuff.Length),this._maskLength},t.prototype.picIsMask=function(t){return(t<0||t>=this._maskLength)&&(t=0),this._msk[t].charCodeAt(0)>r.PICInterface.PIC_MAX_OP},t.prototype.getDirectiveLen=function(t,e,r){return 1===arguments.length?this.getDirectiveLen_0(t):this.getDirectiveLen_1(t,e,r)},t.prototype.getDirectiveLen_0=function(t){for(var e=this._msk[t],r=t;r<this._maskSize&&e===this._msk[r];)r+=1;return r-t},t.prototype.getDirectiveLen_1=function(t,e,n){for(var i=this._msk[t],o=t,a=e;o<this._maskSize&&i===this._msk[o];)a<n.length&&r.UtilStrByteMode.isLocaleDefLangDBCS()&&this.isAttrAlphaOrDate()&&(r.UtilStrByteMode.isHalfWidth(n[a++])||o++),o++;return o-t},t.prototype.validateChar=function(t,e){var n=t;if(e>=this.getMaskSize())return n;for(;this.picIsMask(e);)e++;switch(this._msk[e].charCodeAt(0)){case r.PICInterface.PIC_U:n=t.toUpperCase();break;case r.PICInterface.PIC_L:n=t.toLowerCase();default:if(!r.UtilStrByteMode.isDigit(t))for(var i=0;i<r.PICInterface.NumDirective.length;i++)if(this._msk[e].charCodeAt(0)===r.PICInterface.NumDirective[i]){n=this.isValidInNum(t);break}}return n},t.prototype.isValidInNum=function(t){var e="\0",r=x.Environment.GetDecimal();switch(x.Environment.CanReplaceDecimalSeparator()&&this.isAttrNumeric()&&"."===t&&(t=r),t){case" ":case"-":case"*":case"+":case"/":e=t;break;default:t!==r&&t!==x.Environment.GetThousands()||(e=t)}return e},t.prototype.isAttrLogical=function(){return this._picAttr===r.StorageAttribute.BOOLEAN},t.prototype.isAttrNumeric=function(){return this._picAttr===r.StorageAttribute.NUMERIC},t.prototype.isAttrAlpha=function(){return this._picAttr===r.StorageAttribute.ALPHA},t.prototype.isAttrUnicode=function(){return this._picAttr===r.StorageAttribute.UNICODE},t.prototype.isAttrAlphaOrDate=function(){return this._picAttr===r.StorageAttribute.ALPHA||this._picAttr===r.StorageAttribute.DATE},t.prototype.isAttrDateOrTime=function(){return this._picAttr===r.StorageAttribute.TIME||this._picAttr===r.StorageAttribute.DATE},t.prototype.isAttrBlob=function(){return this._picAttr===r.StorageAttribute.BLOB||this._picAttr===r.StorageAttribute.BLOB_VECTOR},t.prototype.isNumeric=function(t){return this._msk[t]===String.fromCharCode(r.PICInterface.PIC_N)},t.prototype.isAllX=function(){return this._msk[0]===String.fromCharCode(r.PICInterface.PIC_X)&&this.getDirectiveLen(0)===this._maskSize},t.prototype.isMaskPicEq=function(t,e){return this._msk[t]===String.fromCharCode(e)},t.prototype.isValidChar_as400=function(t,e,n){var i=!0;switch(this._msk[n].charCodeAt(0)){case r.PICInterface.PIC_J:case r.PICInterface.PIC_G:i=!r.UtilStrByteMode.isHalfWidth(t);break;case r.PICInterface.PIC_T:i="\x0000"===e||(r.UtilStrByteMode.isHalfWidth(e)?r.UtilStrByteMode.isHalfWidth(t):!r.UtilStrByteMode.isHalfWidth(t));break;case r.PICInterface.PIC_S:i=r.UtilStrByteMode.isHalfWidth(t)}return i},t.prototype.getMinimumValueLength=function(){for(var t=this.getMaskLength();t>0&&!this.picIsMask(t-1);)t--;return t},t.prototype.toString=function(){return"{Picture: "+this._format+"}"},t}(),j=function(){function t(t){this._continuousRangeValues=null,this._discreteRangeValues=null,this._range=null,1===arguments.length&&(this._range=t,null!==this._range&&this.fillRange())}return t.prototype.fillRange=function(){this._range=r.StrUtil.makePrintableTokens(this._range,r.SEQ_2_HTML);for(var t=0,e=0;-1!==(t=this.findDelimeter(t,",",this._range))&&e<this._range.length;)this.rangeForms(this._range.substr(e,t-e)),t=e=t+1;e<this._range.length&&this.rangeForms(this._range.substr(e)),null!=this._discreteRangeValues&&(r.StrUtil.makePrintableTokens(this._discreteRangeValues,r.HTML_2_STR),E.WriteDevToLog(this._discreteRangeValues.toString())),null!==this._continuousRangeValues&&(r.StrUtil.makePrintableTokens(this._continuousRangeValues,r.HTML_2_STR),E.WriteDevToLog(this._continuousRangeValues.toString()))},t.prototype.rangeForms=function(t){var r;if(-1===(r=this.findDelimeter(0,"-",t))){t=e.NString.TrimStart(t);for(var n=0;n<t.length&&-1!==(n=this.findDelimeter(n,"\\",t));)t=t.substr(0,n)+t.substr(n+=1),n+=1;null===this._discreteRangeValues&&(this._discreteRangeValues=new e.List),this._discreteRangeValues.push(t)}else for(var i=void 0,o=0;o<2;o+=1){if(0===o)i=t.substr(0,r);else{for(r+=1;r<t.length&&" "===t.charAt(r);)r+=1;i=t.substr(r)}i=this.deleteChar("\\",i),null===this._continuousRangeValues&&(this._continuousRangeValues=new e.List),this._continuousRangeValues.push(i)}},t.prototype.deleteChar=function(t,e){for(var r=0;-1!==(r=e.indexOf(t,r));)e=e.substr(0,r)+e.substr(r+t.length);return e},t.prototype.findDelimeter=function(t,e,r){for(var n=r.indexOf(e,t);n<r.length&&n>0&&"\\"===r.charAt(n-1);)n=r.indexOf(e,n+1);return n},t.prototype.getDiscreteRangeValues=function(){return this._discreteRangeValues},t.prototype.getContinuousRangeValues=function(){return this._continuousRangeValues},t}(),Z=function(){function t(e,r,n){this.COMMACHAR=",",this.DECIMALCHAR=".",this.SIGNIFICANT_NUM_SIZE=0,this._data=new Int8Array(t.NUM_SIZE),0!==arguments.length?1!==arguments.length||null!==e&&e.constructor!==String?3!==arguments.length||!(null===e||e instanceof Int8Array)||null!==r&&r.constructor!==Number||null!==n&&n.constructor!==Number?1===arguments.length&&(null===e||e instanceof Int8Array)?this.constructor_3(e):3!==arguments.length||null!==e&&e.constructor!==String||!(null===r||r instanceof z)||null!==n&&n.constructor!==Number?this.constructor_5(e):this.constructor_4(e,r,n):this.constructor_2(e,r,n):this.constructor_1(e):this.constructor_0()}return Object.defineProperty(t.prototype,"Data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!1,configurable:!0}),t.prototype.constructor_0=function(){this.initConst(),this.NUM_ZERO()},t.prototype.constructor_1=function(r){var n,i=0;this.initConst();try{for(i=0;i<this.SIGNIFICANT_NUM_SIZE;i+=1)n=r.substr(2*i,2),this._data[i]=t.toSByte(e.NNumber.Parse(n,e.NumberStyles.HexNumber))}catch(t){E.WriteWarningToLog(t),this.NUM_ZERO()}},t.prototype.constructor_2=function(t,e,r){this.constructor_0();for(var n=0;n<r;n+=1)this._data[n]=t[n+e]},t.prototype.constructor_3=function(t){this.constructor_2(t,0,t.length)},t.prototype.constructor_4=function(t,e,r){this.constructor_0(),this.from_a(t,e,r)},t.prototype.constructor_5=function(t){this.initConst(),this._data=new Int8Array(t._data.length);for(var e=0;e<this._data.length;++e)this._data[e]=t._data[e]},t.prototype.toDisplayValue=function(t){return this.to_a(t)},t.prototype.initConst=function(){var t=x.Environment;this.DECIMALCHAR=t.GetDecimal(),this.COMMACHAR=t.GetThousands(),this.SIGNIFICANT_NUM_SIZE=t.GetSignificantNumSize()},t.prototype.toXMLrecord=function(){var t,r=new e.StringBuilder(2*this.SIGNIFICANT_NUM_SIZE);t=this.NUM_IS_LONG()?5:this.SIGNIFICANT_NUM_SIZE;for(var n=0;n<this.SIGNIFICANT_NUM_SIZE;n++)n<t?r.Append(("0"+(255&this._data[n]).toString(16)).slice(-2)):r.Append("00");return r.ToString().toUpperCase()},t.prototype.from_a=function(t,e,n){var i,o,a,s,_,l,u,c,P,h,T,E,p,I,f,O,g,R,S,C="",d="",A="",L=x.Environment.GetSpecialValNewPolicy();for(l=0,P=!1,h=!1,(u=null==e)?(e=new z("",r.StorageAttribute.NUMERIC,n),I=!1):(C=e.getMask(),L||t.length>e.getMaskSize()&&(t=t.substr(0,e.getMaskSize())),(I=e.isNegative())&&(O=e.getNegPref_(),g=e.getPosPref_(),R=e.getNegSuff_(),S=e.getPosSuff_(),l=(d=(P=0===((h=O.length!==g.length||0!==O.length&&O!==g)?O:R).length)?h?g:S:h?O:R).length)),a=!1,s=0,_=0,T=0,o=0;o<t.length;){if(u||L&&o>=e.getMaskSize()||C[o]===String.fromCharCode(r.PICInterface.PIC_N)){if(p=t[o],L&&a&&s===e.getDec())break;if(r.UtilStrByteMode.isDigit(p))_++,A+=p,a&&s++;else if(p===this.DECIMALCHAR)A+=this.DECIMALCHAR,a=!0;else if(p!==this.COMMACHAR)if(I&&0===T){for(T=1,i=o,c=0;i<=t.length&&c<l;i++)if(u||C[i]===String.fromCharCode(r.PICInterface.PIC_N)){if((p=t[i])!==d[c]){if("-"===p&&!P)break;if("+"===p&&P)break;T=-1;break}c++}c>0&&c<l&&(T=-1)}else if(0===o){if(e.getNegPref_().length>0&&t.startsWith(e.getNegPref_())){o+=e.getNegPref_().length;continue}if(e.getPosPref_().length>0&&t.startsWith(e.getPosPref_())){o+=e.getPosPref_().length;continue}}else{if(e.getNegSuff_().length>0&&t.endsWith(e.getNegSuff_())){o+=e.getNegSuff_().length;continue}if(e.getPosSuff_().length>0&&t.endsWith(e.getPosSuff_())){o+=e.getPosSuff_().length;continue}}}o++}0===T&&P&&(T=1),f=1===T&&!P||1!==T&&P,s>0||_>9?(E=(f?"-":" ")+A,this.num_4_a_std(E)):this.NUM_4_LONG((f?-1:1)*this.a_2_long(A))},t.prototype.num_4_a_std=function(e){var n,i="",o=0,a=0,s=0,_=!1,l=!1;for(n=0;n<e.length;n++){var u=e.charAt(n);r.UtilStrByteMode.isDigit(u)?o>0||"0"!==u?(o++,i+=u,_||a++):_&&(s+=1):u===this.DECIMALCHAR?_=!0:"-"===u&&(l=!0)}if(this.NUM_ZERO(),0!==o){(a+s&1)>0?(this._data[1]=t.toSByte(i.charCodeAt(0)-"0".charCodeAt(0)),n=1):n=0;var c=1+n;for(o=Math.min(o,2*(this.SIGNIFICANT_NUM_SIZE-1)-n);n<o;){var P=t.toSByte(i.charCodeAt(n++)-"0".charCodeAt(0)),h=t.toSByte(n<o?i.charCodeAt(n++)-"0".charCodeAt(0):"\0".charCodeAt(0));this._data[c++]=t.toSByte(10*t.toUByte(P)+t.toUByte(h))}this._data[0]=a>0?t.toSByte(t.EXP_BIAS+(a+1>>1)):t.toSByte(t.EXP_BIAS-(s>>1)),l&&(this._data[0]|=t.SIGN_MASK)}},t.prototype.NUM_4_LONG=function(e){var r;this.NUM_ZERO(),0!==e&&(e<0&&(e=4294967295+e+1),r=e.toString(16),e>0&&(r=t.INT_ZERO_HEX.substr(r.length)+r),this._data[1]=t.toSByte(parseInt(r.substr(6,2),16)),this._data[2]=t.toSByte(parseInt(r.substr(4,2),16)),this._data[3]=t.toSByte(parseInt(r.substr(2,2),16)),this._data[4]=t.toSByte(parseInt(r.substr(0,2),16)))},t.prototype.a_2_long=function(t){for(var e=0,n=0;n<t.length;n++)r.UtilStrByteMode.isDigit(t.charAt(n))&&(e=(e*=10)+t.charCodeAt(n)-"0".charCodeAt(0));return e},t.prototype.to_a=function(t){return this.to_a_pic(t)},t.prototype.to_a_pic=function(n){var i,o,a,s,_,l,u,c,P,h,T,E,p,I,f,O,g,R,S,C,d=new Array(128);if(O=n.getMaskSize(),a=(o=!n.isNegative()||!this.num_is_neg())?n.getPosPref_().length:n.getNegPref_().length,s=o?n.getPosSuff_().length:n.getNegSuff_().length,p=n.isLeft(),I=n.padFill(),f=n.getMaskChars(),C=e.NString.ToCharArray(n.getMask().substr(0,O)),h=p||f>0?d:C,p)for(R=0;R<h.length;R++)h[R]="0".toLowerCase();for(S=!(p||f>0),u=a,c=O-a-s,T=h.slice(u,h.length),i=this.NUM_IS_LONG()?this.num_l_2_str(this.NUM_LONG(),T,c,n):this.to_str(T,c,n),R=u;R<h.length;R++)h[R]=T[R-u];if(T=null,i<f){for(g=new Array(O),R=0;R<O;R++)g[R]=i===t.ZERO_FILL?n.getZeroPad():"*";return e.NString.FromChars(g)}if(f>0&&(i-=f,u+=f,c-=f),I)if(E=n.getPad(),p){for(R=0;R<i;R++)h[u+c+R]=E;u+=i}else for(R=0;R<i;R++)h[u+R]=E;else E=" ",u+=i,c-=i;if(s>0){if(l=o?n.getPosSuff_():n.getNegSuff_(),1===s)h[u+c]=l[0];else for(R=0;R<s;R++)h[u+c+R]=l[R];c+=s}if(a>0)if(u-=a,c+=a,_=o?n.getPosPref_():n.getNegPref_(),1===a)h[u]=_[0];else for(R=0;R<a;R++)h[u+R]=_[R];if(!I){var A=h.length;if(p)for(R=0;R<i&&u+c+R<A;R++)h[u+c+R]=E;else for(u-=i,R=0;R<i&&u+R<A;R++)h[u+R]=E}if(S)return e.NString.FromChars(h);if(0===f)return u+O>h.length&&(O=h.length-u),e.NString.FromChars(h,u,O);for(P=0;P<O&&u<h.length;P++)C[P]===String.fromCharCode(r.PICInterface.PIC_N)&&(C[P]=h[u++]);return e.NString.FromChars(C)},t.prototype.num_l_2_str=function(e,r,n,i){var o,a,s,_,l;if(e<0&&(e=-e),o=i.withComa(),(_=Math.min(i.getDec(),n-1))>0&&(n-=_+1),s=n,0===e&&!i.decInFirstPos()){if(i.zeroFill())return t.ZERO_FILL;if(0===n)return t.NO_ROOM;s>r.length&&(s=r.length),r[--s]="0"}if(_>0)for(r[n]=this.DECIMALCHAR,l=0;l<_;l++)r[n+1+l]="0";for(a=0;e>0;e=Math.floor(e/10)){if(s--,o){if(3===a){if(s<0)return t.NO_ROOM;a=0,r[s--]=this.COMMACHAR}a++}if(s<0)return t.NO_ROOM;r[s]=(e%10).toString()}return s},t.prototype.to_str=function(e,r,n){var i,o,a,s,_,l,u,c,P,h;if(o=n.withComa(),(P=n.getDec())>=r&&(P=r-1),(i=new t(this)).round(P),i.NUM_IS_LONG())return i.num_l_2_str(i.NUM_LONG(),e,r,n);if(n.zeroFill()&&0===i._data[0])return t.ZERO_FILL;for(c=r-1,a=0,_=(s=2*((i._data[0]&~t.SIGN_MASK)-t.EXP_BIAS+1))-1+P,(l=s-1)>2&&(l=i._data[1]<10?3:2),u=_;u>=l;u--){if(c<0)return t.NO_ROOM;if(o&&u<s&&(3===a&&(a=0,e[c--]=this.COMMACHAR),a++),c<0)return t.NO_ROOM;if(u<2||u>=2*this.SIGNIFICANT_NUM_SIZE)e[c--]="0";else{if(c<0)return t.NO_ROOM;h=i._data[u>>1],e[c--]=(0!=(1&u)?h%10:Math.floor(h/10)).toString()}if(u===s){if(c<0)return t.NO_ROOM;if(e[c--]=this.DECIMALCHAR,c<0&&n.decInFirstPos())return 0}}return c+1},t.add=function(e,r){var n,i,o,a,s,_;if(null===e||null===r)return null;_=x.Environment.GetSignificantNumSize();var l=new t,u=new t,c=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){if((o=a=e.NUM_LONG())<0&&(o=-o),o<1073741824&&((o=s=r.NUM_LONG())<0&&(o=-o),o<1073741824))return a+=s,u.NUM_4_LONG(a),u;r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();n=t.toSByte(e._data[0]&t.SIGN_MASK),c.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),i=t.toSByte(r._data[0]&t.SIGN_MASK),c.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),c.NUM_Diff_=c.NUM_Exp1_-c.NUM_Exp2_;var P=c.NUM_Diff_;if(0===P&&0===(P=t.toUByte(e._data[1])-t.toUByte(r._data[1]))&&(P=t.memcmp(e,2,r,2,_-2)),P>=0)0!==(l=n===i?t.add_pos(e,r,c):t.sub_pos(e,r,c))._data[0]&&(l._data[0]=t.toSByte(l._data[0]|n));else{var h=c.NUM_Exp1_;c.NUM_Exp1_=c.NUM_Exp2_,c.NUM_Exp2_=h,c.NUM_Diff_=-c.NUM_Diff_,0!==(l=n===i?t.add_pos(r,e,c):t.sub_pos(r,e,c))._data[0]&&(l._data[0]|=i)}return l},t.sub=function(e,r){if(null===e||null===r)return null;var n=new t,i=new t,o=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){var a=void 0,s=a=e.NUM_LONG();if(a<0&&(a=-a),a<1073741824){var _=a=r.NUM_LONG();if(a<0&&(a=-a),a<1073741824)return s-=_,i.NUM_4_LONG(s),i}r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();var l=t.toSByte(e._data[0]&t.SIGN_MASK);o.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK);var u=t.toSByte(r._data[0]&t.SIGN_MASK);o.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),o.NUM_Diff_=o.NUM_Exp1_-o.NUM_Exp2_;var c=o.NUM_Diff_;if(0===c&&0===(c=t.toUByte(e._data[1])-t.toUByte(r._data[1]))&&(c=t.memcmp(e,2,r,2,x.Environment.GetSignificantNumSize()-2)),c>=0)n=l===u?t.sub_pos(e,r,o):t.add_pos(e,r,o);else{var P=o.NUM_Exp1_;o.NUM_Exp1_=o.NUM_Exp2_,o.NUM_Exp2_=P,o.NUM_Diff_=-o.NUM_Diff_,l===u?(n=t.sub_pos(r,e,o),l^=t.SIGN_MASK):n=t.add_pos(r,e,o)}return 0!==n._data[0]&&(n._data[0]|=l),n},t.mul=function(e,r){var n,i,o,a,s,_,l,u,c,P,h,T,E,p=new Int8Array(38);if(null===e||null===r)return null;E=x.Environment.GetSignificantNumSize();var I,f,O=new t,g=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){if((P=h=e.NUM_LONG())<0&&(P=-P),P<45056&&((P=T=r.NUM_LONG())<0&&(P=-P),P<45056))return h*=T,O.NUM_4_LONG(h),O;r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();if(g.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),g.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),0===g.NUM_Exp1_||0===g.NUM_Exp2_)return O.NUM_ZERO(),O;for(i=E-1;0===e._data[i];i--);for(o=E-1;0===r._data[o];o--);for(I=0;I<2*(t.NUM_SIZE-1);I++)p[I]=0;for(_=0,a=i;a>0;a--){for(_=a+o-1,l=e._data[a],c=0,s=o;s>0;s--)u=t.toUByte(l)*t.toUByte(r._data[s])+c,c=Math.floor(u/100),p[_]=t.toSByte(t.toUByte(p[_])+u%100),f=p[_],_--,t.toUByte(f)>=100&&(p[_+1]=t.toSByte(t.toUByte(p[_+1])-100),c++);p[_]=t.toSByte(c)}for(n=t.toUByte(g.NUM_Exp1_)-t.EXP_BIAS+(t.toUByte(g.NUM_Exp2_)-t.EXP_BIAS),0===p[0]&&(_++,n--),(e._data[0]&t.SIGN_MASK)==(r._data[0]&t.SIGN_MASK)?O._data[0]=0:O._data[0]=t.SIGN_MASK,O._data[0]|=t.toSByte(n+t.EXP_BIAS),I=0;I<E-1;I++)O._data[1+I]=p[_+I];return O},t.mod=function(e,r){if(null===e||null===r)return null;var n=new t;return r.num_is_zero()?(n.NUM_ZERO(),n):(e.NUM_IS_LONG()&&e.num_4_std_long(),r.NUM_IS_LONG()&&r.num_4_std_long(),(n=t.div(e,r)).num_trunc(0),n=t.mul(n,r),n=t.sub(e,n))},t.div=function(e,r){var n,i,o,a,s,_,l,u,c,P,h=new Int8Array(2*(t.NUM_SIZE-1)),T=new Int8Array(t.NUM_SIZE);if(null===e||null===r)return null;P=x.Environment.GetSignificantNumSize();var E,p,I=new t,f=new J;if(e.NUM_IS_LONG()&&e.num_4_std_long(),r.NUM_IS_LONG()&&r.num_4_std_long(),f.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),f.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),0===f.NUM_Exp1_||0===f.NUM_Exp2_)return I.NUM_ZERO(),I;for(i=P-1;0===e._data[i];i--);for(o=P-1;0===r._data[o];o--);for(_=t.memcmp(e,1,r,1,o)<0?0:1,E=0;E<2*(t.NUM_SIZE-1);E++)h[E]=0;for(E=0;E<i;E++)h[_+E]=e._data[1+E];for(E=0;E<o;E++)T[1+E]=r._data[1+E];if(I.NUM_SET_ZERO(),n=t.toUByte(f.NUM_Exp1_)-t.toUByte(f.NUM_Exp2_)+_,I._data[0]=t.toSByte(n+t.EXP_BIAS),(e._data[0]&t.SIGN_MASK)!=(r._data[0]&t.SIGN_MASK)&&(I._data[0]|=t.SIGN_MASK),(l=Math.floor(100/(t.toUByte(T[1])+1)))>1){for(c=0,s=o;s>0;s--)u=l*t.toUByte(T[s])+c,c=Math.floor(u/100),T[s]=t.toSByte(u%100);for(c=0,a=i+_-1;a>=0;a--)u=l*t.toUByte(h[a])+c,c=Math.floor(u/100),h[a]=t.toSByte(u%100)}for(a=1;a<P;a++){if((l=100*t.toUByte(h[a-1])+Math.floor(t.toUByte(h[a])/t.toUByte(T[1])))>=100&&(l=99),0!==l){for(_=a+o-1,c=0,s=o;s>0;s--)u=l*t.toUByte(T[s])+c,c=Math.floor(u/100),h[_]=t.toSByte(t.toUByte(h[_])-u%100),p=h[_],_--,p<0&&(h[_+1]=t.toSByte(t.toUByte(h[_+1])+100),c++);for(h[_]=t.toSByte(t.toUByte(h[_])-c);h[_]<0;)for(l--,_=a+o-1,s=o;s>0;s--)h[_]=t.toSByte(t.toUByte(h[_])+t.toUByte(T[s])),p=h[_],_--,t.toUByte(p)>=100&&(h[_+1]=t.toSByte(t.toUByte(h[_+1])-100),h[_]=t.toSByte(t.toUByte(h[_])+1))}I._data[a]=t.toSByte(l)}return I},t.num_cmp=function(r,n){var i,o,a,s,_,l;if(null==r||null==n)return e.Int32.MinValue;if(l=x.Environment.GetSignificantNumSize(),r.NUM_IS_LONG()){if(n.NUM_IS_LONG()){if(a=r.NUM_LONG(),s=n.NUM_LONG(),a>=0&&s>=0)return 0===(_=a-s)?0:_>0?1:-1;n.num_4_std_long()}r.num_4_std_long()}else n.NUM_IS_LONG()&&n.num_4_std_long();return o=(i=t.toSByte(r._data[0]&t.SIGN_MASK))===t.toSByte(n._data[0]&t.SIGN_MASK)?t.memcmp(r,0,n,0,l):1,0!==i&&(o=-o),o},t.numHexStrIsLong=function(t){return"FF"===t.substr(0,2)},t.prototype.NUM_ZERO=function(){this.setZero(!0)},t.prototype.NUM_SET_ZERO=function(){this.setZero(!1)},t.prototype.num_is_neg=function(){return this.NUM_IS_LONG()?0!=(128&this._data[4]):0!=(this._data[0]&t.SIGN_MASK)},t.prototype.num_is_zero=function(){return this.NUM_IS_LONG()?0===this.NUM_LONG():0===this._data[0]},t.prototype.num_neg=function(){var e;if(this.NUM_IS_LONG())return e=-this.NUM_LONG(),void this.NUM_4_LONG(e);0!==this._data[0]&&(this._data[0]^=t.SIGN_MASK)},t.prototype.NUM_IS_LONG=function(){return this._data[0]===t.NUM_LONG_TYPE},t.prototype.NUM_LONG=function(){return 0===this._data[1]&&0===this._data[2]&&0===this._data[3]&&-128===this._data[4]?e.Int32.MinValue:new DataView(this._data.buffer).getInt32(1,!0)},t.prototype.round=function(e){var r;if(!this.NUM_IS_LONG()){(r=new t)._data[0]=t.toSByte(this._data[0]&t.SIGN_MASK|t.EXP_BIAS-(e>>1)),r._data[1]=t.toSByte(0!=(1&e)?5:50);var n=t.add(this,r);this._data=new Int8Array(n._data.length),this._data=n._data,this.num_trunc(e)}},t.prototype.dbRound=function(e){var r,n,i;if(!this.NUM_IS_LONG()){(r=new t)._data[0]=t.toSByte(this._data[0]&t.SIGN_MASK|t.EXP_BIAS+(e+1>>1)),r._data[1]=t.toSByte(0!=(1&e)?5:50);var o=t.add(this,r);this._data=new Int8Array(o._data.length);for(var a=0;a<this._data.length;++a)this._data[a]=o._data[a];if((n=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS-(e+1>>1))>=0)for(0!=(1&e)&&(this._data[1+n]=t.toSByte(this._data[1+n]-this._data[1+n]%10),n++),i=0;i<this.SIGNIFICANT_NUM_SIZE-(1+n);i++)this._data[1+n+i]=0;else this.NUM_SET_ZERO()}},t.prototype.num_trunc=function(e){var r,n,i;if(!(this.NUM_IS_LONG()||(r=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS,(n=this.SIGNIFICANT_NUM_SIZE-1-r-(e+1>>1))<0)))if(n<this.SIGNIFICANT_NUM_SIZE-1&&0!=(1&e)&&(this._data[this.SIGNIFICANT_NUM_SIZE-1-n]=t.toSByte(this._data[this.SIGNIFICANT_NUM_SIZE-1-n]-this._data[this.SIGNIFICANT_NUM_SIZE-1-n]%10),0===this._data[this.SIGNIFICANT_NUM_SIZE-1-n]&&n++),n>=this.SIGNIFICANT_NUM_SIZE-1)this.NUM_ZERO();else for(i=0;i<n;i++)this._data[this.SIGNIFICANT_NUM_SIZE-n+i]=0},t.prototype.num_4_std_long=function(){var e;(e=this.NUM_LONG())>=0?this.num_4_ulong(e):(this.num_4_ulong(-e),this._data[0]|=t.SIGN_MASK)},t.prototype.num_4_ulong=function(e){var r,n;for(this.NUM_SET_ZERO(),r=5;e>0;)this._data[r--]=t.toSByte(e%100),e=Math.floor(e/100);if(r<5){if(r>0){for(n=0;n<5-r;n++)this._data[1+n]=this._data[1+r+n];for(n=0;n<r;n++)this._data[5-r+1+n]=0}this._data[0]=t.toSByte(5-r+t.EXP_BIAS)}},t.prototype.NUM_2_LONG=function(){return this.NUM_IS_LONG()?this.NUM_LONG():this.num_2_long()},t.prototype.NUM_2_ULONG=function(){return this.NUM_IS_LONG()?this.NUM_LONG():this.num_2_ulong()},t.prototype.num_2_long=function(){var e,r;if(r=this._data[0]&t.SIGN_MASK,this._data[0]&=t.toSByte(~t.SIGN_MASK),0!==r){if(t.memcmp(this,0,t.MinLONG(),0,this.SIGNIFICANT_NUM_SIZE)>0)return 0}else if(t.memcmp(this,0,t.MaxLONG(),0,this.SIGNIFICANT_NUM_SIZE)>0)return 0;return e=this.num_2_ulong(),0!==r&&(e=-e,this._data[0]|=t.toSByte(r)),e},t.prototype.num_2_ulong=function(){var e,r,n,i;if((r=this._data[0]-t.EXP_BIAS)>5)return 0;for((i=5===r)&&(r=4),e=0,n=1;n<=r;n++)e=100*e+t.toUByte(this._data[n]);return i&&(e=e<=Math.floor((4294967295-t.toUByte(this._data[5]))/100)?100*e+t.toUByte(this._data[5]):0),e},t.add_pos=function(e,r,n){var i,o,a,s,_,l,u,c;if(null==e||null==r)return null;c=x.Environment.GetSignificantNumSize();var P=new t;if(0===n.NUM_Exp2_||n.NUM_Diff_>=c-1)return(P=new t(e))._data[0]=n.NUM_Exp1_,P;for(i=1,u=c-2;u>0;u-=2)if(!e.SHRT_IS_ZERO(u)){i=u+1;break}for(0===e._data[i]&&i--,o=1,u=c-2;u>0;u-=2)if(!r.SHRT_IS_ZERO(u)){o=u+1;break}for(0===r._data[o]&&o--,(a=Math.max(i,o+n.NUM_Diff_))>c-1&&(a=c-1),P.NUM_SET_ZERO(),_=n.NUM_Diff_,l=n.NUM_Diff_,s=a-n.NUM_Diff_;s>0;s--)P._data[l+s]=t.toSByte(t.toUByte(P._data[l+s])+t.toUByte(e._data[_+s])+t.toUByte(r._data[s])),t.toUByte(P._data[l+s])>=100&&(P._data[l+s]=t.toSByte(t.toUByte(P._data[l+s])-100),P._data[l+s-1]=1);for(s=n.NUM_Diff_;s>0;s--)P._data[s]=t.toSByte(t.toUByte(P._data[s])+t.toUByte(e._data[s])),t.toUByte(P._data[s])>=100&&(P._data[s]=t.toSByte(t.toUByte(P._data[s])-100),P._data[s-1]=1);if(0!==P._data[0]){for(s=Math.min(a,c-2);s>=0;s--)P._data[s+1]=P._data[s];n.NUM_Exp1_++}return P._data[0]=n.NUM_Exp1_,P},t.sub_pos=function(e,r,n){var i,o,a,s,_,l,u,c;if(null==e||null==r)return null;c=x.Environment.GetSignificantNumSize();var P,h=new t;if(0===n.NUM_Exp2_||n.NUM_Diff_>=c-1)return(h=new t(e))._data[0]=n.NUM_Exp1_,h;for(i=1,u=c-2;u>0;u-=2)if(!e.SHRT_IS_ZERO(u)){i=u+1;break}for(0===e._data[i]&&i--,o=1,u=c-2;u>0;u-=2)if(!r.SHRT_IS_ZERO(u)){o=u+1;break}for(0===r._data[o]&&o--,(a=Math.max(i,o+n.NUM_Diff_))>c-1&&(a=c-1),h.NUM_SET_ZERO(),_=n.NUM_Diff_,l=n.NUM_Diff_,s=a-n.NUM_Diff_;s>0;s--)h._data[l+s]=t.toSByte(t.toUByte(h._data[l+s])+t.toUByte(e._data[_+s])-t.toUByte(r._data[s])),h._data[l+s]<0&&(h._data[l+s]=t.toSByte(t.toUByte(h._data[l+s])+100),h._data[l+s-1]=t.toSByte(255));for(s=n.NUM_Diff_;s>0;s--)h._data[s]=t.toSByte(t.toUByte(h._data[s])+t.toUByte(e._data[s])),h._data[s]<0&&(h._data[s]=t.toSByte(t.toUByte(h._data[s])+100),h._data[s-1]=t.toSByte(255));for(;++s<=a&&0===h._data[s];);if(s<=a){if(n.NUM_Diff_=s-1,n.NUM_Diff_>0){for(P=0;P<a-n.NUM_Diff_;P++)h._data[1+P]=h._data[s+P];for(P=0;P<n.NUM_Diff_;P++)h._data[a-n.NUM_Diff_+1+P]=0}h._data[0]=t.toSByte(t.toUByte(n.NUM_Exp1_)-n.NUM_Diff_)}return h},t.prototype.num_fix=function(e){var r;if(this.NUM_IS_LONG()&&this.num_4_std_long(),!((r=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS-(e+1>>1))<0)){if(r<this.SIGNIFICANT_NUM_SIZE-1)for(1==(1&e)&&(this._data[1+r]=t.toSByte(this._data[1+r]%10));r<this.SIGNIFICANT_NUM_SIZE-1&&0===this._data[1+r];)r++;if(r>=this.SIGNIFICANT_NUM_SIZE-1)this.NUM_ZERO();else if(r>0){var n=void 0;for(n=0;n<this.SIGNIFICANT_NUM_SIZE-1-r;n++)this._data[1+n]=this._data[1+r+n];for(n=0;n<r;n++)this._data[this.SIGNIFICANT_NUM_SIZE-r+n]=0;this._data[0]=t.toSByte(this._data[0]-t.toSByte(r))}}},t.prototype.SHRT_IS_ZERO=function(t){return 0===this._data[t]&&0===this._data[t+1]},t.prototype.setZero=function(e){var r;for(r=0;r<t.NUM_SIZE;r++)this._data[r]=0;e&&(this._data[0]=t.NUM_LONG_TYPE)},t.memcmp=function(e,r,n,i,o){for(var a=0;a<o&&e._data[r]===n._data[i]&&r<t.NUM_SIZE&&i<t.NUM_SIZE;)a++,r++,i++;return a===o?0:this.toUByte(e._data[r])<this.toUByte(n._data[i])?-1:1},t.toUByte=function(t){var e=t;return t<0&&(e=256+t),e},t.toSByte=function(t){return t>r.Constants.SByteMaxValue?t-256:t},t.MaxLONG=function(){var e=new t;return e._data[0]=t.toSByte(t.EXP_BIAS+5),e._data[1]=21,e._data[2]=47,e._data[3]=48,e._data[4]=36,e._data[5]=47,e},t.MinLONG=function(){var e=new t;return e._data[0]=t.toSByte(t.EXP_BIAS+5),e._data[1]=21,e._data[2]=47,e._data[3]=48,e._data[4]=36,e._data[5]=48,e},t.prototype.to_double=function(){return this.storage_mg_2_float(8)},t.prototype.storage_mg_2_float=function(e){var r,n,i,o,a,s=new t,_=new t,l=new t,u=0,c=0,P=new Int8Array([0,0,0,0,0,0,0,0]),h=new Int8Array([t.toSByte(t.EXP_BIAS+4),8,38,86,8]),T=new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),E=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),16]),new Int8Array([t.toSByte(t.EXP_BIAS+2),2,56]),new Int8Array([t.toSByte(t.EXP_BIAS+2),40,96]),new Int8Array([t.toSByte(t.EXP_BIAS+3),6,55,36]),new Int8Array([t.toSByte(t.EXP_BIAS+4),1,4,85,76]),new Int8Array([t.toSByte(t.EXP_BIAS+4),16,77,72,16]),new Int8Array([t.toSByte(t.EXP_BIAS+5),2,68,43,54,56]),new Int8Array([t.toSByte(t.EXP_BIAS+5),42,94,96,72,96]),new Int8Array([t.toSByte(t.EXP_BIAS+6),6,87,19,47,67,36]),new Int8Array([t.toSByte(t.EXP_BIAS+7),1,9,95,11,62,77,76]),new Int8Array([t.toSByte(t.EXP_BIAS+7),17,59,21,86,4,44,16]),new Int8Array([t.toSByte(t.EXP_BIAS+8),2,81,47,49,76,71,6,56]),new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),new Int8Array([t.toSByte(t.EXP_BIAS+9),7,20,57,59,40,37,92,79,36])],p=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),2]),new Int8Array([t.toSByte(t.EXP_BIAS+1),4]),new Int8Array([t.toSByte(t.EXP_BIAS+1),8])];if(this.NUM_IS_LONG()&&this.num_4_std_long(),0===this._data[0])return 0;if(n=t.toSByte(this._data[0]&t.SIGN_MASK),this._data[0]=t.toSByte(this._data[0]&~t.SIGN_MASK),4===e?(o=24,s=new t(h)):(o=53,s=new t(T)),(i=o-(a=(i=this._data[0]-t.EXP_BIAS<<1)<0?3*i+Math.floor((i+1)/3):3*i+Math.floor((i+2)/3)))<0)i=-i,_=t.div(this,new t(E[i>>2])),_=t.div(_,new t(p[3&i]));else{for(_=this;i>=60;)_=t.mul(_,new t(E[14])),i-=56;_=t.mul(_,new t(E[i>>2])),_=t.mul(_,new t(p[3&i]))}for(;t.num_cmp(_,s)<0;)a--,_=t.add(_,_);return 4===e?u=_.num_2_ulong():((l=t.div(_,new t(E[8]))).num_trunc(0),u=l.num_2_ulong(),l=t.mul(l,new t(E[8])),c=(l=t.sub(_,l)).num_2_ulong()),r=e-1,4===e?(a+=126,P[3]=t.toSByte(a>>1),P[2]=t.toSByte(127&this.LO_CHAR(this.HI_SHRT(u))|(1&a)<<7),P[1]=t.toSByte(this.HI_CHAR(this.LO_SHRT(u))),P[0]=t.toSByte(this.LO_CHAR(this.LO_SHRT(u)))):(a+=1022,P[7]=t.toSByte(a>>4),P[6]=t.toSByte(15&this.LO_CHAR(this.HI_SHRT(u))|(15&a)<<4),P[5]=t.toSByte(this.HI_CHAR(this.LO_SHRT(u))),P[4]=t.toSByte(this.LO_CHAR(this.LO_SHRT(u))),P[3]=t.toSByte(this.HI_CHAR(this.HI_SHRT(c))),P[2]=t.toSByte(this.LO_CHAR(this.HI_SHRT(c))),P[1]=t.toSByte(this.HI_CHAR(this.LO_SHRT(c))),P[0]=t.toSByte(this.LO_CHAR(this.LO_SHRT(c)))),0!==n&&(P[r]|=t.SIGN_MASK,this._data[0]|=t.SIGN_MASK),this.sbyteArr_2_Double(P)},t.prototype.LO_CHAR=function(t){return 255&t},t.prototype.HI_CHAR=function(t){return(65280&t)>>8},t.prototype.LO_SHRT=function(t){return 65535&t},t.prototype.HI_SHRT=function(t){return(-65536&t)>>16},t.MK_SHRT=function(t,r){var n=(t<<8|r).toString();return e.NNumber.Parse(n)},t.MK_LONG=function(t,r){var n=(t<<16|r).toString();return e.NNumber.Parse(n)},t.prototype.sbyteArr_2_Double=function(t){return new DataView(t.buffer).getFloat64(0,!0)},t.double_2_sbyteArray=function(t){var e=new ArrayBuffer(8),r=new DataView(e);return r.setFloat64(0,t,!0),new Int8Array(r.buffer)},t.eval_op_pwr=function(e,r){var n,i;if(null==e||null==r)return null;if(r.NUM_IS_LONG()&&!r.num_is_neg()){i=r.to_double();for(var o=t.from_double(1),a=0;a<i;a++)o=this.mul(o,e);return o}return n=e.to_double(),i=r.to_double(),n<0&&i!=i?n=0:0!==n&&(n=Math.pow(n,i)),t.from_double(n)},t.from_double=function(e){var r=t.double_2_sbyteArray(e);return t.storage_mg_4_float(8,r)},t.storage_mg_4_float=function(e,r){var n,i,o,a,s,_,l;for(n=new Array(r.length),o=0;o<r.length;o++)n[o]=t.toUByte(r[o]);return i=n[e-1],4===e?(a=n[2]>>7|(127&n[3])<<1,s=150,_=0,l=t.MK_LONG(t.MK_SHRT(0,128|n[2]),t.MK_SHRT(n[1],n[0]))):(a=(127&n[7])<<4|n[6]>>4,s=1075,_=t.MK_LONG(t.MK_SHRT(0,15&n[6]|16),t.MK_SHRT(n[5],n[4])),l=t.MK_LONG(t.MK_SHRT(n[3],n[2]),t.MK_SHRT(n[1],n[0]))),t.storage_num_4_fld_flt(_,l,18,i,s,a)},t.storage_num_4_fld_flt=function(e,r,n,i,o,a){var s=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),16]),new Int8Array([t.toSByte(t.EXP_BIAS+2),2,56]),new Int8Array([t.toSByte(t.EXP_BIAS+2),40,96]),new Int8Array([t.toSByte(t.EXP_BIAS+3),6,55,36]),new Int8Array([t.toSByte(t.EXP_BIAS+4),1,4,85,76]),new Int8Array([t.toSByte(t.EXP_BIAS+4),16,77,72,16]),new Int8Array([t.toSByte(t.EXP_BIAS+5),2,68,43,54,56]),new Int8Array([t.toSByte(t.EXP_BIAS+5),42,94,96,72,96]),new Int8Array([t.toSByte(t.EXP_BIAS+6),6,87,19,47,67,36]),new Int8Array([t.toSByte(t.EXP_BIAS+7),1,9,95,11,62,77,76]),new Int8Array([t.toSByte(t.EXP_BIAS+7),17,59,21,86,4,44,16]),new Int8Array([t.toSByte(t.EXP_BIAS+8),2,81,47,49,76,71,6,56]),new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),new Int8Array([t.toSByte(t.EXP_BIAS+9),7,20,57,59,40,37,92,79,36])],_=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),2]),new Int8Array([t.toSByte(t.EXP_BIAS+1),4]),new Int8Array([t.toSByte(t.EXP_BIAS+1),8])],l=new t,u=new t,c=a;if(0===c)return u.NUM_ZERO(),u;if(u.num_4_ulong(r),0!==e&&(l.num_4_ulong(e),l=t.mul(l,new t(s[8])),u=t.add(l,u)),(c-=o)<0){for(c=-c;c>=60;)u=t.div(u,new t(s[14])),c-=56;l=t.mul(new t(s[c>>2]),new t(_[3&c])),u=t.div(u,l)}else{if(c>=60)return u.NUM_ZERO(),u;l=t.mul(new t(s[c>>2]),new t(_[3&c])),u=t.mul(u,l)}return 0!=(128&i)&&(u._data[0]=u._data[0]|t.SIGN_MASK),u.round(n),u},t.eval_op_log=function(e){if(null==e)return null;var r=new t,n=e.to_double();return n>0?r=t.from_double(Math.log(n)):r.NUM_ZERO(),r},t.eval_op_exp=function(e){if(null===e)return null;var r=e.to_double();return t.from_double(Math.exp(r))},t.eval_op_abs=function(e){if(null===e)return null;var r=new t(e);return r.num_abs(),r},t.eval_op_sin=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.sin(r))},t.eval_op_cos=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.cos(r))},t.eval_op_tan=function(e){if(null==e)return null;new t;var r=e.to_double();return t.from_double(Math.tan(r))},t.eval_op_asin=function(e){if(null===e)return null;new t;var r=e.to_double();return r<=1&&r>=-1?t.from_double(Math.asin(r)):t.from_double(0)},t.eval_op_acos=function(e){if(null===e)return null;new t;var r=e.to_double();return r<=1&&r>=-1?t.from_double(Math.acos(r)):t.from_double(0)},t.eval_op_atan=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.atan(r))},t.prototype.num_abs=function(){var e;if(this.NUM_IS_LONG())return(e=this.NUM_LONG())<0&&(e=-e),void this.NUM_4_LONG(e);this._data[0]&=t.toSByte(~t.SIGN_MASK)},t.eval_op_rand=function(e){if(null===e)return null;var n,i,o,a=r.Randomizer.get_initialized(),s=new t;return a?(n=t.from_double(r.Randomizer.get_mod()),i=t.from_double(r.Randomizer.get_mul()),o=t.from_double(r.Randomizer.get_seed())):(r.Randomizer.set_initialized(),n=new t,i=new t,o=new t,n.num_4_a_std("100000007"),i.num_4_a_std("75000007"),o.num_4_a_std("12345678"),r.Randomizer.set_mod(n.to_double()),r.Randomizer.set_mul(i.to_double()),r.Randomizer.set_seed(o.to_double())),e.num_is_zero()?o.num_is_neg()&&(s.NUM_4_LONG(-1),o=t.mul(o,s)):e.num_is_neg()?o.NUM_4_LONG(t.hash_rand()):o=new t(e),o=t.mul(o,i),o=t.mod(o,n),s=t.div(o,n),r.Randomizer.set_mod(n.to_double()),r.Randomizer.set_mul(i.to_double()),r.Randomizer.set_seed(o.to_double()),s},t.hash_rand=function(){return(new Date).getMilliseconds()^12345678*Math.random()},t}();Z.INT_ZERO_HEX="00000000",Z.BYTE_ZERO_BIT="00000000",Z.NO_ROOM=-1,Z.ZERO_FILL=-2,Z.NUM_SIZE=20,Z.NUM_LONG_TYPE=-1,Z.EXP_BIAS=64,Z.SIGN_MASK=-128,Z._randtbl=[41,179,9,40,93,224,24,94,39,110,70,85,196,129,80,11,127,42,87,8,243,96,174,153,61,192,17,20,235,7,47,222,53,216,101,112,44,139,109,233,108,57,240,229,160,219,251,15,221,245,239,104,182,33,138,59,166,247,146,190,31,125,188,114,97,86,157,106,3,142,66,69,152,177,116,50,149,242,144,28,29,95,37,2,117,246,65,183,206,241,230,131,13,145,63,98,200,176,226,5,158,189,49,18,54,30,120,227,68,48,91,89,252,210,185,203,140,171,155,56,162,249,201,134,244,67,197,148,248,82,100,34,90,236,51,167,178,207,193,164,225,218,147,79,71,217,151,38,198,215,212,123,156,76,121,113,253,55,255,23,25,231,187,21,72,209,103,81,35,12,6,122,78,32,60,92,14,202,83,128,195,135,223,211,181,84,0,119,173,165,234,45,208,107,136,199,126,141,163,180,99,172,220,75,115,232,111,228,204,237,73,254,62,105,132,22,36,118,143,161,133,169,10,52,186,184,170,77,205,137,124,238,16,159,250,191,74,27,130,4,194,1,46,58,102,64,168,150,88,214,175,213,154,26,43,19];var J=function(){this.NUM_Diff_=0,this.NUM_Exp1_=0,this.NUM_Exp2_=0},Q=function(){function t(){}return t.char_memset=function(t,e,r,n){if(!(n<=0))for(var i=0;i<n;i+=1)t[e+i]=r},t.char_memcpy=function(t,e,r,n,i){if(!(i<=0))for(var o=0;o<i;o+=1)t[e+o]=r[n+o]},t.char_memmove=function(t,e,r,n,i){if(!(i<=0)){for(var o=new Array(i),a=0;a<i;a+=1)o[a]=r[n+a];for(a=0;a<i;a+=1)t[e+a]=o[a]}},t.mem_trim=function(t,e,r){var n;for(n=e+r-1;r>0&&n<t.length&&(" "===t[n]||"\x0000"===t[n]);n--,r--);return r},t}(),q=function(){function t(){}return t.dateheb_year_is_leap=function(e){return e%=t.YEARS_PER_CYCLE,t.DATEHEB_months_n[e+1]-t.DATEHEB_months_n[e]==13},t.dateheb_days_in_month=function(e,r,n){var i=r?t.DATEHEB_leap_days_in_month[e-1]:t.DATEHEB_norm_days_in_month[e-1];switch(r&&(n-=30),n){case 353:e===t.KISLEV&&(i=29);break;case 355:e===t.HESHVAN&&(i=30)}return i},t.dateheb_year_start=function(e){e-=1;var r=Math.floor(e/t.YEARS_PER_CYCLE);e%=t.YEARS_PER_CYCLE;var n=r*t.MONTHS_PER_CYCLE+t.DATEHEB_months_n[e],i=n*t.MONTH_DAYS,o=n*t.MONTH_EXTRA_PARTS+t.CREATION_PARTS;i+=Math.floor(o/t.PARTS_PER_DAY),(o%=t.PARTS_PER_DAY)>=Math.floor(3*t.PARTS_PER_DAY/4)&&(o=0,i+=1);var a=(i-1+t.CREATION_DOW)%7+1;return 1!==a&&4!==a&&6!==a||(o=0,i+=1),t.dateheb_year_is_leap(e)||3===a&&o>=9*t.PARTS_PER_HOUR+204&&(i+=2),t.dateheb_year_is_leap(e+t.YEARS_PER_CYCLE-1)&&2===a&&o>=15*t.PARTS_PER_HOUR+589&&(i+=1),i},t.dateheb_4_d=function(e,r,n,i){e+=t.DAYS_TIL_JESUS;var o,a=Math.floor(e/(t.DAYS_PER_CYCLE+1)),s=e%(t.DAYS_PER_CYCLE+1);for(i.value=a*t.YEARS_PER_CYCLE,i.value=i.value+Math.floor(s/(t.DAYS_PER_LEAP_YEAR+1));!((o=t.dateheb_year_start(i.value+1))>=e);)i.value=i.value+1;var _=t.dateheb_year_start(i.value);r.value=e-_;var l,u=o-_,c=u>355;for(l=1;l<13;l+=1){var P=t.dateheb_days_in_month(l,c,u);if(r.value<=P)break;r.value=r.value-P}return!c||l<=t.ADAR?n.value=l:l===t.ADAR+1?n.value=t.ADAR_B:n.value=l-1,c},t.dateheb_i_2_h=function(e,r,n,i,o){for(var a=0,s=0;e>0;)for(a=t.DATEHEB_letters.length;a>0;a-=1){var _=t.DATEHEB_letters[a-1];if(e>=_){e-=_,r[n++]=String.fromCharCode(t.ALEF.charCodeAt(0)+a-1),s+=1;break}}return s>0&&(s>=2&&"י"===r[n-2]&&("ה"!==r[n-1]&&"ו"!==r[n-1]||(r[n-2]=String.fromCharCode(r[n-2].charCodeAt(0)-1),r[n-1]=r[n-1]+"")),a>10&&i&&t.DATEHEB_letters[a-1]===t.DATEHEB_letters[a-2]&&(r[n-1]=String.fromCharCode(r[n-1].charCodeAt(0)-1)),o&&(1===s?r[n]="'":(r[n]=r[n-1],r[n-1]='"'),s+=1)),s},t.dateheb_2_str=function(e,r,n,i,o,a,s,_){var l=n>o&&e[r+o]===e[r];l&&(o+=1);var u=t.dateheb_i_2_h(a%1e3,e,r,_,l),c=o-u;if(c>0)if(s){i.value=i.value-c;var P=n-o;P>0?Q.char_memcpy(e,r+u,e,r+o,P):u=o}else c>e.length-r-u&&(c=e.length-r-u),Q.char_memset(e,r+u," ",c),u=o;return u},t.GetLocalMonths=function(){var e=t.MONTH_LEN;if(null===t._localMonths[0]){var n=E.GetMessageString(r.MsgInterface.DATEHEB_MONTH_STR);if(null!==n){t._localMonths[0]=" ";for(var i=1;i<t._localMonths.length;i+=1)t._localMonths[i]=n.substr((i-1)*e,i*e-(i-1)*e)}}return t._localMonths},t.GetLocalDows=function(){var e=t.DOW_LEN;if(null===t._localDows[0]){var n=E.GetMessageString(r.MsgInterface.DATEHEB_DOW_STR);if(null!==n){t._localDows[0]=" ";for(var i=1;i<t._localDows.length;i+=1)t._localDows[i]=n.substr((i-1)*e,i*e-(i-1)*e)}}return t._localDows},t.dateheb_h_2_i=function(e,r,n){var i,o,a=!1,s=!1,_=!1,l=0,u=1e3;for(i=0;r>0&&n<e.length;n++,r--)if(e[n]>=t.ALEF&&e[n]<=t.TAV){if((o=t.DATEHEB_letters[e[n].charCodeAt(0)-t.ALEF.charCodeAt(0)])>u)return 0;if(400===o){if(2===l)return 0;l+=1}else if(o>=100){if(_)return 0;_=!0}else if(o>=10){if(s)return 0;s=!0}else{if(a){if(s||9!==u)return 0;if(6!==o&&7!==o)return 0}a=!0}i+=o,u=o}return i},t.isHebrewLetter=function(e){return e>=t.ALEF&&e<=t.TAV},t.add2Date=function(r,n,i,o){var a,s=n;for(new e.StringBuilder(r.length);s<r.length&&!t.isHebrewLetter(r.charAt(s));)s+=1;for(a=s;a<s+i&&a<r.length&&(t.isHebrewLetter(r.charAt(a))||" "===r.charAt(a)||'"'===r.charAt(a)||"'"===r.charAt(a));a++)o.Append(r.charAt(a));return a},t.dateheb_2_d=function(e,r,n){if(0===n&&0===r&&0===e)return 0;if(0===n||0===r||0===e)return 1e9;var i=t.dateheb_year_start(e),o=t.dateheb_year_start(e+1)-i,a=o>355;if(a&&r>t.ADAR&&(r===t.ADAR_B?r=t.ADAR+1:r+=1),n>t.dateheb_days_in_month(r,a,o))return 1e9;for(var s=1;s<r;s+=1)i+=t.dateheb_days_in_month(s,a,o);return i+=n,Math.max(i-t.DAYS_TIL_JESUS,0)},t}();q.PARTS_PER_HOUR=1080,q.HOURS_PER_DAY=24,q.PARTS_PER_DAY=q.HOURS_PER_DAY*q.PARTS_PER_HOUR,q.MONTH_DAYS=29,q.MONTH_EXTRA_PARTS=12*q.PARTS_PER_HOUR+793,q.PARTS_PER_MONTH=q.MONTH_DAYS*q.PARTS_PER_DAY+q.MONTH_EXTRA_PARTS,q.MONTHS_PER_NORM_YEAR=12,q.MONTHS_PER_LEAP_YEAR=13,q.NORM_YEARS_PER_CYCLE=12,q.LEAP_YEARS_PER_CYCLE=7,q.YEARS_PER_CYCLE=q.NORM_YEARS_PER_CYCLE+q.LEAP_YEARS_PER_CYCLE,q.MONTHS_PER_CYCLE=q.NORM_YEARS_PER_CYCLE*q.MONTHS_PER_NORM_YEAR+q.LEAP_YEARS_PER_CYCLE*q.MONTHS_PER_LEAP_YEAR,q.PARTS_PER_NORM_YEAR=q.MONTHS_PER_NORM_YEAR*q.PARTS_PER_MONTH,q.DAYS_PER_NORM_YEAR=Math.floor(q.PARTS_PER_NORM_YEAR/q.PARTS_PER_DAY),q.PARTS_PER_LEAP_YEAR=q.MONTHS_PER_LEAP_YEAR*q.PARTS_PER_MONTH,q.DAYS_PER_LEAP_YEAR=Math.floor(q.PARTS_PER_LEAP_YEAR/q.PARTS_PER_DAY),q.PARTS_PER_CYCLE=q.MONTHS_PER_CYCLE*q.PARTS_PER_MONTH,q.DAYS_PER_CYCLE=Math.floor(q.PARTS_PER_CYCLE/q.PARTS_PER_DAY),q.CREATION_DOW=2,q.CREATION_PARTS=5*q.PARTS_PER_HOUR+204,q.DAYS_TIL_JESUS=1373428,q.HESHVAN=2,q.KISLEV=3,q.ADAR=6,q.ADAR_B=13,q.DATEHEB_letters=[1,2,3,4,5,6,7,8,9,10,20,20,30,40,40,50,50,60,70,80,80,90,90,100,200,300,400],q.ALEF="א",q.TAV="ת",q.DATEHEB_months_n=[0,12,24,37,49,61,74,86,99,111,123,136,148,160,173,185,197,210,222,235],q.DATEHEB_norm_days_in_month=[30,29,30,29,30,29,30,29,30,29,30,29,0],q.DATEHEB_leap_days_in_month=[30,29,30,29,30,30,29,30,29,30,29,30,29],q.MONTH_LEN=5,q._localMonths=new Array(15),q.DOW_LEN=5,q._localDows=new Array(8);var $=function(){function t(){this._environment=null,this.DATECHAR=0,this._environment=x.Environment}return Object.defineProperty(t,"Instance",{get:function(){return null===t._instance&&(t._instance=new t),t._instance},enumerable:!1,configurable:!0}),t.prototype.getNewDateBreakParams=function(){return new nt},t.prototype.getNewTimeBreakParams=function(){return new tt},t.prototype.mg2disp=function(t,e,r,n,i,o,a,s){return 6===arguments.length?this.mg2disp_0(t,e,r,n,i,o):7===arguments.length?this.mg2disp_1(t,e,r,n,i,o,a):this.mg2disp_2(t,e,r,n,i,o,a,s)},t.prototype.mg2disp_0=function(t,e,r,n,i,o){return this.mg2disp(t,e,r,n,!1,i,o)},t.prototype.mg2disp_1=function(t,e,r,n,i,o,a){return this.mg2disp(t,e,r,n,i,o,!1,a)},t.prototype.mg2disp_2=function(t,e,n,i,o,a,s,_){var l="",u=null===e?"":e;switch(n.getAttr()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:l=this.fromAlpha(t,n,u,o,s);break;case r.StorageAttribute.NUMERIC:return l=this.fromNum(t,n),0!==n.getMaskChars()&&_||(l=r.StrUtil.ltrim(l)),i?""==l?null:Number(l):l;case r.StorageAttribute.DATE:if(i){return this.fromMgDateToNativeDate(t,a)}l=this.fromDate(t,n,a,_);break;case r.StorageAttribute.TIME:if(i){return this.fromMgTimeToNativeTime(t,n,_)}l=this.fromTime(t,n,_);break;case r.StorageAttribute.BOOLEAN:return this.fromMgLogicalToNativeLogical(t);case r.StorageAttribute.BLOB:l=K.getString(t);break;case r.StorageAttribute.BLOB_VECTOR:l=t}return l},t.prototype.disp2mg=function(t,n,i,o,a){var s="";switch(i.getAttr()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:s=this.toAlpha(t,i);break;case r.StorageAttribute.NUMERIC:for(var _=(t=String(t)).length;_>0&&(i.picIsMask(_-1)||" "===t[_-1]);)_--;t.length>_&&(t=e.NString.Remove(t,_,t.length-_)),i.isNegative()&&t.trim().startsWith("-")&&(t=r.StrUtil.ltrim(t)),s=this.toNum(t,i,o);break;case r.StorageAttribute.DATE:var l=void 0;l="string"==typeof t?new Date(t):t,s=this.fromNativeDateToMgDate(l,i,o);break;case r.StorageAttribute.TIME:l=void 0;"string"==typeof t?(l=new Date,null!==t&&(l.setHours(+String(t).substr(0,2)),l.setMinutes(+String(t).substr(0,2)),String(t).length>5&&l.setSeconds(+String(t).substr(0,2)))):l=t,s=this.fromNativeTimeToMgTime(l,i);break;case r.StorageAttribute.BOOLEAN:s=this.fromNativeLogicalToMgLogical(t);break;case r.StorageAttribute.BLOB:s=K.createFromString(t,a)}return s},t.prototype.fromNum=function(t,e){return new Z(t).toDisplayValue(e)},t.prototype.fromAlpha=function(t,n,i,o,a){var s,_=n.getMaskSize(),l=_,u=n.getMask();if(n.getMaskChars()>0)s=this.win_data_cpy(e.NString.ToCharArray(u),_,e.NString.ToCharArray(t),n.isAttrAlpha(),a);else if(r.UtilStrByteMode.isLocaleDefLangDBCS()&&n.isAttrAlpha()){var c=r.UtilStrByteMode.lenB(t);l>c&&(l=c),s=r.UtilStrByteMode.leftB(t,l)}else null!==t&&(l>t.length&&(l=t.length),s=a?this.win_data_cpy(e.NString.ToCharArray(u),_,e.NString.ToCharArray(t),n.isAttrAlpha(),a):t.substr(0,l));if(o||null!==i&&i.length>0&&s.length<_){var P=new j(i),h=P.getContinuousRangeValues(),T=P.getDiscreteRangeValues();null===h&&null===T||(s=this.fillAlphaByRange(h,T,s))}return s},t.prototype.caseConvertedChar=function(t,e){return e.charCodeAt(0)===r.PICInterface.PIC_U?t.toUpperCase():e.charCodeAt(0)===r.PICInterface.PIC_L?t.toLowerCase():t},t.prototype.win_data_cpy=function(t,e,r,n,i){return 4===arguments.length?this.win_data_cpy_0(t,e,r,n):this.win_data_cpy_1(t,e,r,n,i)},t.prototype.win_data_cpy_0=function(t,e,r,n){return this.win_data_cpy(t,e,r,n,!1)},t.prototype.win_data_cpy_1=function(t,n,i,o,a){var s=0,_=0,l=new Array(n);if(o&&r.UtilStrByteMode.isLocaleDefLangDBCS()){for(var u=0;s<n&&u<n;){if(t[s].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP)if(_<i.length){var c=e.NString.FromChars(i,_,1);2===r.UtilStrByteMode.lenB(c)?s+1<n&&t[s+1].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP?(l[u++]=a?this.caseConvertedChar(i[_++],t[s+1]):i[_++],s+=1):l[u++]=" ":l[u++]=a?this.caseConvertedChar(i[_++],t[s+1]):i[_++]}else l[u++]=" ";else l[u++]=t[s];s+=1}return e.NString.FromChars(l).substr(0,u)}for(;s<n;)t[s].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP?_<i.length?(l[s]=i[_],l[s]=a?this.caseConvertedChar(i[_],t[s]):i[_],_+=1):l[s]=" ":l[s]=t[s],s+=1;return e.NString.FromChars(l)},t.prototype.fromDate=function(t,e,r,n){var i=e.getMask(),o=e.getMaskSize(),a=new Z(t).NUM_2_ULONG();return this.to_a_pic_datemode(i,o,a,e,n,!1,r)},t.prototype.fromTime=function(t,e,r){var n=e.getMask(),i=e.getMaskSize(),o=new Z(t).NUM_2_ULONG();return this.time_2_a_pic(n,i,o,e,r,!1)},t.prototype.fromMgDateToNativeDate=function(t,e){var r,n=new Z(t).NUM_2_ULONG();return r=new nt,this.date_break_datemode(r,n,!1,e),r.month>0&&(r.month=r.month-1),0==r.year&&0==r.month&&0==r.day?null:new Date(r.year,r.month,r.day)},t.prototype.fromNativeDateToMgDateNumber=function(t,e,r){new Z;var n,i=0,o=t.getFullYear(),a=t.getDate(),s=t.getMonth()+1;return e.isHebrew()?(o>0&&(0===i&&(i=5),o+=1e3*i),n=q.dateheb_2_d(o,s,a)):(0===o&&(o=this.date_sys().year),n=this.date_4_calender(o,s,a,0,!1)),n},t.prototype.fromNativeDateToMgDate=function(t,e,r){var n=new Z,i=null==t?0:this.fromNativeDateToMgDateNumber(t,e,r);return n.NUM_4_LONG(i),n.toXMLrecord()},t.prototype.to_a_pic_datemode=function(t,n,i,o,a,s,_){var l,u,c,P,h,T=0,p=0,I=0,f=0,O=0,g=0,R=0,S=0,C=!1,d=e.NString.ToCharArray(t),A=0,L=null;if(o.getMaskSize()>n){for(;u<n;u++)d[u]="*";return e.NString.FromChars(d)}if(n=l=o.getMaskSize(),o.zeroFill()&&0===i&&!a){for(;u<n;u++)d[u]=o.getZeroPad();return e.NString.FromChars(d)}if(o.isHebrew()&&(0===i||1e9===i)){for(;u<n;u++)d[u]=" ";return e.NString.FromChars(d)}if(P=new nt(f,O,T,p,I),this.date_break_datemode(P,i,s,_),o.isHebrew()){var m=new e.RefParam(g),N=new e.RefParam(S),y=new e.RefParam(R);C=q.dateheb_4_d(i,m,N,y),g=m.value,S=N.value,R=y.value}for(f=P.year,O=P.month,T=P.day,p=P.doy,I=P.dow,P=null;l>0;){var M=new e.RefParam(n);switch(d[A].charCodeAt(0)){case r.PICInterface.PIC_YY:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,f,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_HYYYYY:u=q.dateheb_2_str(d,A,l,M,5,R,o.isTrimed(),!0),n=M.value,A+=u,l-=u;break;case r.PICInterface.PIC_HL:u=q.dateheb_i_2_h(R/1e3%10,d,A,!1,!1),A++,l--;break;case r.PICInterface.PIC_HDD:u=q.dateheb_2_str(d,A,l,M,2,g,o.isTrimed(),!1),n=M.value,A+=u,l-=u;break;case r.PICInterface.PIC_YYYY:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),4):this.int_2_a(d,A,4,f,"0"),A+=4,l-=4;break;case r.PICInterface.PIC_MMD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,O,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_MMM:if(o.isHebrew()){C&&6===S&&(S=14);var D=q.GetLocalMonths();c=e.NString.ToCharArray(D[S])}else{var b=E.GetMessageString(r.MsgInterface.MONTHS_PTR);D=r.DateUtil.getLocalMonths(b);c=e.NString.ToCharArray(D[O])}h=new rt(d,A,l),n-=this.date_i_2_nm(h,c,o.isTrimed()),A=h.outIdx,l=h.len,h=null;break;case r.PICInterface.PIC_DD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,T,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_DDD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),3):this.int_2_a(d,A,3,p,"0"),l-=3,A+=3;break;case r.PICInterface.PIC_DDDD:A+=u=this.date_2_DDDD(T,d,A,l,o.isTrimed()),n+=u-4,l-=4;break;case r.PICInterface.PIC_W:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),1):this.int_2_a(d,A,1,I,"0"),l--,A++;break;case r.PICInterface.PIC_WWW:if(o.isHebrew()){var v=q.GetLocalDows();c=e.NString.ToCharArray(v[I])}else{var B=E.GetMessageString(r.MsgInterface.DAYS_PTR),Y=r.DateUtil.getLocalDays(B);c=e.NString.ToCharArray(Y[I])}h=new rt(d,A,l),n-=this.date_i_2_nm(h,c,o.isTrimed()),A=h.outIdx,l=h.len,h=null;break;case r.PICInterface.PIC_BB:c=e.NString.ToCharArray(r.UtilDateJpn.getStrDow(I)),L=null,h=new rt(d,A,l),L=this.date_i_2_nm_bytemode(L,h,e.NString.FromChars(c),n),d=new Array(L.length),e.NString.CopyTo(L,0,d,0,L.length),A=h.outIdx,l=h.len,L=null,h=null;break;case r.PICInterface.PIC_JY1:case r.PICInterface.PIC_JY2:case r.PICInterface.PIC_JY4:var U=null;U=d[A].charCodeAt(0)===r.PICInterface.PIC_JY1?r.UtilDateJpn.getInstance().date_jpn_yr_2_a(f,p,!1):r.UtilDateJpn.getInstance().date_jpn_yr_2_a(f,p,!0),L=null,h=new rt(d,A,l),L=this.date_i_2_nm_bytemode(L,h,U,n),d=null,d=new Array(L.length),e.NString.CopyTo(L,0,d,0,L.length),A=h.outIdx,l=h.len,L=null,h=null;break;case r.PICInterface.PIC_YJ:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,r.UtilDateJpn.getInstance().date_jpn_year_ofs(f,p),"0"),A+=2,l-=2;break;default:A++,l--}}return n<d.length&&Q.char_memset(d,n," ",d.length-n),e.NString.FromChars(d)},t.prototype.date_break_datemode=function(t,e,n,i){var o=t.year,a=t.month,s=t.day,_=t.doy,l=t.dow;if(e<=0)t.day=0,t.doy=0,t.dow=0,t.year=0,t.month=0;else{l=e%7+1,e-=1;var u=Math.floor(e/r.PICInterface.DAYSINFOURCENT);e-=u*r.PICInterface.DAYSINFOURCENT;var c=Math.floor(e/r.PICInterface.DAYSINCENTURY);c>3&&(c=3),e-=c*r.PICInterface.DAYSINCENTURY;var P=Math.floor(e/r.PICInterface.DAYSINFOURYEAR);e-=P*r.PICInterface.DAYSINFOURYEAR,(o=Math.floor(e/r.PICInterface.DAYSINYEAR))>3&&(o=3),e-=o*r.PICInterface.DAYSINYEAR;var h=0;(o=400*u+100*c+4*P+o+1)%4==0&&(o%100==0&&o%400!=0||(h=1)),n||"B"!==this._environment.GetDateMode(i)||(o+=r.PICInterface.DATE_BUDDHIST_GAP),a=Math.floor(e/r.PICInterface.DAYSINMONTH)+1,s=r.PICInterface.date_day_tab[a],h>0&&a>1&&(s+=1),e>=s?a+=1:(s=r.PICInterface.date_day_tab[a-1],h>0&&a>2&&(s+=1)),s=e-s+1,_=e+1,t.year=o,t.month=a,t.day=s,t.doy=_,t.dow=l}},t.prototype.int_2_a=function(t,e,r,n,i){var o=n<0;if(!(r<=0)){n=Math.abs(n);var a=r;do{t[e+(a-=1)]=String.fromCharCode(48+n%10),n=Math.floor(n/10)}while(a>0&&n>0);return o&&a>0&&(t[e+(a-=1)]="-"),this.lib_a_fill(t,e,r,a,i.charCodeAt(0))}},t.prototype.lib_a_fill=function(t,e,r,n,i){return 0===i?(r-=n)>0&&n>0&&(Q.char_memcpy(t,e,t,n,r),Q.char_memset(t,e+r," ",n)):n>0&&Q.char_memset(t,e,String.fromCharCode(i),n),r},t.prototype.date_i_2_nm=function(t,e,r){var n,i=this.date_msk_cnt(t.outVal,t.outIdx,t.len);return n=r?Q.mem_trim(e,0,i):i,n=Math.min(n,t.len),Q.char_memcpy(t.outVal,t.outIdx,e,0,n),t.outIdx=t.outIdx+n,t.len=t.len-i,(i-=n)>0&&Q.char_memcpy(t.outVal,t.outIdx,t.outVal,t.outIdx+i,t.len),i},t.prototype.date_i_2_nm_bytemode=function(t,n,i,o){var a=this.date_msk_cnt(n.outVal,n.outIdx,n.len),s=e.NString.FromChars(n.outVal);s=s.substr(0,n.outIdx);var _=r.UtilStrByteMode.lenB(s);return i=r.UtilStrByteMode.leftB(i,a),t=r.UtilStrByteMode.repB(e.NString.FromChars(n.outVal),i,_+1,a),n.outIdx=n.outIdx+i.length,n.len=n.len-a,a,t},t.prototype.date_msk_cnt=function(t,e,r){for(var n=t[e++],i=1;i<r&&t[e]===n;)e+=1,i+=1;return i},t.prototype.date_2_DDDD=function(t,r,n,i,o){var a,s=4;switch(t>9?(this.int_2_a(r,n,2,t,(0).toString()),n+=2):(o?(Q.char_memcpy(r,n,r,n+1,i-1),s--):r[n++]=" ",this.int_2_a(r,n,1,t,(0).toString()),n++),t){case 1:case 21:case 31:a=e.NString.ToCharArray("st");break;case 2:case 22:a=e.NString.ToCharArray("nd");break;case 3:case 23:a=e.NString.ToCharArray("rd");break;default:a=e.NString.ToCharArray("th")}return r[n++]=a[0],r[n]=a[1],s},t.prototype.fromMgTimeToNativeTime=function(e,r,n){r.getMask(),r.getMaskSize();var i=new Z(e).NUM_2_ULONG(),o=new tt;t.time_break(o,i);var a=new Date;return a.setHours(o.hour),a.setMinutes(o.minute),a.setSeconds(o.second),a},t.prototype.time_2_a_pic=function(n,i,o,a,s,_){var l,u,c=0,P=0,h=0,T=0,E=e.NString.ToCharArray(n),p=new tt(c,P,h);if(_?T=o-1e3*(l=Math.floor(o/1e3)):l=o,t.time_break(p,l),c=p.hour,P=p.minute,h=p.second,a.getMaskSize()>i)Q.char_memset(E,0,"*",i),u=e.NString.FromChars(E);else{if(a.zeroFill()&&0===l&&(!_||0===T)){if(s){for(var I=0;I<a.getMaskSize();I+=1)E[I]<=""&&(E[I]=a.getZeroPad());return u=e.NString.FromChars(E)}return Q.char_memset(E,0,a.getZeroPad(),a.getMaskSize()),u=e.NString.FromChars(E)}for(var f=0,O=0,g=a.getMaskSize(),R=-1;f<g;)switch(E[f].charCodeAt(0)){case r.PICInterface.PIC_HH:R=f,f+=2;break;case r.PICInterface.PIC_MMT:this.int_2_a(E,f,2,P,"0"),f+=2;break;case r.PICInterface.PIC_SS:this.int_2_a(E,f,2,h,"0"),f+=2;break;case r.PICInterface.PIC_MS:this.int_2_a(E,f,3,T,"0"),f+=3;break;case r.PICInterface.PIC_PM:O=1;var S=c%24;S<12||0===S?Q.char_memcpy(E,f,e.NString.ToCharArray("am"),0,2):Q.char_memcpy(E,f,e.NString.ToCharArray("pm"),0,2),f+=2;break;default:f++}R>=0&&(O>0&&(0===(c%=24)||0===(c%=12))&&(c=12),this.int_2_a(E,R,2,c,0!==O&&c<10?" ":"0")),u=e.NString.FromChars(E)}return u},t.time_break=function(t,e){e<=0?(t.second=0,t.minute=0,t.hour=0):(t.hour=Math.floor(e/3600),e-=3600*t.hour,t.minute=Math.floor(e/60),t.second=e-60*t.minute)},t.prototype.fromLogical=function(t,r,n){var i=e.NString.ToCharArray(r.getMask());if(r.getMaskSize()>i.length)return Q.char_memset(i,0,"*",i.length),e.NString.FromChars(i);for(var o=new Array(50),a=0;a<o.length;++a)o[a]=(0).toString();this.win_rng_bool_sub(o,o.length,"1"===t.charAt(0),n);var s=r.getMaskSize();return this.win_data_cpy(i,s,o,r.isAttrAlpha())},t.prototype.fromMgLogicalToNativeLogical=function(t){return"1"===t.charAt(0)},t.prototype.fromNativeLogicalToMgLogical=function(t){return!0===t?"1":"0"},t.prototype.win_rng_bool_sub=function(t,e,n,i){for(var o=new Array(r.PICInterface.DB_STR_MAX+2),a=0;a<o.length;++a)o[a]=(0).toString();var s=new Array(r.PICInterface.DB_STR_MAX+2);for(a=0;a<s.length;++a)s[a]=(0).toString();var _,l=0;if(i=this.win_rng_bool(i),this.win_rng_crk(o,s,i),n)_=0;else{for(;o[l]>"\0";)l+=1;_=l+1}for(var u=_;o[u]>"\0";)u+=1;u-=_,Q.char_memcpy(t,0,o,_,Math.min(u,e)),u<e&&Q.char_memset(t,u," ",e-u)},t.prototype.win_rng_bool=function(t){return null!==t&&0!==t.length||(t="True, False"),t},t.prototype.win_rng_crk=function(t,r,n){for(var i=n.length,o=e.NString.ToCharArray(n),a=0,s=0,_=0;s<i;)if(","===o[s]||"-"===o[s]){if(r[_++]=o[s++],t[a++]="\0",s<i)for(;" "===o[s];)s+=1}else"\\"===o[s]&&(s+=1),t[a]=o[s++],a+=1;r[_]="\0",t[a++]="\0",t[a]="\0"},t.prototype.toNum=function(t,e,r){return new Z(t,e,r).toXMLrecord()},t.prototype.a_2_date_pic_datemode=function(t,n,i,o,a){var s=0,_=!1,l=!1,u=!1,c=!1,P=!1,h=0,T=new et(0),E=0,p=0,I=Math.min(t.length,i.getMaskSize());t.length<o.length&&(t.length=o.length);var f,O=0,g=1,R=1,S=1,C=!1;for(f=0;f<n&&("0"===t[f]||" "===t[f]);f+=1);if(f===n)return 0;for(;s<n&&s+E<I;)switch(o[s+E].charCodeAt(0)){case r.PICInterface.PIC_YY:_=!0,c=!0,O=this.date_a_2_i(t,2,s),s+=2,0===O&&(P=!0);var d=this._environment.GetCentury(a)%100;O<d&&(O+=100),O+=this._environment.GetCentury(a)-d,"B"===this._environment.GetDateMode(a)&&(O-=r.PICInterface.DATE_BUDDHIST_GAP);break;case r.PICInterface.PIC_YYYY:_=!0,c=!0;var A=void 0;if(r.UtilStrByteMode.isLocaleDefLangJPN()){for(A=0;A<4&&s+A<t.length&&r.UtilStrByteMode.isDigit(t[s+A]);A++);f=A}else{for(f=0;s+f<t.length&&t[s+f]!==this.DATECHAR.toString()&&f<4;f++);for(A=0;s+A<t.length&&r.UtilStrByteMode.isDigit(t[s+A])&&A<4;A++);}r.UtilStrByteMode.isLocaleDefLangJPN()?f<4&&t.length<o.length&&this.move_date(t,s,4-f,t.length):f<4&&I<o.length&&(this.move_date(t,s,4-f,I),I=I+4-f),O=this.date_a_2_i(t,4,s),s+=4,0===O&&(P=!0),A<=2&&(O<(d=this._environment.GetCentury(a)%100)&&(O+=100),O+=this._environment.GetCentury(a)-d),"B"===this._environment.GetDateMode(a)&&(O-=r.PICInterface.DATE_BUDDHIST_GAP);break;case r.PICInterface.PIC_HYYYYY:c=!0;var L=0;I>s+5&&o[s+5].charCodeAt(0)===r.PICInterface.PIC_HYYYYY&&(L=1),O=q.dateheb_h_2_i(t,5+L,s),s+=5+L,0===O&&(P=!0);break;case r.PICInterface.PIC_HL:E=q.dateheb_h_2_i(t,1,s),s++;break;case r.PICInterface.PIC_HDD:c=!0,L=0,I>s+2&&o[s+2].charCodeAt(0)===r.PICInterface.PIC_HDD&&(L=1),R=q.dateheb_h_2_i(t,2+L,s),s+=2+L;break;case r.PICInterface.PIC_MMD:c=!0,l=!0,r.UtilStrByteMode.isLocaleDefLangJPN()?(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length):t[s+1].charCodeAt(0)===this.DATECHAR&&I<o.length&&(this.move_date(t,s,1,I),I+=1),g=this.date_a_2_i(t,2,s),s+=2;break;case r.PICInterface.PIC_MMM:c=!0,l=!0,T.val=s,g=this.date_MMM_2_m(t,o,T,I,i.isHebrew()),s=T.val,i.isHebrew()&&14===g&&(g=6);break;case r.PICInterface.PIC_DD:c=!0,u=!0,r.UtilStrByteMode.isLocaleDefLangJPN()?(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length):t[s+1].charCodeAt(0)===this.DATECHAR&&I<o.length&&(this.move_date(t,s,1,I),I+=1),R=this.date_a_2_i(t,2,s),s+=2;break;case r.PICInterface.PIC_DDD:c=!0,C=!0,u=!0,S=this.date_a_2_i(t,3,s),s+=3;break;case r.PICInterface.PIC_DDDD:c=!0,u=!0,R=this.date_a_2_i(t,2,s),s+=4;break;case r.PICInterface.PIC_YJ:_=!0,c=!0,r.UtilStrByteMode.isLocaleDefLangJPN()&&(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length),O=this.date_a_2_i(t,2,s),s+=2;var m=e.NString.FromChars(t);if(0===(h=r.UtilDateJpn.getInstance().getStartYearOfEra(m,i.getMask())))return 0;0===(O+=h-1)&&(P=!0);break;default:r.UtilStrByteMode.isLocaleDefLangDBCS()&&!1===r.UtilStrByteMode.isHalfWidth(t[s])&&r.UtilStrByteMode.isHalfWidth(o[s+E])&&E++,s+=1}return P&&(l||(g=0),u||0!==g||(R=0)),(0!==R||0!==g||!P&&0!==O)&&c?i.isHebrew()?(O>0&&(0===p&&(p=5),O+=1e3*p),q.dateheb_2_d(O,g,R)):(0!==O||_||(O=this.date_sys().year),this.date_4_calender(O,g,R,S,C)):0},t.prototype.date_a_2_i=function(t,e,r){return 3!==arguments.length||!(null===t||t instanceof Array)||null!==e&&e.constructor!==Number||null!==r&&r.constructor!==Number?this.date_a_2_i_1(t,e,r):this.date_a_2_i_0(t,e,r)},t.prototype.date_a_2_i_0=function(t,r,n){for(var i=new Array(r),o=new Z,a=0;a<r;a+=1)i[a]=t[n+a];return o.a_2_long(e.NString.FromChars(i))},t.prototype.move_date=function(t,e,r,n){4!==arguments.length||!(null===t||t instanceof Array)||null!==e&&e.constructor!==Number||null!==r&&r.constructor!==Number||null!==n&&n.constructor!==Number?this.move_date_1(t,e,r,n):this.move_date_0(t,e,r,n)},t.prototype.move_date_0=function(t,e,r,n){Q.char_memmove(t,e+r,t,e,n-(e+r)+1),Q.char_memset(t,e,"0",r)},t.prototype.date_MMM_2_m=function(t,n,i,o,a){var s;if(r.UtilStrByteMode.isLocaleDefLangJPN()){var _=r.UtilStrByteMode.convPos(e.NString.FromChars(t),e.NString.FromChars(n),i.val,!1);s=this.date_msk_cnt(n,_,o-_)}else s=this.date_msk_cnt(n,i.val,o-i.val);var l=i.val;if(i.val=i.val+s,0===(o=Q.mem_trim(t,l,s)))return 0;var u=e.NString.FromChars(t,l,o),c=void 0;if(a)c=q.GetLocalMonths();else{var P=E.GetMessageString(r.MsgInterface.MONTHS_PTR);c=r.DateUtil.getLocalMonths(P)}for(var h=1;h<c.length;h+=1)if(0===e.NString.Compare(c[h].substr(0,o),u,!0))return h;return 0},t.prototype.date_sys=function(){var t=new nt,r=e.DateTime.Now;return t.year=r.Year,t.month=r.Month,t.day=r.Day,t},t.prototype.date_magic=function(t){var r,n=(r=t?e.DateTime.UtcNow:e.DateTime.Now).Year,i=r.Month,o=r.Day;return this.date_4_calender(n,i,o,1,!1)},t.prototype.time_magic=function(t){return e.DateTime.GetTotalSecondsFromMidnight(t,new Date)},t.prototype.mtime_magic=function(t){return e.DateTime.GetTotalMilliSecondsFromMidnight(t,new Date)},t.prototype.date_4_calender=function(t,e,n,i,o){var a=t%4==0&&(t%100!=0||t%400==0);if(o){if(0===i)return 0;if(i>366||!a&&i>365)return 1e9}else{if(0===n&&0===e&&0===t)return 0;if(0===n||0===e||0===t||e>12)return 1e9}t-=1;var s=Math.floor(t/400);t-=400*s;var _=Math.floor(t/100);t-=100*_;var l=Math.floor(t/4);if(t-=4*l,!o){var u=r.PICInterface.date_day_tab[e-1],c=r.PICInterface.date_day_tab[e];if(a&&e>1&&(c+=1,e>2&&(u+=1)),n>c-u)return 1e9;i=u+n}return 146097*s+36524*_+1461*l+365*t+i},t.prototype.fromNativeTimeToMgTime=function(t,e){var r=new Z,n=this.fromNativeTimeToMgTimeNumber(t,e);return r.NUM_4_LONG(n),r.toXMLrecord()},t.prototype.fromNativeTimeToMgTimeNumber=function(t,e){return this.time_2_int(t.getHours(),t.getMinutes(),t.getSeconds())},t.prototype.a_2_time=function(t,e,r,n){return 3===arguments.length?this.a_2_time_0(t,e,r):this.a_2_time_1(t,e,r,n)},t.prototype.a_2_time_0=function(t,r,n){return this.a_2_time(t,t.length,e.NString.ToCharArray(r.getMask()),n)},t.prototype.a_2_time_1=function(t,e,n,i){var o=new Z,a=0,s=n.length;s>e&&(s=e);for(var _=0,l=0,u=0,c=0,P=0;a<s;){var h,T=void 0;switch(n[a].charCodeAt(0)){case r.PICInterface.PIC_HH:case r.PICInterface.PIC_MMT:case r.PICInterface.PIC_SS:case r.PICInterface.PIC_PM:T=2;break;case r.PICInterface.PIC_MS:T=3;break;default:T=1}switch(h=Math.min(T,s-a),n[a].charCodeAt(0)){case r.PICInterface.PIC_HH:l=o.a_2_long(t.substr(a,h));break;case r.PICInterface.PIC_MMT:u=o.a_2_long(t.substr(a,h));break;case r.PICInterface.PIC_SS:c=o.a_2_long(t.substr(a,h));break;case r.PICInterface.PIC_MS:P=o.a_2_long(t.substr(a,h));break;case r.PICInterface.PIC_PM:_=0;var E=t[a];E=E.toUpperCase(),a+1<s&&"M"===t[a+1].toUpperCase()&&("A"===E&&(_=-1),"P"===E&&(_=1))}a+=h}return c>59||u>59?0:(0!==_&&(-1===_?12===l&&(l=0):l<12&&(l+=12)),i?1e3*this.time_2_int(l,u,c)+P:this.time_2_int(l,u,c))},t.prototype.time_2_int=function(t,e,r){return 3600*t+60*e+r},t.toBoolean=function(t){return null!==t&&"1"===t},t.prototype.a_2_date=function(t,e,r){return this.a_2_date_datemode(t,e,r)},t.prototype.a_2_date_pic=function(t,r,n,i){return null===t&&(t=""),this.a_2_date_pic_datemode(e.NString.ToCharArray(t),t.length,r,e.NString.ToCharArray(n),i)},t.prototype.to_a=function(t,e,r,n,i){return this.to_a_datemode(t,e,r,n,!1,i)},t.prototype.a_2_date_datemode=function(t,n,i){var o=new z(n,r.StorageAttribute.DATE,i);return null===t&&(t=""),this.a_2_date_pic_datemode(e.NString.ToCharArray(t),t.length,o,e.NString.ToCharArray(o.getMask()),i)},t.prototype.to_a_datemode=function(t,e,n,i,o,a){var s=new z(i,r.StorageAttribute.DATE,a);return null===t&&(t=s.getMask()),this.to_a_pic_datemode(t,e,n,s,!0,o,a)},t.prototype.date_a_2_i_1=function(t,e,r){var n,i=new Z;return n=t.substr(r,e),i.a_2_long(n)},t.prototype.move_date_1=function(t,e,n,i){return t=r.StrUtil.memmove(t,e+n,t,e,i-e),t=r.StrUtil.memset(t,e,"0",n)},t.prototype.time_2_a=function(t,e,n,i,o,a){0===r.StrUtil.rtrim(i).length&&(i="HH:MM:SS");var s=new z(i,r.StorageAttribute.TIME,o);return null===t&&(t=s.getMask()),this.time_2_a_pic(t,e,n,s,!1,a)},t.prototype.toLogical=function(t,e,r){return null!==(t=t.trim())&&0!==t.length||(t="False"),this.disp_2_logical(t,e.getMask(),r)},t.prototype.disp_2_logical=function(t,n,i){var o=new e.StringBuilder(t.length);i=this.win_rng_bool(i);var a=(i=r.StrUtil.makePrintableTokens(i,r.SEQ_2_HTML)).indexOf(","),s=i.substr(0,a);for(s=r.StrUtil.makePrintableTokens(s,r.HTML_2_STR),a=0,a=0;a<t.length&&a<n.length;a++)n.charCodeAt(a)===r.PICInterface.PIC_X&&o.Append(t.charAt(a));var _=o.ToString();return s.length<_.length?_=_.substr(0,s.length):_.length<s.length&&(s=s.substr(0,_.length)),_.toUpperCase()===s.toUpperCase()?"1":"0"},t.prototype.toAlpha=function(n,i){var o,a=i.getMask(),s=new e.StringBuilder(i.getMaskSize()),_=r.UtilStrByteMode.isLocaleDefLangDBCS()&&i.isAttrAlpha(),l=o=0;for(o=l=0;l<n.length&&o<a.length;l++,o++)if(t.isAlphaPositionalDirective(a.charAt(o))&&(s.Append(n.charAt(l)),_)){var u=n.substr(l,1);2===r.UtilStrByteMode.lenB(u)&&(o+=1)}return s.ToString()},t.isAlphaPositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_X||e===r.PICInterface.PIC_U||e===r.PICInterface.PIC_L||e===r.PICInterface.PIC_N||e===r.PICInterface.PIC_J||e===r.PICInterface.PIC_G||e===r.PICInterface.PIC_S||e===r.PICInterface.PIC_T},t.prototype.fillAlphaByRange=function(t,e,r){var n=this.fillAlphaByDiscreteRangeValues(e,r);return null!==n||null!==(n=this.fillAlphaByContinuousRangeValues(t,r))||null!==e&&null!==(n=this.completeAlphaByRange(e,r))?n:r},t.prototype.fillAlphaByDiscreteRangeValues=function(t,e){if(null!==t)for(var r=0;r<t.length;r+=1){var n=t.get_Item(r),i=n.substr(0,Math.min(e.length,n.length));if(e.toUpperCase()===i.toUpperCase())return n}return null},t.prototype.fillAlphaByContinuousRangeValues=function(t,n){if(n=r.StrUtil.rtrim(n),null!==t)for(var i=0;i<t.length;i+=1){var o=t.get_Item(i),a=t.get_Item(i+=1);if(e.NString.CompareOrdinal(n,o)>=0&&e.NString.CompareOrdinal(n,a)<=0)return n}return null},t.prototype.completeAlphaByRange=function(t,e){for(var n=new Array(2),i=0;i<n.length;++i)n[i]=0;var o=new Array(2);for(i=0;i<o.length;++i)o[i]=null;for(var a=0;0===a||1===a;){var s=void 0;s=0===a?e:e.toLowerCase(),s=r.StrUtil.rtrim(s);for(var _=0;_<t.length;_+=1){var l=!1,u=0,c=void 0;c=0===a?t.get_Item(_):t.get_Item(_).toLowerCase();var P=s.length;if(P<c.length)for(var h=0;h<P;h+=1){if(s.charAt(h)!==c.charAt(h)){l=!0;break}u+=1}else l=!0;u>n[a]&&!l&&(o[a]=t.get_Item(_),n[a]=u)}a+=1}return null!==o[0]?o[0]:null!==o[1]?o[1]:null},t.prototype.setDateChar=function(t){this.DATECHAR=t},t.prototype.getDateChar=function(){return this.DATECHAR},t.StringValueToMgValue=function(t,n,i,o){switch(n){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:var a=t;return a=e.NString.PadRight(a,o,i);case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:return new Z(t);default:return t}},t}();$._instance=null;var tt=function(){function t(t,e,r){this.hour=0,this.minute=0,this.second=0,0!==arguments.length?this.constructor_1(t,e,r):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e,r){this.hour=t,this.minute=e,this.second=r},t}(),et=function(t){this.val=0,this.val=t},rt=function(t,e,r){this.outVal=null,this.len=0,this.outIdx=0,this.outVal=t,this.outIdx=e,this.len=r},nt=function(){function t(t,e,r,n,i){this.day=0,this.dow=0,this.doy=0,this.month=0,this.year=0,0!==arguments.length?this.constructor_1(t,e,r,n,i):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e,r,n,i){this.year=t,this.month=e,this.day=r,this.doy=n,this.dow=i},t}(),it=function(){function t(){}return t.validateBlobContents=function(r){var n=!1;if(!e.NString.IsNullOrEmpty(r)){var i=K.blobPrefixLength(r);n=0===e.NString.Compare(r,t.BLOB_TABLE_STR+t.VECTOR_STR,!0,i,0,t.BLOB_TABLE_STR_LEN+t.VECTOR_STR_LEN)}return n},t.adjustAlphaStringsInFlatData=function(n){if(t.validateBlobContents(n)){var i=new e.StringBuilder,o=K.blobPrefixLength(n),a=n.substr(0,o);i.Append(a);var s=r.StrUtil.tokenize(n.substr(o),","),_=0;if(a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,(a=s[++_]).charAt(0)!==r.StorageAttribute.ALPHA&&a.charAt(0)!==r.StorageAttribute.MEMO)return n;i.Append(a+","),o+=a.length+1,a=s[++_];var l=e.NNumber.Parse(a);i.Append(a+","),o+=a.length+1,a=r.UtilStrByteMode.leftB(n.substr(o),l),i.Append(a+","),o+=a.length+1,_=0,a=(s=r.StrUtil.tokenize(n.substr(o),","))[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_];var u=e.NNumber.Parse(a);i.Append(a+","),o+=a.length+1,_++,a=s[_++],i.Append(a+","),o+=a.length+1;for(var c=0;c<u;c+=1)a=r.UtilStrByteMode.leftB(n.substr(o),l),i.Append(a),o+=a.length;return a=n.substr(o),i.Append(a),i.ToString()}return n},t}();it.BLOB_TABLE_STR="mgbt",it.BLOB_TABLE_STR_LEN=4,it.VECTOR_STR="MGVEC",it.VECTOR_STR_LEN=5;var ot=function(){function t(){}return t.byteStreamToString=function(r){return 1===arguments.length&&(null===r||r instanceof e.StringBuilder)?t.byteStreamToString_0(r):t.byteStreamToString_1(r)},t.byteStreamToString_0=function(t){for(var r,n,i=new e.StringBuilder(Math.floor(t.Length/2)),o=0;o<t.Length;o+=2)r=t.get_Item(o)+t.get_Item(o+1),n=String.fromCharCode(e.NNumber.Parse(r,e.NumberStyles.HexNumber)),i.Append(n);return i.ToString()},t.byteStreamToString_1=function(r){return t.byteStreamToString(new e.StringBuilder(r))},t.serializeItemVal=function(e,r,n,i){return 2===arguments.length?t.serializeItemVal_0(e,r):t.serializeItemVal_1(e,r,n,i)},t.serializeItemVal_0=function(t,n){var i;e.Debug.Assert(null!==t);var o=e.NString.Empty,a=null,s=null,_=0,l=0,u=e.NString.Empty,c=0,P=null,h=e.NString.Empty;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:var T=new Z(t);a=r.Misc.ToByteArray(T.Data);break;case r.StorageAttribute.BOOLEAN:a=x.Environment.GetEncoding().GetBytes(t);break;case r.StorageAttribute.ALPHA:t=r.StrUtil.rtrim(t),i=r.UtilStrByteMode.lenB(t).toString(16).toUpperCase();for(var E=0;E<4-i.length;E++)o+="0";o+=i,(a=new Uint8Array(x.Environment.GetEncoding().GetBytes(o).length+x.Environment.GetEncoding().GetBytes(t).length)).set(x.Environment.GetEncoding().GetBytes(o),0),a.set(x.Environment.GetEncoding().GetBytes(t),x.Environment.GetEncoding().GetBytes(o).length);break;case r.StorageAttribute.UNICODE:i=(t=r.StrUtil.rtrim(t)).length.toString(16).toUpperCase();for(E=0;E<4-i.length;E++)o+="0";o+=i,(a=new Uint8Array(x.Environment.GetEncoding().GetBytes(o).length+x.Environment.GetEncoding().GetBytes(t).length)).set(x.Environment.GetEncoding().GetBytes(o),0),a.set(x.Environment.GetEncoding().GetBytes(t),x.Environment.GetEncoding().GetBytes(o).length);break;case r.StorageAttribute.BLOB:_=0,l=e.ISO_8859_1_Encoding.ISO_8859_1.GetByteCount(t),c=Math.floor(l/65535),o="FFFF",P=x.Environment.GetEncoding().GetBytes(o);for(var p=0;p<c;p++){u=t.substr(_,65535),_+=65535;var I=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u);(s=new Uint8Array(P.length+I.length)).set(P),s.set(I,P.length)}if(l%65535>0){u=t.substr(_,l-_);I=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u);o=e.NString.Format(String.fromCharCode(I.length),"X4");var f=new Uint8Array(s.length+x.Environment.GetEncoding().GetBytes(o).length+e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u).length);f.set(s),f.set(x.Environment.GetEncoding().GetBytes(o),s.length),f.set(e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u),s.length+x.Environment.GetEncoding().GetBytes(o).length),s=f,c++}h=e.NString.Format(String.fromCharCode(c),"D4"),P=x.Environment.GetEncoding().GetBytes(h),(a=new Uint8Array(s.length+P.length)).set(P),a.set(s,P.length)}return a},t.serializeItemVal_1=function(t,n,i,o){e.Debug.Assert(null!=t);var a,s,_,l,u=2*x.Environment.GetSignificantNumSize(),c=new e.StringBuilder;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=o?r.Base64.encode(this.byteStreamToString(t.substr(0,u)),x.Environment.GetEncoding()):t.substr(0,u);break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:_=0,l=(t=r.StrUtil.rtrim(t)).length;do{var P=t.indexOf(String.fromCharCode(0),_);if(-1===P){for(a=(l-_).toString(16).toUpperCase(),s=0;s<4-a.length;s++)c.Append("0");c.Append(a),_>0&&(t=t.substr(_,l-_)),_=l}else{for(a=(P-_+32768).toString(16).toUpperCase(),c.Append(a),c.Append(t.substr(_,P-_)),s=1;s<l-P&&0===t.charCodeAt(P+s);s++);for(a="0000"+s.toString(16).toUpperCase(),c.Append(a.substr(a.length-4)),_=P;s>0;s--,_++){var h="0"+t.charCodeAt(P).toString(16);c.Append(h.substr(h.length-2))}if(_>=l){c.Append("0000"),t="";break}}}while(_<l);break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.DOTNET:if(_=0,l=t.length,r.UtilStrByteMode.isLocaleDefLangDBCS()&&n===r.StorageAttribute.BLOB_VECTOR&&(i===r.StorageAttribute.ALPHA||i===r.StorageAttribute.MEMO)){t=it.adjustAlphaStringsInFlatData(t);do{if(t.length<_+16383){for(_>0&&(t=t.substr(_)),a=r.UtilStrByteMode.lenB(t).toString(16).toUpperCase(),s=0;s<4-a.length;s++)c.Append("0");c.Append(a),t=o?r.Base64.encode(t,!0,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(t,4),_=l}else{var T=t.substr(_,16383);a=(r.UtilStrByteMode.lenB(T)+32768).toString(16).toUpperCase(),c.Append(a),c.Append(o?r.Base64.encode(T,!0,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(T,4)),c.Append("0000"),_+=16383}}while(_<l);break}do{if(l<_+32767){for(a=(l-_).toString(16).toUpperCase(),s=0;s<4-a.length;s++)c.Append("0");c.Append(a),_>0&&(t=t.substr(_,l-_)),t=o?r.Base64.encode(t,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(t,4),_=l}else a="FFFF",c.Append(a),o?c.Append(r.Base64.encode(t.substr(_,32767),x.Environment.GetEncoding())):c.Append(r.StrUtil.stringToHexaDump(t.substr(_,32767),4)),c.Append("0000"),_+=32767}while(_<l)}return c.Append(t),c.ToString()},t.deSerializeItemVal=function(t,n,i,o,a,s){var _,l,u=null,c=0,P=null,h=null;if(n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET)l=c+4,h=t.substr(c,l-c),_=e.NNumber.Parse(h,e.NumberStyles.HexNumber),c=l;else if(n===r.StorageAttribute.BOOLEAN)_=1;else{var T=x.Environment.GetSignificantNumSize();_=o?2*T:4*Math.floor((T+2)/3)}if((32768&_)>0)P=new e.StringBuilder,_&=32767,n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR&&n!==r.StorageAttribute.DOTNET||(o?_*=2:_=4*Math.floor((_+2)/3)),s.value=this.getSpannedField(t,_,c,n,P,o),u=P.ToString(),l=c+s.value;else{if(n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR&&n!==r.StorageAttribute.DOTNET||(o?_*=2:_=4*Math.floor((_+2)/3)),(l=c+_)>t.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+t);u=r.UtilStrByteMode.isLocaleDefLangDBCS()&&n===r.StorageAttribute.BLOB_VECTOR?this.getString(t.substr(c,l-c),n,o,a===r.StorageAttribute.ALPHA):this.getString(t.substr(c,l-c),n,o)}return c=l,n!==r.StorageAttribute.ALPHA&&n!==r.StorageAttribute.UNICODE||(_=i,u=r.StrUtil.padStr(u,_),n===r.StorageAttribute.ALPHA&&r.UtilStrByteMode.isLocaleDefLangDBCS()&&(u=r.UtilStrByteMode.leftB(u,_))),s.value=l,u},t.getString=function(e,r,n,i){return 3===arguments.length?t.getString_0(e,r,n):2===arguments.length?t.getString_2(e,r):t.getString_1(e,r,n,i)},t.getString_0=function(e,r,n){return t.getString(e,r,n,!1)},t.getString_1=function(e,n,i,o){return i?n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET?t.byteStreamToString(e):e:n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET?r.Base64.decode(e,o?x.Environment.GetEncoding():null):r.Base64.decodeToHex(e)},t.getSpannedField=function(e,r,n,i,o,a,s){return 6===arguments.length?t.getSpannedField_0(e,r,n,i,o,a):t.getSpannedField_1(e,r,n,i,o,a,s)},t.getSpannedField_0=function(n,i,o,a,s,_){var l,u,c,P,h=o+i,T=o,E=null;if(h>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(s.Remove(0,s.Length),s.Append(t.getString(n.substr(o,h-o),a,_)),h=(o+=i)+4,c=n.substr(o,h-o),l=e.NNumber.Parse(c,e.NumberStyles.HexNumber),o=h,(h=_?o+2*l:o+4*Math.floor((l+2)/3))>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);for(;o<h;)c=n.substr(o,2),u=String.fromCharCode(e.NNumber.Parse(c,e.NumberStyles.HexNumber)),s.Append(u),o+=2;if(h=o+4,c=n.substr(o,h-o),o=h,(32768&(l=e.NNumber.Parse(c,e.NumberStyles.HexNumber)))>0)E=new e.StringBuilder,l&=32767,a!==r.StorageAttribute.BLOB&&a!==r.StorageAttribute.BLOB_VECTOR||(_?l*=2:l=4*Math.floor((l+2)/3)),P=t.getSpannedField(n,l,o,a,E,_),s.Append(E.ToString()),o+=P;else{if(a!==r.StorageAttribute.BLOB&&a!==r.StorageAttribute.BLOB_VECTOR||(_?l*=2:l=4*Math.floor((l+2)/3)),(h=o+l)>n.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+n);s.Append(t.getString(n.substr(o,h-o),a,_)),o=h}return o-T},t.getSpannedField_1=function(n,i,o,a,s,_,l){var u,c,P,h,T=o+i,E=o,p=null;if(h=r.UtilStrByteMode.isLocaleDefLangDBCS()?e.ISO_8859_1_Encoding.ISO_8859_1:x.Environment.GetEncoding(),T>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(s.Remove(0,s.Length),s.Append(h.GetString(n,o,i)),(l-=1)<=0)return 0;if(T=(o+=i)+4,c=h.GetString(n,o,4),e.NNumber.Parse(c,e.NumberStyles.HexNumber),o=T,T>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(T=o+4,c=h.GetString(n,o,4),o=T,(32768&(u=e.NNumber.Parse(c,e.NumberStyles.HexNumber)))>0)p=new e.StringBuilder,P=t.getSpannedField(n,u,o,a,p,_,l),s.Append(p.ToString()),o+=P;else{if((T=o+u)>n.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+n);s.Append(h.GetString(n,o,u)),o=T}return o-E},t.itemValToXML=function(e,n,i,o){var a=t.serializeItemVal(e,n,i,o);return r.XmlParser.escape(a).toString()},t.getString_2=function(e,n){var i,o=x.Environment.GetDebugLevel()>1||n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||r.StorageAttributeCheck.isTypeLogical(n);return i=n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR?e.substr(4):e,t.getString(i,n,o)},t}(),at=function(t){function n(e,r,n,i,o,a){var s=t.call(this)||this;return s._cells=null,s._encoding=null,s._allowNull=!1,s._cellContentType=null,s._cellSize=0,s._cellsAttr=null,s._cellsDefaultVal=null,s._cellsIsNullDefault=!1,s._dataBuf=null,s._initialized=!1,s._nullBuf=null,s._originalflatData=null,6===arguments.length?s.constructor_0(e,r,n,i,o,a):1!==arguments.length||null!==e&&e.constructor!==String?s.constructor_2(e):s.constructor_1(e),s}return a(n,t),n.prototype.constructor_0=function(t,n,i,o,a,s){this._cells=new e.List,this._cellsAttr=t,this._cellContentType=n,this._cellsDefaultVal=i,this._cellsIsNullDefault=o,this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*s:s,this._initialized=!0,this._allowNull=a,this._nullBuf=new e.StringBuilder,this._dataBuf=new e.StringBuilder,this._originalflatData=this.toString(),this._encoding=x.Environment.GetEncoding()},n.prototype.constructor_1=function(t){this._cells=new e.List,this._initialized=!1,this._originalflatData=t,this._encoding=x.Environment.GetEncoding()},n.prototype.constructor_2=function(t){this._cells=new e.List,this._cellsAttr=t.getCellsType(),this._cellContentType=t.getVecCellsContentType(),this._cellsDefaultVal=t.getCellDefualtValue(),this._cellsIsNullDefault=t.isNullDefault(),this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*t.getVecCellsSize():t.getVecCellsSize(),this._initialized=!0,this._allowNull=t.NullAllowed,this._nullBuf=new e.StringBuilder,this._dataBuf=new e.StringBuilder,this._originalflatData=this.toString(),this._encoding=x.Environment.GetEncoding()},n.prototype.init=function(){var t=null,i=0,o=null,a=this.isUnicode(this._originalflatData),s=!1,_=K.blobPrefixLength(this._originalflatData);t=r.StrUtil.tokenize(this._originalflatData.substr(_),",");var l=0;if(!this._initialized){if(!n.validateBlobContents(this._originalflatData))throw new e.ApplicationException("in VectorType.init wrong vector format");var u=K.getPrefix(this._originalflatData);if(this._cellContentType=K.getContentType(u),_=_+4+5+1,_+=(o=t[++i]).length+1,_+=(o=t[++i]).length+1,o=t[++i],this._cellsAttr=o.charAt(0),_+=2,o=t[++i],this._cellSize=e.NNumber.Parse(o),_+=o.length+1,this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME)this._cellsDefaultVal=r.StrUtil.stringToHexaDump(this._originalflatData.substr(_,this._cellSize),2);else if(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.MEMO){if(r.UtilStrByteMode.isLocaleDefLangDBCS()?(s=!0,a=!0,this._cellsDefaultVal=r.UtilStrByteMode.leftB(this._originalflatData.substr(_),this._cellSize)):this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize),null!==this._encoding&&!a)try{var c=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(this._cellsDefaultVal);this._cellsDefaultVal=this._encoding.GetString(c,0,c.length)}catch(t){}}else if(this._cellsAttr===r.StorageAttribute.UNICODE){this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize);try{c=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(this._cellsDefaultVal);this._cellsDefaultVal=e.Encoding.Unicode.GetString(c,0,c.length)}catch(t){}}else this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize);_=s?_+this._cellsDefaultVal.length+1:_+this._cellSize+1,o=(t=r.StrUtil.tokenize(this._originalflatData.substr(_),","))[i=0],this._cellsIsNullDefault=$.toBoolean(o),_+=o.length+1,o=t[++i],this._allowNull=$.toBoolean(o),_+=o.length+1,_+=(o=t[++i]).length+1,o=t[++i],l=e.NNumber.Parse(o),_+=o.length+1,_+=(o=t[++i]).length+1,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(_+=(o=t[++i]).length+1);var P=void 0;s?_=_+(P=r.UtilStrByteMode.leftB(this._originalflatData.substr(_),l*this._cellSize)).length+1:(P=this._originalflatData.substr(_,l*this._cellSize),_=_+l*this._cellSize+1),this._dataBuf=new e.StringBuilder(P.length),this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO&&this._cellsAttr!==r.StorageAttribute.UNICODE&&this._dataBuf.Append(P);var h=this._originalflatData.substr(_,l);if(_=_+l+1,this._nullBuf=new e.StringBuilder(h),this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR)for(var T=0;T<l;T++){var E=h.charAt(T)>"\0";if(this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME)this._cells.push(new st(r.StrUtil.stringToHexaDump(P.substr(T*this._cellSize,this._cellSize),2),E));else if(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.MEMO){var p=void 0;if(p=s?r.UtilStrByteMode.midB(P,T*this._cellSize,this._cellSize):P.substr(T*this._cellSize,this._cellSize),null!==this._encoding&&!a)try{c=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(p);p=this._encoding.GetString(c,0,c.length)}catch(t){}this._dataBuf.Append(p),this._cells.push(new st(p,E))}else if(this._cellsAttr===r.StorageAttribute.UNICODE){p=P.substr(T*this._cellSize,this._cellSize);try{c=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(p);p=e.Encoding.Unicode.GetString(c,0,c.length)}catch(t){}this._dataBuf.Append(p),this._cells.push(new st(p,E))}else this._cells.push(new st(P.substr(T*this._cellSize,this._cellSize),E))}else for(T=0;T<l;T++){i=0,o=(t=r.StrUtil.tokenize(this._originalflatData.substr(_),","))[++i];var I=e.NNumber.Parse(o);_+=o.length+1;for(var f="",O=0;O<W.BLOB_PREFIX_ELEMENTS_COUNT;O++)f+=o=t[++i],_+=o.length+1,O!==W.BLOB_PREFIX_ELEMENTS_COUNT-1&&(f+=",");p=this._originalflatData.substr(_,I),E=h.charAt(T)>"\0";this._cells.push(new st(p,E,f)),_=_+I+1}0===this._dataBuf.Length&&(this._dataBuf=new e.StringBuilder(P.length)),this._initialized=!0}},n.prototype.toString=function(){var t="";if(this._initialized){if(t=t+0+",0,0,"+this._cellsAttr+","+this._cellContentType+";",t+=this.buildHeadersString(),this._cellsAttr===r.StorageAttribute.UNICODE){for(var i=new Array(2*this._dataBuf.Length),o=0;o<this._dataBuf.Length;o+=1)i[2*o]=String.fromCharCode(this._dataBuf.get_Item(o).charCodeAt(0)%256),i[2*o+1]=String.fromCharCode(this._dataBuf.get_Item(o).charCodeAt(0)/256);t=t+e.NString.FromChars(i)+","}else t=t+this._dataBuf+",";t=t+this._nullBuf+",",this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t+=this.getBlobsBuf()),t+=n.BLOB_TABLE_STR}else t=this._originalflatData;return t},n.prototype.getCellsAttr=function(){return this._initialized?this._cellsAttr:n.getCellsAttr(this._originalflatData)},n.prototype.getCellSize=function(){var t;return t=this._initialized?this._cellSize:n.getCellSize(this._originalflatData),this.getCellsAttr()===r.StorageAttribute.UNICODE&&(t=Math.floor(t/2)),t},n.prototype.getVecSize=function(){return this._initialized?this._cells.length:n.getVecSize(this._originalflatData)},n.prototype.getVecCell=function(t){var e=null;return t>0&&(this.init(),t<=this.getVecSize()?(e=this._cells.get_Item(t-1).data,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(e=this._cells.get_Item(t-1).blobFieldPrefix+";"+e),r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(e="\0"===e.charAt(0)?"0":"1"),this._cells.get_Item(t-1).isNull&&(e=null)):this._cellsIsNullDefault||(e=this._cellsDefaultVal)),e},n.prototype.GetCellValues=function(){var t=null,e=null;if(this.init(),this.getVecSize()>0){e=new Array(this.getVecSize());for(var n=0;n<this.getVecSize();n++)t=this._cells.get_Item(n).data,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t=this._cells.get_Item(n).blobFieldPrefix+";"+t),r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(t="\0"===t.charAt(0)?"0":"1"),this._cells.get_Item(n).isNull&&(t=null),e[n]=t}else this._cellsIsNullDefault||(e=[this._cellsDefaultVal]);return e},n.prototype.setVecCell=function(t,i,o){var a=!1,s=!0;try{if(t>0){this.init();var _=this._cellsAttr===r.StorageAttribute.UNICODE?Math.floor(this._cellSize/2):this._cellSize;if(o&&!this._allowNull&&(o=!1,i=this._cellsDefaultVal),t<=this._cells.length){var l=this._cells.get_Item(t-1);if(o){l.data=null,this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?l.blobFieldPrefix=K.getEmptyBlobPrefix(""):l.blobFieldPrefix=K.getEmptyBlobPrefix("\0"),l.isNull=!0,this._nullBuf.set_Item(t-1,"");for(T=0;T<_;T++)this._dataBuf.set_Item((t-1)*_+T,"\0");this._nullBuf.set_Item(t-1,"")}else{if(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR){var u=K.blobPrefixLength(i);l.blobFieldPrefix=i.substr(0,u-1),i.length>u?l.data=i.substr(u):l.data=""}else{r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)?(l.data=$.toBoolean(i)?(new e.StringBuilder).Append(1).ToString():(new e.StringBuilder).Append("\0").ToString(),i=l.data):l.data=i;var c=i;if(this._cellsAttr!==r.StorageAttribute.NUMERIC&&this._cellsAttr!==r.StorageAttribute.DATE&&this._cellsAttr!==r.StorageAttribute.TIME||(c=ot.byteStreamToString(c)),!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO){for(T=0;T<c.length&&T<_;T++)this._dataBuf.set_Item((t-1)*_+T,c.charAt(T));for(T=c.length;T<_;T++)this._dataBuf.set_Item((t-1)*_+T,this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.UNICODE?" ":"\0");this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.UNICODE&&this._cellsAttr!==r.StorageAttribute.MEMO||(l.data=this._dataBuf.ToString().substr((t-1)*_,_))}else{for(var P=this._encoding.GetBytes(this._dataBuf.ToString()),h=this._encoding.GetBytes(c),T=0;T<h.length&&T<_;T++)P[(t-1)*_+T]=h[T];for(var T=h.length;T<_;T++)P[(t-1)*_+T]=this._cellsAttr===r.StorageAttribute.ALPHA?32:0;this._dataBuf=new e.StringBuilder(this._encoding.GetString(P,0,P.length)),l.data=this._encoding.GetString(P,(t-1)*_,_)}}this._nullBuf.set_Item(t-1,"\0"),l.isNull=!1}a=!0}else{var E=void 0;this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?(E=this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?K.getEmptyBlobPrefix(""):K.getEmptyBlobPrefix("\0"),this._cellsIsNullDefault||(E+=this._cellsDefaultVal)):E=this._cellsIsNullDefault?null:this._cellsDefaultVal,null!==E&&r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(E=$.toBoolean(E)?(new e.StringBuilder).Append("").ToString():(new e.StringBuilder).Append("\0").ToString());for(c=E;this._cells.length<t;){if(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR)this._cells.push(new st(E.substr(n.EMPTY_BLOB_PREFIX_LEN),this._cellsIsNullDefault,E.substr(0,n.EMPTY_BLOB_PREFIX_LEN))),this._dataBuf.Append(this.getNullString(n.BLOB_TYPE_STRUCT_SIZE));else if(this._cells.push(new st(E,this._cellsIsNullDefault)),null!==E){this._cellsAttr!==r.StorageAttribute.NUMERIC&&this._cellsAttr!==r.StorageAttribute.DATE&&this._cellsAttr!==r.StorageAttribute.TIME||s&&(s=!1,c=ot.byteStreamToString(E)),this._dataBuf.Append(c);for(T=!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO?c.length:r.UtilStrByteMode.lenB(c);T<_;T++)this._dataBuf.Append(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.UNICODE?" ":"\0")}else this._dataBuf.Append(this.getNullString(_));this._nullBuf.Insert(this._cells.length-1,this._cellsIsNullDefault?"":"\0")}a=this.setVecCell(t,i,o)}}}catch(t){a=!1}return a},n.prototype.adjustToFit=function(t){if(t.getType()===r.StorageAttribute.BLOB_VECTOR){var n=this.getCellsAttr(),i=t.getCellsType();if(r.StorageAttributeCheck.isTheSameType(n,i)){if(this.init(),r.StorageAttributeCheck.IsTypeAlphaOrUnicode(n)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(i)){var o=t.getVecCellsSize(),a=this._cellsAttr===r.StorageAttribute.UNICODE?Math.floor(this._cellSize/2):this._cellSize,s=r.UtilStrByteMode.isLocaleDefLangDBCS()&&r.StorageAttributeCheck.isTypeAlpha(i);if(a!==o){for(var _=new e.StringBuilder,l=0;l<o;l+=1){var u=this._cells.get_Item(l);if(u.isNull){for(c=new e.StringBuilder,P=0;P<o;P+=1)c.Append("\0");_.Append(c.ToString()),u.data=c.ToString()}else if(a>o)u.data=s?r.UtilStrByteMode.leftB(u.data,o):u.data.substr(0,o),_.Append(u.data);else{var c;(c=new e.StringBuilder).Append(u.data);for(var P=s?r.UtilStrByteMode.lenB(u.data):u.data.length;P<o;P+=1)c.Append(" ");_.Append(c.ToString()),u.data=c.ToString()}}this._dataBuf=_}}var h=t.getVecCellsSize();return this._cellsAttr=t.getCellsType(),this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*h:h,this._cellsDefaultVal=t.getCellDefualtValue(),this._cellsIsNullDefault=t.isNullDefault(),this._allowNull=t.NullAllowed,void(this._originalflatData=this.toString())}throw new e.ApplicationException("in VectorType.adjustToFit vector basic types does not agree")}throw new e.ApplicationException("in VectorType.adjustToFit "+t.getName()+" is not of type vector")},n.prototype.buildHeadersString=function(){var t=n.BLOB_TABLE_STR+n.VECTOR_STR+","+n.VERSION+",1,"+this._cellsAttr+",";t=t+this._cellSize+",";var e="";return null!==this._cellsDefaultVal&&(e=this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME?ot.byteStreamToString(this._cellsDefaultVal):this._cellsDefaultVal),!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO?e+=this.getEmptyString(this._cellSize-e.length):e+=this.getEmptyString(this._cellSize-r.UtilStrByteMode.lenB(e)),t=(t=(t=t+e+","+(this._cellsIsNullDefault?"1":"0")+",")+(this._allowNull?"1":"0")+","+this._cellSize+","+this._cells.length+",")+(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?"1":"0")+",",this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t+="0,"),t},n.prototype.getNullString=function(t){for(var r=new e.StringBuilder,n=0;n<t;n+=1)r.Append("\0");return r.ToString()},n.prototype.getEmptyString=function(t){for(var r=new e.StringBuilder,n=0;n<t;n+=1)r.Append(" ");return r.ToString()},n.prototype.getBlobsBuf=function(){for(var t=new e.StringBuilder,r=0;r<this._cells.length;r+=1){var n="",i=0,o=this._cells.get_Item(r);null!==o.data&&(i=(n=o.data).length),t.Append(i),t.Append(","+o.blobFieldPrefix+","+n+";")}return t+","},n.getCellsAttr=function(t){if(n.validateBlobContents(t))return r.StrUtil.tokenize(t.substr(K.blobPrefixLength(t)),",")[3].charAt(0);throw new e.ApplicationException("in static getCellsAttr the blob is in the wrong format")},n.getCellSize=function(t){var i=n.getCellsAttr(t);if(i!==r.StorageAttribute.BLOB&&i!==r.StorageAttribute.BLOB_VECTOR){var o=r.StrUtil.tokenize(t.substr(K.blobPrefixLength(t)),",");return e.NNumber.Parse(o[4])}return 2147483647},n.getVecSize=function(t){if(n.validateBlobContents(t)){var i=K.blobPrefixLength(t),o=r.StrUtil.tokenize(t.substr(i),",");i+=o[0].length+1,i+=o[1].length+1,i+=o[2].length+1,i+=o[3].length+1;var a=o[4];return i+=a.length+1,i+=e.NNumber.Parse(a)+1,o=r.StrUtil.tokenize(t.substr(i),","),e.NNumber.Parse(o[3])}throw new e.ApplicationException("in static getVecSize the blob is in the wrong format")},n.prototype.isUnicode=function(t){var e=K.blobPrefixLength(t);return t.substr(e,n.BLOB_TABLE_STR_LEN)===n.BLOB_TABLE_STR},n}(it);at.VERSION=5,at.EMPTY_BLOB_PREFIX_LEN=7,at.BLOB_TYPE_STRUCT_SIZE=28;var st=function(){function t(t,e,r){this.blobFieldPrefix=null,this.data=null,this.isNull=!1,2===arguments.length&&this.constructor_0(t,e),this.constructor_1(t,e,r)}return t.prototype.constructor_0=function(t,e){this.data=t,this.isNull=e},t.prototype.constructor_1=function(t,e,r){this.data=t,this.isNull=e,this.blobFieldPrefix=r},t}(),_t=function(){function t(t){this.DefaultValue=null,this.NullAllowed=!1,this._nullDefault=!1,this._nullValue=null,this._nullDisplay=null,this._dbModifiable=!0,this._partOfDataview=!0,this._picture=null,this._size=0,this._varName=null,this._contentType=K.CONTENT_TYPE_UNKNOWN,this._vecCellsContentType=K.CONTENT_TYPE_UNKNOWN,this._vecCellsSize=0,this._vecCellsType=r.StorageAttribute.NONE,this._type=r.StorageAttribute.NONE,this.Storage=0,this.VarDisplayName=null,this._id=0,this._spaces=null,this._id=t,this.VarDisplayName=e.NString.Empty}return Object.defineProperty(t.prototype,"DbModifiable",{get:function(){return this._dbModifiable},set:function(t){this._dbModifiable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PartOfDataview",{get:function(){return this._partOfDataview},enumerable:!1,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getType=function(){return this._type},t.getMagicDefaultNullDisplayValue=function(t){var e;switch(t){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BOOLEAN:e="";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:e=""}return e},t.getMagicDefaultValue=function(e){var n=null;switch(e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:n="";break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:n=K.getEmptyBlobPrefix("\0")+";";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.TIME:n="FF00000000000000000000000000000000000000";break;case r.StorageAttribute.DATE:n=t._default_date;break;case r.StorageAttribute.BOOLEAN:n="0"}return n},t.prototype.getDefaultValue=function(){return this._type!==r.StorageAttribute.BLOB_VECTOR?this._nullDefault&&null!==this._nullValue?this._nullValue:null!==this.DefaultValue?this.DefaultValue:this.getMagicDefaultValue():this.getMagicDefaultValue()},t.prototype.getCellDefualtValue=function(){var e;return this._type===r.StorageAttribute.BLOB_VECTOR?this._nullDefault&&null!==this._nullValue?e=this._nullValue:null!==this.DefaultValue?e=this.DefaultValue:(e=t.getMagicDefaultValue(this._vecCellsType),this._vecCellsType===r.StorageAttribute.BLOB&&(e=K.setContentType(e,this._vecCellsContentType))):e=this.getDefaultValue(),e},t.prototype.getMagicDefaultValue=function(){var e=t.getMagicDefaultValue(this._type);return this._type===r.StorageAttribute.BLOB?e=K.setContentType(e,this._contentType):this._type===r.StorageAttribute.BLOB_VECTOR&&(e=K.SetVecCellAttr(e,this._vecCellsType),this._vecCellsType===r.StorageAttribute.BLOB&&(e=K.setContentType(e,this._vecCellsContentType))),e},t.prototype.getContentType=function(){return this._contentType},t.prototype.hasNullDisplayValue=function(){return null!==this._nullDisplay},t.prototype.getSize=function(){return this._size},t.prototype.getVecCellsSize=function(){return this._type===r.StorageAttribute.BLOB_VECTOR?this._vecCellsSize:this._size},t.prototype.setLengths=function(t,n){var i=this._size;switch(t){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:n?(i=this._vecCellsSize,this._spaces=new Array(this._vecCellsSize)):this._spaces=new Array(this._size);for(var o=0;o<this._size;o+=1)this._spaces[o]=" ";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:i=2*x.Environment.GetSignificantNumSize();break;case r.StorageAttribute.BOOLEAN:i=n?4:1;break;case r.StorageAttribute.BLOB:i=n?at.BLOB_TYPE_STRUCT_SIZE:e.Int32.MaxValue;break;case r.StorageAttribute.BLOB_VECTOR:i=e.Int32.MaxValue,n?i=at.BLOB_TYPE_STRUCT_SIZE:this.setLengths(this._vecCellsType,!0)}n?this._vecCellsSize=i:this._size=i},t.prototype.getCellsType=function(){return this._type===r.StorageAttribute.BLOB_VECTOR?this._vecCellsType:this._type},t.prototype.getVecCellsContentType=function(){return this._vecCellsContentType},t.prototype.getNullValue=function(){return this._nullValue},t.prototype.isNullDefault=function(){return this._nullDefault},t.prototype.getNullDisplay=function(){var t;switch(this._type){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BOOLEAN:t="";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=null}return t},t.prototype.IsContentUnicode=function(){return this._type!==r.StorageAttribute.BLOB||this._contentType===K.CONTENT_TYPE_UNICODE},t.prototype.GetPicture=function(){return this._picture},t.prototype.setAttribute=function(t,n){var i=!0;switch(t){case r.XMLConstants.MG_ATTR_TYPE:this._type=n.charAt(0);break;case r.XMLConstants.MG_ATTR_SIZE:this._size=r.XmlParser.getInt(n),this._size<=0&&E.WriteExceptionToLog("in Field.initElements(): size must be greater than zero");break;case r.XMLConstants.MG_ATTR_VAR_NAME:this._varName=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_VAR_DISP_NAME:this.VarDisplayName=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_PICTURE:this._picture=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_VEC_CELLS_SIZE:this._vecCellsSize=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_VEC_CELLS_ATTR:this._vecCellsType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_VEC_CELLS_CONTENT:this._vecCellsContentType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_NULLVALUE:this._type===r.StorageAttribute.NUMERIC||this._type===r.StorageAttribute.DATE||this._type===r.StorageAttribute.TIME?x.Environment.GetDebugLevel()>1?this._nullValue=r.XmlParser.unescape(n).toString():this._nullValue=r.Base64.decodeToHex(n):this._nullValue=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_NULLDISPLAY:this._nullDisplay=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_NULLDEFAULT:this._nullDefault=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_DB_MODIFIABLE:this.DbModifiable=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_DEFAULTVALUE:this.DefaultValue=n,this._type===r.StorageAttribute.ALPHA||this._type===r.StorageAttribute.UNICODE?(this.DefaultValue=r.XmlParser.unescape(n).toString(),this.DefaultValue=r.StrUtil.padStr(this.DefaultValue,this._size)):this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BOOLEAN?(this._type!==r.StorageAttribute.BLOB_VECTOR||this._vecCellsType!==r.StorageAttribute.NUMERIC&&this._vecCellsType!==r.StorageAttribute.DATE&&this._vecCellsType!==r.StorageAttribute.TIME)&&this._type!==r.StorageAttribute.NUMERIC&&this._type!==r.StorageAttribute.DATE&&this._type!==r.StorageAttribute.TIME||x.Environment.GetDebugLevel()<1&&(this.DefaultValue=r.Base64.decodeToHex(n)):0===this.DefaultValue.length&&this._type!==r.StorageAttribute.BLOB?this.DefaultValue=null:this._type===r.StorageAttribute.BLOB&&(this.DefaultValue=K.createFromString(this.DefaultValue,this._contentType));break;case r.XMLConstants.MG_ATTR_NULLALLOWED:this.NullAllowed=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_BLOB_CONTENT:this._contentType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_PART_OF_DATAVIEW:this._partOfDataview=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_STORAGE:this.Storage=r.XmlParser.getInt(n);break;default:i=!1}return i},t.prototype.fillData=function(t){var e=t.ReadToEndOfCurrentElement();e=e.substr(e.indexOf(r.XMLConstants.MG_TAG_FLDH)+r.XMLConstants.MG_TAG_FLDH.length);var n=r.XmlParser.getTokens(e,r.XMLConstants.XML_ATTR_DELIM);this.initElements(n)},t.prototype.initElements=function(t){for(var e=0;e<t.length;e+=2){var r=t.get_Item(e),n=t.get_Item(e+1);this.setAttribute(r,n)}this.SetAfterParsing()},t.prototype.SetAfterParsing=function(){this.setLengths(this._type,!1),this.NullAllowed&&null===this._nullDisplay&&(this._nullDisplay="")},t.prototype.getVarName=function(){return this._varName||""},t.prototype.getName=function(){return this.getVarName()},t}();_t._default_date=null;var lt=function(t){function r(e){var r=t.call(this,e)||this;return r.ControlToFocus=null,r._controls=null,r._dataview=null,r}return a(r,t),r.prototype.getTask=function(){return this._dataview.getTask()},r.prototype.updateDisplayWithValue=function(t,e){return s(this,void 0,void 0,(function(){var r,n,i,o,a,s,l;return _(this,(function(_){switch(_.label){case 0:if(r=null,n=null,i=W.DEFAULT_VALUE_INT.toString(),null===this._controls)return[3,6];o=null,a=!1,s=this.ControlToFocus,l=0,_.label=1;case 1:return l<this._controls.length?(r=this._controls.get_Item(l)).getForm().inRefreshDisplay()?[3,3]:(r.resetPrevVal(),[4,r.SetAndRefreshDisplayValue(t,e)]):[3,4];case 2:_.sent(),r.isRadio()||(null===n||null!==r.Value&&r.Value!==i&&r===s?n=r:(null===o&&(o=r),null!==r.Value&&r.Value!==i&&(a||(o=r,a=!0),r===s?n=r:null===n&&(n=o)))),_.label=3;case 3:return l+=1,[3,1];case 4:return null===n?[3,6]:(this.ControlToFocus=n,this._controls.length>1?(n.resetPrevVal(),[4,n.SetAndRefreshDisplayValue(t,e)]):[3,6]);case 5:_.sent(),_.label=6;case 6:return[2]}}))}))},r.prototype.SetControl=function(t){null===this._controls&&(this._controls=new e.List),this._controls.Contains(t)||(this._controls.push(t),1===this._controls.length&&(this.ControlToFocus=t))},r.prototype.RemoveControl=function(t){this._controls.Remove(t)},r.prototype.GetRadioCtrls=function(){var t=new e.List;if(null!==this._controls)for(var r=0;r<this._controls.length;r+=1){var n=this._controls[r];n.isRadio()&&t.push(n)}return t},r.prototype.toString=function(){return e.NString.Format("(Field {0}-{1}) in task {2}",this._id,this._varName,this.getTask())},r}(_t),ut=function(){function t(t,e,r,n){this.CtlIndex=0,this.ProgramIsn=0,this.TaskIsn=0,this.IsProgram=!1,4===arguments.length?this.constructor_0(t,e,r,n):this.constructor_1()}return t.prototype.constructor_0=function(t,e,r,n){this.CtlIndex=t,this.ProgramIsn=e,this.IsProgram=n,this.TaskIsn=n?0:r},t.prototype.constructor_1=function(){},t.prototype.IsMainProgram=function(){return this.IsProgram&&1===this.ProgramIsn},t.prototype.Equals=function(e){return null!==e&&e instanceof t&&this.GetHashCode()===e.GetHashCode()},t.prototype.GetHashCode=function(){var t=this.HashCodeString();return e.NString.GetHashCode(t)},t.prototype.HashCodeString=function(){return this.CtlIndex+"."+this.IsProgram+"."+this.ProgramIsn+"."+this.TaskIsn},t.prototype.toString=function(){return e.NString.Format("{{Task ID: {0} ctl {1}/prg {2}{3} (hash: {4})}}",[this.IsProgram?"Program":"Task",this.CtlIndex,this.ProgramIsn,this.IsProgram?"":e.NString.Format(" Task {0}",this.TaskIsn),this.HashCodeString()])},t}(),ct=function(){function t(t){this._newTaskDefinitionIdHandler=null,this._newTaskDefinitionIdHandler=t}return t.prototype.parse=function(t){try{null!==t&&r.JSON_Utils.JSONFromXML(t,this.ParseJSON.bind(this))}catch(t){E.WriteExceptionToLog(t)}},t.prototype.ParseJSON=function(t,e){if(null!=t)throw t;var i=0,o=!1,a=0,s=0,_=e.taskDefinitionId.$;n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_CTL_IDX])||(i=+_[r.XMLConstants.MG_ATTR_CTL_IDX]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_PROGRAM_ISN])||(a=+_[r.XMLConstants.MG_ATTR_PROGRAM_ISN]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_TASK_ISN])||(s=+_[r.XMLConstants.MG_ATTR_TASK_ISN]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_ISPRG])||(o="1"===_[r.XMLConstants.MG_ATTR_ISPRG]);var l=new ut(i,a,s,o);this._newTaskDefinitionIdHandler(l)},t}(),Pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(k),ht=function(){function n(){}return n.getNumericMgValue=function(t,e){var n=new z("3",r.StorageAttribute.NUMERIC,t.getCompIdx());return $.Instance.disp2mg(e,"",n,t.getCompIdx(),K.CONTENT_TYPE_UNKNOWN)},n.getDefaultValueForTask=function(e,r){var n=null;switch(r.value=!0,e){case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_PRELOAD_VIEW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:n="1";break;case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:n="0";break;default:r.value=!1}return n},n.getDefaultValue=function(i,o,a){var s=null,_=null;if(o===W.PARENT_TYPE_TASK){var l=new e.RefParam(!1);if(s=this.getDefaultValueForTask(i,l),l.value)return s}switch(i){case t.PropInterface.PROP_TYPE_COLOR:s=this.getNumericMgValue(a,"1"),o===W.PARENT_TYPE_CONTROL&&(_=a).Type===r.MgControlType.CTRL_TYPE_BUTTON&&_.IsImageButton()&&(s=this.getNumericMgValue(a,"0"));break;case t.PropInterface.PROP_TYPE_BORDER:if(s="0",o===W.PARENT_TYPE_CONTROL)switch((_=a).Type){case r.MgControlType.CTRL_TYPE_SUBFORM:s="0";break;case r.MgControlType.CTRL_TYPE_TEXT:case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_BROWSER:s="1"}break;case t.PropInterface.PROP_TYPE_MAXBOX:case t.PropInterface.PROP_TYPE_MINBOX:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_MULTILINE:case t.PropInterface.PROP_TYPE_PASSWORD:case t.PropInterface.PROP_TYPE_HEBREW:case t.PropInterface.PROP_TYPE_MULTILINE_VERTICAL_SCROLL:case t.PropInterface.PROP_TYPE_MULTILINE_ALLOW_CR:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_SHOW_FULL_ROW:case t.PropInterface.PROP_TYPE_TRACK_SELECTION:case t.PropInterface.PROP_TYPE_COLUMN_DIVIDER:case t.PropInterface.PROP_TYPE_LINE_DIVIDER:case t.PropInterface.PROP_TYPE_THREE_STATES:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_ROW_PLACEMENT:case t.PropInterface.PROP_TYPE_SHOW_IN_WINDOW_MENU:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_SORT_COLUMN:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_FILL_WIDTH:case t.PropInterface.PROP_TYPE_MULTI_COLUMN_DISPLAY:s="0";break;case t.PropInterface.PROP_TYPE_SYSTEM_MENU:case t.PropInterface.PROP_TYPE_TITLE_BAR:case t.PropInterface.PROP_TYPE_ENABLED:case t.PropInterface.PROP_TYPE_VISIBLE:case t.PropInterface.PROP_TYPE_TAB_IN:case t.PropInterface.PROP_TYPE_MODIFIABLE:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_DISPLAY_MENU:case t.PropInterface.PROP_TYPE_DISPLAY_TOOLBAR:case t.PropInterface.PROP_TYPE_SHOW_BUTTONS:case t.PropInterface.PROP_TYPE_LINES_AT_ROOT:case t.PropInterface.PROP_TYPE_SCROLL_BAR:case t.PropInterface.PROP_TYPE_SHOW_LINES:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_RIGHT_BORDER:case t.PropInterface.PROP_TYPE_TOP_BORDER:case t.PropInterface.PROP_TYPE_TOP_BORDER_MARGIN:case t.PropInterface.PROP_TYPE_SHOW_ELLIPISIS:s="1";break;case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_PROMPT:case t.PropInterface.PROP_TYPE_DISPLAY_LIST:case t.PropInterface.PROP_TYPE_DATA:case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:case t.PropInterface.PROP_TYPE_LABEL:case t.PropInterface.PROP_TYPE_PLACEMENT:case t.PropInterface.PROP_TYPE_PULLDOWN_MENU:case t.PropInterface.PROP_TYPE_CONTEXT_MENU:case t.PropInterface.PROP_TYPE_NODE_ID:case t.PropInterface.PROP_TYPE_NODE_PARENTID:case t.PropInterface.PROP_TYPE_SELECT_PROGRAM:case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:case t.PropInterface.PROP_TYPE_EXPANDED_IMAGEIDX:case t.PropInterface.PROP_TYPE_COLLAPSED_IMAGEIDX:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:case t.PropInterface.PROP_TYPE_FORM_NAME:case t.PropInterface.PROP_TYPE_COLUMN_TITLE:case t.PropInterface.PROP_TYPE_HEIGHT:case t.PropInterface.PROP_TYPE_WIDTH:case t.PropInterface.PROP_TYPE_ROW_HIGHLIGHT_COLOR:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:break;case t.PropInterface.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL:case t.PropInterface.PROP_TYPE_BORDER_STYLE:s=this.getNumericMgValue(a,"2");break;case t.PropInterface.PROP_TYPE_WINDOW_TYPE:s=this.getNumericMgValue(a,"6");break;case t.PropInterface.PROP_TYPE_ROW_HIGHLIGHT_STYLE:s=this.getNumericMgValue(a,"4");break;case t.PropInterface.PROP_TYPE_GRADIENT_STYLE:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_STARTUP_MODE:case t.PropInterface.PROP_TYPE_CHOICE_COLUMNS:case t.PropInterface.PROP_TYPE_HORIZONTAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_FONT:case t.PropInterface.PROP_TYPE_WALLPAPER_STYLE:case t.PropInterface.PROP_TYPE_CHECKBOX_MAIN_STYLE:case t.PropInterface.PROP_TYPE_TAB_CONTROL_SIDE:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_UOM:case t.PropInterface.PROP_TYPE_BOTTOM_POSITION_INTERVAL:s=this.getNumericMgValue(a,"1");break;case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:s=r.TransMode.Physical;break;case t.PropInterface.PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX:case t.PropInterface.PROP_TYPE_PARKED_IMAGEIDX:case t.PropInterface.PROP_TYPE_MINIMUM_HEIGHT:case t.PropInterface.PROP_TYPE_TOP:case t.PropInterface.PROP_TYPE_LEFT:case t.PropInterface.PROP_TYPE_TITLE_HEIGHT:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_VISIBLE_LINES:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_TRANSLATOR:case t.PropInterface.PROP_TYPE_HOR_FAC:case t.PropInterface.PROP_TYPE_VER_FAC:case t.PropInterface.PROP_TYPE_FOCUS_COLOR:s=this.getNumericMgValue(a,"0");break;case t.PropInterface.PROP_TYPE_STYLE_3D:if(o===W.PARENT_TYPE_CONTROL)switch((_=a).Type){case r.MgControlType.CTRL_TYPE_COMBO:s=this.getNumericMgValue(a,"2");break;case r.MgControlType.CTRL_TYPE_RADIO:case r.MgControlType.CTRL_TYPE_CHECKBOX:s=this.getNumericMgValue(a,"3")}break;case t.PropInterface.PROP_TYPE_DEFAULT_BUTTON:case t.PropInterface.PROP_TYPE_IMAGE_LIST_INDEXES:case t.PropInterface.PROP_TYPE_WALLPAPER:case t.PropInterface.PROP_TYPE_TEXT:case t.PropInterface.PROP_TYPE_TOOLTIP:case t.PropInterface.PROP_TYPE_FORMAT:s=e.NString.Empty;break;case t.PropInterface.PROP_TYPE_IMAGE_STYLE:s=this.getNumericMgValue(a,"2");break;case t.PropInterface.PROP_TYPE_SELECTION_MODE:s=this.getNumericMgValue(a,String(r.ListboxSelectionMode.Single));break;case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:s=this.getNumericMgValue(a,"0");break;default:e.Debug.Assert(!1,"Undefined default value",e.NString.Format("No default value was defined for property {0} ({1}).",n.GetPropertyName(i),i))}return s},n.GetPropertyName=function(t){return"{Field ID "+t+"}"},n}(),Tt=function(){},Et=function(){function t(t,e){this._valid=t,this._errorMessage=e}return t.prototype.isValid=function(){return this._valid},t.prototype.getErrMessage=function(){return this._errorMessage},t}(),pt=function(){function n(t,n,i,o){this._id=e.Int32.MinValue,this._dataType=r.StorageAttribute.NONE,this._val=null,this._pic=null,this._expId=0,this._parentObj=null,this._parentType=null,this._prevValues=null,this._orgValue=null,this._taskDefinitionId=null,this.StudioValue=null,this._expAlreadyComputedOnce=!1,this.customProperties=new Map,this.customPropertiesValues=new Map,this.customValidatorProperties=new Map,this.customValidatorValues=new Map,0===arguments.length?this.constructor_0():3===arguments.length?this.constructor_1(t,n,i):this.constructor_2(t,n,i,o)}return Object.defineProperty(n.prototype,"TaskDefinitionId",{get:function(){return this._taskDefinitionId},enumerable:!1,configurable:!0}),n.prototype.constructor_0=function(){this._prevValues=new e.List},n.prototype.constructor_1=function(t,e,r){this.constructor_0(),this.setId(t),this._parentObj=e,this._parentType=r,this.setDataType()},n.prototype.constructor_2=function(t,e,r,n){this.constructor_1(t,e,r),this.setValue(n),this.setOrgValue()},n.prototype.setId=function(t){this._id=t},n.prototype.fillData=function(t,n,i){var o=i.getXMLdata().indexOf(">",i.getCurrIndex());if(null===this._parentObj&&null!==t&&(this._parentObj=t,this._parentType=n),-1!==o&&o<i.getXMLdata().length){var a=i.getXMLsubstring(o);i.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_PROP)+r.XMLConstants.MG_TAG_PROP.length);var s=r.XmlParser.getTokens(i.getXMLsubstring(o),r.XMLConstants.XML_ATTR_DELIM);E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("In Prop.FillData(): {0}",s.toString())),this.initElements(s),i.setCurrIndex(o+r.XMLConstants.TAG_CLOSE.length),this.InitInnerObjects(i),this._parentType===W.PARENT_TYPE_CONTROL?this.setControlAttributes():this._parentType===W.PARENT_TYPE_FORM&&this._prevValues.SetSize(1)}else E.WriteExceptionToLog("In Property.FillData(): Out of string bounds")},n.prototype.InitInnerObjects=function(t){if(t.getNextTag()===r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY){var e=t.ReadToEndOfCurrentElement();this.InitTaskDefinitionId(e);var n=t.getXMLdata().indexOf(r.XMLConstants.MG_TAG_PROP+r.XMLConstants.TAG_CLOSE,t.getCurrIndex());t.setCurrIndex(n+(r.XMLConstants.MG_TAG_PROP+r.XMLConstants.TAG_CLOSE).length)}},n.prototype.initElements=function(n){for(var i=0;i<n.length;i+=2){var o=n.get_Item(i),a=n.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:this.setId(r.XmlParser.getInt(a)),this.setDataType();break;case r.XMLConstants.MG_ATTR_STUDIO_VALUE:this.StudioValue=r.XmlParser.unescape(a);break;case r.XMLConstants.MG_ATTR_VALUE:this._id===t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES&&this.InitCustomProperties(r.XmlParser.unescape(a)),this._id===t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS?this.InitCustomValidationProperties(r.XmlParser.unescape(a)):(this._val=r.XmlParser.unescape(a),this._orgValue=this._val);break;case r.XMLConstants.MG_ATTR_EXP:this._expId=r.XmlParser.getInt(a),this._expId>0&&this._id===t.PropInterface.PROP_TYPE_TOOLTIP&&this.setDataType();break;case r.XMLConstants.MG_ATTR_NAME:break;case r.XMLConstants.MG_ATTR_CTL_IDX:this._taskDefinitionId.CtlIndex=r.XmlParser.getInt(a);break;case r.XMLConstants.MG_ATTR_PROGRAM_ISN:this._taskDefinitionId.ProgramIsn=r.XmlParser.getInt(a);break;default:E.WriteExceptionToLog(e.NString.Format("There is no such tag in Property class. Insert case to Property.initElements for {0}",o))}this.IsComputedOnceOnServer()&&(this._expAlreadyComputedOnce=!0)}},n.prototype.InitCustomProperties=function(t){this.customProperties=new Map(JSON.parse(t)),this._parentObj.IsFirstRefreshOfProps()&&this.SetFirstValueForCustomProperties()},n.prototype.InitCustomValidator=function(t){var e=t.ReadToEndOfCurrentElement();e=e.substr(e.indexOf(r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR)+r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR.length);for(var n,i=r.XmlParser.getTokens(e,r.XMLConstants.XML_ATTR_DELIM),o=new Tt,a=0;a<i.length;a+=2){var s=i.get_Item(a),_=i.get_Item(a+1);switch(s){case r.XMLConstants.MG_ATTR_EXP:o._exp=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_NAME:n=r.XmlParser.unescape(_);break;case r.XMLConstants.MG_ATTR_ERROR_EXP:o._errorMessageExp=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_ERROR:o._errorMessage=r.XmlParser.unescape(_)}}this.customValidatorProperties.set(n,o)},n.prototype.InitCustomValidationProperties=function(t){for(var e=new r.XmlParser(t),n=e.getNextTag();null!=n;){switch(n){case r.XMLConstants.MG_TAG_CUSTOM_VALIDATORS:e.setCurrIndex2EndOfTag(),this.customValidatorProperties=new Map;break;case r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR:this.InitCustomValidator(e);break;default:e.setCurrIndex2EndOfTag()}n=e.getNextTag()}this._parentObj.IsFirstRefreshOfProps()&&this.SetFirstValueForCustomValidationProperties()},n.prototype.SetFirstValueForCustomValidationProperties=function(){var t,e;try{for(var r=l(this.customValidatorProperties.keys()),n=r.next();!n.done;n=r.next()){var i=n.value;this.customValidatorProperties.get(i);this.customValidatorValues.set(i,new Et(!0,""))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this._val=this.GetArrayValuesForCustomValidationProperties(),this._orgValue=this._val},n.prototype.GetArrayValuesForCustomValidationProperties=function(){var t=Array.from(this.customValidatorValues.values());return JSON.stringify(t)},n.prototype.GetArrayValuesForCustomProperties=function(){var t=Array.from(this.customPropertiesValues.values());return JSON.stringify(t)},n.prototype.SetFirstValueForCustomProperties=function(){var t,e;try{for(var r=l(this.customProperties.keys()),n=r.next();!n.done;n=r.next()){var i=n.value;this.customPropertiesValues.set(i,"")}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this._val=this.GetArrayValuesForCustomProperties(),this._orgValue=this._val},n.prototype.ResetComputedOnceFlag=function(){this._expAlreadyComputedOnce=!1},n.prototype.InitTaskDefinitionId=function(t){new ct(this.SetTaskDefinitionId).parse(t)},n.prototype.SetTaskDefinitionId=function(t){this._taskDefinitionId=t},n.prototype.setDataType=function(){var i=this._parentObj.getCompIdx();if(this._pic=null,this._id!==e.Int32.MinValue)switch(this._id){case t.PropInterface.PROP_TYPE_TITLE_BAR:case t.PropInterface.PROP_TYPE_DISPLAY_MENU:case t.PropInterface.PROP_TYPE_BORDER:case t.PropInterface.PROP_TYPE_HEBREW:case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_SYSTEM_MENU:case t.PropInterface.PROP_TYPE_END_CONDITION:case t.PropInterface.PROP_TYPE_SELECTION:case t.PropInterface.PROP_TYPE_ALLOW_MODIFY:case t.PropInterface.PROP_TYPE_ALLOW_CREATE:case t.PropInterface.PROP_TYPE_ALLOW_DELETE:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_CONFIRM_UPDATE:case t.PropInterface.PROP_TYPE_FORCE_SUFFIX:case t.PropInterface.PROP_TYPE_FORCE_DELETE:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_MODIFIABLE:case t.PropInterface.PROP_TYPE_VISIBLE:case t.PropInterface.PROP_TYPE_ENABLED:case t.PropInterface.PROP_TYPE_CONFIRM_CANCEL:case t.PropInterface.PROP_TYPE_REPEATABLE:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_PASSWORD:case t.PropInterface.PROP_TYPE_MULTILINE:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_PRELOAD_VIEW:case t.PropInterface.PROP_TYPE_MULTILINE_VERTICAL_SCROLL:case t.PropInterface.PROP_TYPE_MULTILINE_ALLOW_CR:case t.PropInterface.PROP_TYPE_ALLOW_COL_RESIZE:case t.PropInterface.PROP_TYPE_ALLOW_REORDER:case t.PropInterface.PROP_TYPE_SHOW_LINES:case t.PropInterface.PROP_TYPE_SORT_COLUMN:case t.PropInterface.PROP_TYPE_COL_ALLOW_FILTERING:case t.PropInterface.PROP_TYPE_DISPLAY_STATUS_BAR:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_SHOW_FULL_ROW:case t.PropInterface.PROP_TYPE_TRACK_SELECTION:case t.PropInterface.PROP_TYPE_SHOW_BUTTONS:case t.PropInterface.PROP_TYPE_LINES_AT_ROOT:case t.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW:case t.PropInterface.PROP_TYPE_SCROLL_BAR:case t.PropInterface.PROP_TYPE_COLUMN_DIVIDER:case t.PropInterface.PROP_TYPE_LINE_DIVIDER:case t.PropInterface.PROP_TYPE_THREE_STATES:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_ALLOW_OPTION:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_FILL_WIDTH:case t.PropInterface.PROP_TYPE_MULTI_COLUMN_DISPLAY:case t.PropInterface.PROP_TYPE_IS_ROUTER_OUTLET:case t.PropInterface.PROP_TYPE_DEFAULT_OUTLET:case t.PropInterface.PROP_TYPE_SERVER_READ_AHEAD:this._dataType=r.StorageAttribute.BOOLEAN;break;case t.PropInterface.PROP_TYPE_DEFAULT_BUTTON:case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:case t.PropInterface.PROP_TYPE_EVAL_END_CONDITION:case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_NAME:case t.PropInterface.PROP_TYPE_TRASACTION_BEGIN:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:case t.PropInterface.PROP_TYPE_WALLPAPER:case t.PropInterface.PROP_TYPE_ATTRIBUTE:case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_SELECT_MODE:case t.PropInterface.PROP_TYPE_TASK_ID:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_PARAMETERS:case t.PropInterface.PROP_TYPE_IMAGE_LIST_INDEXES:case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_REAL_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL_FIELDS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE:case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:this._dataType=r.StorageAttribute.ALPHA;break;case t.PropInterface.PROP_TYPE_COLUMN_TITLE:case t.PropInterface.PROP_TYPE_DISPLAY_LIST:case t.PropInterface.PROP_TYPE_LABEL:case t.PropInterface.PROP_TYPE_FORMAT:case t.PropInterface.PROP_TYPE_RANGE:case t.PropInterface.PROP_TYPE_FORM_NAME:case t.PropInterface.PROP_TYPE_ADDITIONAL_INFORMATION:case t.PropInterface.PROP_TYPE_TEXT:case t.PropInterface.PROP_TYPE_HINT:this._dataType=r.StorageAttribute.UNICODE;break;case t.PropInterface.PROP_TYPE_UOM:case t.PropInterface.PROP_TYPE_HOR_FAC:case t.PropInterface.PROP_TYPE_VER_FAC:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_WALLPAPER_STYLE:case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_PULLDOWN_MENU:case t.PropInterface.PROP_TYPE_WINDOW_TYPE:case t.PropInterface.PROP_TYPE_IMAGE_STYLE:case t.PropInterface.PROP_TYPE_AUTO_FIT:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_EXPAND_WINDOW:case t.PropInterface.PROP_TYPE_VISIBLE_LINES:case t.PropInterface.PROP_TYPE_CHOICE_COLUMNS:case t.PropInterface.PROP_TYPE_STYLE_3D:case t.PropInterface.PROP_TYPE_FONT:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_WIDTH:case t.PropInterface.PROP_TYPE_HEIGHT:case t.PropInterface.PROP_TYPE_TITLE_HEIGHT:case t.PropInterface.PROP_TYPE_COLOR:case t.PropInterface.PROP_TYPE_LEFT:case t.PropInterface.PROP_TYPE_TOP:case t.PropInterface.PROP_TYPE_TOOLTIP:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_LINES_IN_TABLE:case t.PropInterface.PROP_TYPE_SELECTION_ROWS:case t.PropInterface.PROP_TYPE_HORIZONTAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL:case t.PropInterface.PROP_TYPE_ROW_HEIGHT:case t.PropInterface.PROP_TYPE_WINDOW_WIDTH:case t.PropInterface.PROP_TYPE_MAIN_DISPLAY:case t.PropInterface.PROP_TYPE_TRANSLATOR:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_FRAME_TYPE:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_ROW_HIGHLIGHT_STYLE:case t.PropInterface.PROP_TYPE_VERTICAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_STATIC_TYPE:case t.PropInterface.PROP_TYPE_BUTTON_STYLE:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_BOTTOM_POSITION_INTERVAL:case t.PropInterface.PROP_TYPE_SELECTION_MODE:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:case t.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB:case t.PropInterface.PROP_TYPE_BINDING_LEVEL:this._id===t.PropInterface.PROP_TYPE_TOOLTIP&&this._expId>0?this._dataType=r.StorageAttribute.UNICODE:(this._dataType=r.StorageAttribute.NUMERIC,null==n._numericPropertyPic&&(n._numericPropertyPic=new z("N6",r.StorageAttribute.NUMERIC,i)),this._pic=n._numericPropertyPic);break;case t.PropInterface.PROP_TYPE_RETURN_ACTION:this._dataType=r.StorageAttribute.NONE;break;case t.PropInterface.PROP_TYPE_DATA:this._dataType=this._parentObj.DataType;break;case t.PropInterface.PROP_TYPE_POP_UP:case t.PropInterface.PROP_TYPE_ORIENTATION_LOCK:case t.PropInterface.PROP_TYPE_ENTER_ANIMATION:case t.PropInterface.PROP_TYPE_EXIT_ANIMATION:case t.PropInterface.PROP_TYPE_NAVIGATION_DRAWER_MENU:case t.PropInterface.PROP_TYPE_ACTION_BAR_MENU:case t.PropInterface.PROP_TYPE_OPEN_PICKER:case t.PropInterface.PROP_TYPE_OPEN_EDIT_DIALOG:case t.PropInterface.PROP_TYPE_DEFAULT_ALIGNMENT:case t.PropInterface.PROP_TYPE_KEYBOARD_TYPE:case t.PropInterface.PROP_TYPE_KEYBOARD_RETURN_KEY:case t.PropInterface.PROP_TYPE_ALLOW_SUGGESTIONS:case t.PropInterface.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME:case t.PropInterface.PROP_TYPE_SWIPE_REFRESH:break;default:E.WriteExceptionToLog(e.NString.Format("in Property.setDataType() no case for: {0}",this._id))}else E.WriteExceptionToLog(e.NString.Format("To fill dataType member in Property.FillDataType must id!={0}",e.Int32.MinValue))},n.prototype.setControlAttributes=function(){if(null!=this._parentObj&&this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_NAME:e.Name=this._val;break;case t.PropInterface.PROP_TYPE_ATTRIBUTE:e.DataType=this._val[0];break;case t.PropInterface.PROP_TYPE_FORMAT:e.setPicStr(this._val,this._expId);break;case t.PropInterface.PROP_TYPE_RANGE:e.setRange(this._val);break;case t.PropInterface.PROP_TYPE_DATA:this._expId>0?e.setValExp(this._expId):null!=this._val&&e.setField(this._val);break;case t.PropInterface.PROP_TYPE_BUTTON_STYLE:null!=this._val&&(e.ButtonStyle=this.GetComputedValueInteger());break;case t.PropInterface.PROP_TYPE_LAYER:null!=this._val&&(e.Layer=this.GetComputedValueInteger())}}else E.WriteExceptionToLog("in Property.setControlAttributes() there is no parent or the parent is not a control")},n.prototype.getParentObj=function(){return this._parentObj},n.prototype.getParentType=function(){return this._parentType},n.prototype.getID=function(){return this._id},n.prototype.setValue=function(n){var i=this._parentObj.getCompIdx();if(this._id!==t.PropInterface.PROP_TYPE_DATA&&this._id!==t.PropInterface.PROP_TYPE_NODE_ID&&this._id!==t.PropInterface.PROP_TYPE_NODE_PARENTID)switch(this._dataType===r.StorageAttribute.NONE&&this.setDataType(),this._dataType){case r.StorageAttribute.NUMERIC:null==n&&(n="FF00000000000000000000000000000000000000"),this._val=$.Instance.mg2disp(n,"",this._pic,!1,i,!1).trim();break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.UNICODE:this._val=n;break;default:throw new e.ApplicationException("in Property.setValue() illegal data type: "+this._dataType)}},n.prototype.SetValue=function(t){this._val=String(t)},n.prototype.setOrgValue=function(){this._orgValue=this._val},n.prototype.SetStudioValueAsOrgValue=function(){this._orgValue=this.StudioValue},n.prototype.getForm=function(){var t=null;return this._parentType===W.PARENT_TYPE_FORM?t=this._parentObj:this._parentType===W.PARENT_TYPE_CONTROL&&(t=this._parentObj.getForm()),t},n.prototype.GetTaskByParentObject=function(){var t=null;return this._parentType===W.PARENT_TYPE_FORM?t=this._parentObj.getTask():this._parentType===W.PARENT_TYPE_CONTROL?t=this._parentObj.getForm().getTask():this._parentType===W.PARENT_TYPE_TASK&&(t=this._parentObj),t},n.prototype.RefreshDisplay=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.RefreshDisplayWithCurrentLine(t,e.Int32.MinValue)];case 1:return r.sent(),[2]}}))}))},n.prototype.ShouldSkipRefreshControl=function(){var e=!1,r=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_HEBREW:r.isTableControl()&&(e=!0);break;case t.PropInterface.PROP_TYPE_NODE_ID:case t.PropInterface.PROP_TYPE_NODE_PARENTID:case t.PropInterface.PROP_TYPE_DATA:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_SELECT_PROGRAM:case t.PropInterface.PROP_TYPE_SELECT_MODE:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_RETURN_ACTION:case t.PropInterface.PROP_TYPE_ATTRIBUTE:case t.PropInterface.PROP_TYPE_REPEATABLE:case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_AUTO_FIT:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_FRAME_TYPE:case t.PropInterface.PROP_TYPE_RANGE:case t.PropInterface.PROP_TYPE_WINDOW_WIDTH:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARAMETERS:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_REAL_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_ADDITIONAL_INFORMATION:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL_FIELDS:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_SERVER_READ_AHEAD:e=!0;break;case t.PropInterface.PROP_TYPE_BUTTON_STYLE:this._parentObj.isRadio()||(e=!0)}return e},n.prototype.ShouldSkipRefreshForm=function(){e.Debug.Assert(this._parentType===W.PARENT_TYPE_FORM);var r=!1,n=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_WINDOW_TYPE:this._parentObj.IsFirstRefreshOfProps()||(r=!0);break;case t.PropInterface.PROP_TYPE_LINES_IN_TABLE:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:r=!0}if(!r&&n.isSubForm())switch(r=!0,this._id){case t.PropInterface.PROP_TYPE_DEFAULT_BUTTON:case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:r=!1}return r},n.prototype.ShouldSkipRefreshTask=function(){var e=!1;switch(this._id){case t.PropInterface.PROP_TYPE_ALLOW_CREATE:case t.PropInterface.PROP_TYPE_ALLOW_DELETE:case t.PropInterface.PROP_TYPE_ALLOW_MODIFY:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_CONFIRM_CANCEL:case t.PropInterface.PROP_TYPE_CONFIRM_UPDATE:case t.PropInterface.PROP_TYPE_END_CONDITION:case t.PropInterface.PROP_TYPE_EVAL_END_CONDITION:case t.PropInterface.PROP_TYPE_FORCE_SUFFIX:case t.PropInterface.PROP_TYPE_FORCE_DELETE:case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_SELECTION:case t.PropInterface.PROP_TYPE_TRASACTION_BEGIN:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE:e=!0}return e},n.prototype.ShouldSkipRefresh=function(){var e=!1;switch(this._parentType){case W.PARENT_TYPE_CONTROL:e=this.ShouldSkipRefreshControl();break;case W.PARENT_TYPE_FORM:e=this.ShouldSkipRefreshForm();break;case W.PARENT_TYPE_TASK:e=this.ShouldSkipRefreshTask()}switch(this._id){case t.PropInterface.PROP_TYPE_POP_UP:case t.PropInterface.PROP_TYPE_ORIENTATION_LOCK:case t.PropInterface.PROP_TYPE_ENTER_ANIMATION:case t.PropInterface.PROP_TYPE_EXIT_ANIMATION:case t.PropInterface.PROP_TYPE_NAVIGATION_DRAWER_MENU:case t.PropInterface.PROP_TYPE_ACTION_BAR_MENU:case t.PropInterface.PROP_TYPE_OPEN_PICKER:case t.PropInterface.PROP_TYPE_OPEN_EDIT_DIALOG:case t.PropInterface.PROP_TYPE_DEFAULT_ALIGNMENT:case t.PropInterface.PROP_TYPE_KEYBOARD_TYPE:case t.PropInterface.PROP_TYPE_KEYBOARD_RETURN_KEY:case t.PropInterface.PROP_TYPE_ALLOW_SUGGESTIONS:case t.PropInterface.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME:e=!0}return e},n.prototype.RefreshDisplayWithCurrentLine=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.RefreshDisplayWithCurrLineAndCheckSkipRefresh(t,e,!0)];case 1:return r.sent(),[2]}}))}))},n.prototype.SkipWhenNoExpression=function(){var e=!0,r=this._parentObj instanceof Pt?this._parentObj:null;return(null!=r&&r.isButton()&&this._id===t.PropInterface.PROP_TYPE_FORMAT||null!=r&&r.isComboBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isListBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isRadio()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isCheckBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isTabControl()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isImageControl()&&this._id===t.PropInterface.PROP_TYPE_IMAGE_FILENAME||null!=r&&r.IsImageButton()&&this._id===t.PropInterface.PROP_TYPE_IMAGE_FILENAME||null!=r&&r.isColumnControl()&&this._id===t.PropInterface.PROP_TYPE_COLUMN_TITLE||this._id===t.PropInterface.PROP_TYPE_DISPLAY_LIST||this._id===t.PropInterface.PROP_TYPE_TEXT||this._id===t.PropInterface.PROP_TYPE_TOOLTIP||this._id===t.PropInterface.PROP_TYPE_HINT||this._id===t.PropInterface.PROP_TYPE_PASSWORD||this._id===t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES||this._id===t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS||this._id===t.PropInterface.PROP_TYPE_VISIBLE||this._id===t.PropInterface.PROP_TYPE_ENABLED||this._id===t.PropInterface.PROP_TYPE_BINDING_LEVEL)&&(e=!1),e},n.prototype.RefreshDisplayWithCurrLineAndCheckSkipRefresh=function(n,i,o){return s(this,void 0,void 0,(function(){var a,s,l,u;return _(this,(function(_){switch(_.label){case 0:return a=null,s=0,u=!0,null===this._val&&0===this._expId?(E.WriteExceptionToLog("in Property.RefreshDisplay() null value and expression"),[2]):o&&this.ShouldSkipRefresh()||0===this._expId&&this.SkipWhenNoExpression()?[2]:(0===this._prevValues.length&&this.setPrevArraySize(),[4,this.ComputeValue()]);case 1:switch(_.sent(),this._parentType){case W.PARENT_TYPE_CONTROL:if(a=this._parentObj,this._id===t.PropInterface.PROP_TYPE_FORMAT&&this._expId>0&&a.computePIC(this._val),a.IsRepeatable&&!a.getForm().isRefreshRepeatableAllowed())return[2];if(s=i===e.Int32.MinValue?this.getLine():i,l=this._prevValues.get_Item(s),!n&&this._val===l&&this._id!==t.PropInterface.PROP_TYPE_MODIFIABLE&&this._id!==t.PropInterface.PROP_TYPE_VISIBLE&&this._id!==t.PropInterface.PROP_TYPE_ENABLED)return[2];if(a.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._id===t.PropInterface.PROP_TYPE_VISIBLE&&this._val===l)return[2];this._val===l&&(u=!1),this._prevValues.set_Item(s,this._val);break;case W.PARENT_TYPE_FORM:if(l=this._prevValues.get_Item(0),!n&&this._val===l)return[2];this._prevValues.set_Item(0,this._val);break;case W.PARENT_TYPE_TASK:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): task property {0} wasn't handled",this._id)),[2];default:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): parentType unknown, property {0} wasn't handled",this._id)),[2]}switch(this._id){case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:return[3,2];case t.PropInterface.PROP_TYPE_ENABLED:return[3,4];case t.PropInterface.PROP_TYPE_VISIBLE:return[3,5];case t.PropInterface.PROP_TYPE_NAME:return[3,7];case t.PropInterface.PROP_TYPE_FORM_NAME:return[3,8];case t.PropInterface.PROP_TYPE_COLUMN_TITLE:return[3,9];case t.PropInterface.PROP_TYPE_TEXT:return[3,10];case t.PropInterface.PROP_TYPE_HINT:return[3,11];case t.PropInterface.PROP_TYPE_MODIFIABLE:return[3,12];case t.PropInterface.PROP_TYPE_TOOLTIP:return[3,14];case t.PropInterface.PROP_TYPE_DISPLAY_LIST:return[3,15];case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:return[3,17];case t.PropInterface.PROP_TYPE_FORMAT:return[3,19];case t.PropInterface.PROP_TYPE_LABEL:return[3,20];case t.PropInterface.PROP_TYPE_DEFAULT_BUTTON:return[3,22];case t.PropInterface.PROP_TYPE_PASSWORD:return[3,23];case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_TAB_IN:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:return[3,24];case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:return[3,25];case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:return[3,26];case t.PropInterface.PROP_TYPE_BINDING_LEVEL:return[3,27]}return[3,28];case 2:return[4,this.onImageFileName()];case 3:return _.sent(),[3,29];case 4:return this.onEnable(u),[3,29];case 5:return[4,this.onVisible(u)];case 6:return _.sent(),[3,29];case 7:return this.OnControlName(),[3,29];case 8:return this.onFormName(),[3,29];case 9:return this.onText(0),[3,29];case 10:return this.onText(s),[3,29];case 11:return this.onHint(),[3,29];case 12:return[4,this.onModifiable(u)];case 13:return _.sent(),[3,29];case 14:return this.onTooltip(),[3,29];case 15:return[4,this.onDisplayList(s)];case 16:return _.sent(),[3,29];case 17:return[4,this.onVisibleLayerList(s)];case 18:return _.sent(),[3,29];case 19:return this.onFormat(),[3,29];case 20:return[4,this.onLabel(s)];case 21:return _.sent(),[3,29];case 22:return this.onDefaultButton(),[3,29];case 23:return this.onPassword(),[3,29];case 24:return[3,29];case 25:return this.onCustomProperties(),[3,29];case 26:return this.onCustomValidators(),[3,29];case 27:return this.onBindingLevel(),[3,29];case 28:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): Property {0} wasn't handled",this._id)),[3,29];case 29:return[2]}}))}))},n.prototype.ShouldBeComputedOnce=function(){if(this._parentType===W.PARENT_TYPE_TASK)switch(this._id){case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_MAIN_DISPLAY:return!0}else if(this._parentType===W.PARENT_TYPE_CONTROL&&(this._id===t.PropInterface.PROP_TYPE_IS_CACHED||this._id===t.PropInterface.PROP_TYPE_MULTILINE))return!0;return!1},n.prototype.IsComputedOnceOnServer=function(){if(this.ShouldBeComputedOnce()){var t=this.GetTaskByParentObject();if(null!=t)return!t.ShouldEvaluatePropertyLocally(this._id)}return!1},n.prototype.ComputeValue=function(){return s(this,void 0,void 0,(function(){var n,i,o,a,s,l,u,c;return _(this,(function(_){switch(_.label){case 0:return n=null,i=255,o=new e.RefParam(!1),this._id!==t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES?[3,2]:[4,this.computeCustomPropertiesValues()];case 1:_.sent(),n=this.GetArrayValuesForCustomProperties(),this.setValue(n),_.label=2;case 2:return this._id!==t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS?[3,4]:[4,this.computeCustomValidators()];case 3:return _.sent(),n=this.GetArrayValuesForCustomValidationProperties(),this.setValue(n),[3,10];case 4:return this._expId>0?this.ShouldBeComputedOnce()&&this._expAlreadyComputedOnce?[2]:(this._expAlreadyComputedOnce=!0,a=!1,this._parentType===W.PARENT_TYPE_TASK&&(a=!0),this._id!==t.PropInterface.PROP_TYPE_FORMAT?[3,6]:(i=65535,l=(s=r.StrUtil).rtrim,[4,this._parentObj.EvaluateExpression(this._expId,this._dataType,i,!0,r.StorageAttribute.SKIP,a,o)])):[3,10];case 5:return n=l.apply(s,[_.sent()]),[3,9];case 6:return _.trys.push([6,8,,9]),[4,this._parentObj.EvaluateExpression(this._expId,this._dataType,i,!0,r.StorageAttribute.SKIP,a,o)];case 7:return n=_.sent(),[3,9];case 8:return u=_.sent(),c=new e.StringBuilder("Exception: "+u.Message),this._parentObj instanceof Pt&&c.Append(" Control: "+this._parentObj.Name),E.WriteWarningToLog(c.ToString()),[3,9];case 9:o.value?(n=this.updateResult(n),this.setValue(n)):null==this._val&&this._parentType!==W.PARENT_TYPE_CONTROL&&(n=ht.getDefaultValue(this._id,this._parentType,this._parentObj),this.setValue(n)),_.label=10;case 10:return[2]}}))}))},n.prototype.updateResult=function(r){switch(this._id){case t.PropInterface.PROP_TYPE_FORMAT:null==r&&(r=e.NString.Empty);break;case t.PropInterface.PROP_TYPE_TASK_MODE:r=n.updateTaskModeResult(r);break;default:return r}return r},n.updateTaskModeResult=function(t){var r=" ";if(!e.NString.IsNullOrEmpty(t))switch(r=t[0].toUpperCase()){case"Q":r="E";break;case"F":r="O";break;case"O":r="N"}return r},n.prototype.getValue=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.ComputeValue()];case 1:return t.sent(),[2,this._val]}}))}))},n.prototype.getValueInt=function(){return s(this,void 0,void 0,(function(){var t;return _(this,(function(r){switch(r.label){case 0:return t=0,[4,this.ComputeValue()];case 1:return r.sent(),null!==this._val&&(t=e.NNumber.Parse(this._val)),[2,t]}}))}))},n.prototype.GetComputedValueInteger=function(){return e.NNumber.Parse(this._val)},n.prototype.getValueBoolean=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return this._dataType!==r.StorageAttribute.BOOLEAN?[3,2]:[4,this.getValue()];case 1:return t.sent(),[2,$.toBoolean(this._val)];case 2:E.WriteExceptionToLog(e.NString.Format("Property.getValueBoolean() was called for non boolean type property: {0}",this._id)),t.label=3;case 3:return[2]}}))}))},n.prototype.GetComputedValue=function(){return this._val},n.prototype.GetComputedValueBoolean=function(){if(this._dataType===r.StorageAttribute.BOOLEAN)return $.toBoolean(this._val);E.WriteExceptionToLog(e.NString.Format("Property.getValueBoolean() was called for non boolean type property: {0}",this._id))},n.prototype.getPrevValue=function(t){return t<this._prevValues.length?this._prevValues.get_Item(t):null},n.prototype.isExpression=function(){return this._expId>0},n.prototype.GetExpressionId=function(){return this._expId},n.prototype.onImageFileName=function(){return s(this,void 0,void 0,(function(){var t,r,n,i,o;return _(this,(function(a){switch(a.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,6]:(t=this._parentObj).isTabControl()?(n=(r=t).setImageList,[4,this.getValue()]):[3,2];case 1:return n.apply(r,[a.sent()]),[3,5];case 2:return t.isImageControl()||t.isRadio()||t.isCheckBox()||t.IsImageButton()?(o=(i=t).setImageWithFileName,[4,this.getValue()]):[3,5];case 3:return[4,o.apply(i,[a.sent()])];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw new e.ApplicationException("in onImageFileName.onEnable()");case 7:return[2]}}))}))},n.prototype.onEnable=function(t){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onEnable()");var r=this._parentObj,n=r.getForm().getTask().CurrentEditingControl;if(null!==this._val&&"0"===this._val&&t&&null!==n&&(r===n||n.isDescendentOfControl(r)||r===n.getLinkedParent(!1))){var i=r.getForm().getTask().getLastParkedCtrl();null!==i&&i.InControl&&(r===i||i.isDescendentOfControl(r))&&(E.OnNonParkableLastParkedCtrl(r),r.getForm().getTask().CurrentEditingControl=null)}r.SetEnabled(this.GetComputedValueBoolean())},n.prototype.onVisible=function(e){return s(this,void 0,void 0,(function(){var r,n,i;return _(this,(function(o){switch(o.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,2]:(r=this._parentObj,n=r.getForm().getTask().CurrentEditingControl,null!==this._val&&"0"===this._val&&e&&null!==n&&(r===n||n.isDescendentOfControl(r)||r===n.getLinkedParent(!1))&&null!==(i=r.getForm().getTask().getLastParkedCtrl())&&i.InControl&&(r===i||i.isDescendentOfControl(r))&&(E.OnNonParkableLastParkedCtrl(r),r.getForm().getTask().CurrentEditingControl=null),[4,r.updatePropertyLogicNesting(t.PropInterface.PROP_TYPE_VISIBLE,t.CommandType.PROP_SET_VISIBLE,this.GetComputedValueBoolean(),!0)]);case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.OnControlName=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.OnControlName()")},n.prototype.onHint=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("inProperty.onHint()");var r=this.getObjectByParentObj(),n=E.Translate(this.GetComputedValue());r.IsDateTimePicture()||r.IsTableChild&&!r.IsTableHeaderChild||F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.PlaceHolder,n)},n.prototype.onFormName=function(){if(this._parentType!==W.PARENT_TYPE_FORM)throw new e.ApplicationException("in Property.onFormName()");this.addCommandTypeText(0)},n.prototype.addCommandTypeText=function(n){var i=E.Translate(this.GetComputedValue());(this._parentType===W.PARENT_TYPE_FORM||this._parentType===W.PARENT_TYPE_CONTROL&&this._parentObj.isColumnControl())&&(i=r.StrUtil.rtrim(i),this._parentType===W.PARENT_TYPE_FORM&&i===e.NString.Empty&&(i=" ")),this._parentType===W.PARENT_TYPE_CONTROL&&(this._parentObj.isTextControl()||this._parentObj.isButton())?F.addValueWithLine(t.CommandType.SET_VALUE,this._parentObj,n,i):F.addOperationWithLine(t.CommandType.SET_PROPERTY,this._parentObj,n,t.HtmlProperties.Text,i)},n.prototype.onText=function(t){this.addCommandTypeText(t)},n.prototype.onModifiable=function(n){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,4]:(n=this._parentObj).isTextControl()?(i=this.GetTaskByParentObject(),!(o=!this.GetComputedValueBoolean())&&i.getMode()===r.Constants.TASK_MODE_QUERY||n.GetCurrReadOnly()===o?[3,3]:(n.SetCurrReadOnly(o),r.UtilStrByteMode.isLocaleDefLangDBCS()?[4,n.getForm().getTask().checkProp(t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY,!1)]:[3,2])):[3,3];case 1:if(a.sent())return[2];a.label=2;case 2:F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.ReadOnly,o),a.label=3;case 3:return[3,5];case 4:throw new e.ApplicationException("in Property.onModifiable()");case 5:return[2]}}))}))},n.prototype.onTooltip=function(){var n;if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onTooltip()");var i=this._parentObj;n=0===this._expId?i.getForm().getTask().getHelpItem(e.NNumber.Parse(this._val)).tooltipHelpText:this._val,n=r.StrUtil.rtrim(n),F.addOperationWithLine(t.CommandType.SET_PROPERTY,i,this.getLine(),t.HtmlProperties.Tooltip,n)},n.prototype.onDisplayList=function(t){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,3]:(r=this._parentObj).isSelectionCtrl()||r.isTabControl()||r.isRadio()?(n=t===e.Int32.MinValue?r.getDisplayLine(!1):t,[4,r.refreshAndSetItemsList(n,!0)]):[3,2];case 1:i.sent(),i.label=2;case 2:return[3,4];case 3:throw new e.ApplicationException("in Property.onDisplayList()");case 4:return[2]}}))}))},n.prototype.onVisibleLayerList=function(t){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,2]:(r=this._parentObj,n=0,n=t===e.Int32.MinValue?r.getDisplayLine(!1):t,[4,r.refreshTabForLayerList(n)]);case 1:return i.sent(),[3,3];case 2:throw new e.ApplicationException("in Property.onVisibleLayerList()");case 3:return[2]}}))}))},n.prototype.onFormat=function(){var t,n=null;if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onFormat()");switch(t=(n=this._parentObj).getPIC(),n.resetPrevVal(),n.Type){case r.MgControlType.CTRL_TYPE_BUTTON:(null==n.getField()&&!n.expressionSetAsData()||n.IsImageButton()||this._parentObj.IsFirstRefreshOfProps()&&!x.Environment.GetSpecialIgnoreButtonFormat())&&this.addCommandTypeText(this.getLine());break;case r.MgControlType.CTRL_TYPE_TEXT:n.Type===r.MgControlType.CTRL_TYPE_TEXT&&(t.getAttr(),r.StorageAttribute.NUMERIC)}},n.prototype.onLabel=function(t){return s(this,void 0,void 0,(function(){var n,i,o,a;return _(this,(function(s){switch(s.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,8]:(n=this._parentObj,i=void 0,i=t===e.Int32.MinValue?n.getDisplayLine(!1):t,n.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX?[3,1]:(this.addCommandTypeText(i),[3,7]));case 1:return n.isSelectionCtrl()||n.isTabControl()||n.isRadio()?(a=(o=n).setRange,[4,this.getValue()]):[3,6];case 2:return a.apply(o,[s.sent()]),n.clearRange(i),[4,n.refreshAndSetItemsList(i,!0)];case 3:return s.sent(),this._expId>0?[4,n.ComputeAndRefreshDisplayValue(!1)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:throw new e.ApplicationException("Property.onLabel(), not support control");case 7:return[3,9];case 8:throw new e.ApplicationException("in Property.onLabel()");case 9:return[2]}}))}))},n.prototype.onDefaultButton=function(){if(this._parentType!==W.PARENT_TYPE_FORM&&this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onDefaultButton()");var t=this._parentObj.getForm().getCtrlByName(this.GetComputedValue(),r.MgControlType.CTRL_TYPE_BUTTON);null===t||t.getDisplayLine(!1)},n.prototype.getObjectByParentObj=function(){var t=this._parentObj;if(this._parentType===W.PARENT_TYPE_FORM){var e=this._parentObj;e.isSubForm()&&(t=e.getSubFormCtrl())}return t},n.isRepeatableInTable=function(t){return!1},n.prototype.getLine=function(){var t=0;if(this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj,r=e.isPropertyRepeatable(this._id);t=e.getDisplayLine(r)}return t},n.prototype.getOrgValue=function(){return this._orgValue},n.prototype.updatePrevValueArray=function(t){this.ShouldSkipRefresh()||this._prevValues.SetSize(t)},n.prototype.clearPrevValueArray=function(){this._prevValues.Clear()},n.prototype.ResetPrevValueArray=function(){var t=this._prevValues.length;this._prevValues.Clear(),this._prevValues.SetSize(t)},n.prototype.setPrevArraySize=function(){if(this._parentType===W.PARENT_TYPE_FORM||this._parentType===W.PARENT_TYPE_CONTROL){var t=1;if(this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj;(e.IsRepeatable||e.isTableControl()&&n.isRepeatableInTable(this._id))&&(t=e.getForm().getTableItemsCount())}this._prevValues.SetSize(t)}},n.prototype.onPassword=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onPassword()");F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.Password,this.GetComputedValueBoolean())},n.prototype.computeCustomPropertiesValues=function(){return s(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,c,P,h;return _(this,(function(_){switch(_.label){case 0:_.trys.push([0,5,6,7]),t=l(this.customProperties),r=t.next(),_.label=1;case 1:return r.done?[3,4]:(n=u(r.value,2),i=n[0],o=n[1],255,new e.RefParam(!1),a=o,[4,this.GetRetrunValueForCustomPropertyExpression(a)]);case 2:s=_.sent(),this.customPropertiesValues.set(i,s),_.label=3;case 3:return r=t.next(),[3,1];case 4:return[3,7];case 5:return c=_.sent(),P={error:c},[3,7];case 6:try{r&&!r.done&&(h=t.return)&&h.call(t)}finally{if(P)throw P.error}return[7];case 7:return[2]}}))}))},n.prototype.computeCustomValidators=function(){return s(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,c,P,h,T,E;return _(this,(function(_){switch(_.label){case 0:if(!this._parentObj.ModifiedByUser&&!this.GetTaskByParentObject().IsInRecompute())return[3,11];_.label=1;case 1:_.trys.push([1,9,10,11]),t=l(this.customValidatorProperties),r=t.next(),_.label=2;case 2:return r.done?[3,8]:(n=u(r.value,2),i=n[0],o=n[1],255,new e.RefParam(!1),a=o._exp,[4,this.GetRetrunValueForCustomPropertyExpression(a)]);case 3:return s=_.sent(),c="",(P="1"===s)?(a=o._errorMessageExp)>0?[4,this.GetRetrunValueForCustomPropertyExpression(a)]:[3,5]:[3,6];case 4:return c=_.sent(),[3,6];case 5:c=o._errorMessage,_.label=6;case 6:this.customValidatorValues.set(i,new Et(!P,c)),_.label=7;case 7:return r=t.next(),[3,2];case 8:return[3,11];case 9:return h=_.sent(),T={error:h},[3,11];case 10:try{r&&!r.done&&(E=t.return)&&E.call(t)}finally{if(T)throw T.error}return[7];case 11:return[2]}}))}))},n.prototype.onCustomProperties=function(){var e,r;try{for(var n=l(this.customPropertiesValues),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),a=o[0],s=o[1];F.addOperationWithLine(t.CommandType.PROP_SET_USER_PROPERTY,this._parentObj,this.getLine(),a,s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},n.prototype.onCustomValidators=function(){var e,r;try{for(var n=l(this.customValidatorValues),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),a=o[0],s=o[1];F.addOperationWithLine(t.CommandType.PROP_SET_CUSTOM_VALIDATOR,this._parentObj,this.getLine(),a,s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},n.prototype.onBindingLevel=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.BindingLevel()");F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.BindingLevel,this.GetComputedValueInteger())},n.prototype.GetRetrunValueForCustomPropertyExpression=function(t){return s(this,void 0,void 0,(function(){var n,i,o,a,s;return _(this,(function(_){switch(_.label){case 0:return 255,n=this._parentObj.GetExpressionStorage(t),i=new e.RefParam(!1),[4,this._parentObj.EvaluateExpression(t,n,255,!0,r.StorageAttribute.SKIP,!1,i)];case 1:switch(o=_.sent(),n=this._parentObj.GetExpressionStorage(t),a=this._parentObj.getCompIdx(),n){case r.StorageAttribute.NUMERIC:s=new z("N6.2",r.StorageAttribute.NUMERIC,this._parentObj.getCompIdx()),null==o&&(o="FF00000000000000000000000000000000000000"),o=$.Instance.mg2disp(o,"",s,!1,a,!1).trim();break;case r.StorageAttribute.DATE:s=new z("##/##/####",n,a),o=$.Instance.mg2disp(o,"",s,!0,!1,a,!0);break;case r.StorageAttribute.TIME:s=new z("##:##/####",n,a),o=$.Instance.mg2disp(o,"",s,!0,!1,a,!0);break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:case r.StorageAttribute.NONE:break;default:throw new e.ApplicationException("in Property.GetRetrunValueForCustomPropertyExpression() illegal data type: "+n)}return[2,o]}}))}))},n.prototype.RemovePrevValIndexAt=function(t){this._prevValues.length>t&&this._prevValues.RemoveAt(t)},n.prototype.InsertPrevValAt=function(t){this._prevValues.Insert(t,null)},n.prototype.resetPrevValAt=function(t){t>=0&&t<this._prevValues.length&&this._prevValues.set_Item(t,null)},n.prototype.toString=function(){return e.NString.Format("{0} = {1} (exp={2}, studio value={3})",[ht.GetPropertyName(this._id),null===this._val?"is null":this._val,this._expId,this.StudioValue])},n.getDefaultProp=function(t,e,r){var i=null,o=ht.getDefaultValue(t,e,r);return null!==o&&(i=new n(t,r,e,o)),i},n.prototype.InsertPrevValueArray=function(t,e){this.ShouldSkipRefresh()||this._prevValues.InsertRange(t,new Array(e))},n}();pt._numericPropertyPic=null,pt.UtilImeJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new r.UtilImeJpn:null;var It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.IsFormTag=function(t){return t===r.XMLConstants.MG_TAG_FORM||t===r.XMLConstants.MG_TAG_FORM_PROPERTIES},e.IsEndFormTag=function(t){return t==="/"+r.XMLConstants.MG_TAG_FORM||t==="/"+r.XMLConstants.MG_TAG_FORM_PROPERTIES},e}(T),ft=function(){function n(t){this._hashTab=null,this._props=null,this._parent=null,0!==arguments.length?this.constructor_1(t):this.constructor_0()}return n.prototype.constructor_0=function(){this._props=new e.List,this._hashTab=new e.Hashtable(20)},n.prototype.constructor_1=function(t){this.constructor_0(),this._parent=t},n.prototype.fillData=function(t,e,r){return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,this.initInnerObjects(r.getNextTag(),t,e,r)];case 1:return n.sent()?[3,0]:[3,2];case 2:return[2]}}))}))},n.prototype.fillDataByExists=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.fillExistInnerObjects(e.getNextTag(),t,e)];case 1:return r.sent()?[3,0]:[3,2];case 2:return[2]}}))}))},n.prototype.initInnerObjects=function(t,e,n,i){return s(this,void 0,void 0,(function(){var o;return _(this,(function(a){switch(a.label){case 0:return null===t||t!==r.XMLConstants.MG_TAG_PROP?[3,2]:((o=new pt).fillData(e,n,i),[4,this.addPropWithCheckExistence(o,!0)]);case 1:return a.sent(),[3,3];case 2:return[2,!1];case 3:return[2,!0]}}))}))},n.prototype.addPropWithCheckExistence=function(t,e){return s(this,void 0,void 0,(function(){var r,n,i;return _(this,(function(o){switch(o.label){case 0:return e?null!==(r=this._hashTab.get_Item(t.getID()))?[3,1]:(this.addPropWithKey(t,t.getID()),[3,4]):[3,5];case 1:return i=(n=r).setValue,[4,t.getValue()];case 2:return[4,i.apply(n,[o.sent()])];case 3:o.sent(),o.label=4;case 4:return[3,6];case 5:this.addPropWithKey(t,t.getID()),o.label=6;case 6:return[2]}}))}))},n.prototype.addPropWithKey=function(t,e){this._hashTab.set_Item(e,t),this._props.push(t)},n.prototype.delPropById=function(t){if(null!==this._props){var e=this._hashTab.get_Item(t);null!==e&&(this._props.Remove(e),this._hashTab.Remove(t))}},n.prototype.fillExistInnerObjects=function(t,n,i){return s(this,void 0,void 0,(function(){var o,a,s,l,u,c;return _(this,(function(_){switch(_.label){case 0:if(o=new e.List,a=-1,null==t)return[2,!1];if(t===r.XMLConstants.MG_TAG_CONTROL)a=i.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,i.getCurrIndex());else if(t===r.XMLConstants.MG_TAG_PROP)a=i.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,i.getCurrIndex());else if(t==="/"+r.XMLConstants.MG_TAG_CONTROL||It.IsEndFormTag(t))return i.setCurrIndex2EndOfTag(),[2,!1];return-1!==a&&a<i.getXMLdata().length?(s=i.getXMLsubstring(a),i.add2CurrIndex(s.indexOf(t)+t.length),o=r.XmlParser.getTokens(i.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),t!==r.XMLConstants.MG_TAG_CONTROL?[3,1]:(this._parent=n.getCtrl(e.NNumber.Parse(this.fillName(o))),i.setCurrIndex(++a),[2,!0])):[3,10];case 1:return t!==r.XMLConstants.MG_TAG_PROP?[3,9]:null==this._parent?[3,7]:(l=this.fillName(o),u=e.NNumber.Parse(l),c=null,null==this._parent?[3,3]:[4,this._parent.getProp(u)]);case 2:c=_.sent(),_.label=3;case 3:return null!=c?[3,4]:(E.WriteExceptionToLog(e.NString.Format("in PropTable.fillExistInnerObjects() no property with id={0}",l)),[3,6]);case 4:return[4,this.addPropWithCheckExistence(c,!1)];case 5:_.sent(),_.label=6;case 6:return i.setCurrIndex(a+r.XMLConstants.TAG_TERM.length),[2,!0];case 7:E.WriteExceptionToLog("in PropTable.fillExistInnerObjects() missing control"),_.label=8;case 8:return[3,10];case 9:return E.WriteExceptionToLog(e.NString.Format("in PropTable.fillExistInnerObjects() illegal tag name: {0}",t)),i.setCurrIndex(++a),[2,!0];case 10:return t===r.XMLConstants.MG_TAG_CONTROL?(i.setCurrIndex(++a),[2,!0]):It.IsFormTag(t)?(this._parent=n.getForm(),this._parent.fillName(t),[2,!0]):t==="/"+r.XMLConstants.MG_TAG_FLD?[2,!1]:(i.setCurrIndex(a+r.XMLConstants.TAG_TERM.length),[2,!0])}}))}))},n.prototype.fillName=function(t){for(var n,i=null,o=0;o<t.length;o+=2)if(i=t.get_Item(o),n=t.get_Item(o+1),i===r.XMLConstants.MG_ATTR_DITIDX||i===r.XMLConstants.MG_ATTR_ID)return n;return E.WriteExceptionToLog(e.NString.Format("Unrecognized attribute: '{0}'",i)),null},n.prototype.getSize=function(){return this._props.length},n.prototype.getProp=function(t){return t<0||t>=this._props.length?null:this._props.get_Item(t)},n.prototype.getPropById=function(t){return this._hashTab.get_Item(t)},n.prototype.propExists=function(t){return null!==this.getPropById(t)},n.prototype.setProp=function(t,e,r,n){return s(this,void 0,void 0,(function(){var i;return _(this,(function(o){switch(o.label){case 0:return null!==(i=this.getPropById(t))?[3,2]:(i=new pt(t,r,n),[4,this.addPropWithCheckExistence(i,!0)]);case 1:o.sent(),o.label=2;case 2:return i.setValue(e),i.setOrgValue(),[2]}}))}))},n.prototype.RefreshDisplay=function(r,n){return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,c;return _(this,(function(_){switch(_.label){case 0:i=!0,a=0,s=null,l=new e.List,null!=this._parent&&this._parent instanceof Pt&&(s=this._parent.getForm()),null!=s&&s.checkAndCreateRow(s.DisplayLine),a=0,_.label=1;case 1:if(!(a<this.getSize()))return[3,8];o=this.getProp(a),_.label=2;case 2:return _.trys.push([2,6,,7]),n&&!pt.isRepeatableInTable(o.getID())?[3,7]:o.getID()!==t.PropInterface.PROP_TYPE_VISIBLE?[3,3]:(l.push(o),[3,5]);case 3:return[4,o.RefreshDisplay(r)];case 4:_.sent(),_.label=5;case 5:return[3,7];case 6:if(!((u=_.sent())instanceof e.ApplicationException))throw u;return E.WriteExceptionToLog(u),i=!1,[3,7];case 7:return a++,[3,1];case 8:c=0,_.label=9;case 9:return c<l.length?[4,l[c].RefreshDisplay(r)]:[3,12];case 10:_.sent(),_.label=11;case 11:return c++,[3,9];case 12:return[2,i]}}))}))},n.prototype.updatePrevValueArray=function(t){for(var e=0;e<this._props.length;e+=1){this._props.get_Item(e).updatePrevValueArray(t)}},n.prototype.resetPrevValueArray=function(){for(var t=0;t<this._props.length;t+=1){this._props.get_Item(t).ResetPrevValueArray()}},n.prototype.resetPrevValAt=function(t){for(var e=0;e<this._props.length;e+=1){this._props.get_Item(e).resetPrevValAt(t)}},n.prototype.clearLabelPrevValueArray=function(){var t=this.getPropById(45);null!==t&&t.clearPrevValueArray()},n.prototype.getCtrlRef=function(){return this._parent instanceof Pt?this._parent:null},n.prototype.InsertPrevValueArray=function(t,e){for(var r=0;r<this._props.length;r++){this._props[r].InsertPrevValueArray(t,e)}},n}(),Ot=function(t){function e(e){var r=t.call(this,e)||this;return r._type=null,r.name="WrongFormatException",0===arguments.length?(r.constructor_0(),r):(r.constructor_1(e),r)}return a(e,t),e.prototype.initialize=function(){this._type=null},e.prototype.constructor_0=function(){this.initialize(),this._type=r.MsgInterface.STR_RNG_TXT},e.prototype.constructor_1=function(t){this.initialize(),this._type=t},e.prototype.getType=function(){return this._type},e}(e.Exception),gt=function(){function n(){this._newvalue=null,this._oldvalue=null,this._pictureReal=null,this._pictureEnable=null,this._valDet=null,this._isPm=!1,this._picture=null,this.hebrew=!1,this._decimal=null,this._environment=null,this._environment=x.Environment,this._decimal=this._environment.GetDecimal()||""}return n.prototype.checkVal=function(t){this._newvalue=this._oldvalue=this._pictureReal=this._pictureEnable=null,this.init(t),t.setValidationFailed(!1);var n=t.getControl(),i=n.Type===r.MgControlType.CTRL_TYPE_TAB,o=n.isModifiable();if("E"===n.getForm().getTask().getMode()&&!i)return t.setValue(this._oldvalue),t;if(n.Type===r.MgControlType.CTRL_TYPE_RADIO||n.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||n.Type===r.MgControlType.CTRL_TYPE_TAB||n.isSelectionCtrl()){try{if(n.Type===r.MgControlType.CTRL_TYPE_CHECKBOX&&t.setNull(n.isNullValue(this._newvalue)),null!==this._newvalue&&n.isSelectionCtrl()){var a=e.NNumber.Parse(this._newvalue);n.isChoiceNull(a)&&t.setNull(!0)}}catch(t){if(!(t instanceof e.Exception))throw t}return t.setValue(this._newvalue),t}if(n.DataType!==r.StorageAttribute.ALPHA&&n.DataType!==r.StorageAttribute.UNICODE&&n.DataType!==r.StorageAttribute.BLOB&&("string"==typeof this._newvalue&&0===this._newvalue.trim().length||n.DataType===r.StorageAttribute.DATE&&(n.isDateZero(this._newvalue)||this.isNullDisplayVal()))){var s=n.getField(),_=s.getDefaultValue(),l=null;if(s.isNullDefault()&&(t.setNull(!0),l=s.getNullDisplay(),e.NString.IsNullOrEmpty(l)&&n.DataType===r.StorageAttribute.DATE&&(l=$.Instance.mg2disp(_,t.getRange(),t.getPIC(),o,s.getTask().getCompIdx(),!1))),null===l&&(l=$.Instance.mg2disp(_,t.getRange(),t.getPIC(),o,s.getTask().getCompIdx(),!1)),s.isNullDefault()||null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())return t.setValue(l),t;this._newvalue=l}if("string"==typeof this._newvalue&&r.StrUtil.rtrim(this._newvalue)!==r.StrUtil.rtrim(this._oldvalue)||n.ModifiedByUser)try{switch(t.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:t.setValue(this.checkAlphaField());break;case r.StorageAttribute.NUMERIC:this._pictureReal=t.getPictureReal(),this._pictureEnable=t.getPictureEnable(),this.checkNumericPicture(),t.setValue(this.checkNumericField());break;case r.StorageAttribute.BOOLEAN:t.setValue(this.checkLogicalField());break;case r.StorageAttribute.DATE:t.setValue(this.checkDateField());break;case r.StorageAttribute.TIME:t.setValue(this.checkTimeField());break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:t.setValue(this._newvalue);break;case r.StorageAttribute.NONE:default:E.WriteExceptionToLog("FieldValidator.checkVal: Type of the field "+t.getType())}}catch(e){e instanceof Ot&&(t.setValue(this._oldvalue),this.setValidationFailed(!0),e.getType()!==r.MsgInterface.STR_RNG_TXT?(this.printMessage(e.getType(),!1),this.setValidationFailed(!0)):this.printMessage(r.MsgInterface.STR_RNG_TXT,!0))}return t},n.prototype.checkAlphaField=function(){var t=this._valDet.getControl(),n=this._valDet.getType()===r.StorageAttribute.ALPHA;if(0===this._newvalue.length&&null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())return this.setValidationFailed(!1),this._newvalue;if(n&&r.UtilStrByteMode.isLocaleDefLangDBCS()){var i=r.UtilStrByteMode.lenB(this._picture);r.UtilStrByteMode.lenB(this._newvalue)>i&&(this._newvalue=r.UtilStrByteMode.leftB(this._newvalue,i))}else this._newvalue.length>this._picture.length&&(this._newvalue=this._newvalue.substr(0,this._picture.length));var o,a=new e.StringBuilder,s=o=0;for(o=s=0;s<this._newvalue.length&&o<this._picture.length;){if($.isAlphaPositionalDirective(this._picture.charAt(o))||this._newvalue.charAt(s)!==this._picture.charAt(o))if($.isAlphaPositionalDirective(this._picture.charAt(o))||this._newvalue.charAt(s)===this._picture.charAt(o)){if($.isAlphaPositionalDirective(this._picture.charAt(o))&&this.isPossibleAlphaLetter(s,o))if(r.UtilStrByteMode.isLocaleDefLangDBCS()){var _=this._newvalue.substr(s,1);2===r.UtilStrByteMode.lenB(_)&&n?o+1<this._picture.length&&$.isAlphaPositionalDirective(this._picture.charAt(o+1))&&this.isPossibleAlphaLetter(s,o+1)?(a.Append(this._newvalue.charAt(s)),s+=1,o+=2):(a.Append(" "),o+=1):(a.Append(this._newvalue.charAt(s)),s+=1,o+=1)}else a.Append(this._newvalue.charAt(s)),s+=1,o+=1;else if(a.Append(" "),o+=1,null!==this._valDet.getControl())t.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&this.printMessage(r.MsgInterface.STR_ERR_NUM,!1)}else a.Append(this._picture.charAt(o)),o+=1;else a.Append(this._picture.charAt(o)),s+=1,o+=1}return this._newvalue=a.ToString(),null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues()||(this._newvalue=this.fillAlphaByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues())),this._newvalue},n.prototype.isPossibleAlphaLetter=function(t,n){switch(this._picture.charCodeAt(n)){case r.PICInterface.PIC_X:case r.PICInterface.PIC_J:case r.PICInterface.PIC_G:case r.PICInterface.PIC_S:case r.PICInterface.PIC_T:return!0;case r.PICInterface.PIC_U:var i=this._newvalue[t].toUpperCase();return i!==this._newvalue[t]&&this.changeStringInside(""+i,t),!0;case r.PICInterface.PIC_L:var o=this._newvalue[t].toLowerCase();return o!==this._newvalue[t]&&this.changeStringInside(""+o,t),!0;case r.PICInterface.PIC_N:var a=this._newvalue[t];return!!(r.UtilStrByteMode.isDigit(a)||e.NChar.IsWhiteSpace(a)||r.UtilStrByteMode.asNumeric(a))||(E.WriteErrorToLog("Bad Alpha value. Should be number only on place Num. "+t),!1);default:return E.WriteErrorToLog("FieldValidator.isPossibleAlphaLetter: illegal Char Directive: "+this._picture.indexOf(String.fromCharCode(n))+" for "+this._newvalue[t]),!1}},n.prototype.fillAllAlpha=function(){var t=new e.StringBuilder(this._picture.length);if(t.Append(this._newvalue),r.UtilStrByteMode.isLocaleDefLangDBCS()&&this._valDet.getType()===r.StorageAttribute.ALPHA)for(var n=r.UtilStrByteMode.lenB(this._newvalue),i=r.UtilStrByteMode.leftB(this._picture,n).length;i<this._picture.length;i+=1)$.isAlphaPositionalDirective(this._picture.charAt(i))?t.Append(" "):t.Append(this._picture.charAt(i));else for(i=this._newvalue.length-1;i<this._picture.length&&i>=0;i++)$.isAlphaPositionalDirective(this._picture.charAt(i))?t.Append(" "):t.Append(this._picture.charAt(i)),i+=1;return t.ToString()},n.prototype.fillAlphaByRange=function(t,e){var n=$.Instance.fillAlphaByDiscreteRangeValues(e,this._newvalue);return null!==n||null!==(n=$.Instance.fillAlphaByContinuousRangeValues(t,this._newvalue))?n:null!==e?this.CompleteAlphaByRange(e):(this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue)},n.prototype.CompleteAlphaByRange=function(t){var e=$.Instance.completeAlphaByRange(t,this._newvalue);return null!==e?e:(this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue)},n.prototype.checkLogicalField=function(){if(0===this._newvalue.length&&null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())throw new Ot(r.MsgInterface.STR_RNG_TXT);return null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues()||(this._newvalue=this.fillAlphaByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues())),this.setValidationFailed(!1),this._newvalue},n.prototype.checkNumericField=function(){var t;if("string"==typeof this._newvalue){0===this._newvalue.length&&(this._newvalue="0");var e=this._newvalue.indexOf(this._decimal),n=this._pictureReal.indexOf(this._decimal);t="";var i=void 0,o=void 0;if(this.setValidationFailed(!1),!this.checkNumericInDecFormat())throw new Ot(r.MsgInterface.EDT_ERR_STR_1);if(-1!==n&&-1!==e?(i=this.checkNumericLeft(n,e),o=this.checkNumericRight(n,e),t=i+this._decimal+o):-1!==n&&-1===e?(i=this.checkNumericLeft(n,Math.min(n,this._newvalue.length)),o=this.checkNumericRight(n,n-1),t=i+this._decimal+o):(-1===n&&-1===e||(this._newvalue=e>0?this._newvalue.substr(0,e):"0"),i=t=this.checkNumericRight(-1,-1)),0===o.length&&0===i.length||0===t.length&&this._newvalue.length>0){var a=this._valDet.getControl().getField(),s=a.getDefaultValue(),_=null;a.isNullDefault()&&(this._valDet.setNull(!0),_=a.getNullDisplay()),null==_&&(_=$.Instance.mg2disp(s,this._valDet.getRange(),this._valDet.getPIC(),!0,a.getTask().getCompIdx(),!1))}var l=this.digitsBeforeDelimeter(t,0,this._decimal)-this._valDet.getPIC().getWholes();if(l>0){var u=!1;if(this._valDet.getIsPadFill()){u=!0;for(var c=0;c<l&&u;c++)t[c]!==this._valDet.getPadFillChar()&&(u=!1)}if(!u)throw new Ot(r.MsgInterface.EDT_ERR_STR_1)}this._valDet.getIsNegative()&&(this._newvalue.trim().startsWith("-")||0!==this._valDet.getNegativeSignPref().length&&this._newvalue.trim().startsWith(this._valDet.getNegativeSignPref()))&&(t="-"+t),t=$.Instance.disp2mg(this._newvalue,"",this._valDet.getPIC(),this._valDet.getControl().getForm().getTask().getCompIdx(),K.CONTENT_TYPE_UNKNOWN),t=$.Instance.mg2disp(t,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!0),0===r.StrUtil.ltrim(t).length&&this._valDet.getPIC().zeroFill()&&" "===this._valDet.getPIC().getZeroPad()&&(t="0")}else t=$.Instance.disp2mg(this._newvalue,"",this._valDet.getPIC(),this._valDet.getControl().getForm().getTask().getCompIdx(),K.CONTENT_TYPE_UNKNOWN),t=$.Instance.mg2disp(t,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!0);return null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(this._newvalue=t,t=this.fillNumericByRange()),t},n.prototype.checkNumericLeft=function(t,n){var i,o,a=new e.StringBuilder,s=n-1;for(i=t-1;i>=0&&s>=0;i--)if("1"===this._pictureEnable[i]){var _=s;for(o=!1;s>=0;s--)if(this._pictureReal[i]===this._newvalue[s]){o=!0,s--;break}o||(s=_),a.Append(this._pictureReal[i])}else for(;s>=0;s--)if(r.UtilStrByteMode.isDigit(this._newvalue[s])){a.Append(this._newvalue[s]),s--;break}if(s<0&&i>=0)for(;i>=0;i--)"1"===this._pictureEnable[i]?a.Append(this._pictureReal[i]):this._valDet.getIsPadFill()&&a.Append(this._valDet.getPadFillChar());return r.StrUtil.ReverseString(a).ToString()},n.prototype.checkNumericRight=function(t,n){var i,o=new e.StringBuilder,a=n+1,s=this._valDet.getPIC();for(i=t+1;i<this._pictureEnable.length&&a<this._newvalue.length;i++)if("1"===this._pictureEnable[i])a<i&&(a=i),o.Append(this._pictureReal[i]);else for(;a<this._newvalue.length;a++)if(r.UtilStrByteMode.isDigit(this._newvalue[a])&&!s.picIsMask(a)){o.Append(this._newvalue[a]),a++;break}if(o.Length>0&&a>=this._newvalue.length&&i<this._pictureReal.length)for(;i<this._pictureReal.length;i++)"1"===this._pictureEnable[i]&&o.Append(this._pictureReal[i]);return o.ToString()},n.prototype.checkNumericPicture=function(){var t,e,n,i,o=this._valDet.getPIC();if(null!=this._pictureReal&&null!=this._pictureEnable&&o.getAttr()===r.StorageAttribute.NUMERIC&&o.withDecimal())for(e=this._pictureReal.lastIndexOf("."),n=this._pictureEnable.length,i=0;i<e;){if(-1===(t=this._pictureEnable.indexOf("1",i)))return;if(t===this._pictureReal.indexOf(".",i)){var a=void 0,s=void 0;a=s="",0===t?t+1<n&&(s=this._pictureReal.substr(t+1)):t===n?a=this._pictureReal.substr(0,t):(a=this._pictureReal.substr(0,t),s=this._pictureReal.substr(t+1)),this._pictureReal=a+this._decimal+s;break}i=++t}},n.prototype.fillNumericByRange=function(){var t=this._valDet.getControl().getPIC(),e=this._valDet.getContinuousRangeValues(),n=this._valDet.getDiscreteRangeValues();if(this.setValidationFailed(!1),0===this.setNumericValueWithoutPicture(this._newvalue.toString()).length)return this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue;var i=new Z(this._newvalue.toString(),this._valDet.getControl().getPIC(),0);if(null!==n)for(var o=0;o<n.length;o+=1){var a=new Z(n.get_Item(o),t,0);try{if(0===Z.num_cmp(i,a))return this._newvalue}catch(t){}}if(null!==e)for(o=0;o<e.length;o+=1){a=new Z;var s=new Z;a.num_4_a_std(e.get_Item(o++)),s.num_4_a_std(e.get_Item(o));try{if(-1!==Z.num_cmp(i,a)&&-1!==Z.num_cmp(s,i))return this._newvalue}catch(t){}}throw new Ot},n.prototype.getDoubleVal=function(t){var r=!1,n=!1,i=!1,o=!1,a=0;for(a=0;a<t.length&&!o;a++){var s=t[a];if(s>="0"&&s<="9")i=!0;else switch(s){case"-":(i||r||n)&&(o=!0),n=!0;break;case".":(r||n&&!i)&&(o=!0),r=!0;break;case" ":(i||r||n)&&(o=!0);break;default:o=!0}}return o&&(a-=1),a>0?e.NNumber.Parse(t.substr(0,a)):-1/0},n.prototype.setNumericValueWithoutPicture=function(t){for(var n,i=new e.StringBuilder(t.length),o=!1,a=0;a<this._pictureReal.length&&a<t.length;a++)n=t[a],r.UtilStrByteMode.isDigit(n)?i.Append(n):n!==this._environment.GetDecimal()||o?"-"===n&&this._valDet.getIsNegative()&&i.Append(e.NString.ToCharArray(e.NumberFormatInfo.NegativeSign).toString()):(i.Append(e.NString.ToCharArray(e.NumberFormatInfo.NumberDecimalSeparator).toString()),o=!0);return 0===i.ToString().length&&(this.printMessage(r.MsgInterface.STR_ERR_NUM,!1),this.setValidationFailed(!0)),i.ToString()},n.prototype.checkNumericInDecFormat=function(){var t,e,n,i,o=this._valDet.getPIC(),a=this._environment.GetDecimal();for(e=0,n=0,i=-1,t=0;t<this._newvalue.length;t++)o.isNumeric(t)&&(r.UtilStrByteMode.isDigit(this._newvalue[t])?i>=0?e++:n++:this._newvalue[t]===a&&(i=t));return!(o.getWholes()<n||o.getDec()<e)},n.prototype.checkDateField=function(){var t=null==this._newvalue?null:new Date(this._newvalue);if(this.setValidationFailed(!1),this._valDet.getControl().isDateZero(this._newvalue)){var e=this._valDet.getControl().getField().getDefaultValue();t=$.Instance.mg2disp(e,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!1)}else null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(t=this.fillDateByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues(),this._newvalue));return t},n.prototype.add2Date=function(t,n,i){var o,a=t,s=new e.StringBuilder(this._newvalue.length),_=0;switch(i){case r.PICInterface.PIC_DD:case r.PICInterface.PIC_DDDD:case r.PICInterface.PIC_MMD:case r.PICInterface.PIC_YY:_=2;break;case r.PICInterface.PIC_DDD:_=3;break;case r.PICInterface.PIC_YYYY:_=4;break;case r.PICInterface.PIC_W:_=1;break;case r.PICInterface.PIC_YJ:_=2,i=r.PICInterface.PIC_YY}for(;a<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue.charAt(a));)a++;if(a===this._newvalue.length&&(0===this._newvalue.length||"0"===this._newvalue)){for(var l=0;l<_;l+=1)n.Append("0");return t}for(a===this._newvalue.length&&(this._newvalue=this._newvalue+"0"),o=a;o<a+_&&o<this._newvalue.length&&r.UtilStrByteMode.isDigit(this._newvalue.charAt(o));o++)s.Append(this._newvalue.charAt(o));0===s.Length&&s.Append("0");var u=e.NNumber.Parse(s.ToString());if(u<1&&i!==r.PICInterface.PIC_YYYY&&i!==r.PICInterface.PIC_YY||u>31&&(i===r.PICInterface.PIC_DD||i===r.PICInterface.PIC_DDDD)||u>12&&i===r.PICInterface.PIC_MMD||u>7&&i===r.PICInterface.PIC_W)throw new Ot(r.MsgInterface.STR_ERR_DATE);i===r.PICInterface.PIC_YYYY&&this._environment.GetCentury(this._valDet.getControl().getForm().getTask().getCompIdx())>999&&s.Length<3&&(s=this.checkCentury(u));for(var c=0;c<_-s.Length;c+=1)n.Append("0");return n.Append(s.ToString()),o},n.prototype.addM2Date=function(t,e,n,i){var o;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD)if(this.hebrew)o=q.GetLocalMonths();else{var a=E.GetMessageString(r.MsgInterface.MONTHS_PTR);o=r.DateUtil.getLocalMonths(a)}else if(i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W)if(this.hebrew)o=q.GetLocalDows();else{var s=E.GetMessageString(r.MsgInterface.DAYS_PTR);o=r.DateUtil.getLocalDays(s)}else{if(i!==r.PICInterface.PIC_BB){if(i===r.PICInterface.PIC_JY1||i===r.PICInterface.PIC_JY2||i===r.PICInterface.PIC_JY4){if(this._newvalue.length<t+e)throw new Ot(r.MsgInterface.STR_ERR_DATE);var _=this._newvalue.substr(t,e);return n.Append(_),t+_.length}return t+e}o=r.UtilDateJpn.getArrayDow()}this._newvalue.length<t&&(t=this._newvalue.length);var l=this.getMonthOrWeek(this._newvalue.substr(t),e,i);if(o[l].trim().length>=e)n.Append(o[l].trim().substr(0,e));else{n.Append(o[l].trim());for(var u=e-o[l].trim().length;u>0;u-=1)n.Append(" ")}return t+e},n.prototype.getEndOfNumericBlock=function(t){for(;t<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue.charAt(t));)t+=1;return t},n.prototype.addDateSuffix=function(t){var r=e.NNumber.Parse(t);return 1===r||21===r||31===r?"st":2===r||22===r?"nd":3===r||23===r?"rd":"th"},n.prototype.getSizeOfBlock=function(t,e){for(var r=t+1;r<this._picture.length&&this._picture.charCodeAt(r)===e;)r++;return r-t},n.prototype.getMonthOrWeek=function(t,n,i){var o;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD)if(this.hebrew)o=q.GetLocalMonths();else{var a=E.GetMessageString(r.MsgInterface.MONTHS_PTR);o=r.DateUtil.getLocalMonths(a.toString())}else if(i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W)if(this.hebrew)o=q.GetLocalDows();else{var s=E.GetMessageString(r.MsgInterface.DAYS_PTR);o=r.DateUtil.getLocalDays(s.toString())}else{if(i!==r.PICInterface.PIC_BB)return 1;o=r.UtilDateJpn.getArrayDow()}if(n>t.length&&(n=t.length),this.hebrew){for(var _=e.NString.TrimStart(t).substr(0,n).trim(),l=1;l<o.length;l++)if(o[l].trim()===_)return 14===l&&(l=6),l;return 0}try{var u=t.substr(0,n).trim(),c=new e.StringBuilder(u.length);for(l=0;l<u.length&&r.UtilStrByteMode.isDigit(u[l]);l++)c.Append(u[l]);var P=e.NNumber.Parse(c.ToString());if(P<1)return 1;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD){if(P>12)return 12}else if((i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W||i===r.PICInterface.PIC_BB)&&P>7)return 7;return P}catch(t){}for(var h,T=new Array(o.length),p=-1,I=1;I<o.length;I++){T[I]=0,h=0;for(l=0;l<o[I].length&&h<t.length&&l<n&&o[I].toLowerCase()[l]===t.toLowerCase()[h];l++,h++)T[I]++;if(h===n||h===o[I].length){p=I;break}}return-1===p&&(p=this.findMax(T)),p},n.prototype.isNumberAllowedInDate=function(){for(var t=0;t<this._picture.length;t++)if(this.isDatePositionalNumericDirective(this._picture[t]))return!0;return!1},n.prototype.isAllNumbers0=function(){for(var t,e=0;e<this._newvalue.length;e++)if(t=this._newvalue[e],r.UtilStrByteMode.isDigit(t)&&"0"!==t)return!1;return!0},n.prototype.checkCentury=function(t){var r,n=this._environment.GetCentury(this._valDet.getControl().getForm().getTask().getCompIdx()),i=Math.floor(n/100);return r=t>=n%100&&0!==t?100*i+t:100*++i+t,new e.StringBuilder(r.toString())},n.prototype.isDateLegal4Range=function(t,e,r){var n,i,o,a=this._valDet.getPIC();if(null!=t)for(n=0;n<t.length-1;n++)if(i=$.Instance.a_2_date_pic(t.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),o=$.Instance.a_2_date_pic(t.get_Item(++n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),r>=i&&r<=o)return!0;if(null!=e)for(n=0;n<e.length;n++)if(r===$.Instance.a_2_date_pic(e.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()))return!0;throw new Ot},n.prototype.fillDateByRange=function(t,e,r){var n,i,o,a=this._valDet.getPIC(),s=$.Instance.fromNativeDateToMgDateNumber(r,a,this._valDet.getControl().getForm().getTask().getCompIdx());if(this.setValidationFailed(!1),null!=t)for(n=0;n<t.length-1;n++)if(i=$.Instance.a_2_date_pic(t.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),o=$.Instance.a_2_date_pic(t.get_Item(++n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),s>=i&&s<=o)return new Date(r);if(null!=e)for(n=0;n<e.length;n++)if(s===$.Instance.a_2_date_pic(e.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()))return new Date(r);throw new Ot},n.prototype.checkDay=function(n,i){var o=this.getDateElement(n,t.DateElement.DAY);if(o<29&&!i)return new e.StringBuilder(n);var a=this.getDateElement(n,t.DateElement.YEAR);if(i){var s=this.getMonthByDay(a,o);if(s<1||s>12)throw new Ot(r.MsgInterface.STR_ERR_DATE)}else{a.toString().length<3&&(a=e.NNumber.Parse(this.checkCentury(a).ToString())),"B"===this._environment.GetDateMode(this._valDet.getControl().getForm().getTask().getCompIdx())&&(a-=r.PICInterface.DATE_BUDDHIST_GAP);var _=this.getDateElement(n,t.DateElement.MONTH);if(o>this.getMaxDayInMonth(a,_))throw new Ot(r.MsgInterface.STR_ERR_DATE)}return new e.StringBuilder(n)},n.prototype.checkWeek=function(r){this.getDateElement(r,t.DateElement.DOW);var n=$.Instance.getNewDateBreakParams(),i=$.Instance.a_2_date(r,this._picture,this._valDet.getControl().getForm().getTask().getCompIdx());$.Instance.date_break_datemode(n,i,!0,this._valDet.getControl().getForm().getTask().getCompIdx());var o=n.dow;return o!=o&&(r=this.changeDow(r,o)),new e.StringBuilder(r)},n.prototype.checkJpnEraYear=function(t){var n=$.Instance.getNewDateBreakParams(),i=$.Instance.a_2_date(t,this._picture,this._valDet.getControl().getForm().getTask().getCompIdx());$.Instance.date_break_datemode(n,i,!0,this._valDet.getControl().getForm().getTask().getCompIdx());var o,a,s=n.year,_=n.doy;o=r.UtilDateJpn.getInstance().date_jpn_yr_2_a(s,_,!1),a=r.UtilDateJpn.getInstance().date_jpn_yr_2_a(s,_,!0);var l=new e.StringBuilder,u=r.UtilDateJpn.getInstance().date_jpn_year_ofs(s,_);if(u<=0)throw new Ot(r.MsgInterface.STR_ERR_DATE);u<=9&&l.Append("0"),l.Append(u.toString());for(var c=0,P=0;P+c<this._picture.length;P++)switch(this._picture.charCodeAt(P+c)){case r.PICInterface.PIC_JY1:t=r.UtilStrByteMode.repC(t,o,P+1,1);break;case r.PICInterface.PIC_JY2:t=r.UtilStrByteMode.repC(t,a,P+1,1),c++;break;case r.PICInterface.PIC_JY4:t=r.UtilStrByteMode.repC(t,a,P+1,2),P++,c+=2;break;case r.PICInterface.PIC_YJ:t=r.UtilStrByteMode.repC(t,l.toString(),P+1,2),P++;break;default:P<t.length&&!1===r.UtilStrByteMode.isHalfWidth(t[P])&&!0===r.UtilStrByteMode.isHalfWidth(this._picture[P+c])&&c++}return new e.StringBuilder(t)},n.prototype.getMaxDayInMonth=function(t,e){var r=[0,31,28,31,30,31,30,31,31,30,31,30,31];return t%4==0&&(t%100!=0||t%400==0)&&2===e?r[e]+1:r[e]},n.prototype.getMonthByDay=function(t,e){var n,i;for(i=t%4==0&&(t%100!=0||t%400==0),n=0;n<r.PICInterface.date_day_tab.length;n++)if(i){if(n<3){if(r.PICInterface.date_day_tab[n]>=e)return n}else if(r.PICInterface.date_day_tab[n]+1>=e)return n}else if(r.PICInterface.date_day_tab[n]>=e)return n;return n},n.prototype.getDateElement=function(n,i){var o=null,a=0,s=!1,_=r.PICInterface.PIC_WWW,l=!1,u=0,c=0,P=0;P=r.UtilStrByteMode.isLocaleDefLangJPN()?r.UtilStrByteMode.getMinLenPicture(n,this._picture):Math.min(n.length,this._picture.length);for(var h=0;h+c<P&&!s;h++)if(this.isDataPositionalDirective(this._picture[h+c]))switch(this._picture.charCodeAt(h+c)){case r.PICInterface.PIC_DD:if(i===t.DateElement.DAY){o=n.substr(h,2),s=!0;break}h++;break;case r.PICInterface.PIC_DDD:if(i===t.DateElement.DAY){o=n.substr(h,3),s=!0;break}h+=2;break;case r.PICInterface.PIC_DDDD:i===t.DateElement.DAY&&(o=n.substr(h,2),s=!0),h+=3;break;case r.PICInterface.PIC_MMD:i===t.DateElement.MONTH&&(o=n.substr(h,2),s=!0),h++;break;case r.PICInterface.PIC_MMM:if(a=this.getSizeOfBlock(h+c,r.PICInterface.PIC_MMM),i===t.DateElement.MONTH){o=n.substr(h,a),s=!0;break}h+=a-1,a=0;break;case r.PICInterface.PIC_YY:i===t.DateElement.YEAR&&(o=n.substr(h,2),s=!0),h++;break;case r.PICInterface.PIC_YYYY:i===t.DateElement.YEAR&&(o=n.substr(h,4),s=!0),h+=3;break;case r.PICInterface.PIC_W:i===t.DateElement.DOW&&(o=n.substr(h,1),s=!0);break;case r.PICInterface.PIC_WWW:if(a=this.getSizeOfBlock(h+c,r.PICInterface.PIC_WWW),i===t.DateElement.DOW){o=n.substr(h,a),s=!0;break}h+=a-1,a=0;break;case r.PICInterface.PIC_HYYYYY:case r.PICInterface.PIC_HL:case r.PICInterface.PIC_HDD:break;case r.PICInterface.PIC_BB:a=this.getSizeOfBlock(h+c,r.PICInterface.PIC_BB),h+Math.floor(a/2)<n.length&&(c+=a-(o=n.substr(h,Math.floor(a/2))).length),i===t.DateElement.DOW?(s=!0,_=r.PICInterface.PIC_BB):o=null,h+=a-1;break;case r.PICInterface.PIC_JY1:l=!0;break;case r.PICInterface.PIC_JY2:l=!0,c++;break;case r.PICInterface.PIC_JY4:l=!0,c+=2,h++;break;case r.PICInterface.PIC_YJ:i===t.DateElement.YEAR&&(o=n.substr(h,2),s=!0),h++}if(null==o)return i===t.DateElement.YEAR?e.DateTime.Now.Year:1;if(o=o.trim(),a>0)i===t.DateElement.MONTH?a=this.getMonthOrWeek(o.toString(),a,r.PICInterface.PIC_MMM):i===t.DateElement.DOW&&(a=this.getMonthOrWeek(o.toString(),a,_));else{for(;o.toString().startsWith("0")||o.toString().startsWith(" ");)o=o.toString().substr(1);a=0===o.length?0:e.NNumber.Parse(o.toString())}if(i===t.DateElement.YEAR&&l){if(0===(u=r.UtilDateJpn.getInstance().getStartYearOfEra(n,this._picture)))return 0;a+=u-1}return a},n.prototype.changeDow=function(t,e){var n,i,o,a,s=!1;a=""+e;for(var _=0,l=0;l+_<this._picture.length&&!s;l++)if(this.isDataPositionalDirective(this._picture[l+_]))switch(this._picture.charCodeAt(l+_)){case r.PICInterface.PIC_W:i=t.substr(0,l),o=t.substr(l+1),t=i+a+o,s=!0;break;case r.PICInterface.PIC_WWW:n=this.getSizeOfBlock(l+_,r.PICInterface.PIC_WWW),i=t.substr(0,l),o=t.substr(l+n);var u=E.GetMessageString(r.MsgInterface.DAYS_PTR);if((a=r.DateUtil.getLocalDays(u)[e]).length>n)a=a.substr(0,n);else if(a.length<n)for(;a.length<n;)a+=" ";t=i+a+o,s=!0;break;case r.PICInterface.PIC_BB:if(n=this.getSizeOfBlock(l+_,r.PICInterface.PIC_BB),i=t.substr(0,l),o=t.substr(l+Math.floor(n/2)),a=r.UtilDateJpn.getStrDow(e),r.UtilStrByteMode.lenB(a)>n)a=r.UtilStrByteMode.leftB(a,n);else if(r.UtilStrByteMode.lenB(a)<n)for(;r.UtilStrByteMode.lenB(a)<n;)a+=" ";t=i+a+o,s=!0;break;default:r.UtilStrByteMode.isLocaleDefLangDBCS()&&l<t.length&&!1===r.UtilStrByteMode.isHalfWidth(t[l])&&!0===r.UtilStrByteMode.isHalfWidth(this._picture[l+_])&&_++}return t},n.prototype.checkTimeField=function(){var t=new Date(this._newvalue);if(this.setValidationFailed(!1),this._valDet.getControl().isDateZero(this._newvalue)){var e=this._valDet.getControl().getField().getDefaultValue();t=$.Instance.mg2disp(e,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!1)}else null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(t=this.fillTimeByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues(),this._newvalue));return t},n.prototype.add2Time=function(t,n,i){for(var o,a=t,s=new e.StringBuilder;a<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue[a]);)a++;if(a===this._newvalue.length)return n.Append("00".toString()),t;for(o=a;o<a+2&&o<this._newvalue.length;o++){if(!r.UtilStrByteMode.isDigit(this._newvalue[o])){s.Insert(0,"0");break}s.Append(this._newvalue[o])}o===this._newvalue.length&&o===a+1?s.Insert(0,"0"):o===this._newvalue.length&&o===a&&s.Append("00".toString());var _=e.NNumber.Parse(s.ToString());if(_<0||_>59&&i===r.PICInterface.PIC_MMT||_>59&&i===r.PICInterface.PIC_SS)throw new Ot(r.MsgInterface.STR_ERR_TIME);if(i===r.PICInterface.PIC_HH){var l=this.getIsPM(),u=null,c=void 0;if((_>=12||0===_)&&l){var P=_%24;this._isPm=P>=12&&P<24,u=((c=P>12?P-12:0===P?12:P)>9?"":"0")+c}else _>99&&!l&&(u="99");null!=u&&(s.Remove(0,s.Length),s.Append(u.toString()))}return n.Append(s.ToString()),o},n.prototype.addPM2Time=function(t,e){var r;return-1!==(r=this._newvalue.toUpperCase().indexOf("AM",t))?(e.Append("am"),r+2):-1!==(r=this._newvalue.toUpperCase().indexOf("PM",t))?(e.Append("pm"),r+2):this._isPm?(e.Append("pm"),t):(e.Append("am"),t)},n.prototype.getIsPM=function(){for(var t=0;t<this._picture.length;t++)if(this._picture.charCodeAt(t)===r.PICInterface.PIC_PM)return!0;return!1},n.prototype.fillTimeByRange=function(t,e,r){var n,i,o,a=this._valDet.getPIC(),s=$.Instance.fromNativeTimeToMgTimeNumber(r,a);if(this.setValidationFailed(!1),null!=t)for(o=0;o<t.length-1;o++)if(n=$.Instance.a_2_time(t.get_Item(o),a,!1),i=$.Instance.a_2_time(t.get_Item(++o),a,!1),s>=n&&s<=i)return new Date(r);if(null!=e)for(o=0;o<e.length;o++)if(s===$.Instance.a_2_time(e.get_Item(o),a,!1))return new Date(r);throw new Ot},n.prototype.printMessage=function(t,n){var i,o=new e.StringBuilder("");if(t===r.MsgInterface.EDT_ERR_STR_1){var a=this._valDet.getPIC(),s=E.GetMessageString(t);s=r.StrUtil.replaceStringTokens(s,"%d",1,a.getWholes().toString()),s=r.StrUtil.replaceStringTokens(s,"%d",1,a.getDec().toString()),o.Append(s)}else o.Append(E.GetMessageString(t)),t===r.MsgInterface.STR_RNG_TXT&&null!=this._valDet.getRange()&&o.Append(r.StrUtil.makePrintableTokens(this._valDet.getRange(),r.HTML_2_STR));if(null!=this._valDet.getControl()&&(i=this._valDet.getControl().Type)!==r.MgControlType.CTRL_TYPE_BUTTON&&i!==r.MgControlType.CTRL_TYPE_RADIO&&!this._valDet.getControl().isSelectionCtrl()){var _=o.ToString();this._valDet.getControl().getForm().getTask().WriteToMessagePane(r.StrUtil.makePrintable2(_),!0),this._valDet.getControl().getForm().ErrorOccured=!e.NString.IsNullOrEmpty(_),this._valDet.ErrorMessage=o.ToString()}n&&this.setValidationFailed(!0)},n.prototype.changeStringInside=function(t,e){this._newvalue=this._newvalue.substr(0,e)+t+this._newvalue.substr(e+t.length)},n.prototype.init=function(t){this._valDet=t,this._valDet.setNull(!1),this._isPm=!1;var e=this._valDet.getPIC();this._oldvalue=this._valDet.getOldValue(),this._newvalue=this._valDet.getDispValue(),null===this._newvalue&&(null!=e&&e.getAttr()==r.StorageAttribute.DATE||(this._newvalue="")),null===this._oldvalue&&(this._oldvalue=""),null!==e&&e.getAttr()!==r.StorageAttribute.BLOB&&e.getAttr()!==r.StorageAttribute.BLOB_VECTOR&&(this._picture=e.getMask(),this.hebrew=e.isHebrew(),this._picture=this._picture.substr(0,e.getMaskSize()))},n.prototype.findMax=function(t){for(var e=0,r=t[e],n=1;n<t.length;n++)t[n]>r&&(r=t[n],e=n);return e},n.prototype.isDataPositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_YY||e===r.PICInterface.PIC_YYYY||e===r.PICInterface.PIC_MMD||e===r.PICInterface.PIC_MMM||e===r.PICInterface.PIC_DD||e===r.PICInterface.PIC_DDD||e===r.PICInterface.PIC_DDDD||e===r.PICInterface.PIC_W||e===r.PICInterface.PIC_WWW||e===r.PICInterface.PIC_HYYYYY||e===r.PICInterface.PIC_HL||e===r.PICInterface.PIC_HDD||e===r.PICInterface.PIC_YJ||e===r.PICInterface.PIC_JY1||e===r.PICInterface.PIC_JY2||e===r.PICInterface.PIC_JY4||e===r.PICInterface.PIC_BB},n.prototype.isDatePositionalNumericDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_YY||e===r.PICInterface.PIC_YYYY||e===r.PICInterface.PIC_MMD||e===r.PICInterface.PIC_DD||e===r.PICInterface.PIC_DDD||e===r.PICInterface.PIC_DDDD||e===r.PICInterface.PIC_W||e===r.PICInterface.PIC_HYYYYY||e===r.PICInterface.PIC_HL||e===r.PICInterface.PIC_HDD||e===r.PICInterface.PIC_YJ||e===r.PICInterface.PIC_JY1||e===r.PICInterface.PIC_JY2||e===r.PICInterface.PIC_JY4||e===r.PICInterface.PIC_BB},n.prototype.isNumericPositionalDirective=function(t){return t.charCodeAt(0)===r.PICInterface.PIC_N},n.prototype.isLogicPositionalDirective=function(t){return t.charCodeAt(0)===r.PICInterface.PIC_X},n.prototype.isTimePositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_HH||e===r.PICInterface.PIC_MMT||e===r.PICInterface.PIC_SS||e===r.PICInterface.PIC_PM||e===r.PICInterface.PIC_MS},n.prototype.indexOfPositionalNonDirective=function(t){for(var e,r=0;r<t.length;r++)if(e=t[r],!($.isAlphaPositionalDirective(e)||this.isDataPositionalDirective(e)||this.isNumericPositionalDirective(e)||this.isLogicPositionalDirective(e)||this.isTimePositionalDirective(e)))return r;return-1},n.prototype.setValidationFailed=function(t){this._valDet.ValidationFailed||this._valDet.setValidationFailed(t)},n.prototype.digitsBeforeDelimeter=function(t,r,n){var i=0,o=t.indexOf(n,r);o<0&&(o=t.length);for(var a=r;a<o;a++)e.NChar.IsDigit(t[a])&&i++;return i},n.prototype.isNullDisplayVal=function(){var t=!1,e=this._valDet.getControl().getField();if(e.NullAllowed&&e.hasNullDisplayValue()){var r=e.getNullDisplay();t=null!==r?r.toString()===this._newvalue:null===this._newvalue}return t},n}(),Rt=function(t){function n(e,r,i,o,a){var s=t.call(this)||this;return s._control=null,s._fieldValidator=null,s._picData=null,s._pictureEnable=null,s._pictureReal=null,s._isNull=!1,s._oldvalue=null,s._val=null,s._validationFailed=!1,s.errMessage=null,s.constructor_3(),5===arguments.length?s.constructor_0(e,r,i,o,a):1!==arguments.length||null!==e&&e.constructor!==String?1===arguments.length&&(null===e||e instanceof n)&&s.constructor_2(e):s.constructor_1(e),s}return a(n,t),Object.defineProperty(n.prototype,"ErrorMessage",{get:function(){return this.errMessage},set:function(t){this.errMessage=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ValidationFailed",{get:function(){return this._validationFailed},enumerable:!1,configurable:!0}),n.prototype.constructor_0=function(t,n,i,o,a){switch(this._picData=o,this._oldvalue=t,this._val=n,this._range=i,this._control=a,o.getAttr()){case r.StorageAttribute.NUMERIC:this._pictureReal=new e.StringBuilder(this._picData.getMaskSize()),this._pictureEnable=new e.StringBuilder(this._picData.getMaskSize()),this.getRealNumericPicture();break;case r.StorageAttribute.BOOLEAN:null==this._range&&(this._range="True,False");break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:break;default:E.WriteExceptionToLog("ValidationDetails.ValidationDetails: There is no type "+this._picData.getAttr())}null!=this._range&&this.fillRange(),i=null},n.prototype.constructor_1=function(t){this.constructor_3(),this._range=t,null!==this._range&&this.fillRange()},n.prototype.constructor_2=function(t){this.constructor_3(),this._oldvalue=t.getOldValue(),this._val=t._val,this._range=t.getRange(),this._control=t.getControl(),this._validationFailed=!1,null!==t._pictureReal&&(this._pictureReal=new e.StringBuilder(t._pictureReal.ToString())),null!==t._pictureEnable&&(this._pictureEnable=new e.StringBuilder(t._pictureEnable.ToString())),null!==t.getDiscreteRangeValues()&&(this._discreteRangeValues=t.CloneDiscreteRangeValues()),null!=t.getContinuousRangeValues()&&(this._continuousRangeValues=t.CloneContinuousRangeValues()),this._picData=t.getPIC(),this._isNull=t.getIsNull()},n.prototype.constructor_3=function(){this._fieldValidator=new gt},n.prototype.getRealNumericPicture=function(){for(var t=this._picData.getMask(),e=this._picData.getDec(),n=this._picData.getWholes(),i=this._picData.withDecimal(),o=this._picData.decInFirstPos(),a=this._picData.isNegative(),s=!0,_=!1,l=0,u=0;u<this._picData.getMaskSize();u+=1)switch(l=+t.charAt(u)){case r.PICInterface.PIC_N:if(s){a&&this.setPictures("-","0"),o?(this.setPictures(".","1"),_=!0):n>0&&(n--,this.setPictures("#","0")),s=!1;break}i?n>0?(n--,this.setPictures("#","0")):0!==n||_?e>0&&(e--,this.setPictures("#","0")):(this.setPictures(".","1"),_=!0):n>0&&(n--,this.setPictures("#","0"));break;default:this.setPictures(l.toString(),"1")}E.WriteDevToLog(this._pictureReal.ToString()),E.WriteDevToLog(this._pictureEnable.ToString())},n.prototype.setPictures=function(t,e){this._pictureEnable.Append(e),this._pictureReal.Append(t)},n.prototype.setValue=function(t){this._val=t},n.prototype.setOldValue=function(t){this._oldvalue=t},n.prototype.setRange=function(t){this._range=t},n.prototype.setValidationFailed=function(t){this._validationFailed=t},n.prototype.setNull=function(t){this._isNull=t},n.prototype.getDispValue=function(){if("string"==typeof this._val){var t=this._picData.getMinimumValueLength();if(this._val.length>t&&(t>0||r.StrUtil.rtrim(this._val).length>0)){var e=this._val.substr(t);this._val=this._val.substr(0,t),this._val=this._val+r.StrUtil.rtrim(e)}}else null!=this._control&&this._control.isChoiceControl()&&(this._val=this._val.toString());return this._val},n.prototype.getOldValue=function(){return this._oldvalue},n.prototype.getType=function(){return this._picData.getAttr()},n.prototype.getPictureReal=function(){return this._pictureReal.ToString()},n.prototype.getPictureEnable=function(){return this._pictureEnable.ToString()},n.prototype.getIsNegative=function(){return this._picData.isNegative()},n.prototype.getIsPadFill=function(){return this._picData.padFill()},n.prototype.getPadFillChar=function(){return this._picData.getPad()},n.prototype.getIsZeroFill=function(){return this._picData.zeroFill()},n.prototype.getZeroFillChar=function(){return this._picData.getZeroPad()},n.prototype.getNegativeSignPref=function(){return this._picData.getNegPref_()},n.prototype.getRange=function(){return this._range},n.prototype.getControl=function(){return this._control},n.prototype.getPIC=function(){return this._picData},n.prototype.getIsNull=function(){return this._isNull},n.prototype.evaluate=function(){return this._fieldValidator.checkVal(this)},n.prototype.CloneDiscreteRangeValues=function(){var t=new e.List;return t.AddRange(this._discreteRangeValues.GetEnumerator()),t},n.prototype.CloneContinuousRangeValues=function(){var t=new e.List;return t.AddRange(this._continuousRangeValues.GetEnumerator()),t},n}(j),St=W.DEFAULT_VALUE_INT,Ct=function(){function t(t,e){this._id=0,this._type=r.StorageAttribute.NONE,this._refCount=0,this._nullFlags=null,this._isNumericType=!1,this._numVals=null,this._linkVals=null,this._dispVals=null,t&&(this._id=-2),this._isNumericType=!1}return Object.defineProperty(t.prototype,"HasReferences",{get:function(){return this._refCount>0},enumerable:!1,configurable:!0}),t.prototype.GetAttr=function(){return this._type},t.prototype.setType=function(t){this._type=t,this._type===r.StorageAttribute.MEMO&&(this._type=r.StorageAttribute.ALPHA),this._type!==r.StorageAttribute.NUMERIC&&this._type!==r.StorageAttribute.DATE&&this._type!==r.StorageAttribute.TIME||(this._isNumericType=!0)},t.prototype.SetID=function(t){this._id=t},t.prototype.SetDisplayValues=function(t){this._dispVals=null!==t?t.slice():null},t.prototype.SetLinkValues=function(t){this._linkVals=null!==t?t.slice():null,this.setNumericVals()},t.prototype.setNullFlags=function(t){this._nullFlags=null!==t?t.slice():null},t.prototype.setNumericVals=function(){if(this._isNumericType&&null!==this._linkVals){this._numVals=new Array(this._linkVals.length);for(var t=0;t<this._linkVals.length;t+=1)this._numVals[t]=new Z(this._linkVals[t])}else this._numVals=null},t.prototype.getId=function(){return this._id},t.prototype.getDispVals=function(){return this._dispVals},t.prototype.GetLinkVals=function(){return this._linkVals},t.prototype.getIndexOf=function(t,e,n,i,o,a){var s,_,l,u,c=St,P=null,h=null,T=0,E=-1,p=-1,I="",f=null,O=null;if(n){var g=0;for(f=[St],g=0;null!==this._nullFlags&&g<this._nullFlags.length;g++)if(this._nullFlags[g]){f[0]=g;break}return f}e?O=new at(t).GetCellValues():O=a?t.split(","):[t];f=new Array(O.length);for(var R=0;R<O.length;R+=1){c=St,u=St,s=O[R],this._isNumericType||null!==o?(_=new Z(s),l=s):(_=null,l=r.StrUtil.rtrim(s));for(g=0;g<2&&c===St;g++){switch(g){case 0:P=i,h=o,T=0;break;case 1:default:T=this._isNumericType||null!=h?null==h?0:h.length:null==P?0:P.length,P=this._linkVals,h=this._numVals}if(null!=P)for(var S=0;S<P.length&&c===St;S++)if(this._isNumericType||null!=h){if(0===Z.num_cmp(_,h[S])||s===P[S]||s===P[S]){c=S+T;break}}else{if(P[S]===s||l.length>0&&r.StrUtil.rtrim(P[S])===l){c=S+T;break}if(0===l.length&&0===r.StrUtil.rtrim(P[S]).length){c=S+T;break}c===St&&l.length>0&&(p=Math.min(l.length,P[S].length),(I=l.substr(0,p)).length>0&&P[S].startsWith(I)&&p>E&&(u=S+T,E=p))}}c===St&&(c=u),f[R]=c}return f},t.prototype.getLinkValue=function(t){var e=null;return null!==this._linkVals&&(e=this._linkVals[t]),e},t.prototype.isNull=function(t){return null!=this._nullFlags&&this._nullFlags[t]},t.prototype.AddReference=function(){this._refCount++},t.prototype.RemoveReference=function(){if(this._refCount--,this._refCount<0)throw new e.ApplicationException("in dcVals.decrease() references count is less than zero")},t.prototype.ToString=function(){return e.NString.Format("{{DCValues 0x{0:X8}, {1} refs}}",this._id,this._refCount)},t}(),dt=function(){function t(t,e){this.CtlIndex=0,this.ObjectISN=0,this.CtlIndex=t,this.ObjectISN=e}return t.prototype.toString=function(){return"{Object Ref: "+this.CtlIndex+","+this.ObjectISN+"}"},t.FromXML=function(t){this.ParsedReference=null;try{null!==t&&r.JSON_Utils.JSONFromXML(t,this.FillFromJSON.bind(this))}catch(t){E.WriteExceptionToLog(t)}return this.ParsedReference},t.FillFromJSON=function(e,n){if(null!=e)throw e;var i=n[r.XMLConstants.MG_TAG_OBJECT_REFERENCE].$,o=+i.ctl_idx,a=+i.isn;this.ParsedReference=new t(o,a)},t}();dt.ParsedReference=null;var At=function(){function e(){}return e.SetFocus=function(t,r,n,i){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return t instanceof Pt?[4,e.SetFocus_0(t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return[4,e.SetFocus_1(t,r,n,i)];case 3:return o.sent(),[2]}}))}))},e.SetFocus_0=function(t,r){return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,e.SetFocus(t.getForm().getTask(),t,r,!0)];case 1:return n.sent(),[2]}}))}))},e.SetFocus_1=function(e,r,n,i){return s(this,void 0,void 0,(function(){var o,a;return _(this,(function(s){switch(s.label){case 0:return(o=e).isAborting()?[2]:(E.OnCtrlFocus(e,r),null===r?[3,2]:[4,r.isParkable(!0)]);case 1:return s.sent()?(F.addBoolWithLine(t.CommandType.SET_FOCUS,r,n>=0?n:r.getDisplayLine(!1),i),[3,3]):[2];case 2:a=o.IsSubForm?o.getForm().getSubFormCtrl():o.getForm(),F.addBoolWithLine(t.CommandType.SET_FOCUS,a,0,i),s.label=3;case 3:return[2]}}))}))},e}(),Lt=function(i){function o(t,n,o){var a=i.call(this)||this;return a._ditIdx=0,a._linkedControls=null,a._field=null,a._nodeIdField=null,a._nodeParentIdField=null,a._picStr=null,a._choiceDisps=null,a._choiceLayerList=null,a._choiceLinks=null,a._choiceNums=null,a._containerDitIdx=-1,a._currReadOnly=null,a._dataCtrl=!1,a._dcTableRefs=null,a._firstRefreshProperties=!0,a._form=null,a._hasValidItmAndDispVal=!1,a._id=-1,a._controlIsn=-1,a._linkedParentDitIdx=-1,a._orgChoiceDisps=null,a._parentTable=null,a._pic=null,a._picExpExists=!1,a._prevIsNulls=null,a._prevPicExpResult=null,a._prevValues=null,a._propTab=null,a._range=null,a._rangeChanged=!1,a._rtfVal=e.NString.Empty,a._valExpId=0,a._vd=null,a._dcValId=-2,a.parent=0,a.veeIndx=0,a.DNObjectReferenceField=null,a.SourceTableReference=null,a.ClipBoardDataExists=!1,a.DataType=r.StorageAttribute.NONE,a.KeyStrokeOn=!1,a.ModifiedByUser=!1,a.Value=null,a.IsNull=!1,a.forceRefresh=!1,a.RefreshOnVisible=!1,a.InControl=!1,a.PromptHelp=null,0===arguments.length?(a.constructor_0(),a):(a.constructor_1(t,n,o),a)}return a(o,i),Object.defineProperty(o.prototype,"Form",{get:function(){return this._form},set:function(t){this._form=t,this.GuiMgForm=t},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"Id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"ControlIsn",{get:function(){return this._controlIsn},enumerable:!1,configurable:!0}),o.prototype.constructor_0=function(){this._linkedControls=new e.List,this.DataType=r.StorageAttribute.NONE},o.prototype.constructor_1=function(t,e,r){this.constructor_0(),this.initReferences(e),this.Type=t,this._containerDitIdx=r,this._linkedParentDitIdx=r,this._propTab=new ft(this),this.createArrays(!1)},Object.defineProperty(o.prototype,"UniqueName",{get:function(){return this.Name},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"TaskTag",{get:function(){return this.Form.getTask().getTaskTag()},enumerable:!1,configurable:!0}),o.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},o.prototype.getProp=function(t){return s(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:return e=null,null===this._propTab?[3,2]:null!==(e=this._propTab.getPropById(t))||null===(e=pt.getDefaultProp(t,"C",this))?[3,2]:[4,this._propTab.addPropWithCheckExistence(e,!1)];case 1:r.sent(),r.label=2;case 2:return[2,e]}}))}))},o.prototype.getForm=function(){return this.Form},o.prototype.getCompIdx=function(){return this.getForm().getTask().getCompIdx()},o.prototype.IsFirstRefreshOfProps=function(){return this._firstRefreshProperties},o.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){return _(this,(function(s){switch(s.label){case 0:return[4,this.getForm().getTask().EvaluateExpression(t,e,r,n,i,o,a)];case 1:return[2,s.sent()]}}))}))},o.prototype.GetExpressionStorage=function(t){return this.getForm().getTask().GetExpressionStorage(t)},o.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},o.prototype.initReferences=function(t){this.Form=t},o.prototype.createArrays=function(t){(this._firstRefreshProperties||t)&&(this.SupportsDataSource()&&(this._dcTableRefs=new e.List),this._prevValues=new e.List,t||(this._currReadOnly=new e.List),this._choiceDisps=new e.List,this._orgChoiceDisps=new e.List,this._choiceLinks=new e.List,this._choiceNums=new e.List,this._prevIsNulls=new e.List,this._choiceLayerList=new e.List,this.IsRepeatable||i.prototype.isTableControl.call(this)||this.updateArrays(1))},o.prototype.SetFocus=function(t,e,r,n){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,At.SetFocus(t.getForm().getTask(),t,e,n)];case 1:return r.sent(),[2]}}))}))},o.prototype.InsertArrays=function(t,e){this._prevValues.InsertRange(t,new Array(e)),this._prevIsNulls.InsertRange(t,new Array(e)),this._currReadOnly.InsertRange(t,new Array(e)),this._choiceDisps.InsertRange(t,new Array(e)),this._orgChoiceDisps.InsertRange(t,new Array(e)),this._choiceLinks.InsertRange(t,new Array(e)),this._choiceLayerList.InsertRange(t,new Array(e)),this._choiceNums.InsertRange(t,new Array(e)),this.SupportsDataSource()&&this._dcTableRefs.InsertRange(t,new Array(e)),this._propTab.InsertPrevValueArray(t,e)},o.prototype.updateArrays=function(t){this._prevValues.SetSize(t),this._prevIsNulls.SetSize(t),this._currReadOnly.SetSize(t),this._choiceDisps.SetSize(t),this._orgChoiceDisps.SetSize(t),this._choiceLinks.SetSize(t),this._choiceLayerList.SetSize(t),this._choiceNums.SetSize(t),this.SupportsDataSource()&&this._dcTableRefs.SetSize(t),this._propTab.updatePrevValueArray(t)},o.prototype.updatePrevValArrays=function(t){this._propTab.updatePrevValueArray(t)},o.prototype.fillData=function(t,n,o){var a=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}}});return s(this,void 0,void 0,(function(){return _(this,(function(i){switch(i.label){case 0:null===this.Form&&this.initReferences(t),this._ditIdx=n,i.label=1;case 1:return[4,this.initInnerObjects(o.getNextTag(),o)];case 2:return i.sent()?[3,1]:[3,3];case 3:if(this.DataType===r.StorageAttribute.BLOB&&null===this._picStr&&(this._picStr=""),null!==this._picStr&&void 0!==this.DataType)this.setPIC(this._picStr);else switch(this.Type){case r.MgControlType.CTRL_TYPE_IMAGE:case r.MgControlType.CTRL_TYPE_BROWSER:case r.MgControlType.CTRL_TYPE_BUTTON:this.DataType===r.StorageAttribute.NONE&&(this.DataType=r.StorageAttribute.ALPHA);break;case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_COLUMN:case r.MgControlType.CTRL_TYPE_SUBFORM:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_FRAME_SET:case r.MgControlType.CTRL_TYPE_FRAME_FORM:case r.MgControlType.CTRL_TYPE_CONTAINER:case r.MgControlType.CTRL_TYPE_LINE:break;default:E.WriteExceptionToLog(e.NString.Format("in Control.fillData(): missing datatype or picture string for control: {0}",this.Name))}return a.isTableControl.call(this)&&this.Form.setTableCtrl(this),this.createArrays(!1),[2]}}))}))},o.prototype.initInnerObjects=function(t,n){return s(this,void 0,void 0,(function(){return _(this,(function(i){switch(i.label){case 0:return null===t?[2,!1]:t!==r.XMLConstants.MG_TAG_PROP?[3,2]:(null===this._propTab&&(this._propTab=new ft(this)),[4,this._propTab.fillData(this,"C",n)]);case 1:return i.sent(),[3,3];case 2:if(t===r.XMLConstants.MG_TAG_CONTROL)this.parseAttributes(n);else{if("SourceTable"!==t)return t==="/"+r.XMLConstants.MG_TAG_CONTROL?(n.setCurrIndex2EndOfTag(),[2,!1]):(E.WriteExceptionToLog(e.NString.Format("There is no such tag in Control. Insert else if to Control.initInnerObjects for {0}",t)),[2,!1]);this.ParseSourceTable(n)}i.label=3;case 3:return[2,!0]}}))}))},o.prototype.ParseSourceTable=function(t){t.setCurrIndex2EndOfTag();var e=t.ReadToEndOfCurrentElement(),r=dt.FromXML(e.trim());this.SourceTableReference=r,t.setCurrIndex2EndOfTag()},o.prototype.parseAttributes=function(t){var e=t.getXMLdata().indexOf(">",t.getCurrIndex());if(-1!==e&&e<t.getXMLdata().length){var n=t.getXMLsubstring(e);t.add2CurrIndex(n.indexOf(r.XMLConstants.MG_TAG_CONTROL)+r.XMLConstants.MG_TAG_CONTROL.length);for(var i=r.XmlParser.getTokens(t.getXMLsubstring(e),r.XMLConstants.XML_ATTR_DELIM),o=0;o<i.length;o+=2){var a=i.get_Item(o),s=i.get_Item(o+1);this.SetAttribute(a,s)}t.setCurrIndex(e+1)}else E.WriteExceptionToLog("in Control.FillName() out of string bounds")},o.prototype.SetAttribute=function(t,e){var n=!0;switch(t){case r.XMLConstants.MG_ATTR_TYPE:this.Type=e[0];break;case r.XMLConstants.MG_ATTR_DATA_CTRL:this._dataCtrl=r.XmlParser.getBoolean(e);break;case r.XMLConstants.MG_ATTR_LINKED_PARENT:this.setLinkedParentIdx(r.XmlParser.getInt(e));break;case r.XMLConstants.MG_ATTR_CONTAINER:this.setContainer(r.XmlParser.getInt(e));break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(e);break;case r.XMLConstants.MG_ATTR_CONTROL_ISN:this._controlIsn=r.XmlParser.getInt(e);break;case r.XMLConstants.MG_ATTR_IS_MODAL:this._isModal=r.XmlParser.getBoolean(e);break;case r.XMLConstants.MG_ATTR_CONTROL_Z_ORDER:case r.XMLConstants.MG_HOR_ALIGMENT_IS_INHERITED:break;default:n=!1}return n},o.prototype.setImage=function(){return s(this,void 0,void 0,(function(){var t;return _(this,(function(e){switch(e.label){case 0:return(null===(t=this.Value)||this.IsNull)&&(t=""),this.DataType!==r.StorageAttribute.BLOB?[3,1]:[3,3];case 1:return[4,this.setImageWithFileName(t)];case 2:e.sent(),e.label=3;case 3:return[2]}}))}))},o.prototype.setImageWithFileName=function(e){return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return null===e&&(e=""),[4,E.TranslateLogicalName(e)];case 1:return e=n.sent(),r.Misc.IsWebUrl(e)||(e="./assets/images/"+e),this.IsImageButton()?F.addOperationWithLine(t.CommandType.SET_STYLE,this,0,r.MagicProperties.ImageFile,e):(F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.Image,e),F.addValueWithLine(t.CommandType.SET_VALUE,this,this.getDisplayLine(!1),e)),[2]}}))}))},o.prototype.setContainer=function(t){this._containerDitIdx=t;var e=null;-1!==this._containerDitIdx&&(e=this.Form.getCtrl(this._containerDitIdx)),null!==e&&e.Type===r.MgControlType.CTRL_TYPE_TABLE&&(this._parentTable=e),this.IsRepeatable=null!==this._parentTable&&!i.prototype.isColumnControl.call(this)},o.prototype.getName=function(){return this.Name},o.prototype.getLinkedControls=function(){return this._linkedControls},o.prototype.isRepeatable=function(){return this.IsRepeatable},o.prototype.IsModal=function(){return this._isModal},o.prototype.getDisplayLine=function(t){var e=0;return(this.IsRepeatable||t&&i.prototype.isTableControl.call(this))&&(e=this.Form.DisplayLine),e},o.prototype.isVisible=function(){var e=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_VISIBLE,!0);return e&&(e=this.isParentPropValue(t.PropInterface.PROP_TYPE_VISIBLE)),e},o.prototype.isEnabled=function(){return this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0)},o.prototype.isModifiable=function(){var e=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MODIFIABLE,!0),n=this.getForm().getTask().getMode()===r.Constants.TASK_MODE_QUERY,i=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY,!1),o=e&&(i||!n);return o&&null!=this._field&&(o=this._field.DbModifiable||this.getForm().getTask().getMode()===r.Constants.TASK_MODE_CREATE),o},o.prototype.getDcVals=function(){var t=this.getForm().getTask().DataView,e=null;return-2===this._dcValId?e=this.DataType===r.StorageAttribute.BLOB_VECTOR?t.getEmptyChoiceForVectors():t.getEmptyChoice():this._dcValId>-1&&(e=t.getDcValues(this._dcValId)),e},o.prototype.getPrevIsNull=function(){var t,e=this.getDisplayLine(!0),r=this._prevIsNulls.get_Item(e);return null===r?(t=!1,this._prevIsNulls.set_Item(e,t)):t=r,t},o.prototype.setPrevIsNull=function(t){this._prevIsNulls.set_Item(this.getDisplayLine(!0),t)},o.prototype.setPIC=function(t){i.prototype.isButton.call(this)?this._picStr=i.prototype.IsImageButton.call(this)?""+r.XMLConstants.FILE_NAME_SIZE.toString():E.Translate(t):this._picStr=t,this._pic=new z(this._picStr,this.DataType,this.getForm().getTask().getCompIdx()),this._dataCtrl&&this._picStr.indexOf("H")>-1&&this._pic.setHebrew()},o.prototype.getPIC=function(){return this._pic},o.prototype.getParent=function(){var t=this.Form;return-1!==this._containerDitIdx?t=this.Form.getCtrl(this._containerDitIdx):this.Form.isSubForm()&&(t=this.Form.getSubFormCtrl()),t},o.prototype.getField=function(){return this._field},o.prototype.setField=function(t){null===t||t instanceof lt?this.setField_0(t):this.setField_1(t)},o.prototype.setField_0=function(t){this._field=t,null!==t&&this._field.SetControl(this)},o.prototype.setField_1=function(t){var r=this.getFieldByValueStr(t);if(null!==r)return this._field=r,void this._field.SetControl(this);throw new e.ApplicationException("in Control.setField(): illegal field identifier: "+t)},o.prototype.setPicStr=function(t,e){this._picStr=t,e>0&&(this._picExpExists=!0)},o.prototype.setRange=function(t){this._range=t,this._vd=null},o.prototype.setValExp=function(t){this._valExpId=t},o.prototype.buildCopyPicture=function(t,e){if(i.prototype.isTableControl.call(this)||i.prototype.isColumnControl.call(this))return null;var r=this.getCopyOfVD();return r.setValue(e),r.setOldValue(t),r},o.prototype.getCopyOfVD=function(){return null===this._vd?new Rt(this.Value,this.Value,this._range,this._pic,this):new Rt(this._vd)},o.prototype.getRanges=function(){return this._range},o.prototype.getRangedValue=function(t){var e;return(e=this.buildCopyPicture(this.Value,t)).evaluate(),e.getDispValue().toString()},o.prototype.validate=function(t){var e,r=this.ModifiedByUser;return this.ModifiedByUser=!0,(e=this.buildCopyPicture(this.Value,t)).evaluate(),this.ModifiedByUser=r,e.ValidationFailed?e.ErrorMessage:null},o.prototype.getFieldByValueStr=function(t){var r=new e.RefParam(this.parent),n=new e.RefParam(this.veeIndx),i=this.getForm().getTask().getFieldByValueStr(t,r,n);return this.parent=r.value,this.veeIndx=n.value,i},o.prototype.hasContainer=function(){return-1!==this._containerDitIdx},o.prototype.getLayer=function(){return this.Layer},o.prototype.computePIC=function(t){var e=null!==t&&i.prototype.isButton.call(this)?E.Translate(t):t;return null!==this._prevPicExpResult&&this._prevPicExpResult===e||(this._pic=new z(e,this.DataType,this.getForm().getTask().getCompIdx()),this._prevPicExpResult=e),this._pic},o.prototype.getCurrentIndexOfChoice=function(){var t=[-1],r=this.Value;if(!e.NString.IsNullOrEmpty(r)){var n=r.split(",");t=new Array(n.length);for(var i=0;i<n.length;i+=1){var o=e.NNumber.Parse(n[i]);t[i]=o>=0?o:-1}}return t},o.prototype.IsMultipleSelectionListBox=function(){return i.prototype.isListBox.call(this)},o.prototype.IsDateTimePicture=function(){return this._pic.getAttr()===r.StorageAttribute.DATE||this._pic.getAttr()===r.StorageAttribute.TIME},o.prototype.SupportsDataSource=function(){return i.prototype.isSelectionCtrl.call(this)||i.prototype.isTabControl.call(this)||i.prototype.isRadio.call(this)},o.prototype.getIndexOfChoice=function(t,e,n){return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:return i=this.IsMultipleSelectionListBox(),[4,this.computeChoice(e)];case 1:return a.sent(),o=null!==this.getField()&&this.getField().getType()===r.StorageAttribute.BLOB_VECTOR,[2,this.getDcVals().getIndexOf(t,o,n,this._choiceLinks.get_Item(e),this._choiceNums.get_Item(e),i)]}}))}))},o.prototype.getDispVals=function(t,e){var r=Object.create(null,{isTabControl:{get:function(){return i.prototype.isTabControl}}});return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return e?[4,this.computeChoice(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return r.isTabControl.call(this)?[2,this._orgChoiceDisps.get_Item(t)]:[2,this._choiceDisps.get_Item(t)]}}))}))},o.prototype.emptyChoice=function(t){var e=new Array(0);this._choiceDisps.set_Item(t,e),this._orgChoiceDisps.set_Item(t,e),this._choiceLinks.set_Item(t,e),this._choiceLayerList.set_Item(t,e)},o.prototype.computeChoice=function(n){var o=Object.create(null,{isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u,c,P,h,T,p,I,f,O,g,R,S,C,d,A,L,m,N,y,M,D,b,v,B,Y,U,G,k,V;return _(this,(function(_){switch(_.label){case 0:i=["\\\\","\\-","\\,"],a=["XX","XX","XX"],s=this.getForm().getTask(),l=s.DataView,u=l.getDcValues(this._dcValId),c=this.getDcRef(),P=null,h="",T=!0,p=-1,I=this.DataType,f=!1,_.label=1;case 1:return _.trys.push([1,9,,10]),null===this._choiceLinks.get_Item(n)||this.isDataCtrl()&&c!==this._dcValId?(I===r.StorageAttribute.BLOB_VECTOR&&(I=this.getField().getCellsType()),O=u.getDispVals(),[4,this.getProp(t.PropInterface.PROP_TYPE_DISPLAY_LIST)]):[3,8];case 2:return g=_.sent(),[4,this.getProp(t.PropInterface.PROP_TYPE_LABEL)];case 3:return R=_.sent(),null===g?[3,5]:[4,g.getValue()];case 4:P=_.sent(),_.label=5;case 5:return null===R?[3,7]:[4,R.getValue()];case 6:h=_.sent(),_.label=7;case 7:for(null!==h&&0!==r.StrUtil.rtrim(h).length||(h=""),null!==P&&0!==r.StrUtil.rtrim(P).length||(P=this.isDataCtrl()&&null!==O&&0!==O.length?h="":h,f=!0),P=E.Translate(P),I===r.StorageAttribute.NUMERIC&&(h=r.StrUtil.searchAndReplace(h,"\\-","-")),S=r.StrUtil.searchAndReplace(h,i,a),C=r.StrUtil.tokenize(S,","),d=""!==S?C.length:0,A=r.StrUtil.searchAndReplace(P,i,a),C=r.StrUtil.tokenize(A,","),L=""!==A?C.length:0,d!==L&&L>0&&(P=h,f=!0),m=d,N=new Array(m),this._choiceLinks.set_Item(n,N),I!==r.StorageAttribute.NUMERIC&&I!==r.StorageAttribute.DATE&&I!==r.StorageAttribute.TIME||this._choiceNums.set_Item(n,new Array(m)),y=r.ChoiceUtils.GetDisplayListFromString(P,!1,!0,!f),this._orgChoiceDisps.set_Item(n,y),M=r.ChoiceUtils.GetDisplayListFromString(P,o.isSelectionCtrl.call(this)||o.isTabControl.call(this),!0,!f),this._choiceDisps.set_Item(n,M),null!==this.getField()&&(p=this.getField().getSize()),D=null,b=null,v=void 0,B=0,Y=0,U=0;B<m&&T;B++)switch(U=Y,(U=S.indexOf(",",U))===Y?D=b="":-1===U?(D=h.substr(Y),b=S.substr(Y)):(D=h.substr(Y,U-Y),b=S.substr(Y,U-Y)),Y=U+1,I){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB_VECTOR:if(D=r.StrUtil.ltrim(D),(b=r.StrUtil.ltrim(b)).indexOf("\\")>=0){for(v=new e.StringBuilder,G=0;G<b.length;G++)"\\"!==b[G]?v.Append(D[G]):G===b.length-1&&v.Append(" ");D=v.ToString()}D=r.StrUtil.makePrintableTokens(D,r.SEQ_2_STR),(this.isSelectionCtrl()||this.isTabControl())&&(D=r.ChoiceUtils.RemoveAcclCharFromOptions(new e.StringBuilder(D))),r.UtilStrByteMode.isLocaleDefLangDBCS()&&I===r.StorageAttribute.ALPHA?-1!==p&&r.UtilStrByteMode.lenB(D)>p&&(D=r.UtilStrByteMode.leftB(D,p)):-1!==p&&D.length>p&&(D=D.substr(0,p)),N[B]=D;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:k=z.buildPicture(I,D,s.getCompIdx(),!1),T=this.optionIsValid(D),N[B]=$.Instance.disp2mg(D.trim(),h,k,s.getCompIdx(),K.CONTENT_TYPE_UNKNOWN),this._choiceNums.get_Item(n)[B]=new Z(N[B]);break;case r.StorageAttribute.BOOLEAN:N[B]=(1-B).toString()}T||this.emptyChoice(n),_.label=8;case 8:return[3,10];case 9:if(!((V=_.sent())instanceof e.Exception))throw V;return T=!1,this.emptyChoice(n),E.WriteExceptionToLog(e.NString.Format("{0} : {1}",V.GetType(),V.Message)),[3,10];case 10:return this._hasValidItmAndDispVal=T,[2]}}))}))},o.prototype.getTopMostForm=function(){return this.getForm().getTopMostForm()},o.prototype.setUrl=function(){F.addValueWithLine(t.CommandType.SET_VALUE,this,0,this.Value)},o.prototype.getMgValue=function(t){var r=Object.create(null,{isCheckBox:{get:function(){return i.prototype.isCheckBox}},isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isRadio:{get:function(){return i.prototype.isRadio}}});return s(this,void 0,void 0,(function(){var n,i,o,a;return _(this,(function(s){switch(s.label){case 0:return n=null,r.isCheckBox.call(this)?(n=t?"1":"0",[3,6]):[3,1];case 1:return r.isSelectionCtrl.call(this)||r.isTabControl.call(this)||r.isRadio.call(this)?((i=this.getDisplayLine(!0))<0&&(i=0),"number"==typeof t&&(t=t.toString()),Array.isArray(t)&&(t=t.join(",").toString()),""!==t?[3,2]:(n=t,[3,4])):[3,5];case 2:return[4,this.getLinkValue(t,i)];case 3:n=s.sent(),s.label=4;case 4:return null===n&&(!1,o=new e.RefParam(n),new e.RefParam(false),null!==this._field&&(n=o.value)),[3,6];case 5:a=null!==this._field?this._field.getContentType():K.CONTENT_TYPE_UNKNOWN,n=$.Instance.disp2mg(t,this._range,this._pic,this.getForm().getTask().getCompIdx(),a),s.label=6;case 6:return[2,n]}}))}))},o.prototype.getLinkValue=function(t,n){return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,c,P,h,T,E;return _(this,(function(_){switch(_.label){case 0:return i=0,o=e.NString.Empty,a=new e.List,[4,this.computeChoice(n)];case 1:for(_.sent(),null!==(s=this._choiceLinks.get_Item(n))&&(i=s.length),l=this.getLinkIdxFromLayer(r.Misc.GetIntArray(t)),u=l,c=0;c<u.length;c+=1)(P=u[c])>=i?(h=this.getDcVals(),a.push(h.getLinkValue(P-i))):P>=0&&P<s.length?a.push(s[P]):a.push(null);if(this.DataType===r.StorageAttribute.BLOB_VECTOR){for(T=new at(this.getField()),E=0;E<a.length;E+=1)T.setVecCell(E+1,a.get_Item(E),null===a.get_Item(E));o=T.toString()}else o=a.length>1?a.join(","):a.get_Item(0);return[2,o]}}))}))},o.prototype.setText=function(){var e=this.getDisplayLine(!0),r=this.Value;i.prototype.isButton.call(this)&&(r=E.Translate(this.Value)),this.isTextControl()||this.isButton()?F.addValueWithLine(t.CommandType.SET_VALUE,this,e,r):F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.Text,r)},o.prototype.setRadioChecked=function(e){F.addValueWithLine(t.CommandType.SET_VALUE,this,this.getDisplayLine(!1),e),F.beginInvoke(),e!==W.DEFAULT_VALUE_INT&&this.setControlToFocus()},o.prototype.setControlToFocus=function(){null!==this.getField()&&(this.getField().ControlToFocus=this)},o.prototype.setCheckBoxValue=function(e,r){var n=$.toBoolean(r);F.addValueWithLine(t.CommandType.SET_VALUE,this,e,n)},o.prototype.refreshAndSetItemListByDataSource=function(t,e){return s(this,void 0,void 0,(function(){var r;return _(this,(function(n){switch(n.label){case 0:return this.SupportsDataSource()?(r=this.getDcRef(),this._rangeChanged&&(e=!0),this._rangeChanged=!1,this.isDataCtrl()&&r!==this._dcValId?(e=!0,[4,this.refreshAndSetItemsList(t,!0)]):[3,2]):[3,2];case 1:n.sent(),this.setDcRef(this._dcValId),n.label=2;case 2:return[2,e]}}))}))},o.prototype.setDcRef=function(t){this._dcTableRefs.set_Item(this.getDcLineNum(),t)},o.prototype.setImageList=function(t){},o.prototype.updatePropertyLogicNesting=function(e,r,n,i){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return i&&F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),r===t.CommandType.PROP_SET_VISIBLE?t.HtmlProperties.Visible:t.HtmlProperties.Enabled,n),[4,this.updateChildrenPropValue(e,r,n)];case 1:return o.sent(),[2]}}))}))},o.prototype.SetEnabled=function(e){F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.Enabled,e)},o.prototype.updateChildrenPropValue=function(e,r,n){var o=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isSubform:{get:function(){return i.prototype.isSubform}}});return s(this,void 0,void 0,(function(){var i,a,s,l;return _(this,(function(_){switch(_.label){case 0:if(o.isTableControl.call(this))return[3,6];i=0,_.label=1;case 1:return i<this._linkedControls.length?(a=this._linkedControls.get_Item(i)).IsFirstRefreshOfProps()?[3,3]:(s=(s=a.GetComputedBooleanProperty(e,!0))&&n,l=this.isChildOnCurrentLayer(a),r!==t.CommandType.PROP_SET_VISIBLE?[3,3]:(s&&(s=l),[4,a.updateChildrenPropValue(e,r,s)])):[3,4];case 2:_.sent(),_.label=3;case 3:return i+=1,[3,1];case 4:return o.isSubform.call(this)?[4,this.updateSubformChildrenPropValue(e,r,n)]:[3,6];case 5:_.sent(),_.label=6;case 6:return[2]}}))}))},o.prototype.isDescendentOfControl=function(t){var e=!1;if(null!==t){var n=this.getParent();if(n instanceof o)if(n===t)e=!0;else{var i=n instanceof o?n:null;e=t.Type===r.MgControlType.CTRL_TYPE_COLUMN&&null!==i&&i.Type===r.MgControlType.CTRL_TYPE_TABLE&&t.Layer===this.Layer||n.isDescendentOfControl(t)}}return e},o.prototype.updateSubformChildrenPropValue=function(t,e,r){},o.prototype.isChildOnCurrentLayer=function(t){var e=!0;if(i.prototype.isChoiceControl.call(this)){var r=0;null!==this.Value&&(r=this.getCurrentLinkIdx()+1);var n=t.getLayer();r!==n&&n>0&&(e=!1)}return e},o.prototype.getCurrentLinkIdx=function(){var t=0;if(i.prototype.isChoiceControl.call(this)){var e=this.getCurrentIndexOfChoice();t=this.getLinkIdxFromLayer(e)[0]}return t},o.prototype.getLayerFromLinkIdx=function(t){for(var e=new Array(t.length),r=0;r<t.length;r+=1){var n=t[r];if(e[r]=n,i.prototype.isTabControl.call(this)&&n>=0){var o=this.getDisplayLine(!1);o<0&&(o=0);var a=this._choiceLayerList.get_Item(o);null!==a&&a.length>0&&(e[r]=a.indexOf((n+1).toString()))}}return e},o.prototype.getLinkIdxFromLayer=function(t){for(var r=new Array(t.length),n=0;n<t.length;n+=1){var o=t[n];if(r[n]=o,i.prototype.isTabControl.call(this))if(o<0)r[n]=0;else{var a=this.getDisplayLine(!1);a<0&&(a=0);var s=this._choiceLayerList.get_Item(a);null!=s&&0!==s.length&&o<s.length&&(r[n]=e.NNumber.Parse(s[o])-1)}}return r},o.prototype.isParentPropValue=function(t){var e=this.Form.getControlColumn(this),r=this.getLinkedParent(!0);return null===r||!!r.GetComputedBooleanProperty(t,!0)&&(!!r.isChildOnCurrentLayer(this)&&(!(null!==e&&!e.GetComputedBooleanProperty(t,!0))&&r.isParentPropValue(t)))},o.prototype.getLinkedParent=function(t){return-1!==this._linkedParentDitIdx?this.Form.getCtrl(this._linkedParentDitIdx):t&&this.Form.isSubForm()?this.Form.getSubFormCtrl():null},o.prototype.SetCurrReadOnly=function(t){this._currReadOnly.set_Item(this.getDisplayLine(!0),t)},o.prototype.GetCurrReadOnly=function(){var t,e=i.prototype.isTableControl.call(this)?0:this.getDisplayLine(!0),r=this._currReadOnly.get_Item(e);return null===r?(t=!1,this._currReadOnly.set_Item(e,t)):t=r,t},o.prototype.isDataCtrl=function(){return this._dataCtrl},o.prototype.getDcRef=function(){var t,e=this.getDcLineNum(),r=this._dcTableRefs.get_Item(this.getDcLineNum());return null===r?(t=-2,this._dcTableRefs.set_Item(e,t)):t=r,t},o.prototype.getDcLineNum=function(){return this.IsRepeatable?this.Form.DisplayLine:0},o.prototype.optionIsValid=function(t){var e=!0;if(this.DataType===r.StorageAttribute.NUMERIC&&t.length>0&&-1===t.indexOf("0")){var n=new Z;n.num_4_a_std(t),n.num_is_zero()&&(e=!1)}return e},o.prototype.getOrderedDispList=function(n,i){return s(this,void 0,void 0,(function(){var o,a,s,l,u,c,P,h,T,E,p,I;return _(this,(function(_){switch(_.label){case 0:return o="",a=new e.List,s=new e.List,[4,this.getProp(t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST)];case 1:return null===(l=_.sent())?[3,3]:[4,l.getValue()];case 2:o=_.sent(),_.label=3;case 3:if(null!==o&&0!==r.StrUtil.rtrim(o).length||(o=""),o.length>0&&n.length>0)for(u=o.split(","),c=-1,P=0;P<u.length;P+=1)h=u[P].trim(),-1===s.indexOf(h)&&(T=new e.RefParam(c),E=e.NNumber.TryParse(h,T),c=T.value,E&&c>0&&c<=n.length&&(a.push(n[c-1].trim()),s.push(h)));if(0===a.length)p=n,this._choiceLayerList.set_Item(i,new Array(0));else{for(p=new Array(a.length),I=0;I<p.length;++I)p[I]=null;p=a.ToArray(),this._choiceLayerList.set_Item(i,s.ToArray())}return[2,p]}}))}))},o.prototype.resetPrevVal=function(){var t=this.getDisplayLine(!0);t<0&&(t=0),this._prevValues.set_Item(t,null),this.setPrevIsNull_ToNull()},o.prototype.setPrevIsNull_ToNull=function(){this._prevIsNulls.set_Item(this.getDisplayLine(!0),null)},o.prototype.expressionSetAsData=function(){return this._valExpId>0},o.prototype.clearRange=function(t){this._orgChoiceDisps.set_Item(t,null),this._choiceDisps.set_Item(t,null),this._choiceLinks.set_Item(t,null),this._choiceLayerList.set_Item(t,null)},o.prototype.haveToCheckParentValue=function(){var t=!1;return-1!==this._linkedParentDitIdx?this.isContainedInLinkedParent()?(this.Form.getCtrl(this._linkedParentDitIdx).isTabControl()||this.Form.getCtrl(this._linkedParentDitIdx).isGroup())&&(t=!0):t=!0:this.Form.isSubForm()&&(t=!0),t},o.prototype.isContainedInLinkedParent=function(){return-1!==this._containerDitIdx&&this._containerDitIdx===this._linkedParentDitIdx},o.combineStringArrays=function(t,e){var r=new Array;return null!==t&&(r=r.concat(t)),null!==e&&(r=r.concat(e)),r},o.prototype.GetComputedBooleanProperty=function(t,e,r){return 2!==arguments.length||null!==t&&t.constructor!==Number||null!==e&&e.constructor!==Boolean?this.GetComputedBooleanProperty_1(t,e,r):this.GetComputedBooleanProperty_0(t,e)},o.prototype.GetComputedBooleanProperty_0=function(t,e){var r=e,n=this.GetComputedProperty(t);return null!==n&&(r=n.GetComputedValueBoolean()),r},o.prototype.GetComputedBooleanProperty_1=function(t,e,r){var n=e;if(this.isPropertyRepeatable(t)&&this.Form.DisplayLine!==r){var i=this.GetComputedProperty(t);if(null!==i){var o=i.getPrevValue(r);null!==o&&(n=$.toBoolean(o))}}else n=this.GetComputedBooleanProperty(t,e);return n},o.prototype.checkPropWithLine=function(t,e,r){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return n=e,this.isPropertyRepeatable(t)&&this.Form.DisplayLine!==r?[4,this.getProp(t)]:[3,2];case 1:return null!==(i=a.sent())&&null!==(o=i.getPrevValue(r))&&(n=$.toBoolean(o)),[3,4];case 2:return[4,this.checkProp(t,e)];case 3:n=a.sent(),a.label=4;case 4:return[2,n]}}))}))},o.prototype.checkProp=function(t,e){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return r=e,[4,this.getProp(t)];case 1:return null===(n=i.sent())?[3,3]:[4,n.getValueBoolean()];case 2:r=i.sent(),i.label=3;case 3:return[2,r]}}))}))},o.prototype.isPropertyRepeatable=function(t){return!!this.IsRepeatable||i.prototype.isTableControl.call(this)&&pt.isRepeatableInTable(t)},o.prototype.SetAndRefreshDisplayValue=function(t,n){var o=Object.create(null,{isChoiceControl:{get:function(){return i.prototype.isChoiceControl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isCheckBox:{get:function(){return i.prototype.isCheckBox}},isImageControl:{get:function(){return i.prototype.isImageControl}},IsImageButton:{get:function(){return i.prototype.IsImageButton}},isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u;return _(this,(function(_){switch(_.label){case 0:return i=!0,null!==t?[3,1]:(this.Value="",n||(t=_t.getMagicDefaultValue(this.DataType)),[3,6]);case 1:return o.isChoiceControl.call(this)?((a=this.getDisplayLine(!0))<0&&(a=0),l=this.getLayerFromLinkIdx,[4,this.getIndexOfChoice(t,a,n)]):[3,6];case 2:return(s=l.apply(this,[_.sent()]))[0]<0&&o.isTabControl.call(this)?(s[0]=0,[4,this.getLinkValue(s[0].toString(),a)]):[3,5];case 3:return t=_.sent(),n=!1,null===this._field||null===t?[3,5]:[4,this._field.getTask().UpdateFieldValueAndStartRecompute(this._field,t,n)];case 4:_.sent(),_.label=5;case 5:this.Value=r.Misc.GetCommaSeperatedString(s),i=!1,_.label=6;case 6:if(i)if(o.isCheckBox.call(this)||null!==this._field&&n&&this._field.hasNullDisplayValue())this.isCheckBox()?this.Value=$.toBoolean(t):this.Value=t;else try{o.isImageControl.call(this)&&this.DataType===r.StorageAttribute.BLOB||o.IsImageButton.call(this)?this.Value=t:null!==this._field||!n||this.DataType!==r.StorageAttribute.NUMERIC&&this.DataType!==r.StorageAttribute.DATE&&this.DataType!==r.StorageAttribute.TIME&&this.DataType!==r.StorageAttribute.BOOLEAN?(u=this.InControl,this.Value=$.Instance.mg2disp(t,this._range,this._pic,!0,o.isSelectionCtrl.call(this),this.getForm().getTask().getCompIdx(),u)):this.Value=t,"string"!=typeof this.Value||this._pic.isAttrNumeric()&&!this._pic.isLeft()||this.rtrimValue()}catch(r){if(!(r instanceof e.ApplicationException))throw r;E.WriteExceptionToLog(new e.ApplicationException(e.NString.Format("Control: '{0}', mgval: {1}",this.Name,t),r)),this.Value="",t=_t.getMagicDefaultValue(this.DataType)}return(o.isImageControl.call(this)&&this.DataType!==r.StorageAttribute.BLOB||o.IsImageButton.call(this))&&(t=E.TranslateLogicalName(t)),this.IsNull=n,[4,this.RefreshDisplayValue(t)];case 7:return _.sent(),[2]}}))}))},o.prototype.UpdateModifiedByUser=function(t){if(!i.prototype.isButton.call(this)&&!i.prototype.isImageControl.call(this)){var e=this.IsNull,r=this.isDifferentValue(t,!1,!1);r||this.CanGetNullFromControlValue()&&(r=e!==this.isNullValue(t)),(r||this.KeyStrokeOn)&&(this.ModifiedByUser=!0)}},o.prototype.rtrimValue=function(){if(i.prototype.isImageControl.call(this)&&this.DataType===r.StorageAttribute.BLOB||i.prototype.IsImageButton.call(this))this.Value=e.NString.TrimEnd(this.Value);else{var t=this.getMinimumValueLength();if(this.Value.length>t){var n=this.Value.substr(t);this.Value=this.Value.substr(0,t),this.Value=this.Value+r.StrUtil.rtrimWithNull(n,!0)}i.prototype.isTextControl.call(this)&&this.DataType===r.StorageAttribute.NUMERIC&&(this.Value=e.NString.TrimEnd(this.Value))}},o.prototype.getMinimumValueLength=function(){for(var t=this._pic.getMaskLength();t>0&&!this._pic.picIsMask(t-1);)t-=1;return t},o.prototype.isNullValue=function(t){var e=!1;return this.CanGetNullFromControlValue()&&""===t&&(e=!0),e},o.prototype.CanGetNullFromControlValue=function(){return!1},o.prototype.isChoiceNull=function(t){return t>=0?this.getDcVals().isNull(t):void 0},o.prototype.setProp=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return null===this._propTab&&(this._propTab=new ft(this)),[4,this._propTab.setProp(t,e,this,W.PARENT_TYPE_CONTROL)];case 1:return r.sent(),[2]}}))}))},o.prototype.ComputeAndRefreshDisplayValue=function(t){var n=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isColumnControl:{get:function(){return i.prototype.isColumnControl}}});return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,c;return _(this,(function(_){switch(_.label){case 0:return t&&this.resetPrevVal(),this._valExpId>0?(i=void 0,o=new e.RefParam(i),[4,this.EvaluateExpression(this._valExpId,this.DataType,this._pic.getSize(),!0,r.StorageAttribute.SKIP,!1,o)]):[3,4];case 1:return a=_.sent(),(i=o.value)?[4,this.SetAndRefreshDisplayValue(a,null===a)]:[3,3];case 2:_.sent(),_.label=3;case 3:return[3,9];case 4:return null===this._field?[3,7]:(s=e.NString.Empty,l=!1,u=new e.RefParam(s),c=new e.RefParam(l),[4,this._field.getTask().getFieldDisplayValue(this._field,u,c)]);case 5:return _.sent(),s=u.value,l=c.value,[4,this.SetAndRefreshDisplayValue(s,l)];case 6:return _.sent(),[3,9];case 7:return n.isTableControl.call(this)||n.isColumnControl.call(this)?[3,9]:[4,this.RefreshDisplayValue(this.Value)];case 8:_.sent(),_.label=9;case 9:return[2]}}))}))},o.prototype.ShouldRefreshOnControlEnter=function(){return this.Type===r.MgControlType.CTRL_TYPE_TEXT&&null!==this.getField()&&(this.getField().getType()===r.StorageAttribute.DATE||this.getField().getType()===r.StorageAttribute.TIME||this.getField().getType()===r.StorageAttribute.NUMERIC)},o.prototype.RefreshDisplayValue=function(n){var o=Object.create(null,{isChoiceControl:{get:function(){return i.prototype.isChoiceControl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u,c,P,h,T,p,I,f,O;return _(this,(function(_){switch(_.label){case 0:i=this.getDisplayLine(!0),s=a=!0,i<0&&(i=0),_.label=1;case 1:switch(_.trys.push([1,26,,27]),l=this._prevValues.get_Item(i),u=this.getPrevIsNull(),r.StorageAttributeCheck.IsTypeAlphaOrUnicode(this.DataType)?((r.StrUtil.rtrim(n)===r.StrUtil.rtrim(l)||null!==n&&r.StrUtil.rtrim(n)===r.StrUtil.rtrim(l))&&(a=!1),u!==this.IsNull&&(a=!0)):((n===l||null!==n&&n===l)&&(a=!1),u!==this.IsNull&&(a=!0)),this._prevValues.set_Item(i,n),this.setPrevIsNull(this.IsNull),this.Type){case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_COLUMN:case r.MgControlType.CTRL_TYPE_LABEL:case r.MgControlType.CTRL_TYPE_SUBFORM:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_STATUS_BAR:case r.MgControlType.CTRL_TYPE_FRAME_SET:case r.MgControlType.CTRL_TYPE_CONTAINER:case r.MgControlType.CTRL_TYPE_FRAME_FORM:case r.MgControlType.CTRL_TYPE_SB_LABEL:case r.MgControlType.CTRL_TYPE_LINE:return[3,2];case r.MgControlType.CTRL_TYPE_BROWSER:return[3,3];case r.MgControlType.CTRL_TYPE_IMAGE:case r.MgControlType.CTRL_TYPE_SB_IMAGE:return[3,4];case r.MgControlType.CTRL_TYPE_CHECKBOX:return[3,7];case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:return[3,8];case r.MgControlType.CTRL_TYPE_BUTTON:case r.MgControlType.CTRL_TYPE_TEXT:return[3,13];case r.MgControlType.CTRL_TYPE_RADIO:return[3,19]}return[3,21];case 2:return[2];case 3:return a&&null!=this.Value&&this.setUrl(),[2];case 4:return a&&null!=this.Value?[4,this.setImage()]:[3,6];case 5:_.sent(),_.label=6;case 6:return[2];case 7:return(a||this.forceRefresh)&&this.setCheckBoxValue(i,n),[2];case 8:return s=a,[4,this.refreshAndSetItemListByDataSource(i,a)];case 9:return(a=_.sent())?(c=null,s!==a||null===l?[3,11]:(P=this.getLayerFromLinkIdx,[4,this.getIndexOfChoice(l,i,u)])):[3,12];case 10:for(c=P.apply(this,[_.sent()]),h=0;h<c.length;h+=1)c[h]===W.DEFAULT_VALUE_INT&&(c[h]=W.DEFAULT_LIST_VALUE);_.label=11;case 11:T=r.Misc.GetIntArray(this.Value),this.isTabControl()&&(p=this.getCurrentLinkIdx(),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,i,t.HtmlProperties.SelectedValue,T[0].toString()),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,i,t.HtmlProperties.SelectedLayer,p.toString())),this.IsMultipleSelectionListBox()?F.addValueWithLine(t.CommandType.SET_VALUE,this,i,T):F.addValueWithLine(t.CommandType.SET_VALUE,this,i,+this.Value),_.label=12;case 12:return[3,22];case 13:return a?this.IsImageButton()?[4,this.setImageWithFileName(this.Value)]:[3,15]:[3,17];case 14:return _.sent(),[3,16];case 15:this.setText(),_.label=16;case 16:return[3,18];case 17:return[2];case 18:return[3,22];case 19:return[4,this.refreshAndSetItemListByDataSource(i,a)];case 20:return(a=_.sent())?(this.setRadioChecked(this.Value),[3,22]):[2];case 21:return E.WriteExceptionToLog(e.NString.Format("in Control.RefreshDisplayValue() unknown type: {0}",this.Type)),[2];case 22:return o.isChoiceControl.call(this)&&a?(I=this.updatePropertyLogicNesting,f=[t.PropInterface.PROP_TYPE_VISIBLE,t.CommandType.PROP_SET_VISIBLE],[4,this.checkProp(t.PropInterface.PROP_TYPE_VISIBLE,!0)]):[3,25];case 23:return[4,I.apply(this,f.concat([_.sent(),!1]))];case 24:_.sent(),_.label=25;case 25:return[3,27];case 26:if(!((O=_.sent())instanceof e.Exception))throw O;return E.WriteExceptionToLog(e.NString.Format("in Control.RefreshDisplayValue() for control: {0}",this.Name)),[3,27];case 27:return[2]}}))}))},o.prototype.RefreshDisplay=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return n.isNullOrUndefined(t)&&(t=!1),[4,this.RefreshDisplay_1(t)];case 1:return e.sent(),[2]}}))}))},o.prototype.RefreshDisplay_1=function(e){var r=Object.create(null,{isSubform:{get:function(){return i.prototype.isSubform}}});return s(this,void 0,void 0,(function(){var n,i,o,a,s;return _(this,(function(_){switch(_.label){case 0:return r.isSubform.call(this)&&null!==this.GetSubformMgForm()&&this.GetSubformMgForm().inRefreshDisplay()?[3,11]:[4,this.refreshProperties(e)];case 1:return _.sent(),this.ShouldComputeAndRefreshOnClosedForm()?[4,this.ComputeAndRefreshDisplayValue(!1)]:[3,3];case 2:_.sent(),_.label=3;case 3:return[4,this.isParkable(!1)];case 4:return(i=!_.sent())?[3,6]:[4,this.isModifiable()];case 5:i=!_.sent(),_.label=6;case 6:return n=i,this.GetCurrReadOnly()===n?[3,8]:(this.SetCurrReadOnly(n),[4,X.SetReadOnlyControl(this,n)]);case 7:_.sent(),_.label=8;case 8:return null!=(o=this.GetComputedProperty(t.PropInterface.PROP_TYPE_MUST_INPUT))&&o.isExpression()?(a=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MUST_INPUT,!1),s=a,[4,this.checkProp(t.PropInterface.PROP_TYPE_MUST_INPUT,!1)]):[3,10];case 9:s!==_.sent()&&F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.MustInput,!a),_.label=10;case 10:this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_TAB_IN,!0)||F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.TabIndex,-1),_.label=11;case 11:return[2]}}))}))},o.prototype.ShouldComputeAndRefreshOnClosedForm=function(){return!0},o.prototype.refreshProperties=function(n){return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:if(null!==this._field&&this.DataType!==r.StorageAttribute.NONE&&this._firstRefreshProperties&&F.addWithNumber(t.CommandType.SET_ATTRIBUTE,this,this.DataType.charCodeAt(0)),null===this._propTab)return[3,6];a.label=1;case 1:return a.trys.push([1,5,,6]),this._firstRefreshProperties?[4,this.createDefaultProps()]:[3,3];case 2:a.sent(),a.label=3;case 3:return[4,this._propTab.RefreshDisplay(!1,n)];case 4:return a.sent()||E.WriteExceptionToLog(e.NString.Format("Control '{0}': Not all properties could be set",this.getName())),this._firstRefreshProperties&&(n||(this._firstRefreshProperties=!1)),[3,6];case 5:if(!((i=a.sent())instanceof e.Exception))throw i;return o=new e.StringBuilder(e.NString.Format("Control '{0}': {1}",this.getName(),i.Message)),E.WriteExceptionToLog(o.ToString()),[3,6];case 6:return[2]}}))}))},o.prototype.refreshTabForLayerList=function(t){return s(this,void 0,void 0,(function(){var e,r,n;return _(this,(function(i){switch(i.label){case 0:return e=null,this.getForm().Opened?(r=this.getCurrentIndexOfChoice(),n=r[0],[4,this.getLinkValue(n.toString(),t)]):[3,2];case 1:e=i.sent(),i.label=2;case 2:return[4,this.refreshAndSetItemsList(t,!1)];case 3:return i.sent(),this.getForm().Opened?[4,this.SetAndRefreshDisplayValue(e,this.IsNull)]:[3,5];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},o.prototype.refreshAndSetItemsListForRadioButton=function(e,r){return s(this,void 0,void 0,(function(){var n,i;return _(this,(function(o){switch(o.label){case 0:return[4,this.refreshDispRange(r)];case 1:return n=o.sent(),i=n.map((function(t,e,r){return{index:e.toString(),displayValue:t}})),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.ItemsList,i),[2]}}))}))},o.prototype.refreshAndSetItemsList=function(e,r){var n=Object.create(null,{isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isRadio:{get:function(){return i.prototype.isRadio}}});return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:return r&&this.clearRange(e),[4,this.refreshDispRange(r)];case 1:return i=a.sent(),n.isSelectionCtrl.call(this)||n.isTabControl.call(this)?(o=i.map((function(t,e,r){return{index:e,displayValue:t}})),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.ItemsList,o),[3,4]):[3,2];case 2:return n.isRadio.call(this)?[4,this.refreshAndSetItemsListForRadioButton(e,r)]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))},o.prototype.refreshDispRange=function(t){return s(this,void 0,void 0,(function(){var e,r,n,i,a;return _(this,(function(s){switch(s.label){case 0:return e=new Array(0),(r=this.getDisplayLine(!0))<0&&(r=0),this.SupportsDataSource()?(n=this.getForm().getTask().DataView,i=n.getDcValues(this._dcValId),[4,this.getDispVals(r,t)]):[3,2];case 1:return a=s.sent(),this._hasValidItmAndDispVal&&(e=o.combineStringArrays(a,i.getDispVals())),[3,4];case 2:return[4,this.getDispVals(r,t)];case 3:e=s.sent(),s.label=4;case 4:return this._rangeChanged=!0,[4,this.getOrderedDispList(e,r)];case 5:return[2,s.sent()]}}))}))},o.prototype.refreshItmRange=function(t){return s(this,void 0,void 0,(function(){var r,n,i,a,s;return _(this,(function(_){switch(_.label){case 0:return e.Debug.Assert(this.SupportsDataSource()),r=new Array(0),(n=this.getDisplayLine(!1))<0&&(n=0),t?[4,this.computeChoice(n)]:[3,2];case 1:_.sent(),_.label=2;case 2:return i=this._choiceLinks.get_Item(n),a=this.getForm().getTask().DataView,s=a.getDcValues(this._dcValId),this._hasValidItmAndDispVal&&(r=o.combineStringArrays(i,s.GetLinkVals())),[4,this.getOrderedDispList(r,n)];case 3:return[2,_.sent()]}}))}))},o.prototype.GetItemsRange=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.refreshItmRange(!1)];case 1:return[2,t.sent()]}}))}))},o.prototype.GetDisplayRange=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.refreshDispRange(!1)];case 1:return[2,t.sent()]}}))}))},o.prototype.createDefaultProps=function(){var e=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}}});return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.getProp(t.PropInterface.PROP_TYPE_VISIBLE)];case 1:return r.sent(),[4,this.getProp(t.PropInterface.PROP_TYPE_ENABLED)];case 2:return r.sent(),e.isTableControl.call(this)?[4,this.getProp(t.PropInterface.PROP_TYPE_SCROLL_BAR)]:[3,4];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))},o.prototype.setLinkedParentIdx=function(t){this._linkedParentDitIdx=t},o.prototype.buildPicture=function(t,e){return i.prototype.isTableControl.call(this)||i.prototype.isColumnControl.call(this)?null:(this._picExpExists&&(this._vd=null),null===this._vd?this._vd=new Rt(t,e,this._range,this._pic,this):(this._vd.setValue(e),this._vd.setOldValue(t)),this._vd)},o.prototype.isDifferentValue=function(t,e,n){var i=this.Value,o=!1;if(t instanceof Date&&(o=this.DataType===r.StorageAttribute.DATE?!this.CompareDate(t,i):!this.CompareTime(t,i)),"boolean"==typeof t||"number"==typeof t)o=this.isSelectionCtrl()&&"string"==typeof i?t.toString()!==i:t!==i;else if(this.isSelectionCtrl()&&"string"==typeof i&&Array.isArray(t)){var a=t.join(",").toString();o=!(r.StrUtil.rtrim(a)===r.StrUtil.rtrim(i))}else{var s=this.IsNull;!(o=!(r.StrUtil.rtrim(t)===r.StrUtil.rtrim(i)))&&n&&(o=e!==s)}return o},o.prototype.CompareDate=function(t,e){var r;return null===t&&null===e?r=!0:null===t&&null!==e||null!==t&&null===e?r=!1:t.getFullYear()===e.getFullYear()&&t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&(r=!0),r},o.prototype.CompareTime=function(t,e){var r;return null===t&&null===e?r=!0:null===t&&null!==e||null!==t&&null===e?r=!1:t.getHours()===e.getHours()&&t.getMinutes()===e.getMinutes()&&t.getSeconds()===e.getSeconds()&&(r=!0),r},o.prototype.isColumnSortable=function(){var e=!1;return this.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._propTab.propExists(t.PropInterface.PROP_TYPE_SORT_COLUMN)&&(e=this.GetComputedProperty(t.PropInterface.PROP_TYPE_SORT_COLUMN).GetComputedValueBoolean()),e},o.prototype.getColumnChildControl=function(){var t=this;return this.Type!==r.MgControlType.CTRL_TYPE_COLUMN?null:this._parentTable.getLinkedControls().find((function(e){return e.getLayer()===t.getLayer()&&e.Type!==r.MgControlType.CTRL_TYPE_COLUMN&&!e.IsTableHeaderChild}))},o.prototype.getControlNameForHandlerSearch=function(){var t=this.getColumnChildControl();return null!==t?t.Name:this.Name},o.prototype.linkCtrl=function(t){this._linkedControls.push(t)},o.prototype.removeRefFromField=function(){null!==this._field&&this._field.RemoveControl(this)},o.prototype.getDitIdx=function(){return this._ditIdx},o.prototype.setDcValId=function(t){this._dcValId=t},o.prototype.SetKeyboardLanguage=function(t){F.beginInvoke()},o.prototype.Init=function(){},o.prototype.IsParkable=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.isParkable(!0)];case 1:return[2,t.sent()]}}))}))},o.prototype.HasExpOrParentTaskField=function(){var t=this.getForm().getTask();return null===this.getField()||this.getField().getTask()!==t},o.prototype.isParkable=function(e){var r=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isColumnControl:{get:function(){return i.prototype.isColumnControl}},isSubform:{get:function(){return i.prototype.isSubform}},isBrowserControl:{get:function(){return i.prototype.isBrowserControl}}});return s(this,void 0,void 0,(function(){var n,i;return _(this,(function(o){return n=!r.isTableControl.call(this)&&!r.isColumnControl.call(this),i=this.getForm().getTask(),n&&(n=i.IsInteractive),n&&i.DataView.isEmptyDataview()&&null!==this._field&&this._field.PartOfDataview&&(n=!1),n&&(r.isSubform.call(this)||(n=null!==this._field&&this._field.getTask()===i||this.isButton()||r.isBrowserControl.call(this)),n&&e&&(n=this.isEnabled()&&this.isVisible()),n&&null!==this._parentTable&&e&&(n=this._parentTable.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0)&&this._parentTable.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_VISIBLE,!0))),[2,n]}))}))},o.prototype.refreshDefaultButton=function(){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,this.Form.getProp(t.PropInterface.PROP_TYPE_DEFAULT_BUTTON)];case 1:return[4,e.sent().RefreshDisplay(!0)];case 2:return e.sent(),[2]}}))}))},o.prototype.RaiseControlHitOnLeftClickOfMouseDown=function(){var t=!1;return i.prototype.IsHyperTextButton.call(this)||i.prototype.isRadio.call(this)||i.prototype.isTabControl.call(this)||(t=!0),t},o.prototype.GetVarIndex=function(){return 0},o.prototype.RaiseControlHitOnMouseDown=function(t){var e=!1;return t&&this.RaiseControlHitOnLeftClickOfMouseDown()&&(e=!0),e},o.prototype.OnSubformClick=function(){X.EventsManager.addGuiTriggeredEventWithTaskAndCode(this.getForm().getTask(),r.InternalInterface.MG_ACT_HIT)},o.prototype.GetSubformMgForm=function(){return null},o.prototype.PropertyExists=function(t){return this._propTab.propExists(t)},o.prototype.toString=function(){return"{"+this.constructor.name+": "+r.MgControlType[this.Type]+"}"},o.prototype.isDateZero=function(t){var e=!1;return t instanceof Date&&0===t.getMonth()&&0===t.getFullYear()&&0===t.getDay()&&(e=!0),e},o.prototype.IsDefaultRouterOutlet=function(){return this.Type===r.MgControlType.CTRL_TYPE_SUBFORM&&this.GetComputedBooleanProperty_0(t.PropInterface.PROP_TYPE_DEFAULT_OUTLET,!1)},o.prototype.IsRouterOutlet=function(){return this.Type===r.MgControlType.CTRL_TYPE_SUBFORM&&this.GetComputedBooleanProperty_0(t.PropInterface.PROP_TYPE_IS_ROUTER_OUTLET,!1)},o}(Pt),mt=function(){function t(){this._controls=null,this._mgForm=null,this._controls=new e.List}return t.prototype.fillData=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:this._mgForm=t,r.label=1;case 1:return[4,this.initInnerObjects(e.getNextTag(),e)];case 2:return r.sent()?[3,1]:[3,3];case 3:return[2]}}))}))},t.prototype.initInnerObjects=function(t,e){return s(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return null===t?[2,!1]:t!==r.XMLConstants.MG_TAG_CONTROL?[3,2]:[4,(n=this._mgForm.ConstructMgControl()).fillData(this._mgForm,this._controls.length,e)];case 1:return i.sent(),this._controls.push(n),[3,3];case 2:return t==="/"+r.XMLConstants.MG_TAG_CONTROL?(e.setCurrIndex2EndOfTag(),[2,!1]):[2,!1];case 3:return[2,!0]}}))}))},t.prototype.getSize=function(){return this._controls.length},t.prototype.getCtrl=function(t){return 1!==arguments.length||null!=t&&t.constructor!==Number?this.getCtrl_1(t):this.getCtrl_0(t)},t.prototype.getCtrl_0=function(t){return t<this.getSize()?this._controls.get_Item(t):null},t.prototype.getCtrl_1=function(t){return e.NString.IsNullOrEmpty(t)?null:this._controls.find((function(r){return e.NString.Equals(t,r.getName(),!0)||e.NString.Equals(t,r.Name,!0)}))},t.prototype.getCtrlByName=function(t,r){return e.NString.IsNullOrEmpty(t)?null:this._controls.find((function(n){return n.Type===r&&e.NString.Equals(t,n.getName(),!0)||e.NString.Equals(t,n.Name,!0)}))},t.prototype.GetControlByIsn=function(t){return this._controls.find((function(e){return e.ControlIsn===t}))},t.prototype.GetControl=function(t){return this._controls.find(t)},t.prototype.filter=function(t){return this._controls.filter(t)},t.prototype.contains=function(t){var e=!1;return null!==t&&(e=this._controls.Contains(t)),e},t.prototype.addControl=function(t){this._controls.push(t)},t.prototype.setControlAt=function(t,e){this._controls.length<=e&&this._controls.SetSize(e+1),this._controls.set_Item(e,t)},t.prototype.deleteControlAt=function(t){this._controls.set_Item(t,null)},t.prototype.Remove=function(t){if(1===arguments.length&&(null===t||t instanceof Lt))return this.Remove_0(t);this.Remove_1(t)},t.prototype.Remove_0=function(t){return this._controls.Remove(t),this._controls.Contains(t)},t.prototype.Remove_1=function(t){this._controls.RemoveAt(t)},t.prototype.getControlIdx=function(t,e){for(var r=0,n=0;n<this._controls.length;n++){var i=this._controls.get_Item(n);if(t===i)return r;!e&&i.isSubform()||r++}return-1},t.SelectDataControlPredicate=function(t){return t.isDataCtrl()},t}(),Nt=function(n){function i(){var t=n.call(this)||this;return t.InInitForm=!1,t.CtrlTab=null,t.FormRefreshed=!1,t.RefreshRepeatableAllowed=!1,t.Rows=null,t.ModalFormsCount=0,t.ErrorOccured=!1,t.FormIsn=0,t.Name=null,t.Opened=!1,t.isLegalForm=!1,t.PBImagesNumber=0,t.ignoreFirstRefreshTable=!1,t.ParentForm=null,t._destTblRow=e.Int32.MinValue,t._firstTableTabOrder=0,t._inRefreshDisp=!1,t._inRestore=!1,t._lastRowSent=-1,t._prevGuiTopIndex=-1,t._propTab=null,t._rowsInPage=1,t._maxRowsInPaginatedTable=0,t._subFormCtrl=null,t._tableMgControl=null,t._tableItemsCount=0,t._tableRefreshed=!1,t._task=null,t._topIndexUpdated=!1,t._transferingData=!1,t._allowedSubformRecompute=!0,t._concreteWindowType=0,t._containerCtrl=null,t._firstRefreshOfProps=!0,t._prevSelIndex=-1,t._shouldCreateToolbar=!1,t._tableChildren=null,t._tableColumns=null,t._userStateId="",t.displayLine=0,t.defaultRouterOutlet=null,t._propTab=new ft(t),t.CtrlTab=new mt,t.Rows=new e.List,t._concreteWindowType=0,t.ParentForm=null,t}return a(i,n),Object.defineProperty(i.prototype,"DisplayLine",{get:function(){return this.displayLine},set:function(t){this.displayLine=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"UniqueName",{get:function(){return null!=this.GetComputedProperty(t.PropInterface.PROP_TYPE_FORM_NAME)?this.GetComputedProperty(t.PropInterface.PROP_TYPE_FORM_NAME).GetComputedValue():null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskTag",{get:function(){return this.getTask().getTaskTag()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TableChildren",{get:function(){return null===this._tableChildren&&this.buildTableChildren(),this._tableChildren},set:function(t){this._tableChildren=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ShouldCreateToolbar",{get:function(){return this._shouldCreateToolbar},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"AllowedSubformRecompute",{get:function(){return this._allowedSubformRecompute},set:function(t){this._allowedSubformRecompute=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ConcreteWindowType",{get:function(){if(0===this._concreteWindowType){var e=this.GetComputedProperty(t.PropInterface.PROP_TYPE_WINDOW_TYPE).GetComputedValueInteger();null!==this.ParentForm&&e===r.WindowType.Overlay||(e=r.WindowType.Default),this._concreteWindowType=e}return this._concreteWindowType},set:function(t){this._concreteWindowType=t},enumerable:!1,configurable:!0}),i.ShouldPutActOnFormClose=function(){return!1},i.ShouldBehaveAsModal=function(){return!1},i.ConvertArrayListToString=function(t,n){for(var i,o=["\\","-",","],a=["\\\\","\\-","\\,"],s=new e.StringBuilder,_=0;_<t.length;_+=1)n&&(i=new Z(t.get_Item(_)),t.set_Item(_,i.to_double().toString())),s.Append(r.StrUtil.searchAndReplace(t.get_Item(_),o,a)),_<t.length-1&&s.Append(", ");return s.ToString()},i.prototype.UpdateModalFormsCount=function(t,e){e?this.ModalFormsCount+=1:this.ModalFormsCount-=1,E.SetModal(t,e)},i.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return[4,this._task.EvaluateExpression(t,e,r,n,i,!0,a)];case 1:return[2,o.sent()]}}))}))},i.prototype.GetExpressionStorage=function(t){return this._task.GetExpressionStorage(t)},i.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},i.prototype.getProp=function(t){return s(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:return e=null,null===this._propTab?[3,2]:null!==(e=this._propTab.getPropById(t))||null===(e=pt.getDefaultProp(t,W.PARENT_TYPE_FORM,this))?[3,2]:[4,this._propTab.addPropWithCheckExistence(e,!1)];case 1:r.sent(),r.label=2;case 2:return[2,e]}}))}))},i.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},i.prototype.PropertyHasExpression=function(t){var e=this._propTab.getPropById(t);return null!==e&&e.isExpression()},i.prototype.getCompIdx=function(){return null===this.getTask()?0:this.getTask().getCompIdx()},i.prototype.IsFirstRefreshOfProps=function(){return this._firstRefreshOfProps},i.prototype.getForm=function(){return this},i.prototype.fillData=function(t){return s(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:e=X.GetCurrentRuntimeContext().Parser,null===this._task&&null!==t&&(this._task=t),r.label=1;case 1:return[4,this.initInnerObjects(e.getNextTag())];case 2:return r.sent()?[3,1]:[3,3];case 3:return[2]}}))}))},i.prototype.init=function(){return s(this,void 0,void 0,(function(){var e;return _(this,(function(n){switch(n.label){case 0:for(e=0;e<this.CtrlTab.getSize();e+=1)this.CtrlTab.getCtrl(e).Init();return this.buildLinkedControlsLists(),this.buildTableColumnsList(),[4,this.createForm()];case 1:return n.sent(),this._task.setKeyboardMappingState(r.Constants.ACT_STT_TBL_SCREEN_MODE,this.isScreenMode()),this._task.setKeyboardMappingState(r.Constants.ACT_STT_TBL_LEFT_TO_RIGHT,!this.GetComputedProperty(t.PropInterface.PROP_TYPE_HEBREW).GetComputedValueBoolean()),[2]}}))}))},i.prototype.fillName=function(t){var n=X.GetCurrentRuntimeContext().Parser,i=n.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,n.getCurrIndex());if(-1!==i&&i<n.getXMLdata().length){var o=n.getXMLsubstring(i);n.add2CurrIndex(o.indexOf(t)+t.length);for(var a=r.XmlParser.getTokens(n.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM),s=void 0,_=void 0,l=0;l<a.length;l+=2)switch(s=a.get_Item(l),_=a.get_Item(l+1),s){case r.XMLConstants.MG_ATTR_NAME:this.Name=r.XmlParser.unescape(_).toString(),E.ShouldLog(r.Logger_LogLevels.Gui)&&E.WriteGuiToLog(e.NString.Format('Parsing form "{0}"',this.Name));break;case r.XMLConstants.MG_ATTR_IS_FRAMESET:break;case r.XMLConstants.MG_ATTR_IS_LIGAL_RC_FORM:this.isLegalForm=r.XmlParser.getBoolean(_);break;case r.XMLConstants.MG_ATTR_PB_IMAGES_NUMBER:this.PBImagesNumber=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_FORM_ISN:this.FormIsn=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_USERSTATE_ID:this._userStateId=r.XmlParser.unescape(_).toString();break;default:E.WriteExceptionToLog(e.NString.Format("Unhandled attribute '{0}'.",s))}n.setCurrIndex(i+1)}else E.WriteExceptionToLog("in Form.FillName() out of bounds")},i.prototype.createForm=function(){return s(this,void 0,void 0,(function(){var e,r;return _(this,(function(n){switch(n.label){case 0:return e=this.GetListOfInputControls(),[4,this.buildFormName()];case 1:return r=n.sent(),this.isSubForm()?F.addOpensubform(t.CommandType.CREATE_SUB_FORM,this.getSubFormCtrl(),this.getTask().getTaskTag(),this.getSubFormCtrl().getName(),r,e,this.getTask().RouterPath,this.getTask().GetRouterParams(),this.getTask().InDefaultRouterOutlet):F.addOpenForm(this,r,"0",this.getTask().getTaskTag(),e,this.isDialog()),this.HasTable()&&this.InitTableControl(),F.beginInvoke(),[2]}}))}))},i.prototype.CallJS=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){return[2,F.addCallJS(this,this.UniqueName,t,e)]}))}))},i.prototype.isAutomaticTabbingOrder=function(){return this.GetComputedProperty(t.PropInterface.PROP_TYPE_TABBING_ORDER).GetComputedValueInteger()===r.TabbingOrderType.Automatically},i.prototype.isRefreshRepeatableAllowed=function(){return this.RefreshRepeatableAllowed},i.prototype.isScreenMode=function(){return!this.isLineMode()},i.prototype.isLineMode=function(){return null!==this.getMainControl()},i.prototype.hasTable=function(){return null!==this._tableMgControl},i.prototype.isDialog=function(){var t=!1;return(this.ConcreteWindowType===r.WindowType.Overlay||i.ShouldBehaveAsModal())&&(t=!0),t},i.prototype.isSubForm=function(){return null!==this._subFormCtrl},i.prototype.HasTable=function(){return null!==this._tableMgControl},i.prototype.getTopMostForm=function(){for(var t=this;t.isSubForm()&&null!==t.ParentForm;)t=t.ParentForm;return t},i.prototype.getTopMostFrameForm=function(){for(var t=this;null!==t;)t=null!==t.ParentForm?t.ParentForm:null;return t},i.prototype.getSubFormCtrl=function(){return this._subFormCtrl},i.prototype.getCtrl=function(t){return this.CtrlTab.getCtrl(t)},i.prototype.GetCtrl=function(t){return this.CtrlTab.getCtrl(t)},Object.defineProperty(i.prototype,"DefaultRouterOutlet",{get:function(){return null==this.defaultRouterOutlet&&(this.defaultRouterOutlet=this.CtrlTab.GetControl((function(t){return t.IsDefaultRouterOutlet()}))),this.defaultRouterOutlet},enumerable:!1,configurable:!0}),i.prototype.GetChoiceControlItemList=function(t){return s(this,void 0,void 0,(function(){var n,o,a,s,l,u,c,P,h;return _(this,(function(_){switch(_.label){case 0:if(e.Debug.Assert(t.isChoiceControl()),n=new e.List,o=t.getField(),(a=o.getCellsType())===r.StorageAttribute.DATE||a===r.StorageAttribute.TIME)return[3,8];if(!t.isRadio())return[3,5];s=0,_.label=1;case 1:return s<o.GetRadioCtrls().length?(l=o.GetRadioCtrls().get_Item(s),c=(u=n).AddRange,[4,l.GetItemsRange()]):[3,4];case 2:c.apply(u,[_.sent()]),_.label=3;case 3:return s++,[3,1];case 4:return[3,7];case 5:return h=(P=n).AddRange,[4,t.GetItemsRange()];case 6:h.apply(P,[_.sent()]),_.label=7;case 7:return[2,i.ConvertArrayListToString(n,a===r.StorageAttribute.NUMERIC)];case 8:return[2,e.NString.Empty]}}))}))},i.prototype.GetChoiceControlDisplayList=function(t){return s(this,void 0,void 0,(function(){var n,o,a,s,l,u,c,P,h;return _(this,(function(_){switch(_.label){case 0:if(e.Debug.Assert(t.isChoiceControl()),n=new e.List,o=t.getField(),(a=o.getCellsType())===r.StorageAttribute.DATE||a===r.StorageAttribute.TIME)return[3,8];if(!t.isRadio())return[3,5];s=0,_.label=1;case 1:return s<o.GetRadioCtrls().length?(l=o.GetRadioCtrls().get_Item(s),c=(u=n).AddRange,[4,l.GetDisplayRange()]):[3,4];case 2:c.apply(u,[_.sent()]),_.label=3;case 3:return s++,[3,1];case 4:return[3,7];case 5:return h=(P=n).AddRange,[4,t.GetItemsRange()];case 6:h.apply(P,[_.sent()]),_.label=7;case 7:return[2,i.ConvertArrayListToString(n,!1)];case 8:return[2,e.NString.Empty]}}))}))},i.prototype.getControlColumn=function(t){var e=null;return(t.IsRepeatable||t.IsTableHeaderChild)&&null!==this._tableColumns&&(e=this._tableColumns.get_Item(t.getLayer()-1)),e},i.prototype.getContainerCtrl=function(){return this._containerCtrl},i.prototype.getColumnControls=function(){var t=null;if(null!==this.CtrlTab)for(var n=0;n<this.CtrlTab.getSize();n+=1){var i=this.CtrlTab.getCtrl(n);i.Type===r.MgControlType.CTRL_TYPE_COLUMN&&(null===t&&(t=new e.List),t.push(i))}return t},i.prototype.getTask=function(){return this._task},i.prototype.getTableCtrl=function(){return this._tableMgControl},i.prototype.getMainControl=function(){return this._tableMgControl},i.prototype.getCtrlByName=function(t,e){return this.CtrlTab.getCtrlByName(t,e)},i.prototype.checkAndCreateRow=function(t){null===this._tableMgControl||this.isRowCreated(t)||this.createRow(t)},i.prototype.IsValidRow=function(t){var e=!1;if(null!==this._tableMgControl&&t>=0&&t<this.Rows.length){var r=this.Rows.get_Item(t);e=null!==r&&r.Validated}return e},i.prototype.refreshProps=function(){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return this._firstRefreshOfProps?[4,this.getProp(t.PropInterface.PROP_TYPE_TITLE_BAR)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[4,this._propTab.RefreshDisplay(!1,!1)];case 3:return e.sent(),this._firstRefreshOfProps&&(this._firstRefreshOfProps=!1),[2]}}))}))},i.prototype.refreshControls=function(t){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return this.DisplayLine===e.Int32.MinValue?[2]:null===this._tableMgControl||t?[3,2]:[4,this._tableMgControl.RefreshDisplay()];case 1:a.sent(),a.label=2;case 2:if(null===this._tableColumns||t)return[3,6];o=0,a.label=3;case 3:return o<this._tableColumns.length?[4,this._tableColumns.get_Item(o).RefreshDisplay()]:[3,6];case 4:a.sent(),a.label=5;case 5:return o+=1,[3,3];case 6:this.checkAndCreateRow(this.DisplayLine),i=new e.Stack,o=0,a.label=7;case 7:return o<this.CtrlTab.getSize()?(!(n=this.CtrlTab.getCtrl(o)).isTabControl()&&!n.isGroup()||t||i.push(n),n.Type===r.MgControlType.CTRL_TYPE_TABLE||n.Type===r.MgControlType.CTRL_TYPE_COLUMN?[3,10]:!n.IsRepeatable&&t?[3,9]:[4,n.RefreshDisplay()]):[3,13];case 8:a.sent(),a.label=9;case 9:return[3,12];case 10:return n.Type===r.MgControlType.CTRL_TYPE_TABLE&&t?[4,n.RefreshDisplay(t)]:[3,12];case 11:a.sent(),a.label=12;case 12:return o+=1,[3,7];case 13:return[2]}}))}))},i.prototype.markRowNOTCreated=function(e){F.addWithNumber(t.CommandType.UNDO_CREATE_TABLE_ROW,this._tableMgControl,e),e>=0&&e<this.Rows.length&&this.Rows.set_Item(e,new yt(!1,!1))},i.prototype.SelectRow=function(t,e){0===arguments.length?this.SelectRow_0():1===arguments.length?this.SelectRow_1(t):this.SelectRow_2(t,e)},i.prototype.getRowsInPage=function(){return this._rowsInPage},i.prototype.getMaxRowsInPaginatedTable=function(){return this._maxRowsInPaginatedTable},i.prototype.setRowsInPage=function(t){this._rowsInPage=t},i.prototype.getColumnsCount=function(){var t=0;if(null!==this.CtrlTab)for(var e=0;e<this.CtrlTab.getSize();e+=1){this.CtrlTab.getCtrl(e).Type===r.MgControlType.CTRL_TYPE_COLUMN&&(t+=1)}return t},i.prototype.inRefreshDisplay=function(){return this._inRefreshDisp},i.prototype.setTitle=function(t){F.setTitle(this,t)},i.prototype.getControlIdx=function(t){return this.CtrlTab.getControlIdx(t,!0)},i.prototype.getTopIndexFromGUI=function(){var t=0;return this.hasTable()&&(t=F.getTopIndex(this.getMainControl())),t},i.prototype.getTableItemsCount=function(){return this._tableItemsCount},i.prototype.removeRefsToCtrls=function(){for(var t=0;t<this.CtrlTab.getSize();t+=1)this.CtrlTab.getCtrl(t).removeRefFromField()},i.prototype.buildTableChildren=function(){if(null===this._tableChildren&&(this._tableChildren=new e.List,null!==this.CtrlTab)){for(var r=2147483647,n=this.isAutomaticTabbingOrder(),i=0;i<this.CtrlTab.getSize();i+=1){var o=this.CtrlTab.getCtrl(i);if((o.IsRepeatable||o.IsTableHeaderChild)&&(this._tableChildren.push(o),n)){var a=o.GetComputedProperty(t.PropInterface.PROP_TYPE_TAB_ORDER);if(null!==a){var s=a.GetComputedValueInteger();s<r&&(r=s)}}}r!==e.Int32.MaxValue&&n&&(this._firstTableTabOrder=r)}},i.prototype.setTableCtrl=function(t){this._tableMgControl=t},i.prototype.getCtrlCount=function(){return this.CtrlTab.getSize()},i.prototype.GetControlsCountExcludingStatusBar=function(){return this.CtrlTab.getSize()},i.prototype.refreshPropsOnExpression=function(){return s(this,void 0,void 0,(function(){var t,e,r;return _(this,(function(n){switch(n.label){case 0:e=null==this._propTab?0:this._propTab.getSize(),r=!1,t=0,n.label=1;case 1:return t<e&&!r?this._propTab.getProp(t).isExpression()?(r=!0,[4,this.refreshProps()]):[3,3]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},i.prototype.getTabControl=function(t){var e,r=null;for(e=t;e instanceof Lt;){var n=e;if(n.isTabControl()){r=n;break}e=n.getParent()}if(null==r)for(var i=0;i<this.CtrlTab.getSize();i++)if((e=this.CtrlTab.getCtrl(i)).isTabControl()){r=e;break}return r},i.prototype.IsInputType=function(t){switch(t.Type){case r.MgControlType.CTRL_TYPE_CHECKBOX:case r.MgControlType.CTRL_TYPE_TEXT:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_RADIO:return!0;default:return!1}},i.prototype.GetListOfInputControls=function(){var t=this;return this.CtrlTab.filter((function(e,r,n){return t.IsInputType(e)})).reduce((function(t,e,r){return t[e.UniqueName]=e.IsRepeatable?"1":"0",t}),{})},i.prototype.firstTableRefresh=function(){null!==this._tableMgControl&&(this._rowsInPage=F.getRowsInPage(this._tableMgControl),this.RefreshRepeatableAllowed=!0)},i.prototype.SetTableItemsCount=function(t,e,r){"boolean"==typeof e?this.SetTableItemsCount_0(t,e):this.SetTableItemsCount_1(t,e,r)},i.prototype.SetTableItemsCount_0=function(t,e){this.SetTableItemsCount_1(t,t,e)},i.prototype.SetTableItemsCount_1=function(t,e,r){this.InitTableControl(t,e,r)},i.prototype.InitTableControl=function(t,e,r){0!==arguments.length?this.InitTableControl_1(t,e,r):this.InitTableControl_0()},i.prototype.UpdateTableChildrenArraysSize=function(t){var e=this.TableChildren;if(null!=e)for(var r=0;r<e.length;r++){e.get_Item(r).updateArrays(t)}null!=this._tableMgControl&&this._tableMgControl.updateArrays(t)},i.prototype.toString=function(){return"{GuiMgForm: Id="+this._userStateId+"}"},i.prototype.IncludeControlInTabbingOrder=function(e,r){return!!e.PropertyExists(t.PropInterface.PROP_TYPE_TAB_ORDER)},i.prototype.GetHashCode=function(){return this.FormIsn},i.prototype.initInnerObjects=function(t){return s(this,void 0,void 0,(function(){var e;return _(this,(function(n){switch(n.label){case 0:return null===t?[2,!1]:(e=X.GetCurrentRuntimeContext().Parser,i.IsFormTag(t)?(this.fillName(t),[3,6]):[3,1]);case 1:return t!==r.XMLConstants.MG_TAG_PROP?[3,3]:[4,this._propTab.fillData(this,"F",e)];case 2:return n.sent(),[3,6];case 3:return t!==r.XMLConstants.MG_TAG_CONTROL?[3,5]:[4,this.CtrlTab.fillData(this,e)];case 4:return n.sent(),this.HasTable()||(this.RefreshRepeatableAllowed=!0),[3,6];case 5:return i.IsEndFormTag(t)?(e.setCurrIndex2EndOfTag(),[2,!1]):[2,!1];case 6:return[2,!0]}}))}))},i.prototype.isRowCreated=function(t){if(this.Rows.length<=t||t<0)return!1;var e=this.Rows.get_Item(t);return null!==e&&e.Created},i.prototype.buildLinkedControlsLists=function(){for(var t=0;t<this.CtrlTab.getSize();t+=1){var e=this.CtrlTab.getCtrl(t),r=e.getLinkedParent(!1);null!==r&&r.linkCtrl(e)}},i.prototype.buildTableColumnsList=function(){if(null!==this._tableMgControl){this._tableColumns=new e.List;for(var t=0;t<this.CtrlTab.getSize();t+=1){var n=this.CtrlTab.getCtrl(t);n.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._tableColumns.push(n)}}},i.prototype.createRow=function(e){F.addWithNumber(t.CommandType.CREATE_TABLE_ROW,this._tableMgControl,e),this.Rows.length<=e&&this.Rows.SetSize(e+1),this.Rows.set_Item(e,new yt(!0,!0))},i.prototype.SelectRow_0=function(){this.SelectRow(!1)},i.prototype.SelectRow_1=function(t){this.SelectRow(this.DisplayLine,t)},i.prototype.SelectRow_2=function(e,r){var n=this.getMainControl();if(null!==n&&this.RefreshRepeatableAllowed){var i=e;this._task.DataView.isEmptyDataview()&&(i=W.NO_ROW_SELECTED),(r||i!==this._prevSelIndex)&&(this._prevSelIndex=i,F.addOperationWithLine(t.CommandType.SET_PROPERTY,n,0,t.HtmlProperties.SelectedRow,i))}},i.prototype.InitTableControl_0=function(){this.InitTableControl(1,1,!1)},i.prototype.InitTableControl_1=function(e,r,n){null!=this._tableMgControl&&(F.addWithNumber(t.CommandType.SET_TABLE_ITEMS_COUNT,this._tableMgControl,r),this._tableItemsCount=r,this.Rows.SetSize(e),this._prevGuiTopIndex=-2,this._prevSelIndex=-2,this.UpdateTableChildrenArraysSize(e),this._maxRowsInPaginatedTable=F.getMaxRowsInPaginatedTable(this._tableMgControl))},i.prototype.InsertTableChildrenArrays=function(t,e){var r=this.TableChildren;if(null!=r)for(var n=0;n<r.length;n++){r[n].InsertArrays(t,e)}},i}(It),yt=function(){function t(t,e){this.Created=!1,this.Validated=!1,0!==arguments.length?this.constructor_1(t,e):this.constructor_0()}return t.prototype.constructor_0=function(){this.Validated=!0},t.prototype.constructor_1=function(t,e){this.Created=t,this.Validated=e},t}(),Mt=function(){function n(){this.RegisterHandlers(),this.RegisterSubclassHandlers()}return n.prototype.RegisterHandlers=function(){E.KeyDownEvent=this.processKeyDown.bind(this),E.MouseDownEvent=this.processMouseDown,E.DblClickEvent=this.processDblClick,E.CloseFormEvent=this.processFormClose,E.ColumnClickEvent=this.ProcessColumnClick},n.prototype.processKeyDown=function(t,e,n,i,o,a,s,_,l,u,c){var P=c,h=e,T=t;return X.EventsManager.AddKeyboardEvent(T,h,n,i,o,a,s,_,l,r.InternalInterface.MG_ACT_CTRL_KEYDOWN),P},n.prototype.processFormClose=function(e){var n=e;return Nt.ShouldPutActOnFormClose()&&X.EventsManager.addGuiTriggeredEventTaskAndCodeAndRaisedBy(n.getTask(),r.InternalInterface.MG_ACT_HIT,t.RaisedBy.CLOSE_SYSTEM_MENU),X.EventsManager.addGuiTriggeredEventWithTaskAndCode(n.getTask(),r.InternalInterface.MG_ACT_CLOSE),!1},n.prototype.processMouseDown=function(t,n,i,o,a,s,_){var l=n;null===l?(e.Debug.Assert(null!==t),X.EventsManager.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(t.getTask(),r.InternalInterface.MG_ACT_HIT,s)):l.isSubform()?l.OnSubformClick():(l.RaiseControlHitOnMouseDown(o)&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(l,r.InternalInterface.MG_ACT_CTRL_HIT,a),o&&_&&l.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&l.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(l,r.InternalInterface.MG_ACT_WEB_CLICK,a))},n.prototype.processDblClick=function(e,n){var i=e;i.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0,n)&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(i,r.InternalInterface.MG_ACT_WEB_ON_DBLICK,n)},n.prototype.ProcessColumnClick=function(t,e,r){var n=t;X.EventsManager.AddColumnClickEvent(n,e,r)},n}(),Dt=function(){function r(e,r,n,i){this._keyCode=0,this._modifier=t.Modifiers.MODIFIER_NONE,this._states=0,this._actionId=0,2===arguments.length?this.constructor_1(e,r):this.constructor_2(e,r,n,i)}return r.prototype.constructor_1=function(t,e){this._keyCode=t,this._modifier=e},r.prototype.constructor_2=function(t,e,r,n){this._actionId=t,this._keyCode=e,this._modifier=r,this._states=n},r.prototype.getKeyCode=function(){return this._keyCode},r.prototype.getModifier=function(){return this._modifier},r.prototype.getStates=function(){return this._states},r.prototype.equals=function(t){return this===t||null!==t&&this._keyCode===t._keyCode&&this._modifier===t._modifier},r.prototype.getAction=function(){return this._actionId},r.prototype.setAction=function(t){this._actionId=t},r.prototype.ToString=function(){var r=new e.StringBuilder,n=0;switch(this._modifier){case t.Modifiers.MODIFIER_ALT:r.Append("Alt+");break;case t.Modifiers.MODIFIER_CTRL:r.Append("Ctrl+");break;case t.Modifiers.MODIFIER_SHIFT:r.Append("Shift+");break;case t.Modifiers.MODIFIER_SHIFT_CTRL:r.Append("Shift+Ctrl+");break;case t.Modifiers.MODIFIER_ALT_CTRL:r.Append("Alt+Ctrl+");break;case t.Modifiers.MODIFIER_ALT_SHIFT:r.Append("Shift+Alt+");break;case t.Modifiers.MODIFIER_NONE:}switch(this._keyCode){case W.KEY_SPACE:r.Append("Space");break;case W.KEY_PG_UP:r.Append("PgUp");break;case W.KEY_PG_DOWN:r.Append("PgDn");break;case W.KEY_END:r.Append("End");break;case W.KEY_HOME:r.Append("Home");break;case W.KEY_LEFT:r.Append("Left");break;case W.KEY_UP:r.Append("Up");break;case W.KEY_RIGHT:r.Append("Rght");break;case W.KEY_DOWN:r.Append("Down");break;case W.KEY_TAB:r.Append("Tab");break;case W.KEY_INSERT:r.Append("Ins");break;case W.KEY_DELETE:r.Append("Del");break;case W.KEY_RETURN:r.Append("Ent");break;case W.KEY_ESC:r.Append("Esc");break;case W.KEY_BACKSPACE:r.Append("Back");break;default:this._keyCode>=W.KEY_F1&&this._keyCode<=W.KEY_F12?(n=this._keyCode-W.KEY_F1+1,r.Append("F"+n)):this._keyCode>=W.KEY_0&&this._keyCode<=W.KEY_9?(n=this._keyCode-W.KEY_0,r.Append(n)):this._keyCode>=W.KEY_A&&this._keyCode<=W.KEY_Z?(n=this._keyCode-W.KEY_A+"A".charCodeAt(0),r.Append(String.fromCharCode(n))):r.Append("? ("+this._keyCode+")")}return r.ToString()},r}(),bt=function(t,e,r){this.guiMgControl=null,this.Line=0,this.Val=null,this.guiMgControl=t,this.Line=e,this.Val=r},vt=function(){function t(){}return t.prototype.createDialog=function(t){(new G).createDialog(this,t)},t.prototype.closeDialog=function(){},t}(),Bt=function(){};Bt.PROP_STYLE_BUTTON_PUSH=1,Bt.PROP_STYLE_BUTTON_IMAGE=2,Bt.PROP_STYLE_BUTTON_HYPERTEXT=4,Bt.PROP_STYLE_BUTTON_TEXT_ON_IMAGE=8,Bt.PROP_STYLE_HOR_RIGHT=16,Bt.PROP_STYLE_RIGHT_TO_LEFT=32,Bt.PROP_STYLE_HORIZONTAL_SCROLL=64,Bt.PROP_STYLE_VERTICAL_SCROLL=128,Bt.PROP_STYLE_TITLE=256,Bt.PROP_STYLE_CLOSE=512,Bt.PROP_STYLE_MIN=1024,Bt.PROP_STYLE_MAX=2048,Bt.PROP_STYLE_BORDER=4096,Bt.PROP_STYLE_BORDER_STYLE_THIN=8192,Bt.PROP_STYLE_BORDER_STYLE_THICK=16384,Bt.PROP_STYLE_READ_ONLY=32768,Bt.PROP_STYLE_APPEARANCE_CHECK=65536,Bt.PROP_STYLE_APPEARANCE_BUTTON=131072,Bt.PROP_STYLE_WORD_WRAP=262144,Bt.PROP_STYLE_STYLE_FLAT=524288,Bt.PROP_STYLE_TAB_SIDE_TOP=67108864,Bt.PROP_STYLE_TAB_SIDE_BOTTOM=134217728,Bt.PROP_STYLE_NO_BACKGROUND=268435456,Bt.PROP_STYLE_SHOW_LINES=536870912,Bt.PROP_STYLE_HORIZONTAL=1073741824,Bt.PROP_STYLE_VERTICAL=2147483648,Bt.MSGBOX_BUTTON_OK=0,Bt.MSGBOX_BUTTON_OK_CANCEL=1,Bt.MSGBOX_BUTTON_ABORT_RETRY_IGNORE=2,Bt.MSGBOX_BUTTON_YES_NO_CANCEL=3,Bt.MSGBOX_BUTTON_YES_NO=4,Bt.MSGBOX_BUTTON_RETRY_CANCEL=5,Bt.MSGBOX_ICON_ERROR=16,Bt.MSGBOX_ICON_QUESTION=32,Bt.MSGBOX_ICON_EXCLAMATION=48,Bt.MSGBOX_ICON_INFORMATION=64,Bt.MSGBOX_ICON_WARNING=Bt.MSGBOX_ICON_EXCLAMATION,Bt.MSGBOX_RESULT_OK=1,Bt.MSGBOX_RESULT_CANCEL=2,Bt.MSGBOX_RESULT_ABORT=3,Bt.MSGBOX_RESULT_RETRY=4,Bt.MSGBOX_RESULT_IGNORE=5,Bt.MSGBOX_RESULT_YES=6,Bt.MSGBOX_RESULT_NO=7,Bt.MSGBOX_DEFAULT_BUTTON_1=0,Bt.MSGBOX_DEFAULT_BUTTON_2=256,Bt.MSGBOX_DEFAULT_BUTTON_3=512;var Yt=function(){function t(){this._insertMode=!1,this._lastCoordinates=new Array(4),this.ContextID="\0",this.Parser=null,this.FrameForm=null,this.LastClickedCtrlName=null,this.LastClickedMenuUid=0,this.CurrentClickedCtrl=null,this.CurrentClickedRadio=null,this.DefaultStatusMsg=null,this.LastClickCoordinatesAreInPixels=!1}return t.prototype.Init=function(t){this.ContextID=t,this.LastClickedCtrlName="",this._insertMode=!0,X.SetCurrentContextID(t),this.Parser=new r.XmlParser},t.prototype.SaveLastClickInfo=function(t,r,n,i,o,a){this._lastCoordinates[0]=i,this._lastCoordinates[1]=o,this._lastCoordinates[2]=r,this._lastCoordinates[3]=n,this.LastClickCoordinatesAreInPixels=a,this.LastClickedCtrlName="",e.NString.IsNullOrEmpty(t)||(this.LastClickedCtrlName=t)},t.prototype.GetClickProp=function(t){if(t>=0&&t<4)return this._lastCoordinates[t];throw new e.ApplicationException("in RuntimeContextBase.getClickProp() illegal index: "+t)},t.prototype.IsInsertMode=function(){return this._insertMode},t.prototype.ToggleInsertMode=function(){this._insertMode=!this._insertMode},t}();Yt.noContextId=null,Yt.Instance=new Yt;var Ut=function(){function t(){}return t.prototype.CreateDcValues=function(t){return new Ct(!1,t)},t.prototype.SetId=function(t,e){t.SetID(e)},t.prototype.SetType=function(t,e){t.setType(e)},t.prototype.SetDisplayValues=function(t,e){t.SetDisplayValues(e)},t.prototype.SetLinkValues=function(t,e){t.SetLinkValues(e)},t.prototype.SetNullFlags=function(t,e){2!==arguments.length||!(null===t||t instanceof Ct)||null!==e&&e.constructor!==String?this.SetNullFlags_1(t,e):this.SetNullFlags_0(t,e)},t.prototype.SetNullFlags_0=function(t,e){var r=this.ParseNullFlags(e);t.setNullFlags(r)},t.prototype.SetNullFlags_1=function(t,e){t.setNullFlags(e)},t.prototype.ParseValues=function(t,n,i){var o,a,s,_,l=null,u=new e.List,c=null;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:a=i?2*x.Environment.GetSignificantNumSize():4*Math.floor((x.Environment.GetSignificantNumSize()+2)/3);break;case r.StorageAttribute.BOOLEAN:a=1;break;default:a=0}for(s=0;s<t.length;)n!==r.StorageAttribute.ALPHA&&n!==r.StorageAttribute.UNICODE&&n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR||(o=t.substr(s,4),a=e.NNumber.Parse(o,e.NumberStyles.HexNumber),s+=4),a>=32768?(c=new e.StringBuilder,a-=32768,s+=ot.getSpannedField(t,a,s,n,c,i),u.push(c.ToString())):(_=s+a,l=i?t.substr(s,_-s):r.Base64.decodeToHex(t.substr(s,_-s)),u.push(l),s=_);return u.ToArray()},t.prototype.ParseNullFlags=function(t){for(var e=new Array(t.length),r=0;r<t.length;r+=1)e[r]="0"!==t.charAt(r);return e},t}(),Gt=function(){function t(){this._fields=null,this._fields=new e.List}return t.prototype.getField=function(t){return null===t||t.constructor===Number?this.getField_0(t):this.getField_1(t)},t.prototype.getField_0=function(t){var e=null;return t>=0&&t<this._fields.length&&(e=this._fields.get_Item(t)),e},t.prototype.getSize=function(){return this._fields.length},t.prototype.fillData=function(t,e){for(;this.initInnerObjects(t.getNextTag(),e););},t.prototype.initInnerObjects=function(t,e){if(null===t)return!1;var n=X.GetCurrentRuntimeContext().Parser;if(t===r.XMLConstants.MG_TAG_FLDH){var i=this.initField(n,e);this._fields.push(i)}else{if(t!==r.XMLConstants.MG_TAG_DVHEADER)return t==="/"+r.XMLConstants.MG_TAG_DVHEADER?(n.setCurrIndex2EndOfTag(),!1):(E.WriteExceptionToLog("There is no such tag in FieldsTable. Insert else if to FieldsTable.initInnerObjects for "+t),!1);n.setCurrIndex(n.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,n.getCurrIndex())+1)}return!0},t.prototype.getField_1=function(t){return this._fields.find((function(e){return e.getVarName()===t}))},t}(),kt=function(){function n(){this._dcValsCollection=new e.Dictionary,this._emptyDataview=!1,this._fieldsTab=null,this._task=null,this._emptyChoice=new Ct(!0,!1),this._emptyChoiceForVectors=new Ct(!0,!0)}return n.prototype.Init=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){return[2]}))}))},n.prototype.fillHeaderData=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(e){return this._fieldsTab.fillData(t,this),[2]}))}))},n.prototype.getField=function(t){return null!=this._fieldsTab?this._fieldsTab.getField(t):(E.WriteExceptionToLog("in DataView.getFieldDef(int): There is no fieldsTab object"),null)},n.prototype.isEmptyDataview=function(){return this._emptyDataview},n.prototype.setEmptyDataview=function(e){this._emptyDataview=e,F.addBoolWithLine(t.CommandType.SET_EMPTY_DATAVIEW,this._task.getForm(),0,e)},n.prototype.getTask=function(){return this._task},n.prototype.getDcValues=function(t){if(-2===t)return this.getEmptyChoice();var r=new e.RefParam(undefined);return this._dcValsCollection.TryGetValue(t.toString(),r),r.value},n.prototype.getEmptyChoice=function(){return this._emptyChoice},n.prototype.getEmptyChoiceForVectors=function(){return this._emptyChoiceForVectors},n.prototype.GetFieldsTab=function(){return this._fieldsTab},n.prototype.GetRouteParams=function(){return s(this,void 0,void 0,(function(){var t,n,i,o,a;return _(this,(function(s){for(t=new e.List,n=0;n<this._fieldsTab.getSize();n++)if(i=this._fieldsTab.getField(n),o=void 0,i.IsExposedRouteParam&&!i.isNull())switch(i.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:o=i.getDispValue(),i.isNull()&&(o=i.getNullDisplay()),t.push(o.trim());break;case r.StorageAttribute.BOOLEAN:i.isNull()?t.push(!1):t.push("1"===i.getDispValue().charAt(0));break;case r.StorageAttribute.NUMERIC:o=i.getDispValue(),i.isNull()&&(o=i.getNullDisplay()),a=new z(i.getPicture(),i.getType(),this.getTask().getCompIdx()),o=$.Instance.mg2disp(o,"",a,!0,0,!1),t.push(o)}return[2,t.length>0?t:null]}))}))},n}(),Vt=function(){function t(n){this.Referent=null,this.isDisposed=!1,this.id=0,this._instantiationTrace=null,this.id=t.LastId=t.LastId+1,this.isDisposed=!1,this.Referent=n,r.Logger.Instance.LogLevel>=r.Logger_LogLevels.Development&&(r.Logger.Instance.WriteDevToLog("Creating "+this.toString()),this._instantiationTrace=new e.StackTrace),n.AddReference()}return t.prototype.Dispose=function(t){0!==arguments.length?this.Dispose_1(t):this.Dispose_0()},t.prototype.Dispose_0=function(){r.Logger.Instance.WriteDevToLog("Disposing "+this),this.Dispose(!0)},t.prototype.Dispose_1=function(t){this.isDisposed||(this.Referent.HasReferences?this.Referent.RemoveReference():(r.Logger.Instance.LogLevel>=r.Logger_LogLevels.Development&&(r.Logger.Instance.WriteSupportToLog("Referent does not have any more references: "+this.Referent,!1),r.Logger.Instance.WriteStackTrace(this._instantiationTrace,15,"Instantiation trace:")),e.Debug.Assert(!1,"Referent does not have any more references. See DEV level log."))),this.isDisposed=!0},t.prototype.toString=function(){return"{Reference "+this.id+" to: "+this.Referent+"}"},t}();Vt.LastId=0;var wt=function(){function t(){this._refs=new e.List}return t.prototype.get_Item=function(t){return this._refs.get_Item(t)},t.prototype.Add=function(t){this._refs.push(t)},t.prototype.Dispose=function(){for(var t=0;t<this._refs.length;t+=1)this._refs.get_Item(t).Dispose()},t.prototype.Clone=function(){for(var e=new t,r=0;r<this._refs.length;r+=1){var n=this.get_Item(r).Clone();e.Add(n)}return e},Object.defineProperty(t.prototype,"Refs",{get:function(){return this._refs},enumerable:!1,configurable:!0}),t}(),Ft=function(){};Ft.EXP_OPER_LEN=2,Ft.EXP_OPER_FUNC_PTR_LEN=4,Ft.EXP_OP_NONE=0,Ft.EXP_OP_V=1,Ft.EXP_OP_VAR=2,Ft.EXP_OP_A=3,Ft.EXP_OP_H=4,Ft.EXP_OP_N=5,Ft.EXP_OP_D=6,Ft.EXP_OP_T=7,Ft.EXP_OP_L=8,Ft.EXP_OP_F=9,Ft.EXP_OP_K=10,Ft.EXP_OP_P=11,Ft.EXP_OP_M=12,Ft.EXP_OP_ACT=13,Ft.EXP_OP_KBD=14,Ft.EXP_OP_ADD=15,Ft.EXP_OP_SUB=16,Ft.EXP_OP_MUL=17,Ft.EXP_OP_DIV=18,Ft.EXP_OP_MOD=19,Ft.EXP_OP_NEG=20,Ft.EXP_OP_FIX=21,Ft.EXP_OP_ROUND=22,Ft.EXP_OP_EQ=23,Ft.EXP_OP_NE=24,Ft.EXP_OP_LE=25,Ft.EXP_OP_LT=26,Ft.EXP_OP_GE=27,Ft.EXP_OP_GT=28,Ft.EXP_OP_NOT=29,Ft.EXP_OP_OR=30,Ft.EXP_OP_AND=31,Ft.EXP_OP_IF=32,Ft.EXP_OP_LEN=33,Ft.EXP_OP_CON=34,Ft.EXP_OP_MID=35,Ft.EXP_OP_LEFT=36,Ft.EXP_OP_RIGHT=37,Ft.EXP_OP_FILL=38,Ft.EXP_OP_INSTR=39,Ft.EXP_OP_TRIM=40,Ft.EXP_OP_LTRIM=41,Ft.EXP_OP_RTRIM=42,Ft.EXP_OP_STR=43,Ft.EXP_OP_VAL=44,Ft.EXP_OP_STAT=45,Ft.EXP_OP_LEVEL=46,Ft.EXP_OP_COUNTER=47,Ft.EXP_OP_VARPREV=48,Ft.EXP_OP_VARCURR=49,Ft.EXP_OP_VARMOD=50,Ft.EXP_OP_VARINP=51,Ft.EXP_OP_VARNAME=52,Ft.EXP_OP_VIEWMOD=53,Ft.EXP_OP_ENV=54,Ft.EXP_OP_INIGET=55,Ft.EXP_OP_INIPUT=56,Ft.EXP_OP_TERM=59,Ft.EXP_OP_DATE=61,Ft.EXP_OP_TIME=62,Ft.EXP_OP_SYS=63,Ft.EXP_OP_PROG=66,Ft.EXP_OP_PWR=68,Ft.EXP_OP_LOG=69,Ft.EXP_OP_EXP=70,Ft.EXP_OP_ABS=71,Ft.EXP_OP_SIN=72,Ft.EXP_OP_COS=73,Ft.EXP_OP_TAN=74,Ft.EXP_OP_ASIN=75,Ft.EXP_OP_ACOS=76,Ft.EXP_OP_ATAN=77,Ft.EXP_OP_RAND=78,Ft.EXP_OP_MIN=79,Ft.EXP_OP_MAX=80,Ft.EXP_OP_RANGE=81,Ft.EXP_OP_REP=82,Ft.EXP_OP_INS=83,Ft.EXP_OP_DEL=84,Ft.EXP_OP_FLIP=85,Ft.EXP_OP_UPPER=86,Ft.EXP_OP_LOWER=87,Ft.EXP_OP_CRC=88,Ft.EXP_OP_CHKDGT=89,Ft.EXP_OP_SOUNDX=90,Ft.EXP_OP_HSTR=91,Ft.EXP_OP_HVAL=92,Ft.EXP_OP_CHR=93,Ft.EXP_OP_ASC=94,Ft.EXP_OP_MSTR=103,Ft.EXP_OP_MVAL=104,Ft.EXP_OP_DSTR=105,Ft.EXP_OP_DVAL=106,Ft.EXP_OP_TSTR=107,Ft.EXP_OP_TVAL=108,Ft.EXP_OP_DAY=109,Ft.EXP_OP_MONTH=110,Ft.EXP_OP_YEAR=111,Ft.EXP_OP_DOW=112,Ft.EXP_OP_CDOW=113,Ft.EXP_OP_CMONTH=114,Ft.EXP_OP_NDOW=115,Ft.EXP_OP_NMONTH=116,Ft.EXP_OP_SECOND=117,Ft.EXP_OP_MINUTE=118,Ft.EXP_OP_HOUR=119,Ft.EXP_OP_DELAY=120,Ft.EXP_OP_IDLE=121,Ft.EXP_OP_LOGICAL=138,Ft.EXP_OP_VISUAL=139,Ft.EXP_OP_ADDDATE=156,Ft.EXP_OP_ADDTIME=157,Ft.EXP_OP_OWNER=158,Ft.EXP_OP_VARATTR=159,Ft.EXP_OP_BOM=160,Ft.EXP_OP_BOY=161,Ft.EXP_OP_EOM=162,Ft.EXP_OP_EOY=163,Ft.EXP_OP_RIGHT_LITERAL=165,Ft.EXP_OP_ROLLBACK=167,Ft.EXP_OP_VARSET=168,Ft.EXP_OP_EVALX=171,Ft.EXP_OP_IGNORE=172,Ft.EXP_OP_NULL=173,Ft.EXP_OP_NULL_A=174,Ft.EXP_OP_NULL_N=175,Ft.EXP_OP_NULL_B=176,Ft.EXP_OP_NULL_D=177,Ft.EXP_OP_NULL_T=178,Ft.EXP_OP_ISNULL=179,Ft.EXP_OP_TDEPTH=180,Ft.EXP_OP_MINMAGIC=193,Ft.EXP_OP_MAXMAGIC=194,Ft.EXP_OP_RESMAGIC=195,Ft.EXP_OP_FILEDLG=196,Ft.EXP_OP_MLS_TRANS=199,Ft.EXP_OP_CTRL_NAME=200,Ft.EXP_OP_GETLANG=206,Ft.EXP_OP_NULL_O=210,Ft.EXP_OP_GETPARAM=212,Ft.EXP_OP_SETPARAM=213,Ft.EXP_OP_CND_RANGE=219,Ft.EXP_OP_ISDEFAULT=235,Ft.EXP_OP_FORM=236,Ft.EXP_OP_STRTOKEN=237,Ft.EXP_OP_INIGETLN=241,Ft.EXP_OP_EXPCALC=242,Ft.EXP_OP_E=243,Ft.EXP_OP_WEB_REFERENCE=267,Ft.EXP_OP_CASE=273,Ft.EXP_OP_LIKE=275,Ft.EXP_OP_CALLJS=283,Ft.EXP_OP_THIS=290,Ft.EXP_OP_REPSTR=303,Ft.EXP_OP_DBROUND=306,Ft.EXP_OP_VARPIC=307,Ft.EXP_OP_STRTOK_CNT=309,Ft.EXP_OP_VARCURRN=310,Ft.EXP_OP_VARINDEX=311,Ft.EXP_OP_JCDOW=343,Ft.EXP_OP_JMONTH=344,Ft.EXP_OP_JNDOW=345,Ft.EXP_OP_JYEAR=346,Ft.EXP_OP_JGENGO=347,Ft.EXP_OP_HAN=350,Ft.EXP_OP_ZEN=351,Ft.EXP_OP_ZENS=352,Ft.EXP_OP_ZIMEREAD=353,Ft.EXP_OP_ZKANA=354,Ft.EXP_OP_GOTO_CTRL=368,Ft.EXP_OP_TRANSLATE=373,Ft.EXP_OP_ASTR=374,Ft.EXP_OP_LOOPCOUNTER=401,Ft.EXP_OP_VECGET=417,Ft.EXP_OP_VECSET=418,Ft.EXP_OP_VECSIZE=419,Ft.EXP_OP_VECCELLATTR=420,Ft.EXP_OP_BLOBSIZE=442,Ft.EXP_OP_STRTOKEN_IDX=448,Ft.EXP_OP_MTIME=449,Ft.EXP_OP_MTVAL=450,Ft.EXP_OP_MTSTR=451,Ft.EXP_OP_IN=462,Ft.EXP_OP_ISCOMPONENT=465,Ft.EXP_OP_EXT_A=485,Ft.EXP_OP_NULL_U=491,Ft.EXP_OP_USER_DEFINED_FUNC=496,Ft.EXP_OP_SUBFORM_EXEC_MODE=497,Ft.EXP_OP_UNICODEASC=506,Ft.EXP_OP_ADDDT=509,Ft.EXP_OP_DIFDT=510,Ft.EXP_OP_ISFIRSTRECORDCYCLE=511,Ft.EXP_OP_MAINLEVEL=512,Ft.EXP_OP_MAINDISPLAY=515,Ft.EXP_OP_DBVIEWSIZE=539,Ft.EXP_OP_DBVIEWROWIDX=540,Ft.EXP_OP_PROJECTDIR=541,Ft.EXP_OP_FORMSTATECLEAR=542,Ft.EXP_OP_PUBLICNAME=543,Ft.EXP_OP_TASKID=544,Ft.EXP_OP_STR_BUILD=549,Ft.EXP_OP_EMPTY_DATA_VIEW=561,Ft.EXP_OP_STATUSBARSETTEXT=568,Ft.EXP_OP_CLIENT_DIRDLG=574,Ft.EXP_OP_CLIENT_REDIRECT=577,Ft.EXP_OP_IS_MOBILE_CLIENT=593,Ft.EXP_OP_CLIENT_SESSION_STATISTICS_GET=594,Ft.EXP_OP_TASKTYPE=612,Ft.EXP_OP_CLIENT_FILE_TO_SERVER=615,Ft.EXP_OP_RANGE_ADD=616,Ft.EXP_OP_RANGE_RESET=617,Ft.EXP_OP_LOCATE_ADD=618,Ft.EXP_OP_LOCATE_RESET=619,Ft.EXP_OP_SORT_ADD=620,Ft.EXP_OP_SORT_RESET=621,Ft.EXP_OP_TSK_INSTANCE=622,Ft.EXP_OP_CLIENTSESSION_SET=632,Ft.EXP_OP_UTCDATE=633,Ft.EXP_OP_UTCTIME=634,Ft.EXP_OP_UTCMTIME=635,Ft.EXP_OP_CLIENT_DB_DISCONNECT=636,Ft.EXP_OP_DATAVIEW_TO_DATASOURCE=637,Ft.EXP_OP_CLIENT_DB_DEL=638,Ft.EXP_OP_VARDISPLAYNAME=647,Ft.EXP_OP_VARCONTROLID=650,Ft.EXP_OP_CONTROLITEMSLIST=651,Ft.EXP_OP_CONTROLDISPLAYLIST=652,Ft.EXP_OP_CLIENT_SQL_EXECUTE=653,Ft.EXP_OP_CONTROL_SELECT_PROGRAM=656,Ft.EXP_OP_SET_TITLE=687,Ft.EXP_OP_IS_ROW_EDITING=689,Ft.EXP_OP_IS_LOGGED_IN=690;var xt=function(){function t(){this.ExpTask=null,this.Events=null}return t.prototype.eval_op_statusbar_set_text=function(t,e){return s(this,void 0,void 0,(function(){var n,i;return _(this,(function(o){switch(o.label){case 0:return t.Attr=r.StorageAttribute.UNICODE,t.StrVal=X.GetCurrentRuntimeContext().DefaultStatusMsg,null===X.GetCurrentRuntimeContext().DefaultStatusMsg?t.StrVal="":t.StrVal=X.GetCurrentRuntimeContext().DefaultStatusMsg,t.IsNull=!1,e.Attr!==r.StorageAttribute.ALPHA&&e.Attr!==r.StorageAttribute.UNICODE?[3,2]:e.IsNull?[3,2]:(n=e.StrVal,[4,this.ExpTask.GetContextTask()]);case 1:null===(i=o.sent()).getForm()&&null!==X.GetCurrentRuntimeContext().FrameForm&&(i=X.GetCurrentRuntimeContext().FrameForm.getTask()),i.WriteToMessagePane(n,!1),X.GetCurrentRuntimeContext().DefaultStatusMsg=n,o.label=2;case 2:return[2]}}))}))},t.prototype.IsParallel=function(t){return!1},t.prototype.eval_op_browserExecute_DO=function(t,e,n,i,o){t.Attr=r.StorageAttribute.BOOLEAN,t.BoolVal=!1;this.ExpTask.getForm();var a=r.StrUtil.rtrim(e.StrVal),s=this.ExpTask.getForm().GetCtrl(a);null!==s&&s.isBrowserControl()&&(t.BoolVal=F.browserExecute(s,n.StrVal,i.BoolVal,o))},t.prototype.eval_op_ctrl_name=function(t){var n=X.GetCurrentRuntimeContext().LastClickedCtrlName;t.StrVal=e.NString.IsNullOrEmpty(n)?"":n,t.Attr=r.StorageAttribute.ALPHA},t.prototype.eval_op_formStateClear=function(t,e){},t.prototype.eval_op_gotoCtrl=function(t,e,n,i){return s(this,void 0,void 0,(function(){var o,a,s,l;return _(this,(function(_){switch(_.label){case 0:return i.Attr=r.StorageAttribute.BOOLEAN,i.BoolVal=!1,[4,this.GetContextTask(n.MgNumVal.NUM_2_LONG())];case 1:return null===(o=_.sent())||null===o.getForm()||(a=e.MgNumVal.NUM_2_LONG(),s=r.StrUtil.rtrim(t.StrVal),l=o.getForm().GetCtrl(s),i.BoolVal=this.HandleControlGoto(o,l,a)),[2]}}))}))},t.GetContextTask=function(e,r){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return n=null,[4,e.GetContextTask()];case 1:return i=a.sent(),r!==t.TRIGGER_TASK?[3,2]:(n=i,[3,4]);case 2:return o=r,[4,i.GetTaskDepth()];case 3:o<a.sent()&&(n=i.GetTaskAncestor(r)),a.label=4;case 4:return[2,n]}}))}))},t.prototype.GetContextTask=function(e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,t.GetContextTask(this.ExpTask,e)];case 1:return[2,r.sent()]}}))}))},t.prototype.ConstructMagicNum=function(t,e,r){t.MgNumVal=new Z,t.MgNumVal.NUM_4_LONG(e),t.Attr=r},t.prototype.SetNULL=function(t,e){switch(t.IsNull=!0,t.Attr=e,e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:t.StrVal=null;break;case r.StorageAttribute.TIME:case r.StorageAttribute.DATE:case r.StorageAttribute.NUMERIC:t.MgNumVal=null;break;case r.StorageAttribute.BOOLEAN:t.BoolVal=!1}},t.prototype.GetValidatedValue=function(t,e,n){var i,o=t.buildCopyPicture(e,n);if(o.evaluate(),o.ValidationFailed){var a=t.getField();i=a.getType()===r.StorageAttribute.BLOB_VECTOR?a.getCellDefualtValue():a.getDefaultValue()}else i=o.getDispValue();return i},t.prototype.SetVal=function(t,e,n,i){switch(e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:t.Attr=e,t.StrVal=n,e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR||(t.IncludeBlobPrefix=!0);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t.Attr=e,t.MgNumVal=null==n?null:null==i?new Z(n):new Z(n,i,this.ExpTask.getCompIdx());break;case r.StorageAttribute.BOOLEAN:t.Attr=e,t.BoolVal=$.toBoolean(n);break;default:this.SetNULL(t,e),this.Events.WriteExceptionToLog("ExpressionEvaluator.SetVal() there is no such type : "+e)}},t.exp_build_string=function(t){var e="";if(null!==t.StrVal){var n=t.StrVal.length;n>0&&(e=r.StrUtil.ZstringMake(t.StrVal,n))}return e},t.prototype.exp_build_ioname=function(t){return s(this,void 0,void 0,(function(){var e,n,i;return _(this,(function(o){switch(o.label){case 0:return e="",null===t.StrVal?[3,2]:(n=Math.min(t.StrVal.length,260))>0?(i=r.StrUtil.ZstringMake(t.StrVal,n),[4,this.Translate(i)]):[3,2];case 1:e=o.sent(),o.label=2;case 2:return[2,e]}}))}))},t.isExpVal=function(t){return t instanceof Xt},t.prototype.BlobStringConversion=function(t,e){if(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(e))if(t.Attr===r.StorageAttribute.BLOB){if(t.IncludeBlobPrefix){var n=K.getContentType(t.StrVal);t.StrVal=K.getString(t.StrVal),t.IncludeBlobPrefix=!1,n!==K.CONTENT_TYPE_BINARY&&r.Rtf.isRtf(t.StrVal)&&(t.StrVal=r.StrUtil.GetPlainTextfromRtf(t.StrVal))}t.Attr=e}else{if(t.Attr===r.StorageAttribute.BLOB_VECTOR)t.IncludeBlobPrefix&&(t.StrVal=K.removeBlobPrefix(t.StrVal),t.IncludeBlobPrefix=!1),t.Attr=e}else if(e===r.StorageAttribute.BLOB&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t.Attr)){n=t.Attr===r.StorageAttribute.ALPHA?K.CONTENT_TYPE_ANSI:K.CONTENT_TYPE_UNICODE;t.StrVal=K.createFromString(t.StrVal,n),t.IncludeBlobPrefix=!0,t.Attr=e}},t.prototype.eval_op_zimeread=function(t){t.Attr=r.StorageAttribute.ALPHA,t.StrVal="";var n=X.UtilImeJpn;if(null!==n){var i=n.StrImeRead;e.NString.IsNullOrEmpty(n.StrImeRead)||(t.StrVal=i)}},t.prototype.eval_op_win_help=function(t,e,n,i){var o=t.StrVal,a=e.MgNumVal.NUM_2_LONG(),s=n.StrVal;i.Attr=r.StorageAttribute.BOOLEAN;try{X.ShowWindowHelp(o,a,s),i.BoolVal=!0}catch(t){i.BoolVal=!1}},t.prototype.ConvertExpVal=function(t,e){r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(t.Attr,e)&&this.BlobStringConversion(t,e)},t}();xt.TRIGGER_TASK=5e5;var Xt=function(){function t(t,e,n){this.Attr=r.StorageAttribute.NONE,this.IsNull=!1,this.MgNumVal=null,this.StrVal=null,this.BoolVal=!1,this.IncludeBlobPrefix=!1,this.OriginalNull=!1,this.VectorField=null,0!==arguments.length?this.constructor_1(t,e,n):this.constructor_0()}return t.prototype.constructor_0=function(){this.Attr=r.StorageAttribute.NONE},t.prototype.constructor_1=function(t,e,r){this.Init(t,e,r)},t.prototype.Copy=function(t){this.Attr=t.Attr,this.BoolVal=t.BoolVal,this.IncludeBlobPrefix=t.IncludeBlobPrefix,this.IsNull=t.IsNull,this.MgNumVal=t.MgNumVal,this.StrVal=t.StrVal,this.VectorField=t.VectorField,this.OriginalNull=t.OriginalNull},t.prototype.Nullify=function(){this.Init(r.StorageAttribute.NONE,!0,null)},t.prototype.Init=function(t,n,i){switch(this.Attr=t,this.IsNull=n,this.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:this.StrVal=i;break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:this.StrVal=i,this.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:this.MgNumVal=null!==i?new Z(i):null;break;case r.StorageAttribute.BOOLEAN:this.BoolVal=null!==i&&"1"===i;break;case r.StorageAttribute.NONE:this.BoolVal=!1,this.StrVal=null,this.MgNumVal=null,this.OriginalNull=!0,this.VectorField=null,this.IncludeBlobPrefix=!1;break;case r.StorageAttribute.DOTNET:this.StrVal=i;break;default:throw new e.ApplicationException("in ExpVal.ExpVal() illegal attribute: '"+this.Attr+"'")}},t.prototype.ToMgVal=function(){var t;switch(this.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:t=this.StrVal;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=this.MgNumVal.toXMLrecord();break;case r.StorageAttribute.BOOLEAN:t=this.BoolVal?"1":"0";break;default:t="[illegal attribute: "+this.Attr+"]"}return t},t.prototype.isEmptyString=function(){return(this.Attr===r.StorageAttribute.ALPHA||this.Attr===r.StorageAttribute.UNICODE)&&""===this.StrVal},t}(),Ht=function(){},Wt=function(t){function e(){var e=t.call(this)||this;return e.val=null,e.Name=null,e.FrameX=0,e.FrameY=0,e.FrameDx=0,e.FrameDy=0,e.SizedX=0,e.SizedY=0,e.FactorX=0,e.FactorY=0,e.Borderstyle=0,e.TitleBar=0,e.FontTableIndex=0,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Internal},e}(Ht),Kt=function(t){function e(){var e=t.call(this)||this;return e.PromptHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Prompt},e}(Ht),zt=function(t){function e(){var e=t.call(this)||this;return e.tooltipHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Tooltip},e}(Ht),jt=function(t){function e(){var e=t.call(this)||this;return e.urlHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.URL},e}(Ht),Zt=function(t){function e(){var e=t.call(this)||this;return e.FilePath=null,e.HelpCommand=0,e.HelpKey=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Windows},e}(Ht),Jt=function(){function t(){this._helps=null,this._helps=new e.List}return t.prototype.fillData=function(t){for(;this.initInnerObjects(t.getNextTag(),t););},t.prototype.initInnerObjects=function(t,e){if(null===t)return!1;if(t===r.XMLConstants.MG_TAG_HELPTABLE)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==r.XMLConstants.MG_TAG_HELPITEM)return t==="/"+r.XMLConstants.MG_TAG_HELPTABLE?(e.setCurrIndex2EndOfTag(),!1):(E.WriteExceptionToLog("in Command.FillData() out of string bounds"),!1);var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var i=e.getXMLsubstring(n);e.add2CurrIndex(i.indexOf(r.XMLConstants.MG_TAG_HELPITEM)+r.XMLConstants.MG_TAG_HELPITEM.length);var o=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.fillHelpItem(o),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length),!0}}return!0},t.prototype.fillHelpItem=function(t){var n=0,i=t.get_Item(n),o=t.get_Item(n+1);switch(r.XmlParser.unescape(o).toString()){case r.XMLConstants.MG_ATTR_HLP_TYP_TOOLTIP:var a=new zt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?a.tooltipHelpText=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(a);break;case r.XMLConstants.MG_ATTR_HLP_TYP_PROMPT:var s=new Kt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?s.PromptHelpText=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(s);break;case r.XMLConstants.MG_ATTR_HLP_TYP_URL:var _=new jt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?_.urlHelpText=o:E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(_);break;case r.XMLConstants.MG_ATTR_HLP_TYP_INTERNAL:var l=new Wt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?l.val=r.XmlParser.unescape(o).toString():i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_NAME?l.Name=r.XmlParser.unescape(o).toString():i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEX?l.FrameX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEY?l.FrameY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEDX?l.FrameDx=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEDY?l.FrameDy=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SIZEDX?l.SizedX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SIZEDY?l.SizedY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FACTORX?l.FactorX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FACTORY?l.FactorY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_BORDERSTYLE?l.Borderstyle=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_TITLE_BAR?l.TitleBar=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SYSTEM_MENU||(i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FONT_TABLE_INDEX?l.FontTableIndex=e.NNumber.Parse(r.XmlParser.unescape(o)):E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i)));this._helps.push(l);break;case r.XMLConstants.MG_ATTR_HLP_TYP_WINDOWS:var u=new Zt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_FILE?u.FilePath=o:i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_COMMAND?u.HelpCommand=e.NNumber.Parse(o):i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_KEY?u.HelpKey=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(u)}},t.prototype.getHelp=function(t){return t<0||t>=this._helps.length?null:this._helps.get_Item(t)},t}(),Qt=function(){};Qt.MGDataTable=null;var qt=function(){function n(){this._flowMonitor=null,this._keyboardMappingState=4294901760,this._refreshType="T",this._lastParkedCtrl=null,this._brkLevel=null,this._brkLevelIndex=-1,this._mainLevel=null,this._level="\0",this._enteredRecLevel=!1,this._currParkedFld=null,this.shouldResumeSubformLayout=!0,this.isInRecompute=!1,this.CurrentEditingControl=null,this.ApplicationGuid=null,this.ProgramIsn=0,this.TaskIsn=0,this.ContextID=0,this.IsSubForm=!1,this._ctlIdx=0,this._compIdx=0,this._isPrg=!1,this._isMainPrg=!1,this.IsInteractive=!1,this._taskTag=null,this._openWin=!1,this._allowEvents=!1,this.Form=null,this._propTab=null,this._helpTab=null,this.IconFileName=null,this.IsParallel=!1,this.DataView=null,this.ActionManager=null,this.StudioParentTask=null,this.routerPath=null,this.routeParams=null,this.inDefaultRouterOutlet=!1,this.IsSubtask=!1,this.DataViewWasRetrieved=!1,this.TaskPrefixExecuted=!1,this._nullArithmetic=r.Constants.NULL_ARITH_USE_DEF,this._propTab=new ft(this)}return n.prototype.Init=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.DataView.Init()];case 1:return t.sent(),[2]}}))}))},Object.defineProperty(n.prototype,"RouterPath",{get:function(){return this.routerPath},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RouterParams",{get:function(){return this.routeParams},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"InDefaultRouterOutlet",{get:function(){return this.inDefaultRouterOutlet},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShouldResumeSubformLayout",{get:function(){return this.shouldResumeSubformLayout},set:function(t){this.shouldResumeSubformLayout=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsBlockingBatch",{get:function(){return!this._isMainPrg&&this.isOpenWin()&&!this._allowEvents&&!this.IsInteractive},enumerable:!1,configurable:!0}),n.prototype.getTaskTag=function(){return this._taskTag},n.prototype.getCtlIdx=function(){return this._ctlIdx},n.prototype.isMainProg=function(){return this._isMainPrg},n.prototype.getTopMostForm=function(){var t=null;return null!==this.Form&&(t=this.Form.getTopMostForm()),t},n.prototype.getCtrl=function(t){return this.Form.getCtrl(t)},n.prototype.setMode=function(e){return s(this,void 0,void 0,(function(){var r,n,i;return _(this,(function(o){switch(o.label){case 0:return this.getMode()===e?[3,3]:[4,this.setProp(t.PropInterface.PROP_TYPE_TASK_MODE,e)];case 1:return o.sent(),null===this._flowMonitor?[3,3]:(n=(r=this._flowMonitor).addTaskCngMode,i=[this.ContextID,e],[4,this.GetTaskDetails()]);case 2:n.apply(r,i.concat([o.sent()])),o.label=3;case 3:return[2]}}))}))},n.prototype.getMode=function(){var e=r.Constants.TASK_MODE_MODIFY,n=this._propTab.getPropById(t.PropInterface.PROP_TYPE_TASK_MODE);return null!==n&&(e=n.GetComputedValue()),e},n.prototype.SetInRecompute=function(t){this.isInRecompute=t},n.prototype.IsInRecompute=function(){return this.isInRecompute},n.prototype.resetRefreshType=function(){this._refreshType=r.Constants.TASK_REFRESH_NONE},n.prototype.getRefreshType=function(){return this._refreshType},n.prototype.SetRefreshType=function(t){switch(t){case r.Constants.TASK_REFRESH_FORM:case r.Constants.TASK_REFRESH_TABLE:case r.Constants.TASK_REFRESH_CURR_REC:this._refreshType=t}},n.prototype.GetRouterParams=function(){return this.routeParams},n.prototype.getLastParkedCtrl=function(){return this._lastParkedCtrl},n.prototype.isOpenWin=function(){return this._openWin},n.prototype.checkProp=function(t,e){return s(this,void 0,void 0,(function(){var r;return _(this,(function(n){switch(n.label){case 0:return[4,this.getProp(t)];case 1:return null===(r=n.sent())?[3,3]:[4,r.getValueBoolean()];case 2:return[2,n.sent()];case 3:return[2,e]}}))}))},n.prototype.getClickedControl=function(){var t=E.GetRuntimeContext(null).CurrentClickedCtrl;return null!==t&&t.getForm().getTask()!==this&&(t=null),t},n.prototype.getKeyboardMappingState=function(){return this._keyboardMappingState},n.prototype.isStateEnabled=function(t){return(t&this._keyboardMappingState)>0},n.prototype.setKeyboardMappingState=function(t,e){this._keyboardMappingState=e?n.mkInt(n.hiShrt(this._keyboardMappingState)&~t,n.loShrt(this._keyboardMappingState)|t):n.mkInt(n.hiShrt(this._keyboardMappingState)|t,n.loShrt(this._keyboardMappingState)&~t)},n.hiShrt=function(t){return(4294901760&t)>>16},n.loShrt=function(t){return 65535&t},n.mkInt=function(t,e){return t<<16|e},n.prototype.getHelpItem=function(t){if(null!==this._helpTab)return this._helpTab.getHelp(t)},n.prototype.setProp=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this._propTab.setProp(t,e,this,"T")];case 1:return r.sent(),[2]}}))}))},n.prototype.setBrkLevel=function(t,e){this._brkLevel=t,this._brkLevelIndex=e,this.setMainLevel(t)},n.prototype.getBrkLevel=function(){return this._brkLevel},n.prototype.getBrkLevelIndex=function(){return this._brkLevelIndex},n.prototype.setMainLevel=function(t){if(null!==t&&t.length>0){var e=t.charAt(0);e!==r.Constants.TASK_LEVEL_NONE&&e!==r.Constants.TASK_LEVEL_TASK&&e!==r.Constants.TASK_LEVEL_RECORD||(this._mainLevel=t)}},n.prototype.getMainLevel=function(){return this._mainLevel},n.prototype.setLevel=function(t){this._level=t,this._level===r.Constants.TASK_LEVEL_RECORD&&(this._enteredRecLevel=!0)},n.prototype.getLevel=function(){return this._level},n.prototype.setDataSynced=function(t){},n.prototype.getNullArithmetic=function(){return this._nullArithmetic},n.prototype.setLastParkedCtrl=function(t){this._lastParkedCtrl=t,this._currParkedFld=null!==this._lastParkedCtrl?this._lastParkedCtrl.getField():null,this.CurrentEditingControl=t},n.prototype.getCurrField=function(){return this._currParkedFld},n.prototype.setCurrField=function(t){this._currParkedFld=t},n.prototype.getCurrFieldIdx=function(){return null!==this._currParkedFld?this._currParkedFld.getId():-1},n.prototype.getFieldByValueStr=function(t,e,r){return 1===arguments.length?this.getFieldByValueStr_0(t):this.getFieldByValueStr_1(t,e,r)},n.prototype.getFieldByValueStr_0=function(t){var r=new e.RefParam(undefined),n=new e.RefParam(undefined);return this.getFieldByValueStr_1(t,r,n)},n.prototype.getFieldByValueStr_1=function(t,r,n){r.value=n.value=0;var i=null,o=t.indexOf(",");if(o>0){var a=e.NNumber.Parse(t.substr(0,o)),s=e.NNumber.Parse(t.substr(o+1));i=0!==a?this.getFieldDef(a,s):this.getFieldDef(s),r.value=a,n.value=s}return i},n.prototype.getMainProgFieldByValueStr=function(t){var r=e.NNumber.Parse(t)-1;return this.getFieldDef(r)},n.prototype.getFieldDef=function(t,e){return 1===arguments.length?this.getField_0(t):this.getField_1(t,e)},n.prototype.getField_0=function(t){return this.DataView.getField(t)},n.prototype.InitForm=function(){return s(this,void 0,void 0,(function(){var e;return _(this,(function(n){switch(n.label){case 0:return null!==this.Form&&this.isOpenWin()?(this.Form.InInitForm=!0,[4,this.Form.init()]):[3,7];case 1:return n.sent(),this.SetRefreshType(r.Constants.TASK_REFRESH_FORM),[4,this.RefreshDisplay()];case 2:return n.sent(),null!==this.Form.getSubFormCtrl()?[3,5]:null===(e=this.Form.GetComputedProperty(t.PropInterface.PROP_TYPE_HEIGHT))?[3,4]:[4,e.RefreshDisplay(!0)];case 3:n.sent(),n.label=4;case 4:return[3,6];case 5:this.CanResumeSubformLayout()&&this.ResumeSubformLayout(),n.label=6;case 6:F.beginInvoke(),this.Form.InInitForm=!1,n.label=7;case 7:return[2]}}))}))},n.prototype.CanResumeSubformLayout=function(){return!0},n.prototype.ResumeSubformLayout=function(){null!==this.Form&&(null!==this.Form.getSubFormCtrl()&&this.shouldResumeSubformLayout&&(this.shouldResumeSubformLayout=!1))},n.prototype.GetLastParkedCtrlName=function(t){var e=this.GetTaskAncestor(t);null===e||e._lastParkedCtrl;return null===e||null===e._lastParkedCtrl?"":e._lastParkedCtrl.Name},n.prototype.getForm=function(){return this.Form},n.prototype.SetForm=function(t){return this.Form=t,t},n.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},n.prototype.getProp=function(t){return s(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:return e=null,null===this._propTab?[3,2]:null!==(e=this._propTab.getPropById(t))||null===(e=pt.getDefaultProp(t,W.PARENT_TYPE_TASK,this))?[3,2]:(e.StudioValue=e.getOrgValue(),[4,this._propTab.addPropWithCheckExistence(e,!1)]);case 1:r.sent(),r.label=2;case 2:return[2,e]}}))}))},n.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},n.prototype.getCompIdx=function(){return this._compIdx},n.prototype.IsFirstRefreshOfProps=function(){throw new e.NotImplementedException},n.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){var s;return _(this,(function(_){switch(_.label){case 0:return s=null,a.value=!1,o||this.DataViewWasRetrieved?[4,this.CalculateExpression(t,e,r,n,i)]:[3,2];case 1:s=_.sent(),a.value=!0,_.label=2;case 2:return[2,s]}}))}))},n.prototype.GetExpressionStorage=function(t){return this.GetExpressionStorage(t)},n.prototype.isStarted=function(){return!0},n.prototype.isAborting=function(){return!1},n.prototype.getField_1=function(t,e){switch(t){case 0:return this.getFieldDef(e);case n.MAIN_PRG_PARENT_ID:return Qt.MGDataTable.GetMainProgByCtlIdx(this.ContextID,this._ctlIdx).getFieldDef(e);default:return t--,null!=this.StudioParentTask?this.StudioParentTask.getFieldDef(t,e):null}},n.prototype.fillAttributes=function(t){var n=t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex());if(-1!==n&&n<t.getXMLdata().length){var i=t.getXMLsubstring(n);t.add2CurrIndex(i.indexOf(r.XMLConstants.MG_TAG_TASK)+r.XMLConstants.MG_TAG_TASK.length);for(var o=r.XmlParser.getTokens(t.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),a=0;a<o.length;a+=2){var s=o.get_Item(a),_=o.get_Item(a+1);!this.setAttribute(s,_)&&E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("In TaskBase.fillAttributes(): Unprocessed(!) attribute: '{0}' = '{1}'",s,_))}t.setCurrIndex(t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex())+1)}},n.prototype.setAttribute=function(t,n){var i=!0;switch(t){case r.XMLConstants.MG_ATTR_APPL_GUID:this.ApplicationGuid=n;break;case r.XMLConstants.MG_ATTR_PROGRAM_ISN:this.ProgramIsn=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_TASK_ISN:this.TaskIsn=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_TOOLKIT_PARENT_TASK:0!==e.NNumber.Parse(n)&&(this.StudioParentTask=Qt.MGDataTable.GetTaskByID(n)),this.IsSubtask=!0;break;case r.XMLConstants.MG_ATTR_TASKID:this.setTaskId(n),E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog("TASK: "+this._taskTag);break;case r.XMLConstants.MG_ATTR_CTL_IDX:this.setCtlAndCompIdx(n);break;case r.XMLConstants.MG_ATTR_MAINPRG:this.setMainPrg(n);break;case r.XMLConstants.MG_ATTR_NULL_ARITHMETIC:this.setNullArithmetic(n);break;case r.XMLConstants.MG_ATTR_INTERACTIVE:this.setIsInteracive(n);break;case r.XMLConstants.MG_ATTR_OPEN_WIN:this.setOpenWin(n);break;case r.XMLConstants.MG_ATTR_ALLOW_EVENTS:this.SetAllowEvents(n);break;case r.XMLConstants.MG_ATTR_ISPRG:this.setIsPrg(n);break;case r.XMLConstants.MG_ATTR_ICON_FILE_NAME:this.IconFileName=n;break;case r.XMLConstants.MG_ATTR_PARALLEL:this.IsParallel=r.XmlParser.getBoolean(n);break;case r.XMLConstants.MG_ATTR_ROUTER_PATH:this.routerPath=n;break;case r.XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:this.inDefaultRouterOutlet=r.XmlParser.getBoolean(n);break;default:i=!1}return i},n.prototype.initInnerObjects=function(t,n,i){return s(this,void 0,void 0,(function(){var o,a;return _(this,(function(s){switch(s.label){case 0:switch(t){case r.XMLConstants.MG_TAG_HELPTABLE:return[3,1];case r.XMLConstants.MG_TAG_DVHEADER:return[3,2];case r.XMLConstants.MG_TAG_PROP:return[3,4];case r.XMLConstants.MG_TAG_FORM:return[3,6];case r.XMLConstants.MG_ATTR_MENU_CONTENT:return[3,8];case"assemblies":return[3,9]}return[3,10];case 1:return null==this._helpTab&&(this._helpTab=new Jt),E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("{0} ...",t)),this._helpTab.fillData(i),[3,11];case 2:return E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("{0} ...",t)),[4,this.DataView.fillHeaderData(i)];case 3:return s.sent(),[3,11];case 4:return[4,this._propTab.fillData(this,"T",i)];case 5:return s.sent(),[3,11];case 6:return o=this,[4,this.FormInitData(n)];case 7:return o.Form=s.sent(),[3,11];case 8:return[3,11];case 9:return i.getCurrIndex(),a=i.getXMLdata().indexOf("/assemblies",i.getCurrIndex()),i.setCurrIndex(a),i.setCurrIndex2EndOfTag(),[3,11];case 10:return[2,!1];case 11:return[2,!0]}}))}))},n.prototype.FormInitData=function(t){return s(this,void 0,void 0,(function(){var n;return _(this,(function(i){switch(i.label){case 0:return!1,n=new e.RefParam(false),null===this.Form&&(this.Form=this.ConstructMgForm(n)),this.Form.ParentForm=t,E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog("form"),[4,this.Form.fillData(this)];case 1:return i.sent(),[2,this.Form]}}))}))},n.prototype.setTaskId=function(t){this._taskTag=t},n.prototype.setCtlAndCompIdx=function(t){var r=t.indexOf(",");r>-1&&(this._ctlIdx=e.NNumber.Parse(t.substr(0,r)),this._compIdx=e.NNumber.Parse(t.substr(r+1)))},n.prototype.GetAncestorTaskContainingForm=function(){for(var t=this.GetTaskAncestor(1);null!==t&&null===t.getForm();)t=t.GetTaskAncestor(1);return t},n.prototype.setMainPrg=function(t){this._isMainPrg=r.XmlParser.getBoolean(t)},n.prototype.setNullArithmetic=function(t){this._nullArithmetic=t.charAt(0)},n.prototype.setIsInteracive=function(t){this.IsInteractive=r.XmlParser.getBoolean(t)},n.prototype.setOpenWin=function(t){this._openWin=r.XmlParser.getBoolean(t)},n.prototype.SetOpenWin=function(t){this._openWin=t},n.prototype.SetAllowEvents=function(t){this._allowEvents=r.XmlParser.getBoolean(t)},n.prototype.setIsPrg=function(t){this._isPrg=r.XmlParser.getBoolean(t)},n.prototype.ShouldEvaluatePropertyLocally=function(t){return!1},n.prototype.WriteToMessagePane=function(t,e){null!=t&&console.log(t)},n.prototype.WriteToMessagePanebyMsgId=function(t,e){var r=E.GetMessageString(t);this.WriteToMessagePane(r,e)},n}();qt.MAIN_PRG_PARENT_ID=32768;var $t=function(){function t(t){this._timerIntervalMilliSeconds=0,this._threadTimer=null,this._timerIntervalMilliSeconds=t}return t.Run=function(t){E.OnTimer(t)},t.prototype.Start=function(){var e=this,r=i.timer(this._timerIntervalMilliSeconds,this._timerIntervalMilliSeconds);this._threadTimer=r.subscribe((function(r){return t.Run(e)}))},t.prototype.Stop=function(){this._threadTimer.unsubscribe(),this._threadTimer=null},t}(),te=function(){function t(t,e){this.Username=null,this.Password=null,0!==arguments.length?this.constructor_1(t,e):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e){this.Username=t,this.Password=e},t.prototype.toString=function(){var t=new e.StringBuilder;return t.Append(this.Username),t.Append(":"),t.Append(this.Password||"null"),t.ToString()},t}(),ee=function(t){function r(e,r,n){var i=t.call(this,e,n)||this;return i.NewUserName=null,i.NewPassword=null,0===arguments.length?(i.constructor_2(),i):(i.constructor_3(e,r,n),i)}return a(r,t),r.prototype.constructor_2=function(){},r.prototype.constructor_3=function(t,e,r){this.NewUserName=e},r.prototype.ToString=function(){var t=new e.StringBuilder;return t.Append(this.Username),t.Append(":"),t.Append(this.NewUserName),t.Append(":"),t.Append(this.Password||"null"),t.ToString()},r}(te),re=function(t){function e(e,r,n){var i=t.call(this)||this;return i._credentials=new te,i.ChangePasswordRequested=!1,0===arguments.length?i.constructor_0():1===arguments.length?i.constructor_1(e):i.constructor_2(e,r,n),i}return a(e,t),e.prototype.constructor_0=function(){this.constructor_2(null,null,null)},e.prototype.constructor_1=function(t){this.constructor_2(t,null,null)},e.prototype.constructor_2=function(t,e,r){},e.prototype.closeDialog=function(){t.prototype.closeDialog.call(this)},e.prototype.setCredentials=function(t){this._credentials.Username=t.Username,this._credentials.Password=t.Password},e.prototype.getCredentials=function(){return this._credentials},e}(vt),ne=function(){function t(){}return t.InvokeOS=function(t,e,r,n,i){return-1},t.SeparateParams=function(t){var e=new Array(2),r=null,n=null,i=-1;return'"'===(t=t.trim())[0]&&(i=t.indexOf('"',1)),-1===i&&(i=t.indexOf(" ",0)),-1===i&&(i=t.length-1),r=t.substr(0,i+1-0),e[0]=r.trim(),n=t.substr(i+1,t.length-(i+1)),e[1]=n.trim(),e},t}();t.AuthenticationDialogHandler=re,t.BlobType=K,t.CellElement=st,t.ChangePasswordCredentials=ee,t.Commands=F,t.ContextIDGuard=H,t.ControlBase=h,t.ControlTable=mt,t.CustomValidator=Et,t.CustomValidatorProp=Tt,t.DateBreakParams=nt,t.DcValues=Ct,t.DcValuesBuilderBase=Ut,t.DialogHandler=vt,t.DisplayConvertor=$,t.EMPTY_DCREF=-2,t.Events=E,t.EventsProcessor=Mt,t.ExpVal=Xt,t.ExpressionInterface=Ft,t.FieldDef=_t,t.FieldValidator=gt,t.FieldsTable=Gt,t.FocusManager=At,t.GuiCommand=w,t.GuiCommandQueue=f,t.GuiConstants=W,t.GuiControlPropertyAdapter=Pt,t.GuiDataCollection=Qt,t.GuiDataViewBase=kt,t.GuiEnvironment=x,t.GuiExpressionEvaluator=xt,t.GuiFieldBase=lt,t.GuiFormPropertyAdapter=It,t.GuiInteractive=G,t.GuiInteractiveBase=O,t.GuiMgControl=k,t.GuiMgForm=T,t.GuiTaskBase=qt,t.HebrewDate=q,t.Helps=Jt,t.InternalHelp=Wt,t.KeyboardItem=Dt,t.LastFocusedVal=bt,t.MagicHelp=Ht,t.Manager=X,t.MemoryUtil=Q,t.MgControlBase=Lt,t.MgFormBase=Nt,t.MgTimer=$t,t.MgValue=P,t.NOT_FOUND=St,t.NUM_TYPE=Z,t.ObjectReference=dt,t.ObjectReferenceBase=Vt,t.ObjectReferencesCollection=wt,t.OperData=J,t.PIC=z,t.ProcessLauncher=ne,t.PromptpHelp=Kt,t.PropDefaults=ht,t.PropTable=ft,t.Property=pt,t.RecordUtils=ot,t.Row=yt,t.RuntimeContextBase=Yt,t.Styles=Bt,t.TaskDefinitionId=ut,t.TaskDefinitionIdTableSaxHandler=ct,t.TimeBreakParams=tt,t.ToolTipHelp=zt,t.UIBridge=I,t.URLHelp=jt,t.UsernamePasswordCredentials=te,t.ValidationDetails=Rt,t.ValidationDetailsBase=j,t.VectorType=at,t.VectorTypeBase=it,t.WindowsHelp=Zt,t.WrongFormatException=Ot,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},o(t,e)};function a(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function s(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{_(n.next(t))}catch(t){o(t)}}function s(t){try{_(n.throw(t))}catch(t){o(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}_((n=n.apply(t,e||[])).next())}))}function _(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function P(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}var c=function(){this.str=null,this.caption=null,this.title=null,this.path=null,this.filter=null,this.boolVal=!1,this.bool1=!1,this.style=0,this.number=0,this.obj=null,this.listOfIntArr=null},T=function(){},h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(T),E=function(){function t(){}return t.OnFocus=function(r,n,i,o){e.Debug.Assert(null!==t.FocusEvent),t.FocusEvent(r,n,i,o)},t.OnFocusOnNonMagicControl=function(r){e.Debug.Assert(null!==t.FocusOnNonMagicControlEvent),t.FocusOnNonMagicControlEvent(r)},t.OnMouseDown=function(r,n,i,o,a,s,_){e.Debug.Assert(null!==t.MouseDownEvent),t.MouseDownEvent(r,n,i,o,a,s,_)},t.OnNonParkableLastParkedCtrl=function(e){null!==t.NonParkableLastParkedCtrlEvent&&t.NonParkableLastParkedCtrlEvent(e)},t.OnTableReorder=function(e,r){null!==t.TableReorderEvent&&t.TableReorderEvent(e,r)},t.OnMouseUp=function(e,r){null!==t.MouseUpEvent&&t.MouseUpEvent(e,r)},t.OnComboDroppingDown=function(r,n){e.Debug.Assert(null!==t.ComboDroppingDownEvent),t.ComboDroppingDownEvent(r,n)},t.OnSelection=function(r,n,i,o){e.Debug.Assert(null!==t.SelectionEvent),t.SelectionEvent(r,n,i,o)},t.OnDblClick=function(r,n){e.Debug.Assert(null!==t.DblClickEvent),t.DblClickEvent(r,n)},t.OnKeyDown=function(e,r,n,i,o,a,s,_,l,u,P){11===arguments.length?t.OnKeyDown_0(e,r,n,i,o,a,s,_,l,u,P):10===arguments.length?t.OnKeyDown_1(e,r,n,i,o,a,s,_,l,u):t.OnKeyDown_2(e,r,n,i,o,a,s)},t.OnKeyDown_0=function(r,n,i,o,a,s,_,l,u,P,c){e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,a,s,_,l,u,P,c)},t.OnMultiMarkHit=function(r,n,i){e.Debug.Assert(null!==t.MultimarkHitEvent),t.MultimarkHitEvent(r,n,i)},t.OnKeyDown_1=function(r,n,i,o,a,s,_,l,u,P){return e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,a,s,_,l,u,!1,P)},t.OnKeyDown_2=function(r,n,i,o,a,s,_){return e.Debug.Assert(null!==t.KeyDownEvent),t.KeyDownEvent(r,n,i,o,0,0,null,!1,a,s,_)},t.OnFormClose=function(r){return e.Debug.Assert(null!==t.CloseFormEvent),t.CloseFormEvent(r)},t.OnDispose=function(r){e.Debug.Assert(null!==t.DisposeEvent),t.DisposeEvent(r)},t.OnTimer=function(r){e.Debug.Assert(null!==t.TimerEvent),t.TimerEvent(r)},t.OnTableResize=function(e,r){null!==t.TableResizeEvent&&t.TableResizeEvent(e,r)},t.OnGetRowsData=function(e,r,n,i){null!==t.GetRowsDataEvent&&t.GetRowsDataEvent(e,r,n,i)},t.OnColumnClick=function(r,n,i){e.Debug.Assert(null!==t.ColumnClickEvent),t.ColumnClickEvent(r,n,i)},t.RefreshTables=function(){null!==t.RefreshTablesEvent&&t.RefreshTablesEvent()},t.OnCloseHelp=function(e){null!==t.HelpCloseEvent&&t.HelpCloseEvent(e)},t.IsBatchRunningInMainContext=function(){var e=!1;return null!==t.IsBatchRunningInMainContextEvent&&(e=t.IsBatchRunningInMainContextEvent()),e},t.Translate=function(r){return e.Debug.Assert(null!==t.TranslateEvent),null!==r&&r.length>0?t.TranslateEvent(r):r},t.OnPrintPreviewStart=function(e,r,n,i,o){null!==t.PrintPreviewStartEvent&&t.PrintPreviewStartEvent(e,r,n,i,o)},t.OnPrintPreviewSetCursor=function(e){null!==t.PrintPreviewSetCursorEvent&&t.PrintPreviewSetCursorEvent(e)},t.InvokeUDP=function(e){var r=0;return null!==t.InvokeUDPEvent&&(r=t.InvokeUDPEvent(e)),r},t.OnPrintPreviewUpdate=function(e){null!==t.PrintPreviewUpdateEvent&&t.PrintPreviewUpdateEvent(e)},t.OnCreateRichWindow=function(e,r,n,i,o){null!==t.CreateRichWindowEvent&&t.CreateRichWindowEvent(e,r,n,i,o)},t.OnCreateGuiWindow=function(e,r,n,i,o,a,s,_,l,u,P,c){var T=0;return null!==t.CreateGuiWindowEvent&&(T=t.CreateGuiWindowEvent(e,r,n,i,o,a,s,_,l,u,P,c)),T},t.OnDestroyGuiWindow=function(e){null!==t.DestroyGuiWindowEvent&&t.DestroyGuiWindowEvent(e)},t.OnPrintPreviewClose=function(e){null!==t.PrintPreviewCloseEvent&&t.PrintPreviewCloseEvent(e)},t.OnShowPrintDialog=function(e){var r=0;return null!==t.ShowPrintDialogEvent&&(r=t.ShowPrintDialogEvent(e)),r},t.DisplaySessionStatistics=function(){null!==t.DisplaySessionStatisticsEvent&&t.DisplaySessionStatisticsEvent()},t.ShouldBlockMouseEvents=function(e){return null!==t.ShouldBlockMouseEventsEvent&&t.ShouldBlockMouseEventsEvent(e)},t.PeekEndOfWork=function(){return null!==t.PeekEndOfWorkEvent&&t.PeekEndOfWorkEvent()},t.GetEventTime=function(){return null!==t.GetEventTimeEvent?t.GetEventTimeEvent():0},t.OnScrollTable=function(e,r,n,i,o,a){var s=!1;return null!==t.ScrollTableEvent&&(s=t.ScrollTableEvent(e,r,n,i,o,a)),s},t.GetDropUserFormats=function(){return e.Debug.Assert(null!==t.GetDropUserFormatsEvent),t.GetDropUserFormatsEvent()},t.GetContextID=function(r){var n=-1;return e.Debug.Assert(null!==r),null!==t.GetContextIDEvent&&(n=t.GetContextIDEvent(r)),n},t.SetModal=function(e,r){null!==t.SetModalEvent&&t.SetModalEvent(e,r)},t.OnShowForm=function(e){null!==t.ShowFormEvent&&t.ShowFormEvent(e)},t.OnFormActivate=function(e){null!==t.OnFormActivateEvent&&t.OnFormActivateEvent(e)},t.OnNCActivate=function(e){null!==t.OnNCActivateEvent&&t.OnNCActivateEvent(e)},t.HandleKeyUpMessage=function(e,r){null!==t.HandleKeyUpMessageEvent&&t.HandleKeyUpMessageEvent(e,r)},t.IsLogonRTL=function(){var e=!1;return null!==t.OnIsLogonRTLEvent&&(e=t.OnIsLogonRTLEvent()),e},t.IsSpecialEngLogon=function(){var e=!1;return null!==t.OnIsSpecialEngLogonEvent&&(e=t.OnIsSpecialEngLogonEvent()),e},t.IsSpecialIgnoreButtonFormat=function(){var e=!1;return null!==t.OnIsSpecialIgnoreButtonFormatEvent&&(e=t.OnIsSpecialIgnoreButtonFormatEvent()),e},t.GetMainProgram=function(r,n){return e.Debug.Assert(null!==t.GetMainProgramEvent),t.GetMainProgramEvent(r,n)},t.TranslateLogicalName=function(r){return e.Debug.Assert(null!==t.TranslateLogicalNameEvent),t.TranslateLogicalNameEvent(r)},t.GetMessageString=function(r){e.Debug.Assert(null!==t.GetMessageStringEvent);var n=t.GetMessageStringEvent(r),i=t.Translate(n);if(null!==i&&i.endsWith(":")){var o=void 0;(o=new e.StringBuilder(i)).Insert(i.length," "),i=o.ToString()}return i},t.OnCtrlFocus=function(e,r){null!==t.CtrlFocusEvent&&t.CtrlFocusEvent(e,r)},t.GetRuntimeContext=function(r){return e.Debug.Assert(null!==t.GetRuntimeContextEvent),t.GetRuntimeContextEvent(r)},t.SaveLastClickedCtrlName=function(e,r){null!==t.SaveLastClickedCtrlEvent&&t.SaveLastClickedCtrlEvent(e,r)},t.SaveLastClickInfo=function(e,r,n,i,o,a,s){null!==t.SaveLastClickInfoEvent&&t.SaveLastClickInfoEvent(e,r,n,i,o,a,s)},t.WriteErrorToLog=function(r){e.Debug.Assert(null!==t.WriteErrorToLogEvent),t.WriteErrorToLogEvent(r)},t.WriteExceptionToLog=function(e){1!==arguments.length||null!==e&&e.constructor!==String?t.WriteExceptionToLog_1(e):t.WriteExceptionToLog_0(e)},t.WriteExceptionToLog_0=function(r){e.Debug.Assert(null!==t.WriteErrorToLogEvent),t.WriteErrorToLogEvent(r)},t.WriteExceptionToLog_1=function(n){t.WriteExceptionToLog(e.NString.Format("{0} : {1}{2}{3}{4}",[n.GetType(),r.OSEnvironment.EolSeq,n.StackTrace,r.OSEnvironment.EolSeq,n.Message]))},t.WriteWarningToLog=function(e){1!==arguments.length||null!==e&&e.constructor!==String?t.WriteWarningToLog_1(e):t.WriteWarningToLog_0(e)},t.WriteWarningToLog_0=function(r){e.Debug.Assert(null!==t.WriteWarningToLogEvent),t.WriteWarningToLogEvent(r)},t.WriteWarningToLog_1=function(e){t.WriteWarningToLog(e.GetType()+" : "+r.OSEnvironment.EolSeq+e.StackTrace+r.OSEnvironment.EolSeq+e.Message)},t.ShouldLog=function(r){return e.Debug.Assert(null!==t.ShouldLogEvent),t.ShouldLogEvent(r)},t.WriteGuiToLog=function(r){e.Debug.Assert(null!==t.WriteGuiToLogEvent),t.WriteGuiToLogEvent("GUI: "+r)},t.WriteDevToLog=function(r){e.Debug.Assert(null!==t.WriteDevToLogEvent),t.WriteDevToLogEvent(r)},t.OnClear=function(e){null!==t.ClearEvent&&t.ClearEvent(e)},t.OnUndo=function(e){null!==t.UndoEvent&&t.UndoEvent(e)},t.AddEnterAsKeyEvent=function(){return null!==t.ShouldAddEnterAsKeyEvent&&t.ShouldAddEnterAsKeyEvent()},t.ShowSessionStatisticsForm=function(){null!==t.ShowSessionStatisticsEvent&&t.ShowSessionStatisticsEvent()},t.OnCopyData=function(e,r){null!==t.CopyDataEvent&&t.CopyDataEvent(e,r)},t}();E.NonParkableLastParkedCtrlEvent=null,E.IsBatchRunningInMainContextEvent=null,E.TranslateEvent=null,E.PrintPreviewStartEvent=null,E.PrintPreviewSetCursorEvent=null,E.InvokeUDPEvent=null,E.PrintPreviewUpdateEvent=null,E.CreateRichWindowEvent=null,E.CreateGuiWindowEvent=null,E.DestroyGuiWindowEvent=null,E.PrintPreviewCloseEvent=null,E.ShowPrintDialogEvent=null,E.SetModalEvent=null,E.CtrlFocusEvent=null,E.GetRuntimeContextEvent=null,E.SaveLastClickedCtrlEvent=null,E.SaveLastClickInfoEvent=null,E.WriteErrorToLogEvent=null,E.WriteExceptionToLogEvent=null,E.WriteWarningToLogEvent=null,E.ShouldLogEvent=null,E.WriteGuiToLogEvent=null,E.WriteDevToLogEvent=null,E.ClearEvent=null,E.UndoEvent=null,E.ShouldAddEnterAsKeyEvent=null,E.ShowSessionStatisticsEvent=null,E.CopyDataEvent=null,E.FocusEvent=null,E.FocusOnNonMagicControlEvent=null,E.MouseDownEvent=null,E.TableReorderEvent=null,E.MouseUpEvent=null,E.ComboDroppingDownEvent=null,E.SelectionEvent=null,E.DblClickEvent=null,E.KeyDownEvent=null,E.MultimarkHitEvent=null,E.CloseFormEvent=null,E.DisposeEvent=null,E.TimerEvent=null,E.TableResizeEvent=null,E.GetRowsDataEvent=null,E.EnableCutCopyEvent=null,E.EnablePasteEvent=null,E.ColumnClickEvent=null,E.RefreshTablesEvent=null,E.HelpCloseEvent=null,E.DisplaySessionStatisticsEvent=null,E.ShouldBlockMouseEventsEvent=null,E.PeekEndOfWorkEvent=null,E.GetEventTimeEvent=null,E.ScrollTableEvent=null,E.GetDropUserFormatsEvent=null,E.GetContextIDEvent=null,E.ShowFormEvent=null,E.OnFormActivateEvent=null,E.OnNCActivateEvent=null,E.HandleKeyUpMessageEvent=null,E.OnIsLogonRTLEvent=null,E.OnIsSpecialEngLogonEvent=null,E.OnIsSpecialIgnoreButtonFormatEvent=null,E.GetMainProgramEvent=null,E.TranslateLogicalNameEvent=null,E.GetMessageStringEvent=null;var p,I=function(){function t(){this.getInteractiveCallback=null,this.executeCommandsCallback=null}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.ExecuteInteractiveCommand=function(t){return null!=this.getInteractiveCallback?this.getInteractiveCallback(t):""},t.prototype.executeCommands=function(t){null!=this.executeCommandsCallback&&null!=t&&this.executeCommandsCallback(t)},t.prototype.registerInteractiveCallback=function(t){this.getInteractiveCallback=t},t.prototype.registerExecuteCommandsCallback=function(t){this.executeCommandsCallback=t},t.prototype.saveData=function(t){console.log(t)},t}(),f=function(){function t(){this._commandsQueue=null,this._executingGuiCommands=!1,this.init()}return t.getInstance=function(){return null===t._instance&&(t._instance=new t),t._instance},t.prototype.init=function(){this._commandsQueue=new Array},t.prototype.addCommand=function(t){this.put(t)},t.prototype.put=function(t){this._commandsQueue.push(t)},t.prototype.beginInvoke=function(){this.invoke()},t.prototype.invoke=function(){this._executingGuiCommands||(this._executingGuiCommands=!0,I.getInstance().executeCommands(this._commandsQueue),this._commandsQueue.length=0,this._executingGuiCommands=!1)},t}();f._instance=null,t.InteractiveCommandType=void 0,(p=t.InteractiveCommandType||(t.InteractiveCommandType={}))[p.GET_FONT_METRICS=0]="GET_FONT_METRICS",p[p.GET_RESOLUTION=1]="GET_RESOLUTION",p[p.GET_BOUNDS=2]="GET_BOUNDS",p[p.GET_VALUE=3]="GET_VALUE",p[p.SET_BROWSER_TEXT=4]="SET_BROWSER_TEXT",p[p.GET_BROWSER_TEXT=5]="GET_BROWSER_TEXT",p[p.BROWSER_EXECUTE=6]="BROWSER_EXECUTE",p[p.GET_TOP_INDEX=7]="GET_TOP_INDEX",p[p.MESSAGE_BOX=8]="MESSAGE_BOX",p[p.SET_TITLE=9]="SET_TITLE",p[p.DIRECTORY_DIALOG_BOX=10]="DIRECTORY_DIALOG_BOX",p[p.GET_CLIENT_BOUNDS=11]="GET_CLIENT_BOUNDS",p[p.SET_EDIT_TEXT=12]="SET_EDIT_TEXT",p[p.INSERT_EDIT_TEXT=13]="INSERT_EDIT_TEXT",p[p.SET_SELECTION=14]="SET_SELECTION",p[p.GET_SELECTION=15]="GET_SELECTION",p[p.GET_CARET_POS=16]="GET_CARET_POS",p[p.REFRESH_PAGE=17]="REFRESH_PAGE",p[p.GET_IS_TOP_OF_TEXTBOX=18]="GET_IS_TOP_OF_TEXTBOX",p[p.GET_IS_END_OF_TEXTBOX=19]="GET_IS_END_OF_TEXTBOX",p[p.CLIPBOARD_GET_CONTENT=20]="CLIPBOARD_GET_CONTENT",p[p.CLIPBOARD_SET_CONTENT=21]="CLIPBOARD_SET_CONTENT",p[p.CLIPBOARD_PASTE=22]="CLIPBOARD_PASTE",p[p.POST_KEY_EVENT=23]="POST_KEY_EVENT",p[p.POST_CHAR_EVENT=24]="POST_CHAR_EVENT",p[p.SET_CURSOR=25]="SET_CURSOR",p[p.DISPOSE_ALL_FORMS=26]="DISPOSE_ALL_FORMS",p[p.GET_ROWS_IN_PAGE=27]="GET_ROWS_IN_PAGE",p[p.GET_HIDDEN_ROWS_COUNT_IN_TABLE=28]="GET_HIDDEN_ROWS_COUNT_IN_TABLE",p[p.FILE_OPEN_DIALOG_BOX=29]="FILE_OPEN_DIALOG_BOX",p[p.FILE_SAVE_DIALOG_BOX=30]="FILE_SAVE_DIALOG_BOX",p[p.CREATE_DIALOG=31]="CREATE_DIALOG",p[p.OPEN_DIALOG=32]="OPEN_DIALOG",p[p.CLOSE_DIALOG=33]="CLOSE_DIALOG",p[p.SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA=34]="SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA",p[p.REFLECTION_INVOKE=35]="REFLECTION_INVOKE",p[p.REFLECTION_SET=36]="REFLECTION_SET",p[p.GET_LAST_WINDOW_STATE=37]="GET_LAST_WINDOW_STATE",p[p.GET_FRAMES_BOUNDS=38]="GET_FRAMES_BOUNDS",p[p.GET_LINKED_PARENT_IDX=39]="GET_LINKED_PARENT_IDX",p[p.GET_FORM_BOUNDS=40]="GET_FORM_BOUNDS",p[p.GET_COLUMNS_STATE=41]="GET_COLUMNS_STATE",p[p.GET_FORM_HANDLE=42]="GET_FORM_HANDLE",p[p.GET_CTRL_HANDLE=43]="GET_CTRL_HANDLE",p[p.IS_FORM_ACTIVE=44]="IS_FORM_ACTIVE",p[p.SET_MARKED_TEXT_ON_RICH_EDIT=45]="SET_MARKED_TEXT_ON_RICH_EDIT",p[p.SEND_IME_MSG=46]="SEND_IME_MSG",p[p.CAN_FOCUS=47]="CAN_FOCUS",p[p.INVOKE_OSCOMMAND=48]="INVOKE_OSCOMMAND",p[p.GET_SELECTED_INDICE=49]="GET_SELECTED_INDICE",p[p.SET_SUGGESTED_VALUE=50]="SET_SUGGESTED_VALUE",p[p.MAP_WIDGET_TO_GUI_OBJECT=51]="MAP_WIDGET_TO_GUI_OBJECT",p[p.REMOVE_DN_CONTROL_VALUE_CHANGED_HANDLER=52]="REMOVE_DN_CONTROL_VALUE_CHANGED_HANDLER",p[p.ADD_DN_CONTROL_VALUE_CHANGED_HANDLER=53]="ADD_DN_CONTROL_VALUE_CHANGED_HANDLER",p[p.GET_RTF_VALUE_BEFORE_ENTERING_CONTROL=54]="GET_RTF_VALUE_BEFORE_ENTERING_CONTROL",p[p.ATTACH_DNKEY_TO_OBJECT=55]="ATTACH_DNKEY_TO_OBJECT",p[p.GET_DVCONTROL_POSITION_ISN=56]="GET_DVCONTROL_POSITION_ISN",p[p.CLEAR_DATA_TABLE=57]="CLEAR_DATA_TABLE",p[p.SET_DATA_SOURCE_TO_DVCONTROL=58]="SET_DATA_SOURCE_TO_DVCONTROL",p[p.ACTIVATE_FORM=59]="ACTIVATE_FORM",p[p.IS_COMBO_DROPPED_DOWN=60]="IS_COMBO_DROPPED_DOWN",p[p.OPEN_FORM_DESIGNER=61]="OPEN_FORM_DESIGNER",p[p.INVOKE_UDPCOMMAND=62]="INVOKE_UDPCOMMAND",p[p.GET_HASINDENT=63]="GET_HASINDENT",p[p.GET_IS_ROW_EDITING=64]="GET_IS_ROW_EDITING",p[p.GET_MAX_ROWS_IN_PAGINATED_TABLE=65]="GET_MAX_ROWS_IN_PAGINATED_TABLE",p[p.CALL_JS=66]="CALL_JS",p[p.GET_LAST_ROUTE=67]="GET_LAST_ROUTE";var O=function(){function e(){this._commandType=0,this.TaskTag=null,this.controlName=null,this._x=0,this._y=0,this._char=null,this._str=String.fromCharCode(0),this._intVal1=0,this._line=0,this._obj1=null,this._parameters=null,this._boolVal=!1,this._obj2=null,this._mgValue=null,this._setValue=!1,this.resultString=String.fromCharCode(0)}return e.prototype.canFocus=function(e){return this._commandType=t.InteractiveCommandType.CAN_FOCUS,this._obj1=e,this._mgValue=new c,this.Invoke(),this._mgValue.boolVal},e.prototype.GetSelectedIndice=function(e){return this._commandType=t.InteractiveCommandType.GET_SELECTED_INDICE,this._obj1=e,this._mgValue=new c,this.Invoke(),this._mgValue.str},e.prototype.GetHasIndent=function(e){return this._commandType=t.InteractiveCommandType.GET_HASINDENT,this._obj1=e,this.Invoke(),this._boolVal},e.prototype.setGetSuggestedValueOfChoiceControlOnTagData=function(e,r,n){this._commandType=t.InteractiveCommandType.SET_GET_SUGGESTED_VALUE_FOR_CHOICE_CONTROL_ON_TAGDATA,this._obj2=e,this._line=r,this._boolVal=n,this.Invoke()},e.prototype.getValue=function(e,r){return this._commandType=t.InteractiveCommandType.GET_VALUE,this._obj2=e,this._line=r,this._mgValue=new c,this.Invoke(),this._mgValue.obj},e.prototype.getTopIndex=function(e){return this._commandType=t.InteractiveCommandType.GET_TOP_INDEX,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getIsRowEditing=function(e,r,n){return this._commandType=t.InteractiveCommandType.GET_IS_ROW_EDITING,this._obj2=e,this._intVal1=r,this._boolVal=n,this.Invoke(),this._boolVal},e.prototype.browserExecute=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.BROWSER_EXECUTE,this._obj2=e,this._mgValue=new c,this._mgValue.str=r,this._mgValue.obj=i,!n||(this.Invoke(),this._mgValue.boolVal)},e.prototype.messageBox=function(e,r,n){return this._commandType=t.InteractiveCommandType.MESSAGE_BOX,this._mgValue=new c,this._mgValue.title=e,this._mgValue.str=null===r?"":r,this._mgValue.style=n,E.RefreshTables(),this.Invoke(),this._mgValue.number},e.prototype.setTitle=function(e,r){this._commandType=t.InteractiveCommandType.SET_TITLE,this._mgValue=new c,this._obj2=e,this._mgValue.title=null===r?"":r,this.Invoke()},e.prototype.invokeUDP=function(e){return this._commandType=t.InteractiveCommandType.INVOKE_UDPCOMMAND,this._mgValue=new c,this._mgValue.obj=e,this.Invoke(),this._mgValue.number},e.prototype.directoryDialogBox=function(e,r,n){return this._commandType=t.InteractiveCommandType.DIRECTORY_DIALOG_BOX,this._mgValue=new c,this._mgValue.caption=e,this._mgValue.path=r,this._mgValue.bool1=n,this.Invoke(),this._mgValue.str},e.prototype.fileOpenDialogBox=function(e,r,n,i,o,a){return this._commandType=t.InteractiveCommandType.FILE_OPEN_DIALOG_BOX,this._mgValue=new c,this._mgValue.title=e,this._mgValue.path=r,this._mgValue.str=n,this._mgValue.filter=i,this._mgValue.boolVal=o,this._mgValue.bool1=a,this.Invoke(),this._mgValue.str},e.prototype.fileSaveDialogBox=function(e,r,n,i,o,a){return this._commandType=t.InteractiveCommandType.FILE_SAVE_DIALOG_BOX,this._mgValue=new c,this._mgValue.title=e,this._mgValue.path=r,this._mgValue.str=n,this._mgValue.filter=i,this._mgValue.caption=o,this._mgValue.bool1=a,this.Invoke(),this._mgValue.str},e.prototype.createDialog=function(e,r){this._commandType=t.InteractiveCommandType.CREATE_DIALOG,this._parameters=r,this._obj2=e,this.Invoke()},e.prototype.closeDialog=function(e){this._commandType=t.InteractiveCommandType.CLOSE_DIALOG,this._obj2=e,this.Invoke()},e.prototype.setEditText=function(e,r,n){return this._commandType=t.InteractiveCommandType.SET_EDIT_TEXT,this._obj2=e,this._line=r,this._mgValue=new c,this._mgValue.str=n,this.Invoke(),this._mgValue.boolVal},e.prototype.insertEditText=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.INSERT_EDIT_TEXT,this._obj2=e,this._line=r,this._mgValue=new c,this._mgValue.str=i,this._intVal1=n,this.Invoke(),this._mgValue.boolVal},e.prototype.setSelection=function(e,r,n,i,o){this._commandType=t.InteractiveCommandType.SET_SELECTION,this._obj2=e,this._line=r,this._x=n,this._y=i,this._mgValue=new c,this._mgValue.number=o,this.Invoke()},e.prototype.setSuggestedValue=function(e,r){this._commandType=t.InteractiveCommandType.SET_SUGGESTED_VALUE,this._obj2=e,this._mgValue=new c,this._mgValue.str=r,this.Invoke()},e.prototype.caretPosGet=function(e,r){return this._commandType=t.InteractiveCommandType.GET_CARET_POS,this._obj2=e,this._line=r,this._mgValue=new c,this.Invoke(),this._mgValue.number},e.prototype.RefreshPage=function(e,r){this._commandType=t.InteractiveCommandType.REFRESH_PAGE,this._boolVal=e,this._obj1=r,this.Invoke()},e.prototype.getIsTopOfTextBox=function(e,r){return this._commandType=t.InteractiveCommandType.GET_IS_TOP_OF_TEXTBOX,this._obj2=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.getIsEndOfTextBox=function(e,r){return this._commandType=t.InteractiveCommandType.GET_IS_END_OF_TEXTBOX,this._obj2=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.postKeyEvent=function(e,r,n,i,o){this._commandType=t.InteractiveCommandType.POST_KEY_EVENT,this._obj2=e,this._line=r,this._mgValue=new c,this._mgValue.str=n,this._mgValue.bool1=o,this._boolVal=i,this.Invoke()},e.prototype.postCharEvent=function(e,r,n){this._commandType=t.InteractiveCommandType.POST_CHAR_EVENT,this._obj2=e,this._line=r,this._char=n,this.Invoke()},e.prototype.disposeAllForms=function(){this._commandType=t.InteractiveCommandType.DISPOSE_ALL_FORMS,this.Invoke()},e.prototype.getRowsInPage=function(e){return this._commandType=t.InteractiveCommandType.GET_ROWS_IN_PAGE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getMaxRowsInPaginatedTable=function(e){return this._commandType=t.InteractiveCommandType.GET_MAX_ROWS_IN_PAGINATED_TABLE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getLastRoute=function(){return this._commandType=t.InteractiveCommandType.GET_LAST_ROUTE,this.Invoke(),this.resultString},e.prototype.GetHiddenRowsCountInTable=function(e){return this._commandType=t.InteractiveCommandType.GET_HIDDEN_ROWS_COUNT_IN_TABLE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getLastWindowState=function(e){return this._commandType=t.InteractiveCommandType.GET_LAST_WINDOW_STATE,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getLinkedParentIdx=function(e){return this._commandType=t.InteractiveCommandType.GET_LINKED_PARENT_IDX,this._obj2=e,this.Invoke(),this._intVal1},e.prototype.getColumnsState=function(e){return this._commandType=t.InteractiveCommandType.GET_COLUMNS_STATE,this._obj2=e,this._mgValue=new c,this.Invoke(),this._mgValue.listOfIntArr},e.prototype.MapWidget=function(t){1===arguments.length?this.MapWidget_0(t):this.MapWidget_1()},e.prototype.MapWidget_0=function(e){this._commandType=t.InteractiveCommandType.MAP_WIDGET_TO_GUI_OBJECT,this._obj1=e,this.Invoke()},e.prototype.ActivateForm=function(e){this._commandType=t.InteractiveCommandType.ACTIVATE_FORM,this._obj1=e,this.Invoke()},e.prototype.isFormActive=function(t){if(1===arguments.length)return this.isFormActive_0(t);this.isFormActive_1()},e.prototype.isFormActive_0=function(t){return this._boolVal},e.prototype.GetRtfValueBeforeEnteringControl=function(e,r){return this._commandType=t.InteractiveCommandType.GET_RTF_VALUE_BEFORE_ENTERING_CONTROL,this._obj2=e,this._line=r,this._mgValue=new c,this.Invoke(),this._mgValue.str},e.prototype.GetDVControlPositionIsn=function(e,r){return this._commandType=t.InteractiveCommandType.GET_DVCONTROL_POSITION_ISN,this._obj1=e,this._line=r,this.Invoke(),this._intVal1},e.prototype.ClearDatatable=function(e,r){this._commandType=t.InteractiveCommandType.CLEAR_DATA_TABLE,this._obj1=e,this._obj2=r,this.Invoke()},e.prototype.SetDataSourceToDataViewControl=function(e,r,n){this._commandType=t.InteractiveCommandType.SET_DATA_SOURCE_TO_DVCONTROL,this._obj1=e,this._obj2=r,this._str=n,this.Invoke()},e.prototype.IsComboBoxInDroppedDownState=function(e,r){return this._commandType=t.InteractiveCommandType.IS_COMBO_DROPPED_DOWN,this._obj1=e,this._line=r,this.Invoke(),this._boolVal},e.prototype.ExecuteCallJS=function(e,r,n,i){return this._commandType=t.InteractiveCommandType.CALL_JS,this._obj2=e,this.controlName=r,this._str=n,this.arguments=i,this.Invoke(),this.resultString},e.prototype.Invoke=function(){if(f.getInstance().invoke(),this._obj2 instanceof T){var t=this._obj2;this.TaskTag=t.TaskTag,this.controlName=t.UniqueName}else if(this._obj2 instanceof h){var e=this._obj2;this.TaskTag=e.TaskTag}else this.TaskTag="0";I.getInstance().ExecuteInteractiveCommand(this)},e.prototype.OnRemoveDNControlValueChangedHandler=function(){E.WriteExceptionToLog("RemoveDNControlValueChangedHandler - Not Implemented Yet")},e.prototype.OnAddDNControlValueChangedHandler=function(){E.WriteExceptionToLog("AddDNControlValueChangedHandler - Not Implemented Yet")},e.prototype.OnGetRtfValueBeforeEnteringControl=function(){E.WriteExceptionToLog("OnGetOrgRtfValue - Not Implemented Yet")},e.prototype.onInvokeUDP=function(){},e.prototype.onFileOpenDialogBox=function(){},e.prototype.onFileSaveDialogBox=function(){},e.prototype.onCreateDialog=function(){},e.prototype.onOpenDialog=function(){},e.prototype.onCloseDialog=function(){},e.prototype.isFormActive_1=function(){},e.prototype.onDisposeAllForms=function(){},e.prototype.onGetFontMetrics=function(){},e.prototype.onGetResolution=function(){},e.prototype.onCaretPosGet=function(){},e.prototype.onGetIsTopOfTextBox=function(){return this._boolVal},e.prototype.onGetIsEndOfTextBox=function(){return this._boolVal},e.prototype.onSelectionGet=function(){},e.prototype.onSetEditText=function(){},e.prototype.onInsertEditText=function(){},e.prototype.onSetBrowserText=function(){},e.prototype.onSetSelection=function(){},e.prototype.onSetSuggestedValue=function(){},e.prototype.onGetRowsInPage=function(){},e.prototype.onGetHiddenRowsCountInTable=function(){},e.prototype.onGetTopIndex=function(){},e.prototype.getClientBounds_1=function(){},e.prototype.onPostKeyEvent=function(){},e.prototype.onPostCharEvent=function(){},e.prototype.OnSetGetSuggestedValueOfChoiceControlOnTagData=function(){},e.prototype.onSendImeMsg=function(){},e.prototype.onSetCursor=function(){},e.prototype.invokeRequired=function(){return!1},e.prototype.onGetLastWindowState=function(){},e.prototype.onGetLinkedParentIdx=function(){},e.prototype.onGetColumnsState=function(){},e.prototype.onCanFocus=function(){},e.prototype.OnGetSelectedIndice=function(){},e.prototype.OnGetHasIndent=function(){},e.prototype.MapWidget_1=function(){},e.prototype.OnGetDVControlPositionIsn=function(){},e.prototype.OnActivateForm=function(){},e.prototype.OnIsComboDroppedDowndState=function(){},e}();O.lockObject=null;var g,R,S,C,d,A,L,m,N,y,M,D,b,v,B,Y,U,G=function(t){function e(){return t.call(this)||this}return a(e,t),e.prototype.OnGetRtfValueBeforeEnteringControl=function(){},e.prototype.onGetBrowserText=function(){},e.prototype.onBrowserExecute=function(){},e.prototype.onDirectoryDialogBox=function(){},e}(O),V=function(t){function n(){var e=t.apply(this,P(arguments))||this;return e._type=r.MgControlType.CTRL_TYPE_NONE,e.ForceRefreshPropertyWidth=!1,e.ForceRefreshPropertyHight=!1,e.ButtonStyle=r.CtrlButtonTypeGui.None,e.IsRepeatable=!1,e.Layer=0,e.CheckBoxMainStyle=r.CheckboxMainStyle.None,e.RadioButtonAppearance=r.RbAppearance.None,e.Name=null,e.GuiMgForm=null,e}return a(n,t),Object.defineProperty(n.prototype,"Type",{get:function(){return this._type},set:function(t){this._type===r.MgControlType.CTRL_TYPE_NONE?this._type=t:e.Debug.Assert(!1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsTableChild",{get:function(){var t=this.getParent()instanceof n?this.getParent():null;return null!==t&&t.isTableControl()&&!this.isColumnControl()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsTableHeaderChild",{get:function(){return!this.IsRepeatable&&this.IsTableChild},enumerable:!1,configurable:!0}),n.prototype.getName=function(t){return this.IsRepeatable?t>e.Int32.MinValue?this.Name+"_"+t:this.Name+"_0":this.Name},Object.defineProperty(n.prototype,"UniqueName",{get:function(){return this.Name},enumerable:!1,configurable:!0}),n.prototype.isStatic=function(){return this._type===r.MgControlType.CTRL_TYPE_LABEL||this._type===r.MgControlType.CTRL_TYPE_GROUP||this._type===r.MgControlType.CTRL_TYPE_TABLE||this._type===r.MgControlType.CTRL_TYPE_COLUMN||this._type===r.MgControlType.CTRL_TYPE_STATUS_BAR||this._type===r.MgControlType.CTRL_TYPE_SB_IMAGE||this._type===r.MgControlType.CTRL_TYPE_SB_LABEL||this._type===r.MgControlType.CTRL_TYPE_LINE},n.prototype.isTableControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TABLE},n.prototype.isTabControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TAB},n.prototype.isLineControl=function(){return this._type===r.MgControlType.CTRL_TYPE_LINE},n.prototype.isTextControl=function(){return this._type===r.MgControlType.CTRL_TYPE_TEXT},n.prototype.isImageControl=function(){return this._type===r.MgControlType.CTRL_TYPE_IMAGE},n.prototype.isSubform=function(){return this._type===r.MgControlType.CTRL_TYPE_SUBFORM},n.prototype.isRadio=function(){return this._type===r.MgControlType.CTRL_TYPE_RADIO},n.prototype.isComboBox=function(){return this._type===r.MgControlType.CTRL_TYPE_COMBO},n.prototype.isListBox=function(){return this._type===r.MgControlType.CTRL_TYPE_LIST},n.prototype.isButton=function(){return this._type===r.MgControlType.CTRL_TYPE_BUTTON},n.prototype.isLabel=function(){return this._type===r.MgControlType.CTRL_TYPE_LABEL},n.prototype.isGroup=function(){return this._type===r.MgControlType.CTRL_TYPE_GROUP},n.prototype.isSelectionCtrl=function(){return this._type===r.MgControlType.CTRL_TYPE_COMBO||this._type===r.MgControlType.CTRL_TYPE_LIST},n.prototype.isBrowserControl=function(){return this._type===r.MgControlType.CTRL_TYPE_BROWSER},n.prototype.isCheckBox=function(){return this._type===r.MgControlType.CTRL_TYPE_CHECKBOX},n.prototype.isColumnControl=function(){return this._type===r.MgControlType.CTRL_TYPE_COLUMN},n.prototype.isChoiceControl=function(){var t=!1;switch(this._type){case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_RADIO:t=!0}return t},n.prototype.isContainer=function(){switch(this._type){case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_CONTAINER:return!0;default:return!1}},n.prototype.SupportGradient=function(){return this.isButton()||this.isLabel()||this.isTabControl()||this.isGroup()||this.IsCheckBoxMainStyleButton()||this.IsRadioAppearanceButton()},n.prototype.IsImageButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Image),t},n.prototype.IsButtonPushButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Push),t},n.prototype.IsHyperTextButton=function(){var t=!1;return this.isButton()&&(t=this.ButtonStyle===r.CtrlButtonTypeGui.Hypertext),t},n.prototype.IsCheckBoxMainStyleButton=function(){var t=!1;return this.isCheckBox()&&(t=this.CheckBoxMainStyle===r.CheckboxMainStyle.Button),t},n.prototype.IsRadioAppearanceButton=function(){var t=!1;return this.isRadio()&&(t=this.RadioButtonAppearance===r.RbAppearance.Button),t},n.prototype.getControlTypeName=function(){var t=null;switch(this._type){case r.MgControlType.CTRL_TYPE_STATUS_BAR:t="Status bar";break;case r.MgControlType.CTRL_TYPE_SB_LABEL:t="Status bar label";break;case r.MgControlType.CTRL_TYPE_SB_IMAGE:t="Status bar image";break;case r.MgControlType.CTRL_TYPE_TABLE:t="Table";break;case r.MgControlType.CTRL_TYPE_BUTTON:t="Button";break;case r.MgControlType.CTRL_TYPE_CHECKBOX:t="Checkbox";break;case r.MgControlType.CTRL_TYPE_COMBO:t="Combo";break;case r.MgControlType.CTRL_TYPE_LIST:t="List";break;case r.MgControlType.CTRL_TYPE_SUBFORM:t="Subform";break;case r.MgControlType.CTRL_TYPE_GROUP:t="Groupbox";break;case r.MgControlType.CTRL_TYPE_IMAGE:t="Image";break;case r.MgControlType.CTRL_TYPE_TAB:t="Tab";break;case r.MgControlType.CTRL_TYPE_COLUMN:t="Column";break;case r.MgControlType.CTRL_TYPE_LABEL:t="Label";break;case r.MgControlType.CTRL_TYPE_FRAME_SET:t="Frame set";break;case r.MgControlType.CTRL_TYPE_CONTAINER:t="Container";break;case r.MgControlType.CTRL_TYPE_RADIO:t="Radio";break;case r.MgControlType.CTRL_TYPE_TEXT:t="Text";break;case r.MgControlType.CTRL_TYPE_FRAME_FORM:t="Frame form";break;case r.MgControlType.CTRL_TYPE_BROWSER:t="Browser";break;case r.MgControlType.CTRL_TYPE_LINE:t="Line"}return t},n}(T);t.DateElement=void 0,(g=t.DateElement||(t.DateElement={})).YEAR="Y",g.MONTH="M",g.DAY="D",g.DOW="W",t.MenuEntryProgram_SrcContext=void 0,(R=t.MenuEntryProgram_SrcContext||(t.MenuEntryProgram_SrcContext={})).Main="M",R.Current="C",t.EditReturnCode=void 0,(S=t.EditReturnCode||(t.EditReturnCode={}))[S.EDIT_CONTINUE=0]="EDIT_CONTINUE",S[S.EDIT_AUTOSKIP=1]="EDIT_AUTOSKIP",S[S.EDIT_RESTART=2]="EDIT_RESTART",t.GuiExpressionEvaluator_ControlsPersistencyClearOption=void 0,(C=t.GuiExpressionEvaluator_ControlsPersistencyClearOption||(t.GuiExpressionEvaluator_ControlsPersistencyClearOption={}))[C.All=1]="All",C[C.CurrentForm=2]="CurrentForm",t.DataModificationTypes=void 0,(d=t.DataModificationTypes||(t.DataModificationTypes={})).Update="u",d.Insert="i",d.Delete="d",d.None=" ",t.MgCheckState=void 0,(A=t.MgCheckState||(t.MgCheckState={}))[A.UNCHECKED=1]="UNCHECKED",A[A.CHECKED=2]="CHECKED",A[A.INDETERMINATE=3]="INDETERMINATE",t.MarkMode=void 0,(L=t.MarkMode||(t.MarkMode={}))[L.MARK_ALL_TEXT=1]="MARK_ALL_TEXT",L[L.UNMARK_ALL_TEXT=2]="UNMARK_ALL_TEXT",L[L.MARK_SELECTION_TEXT=3]="MARK_SELECTION_TEXT",t.MgCursors=void 0,(m=t.MgCursors||(t.MgCursors={}))[m.ARROW=1]="ARROW",m[m.WAITCURSOR=2]="WAITCURSOR",m[m.HAND=3]="HAND",m[m.APPSTARTING=4]="APPSTARTING",m[m.CROSS=5]="CROSS",m[m.HELP=6]="HELP",m[m.IBEAM=7]="IBEAM",m[m.NO=8]="NO",m[m.SIZEALL=9]="SIZEALL",m[m.SIZENESW=10]="SIZENESW",m[m.SIZENS=11]="SIZENS",m[m.SIZENWSE=12]="SIZENWSE",m[m.SIZEWE=13]="SIZEWE",m[m.UPARROW=14]="UPARROW",t.Modifiers=void 0,(N=t.Modifiers||(t.Modifiers={})).MODIFIER_ALT="A",N.MODIFIER_CTRL="C",N.MODIFIER_SHIFT="S",N.MODIFIER_NONE=" ",N.MODIFIER_SHIFT_CTRL="X",N.MODIFIER_ALT_CTRL="Y",N.MODIFIER_ALT_SHIFT="Z",t.CommandType=void 0,(y=t.CommandType||(t.CommandType={}))[y.OPEN_FORM=0]="OPEN_FORM",y[y.CREATE_FORM=1]="CREATE_FORM",y[y.INITIAL_FORM_LAYOUT=2]="INITIAL_FORM_LAYOUT",y[y.SHOW_FORM=3]="SHOW_FORM",y[y.CREATE_LABEL=4]="CREATE_LABEL",y[y.CREATE_EDIT=5]="CREATE_EDIT",y[y.CREATE_BUTTON=6]="CREATE_BUTTON",y[y.CREATE_COMBO_BOX=7]="CREATE_COMBO_BOX",y[y.CREATE_LIST_BOX=8]="CREATE_LIST_BOX",y[y.CREATE_RADIO_CONTAINER=9]="CREATE_RADIO_CONTAINER",y[y.CREATE_RADIO_BUTTON=10]="CREATE_RADIO_BUTTON",y[y.CREATE_IMAGE=11]="CREATE_IMAGE",y[y.CREATE_CHECK_BOX=12]="CREATE_CHECK_BOX",y[y.CREATE_TAB=13]="CREATE_TAB",y[y.CREATE_TABLE=14]="CREATE_TABLE",y[y.CREATE_COLUMN=15]="CREATE_COLUMN",y[y.CREATE_SUB_FORM=16]="CREATE_SUB_FORM",y[y.CLOSE_SUB_FORM=17]="CLOSE_SUB_FORM",y[y.CREATE_BROWSER=18]="CREATE_BROWSER",y[y.CREATE_GROUP=19]="CREATE_GROUP",y[y.CREATE_RICH_EDIT=20]="CREATE_RICH_EDIT",y[y.CREATE_RICH_TEXT=21]="CREATE_RICH_TEXT",y[y.CREATE_LINE=22]="CREATE_LINE",y[y.DISPOSE_OBJECT=23]="DISPOSE_OBJECT",y[y.PROP_SET_CONTROL_NAME=24]="PROP_SET_CONTROL_NAME",y[y.PROP_SET_TEXT=25]="PROP_SET_TEXT",y[y.PROP_SET_READ_ONLY=26]="PROP_SET_READ_ONLY",y[y.PROP_SET_TEXT_SIZE_LIMIT=27]="PROP_SET_TEXT_SIZE_LIMIT",y[y.PROP_SET_ITEMS_LIST=28]="PROP_SET_ITEMS_LIST",y[y.PROP_SET_IMAGE_FILE_NAME=29]="PROP_SET_IMAGE_FILE_NAME",y[y.PROP_SET_IMAGE_DATA=30]="PROP_SET_IMAGE_DATA",y[y.PROP_SET_IMAGE_LIST=31]="PROP_SET_IMAGE_LIST",y[y.PROP_SET_TOOLTIP=32]="PROP_SET_TOOLTIP",y[y.PROP_SET_VISIBLE=33]="PROP_SET_VISIBLE",y[y.PROP_SET_ENABLE=34]="PROP_SET_ENABLE",y[y.PROP_SET_MENU_ENABLE=35]="PROP_SET_MENU_ENABLE",y[y.PROP_SET_VISIBLE_LINES=36]="PROP_SET_VISIBLE_LINES",y[y.PROP_SET_RIGHT_TO_LEFT=37]="PROP_SET_RIGHT_TO_LEFT",y[y.PROP_SET_CHECKED=38]="PROP_SET_CHECKED",y[y.PROP_SET_SELECTION=39]="PROP_SET_SELECTION",y[y.PROP_SET_LAYOUT_NUM_COLUMN=40]="PROP_SET_LAYOUT_NUM_COLUMN",y[y.PROP_SET_LINE_VISIBLE=41]="PROP_SET_LINE_VISIBLE",y[y.PROP_SET_RESIZABLE=42]="PROP_SET_RESIZABLE",y[y.PROP_SET_ALLOW_REORDER=43]="PROP_SET_ALLOW_REORDER",y[y.PROP_SET_SORTABLE_COLUMN=44]="PROP_SET_SORTABLE_COLUMN",y[y.PROP_SET_COLUMN_PLACMENT=45]="PROP_SET_COLUMN_PLACMENT",y[y.PROP_SET_ICON_FILE_NAME=46]="PROP_SET_ICON_FILE_NAME",y[y.SET_WINDOW_STATE=47]="SET_WINDOW_STATE",y[y.SET_COLUMN_ORG_WIDTH=48]="SET_COLUMN_ORG_WIDTH",y[y.SET_COLUMN_START_POS=49]="SET_COLUMN_START_POS",y[y.SET_TABLE_ITEMS_COUNT=50]="SET_TABLE_ITEMS_COUNT",y[y.SET_TABLE_VIRTUAL_ITEMS_COUNT=51]="SET_TABLE_VIRTUAL_ITEMS_COUNT",y[y.SET_TABLE_VSCROLL_THUMB_POS=52]="SET_TABLE_VSCROLL_THUMB_POS",y[y.SET_TABLE_VSCROLL_PAGE_SIZE=53]="SET_TABLE_VSCROLL_PAGE_SIZE",y[y.SET_TABLE_INCLUDES_FIRST=54]="SET_TABLE_INCLUDES_FIRST",y[y.SET_TABLE_INCLUDES_LAST=55]="SET_TABLE_INCLUDES_LAST",y[y.SET_TABLE_TOP_INDEX=56]="SET_TABLE_TOP_INDEX",y[y.SET_SELECTION_INDEX=57]="SET_SELECTION_INDEX",y[y.INVALIDATE_TABLE=58]="INVALIDATE_TABLE",y[y.REFRESH_TABLE=59]="REFRESH_TABLE",y[y.REFRESH_TMP_EDITOR=60]="REFRESH_TMP_EDITOR",y[y.UPDATE_TMP_EDITOR_INDEX=61]="UPDATE_TMP_EDITOR_INDEX",y[y.CREATE_TABLE_ROW=62]="CREATE_TABLE_ROW",y[y.UNDO_CREATE_TABLE_ROW=63]="UNDO_CREATE_TABLE_ROW",y[y.SET_TABLE_ROW_VISIBILITY=64]="SET_TABLE_ROW_VISIBILITY",y[y.VALIDATE_TABLE_ROW=65]="VALIDATE_TABLE_ROW",y[y.INSERT_ROWS=66]="INSERT_ROWS",y[y.REMOVE_ROWS=67]="REMOVE_ROWS",y[y.CLEAR_TABLE_COLUMNS_SORT_MARK=68]="CLEAR_TABLE_COLUMNS_SORT_MARK",y[y.PROP_SET_URL=69]="PROP_SET_URL",y[y.MOVE_ABOVE=70]="MOVE_ABOVE",y[y.SET_FOCUS=71]="SET_FOCUS",y[y.WRITE_TO_MESSAGE_BOX=72]="WRITE_TO_MESSAGE_BOX",y[y.CLOSE_FORM=73]="CLOSE_FORM",y[y.REMOVE_SUBFORM_CONTROLS=74]="REMOVE_SUBFORM_CONTROLS",y[y.START_TIMER=75]="START_TIMER",y[y.STOP_TIMER=76]="STOP_TIMER",y[y.BEEP=77]="BEEP",y[y.CREATE_TOOLBAR=78]="CREATE_TOOLBAR",y[y.DELETE_TOOLBAR=79]="DELETE_TOOLBAR",y[y.CREATE_TOOLBAR_ITEM=80]="CREATE_TOOLBAR_ITEM",y[y.DELETE_TOOLBAR_ITEM=81]="DELETE_TOOLBAR_ITEM",y[y.CREATE_STATUS_BAR=82]="CREATE_STATUS_BAR",y[y.PROP_SET_SB_PANE_WIDTH=83]="PROP_SET_SB_PANE_WIDTH",y[y.CREATE_SB_LABEL=84]="CREATE_SB_LABEL",y[y.CREATE_SB_IMAGE=85]="CREATE_SB_IMAGE",y[y.SHOW_TMP_EDITOR=86]="SHOW_TMP_EDITOR",y[y.PROP_SET_TRANSLATOR=87]="PROP_SET_TRANSLATOR",y[y.PROP_SET_PASSWORD_EDIT=88]="PROP_SET_PASSWORD_EDIT",y[y.PROP_SET_TITLE_BAR=89]="PROP_SET_TITLE_BAR",y[y.PROP_SHOW_FULL_ROW=90]="PROP_SHOW_FULL_ROW",y[y.PROP_SHOW_BUTTONS=91]="PROP_SHOW_BUTTONS",y[y.PROP_SHOW_LINES=92]="PROP_SHOW_LINES",y[y.PROP_SHOW_SCROLLBAR=93]="PROP_SHOW_SCROLLBAR",y[y.SET_ENV_ACCESS_TEST=94]="SET_ENV_ACCESS_TEST",y[y.SET_ENV_TOOLTIP_TIMEOUT=95]="SET_ENV_TOOLTIP_TIMEOUT",y[y.SET_ENV_SPECIAL_TEXT_SIZE_FACTORING=96]="SET_ENV_SPECIAL_TEXT_SIZE_FACTORING",y[y.SET_ENV_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME=97]="SET_ENV_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME",y[y.PROP_SET_STARTUP_POSITION=98]="PROP_SET_STARTUP_POSITION",y[y.PROP_SET_CHECK_BOX_CHECKED=99]="PROP_SET_CHECK_BOX_CHECKED",y[y.COMBO_DROP_DOWN=100]="COMBO_DROP_DOWN",y[y.SET_ACTIVETE_KEYBOARD_LAYOUT=101]="SET_ACTIVETE_KEYBOARD_LAYOUT",y[y.SET_TAG_DATA_LINK_VISITED=102]="SET_TAG_DATA_LINK_VISITED",y[y.ALLOW_UPDATE=103]="ALLOW_UPDATE",y[y.SET_ALIGNMENT=104]="SET_ALIGNMENT",y[y.BULLET=105]="BULLET",y[y.INDENT=106]="INDENT",y[y.UNINDENT=107]="UNINDENT",y[y.CHANGE_COLUMN_SORT_MARK=108]="CHANGE_COLUMN_SORT_MARK",y[y.SET_CURRENT_CURSOR=109]="SET_CURRENT_CURSOR",y[y.REORDER_COLUMNS=110]="REORDER_COLUMNS",y[y.RESTORE_COLUMNS=111]="RESTORE_COLUMNS",y[y.ACTIVATE_FORM=112]="ACTIVATE_FORM",y[y.LOCK_WINDOW_UPDATE=113]="LOCK_WINDOW_UPDATE",y[y.ENABLE_XPTHEMES=114]="ENABLE_XPTHEMES",y[y.TOGGLE_ALTERNATE_COLOR_FOR_FIRST_ROW=115]="TOGGLE_ALTERNATE_COLOR_FOR_FIRST_ROW",y[y.REGISTER_DN_CTRL_VALUE_CHANGED_EVENT=116]="REGISTER_DN_CTRL_VALUE_CHANGED_EVENT",y[y.SET_TABLE_ORG_ROW_HEIGHT=117]="SET_TABLE_ORG_ROW_HEIGHT",y[y.SET_TOOLBAR=118]="SET_TOOLBAR",y[y.CREATE_ENTRY_IN_CONTROLS_MAP=119]="CREATE_ENTRY_IN_CONTROLS_MAP",y[y.REMOVE_ENTRY_FROM_CONTROLS_MAP=120]="REMOVE_ENTRY_FROM_CONTROLS_MAP",y[y.PROCESS_PRESS_EVENT=121]="PROCESS_PRESS_EVENT",y[y.SET_MARKED_ITEM_STATE=122]="SET_MARKED_ITEM_STATE",y[y.ACCEPT_DVCONTROL_CHANGES=123]="ACCEPT_DVCONTROL_CHANGES",y[y.UPDATE_DVCONTROL_ROW=124]="UPDATE_DVCONTROL_ROW",y[y.ADD_DVCONTROL_HANDLER=125]="ADD_DVCONTROL_HANDLER",y[y.REMOVE_DVCONTROL_HANDLER=126]="REMOVE_DVCONTROL_HANDLER",y[y.CREATE_ROW_IN_DVCONTROL=127]="CREATE_ROW_IN_DVCONTROL",y[y.UPDATE_DVCONTROL_COLUMN=128]="UPDATE_DVCONTROL_COLUMN",y[y.DELETE_DVCONTROL_ROW=129]="DELETE_DVCONTROL_ROW",y[y.SET_DVCONTROL_ROW_POSITION=130]="SET_DVCONTROL_ROW_POSITION",y[y.REJECT_DVCONTROL_COLUMN_CHANGES=131]="REJECT_DVCONTROL_COLUMN_CHANGES",y[y.SET_DESIGNER_VALUES=132]="SET_DESIGNER_VALUES",y[y.PROP_SET_EDIT_HINT=133]="PROP_SET_EDIT_HINT",y[y.PROP_SET_MULTI_COLUMN_DISPLAY=134]="PROP_SET_MULTI_COLUMN_DISPLAY",y[y.SET_ENV_LAMGUAGE=135]="SET_ENV_LAMGUAGE",y[y.SET_LAST_IN_CONTEXT=136]="SET_LAST_IN_CONTEXT",y[y.SET_CARET=137]="SET_CARET",y[y.SET_RECORDS_BEFORE_CURRENT_VIEW=138]="SET_RECORDS_BEFORE_CURRENT_VIEW",y[y.SET_VALUE=139]="SET_VALUE",y[y.SET_ATTRIBUTE=140]="SET_ATTRIBUTE",y[y.SET_PROPERTY=141]="SET_PROPERTY",y[y.SET_CLASS=142]="SET_CLASS",y[y.SET_STYLE=143]="SET_STYLE",y[y.REFRESH_TASK=144]="REFRESH_TASK",y[y.PROP_SET_USER_PROPERTY=145]="PROP_SET_USER_PROPERTY",y[y.PROP_SET_CUSTOM_VALIDATOR=146]="PROP_SET_CUSTOM_VALIDATOR",y[y.SET_IS_ROW_EDITING=147]="SET_IS_ROW_EDITING",y[y.SET_NOT_IS_ROW_EDITING=148]="SET_NOT_IS_ROW_EDITING",y[y.SET_EMPTY_DATAVIEW=149]="SET_EMPTY_DATAVIEW",y[y.SET_IS_LOGGED_IN=150]="SET_IS_LOGGED_IN",y[y.RELOAD_PAGE=151]="RELOAD_PAGE",y[y.EXIT_MAGIC=152]="EXIT_MAGIC",y[y.CALL_JS=153]="CALL_JS",y[y.PROP_SET_BINDING_LEVEL=154]="PROP_SET_BINDING_LEVEL",y[y.SHOW_SPINNER=155]="SHOW_SPINNER",y[y.SHOW_HTML_ERROR=156]="SHOW_HTML_ERROR",t.HtmlProperties=void 0,(M=t.HtmlProperties||(t.HtmlProperties={})).Visible="visible",M.Enabled="enabled",M.Text="text",M.ItemsList="itemslist",M.Image="image",M.Tooltip="tooltip",M.SelectedValue="selectedvalue",M.ShowBorder="showborder",M.PlaceHolder="placeholder",M.Password="password",M.TabIndex="tabindex",M.SelectedRow="selectedRow",M.ReadOnly="readOnly",M.MustInput="mustInput",M.SelectedLayer="SelectedLayer",M.BindingLevel="bindingLevel",M.ZoomButtonTooltip="ZoomButtonTooltip",t.MenuStyle=void 0,(D=t.MenuStyle||(t.MenuStyle={}))[D.MENU_STYLE_PULLDOWN=1]="MENU_STYLE_PULLDOWN",D[D.MENU_STYLE_CONTEXT=2]="MENU_STYLE_CONTEXT",D[D.MENU_STYLE_TOOLBAR=3]="MENU_STYLE_TOOLBAR",t.DockingStyle=void 0,(b=t.DockingStyle||(t.DockingStyle={}))[b.NONE=0]="NONE",b[b.BOTTOM=1]="BOTTOM",b[b.FILL=2]="FILL",b[b.LEFT=3]="LEFT",b[b.RIGHT=4]="RIGHT",b[b.TOP=5]="TOP",t.RaisedBy=void 0,(v=t.RaisedBy||(t.RaisedBy={}))[v.USER_ACTION=0]="USER_ACTION",v[v.CLOSE_SYSTEM_MENU=1]="CLOSE_SYSTEM_MENU",v[v.CTRL_GOTO=2]="CTRL_GOTO",v[v.MOUSE_WHEEL=3]="MOUSE_WHEEL",v[v.INTERNAL=4]="INTERNAL",v[v.KBPUT=5]="KBPUT",t.TraverseMode=void 0,(B=t.TraverseMode||(t.TraverseMode={}))[B.NONE=1]="NONE",B[B.WITHIN_CONTROL=2]="WITHIN_CONTROL",B[B.BETWEEN_CONTROLS=3]="BETWEEN_CONTROLS",t.ClipFormats=void 0,(Y=t.ClipFormats||(t.ClipFormats={}))[Y.FORMAT_USER=0]="FORMAT_USER",Y[Y.FORMAT_TEXT=1]="FORMAT_TEXT",Y[Y.FORMAT_OEM_TEXT=2]="FORMAT_OEM_TEXT",Y[Y.FORMAT_RICH_TEXT=3]="FORMAT_RICH_TEXT",Y[Y.FORMAT_HTML_TEXT=4]="FORMAT_HTML_TEXT",Y[Y.FORMAT_HYPERLINK_TEXT=5]="FORMAT_HYPERLINK_TEXT",Y[Y.FORMAT_DROP_FILES=6]="FORMAT_DROP_FILES",Y[Y.FORMAT_UNICODE_TEXT=7]="FORMAT_UNICODE_TEXT",Y.FORMAT_UNKNOWN="c",t.OverlayType=void 0,(U=t.OverlayType||(t.OverlayType={}))[U.Overlay=0]="Overlay",U[U.Alert=1]="Alert",U[U.ConfirmationBox=2]="ConfirmationBox";var k,w=function(){function t(t,e,r){this.TaskTag=null,this.CommandType=0,this.options=null,this.Bool1=!1,this.params=null,this.fileName=null,this.height=0,this.layer=0,this.line=0,this.number=0,this.obj=null,this.parentObject=null,this.obj1=null,this.str=null,this.value=null,this.stringList=null,this.style=0,this.width=0,this.x=0,this.y=0,this.userDropFormat=null,this.contextID="\0",1!==arguments.length||null!==t&&t.constructor!==Number?2!==arguments.length||null!==t&&t.constructor!==Number||null!==e&&e.constructor!==String?2!==arguments.length?this.constructor_3(t,e,r):this.constructor_2(t,e):this.constructor_1(t,e):this.constructor_0(t)}return t.prototype.constructor_0=function(t){this.CommandType=t},t.prototype.constructor_1=function(t,e){this.constructor_0(t),this.str=e},t.prototype.constructor_2=function(t,e){this.constructor_0(e),this.obj=t,this.obj instanceof T?(this.CtrlName=this.obj.UniqueName,this.TaskTag=this.obj.TaskTag):null===t&&(this.TaskTag="0")},t.prototype.constructor_3=function(t,e,r){this.constructor_2(e,r),this.parentObject=t},t.prototype.toString=function(){return"{"+this.CommandType+"}"},t}(),F=function(){function r(){}return r.SetResolveCallback=function(t){this.resolveCallback=t},r.ResolvePromise=function(t){this.resolveCallback(t)},r.messageBox=function(t,e,r){return s(this,void 0,void 0,(function(){var n,i,o=this;return _(this,(function(a){switch(a.label){case 0:return n=new G,[4,new Promise((function(i,a){o.SetResolveCallback(i),n.messageBox(t,e,r)})).then((function(t){i=t}))];case 1:return a.sent(),[2,i]}}))}))},r.setTitle=function(t,e){(new G).setTitle(t,e)},r.setGetSuggestedValueOfChoiceControlOnTagData=function(t,e,r){(new G).setGetSuggestedValueOfChoiceControlOnTagData(t,e,r)},r.getValue=function(t,e){return(new G).getValue(t,e)},r.getTopIndex=function(t){return(new G).getTopIndex(t)},r.getIsRowEditing=function(t,e,r){return(new G).getIsRowEditing(t,e,r)},r.browserExecute=function(t,e,r,n){return(new G).browserExecute(t,e,r,n)},r.directoryDialogBox=function(t,e,r){return(new G).directoryDialogBox(t,e,r)},r.fileOpenDialogBox=function(t,e,r,n,i,o){return(new G).fileOpenDialogBox(t,e,r,n,i,o)},r.setEditText=function(t,e,r){return(new G).setEditText(t,e,r)},r.insertEditText=function(t,e,r,n){return(new G).insertEditText(t,e,r,n)},r.caretPosGet=function(t,e){return(new G).caretPosGet(t,e)},r.addRefreshPage=function(t,e){(new G).RefreshPage(t,e)},r.getRowsInPage=function(t){var e=(new G).getRowsInPage(t);return 0===e?1:e},r.getMaxRowsInPaginatedTable=function(t){return(new G).getMaxRowsInPaginatedTable(t)},r.getLastRoute=function(){return(new G).getLastRoute()},r.addBoolWithLine=function(t,e,r,n){var i=new w(e,t);i.Bool1=n,i.line=r,f.getInstance().addCommand(i)},r.addNoParameters=function(t,e){var r=new w(e,t);f.getInstance().addCommand(r)},r.addWithNumber=function(t,e,r){var n=new w(e,t);n.number=r,f.getInstance().addCommand(n)},r.addValueWithLine=function(e,r,n,i){var o=new w(r,e);o.value=i,o.line=n,e===t.CommandType.SET_VALUE&&r instanceof V&&r.isChoiceControl()&&i<0&&(o.value=""),f.getInstance().addCommand(o)},r.addOperationWithLine=function(t,e,r,n,i){var o=new w(e,t);o.obj1=i,o.line=r,o.Operation=n,f.getInstance().addCommand(o)},r.addOpensubform=function(t,e,r,n,i,o,a,s,_){var l=new w(e,t);l.str=r,l.obj1=n,l.userDropFormat=i,l.fileName=o,l.Bool1=_,l.contextID=a,l.params=s,f.getInstance().addCommand(l)},r.addClosesubform=function(t,e,r,n,i){var o=new w(e,t);o.str=r,o.obj1=n,o.userDropFormat=i,f.getInstance().addCommand(o)},r.addOpenForm=function(r,n,i,o,a,s){var _=new w(r,t.CommandType.OPEN_FORM);_.TaskTag=i,_.str=n,_.stringList=new e.List,_.stringList.push(o),_.stringList.push(a),_.Bool1=s,f.getInstance().addCommand(_)},r.addCloseForm=function(e,r,n){var i=new w(e,t.CommandType.CLOSE_FORM);i.TaskTag=r,i.str=n,f.getInstance().addCommand(i)},r.addCallJS=function(t,e,r,n){return(new G).ExecuteCallJS(t,e,r,n)},r.addIsLoggedIn=function(e){var r=new w(null,t.CommandType.SET_IS_LOGGED_IN);r.Bool1=e,f.getInstance().addCommand(r)},r.addShowSpinner=function(e){var r=new w(null,t.CommandType.SHOW_SPINNER);r.Bool1=e,f.getInstance().addCommand(r)},r.addGlobalCommand=function(t){var e=new w(null,t);f.getInstance().addCommand(e)},r.addShowHTMLError=function(t,e){var r=new w(null,t);r.str=e,f.getInstance().addCommand(r)},r.beginInvoke=function(){f.getInstance().beginInvoke()},r.invoke=function(){f.getInstance().invoke()},r}();F.resolveCallback=null,t.PropInterface=void 0,(k=t.PropInterface||(t.PropInterface={}))[k.PROP_TYPE_LINES_IN_TABLE=3]="PROP_TYPE_LINES_IN_TABLE",k[k.PROP_TYPE_HYPERLINK=14]="PROP_TYPE_HYPERLINK",k[k.PROP_TYPE_TEXT=19]="PROP_TYPE_TEXT",k[k.PROP_TYPE_PLACEMENT=20]="PROP_TYPE_PLACEMENT",k[k.PROP_TYPE_LEFT=21]="PROP_TYPE_LEFT",k[k.PROP_TYPE_TOP=22]="PROP_TYPE_TOP",k[k.PROP_TYPE_WIDTH=23]="PROP_TYPE_WIDTH",k[k.PROP_TYPE_LAYER=25]="PROP_TYPE_LAYER",k[k.PROP_TYPE_TITLE_BAR=26]="PROP_TYPE_TITLE_BAR",k[k.PROP_TYPE_SYSTEM_MENU=27]="PROP_TYPE_SYSTEM_MENU",k[k.PROP_TYPE_MINBOX=28]="PROP_TYPE_MINBOX",k[k.PROP_TYPE_MAXBOX=29]="PROP_TYPE_MAXBOX",k[k.PROP_TYPE_UOM=33]="PROP_TYPE_UOM",k[k.PROP_TYPE_VER_FAC=34]="PROP_TYPE_VER_FAC",k[k.PROP_TYPE_HOR_FAC=35]="PROP_TYPE_HOR_FAC",k[k.PROP_TYPE_WALLPAPER=42]="PROP_TYPE_WALLPAPER",k[k.PROP_TYPE_DATA=43]="PROP_TYPE_DATA",k[k.PROP_TYPE_LABEL=45]="PROP_TYPE_LABEL",k[k.PROP_TYPE_NAME=46]="PROP_TYPE_NAME",k[k.PROP_TYPE_FONT=50]="PROP_TYPE_FONT",k[k.PROP_TYPE_COLOR=51]="PROP_TYPE_COLOR",k[k.PROP_TYPE_MUST_INPUT=52]="PROP_TYPE_MUST_INPUT",k[k.PROP_TYPE_MODIFIABLE=53]="PROP_TYPE_MODIFIABLE",k[k.PROP_TYPE_HELP_SCR=54]="PROP_TYPE_HELP_SCR",k[k.PROP_TYPE_TOOLTIP=56]="PROP_TYPE_TOOLTIP",k[k.PROP_TYPE_PROMPT=57]="PROP_TYPE_PROMPT",k[k.PROP_TYPE_SELECT_PROGRAM=58]="PROP_TYPE_SELECT_PROGRAM",k[k.PROP_TYPE_SELECT_MODE=59]="PROP_TYPE_SELECT_MODE",k[k.PROP_TYPE_MODIFY_IN_QUERY=60]="PROP_TYPE_MODIFY_IN_QUERY",k[k.PROP_TYPE_VISIBLE=61]="PROP_TYPE_VISIBLE",k[k.PROP_TYPE_ENABLED=62]="PROP_TYPE_ENABLED",k[k.PROP_TYPE_STYLE_3D=63]="PROP_TYPE_STYLE_3D",k[k.PROP_TYPE_BORDER_STYLE=64]="PROP_TYPE_BORDER_STYLE",k[k.PROP_TYPE_HORIZONTAL_ALIGNMENT=65]="PROP_TYPE_HORIZONTAL_ALIGNMENT",k[k.PROP_TYPE_VERTICAL_ALIGNMENT=66]="PROP_TYPE_VERTICAL_ALIGNMENT",k[k.PROP_TYPE_CHOICE_COLUMNS=67]="PROP_TYPE_CHOICE_COLUMNS",k[k.PROP_TYPE_VISIBLE_LINES=68]="PROP_TYPE_VISIBLE_LINES",k[k.PROP_TYPE_STATIC_TYPE=70]="PROP_TYPE_STATIC_TYPE",k[k.PROP_TYPE_MULTILINE=71]="PROP_TYPE_MULTILINE",k[k.PROP_TYPE_MULTILINE_VERTICAL_SCROLL=73]="PROP_TYPE_MULTILINE_VERTICAL_SCROLL",k[k.PROP_TYPE_MULTILINE_ALLOW_CR=74]="PROP_TYPE_MULTILINE_ALLOW_CR",k[k.PROP_TYPE_LINE_STYLE=75]="PROP_TYPE_LINE_STYLE",k[k.PROP_TYPE_LINE_WIDTH=76]="PROP_TYPE_LINE_WIDTH",k[k.PROP_TYPE_SCROLL_BAR=77]="PROP_TYPE_SCROLL_BAR",k[k.PROP_TYPE_LINE_DIVIDER=78]="PROP_TYPE_LINE_DIVIDER",k[k.PROP_TYPE_TITLE_HEIGHT=79]="PROP_TYPE_TITLE_HEIGHT",k[k.PROP_TYPE_ROW_HEIGHT=80]="PROP_TYPE_ROW_HEIGHT",k[k.PROP_TYPE_FORMAT=82]="PROP_TYPE_FORMAT",k[k.PROP_TYPE_ATTRIBUTE=83]="PROP_TYPE_ATTRIBUTE",k[k.PROP_TYPE_EXPAND_WINDOW=84]="PROP_TYPE_EXPAND_WINDOW",k[k.PROP_TYPE_PASSWORD=85]="PROP_TYPE_PASSWORD",k[k.PROP_TYPE_TAB_CONTROL_SIDE=87]="PROP_TYPE_TAB_CONTROL_SIDE",k[k.PROP_TYPE_IMAGE_FILENAME=88]="PROP_TYPE_IMAGE_FILENAME",k[k.PROP_TYPE_IMAGE_STYLE=89]="PROP_TYPE_IMAGE_STYLE",k[k.PROP_TYPE_BUTTON_STYLE=96]="PROP_TYPE_BUTTON_STYLE",k[k.PROP_TYPE_RETURN_ACTION=97]="PROP_TYPE_RETURN_ACTION",k[k.PROP_TYPE_RANGE=98]="PROP_TYPE_RANGE",k[k.PROP_TYPE_PARAMETERS=126]="PROP_TYPE_PARAMETERS",k[k.PROP_TYPE_FRAME_NAME=127]="PROP_TYPE_FRAME_NAME",k[k.PROP_TYPE_HEBREW=130]="PROP_TYPE_HEBREW",k[k.PROP_TYPE_TRANSLATOR=132]="PROP_TYPE_TRANSLATOR",k[k.PROP_TYPE_SORT_COLUMN=134]="PROP_TYPE_SORT_COLUMN",k[k.PROP_TYPE_COLUMN_PLACEMENT=138]="PROP_TYPE_COLUMN_PLACEMENT",k[k.PROP_TYPE_COLUMN_TITLE=139]="PROP_TYPE_COLUMN_TITLE",k[k.PROP_TYPE_SUBFORM_TYPE=156]="PROP_TYPE_SUBFORM_TYPE",k[k.PROP_TYPE_PRGTSK_NUM=183]="PROP_TYPE_PRGTSK_NUM",k[k.PROP_TYPE_COLUMN_DIVIDER=189]="PROP_TYPE_COLUMN_DIVIDER",k[k.PROP_TYPE_ALLOW_COL_RESIZE=191]="PROP_TYPE_ALLOW_COL_RESIZE",k[k.PROP_TYPE_TASK_MODE=197]="PROP_TYPE_TASK_MODE",k[k.PROP_TYPE_END_CONDITION=198]="PROP_TYPE_END_CONDITION",k[k.PROP_TYPE_EVAL_END_CONDITION=199]="PROP_TYPE_EVAL_END_CONDITION",k[k.PROP_TYPE_SELECTION=200]="PROP_TYPE_SELECTION",k[k.PROP_TYPE_ALLOW_MODIFY=201]="PROP_TYPE_ALLOW_MODIFY",k[k.PROP_TYPE_ALLOW_CREATE=202]="PROP_TYPE_ALLOW_CREATE",k[k.PROP_TYPE_ALLOW_DELETE=203]="PROP_TYPE_ALLOW_DELETE",k[k.PROP_TYPE_CONFIRM_UPDATE=204]="PROP_TYPE_CONFIRM_UPDATE",k[k.PROP_TYPE_CONFIRM_CANCEL=205]="PROP_TYPE_CONFIRM_CANCEL",k[k.PROP_TYPE_FORCE_SUFFIX=206]="PROP_TYPE_FORCE_SUFFIX",k[k.PROP_TYPE_TRASACTION_BEGIN=207]="PROP_TYPE_TRASACTION_BEGIN",k[k.PROP_TYPE_REPEATABLE=208]="PROP_TYPE_REPEATABLE",k[k.PROP_TYPE_HIGHLIGHTING=216]="PROP_TYPE_HIGHLIGHTING",k[k.PROP_TYPE_SELECTION_ROWS=217]="PROP_TYPE_SELECTION_ROWS",k[k.PROP_TYPE_BEFORE_900_VERSION=225]="PROP_TYPE_BEFORE_900_VERSION",k[k.PROP_TYPE_FORCE_DELETE=233]="PROP_TYPE_FORCE_DELETE",k[k.PROP_TYPE_TRIGGER=234]="PROP_TYPE_TRIGGER",k[k.PROP_TYPE_TOP_BORDER=237]="PROP_TYPE_TOP_BORDER",k[k.PROP_TYPE_RIGHT_BORDER=238]="PROP_TYPE_RIGHT_BORDER",k[k.PROP_TYPE_WINDOW_WIDTH=241]="PROP_TYPE_WINDOW_WIDTH",k[k.PROP_TYPE_NODE_ID=247]="PROP_TYPE_NODE_ID",k[k.PROP_TYPE_NODE_PARENTID=248]="PROP_TYPE_NODE_PARENTID",k[k.PROP_TYPE_SHOW_BUTTONS=249]="PROP_TYPE_SHOW_BUTTONS",k[k.PROP_TYPE_SHOW_LINES=250]="PROP_TYPE_SHOW_LINES",k[k.PROP_TYPE_SHOW_FULL_ROW=252]="PROP_TYPE_SHOW_FULL_ROW",k[k.PROP_TYPE_TRACK_SELECTION=253]="PROP_TYPE_TRACK_SELECTION",k[k.PROP_TYPE_EXPANDED_IMAGEIDX=256]="PROP_TYPE_EXPANDED_IMAGEIDX",k[k.PROP_TYPE_COLLAPSED_IMAGEIDX=257]="PROP_TYPE_COLLAPSED_IMAGEIDX",k[k.PROP_TYPE_PARKED_IMAGEIDX=258]="PROP_TYPE_PARKED_IMAGEIDX",k[k.PROP_TYPE_LINES_AT_ROOT=267]="PROP_TYPE_LINES_AT_ROOT",k[k.PROP_TYPE_TAB_IN=269]="PROP_TYPE_TAB_IN",k[k.PROP_TYPE_STARTUP_POSITION=275]="PROP_TYPE_STARTUP_POSITION",k[k.PROP_TYPE_ALLOW_DRAGGING=283]="PROP_TYPE_ALLOW_DRAGGING",k[k.PROP_TYPE_ALLOW_DROPPING=284]="PROP_TYPE_ALLOW_DROPPING",k[k.PROP_TYPE_IS_CACHED=286]="PROP_TYPE_IS_CACHED",k[k.PROP_TYPE_SELECTION_MODE=288]="PROP_TYPE_SELECTION_MODE",k[k.PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX=290]="PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX",k[k.PROP_TYPE_DISPLAY_LIST=303]="PROP_TYPE_DISPLAY_LIST",k[k.PROP_TYPE_FORM_NAME=311]="PROP_TYPE_FORM_NAME",k[k.PROP_TYPE_AUTO_REFRESH=312]="PROP_TYPE_AUTO_REFRESH",k[k.PROP_TYPE_AUTO_FIT=313]="PROP_TYPE_AUTO_FIT",k[k.PROP_TYPE_TAB_ORDER=314]="PROP_TYPE_TAB_ORDER",k[k.PROP_TYPE_ALLOW_PARKING=315]="PROP_TYPE_ALLOW_PARKING",k[k.PROP_TYPE_ALLOWED_DIRECTION=317]="PROP_TYPE_ALLOWED_DIRECTION",k[k.PROP_TYPE_TABBING_ORDER=318]="PROP_TYPE_TABBING_ORDER",k[k.PROP_TYPE_HOT_TRACK=354]="PROP_TYPE_HOT_TRACK",k[k.PROP_TYPE_TAB_CONTROL_TABS_WIDTH=355]="PROP_TYPE_TAB_CONTROL_TABS_WIDTH",k[k.PROP_TYPE_IMAGE_LIST_INDEXES=356]="PROP_TYPE_IMAGE_LIST_INDEXES",k[k.PROP_TYPE_WINDOW_TYPE=358]="PROP_TYPE_WINDOW_TYPE",k[k.PROP_TYPE_DISPLAY_TOOLBAR=360]="PROP_TYPE_DISPLAY_TOOLBAR",k[k.PROP_TYPE_DISPLAY_STATUS_BAR=361]="PROP_TYPE_DISPLAY_STATUS_BAR",k[k.PROP_TYPE_STARTUP_MODE=362]="PROP_TYPE_STARTUP_MODE",k[k.PROP_TYPE_THREE_STATES=390]="PROP_TYPE_THREE_STATES",k[k.PROP_TYPE_CHECKBOX_MAIN_STYLE=391]="PROP_TYPE_CHECKBOX_MAIN_STYLE",k[k.PROP_TYPE_RAISE_AT=395]="PROP_TYPE_RAISE_AT",k[k.PROP_TYPE_DISPLAY_MENU=396]="PROP_TYPE_DISPLAY_MENU",k[k.PROP_TYPE_RADIO_BUTTON_APPEARANCE=401]="PROP_TYPE_RADIO_BUTTON_APPEARANCE",k[k.PROP_TYPE_DEFAULT_BUTTON=408]="PROP_TYPE_DEFAULT_BUTTON",k[k.PROP_TYPE_ROW_HIGHLIGHT_STYLE=409]="PROP_TYPE_ROW_HIGHLIGHT_STYLE",k[k.PROP_TYPE_BOTTOM_POSITION_INTERVAL=411]="PROP_TYPE_BOTTOM_POSITION_INTERVAL",k[k.PROP_TYPE_MINIMUM_WIDTH=418]="PROP_TYPE_MINIMUM_WIDTH",k[k.PROP_TYPE_MINIMUM_HEIGHT=419]="PROP_TYPE_MINIMUM_HEIGHT",k[k.PROP_TYPE_SHOW_IN_WINDOW_MENU=422]="PROP_TYPE_SHOW_IN_WINDOW_MENU",k[k.PROP_TYPE_SET_COLOR_BY=428]="PROP_TYPE_SET_COLOR_BY",k[k.PROP_TYPE_ALLOW_REORDER=430]="PROP_TYPE_ALLOW_REORDER",k[k.PROP_TYPE_PARK_ON_CLICK=433]="PROP_TYPE_PARK_ON_CLICK",k[k.PROP_TYPE_TASK_ID=440]="PROP_TYPE_TASK_ID",k[k.PROP_TYPE_PULLDOWN_MENU=441]="PROP_TYPE_PULLDOWN_MENU",k[k.PROP_TYPE_CONTEXT_MENU=442]="PROP_TYPE_CONTEXT_MENU",k[k.PROP_TYPE_DISPLAY_FIELD=443]="PROP_TYPE_DISPLAY_FIELD",k[k.PROP_TYPE_LINK_FIELD=444]="PROP_TYPE_LINK_FIELD",k[k.PROP_TYPE_INDEX=445]="PROP_TYPE_INDEX",k[k.PROP_TYPE_PRELOAD_VIEW=446]="PROP_TYPE_PRELOAD_VIEW",k[k.PROP_TYPE_WALLPAPER_STYLE=448]="PROP_TYPE_WALLPAPER_STYLE",k[k.PROP_TYPE_PART_OF_DATAVIEW=449]="PROP_TYPE_PART_OF_DATAVIEW",k[k.PROP_TYPE_BORDER=452]="PROP_TYPE_BORDER",k[k.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL=455]="PROP_TYPE_MULTILINE_WORDWRAP_SCROLL",k[k.PROP_TYPE_ALLOW_QUERY=456]="PROP_TYPE_ALLOW_QUERY",k[k.PROP_TYPE_MAIN_DISPLAY=457]="PROP_TYPE_MAIN_DISPLAY",k[k.PROP_TYPE_DEST_SUBFORM=458]="PROP_TYPE_DEST_SUBFORM",k[k.PROP_TYPE_HORIZONTAL_PLACEMENT=459]="PROP_TYPE_HORIZONTAL_PLACEMENT",k[k.PROP_TYPE_VERTICAL_PLACEMENT=460]="PROP_TYPE_VERTICAL_PLACEMENT",k[k.PROP_TYPE_FRAMESET_STYLE=461]="PROP_TYPE_FRAMESET_STYLE",k[k.PROP_TYPE_FRAME_TYPE=462]="PROP_TYPE_FRAME_TYPE",k[k.PROP_TYPE_ALLOW_EMPTY_DATAVIEW=463]="PROP_TYPE_ALLOW_EMPTY_DATAVIEW",k[k.PROP_TYPE_SHOW_TITLE=464]="PROP_TYPE_SHOW_TITLE",k[k.PROP_TYPE_TABBING_CYCLE=465]="PROP_TYPE_TABBING_CYCLE",k[k.PROP_TYPE_REFRESH_WHEN_HIDDEN=472]="PROP_TYPE_REFRESH_WHEN_HIDDEN",k[k.PROP_TYPE_HOVERING_COLOR=473]="PROP_TYPE_HOVERING_COLOR",k[k.PROP_TYPE_VISITED_COLOR=474]="PROP_TYPE_VISITED_COLOR",k[k.PROP_TYPE_ALLOW_OPTION=475]="PROP_TYPE_ALLOW_OPTION",k[k.PROP_TYPE_VISIBLE_LAYERS_LIST=476]="PROP_TYPE_VISIBLE_LAYERS_LIST",k[k.PROP_TYPE_INTERACTIVE=477]="PROP_TYPE_INTERACTIVE",k[k.PROP_TYPE_OBJECT_TYPE=478]="PROP_TYPE_OBJECT_TYPE",k[k.PROP_TYPE_OBJECT_PROPERTIES=479]="PROP_TYPE_OBJECT_PROPERTIES",k[k.PROP_TYPE_GRADIENT_COLOR=480]="PROP_TYPE_GRADIENT_COLOR",k[k.PROP_TYPE_GRADIENT_STYLE=481]="PROP_TYPE_GRADIENT_STYLE",k[k.PROP_TYPE_RETAIN_FOCUS=482]="PROP_TYPE_RETAIN_FOCUS",k[k.PROP_TYPE_REAL_OBJECT_TYPE=483]="PROP_TYPE_REAL_OBJECT_TYPE",k[k.PROP_TYPE_ALLOW_LOCATE_IN_QUERY=486]="PROP_TYPE_ALLOW_LOCATE_IN_QUERY",k[k.PROP_TYPE_LOAD_IMAGE_FROM=487]="PROP_TYPE_LOAD_IMAGE_FROM",k[k.PROP_TYPE_PRINT_DATA=488]="PROP_TYPE_PRINT_DATA",k[k.PROP_TYPE_ALLOW_RANGE=489]="PROP_TYPE_ALLOW_RANGE",k[k.PROP_TYPE_ALLOW_LOCATE=490]="PROP_TYPE_ALLOW_LOCATE",k[k.PROP_TYPE_ALLOW_SORT=491]="PROP_TYPE_ALLOW_SORT",k[k.PROP_TYPE_DEST_SUBFORM_NAME=492]="PROP_TYPE_DEST_SUBFORM_NAME",k[k.PROP_TYPE_PERSISTENT_FORMSTATE=493]="PROP_TYPE_PERSISTENT_FORMSTATE",k[k.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU=496]="PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU",k[k.PROP_TYPE_ROW_PLACEMENT=572]="PROP_TYPE_ROW_PLACEMENT",k[k.PROP_TYPE_ADDITIONAL_INFORMATION=573]="PROP_TYPE_ADDITIONAL_INFORMATION",k[k.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS=592]="PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS",k[k.PROP_TYPE_TASK_PROPERTIES_RETURN_VALUE=596]="PROP_TYPE_TASK_PROPERTIES_RETURN_VALUE",k[k.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE=604]="PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE",k[k.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW=619]="PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW",k[k.PROP_TYPE_TASK_PROPERTIES_MAIN_DISPLAY=621]="PROP_TYPE_TASK_PROPERTIES_MAIN_DISPLAY",k[k.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX=630]="PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX",k[k.PROP_TYPE_TASK_PROPERTIES_LOCATE=634]="PROP_TYPE_TASK_PROPERTIES_LOCATE",k[k.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER=635]="PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER",k[k.PROP_TYPE_TASK_PROPERTIES_POSITION=636]="PROP_TYPE_TASK_PROPERTIES_POSITION",k[k.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE=637]="PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE",k[k.PROP_TYPE_TASK_PROPERTIES_RANGE=638]="PROP_TYPE_TASK_PROPERTIES_RANGE",k[k.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER=639]="PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER",k[k.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE=640]="PROP_TYPE_TASK_PROPERTIES_SQL_RANGE",k[k.PROP_TYPE_TASK_PROPERTIES_DB_SQL_RANGE=641]="PROP_TYPE_TASK_PROPERTIES_DB_SQL_RANGE",k[k.PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE=645]="PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE",k[k.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION=653]="PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION",k[k.PROP_TYPE_DATAVIEWCONTROL=656]="PROP_TYPE_DATAVIEWCONTROL",k[k.PROP_TYPE_DATAVIEWCONTROL_FIELDS=657]="PROP_TYPE_DATAVIEWCONTROL_FIELDS",k[k.PROP_TYPE_POP_UP=658]="PROP_TYPE_POP_UP",k[k.PROP_TYPE_ORIENTATION_LOCK=659]="PROP_TYPE_ORIENTATION_LOCK",k[k.PROP_TYPE_ENTER_ANIMATION=660]="PROP_TYPE_ENTER_ANIMATION",k[k.PROP_TYPE_EXIT_ANIMATION=661]="PROP_TYPE_EXIT_ANIMATION",k[k.PROP_TYPE_NAVIGATION_DRAWER_MENU=662]="PROP_TYPE_NAVIGATION_DRAWER_MENU",k[k.PROP_TYPE_TITLE_BAR_COLOR=663]="PROP_TYPE_TITLE_BAR_COLOR",k[k.PROP_TYPE_MOBILE_BORDER_WIDTH=664]="PROP_TYPE_MOBILE_BORDER_WIDTH",k[k.PROP_TYPE_BORDER_COLOR=665]="PROP_TYPE_BORDER_COLOR",k[k.PROP_TYPE_BORDER_FOCUS_WIDTH=666]="PROP_TYPE_BORDER_FOCUS_WIDTH",k[k.PROP_TYPE_BORDER_FOCUS_COLOR=667]="PROP_TYPE_BORDER_FOCUS_COLOR",k[k.PROP_TYPE_CORNER_RADIUS=668]="PROP_TYPE_CORNER_RADIUS",k[k.PROP_TYPE_OPEN_PICKER=669]="PROP_TYPE_OPEN_PICKER",k[k.PROP_TYPE_OPEN_EDIT_DIALOG=670]="PROP_TYPE_OPEN_EDIT_DIALOG",k[k.PROP_TYPE_DEFAULT_ALIGNMENT=671]="PROP_TYPE_DEFAULT_ALIGNMENT",k[k.PROP_TYPE_HINT=672]="PROP_TYPE_HINT",k[k.PROP_TYPE_KEYBOARD_TYPE=673]="PROP_TYPE_KEYBOARD_TYPE",k[k.PROP_TYPE_KEYBOARD_RETURN_KEY=674]="PROP_TYPE_KEYBOARD_RETURN_KEY",k[k.PROP_TYPE_ALLOW_SUGGESTIONS=675]="PROP_TYPE_ALLOW_SUGGESTIONS",k[k.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME=676]="PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME",k[k.PROP_TYPE_TITLE_COLOR=677]="PROP_TYPE_TITLE_COLOR",k[k.PROP_TYPE_FOCUS_COLOR=678]="PROP_TYPE_FOCUS_COLOR",k[k.PROP_TYPE_SWIPE_REFRESH=679]="PROP_TYPE_SWIPE_REFRESH",k[k.PROP_TYPE_ACTION_BAR_MENU=683]="PROP_TYPE_ACTION_BAR_MENU",k[k.PROP_TYPE_TOP_BORDER_MARGIN=684]="PROP_TYPE_TOP_BORDER_MARGIN",k[k.PROP_TYPE_DIVIDER_COLOR=685]="PROP_TYPE_DIVIDER_COLOR",k[k.PROP_TYPE_HOT_TRACK_COLOR=686]="PROP_TYPE_HOT_TRACK_COLOR",k[k.PROP_TYPE_COL_ALLOW_FILTERING=687]="PROP_TYPE_COL_ALLOW_FILTERING",k[k.PROP_TYPE_FILL_WIDTH=688]="PROP_TYPE_FILL_WIDTH",k[k.PROP_TYPE_TITLE_PADDING=689]="PROP_TYPE_TITLE_PADDING",k[k.PROP_TYPE_HINT_COLOR=691]="PROP_TYPE_HINT_COLOR",k[k.PROP_TYPE_MULTI_COLUMN_DISPLAY=692]="PROP_TYPE_MULTI_COLUMN_DISPLAY",k[k.PROP_TYPE_SELECTED_TAB_COLOR=694]="PROP_TYPE_SELECTED_TAB_COLOR",k[k.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION=696]="PROP_TYPE_PERSISTENT_FORM_STATE_VERSION",k[k.PROP_TYPE_INACTIVE_ROW_HIGHLIGHT_COLOR=697]="PROP_TYPE_INACTIVE_ROW_HIGHLIGHT_COLOR",k[k.PROP_TYPE_ROW_BG_COLOR=698]="PROP_TYPE_ROW_BG_COLOR",k[k.PROP_TYPE_SHOW_ELLIPISIS=699]="PROP_TYPE_SHOW_ELLIPISIS",k[k.PROP_TYPE_SCROLL_BAR_THUMB=700]="PROP_TYPE_SCROLL_BAR_THUMB",k[k.PROP_TYPE_IS_ROUTER_OUTLET=707]="PROP_TYPE_IS_ROUTER_OUTLET",k[k.PROP_TYPE_DEFAULT_OUTLET=712]="PROP_TYPE_DEFAULT_OUTLET",k[k.PROP_TYPE_CUSTOM_PROPERTIES=713]="PROP_TYPE_CUSTOM_PROPERTIES",k[k.PROP_TYPE_CONNECTED_ZOOM_CONTROL=719]="PROP_TYPE_CONNECTED_ZOOM_CONTROL",k[k.PROP_TYPE_CUSTOM_VALIDATORS=732]="PROP_TYPE_CUSTOM_VALIDATORS",k[k.PROP_TYPE_BINDING_LEVEL=733]="PROP_TYPE_BINDING_LEVEL",k[k.PROP_TYPE_SERVER_READ_AHEAD=736]="PROP_TYPE_SERVER_READ_AHEAD",k[k.PROP_TYPE_AUTO_COMPLETE_MODE_WC=740]="PROP_TYPE_AUTO_COMPLETE_MODE_WC";var x=function(){};x.Environment=null;var X=function(){function n(){}return n.SetCurrentContextID=function(t){n._currentContextID=t},n.GetCurrentContextID=function(){return n._currentContextID},n.GetDelayWait=function(){return n._delayWait},n.CanFocus=function(t){return!1},n.Init=function(t){},n.Abort=function(t,e){if(null===t.getSubFormCtrl()&&t.Opened){if(t.isDialog()){this.IsOverlayOpen=!1;var r=t.getTopMostFrameForm();null!==r&&r.UpdateModalFormsCount(t,!1)}F.addCloseForm(t,"0",t.getTask().getTaskTag()),F.beginInvoke()}},n.GetCtrlVal=function(t){return F.getValue(t,t.getDisplayLine(!0))},n.SetReadOnlyControl=function(e,n){return s(this,void 0,void 0,(function(){return _(this,(function(i){switch(i.label){case 0:return e.isTextControl()||e.IsRepeatable?r.UtilStrByteMode.isLocaleDefLangDBCS()?[4,e.getForm().getTask().checkProp(t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY,!1)]:[3,2]:[3,3];case 1:if(i.sent())return[2];i.label=2;case 2:F.addOperationWithLine(t.CommandType.SET_PROPERTY,e,e.getDisplayLine(!1),t.HtmlProperties.ReadOnly,n),F.beginInvoke(),i.label=3;case 3:return[2]}}))}))},n.OpenForm=function(t){if(!t.Opened&&(t.getTask().IsInteractive||t.getTask().isOpenWin())){if(!t.isSubForm()&&t.isDialog()){this.IsOverlayOpen=!0;var e=t.getTopMostFrameForm();null!==e&&e.UpdateModalFormsCount(t,!0)}t.Opened=!0,F.beginInvoke()}},n.DoFirstRefreshTable=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return null===t||t.ignoreFirstRefreshTable?[3,2]:(t.ignoreFirstRefreshTable=!0,[4,t.firstTableRefresh()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},n.CaretPosGet=function(t){var e=0;return t.isTextControl()&&(e=F.caretPosGet(t,t.getDisplayLine(!0))),e},n.ClearStatusBar=function(t){var r=t.getLastParkedCtrl();null===r||e.NString.IsNullOrEmpty(r.PromptHelp)?n.CleanMessagePane(t):t.WriteToMessagePane(r.PromptHelp,!1)},n.CleanMessagePane=function(t){t.WriteToMessagePane(n.GetCurrentRuntimeContext().DefaultStatusMsg,!1)},n.GetMessage=function(t){if(null===t)t="";else if(t.length>0){var e=t.indexOf("\r");-1!==e&&(t=t.substr(0,e));var r=t.indexOf("\n");-1!==r&&(t=t.substr(0,r))}return t},n.SetEditText=function(t,e){F.setEditText(t,t.getDisplayLine(!0),e)},n.InsertEditText=function(t,e,r){F.insertEditText(t,t.getDisplayLine(!0),e,r)},n.GetTooltipTimeout=function(){return x.Environment.GetTooltipTimeout()},n.GetSpecialEditLeftAlign=function(){return x.Environment.GetSpecialEditLeftAlign()},n.GetDefaultDateFormat=function(){var t="",e=x.Environment.GetDate();switch(x.Environment.GetDateMode(0)){case"S":t="YYYY"+e+"MM"+e+"DD";break;case"B":case"E":t="DD"+e+"MM"+e+"YYYY";break;case"A":t="MM"+e+"DD"+e+"YYYY"}return t},n.GetDefaultTimeFormat=function(){var t=x.Environment.GetTime();return"HH"+t+"MM"+t+"SS"},n.GetCurrentRuntimeContext=function(){return E.GetRuntimeContext(n.GetCurrentContextID())},n.GetContextID=function(t){var e=null;return t instanceof V?e=t.GuiMgForm:t instanceof h&&(e=t),E.GetContextID(e)},n.ShowWindowHelp=function(t,e,r){},n.GetSpecialValNewPolicy=function(){return x.Environment.GetSpecialValNewPolicy()},n}();X.IsOverlayOpen=!1,X._delayWait=new Object,X._clipboardData="",X._currentContextID="\0",X.DefaultProtocol=null,X.DefaultServerName=null,X.UtilImeJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new r.UtilImeJpn:null,X.EventsManager=null;var H=function(){function t(t){this._prevContextID="\0",this._fileName=null,0!==arguments.length?this.constructor_1(t):this.constructor_0()}return t.prototype.constructor_0=function(){this._prevContextID=X.GetCurrentContextID(),this.SaveFilename()},t.prototype.constructor_1=function(t){this.SetCurrent(t),this.SaveFilename()},t.prototype.SetCurrent=function(t){t!==this._prevContextID&&(this._prevContextID=t,X.SetCurrentContextID(t))},t.prototype.SaveFilename=function(){var t=new e.StackFrame(1,!0);this._fileName=t.GetFileName()},t.prototype.Dispose=function(){this._prevContextID!==X.GetCurrentContextID()&&X.SetCurrentContextID(this._prevContextID)},t}(),W=function(){};W.DEFAULT_LIST_VALUE=-1,W.DEFAULT_VALUE_INT=-999999,W.ALL_LINES=-1,W.NO_ROW_SELECTED=e.Int32.MinValue,W.RIA_MOBILE_UNSUPPORTED_CONTROL_ERROR="control is not supported for mobile RIA deployment",W.RIA_MOBILE_UNSUPPORTED_CONTROL_ERROR_WINDOW_6="control is not supported for mobile RIA deployment on Window 6 standard",W.TOOL_HEIGHT=17,W.TOOL_WIDTH=16,W.STR_DISPLAY_MEMBER="DisplayMember",W.STR_VALUE_MEMBER="ValueMember",W.PARENT_TYPE_TASK="T",W.PARENT_TYPE_FORM="F",W.PARENT_TYPE_CONTROL="C",W.GENERIC_PROPERTY_BASE_ID=1e4,W.TABBING_CYCLE_REMAIN_IN_CURRENT_RECORD="R",W.TABBING_CYCLE_MOVE_TO_NEXT_RECORD="N",W.TABBING_CYCLE_MOVE_TO_PARENT_TASK="P",W.BLOB_PREFIX_ELEMENTS_COUNT=5,W.KEY_DOWN=40,W.KEY_RIGHT=39,W.KEY_UP=38,W.KEY_LEFT=37,W.KEY_HOME=36,W.KEY_END=35,W.KEY_PG_DOWN=34,W.KEY_PG_UP=33,W.KEY_SPACE=32,W.KEY_F12=123,W.KEY_F1=112,W.KEY_9=57,W.KEY_0=48,W.KEY_Z=90,W.KEY_A=65,W.KEY_DELETE=46,W.KEY_INSERT=45,W.KEY_BACKSPACE=8,W.KEY_TAB=9,W.KEY_RETURN=13,W.KEY_ESC=27,W.KEY_CAPS_LOCK=20,W.KEY_POINT1=190,W.KEY_POINT2=110,W.KEY_COMMA=188,W.KEY_CTRL=17,W.KEY_ALT=18,W.LOGON_CAPTION="Logon - ",W.ENTER_UID_TTL="Please enter your user ID and password.",W.GROUP_BOX_TITLE_MAX_SIZE=62,W.MSG_CAPTION_MAX_SIZE=56,W.LABEL_CAPTION_MAX_SIZE=9,W.PASSWORD_CAPTION_MAX_SIZE=19,W.REPLACE_ALL_TEXT=-1,W.STR_LOGON_RTL="LogonRTL",W.STR_LOGO_WIN_ICON_URL="LogonWindowIconURL",W.STR_LOGON_IMAGE_URL="LogonImageURL",W.STR_LOGON_WIN_TITLE="LogonWindowTitle",W.STR_LOGON_GROUP_TITLE="LogonGroupTitle",W.STR_LOGON_MSG_CAPTION="LogonMessageCaption",W.STR_LOGON_USER_ID_CAPTION="LogonUserIDCaption",W.STR_LOGON_PASS_CAPTION="LogonPasswordCaption",W.STR_LOGON_OK_CAPTION="LogonOKCaption",W.STR_LOGON_CANCEL_CAPTION="LogonCancelCaption";var K=function(){function t(){}return t.getContentType=function(t){try{return r.StrUtil.tokenize(t,/,|;/)[4].charAt(0)}catch(t){throw new e.ApplicationException(" in BlobType.getContentType blob is in invalid format")}},t.getEmptyBlobPrefix=function(t){return e.NString.Format("0,0,{0},{1},0","\0",t)},t.getBlobPrefixForContentType=function(t){return e.NString.Format("0,0,{0},{0},{1};","\0",t)},t.getPrefix=function(t){var e=t.indexOf(";");return t.substr(0,e+1)},t.getEncodingFromContentType=function(r){return r===t.CONTENT_TYPE_UNICODE?e.Encoding.Unicode:r===t.CONTENT_TYPE_ANSI?x.Environment.GetEncoding():e.ISO_8859_1_Encoding.ISO_8859_1},t.MbToUnicode=function(t){var r=null;try{var n=x.Environment.GetEncoding().GetString(t,0,t.length);r=e.Encoding.Unicode.GetBytes(n)}catch(t){r=null}return r},t.UnicodeToMb=function(t){var r=null;try{var n=e.Encoding.Unicode.GetString(t,0,t.length);r=x.Environment.GetEncoding().GetBytes(n)}catch(t){r=null}return r},t.getString=function(r){var n=null,i=null;if(t.isValidBlob(r)){var o=t.getContentType(r);o!==t.CONTENT_TYPE_UNICODE&&(o=t.CONTENT_TYPE_ANSI);try{i=t.getBytes(r);var a=(n=t.getEncodingFromContentType(o).GetString(i,0,i.length)).indexOf("\0");-1!==a&&(n=n.substr(0,a))}catch(t){n=null}}else e.Debug.Assert(!1);return n},t.createFromString=function(e,r){var n=null,i=r,o=null;r!==t.CONTENT_TYPE_UNICODE&&(i=t.CONTENT_TYPE_ANSI);try{if(e.constructor===ArrayBuffer)o=new Uint8Array(e);else o=t.getEncodingFromContentType(i).GetBytes(e);n=t.createFromBytes(o,r)}catch(t){n=null}return n},t.getBytes=function(r){var n=null,i=t.removeBlobPrefix(r);try{n=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(i)}catch(t){n=null}return n},t.createFromBytes=function(r,n){var i,o;i=t.getBlobPrefixForContentType(n);try{o=e.ISO_8859_1_Encoding.ISO_8859_1.GetString(r,0,r.length)}catch(t){o=null}return i+o},t.copyBlob=function(e,r){var n,i;if(null===r)return null;if(null===e)return r;n=t.getBytes(r);var o=t.getContentType(e),a=t.getContentType(r);return i=a===t.CONTENT_TYPE_ANSI&&o===t.CONTENT_TYPE_UNICODE?t.MbToUnicode(n):a===t.CONTENT_TYPE_UNICODE&&o===t.CONTENT_TYPE_ANSI?t.UnicodeToMb(n):n,e=t.createFromBytes(i,o)},t.removeBlobPrefix=function(t){var e;return null!==t?((e=t.indexOf(";"))<0&&r.Logger.Instance.WriteToLog("Error: invalid blob prefix",!0),t.substr(e+1)):null},t.isValidBlob=function(e){var r=!0;if((null===e||e.indexOf(";")<0)&&(r=!1),r){var n=t.getContentType(e);n!==t.CONTENT_TYPE_ANSI&&n!==t.CONTENT_TYPE_BINARY&&n!==t.CONTENT_TYPE_UNICODE&&n!==t.CONTENT_TYPE_UNKNOWN&&(r=!1)}return r},t.setContentType=function(t,n){var i="";try{for(var o=t.indexOf(";"),a=t.substr(0,o),s=t.length-(a.length+1),_=t.substr(o+1,s),l=r.StrUtil.tokenize(a,/,|;/),u=0;u<W.BLOB_PREFIX_ELEMENTS_COUNT;u+=1)i=4===u?i+n+",":i+l[u]+",";return i.substr(0,i.length-1)+";"+_}catch(t){throw new e.ApplicationException(" in BlobType.setContentType : invalid format")}},t.SetVecCellAttr=function(t,n){var i="";try{for(var o=t.indexOf(";"),a=t.substr(0,o),s=t.substr(o+1),_=r.StrUtil.tokenize(a,/,|;/),l=0;l<W.BLOB_PREFIX_ELEMENTS_COUNT;l+=1)i=3===l?i+n+",":i+_[l]+",";return i.substr(0,i.length-1)+";"+s}catch(t){throw new e.ApplicationException(" in XMLparser.blobPrefixLength invalid format")}},t.GetVecCellAttr=function(t){try{return r.StrUtil.tokenize(t,/,|;/)[3].charAt(0)}catch(t){throw new e.ApplicationException(" in BlobType.GetVecCellAttr(): blob is in invalid format")}},t.blobPrefixLength=function(t){try{var n=t.indexOf(";")+1,i=t.substr(0,n);if(n>0)if(r.StrUtil.tokenize(i,",").length===W.BLOB_PREFIX_ELEMENTS_COUNT)return n}catch(t){}throw new e.ApplicationException(" in XMLparser.blobPrefixLength invalid format")},t.getKey=function(t){var n=r.StrUtil.tokenize(t,/,|;/),i=0;if(n.length>5)try{i=e.NNumber.Parse(n[0])}catch(t){}return i},t.getBlobSize=function(t){var e=0;try{var n=r.StrUtil.tokenize(t,/,|;/);if(n.length>5){e=t.length;for(var i=0;i<5;i+=1)e-=n[i].length,e-=1}}catch(t){}return e},t.ParseContentType=function(e){var r=" ";switch(e){case 0:r=t.CONTENT_TYPE_UNKNOWN;break;case 1:r=t.CONTENT_TYPE_ANSI;break;case 2:r=t.CONTENT_TYPE_UNICODE;break;case 3:r=t.CONTENT_TYPE_BINARY}return r},t}();K.CONTENT_TYPE_UNKNOWN="0",K.CONTENT_TYPE_ANSI="1",K.CONTENT_TYPE_UNICODE="2",K.CONTENT_TYPE_BINARY="3";var z=function(){function t(t,n,i){this._mskLen=0,this._negPref=new e.StringBuilder,this._negSuff=new e.StringBuilder,this._picAttr=r.StorageAttribute.NONE,this._posPref=new e.StringBuilder,this._posSuff=new e.StringBuilder,this._autoSkip_=!1,this._padFill=!1,this._zeroFill=!1,this._comma=!1,this._decimalDigits=0,this._decPointIsFirst=!1,this._decimal=!1,this._embeded=!1,this._formatIdx=0,this._format=null,this.hebrew=!1,this._imeMode=-1,this._left=!1,this._maskLength=0,this._maskChars=0,this._maskSize=0,this._mixed=!1,this._msk=null,this._needLength=!1,this._negative=!1,this._pad="\0",this._prefLen=0,this._size=0,this._suffLen=0,this._termFlag=!1,this._trim=!1,this._whole=0,this._zero="\0",this._picAttr=n,this._picAttr!==r.StorageAttribute.BLOB&&this._picAttr!==r.StorageAttribute.BLOB_VECTOR?(this._format=e.NString.ToCharArray(t),this._formatIdx=0,this._mskLen=this.getMaskLen(i),this.prs_all(i)):t.trim().length>0&&E.WriteDevToLog("PIC.PIC the picture of BLOB must be empty string")}return t.prototype.isHebrew=function(){return this.hebrew},t.prototype.isMixed=function(){return this._mixed},t.prototype.embededChars=function(){return this._embeded},t.prototype.isNegative=function(){return this._negative},t.prototype.withComa=function(){return this._comma},t.prototype.isLeft=function(){return this._left},t.prototype.padFill=function(){return this._padFill},t.prototype.getPad=function(){return this._pad},t.prototype.zeroFill=function(){return this._zeroFill},t.prototype.getZeroPad=function(){return this._zero},t.prototype.isTrimed=function(){return this._trim},t.prototype.autoSkip=function(){return this._autoSkip_},t.prototype.withDecimal=function(){return this._decimal},t.prototype.withTerm=function(){return this._termFlag},t.prototype.getMaskChars=function(){return this._maskChars},t.prototype.getWholes=function(){return this._whole},t.prototype.getDec=function(){return this._decimalDigits},t.prototype.getSize=function(){return this._size},t.prototype.getMaskSize=function(){return this._maskSize},t.prototype.getMaskLength=function(){return this._maskLength},t.prototype.decInFirstPos=function(){return this._decPointIsFirst},t.prototype.getPosPref_=function(){return this._posPref.ToString()},t.prototype.getPosSuff_=function(){return this._posSuff.ToString()},t.prototype.getNegPref_=function(){return this._negPref.ToString()},t.prototype.getNegSuff_=function(){return this._negSuff.ToString()},t.prototype.getMask=function(){return e.NString.FromChars(this._msk)},t.prototype.getFormat=function(){return e.NString.FromChars(this._format)},t.prototype.getAttr=function(){return this._picAttr},t.prototype.setAttr=function(t){this._picAttr},t.prototype.getImeMode=function(){return this._imeMode},t.prototype.prs_all=function(t){if(!this._needLength){this._msk=new Array(this._mskLen);for(var e=0;e<this._msk.length;++e)this._msk[e]="\0"}switch(this._picAttr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:this.alpha_prs();break;case r.StorageAttribute.NUMERIC:this.num_prs();break;case r.StorageAttribute.DATE:this.date_prs(t);break;case r.StorageAttribute.TIME:this.time_prs();break;case r.StorageAttribute.BOOLEAN:this.bool_prs();case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:}},t.prototype.alpha_prs=function(){for(var t,e,n;this._formatIdx<this._format.length;)switch(t=this._format[this._formatIdx]){case"H":this._formatIdx++,this.setHebrew();break;case"A":this._autoSkip_=!0,this._formatIdx++;break;case"#":case"L":case"U":case"X":switch(e=0,t){case"#":e=r.PICInterface.PIC_N;break;case"L":e=r.PICInterface.PIC_L;break;case"U":e=r.PICInterface.PIC_U;break;case"X":e=r.PICInterface.PIC_X}this._formatIdx++,n=this.pik_count(),this.pik_drv_fill(e,n);break;default:if(r.UtilStrByteMode.isLocaleDefLangDBCS()){var i=r.UtilStrByteMode.isLocaleDefLangJPN();if("K"===t&&i&&this.pic_kanji())break;if(x.Environment.GetLocalAs400Set()&&(e=0,"J"===t?e=r.PICInterface.PIC_J:"T"===t?e=r.PICInterface.PIC_T:"G"===t?e=r.PICInterface.PIC_G:"S"===t&&(e=r.PICInterface.PIC_S),0!==e)){-1===this._imeMode&&i&&(e===r.PICInterface.PIC_J||e===r.PICInterface.PIC_G?this._imeMode=r.UtilImeJpn.IME_ZEN_HIRAGANA_ROMAN:e===r.PICInterface.PIC_S&&(this._imeMode=r.UtilImeJpn.IME_FORCE_OFF)),this._formatIdx++,n=this.pik_count(),this.pik_drv_fill(e,n);break}}r.UtilStrByteMode.isDigit(t)?(n=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,n)):this.pik_mask()}0===this._maskSize&&this.pik_drv_fill(r.PICInterface.PIC_X,this._mskLen),this._size=this._maskSize,this._embeded||(this._size-=this._maskChars)},t.prototype.num_prs=function(){var t,e,n,i,o,a,s=0,_=!0;for(this._zero=" ",this._pad=" ",this._negPref.Append("-"),t=0;t<this._format.length&&("+"!==this._format[t]&&"-"!==this._format[t]);t+=1)"\\"!==this._format[t]&&"P"!==this._format[t]||(t+=1),"C"===this._format[t]&&(this._comma=!0);for(;this._formatIdx<this._format.length;)switch(n=this._format[this._formatIdx]){case"N":this._formatIdx++,this._negative=!0;break;case"C":this._formatIdx++,this._comma=!0;break;case"L":this._formatIdx++,this._left=!0;break;case"P":this._formatIdx++,this._padFill=!0,this._formatIdx<this._format.length&&(this._pad=this._format[this._formatIdx++]);break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case".":this._formatIdx++,this._needLength&&this._maskLength++,this._decimal=!0,this._maskSize<this._mskLen&&(this._msk[this._maskSize]=String.fromCharCode(r.PICInterface.PIC_N)),0===this._maskSize&&(this._decPointIsFirst=!0),this._maskSize++;break;case"+":case"-":this.pik_sign();break;default:r.UtilStrByteMode.isDigit(n)||"#"===n?(o=this._formatIdx,"#"===n&&this._formatIdx++,i=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_N,i),"#"===this._format[o]?(1===i&&(a=this._formatIdx,this._formatIdx=o,s=this.pik_dup(),this._formatIdx=a),_&&(s>0||i>1)&&(i>1&&(s=i),this._comma&&!this._decimal&&this.pik_drv_fill(r.PICInterface.PIC_N,Math.floor((s-1)/3)),_=!1)):this._comma&&!this._decimal&&this.pik_drv_fill(r.PICInterface.PIC_N,Math.floor((i-1)/3)),this._decimal?this._decimalDigits+=i:this._whole+=i):this.pik_mask()}if(this._prefLen=this._posPref.Length,this._suffLen=this._posSuff.Length,this._negative&&(this._negPref.Length>this._prefLen&&(this._prefLen=this._negPref.Length),this._negSuff.Length>this._suffLen&&(this._suffLen=this._negSuff.Length)),0===this._whole&&0===this._decimalDigits&&(i=r.PICInterface.PIC_MAX_MSK_LEN-this._prefLen-this._suffLen,this._maskSize<i&&(this._whole=i-this._maskSize,this._comma&&(this._whole-=Math.floor(this._whole/4)),this.pik_drv_fill(r.PICInterface.PIC_N,this._whole))),this._comma&&(i=Math.floor((this._whole-1)/3),this.pik_drv_fill(r.PICInterface.PIC_N,i),this._maskSize-=i),(t=this._prefLen)>0&&null!=this._msk){if(this._maskSize+t<=this._mskLen){for(e=this._maskSize-1;e>=0;e--)this._msk[e+t]=this._msk[e];for(e=0;e<t;e++)null!=this._msk&&e<this._msk.length&&(this._msk[e]=String.fromCharCode(r.PICInterface.PIC_N))}this._maskSize+=t}if((t=this._suffLen)>0&&null!=this._msk){if(this._maskSize+this._suffLen<=this._mskLen)for(e=0;e<this._suffLen;e++)this._msk[this._maskSize+e]=String.fromCharCode(r.PICInterface.PIC_N);this._maskSize+=t}},t.prototype.getUnformattedNumericPic=function(){var e="";return this.isNegative()&&(e=this.isNegative()?"N":""),e+=this.getWholes().toString(),this.getDec()>0&&(e+="."+this.getDec().toString()),this._zeroFill&&(e+="Z"),new t(e,r.StorageAttribute.NUMERIC,0)},t.prototype.date_prs=function(n){var i,o,a,s=0,_=!1,l=!1,u=!1;this._zero=" ",o=0,0!==this._format.length&&"\0"!==this._format[0]||(this._format=e.NString.ToCharArray(t.getDefaultDateMask(x.Environment.GetDateMode(n))));for(var P=0;P<this._format.length;P++)"H"===this._format[P]&&this.setHebrew();for(;this._formatIdx<this._format.length;)switch(this._format[this._formatIdx]){case"H":this._formatIdx++;break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"T":this._formatIdx++,this._trim=!0;break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"L":this.hebrew?(this._formatIdx++,this.pik_drv_fill(r.PICInterface.PIC_HL,1)):this.pik_mask();break;case"Y":switch(s=0,i=a=this.pik_dup(),a){case 1:break;case 2:this.hebrew||(s=r.PICInterface.PIC_YY);break;case 4:s=this.hebrew?r.PICInterface.PIC_HYYYYY:r.PICInterface.PIC_YYYY;break;case 5:case 6:this.hebrew&&(s=r.PICInterface.PIC_HYYYYY)}0!==s?(this._formatIdx+=a,this.pik_drv_fill(s,i)):this.pik_mask();break;case"M":s=0,2===(a=this.pik_dup())?s=r.PICInterface.PIC_MMD:a>2&&(s=r.PICInterface.PIC_MMM,a>10&&(s=0)),0!==s?(this._formatIdx+=a,this.pik_drv_fill(s,a)):this.pik_mask();break;case"D":switch(s=0,a=this.pik_dup()){case 2:if(!this.hebrew){s=r.PICInterface.PIC_DD;break}case 3:s=this.hebrew?r.PICInterface.PIC_HDD:r.PICInterface.PIC_DDD;break;case 4:this.hebrew?this.pik_mask():s=r.PICInterface.PIC_DDDD;break;default:this.pik_mask()}0!==s&&(this.pik_drv_fill(s,a),this._formatIdx+=a);break;case"#":if(2===(a=this.pik_dup())){if(s=0,o++,!this.hebrew)switch(x.Environment.GetDateMode(n)){case"B":case"E":switch(o){case 1:s=r.PICInterface.PIC_DD;break;case 2:s=r.PICInterface.PIC_MMD;break;case 3:s=r.PICInterface.PIC_YY}break;case"A":switch(o){case 1:s=r.PICInterface.PIC_MMD;break;case 2:s=r.PICInterface.PIC_DD;break;case 3:s=r.PICInterface.PIC_YY}break;case"J":case"S":switch(o){case 1:l||(_=e.NString.FromChars(this._format).indexOf("####")>-1,l=!0),_?this.pik_drv_fill(r.PICInterface.PIC_YYYY,4):s=r.PICInterface.PIC_YY;break;case 2:s=r.PICInterface.PIC_MMD;break;case 3:s=r.PICInterface.PIC_DD}}0!==s&&this.pik_drv_fill(s,2)}else if(4===a){if(s=0,o++,!this.hebrew)switch(x.Environment.GetDateMode(n)){case"B":case"E":case"A":3===o&&(s=r.PICInterface.PIC_YYYY);break;case"J":case"S":1===o?s=r.PICInterface.PIC_YYYY:(l||(_=e.NString.FromChars(this._format).indexOf("####")>-1,l=!0),_&&3===o&&this.pik_drv_fill(r.PICInterface.PIC_DD,2))}0!==s&&this.pik_drv_fill(s,4)}this._formatIdx+=a;break;case"W":i=a=this.pik_dup(),1===a?s=r.PICInterface.PIC_W:this.hebrew?5===a?s=r.PICInterface.PIC_WWW:i=0:a>2&&a<=10?s=r.PICInterface.PIC_WWW:i=0,this._formatIdx+=a,this.pik_drv_fill(s,i);break;case"/":this._formatIdx++,this.pik_drv_fill(x.Environment.GetDate().charCodeAt(0),1);break;case"S":r.UtilStrByteMode.isLocaleDefLangJPN()?(i=a=this.pik_dup(),2!==a&&4!==a&&6!==a&&(i=0),s=r.PICInterface.PIC_BB,this._formatIdx+=a,this.pik_drv_fill(s,i)):this.pik_mask();break;case"J":if(r.UtilStrByteMode.isLocaleDefLangJPN()){switch(i=a=this.pik_dup(),u=!0,a){case 1:s=r.PICInterface.PIC_JY1;break;case 2:s=r.PICInterface.PIC_JY2;break;case 4:s=r.PICInterface.PIC_JY4;break;default:i=0,u=!1}this._formatIdx+=a,this.pik_drv_fill(s,i)}else this.pik_mask();break;default:this.pik_mask()}if(!this._needLength&&u)for(i=0;i<this._msk.length;i++)this._msk[i].charCodeAt(0)===r.PICInterface.PIC_YY?this._msk[i]=String.fromCharCode(r.PICInterface.PIC_YJ):this._msk[i].charCodeAt(0)===r.PICInterface.PIC_YYYY&&(this._msk[i]="Y")},t.prototype.time_prs=function(){var t,n,i;for(this._zero=" ",0!==this._format.length&&0!==this._format[0].charCodeAt(0)||(n="HH:MM:SS",this._mskLen<8&&(n=n.substr(0,this._mskLen)),this._format=e.NString.ToCharArray(n));this._formatIdx<this._format.length;){var o=void 0;switch(i=this._format[this._formatIdx]){case"H":case"M":case"S":if(o=2,this._formatIdx+1<this._format.length&&this._format[this._formatIdx]===this._format[this._formatIdx+1]){switch(i){case"H":t=r.PICInterface.PIC_HH;break;case"M":t=r.PICInterface.PIC_MMT;break;case"S":t=r.PICInterface.PIC_SS;break;default:t=r.PICInterface.NULL_CHAR}this._formatIdx+=o,this.pik_drv_fill(t,o)}else this.pik_mask();break;case"m":o=3,this._formatIdx+2<this._format.length&&this._format[this._formatIdx]===this._format[this._formatIdx+1]&&this._format[this._formatIdx+1]===this._format[this._formatIdx+2]?(t=r.PICInterface.PIC_MS,this._formatIdx+=o,this.pik_drv_fill(t,o)):this.pik_mask();break;case":":this._formatIdx++,this.pik_drv_fill(x.Environment.GetTime().charCodeAt(0),1);break;case"Z":this._formatIdx++,this._zeroFill=!0,this._formatIdx<this._format.length&&(this._zero=this._format[this._formatIdx++]);break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"P":"M"===this._format[this._formatIdx+1]?(this._formatIdx+=2,this.pik_drv_fill(r.PICInterface.PIC_PM,2)):this.pik_mask();break;default:this.pik_mask()}}},t.buildPicture=function(n,i,o,a){var s,_,l,u,P,c,T,h,p,I,f=null,O=new e.StringBuilder(10);switch(n){case r.StorageAttribute.NUMERIC:if(s=x.Environment.GetDecimal(),_=x.Environment.GetThousands(),c=T=0,h=!1,p=!1,I=!1,null===i||0===i.length)c=T=1;else{for(P=i.length,u=0;u<P;){switch(l=i[u]){case"+":case"-":I=!0;break;default:a&&l===s?h=!0:l===_?p=!0:h?T++:c++}u++}O.Append(""+c+s+T),I&&O.Append("N"),p&&O.Append("C")}break;case r.StorageAttribute.DATE:O.Append(this.getDefaultDateMask(x.Environment.GetDateMode(o)));break;case r.StorageAttribute.TIME:O.Append("HH"+x.Environment.GetTime()+"MM"+x.Environment.GetTime()+"SS");break;default:return E.WriteDevToLog("Event.buildPicture() there is no PICTURE building for type :"+n+" and value :"+i),f}return f=new t(O.ToString(),n,o)},t.prototype.setHebrew=function(){"H"===x.Environment.Language&&(this.hebrew=!0)},t.getDefaultDateMask=function(t){var e;switch(t){case"J":case"S":e="####/##/##";break;default:e="##/##/####"}return e},t.prototype.bool_prs=function(){for(var t,e;this._formatIdx<this._format.length;)switch(e=this._format[this._formatIdx]){case"H":this._formatIdx++,this.setHebrew();break;case"A":this._formatIdx++,this._autoSkip_=!0;break;case"X":this._formatIdx++,t=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,t);break;default:r.UtilStrByteMode.isDigit(e)?(t=this.pik_count(),this.pik_drv_fill(r.PICInterface.PIC_X,t)):this.pik_mask()}0===this._maskSize&&this.pik_drv_fill(r.PICInterface.PIC_X,this._mskLen)},t.prototype.pik_sign=function(){var t,e,r;for(t="+"===this._format[this._formatIdx],this._formatIdx++,t?e=this._posPref:(this._negPref.Remove(0,this._negPref.Length),e=this._negPref);this._formatIdx<this._format.length;)switch(r=this._format[this._formatIdx]){case";":return void this._formatIdx++;case",":this._formatIdx++,e=t?this._posSuff:this._negSuff;break;case"\\":if(this._formatIdx++,this._formatIdx>=this._format.length)return;r=this._format[this._formatIdx];default:e.Append(r),this._formatIdx++}},t.prototype.pik_count=function(){var t,n=x.Environment.GetSpecialValNewPolicy(),i=!1;for(t=0;this._formatIdx<this._format.length&&r.UtilStrByteMode.isDigit(this._format[this._formatIdx]);)t*=10,i=!0,t+=this._format[this._formatIdx].charCodeAt(0)-"0".charCodeAt(0),this._formatIdx++;if(t>32e3)t=32e3;else if(t<=0){if(n&&i&&0===t)return 0;t=1}if(t>e.Int32.MaxValue)throw new e.ApplicationException(E.GetMessageString(r.MsgInterface.STR_ERR_MAX_VAR_SIZE));return t},t.prototype.pik_drv_fill=function(t,e){var r,n=0;if(this._needLength)this._maskLength+=e;else if(r=this._maskSize,this._maskSize+=e,r+e>this._mskLen&&(e=this._mskLen-r),e>0)for(n=0;n<e;n++)this._msk[r+n]=String.fromCharCode(t);else;},t.prototype.pik_mask=function(){var t,e;"\\"===this._format[this._formatIdx]&&this._formatIdx++,this._formatIdx<this._format.length&&(t=this._format[this._formatIdx],this._formatIdx++,e=this.pik_count(),this.pik_drv_fill(t.charCodeAt(0),e),this._maskChars+=e)},t.prototype.pik_dup=function(){var t,e=1,r=this._formatIdx;for(t=this._format[r],r++;r<this._format.length&&t===this._format[r];)e++,r++;return e},t.prototype.pic_kanji=function(){var t;return!(this._formatIdx+1>=this._format.length)&&(!!r.UtilStrByteMode.isDigit(this._format[this._formatIdx+1])&&(this._formatIdx++,"0"===this._format[this._formatIdx]?(this._imeMode=r.UtilImeJpn.IME_FORCE_OFF,this._formatIdx++):1<=(t=this.pik_count())&&t<=9&&(this._imeMode=t),!0))},t.prototype.getMaskLen=function(t){return this._needLength=!0,this._maskLength=0,this._formatIdx=0,this.prs_all(t),this._picAttr===r.StorageAttribute.NUMERIC&&(this._prefLen>0||this._suffLen>0)&&(this._maskLength+=this._prefLen+this._suffLen),this._needLength=!1,this._formatIdx=this._maskChars=this._whole=this._decimalDigits=this._size=this._maskSize=this._prefLen=this._suffLen=0,this._pad=this._zero=String.fromCharCode(0),this.hebrew=this._mixed=this._embeded=this._negative=this._comma=this._left=this._padFill=this._zeroFill=this._trim=this._autoSkip_=this._decimal=this._termFlag=this._decPointIsFirst=!1,this._posPref.Remove(0,this._posPref.Length),this._posSuff.Remove(0,this._posSuff.Length),this._negPref.Remove(0,this._negPref.Length),this._negSuff.Remove(0,this._negSuff.Length),this._maskLength},t.prototype.picIsMask=function(t){return(t<0||t>=this._maskLength)&&(t=0),this._msk[t].charCodeAt(0)>r.PICInterface.PIC_MAX_OP},t.prototype.getDirectiveLen=function(t,e,r){return 1===arguments.length?this.getDirectiveLen_0(t):this.getDirectiveLen_1(t,e,r)},t.prototype.getDirectiveLen_0=function(t){for(var e=this._msk[t],r=t;r<this._maskSize&&e===this._msk[r];)r+=1;return r-t},t.prototype.getDirectiveLen_1=function(t,e,n){for(var i=this._msk[t],o=t,a=e;o<this._maskSize&&i===this._msk[o];)a<n.length&&r.UtilStrByteMode.isLocaleDefLangDBCS()&&this.isAttrAlphaOrDate()&&(r.UtilStrByteMode.isHalfWidth(n[a++])||o++),o++;return o-t},t.prototype.validateChar=function(t,e){var n=t;if(e>=this.getMaskSize())return n;for(;this.picIsMask(e);)e++;switch(this._msk[e].charCodeAt(0)){case r.PICInterface.PIC_U:n=t.toUpperCase();break;case r.PICInterface.PIC_L:n=t.toLowerCase();default:if(!r.UtilStrByteMode.isDigit(t))for(var i=0;i<r.PICInterface.NumDirective.length;i++)if(this._msk[e].charCodeAt(0)===r.PICInterface.NumDirective[i]){n=this.isValidInNum(t);break}}return n},t.prototype.isValidInNum=function(t){var e="\0",r=x.Environment.GetDecimal();switch(x.Environment.CanReplaceDecimalSeparator()&&this.isAttrNumeric()&&"."===t&&(t=r),t){case" ":case"-":case"*":case"+":case"/":e=t;break;default:t!==r&&t!==x.Environment.GetThousands()||(e=t)}return e},t.prototype.isAttrLogical=function(){return this._picAttr===r.StorageAttribute.BOOLEAN},t.prototype.isAttrNumeric=function(){return this._picAttr===r.StorageAttribute.NUMERIC},t.prototype.isAttrAlpha=function(){return this._picAttr===r.StorageAttribute.ALPHA},t.prototype.isAttrUnicode=function(){return this._picAttr===r.StorageAttribute.UNICODE},t.prototype.isAttrAlphaOrDate=function(){return this._picAttr===r.StorageAttribute.ALPHA||this._picAttr===r.StorageAttribute.DATE},t.prototype.isAttrDateOrTime=function(){return this._picAttr===r.StorageAttribute.TIME||this._picAttr===r.StorageAttribute.DATE},t.prototype.isAttrBlob=function(){return this._picAttr===r.StorageAttribute.BLOB||this._picAttr===r.StorageAttribute.BLOB_VECTOR},t.prototype.isNumeric=function(t){return this._msk[t]===String.fromCharCode(r.PICInterface.PIC_N)},t.prototype.isAllX=function(){return this._msk[0]===String.fromCharCode(r.PICInterface.PIC_X)&&this.getDirectiveLen(0)===this._maskSize},t.prototype.isMaskPicEq=function(t,e){return this._msk[t]===String.fromCharCode(e)},t.prototype.isValidChar_as400=function(t,e,n){var i=!0;switch(this._msk[n].charCodeAt(0)){case r.PICInterface.PIC_J:case r.PICInterface.PIC_G:i=!r.UtilStrByteMode.isHalfWidth(t);break;case r.PICInterface.PIC_T:i="\x0000"===e||(r.UtilStrByteMode.isHalfWidth(e)?r.UtilStrByteMode.isHalfWidth(t):!r.UtilStrByteMode.isHalfWidth(t));break;case r.PICInterface.PIC_S:i=r.UtilStrByteMode.isHalfWidth(t)}return i},t.prototype.getMinimumValueLength=function(){for(var t=this.getMaskLength();t>0&&!this.picIsMask(t-1);)t--;return t},t.prototype.toString=function(){return"{Picture: "+this._format+"}"},t}(),j=function(){function t(t){this._continuousRangeValues=null,this._discreteRangeValues=null,this._range=null,1===arguments.length&&(this._range=t,null!==this._range&&this.fillRange())}return t.prototype.fillRange=function(){this._range=r.StrUtil.makePrintableTokens(this._range,r.SEQ_2_HTML);for(var t=0,e=0;-1!==(t=this.findDelimeter(t,",",this._range))&&e<this._range.length;)this.rangeForms(this._range.substr(e,t-e)),t=e=t+1;e<this._range.length&&this.rangeForms(this._range.substr(e)),null!=this._discreteRangeValues&&(r.StrUtil.makePrintableTokens(this._discreteRangeValues,r.HTML_2_STR),E.WriteDevToLog(this._discreteRangeValues.toString())),null!==this._continuousRangeValues&&(r.StrUtil.makePrintableTokens(this._continuousRangeValues,r.HTML_2_STR),E.WriteDevToLog(this._continuousRangeValues.toString()))},t.prototype.rangeForms=function(t){var r;if(-1===(r=this.findDelimeter(0,"-",t))){t=e.NString.TrimStart(t);for(var n=0;n<t.length&&-1!==(n=this.findDelimeter(n,"\\",t));)t=t.substr(0,n)+t.substr(n+=1),n+=1;null===this._discreteRangeValues&&(this._discreteRangeValues=new e.List),this._discreteRangeValues.push(t)}else for(var i=void 0,o=0;o<2;o+=1){if(0===o)i=t.substr(0,r);else{for(r+=1;r<t.length&&" "===t.charAt(r);)r+=1;i=t.substr(r)}i=this.deleteChar("\\",i),null===this._continuousRangeValues&&(this._continuousRangeValues=new e.List),this._continuousRangeValues.push(i)}},t.prototype.deleteChar=function(t,e){for(var r=0;-1!==(r=e.indexOf(t,r));)e=e.substr(0,r)+e.substr(r+t.length);return e},t.prototype.findDelimeter=function(t,e,r){for(var n=r.indexOf(e,t);n<r.length&&n>0&&"\\"===r.charAt(n-1);)n=r.indexOf(e,n+1);return n},t.prototype.getDiscreteRangeValues=function(){return this._discreteRangeValues},t.prototype.getContinuousRangeValues=function(){return this._continuousRangeValues},t}(),Z=function(){function t(e,r,n){this.COMMACHAR=",",this.DECIMALCHAR=".",this.SIGNIFICANT_NUM_SIZE=0,this._data=new Int8Array(t.NUM_SIZE),0!==arguments.length?1!==arguments.length||null!==e&&e.constructor!==String?3!==arguments.length||!(null===e||e instanceof Int8Array)||null!==r&&r.constructor!==Number||null!==n&&n.constructor!==Number?1===arguments.length&&(null===e||e instanceof Int8Array)?this.constructor_3(e):3!==arguments.length||null!==e&&e.constructor!==String||!(null===r||r instanceof z)||null!==n&&n.constructor!==Number?this.constructor_5(e):this.constructor_4(e,r,n):this.constructor_2(e,r,n):this.constructor_1(e):this.constructor_0()}return Object.defineProperty(t.prototype,"Data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!1,configurable:!0}),t.prototype.constructor_0=function(){this.initConst(),this.NUM_ZERO()},t.prototype.constructor_1=function(r){var n,i=0;this.initConst();try{for(i=0;i<this.SIGNIFICANT_NUM_SIZE;i+=1)n=r.substr(2*i,2),this._data[i]=t.toSByte(e.NNumber.Parse(n,e.NumberStyles.HexNumber))}catch(t){E.WriteWarningToLog(t),this.NUM_ZERO()}},t.prototype.constructor_2=function(t,e,r){this.constructor_0();for(var n=0;n<r;n+=1)this._data[n]=t[n+e]},t.prototype.constructor_3=function(t){this.constructor_2(t,0,t.length)},t.prototype.constructor_4=function(t,e,r){this.constructor_0(),this.from_a(t,e,r)},t.prototype.constructor_5=function(t){this.initConst(),this._data=new Int8Array(t._data.length);for(var e=0;e<this._data.length;++e)this._data[e]=t._data[e]},t.prototype.toDisplayValue=function(t){return this.to_a(t)},t.prototype.initConst=function(){var t=x.Environment;this.DECIMALCHAR=t.GetDecimal(),this.COMMACHAR=t.GetThousands(),this.SIGNIFICANT_NUM_SIZE=t.GetSignificantNumSize()},t.prototype.toXMLrecord=function(){var t,r=new e.StringBuilder(2*this.SIGNIFICANT_NUM_SIZE);t=this.NUM_IS_LONG()?5:this.SIGNIFICANT_NUM_SIZE;for(var n=0;n<this.SIGNIFICANT_NUM_SIZE;n++)n<t?r.Append(("0"+(255&this._data[n]).toString(16)).slice(-2)):r.Append("00");return r.ToString().toUpperCase()},t.prototype.from_a=function(t,e,n){var i,o,a,s,_,l,u,P,c,T,h,E,p,I,f,O,g,R,S,C="",d="",A="",L=x.Environment.GetSpecialValNewPolicy();for(l=0,c=!1,T=!1,(u=null==e)?(e=new z("",r.StorageAttribute.NUMERIC,n),I=!1):(C=e.getMask(),L||t.length>e.getMaskSize()&&(t=t.substr(0,e.getMaskSize())),(I=e.isNegative())&&(O=e.getNegPref_(),g=e.getPosPref_(),R=e.getNegSuff_(),S=e.getPosSuff_(),l=(d=(c=0===((T=O.length!==g.length||0!==O.length&&O!==g)?O:R).length)?T?g:S:T?O:R).length)),a=!1,s=0,_=0,h=0,o=0;o<t.length;){if(u||L&&o>=e.getMaskSize()||C[o]===String.fromCharCode(r.PICInterface.PIC_N)){if(p=t[o],L&&a&&s===e.getDec())break;if(r.UtilStrByteMode.isDigit(p))_++,A+=p,a&&s++;else if(p===this.DECIMALCHAR)A+=this.DECIMALCHAR,a=!0;else if(p!==this.COMMACHAR)if(I&&0===h){for(h=1,i=o,P=0;i<=t.length&&P<l;i++)if(u||C[i]===String.fromCharCode(r.PICInterface.PIC_N)){if((p=t[i])!==d[P]){if("-"===p&&!c)break;if("+"===p&&c)break;h=-1;break}P++}P>0&&P<l&&(h=-1)}else if(0===o){if(e.getNegPref_().length>0&&t.startsWith(e.getNegPref_())){o+=e.getNegPref_().length;continue}if(e.getPosPref_().length>0&&t.startsWith(e.getPosPref_())){o+=e.getPosPref_().length;continue}}else{if(e.getNegSuff_().length>0&&t.endsWith(e.getNegSuff_())){o+=e.getNegSuff_().length;continue}if(e.getPosSuff_().length>0&&t.endsWith(e.getPosSuff_())){o+=e.getPosSuff_().length;continue}}}o++}0===h&&c&&(h=1),f=1===h&&!c||1!==h&&c,s>0||_>9?(E=(f?"-":" ")+A,this.num_4_a_std(E)):this.NUM_4_LONG((f?-1:1)*this.a_2_long(A))},t.prototype.num_4_a_std=function(e){var n,i="",o=0,a=0,s=0,_=!1,l=!1;for(n=0;n<e.length;n++){var u=e.charAt(n);r.UtilStrByteMode.isDigit(u)?o>0||"0"!==u?(o++,i+=u,_||a++):_&&(s+=1):u===this.DECIMALCHAR?_=!0:"-"===u&&(l=!0)}if(this.NUM_ZERO(),0!==o){(a+s&1)>0?(this._data[1]=t.toSByte(i.charCodeAt(0)-"0".charCodeAt(0)),n=1):n=0;var P=1+n;for(o=Math.min(o,2*(this.SIGNIFICANT_NUM_SIZE-1)-n);n<o;){var c=t.toSByte(i.charCodeAt(n++)-"0".charCodeAt(0)),T=t.toSByte(n<o?i.charCodeAt(n++)-"0".charCodeAt(0):"\0".charCodeAt(0));this._data[P++]=t.toSByte(10*t.toUByte(c)+t.toUByte(T))}this._data[0]=a>0?t.toSByte(t.EXP_BIAS+(a+1>>1)):t.toSByte(t.EXP_BIAS-(s>>1)),l&&(this._data[0]|=t.SIGN_MASK)}},t.prototype.NUM_4_LONG=function(e){var r;this.NUM_ZERO(),0!==e&&(e<0&&(e=4294967295+e+1),r=e.toString(16),e>0&&(r=t.INT_ZERO_HEX.substr(r.length)+r),this._data[1]=t.toSByte(parseInt(r.substr(6,2),16)),this._data[2]=t.toSByte(parseInt(r.substr(4,2),16)),this._data[3]=t.toSByte(parseInt(r.substr(2,2),16)),this._data[4]=t.toSByte(parseInt(r.substr(0,2),16)))},t.prototype.a_2_long=function(t){for(var e=0,n=0;n<t.length;n++)r.UtilStrByteMode.isDigit(t.charAt(n))&&(e=(e*=10)+t.charCodeAt(n)-"0".charCodeAt(0));return e},t.prototype.to_a=function(t){return this.to_a_pic(t)},t.prototype.to_a_pic=function(n){var i,o,a,s,_,l,u,P,c,T,h,E,p,I,f,O,g,R,S,C,d=new Array(128);if(O=n.getMaskSize(),a=(o=!n.isNegative()||!this.num_is_neg())?n.getPosPref_().length:n.getNegPref_().length,s=o?n.getPosSuff_().length:n.getNegSuff_().length,p=n.isLeft(),I=n.padFill(),f=n.getMaskChars(),C=e.NString.ToCharArray(n.getMask().substr(0,O)),T=p||f>0?d:C,p)for(R=0;R<T.length;R++)T[R]="0".toLowerCase();for(S=!(p||f>0),u=a,P=O-a-s,h=T.slice(u,T.length),i=this.NUM_IS_LONG()?this.num_l_2_str(this.NUM_LONG(),h,P,n):this.to_str(h,P,n),R=u;R<T.length;R++)T[R]=h[R-u];if(h=null,i<f){for(g=new Array(O),R=0;R<O;R++)g[R]=i===t.ZERO_FILL?n.getZeroPad():"*";return e.NString.FromChars(g)}if(f>0&&(i-=f,u+=f,P-=f),I)if(E=n.getPad(),p){for(R=0;R<i;R++)T[u+P+R]=E;u+=i}else for(R=0;R<i;R++)T[u+R]=E;else E=" ",u+=i,P-=i;if(s>0){if(l=o?n.getPosSuff_():n.getNegSuff_(),1===s)T[u+P]=l[0];else for(R=0;R<s;R++)T[u+P+R]=l[R];P+=s}if(a>0)if(u-=a,P+=a,_=o?n.getPosPref_():n.getNegPref_(),1===a)T[u]=_[0];else for(R=0;R<a;R++)T[u+R]=_[R];if(!I){var A=T.length;if(p)for(R=0;R<i&&u+P+R<A;R++)T[u+P+R]=E;else for(u-=i,R=0;R<i&&u+R<A;R++)T[u+R]=E}if(S)return e.NString.FromChars(T);if(0===f)return u+O>T.length&&(O=T.length-u),e.NString.FromChars(T,u,O);for(c=0;c<O&&u<T.length;c++)C[c]===String.fromCharCode(r.PICInterface.PIC_N)&&(C[c]=T[u++]);return e.NString.FromChars(C)},t.prototype.num_l_2_str=function(e,r,n,i){var o,a,s,_,l;if(e<0&&(e=-e),o=i.withComa(),(_=Math.min(i.getDec(),n-1))>0&&(n-=_+1),s=n,0===e&&!i.decInFirstPos()){if(i.zeroFill())return t.ZERO_FILL;if(0===n)return t.NO_ROOM;s>r.length&&(s=r.length),r[--s]="0"}if(_>0)for(r[n]=this.DECIMALCHAR,l=0;l<_;l++)r[n+1+l]="0";for(a=0;e>0;e=Math.floor(e/10)){if(s--,o){if(3===a){if(s<0)return t.NO_ROOM;a=0,r[s--]=this.COMMACHAR}a++}if(s<0)return t.NO_ROOM;r[s]=(e%10).toString()}return s},t.prototype.to_str=function(e,r,n){var i,o,a,s,_,l,u,P,c,T;if(o=n.withComa(),(c=n.getDec())>=r&&(c=r-1),(i=new t(this)).round(c),i.NUM_IS_LONG())return i.num_l_2_str(i.NUM_LONG(),e,r,n);if(n.zeroFill()&&0===i._data[0])return t.ZERO_FILL;for(P=r-1,a=0,_=(s=2*((i._data[0]&~t.SIGN_MASK)-t.EXP_BIAS+1))-1+c,(l=s-1)>2&&(l=i._data[1]<10?3:2),u=_;u>=l;u--){if(P<0)return t.NO_ROOM;if(o&&u<s&&(3===a&&(a=0,e[P--]=this.COMMACHAR),a++),P<0)return t.NO_ROOM;if(u<2||u>=2*this.SIGNIFICANT_NUM_SIZE)e[P--]="0";else{if(P<0)return t.NO_ROOM;T=i._data[u>>1],e[P--]=(0!=(1&u)?T%10:Math.floor(T/10)).toString()}if(u===s){if(P<0)return t.NO_ROOM;if(e[P--]=this.DECIMALCHAR,P<0&&n.decInFirstPos())return 0}}return P+1},t.add=function(e,r){var n,i,o,a,s,_;if(null===e||null===r)return null;_=x.Environment.GetSignificantNumSize();var l=new t,u=new t,P=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){if((o=a=e.NUM_LONG())<0&&(o=-o),o<1073741824&&((o=s=r.NUM_LONG())<0&&(o=-o),o<1073741824))return a+=s,u.NUM_4_LONG(a),u;r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();n=t.toSByte(e._data[0]&t.SIGN_MASK),P.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),i=t.toSByte(r._data[0]&t.SIGN_MASK),P.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),P.NUM_Diff_=P.NUM_Exp1_-P.NUM_Exp2_;var c=P.NUM_Diff_;if(0===c&&0===(c=t.toUByte(e._data[1])-t.toUByte(r._data[1]))&&(c=t.memcmp(e,2,r,2,_-2)),c>=0)0!==(l=n===i?t.add_pos(e,r,P):t.sub_pos(e,r,P))._data[0]&&(l._data[0]=t.toSByte(l._data[0]|n));else{var T=P.NUM_Exp1_;P.NUM_Exp1_=P.NUM_Exp2_,P.NUM_Exp2_=T,P.NUM_Diff_=-P.NUM_Diff_,0!==(l=n===i?t.add_pos(r,e,P):t.sub_pos(r,e,P))._data[0]&&(l._data[0]|=i)}return l},t.sub=function(e,r){if(null===e||null===r)return null;var n=new t,i=new t,o=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){var a=void 0,s=a=e.NUM_LONG();if(a<0&&(a=-a),a<1073741824){var _=a=r.NUM_LONG();if(a<0&&(a=-a),a<1073741824)return s-=_,i.NUM_4_LONG(s),i}r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();var l=t.toSByte(e._data[0]&t.SIGN_MASK);o.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK);var u=t.toSByte(r._data[0]&t.SIGN_MASK);o.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),o.NUM_Diff_=o.NUM_Exp1_-o.NUM_Exp2_;var P=o.NUM_Diff_;if(0===P&&0===(P=t.toUByte(e._data[1])-t.toUByte(r._data[1]))&&(P=t.memcmp(e,2,r,2,x.Environment.GetSignificantNumSize()-2)),P>=0)n=l===u?t.sub_pos(e,r,o):t.add_pos(e,r,o);else{var c=o.NUM_Exp1_;o.NUM_Exp1_=o.NUM_Exp2_,o.NUM_Exp2_=c,o.NUM_Diff_=-o.NUM_Diff_,l===u?(n=t.sub_pos(r,e,o),l^=t.SIGN_MASK):n=t.add_pos(r,e,o)}return 0!==n._data[0]&&(n._data[0]|=l),n},t.mul=function(e,r){var n,i,o,a,s,_,l,u,P,c,T,h,E,p=new Int8Array(38);if(null===e||null===r)return null;E=x.Environment.GetSignificantNumSize();var I,f,O=new t,g=new J;if(e.NUM_IS_LONG()){if(r.NUM_IS_LONG()){if((c=T=e.NUM_LONG())<0&&(c=-c),c<45056&&((c=h=r.NUM_LONG())<0&&(c=-c),c<45056))return T*=h,O.NUM_4_LONG(T),O;r.num_4_std_long()}e.num_4_std_long()}else r.NUM_IS_LONG()&&r.num_4_std_long();if(g.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),g.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),0===g.NUM_Exp1_||0===g.NUM_Exp2_)return O.NUM_ZERO(),O;for(i=E-1;0===e._data[i];i--);for(o=E-1;0===r._data[o];o--);for(I=0;I<2*(t.NUM_SIZE-1);I++)p[I]=0;for(_=0,a=i;a>0;a--){for(_=a+o-1,l=e._data[a],P=0,s=o;s>0;s--)u=t.toUByte(l)*t.toUByte(r._data[s])+P,P=Math.floor(u/100),p[_]=t.toSByte(t.toUByte(p[_])+u%100),f=p[_],_--,t.toUByte(f)>=100&&(p[_+1]=t.toSByte(t.toUByte(p[_+1])-100),P++);p[_]=t.toSByte(P)}for(n=t.toUByte(g.NUM_Exp1_)-t.EXP_BIAS+(t.toUByte(g.NUM_Exp2_)-t.EXP_BIAS),0===p[0]&&(_++,n--),(e._data[0]&t.SIGN_MASK)==(r._data[0]&t.SIGN_MASK)?O._data[0]=0:O._data[0]=t.SIGN_MASK,O._data[0]|=t.toSByte(n+t.EXP_BIAS),I=0;I<E-1;I++)O._data[1+I]=p[_+I];return O},t.mod=function(e,r){if(null===e||null===r)return null;var n=new t;return r.num_is_zero()?(n.NUM_ZERO(),n):(e.NUM_IS_LONG()&&e.num_4_std_long(),r.NUM_IS_LONG()&&r.num_4_std_long(),(n=t.div(e,r)).num_trunc(0),n=t.mul(n,r),n=t.sub(e,n))},t.div=function(e,r){var n,i,o,a,s,_,l,u,P,c,T=new Int8Array(2*(t.NUM_SIZE-1)),h=new Int8Array(t.NUM_SIZE);if(null===e||null===r)return null;c=x.Environment.GetSignificantNumSize();var E,p,I=new t,f=new J;if(e.NUM_IS_LONG()&&e.num_4_std_long(),r.NUM_IS_LONG()&&r.num_4_std_long(),f.NUM_Exp1_=t.toSByte(e._data[0]&~t.SIGN_MASK),f.NUM_Exp2_=t.toSByte(r._data[0]&~t.SIGN_MASK),0===f.NUM_Exp1_||0===f.NUM_Exp2_)return I.NUM_ZERO(),I;for(i=c-1;0===e._data[i];i--);for(o=c-1;0===r._data[o];o--);for(_=t.memcmp(e,1,r,1,o)<0?0:1,E=0;E<2*(t.NUM_SIZE-1);E++)T[E]=0;for(E=0;E<i;E++)T[_+E]=e._data[1+E];for(E=0;E<o;E++)h[1+E]=r._data[1+E];if(I.NUM_SET_ZERO(),n=t.toUByte(f.NUM_Exp1_)-t.toUByte(f.NUM_Exp2_)+_,I._data[0]=t.toSByte(n+t.EXP_BIAS),(e._data[0]&t.SIGN_MASK)!=(r._data[0]&t.SIGN_MASK)&&(I._data[0]|=t.SIGN_MASK),(l=Math.floor(100/(t.toUByte(h[1])+1)))>1){for(P=0,s=o;s>0;s--)u=l*t.toUByte(h[s])+P,P=Math.floor(u/100),h[s]=t.toSByte(u%100);for(P=0,a=i+_-1;a>=0;a--)u=l*t.toUByte(T[a])+P,P=Math.floor(u/100),T[a]=t.toSByte(u%100)}for(a=1;a<c;a++){if((l=100*t.toUByte(T[a-1])+Math.floor(t.toUByte(T[a])/t.toUByte(h[1])))>=100&&(l=99),0!==l){for(_=a+o-1,P=0,s=o;s>0;s--)u=l*t.toUByte(h[s])+P,P=Math.floor(u/100),T[_]=t.toSByte(t.toUByte(T[_])-u%100),p=T[_],_--,p<0&&(T[_+1]=t.toSByte(t.toUByte(T[_+1])+100),P++);for(T[_]=t.toSByte(t.toUByte(T[_])-P);T[_]<0;)for(l--,_=a+o-1,s=o;s>0;s--)T[_]=t.toSByte(t.toUByte(T[_])+t.toUByte(h[s])),p=T[_],_--,t.toUByte(p)>=100&&(T[_+1]=t.toSByte(t.toUByte(T[_+1])-100),T[_]=t.toSByte(t.toUByte(T[_])+1))}I._data[a]=t.toSByte(l)}return I},t.num_cmp=function(r,n){var i,o,a,s,_,l;if(null==r||null==n)return e.Int32.MinValue;if(l=x.Environment.GetSignificantNumSize(),r.NUM_IS_LONG()){if(n.NUM_IS_LONG()){if(a=r.NUM_LONG(),s=n.NUM_LONG(),a>=0&&s>=0)return 0===(_=a-s)?0:_>0?1:-1;n.num_4_std_long()}r.num_4_std_long()}else n.NUM_IS_LONG()&&n.num_4_std_long();return o=(i=t.toSByte(r._data[0]&t.SIGN_MASK))===t.toSByte(n._data[0]&t.SIGN_MASK)?t.memcmp(r,0,n,0,l):1,0!==i&&(o=-o),o},t.numHexStrIsLong=function(t){return"FF"===t.substr(0,2)},t.prototype.NUM_ZERO=function(){this.setZero(!0)},t.prototype.NUM_SET_ZERO=function(){this.setZero(!1)},t.prototype.num_is_neg=function(){return this.NUM_IS_LONG()?0!=(128&this._data[4]):0!=(this._data[0]&t.SIGN_MASK)},t.prototype.num_is_zero=function(){return this.NUM_IS_LONG()?0===this.NUM_LONG():0===this._data[0]},t.prototype.num_neg=function(){var e;if(this.NUM_IS_LONG())return e=-this.NUM_LONG(),void this.NUM_4_LONG(e);0!==this._data[0]&&(this._data[0]^=t.SIGN_MASK)},t.prototype.NUM_IS_LONG=function(){return this._data[0]===t.NUM_LONG_TYPE},t.prototype.NUM_LONG=function(){return 0===this._data[1]&&0===this._data[2]&&0===this._data[3]&&-128===this._data[4]?e.Int32.MinValue:new DataView(this._data.buffer).getInt32(1,!0)},t.prototype.round=function(e){var r;if(!this.NUM_IS_LONG()){(r=new t)._data[0]=t.toSByte(this._data[0]&t.SIGN_MASK|t.EXP_BIAS-(e>>1)),r._data[1]=t.toSByte(0!=(1&e)?5:50);var n=t.add(this,r);this._data=new Int8Array(n._data.length),this._data=n._data,this.num_trunc(e)}},t.prototype.dbRound=function(e){var r,n,i;if(!this.NUM_IS_LONG()){(r=new t)._data[0]=t.toSByte(this._data[0]&t.SIGN_MASK|t.EXP_BIAS+(e+1>>1)),r._data[1]=t.toSByte(0!=(1&e)?5:50);var o=t.add(this,r);this._data=new Int8Array(o._data.length);for(var a=0;a<this._data.length;++a)this._data[a]=o._data[a];if((n=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS-(e+1>>1))>=0)for(0!=(1&e)&&(this._data[1+n]=t.toSByte(this._data[1+n]-this._data[1+n]%10),n++),i=0;i<this.SIGNIFICANT_NUM_SIZE-(1+n);i++)this._data[1+n+i]=0;else this.NUM_SET_ZERO()}},t.prototype.num_trunc=function(e){var r,n,i;if(!(this.NUM_IS_LONG()||(r=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS,(n=this.SIGNIFICANT_NUM_SIZE-1-r-(e+1>>1))<0)))if(n<this.SIGNIFICANT_NUM_SIZE-1&&0!=(1&e)&&(this._data[this.SIGNIFICANT_NUM_SIZE-1-n]=t.toSByte(this._data[this.SIGNIFICANT_NUM_SIZE-1-n]-this._data[this.SIGNIFICANT_NUM_SIZE-1-n]%10),0===this._data[this.SIGNIFICANT_NUM_SIZE-1-n]&&n++),n>=this.SIGNIFICANT_NUM_SIZE-1)this.NUM_ZERO();else for(i=0;i<n;i++)this._data[this.SIGNIFICANT_NUM_SIZE-n+i]=0},t.prototype.num_4_std_long=function(){var e;(e=this.NUM_LONG())>=0?this.num_4_ulong(e):(this.num_4_ulong(-e),this._data[0]|=t.SIGN_MASK)},t.prototype.num_4_ulong=function(e){var r,n;for(this.NUM_SET_ZERO(),r=5;e>0;)this._data[r--]=t.toSByte(e%100),e=Math.floor(e/100);if(r<5){if(r>0){for(n=0;n<5-r;n++)this._data[1+n]=this._data[1+r+n];for(n=0;n<r;n++)this._data[5-r+1+n]=0}this._data[0]=t.toSByte(5-r+t.EXP_BIAS)}},t.prototype.NUM_2_LONG=function(){return this.NUM_IS_LONG()?this.NUM_LONG():this.num_2_long()},t.prototype.NUM_2_ULONG=function(){return this.NUM_IS_LONG()?this.NUM_LONG():this.num_2_ulong()},t.prototype.num_2_long=function(){var e,r;if(r=this._data[0]&t.SIGN_MASK,this._data[0]&=t.toSByte(~t.SIGN_MASK),0!==r){if(t.memcmp(this,0,t.MinLONG(),0,this.SIGNIFICANT_NUM_SIZE)>0)return 0}else if(t.memcmp(this,0,t.MaxLONG(),0,this.SIGNIFICANT_NUM_SIZE)>0)return 0;return e=this.num_2_ulong(),0!==r&&(e=-e,this._data[0]|=t.toSByte(r)),e},t.prototype.num_2_ulong=function(){var e,r,n,i;if((r=this._data[0]-t.EXP_BIAS)>5)return 0;for((i=5===r)&&(r=4),e=0,n=1;n<=r;n++)e=100*e+t.toUByte(this._data[n]);return i&&(e=e<=Math.floor((4294967295-t.toUByte(this._data[5]))/100)?100*e+t.toUByte(this._data[5]):0),e},t.add_pos=function(e,r,n){var i,o,a,s,_,l,u,P;if(null==e||null==r)return null;P=x.Environment.GetSignificantNumSize();var c=new t;if(0===n.NUM_Exp2_||n.NUM_Diff_>=P-1)return(c=new t(e))._data[0]=n.NUM_Exp1_,c;for(i=1,u=P-2;u>0;u-=2)if(!e.SHRT_IS_ZERO(u)){i=u+1;break}for(0===e._data[i]&&i--,o=1,u=P-2;u>0;u-=2)if(!r.SHRT_IS_ZERO(u)){o=u+1;break}for(0===r._data[o]&&o--,(a=Math.max(i,o+n.NUM_Diff_))>P-1&&(a=P-1),c.NUM_SET_ZERO(),_=n.NUM_Diff_,l=n.NUM_Diff_,s=a-n.NUM_Diff_;s>0;s--)c._data[l+s]=t.toSByte(t.toUByte(c._data[l+s])+t.toUByte(e._data[_+s])+t.toUByte(r._data[s])),t.toUByte(c._data[l+s])>=100&&(c._data[l+s]=t.toSByte(t.toUByte(c._data[l+s])-100),c._data[l+s-1]=1);for(s=n.NUM_Diff_;s>0;s--)c._data[s]=t.toSByte(t.toUByte(c._data[s])+t.toUByte(e._data[s])),t.toUByte(c._data[s])>=100&&(c._data[s]=t.toSByte(t.toUByte(c._data[s])-100),c._data[s-1]=1);if(0!==c._data[0]){for(s=Math.min(a,P-2);s>=0;s--)c._data[s+1]=c._data[s];n.NUM_Exp1_++}return c._data[0]=n.NUM_Exp1_,c},t.sub_pos=function(e,r,n){var i,o,a,s,_,l,u,P;if(null==e||null==r)return null;P=x.Environment.GetSignificantNumSize();var c,T=new t;if(0===n.NUM_Exp2_||n.NUM_Diff_>=P-1)return(T=new t(e))._data[0]=n.NUM_Exp1_,T;for(i=1,u=P-2;u>0;u-=2)if(!e.SHRT_IS_ZERO(u)){i=u+1;break}for(0===e._data[i]&&i--,o=1,u=P-2;u>0;u-=2)if(!r.SHRT_IS_ZERO(u)){o=u+1;break}for(0===r._data[o]&&o--,(a=Math.max(i,o+n.NUM_Diff_))>P-1&&(a=P-1),T.NUM_SET_ZERO(),_=n.NUM_Diff_,l=n.NUM_Diff_,s=a-n.NUM_Diff_;s>0;s--)T._data[l+s]=t.toSByte(t.toUByte(T._data[l+s])+t.toUByte(e._data[_+s])-t.toUByte(r._data[s])),T._data[l+s]<0&&(T._data[l+s]=t.toSByte(t.toUByte(T._data[l+s])+100),T._data[l+s-1]=t.toSByte(255));for(s=n.NUM_Diff_;s>0;s--)T._data[s]=t.toSByte(t.toUByte(T._data[s])+t.toUByte(e._data[s])),T._data[s]<0&&(T._data[s]=t.toSByte(t.toUByte(T._data[s])+100),T._data[s-1]=t.toSByte(255));for(;++s<=a&&0===T._data[s];);if(s<=a){if(n.NUM_Diff_=s-1,n.NUM_Diff_>0){for(c=0;c<a-n.NUM_Diff_;c++)T._data[1+c]=T._data[s+c];for(c=0;c<n.NUM_Diff_;c++)T._data[a-n.NUM_Diff_+1+c]=0}T._data[0]=t.toSByte(t.toUByte(n.NUM_Exp1_)-n.NUM_Diff_)}return T},t.prototype.num_fix=function(e){var r;if(this.NUM_IS_LONG()&&this.num_4_std_long(),!((r=(this._data[0]&~t.SIGN_MASK)-t.EXP_BIAS-(e+1>>1))<0)){if(r<this.SIGNIFICANT_NUM_SIZE-1)for(1==(1&e)&&(this._data[1+r]=t.toSByte(this._data[1+r]%10));r<this.SIGNIFICANT_NUM_SIZE-1&&0===this._data[1+r];)r++;if(r>=this.SIGNIFICANT_NUM_SIZE-1)this.NUM_ZERO();else if(r>0){var n=void 0;for(n=0;n<this.SIGNIFICANT_NUM_SIZE-1-r;n++)this._data[1+n]=this._data[1+r+n];for(n=0;n<r;n++)this._data[this.SIGNIFICANT_NUM_SIZE-r+n]=0;this._data[0]=t.toSByte(this._data[0]-t.toSByte(r))}}},t.prototype.SHRT_IS_ZERO=function(t){return 0===this._data[t]&&0===this._data[t+1]},t.prototype.setZero=function(e){var r;for(r=0;r<t.NUM_SIZE;r++)this._data[r]=0;e&&(this._data[0]=t.NUM_LONG_TYPE)},t.memcmp=function(e,r,n,i,o){for(var a=0;a<o&&e._data[r]===n._data[i]&&r<t.NUM_SIZE&&i<t.NUM_SIZE;)a++,r++,i++;return a===o?0:this.toUByte(e._data[r])<this.toUByte(n._data[i])?-1:1},t.toUByte=function(t){var e=t;return t<0&&(e=256+t),e},t.toSByte=function(t){return t>r.Constants.SByteMaxValue?t-256:t},t.MaxLONG=function(){var e=new t;return e._data[0]=t.toSByte(t.EXP_BIAS+5),e._data[1]=21,e._data[2]=47,e._data[3]=48,e._data[4]=36,e._data[5]=47,e},t.MinLONG=function(){var e=new t;return e._data[0]=t.toSByte(t.EXP_BIAS+5),e._data[1]=21,e._data[2]=47,e._data[3]=48,e._data[4]=36,e._data[5]=48,e},t.prototype.to_double=function(){return this.storage_mg_2_float(8)},t.prototype.storage_mg_2_float=function(e){var r,n,i,o,a,s=new t,_=new t,l=new t,u=0,P=0,c=new Int8Array([0,0,0,0,0,0,0,0]),T=new Int8Array([t.toSByte(t.EXP_BIAS+4),8,38,86,8]),h=new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),E=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),16]),new Int8Array([t.toSByte(t.EXP_BIAS+2),2,56]),new Int8Array([t.toSByte(t.EXP_BIAS+2),40,96]),new Int8Array([t.toSByte(t.EXP_BIAS+3),6,55,36]),new Int8Array([t.toSByte(t.EXP_BIAS+4),1,4,85,76]),new Int8Array([t.toSByte(t.EXP_BIAS+4),16,77,72,16]),new Int8Array([t.toSByte(t.EXP_BIAS+5),2,68,43,54,56]),new Int8Array([t.toSByte(t.EXP_BIAS+5),42,94,96,72,96]),new Int8Array([t.toSByte(t.EXP_BIAS+6),6,87,19,47,67,36]),new Int8Array([t.toSByte(t.EXP_BIAS+7),1,9,95,11,62,77,76]),new Int8Array([t.toSByte(t.EXP_BIAS+7),17,59,21,86,4,44,16]),new Int8Array([t.toSByte(t.EXP_BIAS+8),2,81,47,49,76,71,6,56]),new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),new Int8Array([t.toSByte(t.EXP_BIAS+9),7,20,57,59,40,37,92,79,36])],p=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),2]),new Int8Array([t.toSByte(t.EXP_BIAS+1),4]),new Int8Array([t.toSByte(t.EXP_BIAS+1),8])];if(this.NUM_IS_LONG()&&this.num_4_std_long(),0===this._data[0])return 0;if(n=t.toSByte(this._data[0]&t.SIGN_MASK),this._data[0]=t.toSByte(this._data[0]&~t.SIGN_MASK),4===e?(o=24,s=new t(T)):(o=53,s=new t(h)),(i=o-(a=(i=this._data[0]-t.EXP_BIAS<<1)<0?3*i+Math.floor((i+1)/3):3*i+Math.floor((i+2)/3)))<0)i=-i,_=t.div(this,new t(E[i>>2])),_=t.div(_,new t(p[3&i]));else{for(_=this;i>=60;)_=t.mul(_,new t(E[14])),i-=56;_=t.mul(_,new t(E[i>>2])),_=t.mul(_,new t(p[3&i]))}for(;t.num_cmp(_,s)<0;)a--,_=t.add(_,_);return 4===e?u=_.num_2_ulong():((l=t.div(_,new t(E[8]))).num_trunc(0),u=l.num_2_ulong(),l=t.mul(l,new t(E[8])),P=(l=t.sub(_,l)).num_2_ulong()),r=e-1,4===e?(a+=126,c[3]=t.toSByte(a>>1),c[2]=t.toSByte(127&this.LO_CHAR(this.HI_SHRT(u))|(1&a)<<7),c[1]=t.toSByte(this.HI_CHAR(this.LO_SHRT(u))),c[0]=t.toSByte(this.LO_CHAR(this.LO_SHRT(u)))):(a+=1022,c[7]=t.toSByte(a>>4),c[6]=t.toSByte(15&this.LO_CHAR(this.HI_SHRT(u))|(15&a)<<4),c[5]=t.toSByte(this.HI_CHAR(this.LO_SHRT(u))),c[4]=t.toSByte(this.LO_CHAR(this.LO_SHRT(u))),c[3]=t.toSByte(this.HI_CHAR(this.HI_SHRT(P))),c[2]=t.toSByte(this.LO_CHAR(this.HI_SHRT(P))),c[1]=t.toSByte(this.HI_CHAR(this.LO_SHRT(P))),c[0]=t.toSByte(this.LO_CHAR(this.LO_SHRT(P)))),0!==n&&(c[r]|=t.SIGN_MASK,this._data[0]|=t.SIGN_MASK),this.sbyteArr_2_Double(c)},t.prototype.LO_CHAR=function(t){return 255&t},t.prototype.HI_CHAR=function(t){return(65280&t)>>8},t.prototype.LO_SHRT=function(t){return 65535&t},t.prototype.HI_SHRT=function(t){return(-65536&t)>>16},t.MK_SHRT=function(t,r){var n=(t<<8|r).toString();return e.NNumber.Parse(n)},t.MK_LONG=function(t,r){var n=(t<<16|r).toString();return e.NNumber.Parse(n)},t.prototype.sbyteArr_2_Double=function(t){return new DataView(t.buffer).getFloat64(0,!0)},t.double_2_sbyteArray=function(t){var e=new ArrayBuffer(8),r=new DataView(e);return r.setFloat64(0,t,!0),new Int8Array(r.buffer)},t.eval_op_pwr=function(e,r){var n,i;if(null==e||null==r)return null;if(r.NUM_IS_LONG()&&!r.num_is_neg()){i=r.to_double();for(var o=t.from_double(1),a=0;a<i;a++)o=this.mul(o,e);return o}return n=e.to_double(),i=r.to_double(),n<0&&i!=i?n=0:0!==n&&(n=Math.pow(n,i)),t.from_double(n)},t.from_double=function(e){var r=t.double_2_sbyteArray(e);return t.storage_mg_4_float(8,r)},t.storage_mg_4_float=function(e,r){var n,i,o,a,s,_,l;for(n=new Array(r.length),o=0;o<r.length;o++)n[o]=t.toUByte(r[o]);return i=n[e-1],4===e?(a=n[2]>>7|(127&n[3])<<1,s=150,_=0,l=t.MK_LONG(t.MK_SHRT(0,128|n[2]),t.MK_SHRT(n[1],n[0]))):(a=(127&n[7])<<4|n[6]>>4,s=1075,_=t.MK_LONG(t.MK_SHRT(0,15&n[6]|16),t.MK_SHRT(n[5],n[4])),l=t.MK_LONG(t.MK_SHRT(n[3],n[2]),t.MK_SHRT(n[1],n[0]))),t.storage_num_4_fld_flt(_,l,18,i,s,a)},t.storage_num_4_fld_flt=function(e,r,n,i,o,a){var s=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),16]),new Int8Array([t.toSByte(t.EXP_BIAS+2),2,56]),new Int8Array([t.toSByte(t.EXP_BIAS+2),40,96]),new Int8Array([t.toSByte(t.EXP_BIAS+3),6,55,36]),new Int8Array([t.toSByte(t.EXP_BIAS+4),1,4,85,76]),new Int8Array([t.toSByte(t.EXP_BIAS+4),16,77,72,16]),new Int8Array([t.toSByte(t.EXP_BIAS+5),2,68,43,54,56]),new Int8Array([t.toSByte(t.EXP_BIAS+5),42,94,96,72,96]),new Int8Array([t.toSByte(t.EXP_BIAS+6),6,87,19,47,67,36]),new Int8Array([t.toSByte(t.EXP_BIAS+7),1,9,95,11,62,77,76]),new Int8Array([t.toSByte(t.EXP_BIAS+7),17,59,21,86,4,44,16]),new Int8Array([t.toSByte(t.EXP_BIAS+8),2,81,47,49,76,71,6,56]),new Int8Array([t.toSByte(t.EXP_BIAS+8),45,3,59,96,27,37,4,96]),new Int8Array([t.toSByte(t.EXP_BIAS+9),7,20,57,59,40,37,92,79,36])],_=[new Int8Array([t.toSByte(t.EXP_BIAS+1),1]),new Int8Array([t.toSByte(t.EXP_BIAS+1),2]),new Int8Array([t.toSByte(t.EXP_BIAS+1),4]),new Int8Array([t.toSByte(t.EXP_BIAS+1),8])],l=new t,u=new t,P=a;if(0===P)return u.NUM_ZERO(),u;if(u.num_4_ulong(r),0!==e&&(l.num_4_ulong(e),l=t.mul(l,new t(s[8])),u=t.add(l,u)),(P-=o)<0){for(P=-P;P>=60;)u=t.div(u,new t(s[14])),P-=56;l=t.mul(new t(s[P>>2]),new t(_[3&P])),u=t.div(u,l)}else{if(P>=60)return u.NUM_ZERO(),u;l=t.mul(new t(s[P>>2]),new t(_[3&P])),u=t.mul(u,l)}return 0!=(128&i)&&(u._data[0]=u._data[0]|t.SIGN_MASK),u.round(n),u},t.eval_op_log=function(e){if(null==e)return null;var r=new t,n=e.to_double();return n>0?r=t.from_double(Math.log(n)):r.NUM_ZERO(),r},t.eval_op_exp=function(e){if(null===e)return null;var r=e.to_double();return t.from_double(Math.exp(r))},t.eval_op_abs=function(e){if(null===e)return null;var r=new t(e);return r.num_abs(),r},t.eval_op_sin=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.sin(r))},t.eval_op_cos=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.cos(r))},t.eval_op_tan=function(e){if(null==e)return null;new t;var r=e.to_double();return t.from_double(Math.tan(r))},t.eval_op_asin=function(e){if(null===e)return null;new t;var r=e.to_double();return r<=1&&r>=-1?t.from_double(Math.asin(r)):t.from_double(0)},t.eval_op_acos=function(e){if(null===e)return null;new t;var r=e.to_double();return r<=1&&r>=-1?t.from_double(Math.acos(r)):t.from_double(0)},t.eval_op_atan=function(e){if(null===e)return null;new t;var r=e.to_double();return t.from_double(Math.atan(r))},t.prototype.num_abs=function(){var e;if(this.NUM_IS_LONG())return(e=this.NUM_LONG())<0&&(e=-e),void this.NUM_4_LONG(e);this._data[0]&=t.toSByte(~t.SIGN_MASK)},t.eval_op_rand=function(e){if(null===e)return null;var n,i,o,a=r.Randomizer.get_initialized(),s=new t;return a?(n=t.from_double(r.Randomizer.get_mod()),i=t.from_double(r.Randomizer.get_mul()),o=t.from_double(r.Randomizer.get_seed())):(r.Randomizer.set_initialized(),n=new t,i=new t,o=new t,n.num_4_a_std("100000007"),i.num_4_a_std("75000007"),o.num_4_a_std("12345678"),r.Randomizer.set_mod(n.to_double()),r.Randomizer.set_mul(i.to_double()),r.Randomizer.set_seed(o.to_double())),e.num_is_zero()?o.num_is_neg()&&(s.NUM_4_LONG(-1),o=t.mul(o,s)):e.num_is_neg()?o.NUM_4_LONG(t.hash_rand()):o=new t(e),o=t.mul(o,i),o=t.mod(o,n),s=t.div(o,n),r.Randomizer.set_mod(n.to_double()),r.Randomizer.set_mul(i.to_double()),r.Randomizer.set_seed(o.to_double()),s},t.hash_rand=function(){return(new Date).getMilliseconds()^12345678*Math.random()},t}();Z.INT_ZERO_HEX="00000000",Z.BYTE_ZERO_BIT="00000000",Z.NO_ROOM=-1,Z.ZERO_FILL=-2,Z.NUM_SIZE=20,Z.NUM_LONG_TYPE=-1,Z.EXP_BIAS=64,Z.SIGN_MASK=-128,Z._randtbl=[41,179,9,40,93,224,24,94,39,110,70,85,196,129,80,11,127,42,87,8,243,96,174,153,61,192,17,20,235,7,47,222,53,216,101,112,44,139,109,233,108,57,240,229,160,219,251,15,221,245,239,104,182,33,138,59,166,247,146,190,31,125,188,114,97,86,157,106,3,142,66,69,152,177,116,50,149,242,144,28,29,95,37,2,117,246,65,183,206,241,230,131,13,145,63,98,200,176,226,5,158,189,49,18,54,30,120,227,68,48,91,89,252,210,185,203,140,171,155,56,162,249,201,134,244,67,197,148,248,82,100,34,90,236,51,167,178,207,193,164,225,218,147,79,71,217,151,38,198,215,212,123,156,76,121,113,253,55,255,23,25,231,187,21,72,209,103,81,35,12,6,122,78,32,60,92,14,202,83,128,195,135,223,211,181,84,0,119,173,165,234,45,208,107,136,199,126,141,163,180,99,172,220,75,115,232,111,228,204,237,73,254,62,105,132,22,36,118,143,161,133,169,10,52,186,184,170,77,205,137,124,238,16,159,250,191,74,27,130,4,194,1,46,58,102,64,168,150,88,214,175,213,154,26,43,19];var J=function(){this.NUM_Diff_=0,this.NUM_Exp1_=0,this.NUM_Exp2_=0},Q=function(){function t(){}return t.char_memset=function(t,e,r,n){if(!(n<=0))for(var i=0;i<n;i+=1)t[e+i]=r},t.char_memcpy=function(t,e,r,n,i){if(!(i<=0))for(var o=0;o<i;o+=1)t[e+o]=r[n+o]},t.char_memmove=function(t,e,r,n,i){if(!(i<=0)){for(var o=new Array(i),a=0;a<i;a+=1)o[a]=r[n+a];for(a=0;a<i;a+=1)t[e+a]=o[a]}},t.mem_trim=function(t,e,r){var n;for(n=e+r-1;r>0&&n<t.length&&(" "===t[n]||"\x0000"===t[n]);n--,r--);return r},t}(),q=function(){function t(){}return t.dateheb_year_is_leap=function(e){return e%=t.YEARS_PER_CYCLE,t.DATEHEB_months_n[e+1]-t.DATEHEB_months_n[e]==13},t.dateheb_days_in_month=function(e,r,n){var i=r?t.DATEHEB_leap_days_in_month[e-1]:t.DATEHEB_norm_days_in_month[e-1];switch(r&&(n-=30),n){case 353:e===t.KISLEV&&(i=29);break;case 355:e===t.HESHVAN&&(i=30)}return i},t.dateheb_year_start=function(e){e-=1;var r=Math.floor(e/t.YEARS_PER_CYCLE);e%=t.YEARS_PER_CYCLE;var n=r*t.MONTHS_PER_CYCLE+t.DATEHEB_months_n[e],i=n*t.MONTH_DAYS,o=n*t.MONTH_EXTRA_PARTS+t.CREATION_PARTS;i+=Math.floor(o/t.PARTS_PER_DAY),(o%=t.PARTS_PER_DAY)>=Math.floor(3*t.PARTS_PER_DAY/4)&&(o=0,i+=1);var a=(i-1+t.CREATION_DOW)%7+1;return 1!==a&&4!==a&&6!==a||(o=0,i+=1),t.dateheb_year_is_leap(e)||3===a&&o>=9*t.PARTS_PER_HOUR+204&&(i+=2),t.dateheb_year_is_leap(e+t.YEARS_PER_CYCLE-1)&&2===a&&o>=15*t.PARTS_PER_HOUR+589&&(i+=1),i},t.dateheb_4_d=function(e,r,n,i){e+=t.DAYS_TIL_JESUS;var o,a=Math.floor(e/(t.DAYS_PER_CYCLE+1)),s=e%(t.DAYS_PER_CYCLE+1);for(i.value=a*t.YEARS_PER_CYCLE,i.value=i.value+Math.floor(s/(t.DAYS_PER_LEAP_YEAR+1));!((o=t.dateheb_year_start(i.value+1))>=e);)i.value=i.value+1;var _=t.dateheb_year_start(i.value);r.value=e-_;var l,u=o-_,P=u>355;for(l=1;l<13;l+=1){var c=t.dateheb_days_in_month(l,P,u);if(r.value<=c)break;r.value=r.value-c}return!P||l<=t.ADAR?n.value=l:l===t.ADAR+1?n.value=t.ADAR_B:n.value=l-1,P},t.dateheb_i_2_h=function(e,r,n,i,o){for(var a=0,s=0;e>0;)for(a=t.DATEHEB_letters.length;a>0;a-=1){var _=t.DATEHEB_letters[a-1];if(e>=_){e-=_,r[n++]=String.fromCharCode(t.ALEF.charCodeAt(0)+a-1),s+=1;break}}return s>0&&(s>=2&&"י"===r[n-2]&&("ה"!==r[n-1]&&"ו"!==r[n-1]||(r[n-2]=String.fromCharCode(r[n-2].charCodeAt(0)-1),r[n-1]=r[n-1]+"")),a>10&&i&&t.DATEHEB_letters[a-1]===t.DATEHEB_letters[a-2]&&(r[n-1]=String.fromCharCode(r[n-1].charCodeAt(0)-1)),o&&(1===s?r[n]="'":(r[n]=r[n-1],r[n-1]='"'),s+=1)),s},t.dateheb_2_str=function(e,r,n,i,o,a,s,_){var l=n>o&&e[r+o]===e[r];l&&(o+=1);var u=t.dateheb_i_2_h(a%1e3,e,r,_,l),P=o-u;if(P>0)if(s){i.value=i.value-P;var c=n-o;c>0?Q.char_memcpy(e,r+u,e,r+o,c):u=o}else P>e.length-r-u&&(P=e.length-r-u),Q.char_memset(e,r+u," ",P),u=o;return u},t.GetLocalMonths=function(){var e=t.MONTH_LEN;if(null===t._localMonths[0]){var n=E.GetMessageString(r.MsgInterface.DATEHEB_MONTH_STR);if(null!==n){t._localMonths[0]=" ";for(var i=1;i<t._localMonths.length;i+=1)t._localMonths[i]=n.substr((i-1)*e,i*e-(i-1)*e)}}return t._localMonths},t.GetLocalDows=function(){var e=t.DOW_LEN;if(null===t._localDows[0]){var n=E.GetMessageString(r.MsgInterface.DATEHEB_DOW_STR);if(null!==n){t._localDows[0]=" ";for(var i=1;i<t._localDows.length;i+=1)t._localDows[i]=n.substr((i-1)*e,i*e-(i-1)*e)}}return t._localDows},t.dateheb_h_2_i=function(e,r,n){var i,o,a=!1,s=!1,_=!1,l=0,u=1e3;for(i=0;r>0&&n<e.length;n++,r--)if(e[n]>=t.ALEF&&e[n]<=t.TAV){if((o=t.DATEHEB_letters[e[n].charCodeAt(0)-t.ALEF.charCodeAt(0)])>u)return 0;if(400===o){if(2===l)return 0;l+=1}else if(o>=100){if(_)return 0;_=!0}else if(o>=10){if(s)return 0;s=!0}else{if(a){if(s||9!==u)return 0;if(6!==o&&7!==o)return 0}a=!0}i+=o,u=o}return i},t.isHebrewLetter=function(e){return e>=t.ALEF&&e<=t.TAV},t.add2Date=function(r,n,i,o){var a,s=n;for(new e.StringBuilder(r.length);s<r.length&&!t.isHebrewLetter(r.charAt(s));)s+=1;for(a=s;a<s+i&&a<r.length&&(t.isHebrewLetter(r.charAt(a))||" "===r.charAt(a)||'"'===r.charAt(a)||"'"===r.charAt(a));a++)o.Append(r.charAt(a));return a},t.dateheb_2_d=function(e,r,n){if(0===n&&0===r&&0===e)return 0;if(0===n||0===r||0===e)return 1e9;var i=t.dateheb_year_start(e),o=t.dateheb_year_start(e+1)-i,a=o>355;if(a&&r>t.ADAR&&(r===t.ADAR_B?r=t.ADAR+1:r+=1),n>t.dateheb_days_in_month(r,a,o))return 1e9;for(var s=1;s<r;s+=1)i+=t.dateheb_days_in_month(s,a,o);return i+=n,Math.max(i-t.DAYS_TIL_JESUS,0)},t}();q.PARTS_PER_HOUR=1080,q.HOURS_PER_DAY=24,q.PARTS_PER_DAY=q.HOURS_PER_DAY*q.PARTS_PER_HOUR,q.MONTH_DAYS=29,q.MONTH_EXTRA_PARTS=12*q.PARTS_PER_HOUR+793,q.PARTS_PER_MONTH=q.MONTH_DAYS*q.PARTS_PER_DAY+q.MONTH_EXTRA_PARTS,q.MONTHS_PER_NORM_YEAR=12,q.MONTHS_PER_LEAP_YEAR=13,q.NORM_YEARS_PER_CYCLE=12,q.LEAP_YEARS_PER_CYCLE=7,q.YEARS_PER_CYCLE=q.NORM_YEARS_PER_CYCLE+q.LEAP_YEARS_PER_CYCLE,q.MONTHS_PER_CYCLE=q.NORM_YEARS_PER_CYCLE*q.MONTHS_PER_NORM_YEAR+q.LEAP_YEARS_PER_CYCLE*q.MONTHS_PER_LEAP_YEAR,q.PARTS_PER_NORM_YEAR=q.MONTHS_PER_NORM_YEAR*q.PARTS_PER_MONTH,q.DAYS_PER_NORM_YEAR=Math.floor(q.PARTS_PER_NORM_YEAR/q.PARTS_PER_DAY),q.PARTS_PER_LEAP_YEAR=q.MONTHS_PER_LEAP_YEAR*q.PARTS_PER_MONTH,q.DAYS_PER_LEAP_YEAR=Math.floor(q.PARTS_PER_LEAP_YEAR/q.PARTS_PER_DAY),q.PARTS_PER_CYCLE=q.MONTHS_PER_CYCLE*q.PARTS_PER_MONTH,q.DAYS_PER_CYCLE=Math.floor(q.PARTS_PER_CYCLE/q.PARTS_PER_DAY),q.CREATION_DOW=2,q.CREATION_PARTS=5*q.PARTS_PER_HOUR+204,q.DAYS_TIL_JESUS=1373428,q.HESHVAN=2,q.KISLEV=3,q.ADAR=6,q.ADAR_B=13,q.DATEHEB_letters=[1,2,3,4,5,6,7,8,9,10,20,20,30,40,40,50,50,60,70,80,80,90,90,100,200,300,400],q.ALEF="א",q.TAV="ת",q.DATEHEB_months_n=[0,12,24,37,49,61,74,86,99,111,123,136,148,160,173,185,197,210,222,235],q.DATEHEB_norm_days_in_month=[30,29,30,29,30,29,30,29,30,29,30,29,0],q.DATEHEB_leap_days_in_month=[30,29,30,29,30,30,29,30,29,30,29,30,29],q.MONTH_LEN=5,q._localMonths=new Array(15),q.DOW_LEN=5,q._localDows=new Array(8);var $=function(){function t(){this._environment=null,this.DATECHAR=0,this._environment=x.Environment}return Object.defineProperty(t,"Instance",{get:function(){return null===t._instance&&(t._instance=new t),t._instance},enumerable:!1,configurable:!0}),t.prototype.getNewDateBreakParams=function(){return new nt},t.prototype.getNewTimeBreakParams=function(){return new tt},t.prototype.mg2disp=function(t,e,r,n,i,o,a,s){return 6===arguments.length?this.mg2disp_0(t,e,r,n,i,o):7===arguments.length?this.mg2disp_1(t,e,r,n,i,o,a):this.mg2disp_2(t,e,r,n,i,o,a,s)},t.prototype.mg2disp_0=function(t,e,r,n,i,o){return this.mg2disp(t,e,r,n,!1,i,o)},t.prototype.mg2disp_1=function(t,e,r,n,i,o,a){return this.mg2disp(t,e,r,n,i,o,!1,a)},t.prototype.mg2disp_2=function(t,e,n,i,o,a,s,_){var l="",u=null===e?"":e;switch(n.getAttr()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:l=this.fromAlpha(t,n,u,o,s);break;case r.StorageAttribute.NUMERIC:var P=n.getUnformattedNumericPic(),c=x.Environment.GetDecimal(),T=x.Environment.GetThousands();return x.Environment.setDecimalSeparator("."),x.Environment.setThousandsSeparator(","),l=this.fromNum(t,P),x.Environment.setDecimalSeparator(c),x.Environment.setThousandsSeparator(T),0!==P.getMaskChars()&&_||(l=r.StrUtil.ltrim(l)),i?""==l?null:Number(l):l;case r.StorageAttribute.DATE:if(i){return this.fromMgDateToNativeDate(t,a)}l=this.fromDate(t,n,a,_);break;case r.StorageAttribute.TIME:if(i){return this.fromMgTimeToNativeTime(t,n,_)}l=this.fromTime(t,n,_);break;case r.StorageAttribute.BOOLEAN:return this.fromMgLogicalToNativeLogical(t);case r.StorageAttribute.BLOB:l=K.getString(t);break;case r.StorageAttribute.BLOB_VECTOR:l=t}return l},t.prototype.disp2mg=function(t,n,i,o,a){var s="";switch(i.getAttr()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:s=this.toAlpha(t,i);break;case r.StorageAttribute.NUMERIC:for(var _=(t=String(t)).length;_>0&&(i.picIsMask(_-1)||" "===t[_-1]);)_--;t.length>_&&(t=e.NString.Remove(t,_,t.length-_)),i.isNegative()&&t.trim().startsWith("-")&&(t=r.StrUtil.ltrim(t));var l=x.Environment.GetDecimal(),u=x.Environment.GetThousands();x.Environment.setDecimalSeparator("."),x.Environment.setThousandsSeparator(",");var P=i.getUnformattedNumericPic();s=this.toNum(t,P,o),x.Environment.setDecimalSeparator(l),x.Environment.setThousandsSeparator(u);break;case r.StorageAttribute.DATE:var c=void 0;c="string"==typeof t?new Date(t):t,s=this.fromNativeDateToMgDate(c,i,o);break;case r.StorageAttribute.TIME:c=void 0;"string"==typeof t?(c=new Date,null!==t&&(c.setHours(+String(t).substr(0,2)),c.setMinutes(+String(t).substr(0,2)),String(t).length>5&&c.setSeconds(+String(t).substr(0,2)))):c=t,s=this.fromNativeTimeToMgTime(c,i);break;case r.StorageAttribute.BOOLEAN:s=this.fromNativeLogicalToMgLogical(t);break;case r.StorageAttribute.BLOB:s=K.createFromString(t,a)}return s},t.prototype.fromNum=function(t,e){return new Z(t).toDisplayValue(e)},t.prototype.fromAlpha=function(t,n,i,o,a){var s,_=n.getMaskSize(),l=_,u=n.getMask();if(n.getMaskChars()>0)s=this.win_data_cpy(e.NString.ToCharArray(u),_,e.NString.ToCharArray(t),n.isAttrAlpha(),a);else if(r.UtilStrByteMode.isLocaleDefLangDBCS()&&n.isAttrAlpha()){var P=r.UtilStrByteMode.lenB(t);l>P&&(l=P),s=r.UtilStrByteMode.leftB(t,l)}else null!==t&&(l>t.length&&(l=t.length),s=a?this.win_data_cpy(e.NString.ToCharArray(u),_,e.NString.ToCharArray(t),n.isAttrAlpha(),a):t.substr(0,l));if(o||null!==i&&i.length>0&&s.length<_){var c=new j(i),T=c.getContinuousRangeValues(),h=c.getDiscreteRangeValues();null===T&&null===h||(s=this.fillAlphaByRange(T,h,s))}return s},t.prototype.caseConvertedChar=function(t,e){return e.charCodeAt(0)===r.PICInterface.PIC_U?t.toUpperCase():e.charCodeAt(0)===r.PICInterface.PIC_L?t.toLowerCase():t},t.prototype.win_data_cpy=function(t,e,r,n,i){return 4===arguments.length?this.win_data_cpy_0(t,e,r,n):this.win_data_cpy_1(t,e,r,n,i)},t.prototype.win_data_cpy_0=function(t,e,r,n){return this.win_data_cpy(t,e,r,n,!1)},t.prototype.win_data_cpy_1=function(t,n,i,o,a){var s=0,_=0,l=new Array(n);if(o&&r.UtilStrByteMode.isLocaleDefLangDBCS()){for(var u=0;s<n&&u<n;){if(t[s].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP)if(_<i.length){var P=e.NString.FromChars(i,_,1);2===r.UtilStrByteMode.lenB(P)?s+1<n&&t[s+1].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP?(l[u++]=a?this.caseConvertedChar(i[_++],t[s+1]):i[_++],s+=1):l[u++]=" ":l[u++]=a?this.caseConvertedChar(i[_++],t[s+1]):i[_++]}else l[u++]=" ";else l[u++]=t[s];s+=1}return e.NString.FromChars(l).substr(0,u)}for(;s<n;)t[s].charCodeAt(0)<=r.PICInterface.PIC_MAX_OP?_<i.length?(l[s]=i[_],l[s]=a?this.caseConvertedChar(i[_],t[s]):i[_],_+=1):l[s]=" ":l[s]=t[s],s+=1;return e.NString.FromChars(l)},t.prototype.fromDate=function(t,e,r,n){var i=e.getMask(),o=e.getMaskSize(),a=new Z(t).NUM_2_ULONG();return this.to_a_pic_datemode(i,o,a,e,n,!1,r)},t.prototype.fromTime=function(t,e,r){var n=e.getMask(),i=e.getMaskSize(),o=new Z(t).NUM_2_ULONG();return this.time_2_a_pic(n,i,o,e,r,!1)},t.prototype.fromMgDateToNativeDate=function(t,e){var r,n=new Z(t).NUM_2_ULONG();return r=new nt,this.date_break_datemode(r,n,!1,e),r.month>0&&(r.month=r.month-1),0==r.year&&0==r.month&&0==r.day?null:new Date(r.year,r.month,r.day)},t.prototype.fromNativeDateToMgDateNumber=function(t,e,r){new Z;var n,i=0,o=t.getFullYear(),a=t.getDate(),s=t.getMonth()+1;return e.isHebrew()?(o>0&&(0===i&&(i=5),o+=1e3*i),n=q.dateheb_2_d(o,s,a)):(0===o&&(o=this.date_sys().year),n=this.date_4_calender(o,s,a,0,!1)),n},t.prototype.fromNativeDateToMgDate=function(t,e,r){var n=new Z,i=null==t?0:this.fromNativeDateToMgDateNumber(t,e,r);return n.NUM_4_LONG(i),n.toXMLrecord()},t.prototype.to_a_pic_datemode=function(t,n,i,o,a,s,_){var l,u,P,c,T,h=0,p=0,I=0,f=0,O=0,g=0,R=0,S=0,C=!1,d=e.NString.ToCharArray(t),A=0,L=null;if(o.getMaskSize()>n){for(;u<n;u++)d[u]="*";return e.NString.FromChars(d)}if(n=l=o.getMaskSize(),o.zeroFill()&&0===i&&!a){for(;u<n;u++)d[u]=o.getZeroPad();return e.NString.FromChars(d)}if(o.isHebrew()&&(0===i||1e9===i)){for(;u<n;u++)d[u]=" ";return e.NString.FromChars(d)}if(c=new nt(f,O,h,p,I),this.date_break_datemode(c,i,s,_),o.isHebrew()){var m=new e.RefParam(g),N=new e.RefParam(S),y=new e.RefParam(R);C=q.dateheb_4_d(i,m,N,y),g=m.value,S=N.value,R=y.value}for(f=c.year,O=c.month,h=c.day,p=c.doy,I=c.dow,c=null;l>0;){var M=new e.RefParam(n);switch(d[A].charCodeAt(0)){case r.PICInterface.PIC_YY:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,f,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_HYYYYY:u=q.dateheb_2_str(d,A,l,M,5,R,o.isTrimed(),!0),n=M.value,A+=u,l-=u;break;case r.PICInterface.PIC_HL:u=q.dateheb_i_2_h(R/1e3%10,d,A,!1,!1),A++,l--;break;case r.PICInterface.PIC_HDD:u=q.dateheb_2_str(d,A,l,M,2,g,o.isTrimed(),!1),n=M.value,A+=u,l-=u;break;case r.PICInterface.PIC_YYYY:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),4):this.int_2_a(d,A,4,f,"0"),A+=4,l-=4;break;case r.PICInterface.PIC_MMD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,O,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_MMM:if(o.isHebrew()){C&&6===S&&(S=14);var D=q.GetLocalMonths();P=e.NString.ToCharArray(D[S])}else{var b=E.GetMessageString(r.MsgInterface.MONTHS_PTR);D=r.DateUtil.getLocalMonths(b);P=e.NString.ToCharArray(D[O])}T=new rt(d,A,l),n-=this.date_i_2_nm(T,P,o.isTrimed()),A=T.outIdx,l=T.len,T=null;break;case r.PICInterface.PIC_DD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,h,"0"),A+=2,l-=2;break;case r.PICInterface.PIC_DDD:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),3):this.int_2_a(d,A,3,p,"0"),l-=3,A+=3;break;case r.PICInterface.PIC_DDDD:A+=u=this.date_2_DDDD(h,d,A,l,o.isTrimed()),n+=u-4,l-=4;break;case r.PICInterface.PIC_W:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),1):this.int_2_a(d,A,1,I,"0"),l--,A++;break;case r.PICInterface.PIC_WWW:if(o.isHebrew()){var v=q.GetLocalDows();P=e.NString.ToCharArray(v[I])}else{var B=E.GetMessageString(r.MsgInterface.DAYS_PTR),Y=r.DateUtil.getLocalDays(B);P=e.NString.ToCharArray(Y[I])}T=new rt(d,A,l),n-=this.date_i_2_nm(T,P,o.isTrimed()),A=T.outIdx,l=T.len,T=null;break;case r.PICInterface.PIC_BB:P=e.NString.ToCharArray(r.UtilDateJpn.getStrDow(I)),L=null,T=new rt(d,A,l),L=this.date_i_2_nm_bytemode(L,T,e.NString.FromChars(P),n),d=new Array(L.length),e.NString.CopyTo(L,0,d,0,L.length),A=T.outIdx,l=T.len,L=null,T=null;break;case r.PICInterface.PIC_JY1:case r.PICInterface.PIC_JY2:case r.PICInterface.PIC_JY4:var U=null;U=d[A].charCodeAt(0)===r.PICInterface.PIC_JY1?r.UtilDateJpn.getInstance().date_jpn_yr_2_a(f,p,!1):r.UtilDateJpn.getInstance().date_jpn_yr_2_a(f,p,!0),L=null,T=new rt(d,A,l),L=this.date_i_2_nm_bytemode(L,T,U,n),d=null,d=new Array(L.length),e.NString.CopyTo(L,0,d,0,L.length),A=T.outIdx,l=T.len,L=null,T=null;break;case r.PICInterface.PIC_YJ:o.zeroFill()&&0===i&&a?Q.char_memset(d,A,o.getZeroPad(),2):this.int_2_a(d,A,2,r.UtilDateJpn.getInstance().date_jpn_year_ofs(f,p),"0"),A+=2,l-=2;break;default:A++,l--}}return n<d.length&&Q.char_memset(d,n," ",d.length-n),e.NString.FromChars(d)},t.prototype.date_break_datemode=function(t,e,n,i){var o=t.year,a=t.month,s=t.day,_=t.doy,l=t.dow;if(e<=0)t.day=0,t.doy=0,t.dow=0,t.year=0,t.month=0;else{l=e%7+1,e-=1;var u=Math.floor(e/r.PICInterface.DAYSINFOURCENT);e-=u*r.PICInterface.DAYSINFOURCENT;var P=Math.floor(e/r.PICInterface.DAYSINCENTURY);P>3&&(P=3),e-=P*r.PICInterface.DAYSINCENTURY;var c=Math.floor(e/r.PICInterface.DAYSINFOURYEAR);e-=c*r.PICInterface.DAYSINFOURYEAR,(o=Math.floor(e/r.PICInterface.DAYSINYEAR))>3&&(o=3),e-=o*r.PICInterface.DAYSINYEAR;var T=0;(o=400*u+100*P+4*c+o+1)%4==0&&(o%100==0&&o%400!=0||(T=1)),n||"B"!==this._environment.GetDateMode(i)||(o+=r.PICInterface.DATE_BUDDHIST_GAP),a=Math.floor(e/r.PICInterface.DAYSINMONTH)+1,s=r.PICInterface.date_day_tab[a],T>0&&a>1&&(s+=1),e>=s?a+=1:(s=r.PICInterface.date_day_tab[a-1],T>0&&a>2&&(s+=1)),s=e-s+1,_=e+1,t.year=o,t.month=a,t.day=s,t.doy=_,t.dow=l}},t.prototype.int_2_a=function(t,e,r,n,i){var o=n<0;if(!(r<=0)){n=Math.abs(n);var a=r;do{t[e+(a-=1)]=String.fromCharCode(48+n%10),n=Math.floor(n/10)}while(a>0&&n>0);return o&&a>0&&(t[e+(a-=1)]="-"),this.lib_a_fill(t,e,r,a,i.charCodeAt(0))}},t.prototype.lib_a_fill=function(t,e,r,n,i){return 0===i?(r-=n)>0&&n>0&&(Q.char_memcpy(t,e,t,n,r),Q.char_memset(t,e+r," ",n)):n>0&&Q.char_memset(t,e,String.fromCharCode(i),n),r},t.prototype.date_i_2_nm=function(t,e,r){var n,i=this.date_msk_cnt(t.outVal,t.outIdx,t.len);return n=r?Q.mem_trim(e,0,i):i,n=Math.min(n,t.len),Q.char_memcpy(t.outVal,t.outIdx,e,0,n),t.outIdx=t.outIdx+n,t.len=t.len-i,(i-=n)>0&&Q.char_memcpy(t.outVal,t.outIdx,t.outVal,t.outIdx+i,t.len),i},t.prototype.date_i_2_nm_bytemode=function(t,n,i,o){var a=this.date_msk_cnt(n.outVal,n.outIdx,n.len),s=e.NString.FromChars(n.outVal);s=s.substr(0,n.outIdx);var _=r.UtilStrByteMode.lenB(s);return i=r.UtilStrByteMode.leftB(i,a),t=r.UtilStrByteMode.repB(e.NString.FromChars(n.outVal),i,_+1,a),n.outIdx=n.outIdx+i.length,n.len=n.len-a,a,t},t.prototype.date_msk_cnt=function(t,e,r){for(var n=t[e++],i=1;i<r&&t[e]===n;)e+=1,i+=1;return i},t.prototype.date_2_DDDD=function(t,r,n,i,o){var a,s=4;switch(t>9?(this.int_2_a(r,n,2,t,(0).toString()),n+=2):(o?(Q.char_memcpy(r,n,r,n+1,i-1),s--):r[n++]=" ",this.int_2_a(r,n,1,t,(0).toString()),n++),t){case 1:case 21:case 31:a=e.NString.ToCharArray("st");break;case 2:case 22:a=e.NString.ToCharArray("nd");break;case 3:case 23:a=e.NString.ToCharArray("rd");break;default:a=e.NString.ToCharArray("th")}return r[n++]=a[0],r[n]=a[1],s},t.prototype.fromMgTimeToNativeTime=function(e,r,n){r.getMask(),r.getMaskSize();var i=new Z(e).NUM_2_ULONG(),o=new tt;t.time_break(o,i);var a=new Date;return a.setHours(o.hour),a.setMinutes(o.minute),a.setSeconds(o.second),a},t.prototype.time_2_a_pic=function(n,i,o,a,s,_){var l,u,P=0,c=0,T=0,h=0,E=e.NString.ToCharArray(n),p=new tt(P,c,T);if(_?h=o-1e3*(l=Math.floor(o/1e3)):l=o,t.time_break(p,l),P=p.hour,c=p.minute,T=p.second,a.getMaskSize()>i)Q.char_memset(E,0,"*",i),u=e.NString.FromChars(E);else{if(a.zeroFill()&&0===l&&(!_||0===h)){if(s){for(var I=0;I<a.getMaskSize();I+=1)E[I]<=""&&(E[I]=a.getZeroPad());return u=e.NString.FromChars(E)}return Q.char_memset(E,0,a.getZeroPad(),a.getMaskSize()),u=e.NString.FromChars(E)}for(var f=0,O=0,g=a.getMaskSize(),R=-1;f<g;)switch(E[f].charCodeAt(0)){case r.PICInterface.PIC_HH:R=f,f+=2;break;case r.PICInterface.PIC_MMT:this.int_2_a(E,f,2,c,"0"),f+=2;break;case r.PICInterface.PIC_SS:this.int_2_a(E,f,2,T,"0"),f+=2;break;case r.PICInterface.PIC_MS:this.int_2_a(E,f,3,h,"0"),f+=3;break;case r.PICInterface.PIC_PM:O=1;var S=P%24;S<12||0===S?Q.char_memcpy(E,f,e.NString.ToCharArray("am"),0,2):Q.char_memcpy(E,f,e.NString.ToCharArray("pm"),0,2),f+=2;break;default:f++}R>=0&&(O>0&&(0===(P%=24)||0===(P%=12))&&(P=12),this.int_2_a(E,R,2,P,0!==O&&P<10?" ":"0")),u=e.NString.FromChars(E)}return u},t.time_break=function(t,e){e<=0?(t.second=0,t.minute=0,t.hour=0):(t.hour=Math.floor(e/3600),e-=3600*t.hour,t.minute=Math.floor(e/60),t.second=e-60*t.minute)},t.prototype.fromLogical=function(t,r,n){var i=e.NString.ToCharArray(r.getMask());if(r.getMaskSize()>i.length)return Q.char_memset(i,0,"*",i.length),e.NString.FromChars(i);for(var o=new Array(50),a=0;a<o.length;++a)o[a]=(0).toString();this.win_rng_bool_sub(o,o.length,"1"===t.charAt(0),n);var s=r.getMaskSize();return this.win_data_cpy(i,s,o,r.isAttrAlpha())},t.prototype.fromMgLogicalToNativeLogical=function(t){return"1"===t.charAt(0)},t.prototype.fromNativeLogicalToMgLogical=function(t){return!0===t?"1":"0"},t.prototype.win_rng_bool_sub=function(t,e,n,i){for(var o=new Array(r.PICInterface.DB_STR_MAX+2),a=0;a<o.length;++a)o[a]=(0).toString();var s=new Array(r.PICInterface.DB_STR_MAX+2);for(a=0;a<s.length;++a)s[a]=(0).toString();var _,l=0;if(i=this.win_rng_bool(i),this.win_rng_crk(o,s,i),n)_=0;else{for(;o[l]>"\0";)l+=1;_=l+1}for(var u=_;o[u]>"\0";)u+=1;u-=_,Q.char_memcpy(t,0,o,_,Math.min(u,e)),u<e&&Q.char_memset(t,u," ",e-u)},t.prototype.win_rng_bool=function(t){return null!==t&&0!==t.length||(t="True, False"),t},t.prototype.win_rng_crk=function(t,r,n){for(var i=n.length,o=e.NString.ToCharArray(n),a=0,s=0,_=0;s<i;)if(","===o[s]||"-"===o[s]){if(r[_++]=o[s++],t[a++]="\0",s<i)for(;" "===o[s];)s+=1}else"\\"===o[s]&&(s+=1),t[a]=o[s++],a+=1;r[_]="\0",t[a++]="\0",t[a]="\0"},t.prototype.toNum=function(t,e,r){return new Z(t,e,r).toXMLrecord()},t.prototype.a_2_date_pic_datemode=function(t,n,i,o,a){var s=0,_=!1,l=!1,u=!1,P=!1,c=!1,T=0,h=new et(0),E=0,p=0,I=Math.min(t.length,i.getMaskSize());t.length<o.length&&(t.length=o.length);var f,O=0,g=1,R=1,S=1,C=!1;for(f=0;f<n&&("0"===t[f]||" "===t[f]);f+=1);if(f===n)return 0;for(;s<n&&s+E<I;)switch(o[s+E].charCodeAt(0)){case r.PICInterface.PIC_YY:_=!0,P=!0,O=this.date_a_2_i(t,2,s),s+=2,0===O&&(c=!0);var d=this._environment.GetCentury(a)%100;O<d&&(O+=100),O+=this._environment.GetCentury(a)-d,"B"===this._environment.GetDateMode(a)&&(O-=r.PICInterface.DATE_BUDDHIST_GAP);break;case r.PICInterface.PIC_YYYY:_=!0,P=!0;var A=void 0;if(r.UtilStrByteMode.isLocaleDefLangJPN()){for(A=0;A<4&&s+A<t.length&&r.UtilStrByteMode.isDigit(t[s+A]);A++);f=A}else{for(f=0;s+f<t.length&&t[s+f]!==this.DATECHAR.toString()&&f<4;f++);for(A=0;s+A<t.length&&r.UtilStrByteMode.isDigit(t[s+A])&&A<4;A++);}r.UtilStrByteMode.isLocaleDefLangJPN()?f<4&&t.length<o.length&&this.move_date(t,s,4-f,t.length):f<4&&I<o.length&&(this.move_date(t,s,4-f,I),I=I+4-f),O=this.date_a_2_i(t,4,s),s+=4,0===O&&(c=!0),A<=2&&(O<(d=this._environment.GetCentury(a)%100)&&(O+=100),O+=this._environment.GetCentury(a)-d),"B"===this._environment.GetDateMode(a)&&(O-=r.PICInterface.DATE_BUDDHIST_GAP);break;case r.PICInterface.PIC_HYYYYY:P=!0;var L=0;I>s+5&&o[s+5].charCodeAt(0)===r.PICInterface.PIC_HYYYYY&&(L=1),O=q.dateheb_h_2_i(t,5+L,s),s+=5+L,0===O&&(c=!0);break;case r.PICInterface.PIC_HL:E=q.dateheb_h_2_i(t,1,s),s++;break;case r.PICInterface.PIC_HDD:P=!0,L=0,I>s+2&&o[s+2].charCodeAt(0)===r.PICInterface.PIC_HDD&&(L=1),R=q.dateheb_h_2_i(t,2+L,s),s+=2+L;break;case r.PICInterface.PIC_MMD:P=!0,l=!0,r.UtilStrByteMode.isLocaleDefLangJPN()?(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length):t[s+1].charCodeAt(0)===this.DATECHAR&&I<o.length&&(this.move_date(t,s,1,I),I+=1),g=this.date_a_2_i(t,2,s),s+=2;break;case r.PICInterface.PIC_MMM:P=!0,l=!0,h.val=s,g=this.date_MMM_2_m(t,o,h,I,i.isHebrew()),s=h.val,i.isHebrew()&&14===g&&(g=6);break;case r.PICInterface.PIC_DD:P=!0,u=!0,r.UtilStrByteMode.isLocaleDefLangJPN()?(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length):t[s+1].charCodeAt(0)===this.DATECHAR&&I<o.length&&(this.move_date(t,s,1,I),I+=1),R=this.date_a_2_i(t,2,s),s+=2;break;case r.PICInterface.PIC_DDD:P=!0,C=!0,u=!0,S=this.date_a_2_i(t,3,s),s+=3;break;case r.PICInterface.PIC_DDDD:P=!0,u=!0,R=this.date_a_2_i(t,2,s),s+=4;break;case r.PICInterface.PIC_YJ:_=!0,P=!0,r.UtilStrByteMode.isLocaleDefLangJPN()&&(t.length===s+1||t[s+1].charCodeAt(0)===this.DATECHAR||!r.UtilStrByteMode.isDigit(t[s+1]))&&t.length<o.length&&this.move_date(t,s,1,t.length),O=this.date_a_2_i(t,2,s),s+=2;var m=e.NString.FromChars(t);if(0===(T=r.UtilDateJpn.getInstance().getStartYearOfEra(m,i.getMask())))return 0;0===(O+=T-1)&&(c=!0);break;default:r.UtilStrByteMode.isLocaleDefLangDBCS()&&!1===r.UtilStrByteMode.isHalfWidth(t[s])&&r.UtilStrByteMode.isHalfWidth(o[s+E])&&E++,s+=1}return c&&(l||(g=0),u||0!==g||(R=0)),(0!==R||0!==g||!c&&0!==O)&&P?i.isHebrew()?(O>0&&(0===p&&(p=5),O+=1e3*p),q.dateheb_2_d(O,g,R)):(0!==O||_||(O=this.date_sys().year),this.date_4_calender(O,g,R,S,C)):0},t.prototype.date_a_2_i=function(t,e,r){return 3!==arguments.length||!(null===t||t instanceof Array)||null!==e&&e.constructor!==Number||null!==r&&r.constructor!==Number?this.date_a_2_i_1(t,e,r):this.date_a_2_i_0(t,e,r)},t.prototype.date_a_2_i_0=function(t,r,n){for(var i=new Array(r),o=new Z,a=0;a<r;a+=1)i[a]=t[n+a];return o.a_2_long(e.NString.FromChars(i))},t.prototype.move_date=function(t,e,r,n){4!==arguments.length||!(null===t||t instanceof Array)||null!==e&&e.constructor!==Number||null!==r&&r.constructor!==Number||null!==n&&n.constructor!==Number?this.move_date_1(t,e,r,n):this.move_date_0(t,e,r,n)},t.prototype.move_date_0=function(t,e,r,n){Q.char_memmove(t,e+r,t,e,n-(e+r)+1),Q.char_memset(t,e,"0",r)},t.prototype.date_MMM_2_m=function(t,n,i,o,a){var s;if(r.UtilStrByteMode.isLocaleDefLangJPN()){var _=r.UtilStrByteMode.convPos(e.NString.FromChars(t),e.NString.FromChars(n),i.val,!1);s=this.date_msk_cnt(n,_,o-_)}else s=this.date_msk_cnt(n,i.val,o-i.val);var l=i.val;if(i.val=i.val+s,0===(o=Q.mem_trim(t,l,s)))return 0;var u=e.NString.FromChars(t,l,o),P=void 0;if(a)P=q.GetLocalMonths();else{var c=E.GetMessageString(r.MsgInterface.MONTHS_PTR);P=r.DateUtil.getLocalMonths(c)}for(var T=1;T<P.length;T+=1)if(0===e.NString.Compare(P[T].substr(0,o),u,!0))return T;return 0},t.prototype.date_sys=function(){var t=new nt,r=e.DateTime.Now;return t.year=r.Year,t.month=r.Month,t.day=r.Day,t},t.prototype.date_magic=function(t){var r,n=(r=t?e.DateTime.UtcNow:e.DateTime.Now).Year,i=r.Month,o=r.Day;return this.date_4_calender(n,i,o,1,!1)},t.prototype.time_magic=function(t){return e.DateTime.GetTotalSecondsFromMidnight(t,new Date)},t.prototype.mtime_magic=function(t){return e.DateTime.GetTotalMilliSecondsFromMidnight(t,new Date)},t.prototype.date_4_calender=function(t,e,n,i,o){var a=t%4==0&&(t%100!=0||t%400==0);if(o){if(0===i)return 0;if(i>366||!a&&i>365)return 1e9}else{if(0===n&&0===e&&0===t)return 0;if(0===n||0===e||0===t||e>12)return 1e9}t-=1;var s=Math.floor(t/400);t-=400*s;var _=Math.floor(t/100);t-=100*_;var l=Math.floor(t/4);if(t-=4*l,!o){var u=r.PICInterface.date_day_tab[e-1],P=r.PICInterface.date_day_tab[e];if(a&&e>1&&(P+=1,e>2&&(u+=1)),n>P-u)return 1e9;i=u+n}return 146097*s+36524*_+1461*l+365*t+i},t.prototype.fromNativeTimeToMgTime=function(t,e){var r=new Z,n=this.fromNativeTimeToMgTimeNumber(t,e);return r.NUM_4_LONG(n),r.toXMLrecord()},t.prototype.fromNativeTimeToMgTimeNumber=function(t,e){return this.time_2_int(t.getHours(),t.getMinutes(),t.getSeconds())},t.prototype.a_2_time=function(t,e,r,n){return 3===arguments.length?this.a_2_time_0(t,e,r):this.a_2_time_1(t,e,r,n)},t.prototype.a_2_time_0=function(t,r,n){return this.a_2_time(t,t.length,e.NString.ToCharArray(r.getMask()),n)},t.prototype.a_2_time_1=function(t,e,n,i){var o=new Z,a=0,s=n.length;s>e&&(s=e);for(var _=0,l=0,u=0,P=0,c=0;a<s;){var T,h=void 0;switch(n[a].charCodeAt(0)){case r.PICInterface.PIC_HH:case r.PICInterface.PIC_MMT:case r.PICInterface.PIC_SS:case r.PICInterface.PIC_PM:h=2;break;case r.PICInterface.PIC_MS:h=3;break;default:h=1}switch(T=Math.min(h,s-a),n[a].charCodeAt(0)){case r.PICInterface.PIC_HH:l=o.a_2_long(t.substr(a,T));break;case r.PICInterface.PIC_MMT:u=o.a_2_long(t.substr(a,T));break;case r.PICInterface.PIC_SS:P=o.a_2_long(t.substr(a,T));break;case r.PICInterface.PIC_MS:c=o.a_2_long(t.substr(a,T));break;case r.PICInterface.PIC_PM:_=0;var E=t[a];E=E.toUpperCase(),a+1<s&&"M"===t[a+1].toUpperCase()&&("A"===E&&(_=-1),"P"===E&&(_=1))}a+=T}return P>59||u>59?0:(0!==_&&(-1===_?12===l&&(l=0):l<12&&(l+=12)),i?1e3*this.time_2_int(l,u,P)+c:this.time_2_int(l,u,P))},t.prototype.time_2_int=function(t,e,r){return 3600*t+60*e+r},t.toBoolean=function(t){return null!==t&&"1"===t},t.prototype.a_2_date=function(t,e,r){return this.a_2_date_datemode(t,e,r)},t.prototype.a_2_date_pic=function(t,r,n,i){return null===t&&(t=""),this.a_2_date_pic_datemode(e.NString.ToCharArray(t),t.length,r,e.NString.ToCharArray(n),i)},t.prototype.to_a=function(t,e,r,n,i){return this.to_a_datemode(t,e,r,n,!1,i)},t.prototype.a_2_date_datemode=function(t,n,i){var o=new z(n,r.StorageAttribute.DATE,i);return null===t&&(t=""),this.a_2_date_pic_datemode(e.NString.ToCharArray(t),t.length,o,e.NString.ToCharArray(o.getMask()),i)},t.prototype.to_a_datemode=function(t,e,n,i,o,a){var s=new z(i,r.StorageAttribute.DATE,a);return null===t&&(t=s.getMask()),this.to_a_pic_datemode(t,e,n,s,!0,o,a)},t.prototype.date_a_2_i_1=function(t,e,r){var n,i=new Z;return n=t.substr(r,e),i.a_2_long(n)},t.prototype.move_date_1=function(t,e,n,i){return t=r.StrUtil.memmove(t,e+n,t,e,i-e),t=r.StrUtil.memset(t,e,"0",n)},t.prototype.time_2_a=function(t,e,n,i,o,a){0===r.StrUtil.rtrim(i).length&&(i="HH:MM:SS");var s=new z(i,r.StorageAttribute.TIME,o);return null===t&&(t=s.getMask()),this.time_2_a_pic(t,e,n,s,!1,a)},t.prototype.toLogical=function(t,e,r){return null!==(t=t.trim())&&0!==t.length||(t="False"),this.disp_2_logical(t,e.getMask(),r)},t.prototype.disp_2_logical=function(t,n,i){var o=new e.StringBuilder(t.length);i=this.win_rng_bool(i);var a=(i=r.StrUtil.makePrintableTokens(i,r.SEQ_2_HTML)).indexOf(","),s=i.substr(0,a);for(s=r.StrUtil.makePrintableTokens(s,r.HTML_2_STR),a=0,a=0;a<t.length&&a<n.length;a++)n.charCodeAt(a)===r.PICInterface.PIC_X&&o.Append(t.charAt(a));var _=o.ToString();return s.length<_.length?_=_.substr(0,s.length):_.length<s.length&&(s=s.substr(0,_.length)),_.toUpperCase()===s.toUpperCase()?"1":"0"},t.prototype.toAlpha=function(n,i){var o,a=i.getMask(),s=new e.StringBuilder(i.getMaskSize()),_=r.UtilStrByteMode.isLocaleDefLangDBCS()&&i.isAttrAlpha(),l=o=0;for(o=l=0;l<n.length&&o<a.length;l++,o++)if(t.isAlphaPositionalDirective(a.charAt(o))&&(s.Append(n.charAt(l)),_)){var u=n.substr(l,1);2===r.UtilStrByteMode.lenB(u)&&(o+=1)}return s.ToString()},t.isAlphaPositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_X||e===r.PICInterface.PIC_U||e===r.PICInterface.PIC_L||e===r.PICInterface.PIC_N||e===r.PICInterface.PIC_J||e===r.PICInterface.PIC_G||e===r.PICInterface.PIC_S||e===r.PICInterface.PIC_T},t.prototype.fillAlphaByRange=function(t,e,r){var n=this.fillAlphaByDiscreteRangeValues(e,r);return null!==n||null!==(n=this.fillAlphaByContinuousRangeValues(t,r))||null!==e&&null!==(n=this.completeAlphaByRange(e,r))?n:r},t.prototype.fillAlphaByDiscreteRangeValues=function(t,e){if(null!==t)for(var r=0;r<t.length;r+=1){var n=t.get_Item(r),i=n.substr(0,Math.min(e.length,n.length));if(e.toUpperCase()===i.toUpperCase())return n}return null},t.prototype.fillAlphaByContinuousRangeValues=function(t,n){if(n=r.StrUtil.rtrim(n),null!==t)for(var i=0;i<t.length;i+=1){var o=t.get_Item(i),a=t.get_Item(i+=1);if(e.NString.CompareOrdinal(n,o)>=0&&e.NString.CompareOrdinal(n,a)<=0)return n}return null},t.prototype.completeAlphaByRange=function(t,e){for(var n=new Array(2),i=0;i<n.length;++i)n[i]=0;var o=new Array(2);for(i=0;i<o.length;++i)o[i]=null;for(var a=0;0===a||1===a;){var s=void 0;s=0===a?e:e.toLowerCase(),s=r.StrUtil.rtrim(s);for(var _=0;_<t.length;_+=1){var l=!1,u=0,P=void 0;P=0===a?t.get_Item(_):t.get_Item(_).toLowerCase();var c=s.length;if(c<P.length)for(var T=0;T<c;T+=1){if(s.charAt(T)!==P.charAt(T)){l=!0;break}u+=1}else l=!0;u>n[a]&&!l&&(o[a]=t.get_Item(_),n[a]=u)}a+=1}return null!==o[0]?o[0]:null!==o[1]?o[1]:null},t.prototype.setDateChar=function(t){this.DATECHAR=t},t.prototype.getDateChar=function(){return this.DATECHAR},t.StringValueToMgValue=function(t,n,i,o){switch(n){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:var a=t;return a=e.NString.PadRight(a,o,i);case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:return new Z(t);default:return t}},t}();$._instance=null;var tt=function(){function t(t,e,r){this.hour=0,this.minute=0,this.second=0,0!==arguments.length?this.constructor_1(t,e,r):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e,r){this.hour=t,this.minute=e,this.second=r},t}(),et=function(t){this.val=0,this.val=t},rt=function(t,e,r){this.outVal=null,this.len=0,this.outIdx=0,this.outVal=t,this.outIdx=e,this.len=r},nt=function(){function t(t,e,r,n,i){this.day=0,this.dow=0,this.doy=0,this.month=0,this.year=0,0!==arguments.length?this.constructor_1(t,e,r,n,i):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e,r,n,i){this.year=t,this.month=e,this.day=r,this.doy=n,this.dow=i},t}(),it=function(){function t(){}return t.validateBlobContents=function(r){var n=!1;if(!e.NString.IsNullOrEmpty(r)){var i=K.blobPrefixLength(r);n=0===e.NString.Compare(r,t.BLOB_TABLE_STR+t.VECTOR_STR,!0,i,0,t.BLOB_TABLE_STR_LEN+t.VECTOR_STR_LEN)}return n},t.adjustAlphaStringsInFlatData=function(n){if(t.validateBlobContents(n)){var i=new e.StringBuilder,o=K.blobPrefixLength(n),a=n.substr(0,o);i.Append(a);var s=r.StrUtil.tokenize(n.substr(o),","),_=0;if(a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,(a=s[++_]).charAt(0)!==r.StorageAttribute.ALPHA&&a.charAt(0)!==r.StorageAttribute.MEMO)return n;i.Append(a+","),o+=a.length+1,a=s[++_];var l=e.NNumber.Parse(a);i.Append(a+","),o+=a.length+1,a=r.UtilStrByteMode.leftB(n.substr(o),l),i.Append(a+","),o+=a.length+1,_=0,a=(s=r.StrUtil.tokenize(n.substr(o),","))[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_],i.Append(a+","),o+=a.length+1,a=s[++_];var u=e.NNumber.Parse(a);i.Append(a+","),o+=a.length+1,_++,a=s[_++],i.Append(a+","),o+=a.length+1;for(var P=0;P<u;P+=1)a=r.UtilStrByteMode.leftB(n.substr(o),l),i.Append(a),o+=a.length;return a=n.substr(o),i.Append(a),i.ToString()}return n},t}();it.BLOB_TABLE_STR="mgbt",it.BLOB_TABLE_STR_LEN=4,it.VECTOR_STR="MGVEC",it.VECTOR_STR_LEN=5;var ot=function(){function t(){}return t.byteStreamToString=function(r){return 1===arguments.length&&(null===r||r instanceof e.StringBuilder)?t.byteStreamToString_0(r):t.byteStreamToString_1(r)},t.byteStreamToString_0=function(t){for(var r,n,i=new e.StringBuilder(Math.floor(t.Length/2)),o=0;o<t.Length;o+=2)r=t.get_Item(o)+t.get_Item(o+1),n=String.fromCharCode(e.NNumber.Parse(r,e.NumberStyles.HexNumber)),i.Append(n);return i.ToString()},t.byteStreamToString_1=function(r){return t.byteStreamToString(new e.StringBuilder(r))},t.serializeItemVal=function(e,r,n,i){return 2===arguments.length?t.serializeItemVal_0(e,r):t.serializeItemVal_1(e,r,n,i)},t.serializeItemVal_0=function(t,n){var i;e.Debug.Assert(null!==t);var o=e.NString.Empty,a=null,s=null,_=0,l=0,u=e.NString.Empty,P=0,c=null,T=e.NString.Empty;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:var h=new Z(t);a=r.Misc.ToByteArray(h.Data);break;case r.StorageAttribute.BOOLEAN:a=x.Environment.GetEncoding().GetBytes(t);break;case r.StorageAttribute.ALPHA:t=r.StrUtil.rtrim(t),i=r.UtilStrByteMode.lenB(t).toString(16).toUpperCase();for(var E=0;E<4-i.length;E++)o+="0";o+=i,(a=new Uint8Array(x.Environment.GetEncoding().GetBytes(o).length+x.Environment.GetEncoding().GetBytes(t).length)).set(x.Environment.GetEncoding().GetBytes(o),0),a.set(x.Environment.GetEncoding().GetBytes(t),x.Environment.GetEncoding().GetBytes(o).length);break;case r.StorageAttribute.UNICODE:i=(t=r.StrUtil.rtrim(t)).length.toString(16).toUpperCase();for(E=0;E<4-i.length;E++)o+="0";o+=i,(a=new Uint8Array(x.Environment.GetEncoding().GetBytes(o).length+x.Environment.GetEncoding().GetBytes(t).length)).set(x.Environment.GetEncoding().GetBytes(o),0),a.set(x.Environment.GetEncoding().GetBytes(t),x.Environment.GetEncoding().GetBytes(o).length);break;case r.StorageAttribute.BLOB:_=0,l=e.ISO_8859_1_Encoding.ISO_8859_1.GetByteCount(t),P=Math.floor(l/65535),o="FFFF",c=x.Environment.GetEncoding().GetBytes(o);for(var p=0;p<P;p++){u=t.substr(_,65535),_+=65535;var I=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u);(s=new Uint8Array(c.length+I.length)).set(c),s.set(I,c.length)}if(l%65535>0){u=t.substr(_,l-_);I=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u);o=e.NString.Format(String.fromCharCode(I.length),"X4");var f=new Uint8Array(s.length+x.Environment.GetEncoding().GetBytes(o).length+e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u).length);f.set(s),f.set(x.Environment.GetEncoding().GetBytes(o),s.length),f.set(e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(u),s.length+x.Environment.GetEncoding().GetBytes(o).length),s=f,P++}T=e.NString.Format(String.fromCharCode(P),"D4"),c=x.Environment.GetEncoding().GetBytes(T),(a=new Uint8Array(s.length+c.length)).set(c),a.set(s,c.length)}return a},t.serializeItemVal_1=function(t,n,i,o){e.Debug.Assert(null!=t);var a,s,_,l,u=2*x.Environment.GetSignificantNumSize(),P=new e.StringBuilder;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=o?r.Base64.encode(this.byteStreamToString(t.substr(0,u)),x.Environment.GetEncoding()):t.substr(0,u);break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:_=0,l=(t=r.StrUtil.rtrim(t)).length;do{var c=t.indexOf(String.fromCharCode(0),_);if(-1===c){for(a=(l-_).toString(16).toUpperCase(),s=0;s<4-a.length;s++)P.Append("0");P.Append(a),_>0&&(t=t.substr(_,l-_)),_=l}else{for(a=(c-_+32768).toString(16).toUpperCase(),P.Append(a),P.Append(t.substr(_,c-_)),s=1;s<l-c&&0===t.charCodeAt(c+s);s++);for(a="0000"+s.toString(16).toUpperCase(),P.Append(a.substr(a.length-4)),_=c;s>0;s--,_++){var T="0"+t.charCodeAt(c).toString(16);P.Append(T.substr(T.length-2))}if(_>=l){P.Append("0000"),t="";break}}}while(_<l);break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.DOTNET:if(_=0,l=t.length,r.UtilStrByteMode.isLocaleDefLangDBCS()&&n===r.StorageAttribute.BLOB_VECTOR&&(i===r.StorageAttribute.ALPHA||i===r.StorageAttribute.MEMO)){t=it.adjustAlphaStringsInFlatData(t);do{if(t.length<_+16383){for(_>0&&(t=t.substr(_)),a=r.UtilStrByteMode.lenB(t).toString(16).toUpperCase(),s=0;s<4-a.length;s++)P.Append("0");P.Append(a),t=o?r.Base64.encode(t,!0,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(t,4),_=l}else{var h=t.substr(_,16383);a=(r.UtilStrByteMode.lenB(h)+32768).toString(16).toUpperCase(),P.Append(a),P.Append(o?r.Base64.encode(h,!0,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(h,4)),P.Append("0000"),_+=16383}}while(_<l);break}do{if(l<_+32767){for(a=(l-_).toString(16).toUpperCase(),s=0;s<4-a.length;s++)P.Append("0");P.Append(a),_>0&&(t=t.substr(_,l-_)),t=o?r.Base64.encode(t,x.Environment.GetEncoding()):r.StrUtil.stringToHexaDump(t,4),_=l}else a="FFFF",P.Append(a),o?P.Append(r.Base64.encode(t.substr(_,32767),x.Environment.GetEncoding())):P.Append(r.StrUtil.stringToHexaDump(t.substr(_,32767),4)),P.Append("0000"),_+=32767}while(_<l)}return P.Append(t),P.ToString()},t.deSerializeItemVal=function(t,n,i,o,a,s){var _,l,u=null,P=0,c=null,T=null;if(n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET)l=P+4,T=t.substr(P,l-P),_=e.NNumber.Parse(T,e.NumberStyles.HexNumber),P=l;else if(n===r.StorageAttribute.BOOLEAN)_=1;else{var h=x.Environment.GetSignificantNumSize();_=o?2*h:4*Math.floor((h+2)/3)}if((32768&_)>0)c=new e.StringBuilder,_&=32767,n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR&&n!==r.StorageAttribute.DOTNET||(o?_*=2:_=4*Math.floor((_+2)/3)),s.value=this.getSpannedField(t,_,P,n,c,o),u=c.ToString(),l=P+s.value;else{if(n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR&&n!==r.StorageAttribute.DOTNET||(o?_*=2:_=4*Math.floor((_+2)/3)),(l=P+_)>t.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+t);u=r.UtilStrByteMode.isLocaleDefLangDBCS()&&n===r.StorageAttribute.BLOB_VECTOR?this.getString(t.substr(P,l-P),n,o,a===r.StorageAttribute.ALPHA):this.getString(t.substr(P,l-P),n,o)}return P=l,n!==r.StorageAttribute.ALPHA&&n!==r.StorageAttribute.UNICODE||(_=i,u=r.StrUtil.padStr(u,_),n===r.StorageAttribute.ALPHA&&r.UtilStrByteMode.isLocaleDefLangDBCS()&&(u=r.UtilStrByteMode.leftB(u,_))),s.value=l,u},t.getString=function(e,r,n,i){return 3===arguments.length?t.getString_0(e,r,n):2===arguments.length?t.getString_2(e,r):t.getString_1(e,r,n,i)},t.getString_0=function(e,r,n){return t.getString(e,r,n,!1)},t.getString_1=function(e,n,i,o){return i?n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET?t.byteStreamToString(e):e:n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR||n===r.StorageAttribute.DOTNET?r.Base64.decode(e,o?x.Environment.GetEncoding():null):r.Base64.decodeToHex(e)},t.getSpannedField=function(e,r,n,i,o,a,s){return 6===arguments.length?t.getSpannedField_0(e,r,n,i,o,a):t.getSpannedField_1(e,r,n,i,o,a,s)},t.getSpannedField_0=function(n,i,o,a,s,_){var l,u,P,c,T=o+i,h=o,E=null;if(T>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(s.Remove(0,s.Length),s.Append(t.getString(n.substr(o,T-o),a,_)),T=(o+=i)+4,P=n.substr(o,T-o),l=e.NNumber.Parse(P,e.NumberStyles.HexNumber),o=T,(T=_?o+2*l:o+4*Math.floor((l+2)/3))>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);for(;o<T;)P=n.substr(o,2),u=String.fromCharCode(e.NNumber.Parse(P,e.NumberStyles.HexNumber)),s.Append(u),o+=2;if(T=o+4,P=n.substr(o,T-o),o=T,(32768&(l=e.NNumber.Parse(P,e.NumberStyles.HexNumber)))>0)E=new e.StringBuilder,l&=32767,a!==r.StorageAttribute.BLOB&&a!==r.StorageAttribute.BLOB_VECTOR||(_?l*=2:l=4*Math.floor((l+2)/3)),c=t.getSpannedField(n,l,o,a,E,_),s.Append(E.ToString()),o+=c;else{if(a!==r.StorageAttribute.BLOB&&a!==r.StorageAttribute.BLOB_VECTOR||(_?l*=2:l=4*Math.floor((l+2)/3)),(T=o+l)>n.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+n);s.Append(t.getString(n.substr(o,T-o),a,_)),o=T}return o-h},t.getSpannedField_1=function(n,i,o,a,s,_,l){var u,P,c,T,h=o+i,E=o,p=null;if(T=r.UtilStrByteMode.isLocaleDefLangDBCS()?e.ISO_8859_1_Encoding.ISO_8859_1:x.Environment.GetEncoding(),h>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(s.Remove(0,s.Length),s.Append(T.GetString(n,o,i)),(l-=1)<=0)return 0;if(h=(o+=i)+4,P=T.GetString(n,o,4),e.NNumber.Parse(P,e.NumberStyles.HexNumber),o=h,h>n.length)throw new e.ApplicationException("in Record.getSpannedField() data string too short:\n"+n);if(h=o+4,P=T.GetString(n,o,4),o=h,(32768&(u=e.NNumber.Parse(P,e.NumberStyles.HexNumber)))>0)p=new e.StringBuilder,c=t.getSpannedField(n,u,o,a,p,_,l),s.Append(p.ToString()),o+=c;else{if((h=o+u)>n.length)throw new e.ApplicationException("in Record.fillFieldsData() data string too short:\n"+n);s.Append(T.GetString(n,o,u)),o=h}return o-E},t.itemValToXML=function(e,n,i,o){var a=t.serializeItemVal(e,n,i,o);return r.XmlParser.escape(a).toString()},t.getString_2=function(e,n){var i,o=x.Environment.GetDebugLevel()>1||n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||r.StorageAttributeCheck.isTypeLogical(n);return i=n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BLOB||n===r.StorageAttribute.BLOB_VECTOR?e.substr(4):e,t.getString(i,n,o)},t}(),at=function(t){function n(e,r,n,i,o,a){var s=t.call(this)||this;return s._cells=null,s._encoding=null,s._allowNull=!1,s._cellContentType=null,s._cellSize=0,s._cellsAttr=null,s._cellsDefaultVal=null,s._cellsIsNullDefault=!1,s._dataBuf=null,s._initialized=!1,s._nullBuf=null,s._originalflatData=null,6===arguments.length?s.constructor_0(e,r,n,i,o,a):1!==arguments.length||null!==e&&e.constructor!==String?s.constructor_2(e):s.constructor_1(e),s}return a(n,t),n.prototype.constructor_0=function(t,n,i,o,a,s){this._cells=new e.List,this._cellsAttr=t,this._cellContentType=n,this._cellsDefaultVal=i,this._cellsIsNullDefault=o,this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*s:s,this._initialized=!0,this._allowNull=a,this._nullBuf=new e.StringBuilder,this._dataBuf=new e.StringBuilder,this._originalflatData=this.toString(),this._encoding=x.Environment.GetEncoding()},n.prototype.constructor_1=function(t){this._cells=new e.List,this._initialized=!1,this._originalflatData=t,this._encoding=x.Environment.GetEncoding()},n.prototype.constructor_2=function(t){this._cells=new e.List,this._cellsAttr=t.getCellsType(),this._cellContentType=t.getVecCellsContentType(),this._cellsDefaultVal=t.getCellDefualtValue(),this._cellsIsNullDefault=t.isNullDefault(),this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*t.getVecCellsSize():t.getVecCellsSize(),this._initialized=!0,this._allowNull=t.NullAllowed,this._nullBuf=new e.StringBuilder,this._dataBuf=new e.StringBuilder,this._originalflatData=this.toString(),this._encoding=x.Environment.GetEncoding()},n.prototype.init=function(){var t=null,i=0,o=null,a=this.isUnicode(this._originalflatData),s=!1,_=K.blobPrefixLength(this._originalflatData);t=r.StrUtil.tokenize(this._originalflatData.substr(_),",");var l=0;if(!this._initialized){if(!n.validateBlobContents(this._originalflatData))throw new e.ApplicationException("in VectorType.init wrong vector format");var u=K.getPrefix(this._originalflatData);if(this._cellContentType=K.getContentType(u),_=_+4+5+1,_+=(o=t[++i]).length+1,_+=(o=t[++i]).length+1,o=t[++i],this._cellsAttr=o.charAt(0),_+=2,o=t[++i],this._cellSize=e.NNumber.Parse(o),_+=o.length+1,this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME)this._cellsDefaultVal=r.StrUtil.stringToHexaDump(this._originalflatData.substr(_,this._cellSize),2);else if(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.MEMO){if(r.UtilStrByteMode.isLocaleDefLangDBCS()?(s=!0,a=!0,this._cellsDefaultVal=r.UtilStrByteMode.leftB(this._originalflatData.substr(_),this._cellSize)):this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize),null!==this._encoding&&!a)try{var P=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(this._cellsDefaultVal);this._cellsDefaultVal=this._encoding.GetString(P,0,P.length)}catch(t){}}else if(this._cellsAttr===r.StorageAttribute.UNICODE){this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize);try{P=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(this._cellsDefaultVal);this._cellsDefaultVal=e.Encoding.Unicode.GetString(P,0,P.length)}catch(t){}}else this._cellsDefaultVal=this._originalflatData.substr(_,this._cellSize);_=s?_+this._cellsDefaultVal.length+1:_+this._cellSize+1,o=(t=r.StrUtil.tokenize(this._originalflatData.substr(_),","))[i=0],this._cellsIsNullDefault=$.toBoolean(o),_+=o.length+1,o=t[++i],this._allowNull=$.toBoolean(o),_+=o.length+1,_+=(o=t[++i]).length+1,o=t[++i],l=e.NNumber.Parse(o),_+=o.length+1,_+=(o=t[++i]).length+1,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(_+=(o=t[++i]).length+1);var c=void 0;s?_=_+(c=r.UtilStrByteMode.leftB(this._originalflatData.substr(_),l*this._cellSize)).length+1:(c=this._originalflatData.substr(_,l*this._cellSize),_=_+l*this._cellSize+1),this._dataBuf=new e.StringBuilder(c.length),this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO&&this._cellsAttr!==r.StorageAttribute.UNICODE&&this._dataBuf.Append(c);var T=this._originalflatData.substr(_,l);if(_=_+l+1,this._nullBuf=new e.StringBuilder(T),this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR)for(var h=0;h<l;h++){var E=T.charAt(h)>"\0";if(this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME)this._cells.push(new st(r.StrUtil.stringToHexaDump(c.substr(h*this._cellSize,this._cellSize),2),E));else if(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.MEMO){var p=void 0;if(p=s?r.UtilStrByteMode.midB(c,h*this._cellSize,this._cellSize):c.substr(h*this._cellSize,this._cellSize),null!==this._encoding&&!a)try{P=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(p);p=this._encoding.GetString(P,0,P.length)}catch(t){}this._dataBuf.Append(p),this._cells.push(new st(p,E))}else if(this._cellsAttr===r.StorageAttribute.UNICODE){p=c.substr(h*this._cellSize,this._cellSize);try{P=e.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(p);p=e.Encoding.Unicode.GetString(P,0,P.length)}catch(t){}this._dataBuf.Append(p),this._cells.push(new st(p,E))}else this._cells.push(new st(c.substr(h*this._cellSize,this._cellSize),E))}else for(h=0;h<l;h++){i=0,o=(t=r.StrUtil.tokenize(this._originalflatData.substr(_),","))[++i];var I=e.NNumber.Parse(o);_+=o.length+1;for(var f="",O=0;O<W.BLOB_PREFIX_ELEMENTS_COUNT;O++)f+=o=t[++i],_+=o.length+1,O!==W.BLOB_PREFIX_ELEMENTS_COUNT-1&&(f+=",");p=this._originalflatData.substr(_,I),E=T.charAt(h)>"\0";this._cells.push(new st(p,E,f)),_=_+I+1}0===this._dataBuf.Length&&(this._dataBuf=new e.StringBuilder(c.length)),this._initialized=!0}},n.prototype.toString=function(){var t="";if(this._initialized){if(t=t+0+",0,0,"+this._cellsAttr+","+this._cellContentType+";",t+=this.buildHeadersString(),this._cellsAttr===r.StorageAttribute.UNICODE){for(var i=new Array(2*this._dataBuf.Length),o=0;o<this._dataBuf.Length;o+=1)i[2*o]=String.fromCharCode(this._dataBuf.get_Item(o).charCodeAt(0)%256),i[2*o+1]=String.fromCharCode(this._dataBuf.get_Item(o).charCodeAt(0)/256);t=t+e.NString.FromChars(i)+","}else t=t+this._dataBuf+",";t=t+this._nullBuf+",",this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t+=this.getBlobsBuf()),t+=n.BLOB_TABLE_STR}else t=this._originalflatData;return t},n.prototype.getCellsAttr=function(){return this._initialized?this._cellsAttr:n.getCellsAttr(this._originalflatData)},n.prototype.getCellSize=function(){var t;return t=this._initialized?this._cellSize:n.getCellSize(this._originalflatData),this.getCellsAttr()===r.StorageAttribute.UNICODE&&(t=Math.floor(t/2)),t},n.prototype.getVecSize=function(){return this._initialized?this._cells.length:n.getVecSize(this._originalflatData)},n.prototype.getVecCell=function(t){var e=null;return t>0&&(this.init(),t<=this.getVecSize()?(e=this._cells.get_Item(t-1).data,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(e=this._cells.get_Item(t-1).blobFieldPrefix+";"+e),r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(e="\0"===e.charAt(0)?"0":"1"),this._cells.get_Item(t-1).isNull&&(e=null)):this._cellsIsNullDefault||(e=this._cellsDefaultVal)),e},n.prototype.GetCellValues=function(){var t=null,e=null;if(this.init(),this.getVecSize()>0){e=new Array(this.getVecSize());for(var n=0;n<this.getVecSize();n++)t=this._cells.get_Item(n).data,this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t=this._cells.get_Item(n).blobFieldPrefix+";"+t),r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(t="\0"===t.charAt(0)?"0":"1"),this._cells.get_Item(n).isNull&&(t=null),e[n]=t}else this._cellsIsNullDefault||(e=[this._cellsDefaultVal]);return e},n.prototype.setVecCell=function(t,i,o){var a=!1,s=!0;try{if(t>0){this.init();var _=this._cellsAttr===r.StorageAttribute.UNICODE?Math.floor(this._cellSize/2):this._cellSize;if(o&&!this._allowNull&&(o=!1,i=this._cellsDefaultVal),t<=this._cells.length){var l=this._cells.get_Item(t-1);if(o){l.data=null,this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?l.blobFieldPrefix=K.getEmptyBlobPrefix(""):l.blobFieldPrefix=K.getEmptyBlobPrefix("\0"),l.isNull=!0,this._nullBuf.set_Item(t-1,"");for(h=0;h<_;h++)this._dataBuf.set_Item((t-1)*_+h,"\0");this._nullBuf.set_Item(t-1,"")}else{if(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR){var u=K.blobPrefixLength(i);l.blobFieldPrefix=i.substr(0,u-1),i.length>u?l.data=i.substr(u):l.data=""}else{r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)?(l.data=$.toBoolean(i)?(new e.StringBuilder).Append(1).ToString():(new e.StringBuilder).Append("\0").ToString(),i=l.data):l.data=i;var P=i;if(this._cellsAttr!==r.StorageAttribute.NUMERIC&&this._cellsAttr!==r.StorageAttribute.DATE&&this._cellsAttr!==r.StorageAttribute.TIME||(P=ot.byteStreamToString(P)),!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO){for(h=0;h<P.length&&h<_;h++)this._dataBuf.set_Item((t-1)*_+h,P.charAt(h));for(h=P.length;h<_;h++)this._dataBuf.set_Item((t-1)*_+h,this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.UNICODE?" ":"\0");this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.UNICODE&&this._cellsAttr!==r.StorageAttribute.MEMO||(l.data=this._dataBuf.ToString().substr((t-1)*_,_))}else{for(var c=this._encoding.GetBytes(this._dataBuf.ToString()),T=this._encoding.GetBytes(P),h=0;h<T.length&&h<_;h++)c[(t-1)*_+h]=T[h];for(var h=T.length;h<_;h++)c[(t-1)*_+h]=this._cellsAttr===r.StorageAttribute.ALPHA?32:0;this._dataBuf=new e.StringBuilder(this._encoding.GetString(c,0,c.length)),l.data=this._encoding.GetString(c,(t-1)*_,_)}}this._nullBuf.set_Item(t-1,"\0"),l.isNull=!1}a=!0}else{var E=void 0;this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?(E=this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?K.getEmptyBlobPrefix(""):K.getEmptyBlobPrefix("\0"),this._cellsIsNullDefault||(E+=this._cellsDefaultVal)):E=this._cellsIsNullDefault?null:this._cellsDefaultVal,null!==E&&r.StorageAttributeCheck.isTypeLogical(this._cellsAttr)&&(E=$.toBoolean(E)?(new e.StringBuilder).Append("").ToString():(new e.StringBuilder).Append("\0").ToString());for(P=E;this._cells.length<t;){if(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR)this._cells.push(new st(E.substr(n.EMPTY_BLOB_PREFIX_LEN),this._cellsIsNullDefault,E.substr(0,n.EMPTY_BLOB_PREFIX_LEN))),this._dataBuf.Append(this.getNullString(n.BLOB_TYPE_STRUCT_SIZE));else if(this._cells.push(new st(E,this._cellsIsNullDefault)),null!==E){this._cellsAttr!==r.StorageAttribute.NUMERIC&&this._cellsAttr!==r.StorageAttribute.DATE&&this._cellsAttr!==r.StorageAttribute.TIME||s&&(s=!1,P=ot.byteStreamToString(E)),this._dataBuf.Append(P);for(h=!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO?P.length:r.UtilStrByteMode.lenB(P);h<_;h++)this._dataBuf.Append(this._cellsAttr===r.StorageAttribute.ALPHA||this._cellsAttr===r.StorageAttribute.UNICODE?" ":"\0")}else this._dataBuf.Append(this.getNullString(_));this._nullBuf.Insert(this._cells.length-1,this._cellsIsNullDefault?"":"\0")}a=this.setVecCell(t,i,o)}}}catch(t){a=!1}return a},n.prototype.adjustToFit=function(t){if(t.getType()===r.StorageAttribute.BLOB_VECTOR){var n=this.getCellsAttr(),i=t.getCellsType();if(r.StorageAttributeCheck.isTheSameType(n,i)){if(this.init(),r.StorageAttributeCheck.IsTypeAlphaOrUnicode(n)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(i)){var o=t.getVecCellsSize(),a=this._cellsAttr===r.StorageAttribute.UNICODE?Math.floor(this._cellSize/2):this._cellSize,s=r.UtilStrByteMode.isLocaleDefLangDBCS()&&r.StorageAttributeCheck.isTypeAlpha(i);if(a!==o){for(var _=new e.StringBuilder,l=0;l<o;l+=1){var u=this._cells.get_Item(l);if(u.isNull){for(P=new e.StringBuilder,c=0;c<o;c+=1)P.Append("\0");_.Append(P.ToString()),u.data=P.ToString()}else if(a>o)u.data=s?r.UtilStrByteMode.leftB(u.data,o):u.data.substr(0,o),_.Append(u.data);else{var P;(P=new e.StringBuilder).Append(u.data);for(var c=s?r.UtilStrByteMode.lenB(u.data):u.data.length;c<o;c+=1)P.Append(" ");_.Append(P.ToString()),u.data=P.ToString()}}this._dataBuf=_}}var T=t.getVecCellsSize();return this._cellsAttr=t.getCellsType(),this._cellSize=this._cellsAttr===r.StorageAttribute.UNICODE?2*T:T,this._cellsDefaultVal=t.getCellDefualtValue(),this._cellsIsNullDefault=t.isNullDefault(),this._allowNull=t.NullAllowed,void(this._originalflatData=this.toString())}throw new e.ApplicationException("in VectorType.adjustToFit vector basic types does not agree")}throw new e.ApplicationException("in VectorType.adjustToFit "+t.getName()+" is not of type vector")},n.prototype.buildHeadersString=function(){var t=n.BLOB_TABLE_STR+n.VECTOR_STR+","+n.VERSION+",1,"+this._cellsAttr+",";t=t+this._cellSize+",";var e="";return null!==this._cellsDefaultVal&&(e=this._cellsAttr===r.StorageAttribute.NUMERIC||this._cellsAttr===r.StorageAttribute.DATE||this._cellsAttr===r.StorageAttribute.TIME?ot.byteStreamToString(this._cellsDefaultVal):this._cellsDefaultVal),!r.UtilStrByteMode.isLocaleDefLangDBCS()||this._cellsAttr!==r.StorageAttribute.ALPHA&&this._cellsAttr!==r.StorageAttribute.MEMO?e+=this.getEmptyString(this._cellSize-e.length):e+=this.getEmptyString(this._cellSize-r.UtilStrByteMode.lenB(e)),t=(t=(t=t+e+","+(this._cellsIsNullDefault?"1":"0")+",")+(this._allowNull?"1":"0")+","+this._cellSize+","+this._cells.length+",")+(this._cellsAttr===r.StorageAttribute.BLOB||this._cellsAttr===r.StorageAttribute.BLOB_VECTOR?"1":"0")+",",this._cellsAttr!==r.StorageAttribute.BLOB&&this._cellsAttr!==r.StorageAttribute.BLOB_VECTOR||(t+="0,"),t},n.prototype.getNullString=function(t){for(var r=new e.StringBuilder,n=0;n<t;n+=1)r.Append("\0");return r.ToString()},n.prototype.getEmptyString=function(t){for(var r=new e.StringBuilder,n=0;n<t;n+=1)r.Append(" ");return r.ToString()},n.prototype.getBlobsBuf=function(){for(var t=new e.StringBuilder,r=0;r<this._cells.length;r+=1){var n="",i=0,o=this._cells.get_Item(r);null!==o.data&&(i=(n=o.data).length),t.Append(i),t.Append(","+o.blobFieldPrefix+","+n+";")}return t+","},n.getCellsAttr=function(t){if(n.validateBlobContents(t))return r.StrUtil.tokenize(t.substr(K.blobPrefixLength(t)),",")[3].charAt(0);throw new e.ApplicationException("in static getCellsAttr the blob is in the wrong format")},n.getCellSize=function(t){var i=n.getCellsAttr(t);if(i!==r.StorageAttribute.BLOB&&i!==r.StorageAttribute.BLOB_VECTOR){var o=r.StrUtil.tokenize(t.substr(K.blobPrefixLength(t)),",");return e.NNumber.Parse(o[4])}return 2147483647},n.getVecSize=function(t){if(n.validateBlobContents(t)){var i=K.blobPrefixLength(t),o=r.StrUtil.tokenize(t.substr(i),",");i+=o[0].length+1,i+=o[1].length+1,i+=o[2].length+1,i+=o[3].length+1;var a=o[4];return i+=a.length+1,i+=e.NNumber.Parse(a)+1,o=r.StrUtil.tokenize(t.substr(i),","),e.NNumber.Parse(o[3])}throw new e.ApplicationException("in static getVecSize the blob is in the wrong format")},n.prototype.isUnicode=function(t){var e=K.blobPrefixLength(t);return t.substr(e,n.BLOB_TABLE_STR_LEN)===n.BLOB_TABLE_STR},n}(it);at.VERSION=5,at.EMPTY_BLOB_PREFIX_LEN=7,at.BLOB_TYPE_STRUCT_SIZE=28;var st=function(){function t(t,e,r){this.blobFieldPrefix=null,this.data=null,this.isNull=!1,2===arguments.length&&this.constructor_0(t,e),this.constructor_1(t,e,r)}return t.prototype.constructor_0=function(t,e){this.data=t,this.isNull=e},t.prototype.constructor_1=function(t,e,r){this.data=t,this.isNull=e,this.blobFieldPrefix=r},t}(),_t=function(){function t(t){this.DefaultValue=null,this.NullAllowed=!1,this._nullDefault=!1,this._nullValue=null,this._nullDisplay=null,this._dbModifiable=!0,this._partOfDataview=!0,this._picture=null,this._size=0,this._varName=null,this._contentType=K.CONTENT_TYPE_UNKNOWN,this._vecCellsContentType=K.CONTENT_TYPE_UNKNOWN,this._vecCellsSize=0,this._vecCellsType=r.StorageAttribute.NONE,this._type=r.StorageAttribute.NONE,this.Storage=0,this.VarDisplayName=null,this._id=0,this._spaces=null,this._id=t,this.VarDisplayName=e.NString.Empty}return Object.defineProperty(t.prototype,"DbModifiable",{get:function(){return this._dbModifiable},set:function(t){this._dbModifiable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"PartOfDataview",{get:function(){return this._partOfDataview},enumerable:!1,configurable:!0}),t.prototype.getId=function(){return this._id},t.prototype.getType=function(){return this._type},t.getMagicDefaultNullDisplayValue=function(t){var e;switch(t){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:e=""}return e},t.getMagicDefaultValue=function(e){var n=null;switch(e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:n="";break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:n=K.getEmptyBlobPrefix("\0")+";";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.TIME:n="FF00000000000000000000000000000000000000";break;case r.StorageAttribute.DATE:n=t._default_date;break;case r.StorageAttribute.BOOLEAN:n="0"}return n},t.prototype.getDefaultValue=function(){return this._type!==r.StorageAttribute.BLOB_VECTOR?this._nullDefault&&null!==this._nullValue?this._nullValue:null!==this.DefaultValue?this.DefaultValue:this.getMagicDefaultValue():this.getMagicDefaultValue()},t.prototype.getCellDefualtValue=function(){var e;return this._type===r.StorageAttribute.BLOB_VECTOR?this._nullDefault&&null!==this._nullValue?e=this._nullValue:null!==this.DefaultValue?e=this.DefaultValue:(e=t.getMagicDefaultValue(this._vecCellsType),this._vecCellsType===r.StorageAttribute.BLOB&&(e=K.setContentType(e,this._vecCellsContentType))):e=this.getDefaultValue(),e},t.prototype.getMagicDefaultValue=function(){var e=t.getMagicDefaultValue(this._type);return this._type===r.StorageAttribute.BLOB?e=K.setContentType(e,this._contentType):this._type===r.StorageAttribute.BLOB_VECTOR&&(e=K.SetVecCellAttr(e,this._vecCellsType),this._vecCellsType===r.StorageAttribute.BLOB&&(e=K.setContentType(e,this._vecCellsContentType))),e},t.prototype.getContentType=function(){return this._contentType},t.prototype.hasNullDisplayValue=function(){return null!==this._nullDisplay},t.prototype.getSize=function(){return this._size},t.prototype.getVecCellsSize=function(){return this._type===r.StorageAttribute.BLOB_VECTOR?this._vecCellsSize:this._size},t.prototype.setLengths=function(t,n){var i=this._size;switch(t){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:n?(i=this._vecCellsSize,this._spaces=new Array(this._vecCellsSize)):this._spaces=new Array(this._size);for(var o=0;o<this._size;o+=1)this._spaces[o]=" ";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:i=2*x.Environment.GetSignificantNumSize();break;case r.StorageAttribute.BOOLEAN:i=n?4:1;break;case r.StorageAttribute.BLOB:i=n?at.BLOB_TYPE_STRUCT_SIZE:e.Int32.MaxValue;break;case r.StorageAttribute.BLOB_VECTOR:i=e.Int32.MaxValue,n?i=at.BLOB_TYPE_STRUCT_SIZE:this.setLengths(this._vecCellsType,!0)}n?this._vecCellsSize=i:this._size=i},t.prototype.getCellsType=function(){return this._type===r.StorageAttribute.BLOB_VECTOR?this._vecCellsType:this._type},t.prototype.getVecCellsContentType=function(){return this._vecCellsContentType},t.prototype.getNullValue=function(){return this._nullValue},t.prototype.isNullDefault=function(){return this._nullDefault},t.prototype.getNullDisplay=function(){var t;switch(this._type){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BOOLEAN:t="";break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=null}return t},t.prototype.IsContentUnicode=function(){return this._type!==r.StorageAttribute.BLOB||this._contentType===K.CONTENT_TYPE_UNICODE},t.prototype.GetPicture=function(){return this._picture},t.prototype.setAttribute=function(t,n){var i=!0;switch(t){case r.XMLConstants.MG_ATTR_TYPE:this._type=n.charAt(0);break;case r.XMLConstants.MG_ATTR_SIZE:this._size=r.XmlParser.getInt(n),this._size<=0&&E.WriteExceptionToLog("in Field.initElements(): size must be greater than zero");break;case r.XMLConstants.MG_ATTR_VAR_NAME:this._varName=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_VAR_DISP_NAME:this.VarDisplayName=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_PICTURE:this._picture=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_VEC_CELLS_SIZE:this._vecCellsSize=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_VEC_CELLS_ATTR:this._vecCellsType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_VEC_CELLS_CONTENT:this._vecCellsContentType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_NULLVALUE:this._type===r.StorageAttribute.NUMERIC||this._type===r.StorageAttribute.DATE||this._type===r.StorageAttribute.TIME?x.Environment.GetDebugLevel()>1?this._nullValue=r.XmlParser.unescape(n).toString():this._nullValue=r.Base64.decodeToHex(n):this._nullValue=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_NULLDISPLAY:this._nullDisplay=r.XmlParser.unescape(n).toString();break;case r.XMLConstants.MG_ATTR_NULLDEFAULT:this._nullDefault=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_DB_MODIFIABLE:this.DbModifiable=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_DEFAULTVALUE:this.DefaultValue=n,this._type===r.StorageAttribute.ALPHA||this._type===r.StorageAttribute.UNICODE?(this.DefaultValue=r.XmlParser.unescape(n).toString(),this.DefaultValue=r.StrUtil.padStr(this.DefaultValue,this._size)):this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BOOLEAN?(this._type!==r.StorageAttribute.BLOB_VECTOR||this._vecCellsType!==r.StorageAttribute.NUMERIC&&this._vecCellsType!==r.StorageAttribute.DATE&&this._vecCellsType!==r.StorageAttribute.TIME)&&this._type!==r.StorageAttribute.NUMERIC&&this._type!==r.StorageAttribute.DATE&&this._type!==r.StorageAttribute.TIME||x.Environment.GetDebugLevel()<1&&(this.DefaultValue=r.Base64.decodeToHex(n)):0===this.DefaultValue.length&&this._type!==r.StorageAttribute.BLOB?this.DefaultValue=null:this._type===r.StorageAttribute.BLOB&&(this.DefaultValue=K.createFromString(this.DefaultValue,this._contentType));break;case r.XMLConstants.MG_ATTR_NULLALLOWED:this.NullAllowed=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_BLOB_CONTENT:this._contentType=n.charAt(0);break;case r.XMLConstants.MG_ATTR_PART_OF_DATAVIEW:this._partOfDataview=$.toBoolean(n);break;case r.XMLConstants.MG_ATTR_STORAGE:this.Storage=r.XmlParser.getInt(n);break;default:i=!1}return i},t.prototype.fillData=function(t){var e=t.ReadToEndOfCurrentElement();e=e.substr(e.indexOf(r.XMLConstants.MG_TAG_FLDH)+r.XMLConstants.MG_TAG_FLDH.length);var n=r.XmlParser.getTokens(e,r.XMLConstants.XML_ATTR_DELIM);this.initElements(n)},t.prototype.initElements=function(t){for(var e=0;e<t.length;e+=2){var r=t.get_Item(e),n=t.get_Item(e+1);this.setAttribute(r,n)}this.SetAfterParsing()},t.prototype.SetAfterParsing=function(){this.setLengths(this._type,!1),this.NullAllowed&&null===this._nullDisplay&&(this._nullDisplay="")},t.prototype.getVarName=function(){return this._varName||""},t.prototype.getName=function(){return this.getVarName()},t}();_t._default_date=null;var lt=function(t){function r(e){var r=t.call(this,e)||this;return r.ControlToFocus=null,r._controls=null,r._dataview=null,r}return a(r,t),r.prototype.getTask=function(){return this._dataview.getTask()},r.prototype.updateDisplayWithValue=function(t,e){return s(this,void 0,void 0,(function(){var r,n,i,o,a,s,l;return _(this,(function(_){switch(_.label){case 0:if(r=null,n=null,i=W.DEFAULT_VALUE_INT.toString(),null===this._controls)return[3,6];o=null,a=!1,s=this.ControlToFocus,l=0,_.label=1;case 1:return l<this._controls.length?(r=this._controls.get_Item(l)).getForm().inRefreshDisplay()?[3,3]:(r.resetPrevVal(),[4,r.SetAndRefreshDisplayValue(t,e)]):[3,4];case 2:_.sent(),r.isRadio()||(null===n||null!==r.Value&&r.Value!==i&&r===s?n=r:(null===o&&(o=r),null!==r.Value&&r.Value!==i&&(a||(o=r,a=!0),r===s?n=r:null===n&&(n=o)))),_.label=3;case 3:return l+=1,[3,1];case 4:return null===n?[3,6]:(this.ControlToFocus=n,this._controls.length>1?(n.resetPrevVal(),[4,n.SetAndRefreshDisplayValue(t,e)]):[3,6]);case 5:_.sent(),_.label=6;case 6:return[2]}}))}))},r.prototype.SetControl=function(t){null===this._controls&&(this._controls=new e.List),this._controls.Contains(t)||(this._controls.push(t),1===this._controls.length&&(this.ControlToFocus=t))},r.prototype.RemoveControl=function(t){this._controls.Remove(t)},r.prototype.GetRadioCtrls=function(){var t=new e.List;if(null!==this._controls)for(var r=0;r<this._controls.length;r+=1){var n=this._controls[r];n.isRadio()&&t.push(n)}return t},r.prototype.toString=function(){return e.NString.Format("(Field {0}-{1}) in task {2}",this._id,this._varName,this.getTask())},r}(_t),ut=function(){function t(t,e,r,n){this.CtlIndex=0,this.ProgramIsn=0,this.TaskIsn=0,this.IsProgram=!1,4===arguments.length?this.constructor_0(t,e,r,n):this.constructor_1()}return t.prototype.constructor_0=function(t,e,r,n){this.CtlIndex=t,this.ProgramIsn=e,this.IsProgram=n,this.TaskIsn=n?0:r},t.prototype.constructor_1=function(){},t.prototype.IsMainProgram=function(){return this.IsProgram&&1===this.ProgramIsn},t.prototype.Equals=function(e){return null!==e&&e instanceof t&&this.GetHashCode()===e.GetHashCode()},t.prototype.GetHashCode=function(){var t=this.HashCodeString();return e.NString.GetHashCode(t)},t.prototype.HashCodeString=function(){return this.CtlIndex+"."+this.IsProgram+"."+this.ProgramIsn+"."+this.TaskIsn},t.prototype.toString=function(){return e.NString.Format("{{Task ID: {0} ctl {1}/prg {2}{3} (hash: {4})}}",[this.IsProgram?"Program":"Task",this.CtlIndex,this.ProgramIsn,this.IsProgram?"":e.NString.Format(" Task {0}",this.TaskIsn),this.HashCodeString()])},t.prototype.fromJSON=function(t){var e=JSON.parse(t);this.CtlIndex=e.CtlIndex,this.ProgramIsn=e.ProgramIsn,this.TaskIsn=e.TaskIsn,this.IsProgram=e.IsProgram},t}(),Pt=function(){function t(t){this._newTaskDefinitionIdHandler=null,this._newTaskDefinitionIdHandler=t}return t.prototype.parse=function(t){try{null!==t&&r.JSON_Utils.JSONFromXML(t,this.ParseJSON.bind(this))}catch(t){E.WriteExceptionToLog(t)}},t.prototype.ParseJSON=function(t,e){if(null!=t)throw t;var i=0,o=!1,a=0,s=0,_=e.taskDefinitionId.$;n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_CTL_IDX])||(i=+_[r.XMLConstants.MG_ATTR_CTL_IDX]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_PROGRAM_ISN])||(a=+_[r.XMLConstants.MG_ATTR_PROGRAM_ISN]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_TASK_ISN])||(s=+_[r.XMLConstants.MG_ATTR_TASK_ISN]),n.isNullOrUndefined(_[r.XMLConstants.MG_ATTR_ISPRG])||(o="1"===_[r.XMLConstants.MG_ATTR_ISPRG]);var l=new ut(i,a,s,o);this._newTaskDefinitionIdHandler(l)},t}(),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e}(V),Tt=function(){function n(){}return n.getNumericMgValue=function(t,e){var n=new z("3",r.StorageAttribute.NUMERIC,t.getCompIdx());return $.Instance.disp2mg(e,"",n,t.getCompIdx(),K.CONTENT_TYPE_UNKNOWN)},n.getDefaultValueForTask=function(e,r){var n=null;switch(r.value=!0,e){case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_PRELOAD_VIEW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:n="1";break;case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:n="0";break;default:r.value=!1}return n},n.getDefaultValue=function(i,o,a){var s=null,_=null;if(o===W.PARENT_TYPE_TASK){var l=new e.RefParam(!1);if(s=this.getDefaultValueForTask(i,l),l.value)return s}switch(i){case t.PropInterface.PROP_TYPE_COLOR:s=this.getNumericMgValue(a,"1"),o===W.PARENT_TYPE_CONTROL&&(_=a).Type===r.MgControlType.CTRL_TYPE_BUTTON&&_.IsImageButton()&&(s=this.getNumericMgValue(a,"0"));break;case t.PropInterface.PROP_TYPE_BORDER:if(s="0",o===W.PARENT_TYPE_CONTROL)switch((_=a).Type){case r.MgControlType.CTRL_TYPE_SUBFORM:s="0";break;case r.MgControlType.CTRL_TYPE_TEXT:case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_BROWSER:s="1"}break;case t.PropInterface.PROP_TYPE_MAXBOX:case t.PropInterface.PROP_TYPE_MINBOX:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_MULTILINE:case t.PropInterface.PROP_TYPE_PASSWORD:case t.PropInterface.PROP_TYPE_HEBREW:case t.PropInterface.PROP_TYPE_MULTILINE_VERTICAL_SCROLL:case t.PropInterface.PROP_TYPE_MULTILINE_ALLOW_CR:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_SHOW_FULL_ROW:case t.PropInterface.PROP_TYPE_TRACK_SELECTION:case t.PropInterface.PROP_TYPE_COLUMN_DIVIDER:case t.PropInterface.PROP_TYPE_LINE_DIVIDER:case t.PropInterface.PROP_TYPE_THREE_STATES:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_ROW_PLACEMENT:case t.PropInterface.PROP_TYPE_SHOW_IN_WINDOW_MENU:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_SORT_COLUMN:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_FILL_WIDTH:case t.PropInterface.PROP_TYPE_MULTI_COLUMN_DISPLAY:case t.PropInterface.PROP_TYPE_AUTO_COMPLETE_MODE_WC:s="0";break;case t.PropInterface.PROP_TYPE_SYSTEM_MENU:case t.PropInterface.PROP_TYPE_TITLE_BAR:case t.PropInterface.PROP_TYPE_ENABLED:case t.PropInterface.PROP_TYPE_VISIBLE:case t.PropInterface.PROP_TYPE_TAB_IN:case t.PropInterface.PROP_TYPE_MODIFIABLE:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_DISPLAY_MENU:case t.PropInterface.PROP_TYPE_DISPLAY_TOOLBAR:case t.PropInterface.PROP_TYPE_SHOW_BUTTONS:case t.PropInterface.PROP_TYPE_LINES_AT_ROOT:case t.PropInterface.PROP_TYPE_SCROLL_BAR:case t.PropInterface.PROP_TYPE_SHOW_LINES:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_RIGHT_BORDER:case t.PropInterface.PROP_TYPE_TOP_BORDER:case t.PropInterface.PROP_TYPE_TOP_BORDER_MARGIN:case t.PropInterface.PROP_TYPE_SHOW_ELLIPISIS:s="1";break;case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_PROMPT:case t.PropInterface.PROP_TYPE_DISPLAY_LIST:case t.PropInterface.PROP_TYPE_DATA:case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:case t.PropInterface.PROP_TYPE_LABEL:case t.PropInterface.PROP_TYPE_PLACEMENT:case t.PropInterface.PROP_TYPE_PULLDOWN_MENU:case t.PropInterface.PROP_TYPE_CONTEXT_MENU:case t.PropInterface.PROP_TYPE_NODE_ID:case t.PropInterface.PROP_TYPE_NODE_PARENTID:case t.PropInterface.PROP_TYPE_SELECT_PROGRAM:case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:case t.PropInterface.PROP_TYPE_EXPANDED_IMAGEIDX:case t.PropInterface.PROP_TYPE_COLLAPSED_IMAGEIDX:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:case t.PropInterface.PROP_TYPE_FORM_NAME:case t.PropInterface.PROP_TYPE_COLUMN_TITLE:case t.PropInterface.PROP_TYPE_WIDTH:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:break;case t.PropInterface.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL:case t.PropInterface.PROP_TYPE_BORDER_STYLE:s=this.getNumericMgValue(a,"2");break;case t.PropInterface.PROP_TYPE_WINDOW_TYPE:s=this.getNumericMgValue(a,"6");break;case t.PropInterface.PROP_TYPE_ROW_HIGHLIGHT_STYLE:s=this.getNumericMgValue(a,"4");break;case t.PropInterface.PROP_TYPE_GRADIENT_STYLE:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_STARTUP_MODE:case t.PropInterface.PROP_TYPE_CHOICE_COLUMNS:case t.PropInterface.PROP_TYPE_HORIZONTAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_FONT:case t.PropInterface.PROP_TYPE_WALLPAPER_STYLE:case t.PropInterface.PROP_TYPE_CHECKBOX_MAIN_STYLE:case t.PropInterface.PROP_TYPE_TAB_CONTROL_SIDE:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_UOM:case t.PropInterface.PROP_TYPE_BOTTOM_POSITION_INTERVAL:s=this.getNumericMgValue(a,"1");break;case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:s=r.TransMode.Physical;break;case t.PropInterface.PROP_TYPE_PARKED_COLLAPSED_IMAGEIDX:case t.PropInterface.PROP_TYPE_PARKED_IMAGEIDX:case t.PropInterface.PROP_TYPE_MINIMUM_HEIGHT:case t.PropInterface.PROP_TYPE_TOP:case t.PropInterface.PROP_TYPE_LEFT:case t.PropInterface.PROP_TYPE_TITLE_HEIGHT:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_VISIBLE_LINES:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_TRANSLATOR:case t.PropInterface.PROP_TYPE_HOR_FAC:case t.PropInterface.PROP_TYPE_VER_FAC:case t.PropInterface.PROP_TYPE_FOCUS_COLOR:s=this.getNumericMgValue(a,"0");break;case t.PropInterface.PROP_TYPE_STYLE_3D:if(o===W.PARENT_TYPE_CONTROL)switch((_=a).Type){case r.MgControlType.CTRL_TYPE_COMBO:s=this.getNumericMgValue(a,"2");break;case r.MgControlType.CTRL_TYPE_RADIO:case r.MgControlType.CTRL_TYPE_CHECKBOX:s=this.getNumericMgValue(a,"3")}break;case t.PropInterface.PROP_TYPE_IMAGE_LIST_INDEXES:case t.PropInterface.PROP_TYPE_WALLPAPER:case t.PropInterface.PROP_TYPE_TEXT:case t.PropInterface.PROP_TYPE_TOOLTIP:case t.PropInterface.PROP_TYPE_FORMAT:s=e.NString.Empty;break;case t.PropInterface.PROP_TYPE_IMAGE_STYLE:s=this.getNumericMgValue(a,"2");break;case t.PropInterface.PROP_TYPE_SELECTION_MODE:s=this.getNumericMgValue(a,String(r.ListboxSelectionMode.Single));break;case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:s=this.getNumericMgValue(a,"0");break;default:e.Debug.Assert(!1,"Undefined default value",e.NString.Format("No default value was defined for property {0} ({1}).",n.GetPropertyName(i),i))}return s},n.GetPropertyName=function(t){return"{Field ID "+t+"}"},n}(),ht=function(){},Et=function(){function t(t,e){this._valid=t,this._errorMessage=e}return t.prototype.isValid=function(){return this._valid},t.prototype.getErrMessage=function(){return this._errorMessage},t}(),pt=function(){function n(t,n,i,o){this._id=e.Int32.MinValue,this._dataType=r.StorageAttribute.NONE,this._val=null,this._pic=null,this._expId=0,this._parentObj=null,this._parentType=null,this._prevValues=null,this._orgValue=null,this._taskDefinitionId=null,this.StudioValue=null,this._expAlreadyComputedOnce=!1,this.customProperties=new Map,this.customPropertiesValues=new Map,this.customValidatorProperties=new Map,this.customValidatorValues=new Map,0===arguments.length?this.constructor_0():3===arguments.length?this.constructor_1(t,n,i):this.constructor_2(t,n,i,o)}return Object.defineProperty(n.prototype,"TaskDefinitionId",{get:function(){return this._taskDefinitionId},enumerable:!1,configurable:!0}),n.prototype.constructor_0=function(){this._prevValues=new e.List},n.prototype.constructor_1=function(t,e,r){this.constructor_0(),this.setId(t),this._parentObj=e,this._parentType=r,this.setDataType()},n.prototype.constructor_2=function(t,e,r,n){this.constructor_1(t,e,r),this.setValue(n),this.setOrgValue()},n.prototype.setId=function(t){this._id=t},n.prototype.fillData=function(t,n,i){var o=i.getXMLdata().indexOf(">",i.getCurrIndex());if(null===this._parentObj&&null!==t&&(this._parentObj=t,this._parentType=n),-1!==o&&o<i.getXMLdata().length){var a=i.getXMLsubstring(o);i.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_PROP)+r.XMLConstants.MG_TAG_PROP.length);var s=r.XmlParser.getTokens(i.getXMLsubstring(o),r.XMLConstants.XML_ATTR_DELIM);E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("In Prop.FillData(): {0}",s.toString())),this.initElements(s),i.setCurrIndex(o+r.XMLConstants.TAG_CLOSE.length),this.InitInnerObjects(i),this._parentType===W.PARENT_TYPE_CONTROL?this.setControlAttributes():this._parentType===W.PARENT_TYPE_FORM&&this._prevValues.SetSize(1)}else E.WriteExceptionToLog("In Property.FillData(): Out of string bounds")},n.prototype.InitInnerObjects=function(t){if(t.getNextTag()===r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY){var e=t.ReadToEndOfCurrentElement();this.InitTaskDefinitionId(e);var n=t.getXMLdata().indexOf(r.XMLConstants.MG_TAG_PROP+r.XMLConstants.TAG_CLOSE,t.getCurrIndex());t.setCurrIndex(n+(r.XMLConstants.MG_TAG_PROP+r.XMLConstants.TAG_CLOSE).length)}},n.prototype.initElements=function(n){for(var i=0;i<n.length;i+=2){var o=n.get_Item(i),a=n.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:this.setId(r.XmlParser.getInt(a)),this.setDataType();break;case r.XMLConstants.MG_ATTR_STUDIO_VALUE:this.StudioValue=r.XmlParser.unescape(a);break;case r.XMLConstants.MG_ATTR_VALUE:this._id===t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES&&this.InitCustomProperties(r.XmlParser.unescape(a)),this._id===t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS?this.InitCustomValidationProperties(r.XmlParser.unescape(a)):(this._val=r.XmlParser.unescape(a),this._orgValue=this._val);break;case r.XMLConstants.MG_ATTR_EXP:this._expId=r.XmlParser.getInt(a),this._expId>0&&this._id===t.PropInterface.PROP_TYPE_TOOLTIP&&this.setDataType();break;case r.XMLConstants.MG_ATTR_NAME:break;case r.XMLConstants.MG_ATTR_CTL_IDX:this._taskDefinitionId.CtlIndex=r.XmlParser.getInt(a);break;case r.XMLConstants.MG_ATTR_PROGRAM_ISN:this._taskDefinitionId.ProgramIsn=r.XmlParser.getInt(a);break;default:E.WriteExceptionToLog(e.NString.Format("There is no such tag in Property class. Insert case to Property.initElements for {0}",o))}this.IsComputedOnceOnServer()&&(this._expAlreadyComputedOnce=!0)}},n.prototype.InitCustomProperties=function(t){this.customProperties=new Map(JSON.parse(t)),this._parentObj.IsFirstRefreshOfProps()&&this.SetFirstValueForCustomProperties()},n.prototype.InitCustomValidator=function(t){var e=t.ReadToEndOfCurrentElement();e=e.substr(e.indexOf(r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR)+r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR.length);for(var n,i=r.XmlParser.getTokens(e,r.XMLConstants.XML_ATTR_DELIM),o=new ht,a=0;a<i.length;a+=2){var s=i.get_Item(a),_=i.get_Item(a+1);switch(s){case r.XMLConstants.MG_ATTR_EXP:o._exp=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_NAME:n=r.XmlParser.unescape(_);break;case r.XMLConstants.MG_ATTR_ERROR_EXP:o._errorMessageExp=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_ERROR:o._errorMessage=r.XmlParser.unescape(_)}}this.customValidatorProperties.set(n,o)},n.prototype.InitCustomValidationProperties=function(t){for(var e=new r.XmlParser(t),n=e.getNextTag();null!=n;){switch(n){case r.XMLConstants.MG_TAG_CUSTOM_VALIDATORS:e.setCurrIndex2EndOfTag(),this.customValidatorProperties=new Map;break;case r.XMLConstants.MG_TAG_CUSTOM_VALIDATOR:this.InitCustomValidator(e);break;default:e.setCurrIndex2EndOfTag()}n=e.getNextTag()}this._parentObj.IsFirstRefreshOfProps()&&this.SetFirstValueForCustomValidationProperties()},n.prototype.SetFirstValueForCustomValidationProperties=function(){var t,e;try{for(var r=l(this.customValidatorProperties.keys()),n=r.next();!n.done;n=r.next()){var i=n.value;this.customValidatorProperties.get(i);this.customValidatorValues.set(i,new Et(!0,""))}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this._val=this.GetArrayValuesForCustomValidationProperties(),this._orgValue=this._val},n.prototype.GetArrayValuesForCustomValidationProperties=function(){var t=Array.from(this.customValidatorValues.values());return JSON.stringify(t)},n.prototype.GetArrayValuesForCustomProperties=function(){var t=Array.from(this.customPropertiesValues.values());return JSON.stringify(t)},n.prototype.SetFirstValueForCustomProperties=function(){var t,e;try{for(var r=l(this.customProperties.keys()),n=r.next();!n.done;n=r.next()){var i=n.value;this.customPropertiesValues.set(i,"")}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this._val=this.GetArrayValuesForCustomProperties(),this._orgValue=this._val},n.prototype.ResetComputedOnceFlag=function(){this._expAlreadyComputedOnce=!1},n.prototype.InitTaskDefinitionId=function(t){new Pt(this.SetTaskDefinitionId).parse(t)},n.prototype.SetTaskDefinitionId=function(t){this._taskDefinitionId=t},n.prototype.setDataType=function(){var i=this._parentObj.getCompIdx();if(this._pic=null,this._id!==e.Int32.MinValue)switch(this._id){case t.PropInterface.PROP_TYPE_TITLE_BAR:case t.PropInterface.PROP_TYPE_DISPLAY_MENU:case t.PropInterface.PROP_TYPE_BORDER:case t.PropInterface.PROP_TYPE_HEBREW:case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_SYSTEM_MENU:case t.PropInterface.PROP_TYPE_END_CONDITION:case t.PropInterface.PROP_TYPE_SELECTION:case t.PropInterface.PROP_TYPE_ALLOW_MODIFY:case t.PropInterface.PROP_TYPE_ALLOW_CREATE:case t.PropInterface.PROP_TYPE_ALLOW_DELETE:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_CONFIRM_UPDATE:case t.PropInterface.PROP_TYPE_FORCE_SUFFIX:case t.PropInterface.PROP_TYPE_FORCE_DELETE:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_MODIFIABLE:case t.PropInterface.PROP_TYPE_VISIBLE:case t.PropInterface.PROP_TYPE_ENABLED:case t.PropInterface.PROP_TYPE_CONFIRM_CANCEL:case t.PropInterface.PROP_TYPE_REPEATABLE:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_PASSWORD:case t.PropInterface.PROP_TYPE_MULTILINE:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_PRELOAD_VIEW:case t.PropInterface.PROP_TYPE_MULTILINE_VERTICAL_SCROLL:case t.PropInterface.PROP_TYPE_MULTILINE_ALLOW_CR:case t.PropInterface.PROP_TYPE_ALLOW_COL_RESIZE:case t.PropInterface.PROP_TYPE_ALLOW_REORDER:case t.PropInterface.PROP_TYPE_SHOW_LINES:case t.PropInterface.PROP_TYPE_SORT_COLUMN:case t.PropInterface.PROP_TYPE_COL_ALLOW_FILTERING:case t.PropInterface.PROP_TYPE_DISPLAY_STATUS_BAR:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_SHOW_FULL_ROW:case t.PropInterface.PROP_TYPE_TRACK_SELECTION:case t.PropInterface.PROP_TYPE_SHOW_BUTTONS:case t.PropInterface.PROP_TYPE_LINES_AT_ROOT:case t.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW:case t.PropInterface.PROP_TYPE_SCROLL_BAR:case t.PropInterface.PROP_TYPE_COLUMN_DIVIDER:case t.PropInterface.PROP_TYPE_LINE_DIVIDER:case t.PropInterface.PROP_TYPE_THREE_STATES:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_ALLOW_OPTION:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_FILL_WIDTH:case t.PropInterface.PROP_TYPE_MULTI_COLUMN_DISPLAY:case t.PropInterface.PROP_TYPE_IS_ROUTER_OUTLET:case t.PropInterface.PROP_TYPE_DEFAULT_OUTLET:case t.PropInterface.PROP_TYPE_SERVER_READ_AHEAD:case t.PropInterface.PROP_TYPE_AUTO_COMPLETE_MODE_WC:this._dataType=r.StorageAttribute.BOOLEAN;break;case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:case t.PropInterface.PROP_TYPE_EVAL_END_CONDITION:case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_NAME:case t.PropInterface.PROP_TYPE_TRASACTION_BEGIN:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:case t.PropInterface.PROP_TYPE_WALLPAPER:case t.PropInterface.PROP_TYPE_ATTRIBUTE:case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_SELECT_MODE:case t.PropInterface.PROP_TYPE_TASK_ID:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_PARAMETERS:case t.PropInterface.PROP_TYPE_IMAGE_LIST_INDEXES:case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_REAL_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL_FIELDS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE:case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:this._dataType=r.StorageAttribute.ALPHA;break;case t.PropInterface.PROP_TYPE_COLUMN_TITLE:case t.PropInterface.PROP_TYPE_DISPLAY_LIST:case t.PropInterface.PROP_TYPE_LABEL:case t.PropInterface.PROP_TYPE_FORMAT:case t.PropInterface.PROP_TYPE_RANGE:case t.PropInterface.PROP_TYPE_FORM_NAME:case t.PropInterface.PROP_TYPE_ADDITIONAL_INFORMATION:case t.PropInterface.PROP_TYPE_TEXT:case t.PropInterface.PROP_TYPE_HINT:this._dataType=r.StorageAttribute.UNICODE;break;case t.PropInterface.PROP_TYPE_UOM:case t.PropInterface.PROP_TYPE_HOR_FAC:case t.PropInterface.PROP_TYPE_VER_FAC:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_WALLPAPER_STYLE:case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_PULLDOWN_MENU:case t.PropInterface.PROP_TYPE_WINDOW_TYPE:case t.PropInterface.PROP_TYPE_IMAGE_STYLE:case t.PropInterface.PROP_TYPE_AUTO_FIT:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_EXPAND_WINDOW:case t.PropInterface.PROP_TYPE_VISIBLE_LINES:case t.PropInterface.PROP_TYPE_CHOICE_COLUMNS:case t.PropInterface.PROP_TYPE_STYLE_3D:case t.PropInterface.PROP_TYPE_FONT:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_WIDTH:case t.PropInterface.PROP_TYPE_TITLE_HEIGHT:case t.PropInterface.PROP_TYPE_COLOR:case t.PropInterface.PROP_TYPE_LEFT:case t.PropInterface.PROP_TYPE_TOP:case t.PropInterface.PROP_TYPE_TOOLTIP:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_LINES_IN_TABLE:case t.PropInterface.PROP_TYPE_SELECTION_ROWS:case t.PropInterface.PROP_TYPE_HORIZONTAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_MULTILINE_WORDWRAP_SCROLL:case t.PropInterface.PROP_TYPE_ROW_HEIGHT:case t.PropInterface.PROP_TYPE_WINDOW_WIDTH:case t.PropInterface.PROP_TYPE_MAIN_DISPLAY:case t.PropInterface.PROP_TYPE_TRANSLATOR:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_FRAME_TYPE:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_ROW_HIGHLIGHT_STYLE:case t.PropInterface.PROP_TYPE_VERTICAL_ALIGNMENT:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_STATIC_TYPE:case t.PropInterface.PROP_TYPE_BUTTON_STYLE:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_BOTTOM_POSITION_INTERVAL:case t.PropInterface.PROP_TYPE_SELECTION_MODE:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:case t.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB:case t.PropInterface.PROP_TYPE_BINDING_LEVEL:case t.PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL:case t.PropInterface.PROP_TYPE_SELECT_PROGRAM:this._id===t.PropInterface.PROP_TYPE_TOOLTIP&&this._expId>0?this._dataType=r.StorageAttribute.UNICODE:(this._dataType=r.StorageAttribute.NUMERIC,null==n._numericPropertyPic&&(n._numericPropertyPic=new z("N6",r.StorageAttribute.NUMERIC,i)),this._pic=n._numericPropertyPic);break;case t.PropInterface.PROP_TYPE_RETURN_ACTION:this._dataType=r.StorageAttribute.NONE;break;case t.PropInterface.PROP_TYPE_DATA:this._dataType=this._parentObj.DataType;break;case t.PropInterface.PROP_TYPE_POP_UP:case t.PropInterface.PROP_TYPE_ORIENTATION_LOCK:case t.PropInterface.PROP_TYPE_ENTER_ANIMATION:case t.PropInterface.PROP_TYPE_EXIT_ANIMATION:case t.PropInterface.PROP_TYPE_NAVIGATION_DRAWER_MENU:case t.PropInterface.PROP_TYPE_ACTION_BAR_MENU:case t.PropInterface.PROP_TYPE_OPEN_PICKER:case t.PropInterface.PROP_TYPE_OPEN_EDIT_DIALOG:case t.PropInterface.PROP_TYPE_DEFAULT_ALIGNMENT:case t.PropInterface.PROP_TYPE_KEYBOARD_TYPE:case t.PropInterface.PROP_TYPE_KEYBOARD_RETURN_KEY:case t.PropInterface.PROP_TYPE_ALLOW_SUGGESTIONS:case t.PropInterface.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME:case t.PropInterface.PROP_TYPE_SWIPE_REFRESH:break;default:E.WriteExceptionToLog(e.NString.Format("in Property.setDataType() no case for: {0}",this._id))}else E.WriteExceptionToLog(e.NString.Format("To fill dataType member in Property.FillDataType must id!={0}",e.Int32.MinValue))},n.prototype.setControlAttributes=function(){if(null!=this._parentObj&&this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_NAME:e.Name=this._val;break;case t.PropInterface.PROP_TYPE_ATTRIBUTE:e.DataType=this._val[0];break;case t.PropInterface.PROP_TYPE_FORMAT:e.setPicStr(this._val,this._expId);break;case t.PropInterface.PROP_TYPE_RANGE:e.setRange(this._val);break;case t.PropInterface.PROP_TYPE_DATA:this._expId>0?e.setValExp(this._expId):null!=this._val&&e.setField(this._val);break;case t.PropInterface.PROP_TYPE_BUTTON_STYLE:null!=this._val&&(e.ButtonStyle=this.GetComputedValueInteger());break;case t.PropInterface.PROP_TYPE_LAYER:null!=this._val&&(e.Layer=this.GetComputedValueInteger())}}else E.WriteExceptionToLog("in Property.setControlAttributes() there is no parent or the parent is not a control")},n.prototype.getParentObj=function(){return this._parentObj},n.prototype.getParentType=function(){return this._parentType},n.prototype.getID=function(){return this._id},n.prototype.setValue=function(n){var i=this._parentObj.getCompIdx();if(this._id!==t.PropInterface.PROP_TYPE_DATA&&this._id!==t.PropInterface.PROP_TYPE_NODE_ID&&this._id!==t.PropInterface.PROP_TYPE_NODE_PARENTID)switch(this._dataType===r.StorageAttribute.NONE&&this.setDataType(),this._dataType){case r.StorageAttribute.NUMERIC:null==n&&(n="FF00000000000000000000000000000000000000"),this._val=$.Instance.mg2disp(n,"",this._pic,!1,i,!1).trim();break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.UNICODE:this._val=n;break;default:throw new e.ApplicationException("in Property.setValue() illegal data type: "+this._dataType)}},n.prototype.SetValue=function(t){this._val=String(t)},n.prototype.setOrgValue=function(){this._orgValue=this._val},n.prototype.SetStudioValueAsOrgValue=function(){this._orgValue=this.StudioValue},n.prototype.getForm=function(){var t=null;return this._parentType===W.PARENT_TYPE_FORM?t=this._parentObj:this._parentType===W.PARENT_TYPE_CONTROL&&(t=this._parentObj.getForm()),t},n.prototype.GetTaskByParentObject=function(){var t=null;return this._parentType===W.PARENT_TYPE_FORM?t=this._parentObj.getTask():this._parentType===W.PARENT_TYPE_CONTROL?t=this._parentObj.getForm().getTask():this._parentType===W.PARENT_TYPE_TASK&&(t=this._parentObj),t},n.prototype.RefreshDisplay=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.RefreshDisplayWithCurrentLine(t,e.Int32.MinValue)];case 1:return r.sent(),[2]}}))}))},n.prototype.ShouldSkipRefreshControl=function(){var e=!1,r=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_HEBREW:r.isTableControl()&&(e=!0);break;case t.PropInterface.PROP_TYPE_NODE_ID:case t.PropInterface.PROP_TYPE_NODE_PARENTID:case t.PropInterface.PROP_TYPE_DATA:case t.PropInterface.PROP_TYPE_HIGHLIGHTING:case t.PropInterface.PROP_TYPE_MUST_INPUT:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_SELECT_PROGRAM:case t.PropInterface.PROP_TYPE_SELECT_MODE:case t.PropInterface.PROP_TYPE_ALLOWED_DIRECTION:case t.PropInterface.PROP_TYPE_RETURN_ACTION:case t.PropInterface.PROP_TYPE_ATTRIBUTE:case t.PropInterface.PROP_TYPE_REPEATABLE:case t.PropInterface.PROP_TYPE_FRAME_NAME:case t.PropInterface.PROP_TYPE_TRIGGER:case t.PropInterface.PROP_TYPE_TAB_ORDER:case t.PropInterface.PROP_TYPE_IS_CACHED:case t.PropInterface.PROP_TYPE_LAYER:case t.PropInterface.PROP_TYPE_AUTO_FIT:case t.PropInterface.PROP_TYPE_RAISE_AT:case t.PropInterface.PROP_TYPE_FRAMESET_STYLE:case t.PropInterface.PROP_TYPE_FRAME_TYPE:case t.PropInterface.PROP_TYPE_RANGE:case t.PropInterface.PROP_TYPE_WINDOW_WIDTH:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_AUTO_REFRESH:case t.PropInterface.PROP_TYPE_PARAMETERS:case t.PropInterface.PROP_TYPE_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_RETAIN_FOCUS:case t.PropInterface.PROP_TYPE_SUBFORM_TYPE:case t.PropInterface.PROP_TYPE_REAL_OBJECT_TYPE:case t.PropInterface.PROP_TYPE_ADDITIONAL_INFORMATION:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL:case t.PropInterface.PROP_TYPE_DATAVIEWCONTROL_FIELDS:case t.PropInterface.PROP_TYPE_PRGTSK_NUM:case t.PropInterface.PROP_TYPE_INDEX:case t.PropInterface.PROP_TYPE_DISPLAY_FIELD:case t.PropInterface.PROP_TYPE_LINK_FIELD:case t.PropInterface.PROP_TYPE_BEFORE_900_VERSION:case t.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN:case t.PropInterface.PROP_TYPE_SERVER_READ_AHEAD:e=!0;break;case t.PropInterface.PROP_TYPE_BUTTON_STYLE:this._parentObj.isRadio()||(e=!0)}return e},n.prototype.ShouldSkipRefreshForm=function(){e.Debug.Assert(this._parentType===W.PARENT_TYPE_FORM);var r=!1,n=this._parentObj;switch(this._id){case t.PropInterface.PROP_TYPE_WINDOW_TYPE:this._parentObj.IsFirstRefreshOfProps()||(r=!0);break;case t.PropInterface.PROP_TYPE_LINES_IN_TABLE:case t.PropInterface.PROP_TYPE_HELP_SCR:case t.PropInterface.PROP_TYPE_TABBING_ORDER:case t.PropInterface.PROP_TYPE_PERSISTENT_FORM_STATE_VERSION:r=!0}if(!r&&n.isSubForm())switch(r=!0,this._id){case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:r=!1}return r},n.prototype.ShouldSkipRefreshTask=function(){var e=!1;switch(this._id){case t.PropInterface.PROP_TYPE_ALLOW_CREATE:case t.PropInterface.PROP_TYPE_ALLOW_DELETE:case t.PropInterface.PROP_TYPE_ALLOW_MODIFY:case t.PropInterface.PROP_TYPE_ALLOW_QUERY:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_CONFIRM_CANCEL:case t.PropInterface.PROP_TYPE_CONFIRM_UPDATE:case t.PropInterface.PROP_TYPE_END_CONDITION:case t.PropInterface.PROP_TYPE_EVAL_END_CONDITION:case t.PropInterface.PROP_TYPE_FORCE_SUFFIX:case t.PropInterface.PROP_TYPE_FORCE_DELETE:case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_SELECTION:case t.PropInterface.PROP_TYPE_TRASACTION_BEGIN:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_TRANSACTION_MODE:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_CLOSE_TASKS_BY_MDI_MENU:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_CHUNK_SIZE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_INDEX_OPTIMIZATION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_RANGE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_LOCATE_ORDER:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_POSITION_USAGE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_SQL_RANGE:e=!0}return e},n.prototype.ShouldSkipRefresh=function(){var e=!1;switch(this._parentType){case W.PARENT_TYPE_CONTROL:e=this.ShouldSkipRefreshControl();break;case W.PARENT_TYPE_FORM:e=this.ShouldSkipRefreshForm();break;case W.PARENT_TYPE_TASK:e=this.ShouldSkipRefreshTask()}switch(this._id){case t.PropInterface.PROP_TYPE_POP_UP:case t.PropInterface.PROP_TYPE_ORIENTATION_LOCK:case t.PropInterface.PROP_TYPE_ENTER_ANIMATION:case t.PropInterface.PROP_TYPE_EXIT_ANIMATION:case t.PropInterface.PROP_TYPE_NAVIGATION_DRAWER_MENU:case t.PropInterface.PROP_TYPE_ACTION_BAR_MENU:case t.PropInterface.PROP_TYPE_OPEN_PICKER:case t.PropInterface.PROP_TYPE_OPEN_EDIT_DIALOG:case t.PropInterface.PROP_TYPE_DEFAULT_ALIGNMENT:case t.PropInterface.PROP_TYPE_KEYBOARD_TYPE:case t.PropInterface.PROP_TYPE_KEYBOARD_RETURN_KEY:case t.PropInterface.PROP_TYPE_ALLOW_SUGGESTIONS:case t.PropInterface.PROP_TYPE_MOBILE_IMAGE_LIST_FILE_NAME:e=!0}return e},n.prototype.RefreshDisplayWithCurrentLine=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,this.RefreshDisplayWithCurrLineAndCheckSkipRefresh(t,e,!0)];case 1:return r.sent(),[2]}}))}))},n.prototype.SkipWhenNoExpression=function(){var e=!0,r=this._parentObj instanceof ct?this._parentObj:null;return(null!=r&&r.isButton()&&this._id===t.PropInterface.PROP_TYPE_FORMAT||null!=r&&r.isComboBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isListBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isRadio()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isCheckBox()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isTabControl()&&this._id===t.PropInterface.PROP_TYPE_LABEL||null!=r&&r.isImageControl()&&this._id===t.PropInterface.PROP_TYPE_IMAGE_FILENAME||null!=r&&r.IsImageButton()&&this._id===t.PropInterface.PROP_TYPE_IMAGE_FILENAME||null!=r&&r.isColumnControl()&&this._id===t.PropInterface.PROP_TYPE_COLUMN_TITLE||this._id===t.PropInterface.PROP_TYPE_DISPLAY_LIST||this._id===t.PropInterface.PROP_TYPE_TEXT||this._id===t.PropInterface.PROP_TYPE_TOOLTIP||this._id===t.PropInterface.PROP_TYPE_HINT||this._id===t.PropInterface.PROP_TYPE_PASSWORD||this._id===t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES||this._id===t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS||this._id===t.PropInterface.PROP_TYPE_VISIBLE||this._id===t.PropInterface.PROP_TYPE_ENABLED||this._id===t.PropInterface.PROP_TYPE_BINDING_LEVEL)&&(e=!1),e},n.prototype.RefreshDisplayWithCurrLineAndCheckSkipRefresh=function(n,i,o){return s(this,void 0,void 0,(function(){var a,s,l,u;return _(this,(function(_){switch(_.label){case 0:return a=null,s=0,u=!0,null===this._val&&0===this._expId?(E.WriteExceptionToLog("in Property.RefreshDisplay() null value and expression"),[2]):o&&this.ShouldSkipRefresh()||0===this._expId&&this.SkipWhenNoExpression()?[2]:(0===this._prevValues.length&&this.setPrevArraySize(),[4,this.ComputeValue()]);case 1:switch(_.sent(),this._parentType){case W.PARENT_TYPE_CONTROL:if(a=this._parentObj,this._id===t.PropInterface.PROP_TYPE_FORMAT&&this._expId>0&&a.computePIC(this._val),a.IsRepeatable&&!a.getForm().isRefreshRepeatableAllowed())return[2];if(s=i===e.Int32.MinValue?this.getLine():i,l=this._prevValues.get_Item(s),!n&&this._val===l&&this._id!==t.PropInterface.PROP_TYPE_MODIFIABLE&&this._id!==t.PropInterface.PROP_TYPE_VISIBLE&&this._id!==t.PropInterface.PROP_TYPE_ENABLED)return[2];if(a.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._id===t.PropInterface.PROP_TYPE_VISIBLE&&this._val===l)return[2];this._val===l&&(u=!1),this._prevValues.set_Item(s,this._val);break;case W.PARENT_TYPE_FORM:if(l=this._prevValues.get_Item(0),!n&&this._val===l)return[2];this._prevValues.set_Item(0,this._val);break;case W.PARENT_TYPE_TASK:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): task property {0} wasn't handled",this._id)),[2];default:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): parentType unknown, property {0} wasn't handled",this._id)),[2]}switch(this._id){case t.PropInterface.PROP_TYPE_IMAGE_FILENAME:return[3,2];case t.PropInterface.PROP_TYPE_ENABLED:return[3,3];case t.PropInterface.PROP_TYPE_VISIBLE:return[3,4];case t.PropInterface.PROP_TYPE_NAME:return[3,6];case t.PropInterface.PROP_TYPE_FORM_NAME:return[3,7];case t.PropInterface.PROP_TYPE_COLUMN_TITLE:return[3,8];case t.PropInterface.PROP_TYPE_TEXT:return[3,9];case t.PropInterface.PROP_TYPE_HINT:return[3,10];case t.PropInterface.PROP_TYPE_MODIFIABLE:return[3,11];case t.PropInterface.PROP_TYPE_TOOLTIP:return[3,13];case t.PropInterface.PROP_TYPE_DISPLAY_LIST:return[3,14];case t.PropInterface.PROP_TYPE_AUTO_COMPLETE_MODE_WC:return[3,16];case t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST:return[3,17];case t.PropInterface.PROP_TYPE_FORMAT:return[3,19];case t.PropInterface.PROP_TYPE_LABEL:return[3,20];case t.PropInterface.PROP_TYPE_PASSWORD:return[3,22];case t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY:case t.PropInterface.PROP_TYPE_TAB_IN:case t.PropInterface.PROP_TYPE_PARK_ON_CLICK:case t.PropInterface.PROP_TYPE_LOAD_IMAGE_FROM:return[3,23];case t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES:return[3,24];case t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS:return[3,25];case t.PropInterface.PROP_TYPE_BINDING_LEVEL:return[3,26]}return[3,27];case 2:return this.onImageFileName(),[3,28];case 3:return this.onEnable(u),[3,28];case 4:return[4,this.onVisible(u)];case 5:case 12:case 15:case 18:case 21:return _.sent(),[3,28];case 6:return this.OnControlName(),[3,28];case 7:return this.onFormName(),[3,28];case 8:return this.onText(0),[3,28];case 9:return this.onText(s),[3,28];case 10:return this.onHint(),[3,28];case 11:return[4,this.onModifiable(u)];case 13:return this.onTooltip(),[3,28];case 14:return[4,this.onDisplayList(s)];case 16:return this.onAutoCompleteMode(),[3,28];case 17:return[4,this.onVisibleLayerList(s)];case 19:return this.onFormat(),[3,28];case 20:return[4,this.onLabel(s)];case 22:return this.onPassword(),[3,28];case 23:return[3,28];case 24:return this.onCustomProperties(),[3,28];case 25:return this.onCustomValidators(),[3,28];case 26:return this.onBindingLevel(),[3,28];case 27:return E.WriteExceptionToLog(e.NString.Format("Property.RefreshDisplay(): Property {0} wasn't handled",this._id)),[3,28];case 28:return[2]}}))}))},n.prototype.ShouldBeComputedOnce=function(){if(this._parentType===W.PARENT_TYPE_TASK)switch(this._id){case t.PropInterface.PROP_TYPE_TASK_MODE:case t.PropInterface.PROP_TYPE_PRELOAD_VIEW:case t.PropInterface.PROP_TYPE_TABBING_CYCLE:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY:case t.PropInterface.PROP_TYPE_PRINT_DATA:case t.PropInterface.PROP_TYPE_ALLOW_RANGE:case t.PropInterface.PROP_TYPE_ALLOW_LOCATE:case t.PropInterface.PROP_TYPE_ALLOW_SORT:case t.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX:case t.PropInterface.PROP_TYPE_MAIN_DISPLAY:return!0}else if(this._parentType===W.PARENT_TYPE_CONTROL&&(this._id===t.PropInterface.PROP_TYPE_IS_CACHED||this._id===t.PropInterface.PROP_TYPE_MULTILINE))return!0;return!1},n.prototype.IsComputedOnceOnServer=function(){if(this.ShouldBeComputedOnce()){var t=this.GetTaskByParentObject();if(null!=t)return!t.ShouldEvaluatePropertyLocally(this._id)}return!1},n.prototype.ComputeValue=function(){return s(this,void 0,void 0,(function(){var n,i,o,a,s,l,u,P;return _(this,(function(_){switch(_.label){case 0:return n=null,i=255,o=new e.RefParam(!1),this._id!==t.PropInterface.PROP_TYPE_CUSTOM_PROPERTIES?[3,2]:[4,this.computeCustomPropertiesValues()];case 1:_.sent(),n=this.GetArrayValuesForCustomProperties(),this.setValue(n),_.label=2;case 2:return this._id!==t.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS?[3,4]:[4,this.computeCustomValidators()];case 3:return _.sent(),n=this.GetArrayValuesForCustomValidationProperties(),this.setValue(n),[3,10];case 4:return this._expId>0?this.ShouldBeComputedOnce()&&this._expAlreadyComputedOnce?[2]:(this._expAlreadyComputedOnce=!0,a=!1,this._parentType===W.PARENT_TYPE_TASK&&(a=!0),this._id!==t.PropInterface.PROP_TYPE_FORMAT?[3,6]:(i=65535,l=(s=r.StrUtil).rtrim,[4,this._parentObj.EvaluateExpression(this._expId,this._dataType,i,!0,r.StorageAttribute.SKIP,a,o)])):[3,10];case 5:return n=l.apply(s,[_.sent()]),[3,9];case 6:return _.trys.push([6,8,,9]),[4,this._parentObj.EvaluateExpression(this._expId,this._dataType,i,!0,r.StorageAttribute.SKIP,a,o)];case 7:return n=_.sent(),[3,9];case 8:return u=_.sent(),P=new e.StringBuilder("Exception: "+u.Message),this._parentObj instanceof ct&&P.Append(" Control: "+this._parentObj.Name),E.WriteWarningToLog(P.ToString()),[3,9];case 9:o.value?(n=this.updateResult(n),this.setValue(n)):null==this._val&&this._parentType!==W.PARENT_TYPE_CONTROL&&(n=Tt.getDefaultValue(this._id,this._parentType,this._parentObj),this.setValue(n)),_.label=10;case 10:return[2]}}))}))},n.prototype.updateResult=function(r){switch(this._id){case t.PropInterface.PROP_TYPE_FORMAT:null==r&&(r=e.NString.Empty);break;case t.PropInterface.PROP_TYPE_TASK_MODE:r=n.updateTaskModeResult(r);break;default:return r}return r},n.updateTaskModeResult=function(t){var r=" ";if(!e.NString.IsNullOrEmpty(t))switch(r=t[0].toUpperCase()){case"Q":r="E";break;case"F":r="O";break;case"O":r="N"}return r},n.prototype.getValue=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.ComputeValue()];case 1:return t.sent(),[2,this._val]}}))}))},n.prototype.getValueInt=function(){return s(this,void 0,void 0,(function(){var t;return _(this,(function(r){switch(r.label){case 0:return t=0,[4,this.ComputeValue()];case 1:return r.sent(),null!==this._val&&(t=e.NNumber.Parse(this._val)),[2,t]}}))}))},n.prototype.GetComputedValueInteger=function(){return e.NNumber.Parse(this._val)},n.prototype.getValueBoolean=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return this._dataType!==r.StorageAttribute.BOOLEAN?[3,2]:[4,this.getValue()];case 1:return t.sent(),[2,$.toBoolean(this._val)];case 2:E.WriteExceptionToLog(e.NString.Format("Property.getValueBoolean() was called for non boolean type property: {0}",this._id)),t.label=3;case 3:return[2]}}))}))},n.prototype.GetComputedValue=function(){return this._val},n.prototype.GetComputedValueBoolean=function(){if(this._dataType===r.StorageAttribute.BOOLEAN)return $.toBoolean(this._val);E.WriteExceptionToLog(e.NString.Format("Property.getValueBoolean() was called for non boolean type property: {0}",this._id))},n.prototype.getPrevValue=function(t){return t<this._prevValues.length?this._prevValues.get_Item(t):null},n.prototype.isExpression=function(){return this._expId>0},n.prototype.GetExpressionId=function(){return this._expId},n.prototype.onImageFileName=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in onImageFileName.onEnable()");var t=this._parentObj;t.isTabControl()?t.setImageList(this.GetComputedValue()):(t.isImageControl()||t.isRadio()||t.isCheckBox()||t.IsImageButton())&&t.setImageWithFileName(this.GetComputedValue())},n.prototype.onEnable=function(t){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onEnable()");var r=this._parentObj,n=r.getForm().getTask().CurrentEditingControl;if(null!==this._val&&"0"===this._val&&t&&null!==n&&(r===n||n.isDescendentOfControl(r)||r===n.getLinkedParent(!1))){var i=r.getForm().getTask().getLastParkedCtrl();null!==i&&i.InControl&&(r===i||i.isDescendentOfControl(r))&&(E.OnNonParkableLastParkedCtrl(r),r.getForm().getTask().CurrentEditingControl=null)}r.SetEnabled(this.GetComputedValueBoolean())},n.prototype.onVisible=function(e){return s(this,void 0,void 0,(function(){var r,n,i;return _(this,(function(o){switch(o.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,2]:(r=this._parentObj,n=r.getForm().getTask().CurrentEditingControl,null!==this._val&&"0"===this._val&&e&&null!==n&&(r===n||n.isDescendentOfControl(r)||r===n.getLinkedParent(!1))&&null!==(i=r.getForm().getTask().getLastParkedCtrl())&&i.InControl&&(r===i||i.isDescendentOfControl(r))&&(E.OnNonParkableLastParkedCtrl(r),r.getForm().getTask().CurrentEditingControl=null),[4,r.updatePropertyLogicNesting(t.PropInterface.PROP_TYPE_VISIBLE,t.CommandType.PROP_SET_VISIBLE,this.GetComputedValueBoolean(),!0)]);case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},n.prototype.OnControlName=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.OnControlName()")},n.prototype.onHint=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("inProperty.onHint()");var r=this.getObjectByParentObj(),n=E.Translate(this.GetComputedValue());r.IsDateTimePicture()||r.IsTableChild&&!r.IsTableHeaderChild||F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.PlaceHolder,n)},n.prototype.onFormName=function(){if(this._parentType!==W.PARENT_TYPE_FORM)throw new e.ApplicationException("in Property.onFormName()");this.addCommandTypeText(0)},n.prototype.addCommandTypeText=function(n){var i=E.Translate(this.GetComputedValue());(this._parentType===W.PARENT_TYPE_FORM||this._parentType===W.PARENT_TYPE_CONTROL&&this._parentObj.isColumnControl())&&(i=r.StrUtil.rtrim(i),this._parentType===W.PARENT_TYPE_FORM&&i===e.NString.Empty&&(i=" ")),this._parentType===W.PARENT_TYPE_CONTROL&&(this._parentObj.isTextControl()||this._parentObj.isButton())?F.addValueWithLine(t.CommandType.SET_VALUE,this._parentObj,n,i):F.addOperationWithLine(t.CommandType.SET_PROPERTY,this._parentObj,n,t.HtmlProperties.Text,i)},n.prototype.onText=function(t){this.addCommandTypeText(t)},n.prototype.onModifiable=function(n){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,4]:(n=this._parentObj).isTextControl()?(i=this.GetTaskByParentObject(),!(o=!this.GetComputedValueBoolean())&&i.getMode()===r.Constants.TASK_MODE_QUERY||n.GetCurrReadOnly()===o?[3,3]:(n.SetCurrReadOnly(o),r.UtilStrByteMode.isLocaleDefLangDBCS()?[4,n.getForm().getTask().checkProp(t.PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY,!1)]:[3,2])):[3,3];case 1:if(a.sent())return[2];a.label=2;case 2:F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.ReadOnly,o),a.label=3;case 3:return[3,5];case 4:throw new e.ApplicationException("in Property.onModifiable()");case 5:return[2]}}))}))},n.prototype.onTooltip=function(){var n;if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onTooltip()");var i=this._parentObj;n=0===this._expId?i.getForm().getTask().getHelpItem(e.NNumber.Parse(this._val)).tooltipHelpText:this._val,n=r.StrUtil.rtrim(n),i.isButton()&&i.ConnectedControl?F.addOperationWithLine(t.CommandType.SET_PROPERTY,i.ConnectedControl,this.getLine(),t.HtmlProperties.ZoomButtonTooltip,n):F.addOperationWithLine(t.CommandType.SET_PROPERTY,i,this.getLine(),t.HtmlProperties.Tooltip,n)},n.prototype.onDisplayList=function(t){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,3]:(r=this._parentObj).isSelectionCtrl()||r.isTabControl()||r.isRadio()||r.HasAutocomplete()?(n=t===e.Int32.MinValue?r.getDisplayLine(!1):t,[4,r.refreshAndSetItemsList(n,!0)]):[3,2];case 1:i.sent(),i.label=2;case 2:return[3,4];case 3:throw new e.ApplicationException("in Property.onDisplayList()");case 4:return[2]}}))}))},n.prototype.onVisibleLayerList=function(t){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,2]:(r=this._parentObj,n=0,n=t===e.Int32.MinValue?r.getDisplayLine(!1):t,[4,r.refreshTabForLayerList(n)]);case 1:return i.sent(),[3,3];case 2:throw new e.ApplicationException("in Property.onVisibleLayerList()");case 3:return[2]}}))}))},n.prototype.onFormat=function(){var t,n=null;if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onFormat()");switch(t=(n=this._parentObj).getPIC(),n.resetPrevVal(),n.Type){case r.MgControlType.CTRL_TYPE_BUTTON:(null==n.getField()&&!n.expressionSetAsData()||n.IsImageButton()||this._parentObj.IsFirstRefreshOfProps()&&!x.Environment.GetSpecialIgnoreButtonFormat())&&this.addCommandTypeText(this.getLine());break;case r.MgControlType.CTRL_TYPE_TEXT:n.Type===r.MgControlType.CTRL_TYPE_TEXT&&(t.getAttr(),r.StorageAttribute.NUMERIC)}},n.prototype.onLabel=function(t){return s(this,void 0,void 0,(function(){var n,i,o,a;return _(this,(function(s){switch(s.label){case 0:return this._parentType!==W.PARENT_TYPE_CONTROL?[3,10]:(n=this._parentObj,i=void 0,i=t===e.Int32.MinValue?n.getDisplayLine(!1):t,n.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX?[3,1]:(this.addCommandTypeText(i),[3,9]));case 1:return n.isSelectionCtrl()||n.isTabControl()||n.isRadio()?(a=(o=n).setRange,[4,this.getValue()]):[3,6];case 2:return a.apply(o,[s.sent()]),n.clearRange(i),[4,n.refreshAndSetItemsList(i,!0)];case 3:return s.sent(),this._expId>0?[4,n.ComputeAndRefreshDisplayValue(!1)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[3,9];case 6:return n.HasAutocomplete()?[4,n.refreshAndSetItemsList(i,!0)]:[3,8];case 7:return s.sent(),[3,9];case 8:throw new e.ApplicationException("Property.onLabel(), not support control");case 9:return[3,11];case 10:throw new e.ApplicationException("in Property.onLabel()");case 11:return[2]}}))}))},n.prototype.getObjectByParentObj=function(){var t=this._parentObj;if(this._parentType===W.PARENT_TYPE_FORM){var e=this._parentObj;e.isSubForm()&&(t=e.getSubFormCtrl())}return t},n.isRepeatableInTable=function(t){return!1},n.prototype.getLine=function(){var t=0;if(this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj,r=e.isPropertyRepeatable(this._id);t=e.getDisplayLine(r)}return t},n.prototype.getOrgValue=function(){return this._orgValue},n.prototype.updatePrevValueArray=function(t){this.ShouldSkipRefresh()||this._prevValues.SetSize(t)},n.prototype.clearPrevValueArray=function(){this._prevValues.Clear()},n.prototype.ResetPrevValueArray=function(){var t=this._prevValues.length;this._prevValues.Clear(),this._prevValues.SetSize(t)},n.prototype.setPrevArraySize=function(){if(this._parentType===W.PARENT_TYPE_FORM||this._parentType===W.PARENT_TYPE_CONTROL){var t=1;if(this._parentType===W.PARENT_TYPE_CONTROL){var e=this._parentObj;(e.IsRepeatable||e.isTableControl()&&n.isRepeatableInTable(this._id))&&(t=e.getForm().getTableItemsCount())}this._prevValues.SetSize(t)}},n.prototype.onPassword=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.onPassword()");F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.Password,this.GetComputedValueBoolean())},n.prototype.computeCustomPropertiesValues=function(){return s(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,P,c,T;return _(this,(function(_){switch(_.label){case 0:_.trys.push([0,5,6,7]),t=l(this.customProperties),r=t.next(),_.label=1;case 1:return r.done?[3,4]:(n=u(r.value,2),i=n[0],o=n[1],255,new e.RefParam(!1),a=o,[4,this.GetRetrunValueForCustomPropertyExpression(a)]);case 2:s=_.sent(),this.customPropertiesValues.set(i,s),_.label=3;case 3:return r=t.next(),[3,1];case 4:return[3,7];case 5:return P=_.sent(),c={error:P},[3,7];case 6:try{r&&!r.done&&(T=t.return)&&T.call(t)}finally{if(c)throw c.error}return[7];case 7:return[2]}}))}))},n.prototype.computeCustomValidators=function(){return s(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,P,c,T,h,E,p;return _(this,(function(_){switch(_.label){case 0:if(!((t=this._parentObj).ModifiedByUser||t.ValidateControl||this.GetTaskByParentObject().IsInRecompute()))return[3,11];_.label=1;case 1:_.trys.push([1,9,10,11]),r=l(this.customValidatorProperties),n=r.next(),_.label=2;case 2:return n.done?[3,8]:(i=u(n.value,2),o=i[0],a=i[1],255,new e.RefParam(!1),s=a._exp,[4,this.GetRetrunValueForCustomPropertyExpression(s)]);case 3:return P=_.sent(),c="",(T="1"===P)?(s=a._errorMessageExp)>0?[4,this.GetRetrunValueForCustomPropertyExpression(s)]:[3,5]:[3,6];case 4:return c=_.sent(),[3,6];case 5:c=a._errorMessage,_.label=6;case 6:this.customValidatorValues.set(o,new Et(!T,c)),_.label=7;case 7:return n=r.next(),[3,2];case 8:return[3,11];case 9:return h=_.sent(),E={error:h},[3,11];case 10:try{n&&!n.done&&(p=r.return)&&p.call(r)}finally{if(E)throw E.error}return[7];case 11:return[2]}}))}))},n.prototype.onCustomProperties=function(){var e,r;try{for(var n=l(this.customPropertiesValues),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),a=o[0],s=o[1];F.addOperationWithLine(t.CommandType.PROP_SET_USER_PROPERTY,this._parentObj,this.getLine(),a,s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},n.prototype.onCustomValidators=function(){var e,r;try{for(var n=l(this.customValidatorValues),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),a=o[0],s=o[1];F.addOperationWithLine(t.CommandType.PROP_SET_CUSTOM_VALIDATOR,this._parentObj,this.getLine(),a,s)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},n.prototype.onBindingLevel=function(){if(this._parentType!==W.PARENT_TYPE_CONTROL)throw new e.ApplicationException("in Property.BindingLevel()");F.addOperationWithLine(t.CommandType.SET_PROPERTY,this.getObjectByParentObj(),this.getLine(),t.HtmlProperties.BindingLevel,this.GetComputedValueInteger())},n.prototype.onAutoCompleteMode=function(){},n.prototype.GetRetrunValueForCustomPropertyExpression=function(t){return s(this,void 0,void 0,(function(){var n,i,o,a,s;return _(this,(function(_){switch(_.label){case 0:return 255,n=this._parentObj.GetExpressionStorage(t),i=new e.RefParam(!1),[4,this._parentObj.EvaluateExpression(t,n,255,!0,r.StorageAttribute.SKIP,!1,i)];case 1:switch(o=_.sent(),n=this._parentObj.GetExpressionStorage(t),a=this._parentObj.getCompIdx(),n){case r.StorageAttribute.NUMERIC:s=new z("N6.2",r.StorageAttribute.NUMERIC,this._parentObj.getCompIdx()),null==o&&(o="FF00000000000000000000000000000000000000"),o=$.Instance.mg2disp(o,"",s,!1,a,!1).trim();break;case r.StorageAttribute.DATE:s=new z("##/##/####",n,a),o=$.Instance.mg2disp(o,"",s,!0,!1,a,!0);break;case r.StorageAttribute.TIME:s=new z("##:##/####",n,a),o=$.Instance.mg2disp(o,"",s,!0,!1,a,!0);break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:case r.StorageAttribute.NONE:break;default:throw new e.ApplicationException("in Property.GetRetrunValueForCustomPropertyExpression() illegal data type: "+n)}return[2,o]}}))}))},n.prototype.RemovePrevValIndexAt=function(t){this._prevValues.length>t&&this._prevValues.RemoveAt(t)},n.prototype.InsertPrevValAt=function(t){this._prevValues.Insert(t,null)},n.prototype.resetPrevValAt=function(t){t>=0&&t<this._prevValues.length&&this._prevValues.set_Item(t,null)},n.prototype.toString=function(){return e.NString.Format("{0} = {1} (exp={2}, studio value={3})",[Tt.GetPropertyName(this._id),null===this._val?"is null":this._val,this._expId,this.StudioValue])},n.getDefaultProp=function(t,e,r){var i=null,o=Tt.getDefaultValue(t,e,r);return null!==o&&(i=new n(t,r,e,o)),i},n.prototype.InsertPrevValueArray=function(t,e){this.ShouldSkipRefresh()||this._prevValues.InsertRange(t,new Array(e))},n}();pt._numericPropertyPic=null,pt.UtilImeJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new r.UtilImeJpn:null;var It=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.IsFormTag=function(t){return t===r.XMLConstants.MG_TAG_FORM||t===r.XMLConstants.MG_TAG_FORM_PROPERTIES},e.IsEndFormTag=function(t){return t==="/"+r.XMLConstants.MG_TAG_FORM||t==="/"+r.XMLConstants.MG_TAG_FORM_PROPERTIES},e}(h),ft=function(){function n(t){this._hashTab=null,this._props=null,this._parent=null,0!==arguments.length?this.constructor_1(t):this.constructor_0()}return n.prototype.constructor_0=function(){this._props=new e.List,this._hashTab=new e.Hashtable(20)},n.prototype.constructor_1=function(t){this.constructor_0(),this._parent=t},n.prototype.fillData=function(t,e,r){for(;this.initInnerObjects(r.getNextTag(),t,e,r););},n.prototype.fillDataByExists=function(t,e){for(;this.fillExistInnerObjects(e.getNextTag(),t,e););},n.prototype.initInnerObjects=function(t,e,n,i){if(null===t||t!==r.XMLConstants.MG_TAG_PROP)return!1;var o=new pt;return o.fillData(e,n,i),this.addProp(o),!0},n.prototype.addProp=function(t){this._hashTab.set_Item(t.getID(),t),this._props.push(t)},n.prototype.delPropById=function(t){if(null!==this._props){var e=this._hashTab.get_Item(t);null!==e&&(this._props.Remove(e),this._hashTab.Remove(t))}},n.prototype.fillExistInnerObjects=function(t,n,i){var o=new e.List,a=-1;if(null==t)return!1;if(t===r.XMLConstants.MG_TAG_CONTROL)a=i.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,i.getCurrIndex());else if(t===r.XMLConstants.MG_TAG_PROP)a=i.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,i.getCurrIndex());else if(t==="/"+r.XMLConstants.MG_TAG_CONTROL||It.IsEndFormTag(t))return i.setCurrIndex2EndOfTag(),!1;if(-1!==a&&a<i.getXMLdata().length){var s=i.getXMLsubstring(a);if(i.add2CurrIndex(s.indexOf(t)+t.length),o=r.XmlParser.getTokens(i.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),t===r.XMLConstants.MG_TAG_CONTROL)return this._parent=n.getCtrl(e.NNumber.Parse(this.fillName(o))),i.setCurrIndex(++a),!0;if(t!==r.XMLConstants.MG_TAG_PROP)return E.WriteExceptionToLog(e.NString.Format("in PropTable.fillExistInnerObjects() illegal tag name: {0}",t)),i.setCurrIndex(++a),!0;if(null!=this._parent){var _=this.fillName(o),l=e.NNumber.Parse(_),u=null;return null!=this._parent&&(u=this._parent.getProp(l)),null==u?E.WriteExceptionToLog(e.NString.Format("in PropTable.fillExistInnerObjects() no property with id={0}",_)):this.addProp(u),i.setCurrIndex(a+r.XMLConstants.TAG_TERM.length),!0}E.WriteExceptionToLog("in PropTable.fillExistInnerObjects() missing control")}return t===r.XMLConstants.MG_TAG_CONTROL?(i.setCurrIndex(++a),!0):It.IsFormTag(t)?(this._parent=n.getForm(),this._parent.fillName(t),!0):t!=="/"+r.XMLConstants.MG_TAG_FLD&&(i.setCurrIndex(a+r.XMLConstants.TAG_TERM.length),!0)},n.prototype.fillName=function(t){for(var n,i=null,o=0;o<t.length;o+=2)if(i=t.get_Item(o),n=t.get_Item(o+1),i===r.XMLConstants.MG_ATTR_DITIDX||i===r.XMLConstants.MG_ATTR_ID)return n;return E.WriteExceptionToLog(e.NString.Format("Unrecognized attribute: '{0}'",i)),null},n.prototype.getSize=function(){return this._props.length},n.prototype.getProp=function(t){return t<0||t>=this._props.length?null:this._props.get_Item(t)},n.prototype.getPropById=function(t){return this._hashTab.get_Item(t)},n.prototype.propExists=function(t){return null!==this.getPropById(t)},n.prototype.setProp=function(t,e,r,n){var i=this.getPropById(t);null===i&&(i=new pt(t,r,n),this.addProp(i)),i.setValue(e),i.setOrgValue()},n.prototype.RefreshDisplay=function(r,n){return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,P;return _(this,(function(_){switch(_.label){case 0:i=!0,a=0,s=null,l=new e.List,null!=this._parent&&this._parent instanceof ct&&(s=this._parent.getForm()),null!=s&&s.checkAndCreateRow(s.DisplayLine),a=0,_.label=1;case 1:if(!(a<this.getSize()))return[3,8];o=this.getProp(a),_.label=2;case 2:return _.trys.push([2,6,,7]),n&&!pt.isRepeatableInTable(o.getID())?[3,7]:o.getID()!==t.PropInterface.PROP_TYPE_VISIBLE?[3,3]:(l.push(o),[3,5]);case 3:return[4,o.RefreshDisplay(r)];case 4:_.sent(),_.label=5;case 5:return[3,7];case 6:if(!((u=_.sent())instanceof e.ApplicationException))throw u;return E.WriteExceptionToLog(u),i=!1,[3,7];case 7:return a++,[3,1];case 8:P=0,_.label=9;case 9:return P<l.length?[4,l[P].RefreshDisplay(r)]:[3,12];case 10:_.sent(),_.label=11;case 11:return P++,[3,9];case 12:return[2,i]}}))}))},n.prototype.updatePrevValueArray=function(t){for(var e=0;e<this._props.length;e+=1){this._props.get_Item(e).updatePrevValueArray(t)}},n.prototype.resetPrevValueArray=function(){for(var t=0;t<this._props.length;t+=1){this._props.get_Item(t).ResetPrevValueArray()}},n.prototype.resetPrevValAt=function(t){for(var e=0;e<this._props.length;e+=1){this._props.get_Item(e).resetPrevValAt(t)}},n.prototype.clearLabelPrevValueArray=function(){var t=this.getPropById(45);null!==t&&t.clearPrevValueArray()},n.prototype.getCtrlRef=function(){return this._parent instanceof ct?this._parent:null},n.prototype.InsertPrevValueArray=function(t,e){for(var r=0;r<this._props.length;r++){this._props[r].InsertPrevValueArray(t,e)}},n}(),Ot=function(t){function e(e){var r=t.call(this,e)||this;return r._type=null,r.name="WrongFormatException",0===arguments.length?(r.constructor_0(),r):(r.constructor_1(e),r)}return a(e,t),e.prototype.initialize=function(){this._type=null},e.prototype.constructor_0=function(){this.initialize(),this._type=r.MsgInterface.STR_RNG_TXT},e.prototype.constructor_1=function(t){this.initialize(),this._type=t},e.prototype.getType=function(){return this._type},e}(e.Exception),gt=function(){function n(){this._newvalue=null,this._oldvalue=null,this._pictureReal=null,this._pictureEnable=null,this._valDet=null,this._isPm=!1,this._picture=null,this.hebrew=!1,this._decimal=null,this._environment=null,this._environment=x.Environment,this._decimal=this._environment.GetDecimal()||""}return n.prototype.checkVal=function(n){this._newvalue=this._oldvalue=this._pictureReal=this._pictureEnable=null,this.init(n),n.setValidationFailed(!1);var i=n.getControl(),o=!i.isRepeatable()&&i.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY,!1,i.getDisplayLine(!1)),a=i.isModifiable();if("E"===i.getForm().getTask().getMode()&&!o)return n.setValue(this._oldvalue),n;if(i.Type===r.MgControlType.CTRL_TYPE_RADIO||i.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||i.Type===r.MgControlType.CTRL_TYPE_TAB||i.isSelectionCtrl()){try{if(i.Type===r.MgControlType.CTRL_TYPE_CHECKBOX&&n.setNull(i.isNullValue(this._newvalue)),null!==this._newvalue&&i.isSelectionCtrl()){var s=e.NNumber.Parse(this._newvalue);i.isChoiceNull(s)&&n.setNull(!0)}}catch(t){if(!(t instanceof e.Exception))throw t}return n.setValue(this._newvalue),n}if(i.DataType!==r.StorageAttribute.ALPHA&&i.DataType!==r.StorageAttribute.UNICODE&&i.DataType!==r.StorageAttribute.BLOB&&("string"==typeof this._newvalue&&0===this._newvalue.trim().length||i.DataType===r.StorageAttribute.DATE&&(i.isDateZero(this._newvalue)||this.isNullDisplayVal()))){var _=i.getField(),l=_.getDefaultValue(),u=null;if(_.isNullDefault()&&(n.setNull(!0),u=_.getNullDisplay(),e.NString.IsNullOrEmpty(u)&&i.DataType===r.StorageAttribute.DATE&&(u=$.Instance.mg2disp(l,n.getRange(),n.getPIC(),a,_.getTask().getCompIdx(),!1))),null===u&&(u=$.Instance.mg2disp(l,n.getRange(),n.getPIC(),a,_.getTask().getCompIdx(),!1)),_.isNullDefault()||null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())return n.setValue(u),n;this._newvalue=u}if("string"==typeof this._newvalue&&r.StrUtil.rtrim(this._newvalue)!==r.StrUtil.rtrim(this._oldvalue)||i.ModifiedByUser)try{switch(n.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:n.setValue(this.checkAlphaField());break;case r.StorageAttribute.NUMERIC:this._pictureReal=n.getPictureReal(),this._pictureEnable=n.getPictureEnable(),this.checkNumericPicture(),n.setValue(this.checkNumericField());break;case r.StorageAttribute.BOOLEAN:n.setValue(this.checkLogicalField());break;case r.StorageAttribute.DATE:n.setValue(this.checkDateField());break;case r.StorageAttribute.TIME:n.setValue(this.checkTimeField());break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:n.setValue(this._newvalue);break;case r.StorageAttribute.NONE:default:E.WriteExceptionToLog("FieldValidator.checkVal: Type of the field "+n.getType())}}catch(t){t instanceof Ot&&(n.setValue(this._oldvalue),this.setValidationFailed(!0),t.getType()!==r.MsgInterface.STR_RNG_TXT?(this.printMessage(t.getType(),!1),this.setValidationFailed(!0)):this.printMessage(r.MsgInterface.STR_RNG_TXT,!0))}return n},n.prototype.checkAlphaField=function(){var t=this._valDet.getControl(),n=this._valDet.getType()===r.StorageAttribute.ALPHA;if(0===this._newvalue.length&&null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())return this.setValidationFailed(!1),this._newvalue;if(n&&r.UtilStrByteMode.isLocaleDefLangDBCS()){var i=r.UtilStrByteMode.lenB(this._picture);r.UtilStrByteMode.lenB(this._newvalue)>i&&(this._newvalue=r.UtilStrByteMode.leftB(this._newvalue,i))}else this._newvalue.length>this._picture.length&&(this._newvalue=this._newvalue.substr(0,this._picture.length));var o,a=new e.StringBuilder,s=o=0;for(o=s=0;s<this._newvalue.length&&o<this._picture.length;){if($.isAlphaPositionalDirective(this._picture.charAt(o))||this._newvalue.charAt(s)!==this._picture.charAt(o))if($.isAlphaPositionalDirective(this._picture.charAt(o))||this._newvalue.charAt(s)===this._picture.charAt(o)){if($.isAlphaPositionalDirective(this._picture.charAt(o))&&this.isPossibleAlphaLetter(s,o))if(r.UtilStrByteMode.isLocaleDefLangDBCS()){var _=this._newvalue.substr(s,1);2===r.UtilStrByteMode.lenB(_)&&n?o+1<this._picture.length&&$.isAlphaPositionalDirective(this._picture.charAt(o+1))&&this.isPossibleAlphaLetter(s,o+1)?(a.Append(this._newvalue.charAt(s)),s+=1,o+=2):(a.Append(" "),o+=1):(a.Append(this._newvalue.charAt(s)),s+=1,o+=1)}else a.Append(this._newvalue.charAt(s)),s+=1,o+=1;else if(a.Append(" "),o+=1,null!==this._valDet.getControl())t.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&this.printMessage(r.MsgInterface.STR_ERR_NUM,!1)}else a.Append(this._picture.charAt(o)),o+=1;else a.Append(this._picture.charAt(o)),s+=1,o+=1}return this._newvalue=a.ToString(),null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues()||(this._newvalue=this.fillAlphaByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues())),this._newvalue},n.prototype.isPossibleAlphaLetter=function(t,n){switch(this._picture.charCodeAt(n)){case r.PICInterface.PIC_X:case r.PICInterface.PIC_J:case r.PICInterface.PIC_G:case r.PICInterface.PIC_S:case r.PICInterface.PIC_T:return!0;case r.PICInterface.PIC_U:var i=this._newvalue[t].toUpperCase();return i!==this._newvalue[t]&&this.changeStringInside(""+i,t),!0;case r.PICInterface.PIC_L:var o=this._newvalue[t].toLowerCase();return o!==this._newvalue[t]&&this.changeStringInside(""+o,t),!0;case r.PICInterface.PIC_N:var a=this._newvalue[t];return!!(r.UtilStrByteMode.isDigit(a)||e.NChar.IsWhiteSpace(a)||r.UtilStrByteMode.asNumeric(a))||(E.WriteErrorToLog("Bad Alpha value. Should be number only on place Num. "+t),!1);default:return E.WriteErrorToLog("FieldValidator.isPossibleAlphaLetter: illegal Char Directive: "+this._picture.indexOf(String.fromCharCode(n))+" for "+this._newvalue[t]),!1}},n.prototype.fillAllAlpha=function(){var t=new e.StringBuilder(this._picture.length);if(t.Append(this._newvalue),r.UtilStrByteMode.isLocaleDefLangDBCS()&&this._valDet.getType()===r.StorageAttribute.ALPHA)for(var n=r.UtilStrByteMode.lenB(this._newvalue),i=r.UtilStrByteMode.leftB(this._picture,n).length;i<this._picture.length;i+=1)$.isAlphaPositionalDirective(this._picture.charAt(i))?t.Append(" "):t.Append(this._picture.charAt(i));else for(i=this._newvalue.length-1;i<this._picture.length&&i>=0;i++)$.isAlphaPositionalDirective(this._picture.charAt(i))?t.Append(" "):t.Append(this._picture.charAt(i)),i+=1;return t.ToString()},n.prototype.fillAlphaByRange=function(t,e){var n=$.Instance.fillAlphaByDiscreteRangeValues(e,this._newvalue);return null!==n||null!==(n=$.Instance.fillAlphaByContinuousRangeValues(t,this._newvalue))?n:null!==e?this.CompleteAlphaByRange(e):(this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue)},n.prototype.CompleteAlphaByRange=function(t){var e=$.Instance.completeAlphaByRange(t,this._newvalue);return null!==e?e:(this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue)},n.prototype.checkLogicalField=function(){if(0===this._newvalue.length&&null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues())throw new Ot(r.MsgInterface.STR_RNG_TXT);return null===this._valDet.getContinuousRangeValues()&&null===this._valDet.getDiscreteRangeValues()||(this._newvalue=this.fillAlphaByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues())),this.setValidationFailed(!1),this._newvalue},n.prototype.checkNumericField=function(){var t;if("string"==typeof this._newvalue){0===this._newvalue.length&&(this._newvalue="0");var e=this._newvalue.indexOf(this._decimal),n=this._pictureReal.indexOf(this._decimal);t="";var i=void 0,o=void 0;if(this.setValidationFailed(!1),!this.checkNumericInDecFormat())throw new Ot(r.MsgInterface.EDT_ERR_STR_1);if(-1!==n&&-1!==e?(i=this.checkNumericLeft(n,e),o=this.checkNumericRight(n,e),t=i+this._decimal+o):-1!==n&&-1===e?(i=this.checkNumericLeft(n,Math.min(n,this._newvalue.length)),o=this.checkNumericRight(n,n-1),t=i+this._decimal+o):(-1===n&&-1===e||(this._newvalue=e>0?this._newvalue.substr(0,e):"0"),i=t=this.checkNumericRight(-1,-1)),0===o.length&&0===i.length||0===t.length&&this._newvalue.length>0){var a=this._valDet.getControl().getField(),s=a.getDefaultValue(),_=null;a.isNullDefault()&&(this._valDet.setNull(!0),_=a.getNullDisplay()),null==_&&(_=$.Instance.mg2disp(s,this._valDet.getRange(),this._valDet.getPIC(),!0,a.getTask().getCompIdx(),!1))}var l=this.digitsBeforeDelimeter(t,0,this._decimal)-this._valDet.getPIC().getWholes();if(l>0){var u=!1;if(this._valDet.getIsPadFill()){u=!0;for(var P=0;P<l&&u;P++)t[P]!==this._valDet.getPadFillChar()&&(u=!1)}if(!u)throw new Ot(r.MsgInterface.EDT_ERR_STR_1)}this._valDet.getIsNegative()&&(this._newvalue.trim().startsWith("-")||0!==this._valDet.getNegativeSignPref().length&&this._newvalue.trim().startsWith(this._valDet.getNegativeSignPref()))&&(t="-"+t),t=$.Instance.disp2mg(this._newvalue,"",this._valDet.getPIC(),this._valDet.getControl().getForm().getTask().getCompIdx(),K.CONTENT_TYPE_UNKNOWN),t=$.Instance.mg2disp(t,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!0),0===r.StrUtil.ltrim(t).length&&this._valDet.getPIC().zeroFill()&&" "===this._valDet.getPIC().getZeroPad()&&(t="0")}else t=$.Instance.disp2mg(this._newvalue,"",this._valDet.getPIC(),this._valDet.getControl().getForm().getTask().getCompIdx(),K.CONTENT_TYPE_UNKNOWN),t=$.Instance.mg2disp(t,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!0);return null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(this._newvalue=t,t=this.fillNumericByRange()),t},n.prototype.checkNumericLeft=function(t,n){var i,o,a=new e.StringBuilder,s=n-1;for(i=t-1;i>=0&&s>=0;i--)if("1"===this._pictureEnable[i]){var _=s;for(o=!1;s>=0;s--)if(this._pictureReal[i]===this._newvalue[s]){o=!0,s--;break}o||(s=_),a.Append(this._pictureReal[i])}else for(;s>=0;s--)if(r.UtilStrByteMode.isDigit(this._newvalue[s])){a.Append(this._newvalue[s]),s--;break}if(s<0&&i>=0)for(;i>=0;i--)"1"===this._pictureEnable[i]?a.Append(this._pictureReal[i]):this._valDet.getIsPadFill()&&a.Append(this._valDet.getPadFillChar());return r.StrUtil.ReverseString(a).ToString()},n.prototype.checkNumericRight=function(t,n){var i,o=new e.StringBuilder,a=n+1,s=this._valDet.getPIC();for(i=t+1;i<this._pictureEnable.length&&a<this._newvalue.length;i++)if("1"===this._pictureEnable[i])a<i&&(a=i),o.Append(this._pictureReal[i]);else for(;a<this._newvalue.length;a++)if(r.UtilStrByteMode.isDigit(this._newvalue[a])&&!s.picIsMask(a)){o.Append(this._newvalue[a]),a++;break}if(o.Length>0&&a>=this._newvalue.length&&i<this._pictureReal.length)for(;i<this._pictureReal.length;i++)"1"===this._pictureEnable[i]&&o.Append(this._pictureReal[i]);return o.ToString()},n.prototype.checkNumericPicture=function(){var t,e,n,i,o=this._valDet.getPIC();if(null!=this._pictureReal&&null!=this._pictureEnable&&o.getAttr()===r.StorageAttribute.NUMERIC&&o.withDecimal())for(e=this._pictureReal.lastIndexOf("."),n=this._pictureEnable.length,i=0;i<e;){if(-1===(t=this._pictureEnable.indexOf("1",i)))return;if(t===this._pictureReal.indexOf(".",i)){var a=void 0,s=void 0;a=s="",0===t?t+1<n&&(s=this._pictureReal.substr(t+1)):t===n?a=this._pictureReal.substr(0,t):(a=this._pictureReal.substr(0,t),s=this._pictureReal.substr(t+1)),this._pictureReal=a+this._decimal+s;break}i=++t}},n.prototype.fillNumericByRange=function(){var t=this._valDet.getControl().getPIC(),e=this._valDet.getContinuousRangeValues(),n=this._valDet.getDiscreteRangeValues();if(this.setValidationFailed(!1),0===this.setNumericValueWithoutPicture(this._newvalue.toString()).length)return this.printMessage(r.MsgInterface.STR_RNG_TXT,!0),this._oldvalue;var i=new Z(this._newvalue.toString(),this._valDet.getControl().getPIC(),0);if(null!==n)for(var o=0;o<n.length;o+=1){var a=new Z(n.get_Item(o),t,0);try{if(0===Z.num_cmp(i,a))return this._newvalue}catch(t){}}if(null!==e)for(o=0;o<e.length;o+=1){a=new Z;var s=new Z;a.num_4_a_std(e.get_Item(o++)),s.num_4_a_std(e.get_Item(o));try{if(-1!==Z.num_cmp(i,a)&&-1!==Z.num_cmp(s,i))return this._newvalue}catch(t){}}throw new Ot},n.prototype.getDoubleVal=function(t){var r=!1,n=!1,i=!1,o=!1,a=0;for(a=0;a<t.length&&!o;a++){var s=t[a];if(s>="0"&&s<="9")i=!0;else switch(s){case"-":(i||r||n)&&(o=!0),n=!0;break;case".":(r||n&&!i)&&(o=!0),r=!0;break;case" ":(i||r||n)&&(o=!0);break;default:o=!0}}return o&&(a-=1),a>0?e.NNumber.Parse(t.substr(0,a)):-1/0},n.prototype.setNumericValueWithoutPicture=function(t){for(var n,i=new e.StringBuilder(t.length),o=!1,a=0;a<this._pictureReal.length&&a<t.length;a++)n=t[a],r.UtilStrByteMode.isDigit(n)?i.Append(n):n!==this._environment.GetDecimal()||o?"-"===n&&this._valDet.getIsNegative()&&i.Append(e.NString.ToCharArray(e.NumberFormatInfo.NegativeSign).toString()):(i.Append(e.NString.ToCharArray(e.NumberFormatInfo.NumberDecimalSeparator).toString()),o=!0);return 0===i.ToString().length&&(this.printMessage(r.MsgInterface.STR_ERR_NUM,!1),this.setValidationFailed(!0)),i.ToString()},n.prototype.checkNumericInDecFormat=function(){var t,e,n,i,o=this._valDet.getPIC(),a=this._environment.GetDecimal();for(e=0,n=0,i=-1,t=0;t<this._newvalue.length;t++)o.isNumeric(t)&&(r.UtilStrByteMode.isDigit(this._newvalue[t])?i>=0?e++:n++:this._newvalue[t]===a&&(i=t));return!(o.getWholes()<n||o.getDec()<e)},n.prototype.checkDateField=function(){var t=null==this._newvalue?null:new Date(this._newvalue);if(this.setValidationFailed(!1),this._valDet.getControl().isDateZero(this._newvalue)){var e=this._valDet.getControl().getField().getDefaultValue();t=$.Instance.mg2disp(e,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!1)}else null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(t=this.fillDateByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues(),this._newvalue));return t},n.prototype.add2Date=function(t,n,i){var o,a=t,s=new e.StringBuilder(this._newvalue.length),_=0;switch(i){case r.PICInterface.PIC_DD:case r.PICInterface.PIC_DDDD:case r.PICInterface.PIC_MMD:case r.PICInterface.PIC_YY:_=2;break;case r.PICInterface.PIC_DDD:_=3;break;case r.PICInterface.PIC_YYYY:_=4;break;case r.PICInterface.PIC_W:_=1;break;case r.PICInterface.PIC_YJ:_=2,i=r.PICInterface.PIC_YY}for(;a<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue.charAt(a));)a++;if(a===this._newvalue.length&&(0===this._newvalue.length||"0"===this._newvalue)){for(var l=0;l<_;l+=1)n.Append("0");return t}for(a===this._newvalue.length&&(this._newvalue=this._newvalue+"0"),o=a;o<a+_&&o<this._newvalue.length&&r.UtilStrByteMode.isDigit(this._newvalue.charAt(o));o++)s.Append(this._newvalue.charAt(o));0===s.Length&&s.Append("0");var u=e.NNumber.Parse(s.ToString());if(u<1&&i!==r.PICInterface.PIC_YYYY&&i!==r.PICInterface.PIC_YY||u>31&&(i===r.PICInterface.PIC_DD||i===r.PICInterface.PIC_DDDD)||u>12&&i===r.PICInterface.PIC_MMD||u>7&&i===r.PICInterface.PIC_W)throw new Ot(r.MsgInterface.STR_ERR_DATE);i===r.PICInterface.PIC_YYYY&&this._environment.GetCentury(this._valDet.getControl().getForm().getTask().getCompIdx())>999&&s.Length<3&&(s=this.checkCentury(u));for(var P=0;P<_-s.Length;P+=1)n.Append("0");return n.Append(s.ToString()),o},n.prototype.addM2Date=function(t,e,n,i){var o;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD)if(this.hebrew)o=q.GetLocalMonths();else{var a=E.GetMessageString(r.MsgInterface.MONTHS_PTR);o=r.DateUtil.getLocalMonths(a)}else if(i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W)if(this.hebrew)o=q.GetLocalDows();else{var s=E.GetMessageString(r.MsgInterface.DAYS_PTR);o=r.DateUtil.getLocalDays(s)}else{if(i!==r.PICInterface.PIC_BB){if(i===r.PICInterface.PIC_JY1||i===r.PICInterface.PIC_JY2||i===r.PICInterface.PIC_JY4){if(this._newvalue.length<t+e)throw new Ot(r.MsgInterface.STR_ERR_DATE);var _=this._newvalue.substr(t,e);return n.Append(_),t+_.length}return t+e}o=r.UtilDateJpn.getArrayDow()}this._newvalue.length<t&&(t=this._newvalue.length);var l=this.getMonthOrWeek(this._newvalue.substr(t),e,i);if(o[l].trim().length>=e)n.Append(o[l].trim().substr(0,e));else{n.Append(o[l].trim());for(var u=e-o[l].trim().length;u>0;u-=1)n.Append(" ")}return t+e},n.prototype.getEndOfNumericBlock=function(t){for(;t<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue.charAt(t));)t+=1;return t},n.prototype.addDateSuffix=function(t){var r=e.NNumber.Parse(t);return 1===r||21===r||31===r?"st":2===r||22===r?"nd":3===r||23===r?"rd":"th"},n.prototype.getSizeOfBlock=function(t,e){for(var r=t+1;r<this._picture.length&&this._picture.charCodeAt(r)===e;)r++;return r-t},n.prototype.getMonthOrWeek=function(t,n,i){var o;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD)if(this.hebrew)o=q.GetLocalMonths();else{var a=E.GetMessageString(r.MsgInterface.MONTHS_PTR);o=r.DateUtil.getLocalMonths(a.toString())}else if(i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W)if(this.hebrew)o=q.GetLocalDows();else{var s=E.GetMessageString(r.MsgInterface.DAYS_PTR);o=r.DateUtil.getLocalDays(s.toString())}else{if(i!==r.PICInterface.PIC_BB)return 1;o=r.UtilDateJpn.getArrayDow()}if(n>t.length&&(n=t.length),this.hebrew){for(var _=e.NString.TrimStart(t).substr(0,n).trim(),l=1;l<o.length;l++)if(o[l].trim()===_)return 14===l&&(l=6),l;return 0}try{var u=t.substr(0,n).trim(),P=new e.StringBuilder(u.length);for(l=0;l<u.length&&r.UtilStrByteMode.isDigit(u[l]);l++)P.Append(u[l]);var c=e.NNumber.Parse(P.ToString());if(c<1)return 1;if(i===r.PICInterface.PIC_MMM||i===r.PICInterface.PIC_MMD){if(c>12)return 12}else if((i===r.PICInterface.PIC_WWW||i===r.PICInterface.PIC_W||i===r.PICInterface.PIC_BB)&&c>7)return 7;return c}catch(t){}for(var T,h=new Array(o.length),p=-1,I=1;I<o.length;I++){h[I]=0,T=0;for(l=0;l<o[I].length&&T<t.length&&l<n&&o[I].toLowerCase()[l]===t.toLowerCase()[T];l++,T++)h[I]++;if(T===n||T===o[I].length){p=I;break}}return-1===p&&(p=this.findMax(h)),p},n.prototype.isNumberAllowedInDate=function(){for(var t=0;t<this._picture.length;t++)if(this.isDatePositionalNumericDirective(this._picture[t]))return!0;return!1},n.prototype.isAllNumbers0=function(){for(var t,e=0;e<this._newvalue.length;e++)if(t=this._newvalue[e],r.UtilStrByteMode.isDigit(t)&&"0"!==t)return!1;return!0},n.prototype.checkCentury=function(t){var r,n=this._environment.GetCentury(this._valDet.getControl().getForm().getTask().getCompIdx()),i=Math.floor(n/100);return r=t>=n%100&&0!==t?100*i+t:100*++i+t,new e.StringBuilder(r.toString())},n.prototype.isDateLegal4Range=function(t,e,r){var n,i,o,a=this._valDet.getPIC();if(null!=t)for(n=0;n<t.length-1;n++)if(i=$.Instance.a_2_date_pic(t.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),o=$.Instance.a_2_date_pic(t.get_Item(++n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),r>=i&&r<=o)return!0;if(null!=e)for(n=0;n<e.length;n++)if(r===$.Instance.a_2_date_pic(e.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()))return!0;throw new Ot},n.prototype.fillDateByRange=function(t,e,r){var n,i,o,a=this._valDet.getPIC(),s=$.Instance.fromNativeDateToMgDateNumber(r,a,this._valDet.getControl().getForm().getTask().getCompIdx());if(this.setValidationFailed(!1),null!=t)for(n=0;n<t.length-1;n++)if(i=$.Instance.a_2_date_pic(t.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),o=$.Instance.a_2_date_pic(t.get_Item(++n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()),s>=i&&s<=o)return new Date(r);if(null!=e)for(n=0;n<e.length;n++)if(s===$.Instance.a_2_date_pic(e.get_Item(n),a,a.getMask(),this._valDet.getControl().getForm().getTask().getCompIdx()))return new Date(r);throw new Ot},n.prototype.checkDay=function(n,i){var o=this.getDateElement(n,t.DateElement.DAY);if(o<29&&!i)return new e.StringBuilder(n);var a=this.getDateElement(n,t.DateElement.YEAR);if(i){var s=this.getMonthByDay(a,o);if(s<1||s>12)throw new Ot(r.MsgInterface.STR_ERR_DATE)}else{a.toString().length<3&&(a=e.NNumber.Parse(this.checkCentury(a).ToString())),"B"===this._environment.GetDateMode(this._valDet.getControl().getForm().getTask().getCompIdx())&&(a-=r.PICInterface.DATE_BUDDHIST_GAP);var _=this.getDateElement(n,t.DateElement.MONTH);if(o>this.getMaxDayInMonth(a,_))throw new Ot(r.MsgInterface.STR_ERR_DATE)}return new e.StringBuilder(n)},n.prototype.checkWeek=function(r){this.getDateElement(r,t.DateElement.DOW);var n=$.Instance.getNewDateBreakParams(),i=$.Instance.a_2_date(r,this._picture,this._valDet.getControl().getForm().getTask().getCompIdx());$.Instance.date_break_datemode(n,i,!0,this._valDet.getControl().getForm().getTask().getCompIdx());var o=n.dow;return o!=o&&(r=this.changeDow(r,o)),new e.StringBuilder(r)},n.prototype.checkJpnEraYear=function(t){var n=$.Instance.getNewDateBreakParams(),i=$.Instance.a_2_date(t,this._picture,this._valDet.getControl().getForm().getTask().getCompIdx());$.Instance.date_break_datemode(n,i,!0,this._valDet.getControl().getForm().getTask().getCompIdx());var o,a,s=n.year,_=n.doy;o=r.UtilDateJpn.getInstance().date_jpn_yr_2_a(s,_,!1),a=r.UtilDateJpn.getInstance().date_jpn_yr_2_a(s,_,!0);var l=new e.StringBuilder,u=r.UtilDateJpn.getInstance().date_jpn_year_ofs(s,_);if(u<=0)throw new Ot(r.MsgInterface.STR_ERR_DATE);u<=9&&l.Append("0"),l.Append(u.toString());for(var P=0,c=0;c+P<this._picture.length;c++)switch(this._picture.charCodeAt(c+P)){case r.PICInterface.PIC_JY1:t=r.UtilStrByteMode.repC(t,o,c+1,1);break;case r.PICInterface.PIC_JY2:t=r.UtilStrByteMode.repC(t,a,c+1,1),P++;break;case r.PICInterface.PIC_JY4:t=r.UtilStrByteMode.repC(t,a,c+1,2),c++,P+=2;break;case r.PICInterface.PIC_YJ:t=r.UtilStrByteMode.repC(t,l.toString(),c+1,2),c++;break;default:c<t.length&&!1===r.UtilStrByteMode.isHalfWidth(t[c])&&!0===r.UtilStrByteMode.isHalfWidth(this._picture[c+P])&&P++}return new e.StringBuilder(t)},n.prototype.getMaxDayInMonth=function(t,e){var r=[0,31,28,31,30,31,30,31,31,30,31,30,31];return t%4==0&&(t%100!=0||t%400==0)&&2===e?r[e]+1:r[e]},n.prototype.getMonthByDay=function(t,e){var n,i;for(i=t%4==0&&(t%100!=0||t%400==0),n=0;n<r.PICInterface.date_day_tab.length;n++)if(i){if(n<3){if(r.PICInterface.date_day_tab[n]>=e)return n}else if(r.PICInterface.date_day_tab[n]+1>=e)return n}else if(r.PICInterface.date_day_tab[n]>=e)return n;return n},n.prototype.getDateElement=function(n,i){var o=null,a=0,s=!1,_=r.PICInterface.PIC_WWW,l=!1,u=0,P=0,c=0;c=r.UtilStrByteMode.isLocaleDefLangJPN()?r.UtilStrByteMode.getMinLenPicture(n,this._picture):Math.min(n.length,this._picture.length);for(var T=0;T+P<c&&!s;T++)if(this.isDataPositionalDirective(this._picture[T+P]))switch(this._picture.charCodeAt(T+P)){case r.PICInterface.PIC_DD:if(i===t.DateElement.DAY){o=n.substr(T,2),s=!0;break}T++;break;case r.PICInterface.PIC_DDD:if(i===t.DateElement.DAY){o=n.substr(T,3),s=!0;break}T+=2;break;case r.PICInterface.PIC_DDDD:i===t.DateElement.DAY&&(o=n.substr(T,2),s=!0),T+=3;break;case r.PICInterface.PIC_MMD:i===t.DateElement.MONTH&&(o=n.substr(T,2),s=!0),T++;break;case r.PICInterface.PIC_MMM:if(a=this.getSizeOfBlock(T+P,r.PICInterface.PIC_MMM),i===t.DateElement.MONTH){o=n.substr(T,a),s=!0;break}T+=a-1,a=0;break;case r.PICInterface.PIC_YY:i===t.DateElement.YEAR&&(o=n.substr(T,2),s=!0),T++;break;case r.PICInterface.PIC_YYYY:i===t.DateElement.YEAR&&(o=n.substr(T,4),s=!0),T+=3;break;case r.PICInterface.PIC_W:i===t.DateElement.DOW&&(o=n.substr(T,1),s=!0);break;case r.PICInterface.PIC_WWW:if(a=this.getSizeOfBlock(T+P,r.PICInterface.PIC_WWW),i===t.DateElement.DOW){o=n.substr(T,a),s=!0;break}T+=a-1,a=0;break;case r.PICInterface.PIC_HYYYYY:case r.PICInterface.PIC_HL:case r.PICInterface.PIC_HDD:break;case r.PICInterface.PIC_BB:a=this.getSizeOfBlock(T+P,r.PICInterface.PIC_BB),T+Math.floor(a/2)<n.length&&(P+=a-(o=n.substr(T,Math.floor(a/2))).length),i===t.DateElement.DOW?(s=!0,_=r.PICInterface.PIC_BB):o=null,T+=a-1;break;case r.PICInterface.PIC_JY1:l=!0;break;case r.PICInterface.PIC_JY2:l=!0,P++;break;case r.PICInterface.PIC_JY4:l=!0,P+=2,T++;break;case r.PICInterface.PIC_YJ:i===t.DateElement.YEAR&&(o=n.substr(T,2),s=!0),T++}if(null==o)return i===t.DateElement.YEAR?e.DateTime.Now.Year:1;if(o=o.trim(),a>0)i===t.DateElement.MONTH?a=this.getMonthOrWeek(o.toString(),a,r.PICInterface.PIC_MMM):i===t.DateElement.DOW&&(a=this.getMonthOrWeek(o.toString(),a,_));else{for(;o.toString().startsWith("0")||o.toString().startsWith(" ");)o=o.toString().substr(1);a=0===o.length?0:e.NNumber.Parse(o.toString())}if(i===t.DateElement.YEAR&&l){if(0===(u=r.UtilDateJpn.getInstance().getStartYearOfEra(n,this._picture)))return 0;a+=u-1}return a},n.prototype.changeDow=function(t,e){var n,i,o,a,s=!1;a=""+e;for(var _=0,l=0;l+_<this._picture.length&&!s;l++)if(this.isDataPositionalDirective(this._picture[l+_]))switch(this._picture.charCodeAt(l+_)){case r.PICInterface.PIC_W:i=t.substr(0,l),o=t.substr(l+1),t=i+a+o,s=!0;break;case r.PICInterface.PIC_WWW:n=this.getSizeOfBlock(l+_,r.PICInterface.PIC_WWW),i=t.substr(0,l),o=t.substr(l+n);var u=E.GetMessageString(r.MsgInterface.DAYS_PTR);if((a=r.DateUtil.getLocalDays(u)[e]).length>n)a=a.substr(0,n);else if(a.length<n)for(;a.length<n;)a+=" ";t=i+a+o,s=!0;break;case r.PICInterface.PIC_BB:if(n=this.getSizeOfBlock(l+_,r.PICInterface.PIC_BB),i=t.substr(0,l),o=t.substr(l+Math.floor(n/2)),a=r.UtilDateJpn.getStrDow(e),r.UtilStrByteMode.lenB(a)>n)a=r.UtilStrByteMode.leftB(a,n);else if(r.UtilStrByteMode.lenB(a)<n)for(;r.UtilStrByteMode.lenB(a)<n;)a+=" ";t=i+a+o,s=!0;break;default:r.UtilStrByteMode.isLocaleDefLangDBCS()&&l<t.length&&!1===r.UtilStrByteMode.isHalfWidth(t[l])&&!0===r.UtilStrByteMode.isHalfWidth(this._picture[l+_])&&_++}return t},n.prototype.checkTimeField=function(){var t=new Date(this._newvalue);if(this.setValidationFailed(!1),this._valDet.getControl().isDateZero(this._newvalue)){var e=this._valDet.getControl().getField().getDefaultValue();t=$.Instance.mg2disp(e,"",this._valDet.getPIC(),!0,this._valDet.getControl().getForm().getTask().getCompIdx(),!1)}else null==this._valDet.getContinuousRangeValues()&&null==this._valDet.getDiscreteRangeValues()||(t=this.fillTimeByRange(this._valDet.getContinuousRangeValues(),this._valDet.getDiscreteRangeValues(),this._newvalue));return t},n.prototype.add2Time=function(t,n,i){for(var o,a=t,s=new e.StringBuilder;a<this._newvalue.length&&!r.UtilStrByteMode.isDigit(this._newvalue[a]);)a++;if(a===this._newvalue.length)return n.Append("00".toString()),t;for(o=a;o<a+2&&o<this._newvalue.length;o++){if(!r.UtilStrByteMode.isDigit(this._newvalue[o])){s.Insert(0,"0");break}s.Append(this._newvalue[o])}o===this._newvalue.length&&o===a+1?s.Insert(0,"0"):o===this._newvalue.length&&o===a&&s.Append("00".toString());var _=e.NNumber.Parse(s.ToString());if(_<0||_>59&&i===r.PICInterface.PIC_MMT||_>59&&i===r.PICInterface.PIC_SS)throw new Ot(r.MsgInterface.STR_ERR_TIME);if(i===r.PICInterface.PIC_HH){var l=this.getIsPM(),u=null,P=void 0;if((_>=12||0===_)&&l){var c=_%24;this._isPm=c>=12&&c<24,u=((P=c>12?c-12:0===c?12:c)>9?"":"0")+P}else _>99&&!l&&(u="99");null!=u&&(s.Remove(0,s.Length),s.Append(u.toString()))}return n.Append(s.ToString()),o},n.prototype.addPM2Time=function(t,e){var r;return-1!==(r=this._newvalue.toUpperCase().indexOf("AM",t))?(e.Append("am"),r+2):-1!==(r=this._newvalue.toUpperCase().indexOf("PM",t))?(e.Append("pm"),r+2):this._isPm?(e.Append("pm"),t):(e.Append("am"),t)},n.prototype.getIsPM=function(){for(var t=0;t<this._picture.length;t++)if(this._picture.charCodeAt(t)===r.PICInterface.PIC_PM)return!0;return!1},n.prototype.fillTimeByRange=function(t,e,r){var n,i,o,a=this._valDet.getPIC(),s=$.Instance.fromNativeTimeToMgTimeNumber(r,a);if(this.setValidationFailed(!1),null!=t)for(o=0;o<t.length-1;o++)if(n=$.Instance.a_2_time(t.get_Item(o),a,!1),i=$.Instance.a_2_time(t.get_Item(++o),a,!1),s>=n&&s<=i)return new Date(r);if(null!=e)for(o=0;o<e.length;o++)if(s===$.Instance.a_2_time(e.get_Item(o),a,!1))return new Date(r);throw new Ot},n.prototype.printMessage=function(t,n){var i,o=new e.StringBuilder("");if(t===r.MsgInterface.EDT_ERR_STR_1){var a=this._valDet.getPIC(),s=E.GetMessageString(t);s=r.StrUtil.replaceStringTokens(s,"%d",1,a.getWholes().toString()),s=r.StrUtil.replaceStringTokens(s,"%d",1,a.getDec().toString()),o.Append(s)}else o.Append(E.GetMessageString(t)),t===r.MsgInterface.STR_RNG_TXT&&null!=this._valDet.getRange()&&o.Append(r.StrUtil.makePrintableTokens(this._valDet.getRange(),r.HTML_2_STR));if(null!=this._valDet.getControl()&&(i=this._valDet.getControl().Type)!==r.MgControlType.CTRL_TYPE_BUTTON&&i!==r.MgControlType.CTRL_TYPE_RADIO&&!this._valDet.getControl().isSelectionCtrl()){var _=o.ToString();this._valDet.getControl().getForm().getTask().WriteToMessagePane(r.StrUtil.makePrintable2(_),!0),this._valDet.getControl().getForm().ErrorOccured=!e.NString.IsNullOrEmpty(_),this._valDet.ErrorMessage=o.ToString()}n&&this.setValidationFailed(!0)},n.prototype.changeStringInside=function(t,e){this._newvalue=this._newvalue.substr(0,e)+t+this._newvalue.substr(e+t.length)},n.prototype.init=function(t){this._valDet=t,this._valDet.setNull(!1),this._isPm=!1;var e=this._valDet.getPIC();this._oldvalue=this._valDet.getOldValue(),this._newvalue=this._valDet.getDispValue(),null===this._newvalue&&(null!=e&&e.getAttr()==r.StorageAttribute.DATE||(this._newvalue="")),null===this._oldvalue&&(this._oldvalue=""),null!==e&&e.getAttr()!==r.StorageAttribute.BLOB&&e.getAttr()!==r.StorageAttribute.BLOB_VECTOR&&(this._picture=e.getMask(),this.hebrew=e.isHebrew(),this._picture=this._picture.substr(0,e.getMaskSize()))},n.prototype.findMax=function(t){for(var e=0,r=t[e],n=1;n<t.length;n++)t[n]>r&&(r=t[n],e=n);return e},n.prototype.isDataPositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_YY||e===r.PICInterface.PIC_YYYY||e===r.PICInterface.PIC_MMD||e===r.PICInterface.PIC_MMM||e===r.PICInterface.PIC_DD||e===r.PICInterface.PIC_DDD||e===r.PICInterface.PIC_DDDD||e===r.PICInterface.PIC_W||e===r.PICInterface.PIC_WWW||e===r.PICInterface.PIC_HYYYYY||e===r.PICInterface.PIC_HL||e===r.PICInterface.PIC_HDD||e===r.PICInterface.PIC_YJ||e===r.PICInterface.PIC_JY1||e===r.PICInterface.PIC_JY2||e===r.PICInterface.PIC_JY4||e===r.PICInterface.PIC_BB},n.prototype.isDatePositionalNumericDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_YY||e===r.PICInterface.PIC_YYYY||e===r.PICInterface.PIC_MMD||e===r.PICInterface.PIC_DD||e===r.PICInterface.PIC_DDD||e===r.PICInterface.PIC_DDDD||e===r.PICInterface.PIC_W||e===r.PICInterface.PIC_HYYYYY||e===r.PICInterface.PIC_HL||e===r.PICInterface.PIC_HDD||e===r.PICInterface.PIC_YJ||e===r.PICInterface.PIC_JY1||e===r.PICInterface.PIC_JY2||e===r.PICInterface.PIC_JY4||e===r.PICInterface.PIC_BB},n.prototype.isNumericPositionalDirective=function(t){return t.charCodeAt(0)===r.PICInterface.PIC_N},n.prototype.isLogicPositionalDirective=function(t){return t.charCodeAt(0)===r.PICInterface.PIC_X},n.prototype.isTimePositionalDirective=function(t){var e=t.charCodeAt(0);return e===r.PICInterface.PIC_HH||e===r.PICInterface.PIC_MMT||e===r.PICInterface.PIC_SS||e===r.PICInterface.PIC_PM||e===r.PICInterface.PIC_MS},n.prototype.indexOfPositionalNonDirective=function(t){for(var e,r=0;r<t.length;r++)if(e=t[r],!($.isAlphaPositionalDirective(e)||this.isDataPositionalDirective(e)||this.isNumericPositionalDirective(e)||this.isLogicPositionalDirective(e)||this.isTimePositionalDirective(e)))return r;return-1},n.prototype.setValidationFailed=function(t){this._valDet.ValidationFailed||this._valDet.setValidationFailed(t)},n.prototype.digitsBeforeDelimeter=function(t,r,n){var i=0,o=t.indexOf(n,r);o<0&&(o=t.length);for(var a=r;a<o;a++)e.NChar.IsDigit(t[a])&&i++;return i},n.prototype.isNullDisplayVal=function(){var t=!1,e=this._valDet.getControl().getField();if(e.NullAllowed&&e.hasNullDisplayValue()){var r=e.getNullDisplay();t=null!==r?r.toString()===this._newvalue:null===this._newvalue}return t},n}(),Rt=function(t){function n(e,r,i,o,a){var s=t.call(this)||this;return s._control=null,s._fieldValidator=null,s._picData=null,s._pictureEnable=null,s._pictureReal=null,s._isNull=!1,s._oldvalue=null,s._val=null,s._validationFailed=!1,s.errMessage=null,s.constructor_3(),5===arguments.length?s.constructor_0(e,r,i,o,a):1!==arguments.length||null!==e&&e.constructor!==String?1===arguments.length&&(null===e||e instanceof n)&&s.constructor_2(e):s.constructor_1(e),s}return a(n,t),Object.defineProperty(n.prototype,"ErrorMessage",{get:function(){return this.errMessage},set:function(t){this.errMessage=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ValidationFailed",{get:function(){return this._validationFailed},enumerable:!1,configurable:!0}),n.prototype.constructor_0=function(t,n,i,o,a){switch(this._picData=o,this._oldvalue=t,this._val=n,this._range=i,this._control=a,o.getAttr()){case r.StorageAttribute.NUMERIC:this._pictureReal=new e.StringBuilder(this._picData.getMaskSize()),this._pictureEnable=new e.StringBuilder(this._picData.getMaskSize()),this.getRealNumericPicture();break;case r.StorageAttribute.BOOLEAN:null==this._range&&(this._range="True,False");break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:break;default:E.WriteExceptionToLog("ValidationDetails.ValidationDetails: There is no type "+this._picData.getAttr())}null!=this._range&&this.fillRange(),i=null},n.prototype.constructor_1=function(t){this.constructor_3(),this._range=t,null!==this._range&&this.fillRange()},n.prototype.constructor_2=function(t){this.constructor_3(),this._oldvalue=t.getOldValue(),this._val=t._val,this._range=t.getRange(),this._control=t.getControl(),this._validationFailed=!1,null!==t._pictureReal&&(this._pictureReal=new e.StringBuilder(t._pictureReal.ToString())),null!==t._pictureEnable&&(this._pictureEnable=new e.StringBuilder(t._pictureEnable.ToString())),null!==t.getDiscreteRangeValues()&&(this._discreteRangeValues=t.CloneDiscreteRangeValues()),null!=t.getContinuousRangeValues()&&(this._continuousRangeValues=t.CloneContinuousRangeValues()),this._picData=t.getPIC(),this._isNull=t.getIsNull()},n.prototype.constructor_3=function(){this._fieldValidator=new gt},n.prototype.getRealNumericPicture=function(){for(var t=this._picData.getMask(),e=this._picData.getDec(),n=this._picData.getWholes(),i=this._picData.withDecimal(),o=this._picData.decInFirstPos(),a=this._picData.isNegative(),s=!0,_=!1,l=0,u=0;u<this._picData.getMaskSize();u+=1)switch(l=+t.charAt(u)){case r.PICInterface.PIC_N:if(s){a&&this.setPictures("-","0"),o?(this.setPictures(".","1"),_=!0):n>0&&(n--,this.setPictures("#","0")),s=!1;break}i?n>0?(n--,this.setPictures("#","0")):0!==n||_?e>0&&(e--,this.setPictures("#","0")):(this.setPictures(".","1"),_=!0):n>0&&(n--,this.setPictures("#","0"));break;default:this.setPictures(l.toString(),"1")}E.WriteDevToLog(this._pictureReal.ToString()),E.WriteDevToLog(this._pictureEnable.ToString())},n.prototype.setPictures=function(t,e){this._pictureEnable.Append(e),this._pictureReal.Append(t)},n.prototype.setValue=function(t){this._val=t},n.prototype.setOldValue=function(t){this._oldvalue=t},n.prototype.setRange=function(t){this._range=t},n.prototype.setValidationFailed=function(t){this._validationFailed=t},n.prototype.setNull=function(t){this._isNull=t},n.prototype.getDispValue=function(){if("string"==typeof this._val){var t=this._picData.getMinimumValueLength();if(this._val.length>t&&(t>0||r.StrUtil.rtrim(this._val).length>0)){var e=this._val.substr(t);this._val=this._val.substr(0,t),this._val=this._val+r.StrUtil.rtrim(e)}}else null!=this._control&&this._control.isChoiceControl()&&(this._val=this._val.toString());return this._val},n.prototype.getOldValue=function(){return this._oldvalue},n.prototype.getType=function(){return this._picData.getAttr()},n.prototype.getPictureReal=function(){return this._pictureReal.ToString()},n.prototype.getPictureEnable=function(){return this._pictureEnable.ToString()},n.prototype.getIsNegative=function(){return this._picData.isNegative()},n.prototype.getIsPadFill=function(){return this._picData.padFill()},n.prototype.getPadFillChar=function(){return this._picData.getPad()},n.prototype.getIsZeroFill=function(){return this._picData.zeroFill()},n.prototype.getZeroFillChar=function(){return this._picData.getZeroPad()},n.prototype.getNegativeSignPref=function(){return this._picData.getNegPref_()},n.prototype.getRange=function(){return this._range},n.prototype.getControl=function(){return this._control},n.prototype.getPIC=function(){return this._picData},n.prototype.getIsNull=function(){return this._isNull},n.prototype.evaluate=function(){return this._fieldValidator.checkVal(this)},n.prototype.CloneDiscreteRangeValues=function(){var t=new e.List;return t.AddRange(this._discreteRangeValues.GetEnumerator()),t},n.prototype.CloneContinuousRangeValues=function(){var t=new e.List;return t.AddRange(this._continuousRangeValues.GetEnumerator()),t},n}(j),St=W.DEFAULT_VALUE_INT,Ct=function(){function t(t,e){this._id=0,this._type=r.StorageAttribute.NONE,this._refCount=0,this._nullFlags=null,this._isNumericType=!1,this._numVals=null,this._linkVals=null,this._dispVals=null,t&&(this._id=-2),this._isNumericType=!1}return Object.defineProperty(t.prototype,"HasReferences",{get:function(){return this._refCount>0},enumerable:!1,configurable:!0}),t.prototype.GetAttr=function(){return this._type},t.prototype.setType=function(t){this._type=t,this._type===r.StorageAttribute.MEMO&&(this._type=r.StorageAttribute.ALPHA),this._type!==r.StorageAttribute.NUMERIC&&this._type!==r.StorageAttribute.DATE&&this._type!==r.StorageAttribute.TIME||(this._isNumericType=!0)},t.prototype.SetID=function(t){this._id=t},t.prototype.SetDisplayValues=function(t){this._dispVals=null!==t?t.slice():null},t.prototype.SetLinkValues=function(t){this._linkVals=null!==t?t.slice():null,this.setNumericVals()},t.prototype.setNullFlags=function(t){this._nullFlags=null!==t?t.slice():null},t.prototype.setNumericVals=function(){if(this._isNumericType&&null!==this._linkVals){this._numVals=new Array(this._linkVals.length);for(var t=0;t<this._linkVals.length;t+=1)this._numVals[t]=new Z(this._linkVals[t])}else this._numVals=null},t.prototype.getId=function(){return this._id},t.prototype.getDispVals=function(){return this._dispVals},t.prototype.GetLinkVals=function(){return this._linkVals},t.prototype.getIndexOf=function(t,e,n,i,o,a){var s,_,l,u,P=St,c=null,T=null,h=0,E=-1,p=-1,I="",f=null,O=null;if(n){var g=0;for(f=[St],g=0;null!==this._nullFlags&&g<this._nullFlags.length;g++)if(this._nullFlags[g]){f[0]=g;break}return f}e?O=new at(t).GetCellValues():O=a?t.split(","):[t];f=new Array(O.length);for(var R=0;R<O.length;R+=1){P=St,u=St,s=O[R],this._isNumericType||null!==o?(_=new Z(s),l=s):(_=null,l=r.StrUtil.rtrim(s));for(g=0;g<2&&P===St;g++){if(0===g)c=i,T=o,h=0;else h=this._isNumericType||null!=T?null==T?0:T.length:null==c?0:c.length,c=this._linkVals,T=this._numVals;if(null!=c)for(var S=0;S<c.length&&P===St;S++)if(this._isNumericType||null!=T){if(0===Z.num_cmp(_,T[S])||s===c[S]||s===c[S]){P=S+h;break}}else{if(c[S]===s||l.length>0&&r.StrUtil.rtrim(c[S])===l){P=S+h;break}if(0===l.length&&0===r.StrUtil.rtrim(c[S]).length){P=S+h;break}P===St&&l.length>0&&(p=Math.min(l.length,c[S].length),(I=l.substr(0,p)).length>0&&c[S].startsWith(I)&&p>E&&(u=S+h,E=p))}}P===St&&(P=u),f[R]=P}return f},t.prototype.getLinkValue=function(t){var e=null;return null!==this._linkVals&&(e=this._linkVals[t]),e},t.prototype.isNull=function(t){return null!=this._nullFlags&&this._nullFlags[t]},t.prototype.AddReference=function(){this._refCount++},t.prototype.RemoveReference=function(){if(this._refCount--,this._refCount<0)throw new e.ApplicationException("in dcVals.decrease() references count is less than zero")},t.prototype.ToString=function(){return e.NString.Format("{{DCValues 0x{0:X8}, {1} refs}}",this._id,this._refCount)},t}(),dt=function(){function t(t,e){this.CtlIndex=0,this.ObjectISN=0,this.CtlIndex=t,this.ObjectISN=e}return t.prototype.toString=function(){return"{Object Ref: "+this.CtlIndex+","+this.ObjectISN+"}"},t.FromXML=function(t){this.ParsedReference=null;try{null!==t&&r.JSON_Utils.JSONFromXML(t,this.FillFromJSON.bind(this))}catch(t){E.WriteExceptionToLog(t)}return this.ParsedReference},t.FillFromJSON=function(e,n){if(null!=e)throw e;var i=n[r.XMLConstants.MG_TAG_OBJECT_REFERENCE].$,o=+i.ctl_idx,a=+i.isn;this.ParsedReference=new t(o,a)},t}();dt.ParsedReference=null;var At=function(){function e(){}return e.SetFocus=function(t,r,n,i){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return t instanceof ct?[4,e.SetFocus_0(t,r)]:[3,2];case 1:case 3:return o.sent(),[2];case 2:return[4,e.SetFocus_1(t,r,n,i)]}}))}))},e.SetFocus_0=function(t,r){return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return[4,e.SetFocus(t.getForm().getTask(),t,r,!0)];case 1:return n.sent(),[2]}}))}))},e.SetFocus_1=function(e,r,n,i){return s(this,void 0,void 0,(function(){var o,a;return _(this,(function(s){switch(s.label){case 0:return(o=e).isAborting()?[2]:(E.OnCtrlFocus(e,r),null===r?[3,2]:[4,r.isParkable(!0)]);case 1:return s.sent()?(F.addBoolWithLine(t.CommandType.SET_FOCUS,r,n>=0?n:r.getDisplayLine(!1),i),[3,3]):[2];case 2:a=o.IsSubForm?o.getForm().getSubFormCtrl():o.getForm(),F.addBoolWithLine(t.CommandType.SET_FOCUS,a,0,i),s.label=3;case 3:return[2]}}))}))},e}(),Lt=function(i){function o(t,n,o){var a=i.call(this)||this;return a._ditIdx=0,a._linkedControls=null,a._field=null,a._nodeIdField=null,a._nodeParentIdField=null,a._picStr=null,a._choiceDisps=null,a._choiceLayerList=null,a._choiceLinks=null,a._choiceNums=null,a._containerDitIdx=-1,a._currReadOnly=null,a._dataCtrl=!1,a._dcTableRefs=null,a._firstRefreshProperties=!0,a._form=null,a._hasValidItmAndDispVal=!1,a._id=-1,a._controlIsn=-1,a._linkedParentDitIdx=-1,a._orgChoiceDisps=null,a._parentTable=null,a._pic=null,a._picExpExists=!1,a._prevIsNulls=null,a._prevPicExpResult=null,a._prevValues=null,a._propTab=null,a._range=null,a._rangeChanged=!1,a._rtfVal=e.NString.Empty,a._valExpId=0,a._vd=null,a._dcValId=-2,a.parent=0,a.veeIndx=0,a.DNObjectReferenceField=null,a.SourceTableReference=null,a.ClipBoardDataExists=!1,a.DataType=r.StorageAttribute.NONE,a.KeyStrokeOn=!1,a.ModifiedByUser=!1,a.Value=null,a.IsNull=!1,a.forceRefresh=!1,a.RefreshOnVisible=!1,a.InControl=!1,a.ValidateControl=!1,a.PromptHelp=null,0===arguments.length?(a.constructor_0(),a):(a.constructor_1(t,n,o),a)}return a(o,i),Object.defineProperty(o.prototype,"Form",{get:function(){return this._form},set:function(t){this._form=t,this.GuiMgForm=t},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"Id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"ControlIsn",{get:function(){return this._controlIsn},enumerable:!1,configurable:!0}),o.prototype.constructor_0=function(){this._linkedControls=new e.List,this.DataType=r.StorageAttribute.NONE},o.prototype.constructor_1=function(t,e,r){this.constructor_0(),this.initReferences(e),this.Type=t,this._containerDitIdx=r,this._linkedParentDitIdx=r,this._propTab=new ft(this),this.createArrays(!1)},Object.defineProperty(o.prototype,"UniqueName",{get:function(){return this.Name},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"TaskTag",{get:function(){return this.Form.getTask().getTaskTag()},enumerable:!1,configurable:!0}),o.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},o.prototype.getProp=function(t){var e=null;return null!==this._propTab&&null===(e=this._propTab.getPropById(t))&&null!==(e=pt.getDefaultProp(t,"C",this))&&this._propTab.addProp(e),e},o.prototype.getForm=function(){return this.Form},o.prototype.getCompIdx=function(){return this.getForm().getTask().getCompIdx()},o.prototype.IsFirstRefreshOfProps=function(){return this._firstRefreshProperties},o.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){return _(this,(function(s){switch(s.label){case 0:return[4,this.getForm().getTask().EvaluateExpression(t,e,r,n,i,o,a)];case 1:return[2,s.sent()]}}))}))},o.prototype.GetExpressionStorage=function(t){return this.getForm().getTask().GetExpressionStorage(t)},o.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},o.prototype.initReferences=function(t){this.Form=t},o.prototype.createArrays=function(t){(this._firstRefreshProperties||t)&&(this.SupportsDataSource()&&(this._dcTableRefs=new e.List),this._prevValues=new e.List,t||(this._currReadOnly=new e.List),this._choiceDisps=new e.List,this._orgChoiceDisps=new e.List,this._choiceLinks=new e.List,this._choiceNums=new e.List,this._prevIsNulls=new e.List,this._choiceLayerList=new e.List,this.IsRepeatable||i.prototype.isTableControl.call(this)||this.updateArrays(1))},o.prototype.SetFocus=function(t,e,r,n){return s(this,void 0,void 0,(function(){return _(this,(function(r){switch(r.label){case 0:return[4,At.SetFocus(t.getForm().getTask(),t,e,n)];case 1:return r.sent(),[2]}}))}))},o.prototype.InsertArrays=function(t,e){this._prevValues.InsertRange(t,new Array(e)),this._prevIsNulls.InsertRange(t,new Array(e)),this._currReadOnly.InsertRange(t,new Array(e)),this._choiceDisps.InsertRange(t,new Array(e)),this._orgChoiceDisps.InsertRange(t,new Array(e)),this._choiceLinks.InsertRange(t,new Array(e)),this._choiceLayerList.InsertRange(t,new Array(e)),this._choiceNums.InsertRange(t,new Array(e)),this.SupportsDataSource()&&this._dcTableRefs.InsertRange(t,new Array(e)),this._propTab.InsertPrevValueArray(t,e)},o.prototype.updateArrays=function(t){this._prevValues.SetSize(t),this._prevIsNulls.SetSize(t),this._currReadOnly.SetSize(t),this._choiceDisps.SetSize(t),this._orgChoiceDisps.SetSize(t),this._choiceLinks.SetSize(t),this._choiceLayerList.SetSize(t),this._choiceNums.SetSize(t),this.SupportsDataSource()&&this._dcTableRefs.SetSize(t),this._propTab.updatePrevValueArray(t)},o.prototype.updatePrevValArrays=function(t){this._propTab.updatePrevValueArray(t)},o.prototype.fillData=function(t,n,o){for(null===this.Form&&this.initReferences(t),this._ditIdx=n;this.initInnerObjects(o.getNextTag(),o););if(this.DataType===r.StorageAttribute.BLOB&&null===this._picStr&&(this._picStr=""),null!==this._picStr&&void 0!==this.DataType)this.setPIC(this._picStr);else switch(this.Type){case r.MgControlType.CTRL_TYPE_IMAGE:case r.MgControlType.CTRL_TYPE_BROWSER:case r.MgControlType.CTRL_TYPE_BUTTON:this.DataType===r.StorageAttribute.NONE&&(this.DataType=r.StorageAttribute.ALPHA);break;case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_COLUMN:case r.MgControlType.CTRL_TYPE_SUBFORM:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_FRAME_SET:case r.MgControlType.CTRL_TYPE_FRAME_FORM:case r.MgControlType.CTRL_TYPE_CONTAINER:case r.MgControlType.CTRL_TYPE_LINE:break;default:E.WriteExceptionToLog(e.NString.Format("in Control.fillData(): missing datatype or picture string for control: {0}",this.Name))}i.prototype.isTableControl.call(this)&&this.Form.setTableCtrl(this),this.createArrays(!1)},o.prototype.initInnerObjects=function(t,n){if(null===t)return!1;if(t===r.XMLConstants.MG_TAG_PROP)null===this._propTab&&(this._propTab=new ft(this)),this._propTab.fillData(this,"C",n);else if(t===r.XMLConstants.MG_TAG_CONTROL)this.parseAttributes(n);else{if("SourceTable"!==t)return t==="/"+r.XMLConstants.MG_TAG_CONTROL?(n.setCurrIndex2EndOfTag(),!1):(E.WriteExceptionToLog(e.NString.Format("There is no such tag in Control. Insert else if to Control.initInnerObjects for {0}",t)),!1);this.ParseSourceTable(n)}return!0},o.prototype.ParseSourceTable=function(t){t.setCurrIndex2EndOfTag();var e=t.ReadToEndOfCurrentElement(),r=dt.FromXML(e.trim());this.SourceTableReference=r,t.setCurrIndex2EndOfTag()},o.prototype.parseAttributes=function(t){var e=t.getXMLdata().indexOf(">",t.getCurrIndex());if(-1!==e&&e<t.getXMLdata().length){var n=t.getXMLsubstring(e);t.add2CurrIndex(n.indexOf(r.XMLConstants.MG_TAG_CONTROL)+r.XMLConstants.MG_TAG_CONTROL.length);for(var i=r.XmlParser.getTokens(t.getXMLsubstring(e),r.XMLConstants.XML_ATTR_DELIM),o=0;o<i.length;o+=2){var a=i.get_Item(o),s=i.get_Item(o+1);this.SetAttribute(a,s)}t.setCurrIndex(e+1)}else E.WriteExceptionToLog("in Control.FillName() out of string bounds")},o.prototype.SetAttribute=function(t,e){var n=!0;switch(t){case r.XMLConstants.MG_ATTR_TYPE:this.Type=e[0];break;case r.XMLConstants.MG_ATTR_DATA_CTRL:this._dataCtrl=r.XmlParser.getBoolean(e);break;case r.XMLConstants.MG_ATTR_LINKED_PARENT:this.setLinkedParentIdx(r.XmlParser.getInt(e));break;case r.XMLConstants.MG_ATTR_CONTAINER:this.setContainer(r.XmlParser.getInt(e));break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(e);break;case r.XMLConstants.MG_ATTR_CONTROL_ISN:this._controlIsn=r.XmlParser.getInt(e);break;case r.XMLConstants.MG_ATTR_IS_MODAL:this._isModal=r.XmlParser.getBoolean(e);break;case r.XMLConstants.MG_ATTR_CONTROL_Z_ORDER:case r.XMLConstants.MG_HOR_ALIGMENT_IS_INHERITED:break;default:n=!1}return n},o.prototype.setImage=function(){var t=this.Value;(null===t||this.IsNull)&&(t=""),this.DataType===r.StorageAttribute.BLOB||this.setImageWithFileName(t)},o.prototype.setImageWithFileName=function(e){null===e&&(e=""),e=E.TranslateLogicalName(e),r.Misc.IsWebUrl(e)||(e="./assets/images/"+e),this.IsImageButton()?F.addOperationWithLine(t.CommandType.SET_STYLE,this,0,r.MagicProperties.ImageFile,e):(F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.Image,e),F.addValueWithLine(t.CommandType.SET_VALUE,this,this.getDisplayLine(!1),e))},o.prototype.setContainer=function(t){this._containerDitIdx=t;var e=null;-1!==this._containerDitIdx&&(e=this.Form.getCtrl(this._containerDitIdx)),null!==e&&e.Type===r.MgControlType.CTRL_TYPE_TABLE&&(this._parentTable=e),this.IsRepeatable=null!==this._parentTable&&!i.prototype.isColumnControl.call(this)},o.prototype.getName=function(){return this.Name},o.prototype.getLinkedControls=function(){return this._linkedControls},o.prototype.isRepeatable=function(){return this.IsRepeatable},o.prototype.IsModal=function(){return this._isModal},o.prototype.getDisplayLine=function(t){var e=0;return(this.IsRepeatable||t&&i.prototype.isTableControl.call(this))&&(e=this.Form.DisplayLine),e},o.prototype.isVisible=function(){var e=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_VISIBLE,!0);return e&&(e=this.isParentPropValue(t.PropInterface.PROP_TYPE_VISIBLE)),e},o.prototype.isEnabled=function(){return this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0)},o.prototype.isModifiable=function(){var e=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MODIFIABLE,!0),n=this.getForm().getTask().getMode()===r.Constants.TASK_MODE_QUERY,i=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MODIFY_IN_QUERY,!1),o=e&&(i||!n);return o&&null!=this._field&&(o=this._field.DbModifiable||this.getForm().getTask().getMode()===r.Constants.TASK_MODE_CREATE),o},o.prototype.getDcVals=function(){var t=this.getForm().getTask().DataView,e=null;return-2===this._dcValId?e=this.DataType===r.StorageAttribute.BLOB_VECTOR?t.getEmptyChoiceForVectors():t.getEmptyChoice():this._dcValId>-1&&(e=t.getDcValues(this._dcValId)),e},o.prototype.getPrevIsNull=function(){var t,e=this.getDisplayLine(!0),r=this._prevIsNulls.get_Item(e);return null===r?(t=!1,this._prevIsNulls.set_Item(e,t)):t=r,t},o.prototype.setPrevIsNull=function(t){this._prevIsNulls.set_Item(this.getDisplayLine(!0),t)},o.prototype.setPIC=function(t){i.prototype.isButton.call(this)?this._picStr=i.prototype.IsImageButton.call(this)?""+r.XMLConstants.FILE_NAME_SIZE.toString():E.Translate(t):this._picStr=t,this._pic=new z(this._picStr,this.DataType,this.getForm().getTask().getCompIdx()),this._dataCtrl&&this._picStr.indexOf("H")>-1&&this._pic.setHebrew()},o.prototype.getPIC=function(){return this._pic},o.prototype.getParent=function(){var t=this.Form;return-1!==this._containerDitIdx?t=this.Form.getCtrl(this._containerDitIdx):this.Form.isSubForm()&&(t=this.Form.getSubFormCtrl()),t},o.prototype.getField=function(){return this._field},o.prototype.setField=function(t){null===t||t instanceof lt?this.setField_0(t):this.setField_1(t)},o.prototype.setField_0=function(t){this._field=t,null!==t&&this._field.SetControl(this)},o.prototype.setField_1=function(t){var r=this.getFieldByValueStr(t);if(null!==r)return this._field=r,void this._field.SetControl(this);throw new e.ApplicationException("in Control.setField(): illegal field identifier: "+t)},o.prototype.setPicStr=function(t,e){this._picStr=t,e>0&&(this._picExpExists=!0)},o.prototype.setRange=function(t){this._range=t,this._vd=null},o.prototype.setValExp=function(t){this._valExpId=t},o.prototype.buildCopyPicture=function(t,e){if(i.prototype.isTableControl.call(this)||i.prototype.isColumnControl.call(this))return null;var r=this.getCopyOfVD();return r.setValue(e),r.setOldValue(t),r},o.prototype.getCopyOfVD=function(){return null===this._vd?new Rt(this.Value,this.Value,this._range,this._pic,this):new Rt(this._vd)},o.prototype.getRanges=function(){return this._range},o.prototype.getRangedValue=function(t){var e;return(e=this.buildCopyPicture(this.Value,t)).evaluate(),e.getDispValue().toString()},o.prototype.validate=function(t){var e,r=this.ModifiedByUser;return this.ModifiedByUser=!0,(e=this.buildCopyPicture(this.Value,t)).evaluate(),this.ModifiedByUser=r,e.ValidationFailed?e.ErrorMessage:null},o.prototype.getFieldByValueStr=function(t){var r=new e.RefParam(this.parent),n=new e.RefParam(this.veeIndx),i=this.getForm().getTask().getFieldByValueStr(t,r,n);return this.parent=r.value,this.veeIndx=n.value,i},o.prototype.hasContainer=function(){return-1!==this._containerDitIdx},o.prototype.getLayer=function(){return this.Layer},o.prototype.computePIC=function(t){var e=null!==t&&i.prototype.isButton.call(this)?E.Translate(t):t;return null!==this._prevPicExpResult&&this._prevPicExpResult===e||(this._pic=new z(e,this.DataType,this.getForm().getTask().getCompIdx()),this._prevPicExpResult=e),this._pic},o.prototype.getCurrentIndexOfChoice=function(){var t=[-1],r=this.Value;if(!e.NString.IsNullOrEmpty(r)){var n=r.split(",");t=new Array(n.length);for(var i=0;i<n.length;i+=1){var o=e.NNumber.Parse(n[i]);t[i]=o>=0?o:-1}}return t},o.prototype.IsMultipleSelectionListBox=function(){return i.prototype.isListBox.call(this)},o.prototype.IsDateTimePicture=function(){return this._pic.getAttr()===r.StorageAttribute.DATE||this._pic.getAttr()===r.StorageAttribute.TIME},o.prototype.SupportsDataSource=function(){return i.prototype.isSelectionCtrl.call(this)||i.prototype.isTabControl.call(this)||i.prototype.isRadio.call(this)||this.HasAutocomplete()},o.prototype.HasAutocomplete=function(){return!!i.prototype.isTextControl.call(this)&&this.getProp(t.PropInterface.PROP_TYPE_AUTO_COMPLETE_MODE_WC).GetComputedValueBoolean()},o.prototype.getIndexOfChoice=function(t,e,n){return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:return i=this.IsMultipleSelectionListBox(),[4,this.computeChoice(e)];case 1:return a.sent(),o=null!==this.getField()&&this.getField().getType()===r.StorageAttribute.BLOB_VECTOR,[2,this.getDcVals().getIndexOf(t,o,n,this._choiceLinks.get_Item(e),this._choiceNums.get_Item(e),i)]}}))}))},o.prototype.getDispVals=function(t,e){var r=Object.create(null,{isTabControl:{get:function(){return i.prototype.isTabControl}}});return s(this,void 0,void 0,(function(){return _(this,(function(n){switch(n.label){case 0:return e?[4,this.computeChoice(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return r.isTabControl.call(this)?[2,this._orgChoiceDisps.get_Item(t)]:[2,this._choiceDisps.get_Item(t)]}}))}))},o.prototype.emptyChoice=function(t){var e=new Array(0);this._choiceDisps.set_Item(t,e),this._orgChoiceDisps.set_Item(t,e),this._choiceLinks.set_Item(t,e),this._choiceLayerList.set_Item(t,e)},o.prototype.computeChoice=function(n){var o=Object.create(null,{isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u,P,c,T,h,p,I,f,O,g,R,S,C,d,A,L,m,N,y,M,D,b,v,B,Y,U,G,V,k;return _(this,(function(_){switch(_.label){case 0:i=["\\\\","\\-","\\,"],a=["XX","XX","XX"],s=this.getForm().getTask(),l=s.DataView,u=l.getDcValues(this._dcValId),P=this.getDcRef(),c=null,T="",h=!0,p=-1,I=this.DataType,f=!1,_.label=1;case 1:return _.trys.push([1,7,,8]),null===this._choiceLinks.get_Item(n)||this.isDataCtrl()&&P!==this._dcValId?(I===r.StorageAttribute.BLOB_VECTOR&&(I=this.getField().getCellsType()),O=u.getDispVals(),g=this.getProp(t.PropInterface.PROP_TYPE_DISPLAY_LIST),R=this.getProp(t.PropInterface.PROP_TYPE_LABEL),null===g?[3,3]:[4,g.getValue()]):[3,6];case 2:c=_.sent(),_.label=3;case 3:return null===R?[3,5]:[4,R.getValue()];case 4:T=_.sent(),_.label=5;case 5:for(null!==T&&0!==r.StrUtil.rtrim(T).length||(T=""),null!==c&&0!==r.StrUtil.rtrim(c).length||(c=this.isDataCtrl()&&null!==O&&0!==O.length?T="":T,f=!0),c=E.Translate(c),I===r.StorageAttribute.NUMERIC&&(T=r.StrUtil.searchAndReplace(T,"\\-","-")),S=r.StrUtil.searchAndReplace(T,i,a),C=r.StrUtil.tokenize(S,","),d=""!==S?C.length:0,A=r.StrUtil.searchAndReplace(c,i,a),C=r.StrUtil.tokenize(A,","),L=""!==A?C.length:0,d!==L&&L>0&&(c=T,f=!0),m=d,N=new Array(m),this._choiceLinks.set_Item(n,N),I!==r.StorageAttribute.NUMERIC&&I!==r.StorageAttribute.DATE&&I!==r.StorageAttribute.TIME||this._choiceNums.set_Item(n,new Array(m)),y=r.ChoiceUtils.GetDisplayListFromString(c,!1,!0,!f),this._orgChoiceDisps.set_Item(n,y),M=r.ChoiceUtils.GetDisplayListFromString(c,o.isSelectionCtrl.call(this)||o.isTabControl.call(this),!0,!f),this._choiceDisps.set_Item(n,M),null!==this.getField()&&(p=this.getField().getSize()),D=null,b=null,v=void 0,B=0,Y=0,U=0;B<m&&h;B++)switch(U=Y,(U=S.indexOf(",",U))===Y?D=b="":-1===U?(D=T.substr(Y),b=S.substr(Y)):(D=T.substr(Y,U-Y),b=S.substr(Y,U-Y)),Y=U+1,I){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB_VECTOR:if(D=r.StrUtil.ltrim(D),(b=r.StrUtil.ltrim(b)).indexOf("\\")>=0){for(v=new e.StringBuilder,G=0;G<b.length;G++)"\\"!==b[G]?v.Append(D[G]):G===b.length-1&&v.Append(" ");D=v.ToString()}D=r.StrUtil.makePrintableTokens(D,r.SEQ_2_STR),(this.isSelectionCtrl()||this.isTabControl())&&(D=r.ChoiceUtils.RemoveAcclCharFromOptions(new e.StringBuilder(D))),r.UtilStrByteMode.isLocaleDefLangDBCS()&&I===r.StorageAttribute.ALPHA?-1!==p&&r.UtilStrByteMode.lenB(D)>p&&(D=r.UtilStrByteMode.leftB(D,p)):-1!==p&&D.length>p&&(D=D.substr(0,p)),N[B]=D;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:V=z.buildPicture(I,D,s.getCompIdx(),!1),h=this.optionIsValid(D),N[B]=$.Instance.disp2mg(D.trim(),T,V,s.getCompIdx(),K.CONTENT_TYPE_UNKNOWN),this._choiceNums.get_Item(n)[B]=new Z(N[B]);break;case r.StorageAttribute.BOOLEAN:N[B]=(1-B).toString()}h||this.emptyChoice(n),_.label=6;case 6:return[3,8];case 7:if(!((k=_.sent())instanceof e.Exception))throw k;return h=!1,this.emptyChoice(n),E.WriteExceptionToLog(e.NString.Format("{0} : {1}",k.GetType(),k.Message)),[3,8];case 8:return this._hasValidItmAndDispVal=h,[2]}}))}))},o.prototype.getTopMostForm=function(){return this.getForm().getTopMostForm()},o.prototype.setUrl=function(){F.addValueWithLine(t.CommandType.SET_VALUE,this,0,this.Value)},o.prototype.getMgValue=function(t){var r=Object.create(null,{isCheckBox:{get:function(){return i.prototype.isCheckBox}},isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isRadio:{get:function(){return i.prototype.isRadio}}});return s(this,void 0,void 0,(function(){var n,i,o,a;return _(this,(function(s){switch(s.label){case 0:return n=null,r.isCheckBox.call(this)?(n=t?"1":"0",[3,6]):[3,1];case 1:return r.isSelectionCtrl.call(this)||r.isTabControl.call(this)||r.isRadio.call(this)?((i=this.getDisplayLine(!0))<0&&(i=0),"number"==typeof t&&(t=t.toString()),Array.isArray(t)&&(t=t.join(",").toString()),""!==t?[3,2]:(n=t,[3,4])):[3,5];case 2:return[4,this.getLinkValue(t,i)];case 3:n=s.sent(),s.label=4;case 4:return null===n&&(!1,o=new e.RefParam(n),new e.RefParam(false),null!==this._field&&(n=o.value)),[3,6];case 5:a=null!==this._field?this._field.getContentType():K.CONTENT_TYPE_UNKNOWN,n=$.Instance.disp2mg(t,this._range,this._pic,this.getForm().getTask().getCompIdx(),a),s.label=6;case 6:return[2,n]}}))}))},o.prototype.getLinkValue=function(t,n){return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,P,c,T,h,E;return _(this,(function(_){switch(_.label){case 0:return i=0,o=e.NString.Empty,a=new e.List,[4,this.computeChoice(n)];case 1:for(_.sent(),null!==(s=this._choiceLinks.get_Item(n))&&(i=s.length),l=this.getLinkIdxFromLayer(r.Misc.GetIntArray(t)),u=l,P=0;P<u.length;P+=1)(c=u[P])>=i?(T=this.getDcVals(),a.push(T.getLinkValue(c-i))):c>=0&&c<s.length?a.push(s[c]):a.push(null);if(this.DataType===r.StorageAttribute.BLOB_VECTOR){for(h=new at(this.getField()),E=0;E<a.length;E+=1)h.setVecCell(E+1,a.get_Item(E),null===a.get_Item(E));o=h.toString()}else o=a.length>1?a.join(","):a.get_Item(0);return[2,o]}}))}))},o.prototype.setText=function(){var e=this.getDisplayLine(!0),r=this.Value;i.prototype.isButton.call(this)&&(r=E.Translate(this.Value)),this.isTextControl()||this.isButton()?F.addValueWithLine(t.CommandType.SET_VALUE,this,e,r):F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.Text,r)},o.prototype.setRadioChecked=function(e){F.addValueWithLine(t.CommandType.SET_VALUE,this,this.getDisplayLine(!1),e),F.beginInvoke(),e!==W.DEFAULT_VALUE_INT&&this.setControlToFocus()},o.prototype.setControlToFocus=function(){null!==this.getField()&&(this.getField().ControlToFocus=this)},o.prototype.setCheckBoxValue=function(e,r){var n=$.toBoolean(r);F.addValueWithLine(t.CommandType.SET_VALUE,this,e,n)},o.prototype.refreshAndSetItemListByDataSource=function(t,e){return s(this,void 0,void 0,(function(){var r;return _(this,(function(n){switch(n.label){case 0:return this.SupportsDataSource()?(r=this.getDcRef(),this._rangeChanged&&(e=!0),this._rangeChanged=!1,this.isDataCtrl()&&r!==this._dcValId?(e=!0,[4,this.refreshAndSetItemsList(t,!0)]):[3,2]):[3,2];case 1:n.sent(),this.setDcRef(this._dcValId),n.label=2;case 2:return[2,e]}}))}))},o.prototype.setDcRef=function(t){this._dcTableRefs.set_Item(this.getDcLineNum(),t)},o.prototype.setImageList=function(t){},o.prototype.updatePropertyLogicNesting=function(e,r,n,i){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return i&&F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),r===t.CommandType.PROP_SET_VISIBLE?t.HtmlProperties.Visible:t.HtmlProperties.Enabled,n),[4,this.updateChildrenPropValue(e,r,n)];case 1:return o.sent(),[2]}}))}))},o.prototype.SetEnabled=function(e){F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.Enabled,e)},o.prototype.updateChildrenPropValue=function(e,r,n){var o=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isSubform:{get:function(){return i.prototype.isSubform}}});return s(this,void 0,void 0,(function(){var i,a,s,l;return _(this,(function(_){switch(_.label){case 0:if(o.isTableControl.call(this))return[3,6];i=0,_.label=1;case 1:return i<this._linkedControls.length?(a=this._linkedControls.get_Item(i)).IsFirstRefreshOfProps()?[3,3]:(s=(s=a.GetComputedBooleanProperty(e,!0))&&n,l=this.isChildOnCurrentLayer(a),r!==t.CommandType.PROP_SET_VISIBLE?[3,3]:(s&&(s=l),[4,a.updateChildrenPropValue(e,r,s)])):[3,4];case 2:_.sent(),_.label=3;case 3:return i+=1,[3,1];case 4:return o.isSubform.call(this)?[4,this.updateSubformChildrenPropValue(e,r,n)]:[3,6];case 5:_.sent(),_.label=6;case 6:return[2]}}))}))},o.prototype.isDescendentOfControl=function(t){var e=!1;if(null!==t){var n=this.getParent();if(n instanceof o)if(n===t)e=!0;else{var i=n instanceof o?n:null;e=t.Type===r.MgControlType.CTRL_TYPE_COLUMN&&null!==i&&i.Type===r.MgControlType.CTRL_TYPE_TABLE&&t.Layer===this.Layer||n.isDescendentOfControl(t)}}return e},o.prototype.updateSubformChildrenPropValue=function(t,e,r){},o.prototype.isChildOnCurrentLayer=function(t){var e=!0;if(i.prototype.isChoiceControl.call(this)){var r=0;null!==this.Value&&(r=this.getCurrentLinkIdx()+1);var n=t.getLayer();r!==n&&n>0&&(e=!1)}return e},o.prototype.getCurrentLinkIdx=function(){var t=0;if(i.prototype.isChoiceControl.call(this)||this.HasAutocomplete()){var e=this.getCurrentIndexOfChoice();t=this.getLinkIdxFromLayer(e)[0]}return t},o.prototype.getLayerFromLinkIdx=function(t){for(var e=new Array(t.length),r=0;r<t.length;r+=1){var n=t[r];if(e[r]=n,i.prototype.isTabControl.call(this)&&n>=0){var o=this.getDisplayLine(!1);o<0&&(o=0);var a=this._choiceLayerList.get_Item(o);null!==a&&a.length>0&&(e[r]=a.indexOf((n+1).toString()))}}return e},o.prototype.getLinkIdxFromLayer=function(t){for(var r=new Array(t.length),n=0;n<t.length;n+=1){var o=t[n];if(r[n]=o,i.prototype.isTabControl.call(this))if(o<0)r[n]=0;else{var a=this.getDisplayLine(!1);a<0&&(a=0);var s=this._choiceLayerList.get_Item(a);null!=s&&0!==s.length&&o<s.length&&(r[n]=e.NNumber.Parse(s[o])-1)}}return r},o.prototype.isParentPropValue=function(t){var e=this.Form.getControlColumn(this),r=this.getLinkedParent(!0);return null===r||!!r.GetComputedBooleanProperty(t,!0)&&(!!r.isChildOnCurrentLayer(this)&&(!(null!==e&&!e.GetComputedBooleanProperty(t,!0))&&r.isParentPropValue(t)))},o.prototype.getLinkedParent=function(t){return-1!==this._linkedParentDitIdx?this.Form.getCtrl(this._linkedParentDitIdx):t&&this.Form.isSubForm()?this.Form.getSubFormCtrl():null},o.prototype.SetCurrReadOnly=function(t){this._currReadOnly.set_Item(this.getDisplayLine(!0),t)},o.prototype.GetCurrReadOnly=function(){var t,e=i.prototype.isTableControl.call(this)?0:this.getDisplayLine(!0),r=this._currReadOnly.get_Item(e);return null===r?(t=!1,this._currReadOnly.set_Item(e,t)):t=r,t},o.prototype.isDataCtrl=function(){return this._dataCtrl},o.prototype.getDcRef=function(){var t,e=this.getDcLineNum(),r=this._dcTableRefs.get_Item(this.getDcLineNum());return null===r?(t=-2,this._dcTableRefs.set_Item(e,t)):t=r,t},o.prototype.getDcLineNum=function(){return this.IsRepeatable?this.Form.DisplayLine:0},o.prototype.optionIsValid=function(t){var e=!0;if(this.DataType===r.StorageAttribute.NUMERIC&&t.length>0&&-1===t.indexOf("0")){var n=new Z;n.num_4_a_std(t),n.num_is_zero()&&(e=!1)}return e},o.prototype.getOrderedDispList=function(n,i){return s(this,void 0,void 0,(function(){var o,a,s,l,u,P,c,T,h,E,p,I;return _(this,(function(_){switch(_.label){case 0:return o="",a=new e.List,s=new e.List,null===(l=this.getProp(t.PropInterface.PROP_TYPE_VISIBLE_LAYERS_LIST))?[3,2]:[4,l.getValue()];case 1:o=_.sent(),_.label=2;case 2:if(null!==o&&0!==r.StrUtil.rtrim(o).length||(o=""),o.length>0&&n.length>0)for(u=o.split(","),P=-1,c=0;c<u.length;c+=1)T=u[c].trim(),-1===s.indexOf(T)&&(h=new e.RefParam(P),E=e.NNumber.TryParse(T,h),P=h.value,E&&P>0&&P<=n.length&&(a.push(n[P-1].trim()),s.push(T)));if(0===a.length)p=n,this._choiceLayerList.set_Item(i,new Array(0));else{for(p=new Array(a.length),I=0;I<p.length;++I)p[I]=null;p=a.ToArray(),this._choiceLayerList.set_Item(i,s.ToArray())}return[2,p]}}))}))},o.prototype.resetPrevVal=function(){var t=this.getDisplayLine(!0);t<0&&(t=0),this._prevValues.set_Item(t,null),this.setPrevIsNull_ToNull()},o.prototype.setPrevIsNull_ToNull=function(){this._prevIsNulls.set_Item(this.getDisplayLine(!0),null)},o.prototype.expressionSetAsData=function(){return this._valExpId>0},o.prototype.clearRange=function(t){this._orgChoiceDisps.set_Item(t,null),this._choiceDisps.set_Item(t,null),this._choiceLinks.set_Item(t,null),this._choiceLayerList.set_Item(t,null)},o.prototype.haveToCheckParentValue=function(){var t=!1;return-1!==this._linkedParentDitIdx?this.isContainedInLinkedParent()?(this.Form.getCtrl(this._linkedParentDitIdx).isTabControl()||this.Form.getCtrl(this._linkedParentDitIdx).isGroup())&&(t=!0):t=!0:this.Form.isSubForm()&&(t=!0),t},o.prototype.isContainedInLinkedParent=function(){return-1!==this._containerDitIdx&&this._containerDitIdx===this._linkedParentDitIdx},o.combineStringArrays=function(t,e){var r=new Array;return null!==t&&(r=r.concat(t)),null!==e&&(r=r.concat(e)),r},o.prototype.GetComputedBooleanProperty=function(t,e,r){return 2!==arguments.length||null!==t&&t.constructor!==Number||null!==e&&e.constructor!==Boolean?this.GetComputedBooleanProperty_1(t,e,r):this.GetComputedBooleanProperty_0(t,e)},o.prototype.GetComputedBooleanProperty_0=function(t,e){var r=e,n=this.GetComputedProperty(t);return null!==n&&(r=n.GetComputedValueBoolean()),r},o.prototype.GetComputedBooleanProperty_1=function(t,e,r){var n=e;if(this.isPropertyRepeatable(t)&&this.Form.DisplayLine!==r){var i=this.GetComputedProperty(t);if(null!==i){var o=i.getPrevValue(r);null!==o&&(n=$.toBoolean(o))}}else n=this.GetComputedBooleanProperty(t,e);return n},o.prototype.checkPropWithLine=function(t,e,r){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return n=e,this.isPropertyRepeatable(t)&&this.Form.DisplayLine!==r?(null!==(i=this.getProp(t))&&null!==(o=i.getPrevValue(r))&&(n=$.toBoolean(o)),[3,3]):[3,1];case 1:return[4,this.checkProp(t,e)];case 2:n=a.sent(),a.label=3;case 3:return[2,n]}}))}))},o.prototype.checkProp=function(t,e){return s(this,void 0,void 0,(function(){var r,n;return _(this,(function(i){switch(i.label){case 0:return r=e,null===(n=this.getProp(t))?[3,2]:[4,n.getValueBoolean()];case 1:r=i.sent(),i.label=2;case 2:return[2,r]}}))}))},o.prototype.isPropertyRepeatable=function(t){return!!this.IsRepeatable||i.prototype.isTableControl.call(this)&&pt.isRepeatableInTable(t)},o.prototype.SetAndRefreshDisplayValue=function(t,n){var o=Object.create(null,{isChoiceControl:{get:function(){return i.prototype.isChoiceControl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isCheckBox:{get:function(){return i.prototype.isCheckBox}},isImageControl:{get:function(){return i.prototype.isImageControl}},IsImageButton:{get:function(){return i.prototype.IsImageButton}},isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u;return _(this,(function(_){switch(_.label){case 0:return i=!0,null!==t?[3,1]:(this.Value="",n||(t=_t.getMagicDefaultValue(this.DataType)),[3,6]);case 1:return o.isChoiceControl.call(this)?((a=this.getDisplayLine(!0))<0&&(a=0),l=this.getLayerFromLinkIdx,[4,this.getIndexOfChoice(t,a,n)]):[3,6];case 2:return(s=l.apply(this,[_.sent()]))[0]<0&&o.isTabControl.call(this)?(s[0]=0,[4,this.getLinkValue(s[0].toString(),a)]):[3,5];case 3:return t=_.sent(),n=!1,null===this._field||null===t?[3,5]:[4,this._field.getTask().UpdateFieldValueAndStartRecompute(this._field,t,n)];case 4:_.sent(),_.label=5;case 5:this.Value=r.Misc.GetCommaSeperatedString(s),i=!1,_.label=6;case 6:if(i)if(o.isCheckBox.call(this)||null!==this._field&&n&&this._field.hasNullDisplayValue())this.isCheckBox()?this.Value=$.toBoolean(t):this.Value=t;else try{o.isImageControl.call(this)&&this.DataType===r.StorageAttribute.BLOB||o.IsImageButton.call(this)?this.Value=t:null!==this._field||!n||this.DataType!==r.StorageAttribute.NUMERIC&&this.DataType!==r.StorageAttribute.DATE&&this.DataType!==r.StorageAttribute.TIME&&this.DataType!==r.StorageAttribute.BOOLEAN?(u=this.InControl,this.Value=$.Instance.mg2disp(t,this._range,this._pic,!0,o.isSelectionCtrl.call(this),this.getForm().getTask().getCompIdx(),u)):this.Value=t,"string"!=typeof this.Value||this._pic.isAttrNumeric()&&!this._pic.isLeft()||this.rtrimValue()}catch(r){if(!(r instanceof e.ApplicationException))throw r;E.WriteExceptionToLog(new e.ApplicationException(e.NString.Format("Control: '{0}', mgval: {1}",this.Name,t),r)),this.Value="",t=_t.getMagicDefaultValue(this.DataType)}return(o.isImageControl.call(this)&&this.DataType!==r.StorageAttribute.BLOB||o.IsImageButton.call(this))&&(t=E.TranslateLogicalName(t)),this.IsNull=n,[4,this.RefreshDisplayValue(t)];case 7:return _.sent(),[2]}}))}))},o.prototype.UpdateModifiedByUser=function(t){if(!i.prototype.isButton.call(this)&&!i.prototype.isImageControl.call(this)){var e=this.IsNull,r=this.isDifferentValue(t,!1,!1);r||this.CanGetNullFromControlValue()&&(r=e!==this.isNullValue(t)),(r||this.KeyStrokeOn)&&(this.ModifiedByUser=!0)}},o.prototype.rtrimValue=function(){if(i.prototype.isImageControl.call(this)&&this.DataType===r.StorageAttribute.BLOB||i.prototype.IsImageButton.call(this))this.Value=e.NString.TrimEnd(this.Value);else{var t=this.getMinimumValueLength();if(this.Value.length>t){var n=this.Value.substr(t);this.Value=this.Value.substr(0,t),this.Value=this.Value+r.StrUtil.rtrimWithNull(n,!0)}i.prototype.isTextControl.call(this)&&this.DataType===r.StorageAttribute.NUMERIC&&(this.Value=e.NString.TrimEnd(this.Value))}},o.prototype.getMinimumValueLength=function(){for(var t=this._pic.getMaskLength();t>0&&!this._pic.picIsMask(t-1);)t-=1;return t},o.prototype.isNullValue=function(t){var e=!1;return this.CanGetNullFromControlValue()&&""===t&&(e=!0),e},o.prototype.CanGetNullFromControlValue=function(){return!1},o.prototype.isChoiceNull=function(t){return t>=0?this.getDcVals().isNull(t):void 0},o.prototype.ComputeAndRefreshDisplayValue=function(t){var n=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isColumnControl:{get:function(){return i.prototype.isColumnControl}}});return s(this,void 0,void 0,(function(){var i,o,a,s,l,u,P;return _(this,(function(_){switch(_.label){case 0:return t&&this.resetPrevVal(),this._valExpId>0?(i=void 0,o=new e.RefParam(i),[4,this.EvaluateExpression(this._valExpId,this.DataType,this._pic.getSize(),!0,r.StorageAttribute.SKIP,!1,o)]):[3,4];case 1:return a=_.sent(),(i=o.value)?[4,this.SetAndRefreshDisplayValue(a,null===a)]:[3,3];case 2:_.sent(),_.label=3;case 3:return[3,8];case 4:return null===this._field?[3,6]:(s=e.NString.Empty,l=!1,u=new e.RefParam(s),P=new e.RefParam(l),this._field.getTask().getFieldDisplayValue(this._field,u,P),s=u.value,l=P.value,[4,this.SetAndRefreshDisplayValue(s,l)]);case 5:return _.sent(),[3,8];case 6:return n.isTableControl.call(this)||n.isColumnControl.call(this)?[3,8]:[4,this.RefreshDisplayValue(this.Value)];case 7:_.sent(),_.label=8;case 8:return[2]}}))}))},o.prototype.ShouldRefreshOnControlEnter=function(){return this.Type===r.MgControlType.CTRL_TYPE_TEXT&&null!==this.getField()&&(this.getField().getType()===r.StorageAttribute.DATE||this.getField().getType()===r.StorageAttribute.TIME||this.getField().getType()===r.StorageAttribute.NUMERIC)},o.prototype.RefreshDisplayValue=function(n){var o=Object.create(null,{isChoiceControl:{get:function(){return i.prototype.isChoiceControl}}});return s(this,void 0,void 0,(function(){var i,a,s,l,u,P,c,T,h,p,I,f,O;return _(this,(function(_){switch(_.label){case 0:i=this.getDisplayLine(!0),s=a=!0,i<0&&(i=0),_.label=1;case 1:switch(_.trys.push([1,21,,22]),l=this._prevValues.get_Item(i),u=this.getPrevIsNull(),r.StorageAttributeCheck.IsTypeAlphaOrUnicode(this.DataType)?((r.StrUtil.rtrim(n)===r.StrUtil.rtrim(l)||null!==n&&r.StrUtil.rtrim(n)===r.StrUtil.rtrim(l))&&(a=!1),u!==this.IsNull&&(a=!0)):((n===l||null!==n&&n===l)&&(a=!1),u!==this.IsNull&&(a=!0)),this._prevValues.set_Item(i,n),this.setPrevIsNull(this.IsNull),this.Type){case r.MgControlType.CTRL_TYPE_TABLE:case r.MgControlType.CTRL_TYPE_COLUMN:case r.MgControlType.CTRL_TYPE_LABEL:case r.MgControlType.CTRL_TYPE_SUBFORM:case r.MgControlType.CTRL_TYPE_GROUP:case r.MgControlType.CTRL_TYPE_STATUS_BAR:case r.MgControlType.CTRL_TYPE_FRAME_SET:case r.MgControlType.CTRL_TYPE_CONTAINER:case r.MgControlType.CTRL_TYPE_FRAME_FORM:case r.MgControlType.CTRL_TYPE_SB_LABEL:case r.MgControlType.CTRL_TYPE_LINE:return[3,2];case r.MgControlType.CTRL_TYPE_BROWSER:return[3,3];case r.MgControlType.CTRL_TYPE_IMAGE:case r.MgControlType.CTRL_TYPE_SB_IMAGE:return[3,4];case r.MgControlType.CTRL_TYPE_CHECKBOX:return[3,5];case r.MgControlType.CTRL_TYPE_TAB:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:return[3,6];case r.MgControlType.CTRL_TYPE_BUTTON:case r.MgControlType.CTRL_TYPE_TEXT:return[3,11];case r.MgControlType.CTRL_TYPE_RADIO:return[3,14]}return[3,16];case 2:return[2];case 3:return a&&null!=this.Value&&this.setUrl(),[2];case 4:return a&&null!=this.Value&&this.setImage(),[2];case 5:return(a||this.forceRefresh)&&this.setCheckBoxValue(i,n),[2];case 6:return s=a,[4,this.refreshAndSetItemListByDataSource(i,a)];case 7:return(a=_.sent())?(P=null,s!==a||null===l?[3,9]:(c=this.getLayerFromLinkIdx,[4,this.getIndexOfChoice(l,i,u)])):[3,10];case 8:for(P=c.apply(this,[_.sent()]),T=0;T<P.length;T+=1)P[T]===W.DEFAULT_VALUE_INT&&(P[T]=W.DEFAULT_LIST_VALUE);_.label=9;case 9:h=r.Misc.GetIntArray(this.Value),this.isTabControl()&&(p=this.getCurrentLinkIdx(),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,i,t.HtmlProperties.SelectedValue,h[0].toString()),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,i,t.HtmlProperties.SelectedLayer,p.toString())),this.IsMultipleSelectionListBox()?F.addValueWithLine(t.CommandType.SET_VALUE,this,i,h):F.addValueWithLine(t.CommandType.SET_VALUE,this,i,+this.Value),_.label=10;case 10:return[3,17];case 11:return this.HasAutocomplete()?[4,this.refreshAndSetItemListByDataSource(i,a)]:[3,13];case 12:_.sent(),_.label=13;case 13:return a?(this.IsImageButton()?this.setImageWithFileName(this.Value):this.setText(),[3,17]):[2];case 14:return[4,this.refreshAndSetItemListByDataSource(i,a)];case 15:return(a=_.sent())?(this.setRadioChecked(this.Value),[3,17]):[2];case 16:return E.WriteExceptionToLog(e.NString.Format("in Control.RefreshDisplayValue() unknown type: {0}",this.Type)),[2];case 17:return o.isChoiceControl.call(this)&&a?(I=this.updatePropertyLogicNesting,f=[t.PropInterface.PROP_TYPE_VISIBLE,t.CommandType.PROP_SET_VISIBLE],[4,this.checkProp(t.PropInterface.PROP_TYPE_VISIBLE,!0)]):[3,20];case 18:return[4,I.apply(this,f.concat([_.sent(),!1]))];case 19:_.sent(),_.label=20;case 20:return[3,22];case 21:if(!((O=_.sent())instanceof e.Exception))throw O;return E.WriteExceptionToLog(e.NString.Format("in Control.RefreshDisplayValue() for control: {0}",this.Name)),[3,22];case 22:return[2]}}))}))},o.prototype.RefreshDisplay=function(t){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return n.isNullOrUndefined(t)&&(t=!1),[4,this.RefreshDisplay_1(t)];case 1:return e.sent(),[2]}}))}))},o.prototype.RefreshDisplay_1=function(e){var r=Object.create(null,{isSubform:{get:function(){return i.prototype.isSubform}}});return s(this,void 0,void 0,(function(){var n,i,o,a,s;return _(this,(function(_){switch(_.label){case 0:return r.isSubform.call(this)&&null!==this.GetSubformMgForm()&&this.GetSubformMgForm().inRefreshDisplay()?[3,11]:[4,this.refreshProperties(e)];case 1:return _.sent(),this.ShouldComputeAndRefreshOnClosedForm()?[4,this.ComputeAndRefreshDisplayValue(!1)]:[3,3];case 2:_.sent(),_.label=3;case 3:return[4,this.isParkable(!1)];case 4:return(i=!_.sent())?[3,6]:[4,this.isModifiable()];case 5:i=!_.sent(),_.label=6;case 6:return n=i,this.GetCurrReadOnly()===n?[3,8]:(this.SetCurrReadOnly(n),[4,X.SetReadOnlyControl(this,n)]);case 7:_.sent(),_.label=8;case 8:return null!=(o=this.GetComputedProperty(t.PropInterface.PROP_TYPE_MUST_INPUT))&&o.isExpression()?(a=this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_MUST_INPUT,!1),s=a,[4,this.checkProp(t.PropInterface.PROP_TYPE_MUST_INPUT,!1)]):[3,10];case 9:s!==_.sent()&&F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.MustInput,!a),_.label=10;case 10:this.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_TAB_IN,!0)||F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,this.getDisplayLine(!1),t.HtmlProperties.TabIndex,-1),_.label=11;case 11:return[2]}}))}))},o.prototype.ShouldComputeAndRefreshOnClosedForm=function(){return!0},o.prototype.refreshProperties=function(n){return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:if(null!==this._field&&this.DataType!==r.StorageAttribute.NONE&&this._firstRefreshProperties&&F.addWithNumber(t.CommandType.SET_ATTRIBUTE,this,this.DataType.charCodeAt(0)),null===this._propTab)return[3,6];a.label=1;case 1:return a.trys.push([1,5,,6]),this._firstRefreshProperties?(this.createDefaultProps(),[4,this.ZoomButtonInitialization()]):[3,3];case 2:a.sent(),a.label=3;case 3:return[4,this._propTab.RefreshDisplay(!1,n)];case 4:return a.sent()||E.WriteExceptionToLog(e.NString.Format("Control '{0}': Not all properties could be set",this.getName())),this._firstRefreshProperties&&(n||(this._firstRefreshProperties=!1)),[3,6];case 5:if(!((i=a.sent())instanceof e.Exception))throw i;return o=new e.StringBuilder(e.NString.Format("Control '{0}': {1}",this.getName(),i.Message)),E.WriteExceptionToLog(o.ToString()),[3,6];case 6:return[2]}}))}))},o.prototype.refreshTabForLayerList=function(t){return s(this,void 0,void 0,(function(){var e,r,n;return _(this,(function(i){switch(i.label){case 0:return e=null,this.getForm().Opened?(r=this.getCurrentIndexOfChoice(),n=r[0],[4,this.getLinkValue(n.toString(),t)]):[3,2];case 1:e=i.sent(),i.label=2;case 2:return[4,this.refreshAndSetItemsList(t,!1)];case 3:return i.sent(),this.getForm().Opened?[4,this.SetAndRefreshDisplayValue(e,this.IsNull)]:[3,5];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},o.prototype.refreshAndSetItemsListForRadioButton=function(e,r){return s(this,void 0,void 0,(function(){var n,i;return _(this,(function(o){switch(o.label){case 0:return[4,this.refreshDispRange(r)];case 1:return n=o.sent(),i=n.map((function(t,e,r){return{index:e.toString(),displayValue:t}})),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.ItemsList,i),[2]}}))}))},o.prototype.refreshAndSetItemsList=function(e,r){var n=Object.create(null,{isSelectionCtrl:{get:function(){return i.prototype.isSelectionCtrl}},isTabControl:{get:function(){return i.prototype.isTabControl}},isRadio:{get:function(){return i.prototype.isRadio}}});return s(this,void 0,void 0,(function(){var i,o;return _(this,(function(a){switch(a.label){case 0:return r&&this.clearRange(e),[4,this.refreshDispRange(r)];case 1:return i=a.sent(),n.isSelectionCtrl.call(this)||n.isTabControl.call(this)||this.HasAutocomplete()?(o=i.map((function(t,e,r){return{index:e,displayValue:t}})),F.addOperationWithLine(t.CommandType.SET_PROPERTY,this,e,t.HtmlProperties.ItemsList,o),[3,4]):[3,2];case 2:return n.isRadio.call(this)?[4,this.refreshAndSetItemsListForRadioButton(e,r)]:[3,4];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))},o.prototype.refreshDispRange=function(t){return s(this,void 0,void 0,(function(){var e,r,n,i,a;return _(this,(function(s){switch(s.label){case 0:return e=new Array(0),(r=this.getDisplayLine(!0))<0&&(r=0),this.SupportsDataSource()?(n=this.getForm().getTask().DataView,i=n.getDcValues(this._dcValId),[4,this.getDispVals(r,t)]):[3,2];case 1:return a=s.sent(),this._hasValidItmAndDispVal&&(e=o.combineStringArrays(a,i.getDispVals())),[3,4];case 2:return[4,this.getDispVals(r,t)];case 3:e=s.sent(),s.label=4;case 4:return this._rangeChanged=!0,[4,this.getOrderedDispList(e,r)];case 5:return[2,s.sent()]}}))}))},o.prototype.refreshItmRange=function(t){return s(this,void 0,void 0,(function(){var r,n,i,a,s;return _(this,(function(_){switch(_.label){case 0:return e.Debug.Assert(this.SupportsDataSource()),r=new Array(0),(n=this.getDisplayLine(!1))<0&&(n=0),t?[4,this.computeChoice(n)]:[3,2];case 1:_.sent(),_.label=2;case 2:return i=this._choiceLinks.get_Item(n),a=this.getForm().getTask().DataView,s=a.getDcValues(this._dcValId),this._hasValidItmAndDispVal&&(r=o.combineStringArrays(i,s.GetLinkVals())),[4,this.getOrderedDispList(r,n)];case 3:return[2,_.sent()]}}))}))},o.prototype.GetItemsRange=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.refreshItmRange(!1)];case 1:return[2,t.sent()]}}))}))},o.prototype.GetDisplayRange=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.refreshDispRange(!1)];case 1:return[2,t.sent()]}}))}))},o.prototype.createDefaultProps=function(){this.getProp(t.PropInterface.PROP_TYPE_VISIBLE),this.getProp(t.PropInterface.PROP_TYPE_ENABLED),i.prototype.isTableControl.call(this)&&this.getProp(t.PropInterface.PROP_TYPE_SCROLL_BAR)},o.prototype.setLinkedParentIdx=function(t){this._linkedParentDitIdx=t},o.prototype.buildPicture=function(t,e){return i.prototype.isTableControl.call(this)||i.prototype.isColumnControl.call(this)?null:(this._picExpExists&&(this._vd=null),null===this._vd?this._vd=new Rt(t,e,this._range,this._pic,this):(this._vd.setValue(e),this._vd.setOldValue(t)),this._vd)},o.prototype.isDifferentValue=function(t,e,n){var i=this.Value,o=!1;if(t instanceof Date&&(o=this.DataType===r.StorageAttribute.DATE?!this.CompareDate(t,i):!this.CompareTime(t,i)),"boolean"==typeof t||"number"==typeof t)o=this.isSelectionCtrl()&&"string"==typeof i?t.toString()!==i:t!==i;else if(this.isSelectionCtrl()&&"string"==typeof i&&Array.isArray(t)){var a=t.join(",").toString();o=!(r.StrUtil.rtrim(a)===r.StrUtil.rtrim(i))}else{var s=this.IsNull;!(o=!(r.StrUtil.rtrim(t)===r.StrUtil.rtrim(i)))&&n&&(o=e!==s)}return o},o.prototype.CompareDate=function(t,e){var r;return null===t&&null===e?r=!0:null===t&&null!==e||null!==t&&null===e?r=!1:t.getFullYear()===e.getFullYear()&&t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&(r=!0),r},o.prototype.CompareTime=function(t,e){var r;return null===t&&null===e?r=!0:null===t&&null!==e||null!==t&&null===e?r=!1:t.getHours()===e.getHours()&&t.getMinutes()===e.getMinutes()&&t.getSeconds()===e.getSeconds()&&(r=!0),r},o.prototype.isColumnSortable=function(){var e=!1;return this.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._propTab.propExists(t.PropInterface.PROP_TYPE_SORT_COLUMN)&&(e=this.GetComputedProperty(t.PropInterface.PROP_TYPE_SORT_COLUMN).GetComputedValueBoolean()),e},o.prototype.getColumnChildControl=function(){var t=this;return this.Type!==r.MgControlType.CTRL_TYPE_COLUMN?null:this._parentTable.getLinkedControls().find((function(e){return e.getLayer()===t.getLayer()&&e.Type!==r.MgControlType.CTRL_TYPE_COLUMN&&!e.IsTableHeaderChild}))},o.prototype.getControlNameForHandlerSearch=function(){var t=this.getColumnChildControl();return null!==t?t.Name:this.Name},o.prototype.linkCtrl=function(t){this._linkedControls.push(t)},o.prototype.removeRefFromField=function(){null!==this._field&&this._field.RemoveControl(this)},o.prototype.getDitIdx=function(){return this._ditIdx},o.prototype.setDcValId=function(t){this._dcValId=t},o.prototype.SetKeyboardLanguage=function(t){F.beginInvoke()},o.prototype.Init=function(){},o.prototype.IsParkable=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return[4,this.isParkable(!0)];case 1:return[2,t.sent()]}}))}))},o.prototype.HasExpOrParentTaskField=function(){var t=this.getForm().getTask();return null===this.getField()||this.getField().getTask()!==t},o.prototype.isParkable=function(e){var r=Object.create(null,{isTableControl:{get:function(){return i.prototype.isTableControl}},isColumnControl:{get:function(){return i.prototype.isColumnControl}},isSubform:{get:function(){return i.prototype.isSubform}},isBrowserControl:{get:function(){return i.prototype.isBrowserControl}}});return s(this,void 0,void 0,(function(){var n,i;return _(this,(function(o){return n=!r.isTableControl.call(this)&&!r.isColumnControl.call(this),i=this.getForm().getTask(),n&&(n=i.IsInteractive),n&&i.DataView.isEmptyDataview()&&null!==this._field&&this._field.PartOfDataview&&(n=!1),n&&(r.isSubform.call(this)||(n=null!==this._field&&this._field.getTask()===i||this.isButton()||r.isBrowserControl.call(this)),n&&e&&(n=this.isEnabled()&&this.isVisible()),n&&null!==this._parentTable&&e&&(n=this._parentTable.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0)&&this._parentTable.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_VISIBLE,!0))),[2,n]}))}))},o.prototype.RaiseControlHitOnLeftClickOfMouseDown=function(){var t=!1;return i.prototype.IsHyperTextButton.call(this)||i.prototype.isRadio.call(this)||i.prototype.isTabControl.call(this)||(t=!0),t},o.prototype.GetVarIndex=function(){return 0},o.prototype.RaiseControlHitOnMouseDown=function(t){var e=!1;return t&&this.RaiseControlHitOnLeftClickOfMouseDown()&&(e=!0),e},o.prototype.OnSubformClick=function(){X.EventsManager.addGuiTriggeredEventWithTaskAndCode(this.getForm().getTask(),r.InternalInterface.MG_ACT_HIT)},o.prototype.GetSubformMgForm=function(){return null},o.prototype.PropertyExists=function(t){return this._propTab.propExists(t)},o.prototype.toString=function(){return"{"+this.constructor.name+": "+r.MgControlType[this.Type]+"}"},o.prototype.isDateZero=function(t){var e=!1;return t instanceof Date&&0===t.getMonth()&&0===t.getFullYear()&&0===t.getDay()&&(e=!0),e},o.prototype.IsDefaultRouterOutlet=function(){return this.Type===r.MgControlType.CTRL_TYPE_SUBFORM&&this.GetComputedBooleanProperty_0(t.PropInterface.PROP_TYPE_DEFAULT_OUTLET,!1)},o.prototype.IsRouterOutlet=function(){return this.Type===r.MgControlType.CTRL_TYPE_SUBFORM&&this.GetComputedBooleanProperty_0(t.PropInterface.PROP_TYPE_IS_ROUTER_OUTLET,!1)},o.prototype.ZoomButtonInitialization=function(){return s(this,void 0,void 0,(function(){var e,n,i,o;return _(this,(function(a){switch(a.label){case 0:return this.isTextControl()&&this.checkIfExistProp(t.PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)?(i=(n=this.Form.CtrlTab).GetControlByIsn,[4,this.getProp(t.PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)]):[3,6];case 1:return[4,a.sent().getValueInt()];case 2:return e=i.apply(n,[a.sent()]),o=null,e.IsImageButton()&&e.PropertyExists(t.PropInterface.PROP_TYPE_IMAGE_FILENAME)?[4,e.getProp(t.PropInterface.PROP_TYPE_IMAGE_FILENAME)]:[3,5];case 3:return[4,a.sent().getValue()];case 4:o=a.sent(),r.Misc.IsWebUrl(o)||(o="./assets/images/"+o),F.addOperationWithLine(t.CommandType.SET_STYLE,this,0,r.MagicProperties.ImageFile,o),a.label=5;case 5:this.ConnectedControl=e,e.ConnectedControl=this,a.label=6;case 6:return[2]}}))}))},o}(ct),mt=function(){function t(){this._controls=null,this._mgForm=null,this._controls=new e.List}return t.prototype.fillData=function(t,e){for(this._mgForm=t;this.initInnerObjects(e.getNextTag(),e););},t.prototype.initInnerObjects=function(t,e){if(null===t)return!1;if(t!==r.XMLConstants.MG_TAG_CONTROL)return t==="/"+r.XMLConstants.MG_TAG_CONTROL&&(e.setCurrIndex2EndOfTag(),!1);var n=this._mgForm.ConstructMgControl();return n.fillData(this._mgForm,this._controls.length,e),this._controls.push(n),!0},t.prototype.getSize=function(){return this._controls.length},t.prototype.getCtrl=function(t){return 1!==arguments.length||null!=t&&t.constructor!==Number?this.getCtrl_1(t):this.getCtrl_0(t)},t.prototype.getCtrl_0=function(t){return t<this.getSize()?this._controls.get_Item(t):null},t.prototype.getCtrl_1=function(t){return e.NString.IsNullOrEmpty(t)?null:this._controls.find((function(r){return e.NString.Equals(t,r.getName(),!0)||e.NString.Equals(t,r.Name,!0)}))},t.prototype.getCtrlByName=function(t,r){return e.NString.IsNullOrEmpty(t)?null:this._controls.find((function(n){return n.Type===r&&e.NString.Equals(t,n.getName(),!0)||e.NString.Equals(t,n.Name,!0)}))},t.prototype.GetControlByIsn=function(t){return this._controls.find((function(e){return e.ControlIsn===t}))},t.prototype.GetControl=function(t){return this._controls.find(t)},t.prototype.filter=function(t){return this._controls.filter(t)},t.prototype.contains=function(t){var e=!1;return null!==t&&(e=this._controls.Contains(t)),e},t.prototype.addControl=function(t){this._controls.push(t)},t.prototype.setControlAt=function(t,e){this._controls.length<=e&&this._controls.SetSize(e+1),this._controls.set_Item(e,t)},t.prototype.deleteControlAt=function(t){this._controls.set_Item(t,null)},t.prototype.Remove=function(t){if(1===arguments.length&&(null===t||t instanceof Lt))return this.Remove_0(t);this.Remove_1(t)},t.prototype.Remove_0=function(t){return this._controls.Remove(t),this._controls.Contains(t)},t.prototype.Remove_1=function(t){this._controls.RemoveAt(t)},t.prototype.getControlIdx=function(t,e){for(var r=0,n=0;n<this._controls.length;n++){var i=this._controls.get_Item(n);if(t===i)return r;!e&&i.isSubform()||r++}return-1},t.SelectDataControlPredicate=function(t){return t.isDataCtrl()},t}(),Nt=function(n){function i(){var t=n.call(this)||this;return t.InInitForm=!1,t.CtrlTab=null,t.FormRefreshed=!1,t.RefreshRepeatableAllowed=!1,t.Rows=null,t.ModalFormsCount=0,t.ErrorOccured=!1,t.FormIsn=0,t.Name=null,t.Opened=!1,t.isLegalForm=!1,t.PBImagesNumber=0,t.ignoreFirstRefreshTable=!1,t.ParentForm=null,t._destTblRow=e.Int32.MinValue,t._firstTableTabOrder=0,t._inRefreshDisp=!1,t._inRestore=!1,t._lastRowSent=-1,t._prevGuiTopIndex=-1,t._propTab=null,t._rowsInPage=1,t._maxRowsInPaginatedTable=0,t._subFormCtrl=null,t._tableMgControl=null,t._tableItemsCount=0,t._tableRefreshed=!1,t._task=null,t._topIndexUpdated=!1,t._transferingData=!1,t._allowedSubformRecompute=!0,t._concreteWindowType=0,t._containerCtrl=null,t._firstRefreshOfProps=!0,t._prevSelIndex=-1,t._shouldCreateToolbar=!1,t._tableChildren=null,t._tableColumns=null,t._userStateId="",t.displayLine=0,t.defaultRouterOutlet=null,t._propTab=new ft(t),t.CtrlTab=new mt,t.Rows=new e.List,t._concreteWindowType=0,t.ParentForm=null,t}return a(i,n),Object.defineProperty(i.prototype,"DisplayLine",{get:function(){return this.displayLine},set:function(t){this.displayLine=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"UniqueName",{get:function(){return null!=this.GetComputedProperty(t.PropInterface.PROP_TYPE_FORM_NAME)?this.GetComputedProperty(t.PropInterface.PROP_TYPE_FORM_NAME).GetComputedValue():null},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskTag",{get:function(){return this.getTask().getTaskTag()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TableChildren",{get:function(){return null===this._tableChildren&&this.buildTableChildren(),this._tableChildren},set:function(t){this._tableChildren=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ShouldCreateToolbar",{get:function(){return this._shouldCreateToolbar},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"AllowedSubformRecompute",{get:function(){return this._allowedSubformRecompute},set:function(t){this._allowedSubformRecompute=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ConcreteWindowType",{get:function(){if(0===this._concreteWindowType){var e=this.GetComputedProperty(t.PropInterface.PROP_TYPE_WINDOW_TYPE).GetComputedValueInteger();null!==this.ParentForm&&e===r.WindowType.Overlay||(e=r.WindowType.Default),this._concreteWindowType=e}return this._concreteWindowType},set:function(t){this._concreteWindowType=t},enumerable:!1,configurable:!0}),i.ShouldPutActOnFormClose=function(){return!1},i.ShouldBehaveAsModal=function(){return!1},i.ConvertArrayListToString=function(t,n){for(var i,o=["\\","-",","],a=["\\\\","\\-","\\,"],s=new e.StringBuilder,_=0;_<t.length;_+=1)n&&(i=new Z(t.get_Item(_)),t.set_Item(_,i.to_double().toString())),s.Append(r.StrUtil.searchAndReplace(t.get_Item(_),o,a)),_<t.length-1&&s.Append(", ");return s.ToString()},i.prototype.UpdateModalFormsCount=function(t,e){e?this.ModalFormsCount+=1:this.ModalFormsCount-=1,E.SetModal(t,e)},i.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){return _(this,(function(o){switch(o.label){case 0:return[4,this._task.EvaluateExpression(t,e,r,n,i,!0,a)];case 1:return[2,o.sent()]}}))}))},i.prototype.GetExpressionStorage=function(t){return this._task.GetExpressionStorage(t)},i.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},i.prototype.getProp=function(t){var e=null;return null!==this._propTab&&null===(e=this._propTab.getPropById(t))&&null!==(e=pt.getDefaultProp(t,W.PARENT_TYPE_FORM,this))&&this._propTab.addProp(e),e},i.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},i.prototype.PropertyHasExpression=function(t){var e=this._propTab.getPropById(t);return null!==e&&e.isExpression()},i.prototype.getCompIdx=function(){return null===this.getTask()?0:this.getTask().getCompIdx()},i.prototype.IsFirstRefreshOfProps=function(){return this._firstRefreshOfProps},i.prototype.getForm=function(){return this},i.prototype.fillData=function(t){var e=X.GetCurrentRuntimeContext().Parser;for(null===this._task&&null!==t&&(this._task=t);this.initInnerObjects(e.getNextTag()););},i.prototype.init=function(){for(var e=0;e<this.CtrlTab.getSize();e+=1){this.CtrlTab.getCtrl(e).Init()}this.buildLinkedControlsLists(),this.buildTableColumnsList(),this.createForm(),this._task.setKeyboardMappingState(r.Constants.ACT_STT_TBL_SCREEN_MODE,this.isScreenMode()),this._task.setKeyboardMappingState(r.Constants.ACT_STT_TBL_LEFT_TO_RIGHT,!this.GetComputedProperty(t.PropInterface.PROP_TYPE_HEBREW).GetComputedValueBoolean())},i.prototype.fillName=function(t){var n=X.GetCurrentRuntimeContext().Parser,i=n.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,n.getCurrIndex());if(-1!==i&&i<n.getXMLdata().length){var o=n.getXMLsubstring(i);n.add2CurrIndex(o.indexOf(t)+t.length);for(var a=r.XmlParser.getTokens(n.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM),s=void 0,_=void 0,l=0;l<a.length;l+=2)switch(s=a.get_Item(l),_=a.get_Item(l+1),s){case r.XMLConstants.MG_ATTR_NAME:this.Name=r.XmlParser.unescape(_).toString(),E.ShouldLog(r.Logger_LogLevels.Gui)&&E.WriteGuiToLog(e.NString.Format('Parsing form "{0}"',this.Name));break;case r.XMLConstants.MG_ATTR_IS_FRAMESET:break;case r.XMLConstants.MG_ATTR_IS_LIGAL_RC_FORM:this.isLegalForm=r.XmlParser.getBoolean(_);break;case r.XMLConstants.MG_ATTR_PB_IMAGES_NUMBER:this.PBImagesNumber=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_FORM_ISN:this.FormIsn=r.XmlParser.getInt(_);break;case r.XMLConstants.MG_ATTR_USERSTATE_ID:this._userStateId=r.XmlParser.unescape(_).toString();break;default:E.WriteExceptionToLog(e.NString.Format("Unhandled attribute '{0}'.",s))}n.setCurrIndex(i+1)}else E.WriteExceptionToLog("in Form.FillName() out of bounds")},i.prototype.createForm=function(){var e=this.GetListOfInputControls(),r=this.buildFormName();this.isSubForm()?F.addOpensubform(t.CommandType.CREATE_SUB_FORM,this.getSubFormCtrl(),this.getTask().getTaskTag(),this.getSubFormCtrl().getName(),r,e,this.getTask().RouterPath,this.getTask().GetRouterParams(),this.getTask().InDefaultRouterOutlet):F.addOpenForm(this,r,"0",this.getTask().getTaskTag(),e,this.isDialog()),this.HasTable()&&this.InitTableControl(),F.beginInvoke()},i.prototype.CallJS=function(t,e){return s(this,void 0,void 0,(function(){return _(this,(function(r){return[2,F.addCallJS(this,this.UniqueName,t,e)]}))}))},i.prototype.isAutomaticTabbingOrder=function(){return this.GetComputedProperty(t.PropInterface.PROP_TYPE_TABBING_ORDER).GetComputedValueInteger()===r.TabbingOrderType.Automatically},i.prototype.isRefreshRepeatableAllowed=function(){return this.RefreshRepeatableAllowed},i.prototype.isScreenMode=function(){return!this.isLineMode()},i.prototype.isLineMode=function(){return null!==this.getMainControl()},i.prototype.hasTable=function(){return null!==this._tableMgControl},i.prototype.isDialog=function(){var t=!1;return(this.ConcreteWindowType===r.WindowType.Overlay||i.ShouldBehaveAsModal())&&(t=!0),t},i.prototype.isSubForm=function(){return null!==this._subFormCtrl},i.prototype.HasTable=function(){return null!==this._tableMgControl},i.prototype.getTopMostForm=function(){for(var t=this;t.isSubForm()&&null!==t.ParentForm;)t=t.ParentForm;return t},i.prototype.getTopMostFrameForm=function(){for(var t=this;null!==t;)t=null!==t.ParentForm?t.ParentForm:null;return t},i.prototype.getSubFormCtrl=function(){return this._subFormCtrl},i.prototype.getCtrl=function(t){return this.CtrlTab.getCtrl(t)},i.prototype.GetCtrl=function(t){return this.CtrlTab.getCtrl(t)},Object.defineProperty(i.prototype,"DefaultRouterOutlet",{get:function(){return null==this.defaultRouterOutlet&&(this.defaultRouterOutlet=this.CtrlTab.GetControl((function(t){return t.IsDefaultRouterOutlet()}))),this.defaultRouterOutlet},enumerable:!1,configurable:!0}),i.prototype.GetChoiceControlItemList=function(t){return s(this,void 0,void 0,(function(){var n,o,a,s,l,u,P,c,T;return _(this,(function(_){switch(_.label){case 0:if(e.Debug.Assert(t.isChoiceControl()),n=new e.List,o=t.getField(),(a=o.getCellsType())===r.StorageAttribute.DATE||a===r.StorageAttribute.TIME)return[3,8];if(!t.isRadio())return[3,5];s=0,_.label=1;case 1:return s<o.GetRadioCtrls().length?(l=o.GetRadioCtrls().get_Item(s),P=(u=n).AddRange,[4,l.GetItemsRange()]):[3,4];case 2:P.apply(u,[_.sent()]),_.label=3;case 3:return s++,[3,1];case 4:return[3,7];case 5:return T=(c=n).AddRange,[4,t.GetItemsRange()];case 6:T.apply(c,[_.sent()]),_.label=7;case 7:return[2,i.ConvertArrayListToString(n,a===r.StorageAttribute.NUMERIC)];case 8:return[2,e.NString.Empty]}}))}))},i.prototype.GetChoiceControlDisplayList=function(t){return s(this,void 0,void 0,(function(){var n,o,a,s,l,u,P,c,T;return _(this,(function(_){switch(_.label){case 0:if(e.Debug.Assert(t.isChoiceControl()),n=new e.List,o=t.getField(),(a=o.getCellsType())===r.StorageAttribute.DATE||a===r.StorageAttribute.TIME)return[3,8];if(!t.isRadio())return[3,5];s=0,_.label=1;case 1:return s<o.GetRadioCtrls().length?(l=o.GetRadioCtrls().get_Item(s),P=(u=n).AddRange,[4,l.GetDisplayRange()]):[3,4];case 2:P.apply(u,[_.sent()]),_.label=3;case 3:return s++,[3,1];case 4:return[3,7];case 5:return T=(c=n).AddRange,[4,t.GetItemsRange()];case 6:T.apply(c,[_.sent()]),_.label=7;case 7:return[2,i.ConvertArrayListToString(n,!1)];case 8:return[2,e.NString.Empty]}}))}))},i.prototype.getControlColumn=function(t){var e=null;return(t.IsRepeatable||t.IsTableHeaderChild)&&null!==this._tableColumns&&(e=this._tableColumns.get_Item(t.getLayer()-1)),e},i.prototype.getContainerCtrl=function(){return this._containerCtrl},i.prototype.getColumnControls=function(){var t=null;if(null!==this.CtrlTab)for(var n=0;n<this.CtrlTab.getSize();n+=1){var i=this.CtrlTab.getCtrl(n);i.Type===r.MgControlType.CTRL_TYPE_COLUMN&&(null===t&&(t=new e.List),t.push(i))}return t},i.prototype.getTask=function(){return this._task},i.prototype.getTableCtrl=function(){return this._tableMgControl},i.prototype.getMainControl=function(){return this._tableMgControl},i.prototype.getCtrlByName=function(t,e){return this.CtrlTab.getCtrlByName(t,e)},i.prototype.checkAndCreateRow=function(t){null===this._tableMgControl||this.isRowCreated(t)||this.createRow(t)},i.prototype.IsValidRow=function(t){var e=!1;if(null!==this._tableMgControl&&t>=0&&t<this.Rows.length){var r=this.Rows.get_Item(t);e=null!==r&&r.Validated}return e},i.prototype.refreshProps=function(){return s(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return this._firstRefreshOfProps&&this.getProp(t.PropInterface.PROP_TYPE_TITLE_BAR),[4,this._propTab.RefreshDisplay(!1,!1)];case 1:return e.sent(),this._firstRefreshOfProps&&(this._firstRefreshOfProps=!1),[2]}}))}))},i.prototype.refreshControls=function(t){return s(this,void 0,void 0,(function(){var n,i,o;return _(this,(function(a){switch(a.label){case 0:return this.DisplayLine===e.Int32.MinValue?[2]:null===this._tableMgControl||t?[3,2]:[4,this._tableMgControl.RefreshDisplay()];case 1:a.sent(),a.label=2;case 2:if(null===this._tableColumns||t)return[3,6];o=0,a.label=3;case 3:return o<this._tableColumns.length?[4,this._tableColumns.get_Item(o).RefreshDisplay()]:[3,6];case 4:a.sent(),a.label=5;case 5:return o+=1,[3,3];case 6:this.checkAndCreateRow(this.DisplayLine),i=new e.Stack,o=0,a.label=7;case 7:return o<this.CtrlTab.getSize()?(!(n=this.CtrlTab.getCtrl(o)).isTabControl()&&!n.isGroup()||t||i.push(n),n.Type===r.MgControlType.CTRL_TYPE_TABLE||n.Type===r.MgControlType.CTRL_TYPE_COLUMN?[3,10]:!n.IsRepeatable&&t?[3,9]:[4,n.RefreshDisplay()]):[3,13];case 8:a.sent(),a.label=9;case 9:return[3,12];case 10:return n.Type===r.MgControlType.CTRL_TYPE_TABLE&&t?[4,n.RefreshDisplay(t)]:[3,12];case 11:a.sent(),a.label=12;case 12:return o+=1,[3,7];case 13:return[2]}}))}))},i.prototype.markRowNOTCreated=function(e){F.addWithNumber(t.CommandType.UNDO_CREATE_TABLE_ROW,this._tableMgControl,e),e>=0&&e<this.Rows.length&&this.Rows.set_Item(e,new yt(!1,!1))},i.prototype.SelectRow=function(t,e){0===arguments.length?this.SelectRow_0():1===arguments.length?this.SelectRow_1(t):this.SelectRow_2(t,e)},i.prototype.getRowsInPage=function(){return this._rowsInPage},i.prototype.getMaxRowsInPaginatedTable=function(){return this._maxRowsInPaginatedTable},i.prototype.setRowsInPage=function(t){this._rowsInPage=t},i.prototype.getColumnsCount=function(){var t=0;if(null!==this.CtrlTab)for(var e=0;e<this.CtrlTab.getSize();e+=1){this.CtrlTab.getCtrl(e).Type===r.MgControlType.CTRL_TYPE_COLUMN&&(t+=1)}return t},i.prototype.inRefreshDisplay=function(){return this._inRefreshDisp},i.prototype.setTitle=function(t){F.setTitle(this,t)},i.prototype.getControlIdx=function(t){return this.CtrlTab.getControlIdx(t,!0)},i.prototype.getTopIndexFromGUI=function(){var t=0;return this.hasTable()&&(t=F.getTopIndex(this.getMainControl())),t},i.prototype.getTableItemsCount=function(){return this._tableItemsCount},i.prototype.removeRefsToCtrls=function(){for(var t=0;t<this.CtrlTab.getSize();t+=1)this.CtrlTab.getCtrl(t).removeRefFromField()},i.prototype.buildTableChildren=function(){if(null===this._tableChildren&&(this._tableChildren=new e.List,null!==this.CtrlTab)){for(var r=2147483647,n=this.isAutomaticTabbingOrder(),i=0;i<this.CtrlTab.getSize();i+=1){var o=this.CtrlTab.getCtrl(i);if((o.IsRepeatable||o.IsTableHeaderChild)&&(this._tableChildren.push(o),n)){var a=o.GetComputedProperty(t.PropInterface.PROP_TYPE_TAB_ORDER);if(null!==a){var s=a.GetComputedValueInteger();s<r&&(r=s)}}}r!==e.Int32.MaxValue&&n&&(this._firstTableTabOrder=r)}},i.prototype.setTableCtrl=function(t){this._tableMgControl=t},i.prototype.getCtrlCount=function(){return this.CtrlTab.getSize()},i.prototype.GetControlsCountExcludingStatusBar=function(){return this.CtrlTab.getSize()},i.prototype.refreshPropsOnExpression=function(){return s(this,void 0,void 0,(function(){var t,e,r;return _(this,(function(n){switch(n.label){case 0:e=null==this._propTab?0:this._propTab.getSize(),r=!1,t=0,n.label=1;case 1:return t<e&&!r?this._propTab.getProp(t).isExpression()?(r=!0,[4,this.refreshProps()]):[3,3]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},i.prototype.getTabControl=function(t){var e,r=null;for(e=t;e instanceof Lt;){var n=e;if(n.isTabControl()){r=n;break}e=n.getParent()}if(null==r)for(var i=0;i<this.CtrlTab.getSize();i++)if((e=this.CtrlTab.getCtrl(i)).isTabControl()){r=e;break}return r},i.prototype.IsInputType=function(t){switch(t.Type){case r.MgControlType.CTRL_TYPE_CHECKBOX:case r.MgControlType.CTRL_TYPE_TEXT:case r.MgControlType.CTRL_TYPE_COMBO:case r.MgControlType.CTRL_TYPE_LIST:case r.MgControlType.CTRL_TYPE_RADIO:return!0;default:return!1}},i.prototype.GetListOfInputControls=function(){var t=this;return this.CtrlTab.filter((function(e,r,n){return t.IsInputType(e)})).reduce((function(t,e,r){return t[e.UniqueName]=e.IsRepeatable?"1":"0",t}),{})},i.prototype.firstTableRefresh=function(){null!==this._tableMgControl&&(this._rowsInPage=F.getRowsInPage(this._tableMgControl),this.RefreshRepeatableAllowed=!0)},i.prototype.SetTableItemsCount=function(t,e,r){"boolean"==typeof e?this.SetTableItemsCount_0(t,e):this.SetTableItemsCount_1(t,e,r)},i.prototype.SetTableItemsCount_0=function(t,e){this.SetTableItemsCount_1(t,t,e)},i.prototype.SetTableItemsCount_1=function(t,e,r){this.InitTableControl(t,e,r)},i.prototype.InitTableControl=function(t,e,r){0!==arguments.length?this.InitTableControl_1(t,e,r):this.InitTableControl_0()},i.prototype.UpdateTableChildrenArraysSize=function(t){var e=this.TableChildren;if(null!=e)for(var r=0;r<e.length;r++){e.get_Item(r).updateArrays(t)}null!=this._tableMgControl&&this._tableMgControl.updateArrays(t)},i.prototype.toString=function(){return"{GuiMgForm: Id="+this._userStateId+"}"},i.prototype.IncludeControlInTabbingOrder=function(e,r){return!!e.PropertyExists(t.PropInterface.PROP_TYPE_TAB_ORDER)},i.prototype.GetHashCode=function(){return this.FormIsn},i.prototype.initInnerObjects=function(t){if(null===t)return!1;var e=X.GetCurrentRuntimeContext().Parser;if(i.IsFormTag(t))this.fillName(t);else if(t===r.XMLConstants.MG_TAG_PROP)this._propTab.fillData(this,"F",e);else{if(t!==r.XMLConstants.MG_TAG_CONTROL)return!!i.IsEndFormTag(t)&&(e.setCurrIndex2EndOfTag(),!1);this.CtrlTab.fillData(this,e),this.HasTable()||(this.RefreshRepeatableAllowed=!0)}return!0},i.prototype.isRowCreated=function(t){if(this.Rows.length<=t||t<0)return!1;var e=this.Rows.get_Item(t);return null!==e&&e.Created},i.prototype.buildLinkedControlsLists=function(){for(var t=0;t<this.CtrlTab.getSize();t+=1){var e=this.CtrlTab.getCtrl(t),r=e.getLinkedParent(!1);null!==r&&r.linkCtrl(e)}},i.prototype.buildTableColumnsList=function(){if(null!==this._tableMgControl){this._tableColumns=new e.List;for(var t=0;t<this.CtrlTab.getSize();t+=1){var n=this.CtrlTab.getCtrl(t);n.Type===r.MgControlType.CTRL_TYPE_COLUMN&&this._tableColumns.push(n)}}},i.prototype.createRow=function(e){F.addWithNumber(t.CommandType.CREATE_TABLE_ROW,this._tableMgControl,e),this.Rows.length<=e&&this.Rows.SetSize(e+1),this.Rows.set_Item(e,new yt(!0,!0))},i.prototype.SelectRow_0=function(){this.SelectRow(!1)},i.prototype.SelectRow_1=function(t){this.SelectRow(this.DisplayLine,t)},i.prototype.SelectRow_2=function(e,r){var n=this.getMainControl();if(null!==n&&this.RefreshRepeatableAllowed){var i=e;this._task.DataView.isEmptyDataview()&&(i=W.NO_ROW_SELECTED),(r||i!==this._prevSelIndex)&&(this._prevSelIndex=i,F.addOperationWithLine(t.CommandType.SET_PROPERTY,n,0,t.HtmlProperties.SelectedRow,i))}},i.prototype.InitTableControl_0=function(){this.InitTableControl(1,1,!1)},i.prototype.InitTableControl_1=function(e,r,n){null!=this._tableMgControl&&(F.addWithNumber(t.CommandType.SET_TABLE_ITEMS_COUNT,this._tableMgControl,r),this._tableItemsCount=r,this.Rows.SetSize(e),this._prevGuiTopIndex=-2,this._prevSelIndex=-2,this.UpdateTableChildrenArraysSize(e),this._maxRowsInPaginatedTable=F.getMaxRowsInPaginatedTable(this._tableMgControl))},i.prototype.InsertTableChildrenArrays=function(t,e){var r=this.TableChildren;if(null!=r)for(var n=0;n<r.length;n++){r[n].InsertArrays(t,e)}},i}(It),yt=function(){function t(t,e){this.Created=!1,this.Validated=!1,0!==arguments.length?this.constructor_1(t,e):this.constructor_0()}return t.prototype.constructor_0=function(){this.Validated=!0},t.prototype.constructor_1=function(t,e){this.Created=t,this.Validated=e},t}(),Mt=function(){function n(){this.RegisterHandlers(),this.RegisterSubclassHandlers()}return n.prototype.RegisterHandlers=function(){E.KeyDownEvent=this.processKeyDown.bind(this),E.MouseDownEvent=this.processMouseDown,E.DblClickEvent=this.processDblClick,E.CloseFormEvent=this.processFormClose,E.ColumnClickEvent=this.ProcessColumnClick},n.prototype.processKeyDown=function(t,e,n,i,o,a,s,_,l,u,P){var c=P,T=e,h=t;return X.EventsManager.AddKeyboardEvent(h,T,n,i,o,a,s,_,l,r.InternalInterface.MG_ACT_CTRL_KEYDOWN),c},n.prototype.processFormClose=function(e){var n=e;return Nt.ShouldPutActOnFormClose()&&X.EventsManager.addGuiTriggeredEventTaskAndCodeAndRaisedBy(n.getTask(),r.InternalInterface.MG_ACT_HIT,t.RaisedBy.CLOSE_SYSTEM_MENU),X.EventsManager.addGuiTriggeredEventWithTaskAndCode(n.getTask(),r.InternalInterface.MG_ACT_CLOSE),!1},n.prototype.processMouseDown=function(t,n,i,o,a,s,_){var l=n;null===l?(e.Debug.Assert(null!==t),X.EventsManager.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(t.getTask(),r.InternalInterface.MG_ACT_HIT,s)):l.isSubform()?l.OnSubformClick():(l.RaiseControlHitOnMouseDown(o)&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(l,r.InternalInterface.MG_ACT_CTRL_HIT,a),o&&_&&l.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&l.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(l,r.InternalInterface.MG_ACT_WEB_CLICK,a))},n.prototype.processDblClick=function(e,n){var i=e;i.GetComputedBooleanProperty(t.PropInterface.PROP_TYPE_ENABLED,!0,n)&&X.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(i,r.InternalInterface.MG_ACT_WEB_ON_DBLICK,n)},n.prototype.ProcessColumnClick=function(t,e,r){var n=t;X.EventsManager.AddColumnClickEvent(n,e,r)},n}(),Dt=function(){function r(e,r,n,i){this._keyCode=0,this._modifier=t.Modifiers.MODIFIER_NONE,this._states=0,this._actionId=0,2===arguments.length?this.constructor_1(e,r):this.constructor_2(e,r,n,i)}return r.prototype.constructor_1=function(t,e){this._keyCode=t,this._modifier=e},r.prototype.constructor_2=function(t,e,r,n){this._actionId=t,this._keyCode=e,this._modifier=r,this._states=n},r.prototype.getKeyCode=function(){return this._keyCode},r.prototype.getModifier=function(){return this._modifier},r.prototype.getStates=function(){return this._states},r.prototype.equals=function(t){return this===t||null!==t&&this._keyCode===t._keyCode&&this._modifier===t._modifier},r.prototype.getAction=function(){return this._actionId},r.prototype.setAction=function(t){this._actionId=t},r.prototype.ToString=function(){var r=new e.StringBuilder,n=0;switch(this._modifier){case t.Modifiers.MODIFIER_ALT:r.Append("Alt+");break;case t.Modifiers.MODIFIER_CTRL:r.Append("Ctrl+");break;case t.Modifiers.MODIFIER_SHIFT:r.Append("Shift+");break;case t.Modifiers.MODIFIER_SHIFT_CTRL:r.Append("Shift+Ctrl+");break;case t.Modifiers.MODIFIER_ALT_CTRL:r.Append("Alt+Ctrl+");break;case t.Modifiers.MODIFIER_ALT_SHIFT:r.Append("Shift+Alt+");case t.Modifiers.MODIFIER_NONE:}switch(this._keyCode){case W.KEY_SPACE:r.Append("Space");break;case W.KEY_PG_UP:r.Append("PgUp");break;case W.KEY_PG_DOWN:r.Append("PgDn");break;case W.KEY_END:r.Append("End");break;case W.KEY_HOME:r.Append("Home");break;case W.KEY_LEFT:r.Append("Left");break;case W.KEY_UP:r.Append("Up");break;case W.KEY_RIGHT:r.Append("Rght");break;case W.KEY_DOWN:r.Append("Down");break;case W.KEY_TAB:r.Append("Tab");break;case W.KEY_INSERT:r.Append("Ins");break;case W.KEY_DELETE:r.Append("Del");break;case W.KEY_RETURN:r.Append("Ent");break;case W.KEY_ESC:r.Append("Esc");break;case W.KEY_BACKSPACE:r.Append("Back");break;default:this._keyCode>=W.KEY_F1&&this._keyCode<=W.KEY_F12?(n=this._keyCode-W.KEY_F1+1,r.Append("F"+n)):this._keyCode>=W.KEY_0&&this._keyCode<=W.KEY_9?(n=this._keyCode-W.KEY_0,r.Append(n)):this._keyCode>=W.KEY_A&&this._keyCode<=W.KEY_Z?(n=this._keyCode-W.KEY_A+"A".charCodeAt(0),r.Append(String.fromCharCode(n))):r.Append("? ("+this._keyCode+")")}return r.ToString()},r}(),bt=function(t,e,r){this.guiMgControl=null,this.Line=0,this.Val=null,this.guiMgControl=t,this.Line=e,this.Val=r},vt=function(){function t(){}return t.prototype.createDialog=function(t){(new G).createDialog(this,t)},t.prototype.closeDialog=function(){},t}(),Bt=function(){};Bt.PROP_STYLE_BUTTON_PUSH=1,Bt.PROP_STYLE_BUTTON_IMAGE=2,Bt.PROP_STYLE_BUTTON_HYPERTEXT=4,Bt.PROP_STYLE_BUTTON_TEXT_ON_IMAGE=8,Bt.PROP_STYLE_HOR_RIGHT=16,Bt.PROP_STYLE_RIGHT_TO_LEFT=32,Bt.PROP_STYLE_HORIZONTAL_SCROLL=64,Bt.PROP_STYLE_VERTICAL_SCROLL=128,Bt.PROP_STYLE_TITLE=256,Bt.PROP_STYLE_CLOSE=512,Bt.PROP_STYLE_MIN=1024,Bt.PROP_STYLE_MAX=2048,Bt.PROP_STYLE_BORDER=4096,Bt.PROP_STYLE_BORDER_STYLE_THIN=8192,Bt.PROP_STYLE_BORDER_STYLE_THICK=16384,Bt.PROP_STYLE_READ_ONLY=32768,Bt.PROP_STYLE_APPEARANCE_CHECK=65536,Bt.PROP_STYLE_APPEARANCE_BUTTON=131072,Bt.PROP_STYLE_WORD_WRAP=262144,Bt.PROP_STYLE_STYLE_FLAT=524288,Bt.PROP_STYLE_TAB_SIDE_TOP=67108864,Bt.PROP_STYLE_TAB_SIDE_BOTTOM=134217728,Bt.PROP_STYLE_NO_BACKGROUND=268435456,Bt.PROP_STYLE_SHOW_LINES=536870912,Bt.PROP_STYLE_HORIZONTAL=1073741824,Bt.PROP_STYLE_VERTICAL=2147483648,Bt.MSGBOX_BUTTON_OK=0,Bt.MSGBOX_BUTTON_OK_CANCEL=1,Bt.MSGBOX_BUTTON_ABORT_RETRY_IGNORE=2,Bt.MSGBOX_BUTTON_YES_NO_CANCEL=3,Bt.MSGBOX_BUTTON_YES_NO=4,Bt.MSGBOX_BUTTON_RETRY_CANCEL=5,Bt.MSGBOX_ICON_ERROR=16,Bt.MSGBOX_ICON_QUESTION=32,Bt.MSGBOX_ICON_EXCLAMATION=48,Bt.MSGBOX_ICON_INFORMATION=64,Bt.MSGBOX_ICON_WARNING=Bt.MSGBOX_ICON_EXCLAMATION,Bt.MSGBOX_RESULT_OK=1,Bt.MSGBOX_RESULT_CANCEL=2,Bt.MSGBOX_RESULT_ABORT=3,Bt.MSGBOX_RESULT_RETRY=4,Bt.MSGBOX_RESULT_IGNORE=5,Bt.MSGBOX_RESULT_YES=6,Bt.MSGBOX_RESULT_NO=7;var Yt=function(){function t(){this._insertMode=!1,this._lastCoordinates=new Array(4),this.ContextID="\0",this.Parser=null,this.FrameForm=null,this.LastClickedCtrlName=null,this.LastClickedMenuUid=0,this.RemovedContextFromServer=!1,this.RemovingContextFromServer=!1,this.CurrentClickedCtrl=null,this.CurrentClickedRadio=null,this.DefaultStatusMsg=null,this.LastClickCoordinatesAreInPixels=!1}return t.prototype.Init=function(t){this.ContextID=t,this.LastClickedCtrlName="",this._insertMode=!0,X.SetCurrentContextID(t),this.Parser=new r.XmlParser},t.prototype.SaveLastClickInfo=function(t,r,n,i,o,a){this._lastCoordinates[0]=i,this._lastCoordinates[1]=o,this._lastCoordinates[2]=r,this._lastCoordinates[3]=n,this.LastClickCoordinatesAreInPixels=a,this.LastClickedCtrlName="",e.NString.IsNullOrEmpty(t)||(this.LastClickedCtrlName=t)},t.prototype.GetClickProp=function(t){if(t>=0&&t<4)return this._lastCoordinates[t];throw new e.ApplicationException("in RuntimeContextBase.getClickProp() illegal index: "+t)},t.prototype.IsInsertMode=function(){return this._insertMode},t.prototype.ToggleInsertMode=function(){this._insertMode=!this._insertMode},t}();Yt.noContextId=null,Yt.Instance=new Yt;var Ut=function(){function t(){}return t.prototype.CreateDcValues=function(t){return new Ct(!1,t)},t.prototype.SetId=function(t,e){t.SetID(e)},t.prototype.SetType=function(t,e){t.setType(e)},t.prototype.SetDisplayValues=function(t,e){t.SetDisplayValues(e)},t.prototype.SetLinkValues=function(t,e){t.SetLinkValues(e)},t.prototype.SetNullFlags=function(t,e){2!==arguments.length||!(null===t||t instanceof Ct)||null!==e&&e.constructor!==String?this.SetNullFlags_1(t,e):this.SetNullFlags_0(t,e)},t.prototype.SetNullFlags_0=function(t,e){var r=this.ParseNullFlags(e);t.setNullFlags(r)},t.prototype.SetNullFlags_1=function(t,e){t.setNullFlags(e)},t.prototype.ParseValues=function(t,n,i){var o,a,s,_,l=null,u=new e.List,P=null;switch(n){case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:a=i?2*x.Environment.GetSignificantNumSize():4*Math.floor((x.Environment.GetSignificantNumSize()+2)/3);break;case r.StorageAttribute.BOOLEAN:a=1;break;default:a=0}for(s=0;s<t.length;)n!==r.StorageAttribute.ALPHA&&n!==r.StorageAttribute.UNICODE&&n!==r.StorageAttribute.BLOB&&n!==r.StorageAttribute.BLOB_VECTOR||(o=t.substr(s,4),a=e.NNumber.Parse(o,e.NumberStyles.HexNumber),s+=4),a>=32768?(P=new e.StringBuilder,a-=32768,s+=ot.getSpannedField(t,a,s,n,P,i),u.push(P.ToString())):(_=s+a,l=i?t.substr(s,_-s):r.Base64.decodeToHex(t.substr(s,_-s)),u.push(l),s=_);return u.ToArray()},t.prototype.ParseNullFlags=function(t){for(var e=new Array(t.length),r=0;r<t.length;r+=1)e[r]="0"!==t.charAt(r);return e},t}(),Gt=function(){function t(){this._fields=null,this._fields=new e.List}return t.prototype.getField=function(t){return null===t||t.constructor===Number?this.getField_0(t):this.getField_1(t)},t.prototype.getField_0=function(t){var e=null;return t>=0&&t<this._fields.length&&(e=this._fields.get_Item(t)),e},t.prototype.getSize=function(){return this._fields.length},t.prototype.fillData=function(t,e){for(;this.initInnerObjects(t.getNextTag(),e););},t.prototype.initInnerObjects=function(t,e){if(null===t)return!1;var n=X.GetCurrentRuntimeContext().Parser;if(t===r.XMLConstants.MG_TAG_FLDH){var i=this.initField(n,e);this._fields.push(i)}else{if(t!==r.XMLConstants.MG_TAG_DVHEADER)return t==="/"+r.XMLConstants.MG_TAG_DVHEADER?(n.setCurrIndex2EndOfTag(),!1):(E.WriteExceptionToLog("There is no such tag in FieldsTable. Insert else if to FieldsTable.initInnerObjects for "+t),!1);n.setCurrIndex(n.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,n.getCurrIndex())+1)}return!0},t.prototype.getField_1=function(t){return this._fields.find((function(e){return e.getVarName()===t}))},t}(),Vt=function(){function n(){this._dcValsCollection=new e.Dictionary,this._emptyDataview=!1,this._fieldsTab=null,this._task=null,this._emptyChoice=new Ct(!0,!1),this._emptyChoiceForVectors=new Ct(!0,!0)}return n.prototype.getField=function(t){return null!=this._fieldsTab?this._fieldsTab.getField(t):(E.WriteExceptionToLog("in DataView.getFieldDef(int): There is no fieldsTab object"),null)},n.prototype.isEmptyDataview=function(){return this._emptyDataview},n.prototype.setEmptyDataview=function(e){this._emptyDataview=e,F.addBoolWithLine(t.CommandType.SET_EMPTY_DATAVIEW,this._task.getForm(),0,e)},n.prototype.getTask=function(){return this._task},n.prototype.getDcValues=function(t){if(-2===t)return this.getEmptyChoice();var r=new e.RefParam(undefined);return this._dcValsCollection.TryGetValue(t.toString(),r),r.value},n.prototype.getEmptyChoice=function(){return this._emptyChoice},n.prototype.getEmptyChoiceForVectors=function(){return this._emptyChoiceForVectors},n.prototype.GetFieldsTab=function(){return this._fieldsTab},n.prototype.GetRouteParams=function(){for(var t=new e.List,n=0;n<this._fieldsTab.getSize();n++){var i=this._fieldsTab.getField(n),o=void 0;if(i.IsExposedRouteParam&&!i.isNull())switch(i.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:o=i.getDispValue(),i.isNull()&&(o=i.getNullDisplay()),t.push(o.trim());break;case r.StorageAttribute.BOOLEAN:i.isNull()?t.push(!1):t.push("1"===i.getDispValue().charAt(0));break;case r.StorageAttribute.NUMERIC:o=i.getDispValue(),i.isNull()&&(o=i.getNullDisplay());var a=new z(i.getPicture(),i.getType(),this.getTask().getCompIdx());o=$.Instance.mg2disp(o,"",a,!0,0,!1),t.push(o)}}return t.length>0?t:null},n}(),kt=function(){function t(n){this.Referent=null,this.isDisposed=!1,this.id=0,this._instantiationTrace=null,this.id=t.LastId=t.LastId+1,this.isDisposed=!1,this.Referent=n,r.Logger.Instance.LogLevel>=r.Logger_LogLevels.Development&&(r.Logger.Instance.WriteDevToLog("Creating "+this.toString()),this._instantiationTrace=new e.StackTrace),n.AddReference()}return t.prototype.Dispose=function(t){0!==arguments.length?this.Dispose_1(t):this.Dispose_0()},t.prototype.Dispose_0=function(){r.Logger.Instance.WriteDevToLog("Disposing "+this),this.Dispose(!0)},t.prototype.Dispose_1=function(t){this.isDisposed||(this.Referent.HasReferences?this.Referent.RemoveReference():(r.Logger.Instance.LogLevel>=r.Logger_LogLevels.Development&&(r.Logger.Instance.WriteSupportToLog("Referent does not have any more references: "+this.Referent,!1),r.Logger.Instance.WriteStackTrace(this._instantiationTrace,15,"Instantiation trace:")),e.Debug.Assert(!1,"Referent does not have any more references. See DEV level log."))),this.isDisposed=!0},t.prototype.toString=function(){return"{Reference "+this.id+" to: "+this.Referent+"}"},t}();kt.LastId=0;var wt=function(){function t(){this._refs=new e.List}return t.prototype.get_Item=function(t){return this._refs.get_Item(t)},t.prototype.Add=function(t){this._refs.push(t)},t.prototype.Dispose=function(){for(var t=0;t<this._refs.length;t+=1)this._refs.get_Item(t).Dispose()},t.prototype.Clone=function(){for(var e=new t,r=0;r<this._refs.length;r+=1){var n=this.get_Item(r).Clone();e.Add(n)}return e},Object.defineProperty(t.prototype,"Refs",{get:function(){return this._refs},enumerable:!1,configurable:!0}),t}(),Ft=function(){};Ft.EXP_OPER_LEN=2,Ft.EXP_OPER_FUNC_PTR_LEN=4,Ft.EXP_OP_NONE=0,Ft.EXP_OP_V=1,Ft.EXP_OP_VAR=2,Ft.EXP_OP_A=3,Ft.EXP_OP_H=4,Ft.EXP_OP_N=5,Ft.EXP_OP_D=6,Ft.EXP_OP_T=7,Ft.EXP_OP_L=8,Ft.EXP_OP_F=9,Ft.EXP_OP_K=10,Ft.EXP_OP_P=11,Ft.EXP_OP_M=12,Ft.EXP_OP_ACT=13,Ft.EXP_OP_KBD=14,Ft.EXP_OP_ADD=15,Ft.EXP_OP_SUB=16,Ft.EXP_OP_MUL=17,Ft.EXP_OP_DIV=18,Ft.EXP_OP_MOD=19,Ft.EXP_OP_NEG=20,Ft.EXP_OP_FIX=21,Ft.EXP_OP_ROUND=22,Ft.EXP_OP_EQ=23,Ft.EXP_OP_NE=24,Ft.EXP_OP_LE=25,Ft.EXP_OP_LT=26,Ft.EXP_OP_GE=27,Ft.EXP_OP_GT=28,Ft.EXP_OP_NOT=29,Ft.EXP_OP_OR=30,Ft.EXP_OP_AND=31,Ft.EXP_OP_IF=32,Ft.EXP_OP_LEN=33,Ft.EXP_OP_CON=34,Ft.EXP_OP_MID=35,Ft.EXP_OP_LEFT=36,Ft.EXP_OP_RIGHT=37,Ft.EXP_OP_FILL=38,Ft.EXP_OP_INSTR=39,Ft.EXP_OP_TRIM=40,Ft.EXP_OP_LTRIM=41,Ft.EXP_OP_RTRIM=42,Ft.EXP_OP_STR=43,Ft.EXP_OP_VAL=44,Ft.EXP_OP_STAT=45,Ft.EXP_OP_LEVEL=46,Ft.EXP_OP_COUNTER=47,Ft.EXP_OP_VARPREV=48,Ft.EXP_OP_VARCURR=49,Ft.EXP_OP_VARMOD=50,Ft.EXP_OP_VARINP=51,Ft.EXP_OP_VARNAME=52,Ft.EXP_OP_VIEWMOD=53,Ft.EXP_OP_ENV=54,Ft.EXP_OP_INIGET=55,Ft.EXP_OP_INIPUT=56,Ft.EXP_OP_TERM=59,Ft.EXP_OP_DATE=61,Ft.EXP_OP_TIME=62,Ft.EXP_OP_SYS=63,Ft.EXP_OP_PROG=66,Ft.EXP_OP_PWR=68,Ft.EXP_OP_LOG=69,Ft.EXP_OP_EXP=70,Ft.EXP_OP_ABS=71,Ft.EXP_OP_SIN=72,Ft.EXP_OP_COS=73,Ft.EXP_OP_TAN=74,Ft.EXP_OP_ASIN=75,Ft.EXP_OP_ACOS=76,Ft.EXP_OP_ATAN=77,Ft.EXP_OP_RAND=78,Ft.EXP_OP_MIN=79,Ft.EXP_OP_MAX=80,Ft.EXP_OP_RANGE=81,Ft.EXP_OP_REP=82,Ft.EXP_OP_INS=83,Ft.EXP_OP_DEL=84,Ft.EXP_OP_FLIP=85,Ft.EXP_OP_UPPER=86,Ft.EXP_OP_LOWER=87,Ft.EXP_OP_CRC=88,Ft.EXP_OP_CHKDGT=89,Ft.EXP_OP_SOUNDX=90,Ft.EXP_OP_HSTR=91,Ft.EXP_OP_HVAL=92,Ft.EXP_OP_CHR=93,Ft.EXP_OP_ASC=94,Ft.EXP_OP_MSTR=103,Ft.EXP_OP_MVAL=104,Ft.EXP_OP_DSTR=105,Ft.EXP_OP_DVAL=106,Ft.EXP_OP_TSTR=107,Ft.EXP_OP_TVAL=108,Ft.EXP_OP_DAY=109,Ft.EXP_OP_MONTH=110,Ft.EXP_OP_YEAR=111,Ft.EXP_OP_DOW=112,Ft.EXP_OP_CDOW=113,Ft.EXP_OP_CMONTH=114,Ft.EXP_OP_NDOW=115,Ft.EXP_OP_NMONTH=116,Ft.EXP_OP_SECOND=117,Ft.EXP_OP_MINUTE=118,Ft.EXP_OP_HOUR=119,Ft.EXP_OP_DELAY=120,Ft.EXP_OP_IDLE=121,Ft.EXP_OP_LOGICAL=138,Ft.EXP_OP_VISUAL=139,Ft.EXP_OP_ADDDATE=156,Ft.EXP_OP_ADDTIME=157,Ft.EXP_OP_OWNER=158,Ft.EXP_OP_VARATTR=159,Ft.EXP_OP_BOM=160,Ft.EXP_OP_BOY=161,Ft.EXP_OP_EOM=162,Ft.EXP_OP_EOY=163,Ft.EXP_OP_RIGHT_LITERAL=165,Ft.EXP_OP_ROLLBACK=167,Ft.EXP_OP_VARSET=168,Ft.EXP_OP_EVALX=171,Ft.EXP_OP_IGNORE=172,Ft.EXP_OP_NULL=173,Ft.EXP_OP_NULL_A=174,Ft.EXP_OP_NULL_N=175,Ft.EXP_OP_NULL_B=176,Ft.EXP_OP_NULL_D=177,Ft.EXP_OP_NULL_T=178,Ft.EXP_OP_ISNULL=179,Ft.EXP_OP_TDEPTH=180,Ft.EXP_OP_MINMAGIC=193,Ft.EXP_OP_MAXMAGIC=194,Ft.EXP_OP_RESMAGIC=195,Ft.EXP_OP_FILEDLG=196,Ft.EXP_OP_MLS_TRANS=199,Ft.EXP_OP_CTRL_NAME=200,Ft.EXP_OP_GETLANG=206,Ft.EXP_OP_NULL_O=210,Ft.EXP_OP_GETPARAM=212,Ft.EXP_OP_SETPARAM=213,Ft.EXP_OP_CND_RANGE=219,Ft.EXP_OP_ISDEFAULT=235,Ft.EXP_OP_FORM=236,Ft.EXP_OP_STRTOKEN=237,Ft.EXP_OP_INIGETLN=241,Ft.EXP_OP_EXPCALC=242,Ft.EXP_OP_E=243,Ft.EXP_OP_WEB_REFERENCE=267,Ft.EXP_OP_CASE=273,Ft.EXP_OP_LIKE=275,Ft.EXP_OP_CALLJS=283,Ft.EXP_OP_THIS=290,Ft.EXP_OP_REPSTR=303,Ft.EXP_OP_DBROUND=306,Ft.EXP_OP_VARPIC=307,Ft.EXP_OP_STRTOK_CNT=309,Ft.EXP_OP_VARCURRN=310,Ft.EXP_OP_VARINDEX=311,Ft.EXP_OP_JCDOW=343,Ft.EXP_OP_JMONTH=344,Ft.EXP_OP_JNDOW=345,Ft.EXP_OP_JYEAR=346,Ft.EXP_OP_JGENGO=347,Ft.EXP_OP_HAN=350,Ft.EXP_OP_ZEN=351,Ft.EXP_OP_ZENS=352,Ft.EXP_OP_ZIMEREAD=353,Ft.EXP_OP_ZKANA=354,Ft.EXP_OP_GOTO_CTRL=368,Ft.EXP_OP_TRANSLATE=373,Ft.EXP_OP_ASTR=374,Ft.EXP_OP_LOOPCOUNTER=401,Ft.EXP_OP_VECGET=417,Ft.EXP_OP_VECSET=418,Ft.EXP_OP_VECSIZE=419,Ft.EXP_OP_VECCELLATTR=420,Ft.EXP_OP_BLOBSIZE=442,Ft.EXP_OP_STRTOKEN_IDX=448,Ft.EXP_OP_MTIME=449,Ft.EXP_OP_MTVAL=450,Ft.EXP_OP_MTSTR=451,Ft.EXP_OP_IN=462,Ft.EXP_OP_ISCOMPONENT=465,Ft.EXP_OP_EXT_A=485,Ft.EXP_OP_NULL_U=491,Ft.EXP_OP_USER_DEFINED_FUNC=496,Ft.EXP_OP_SUBFORM_EXEC_MODE=497,Ft.EXP_OP_UNICODEASC=506,Ft.EXP_OP_ADDDT=509,Ft.EXP_OP_DIFDT=510,Ft.EXP_OP_ISFIRSTRECORDCYCLE=511,Ft.EXP_OP_MAINLEVEL=512,Ft.EXP_OP_MAINDISPLAY=515,Ft.EXP_OP_DBVIEWSIZE=539,Ft.EXP_OP_DBVIEWROWIDX=540,Ft.EXP_OP_PROJECTDIR=541,Ft.EXP_OP_FORMSTATECLEAR=542,Ft.EXP_OP_PUBLICNAME=543,Ft.EXP_OP_TASKID=544,Ft.EXP_OP_STR_BUILD=549,Ft.EXP_OP_EMPTY_DATA_VIEW=561,Ft.EXP_OP_STATUSBARSETTEXT=568,Ft.EXP_OP_CLIENT_DIRDLG=574,Ft.EXP_OP_CLIENT_REDIRECT=577,Ft.EXP_OP_IS_MOBILE_CLIENT=593,Ft.EXP_OP_CLIENT_SESSION_STATISTICS_GET=594,Ft.EXP_OP_TASKTYPE=612,Ft.EXP_OP_CLIENT_FILE_TO_SERVER=615,Ft.EXP_OP_RANGE_ADD=616,Ft.EXP_OP_RANGE_RESET=617,Ft.EXP_OP_LOCATE_ADD=618,Ft.EXP_OP_LOCATE_RESET=619,Ft.EXP_OP_SORT_ADD=620,Ft.EXP_OP_SORT_RESET=621,Ft.EXP_OP_TSK_INSTANCE=622,Ft.EXP_OP_CLIENTSESSION_SET=632,Ft.EXP_OP_UTCDATE=633,Ft.EXP_OP_UTCTIME=634,Ft.EXP_OP_UTCMTIME=635,Ft.EXP_OP_CLIENT_DB_DISCONNECT=636,Ft.EXP_OP_DATAVIEW_TO_DATASOURCE=637,Ft.EXP_OP_CLIENT_DB_DEL=638,Ft.EXP_OP_VARDISPLAYNAME=647,Ft.EXP_OP_VARCONTROLID=650,Ft.EXP_OP_CONTROLITEMSLIST=651,Ft.EXP_OP_CONTROLDISPLAYLIST=652,Ft.EXP_OP_CLIENT_SQL_EXECUTE=653,Ft.EXP_OP_CONTROL_SELECT_PROGRAM=656,Ft.EXP_OP_SET_TITLE=687,Ft.EXP_OP_IS_ROW_EDITING=689,Ft.EXP_OP_IS_LOGGED_IN=690,Ft.EXP_OP_SET_COOKIE=701,Ft.EXP_OP_GET_COOKIE=702,Ft.EXP_OP_DELETE_COOKIE=703,Ft.EXP_OP_ROUTEGET=705;var xt=function(){function t(){this.ExpTask=null,this.Events=null}return t.prototype.eval_op_statusbar_set_text=function(t,e){if(t.Attr=r.StorageAttribute.UNICODE,t.StrVal=X.GetCurrentRuntimeContext().DefaultStatusMsg,null===X.GetCurrentRuntimeContext().DefaultStatusMsg?t.StrVal="":t.StrVal=X.GetCurrentRuntimeContext().DefaultStatusMsg,t.IsNull=!1,(e.Attr===r.StorageAttribute.ALPHA||e.Attr===r.StorageAttribute.UNICODE)&&!e.IsNull){var n=e.StrVal,i=this.ExpTask.GetContextTask();null===i.getForm()&&null!==X.GetCurrentRuntimeContext().FrameForm&&(i=X.GetCurrentRuntimeContext().FrameForm.getTask()),i.WriteToMessagePane(n,!1),X.GetCurrentRuntimeContext().DefaultStatusMsg=n}},t.prototype.IsParallel=function(t){return!1},t.prototype.eval_op_browserExecute_DO=function(t,e,n,i,o){t.Attr=r.StorageAttribute.BOOLEAN,t.BoolVal=!1;this.ExpTask.getForm();var a=r.StrUtil.rtrim(e.StrVal),s=this.ExpTask.getForm().GetCtrl(a);null!==s&&s.isBrowserControl()&&(t.BoolVal=F.browserExecute(s,n.StrVal,i.BoolVal,o))},t.prototype.eval_op_ctrl_name=function(t){var n=X.GetCurrentRuntimeContext().LastClickedCtrlName;t.StrVal=e.NString.IsNullOrEmpty(n)?"":n,t.Attr=r.StorageAttribute.ALPHA},t.prototype.eval_op_formStateClear=function(t,e){},t.prototype.eval_op_gotoCtrl=function(t,e,n,i){i.Attr=r.StorageAttribute.BOOLEAN,i.BoolVal=!1;var o=this.GetContextTask(n.MgNumVal.NUM_2_LONG());if(null!==o&&null!==o.getForm()){var a=e.MgNumVal.NUM_2_LONG(),s=r.StrUtil.rtrim(t.StrVal),_=o.getForm().GetCtrl(s);i.BoolVal=this.HandleControlGoto(o,_,a)}},t.GetContextTask=function(e,r){var n=null,i=e.GetContextTask();return r===t.TRIGGER_TASK?n=i:r<i.GetTaskDepth()&&(n=i.GetTaskAncestor(r)),n},t.prototype.GetContextTask=function(e){return t.GetContextTask(this.ExpTask,e)},t.prototype.ConstructMagicNum=function(t,e,r){t.MgNumVal=new Z,t.MgNumVal.NUM_4_LONG(e),t.Attr=r},t.prototype.SetNULL=function(t,e){switch(t.IsNull=!0,t.Attr=e,e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:t.StrVal=null;break;case r.StorageAttribute.TIME:case r.StorageAttribute.DATE:case r.StorageAttribute.NUMERIC:t.MgNumVal=null;break;case r.StorageAttribute.BOOLEAN:t.BoolVal=!1}},t.prototype.GetValidatedValue=function(t,e,n){var i,o=t.buildCopyPicture(e,n);if(o.evaluate(),o.ValidationFailed){var a=t.getField();i=a.getType()===r.StorageAttribute.BLOB_VECTOR?a.getCellDefualtValue():a.getDefaultValue()}else i=o.getDispValue();return i},t.prototype.SetVal=function(t,e,n,i){switch(e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:t.Attr=e,t.StrVal=n,e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR||(t.IncludeBlobPrefix=!0);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t.Attr=e,t.MgNumVal=null==n?null:null==i?new Z(n):new Z(n,i,this.ExpTask.getCompIdx());break;case r.StorageAttribute.BOOLEAN:t.Attr=e,t.BoolVal=$.toBoolean(n);break;default:this.SetNULL(t,e),this.Events.WriteExceptionToLog("ExpressionEvaluator.SetVal() there is no such type : "+e)}},t.exp_build_string=function(t){var e="";if(null!==t.StrVal){var n=t.StrVal.length;n>0&&(e=r.StrUtil.ZstringMake(t.StrVal,n))}return e},t.isExpVal=function(t){return t instanceof Xt},t.prototype.BlobStringConversion=function(t,e){if(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(e))if(t.Attr===r.StorageAttribute.BLOB){if(t.IncludeBlobPrefix){var n=K.getContentType(t.StrVal);t.StrVal=K.getString(t.StrVal),t.IncludeBlobPrefix=!1,n!==K.CONTENT_TYPE_BINARY&&r.Rtf.isRtf(t.StrVal)&&(t.StrVal=r.StrUtil.GetPlainTextfromRtf(t.StrVal))}t.Attr=e}else{if(t.Attr===r.StorageAttribute.BLOB_VECTOR)t.IncludeBlobPrefix&&(t.StrVal=K.removeBlobPrefix(t.StrVal),t.IncludeBlobPrefix=!1),t.Attr=e}else if(e===r.StorageAttribute.BLOB&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t.Attr)){n=t.Attr===r.StorageAttribute.ALPHA?K.CONTENT_TYPE_ANSI:K.CONTENT_TYPE_UNICODE;t.StrVal=K.createFromString(t.StrVal,n),t.IncludeBlobPrefix=!0,t.Attr=e}},t.prototype.eval_op_zimeread=function(t){t.Attr=r.StorageAttribute.ALPHA,t.StrVal="";var n=X.UtilImeJpn;if(null!==n){var i=n.StrImeRead;e.NString.IsNullOrEmpty(n.StrImeRead)||(t.StrVal=i)}},t.prototype.eval_op_win_help=function(t,e,n,i){var o=t.StrVal,a=e.MgNumVal.NUM_2_LONG(),s=n.StrVal;i.Attr=r.StorageAttribute.BOOLEAN;try{X.ShowWindowHelp(o,a,s),i.BoolVal=!0}catch(t){i.BoolVal=!1}},t.prototype.ConvertExpVal=function(t,e){r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(t.Attr,e)&&this.BlobStringConversion(t,e)},t}();xt.TRIGGER_TASK=5e5;var Xt=function(){function t(t,e,n){this.Attr=r.StorageAttribute.NONE,this.IsNull=!1,this.MgNumVal=null,this.StrVal=null,this.BoolVal=!1,this.IncludeBlobPrefix=!1,this.OriginalNull=!1,this.VectorField=null,0!==arguments.length?this.constructor_1(t,e,n):this.constructor_0()}return t.prototype.constructor_0=function(){this.Attr=r.StorageAttribute.NONE},t.prototype.constructor_1=function(t,e,r){this.Init(t,e,r)},t.prototype.Copy=function(t){this.Attr=t.Attr,this.BoolVal=t.BoolVal,this.IncludeBlobPrefix=t.IncludeBlobPrefix,this.IsNull=t.IsNull,this.MgNumVal=t.MgNumVal,this.StrVal=t.StrVal,this.VectorField=t.VectorField,this.OriginalNull=t.OriginalNull},t.prototype.Nullify=function(){this.Init(r.StorageAttribute.NONE,!0,null)},t.prototype.Init=function(t,n,i){switch(this.Attr=t,this.IsNull=n,this.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:this.StrVal=i;break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:this.StrVal=i,this.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:this.MgNumVal=null!==i?new Z(i):null;break;case r.StorageAttribute.BOOLEAN:this.BoolVal=null!==i&&"1"===i;break;case r.StorageAttribute.NONE:this.BoolVal=!1,this.StrVal=null,this.MgNumVal=null,this.OriginalNull=!0,this.VectorField=null,this.IncludeBlobPrefix=!1;break;case r.StorageAttribute.DOTNET:this.StrVal=i;break;default:throw new e.ApplicationException("in ExpVal.ExpVal() illegal attribute: '"+this.Attr+"'")}},t.prototype.ToMgVal=function(){var t;switch(this.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:t=this.StrVal;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:t=this.MgNumVal.toXMLrecord();break;case r.StorageAttribute.BOOLEAN:t=this.BoolVal?"1":"0";break;default:t="[illegal attribute: "+this.Attr+"]"}return t},t.prototype.isEmptyString=function(){return(this.Attr===r.StorageAttribute.ALPHA||this.Attr===r.StorageAttribute.UNICODE)&&""===this.StrVal},t}(),Ht=function(){},Wt=function(t){function e(){var e=t.call(this)||this;return e.val=null,e.Name=null,e.FrameX=0,e.FrameY=0,e.FrameDx=0,e.FrameDy=0,e.SizedX=0,e.SizedY=0,e.FactorX=0,e.FactorY=0,e.Borderstyle=0,e.TitleBar=0,e.FontTableIndex=0,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Internal},e}(Ht),Kt=function(t){function e(){var e=t.call(this)||this;return e.PromptHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Prompt},e}(Ht),zt=function(t){function e(){var e=t.call(this)||this;return e.tooltipHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Tooltip},e}(Ht),jt=function(t){function e(){var e=t.call(this)||this;return e.urlHelpText=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.URL},e}(Ht),Zt=function(t){function e(){var e=t.call(this)||this;return e.FilePath=null,e.HelpCommand=0,e.HelpKey=null,e}return a(e,t),e.prototype.GetHelpType=function(){return r.HelpType.Windows},e}(Ht),Jt=function(){function t(){this._helps=null,this._helps=new e.List}return t.prototype.fillData=function(t){for(;this.initInnerObjects(t.getNextTag(),t););},t.prototype.initInnerObjects=function(t,e){if(null===t)return!1;if(t===r.XMLConstants.MG_TAG_HELPTABLE)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==r.XMLConstants.MG_TAG_HELPITEM)return t==="/"+r.XMLConstants.MG_TAG_HELPTABLE?(e.setCurrIndex2EndOfTag(),!1):(E.WriteExceptionToLog("in Command.FillData() out of string bounds"),!1);var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var i=e.getXMLsubstring(n);e.add2CurrIndex(i.indexOf(r.XMLConstants.MG_TAG_HELPITEM)+r.XMLConstants.MG_TAG_HELPITEM.length);var o=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.fillHelpItem(o),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length),!0}}return!0},t.prototype.fillHelpItem=function(t){var n=0,i=t.get_Item(n),o=t.get_Item(n+1);switch(r.XmlParser.unescape(o).toString()){case r.XMLConstants.MG_ATTR_HLP_TYP_TOOLTIP:var a=new zt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?a.tooltipHelpText=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(a);break;case r.XMLConstants.MG_ATTR_HLP_TYP_PROMPT:var s=new Kt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?s.PromptHelpText=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(s);break;case r.XMLConstants.MG_ATTR_HLP_TYP_URL:var _=new jt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?_.urlHelpText=o:E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(_);break;case r.XMLConstants.MG_ATTR_HLP_TYP_INTERNAL:var l=new Wt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_VALUE?l.val=r.XmlParser.unescape(o).toString():i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_NAME?l.Name=r.XmlParser.unescape(o).toString():i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEX?l.FrameX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEY?l.FrameY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEDX?l.FrameDx=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FRAMEDY?l.FrameDy=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SIZEDX?l.SizedX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SIZEDY?l.SizedY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FACTORX?l.FactorX=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FACTORY?l.FactorY=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_BORDERSTYLE?l.Borderstyle=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_TITLE_BAR?l.TitleBar=e.NNumber.Parse(r.XmlParser.unescape(o)):i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_SYSTEM_MENU||(i===r.XMLConstants.MG_ATTR_INTERNAL_HELP_FONT_TABLE_INDEX?l.FontTableIndex=e.NNumber.Parse(r.XmlParser.unescape(o)):E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i)));this._helps.push(l);break;case r.XMLConstants.MG_ATTR_HLP_TYP_WINDOWS:var u=new Zt;for(n=2;n<t.length;n+=2)i=t.get_Item(n),o=t.get_Item(n+1),i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_FILE?u.FilePath=o:i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_COMMAND?u.HelpCommand=e.NNumber.Parse(o):i===r.XMLConstants.MG_ATTR_WINDOWS_HELP_KEY?u.HelpKey=r.XmlParser.unescape(o).toString():E.WriteExceptionToLog(e.NString.Format("There is no such tag in <helptable><helpitem ..>.Insert case to HelpTable.FillHelpItem for {0}",i));this._helps.push(u)}},t.prototype.getHelp=function(t){return t<0||t>=this._helps.length?null:this._helps.get_Item(t)},t}(),Qt=function(){};Qt.MGDataTable=null;var qt=function(){function n(){this._flowMonitor=null,this._keyboardMappingState=4294901760,this._refreshType="T",this._lastParkedCtrl=null,this._brkLevel=null,this._brkLevelIndex=-1,this._mainLevel=null,this._level="\0",this._enteredRecLevel=!1,this._currParkedFld=null,this.isInRecompute=!1,this.CurrentEditingControl=null,this.ApplicationGuid=null,this.ProgramIsn=0,this.TaskIsn=0,this.ContextID=0,this.IsSubForm=!1,this._ctlIdx=0,this._compIdx=0,this._isPrg=!1,this._isMainPrg=!1,this.IsInteractive=!1,this._taskTag=null,this._openWin=!1,this._allowEvents=!1,this.Form=null,this._propTab=null,this._helpTab=null,this.IconFileName=null,this.IsParallel=!1,this.DataView=null,this.ActionManager=null,this.StudioParentTask=null,this.routerPath=null,this.routeParams=null,this.inDefaultRouterOutlet=!1,this.IsSubtask=!1,this.DataViewWasRetrieved=!1,this.TaskPrefixExecuted=!1,this._nullArithmetic=r.Constants.NULL_ARITH_USE_DEF,this._propTab=new ft(this)}return n.prototype.Init=function(){this.DataView.Init()},Object.defineProperty(n.prototype,"RouterPath",{get:function(){return this.routerPath},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"RouterParams",{get:function(){return this.routeParams},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"InDefaultRouterOutlet",{get:function(){return this.inDefaultRouterOutlet},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"IsBlockingBatch",{get:function(){return!this._isMainPrg&&this.isOpenWin()&&!this._allowEvents&&!this.IsInteractive},enumerable:!1,configurable:!0}),n.prototype.getTaskTag=function(){return this._taskTag},n.prototype.getCtlIdx=function(){return this._ctlIdx},n.prototype.isMainProg=function(){return this._isMainPrg},n.prototype.getTopMostForm=function(){var t=null;return null!==this.Form&&(t=this.Form.getTopMostForm()),t},n.prototype.getCtrl=function(t){return this.Form.getCtrl(t)},n.prototype.setMode=function(e){this.getMode()!==e&&(this.setProp(t.PropInterface.PROP_TYPE_TASK_MODE,e),null!==this._flowMonitor&&this._flowMonitor.addTaskCngMode(this.ContextID,e,this.GetTaskDetails()))},n.prototype.getMode=function(){var e=r.Constants.TASK_MODE_MODIFY,n=this._propTab.getPropById(t.PropInterface.PROP_TYPE_TASK_MODE);return null!==n&&(e=n.GetComputedValue()),e},n.prototype.SetInRecompute=function(t){this.isInRecompute=t},n.prototype.IsInRecompute=function(){return this.isInRecompute},n.prototype.resetRefreshType=function(){this._refreshType=r.Constants.TASK_REFRESH_NONE},n.prototype.getRefreshType=function(){return this._refreshType},n.prototype.SetRefreshType=function(t){switch(t){case r.Constants.TASK_REFRESH_FORM:case r.Constants.TASK_REFRESH_TABLE:case r.Constants.TASK_REFRESH_CURR_REC:this._refreshType=t}},n.prototype.GetRouterParams=function(){return this.routeParams},n.prototype.getLastParkedCtrl=function(){return this._lastParkedCtrl},n.prototype.isOpenWin=function(){return this._openWin},n.prototype.checkProp=function(t,e){return s(this,void 0,void 0,(function(){var r;return _(this,(function(n){switch(n.label){case 0:return null===(r=this.getProp(t))?[3,2]:[4,r.getValueBoolean()];case 1:return[2,n.sent()];case 2:return[2,e]}}))}))},n.prototype.getClickedControl=function(){var t=E.GetRuntimeContext(null).CurrentClickedCtrl;return null!==t&&t.getForm().getTask()!==this&&(t=null),t},n.prototype.getKeyboardMappingState=function(){return this._keyboardMappingState},n.prototype.isStateEnabled=function(t){return(t&this._keyboardMappingState)>0},n.prototype.setKeyboardMappingState=function(t,e){this._keyboardMappingState=e?n.mkInt(n.hiShrt(this._keyboardMappingState)&~t,n.loShrt(this._keyboardMappingState)|t):n.mkInt(n.hiShrt(this._keyboardMappingState)|t,n.loShrt(this._keyboardMappingState)&~t)},n.hiShrt=function(t){return(4294901760&t)>>16},n.loShrt=function(t){return 65535&t},n.mkInt=function(t,e){return t<<16|e},n.prototype.getHelpItem=function(t){if(null!==this._helpTab)return this._helpTab.getHelp(t)},n.prototype.setProp=function(t,e){this._propTab.setProp(t,e,this,"T")},n.prototype.setBrkLevel=function(t,e){this._brkLevel=t,this._brkLevelIndex=e,this.setMainLevel(t)},n.prototype.getBrkLevel=function(){return this._brkLevel},n.prototype.getBrkLevelIndex=function(){return this._brkLevelIndex},n.prototype.setMainLevel=function(t){if(null!==t&&t.length>0){var e=t.charAt(0);e!==r.Constants.TASK_LEVEL_NONE&&e!==r.Constants.TASK_LEVEL_TASK&&e!==r.Constants.TASK_LEVEL_RECORD||(this._mainLevel=t)}},n.prototype.getMainLevel=function(){return this._mainLevel},n.prototype.setLevel=function(t){this._level=t,this._level===r.Constants.TASK_LEVEL_RECORD&&(this._enteredRecLevel=!0)},n.prototype.getLevel=function(){return this._level},n.prototype.setDataSynced=function(t){},n.prototype.getNullArithmetic=function(){return this._nullArithmetic},n.prototype.setLastParkedCtrl=function(t){this._lastParkedCtrl=t,this._currParkedFld=null!==this._lastParkedCtrl?this._lastParkedCtrl.getField():null,this.CurrentEditingControl=t},n.prototype.getCurrField=function(){return this._currParkedFld},n.prototype.setCurrField=function(t){this._currParkedFld=t},n.prototype.getCurrFieldIdx=function(){return null!==this._currParkedFld?this._currParkedFld.getId():-1},n.prototype.getFieldByValueStr=function(t,e,r){return 1===arguments.length?this.getFieldByValueStr_0(t):this.getFieldByValueStr_1(t,e,r)},n.prototype.getFieldByValueStr_0=function(t){var r=new e.RefParam(undefined),n=new e.RefParam(undefined);return this.getFieldByValueStr_1(t,r,n)},n.prototype.getFieldByValueStr_1=function(t,r,n){r.value=n.value=0;var i=null,o=t.indexOf(",");if(o>0){var a=e.NNumber.Parse(t.substr(0,o)),s=e.NNumber.Parse(t.substr(o+1));i=0!==a?this.getFieldDef(a,s):this.getFieldDef(s),r.value=a,n.value=s}return i},n.prototype.getMainProgFieldByValueStr=function(t){var r=e.NNumber.Parse(t)-1;return this.getFieldDef(r)},n.prototype.getFieldDef=function(t,e){return 1===arguments.length?this.getField_0(t):this.getField_1(t,e)},n.prototype.getField_0=function(t){return this.DataView.getField(t)},n.prototype.InitForm=function(){return s(this,void 0,void 0,(function(){return _(this,(function(t){switch(t.label){case 0:return null!==this.Form&&this.isOpenWin()?(this.Form.InInitForm=!0,this.Form.init(),this.SetRefreshType(r.Constants.TASK_REFRESH_FORM),[4,this.RefreshDisplay()]):[3,2];case 1:t.sent(),F.beginInvoke(),this.Form.InInitForm=!1,t.label=2;case 2:return[2]}}))}))},n.prototype.GetLastParkedCtrlName=function(t){var e=this.GetTaskAncestor(t);null===e||e._lastParkedCtrl;return null===e||null===e._lastParkedCtrl?"":e._lastParkedCtrl.Name},n.prototype.getForm=function(){return this.Form},n.prototype.SetForm=function(t){return this.Form=t,t},n.prototype.checkIfExistProp=function(t){var e=!1;null!==this._propTab&&(e=null!==this._propTab.getPropById(t));return e},n.prototype.getProp=function(t){var e=null;return null!==this._propTab&&null===(e=this._propTab.getPropById(t))&&null!==(e=pt.getDefaultProp(t,W.PARENT_TYPE_TASK,this))&&(e.StudioValue=e.getOrgValue(),this._propTab.addProp(e)),e},n.prototype.GetComputedProperty=function(t){var e=null;return null!==this._propTab&&(e=this._propTab.getPropById(t)),e},n.prototype.getCompIdx=function(){return this._compIdx},n.prototype.IsFirstRefreshOfProps=function(){throw new e.NotImplementedException},n.prototype.EvaluateExpression=function(t,e,r,n,i,o,a){return s(this,void 0,void 0,(function(){var s;return _(this,(function(_){switch(_.label){case 0:return s=null,a.value=!1,o||this.DataViewWasRetrieved?[4,this.CalculateExpression(t,e,r,n,i)]:[3,2];case 1:s=_.sent(),a.value=!0,_.label=2;case 2:return[2,s]}}))}))},n.prototype.GetExpressionStorage=function(t){return this.GetExpressionStorage(t)},n.prototype.isStarted=function(){return!0},n.prototype.isAborting=function(){return!1},n.prototype.getField_1=function(t,e){switch(t){case 0:return this.getFieldDef(e);case n.MAIN_PRG_PARENT_ID:return Qt.MGDataTable.GetMainProgByCtlIdx(this.ContextID,this._ctlIdx).getFieldDef(e);default:return t--,null!=this.StudioParentTask?this.StudioParentTask.getFieldDef(t,e):null}},n.prototype.fillAttributes=function(t){var n=t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex());if(-1!==n&&n<t.getXMLdata().length){var i=t.getXMLsubstring(n);t.add2CurrIndex(i.indexOf(r.XMLConstants.MG_TAG_TASK)+r.XMLConstants.MG_TAG_TASK.length);for(var o=r.XmlParser.getTokens(t.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),a=0;a<o.length;a+=2){var s=o.get_Item(a),_=o.get_Item(a+1);!this.setAttribute(s,_)&&E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog(e.NString.Format("In TaskBase.fillAttributes(): Unprocessed(!) attribute: '{0}' = '{1}'",s,_))}t.setCurrIndex(t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex())+1)}},n.prototype.setAttribute=function(t,n){var i=!0;switch(t){case r.XMLConstants.MG_ATTR_APPL_GUID:this.ApplicationGuid=n;break;case r.XMLConstants.MG_ATTR_PROGRAM_ISN:this.ProgramIsn=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_TASK_ISN:this.TaskIsn=e.NNumber.Parse(n);break;case r.XMLConstants.MG_ATTR_TOOLKIT_PARENT_TASK:0!==e.NNumber.Parse(n)&&(this.StudioParentTask=Qt.MGDataTable.GetTaskByID(n)),this.IsSubtask=!0;break;case r.XMLConstants.MG_ATTR_TASKID:this.setTaskId(n),E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog("TASK: "+this._taskTag);break;case r.XMLConstants.MG_ATTR_CTL_IDX:this.setCtlAndCompIdx(n);break;case r.XMLConstants.MG_ATTR_MAINPRG:this.setMainPrg(n);break;case r.XMLConstants.MG_ATTR_NULL_ARITHMETIC:this.setNullArithmetic(n);break;case r.XMLConstants.MG_ATTR_INTERACTIVE:this.setIsInteracive(n);break;case r.XMLConstants.MG_ATTR_OPEN_WIN:this.setOpenWin(n);break;case r.XMLConstants.MG_ATTR_ALLOW_EVENTS:this.SetAllowEvents(n);break;case r.XMLConstants.MG_ATTR_ISPRG:this.setIsPrg(n);break;case r.XMLConstants.MG_ATTR_ICON_FILE_NAME:this.IconFileName=n;break;case r.XMLConstants.MG_ATTR_PARALLEL:this.IsParallel=r.XmlParser.getBoolean(n);break;case r.XMLConstants.MG_ATTR_ROUTER_PATH:this.routerPath=n;break;case r.XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:this.inDefaultRouterOutlet=r.XmlParser.getBoolean(n);break;default:i=!1}return i},n.prototype.FormInitData=function(t){var n=new e.RefParam(false);return null===this.Form&&(this.Form=this.ConstructMgForm(n)),this.Form.ParentForm=t,E.ShouldLog(r.Logger_LogLevels.Development)&&E.WriteDevToLog("form"),this.Form.fillData(this),this.Form},n.prototype.setTaskId=function(t){this._taskTag=t},n.prototype.setCtlAndCompIdx=function(t){var r=t.indexOf(",");r>-1&&(this._ctlIdx=e.NNumber.Parse(t.substr(0,r)),this._compIdx=e.NNumber.Parse(t.substr(r+1)))},n.prototype.GetAncestorTaskContainingForm=function(){for(var t=this.GetTaskAncestor(1);null!==t&&null===t.getForm();)t=t.GetTaskAncestor(1);return t},n.prototype.setMainPrg=function(t){this._isMainPrg=r.XmlParser.getBoolean(t)},n.prototype.setNullArithmetic=function(t){this._nullArithmetic=t.charAt(0)},n.prototype.setIsInteracive=function(t){this.IsInteractive=r.XmlParser.getBoolean(t)},n.prototype.setOpenWin=function(t){this._openWin=r.XmlParser.getBoolean(t)},n.prototype.SetOpenWin=function(t){this._openWin=t},n.prototype.SetAllowEvents=function(t){this._allowEvents=r.XmlParser.getBoolean(t)},n.prototype.setIsPrg=function(t){this._isPrg=r.XmlParser.getBoolean(t)},n.prototype.ShouldEvaluatePropertyLocally=function(t){return!1},n.prototype.WriteToMessagePane=function(t,e){null!=t&&console.log(t)},n.prototype.WriteToMessagePanebyMsgId=function(t,e){var r=E.GetMessageString(t);this.WriteToMessagePane(r,e)},n}();qt.MAIN_PRG_PARENT_ID=32768;var $t=function(){function t(t){this._timerIntervalMilliSeconds=0,this._threadTimer=null,this._timerIntervalMilliSeconds=t}return t.Run=function(t){E.OnTimer(t)},t.prototype.Start=function(){var e=this,r=i.timer(this._timerIntervalMilliSeconds,this._timerIntervalMilliSeconds);this._threadTimer=r.subscribe((function(r){return t.Run(e)}))},t.prototype.Stop=function(){this._threadTimer.unsubscribe(),this._threadTimer=null},t}(),te=function(){function t(t,e){this.Username=null,this.Password=null,0!==arguments.length?this.constructor_1(t,e):this.constructor_0()}return t.prototype.constructor_0=function(){},t.prototype.constructor_1=function(t,e){this.Username=t,this.Password=e},t.prototype.toString=function(){var t=new e.StringBuilder;return t.Append(this.Username),t.Append(":"),t.Append(this.Password||"null"),t.ToString()},t}(),ee=function(t){function r(e,r,n){var i=t.call(this,e,n)||this;return i.NewUserName=null,i.NewPassword=null,0===arguments.length?(i.constructor_2(),i):(i.constructor_3(e,r,n),i)}return a(r,t),r.prototype.constructor_2=function(){},r.prototype.constructor_3=function(t,e,r){this.NewUserName=e},r.prototype.ToString=function(){var t=new e.StringBuilder;return t.Append(this.Username),t.Append(":"),t.Append(this.NewUserName),t.Append(":"),t.Append(this.Password||"null"),t.ToString()},r}(te),re=function(t){function e(e,r,n){var i=t.call(this)||this;return i._credentials=new te,i.ChangePasswordRequested=!1,0===arguments.length?i.constructor_0():1===arguments.length?i.constructor_1(e):i.constructor_2(e,r,n),i}return a(e,t),e.prototype.constructor_0=function(){this.constructor_2(null,null,null)},e.prototype.constructor_1=function(t){this.constructor_2(t,null,null)},e.prototype.constructor_2=function(t,e,r){},e.prototype.closeDialog=function(){t.prototype.closeDialog.call(this)},e.prototype.setCredentials=function(t){this._credentials.Username=t.Username,this._credentials.Password=t.Password},e.prototype.getCredentials=function(){return this._credentials},e}(vt),ne=function(){function t(){}return t.InvokeOS=function(t,e,r,n,i){return-1},t.SeparateParams=function(t){var e=new Array(2),r=null,n=null,i=-1;return'"'===(t=t.trim())[0]&&(i=t.indexOf('"',1)),-1===i&&(i=t.indexOf(" ",0)),-1===i&&(i=t.length-1),r=t.substr(0,i+1-0),e[0]=r.trim(),n=t.substr(i+1,t.length-(i+1)),e[1]=n.trim(),e},t}();t.AuthenticationDialogHandler=re,t.BlobType=K,t.CellElement=st,t.ChangePasswordCredentials=ee,t.Commands=F,t.ContextIDGuard=H,t.ControlBase=T,t.ControlTable=mt,t.CustomValidator=Et,t.CustomValidatorProp=ht,t.DateBreakParams=nt,t.DcValues=Ct,t.DcValuesBuilderBase=Ut,t.DialogHandler=vt,t.DisplayConvertor=$,t.EMPTY_DCREF=-2,t.Events=E,t.EventsProcessor=Mt,t.ExpVal=Xt,t.ExpressionInterface=Ft,t.FieldDef=_t,t.FieldValidator=gt,t.FieldsTable=Gt,t.FocusManager=At,t.GuiCommand=w,t.GuiCommandQueue=f,t.GuiConstants=W,t.GuiControlPropertyAdapter=ct,t.GuiDataCollection=Qt,t.GuiDataViewBase=Vt,t.GuiEnvironment=x,t.GuiExpressionEvaluator=xt,t.GuiFieldBase=lt,t.GuiFormPropertyAdapter=It,t.GuiInteractive=G,t.GuiInteractiveBase=O,t.GuiMgControl=V,t.GuiMgForm=h,t.GuiTaskBase=qt,t.HebrewDate=q,t.Helps=Jt,t.InternalHelp=Wt,t.KeyboardItem=Dt,t.LastFocusedVal=bt,t.MagicHelp=Ht,t.Manager=X,t.MemoryUtil=Q,t.MgControlBase=Lt,t.MgFormBase=Nt,t.MgTimer=$t,t.MgValue=c,t.NOT_FOUND=St,t.NUM_TYPE=Z,t.ObjectReference=dt,t.ObjectReferenceBase=kt,t.ObjectReferencesCollection=wt,t.OperData=J,t.PIC=z,t.ProcessLauncher=ne,t.PromptpHelp=Kt,t.PropDefaults=Tt,t.PropTable=ft,t.Property=pt,t.RecordUtils=ot,t.Row=yt,t.RuntimeContextBase=Yt,t.Styles=Bt,t.TaskDefinitionId=ut,t.TaskDefinitionIdTableSaxHandler=Pt,t.TimeBreakParams=tt,t.ToolTipHelp=zt,t.UIBridge=I,t.URLHelp=jt,t.UsernamePasswordCredentials=te,t.ValidationDetails=Rt,t.ValidationDetailsBase=j,t.VectorType=at,t.VectorTypeBase=it,t.WindowsHelp=Zt,t.WrongFormatException=Ot,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=magic-xpa-gui.umd.min.js.map
|