@magic-xpa/engine 4.800.0 → 4.800.2
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-engine.umd.js +20 -5
- package/bundles/magic-xpa-engine.umd.js.map +1 -1
- package/bundles/magic-xpa-engine.umd.min.js +2 -2
- package/bundles/magic-xpa-engine.umd.min.js.map +1 -1
- package/esm2015/src/CurrentClientVersion.js +2 -2
- package/esm2015/src/util/Scrambler.js +3 -2
- package/fesm2015/magic-xpa-engine.js +3 -2
- package/fesm2015/magic-xpa-engine.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@magic-xpa/mscorelib"),require("@magic-xpa/utils"),require("@magic-xpa/gui"),require("util"),require("@angular/common/http"),require("rxjs")):"function"==typeof define&&define.amd?define("@magic-xpa/engine",["exports","@magic-xpa/mscorelib","@magic-xpa/utils","@magic-xpa/gui","util","@angular/common/http","rxjs"],t):t(((e=e||self)["magic-xpa"]=e["magic-xpa"]||{},e["magic-xpa"].engine={}),e.mscorelib,e.utils,e.gui,e.util,e.ng.common.http,e.rxjs)}(this,(function(e,t,r,n,a,s,i){"use strict";var o=function(){},l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},l(e,t)};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@magic-xpa/mscorelib"),require("@magic-xpa/utils"),require("@magic-xpa/gui"),require("util"),require("@angular/common/http"),require("rxjs")):"function"==typeof define&&define.amd?define("@magic-xpa/engine",["exports","@magic-xpa/mscorelib","@magic-xpa/utils","@magic-xpa/gui","util","@angular/common/http","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["magic-xpa"]=e["magic-xpa"]||{},e["magic-xpa"].engine={}),e.mscorelib,e.utils,e.gui,e.util,e.ng.common.http,e.rxjs)}(this,(function(e,t,r,n,a,s,i){"use strict";var o=function(){},l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},l(e,t)};
|
|
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
|
-
***************************************************************************** */function u(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c,_;function T(e,t,r,n){return new(r||(r=Promise))((function(a,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,o)}l((n=n.apply(e,t||[])).next())}))}function h(e,t){var r,n,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(a)throw a.error}}return i}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}(c=e.EventSubType||(e.EventSubType={}))[c.Normal=0]="Normal",c[c.CancelWithNoRollback=1]="CancelWithNoRollback",c[c.CancelIsQuit=2]="CancelIsQuit",c[c.RtRefreshViewUseCurrentRow=3]="RtRefreshViewUseCurrentRow",c[c.ExitDueToError=4]="ExitDueToError",(_=e.ClientTargetedCommandType||(e.ClientTargetedCommandType={})).Abort="A",_.OpenURL="P",_.Verify="V",_.EnhancedVerify="E",_.Result="S",_.AddRange="R",_.ClientRefresh="C",_.AddLocate="L",_.AddSort="T",_.ResetRange="G",_.ResetLocate="O",_.ResetSort="U";var E=function(){};E.EXECUTION_PROPERTIES_FILE_NAME="execution.properties",E.FORMS_USER_STATE_FILE_NAME="FormsUserStateRIA",E.NAMES_SEPARATOR="#+%",E.MG_TAG_CONTEXT="context",E.MG_TAG_PROTOCOL="protocol",E.MG_TAG_ENV="env",E.MG_TAG_COMMAND="command",E.MG_TAG_LANGUAGE="language",E.MG_TAG_LANGUAGE_END="/language",E.MG_TAG_CONSTMESSAGES="ConstMessages",E.MG_TAG_CONSTMESSAGES_END="/ConstMessages",E.MG_TAG_CONSTMESSAGESCONTENT="ConstLangFileContent",E.MG_TAG_CONSTMESSAGESCONTENT_END="/ConstLangFileContent",E.MG_TAG_MLS_FILE_URL="MlsFileUrl",E.MG_TAG_MLS_FILE_URL_END="/MlsFileUrl",E.MG_TAG_MLS_CONTENT="MlsContent",E.MG_TAG_MLS_CONTENT_END="/MlsContent",E.MG_TAG_COMPMAINPRG="compmainprg",E.MG_TAG_STARTUP_PROGRAM="StartupProgram",E.MG_TAG_CONTEXT_ID="ContextID",E.MG_TAG_SESSION_ID="SessionID",E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT="HttpTimeout",E.MG_TAG_UNSYNCRONIZED_METADATA="UnsynchronizedMetadata",E.MG_TAG_TASKDEFINITION_IDS_URL="taskDefinitionIdsUrl",E.MG_TAG_OFFLINE_SNIPPETS_URL="offlineSnippetsUrl",E.MG_TAG_DEFAULT_TAG_LIST="defaultTagList",E.MG_TAG_TASK_INFO="taskinfo",E.MG_TAG_EXECUTION_RIGHT="executionRightIdx",E.MG_ATTR_ISSPECIFIC="isSpecific",E.MG_ATTR_IS_GUI_THREAD_EXECUTION="isGuiThreadExecution",E.MG_ATTR_FULLNAME="fullname",E.MG_ATTR_PUBLIC_NAME="publicName",E.MG_TAG_TASKURL="taskURL",E.MG_TAG_TASK_IS_OFFLINE="IsOffline",E.MG_TAG_EXPTABLE="exptable",E.MG_TAG_EXP="exp",E.MG_TAG_DATAVIEW="dataview",E.MG_TAG_COMPLETE_DV="CompleteDataView",E.MG_TAG_REC="rec",E.MG_TAG_FLD_END="/fld",E.MG_TAG_HANDLER="handler",E.MG_TAG_EVENTHANDLERS="eventhandlers",E.MG_TAG_EVENT="event",E.MG_TAG_OPER="oper",E.MG_TAG_KBDMAP_URL="kbdmapurl",E.MG_TAG_KBDMAP="kbdmap",E.MG_TAG_KBDITM="kbditm",E.MG_TAG_USER_EVENTS="userevents",E.MG_TAG_USER_EVENTS_END="/userevents",E.MG_TAG_EVENTS_QUEUE="eventsqueue",E.MG_TAG_DC_VALS="dc_vals",E.MG_TAG_FLWMTR_CONFIG="flwmtr_config",E.MG_TAG_FLWMTR_MSG="flwmtr_msg",E.MG_TAG_FLWMTR_ACT="act",E.MG_TAG_DEL_LIST="cacheDelList",E.MG_TAG_LINKS="links",E.MG_TAG_LINKS_END="/links",E.MG_TAG_LINK="link",E.MG_TAG_TASK_TABLES="taskTables",E.MG_TAG_TASK_TABLES_END="/taskTables",E.MG_TAG_TASK_TABLE="taskTable",E.MG_TAG_COLUMN="column",E.MG_TAG_SORT="sort",E.MG_TAG_SORTS="sorts",E.MG_TAG_SORTS_END="/sorts",E.MG_TAG_CACHED_TABLE="cachedTable",E.MG_TAG_CACHED_TABLE_END="/cachedTable",E.MG_TAG_RECORDS="records",E.MG_TAG_RECORDS_END="/records",E.MG_TAG_TASK_XML="taskxml",E.MG_TAG_EXEC_STACK_ENTRY="execstackentry",E.MG_TAG_DBH_REAL_IDXS="dbhRealIdxs",E.MG_TAG_USER_DETAILS="userDetails",E.MG_SSL_STORE_ARG_PREFIX="STORE:",E.MG_ATTR_VALUE_TAGGED=r.XMLConstants.TAG_OPEN+r.XMLConstants.MG_ATTR_VALUE+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_VALUE_END_TAGGED=r.XMLConstants.END_TAG+r.XMLConstants.MG_ATTR_VALUE+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_HANDLER="handler",E.MG_ATTR_OBJECT="object",E.MG_ATTR_RECOMPUTE="recompute",E.MG_ATTR_MESSAGE="message",E.MG_ATTR_HTML="html",E.MG_ATTR_ARGLIST="arglist",E.MG_ATTR_EXTRA="extra",E.MG_ATTR_FIRSTPOS="firstpos",E.MG_ATTR_LASTPOS="lastpos",E.MG_ATTR_VIRTUAL="virtual",E.MG_ATTR_SUBFORM_TASK="subform_task",E.MG_ATTR_PARAM="param",E.MG_ATTR_PARAMS="params",E.MG_ATTR_ROUTE_PARAMS="routeParams",E.MG_ATTR_EXPOSED_ROUTE_PARAMS="exposedRouteParam",E.MG_ATTR_EXPOSED_TO_CLIENT="exposedToClient",E.MG_ATTR_PAR_ATTRS="attr",E.MG_ATTR_PAR_ATTRS_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_ATTR_PAR_ATTRS+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_PAR_ATTRS_END_TAGGED=r.XMLConstants.END_TAG+E.MG_ATTR_PAR_ATTRS+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_VIR_AS_REAL="vir_as_real",E.MG_ATTR_LNK_CREATE="link_create",E.MG_ATTR_LENGTH="length",E.MG_ATTR_RANGE="range",E.MG_ATTR_NULLVALUE="nullvalue",E.MG_ATTR_INIT="init",E.MG_ATTR_CURRPOS="currpos",E.MG_ATTR_POS="pos",E.MG_ATTR_OLDPOS="oldpos",E.MG_ATTR_MODE="mode",E.MG_ATTR_RECOMPUTEBY="recompute_by",E.MG_ATTR_NAME_TAGGED=r.XMLConstants.TAG_OPEN+r.XMLConstants.MG_ATTR_NAME+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_NAME_END_TAGGED=r.XMLConstants.END_TAG+r.XMLConstants.MG_ATTR_NAME+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_TRANS="trans",E.MG_ATTR_HANDLEDBY="handledby",E.MG_ATTR_LEVEL="level",E.MG_ATTR_DESTINATION_DATASOURCE_NAME="destDataSourceName",E.MG_ATTR_DESTINATION_COLUMNLIST="destColumnList",E.MG_ATTR_SOURCE_DATAVIEW="sourceDataView",E.MG_ATTR_SECONDS="seconds",E.MG_ATTR_SCOPE="scope",E.MG_ATTR_RETURN="return",E.MG_ATTR_PROPAGATE="propagate",E.MG_ATTR_ENABLED="enabled",E.MG_ATTR_FLD="fld",E.MG_ATTR_FIELDID="fieldid",E.MG_ATTR_IGNORE_SUBFORM_RECOMPUTE="ignoreSubformRecompute",E.MG_ATTR_MAGICEVENT="magicevent",E.MG_ATTR_EXIT_BY_MENU="exitByMenu",E.MG_ATTR_FOCUSLIST="focuslist",E.MG_ATTR_FOCUSTASK="currFocusedTask",E.MG_ATTR_TEXT="text",E.MG_ATTR_TITLE="title",E.MG_ATTR_TITLE_EXP="titleExp",E.MG_ATTR_IMAGE="image",E.MG_ATTR_BUTTONS="buttons",E.MG_ATTR_RETURN_VAL="returnVal",E.MG_ATTR_ERR_LOG_APPEND="errorLogAppend",E.MG_ATTR_EVENTVALUE="eventvalue",E.MG_ATTR_EVENTTYPE="eventtype",E.MG_ATTR_HOW="how",E.MG_ATTR_UNDO="undo",E.MG_ATTR_CND="cnd",E.MG_ATTR_ACTIONID="actionid",E.MG_ATTR_KEYCODE="keycode",E.MG_ATTR_MODIFIER="modifier",E.MG_ATTR_STATES="states",E.MG_ATTR_CURR_REC="curr_rec",E.MG_ATTR_LAST_REC_ID="lastRecIdx",E.MG_ATTR_OLD_FIRST_REC_ID="oldFirstRecIdx",E.MG_ATTR_CURR_REC_POS_IN_FORM="currRecPosInForm",E.MG_ATTR_REPEATABLE="repeatable",E.MG_ATTR_FIELD="field",E.MG_ATTR_IDX="idx",E.MG_ATTR_URL="url",E.MG_ATTR_DATEMODE="datemode",E.MG_ATTR_THOUSANDS="thousands",E.MG_ATTR_DECIMAL_SEPARATOR="decimalseparator",E.MG_ATTR_DATE="date",E.MG_ATTR_TIME="time",E.MG_ATTR_LANGUAGE="language",E.MG_ATTR_MODAL="modal",E.MG_ATTR_IS_ROUTE="is_route",E.MG_ATTR_TASK="task",E.MG_ATTR_INTERNALEVENT="internalevent",E.MG_ATTR_VARIABLE="variable",E.MG_ATTR_HANDLERID="handlerid",E.MG_ATTR_ROLLBACK_TYPE="rollbackType",E.MG_ATTR_CENTURY="century",E.MG_ATTR_DATATYPE="datatype",E.MG_ATTR_INCLUDE_FIRST="include_first",E.MG_ATTR_INCLUDE_LAST="include_last",E.MG_ATTR_IS_ONEWAY_KEY="isonewaykey",E.MG_ATTR_INSERT_AT="insert_at",E.MG_ATTR_DBVIEWSIZE="dbviewsize",E.MG_ATTR_FRAME_EXP="frameexp",E.MG_ATTR_PICLEN="piclen",E.MG_ATTR_SRCTASK="srctask",E.MG_ATTR_INVALIDATE="invalidate",E.MG_ATTR_RMPOS="rmpos",E.MG_ATTR_DISPLAY="display",E.MG_ATTR_SUBTYPE="subtype",E.MG_ATTR_ADD_AFTER="add_after",E.MG_ATTR_TOP_REC_ID="top_rec_id",E.MG_ATTR_LOW_ID="low_id",E.MG_ATTR_OWNER="owner",E.MG_ATTR_UPD_IN_QUERY="updateInQuery",E.MG_ATTR_UPD_IN_QUERY_LOWER="updateinquery",E.MG_ATTR_CRE_IN_MODIFY="createInModify",E.MG_ATTR_CRE_IN_MODIFY_LOWER="createinmodify",E.MG_ATTR_IDLETIME="idletime",E.MG_ATTR_VER="ver",E.MG_ATTR_SUBVER="subver",E.MG_ATTR_WAIT="wait",E.MG_ATTR_RETAIN_FOCUS="retainFocus",E.MG_ATTR_SYNC_DATA="syncData",E.MG_ATTR_SHOW="show",E.MG_ATTR_COMPONENT="component",E.MG_ATTR_PATH_PARENT_TASK="path_parent_task",E.MG_ATTR_USER="user",E.MG_ATTR_FORCE_EXIT="force_exit",E.MG_ATTR_PUBLIC="public_name",E.MG_ATTR_PRG_DESCRIPTION="prgDescription",E.MG_ATTR_MENU_CONTENTEND="MenusContentEnd",E.MG_ATTR_OBJECT_TYPE="object_type",E.MG_ATTR_TABLE_NAME="table_name",E.MG_ATTR_INDEX_IN_TABLE="index_in_table",E.MG_ATTR_CALLINGTASK="callingtask",E.MG_ATTR_FLAGS="flags",E.MG_ATTR_LNKEXP="link_exp",E.MG_ATTR_MODIFIED="modi",E.MG_ATTR_OPER="oper",E.MG_ATTR_REFRESHON="refreshon",E.MG_ATTR_TASKMODE="taskmode",E.MG_ATTR_EMPTY_DATAVIEW="EmptyDataview",E.MG_ATTR_TASKLEVEL="tasklevel",E.MG_ATTR_TRANS_CLEARED="trans_cleared",E.MG_ATTR_TRANS_STAT="trans_stat",E.MG_ATTR_SUBFORM_VISIBLE="visible",E.MG_ATTR_ACK="ack",E.MG_ATTR_COMPUTE_BY="compute_by",E.MG_ATTR_CHUNK_SIZE="chunk_size",E.MG_ATTR_CHUNK_SIZE_EXPRESSION="chunk_size_expression",E.MG_ATTR_HAS_MAIN_TBL="has_main_tbl",E.MG_ATTR_SERVER_ID="serverid",E.MG_ATTR_SUBFORM_CTRL="subformCtrl",E.MG_ATTR_CHECK_BY_SERVER="checkByServer",E.MG_ATTR_OPER_IDX="operidx",E.MG_ATTR_EXP_IDX="expidx",E.MG_ATTR_EXP_TYPE="exptype",E.MG_ATTR_NULL="null",E.MG_ATTR_NULLS="nulls",E.MG_ATTR_DC_REFS="dc_refs",E.MG_ATTR_LINKED="linked",E.MG_ATTR_DISP="disp",E.MG_ATTR_REMOVE="remove",E.MG_ATTR_DVPOS="dvpos",E.MG_ATTR_SIGNIFICANT_NUM_SIZE="significant_num_size",E.MG_ATTR_DEBUG_MODE="debug",E.MG_ATTR_POINT_TRANSLATION="changePoint",E.MG_ATTR_SPECIAL_EXITCTRL="specialExitCtrl",E.MG_ATTR_DEFAULT_COLOR="defaultColor",E.MG_ATTR_DEFAULT_FOCUS_COLOR="defaultFocusColor",E.MG_ATTR_DEFAULT_DISABLED_COLOR="defaultDisabledColor",E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT="ContextInactivityTimeout",E.MG_ATTR_CLIENT_CONTEXT_INACTIVITY_TIMEOUT="ClientContextInactivityTimeout",E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT_LOWER="contextinactivitytimeout",E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME="ContextInactivityWarningTime",E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME_LOWER="contextinactivitywarningtime",E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT="ContextUnloadTimeout",E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT_LOWER="contextunloadtimeout",E.MG_ATTR_TOOLTIP_TIMEOUT="TooltipTimeout",E.MG_ATTR_WEBCLIENT_REINIT_SESSION="WebClientReInitSession",E.MG_ATTR_LOWHIGH="lowhigh",E.MG_ATTR_ACCESS_TEST="AccessTest",E.MG_ATTR_SPECIAL_TEXT_SIZE_FACTORING="SpecialTextSizeFactoring",E.MG_ATTR_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME="SpecialFlatEditOnClassicTheme",E.MG_ATTR_SPECIAL_LEGACY_TRIM_RANGE="SpecialLegacyTrimRange",E.MG_ATTR_SPECIAL_LEGACY_EMPTY_RANGE="SpecialFirstRangeOnEmptyField",E.MG_ATTR_ENCODING="encoding",E.MG_ATTR_SYSTEM="system",E.MG_ATTR_RECOVERY="recovery",E.MG_ATTR_REVERSIBLE="reversible",E.MG_ATTR_NEWID="newid",E.MG_ATTR_MPRG_SOURCE="mprg_source",E.MG_ATTR_INVOKER_ID="invokerid",E.MG_ATTR_TRANS_LEVEL="level",E.MG_ATTR_TOP="top",E.MG_ATTR_LEFT="left",E.MG_ATTR_HEIGHT="height",E.MG_ATTR_WIDTH="width",E.MG_ATTR_LEN="len",E.MG_ATTR_SCAN="scan",E.MG_ATTR_STANDALONE="standalone",E.MG_ATTR_DESC="desc",E.MG_ATTR_CLOSE_SUBFORM_ONLY="closeSubformOnly",E.MG_ATTR_CHECK_ONLY="checkOnly",E.MG_ATTR_EXEC_ON_SERVER="execOnServer",E.MG_ATTR_EXEC_ON_CLIENT="execOnClient",E.MG_ATTR_USER_SORT="userSort",E.MG_TAG_USERNAME="userName",E.MG_TAG_IS_LOGGED_IN="isLoggedIn",E.MG_TAG_PASSWORD="password",E.MG_ATTR_USERID="userId",E.MG_ATTR_USERINFO="userInfo",E.MG_ATTR_CPY_GLB_PRMS="copy_global_params",E.MG_TAG_GLOBALPARAMS="globalparams",E.MG_TAG_GLOBALPARAMSCHANGES="globalParamChanges",E.MG_TAG_GLOBALPARAMSCHANGES_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_TAG_GLOBALPARAMSCHANGES+r.XMLConstants.TAG_CLOSE,E.MG_TAG_GLOBALPARAMSCHANGES_END_TAGGED=r.XMLConstants.END_TAG+E.MG_TAG_GLOBALPARAMSCHANGES+r.XMLConstants.TAG_CLOSE,E.MG_TAG_PARAM="param",E.MG_TAG_PARAM_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_TAG_PARAM+r.XMLConstants.TAG_CLOSE,E.MG_TAG_PARAM_END_TAGGED=r.XMLConstants.END_TAG+E.MG_TAG_PARAM+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_IME_AUTO_OFF="imeAutoOff",E.MG_ATTR_LOCAL_AS400SET="local_as400set",E.MG_ATTR_LOCAL_EXTRA_GENGO="local_extraGengo",E.MG_ATTR_LOCAL_FLAGS="local_flags",E.MG_ATTR_SPEACIAL_ANSI_EXP="SpecialAnsiExpression",E.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES="SpecialShowStatusBarPanes",E.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION="SpecialRouteToRootProgramOnContextRecreation",E.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN="SpecialEditLeftAlign",E.MG_ATTR_SPECIAL_IGNORE_BUTTON_FORMAT="SpecialIgnoreButtonFormat",E.MG_ATTR_SPEACIAL_SWF_CONTROL_NAME="SpecialSwfControlNameProperty",E.MG_ATTR_FRAMESET_STYLE="frameSetStyle",E.MG_ATTR_SPECIAL_VAL_NEW_POLICY="SpecialValNewPolicy",E.MG_ATTR_OPER_CALLMODE="operCallMode",E.MG_ATTR_TASK_FLOW_DIRECTION="taskFlowDir",E.MG_ATTR_TASK_MAINLEVEL="mainlevel",E.MG_ATTR_OPER_METHODNAME="method_name",E.MG_ATTR_OPER_ASMURL="asm_url",E.MG_ATTR_OPER_ASMFILE="asm_file",E.MG_ATTR_OPER_ASMNAME="asm_name",E.MG_ATTR_OPER_ASMCONTENT="asm_content",E.MG_ATTR_GUID="GUID",E.MG_ATTR_CONTROLS_PERSISTENCY_PATH="ControlsPersistencyPath",E.MG_ATTR_PROJDIR="projdir",E.MG_ATTR_TERMINAL="terminal",E.MG_TAG_ENV_PARAM_URL="envparamurl",E.MG_TAG_ENV_PARAM="environment",E.MG_ATTR_CLOSE_TASKS_ON_PARENT_ACTIVATE="closeTasksOnParentActivate",E.MG_ATTR_HANDLER_ONFORM="HandlerOnForm",E.MG_ATTR_DROP_USERFORMATS="dropuserformats",E.MG_ATTR_CACHED_FILES="cachedFiles",E.MG_ATTR_CONTROL_NAME="ControlName",E.MG_TAG_HIDDEN_CONTOLS="HiddenControls",E.MG_ATTR_ISNS="Isns",E.MG_ATTR_SPECIAL_CANCEL_ON_CREATE="SpecialCancelOnCreate",E.MG_ATTR_TEMP_DATABASE="tempdatabase",E.MG_ATTR_TIME_SEPARATOR="timeseparator",E.MG_ATTR_IOTIMING="iotiming",E.MG_ATTR_HTTP_TIMEOUT="httptimeout",E.MG_ATTR_USE_SIGNED_BROWSER_CLIENT="usesignedbrowserclient",E.MG_ATTR_CLOSE_PRINTED_TABLES_IN_SUBTASKS="closeprintedtablesinsubtasks",E.MG_ATTR_GENERIC_TEXT_PRINTING="generictextprinting",E.MG_ATTR_HIGH_RESOLUTION_PRINT="highresolutionprint",E.MG_ATTR_MERGE_TRIM="mergetrim",E.MG_ATTR_ORIGINAL_IMAGE_LOAD="originalimageload",E.MG_ATTR_PRINT_DATA_TRIM="printdatatrim",E.MG_ATTR_PSCRIPT_PRINT_NT="pscriptprintnt",E.MG_ATTR_THOUSAND_SEPARATOR="thousandseparator",E.MG_ATTR_RTF_BUFFER_SIZE="rtfbuffersize",E.MG_ATTR_SPECIAL_CONV_ADD_SLASH="specialconvaddslash",E.MG_ATTR_SPECIAL_FULL_EXPAND_PRINT="specialfullexpandprint",E.MG_ATTR_SPECIAL_FULL_TEXT="specialfulltext",E.MG_ATTR_SPECIAL_LAST_LINE_PRINT="speciallastlineprint",E.MG_ATTR_SPECIAL_PRINTER_OEM="specialprinteroem",E.MG_ATTR_RANGE_POP_TIME="rangepoptime",E.MG_ATTR_TEMP_POP_TIME="temppoptime",E.MG_ATTR_EMBED_FONTS="embedfonts",E.MG_ATTR_BATCH_PAINT_TIME="batchpainttime",E.MG_ATTR_ISAM_TRANSACTION="isamtransaction",E.MG_ATTR_CENTER_SCREEN_IN_ONLINE="centerscreeninonline",E.MG_ATTR_REPOSITION_AFTER_MODIFY="repositionaftermodify",E.MG_ATTR_OVERLAY="overlayid",E.MG_ATTR_TASKFLW="taskflw",E.MG_ATTR_DATAVIEW="dataview",E.MG_ATTR_RECOMP="recomp",E.MG_ATTR_FLWOP="flwop",E.MG_ATTR_START="start",E.MG_ATTR_END="end",E.MG_ATTR_INFO="info",E.MG_ATTR_KEY="key",E.MG_ATTR_KEY_EXP="key_exp",E.MG_ATTR_NULL_FLAGS="nullFlags",E.MG_ATTR_NEXTOPERIDX="nextOperIdx",E.MG_ATTR_DVPOS_VALUE="dvPosValue",E.MG_ATTR_DVPOS_DEC="DvPosDec",E.MG_ATTR_TRANS_ID="transId",E.MG_ATTR_REALREFRESH="realRefresh",E.MG_ATTR_SUB_FORM_RCMP="sub_form_recomp",E.MG_ATTR_HAS_LINK_RECOMPUTES="has_link_recomputes",E.MG_ATTR_LOCATE_FIRST_ID="locateFirstRec",E.MG_ATTR_OFFSET="offset",E.MG_ATTR_HAS_LOCATE="hasLocate",E.MG_ATTR_AS_PARENT="AsParent",E.MG_ATTR_TASK_UNIQUE_SORT="TaskUniqueSort",E.MG_ATTR_TRANS_OWNER="newTransOwner",E.MG_ATTR_CLOSE="close",E.MG_ATTR_TASK_COUNTER="task_counter",E.MG_ATTR_LOOP_COUNTER="loop_counter",E.MG_ATTR_CHACHED_FLD_ID="cachedFldId",E.MG_ATTR_LOCATE="locate",E.MG_ATTR_LINK="link",E.MG_ATTR_IS_LINK_FIELD="isLinkFld",E.MG_ATTR_CACHED_TABLE="cached_table",E.MG_ATTR_TABLE_INDEX="tableIndex",E.MG_ATTR_LINK_EVAL_CONDITION="evalCondition",E.MG_ATTR_LINK_MODE="linkmode",E.MG_ATTR_LINK_START="linkBeginAfterField",E.MG_ATTR_IDENT="tid",E.MG_ATTR_DIR="dir",E.MG_ATTR_COND="cndExp",E.MG_ATTR_COND_RES="tskCndRes",E.MG_ATTR_RET_VAL="retVal",E.MG_ATTR_DBPOS="db_pos",E.MG_TAG_USR_DEF_FUC_RET_EXP_ID="returnexp",E.MG_TAG_USR_DEF_FUC_RET_EXP_ATTR="returnexpattr",E.MG_TAG_PROPERTIES="properties",E.MG_TAG_PROPERTY="property",E.MG_ATTR_IS_VECTOR="is_vector",E.MG_ATTR_DIRECTION="direction",E.MG_ATTR_KEEP_USER_SORT="keepUserSort",E.MG_ATTR_SEARCH_STR="searchStr",E.MG_ATTR_RESET_SEARCH="resetSearch",E.MG_TAG_DBHS="DBHS",E.MG_TAG_DBHS_END="/DBHS",E.MG_TAG_DBH_DATA_IDS_URL="dbhDataIdsUrl",E.MG_TAG_DBH_DATA_ID="dbhDataId",E.MG_TAG_DBH="DBH",E.MG_TAG_DBH_END="/DBH",E.MG_TAG_FLDS="FLDS",E.MG_TAG_FLDS_END="/FLDS",E.MG_TAG_FLD="FLD",E.MG_TAG_KEYS="KEYS",E.MG_TAG_KEYS_END="/KEYS",E.MG_TAG_KEY="KEY",E.MG_TAG_KEY_END="/KEY",E.MG_TAG_SEGS="SEGS",E.MG_TAG_SEGS_END="/SEGS",E.MG_TAG_SEG="SEG",E.MG_ATTR_ISN="isn",E.MG_ATTR_ATTR="Attr",E.MG_ATTR_ALLOW_NULL="AllowNull",E.MG_ATTR_DEFAULT_NULL="DefaultNull",E.MG_ATTR_STORAGE="Storage",E.MG_ATTR_DATASOURCE_DEFINITION="DataSourceDefinition",E.MG_ATTR_DIFF_UPDATE="DiffUpdate",E.MG_ATTR_DEC="Dec",E.MG_ATTR_WHOLE="Whole",E.MG_ATTR_PART_OF_DATETIME="PartOfDateTime",E.MG_ATTR_DEFAULT_STORAGE="DefaultStorage",E.MG_ATTR_CONTENT="Content",E.MG_ATTR_PICTURE="Picture",E.MG_ATTR_DB_DEFAULT_VALUE="DbDefaultValue",E.MG_ATTR_FLD_DB_INFO="DbInfo",E.MG_ATTR_DB_NAME="DbName",E.MG_ATTR_DB_TYPE="DbType",E.MG_ATTR_USER_TYPE="UserType",E.MG_ATTR_NULL_DISPLAY="NullDisplay",E.MG_ATTR_FIELD_NAME="Name",E.MG_ATTR_FLD_ISN="fld_isn",E.MG_TAG_KEY_SEGMENTS="KeySegs",E.MG_TAG_SEGMENT="segment",E.MG_ATTR_KEY_DB_NAME="KeyDBName",E.MG_ATTR_NAME="name",E.MG_ATTR_DBASE_NAME="dbase_name",E.MG_ATTR_POSITION_ISN="position_isn",E.MG_ATTR_ARRAY_SIZE="array_size",E.MG_ATTR_ROW_IDENTIFIER="row_identifier",E.MG_ATTR_CHECK_EXIST="check_exist",E.MG_ATTR_DEL_UPD_MODE="del_upd_mode",E.MG_ATTR_DBH_DATA_URL="dbhDataURL",E.MG_ATTR_FIELD_INDEX="fieldindex",E.MG_ATTR_MIN_VALUE="min",E.MG_ATTR_MAX_VALUE="max",E.MG_ATTR_NULL_MIN_VALUE="null_min",E.MG_ATTR_NULL_MAX_VALUE="null_max",E.MG_ATTR_TASK_TABLE_NAME_EXP="tableNameExp",E.MG_ATTR_TASK_TABLE_ACCESS="access",E.MG_ATTR_TASK_TABLE_IDENTIFIER="dataSourceIdentifier",E.MG_TAG_DATABASES_HEADER="Databases",E.MG_TAG_DATABASES_END="/Databases",E.MG_TAG_DATABASE_INFO="database",E.MG_TAG_DATABASE_URL="databaseUrl",E.MG_ATTR_DATABASE_NAME="name",E.MG_ATTR_DATABASE_LOCATION="location",E.MG_ATTR_DATABASE_TYPE="dbtype",E.MG_ATTR_DATABASE_USER_PASSWORD="userPassword",E.BYTES_IN_CHAR=2,E.MG_OPER_VERIFY=2,E.MG_OPER_BLOCK=5,E.MG_OPER_LOOP=97,E.MG_OPER_ELSE=98,E.MG_OPER_ENDBLOCK=6,E.MG_OPER_CALL=7,E.MG_OPER_EVALUATE=8,E.MG_OPER_UPDATE=9,E.MG_OPER_USR_EXIT=13,E.MG_OPER_RAISE_EVENT=14,E.MG_OPER_SERVER=99,E.TRANS_BEGIN="B",E.TRANS_COMMIT="C",E.TRANS_ABORT="A",E.FRAME_SET_STYLE_HOR="H",E.FRAME_SET_STYLE_VER="V",E.EVENT_TYPE_SYSTEM="S",E.EVENT_TYPE_INTERNAL="I",E.EVENT_TYPE_TIMER="T",E.EVENT_TYPE_EXPRESSION="E",E.EVENT_TYPE_USER="U",E.EVENT_TYPE_PUBLIC="P",E.EVENT_TYPE_NONE="N",E.EVENT_TYPE_NOTINITED="X",E.EVENT_TYPE_USER_FUNC="F",E.BRK_LEVEL_TASK_PREFIX="TP",E.BRK_LEVEL_TASK_SUFFIX="TS",E.BRK_LEVEL_REC_PREFIX="RP",E.BRK_LEVEL_REC_MAIN="RM",E.BRK_LEVEL_REC_SUFFIX="RS",E.BRK_LEVEL_CTRL_PREFIX="CP",E.BRK_LEVEL_CTRL_SUFFIX="CS",E.BRK_LEVEL_CTRL_VERIFICATION="CV",E.BRK_LEVEL_HANDLER_INTERNAL="HI",E.BRK_LEVEL_HANDLER_SYSTEM="HS",E.BRK_LEVEL_HANDLER_TIMER="HT",E.BRK_LEVEL_HANDLER_EXPRESSION="HE",E.BRK_LEVEL_HANDLER_ERROR="HR",E.BRK_LEVEL_HANDLER_USER="HU",E.BRK_LEVEL_HANDLER_DOTNET="HD",E.BRK_LEVEL_USER_FUNCTION="UF",E.BRK_LEVEL_VARIABLE="VC",E.BRK_LEVEL_MAIN_PROG="MP",E.BRK_LEVEL_SUBFORM="SUBFORM",E.BRK_LEVEL_FRAME="FRAME",E.BRK_LEVEL_TASK_PREFIX_FM="Task Prefix ",E.BRK_LEVEL_TASK_SUFFIX_FM="Task Suffix ",E.BRK_LEVEL_REC_PREFIX_FM="Record Prefix ",E.BRK_LEVEL_REC_SUFFIX_FM="Record Suffix ",E.BRK_LEVEL_CTRL_PREFIX_FM="Control Prefix ",E.BRK_LEVEL_CTRL_SUFFIX_FM="Control Suffix ",E.BRK_LEVEL_VARIABLE_FM="Variable Change ",E.BRK_LEVEL_CTRL_VERIFICATION_FM="Control Verification ",E.BRK_LEVEL_HANDLER_INTERNAL_FM="Internal: ",E.BRK_LEVEL_HANDLER_SYSTEM_FM="System: ",E.BRK_LEVEL_HANDLER_TIMER_FM="Timer:",E.BRK_LEVEL_HANDLER_EXPRESSION_FM="Expression: ",E.BRK_LEVEL_HANDLER_ERROR_FM="Handler Error ",E.BRK_LEVEL_HANDLER_USER_FM="User",E.BRK_LEVEL_HANDLER_DOTNET_FM="Dotnet: ",E.BRK_LEVEL_USER_FUNCTION_FM="User Defined Function",E.HANDLER_LEVEL_VARIABLE="V",E.TRANS_NONE="O",E.TRANS_RECORD_PREFIX="P",E.TRANS_TASK_PREFIX="T",E.TRANS_IGNORE="I",E.TRANS_FORCE_OPEN="F",E.RECOVERY_NONE="\0",E.RECOVERY_ROLLBACK="R",E.RECOVERY_RETRY="T",E.FLW_VERIFY_MODE_ERROR="E",E.FLW_VERIFY_MODE_WARNING="W",E.IMAGE_EXCLAMATION="E",E.IMAGE_CRITICAL="C",E.IMAGE_QUESTION="Q",E.IMAGE_INFORMATION="I",E.IMAGE_NONE="N",E.BUTTONS_OK="O",E.BUTTONS_OK_CANCEL="K",E.BUTTONS_ABORT_RETRY_IGNORE="A",E.BUTTONS_YES_NO_CANCEL="Y",E.BUTTONS_YES_NO="N",E.BUTTONS_RETRY_CANCEL="R",E.DISPLAY_BOX="B",E.DISPLAY_STATUS="S",E.END_COND_EVAL_BEFORE="B",E.END_COND_EVAL_AFTER="A",E.END_COND_EVAL_IMMIDIATE="I",E.OPENWIN_STATE_NONE="N",E.OPENWIN_STATE_INPROCESS="I",E.OPENWIN_STATE_OVER="O",E.ARG_TYPE_FIELD="F",E.ARG_TYPE_EXP="E",E.ARG_TYPE_VALUE="V",E.ARG_TYPE_SKIP="X",E.TOP_LEVEL_CONTAINER=0,E.MG_HYPER_ARGS="MG_HYPER_ARGS",E.REQ_ARG_ALPHA="-A",E.REQ_ARG_UNICODE="-C",E.REQ_ARG_NUMERIC="-N",E.REQ_ARG_DOUBLE="-D",E.REQ_ARG_LOGICAL="-L",E.REQ_ARG_NULL="-U",E.REQ_ARG_SEPARATOR="&",E.REQ_ARG_START="?",E.REQ_ARG_COMMA=",",E.REQ_APP_NAME="appname",E.REQ_PRG_NAME="prgname",E.REQ_PRG_DESCRIPTION="prgdescription",E.REQ_ARGS="arguments",E.REQ_SKIP_AUTHENTICATION="SkipAuthentication",E.RC_INDICATION_INITIAL="WEBCLIENT=INITIAL&",E.RC_INDICATION_SCRAMBLED="SCRAMBLED&",E.RC_INDICATION="WEBCLIENT=Y&",E.UTF8TRANS="UTF8TRANS=Y&",E.DEBUG_CLIENT_NETWORK_RECOVERY="&DEBUGCLIENTNETWORKRECOVERY=Y",E.RC_TOKEN_CTX_ID="CTX=",E.RC_TOKEN_SESSION_ID="SI=",E.RC_TOKEN_CTX_GROUP="CTXGROUP=",E.RC_TOKEN_SESSION_COUNT="SESSION=",E.RC_TOKEN_DATA="DATA=",E.RC_TOKEN_TARGET_FILE="TARGETFILE=",E.WEBCLIENT_REINITIALIZE_REQUEST="WCREINITIALIZEREQUEST=Y",E.MAIN_PROG_VIEW="MainProgramsDataView",E.GLOBAL_PARAM_LIST="GlobalParamList",E.LAST_EXCEPTION="LastException",E.CTX_REMOVED_FROM_SRVR="CtxRemovedFromSrvr",E.LAST_ROUTE_EVENT="LastRouteEvent",E.LAST_ROUTE_EVENT_ARG_LIST="LastRouteEventArgList",E.LAST_ROUTE_EVENT_SRC_TSK="LastRouteEventSourceTask",E.IS_SESSION_REINITIALIZING="IsSessionReInitializing",E.RC_AUTHENTICATION_REQUEST="RCAUTHENTICATIONREQUEST=Y",E.V24_RIA_ERROR_PREFIX="<RIA_ERROR_RESPONSE>",E.SESSION_COUNTER_CLOSE_CTX_INDICATION=-1,E.SERVER="server",E.REQUESTER="requester",E.LOCALID="localid",E.DEBUGCLIENT="debugclient",E.ENVVARS="envvars",E.INTERNAL_LOG_LEVEL="InternalLogLevel",E.INTERNAL_LOG_SYNC="InternalLogSync",E.LOG_CLIENTSEQUENCE_FOR_ACTIVITY_MONITOR="LogClientSequenceForActivityMonitor",E.CTX_GROUP="CtxGroup",E.PARALLEL_EXECUTION="ParallelExecution",E.DISPLAY_GENERIC_ERROR="DisplayGenericError",E.FIRST_HTTP_REQUEST_TIMEOUT="FirstHTTPRequestTimeout",E.MG_TAG_CHNG_PASS_CAPTION="LogonChangePasswordCaption",E.MG_TAG_CHNG_PASS_WIN_TITLE="ChangePasswordWindowTitle",E.MG_TAG_CHNG_PASS_OLD_PASS_CAPTION="ChangePasswordOldPasswordCaption",E.MG_TAG_CHNG_PASS_NEW_PASS_CAPTION="ChangePasswordNewPasswordCaption",E.MG_TAG_CHNG_PASS_CONFIRM_PASS_CAPTION="ChangePasswordConfirmPasswordCaption",E.MG_TAG_CHNG_PASS_MISMATCH_MSG="ChangePasswordMismatchMessage",E.DEPLOYMENT_MANIFEST="APPLICATION",E.PUBLISH_HTML="publish.html",E.PROPS_START_TAG="<properties>",E.PROPS_END_TAG="</properties>",E.APPL_LOGON_SUB_CAPTION="Logon Parameters",E.DEFAULT_ERROR_LOGON_FAILED="Error during authentication process",E.DEFAULT_ERROR_WRONG_PASSWORD="Incorrect password",E.ERROR_STRING="Error",E.INFORMATION_STRING="Information",E.DEFAULT_MSG_PASSWORD_CHANGE="Password was changed successfully",E.PASSWORD_MISMATCH="New password and confirm password not same",E.ROW_CONTROLS_KEY="ROW_CONTROLS_KEY",E.ROW_INVALIDATED_KEY="ROW_INVALIDATED_KEY",E.IS_EDITOR_KEY="IS_EDITOR_KEY",E.TMP_EDITOR="TMP_EDITOR",E.LAST_FOCUSED_WIDGET="LAST_FOCUSED_WIDGET",E.LAST_CURSOR="LAST_CURSOR",E.KEYDOWN_IGNORE_KEY="KEYDOWN_IGNORE_key",E.STATUS_BAR_WIDGET_KEY="STATUS_BAR_WIDGET_KEY",E.MGBROWSER_KEY="MGBROWSER_Key",E.POPUP_WAS_OPENED="COMBO_BOX_WAS_OPENED",E.POPUP_WAS_CLOSED_COUNT="COMBO_BOX_WAS_CLOSED_COUNT",E.IGNORE_SELECTION_KEY="IGNORE_SELECTION_KEY",E.CP_ISO_8859_ANSI="8859_1",E.CP_UNICODE="UTF-16LE",E.INCREMENTAL_LOCATE_TIMEOUT=500,E.USER_RANGES="ranges",E.USER_LOCATES="locates",E.SORT="srt",E.MIN_RNG="min",E.MAX_RNG="max",E.NULL_MIN_RNG="isNullMin",E.NULL_MAX_RNG="isNullMax",E.CLEAR_RANGE="rangeReset",E.CLEAR_LOCATES="locateReset",E.CLEAR_SORTS="sortReset",E.USER_RNG="rng",E.TASK_MODE_QUERY_STR="Query",E.TASK_MODE_MODIFY_STR="Modify",E.TASK_MODE_CREATE_STR="Create",E.TASK_MODE_DELETE_STR="Delete",E.MG_ZOOM="ZOOM",E.MG_NORMAL="NORMAL",E.MG_INSERT="INS",E.MG_OVERWRITE="OVR",E.MG_TAG_ENV_CHANGES="changes",E.MG_ATTR_ENV_VALUE="value",E.MG_ATTR_ENV_WRITEINI="writeToINI",E.MG_ATTR_ENV_RESERVED="reserved",E.MG_ATTR_ENV_REMOVED="removed",E.INI_SECTION_MAGIC_ENV_BRACKETS="[MAGIC_ENV]",E.INI_SECTION_LOGICAL_NAMES_BRACKETS="[MAGIC_LOGICAL_NAMES]",E.INI_SECTION_MAGIC_ENV="MAGIC_ENV",E.INI_SECTION_MAGIC_SYSTEMS="MAGIC_SYSTEMS",E.INI_SECTION_MAGIC_DBMS="MAGIC_DBMS",E.INI_SECTION_MAGIC_SERVERS="MAGIC_SERVERS",E.INI_SECTION_MAGIC_COMMS="MAGIC_COMMS",E.INI_SECTION_MAGIC_PRINTERS="MAGIC_PRINTERS",E.INI_SECTION_MAGIC_SYSTEM_MENU="MAGIC_SYSTEM_MENU",E.INI_SECTION_MAGIC_DATABASES="MAGIC_DATABASES",E.INI_SECTION_MAGIC_LANGUAGE="MAGIC_LANGUAGE",E.INI_SECTION_MAGIC_SERVICES="MAGIC_SERVICES",E.INI_SECTION_TOOLS_MENU="TOOLS_MENU",E.MENU_PROGRAM_FLOW_ONLINE="O",E.MENU_PROGRAM_FLOW_BATCH="B",E.MENU_PROGRAM_FLOW_BROWSER="R",E.MENU_PROGRAM_FLOW_RC="C",E.SB_IMG_PANE_LAYER=1,E.SB_IMG_PANE_WIDTH=33,E.GUI_COMMAND_EXEC_WAIT_TIME=100,E.STARTUP_IMAGE_FILENAME="Resources\\startup.png",E.V2L_DLL="v2l32.dll",E.SQLITE_DLL_NAME="MgRIASqliteGateway.dll",E.INITIAL_OFFLINE_TASK_TAG=1e9,E.ENABLE_COMMUNICATION_DIALOGS="EnableCommunicationDialogs",E.MG_ATTR_VAL_ABORT="abort",E.MG_ATTR_VAL_ENHANCED_VERIFY="enhancedverify",E.MG_ATTR_VAL_OPENURL="openurl",E.MG_ATTR_VAL_RESULT="result",E.MG_ATTR_VAL_VERIFY="verify",E.MG_ATTR_VAL_ADD_RANGE="addrange",E.MG_ATTR_VAL_ADD_LOCATE="addlocate",E.MG_ATTR_VAL_ADD_SORT="addsort",E.MG_ATTR_VAL_RESET_RANGE="resetrange",E.MG_ATTR_VAL_RESET_LOCATE="resetlocate",E.MG_ATTR_VAL_RESET_SORT="resetsort",E.MG_ATTR_VAL_CLIENT_REFRESH="clientrefresh",E.MG_ATTR_VAL_EVAL="evaluate",E.MG_ATTR_VAL_EVENT="event",E.MG_ATTR_VAL_EXEC_OPER="execoper",E.MG_ATTR_VAL_EXPAND="expand",E.MG_ATTR_VAL_MENU="execmenu",E.MG_ATTR_VAL_QUERY="query",E.MG_ATTR_VAL_QUERY_GLOBAL_PARAMS="globalparams",E.MG_ATTR_VAL_QUERY_TYPE="query_type",E.MG_ATTR_VAL_RECOMP="recompute",E.MG_ATTR_VAL_TRANS="trans",E.MG_ATTR_VAL_UNLOAD="unload",E.MG_ATTR_VAL_INIPUT_FORCE_WRITE="iniputForceWrite",E.MG_ATTR_VAL_INIPUT_PARAM="iniputParam",E.MG_ATTR_ERROR_MESSAGE="errorMessage",E.MG_ATTR_VAL_TOTAL_RECORDS_COUNT="totalRecordsCount",E.MG_ATTR_VAL_RECORDS_BEFORE_CURRENT_VIEW="recordsBeforeCurrentView",E.MG_ATTR_VAL_SERVER_TRANS_CACHE_EMPTY="serverTransCacheEmpty",E.MG_ATTR_SPECIAL_ANSI_BLOB_CHECK_NULL="SpecialAnsiBlobCheckNull",E.MG_ATTR_SPECIAL_TABLE_REDUCE_TITLE_HEIGHT="SpecialTableReduceTitleHeight",E.MG_ATTR_SPECIAL_DOTNET_ALLOW_ZERO_DATE="SpecialDotNetAllowZeroDate",E.MG_ATTR_SPECIAL_REUSE_TABLE_EDITOR="SpecialReuseTableEditor",E.MG_TAG_LAST_ROUTE="LastRoute";var I,f=function(){function e(){}return Object.defineProperty(e.prototype,"ShouldSerialize",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ShouldSerializeRecords",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.SerializeCommandData=function(e){return null},e.prototype.SerializeDataAfterCommand=function(){return null},e}(),C=function(e){function t(){return e.call(this)||this}return u(t,e),Object.defineProperty(t.prototype,"Task",{get:function(){return o.mgDataTable.getCurrMGData().getTask(this.TaskTag)},enumerable:!1,configurable:!0}),t}(f),A=function(){function e(){this.message=new t.StringBuilder}return e.prototype.GetString=function(){return this.message.ToString()},e.prototype.SerializeTaskTag=function(e){var t=o.mgDataTable.getTaskIdById(e);this.SerializeAttribute(r.XMLConstants.MG_ATTR_TASKID,t)},e.prototype.SerializeFldId=function(e){this.SerializeAttribute(E.MG_ATTR_FIELDID,e)},e.prototype.SerializeDitIdx=function(e){e>t.Int32.MinValue&&this.SerializeAttribute(r.XMLConstants.MG_ATTR_DITIDX,e)},e.prototype.SerializeRouteParams=function(e){for(var t=e.getRouteParams(),a="",s=0;s<t.length;s++)a=a.concat(n.RecordUtils.serializeItemVal(t[s],r.StorageAttribute.UNICODE,r.StorageAttribute.SKIP,!0));this.SerializeAttribute(E.MG_ATTR_ROUTE_PARAMS,a)},e.prototype.SerializeRefreshMode=function(e){e!==r.ViewRefreshMode.None&&this.SerializeAttribute(E.MG_ATTR_REALREFRESH,e)},e.prototype.SerializeMagicEvent=function(e){this.SerializeAttribute(E.MG_ATTR_MAGICEVENT,e)},e.prototype.SerializeCloseSubformOnly=function(e){e&&this.SerializeAttribute(E.MG_ATTR_CLOSE_SUBFORM_ONLY,"1")},e.prototype.SerializeKeyIndex=function(e){this.SerializeAttribute(E.MG_ATTR_KEY,e)},e.prototype.SerializeAttribute=function(e,t){2!==arguments.length||null!==e&&e.constructor!==String||null!==t&&t.constructor!==String?2!==arguments.length||null!==e&&e.constructor!==String||null!==t&&t.constructor!==Number?this.SerializeAttribute_2(e,t):this.SerializeAttribute_1(e,t):this.SerializeAttribute_0(e,t)},e.prototype.SerializeAttribute_0=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e.prototype.SerializeAttribute_1=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e.prototype.SerializeAttribute_2=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e}(),R=function(e){function r(t){var r=e.call(this)||this;return r.TaskTag=null,r.MagicEvent=0,r.ClientRecId=0,r.MagicEvent=t,r}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EVENT},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"EventDescription",{get:function(){return k.getInternalEvtDescription(this.MagicEvent)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Task",{get:function(){return o.mgDataTable.getCurrMGData().getTask(this.TaskTag)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ShouldSerialize",{get:function(){return!(null!==this.TaskTag&&null!==o.mgDataTable.GetTaskByID(this.TaskTag)&&!o.mgDataTable.GetTaskByID(this.TaskTag).KnownToServer)},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]",this.EventDescription,this.Task.getTaskInfo())},r}(C);(I=e.RollbackEventCommand_RollbackType||(e.RollbackEventCommand_RollbackType={})).NONE=" ",I.CANCEL="C",I.ROLLBACK="R";var S=function(n){function a(){var t=n.call(this,r.InternalInterface.MG_ACT_ROLLBACK)||this;return t.Rollback=e.RollbackEventCommand_RollbackType.NONE,t}return u(a,n),a.prototype.SerializeCommandData=function(t){var r=new A;return r.SerializeTaskTag(this.TaskTag),r.SerializeMagicEvent(this.MagicEvent),this.Rollback!==e.RollbackEventCommand_RollbackType.NONE&&r.SerializeAttribute(E.MG_ATTR_ROLLBACK_TYPE,this.Rollback),r.GetString()},a.prototype.getRollbackTypeString=function(){switch(this.Rollback){case e.RollbackEventCommand_RollbackType.CANCEL:return"Cancel";case e.RollbackEventCommand_RollbackType.ROLLBACK:return"Rollback"}},a.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,t.NString.IsNullOrEmpty(this.getRollbackTypeString())?t.NString.Empty:t.NString.Format(" while handling {0}",this.getRollbackTypeString()),this.Task.getTaskInfo())},a}(R),M=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.IsEventHandlerField=!1,t}return u(t,e),t}(n.GuiFieldBase);M.CLEAR_FLAGS=!0;var m,v=function(){function e(e){this._exp=null,this._fld=null,this._skip=!1,this._type="\0",this._val=null,this._valueAttr=r.StorageAttribute.NONE,this._valueIsNull=!1,0!==arguments.length?1===arguments.length&&(null===e||e instanceof M)?this.constructor_1(e):1===arguments.length&&(null===e||e instanceof n.ExpVal)?this.constructor_2(e):this.constructor_3(e):this.constructor_0()}return e.prototype.constructor_0=function(){this._type="\0",this._fld=null,this._exp=null,this._skip=!1},e.prototype.constructor_1=function(e){this._fld=e,this._type=E.ARG_TYPE_FIELD,this._exp=null,this._skip=!1},e.prototype.constructor_2=function(e){this._type=E.ARG_TYPE_VALUE,this._fld=null,this._exp=null,this._skip=!1,e.IsNull?this._val=null:this._val=e.ToMgVal(),this._valueIsNull=null===this._val,this._valueAttr=e.Attr},e.prototype.constructor_3=function(e){switch(this._type=E.ARG_TYPE_VALUE,e._type){case E.ARG_TYPE_FIELD:this._valueAttr=e._fld.getType();break;case E.ARG_TYPE_EXP:break;case E.ARG_TYPE_SKIP:this._skip=!0;break;default:throw new t.ApplicationException("in Argument.Argument(): illegal source Argument type!")}},e.prototype.Initialize=function(t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:switch(t._type){case E.ARG_TYPE_FIELD:return[3,1];case E.ARG_TYPE_EXP:return[3,2]}return[3,4];case 1:return this._val=t._fld.getValue(!0),this._valueIsNull=t._fld.isNull(),[3,4];case 2:return[4,t._exp.evaluateWithResLength(255)];case 3:return n=a.sent(),this._val=n.mgVal,this._valueAttr=n.type,this._valueIsNull=null==this._val,this._valueIsNull&&(this._val=e.getEmptyValue(n.type===r.StorageAttribute.BLOB||n.type===r.StorageAttribute.BLOB_VECTOR)),[3,4];case 4:return[2]}}))}))},e.prototype.fillData=function(e,n){this._type=e[0];var a=e.substr(2);switch(this._type){case E.ARG_TYPE_FIELD:var s=a.split(","),i=t.NNumber.Parse(s[0]),o=t.NNumber.Parse(s[1]);this._fld=n.getFieldDef(i,o);break;case E.ARG_TYPE_EXP:var l=t.NNumber.Parse(a);this._exp=n.getExpById(l);break;case E.ARG_TYPE_SKIP:this._skip=!0;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Argument.FillData() illegal type: "+e)}},e.prototype.buildXML=function(e){switch(this._type){case E.ARG_TYPE_FIELD:e.Append("F:"+this._fld.getTask().getTaskTag()+","+this._fld.getId());break;case E.ARG_TYPE_EXP:e.Append("E:"+this._exp.getId());break;case E.ARG_TYPE_SKIP:e.Append("X:0");break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Argument.buildXML() illegal type: "+this._type)}},e.prototype.getType=function(){return this._type},e.prototype.getField=function(){return this._type===E.ARG_TYPE_FIELD?this._fld:null},e.prototype.getExp=function(){return this._type===E.ARG_TYPE_EXP?this._exp:null},e.prototype.setValueToField=function(t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:switch(this._type){case E.ARG_TYPE_FIELD:return[3,1];case E.ARG_TYPE_EXP:return[3,2];case E.ARG_TYPE_VALUE:return[3,4]}return[3,5];case 1:return n=this._fld.getValue(!0),n=e.convertArgs(n,this._fld.getType(),t.getType()),a=this._fld.isNull()||null==n,[3,6];case 2:return[4,this._exp.evaluateWithResultTypeAndLength(t.getType(),t.getSize())];case 3:return n=s.sent(),(a=null==n)&&(n=e.getEmptyValue(t.getType()===r.StorageAttribute.BLOB||t.getType()===r.StorageAttribute.BLOB_VECTOR)),[3,6];case 4:return n=e.convertArgs(this._val,this._valueAttr,t.getType()),a=this._valueIsNull||null==n,[3,6];case 5:return[2];case 6:return t.takeValFromRec(),[4,t.setValueAndStartRecompute(n,a,t.getTask().DataViewWasRetrieved,!1,!0)];case 7:return s.sent(),[2]}}))}))},e.convertArgs=function(e,t,a){var s=!1;switch(a){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:t===r.StorageAttribute.BLOB?n.BlobType.isValidBlob(e)&&(e=n.BlobType.getString(e)):r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t)||(s=!0);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:r.StorageAttributeCheck.isTypeNumeric(t)||(s=!0);break;case r.StorageAttribute.BLOB:if(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t)){var i=t===r.StorageAttribute.ALPHA?n.BlobType.CONTENT_TYPE_ANSI:n.BlobType.CONTENT_TYPE_UNICODE;e=n.BlobType.createFromString(e,i)}else r.StorageAttributeCheck.isTypeBlob(t)||(s=!0)}return s&&(e=n.FieldDef.getMagicDefaultValue(a)),e},e.prototype.getValue=function(t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:switch(this._type){case E.ARG_TYPE_EXP:return[3,1];case E.ARG_TYPE_FIELD:return[3,3];case E.ARG_TYPE_VALUE:return[3,4]}return[3,5];case 1:return a=this,[4,this._exp.evaluateWithResultTypeAndLength(t,n)];case 2:return a._val=s.sent(),null==this._val&&(this._val=e.getEmptyValue(t===r.StorageAttribute.BLOB||t===r.StorageAttribute.BLOB_VECTOR)),[3,6];case 3:return this._val=this._fld.getValue(!0),[3,6];case 4:return[3,6];case 5:return[2,null];case 6:return[2,this._val]}}))}))},e.prototype.skipArg=function(){return this._skip},e.prototype.fillDataByParams=function(e,t,n){this._valueAttr=e,this._val=t,this._valueIsNull=n,this._valueAttr===r.StorageAttribute.SKIP?(this._type=E.ARG_TYPE_SKIP,this._skip=!0):this._type=E.ARG_TYPE_VALUE},e.getEmptyValue=function(e){return e?n.BlobType.getEmptyBlobPrefix("\0")+";":""},e.prototype.FillFromString=function(e){this._type=E.ARG_TYPE_VALUE;var t=null;switch(e.length>2&&(t=e.substr(0,2)),t){case E.REQ_ARG_ALPHA:this._valueAttr=r.StorageAttribute.ALPHA;break;case E.REQ_ARG_UNICODE:this._valueAttr=r.StorageAttribute.UNICODE;break;case E.REQ_ARG_NUMERIC:case E.REQ_ARG_DOUBLE:this._valueAttr=r.StorageAttribute.NUMERIC;break;case E.REQ_ARG_LOGICAL:this._valueAttr=r.StorageAttribute.BOOLEAN;break;case E.REQ_ARG_NULL:this._valueAttr=r.StorageAttribute.NONE;break;default:return this._valueAttr=r.StorageAttribute.ALPHA,void(this._val=e)}this._val=e.substr(2)},e.prototype.makeURLPrintable=function(e){return r.StrUtil.searchAndReplace(e,["\\","\0",","],["\\\\","\\0","\\,"])},e}(),L=function(){function e(e){this._list=null,this.RefreshOnString=null,0!==arguments.length?1===arguments.length&&(null===e||e instanceof Array)?this.constructor_2(e):this.constructor_3(e):this.constructor_0()}return e.prototype.constructor_0=function(){},e.prototype.Initialize=function(e){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:return this.constructor_0(),null!==e?[3,1]:(this._list=null,[3,5]);case 1:this._list=new t.List,r=0,a.label=2;case 2:return r<e.getSize()?[4,(n=new v(e.getArg(r))).Initialize(e.getArg(r))]:[3,5];case 3:a.sent(),this._list.push(n),a.label=4;case 4:return r+=1,[3,2];case 5:return[2]}}))}))},e.prototype.constructor_2=function(e){this.constructor_0();var r=e.length;if(0===r)this._list=null;else{this._list=new t.List;for(var n=0;n<r;n+=1)this._list.push(new v(e[n]))}},e.prototype.constructor_3=function(e){this.Add(e)},e.prototype.fillList=function(e,n){var a=r.StrUtil.tokenize(e,"$"),s=a.length;this._list=new t.List;for(var i=0;i<s;i+=1){var o=new v;o.fillData(a[i],n),this._list.push(o)}},e.prototype.buildListFromParams=function(e,r,n,a){this._list=new t.List;for(var s=0;s<e;s+=1){var i=new v;i.fillDataByParams(r.charAt(s),n[s],"0"!==a.charAt(s)),this._list.push(i)}},e.prototype.buildXML=function(e){for(var t=0;t<this._list.length;t+=1)t>0&&e.Append("$"),this._list.get_Item(t).buildXML(e)},e.prototype.getSize=function(){return null===this._list?0:this._list.length},e.prototype.getArg=function(e){return e<0||e>=this._list.length?null:this._list.get_Item(e)},e.prototype.getArgValue=function(e,t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return null===(n=this.getArg(e))?[2,null]:[4,n.getValue(t,r)];case 1:return[2,a.sent()]}}))}))},e.prototype.FillListFromString=function(e){var r=new RegExp("(?<!\\\\),"),n=e.split(r);this._list=new t.List;for(var a=0;a<n.length;a+=1){var s=new v;s.FillFromString(n[a]),this._list.push(s)}},e.prototype.Add=function(e){null===this._list&&(this._list=new t.List),this._list.push(e)},e}();(m=e.Task_SubformExecModeEnum||(e.Task_SubformExecModeEnum={}))[m.NO_SUBFORM=-1]="NO_SUBFORM",m[m.SET_FOCUS=0]="SET_FOCUS",m[m.FIRST_TIME=1]="FIRST_TIME",m[m.REFRESH=2]="REFRESH";var b=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.IsTryingToStop=!1,t.DoSubformPrefixSuffix=!1,t.IsAfterRetryBeforeBuildXML=!1,t.TaskSuffixExecuted=!1,t.DataviewManager=null,t.IsOffline=!1,t.ResetRange=!1,t.UserRngs=null,t.ResetLocate=!1,t.UserLocs=null,t.ResetSort=!1,t.UserSorts=null,t._transactionFailed=!1,t.InEndTask=!1,t.InCtrlPrefix=!1,t.RetainFocus=!1,t.SubformExecMode=0,t.TransactionErrorHandlingsRetry=null,t.ClosingFormUI=!1,t.AfterFirstRecordPrefix=!1,t}return u(t,e),t.ShouldNonInteractiveBeModal=function(){return!0},t}(n.GuiTaskBase),N=function(){this.veeIdx=0,this.min=null,this.max=null,this.nullMax=!1,this.nullMin=!1,this.discardMax=!1,this.discardMin=!1},y=function(){function e(e,t){this.CallingTask=null,this.PathParentTask=null,0!==arguments.length?this.constructor_1(e,t):this.constructor_0()}return e.prototype.constructor_0=function(){this.CallingTask=this.PathParentTask=null},e.prototype.constructor_1=function(e,t){this.CallingTask=e,this.PathParentTask=t},e}(),O=function(){function e(){this._tasks=null,this._tasks=new t.List}return e.prototype.fillData=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.initInnerObjects(r.getNextTag(),e,t)];case 1:return n.sent()?[3,0]:[3,2];case 2:return[2]}}))}))},e.prototype.initInnerObjects=function(t,n,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return null!==t?[3,1]:(s=!1,[3,4]);case 1:return t!==r.XMLConstants.MG_TAG_TASK?[3,3]:(i=e.createNewtask(),this._tasks.push(i),[4,i.fillData(n,a)]);case 2:return o.sent(),s=!0,[3,4];case 3:s=!1,o.label=4;case 4:return[2,s]}}))}))},e.prototype.addTask=function(e){this._tasks.push(e)},e.prototype.removeTask=function(e){this._tasks.Remove(e)},e.prototype.getTask=function(e){return 1!==arguments.length||null!=e&&e.constructor!==String?this.getTask_1(e):this.getTask_0(e)},e.prototype.getTask_0=function(e){for(var t=0;t<this._tasks.length;t+=1){var r=this._tasks.get_Item(t);if(e===r.getTaskTag())return r}return null},e.prototype.getTask_1=function(e){return e>=0&&e<this._tasks.length?this._tasks.get_Item(e):null},e.prototype.getSize=function(){return this._tasks.length},e.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<this.getSize()?[4,this.getTask(t).buildXML(e)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t+=1,[3,1];case 4:return[2]}}))}))},e.prototype.setTaskAt=function(e,t){this._tasks.length<=t&&this._tasks.SetSize(t+1),this._tasks.set_Item(t,e)},e}();O.createNewtask=null;var G=function(){function e(){this._lastFocusedTasks=null,this.LastActionTime=0}return e.prototype.Init=function(e){this._lastFocusedTasks=new O},e.prototype.getCurrTask=function(){var e=o.eventsManager.getLastRtEvent();return null!==e&&null!==e.getTask()&&null!==e.getTask().GetContextTask()?this.getLastFocusedTask(e.getTask().GetContextTask().getMgdID()):this.getLastFocusedTask()},e.prototype.getLastFocusedTask=function(e){return 0===arguments.length?this._lastFocusedTasks.getTask(o.mgDataTable.currMgdID):this._lastFocusedTasks.getTask(e)},e.prototype.setLastFocusedTask=function(e){var t=this.getLastFocusedTask();if(null!==t&&t!==e)t.getForm();var r=e,n=r.getMgdID();this._lastFocusedTasks.setTaskAt(r,n)},e.prototype.clean=function(t){e.deleteLastFocusedControlAt(t),null!==this._lastFocusedTasks&&this._lastFocusedTasks.setTaskAt(null,t)},e.getLastFocusedControl=function(t){return 1===arguments.length?e.getLastFocusedControl_1(t):e.getLastFocusedControl_0()},e.getLastFocusedControl_0=function(){return e._lastFocusedControls.getCtrl(o.mgDataTable.currMgdID)},e.getLastFocusedControl_1=function(t){return e._lastFocusedControls.getCtrl(t)},e.deleteLastFocusedControlAt=function(t){null!==e._lastFocusedControls&&null!=e._lastFocusedControls.getCtrl(t)&&e._lastFocusedControls.deleteControlAt(t)},e.setLastFocusedControlAt=function(t,r){e._lastFocusedControls.setControlAt(t,r)},e.setLastFocusedControl=function(r,n){var a=r.getMgdID();t.Debug.Assert(null===n||r===n.getForm().getTask()),e.LastFocusMgdID=a,e.setLastFocusedControlAt(n,a),e.Instance.setLastFocusedTask(r)},e}();G.Instance=new G,G._lastFocusedControls=new n.ControlTable,G.LastFocusMgdID=0;var P=function(e){function a(t,r,n){var a=this;return(a=0===arguments.length?e.call(this)||this:3!==arguments.length||null!==t&&t.constructor!==Number||!(null===r||r instanceof b)||null!==n&&n.constructor!==Number?e.call(this,t,r,n)||this:e.call(this,t,r.getForm(),n)||this).initialize(),a}return u(a,e),a.prototype.initialize=function(){this._focusedStopExecution=!1,this._inControlSuffix=!1,this._rtEvtTask=null,this._subformTaskId=null,this._subformTask=null,this.IsInteractiveUpdate=!1,this.refreshOnString=null,this.SubformLoaded=!1,this.HasZoomHandler=!1,this.ArgList=null},a.prototype.GetVarIndex=function(){return e.prototype.getForm.call(this).getTask().DataView.Dvcount+this.veeIndx},a.prototype.fillData=function(t,r,n){var a=Object.create(null,{fillData:{get:function(){return e.prototype.fillData}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(s){switch(s.label){case 0:return a.fillData.call(this,t,r,n),e=this,[4,this.GetArgumentList()];case 1:return e.ArgList=s.sent(),[2]}}))}))},a.prototype.SetAttribute=function(n,a){var s=e.prototype.SetAttribute.call(this,n,a);if(!s)switch(n){case E.MG_ATTR_SUBFORM_TASK:this._subformTaskId=a;break;case E.MG_ATTR_REFRESHON:this.refreshOnString=a.trim();break;default:s=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",n))}return s},a.prototype.GetArgumentList=function(){var t=Object.create(null,{getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){var e,r,a;return h(this,(function(s){switch(s.label){case 0:return e=null,null===this._propTab?[2,e]:null===(r=this._propTab.getPropById(n.PropInterface.PROP_TYPE_PARAMETERS))?[2,e]:[4,r.getValue()];case 1:return null!==(a=s.sent())&&((e=new L).fillList(a,t.getForm.call(this).getTask()),null!==this.refreshOnString&&(e.RefreshOnString=this.refreshOnString)),[2,e]}}))}))},a.prototype.isDescendent=function(r){var n=!1,a=e.prototype.getForm.call(this);for(t.Debug.Assert(null!==r);!n&&null!==a;)if(r===a)n=!0;else{var s=a.getTask();if(null===s.getParent())break;a=s.getParent().getForm()}return n},a.prototype.refreshOnExpression=function(){return T(this,void 0,void 0,(function(){var e,t,r,a;return h(this,(function(s){switch(s.label){case 0:t=null===this._propTab?0:this._propTab.getSize(),a=!1,e=0,s.label=1;case 1:if(!(e<t)||a)return[3,4];switch((r=this._propTab.getProp(e)).getID()){case n.PropInterface.PROP_TYPE_DATA:if(!r.isExpression()&&null!==this._field&&this._field.getTask()!==this.getForm().getTask()){a=!0;break}case n.PropInterface.PROP_TYPE_FORMAT:case n.PropInterface.PROP_TYPE_VISIBLE:case n.PropInterface.PROP_TYPE_ENABLED:case n.PropInterface.PROP_TYPE_RANGE:case n.PropInterface.PROP_TYPE_TRANSLATOR:r.isExpression()&&(a=!0)}return a?[4,this.RefreshDisplay()]:[3,3];case 2:s.sent(),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},a.prototype.invoke=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!1,[4,this.isParkable(!0)];case 1:return t.sent()?[4,o.eventsManager.handleInternalEventWithMgControlBase(this,r.InternalInterface.MG_ACT_CTRL_PREFIX)]:[3,3];case 2:t.sent(),e=!0,t.label=3;case 3:return[2,e]}}))}))},a.prototype.isParkable=function(t){var r=Object.create(null,{isImageControl:{get:function(){return e.prototype.isImageControl}},checkProp:{get:function(){return e.prototype.checkProp}},isParkable:{get:function(){return e.prototype.isParkable}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(a){switch(a.label){case 0:return(e=!r.isImageControl.call(this))?[4,r.checkProp.call(this,n.PropInterface.PROP_TYPE_ENABLED,!0)]:[3,4];case 1:return a.sent(),[4,r.checkProp.call(this,n.PropInterface.PROP_TYPE_VISIBLE,!0)];case 2:return a.sent(),[4,r.isParkable.call(this,t)];case 3:e=a.sent(),a.label=4;case 4:return[2,e]}}))}))},a.prototype.getSubformTaskId=function(){return this._subformTaskId},a.prototype.initSubformTask=function(){e.prototype.isSubform.call(this)&&(this._subformTask=n.GuiDataCollection.MGDataTable.GetTaskByID(this._subformTaskId))},a.prototype.getParentTable=function(){return this._parentTable},a.prototype.restoreOldValue=function(){var t=Object.create(null,{resetPrevVal:{get:function(){return e.prototype.resetPrevVal}},SetAndRefreshDisplayValue:{get:function(){return e.prototype.SetAndRefreshDisplayValue}}});return T(this,void 0,void 0,(function(){var e,r,n;return h(this,(function(a){switch(a.label){case 0:return null===this._field?[3,2]:[4,this._field.updateDisplay()];case 1:return a.sent(),[3,5];case 2:return t.resetPrevVal.call(this),r=(e=t.SetAndRefreshDisplayValue).call,n=[this],[4,this.getMgValue(this.Value)];case 3:return[4,r.apply(e,n.concat([a.sent(),this.IsNull]))];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))},a.prototype.setRtEvtTask=function(e){this._rtEvtTask=e},a.prototype.getRtEvtTask=function(){return this._rtEvtTask},a.prototype.setSubformTaskId=function(e){this._subformTaskId=e},a.prototype.isFocusedStopExecution=function(){return this._focusedStopExecution},a.prototype.setFocusedStopExecution=function(e){this._focusedStopExecution=e},a.prototype.onTheSameSubFormControl=function(t){var r=!1;return null!==t&&e.prototype.getForm.call(this).isSubForm()&&t.getForm().isSubForm()&&e.prototype.getForm.call(this).getTask()===t.getForm().getTask()&&(r=!0),r},a.prototype.onDiffForm=function(t){return(e.prototype.getForm.call(this).isSubForm()||t.getForm().isSubForm())&&!this.onTheSameSubFormControl(t)},a.prototype.isInControlSuffix=function(){return this._inControlSuffix},a.prototype.setInControlSuffix=function(e){this._inControlSuffix=e},a.prototype.HasSelectProgram=function(){var t=!1,r=e.prototype.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SELECT_PROGRAM);return null!==r&&null!==r.GetComputedValue()&&(t=!0),t},a.prototype.useZoomHandler=function(){return this.HasZoomHandler||null!==e.prototype.getField.call(this)&&(e.prototype.getField.call(this).getHasZoomHandler()||this.HasSelectProgram())},a.prototype.updatePropertyLogicNesting=function(t,r,a,s){var i=Object.create(null,{haveToCheckParentValue:{get:function(){return e.prototype.haveToCheckParentValue}},isParentPropValue:{get:function(){return e.prototype.isParentPropValue}},isSubform:{get:function(){return e.prototype.isSubform}},getDisplayLine:{get:function(){return e.prototype.getDisplayLine}},updateChildrenPropValue:{get:function(){return e.prototype.updateChildrenPropValue}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return a&&i.haveToCheckParentValue.call(this)&&(a=i.isParentPropValue.call(this,t)),a&&i.isSubform.call(this)&&r===n.CommandType.PROP_SET_VISIBLE&&this.ShouldSetSubformInvisible()&&(a=!1),s&&n.Commands.addOperationWithLine(n.CommandType.SET_PROPERTY,this,i.getDisplayLine.call(this,!1),r===n.CommandType.PROP_SET_VISIBLE?n.HtmlProperties.Visible:n.HtmlProperties.Enabled,a),[4,i.updateChildrenPropValue.call(this,t,r,a)];case 1:return e.sent(),[2]}}))}))},a.prototype.ShouldSetSubformInvisible=function(){var t=!1;return e.prototype.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SUBFORM_TYPE).GetComputedValueInteger()===r.SubformType.None&&null===this.getSubformTaskId()&&(t=!0),t},a.prototype.updateSubformChildrenPropValue=function(a,s,i){var l=Object.create(null,{isSubform:{get:function(){return e.prototype.isSubform}},getForm:{get:function(){return e.prototype.getForm}},GetComputedProperty:{get:function(){return e.prototype.GetComputedProperty}}});return T(this,void 0,void 0,(function(){var e,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return t.Debug.Assert(l.isSubform.call(this)),l.getForm.call(this).getTask().AfterFirstRecordPrefix?(e=l.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SUBFORM_TYPE).GetComputedValueInteger(),null===this._subformTaskId&&e!==r.SubformType.None?[3,8]:null!==this._subformTask&&this._subformTask.isStarted()?(this.SubformLoaded=!0,s===n.CommandType.PROP_SET_VISIBLE&&i&&this.RefreshOnVisible?(this.RefreshOnVisible=!1,[4,l.getForm.call(this).getTask().SubformRefresh(this._subformTask,!0)]):[3,2]):[3,7]):[2];case 1:h.sent(),h.label=2;case 2:u=this._subformTask.getForm(),c=0,h.label=3;case 3:return c<u.getCtrlCount()?(_=u.getCtrl(c)).isColumnControl()?[4,_.checkProp(a,!0)]:[3,6]:[3,7];case 4:return(T=h.sent()&&i)&&(T=_.isParentPropValue(a)),[4,_.updateChildrenPropValue(a,s,T)];case 5:h.sent(),h.label=6;case 6:return c++,[3,3];case 7:return[3,10];case 8:return s!==n.CommandType.PROP_SET_VISIBLE||!i||this.SubformLoaded?[3,10]:(this.SubformLoaded=!0,[4,o.eventsManager.handleInternalEventWithMgControlBase(this,r.InternalInterface.MG_ACT_SUBFORM_OPEN)]);case 9:h.sent(),h.label=10;case 10:return[2]}}))}))},a.prototype.Init=function(){this.initSubformTask()},a.prototype.GetTableBehaviour=function(){return r.TableBehaviour.UnlimitedItems},a.prototype.getFieldXML=function(t){return t<0?"":e.prototype.getForm.call(this).getTask().DataView.getRecByIdx(t).getFieldDataXML(this._nodeIdField.getId(),!1)},a.prototype.getParentFieldXML=function(t){return t<0?"":e.prototype.getForm.call(this).getTask().DataView.getRecByIdx(t).getFieldDataXML(this._nodeParentIdField.getId(),!1)},a.prototype.validateAndSetValue=function(t,n){var a=Object.create(null,{UpdateModifiedByUser:{get:function(){return e.prototype.UpdateModifiedByUser}},getPIC:{get:function(){return e.prototype.getPIC}},buildPicture:{get:function(){return e.prototype.buildPicture}},getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){var e,s;return h(this,(function(i){switch(i.label){case 0:return a.UpdateModifiedByUser.call(this,t),this.ModifiedByUser?(e=this.Value,s=void 0,null===a.getPIC.call(this)?[2,!0]:((s=a.buildPicture.call(this,e,t)).evaluate(),s.ValidationFailed?(this.ModifiedByUser=!1,[2,!1]):(this.IsInteractiveUpdate=!0,a.getForm.call(this).getTask().setDataSynced(!1),n?(null!==this._field&&this._field.getType()===r.StorageAttribute.NUMERIC&&"string"==typeof t&&t.trim().length>0&&s.setValue(t),[4,this.setValue(s)]):[3,2]))):[3,2];case 1:i.sent(),i.label=2;case 2:return[2,!0]}}))}))},a.prototype.setValue=function(t){var n=Object.create(null,{getMgValue:{get:function(){return e.prototype.getMgValue}},isCheckBox:{get:function(){return e.prototype.isCheckBox}},SetAndRefreshDisplayValue:{get:function(){return e.prototype.SetAndRefreshDisplayValue}}});return T(this,void 0,void 0,(function(){var e,a,s;return h(this,(function(i){switch(i.label){case 0:return e=t.getIsNull(),a=t.getDispValue(),e&&this._field.hasNullDisplayValue()?[3,2]:[4,n.getMgValue.call(this,a)];case 1:return s=i.sent(),[3,3];case 2:s=this._field.getType()===r.StorageAttribute.BLOB_VECTOR?this._field.getCellDefualtValue():this._field.getDefaultValue(),i.label=3;case 3:return null===s?[3,7]:null===this._field||a===this.Value&&!this.KeyStrokeOn&&this.IsNull===e?[3,5]:[4,this._field.setValueAndStartRecompute(s,e,!0,!0,!1)];case 4:i.sent(),n.isCheckBox.call(this)&&(this.forceRefresh=!0,s=this._field.getValue(!1)),i.label=5;case 5:return null!==this._field&&e&&this._field.hasNullDisplayValue()&&(s=a),[4,n.SetAndRefreshDisplayValue.call(this,s,e)];case 6:i.sent(),this.forceRefresh=!1,this.KeyStrokeOn=!1,i.label=7;case 7:return[2]}}))}))},a.prototype.refreshAndSetItemsListForRadioButton=function(t,r){var n=Object.create(null,{refreshAndSetItemsListForRadioButton:{get:function(){return e.prototype.refreshAndSetItemsListForRadioButton}},getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,n.refreshAndSetItemsListForRadioButton.call(this,t,r)];case 1:return e.sent(),G.Instance.getLastFocusedTask(n.getForm.call(this).getTask().getMgdID()),[2]}}))}))},a.prototype.getSubformTask=function(){return this._subformTask},a.prototype.resetSubformTask=function(){this._subformTask=null,this._subformTaskId="0"},a.prototype.GetSubformMgForm=function(){var e=null;return null!==this._subformTask&&(e=this._subformTask.getForm()),e},a.prototype.IsTableWithAbsoluteScrollbar=function(){var e=!1;return t.Debug.Assert(this.Type===r.MgControlType.CTRL_TYPE_TABLE,"In MgControl.IsTableWithAbsoluteScrollbar(): Not a table control."),this._propTab.propExists(n.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB)&&(e=this._propTab.getPropById(n.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB).GetComputedValueInteger()===r.ScrollBarThumbType.Absolute),e},a.validReturnToCtrl=function(){return null===a.ReturnToCtrl||!a.ReturnToCtrl.getForm().getTask().isAborting()},a.prototype.maySetValue=function(){switch(this.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:case r.MgControlType.CTRL_TYPE_TAB:break;default:return!1}return!(null===this._field||this._valExpId>0)&&this.isModifiable()},a.prototype.validateAndSetValueIfAllowed=function(e,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return this.maySetValue()?[4,this.validateAndSetValue(e,!0)]:(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Unable to change value of control {0}: The control is read-only.",this.Name)),[2,!1]);case 1:return(s=i.sent())||r.Logger.Instance.WriteErrorToLog(t.NString.Format("Value validation failed for {0}.",this.Name)),a&&(n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),n.Commands.invoke()),[2,s]}}))}))},a}(n.MgControlBase);P.ReturnToCtrl=null;var D=function(){function e(){this._queue=null,this.Size=0,this._queue=new Array(e.DEFAULT_INITIAL_CAPACITY+1);for(var t=0;t<this._queue.length;++t)this._queue[t]=null}return e.prototype.offer=function(e){return++this.Size,this.Size>=this._queue.length&&(this._queue.length=this.Size),this._queue[this.Size]=e,this.fixUp(this.Size),!0},e.prototype.peek=function(){return 0===this.Size?null:this._queue[1]},e.prototype.isEmpty=function(){return 0===this.Size},e.prototype.clear=function(){for(var e=1;e<=this.Size;e++)this._queue[e]=null;this.Size=0},e.prototype.poll=function(){if(0===this.Size)return null;var e=this._queue[1];return this._queue[1]=this._queue[this.Size],this._queue[this.Size--]=null,this.Size>1&&this.fixDown(1),e},e.prototype.fixUp=function(e){for(;e>1;){var t=e>>1;if(this._queue[t].CompareTo(this._queue[e])<=0)break;var r=this._queue[t];this._queue[t]=this._queue[e],this._queue[e]=r,e=t}},e.prototype.fixDown=function(e){for(var t;(t=e<<1)<=this.Size&&t>0&&(t<this.Size&&this._queue[t].CompareTo(this._queue[t+1])>0&&t++,!(this._queue[e].CompareTo(this._queue[t])<=0));){var r=this._queue[t];this._queue[t]=this._queue[e],this._queue[e]=r,e=t}},e}();D.DEFAULT_INITIAL_CAPACITY=11;var k=function(){function e(n,a){this.Exp=null,this._forceExit=r.ForceExit.None,this.kbdItm=null,this._osCommandShow=0,this._osCommandText=null,this._osCommandWait=!1,this._paramAttrs=null,this._paramNulls=null,this._paramVals=null,this._parameters=0,this._returnExp=0,this._seconds=t.Int32.MinValue,this._timestamp=0,this._type=t.Char.MinValue,this._userDefinedFuncName=null,this._userDefinedFuncNameHashCode=0,this._userEvtDesc="",this._userEvtIdx=t.Int32.MinValue,this.ownerTaskDefinitionId=null,this.InternalEvent=0,this.PrgDescription=null,this.PublicName=null,this.UserEvt=null,this.UserEvtTaskTag=null,0===arguments.length?this.constructor_0():1===arguments.length&&(null===n||n instanceof e)?this.constructor_1(n):this.constructor_4(n)}return e.prototype.constructor_0=function(){this.InternalEvent=t.Int32.MinValue,this.setTimestamp()},e.prototype.constructor_1=function(e){this._type=e._type,this.kbdItm=e.kbdItm,this.InternalEvent=e.InternalEvent,this._seconds=e._seconds,this.Exp=e.Exp,this._forceExit=e._forceExit,this.UserEvt=e.UserEvt,this.UserEvtTaskTag=e.UserEvtTaskTag,this._userEvtIdx=e._userEvtIdx,this._timestamp=0},e.prototype.constructor_4=function(e){this.setType(e)},Object.defineProperty(e.prototype,"ForceExit",{get:function(){return this._forceExit},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e,n){var a,s=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==s&&s<e.getXMLdata().length){var i=e.getXMLsubstring(s);e.add2CurrIndex(i.indexOf(E.MG_TAG_EVENT)+E.MG_TAG_EVENT.length);var o=r.XmlParser.getTokens(e.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM),l=new t.RefParam(a);this.initElements(o,n,l),a=l.value,e.setCurrIndex(s+r.XMLConstants.TAG_CLOSE.length),this.InitInnerObjects(e),null!==a&&this.InitUserData(n,a)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Event.FillData() out of string bounds")},e.prototype.InitInnerObjects=function(e){if(e.getNextTag()===r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY){var t=e.ReadToEndOfCurrentElement();this.InitTaskDefinitionId(t);var n=e.getXMLdata().indexOf(E.MG_TAG_EVENT+r.XMLConstants.TAG_CLOSE,e.getCurrIndex());e.setCurrIndex(n+(E.MG_TAG_EVENT+r.XMLConstants.TAG_CLOSE).length)}},e.prototype.initElements=function(e,a,s){var i=n.Modifiers.MODIFIER_NONE,o=-1;s.value=null;for(var l=0;l<e.length;l+=2){var u=e.get_Item(l),c=e.get_Item(l+1);switch(u){case E.MG_ATTR_EVENTTYPE:this._type=c[0];break;case E.MG_ATTR_MODIFIER:i=c[0];break;case E.MG_ATTR_INTERNALEVENT:this.InternalEvent=r.XmlParser.getInt(c);break;case E.MG_ATTR_KEYCODE:o=r.XmlParser.getInt(c);break;case E.MG_ATTR_SECONDS:this._seconds=r.XmlParser.getInt(c);break;case r.XMLConstants.MG_ATTR_EXP:this.Exp=a.getExpById(r.XmlParser.getInt(c));break;case E.MG_ATTR_FORCE_EXIT:this._forceExit=c[0];break;case E.MG_ATTR_DESC:this._userEvtDesc=r.XmlParser.unescape(c);break;case E.MG_ATTR_PUBLIC:this.PublicName=r.XmlParser.unescape(c);break;case E.MG_ATTR_PARAMS:this._parameters=r.XmlParser.getInt(c);break;case E.MG_ATTR_PAR_ATTRS:this._paramAttrs=c;break;case r.XMLConstants.MG_ATTR_VALUE:var _=r.XmlParser.unescape(c);this._paramVals=new Array(this._parameters),this.parseParamVal(_);break;case E.MG_ATTR_NULLS:this._paramNulls=c;break;case E.MG_ATTR_USER:s.value=c;break;case r.XMLConstants.MG_ATTR_NAME:this.setUserDefinedFuncName(c);break;case E.MG_TAG_USR_DEF_FUC_RET_EXP_ID:this._returnExp=r.XmlParser.getInt(c);break;case E.MG_TAG_USR_DEF_FUC_RET_EXP_ATTR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("There is no such tag in Event class. Insert case to Event.initElements for {0}",u))}}this._type===E.EVENT_TYPE_SYSTEM&&(this.kbdItm=new n.KeyboardItem(o,i))},e.prototype.InitUserData=function(e,n){var a=n.indexOf(",");if(a>-1){var s=n.substr(0,a);null!==e&&(s=e.TaskService.GetEventTaskId(e,s,this));var i=o.mgDataTable.GetTaskByID(s),l=r.XmlParser.getInt(n.substr(a+1));if(null!==i){if(this.UserEvt=i.getUserEvent(l),null===this.UserEvt)throw new t.ApplicationException("in Event.fillData(): user event not found. task id = "+s+", user event index = "+l);this.UserEvtTaskTag=s,this._userEvtIdx=l}else this.UserEvtTaskTag=s,this._userEvtIdx=l,this.UserEvt=null}},e.prototype.InitTaskDefinitionId=function(e){new n.TaskDefinitionIdTableSaxHandler(this.SetTaskDefinitionId).parse(e)},e.prototype.SetTaskDefinitionId=function(e){this.ownerTaskDefinitionId=e},e.prototype.findUserEvent=function(){if(this._type===E.EVENT_TYPE_USER&&null===this.UserEvt){var e=o.mgDataTable.GetTaskByID(this.UserEvtTaskTag);if(null!==e&&(this.UserEvt=e.getUserEvent(this._userEvtIdx)),null===this.UserEvt)throw new t.ApplicationException(t.NString.Format("in Event.findUserEvent(): user event not found. task id = {0} doesn't exist",this.UserEvtTaskTag))}},e.prototype.equals=function(e){var r=!1;if(this===e)r=!0;else if(this._type===e._type)switch(this._type){case E.EVENT_TYPE_SYSTEM:r=this.kbdItm.equals(e.kbdItm);break;case E.EVENT_TYPE_INTERNAL:r=this.InternalEvent===e.InternalEvent;break;case E.EVENT_TYPE_TIMER:r=this._seconds===e._seconds;break;case E.EVENT_TYPE_EXPRESSION:case E.EVENT_TYPE_PUBLIC:r=this.Exp===e.Exp;break;case E.EVENT_TYPE_USER:r=this.UserEvt===e.UserEvt;break;case E.EVENT_TYPE_USER_FUNC:this._userDefinedFuncNameHashCode===e.getUserDefinedFuncNameHashCode()&&t.NString.Equals(e.getUserDefinedFuncName(),this._userDefinedFuncName,!0)&&(r=!0);break;default:r=!1}if(this._type===E.EVENT_TYPE_PUBLIC||e._type===E.EVENT_TYPE_PUBLIC){var n=null,a=null;this._type!==E.EVENT_TYPE_USER&&e._type!==E.EVENT_TYPE_USER?r=!1:this._type===E.EVENT_TYPE_PUBLIC?(n=this.PublicName,a=e.getUserEvent().PublicName):(n=e.PublicName,a=this.getUserEvent().PublicName),r=null!==n&&null!==a&&n===a}else this._type===E.EVENT_TYPE_INTERNAL&&e._type===E.EVENT_TYPE_SYSTEM?null!==G.Instance.getCurrTask()&&o.eventsManager.getMatchingAction(G.Instance.getCurrTask(),e.getKbdItm())===this.getInternalCode()&&(r=!0):this._type===E.EVENT_TYPE_USER&&e._type!==E.EVENT_TYPE_USER&&(this.findUserEvent(),r=this.UserEvt.equals(e));return r},e.prototype.setPublicName=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return this._type!==E.EVENT_TYPE_PUBLIC||null===this.Exp?[3,2]:(e=this,[4,this.Exp.evaluateWithResLength(255)]);case 1:e.PublicName=t.sent().mgVal,null!==this.PublicName&&(this.PublicName=r.StrUtil.rtrim(this.PublicName)),t.label=2;case 2:return[2]}}))}))},e.prototype.setInternal=function(e){this._type=E.EVENT_TYPE_INTERNAL,this.InternalEvent=e,e!==r.InternalInterface.MG_ACT_HIT&&e!==r.InternalInterface.MG_ACT_CTRL_HIT||(G.Instance.LastActionTime=r.Misc.getSystemMilliseconds())},e.prototype.setExpression=function(e){this._type=E.EVENT_TYPE_EXPRESSION,this.Exp=e},e.prototype.getExpression=function(){return this.Exp},e.prototype.getUsrEvntDesc=function(){return null!==this.UserEvt?this.UserEvt._userEvtDesc:this._userEvtDesc},e.prototype.setSystem=function(e){this._type=E.EVENT_TYPE_SYSTEM,this.kbdItm=e},e.prototype.setKeyboardItem=function(e){this.kbdItm=e},e.prototype.getType=function(){return this._type},e.prototype.setType=function(e){this._type=e},e.prototype.getInternalCode=function(){return this._type===E.EVENT_TYPE_INTERNAL?this.InternalEvent:t.Int32.MinValue},e.prototype.getKbdItm=function(){return this._type===E.EVENT_TYPE_SYSTEM?this.kbdItm:null},e.prototype.getKbdItmAlways=function(){return this.kbdItm},e.prototype.dataEventIsTrue=function(){return T(this,void 0,void 0,(function(){var e,t,a,s;return h(this,(function(i){switch(i.label){case 0:return this._type===E.EVENT_TYPE_EXPRESSION||this._type===E.EVENT_TYPE_USER&&this.getUserEventType()===E.EVENT_TYPE_EXPRESSION?this._type===E.EVENT_TYPE_USER?[3,2]:(t=(e=n.DisplayConvertor).toBoolean,[4,this.Exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)]):[2,!0];case 1:return[2,t.apply(e,[i.sent()])];case 2:return s=(a=n.DisplayConvertor).toBoolean,[4,this.UserEvt.getExpression().evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)];case 3:return[2,s.apply(a,[i.sent()])]}}))}))},e.prototype.getSeconds=function(){return this._seconds},e.prototype.getBrkLevel=function(e){return 0===arguments.length?this.getBrkLevel_0():this.getBrkLevel_1(e)},e.prototype.getBrkLevel_0=function(){return this.getBrkLevel(!1)},e.prototype.getBrkLevel_1=function(t){var n="";switch(this._type){case E.EVENT_TYPE_INTERNAL:switch(this.InternalEvent){case r.InternalInterface.MG_ACT_TASK_PREFIX:n=t?E.BRK_LEVEL_TASK_PREFIX_FM:E.BRK_LEVEL_TASK_PREFIX;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:n=t?E.BRK_LEVEL_TASK_SUFFIX_FM:E.BRK_LEVEL_TASK_SUFFIX;break;case r.InternalInterface.MG_ACT_REC_PREFIX:n=t?E.BRK_LEVEL_REC_PREFIX_FM:E.BRK_LEVEL_REC_PREFIX;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:n=t?E.BRK_LEVEL_REC_SUFFIX_FM:E.BRK_LEVEL_REC_SUFFIX;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:n=t?E.BRK_LEVEL_CTRL_PREFIX_FM:E.BRK_LEVEL_CTRL_PREFIX+"_";break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:n=t?E.BRK_LEVEL_CTRL_SUFFIX_FM:E.BRK_LEVEL_CTRL_SUFFIX+"_";break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:n=t?E.BRK_LEVEL_CTRL_VERIFICATION_FM:E.BRK_LEVEL_CTRL_VERIFICATION+"_";break;case r.InternalInterface.MG_ACT_VARIABLE:n=t?E.BRK_LEVEL_VARIABLE_FM:E.BRK_LEVEL_VARIABLE+"_";break;default:n=t?E.BRK_LEVEL_HANDLER_INTERNAL_FM:E.BRK_LEVEL_HANDLER_INTERNAL+"_"}n+=e.getInternalEvtDescription(this.InternalEvent);break;case E.EVENT_TYPE_SYSTEM:n=t?E.BRK_LEVEL_HANDLER_SYSTEM_FM:E.BRK_LEVEL_HANDLER_SYSTEM+"_",n+=this.getKeyboardItemString();break;case E.EVENT_TYPE_TIMER:n=t?E.BRK_LEVEL_HANDLER_TIMER_FM+" "+this.seconds2String():E.BRK_LEVEL_HANDLER_TIMER+"_"+this.seconds2String();break;case E.EVENT_TYPE_EXPRESSION:n=t?E.BRK_LEVEL_HANDLER_EXPRESSION_FM:E.BRK_LEVEL_HANDLER_EXPRESSION+"_"+this.Exp.getId();break;case E.EVENT_TYPE_USER:n=(t?E.BRK_LEVEL_HANDLER_USER_FM+": ":E.BRK_LEVEL_HANDLER_USER+"_")+(null!=this.UserEvt?this.UserEvt._userEvtDesc:this._userEvtDesc);break;case E.EVENT_TYPE_USER_FUNC:n=(t?E.BRK_LEVEL_USER_FUNCTION_FM+":":E.BRK_LEVEL_USER_FUNCTION+"_")+this._userDefinedFuncName}return n},e.getInternalEvtDescription=function(e){var t;switch(e){case r.InternalInterface.MG_ACT_ABOUT:t="About Magic";break;case r.InternalInterface.MG_ACT_ACTION_LIST:t="Action List";break;case r.InternalInterface.MG_ACT_ADD_HYPERLINK:t="";break;case r.InternalInterface.MG_ACT_ALIGN_LEFT:t="Left";break;case r.InternalInterface.MG_ACT_ALIGN_RIGHT:t="Right";break;case r.InternalInterface.MG_ACT_APPL_PROPERTIES:t="";break;case r.InternalInterface.MG_ACT_APPLICATIONS:t="Applications";break;case r.InternalInterface.MG_ACT_APPLICATIONS_LIST:t="Applications List";break;case r.InternalInterface.MG_ACT_ATTACH_TO_TABLE:t="Attach to Table";break;case r.InternalInterface.MG_ACT_AUTHORIZE:t="Authorize";break;case r.InternalInterface.MG_ACT_EDT_BEGFLD:t="Begin Field";break;case r.InternalInterface.MG_ACT_EDT_BEGFORM:t="Begin Form";break;case r.InternalInterface.MG_ACT_EDT_BEGLINE:t="Begin Line";break;case r.InternalInterface.MG_ACT_EDT_BEGNXTLINE:t="Begin Next Line";break;case r.InternalInterface.MG_ACT_EDT_BEGPAGE:t="Begin Page";break;case r.InternalInterface.MG_ACT_TBL_BEGLINE:t="Begin Row";break;case r.InternalInterface.MG_ACT_TBL_BEGPAGE:t="Begin Screen";break;case r.InternalInterface.MG_ACT_TBL_BEGTBL:t="Begin table";break;case r.InternalInterface.MG_ACT_BOTTOM:t="Bottom";break;case r.InternalInterface.MG_ACT_BULLET:t="Bullet";break;case r.InternalInterface.MG_ACT_BUTTON:t="Button Press";break;case r.InternalInterface.MG_ACT_CANCEL:t="Cancel";break;case r.InternalInterface.MG_ACT_RT_QUIT:t="Quit";break;case r.InternalInterface.MG_ACT_CENTER:t="Center";break;case r.InternalInterface.MG_ACT_CHECK_SYNTAX:t="Check Syntax";break;case r.InternalInterface.MG_ACT_CHECK_TO_END:t="Check to End";break;case r.InternalInterface.MG_ACT_CLEAR_TEMPLATE:t="Clear Template";break;case r.InternalInterface.MG_ACT_CLEAR_VALUE:t="Clear Value";break;case r.InternalInterface.MG_ACT_CLOSE:t="Close";break;case r.InternalInterface.MG_ACT_ACT_CLOSE_APPL:t="Close Application";break;case r.InternalInterface.MG_ACT_COMMUNICATIONS:t="Communications";break;case r.InternalInterface.MG_ACT_COMPONENTS:t="Components";break;case r.InternalInterface.MG_ACT_CTRL_HIT:t="Control Hit";break;case r.InternalInterface.MG_ACT_CONTROL_NAME_LIST:t="Control Name List";break;case r.InternalInterface.MG_ACT_CLIP_COPY:t="Copy";break;case r.InternalInterface.MG_ACT_COPY_LAYOUT:t="Copy Layout";break;case r.InternalInterface.MG_ACT_COPY_SUBTREE:t="Copy Subtree";break;case r.InternalInterface.MG_ACT_CRELINE:t="Create Line";break;case r.InternalInterface.MG_ACT_CRELINE_ABOVE:t="Create Line Above";break;case r.InternalInterface.MG_ACT_CREATE_PARENT:t="Create Parent";break;case r.InternalInterface.MG_ACT_RTO_CREATE:t="Create Records";break;case r.InternalInterface.MG_ACT_CREATE_SUBTASK:t="Create Subtask";break;case r.InternalInterface.MG_ACT_CROSS_REFERENCE:t="Cross Reference";break;case r.InternalInterface.MG_ACT_CUT:t="Cut";break;case r.InternalInterface.MG_ACT_DB_TABLES:t="";break;case r.InternalInterface.MG_ACT_DBMS:t="DBMS";break;case r.InternalInterface.MG_ACT_DDF_MAKE:t="DDF Make";break;case r.InternalInterface.MG_ACT_DATABASES:t="Databases";break;case r.InternalInterface.MG_ACT_DEFAULT_LAYOUT:t="Default Layout";break;case r.InternalInterface.MG_ACT_DEFINE_EXPRESSION:t="Define Expression";break;case r.InternalInterface.MG_ACT_EDT_DELCURCH:t="Current Char";break;case r.InternalInterface.MG_ACT_EDT_DELPRVCH:t="Previous Char";break;case r.InternalInterface.MG_ACT_DELETE_HYPERLINK:t="Delete Hyperlink";break;case r.InternalInterface.MG_ACT_DELLINE:t="Delete Line";break;case r.InternalInterface.MG_ACT_DELETE_SUBTREE:t="Delete Subtree";break;case r.InternalInterface.MG_ACT_RT_COPYFLD:t="Ditto";break;case r.InternalInterface.MG_ACT_DISPLAY_REFRESH:t="Display Refresh";break;case r.InternalInterface.MG_ACT_EDIT_MAIN_FORM:t="Edit Main Form";break;case r.InternalInterface.MG_ACT_EDT_ENDFLD:t="End Field";break;case r.InternalInterface.MG_ACT_EDT_ENDFORM:t="End Form";break;case r.InternalInterface.MG_ACT_EDT_ENDLINE:t="End Line";break;case r.InternalInterface.MG_ACT_EDT_ENDPAGE:t="End Page";break;case r.InternalInterface.MG_ACT_TBL_ENDLINE:t="End Row";break;case r.InternalInterface.MG_ACT_TBL_ENDPAGE:t="End Screen";break;case r.InternalInterface.MG_ACT_TBL_ENDTBL:t="End Table";break;case r.InternalInterface.MG_ACT_ENVIRONMENT:t="Environment";break;case r.InternalInterface.MG_ACT_EXECUTE_PROGRAM:t="Execute Program";break;case r.InternalInterface.MG_ACT_EXECUTE_REPORT:t="Execute Report";break;case r.InternalInterface.MG_ACT_EXIT:t="Exit";break;case r.InternalInterface.MG_ACT_EXIT_SYSTEM:t="Exit System";break;case r.InternalInterface.MG_ACT_EXPORT_IMPORT:t="Export/Import";break;case r.InternalInterface.MG_ACT_EXPRESSION_RULES:t="Expression rules";break;case r.InternalInterface.MG_ACT_EXTERNAL_EDITOR:t="External Editor";break;case r.InternalInterface.MG_ACT_EXT_EVENT:t="External Event";break;case r.InternalInterface.MG_ACT_FORMS:t="Forms";break;case r.InternalInterface.MG_ACT_FROM_VALUE:t="From Value";break;case r.InternalInterface.MG_ACT_FUNCTION_LIST:t="Function List";break;case r.InternalInterface.MG_ACT_GENERATE_FORM:t="Generate Form";break;case r.InternalInterface.MG_ACT_GENERATE_PROGRAM:t="Generate Program";break;case r.InternalInterface.MG_ACT_GO_TO_TOP:t="Go to Top";break;case r.InternalInterface.MG_ACT_H_CENTER_OF_FORM:t="";break;case r.InternalInterface.MG_ACT_HTML_STYLES:t="HTML Styles";break;case r.InternalInterface.MG_ACT_HELP:t="Help";break;case r.InternalInterface.MG_ACT_HELP_SCREENS:t="Help Screens";break;case r.InternalInterface.MG_ACT_HORIZ_CENTER:t="Horiz. Center";break;case r.InternalInterface.MG_ACT_I_O_FILES:t="Tables";break;case r.InternalInterface.MG_ACT_INDENT:t="Indent";break;case r.InternalInterface.MG_ACT_INSERT_OBJECT:t="Insert Object";break;case r.InternalInterface.MG_ACT_JUMP_TO_ROW:t="Jump to Row";break;case r.InternalInterface.MG_ACT_KEYBOARD_LIST:t="Keyboard List";break;case r.InternalInterface.MG_ACT_KEYBOARD_MAPPING:t="Keyboard Mapping";break;case r.InternalInterface.MG_ACT_LANGUAGES:t="languages";break;case r.InternalInterface.MG_ACT_RTO_SEARCH:t="Locate Next";break;case r.InternalInterface.MG_ACT_RTO_LOCATE:t="Locate a Record";break;case r.InternalInterface.MG_ACT_LOGICALPNAMES:t="";break;case r.InternalInterface.MG_ACT_LOGON:t="Logon";break;case r.InternalInterface.MG_ACT_USING_HELP:t="Help Topics";break;case r.InternalInterface.MG_ACT_EDT_MARKNXTCH:t="Mark Next Char";break;case r.InternalInterface.MG_ACT_MARK_NEXT_LINE:t="Mark Next Line MLE";break;case r.InternalInterface.MG_ACT_EDT_MARKPRVCH:t="Mark Previous Char";break;case r.InternalInterface.MG_ACT_EDT_MARKPRVLINE:t="Mark Previous Line MLE";break;case r.InternalInterface.MG_ACT_MARK_SUBTREE:t="";break;case r.InternalInterface.MG_ACT_EDT_MARKTOBEG:t="Mark To Beginning";break;case r.InternalInterface.MG_ACT_EDT_MARKTOEND:t="Mark To End";break;case r.InternalInterface.MG_ACT_MAXIMUM_HEIGHT:t="Maximum Height";break;case r.InternalInterface.MG_ACT_MAXIMUM_WIDTH:t="Maximum Width";break;case r.InternalInterface.MG_ACT_MENU_BAR:t="Menu Bar";break;case r.InternalInterface.MG_ACT_MENUS:t="";break;case r.InternalInterface.MG_ACT_MINIMUM_HEIGHT:t="Minimum Height";break;case r.InternalInterface.MG_ACT_MINIMUM_WIDTH:t="Minimum Width";break;case r.InternalInterface.MG_ACT_RTO_MODIFY:t="Modify Records";break;case r.InternalInterface.MG_ACT_MONITOR_DEBUGGER:t="Monitor/Debugger";break;case r.InternalInterface.MG_ACT_MOVE_ENTRY:t="Move Entry";break;case r.InternalInterface.MG_ACT_MOVE_SUBTREE:t="Move Subtree";break;case r.InternalInterface.MG_ACT_NULL_SETTINGS:t="NULL Settings";break;case r.InternalInterface.MG_ACT_EDT_NXTCHAR:t="Next Char";break;case r.InternalInterface.MG_ACT_EDT_NXTLINE:t="Next Line";break;case r.InternalInterface.MG_ACT_EDT_NXTPAGE:t="Next Page";break;case r.InternalInterface.MG_ACT_TBL_NXTLINE:t="Next Row";break;case r.InternalInterface.MG_ACT_TBL_NXTPAGE:t="Next Screen";break;case r.InternalInterface.MG_ACT_EDT_NXTTAB:t="Next Tab";break;case r.InternalInterface.MG_ACT_EDT_NXTWORD:t="Next Word";break;case r.InternalInterface.MG_ACT_NORMAL:t="Normal";break;case r.InternalInterface.MG_ACT_OK:t="OK";break;case r.InternalInterface.MG_ACT_OLE2:t="OLE2";break;case r.InternalInterface.MG_ACT_OPEN_APPLICATION:t="Open Application";break;case r.InternalInterface.MG_ACT_OVERWRITE_ENTRY:t="Overwrite Entry";break;case r.InternalInterface.MG_ACT_OVERWRITE_SUBTREE:t="Overwrite Subtree";break;case r.InternalInterface.MG_ACT_PPD:t="PPD";break;case r.InternalInterface.MG_ACT_PAGE_FOOTER:t="Page Footer";break;case r.InternalInterface.MG_ACT_PAGE_HEADER:t="Page Header";break;case r.InternalInterface.MG_ACT_CLIP_PASTE:t="Paste";break;case r.InternalInterface.MG_ACT_PASTE_LINK:t="Paste Link";break;case r.InternalInterface.MG_ACT_PASTE_SUBTREE:t="Paste Subtree";break;case r.InternalInterface.MG_ACT_EDT_PRVCHAR:t="Previous Char";break;case r.InternalInterface.MG_ACT_EDT_PRVLINE:t="Previous Line";break;case r.InternalInterface.MG_ACT_EDT_PRVPAGE:t="Previous Page";break;case r.InternalInterface.MG_ACT_TBL_PRVLINE:t="Previous Row";break;case r.InternalInterface.MG_ACT_TBL_PRVPAGE:t="Previous Screen";break;case r.InternalInterface.MG_ACT_EDT_PRVTAB:t="Previous Tab";break;case r.InternalInterface.MG_ACT_EDT_PRVWORD:t="Previous Word";break;case r.InternalInterface.MG_ACT_PRINT_ATTRIBUTES:t="Print Attributes";break;case r.InternalInterface.MG_ACT_PRINTER_SETUP:t="Printer Setup";break;case r.InternalInterface.MG_ACT_PRINTERS:t="Printers";break;case r.InternalInterface.MG_ACT_PROGRAMS:t="Programs";break;case r.InternalInterface.MG_ACT_PROPERTIES:t="Properties";break;case r.InternalInterface.MG_ACT_RTO_QUERY:t="Query Records";break;case r.InternalInterface.MG_ACT_RTO_RANGE:t="Range of Records";break;case r.InternalInterface.MG_ACT_RT_REFRESH_RECORD:t="Record Flush";break;case r.InternalInterface.MG_ACT_REDIRECT_FILES:t="Redirect Files";break;case r.InternalInterface.MG_ACT_REDRAW_LAYOUT:t="";break;case r.InternalInterface.MG_ACT_REPEAT_ENTRY:t="Repeat Entry";break;case r.InternalInterface.MG_ACT_REPEAT_SUBTREE:t="Repeat Subtree";break;case r.InternalInterface.MG_ACT_REPORT_GENERATOR:t="";break;case r.InternalInterface.MG_ACT_RESTORE_DEFAULTS:t="Restore Defaults";break;case r.InternalInterface.MG_ACT_RETURN_TO_TREE:t="";break;case r.InternalInterface.MG_ACT_RIGHT:t="Right";break;case r.InternalInterface.MG_ACT_RIGHTS:t="";break;case r.InternalInterface.MG_ACT_RIGHTS_LIST:t="Rights List";break;case r.InternalInterface.MG_ACT_SQL_ASSIST:t="SQL Assist";break;case r.InternalInterface.MG_ACT_SQL_COLUMNS:t="SQL Columns";break;case r.InternalInterface.MG_ACT_SQL_COMMAND:t="SQL Command";break;case r.InternalInterface.MG_ACT_SQL_FLIP_DESC:t="SQL Flip Desc.";break;case r.InternalInterface.MG_ACT_SQL_KEYWORDS:t="SQL Keywords";break;case r.InternalInterface.MG_ACT_SQL_OPERATORS:t="SQL Operators";break;case r.InternalInterface.MG_ACT_SQL_TABLES:t="SQL Tables";break;case r.InternalInterface.MG_ACT_SQL_WHERE_CLAUSE:t="";break;case r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN:t="Screen Refresh";break;case r.InternalInterface.MG_ACT_SECRET_NAMES:t="Secret Names";break;case r.InternalInterface.MG_ACT_SELECT:t="Select";break;case r.InternalInterface.MG_ACT_EDT_MARKALL:t="Select All";break;case r.InternalInterface.MG_ACT_SERVERS:case r.InternalInterface.MG_ACT_SERVICES:t="";break;case r.InternalInterface.MG_ACT_RT_EDT_NULL:t="Set to NULL";break;case r.InternalInterface.MG_ACT_SHELL_TO_OS:t="Shell to OS";break;case r.InternalInterface.MG_ACT_SHOW_EXPRESSION:t="Show Expression";break;case r.InternalInterface.MG_ACT_SHOW_FULL_LAYOUT:case r.InternalInterface.MG_ACT_SHRINK_TREE:t="";break;case r.InternalInterface.MG_ACT_SORT:t="Sort";break;case r.InternalInterface.MG_ACT_SORT_RECORDS:t="Sort Records";break;case r.InternalInterface.MG_ACT_TABLE_LOCATE:t="Table Locate";break;case r.InternalInterface.MG_ACT_TABLE_LOCATE_NEXT:t="Table Locate Next";break;case r.InternalInterface.MG_ACT_TABLES:case r.InternalInterface.MG_ACT_TASK_CONTROL:case r.InternalInterface.MG_ACT_TASK_EVENTS:t="";break;case r.InternalInterface.MG_ACT_TO_VALUE:t="To Value";break;case r.InternalInterface.MG_ACT_TOOLKIT_RUNTIME:t="Toolkit/Runtime";break;case r.InternalInterface.MG_ACT_TOP:t="Top";break;case r.InternalInterface.MG_ACT_TYPES:t="";break;case r.InternalInterface.MG_ACT_EDT_UNDO:t="Undo Editing";break;case r.InternalInterface.MG_ACT_UNINDENT:t="Unindent";break;case r.InternalInterface.MG_ACT_UPDATE_LINK:t="";break;case r.InternalInterface.MG_ACT_USER_ACTION_1:case r.InternalInterface.MG_ACT_USER_ACTION_2:case r.InternalInterface.MG_ACT_USER_ACTION_3:case r.InternalInterface.MG_ACT_USER_ACTION_4:case r.InternalInterface.MG_ACT_USER_ACTION_5:case r.InternalInterface.MG_ACT_USER_ACTION_6:case r.InternalInterface.MG_ACT_USER_ACTION_7:case r.InternalInterface.MG_ACT_USER_ACTION_8:case r.InternalInterface.MG_ACT_USER_ACTION_9:case r.InternalInterface.MG_ACT_USER_ACTION_10:case r.InternalInterface.MG_ACT_USER_ACTION_11:case r.InternalInterface.MG_ACT_USER_ACTION_12:case r.InternalInterface.MG_ACT_USER_ACTION_13:case r.InternalInterface.MG_ACT_USER_ACTION_14:case r.InternalInterface.MG_ACT_USER_ACTION_15:case r.InternalInterface.MG_ACT_USER_ACTION_16:case r.InternalInterface.MG_ACT_USER_ACTION_17:case r.InternalInterface.MG_ACT_USER_ACTION_18:case r.InternalInterface.MG_ACT_USER_ACTION_19:case r.InternalInterface.MG_ACT_USER_ACTION_20:t="User Action "+(e-r.InternalInterface.MG_ACT_USER_ACTION_1+1);break;case r.InternalInterface.MG_ACT_USER_GROUPS:t="";break;case r.InternalInterface.MG_ACT_USER_IDS:t="User IDs";break;case r.InternalInterface.MG_ACT_V_CENTER_OF_FORM:t="Center of Form";break;case r.InternalInterface.MG_ACT_VERTICAL_CENTER:t="Vertical Center";break;case r.InternalInterface.MG_ACT_VIEW_BY_KEY:t="View by Key";break;case r.InternalInterface.MG_ACT_RT_REFRESH_VIEW:t="View Refresh";break;case r.InternalInterface.MG_ACT_VIRTUAL_VARIABLES:t="Variables";break;case r.InternalInterface.MG_ACT_VISUAL_CONNECTION:t="Visual Connection";break;case r.InternalInterface.MG_ACT_HIT:t="Window Hit";break;case r.InternalInterface.MG_ACT_WINMOVE:t="Window Reposition";break;case r.InternalInterface.MG_ACT_WINSIZE:t="Window Resize";break;case r.InternalInterface.MG_ACT_ZOOM:t="Zoom";break;case r.InternalInterface.MG_ACT_LOCKING_DETAILS:t="Locking Details";break;case r.InternalInterface.MG_ACT_LOCKING_ABORT:t="Locking Abort";break;case r.InternalInterface.MG_ACT_LOCKING_RETRY:t="Locking Retry";break;case r.InternalInterface.MG_ACT_CHECK_OBJECT_LIST:t="Check Object List";break;case r.InternalInterface.MG_ACT_USERS_LIST:t="Users List";break;case r.InternalInterface.MG_ACT_MODELS:t="Models";break;case r.InternalInterface.MG_ACT_WEB_CLICK:t="Click";break;case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:t="DblClick";break;case r.InternalInterface.MG_ACT_BROWSER_ESC:t="Esc";break;case r.InternalInterface.MG_ACT_ROLLBACK:t="Rollback";break;case r.InternalInterface.MG_ACT_EMPTY_DATAVIEW:t="Empty Dataview";break;case r.InternalInterface.MG_ACT_CTRL_MODIFY:t="Control Modify";break;case r.InternalInterface.MG_ACT_PRINT_DATA:t="Print Data";break;case r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT:t="Post Refresh by Parent";break;case r.InternalInterface.MG_ACT_SWITCH_TO_OFFLINE:t="Switch To Offline";break;case r.InternalInterface.MG_ACT_UNAVAILABLE_SERVER:t="Unavailable Server";break;case r.InternalInterface.MG_ACT_CONTEXT_MENU:t="Context Menu";break;case r.InternalInterface.MG_ACT_ENTER_ROW_EDITING:t="Enter Row Editing";break;case r.InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS:t="No Program Execution Rights";break;case r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE:t="Route";break;case r.InternalInterface.MG_ACT_COL_SORT:t="Column Sort";break;case r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:t="Get Rows";break;case r.InternalInterface.MG_ACT_SUBFORM_CLOSE:t="Subform Close";break;case r.InternalInterface.MG_ACT_SUBFORM_REFRESH:t="Subform Refresh";break;case r.InternalInterface.MG_ACT_SUBFORM_OPEN:t="Subform Open";break;case r.InternalInterface.MG_ACT_COMPUTE:t="Compute";break;case r.InternalInterface.MG_ACT_CACHE_NEXT:t="Get Next Data";break;case r.InternalInterface.MG_ACT_CACHE_PREV:t="Get Previous Data";break;case r.InternalInterface.MG_ACT_FETCH_DATA_CONTROL_VALUES:t="Fetch data control values";break;case r.InternalInterface.MG_ACT_INDEX_CHANGE:t="Index Change";break;default:t=""}return t},e.prototype.getUserEventType=function(){return null===this.UserEvt?E.EVENT_TYPE_NOTINITED:this.UserEvt.getType()},e.prototype.getSecondsOfUserEvent=function(){return this.UserEvt.getSeconds()},e.prototype.getUserEvent=function(){return this.UserEvt},e.prototype.getKeyboardItemString=function(){var e=this.getKbdItm();return null===e?"":e.ToString()},e.prototype.seconds2String=function(){var e=new Array(3),t="";e[0]=Math.floor(this._seconds/3600),e[1]=Math.floor((this._seconds-3600*e[0])/60),e[2]=this._seconds%60;for(var r=0;r<e.length;r++)0===e[r]?t+="00":e[r]<10?t+="0"+e[r]:t+=e[r],r<e.length-1&&(t+=":");return t},e.prototype.getParamVal=function(e){return this._paramVals[e]},e.prototype.parseParamVal=function(e){var a,s,i,l=0,u=0,c=null;for(s=0;s<this._parameters;s++){switch(this._paramAttrs[s]){case r.StorageAttribute.SKIP:c="";break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.BLOB:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:if(u=l+4,i=e.substr(l,u-l),a=t.NNumber.Parse(i,t.NumberStyles.HexNumber),l=u,o.environment.GetDebugLevel()>1||this._paramAttrs[s]===r.StorageAttribute.ALPHA||this._paramAttrs[s]===r.StorageAttribute.UNICODE||this._paramAttrs[s]===r.StorageAttribute.MEMO)if((32768&a)>0){a&=32767,a*=2;var _=new t.StringBuilder;u+=n.RecordUtils.getSpannedField(e,a,l,this._paramAttrs[s],_,!0),e=_.ToString()}else u=l+a,c=e.substr(l,u-l);else if((32768&a)>0){a&=32767,a=4*Math.floor((a+2)/3);_=new t.StringBuilder;u+=n.RecordUtils.getSpannedField(e,a,l,this._paramAttrs[s],_,!1),c=_.ToString()}else u=l+4*Math.floor((a+2)/3),c=r.Base64.decode(e.substr(l,u-l));break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:o.environment.GetDebugLevel()>1?(u=l+2*o.environment.GetSignificantNumSize(),c=e.substr(l,u-l)):(u=l+4*Math.floor((o.environment.GetSignificantNumSize()+2)/3),c=r.Base64.decodeToHex(e.substr(l,u-l)));break;case r.StorageAttribute.BOOLEAN:u=l+1,c=e.substr(l,u-l)}this._paramVals[s]=c,l=u}return u},e.prototype.setParamVals=function(e){if(this._paramVals=e,this._paramAttrs=this._paramNulls="",this._parameters=0,null!==this._paramVals){this._parameters=this._paramVals.length;for(var t=0;t<this._parameters;t++)this._paramAttrs+=r.StorageAttribute.ALPHA,this._paramNulls+="0"}},e.prototype.setParamType=function(e,a){var s,i,o=a.getType(),l=null,u=!1;if(null!=this._paramVals&&this.getParamNum()>=e&&!(u=(s=this._paramAttrs[e])===o)){var c=null;switch(i=this._paramVals[e],o){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(s===r.StorageAttribute.ALPHA)try{l=n.PIC.buildPicture(o,i,a.getTask().getCompIdx(),!0),this._paramVals[e]=n.DisplayConvertor.Instance.disp2mg(i,"",l,a.getTask().getCompIdx(),n.BlobType.CONTENT_TYPE_UNKNOWN),u=!0}catch(e){if(!(e instanceof t.Exception))throw e;u=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Event.setParamType() cannot transfer {0} to Numeric with picture {1}",i,null!=l?l.getFormat():"null"))}break;case r.StorageAttribute.BOOLEAN:s===r.StorageAttribute.ALPHA&&("1"===(i=i.trim())||"true"===i.toLowerCase()?this._paramVals[e]="1":this._paramVals[e]="0",u=!0)}u&&((c=t.NString.ToCharArray(this._paramAttrs))[e]=o,this._paramAttrs=t.NString.FromChars(c))}return u},e.prototype.getParamNum=function(){return this._parameters},e.prototype.getParamNull=function(e){return"0"!==this._paramNulls.charAt(e)},e.prototype.getParamAttr=function(e){return this._paramAttrs.charAt(e)},e.prototype.isControlHeader=function(){return this.getType()==E.EVENT_TYPE_INTERNAL&&(this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_PREFIX||this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_SUFFIX||this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_VERIFICATION)},e.prototype.isVariableHeader=function(){return this.getType()==E.EVENT_TYPE_INTERNAL&&this.getInternalCode()==r.InternalInterface.MG_ACT_VARIABLE},e.prototype.AppendDescription=function(t){switch(this._type){case E.EVENT_TYPE_INTERNAL:t.Append(e.getInternalEvtDescription(this.InternalEvent));break;case E.EVENT_TYPE_SYSTEM:t.Append(this.getKeyboardItemString());break;case E.EVENT_TYPE_USER:t.Append(this.getUsrEvntDesc());break;case E.EVENT_TYPE_USER_FUNC:t.Append(this._userDefinedFuncName);break;case E.EVENT_TYPE_TIMER:t.Append(this.seconds2String());break;case E.EVENT_TYPE_EXPRESSION:t.Append("ID "+this.Exp.getId().toString());break;default:t.Append("unknown event type ")}},e.prototype.isNewInternalEvent=function(){return this.InternalEvent>=1001&&this.InternalEvent<=1008},e.prototype.getNewInternalEventDescription=function(){var e=t.NString.Empty;switch(this.InternalEvent){case r.InternalInterface.MG_ACT_TASK_PREFIX:e=E.BRK_LEVEL_TASK_PREFIX_FM;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:e=E.BRK_LEVEL_TASK_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_REC_PREFIX:e=E.BRK_LEVEL_REC_PREFIX_FM;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:e=E.BRK_LEVEL_REC_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:e=E.BRK_LEVEL_CTRL_PREFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:e=E.BRK_LEVEL_CTRL_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:e=E.BRK_LEVEL_CTRL_VERIFICATION_FM;break;case r.InternalInterface.MG_ACT_VARIABLE:e=E.BRK_LEVEL_VARIABLE_FM}return e},e.prototype.getEventType=function(){return this.isNewInternalEvent()?t.NString.TrimEnd(this.getNewInternalEventDescription()):this.getEventTypeString()},e.prototype.getEventTypeString=function(){var e;switch(this.getType()){case E.EVENT_TYPE_INTERNAL:e="Internal Event:";break;case E.EVENT_TYPE_SYSTEM:e="System Event:";break;case E.EVENT_TYPE_EXPRESSION:e="Expression Event:";break;case E.EVENT_TYPE_TIMER:e="Timer Event:";break;case E.EVENT_TYPE_USER:e="User Event:";break;default:e=""}return e},e.prototype.setUserDefinedFuncName=function(e){this._userDefinedFuncName=e;var r=this._userDefinedFuncName.toUpperCase();this._userDefinedFuncNameHashCode=t.HashUtils.GetHashCode(r)},e.prototype.getUserDefinedFuncName=function(){return this._userDefinedFuncName},e.prototype.getUserDefinedFuncNameHashCode=function(){return this._userDefinedFuncNameHashCode},e.prototype.getUserDefinedFuncRetExp=function(){return this._returnExp},e.prototype.getOsCommandText=function(){return this._osCommandText},e.prototype.setOsCommandText=function(e){this._osCommandText=e},e.prototype.getOsCommandWait=function(){return this._osCommandWait},e.prototype.setOsCommandWait=function(e){this._osCommandWait=e},e.prototype.getOsCommandShow=function(){return this._osCommandShow},e.prototype.setOsCommandShow=function(e){this._osCommandShow=e},e.prototype.setTimestamp=function(){this._timestamp=e._lastTimestamp++},e.prototype.getTimestamp=function(){return this._timestamp},e.prototype.toString=function(){return t.NString.Format("{{Event: {0}}}",this.getBrkLevel())},e}();k._lastTimestamp=0;var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(k),F=function(){function e(){this._queue=null,this._timeFirstEvent=0,this._queue=new D}return e.prototype.isBackgroundEvent=function(e){var t=!1;e instanceof x&&(e.getPriority()===r.Priority.LOWEST&&(t=!0));return t},e.prototype.offer=function(e){try{var n=this._queue.offer(e);return 0===this._timeFirstEvent&&(this.isBackgroundEvent(e)||(this._timeFirstEvent=r.Misc.getSystemMilliseconds())),t.Debug.Assert(n),r.SyncExecutionHelper.Instance.Pulse(),!0}finally{}},e.prototype.put=function(e){this.offer(e)},e.prototype.waitForElement=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return 0!==this._queue.Size?[3,2]:(this._timeFirstEvent=0,[4,r.SyncExecutionHelper.Instance.Wait()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.GetTime=function(){return this._timeFirstEvent},e.prototype.poll=function(){var e;try{var t=this._queue.poll();this.isBackgroundEvent(t)&&(this._timeFirstEvent=0),e=t}finally{}return e},e.prototype.peek=function(){return this._queue.peek()},e.prototype.size=function(){return this._queue.Size},e.prototype.remainingCapacity=function(){return t.Int32.MaxValue},e.prototype.clear=function(){this._queue.clear()},e.prototype.isEmpty=function(){return this._queue.isEmpty()},e}(),w=function(a){function s(i,o,l,u,c,_){var T=a.call(this)||this;return T._controlsList=null,T._direction=0,T._displayLine=t.Int32.MinValue,T._eventSubType=e.EventSubType.Normal,T._actEnableList=null,T._argList=null,T._ctrl=null,T._dotNetObject=null,T._eventFld=null,T._fromServer=!1,T._guiTriggeredEvent=!1,T._immediate=!1,T._isIdleTimer=!1,T._isRealRefresh=!0,T._mgdId=0,T._routeParams=null,T._mprgCreator=null,T._priority=r.Priority.HIGH,T._produceClick=!1,T._reversibleExit=!0,T._selectionEnd=0,T._selectionStart=0,T._sendAll=!1,T._task=null,T._taskTag=null,T._val=null,T.IsSubTree=!1,T.IsFormFocus=!1,T.ActivatedFromMDIFrame=!1,T.PrgFlow="\0",T.CopyGlobalParams=!1,T.MainProgVars=null,T.IgnoreSpecifiedControl=!1,T.LastFocusedVal=null,1===arguments.length&&(null===i||i instanceof b)?T.constructor_5(i):2===arguments.length&&(null===i||i instanceof b)&&(null===o||o instanceof n.MgControlBase)?T.constructor_6(i,o):1===arguments.length&&(null===i||i instanceof n.MgControlBase)?T.constructor_7(i):2!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Boolean?3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Boolean||null!==l&&l.constructor!==Boolean?2!==arguments.length||!(null===i||i instanceof b)||null!==o&&o.constructor!==Boolean?1===arguments.length&&(null===i||i instanceof n.GuiFieldBase)?T.constructor_11(i):2!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number?3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number||null!==l&&l.constructor!==Boolean?3===arguments.length&&(null===i||i instanceof n.MgControlBase)&&(null===o||o instanceof t.List)&&(null===l||l.constructor===Boolean)?T.constructor_14(i,o,l):3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number||null!==l&&l.constructor!==Number?6===arguments.length?T.constructor_16(i,o,l,u,c,_):2===arguments.length&&(null===i||i instanceof k)&&(null===o||o instanceof s)?(a.prototype.constructor_1.call(T,i),T.constructor_17(i,o)):1===arguments.length&&i instanceof s&&Object.assign(T,i):T.constructor_15(i,o,l):T.constructor_13(i,o,l):T.constructor_12(i,o):T.constructor_10(i,o):T.constructor_9(i,o,l):T.constructor_8(i,o),T}return u(s,a),Object.defineProperty(s.prototype,"Control",{get:function(){return this._ctrl},set:function(e){this._ctrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"DisplayLine",{set:function(e){this._displayLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"ControlsList",{get:function(){return this._controlsList},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"Direction",{get:function(){return this._direction},enumerable:!1,configurable:!0}),s.prototype.constructor_5=function(e){this.init(e)},s.prototype.constructor_6=function(e,t){this.constructor_5(null!==t?t.getForm().getTask():e),this.Control=t},s.prototype.constructor_7=function(e){if(this.constructor_6(null,e),null!==e&&a.prototype.getType.call(this)===t.Char.MinValue){var s=e.GetComputedProperty(n.PropInterface.PROP_TYPE_TRIGGER);if(null!==s){var i=new r.XmlParser(s.GetComputedValue());a.prototype.fillData.call(this,i,e.getForm().getTask())}}},s.prototype.constructor_8=function(e,t){this.constructor_7(e),this._guiTriggeredEvent=t,t&&(this._priority=r.Priority.LOW)},s.prototype.constructor_9=function(e,t,r){this.constructor_8(e,t),this.IgnoreSpecifiedControl=r},s.prototype.constructor_10=function(e,t){this.constructor_5(e),this._guiTriggeredEvent=t,t&&(this._priority=r.Priority.LOW)},s.prototype.constructor_11=function(e){this._eventFld=e,this.init(null!==e?e.getTask():null)},s.prototype.constructor_12=function(e,t){this.constructor_7(e),this._displayLine=t},s.prototype.constructor_13=function(e,t,r){this.constructor_8(e,r),this._displayLine=t},s.prototype.constructor_14=function(e,t,r){this.constructor_8(e,r),this._controlsList=t},s.prototype.constructor_15=function(e,t,r){this.constructor_8(e,!0),this._direction=t},s.prototype.constructor_16=function(e,t,r,n,a,s){this.constructor_8(e,!0)},s.prototype.constructor_17=function(e,t){this._taskTag=t._taskTag,this._task=t._task,this.Control=t.Control,this._eventFld=t._eventFld,this._mgdId=t._mgdId,this._displayLine=t._displayLine,this._reversibleExit=t._reversibleExit,this._argList=t._argList,this._immediate=t._immediate,this._mprgCreator=t._mprgCreator,this._priority=t._priority,this._guiTriggeredEvent=t._guiTriggeredEvent,this._isIdleTimer=t._isIdleTimer,this._val=t._val,this._selectionStart=t._selectionStart,this._selectionEnd=t._selectionEnd,this._controlsList=t._controlsList,this._direction=t._direction,this._dotNetObject=t._dotNetObject,this.LastFocusedVal=t.LastFocusedVal,this._routeParams=t._routeParams},s.prototype.CompareTo=function(e){var t=e,r=t._priority-this._priority;return 0===r&&(r=this._timestamp-t._timestamp),r},s.prototype.replicate=function(){var e=new s(this);return e.setTimestamp(),e},s.prototype.init=function(e){this._task=e||o.mgDataTable.getCurrMGData().getFirstTask(),this._taskTag=null===this._task?"":this._task.getTaskTag(),this._mprgCreator=null},s.prototype.convertParamsToArgs=function(){this._argList=new L,this._argList.buildListFromParams(this._parameters,this._paramAttrs,this._paramVals,this._paramNulls),this._parameters=0,this._paramAttrs=null,this._paramVals=null,this._paramNulls=null},s.prototype.getTask=function(){return a.prototype.findUserEvent.call(this),this._task},s.prototype.setTask=function(e){this._task=e,null!==this._task?this._taskTag=this._task.getTaskTag():this._taskTag=null},s.prototype.setTimer=function(e,t,r){this._type=E.EVENT_TYPE_TIMER,this._seconds=e,this._mgdId=t,this._isIdleTimer=r},s.prototype.setClose=function(e,t){a.prototype.setInternal.call(this,t),this._mgdId=e,this._guiTriggeredEvent=!0},s.prototype.getDisplayLine=function(){return this._displayLine},s.prototype.getMgdID=function(){return this._mgdId},s.prototype.getBrkLevel=function(e){return 0===arguments.length?this.getBrkLevel_00():this.getBrkLevel_01(e)},s.prototype.getBrkLevel_00=function(){var e=a.prototype.getBrkLevel.call(this);if(this._type===E.EVENT_TYPE_INTERNAL)switch(this.InternalEvent){case r.InternalInterface.MG_ACT_CTRL_PREFIX:case r.InternalInterface.MG_ACT_CTRL_SUFFIX:case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:e+=this.Control.Name;break;case r.InternalInterface.MG_ACT_VARIABLE:e+=this._eventFld.getVarName()}return e},s.prototype.getBrkLevel_01=function(e){return a.prototype.getBrkLevel.call(this,e)},s.prototype.setCtrl=function(e){this._ctrl=e},s.prototype.setNonReversibleExit=function(){this._reversibleExit=!1},s.prototype.reversibleExit=function(){return this._reversibleExit},s.prototype.buildXML=function(e){if(e.Append("\n "+r.XMLConstants.TAG_OPEN+E.MG_TAG_EVENT),this._type!==t.Char.MinValue&&e.Append(" "+E.MG_ATTR_EVENTTYPE+'="'+this._type+'"'),this._type===E.EVENT_TYPE_SYSTEM&&null!=this.kbdItm){var a=this.kbdItm.getModifier();a!==n.Modifiers.MODIFIER_NONE&&e.Append(" "+E.MG_ATTR_MODIFIER+'="'+a+'"'),e.Append(" "+E.MG_ATTR_KEYCODE+'="'+this.kbdItm.getKeyCode()+'"')}this.InternalEvent!==t.Int32.MinValue&&e.Append(" "+E.MG_ATTR_INTERNALEVENT+'="'+this.InternalEvent+'"'),this._seconds!==t.Int32.MinValue&&e.Append(" "+E.MG_ATTR_SECONDS+'="'+this._seconds+'"'),null!=this.Exp&&e.Append(" "+r.XMLConstants.MG_ATTR_EXP+'="'+this.Exp.getId()+'"'),this._forceExit!==r.ForceExit.None&&e.Append(" "+r.XMLConstants.MG_ATTR_EXP+'="'+this._forceExit+'"'),null!=this.UserEvt&&e.Append(" "+E.MG_ATTR_USER+'="'+this.UserEvtTaskTag+","+this._userEvtIdx+'"'),e.Append(r.XMLConstants.TAG_TERM)},s.prototype.getArgList=function(){return this._argList},s.prototype.setArgList=function(e){var t=null===this._argList;return this._argList=e,t},s.prototype.setRouteParamList=function(e){this._routeParams=e},s.prototype.getRouteParamList=function(){return this._routeParams},s.prototype.setImmediate=function(e){this._immediate=e},s.prototype.isImmediate=function(){return this._immediate},s.prototype.setMainPrgCreator=function(e){this._mprgCreator=e},s.prototype.getMainPrgCreator=function(){return this._mprgCreator},s.prototype.setIsRealRefresh=function(e){this._isRealRefresh=e},s.prototype.getRefreshType=function(){return this._isRealRefresh},s.prototype.setFromServer=function(){this._fromServer=!0},s.prototype.resetFromServer=function(){this._fromServer=!1},s.prototype.isFromServer=function(){return this._fromServer},s.prototype.isQuit=function(){return this._eventSubType===e.EventSubType.CancelIsQuit},s.prototype.RollbackInCancel=function(){return this._eventSubType!==e.EventSubType.CancelWithNoRollback},s.prototype.ExitDueToError=function(){return this._eventSubType===e.EventSubType.ExitDueToError},s.prototype.RtViewRefreshUseCurrentRow=function(){return this._eventSubType===e.EventSubType.RtRefreshViewUseCurrentRow},s.prototype.SetEventSubType=function(e){this._eventSubType=e},s.prototype.getFld=function(){return this._eventFld},s.prototype.isGuiTriggeredEvent=function(){return this._guiTriggeredEvent},s.prototype.getPriority=function(){return this._priority},s.prototype.setPriority=function(e){this._priority=e},s.prototype.isIdleTimer=function(){return this._isIdleTimer},s.prototype.getValue=function(){return this._val},s.prototype.setValue=function(e){this._val=e},s.prototype.getStartSelection=function(){return this._selectionStart},s.prototype.getEndSelection=function(){return this._selectionEnd},s.prototype.setEditParms=function(e,t,r){this._selectionStart=e,this._selectionEnd=t,this.setValue(r)},s.prototype.isProduceClick=function(){return this._produceClick},s.prototype.setProduceClick=function(e){this._produceClick=e},s.prototype.setActEnableList=function(e){this._actEnableList=e},s.prototype.getActEnableList=function(){return this._actEnableList},s.prototype.isSendAll=function(){return this._sendAll},s.prototype.setSendAll=function(e){this._sendAll=e},s.prototype.isBlockedByModalWindow=function(e){if(e.IsModal){var t=this.getTask(),r=e.getTask(0);if(t!==r&&r.isDescendentOf(t))return!0}return!1},s.prototype.toString=function(){return t.NString.Format("{{RTEvent {0} ({1}), type {2}{3}}}",[this.getBrkLevel(),this.InternalEvent,this._type,null===this._task?"":" on "+this._task])},s}(x),V=function(){};V.FLWMTR_START=0,V.FLWMTR_END=1,V.FLWMTR_PROPAGATE=2,V.FLWMTR_USE_COMP=3,V.FLWMTR_EVENT=7,V.FLWMTR_CHNG_MODE=8,V.FLWMTR_PREFIX=15,V.FLWMTR_SUFFIX=16,V.FLWMTR_CTRL_PREFIX=18,V.FLWMTR_CTRL_SUFFIX=19,V.FLWMTR_TSK_HANDLER=20,V.FLWMTR_CTRL_VERIFY=21,V.FLWMTR_SORT=22,V.FLWMTR_LOCATE=23,V.FLWMTR_RANGE=24,V.FLWMTR_KEY_CHANGE=25,V.FLWMTR_TRANS=26,V.FLWMTR_LOADREC=27,V.FLWMTR_UPDATE=28,V.FLWMTR_DELETE=29,V.FLWMTR_INSERT=30,V.FLWMTR_RECOMP=31,V.FLWMTR_DATA_OPER=41,V.FLWMTR_LOG_MSG=51,V.FLWMTR_USER_MSG=96,V.FLWMTR_ERROR_MSG=97,V.FLWMTR_FREE_MSG=98,V.FLWMTR_DEBUG_MSG=99,V.FLWMTR_WARN_MSG=100,V.FLWMTR_VARCHG_VALUE=119,V.FLWMTR_VARCHG_REASON=120,V.FLWMTR_EVENT_KBD=1,V.FLWMTR_EVENT_ACT=2,V.FLWMTR_EVENT_TIME=4,V.FLWMTR_EVENT_EXP=8;var U=function(){function e(){this._queue=new r.Queue,this._enabled=!1,this._isFlowOperation=!1,this._isRecompute=!1,this._isTask=!1,this._isTaskFlow=!1,this.ShouldSerialize=!1}return Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.addTaskCngMode=function(t,n,a){var s="Task Mode Change - ";if(this._enabled&&this._isTask){var i=new B(this,e.ACT_TASK,V.FLWMTR_CHNG_MODE);switch(n){case r.Constants.TASK_MODE_MODIFY:s+="Modify";break;case r.Constants.TASK_MODE_CREATE:s+="Create";break;case r.Constants.TASK_MODE_DELETE:s+="Delete";break;case r.Constants.TASK_MODE_QUERY:s+="Query";break;default:s=null}i.setInfo(s),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(a+": "+s,!0)}},e.prototype.fillData=function(e){var t=e.getXMLdata().indexOf("/>",e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf("flwmtr_config")+"flwmtr_config".length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);return r.Logger.Instance.WriteDevToLog("in FlowMonitorQueue.FillData: "+a.toString()),this.initElements(a),void e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in FlowMonitorQueue.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var t=0;t<e.length;t+=2){var n=e.get_Item(t),a=e.get_Item(t+1);switch(r.Logger.Instance.WriteDevToLog(n+" value: "+a),n){case E.MG_ATTR_TASK:this._isTask=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_TASKFLW:this._isTaskFlow=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_RECOMP:this._isRecompute=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_FLWOP:this._isFlowOperation=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ENABLED:this.enable(r.XmlParser.getBoolean(a));break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in FlowMonitorQueue.initElements(): unknown attribute: "+n)}}},e.prototype.buildXML=function(e){if(!this._queue.isEmpty()&&this.ShouldSerialize){for(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_FLWMTR_MSG+r.XMLConstants.TAG_CLOSE);!this._queue.isEmpty();){this._queue.get().buildXML(e)}e.Append("</"+E.MG_TAG_FLWMTR_MSG+r.XMLConstants.TAG_CLOSE)}},e.prototype.isEmpty=function(){return this._queue.isEmpty()},e.prototype.enable=function(e){var t=this._enabled;return this._enabled=e,this.ShouldSerialize=this._enabled,t},e.prototype.addTaskEvent=function(t,n,a){if(this._enabled&&this._isTask){var s=new B(this,e.ACT_TASK,V.FLWMTR_EVENT),i=void 0;switch(n){case V.FLWMTR_START:i=e.S_EVENT_STR1+t+e.S_EVENT_STR2;break;case V.FLWMTR_END:i=e.E_EVENT_STR+t;break;case V.FLWMTR_PROPAGATE:i=e.S_EVENT_PROPAGATED;break;default:i=null}s.setInfo(i),this._queue.put(s),r.Logger.Instance.WriteSupportToLog(a+": "+i,!0)}},e.prototype.addTaskFlowRec=function(t,n,a){if(this._enabled&&this._isTaskFlow){var s=void 0;switch(t){case r.InternalInterface.MG_ACT_REC_PREFIX:s=n===V.FLWMTR_START?e.S_RECPRF_STR:e.E_RECPRF_STR,t=V.FLWMTR_PREFIX;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:s=n===V.FLWMTR_START?e.S_RECSUF_STR:e.E_RECSUF_STR,t=V.FLWMTR_SUFFIX;break;case r.InternalInterface.MG_ACT_TASK_PREFIX:s=n===V.FLWMTR_START?e.S_TASKPRF_STR:e.E_TASKPRF_STR,t=V.FLWMTR_PREFIX;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:s=n===V.FLWMTR_START?e.S_TASKSUF_STR:e.E_TASKSUF_STR,t=V.FLWMTR_SUFFIX;break;default:s=null}var i=new B(this,e.ACT_TASK_FLW,t);i.setInfo(s),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(a+": "+s,!0)}},e.prototype.addTaskFlowFld=function(e,t,r,n){this.addTaskFlowCtrl(e,t,r,n)},e.prototype.addTaskFlowCtrl=function(t,n,a,s){if(this._enabled&&this._isTaskFlow){var i=void 0;switch(t){case r.InternalInterface.MG_ACT_VARIABLE:i=a===V.FLWMTR_START?e.S_VARIABLE_STR:e.E_VARIABLE_STR,t=V.FLWMTR_VARCHG_VALUE;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:i=a===V.FLWMTR_START?e.S_CTRLPRF_STR:e.E_CTRLPRF_STR,t=V.FLWMTR_CTRL_PREFIX;break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:i=a===V.FLWMTR_START?e.S_CTRLSUF_STR:e.E_CTRLSUF_STR,t=V.FLWMTR_CTRL_SUFFIX;break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:i=a===V.FLWMTR_START?e.S_CTRLVER_STR:e.E_CTRLVER_STR,t=V.FLWMTR_CTRL_SUFFIX;break;default:i=null}var o=new B(this,e.ACT_TASK_FLW,t);null!==i&&(i+=n,t===V.FLWMTR_VARCHG_VALUE&&a===V.FLWMTR_START&&(i+=e.VARIABLE_REASON_STR),o.setInfo(i),r.Logger.Instance.WriteSupportToLog(s+": "+i,!0)),this._queue.put(o)}},e.prototype.addTaskFlowHandler=function(n,a,s){if(this._enabled&&this._isTaskFlow){var i=new B(this,e.ACT_TASK_FLW,V.FLWMTR_TSK_HANDLER),o=void 0;switch(a){case V.FLWMTR_START:o=t.NString.Format(e.S_HANDLER_STR,n);break;case V.FLWMTR_END:o=t.NString.Format(e.E_HANDLER_STR,n);break;default:o=null}null!==o&&(i.setInfo(o),r.Logger.Instance.WriteSupportToLog(s+": "+o,!0)),this._queue.put(i)}},e.prototype.addRecompute=function(t,n){if(this._enabled&&this._isRecompute){var a=new B(this,e.ACT_RECOMPUTE,V.FLWMTR_RECOMP),s=e.RECOMP_STR+t;a.setInfo(s),this._queue.put(a),r.Logger.Instance.WriteSupportToLog(n+": "+s,!0)}},e.prototype.addFlowFieldOperation=function(n,a,s){return T(this,void 0,void 0,(function(){var i,o,l;return h(this,(function(u){switch(u.label){case 0:return this._enabled&&this._isFlowOperation?(i=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),o=new t.StringBuilder(e.FLW_PERFIX),[4,n.AddFlowDescription(o)]):[3,2];case 1:u.sent(),o.Append(" "),a||o.Append("[Not Executed]"),l=o.ToString(),i.setInfo(l),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(s+": "+l,!0),u.label=2;case 2:return[2]}}))}))},e.prototype.addFlowOperationUpdate=function(t,n){if(this._enabled&&this._isFlowOperation){var a=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),s=void 0;s=t===V.FLWMTR_START?"Starts Update":"Ends Update",a.setInfo(s),this._queue.put(a),r.Logger.Instance.WriteSupportToLog(n+": "+s,!0)}},e.prototype.addFlowVerifyInfo=function(e,t){this.addFlowInfo(e,t)},e.prototype.addFlowInvokeOsInfo=function(e,t){this.addFlowInfo(e,t)},e.prototype.addFlowInfo=function(n,a){if(this._enabled){var s=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),i=new t.StringBuilder("");""!==n&&(i.Append(" >> INFORMATION >> "),i.Append(n));var o=i.ToString();s.setInfo(o),this._queue.put(s),r.Logger.Instance.WriteSupportToLog(a+": "+o,!0)}},e}();U._instance=null,U.S_EVENT_STR1=">>Starts ",U.S_EVENT_STR2=" Event",U.S_EVENT_PROPAGATED="Event was propagated",U.E_EVENT_STR="<<Ends Event",U.TSK_CHNG_MODE="Task Mode Change - ",U.S_RECPRF_STR="Starts Record Prefix",U.E_RECPRF_STR="Ends Record Prefix",U.S_RECSUF_STR="Starts Record Suffix",U.E_RECSUF_STR="Ends Record Suffix",U.S_TASKSUF_STR="Starts Task Suffix",U.E_TASKSUF_STR="Ends Task Suffix",U.S_TASKPRF_STR="Starts Task Prefix",U.E_TASKPRF_STR="Ends Task Prefix",U.S_CTRLPRF_STR="Starts Control Prefix - ",U.E_CTRLPRF_STR="Ends Control Prefix - ",U.S_CTRLSUF_STR="Starts Control Suffix - ",U.E_CTRLSUF_STR="Ends Control Suffix - ",U.S_HANDLER_STR="Starts handling event {0}",U.E_HANDLER_STR="Ends handling event {0}",U.S_CTRLVER_STR="Starts Control Verification for Control - ",U.E_CTRLVER_STR="Ends Control Verification for Control - ",U.RECOMP_STR="Recomputes - ",U.S_VARIABLE_STR="Starts Variable Change - ",U.E_VARIABLE_STR="Ends Variable Change - ",U.VARIABLE_REASON_STR=" - Reason - Previous value",U.INFORM_STR=" >> INFORMATION >> ",U.FLW_STEP_FWD="(Step Forward)",U.FLW_FAST_FWD="(Fast Forward)",U.FLW_STEP_BWD="(Step Backward)",U.FLW_FAST_BWD="(Fast Backward)",U.FLW_NOT_EXEC="[Not Executed]",U.FLW_FORWARD="(Forward)",U.FLW_BACKWARD="(Backward)",U.FLW_PERFIX="Flow - ",U.S_UPDATE_STR="Starts Update",U.E_UPDATE_STR="Ends Update",U.ACT_TASK="T",U.ACT_TASK_FLW="F",U.ACT_RECOMPUTE="R",U.ACT_FLW_OPER="T",U.LongTimePattern="HH:mm:ss:SSS";var B=function(){function e(e,t,r){this._enclosingInstance=null,this._id=0,this._type=null,this._info=null,this._time=null,this._enclosingInstance=e,this._type=t,this._id=r,this.setTime()}return e.prototype.setTime=function(){this._time=r.DateTimeUtils.ToString(t.DateTime.Now,U.LongTimePattern,r.Logger.Instance)},e.prototype.setInfo=function(e){this._info=null!==e?r.XmlParser.escape(e):e},e.prototype.buildXML=function(e){e.Append(r.XMLConstants.START_TAG+E.MG_TAG_FLWMTR_ACT),e.Append(" "+r.XMLConstants.MG_ATTR_TYPE+'="'+this._type+'"'),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),null!=this._info&&e.Append(" "+E.MG_ATTR_INFO+'="'+this._info+'"'),e.Append(" "+E.MG_ATTR_TIME+'="'+this._time+'"'),e.Append(r.XMLConstants.TAG_TERM)},e}(),X=function(){};X.MgDataToTimerObjList=new t.Dictionary;var H,W,K=function(e){function r(r,n,a){var s=e.call(this,n)||this;s._mgData=null,s._isIdle=!1,s._mgData=r,s.IsIdleTimer=a;var i=s._mgData.GetId().toString();return X.MgDataToTimerObjList.ContainsKey(i)||X.MgDataToTimerObjList.Add(i,new t.List),X.MgDataToTimerObjList.get_Item(i).push(s),s}return u(r,e),Object.defineProperty(r.prototype,"TimerIntervalMiliSeconds",{get:function(){return this._timerIntervalMilliSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"IsIdleTimer",{get:function(){return this._isIdle},set:function(e){this._isIdle=e},enumerable:!1,configurable:!0}),r.prototype.GetMgdata=function(){return this._mgData},r.StopTimer=function(e,t,r){var n=null,a=null,s=e.GetId().toString();X.MgDataToTimerObjList.ContainsKey(s)&&(null!=(a=(n=X.MgDataToTimerObjList.get_Item(s)).find((function(e){return null!==e&&e._timerIntervalMilliSeconds===t&&e._isIdle===r})))&&(a.Stop(),n.Remove(a)),0===n.length&&X.MgDataToTimerObjList.Remove(s))},r.StopAll=function(e){var t=null,r=e.GetId().toString();X.MgDataToTimerObjList.ContainsKey(r)&&(t=X.MgDataToTimerObjList.get_Item(r)),null!==t&&(t.forEach((function(e){null!==e&&e.Stop()})),t.Clear(),X.MgDataToTimerObjList.Remove(r))},r}(n.MgTimer),Y=function(){function e(e,t,r){this.TaskId=null,this.HandlerId=null,this.OperIdx=0,this.TaskId=e,this.HandlerId=t,this.OperIdx=r}return e.prototype.Equals=function(t){var r=t instanceof e?t:null;return null!==r&&r.HandlerId===this.HandlerId&&r.TaskId===this.TaskId&&r.OperIdx===this.OperIdx},e}(),z=function(){function e(e){this._execStack=null,0!==arguments.length?this.constructor_1(e):this.constructor_0()}return e.prototype.constructor_0=function(){this._execStack=new t.Stack},e.prototype.constructor_1=function(e){this._execStack=e.getStack().Clone()},e.prototype.getStack=function(){return this._execStack},e.prototype.push=function(e,t,r){1===arguments.length?this.push_0(e):this.push_1(e,t,r)},e.prototype.push_0=function(e){this._execStack.push(e)},e.prototype.push_1=function(e,t,r){var n=new Y(e,t,r);this._execStack.push(n)},e.prototype.pop=function(){return this._execStack.pop()},e.prototype.empty=function(){return 0===this._execStack.count()},e.prototype.clear=function(){this._execStack.Clear()},e.prototype.size=function(){return this._execStack.count()},e.prototype.Equals=function(t){var r=new e(this),n=new e(t),a=!1;if(r.size()===n.size())for(a=!0;!r.empty()&&a;)r.pop().Equals(n.pop())||(a=!1);return a},e.prototype.pushUpSideDown=function(t){for(var r=new e(t);!r.empty();){var n=r.pop();this._execStack.push(n)}},e.prototype.reverse=function(){var t=new e(this);for(this.clear();!t.empty();){var r=t.pop();this.push(r)}},e.prototype.buildXML=function(e){for(var n=new t.StringBuilder;0!==this._execStack.count();){var a=this._execStack.pop();t.NNumber.Parse(a.TaskId)>E.INITIAL_OFFLINE_TASK_TAG?n.Remove(0,n.Length):(n.Append("\n "+r.XMLConstants.TAG_OPEN+E.MG_TAG_EXEC_STACK_ENTRY),n.Append(" "+r.XMLConstants.MG_ATTR_TASKID+'="'+a.TaskId+'"'),n.Append(" "+E.MG_ATTR_HANDLERID+'="'+a.HandlerId+'"'),n.Append(" "+E.MG_ATTR_OPER_IDX+'="'+a.OperIdx+'"'),n.Append(" "+r.XMLConstants.TAG_TERM))}e.Append(n.ToString())},e}(),q=function(e){function n(){var r=e.call(this)||this;return r.ExecutionStack=null,r.TaskTag=null,r.HandlerId=null,r.OperIdx=0,r.DitIdx=0,r.Val=null,r.MprgCreator=null,r.Operation=null,r.CheckOnly=!1,r.DitIdx=t.Int32.MinValue,r}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EXEC_OPER},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){var n=new A,a=null!==this.ExecutionStack&&!this.ExecutionStack.empty();return n.SerializeTaskTag(this.TaskTag),null===this.HandlerId||a||n.SerializeAttribute(E.MG_ATTR_HANDLERID,this.HandlerId),this.OperIdx>t.Int32.MinValue&&!a&&n.SerializeAttribute(E.MG_ATTR_OPER_IDX,this.OperIdx),this.DitIdx>t.Int32.MinValue&&n.SerializeDitIdx(this.DitIdx),null!=this.Operation&&this.Operation.getType()===E.MG_OPER_CALL&&null!==this.Operation.getRouteParams()&&n.SerializeRouteParams(this.Operation),null!==this.Val&&n.SerializeAttribute(r.XMLConstants.MG_ATTR_VALUE,r.XmlParser.escape(this.Val)),this.CheckOnly&&n.SerializeAttribute(E.MG_ATTR_CHECK_ONLY,"1"),n.GetString()},n.prototype.SetExecutionStack=function(e){this.ExecutionStack=new z,this.ExecutionStack.push(o.mgDataTable.getTaskIdById(this.TaskTag),this.HandlerId,this.OperIdx),this.ExecutionStack.pushUpSideDown(e)},n.prototype.SerializeDataAfterCommand=function(){if(null!==this.ExecutionStack&&!this.ExecutionStack.empty()){var e=new t.StringBuilder;return this.ExecutionStack.buildXML(e),e.ToString()}return null},n.prototype.getCommandInfo=function(){return"Line number ["+(this.Operation.getServerId()+1)+"] in ["+this.Operation.getEventHandler().getEventHandlerInfo()+"] on ["+this.Operation.Task.getTaskInfo()+"]"},n.prototype.getTask=function(){return this.Operation.Task},n}(C),j=function(){function e(){}return e.Scramble=function(r){if(!this.ScramblingEnabled)return r;var n,a=0,s=r.length,i=e.RandomScramble(s),o=Math.floor(Math.sqrt(s))+i,l=new t.StringBuilder(s+1);l.Append(String.fromCharCode(i+81));for(var u=0;u<o;u++)for(a=u;a<s;)n=r[a],l.Append(n),a+=o;return l.Append("_"),l.ToString()},e.LocateScramble=function(e,r){for(var n=r;n<e.length&&t.NChar.IsWhiteSpace(e.charAt(n));)n+=1;return n+1},e.RandomScramble=function(t){var r,n=Math.sqrt(t),a=e.XML_MIN_RANDOM,s=e.XML_MAX_RANDOM;return a<-1*n/2&&(a=Math.floor(-1*n/2)),s>n/2&&(s=Math.floor(n/2)),(r=Math.random()*(s-a)+a)===e.XML_ILLEGAL_RANDOM&&r++,Math.floor(r)},e.UnScramble=function(r,n,a){if(e.ScramblingEnabled){var s,i,o,l,u,c=void 0,_=void 0,T=void 0,h=(p=void 0,void 0);for(s=(a-=1)-(u=this.LocateScramble(r,n))+1,i=r[u-1].charCodeAt(0)-81+Math.floor(Math.sqrt(s)),p=new Array(s),o=Math.floor(s/i),l=s%i,T=c=0;c<s;T++)for(_=T,h=1;_<s&&c<s;)p[c]=r[_+u],_+=o,h<=l&&_++,c++,h++;return t.NString.FromChars(p)}var p;return p=r.substr(n,a-n+1)},e}();j.ScramblingEnabled=!0,j.XML_MIN_RANDOM=-48,j.XML_MAX_RANDOM=47,j.XML_ILLEGAL_RANDOM=-21,(H=e.CommandsProcessorBase_SessionStage||(e.CommandsProcessorBase_SessionStage={}))[H.HANDSHAKE=1]="HANDSHAKE",H[H.INITIAL=2]="INITIAL",H[H.NORMAL=3]="NORMAL",(W=e.CommandsProcessorBase_SendingInstruction||(e.CommandsProcessorBase_SendingInstruction={}))[W.NO_TASKS_OR_COMMANDS=0]="NO_TASKS_OR_COMMANDS",W[W.ONLY_COMMANDS=1]="ONLY_COMMANDS",W[W.TASKS_AND_COMMANDS=2]="TASKS_AND_COMMANDS";var Q=function(){function t(){this._sessionCounter=0}return t.prototype.GetSessionCounter=function(){return this._sessionCounter},t.prototype.Execute=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return a.isNullOrUndefined(t)?[4,this.Execute_0(e)]:[3,2];case 1:case 3:return n.sent(),[2];case 2:return[4,this.Execute_1(e,t,r)]}}))}))},t.prototype.Execute_0=function(t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.Execute_1(t,e.CommandsProcessorBase_SessionStage.NORMAL,null)];case 1:return r.sent(),[2]}}))}))},t.UnScramble=function(e){var t,n=e.indexOf(r.XMLConstants.MG_TAG_OPEN);if(-1!==n){var a=n+r.XMLConstants.MG_TAG_OPEN.length,s=e.substr(0,a),i=e.lastIndexOf(r.XMLConstants.TAG_OPEN),o=e.substr(i);t=s+j.UnScramble(e,a,i-1)+o}else t=j.UnScramble(e,0,e.length-1);return t},t}(),Z=function(){function e(){}return e.GetHttpCommunicationTimeout=function(){return null!==e.GetHttpCommunicationTimeout_Event?e.GetHttpCommunicationTimeout_Event():5e3},e.GetExecutionProperty=function(t){return null!==e.GetExecutionProperty_Event?e.GetExecutionProperty_Event(t):null},e.GetGlobalUniqueSessionID=function(){return null!==e.GetGlobalUniqueSessionID_Event?e.GetGlobalUniqueSessionID_Event():null},e.ShouldDisplayGenericError=function(){return null===e.ShouldDisplayGenericError_Event||e.ShouldDisplayGenericError_Event()},e.GetRuntimeCtxID=function(){return null!==e.GetRuntimeCtxID_Event?e.GetRuntimeCtxID_Event():""},e.GetSessionCounter=function(){return null!==e.GetSessionCounter_Event?e.GetSessionCounter_Event():0},e.CheckAndSetSessionCounter=function(t){null!==e.CheckAndSetSessionCounter_Event&&e.CheckAndSetSessionCounter_Event(t)},e.ComputeAndLogRequestInfo=function(t,r,n){null!==e.ComputeAndLogRequestInfo_Event&&e.ComputeAndLogRequestInfo_Event(t,r,n)},e}();Z.GetHttpCommunicationTimeout_Event=null,Z.GetExecutionProperty_Event=null,Z.GetGlobalUniqueSessionID_Event=null,Z.ShouldDisplayGenericError_Event=null,Z.GetRuntimeCtxID_Event=null,Z.GetSessionCounter_Event=null,Z.CheckAndSetSessionCounter_Event=null,Z.ComputeAndLogRequestInfo_Event=null;var J;(J=e.RequestMethod||(e.RequestMethod={}))[J.Get=0]="Get",J[J.Post=1]="Post",J[J.Put=2]="Put",J[J.Delete=3]="Delete",J[J.Options=4]="Options",J[J.Head=5]="Head",J[J.Patch=6]="Patch";var $=function(){function n(){this._HTTPMaxURLLength=2048,this.CommunicationsFailureHandler=null,this.CommunicationsFailureHandler=null}return n.prototype.DecideOnRequestMethod=function(t,r){var n=e.RequestMethod.Get;return null===t?n=e.RequestMethod.Get:r.value.length+1+t.length<=this._HTTPMaxURLLength?(r.value=r.value+"?"+t,n=e.RequestMethod.Get):n=e.RequestMethod.Post,n},n.prototype.GetContent=function(e,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:o=new t.RefParam(null),l=new t.RefParam(e),u=this.DecideOnRequestMethod(s,l),e=l.value,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this.ExecuteHttpRequest(e,s,i,u,o)];case 2:return null!=(c=h.sent())&&(r.Logger.Instance.WriteServerToLog("Incoming Headers : "+n.HeadersToString(c.headers,!0)),_=c.headers.get("MgxpaNextSessionCounter".toLowerCase()),a.isNullOrUndefined(_)||Z.CheckAndSetSessionCounter(+_)),[3,4];case 3:throw T=h.sent(),r.Logger.Instance.WriteWarningToLog(T),T;case 4:return[2,o.value]}}))}))},n.prototype.ExecuteHttpRequest=function(i,o,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,E,I,f,C,A,R,S;return h(this,(function(h){switch(h.label){case 0:_=null,this.prepareRequest(u,i),T=Z.GetHttpCommunicationTimeout(),p=Z.GetGlobalUniqueSessionID(),g=0,d=r.Misc.getSystemMilliseconds(),h.label=1;case 1:0,g++,h.label=2;case 2:return h.trys.push([2,4,,5]),E=new s.HttpHeaders,E=this.addHeaders(i,l,E,p),r.Logger.Instance.WriteServerToLog(t.NString.Format("Request Timeout set to {0} ms",T)),r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&(I=0,u===e.RequestMethod.Get?2===(f=i.split("?")).length&&(I=f[1].length):I=o.length,r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageLeaving,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),p,Z.ShouldDisplayGenericError()?"-":new URL(i).host,0,"-",JSON.stringify(E),I)),C=r.Misc.getSystemMilliseconds(),r.Logger.Instance.WriteServerToLog(t.NString.Format("Accessing (method: '{0}'): '{1}'",u,i)),r.Logger.Instance.WriteServerToLog("Outgoing Headers : "+n.HeadersToString(E,!1)),e.RequestMethod.Post,A=r.Misc.getSystemMilliseconds(),this.LogRequestInfo(a.isNullOrUndefined(o)?0:o.length,A,!1),[4,this.sendRequestToServer(u,i,E,o,c,C,p)];case 3:return _=h.sent(),this.logResponse(_,p,i,c,C),this.LogRequestInfo(a.isNullOrUndefined(o)?0:o.length,r.Misc.getSystemMilliseconds()-A,!0),[3,6];case 4:return R=h.sent(),r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic?r.Logger.Instance.WriteBasicErrorToLog(Z.GetRuntimeCtxID(),Z.GetSessionCounter(),p,Z.ShouldDisplayGenericError()?"-":new URL(i).host,R):r.Logger.Instance.WriteWarningToLog(R),this.handleHttpErrorException(R,i),S=new t.RefParam(d),this.shouldRetry(T,i,this.CommunicationsFailureHandler,R,S)?(d=S.value,[3,1]):(this.logAndThrowException(R),[3,5]);case 5:return[3,1];case 6:return this.logExecutionAttempts(g),[2,_]}}))}))},n.prototype.LogRequestInfo=function(e,t,n){r.Logger.Instance.LogLevel==r.Logger_LogLevels.RequestInfo&&Z.ComputeAndLogRequestInfo(e,t,n)},n.HeadersToString=function(e,r){var n=new t.StringBuilder,a=e.keys();for(var s in a)r&&!a[s].startsWith("Mg")||n.Append(t.NString.Format("{0}:{1} ",a[s],e.get(a[s])));return n},n.GetHTTPExpect100Continue=function(){var e=!0,r=Z.GetExecutionProperty("Expect100Continue");return t.NString.IsNullOrEmpty(r)||(e="Y"===r.toUpperCase()),e},n.GetUseHighestSecurityProtocol=function(){var e=!1,r=Z.GetExecutionProperty("UseHighestSecurityProtocol");return t.NString.IsNullOrEmpty(r)||(e="Y"===r.toUpperCase()),e},n}(),ee=function(e){function n(){var t=e.call(this)||this;return t.httpRequest=null,t.headers=new Headers,t}return u(n,e),n.prototype.prepareRequest=function(e,t){},n.prototype.addHeaders=function(e,t,r,n){return e.startsWith("/")||this.headers.append("MgxpaRIAglobalUniqueSessionID",n),t||this.headers.append("Cache-Control","no-cache"),r},n.prototype.sendRequestToServer=function(e,r,n,a,s,i,o){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,fetch(r,{method:"POST",headers:this.headers,body:a,keepalive:!0})];case 1:return e.sent(),[2,t.NString.Empty]}}))}))},n.prototype.logResponse=function(e,t,n,a,s){var i=r.Misc.getSystemMilliseconds()-s;r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageEntering,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),t,Z.ShouldDisplayGenericError()?"-":new URL(n).host,i,this.httpRequest.status.toString(),JSON.stringify(this.httpRequest.getAllResponseHeaders()),a.value.length)},n.prototype.handleHttpErrorException=function(e,t){throw e},n.prototype.shouldRetry=function(e,t,r,n,a){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,!1]}))}))},n.prototype.logAndThrowException=function(e){},n.prototype.logExecutionAttempts=function(e){},n}($),te=function(n){function a(e){var t=n.call(this)||this;return t.httpClient=e,t}return u(a,n),a.prototype.prepareRequest=function(e,t){},a.prototype.addHeaders=function(e,t,r,n){return e.startsWith("/")||(r=r.append("MgxpaRIAglobalUniqueSessionID",n)),t||(r=r.append("Cache-Control","no-cache")),r},a.prototype.sendRequestToServer=function(t,r,n,a,s,i,o){return T(this,void 0,void 0,(function(){var i;return h(this,(function(o){switch(o.label){case 0:return[4,this.httpClient.request(e.RequestMethod[t],r,{headers:n,responseType:"text",observe:"response",body:a}).toPromise()];case 1:return i=o.sent(),s.value=i.body,[2,i]}}))}))},a.prototype.logResponse=function(e,t,n,a,s){var i=e.status,o=r.Misc.getSystemMilliseconds()-s;r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageEntering,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),t,Z.ShouldDisplayGenericError()?"-":new URL(n).host,o,i.toString(),JSON.stringify(e.headers),a.value.length)},a.prototype.handleHttpErrorException=function(e,r){if(e instanceof s.HttpErrorResponse){var n=e.status;if(404===n||403===n)throw new t.WebException(new Error("bad URL: "+r+" - StatusCode = "+n),n)}},a.prototype.shouldRetry=function(e,n,a,s,i){return T(this,void 0,void 0,(function(){var o,l;return h(this,(function(u){switch(u.label){case 0:return o=Math.floor(e/10),(l=r.Misc.getSystemMilliseconds()-i.value+o)<=e?[4,t.Thread.Sleep(o)]:[3,2];case 1:return u.sent(),r.Logger.Instance.WriteWarningToLogWithMsg(t.NString.Format("Retrying {0} : elapsed time {1:N0}ms out of {2:N0}ms",n,l,e)),[2,!0];case 2:return r.Logger.Instance.WriteWarningToLogWithMsg(t.NString.Format("{0} : http timeout {1:N0}ms expired",n,e)),null!=a&&(a.CommunicationFailed(n,s),a.ShouldRetryLastRequest)?(r.Logger.Instance.WriteServerToLog(t.NString.Format("Retrying {0}, confirmed by user ...",n)),i.value=r.Misc.getSystemMilliseconds(),[2,!0]):[2,!1]}}))}))},a.prototype.logAndThrowException=function(e){throw r.Logger.Instance.WriteWarningToLogWithMsg("Re-throwing ..."),r.Logger.Instance.WriteWarningToLog(e),new t.WebException(e)},a.prototype.logExecutionAttempts=function(e){e>1&&r.Logger.Instance.WriteServerToLog(t.NString.Format("Succeeded after {0} attempts ...",e))},a}($),re=function(){function e(){this._httpCommunicationTimeoutMS=e.DEFAULT_HTTP_COMMUNICATION_TIMEOUT,this._httpClientAsync=null,this._isAbortingMagicEngine=!1,this._httpClientAsync=new te(e._nativeHttpClient),this.RegisterBasicDelegates()}return e.prototype.getHttpClient=function(){return this.IsAbortingMagicEngine?new ee:this._httpClientAsync},Object.defineProperty(e.prototype,"HttpCommunicationTimeoutMS",{set:function(e){this._httpCommunicationTimeoutMS=e},enumerable:!1,configurable:!0}),e.setNativeHttpClient=function(t){e._nativeHttpClient=t},e.GetInstance=function(){return null===e._instance&&(e._instance=new e),e._instance},Object.defineProperty(e.prototype,"IsAbortingMagicEngine",{get:function(){return this._isAbortingMagicEngine},set:function(e){this._isAbortingMagicEngine=e},enumerable:!1,configurable:!0}),e.prototype.RegisterBasicDelegates=function(){Z.GetHttpCommunicationTimeout_Event=this.GetHttpCommunicationTimeoutMS.bind(this)},e.prototype.GetHttpCommunicationTimeoutMS=function(){return this._httpCommunicationTimeoutMS},e.prototype.SetCommunicationsFailureHandler=function(e){this.getHttpClient().CommunicationsFailureHandler=e},e.prototype.GetContent=function(n,a,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c;return h(this,(function(_){switch(_.label){case 0:t.Debug.Assert(null!=this.getHttpClient()),_.label=1;case 1:return _.trys.push([1,3,4,5]),r.Logger.Instance.WriteServerToLog("*************************************************************************************************"),i.value=!1,r.Logger.Instance.WriteServerToLog(n),e.LogAccessToServer("",a),[4,this.getHttpClient().GetContent(n,a,s)];case 2:return o=_.sent(),t.Debug.Assert(null!==o),null!==(l=e.CheckAndGetErrorResponse(o))&&(o=l,i.value=!0),[2,o];case 3:throw u=_.sent(),c=new URL(n),new t.ApplicationException(u.Message+"\n"+c.origin+c.pathname,u);case 4:return[7];case 5:return[2]}}))}))},e.CheckAndGetErrorResponse=function(e){var t=null;return e.startsWith(E.V24_RIA_ERROR_PREFIX)&&(t=e.substr(E.V24_RIA_ERROR_PREFIX.length)),t},e.LogAccessToServer=function(e,n){r.Logger.Instance.ShouldLogServerRelatedMessages()&&(t.NString.IsNullOrEmpty(e)||(e+="; accessing server ..."),null===n?t.NString.IsNullOrEmpty(e)||r.Logger.Instance.WriteServerToLog(e):(t.NString.IsNullOrEmpty(e)||(e+=" "),e=e+"uploading "+n.length+" bytes",r.Logger.Instance.WriteServerToLog(e)))},e}();re._instance=null,re.DEFAULT_HTTP_COMMUNICATION_TIMEOUT=5e3,re.DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT=2e3,re._nativeHttpClient=null;var ne=function(){function e(){this._protocol=null,this._server=null,this._httpReq=null,this._appName=null,this._serverUrl=null}return e.prototype.Init=function(e){this._executionProps=e},e.prototype.ShouldDisplayGenericError=function(){return this._executionProps.DisplayGenericError},e.prototype.setUsername=function(e){this._executionProps[E.MG_TAG_USERNAME]=e},e.prototype.setPassword=function(e){this._executionProps[E.MG_TAG_PASSWORD]=e},e.prototype.setSkipAuthenticationDialog=function(e){this._executionProps[E.REQ_SKIP_AUTHENTICATION]=e.toString()},e.prototype.setGlobalParams=function(e){null!==e?this._executionProps[E.MG_TAG_GLOBALPARAMS]=e:delete this._executionProps[E.MG_TAG_GLOBALPARAMS]},e.prototype.getGlobalParams=function(){var e=this._executionProps[E.MG_TAG_GLOBALPARAMS];return void 0===e?null:e},e.prototype.getProtocol=function(){return null===this._protocol&&(this._protocol=this._executionProps.protocol),this._protocol},e.prototype.getServer=function(){return null===this._server&&(this._server=this._executionProps.server),this._server},e.prototype.getHttpReq=function(){if(null===this._httpReq&&(this._httpReq=this._executionProps.requester,null!==this._httpReq)){for(;this._httpReq.startsWith("/");)this._httpReq=this._httpReq.substr(1);for(;this._httpReq.endsWith("/");)this._httpReq=this._httpReq.substr(0,this._httpReq.length-1)}return this._httpReq},e.prototype.getAppName=function(){return null===this._appName&&(this._appName=this._executionProps.appname),this._appName},e.prototype.getInternalLogLevel=function(){return this._executionProps.InternalLogLevel},e.prototype.setInternalLogLevel=function(e){this._executionProps.InternalLogLevel=e},e.prototype.getInternalLogSync=function(){return this._executionProps.InternalLogSync},e.prototype.getUsername=function(){var e=this._executionProps[E.MG_TAG_USERNAME];return void 0===e?null:e},e.prototype.getPassword=function(){var e=this._executionProps[E.MG_TAG_PASSWORD];return void 0===e?null:e},e.prototype.getCtxGroup=function(){var e=this._executionProps[E.CTX_GROUP];return void 0===e?null:e},e.prototype.setCtxGroup=function(e){this._executionProps[E.CTX_GROUP]=e},e.prototype.getSkipAuthenticationDialog=function(){var e=this._executionProps[E.REQ_SKIP_AUTHENTICATION];return!t.NString.IsNullOrEmpty(e)&&e===(!0).toString()},e.prototype.GetFirstHttpRequestTimeout=function(){var e=this._executionProps.FirstHTTPRequestTimeout;return e>0?1e3*e:re.DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT},e.prototype.GetExecutionProperty=function(e){var t=this._executionProps[e];return void 0===t?null:t},e.prototype.getServerURL=function(){if(null===this._serverUrl){var t=e.Instance.getHttpReq();null!==t&&t.toLowerCase().startsWith("http")?this._serverUrl=t:this._serverUrl=e.Instance.getProtocol()+"://"+e.Instance.getServer()+"/"+e.Instance.getHttpReq()}return this._serverUrl},e.prototype.IsLogonRTL=function(){var t=e.Instance.GetExecutionProperty[n.GuiConstants.STR_LOGON_RTL];return null!=t&&"Y"===t},e}();ne.Instance=new ne;var ae=function(e){function n(t,r){var n=e.call(this,t)||this;return n._code=0,1===arguments.length||a.isNullOrUndefined(r)||("number"==typeof r?n._code=r:n.InnerException=r,n.errorLevel=3),n}return u(n,e),n.prototype.GetCode=function(){return this._code},n.prototype.GetMessage=function(){var e;if(ne.Instance.ShouldDisplayGenericError()&&this.GetCode()>0){var n=o.languageData.getConstMessage(r.MsgInterface.STR_GENERIC_ERROR_MESSAGE);n=r.StrUtil.replaceStringTokens(n,"%d",1,"{0}"),e=t.NString.Format(n,this.GetCode())}else e=this.Message;return e},n}(t.ApplicationException);ae.INF_NO_RESULT=-11,ae.ERR_CTX_NOT_FOUND=-197,ae.ERR_AUTHENTICATION=-157,ae.ERR_ACCESS_DENIED=-133,ae.ERR_LIMITED_LICENSE_CS=-136,ae.ERR_UNSYNCHRONIZED_METADATA=-271,ae.ERR_CANNOT_EXECUTE_OFFLINE_RC_IN_ONLINE_MODE=-272,ae.ERR_INCOMPATIBLE_CLIENT=-275,ae.ERR_WEBCLIENT_PROGRAM_RELOADED=-278,ae.ERR_EXECUTED_PROGRAM_CHANGED=-283,ae.ERR_THREAD_ABORTED=-138;var se=function(){function e(){}return e.ASCIIGetString=function(e){return t.Encoding.ASCII.GetString(e,0,e.length)},e.IntToHexCharCode=function(e){return e<=9?e+48:e-10+97},e.IsSafe=function(e){if(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9")return!0;switch(e){case"'":case"(":case")":case"*":case"-":case".":case"_":case"!":return!0}return!1},e.UrlEncode=function(n,a){var s=null;return null!==n&&(s=e.ASCIIGetString(e.UrlEncodeToBytes(n,a)),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("\n String: {0} \n UrlEncoded by: {1} \n To: {2}",n,a,s))),s},e.UrlEncodeToBytes=function(t,r){if(null===t)return null;var n=r.GetBytes(t);return e.UrlEncodeBytesToBytesInternal(n,0,n.length)},e.UrlEncodeBytesToBytesInternal=function(t,r,n){if(!e.EncodingEnabled)return t;for(var a=0,s=0,i=0;i<n;i++){" "===(_=String.fromCharCode(t[r+i]))?a=a++:e.IsSafe(_)||(s+=1)}if(0===a&&0===s)return t;for(var o=new Uint8Array(n+2*s),l=0,u=0;u<n;u++){var c=t[r+u],_=String.fromCharCode(c);e.IsSafe(_)?o[l++]=c:" "===_?o[l++]=43:(o[l++]=37,o[l++]=e.IntToHexCharCode(c>>4&15),o[l++]=e.IntToHexCharCode(15&c))}return o},e}();se.EncodingEnabled=!0;var ie,oe=function(){function a(){this._mgDataTab=new t.List,this._iteratorMgdIdx=0,this._iteratorTaskIdx=0,this.currMgdID=0,this.StartupMgData=null,this._lastRouteSentToServer=""}return a.prototype.GetTaskByID=function(e){for(var t=null,r=0;r<this.getSize()&&null==t;r++){var n=this.getMGData(r);null!=n&&(t=n.getTask(e))}return t},Object.defineProperty(a,"Instance",{get:function(){return null==a._instance&&null==a._instance&&(a._instance=new a),a._instance},enumerable:!1,configurable:!0}),a.prototype.addMGData=function(e,r,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:if(r<0||r>this.getSize())throw new t.ApplicationException("Illegal MGData requested");return n&&(this.StartupMgData=e),r!==this.getSize()?[3,1]:(this._mgDataTab.push(e),[3,4]);case 1:return null==(a=this.getMGData(r))||a.IsAborting?[3,3]:[4,a.getFirstTask().stop()];case 2:s.sent(),a.abort(),s.label=3;case 3:this._mgDataTab.set_Item(r,e),s.label=4;case 4:return[2]}}))}))},a.prototype.getMGData=function(e){var t=null;return e>=0&&e<this.getSize()&&(t=this._mgDataTab.get_Item(e)),t},a.prototype.getAvailableIdx=function(){var e;for(e=0;e<this._mgDataTab.length&&null!==this._mgDataTab.get_Item(e);e+=1);return e},a.prototype.getMgDataIdx=function(e){return this._mgDataTab.indexOf(e)},a.prototype.deleteMGDataTree=function(e){var r,n,a;if(e<0||e>=this.getSize())throw new t.ApplicationException("in deleteMGData() illegal index: "+e);if(null!=(r=this.getMGData(e)))for(e>0&&null!=r.getParentMGdata()&&this._mgDataTab.set_Item(e,null),G.Instance.clean(e),a=0;a<this.getSize();a++)null!=(n=this.getMGData(a))&&n.getParentMGdata()===r&&this.deleteMGDataTree(a)},a.prototype.getCurrMGData=function(){return this.getMGData(this.currMgdID)},a.prototype.GetMainProgByCtlIdx=function(e,t){return 2===arguments.length?this.GetMainProgByCtlIdx_0(e,t):this.GetMainProgByCtlIdx_1(e)},a.prototype.GetMainProgByCtlIdx_0=function(e,t){for(var r=null,n=0;n<this.getSize()&&null==r;n++){var a=this.getMGData(n);null!=a&&(r=a.getMainProg(t))}return r},a.prototype.GetMainProgByCtlIdx_1=function(e){return this.GetMainProgByCtlIdx(-1,e)},a.prototype.startTasksIteration=function(){this._iteratorMgdIdx=0,this._iteratorTaskIdx=0},a.prototype.getNextTask=function(){var e,t=this.getMGData(this._iteratorMgdIdx);if(null==t)return null;if(null==(e=t.getTask(this._iteratorTaskIdx))){do{this._iteratorMgdIdx++}while(this._iteratorMgdIdx<this.getSize()&&null==this.getMGData(this._iteratorMgdIdx));return this._iteratorTaskIdx=0,this.getNextTask()}return this._iteratorTaskIdx++,e},a.prototype.buildXML=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i;return h(this,(function(o){switch(o.label){case 0:(a=n.Commands.getLastRoute())!==this._lastRouteSentToServer&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_LAST_ROUTE),e.Append(" "+E.MG_ATTR_ENV_VALUE+'="'+a+'"'),e.Append(r.XMLConstants.TAG_TERM),this._lastRouteSentToServer=a),s=0,o.label=1;case 1:return s<this.getSize()?null===(i=this.getMGData(s))||i.IsAborting?[3,3]:[4,i.buildXML(e,t)]:[3,4];case 2:o.sent(),o.label=3;case 3:return s+=1,[3,1];case 4:return U.Instance.buildXML(e),[2]}}))}))},a.prototype.RemoveServerCommands=function(){for(var e=0;e<this.getSize();e+=1){var t=this.getMGData(e);null!==t&&t.CmdsToServer.clear()}},a.prototype.getSize=function(){return this._mgDataTab.length},a.prototype.processRecovery=function(){return T(this,void 0,void 0,(function(){var e,t,r,n;return h(this,(function(a){switch(a.label){case 0:e=0,a.label=1;case 1:if(!(e<this.getSize()))return[3,6];if(null===(t=this.getMGData(e)))return[3,5];r=0,a.label=2;case 2:return r<t.getTasksCount()?null===(n=t.getTask(r))?[3,4]:[4,n.DataView.processRecovery()]:[3,5];case 3:a.sent(),a.label=4;case 4:return r+=1,[3,2];case 5:return e+=1,[3,1];case 6:return[2]}}))}))},a.prototype.getTriggeredTasks=function(e){var r,n=new t.List,a=e.getTaskTag();for(this.startTasksIteration();null!==(r=this.getNextTask());)a===r.PreviouslyActiveTaskId&&n.push(r);return n},a.prototype.GetTasks=function(e){var r=new t.List;return this._mgDataTab.forEach((function(t){if(null!==t&&!t.IsAborting)for(var n=0;n<t.getTasksCount();n+=1){var a=t.getTask(n);null!==a&&e(a)&&r.push(a)}})),r},a.prototype.getTaskIdById=function(e){var t=this.GetTaskByID(e),r=e;return null!=t&&(r=t.getTaskTag()),r},a.prototype.GetTopMostForms=function(){var e,r=new t.List;for(this.startTasksIteration();null!=(e=this.getNextTask());){var n=e.getForm();e.isAborting()||null==n||n.isSubForm()||r.push(n)}return r},a.prototype.GetMGDataForStartupProgram=function(){t.Debug.Assert(this._mgDataTab.length>0,"The main program must be processed before invoking this method.");var e=this.GetMainProgByCtlIdx(0);return t.Debug.Assert(null!==e,"The main program must be processed before invoking this method."),t.Debug.Assert(0===e.getMgdID(),"Main program is expected to be on MGData 0. Is this an error?"),this._mgDataTab.get_Item(0)},a.prototype.execRequestWithSubformRecordCycle=function(t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(s){switch(s.label){case 0:return this.cleanDoSubformPrefixSuffix(),t.Add(r),a.Instance.StartupMgData.getFirstTask().InEndTask&&a.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,2]:[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.NORMAL,n)];case 1:s.sent(),s.label=2;case 2:return[4,this.execAllSubformRecordCycle()];case 3:return s.sent(),[2]}}))}))},a.prototype.cleanDoSubformPrefixSuffix=function(){for(var e=0;e<this.getSize();e++){var t=this.getMGData(e);if(null!==t&&!t.IsAborting)for(var r=t.getTasksCount(),n=0;n<r;n++){t.getTask(n).DoSubformPrefixSuffix=!1}}},a.prototype.execAllSubformRecordCycle=function(){return T(this,void 0,void 0,(function(){var e,t,n,a,s;return h(this,(function(i){switch(i.label){case 0:e=0,i.label=1;case 1:if(!(e<this.getSize()))return[3,8];if(null===(t=this.getMGData(e))||t.IsAborting)return[3,7];n=t.getTasksCount(),a=0,i.label=2;case 2:return a<n?(s=t.getTask(a)).IsSubForm&&s.DoSubformPrefixSuffix?(s.PerformParentRecordPrefix=!1,o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(s,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]):[3,6]:[3,7];case 3:return i.sent(),o.eventsManager.GetStopExecutionFlag()?[3,5]:[4,o.eventsManager.handleInternalEventWithTask(s,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 4:i.sent(),i.label=5;case 5:o.eventsManager.popNewExecStacks(),s.PerformParentRecordPrefix=!0,i.label=6;case 6:return a+=1,[3,2];case 7:return e+=1,[3,1];case 8:return[2]}}))}))},a}();oe._instance=null,function(e){e[e.Handled=0]="Handled",e[e.Retry=1]="Retry",e[e.Abort=2]="Abort"}(ie||(ie={}));var le=function(s){function l(){var e=s.call(this)||this;return e._lastRequestTime=0,e.ServerUrl=null,e.DelayCommandExecution=!1,e._requestInfo=new r.RequestInfo,e.ServerUrl=ne.Instance.getServerURL(),re.GetInstance(),e.RegisterDelegates(),e}return u(l,s),l.GetInstance=function(){return null===l._instance&&(l._instance=new l),l._instance},l.prototype.CheckAndSetSessionCounter=function(e){e===E.SESSION_COUNTER_CLOSE_CTX_INDICATION?t.Debug.Assert(this.GetSessionCounter()===E.SESSION_COUNTER_CLOSE_CTX_INDICATION):(t.Debug.Assert(e===this.GetSessionCounter()+1),this.SetSessionCounter(e),r.Logger.Instance.WriteServerToLog(t.NString.Format("Session Counter --\x3e {0}",this._sessionCounter)))},l.prototype.ClearSessionCounter=function(){this._sessionCounter=0,r.Logger.Instance.WriteServerToLog(t.NString.Format("Session Counter --\x3e {0}",this._sessionCounter))},l.prototype.SetSessionCounter=function(e){this._sessionCounter=e},Object.defineProperty(l.prototype,"GetLastRequestTime",{get:function(){return this._lastRequestTime},enumerable:!1,configurable:!0}),l.prototype.ReStartSession=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:return l.IsSessionReInitializing=!0,[4,this.StoreSessionReInitializingDataOnLocalStorage()];case 1:throw r.sent(),e=!1,n.RuntimeContextBase.Instance.RemovedContextFromServer||(e=!!et.Instance.getSpecialRouteToRootProgOnContextRecreation()),n.Commands.addRefreshPage(e,l.InitialUrl),new t.Exception("")}}))}))},l.prototype.StoreSessionReInitializingDataOnLocalStorage=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(a){switch(a.label){case 0:return[4,this.BuildXMLForMainProgramDataView()];case 1:return e=a.sent(),t=o.globalParams.mirrorAllToXML(),(r=window.localStorage).setItem(E.IS_SESSION_REINITIALIZING,"true"),r.setItem(E.MAIN_PROG_VIEW,e.toString()),r.setItem(E.GLOBAL_PARAM_LIST,t),r.setItem(E.LAST_EXCEPTION,l.lastExceptionMessage),n.RuntimeContextBase.Instance.RemovedContextFromServer&&r.setItem(E.CTX_REMOVED_FROM_SRVR,"1"),kr.Instance.storeLastSavedRouteEventOnLocalStorage(),[2]}}))}))},l.prototype.RestoreSessionReInitializingDataFromLocalStorage=function(e){return window.localStorage.getItem(e)},l.prototype.StartSession=function(){return T(this,void 0,void 0,(function(){var s,i,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N;return h(this,(function(h){switch(h.label){case 0:s=!1,i=null,u=null,h.label=1;case 1:h.trys.push([1,17,,18]),c=null,(_=new t.StringBuilder).Append(E.UTF8TRANS+E.REQ_APP_NAME+"="+se.UrlEncode(ne.Instance.getAppName(),t.Encoding.UTF8)),_.Append("&"+E.REQ_ARGS+"="+E.REQ_ARG_ALPHA+'<Richclient><Requires EncryptionKey="False"/><RIAProtocolVersion="'+l.WEB_COMMUNICATION_PROTOCOL_VERSION+'"/></Richclient>'),r.Logger.Instance.WriteDevToLog(t.NString.Format("Handshake request #1 (not scrambled) : {0}",this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION_INITIAL+_)),T=this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION_INITIAL+E.RC_TOKEN_DATA+se.UrlEncode(j.Scramble(_.ToString()),t.Encoding.UTF8),r.Logger.Instance.WriteServerMessagesToLog(""),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #1: {0}",T)),p=ne.Instance.getCtxGroup(),h.label=2;case 2:return s?[3,14]:(g=new t.RefParam(ie.Handled),[4,this.DispatchRequest(T,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,g)]);case 3:if(d=h.sent(),t.NString.IsNullOrEmpty(d))throw new ae("Client failed to initialize a session."+r.OSEnvironment.EolSeq+"Empty response was received from the web server."+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq+this.ServerUrl);return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake response #1: {0}",d)),r.Logger.Instance.WriteServerMessagesToLog(""),i=new ue(d),n.RuntimeContextBase.Instance.ContextID=i.ContextId,this.SessionId=i.GetSessionId,re.GetInstance().HttpCommunicationTimeoutMS=1e3*i.HttpTimeout,t.NString.IsNullOrEmpty(ne.Instance.getCtxGroup())&&(p=i.ContextId),I=null,ne.Instance.getSkipAuthenticationDialog()?(null!==ne.Instance.getUsername()&&(I=new n.UsernamePasswordCredentials(ne.Instance.getUsername(),ne.Instance.getPassword()),ne.Instance.setUsername(""),ne.Instance.setPassword("")),[3,6]):[3,4];case 4:return i.InputPassword&&i.SystemLogin!==ue.SYSTEM_LOGIN_AD?null===c?[3,6]:(f=o.languageData.getConstMessage(r.MsgInterface.BRKTAB_STR_ERROR),C=o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW),[4,ge.Instance.MessageBox(f,C,n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)]):[3,6];case 5:h.sent(),h.label=6;case 6:s&&this.SetSessionCounter(E.SESSION_COUNTER_CLOSE_CTX_INDICATION),A=this.PrepareAuthenticationUrl(i.ContextId,p,this.GetSessionCounter()),h.label=7;case 7:return h.trys.push([7,12,,13]),null===I?[3,9]:(R=I.Username+":",t.NString.IsNullOrEmpty(I.Password)||(R=R+I.Password+":"),R+=i.ContextId,R=j.Scramble(R),R=r.Base64.encode(R,!0,t.Encoding.UTF8),A+="&USERNAME="+se.UrlEncode(R,t.Encoding.UTF8),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #2: {0}",A)),S=new t.RefParam(ie.Handled),[4,this.DispatchRequest(A,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,S)]);case 8:if(-1===(d=h.sent()).indexOf(i.ContextId))throw new ae(o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW));return ne.Instance.setUsername(I.Username),ne.Instance.setPassword(I.Password),[3,11];case 9:return M=new t.RefParam(ie.Handled),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #2: {0}",A)),[4,this.DispatchRequest(A,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,M)];case 10:d=h.sent(),h.label=11;case 11:return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake response #2: {0}",d)),r.Logger.Instance.WriteServerMessagesToLog(""),[3,14];case 12:if(!((m=h.sent())instanceof ae))throw m;if(v=m,ne.Instance.getSkipAuthenticationDialog())switch(v.GetCode()){case ae.ERR_ACCESS_DENIED:case ae.ERR_AUTHENTICATION:throw ne.Instance.setSkipAuthenticationDialog(!1),v}if(!i.InputPassword)throw v;if(v.GetCode()!==ae.ERR_AUTHENTICATION&&(!s||v.GetCode()!==ae.INF_NO_RESULT))throw v;return[3,13];case 13:return[3,2];case 14:return ne.Instance.setSkipAuthenticationDialog(!0),ne.Instance.setCtxGroup(p),null!==u&&u.closeDialog(),l.ShouldScrambleAndUnscrambleMessages=i.ScrambleMessages,r.Logger.Instance.LogLevel!==r.Logger_LogLevels.Basic&&null!==(L=i.MaxInternalLogLevel)&&(b=this.parseLogLevel(L))<r.Logger.Instance.LogLevel&&(ne.Instance.setInternalLogLevel(L),r.Logger.Instance.WriteToLog(t.NString.Format("Internal log level was restricted to '{0}' by the Magic xpa server.",L),!1),r.Logger.Instance.LogLevel=b),s?[3,16]:[4,this.ExecuteInitialRequest()];case 15:h.sent(),h.label=16;case 16:return[3,18];case 17:if((N=h.sent())instanceof ae)throw N;throw a.isNullOrUndefined(N.InnerException)?new ae(N.message,new t.Exception(N)):new ae(N.message,N.InnerException);case 18:return[2,!s]}}))}))},l.prototype.PrepareAuthenticationUrl=function(e,t,r){var n=this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION+E.UTF8TRANS+E.RC_TOKEN_CTX_ID+e;return a.isNullOrUndefined(this.SessionId)||(n+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_ID+this.SessionId),n+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_COUNT+r+E.REQ_ARG_SEPARATOR+E.RC_TOKEN_CTX_GROUP+t+E.REQ_ARG_SEPARATOR+E.RC_AUTHENTICATION_REQUEST},l.prototype.ExecuteInitialRequest=function(){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.Execute_1(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.INITIAL,null)];case 1:return t.sent(),[2]}}))}))},l.prototype.GetTaskTree=function(e){for(var r=new t.List;!a.isNullOrUndefined(e);)r.push(e.getTaskInfo()),e=e.getParent();return r},l.prototype.UpdateRequestInfo=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i,l,u,c,_,T;return h(this,(function(h){for(e=o.mgDataTable.getCurrMGData(),r=o.eventsManager,a=!1,s=e.CmdsToServer,i=0;i<s.getSize();i++)if(s.getCmd(i)instanceof q){l=e.CmdsToServer.getCmd(i),this._requestInfo.serverCallAt=l.getCommandInfo(),this._requestInfo.runtimeTaskTree=this.GetTaskTree(l.getTask()),a=!0;break}return this._requestInfo.extraInfo.contextID=n.RuntimeContextBase.Instance.ContextID,this._requestInfo.extraInfo.sessionCounter=this.GetSessionCounter(),a||null!=r.getLastRtEvent()&&0!=r.getLastRtEvent().InternalEvent&&(u=r.getLastRtEvent(),this._requestInfo.runtimeTaskTree=this.GetTaskTree(u.getTask()),c=u.isNewInternalEvent()?t.NString.TrimEnd(u.getNewInternalEventDescription()):k.getInternalEvtDescription(u.InternalEvent),(_=s.getCmd(s.getSize()-1))&&(T=t.NString.IsNullOrEmpty(_.getCommandInfo())?t.NString.Empty:_.getCommandInfo(),_ instanceof R&&u.InternalEvent==_.MagicEvent&&(c=t.NString.Empty),this._requestInfo.serverCallAt="Event "+T+(t.NString.IsNullOrEmpty(c)?t.NString.Empty:t.NString.Format(" while executing [{0}]",c)))),[2]}))}))},l.prototype.BuildXMLForMainProgramDataView=function(){return T(this,void 0,void 0,(function(){var e,n,a,s;return h(this,(function(i){switch(i.label){case 0:e=new t.StringBuilder,n=oe.Instance.getMGData(0),a=n.getMainProg(0),i.label=1;case 1:return null==a?[3,3]:[4,a.buildXML(e)];case 2:return i.sent(),a=n.getNextMainProg(a.getCtlIdx()),[3,1];case 3:return l.ShouldScrambleAndUnscrambleMessages&&(s=j.Scramble(e.ToString()),e=new t.StringBuilder(s)),e.Insert(0,r.XMLConstants.MG_TAG_OPEN),e.Append(r.XMLConstants.MG_TAG_XML_END_TAGGED),[2,e.ToString()]}}))}))},l.prototype.Execute_1=function(a,s,i){return T(this,void 0,void 0,(function(){var u,c,_,T,p,g,d,I,f,C,A;return h(this,(function(h){switch(h.label){case 0:return c=s===e.CommandsProcessorBase_SessionStage.INITIAL,_=null,this.DelayCommandExecution?[2]:r.Logger.Instance.LogLevel!=r.Logger_LogLevels.RequestInfo||c?[3,2]:[4,this.UpdateRequestInfo()];case 1:h.sent(),h.label=2;case 2:return c&&"true"===(T=this.RestoreSessionReInitializingDataFromLocalStorage(E.IS_SESSION_REINITIALIZING))&&(l.IsSessionReInitializing="true"===T,l.lastExceptionMessage=this.RestoreSessionReInitializingDataFromLocalStorage(E.LAST_EXCEPTION),"1"!==this.RestoreSessionReInitializingDataFromLocalStorage(E.CTX_REMOVED_FROM_SRVR)&&(r.Logger.Instance.WriteErrorToLog(l.lastExceptionMessage),r.Logger.Instance.WriteToLog("Session is reinitializing...",!0))),a!==e.CommandsProcessorBase_SendingInstruction.NO_TASKS_OR_COMMANDS?[3,3]:(u=null,[3,5]);case 3:return[4,this.PrepareRequest(a===e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 4:u=h.sent(),!l.IsSessionReInitializing&&c||(p=new t.StringBuilder,g=new t.StringBuilder,l.IsSessionReInitializing||g.Append(u),_=l.IsSessionReInitializing?this.RestoreSessionReInitializingDataFromLocalStorage(E.GLOBAL_PARAM_LIST):o.globalParams.mirrorToXML(),p.Append(_),p.Append(o.envParamsTable.mirrorToXML()),p.Length>0&&(p.Insert(0,"<"+E.MG_TAG_ENV_CHANGES+">"),p.Append("</"+E.MG_TAG_ENV_CHANGES+">"),l.ShouldScrambleAndUnscrambleMessages&&(d=j.Scramble(p.ToString()),p=new t.StringBuilder(d)),p.Insert(0,r.XMLConstants.MG_TAG_OPEN),p.Append(r.XMLConstants.MG_TAG_XML_END_TAGGED),g.Append(p.ToString())),u=g.ToString()),h.label=5;case 5:return I=new t.RefParam(ie.Handled),f=null,l.IsSessionReInitializing&&(u+=this.RestoreSessionReInitializingDataFromLocalStorage(E.MAIN_PROG_VIEW)),n.RuntimeContextBase.Instance.RemovedContextFromServer?(I.value=ie.Retry,[3,8]):[3,6];case 6:return n.RuntimeContextBase.Instance.RemovingContextFromServer&&(n.RuntimeContextBase.Instance.RemovedContextFromServer=!0),[4,this.DispatchRequest(this.ServerUrl,u,s,I)];case 7:f=h.sent(),h.label=8;case 8:return I.value!=ie.Retry?[3,10]:[4,this.ReStartSession()];case 9:h.sent(),h.label=10;case 10:return null==f?[2]:(c&&(l.InitialUrl=window.location.href,l.IsSessionReInitializing&&((C=window.localStorage).removeItem(E.IS_SESSION_REINITIALIZING),C.removeItem(E.MAIN_PROG_VIEW),C.removeItem(E.GLOBAL_PARAM_LIST),C.removeItem(E.LAST_EXCEPTION))),U.Instance.enable(!1),[4,this.ProcessResponse(f,o.mgDataTable.currMgdID,null,i)]);case 11:if(h.sent(),l.IsSessionReInitializing&&(o.globalParams.RestoreGlobalParams(_),C=window.localStorage,"1"===C.getItem(E.CTX_REMOVED_FROM_SRVR)&&(kr.Instance.restoreLastSavedRouteEventFromLocalStorage(),C.removeItem(E.CTX_REMOVED_FROM_SRVR),C.removeItem(E.LAST_ROUTE_EVENT),C.removeItem(E.LAST_ROUTE_EVENT_SRC_TSK),C.removeItem(E.LAST_ROUTE_EVENT_ARG_LIST)),l.IsSessionReInitializing=!1),a!==e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)return[3,15];o.mgDataTable.startTasksIteration(),A=void 0,h.label=12;case 12:return null===(A=o.mgDataTable.getNextTask())?[3,15]:A.DataViewWasRetrieved?[4,A.RefreshDisplay()]:[3,14];case 13:h.sent(),h.label=14;case 14:return[3,12];case 15:return c&&ne.Instance.setGlobalParams(null),[2]}}))}))},l.prototype.DispatchRequest=function(a,s,i,o){return T(this,void 0,void 0,(function(){var u,c,_,T,p,g,d,E;return h(this,(function(h){switch(h.label){case 0:if(u=null,c=null,o.value=ie.Handled,null===a)return r.Logger.Instance.WriteExceptionToLogWithMsg("in sendMsgToSrvr() unknown server"),[2,u];i!==e.CommandsProcessorBase_SessionStage.HANDSHAKE&&(_=this.BuildUrlSuffix(null!==s,i===e.CommandsProcessorBase_SessionStage.INITIAL),T=se.UrlEncode(s,t.Encoding.UTF8),c=_+T),h.label=1;case 1:return h.trys.push([1,3,,11]),r.Logger.Instance.ShouldLogExtendedServerRelatedMessages()&&r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("MESSAGE TO SERVER:\n URL: {0}\n BODY: {1}",a,c)),[4,this.ExecuteRequest(a,c)];case 2:return(u=h.sent()).toUpperCase().startsWith("<HTML")||(p=u.indexOf('<xml id="MGDATA">'))>0&&(u=u.substr(p)),r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+u),(i===e.CommandsProcessorBase_SessionStage.HANDSHAKE||u.length>0&&l.ShouldScrambleAndUnscrambleMessages&&'<xml id="MGDATA">\n</xml>'!==u)&&(i===e.CommandsProcessorBase_SessionStage.HANDSHAKE&&t.Debug.Assert(u.length>0&&"<"!==u[0]),u=Q.UnScramble(u)),r.Logger.Instance.WriteDevToLog("MESSAGE FROM SERVER: (size = "+u.length+")"+r.OSEnvironment.EolSeq+u),this._lastRequestTime=r.Misc.getSystemMilliseconds(),[3,11];case 3:return(g=h.sent())instanceof ae?(o.value=ie.Abort,i!=e.CommandsProcessorBase_SessionStage.NORMAL||g.GetCode()!=ae.ERR_CTX_NOT_FOUND&&g.GetCode()!=ae.ERR_THREAD_ABORTED?[3,10]:n.RuntimeContextBase.Instance.RemovedContextFromServer?(o.value=ie.Retry,[3,9]):[3,4]):[3,10];case 4:switch(et.Instance.getWebClientReinitSession()){case"Y":return[3,5];case"A":return[3,6];case"N":return[3,8]}return[3,8];case 5:return o.value=ie.Retry,[3,9];case 6:return[4,ge.Instance.MessageBox("Error","Unknown error occurred at server-side. Would you like to reinitialize the session?",n.Styles.MSGBOX_BUTTON_YES_NO)];case 7:return d=h.sent(),o.value=d==n.Styles.MSGBOX_RESULT_YES?ie.Retry:ie.Abort,[3,9];case 8:return o.value=ie.Abort,[3,9];case 9:if(o.value==ie.Abort)throw et.Instance.setWebClientReinitSession("N"),g;return E=r.StrUtil.getConsoleErorString(g.GetMessage()),l.lastExceptionMessage="Exception Occured at server side : "+g.GetCode().toString()+" : "+E,console.log(l.lastExceptionMessage),[2,null];case 10:throw window.localStorage.clear(),g;case 11:return[2,u]}}))}))},l.prototype.HandleErrorResponse=function(e){try{r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+e),e=Q.UnScramble(e),r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+r.StrUtil.getConsoleErorString(e))}catch(e){}if(e.startsWith("<xmlerr")){var t=new ce(e,this._lastRequestTime,o.environment.getContextInactivityTimeout());throw new ae(t.GetMessage(),t.GetCode())}if(e.toUpperCase().startsWith("<HTML"))throw new ae(e)},l.prototype.ExecuteRequest=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.GetContent(e,!1,t)];case 1:return[2,r.sent()]}}))}))},l.prototype.GetContent=function(e,n,s){return T(this,void 0,void 0,(function(){var u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:a.isUndefined(s)&&(s=null),h.label=1;case 1:return h.trys.push([1,3,4,5]),e.startsWith("/")&&(e=ne.Instance.getProtocol()+"://"+ne.Instance.getServer()+e),c=i.timer(50,50),_=c.subscribe((function(e){o.eventsManager.CheckAndShowSpinner(!0)})),T=new t.RefParam(!1),l.requestNumber++,[4,re.GetInstance().GetContent(e,s,n,T)];case 2:return u=h.sent(),l.totalResponseDataLength+=l.totalResponseDataLength+(a.isNullOrUndefined(u)?0:u.length),_.unsubscribe(),_=null,T.value&&this.HandleErrorResponse(u),[3,5];case 3:throw(p=h.sent())instanceof ae&&r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic||r.Logger.Instance.WriteExceptionToLog(p,t.NString.Format('requested URL = "{0}"',e)),p instanceof ae||(p=new ae(p.Message,p.InnerException?p.InnerException:p)),p;case 4:return null!=_&&_.unsubscribe(),[7];case 5:return[2,u]}}))}))},l.prototype.ClientActivated=function(e){},l.prototype.BuildUrlSuffix=function(e,r){var s=E.RC_INDICATION+E.RC_TOKEN_CTX_ID+n.RuntimeContextBase.Instance.ContextID;if(a.isNullOrUndefined(this.SessionId)||(s+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_ID+this.SessionId),r){l.IsSessionReInitializing&&(s+=E.REQ_ARG_SEPARATOR+E.WEBCLIENT_REINITIALIZE_REQUEST);var i=ne.Instance.getGlobalParams();null!==i&&(i=t.NString.Replace(i,"+","%2B"),s+="&"+E.MG_TAG_GLOBALPARAMS+"="+i)}return e&&(s+="&"+E.RC_TOKEN_SESSION_COUNT+this.GetSessionCounter()+E.REQ_ARG_SEPARATOR+E.RC_TOKEN_DATA),s},l.prototype.SendMonitorOnly=function(){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:return r=U.Instance,null==o.mgDataTable||null==o.mgDataTable.getMGData(0)||o.mgDataTable.getMGData(0).IsAborting?[2]:r.isEmpty()?[3,4]:(n=this.BuildMonitorMessage(),!1,[3,1]);case 1:return s.trys.push([1,3,,4]),a=new t.RefParam(ie.Handled),[4,this.DispatchRequest(this.ServerUrl,n.ToString(),e.CommandsProcessorBase_SessionStage.NORMAL,a)];case 2:return s.sent(),[3,4];case 3:return s.sent(),[3,4];case 4:return[2]}}))}))},l.prototype.BuildMonitorMessage=function(){var e=new t.StringBuilder(1e3),n=U.Instance;if(l.ShouldScrambleAndUnscrambleMessages){n.buildXML(e);var a=j.Scramble(e.ToString());(e=new t.StringBuilder(1e3)).Append(r.XMLConstants.MG_TAG_OPEN+a)}else e.Append(r.XMLConstants.MG_TAG_OPEN),n.buildXML(e);return e.Append("</"+r.XMLConstants.MG_TAG_XML+r.XMLConstants.TAG_CLOSE),e},l.prototype.RegisterDelegates=function(){var e=this;Z.GetSessionCounter_Event=this.GetSessionCounter.bind(this),Z.CheckAndSetSessionCounter_Event=this.CheckAndSetSessionCounter.bind(this),Z.ComputeAndLogRequestInfo_Event=this.ComputeAndLogRequestInfo.bind(this),o.eventsManager.SpinnerStopped.subscribe((function(t){return e.ClientActivated(t)}))},l.prototype.ComputeAndLogRequestInfo=function(e,t,n){if(!a.isNullOrUndefined(this._requestInfo.serverCallAt)){this._requestInfo.extraInfo.contentLength=e,this._requestInfo.extraInfo.timeStamp=(new Date).toString();var s=n?"Response ⤵":"Request ⤵";n?(this._requestInfo.roundtripTime=t,l.totalTimeForHTTPRequests+=t):l.totalRequestDataLength+=e,r.Logger.Instance.WriteRequestInfoToLog(this._requestInfo,s),n&&this._requestInfo.clear()}},Object.defineProperty(l,"ShouldScrambleAndUnscrambleMessages",{get:function(){return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("ShouldScrambleAndUnscrambleMessages.Get: {0}",this._shouldScrambleAndUnscrambleMessages)),l._shouldScrambleAndUnscrambleMessages},set:function(e){l._shouldScrambleAndUnscrambleMessages=e,r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("ShouldScrambleAndUnscrambleMessages.Set: {0}",this._shouldScrambleAndUnscrambleMessages))},enumerable:!1,configurable:!0}),l.prototype.parseLogLevel=function(e){var n=r.Logger_LogLevels.None;return t.NString.IsNullOrEmpty(e)||(e.toUpperCase().startsWith("SERVER")?n=e.endsWith("#")?r.Logger_LogLevels.ServerMessages:r.Logger_LogLevels.Server:e.toUpperCase().startsWith("S")||e.toUpperCase().startsWith("Q")?n=r.Logger_LogLevels.Support:e.toUpperCase().startsWith("G")?n=r.Logger_LogLevels.Gui:e.toUpperCase().startsWith("D")?n=r.Logger_LogLevels.Development:e.toUpperCase().startsWith("B")?n=r.Logger_LogLevels.Basic:e.toUpperCase().startsWith("R")&&(n=r.Logger_LogLevels.RequestInfo)),n},l.prototype.PrepareRequest=function(e){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return(n=new t.StringBuilder).Append(r.XMLConstants.MG_TAG_OPEN),null===o.mgDataTable.getCurrMGData()?[3,2]:(a=new t.StringBuilder,[4,o.mgDataTable.buildXML(a,e)]);case 1:s.sent(),l.ShouldScrambleAndUnscrambleMessages?n.Append(j.Scramble(a.ToString())):n.Append(a.ToString()),s.label=2;case 2:return n.Append("</"+r.XMLConstants.MG_TAG_XML+r.XMLConstants.TAG_CLOSE),[2,n.ToString()]}}))}))},l.prototype.ProcessResponse=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,l;return h(this,(function(u){switch(u.label){case 0:return r.Logger.Instance.WriteDevToLog("<-- ProcessResponse started --\x3e"),null===a&&(a=new y),i=r.Misc.getSystemMilliseconds(),null===e||0===e.trim().length?[2]:(o.mgDataTable.currMgdID=t,n.RuntimeContextBase.Instance.Parser.push(),n.RuntimeContextBase.Instance.Parser.setXMLdata(e),n.RuntimeContextBase.Instance.Parser.setCurrIndex(0),[4,(l=o.mgDataTable.getCurrMGData()).fillData(a,n.RuntimeContextBase.Instance.Parser)]);case 1:return u.sent(),n.RuntimeContextBase.Instance.Parser.setXMLdata(null),n.RuntimeContextBase.Instance.Parser.pop(),r.Logger.Instance.WriteDevToLog("<-- ProcessResponse finished --\x3e ("+(r.Misc.getSystemMilliseconds()-i)+")"),[4,l.CmdsToClient.Execute(s)];case 2:return u.sent(),[4,this.ProcessRecovery()];case 3:return u.sent(),[2]}}))}))},l.prototype.ProcessRecovery=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return o.eventsManager.pushNewExecStacks(),[4,o.mgDataTable.processRecovery()];case 1:return e.sent(),o.eventsManager.popNewExecStacks(),[2]}}))}))},l}(Q);le.RC_NO_CONTEXT_ID="-1",le._instance=null,le.IsSessionReInitializing=!1,le.lastExceptionMessage=null,le.InitialUrl=null,le.requestNumber=0,le.totalTimeForHTTPRequests=0,le.totalRequestDataLength=0,le.totalResponseDataLength=0,le.WEB_COMMUNICATION_PROTOCOL_VERSION="14002",le._shouldScrambleAndUnscrambleMessages=!1;var ue=function(){function e(e){this._scrambleMessages=!0,this._contextId=null,this._privateSessionId=null,this._inputPassword=!1,this._httpTimeout=0,this._systemLogin=null,this._maxInternalLogLevel=null;try{r.JSON_Utils.JSONFromXML(e,this.FillFromJSON.bind(this))}catch(t){r.Logger.Instance.WriteExceptionToLog(t,e)}}return Object.defineProperty(e.prototype,"ScrambleMessages",{get:function(){return this._scrambleMessages},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ContextId",{get:function(){return this._contextId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"GetSessionId",{get:function(){return this._privateSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"InputPassword",{get:function(){return this._inputPassword},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HttpTimeout",{get:function(){return this._httpTimeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SystemLogin",{get:function(){return this._systemLogin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"MaxInternalLogLevel",{get:function(){return this._maxInternalLogLevel},enumerable:!1,configurable:!0}),e.prototype.FillFromJSON=function(e,r){if(null!=e)throw e;var n=r.Richclientresponse;for(var s in n)if(n.hasOwnProperty(s))switch(s){case"ContextID":this._contextId=n[s][0];break;case"SessionID":this._privateSessionId=n[s][0];break;case"Environment":var i=n.Environment[0].$;a.isNullOrUndefined(i.ScrambleMessages)||(t.Debug.Assert("N"===i.ScrambleMessages),this._scrambleMessages=!1),a.isNullOrUndefined(i.MaxInternalLogLevel)||(this._maxInternalLogLevel=i.MaxInternalLogLevel),a.isNullOrUndefined(i.InputPassword)||"y"!==i.InputPassword.toLocaleLowerCase()||(this._inputPassword=!0),a.isNullOrUndefined(i.SystemLogin)||(this._systemLogin=i.SystemLogin),a.isNullOrUndefined(i[E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT])||(this._httpTimeout=+i[E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT]),a.isNullOrUndefined(i.ForwardSlash)||(o.environment.ForwardSlashUsage=i.ForwardSlash)}},e}();ue.SYSTEM_LOGIN_AD="D";var ce=function(){function e(e,t,n){this._lastRequestTime=0,this._errorMessage=null,this._errorCode=0,this._middlewareAddress=null,this._parsingFailed=!1,this._lastRequestTime=t,this.contextInactivityTimeout=n;try{r.JSON_Utils.JSONFromXML(e,this.FillFromJSON.bind(this))}catch(e){r.Logger.Instance.WriteExceptionToLog(e),r.Misc.WriteStackTrace(e),this._parsingFailed=!0}}return e.prototype.FillFromJSON=function(e,n){if(null!=e)throw e;var a=n.xmlerr;for(var s in a)if(a.hasOwnProperty(s))switch(s){case"errmsg":this._errorMessage=a[s][0];break;case"errcode":this._errorCode=+a[s];break;case"server":this._middlewareAddress=a[s][0];break;case"appname":case"prgname":case"arguments":case"username":case"xmlerr":break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unknown element: '{0}'",s))}},e.prototype.GetCode=function(){return this._errorCode},e.prototype.GetMessage=function(){var e=new t.StringBuilder;if(this._parsingFailed)e.Append(o.languageData.getConstMessage(r.MsgInterface.RC_STR_F7_UNEXPECTED_ERR));else{switch(this._errorCode){case ae.ERR_CTX_NOT_FOUND:this.InactivityTimeoutExpired()?e.Append(t.NString.Format("{0} ({1} {2})",o.languageData.getConstMessage(r.MsgInterface.STR_ERR_SESSION_CLOSED_INACTIVITY),Math.floor(this.contextInactivityTimeout/600),o.languageData.getConstMessage(r.MsgInterface.STR_MINUTES))):e.Append(t.NString.Format("{0} ({1}).",o.languageData.getConstMessage(r.MsgInterface.STR_ERR_SESSION_CLOSED),this._errorCode));break;case ae.ERR_WEBCLIENT_PROGRAM_RELOADED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_WEBCLIENT_PROGRAM_RELOADED));break;case ae.ERR_EXECUTED_PROGRAM_CHANGED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_EXECUTED_PROGRAM_CHANGED));break;case ae.ERR_AUTHENTICATION:e.Append(o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW));break;case ae.ERR_ACCESS_DENIED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_AUTHORIZATION_FAILURE));break;default:e.Append(this._errorMessage)}e.Append(r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq),ne.Instance.ShouldDisplayGenericError()||(e.Append(o.languageData.getConstMessage(r.MsgInterface.BROWSER_OPT_INFO_SERVER_STR)+": "),e.Append(ne.Instance.getServer()),t.NString.IsNullOrEmpty(this._middlewareAddress)||(e.Append(" --\x3e "),e.Append(this._middlewareAddress)),e.Append(r.OSEnvironment.EolSeq)),e.Append(o.languageData.getConstMessage(r.MsgInterface.TASKRULE_STR_APPLICATION)+': "'),e.Append(ne.Instance.getAppName()),e.Append('" ("'),e.Append('")')}return e.ToString()},e.prototype.InactivityTimeoutExpired=function(){var e=!1;this.contextInactivityTimeout>0&&(e=r.Misc.getSystemMilliseconds()-this._lastRequestTime>100*this.contextInactivityTimeout);return e},e}(),_e=function(){function e(){this.ShouldRetryLastRequest=!1}return Object.defineProperty(e.prototype,"ShowCommunicationErrors",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.CommunicationFailed=function(e,t){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return"",a=e.split("?")[0]+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq+t.message+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq,s=this,[4,ge.Instance.MessageBox("",a+"Do you wish to retry connecting?",n.Styles.MSGBOX_BUTTON_YES_NO)];case 1:return s.ShouldRetryLastRequest=i.sent()===n.Styles.MSGBOX_RESULT_YES,[2]}}))}))},e}(),Te=function(){function e(){}return e.GetCommandsProcessor=function(){return le.GetInstance()},e.GetContent=function(t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,e.GetCommandsProcessor().GetContent(t,r)];case 1:return[2,n.sent()]}}))}))},e.StartSession=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(n){switch(n.label){case 0:e=!1,n.label=1;case 1:return n.trys.push([1,3,,4]),re.GetInstance().SetCommunicationsFailureHandler(new _e),[4,le.GetInstance().StartSession()];case 2:return e=n.sent(),[3,4];case 3:throw t=n.sent(),r.Logger.Instance.WriteServerToLog("Failed connecting to the server: "+r.StrUtil.getConsoleErorString(t.Message)),t;case 4:return[2,e]}}))}))},e}(),he="</ErrorCodes>",pe=function(){function e(){this._constMessages=null,this._constMessagesContent=null,this._constMessagesUrl=null,this._mlsContent=null,this._mlsFileUrl=null,this._mlsStrings=null}return e.prototype.fillData=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:for(;this.initInnerObjects(e,e.getNextTag()););return[4,this.InitConstMessagesTable()];case 1:return t.sent(),[4,this.fillMlsMessagesTable()];case 2:return t.sent(),[2]}}))}))},e.prototype.initInnerObjects=function(e,n){if(null==n)return!1;switch(n){case E.MG_TAG_LANGUAGE:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_CONSTMESSAGES:var a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),this._constMessagesUrl=e.getXMLsubstring(a),e.setCurrIndex(a);break;case E.MG_TAG_CONSTMESSAGESCONTENT:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(E.MG_TAG_CONSTMESSAGESCONTENT,e.getCurrIndex())-2,this._constMessagesContent=e.getXMLsubstring(a),e.setCurrIndex(a);break;case E.MG_TAG_MLS_CONTENT:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(E.MG_TAG_MLS_CONTENT,e.getCurrIndex())-2,this._mlsContent=e.getXMLsubstring(a),e.setCurrIndex(a),t.NString.IsNullOrEmpty(this._mlsContent)||null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null),t.NString.IsNullOrEmpty(this._mlsContent)&&null!=this._mlsContent&&(this._mlsContent=null,null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null));break;case E.MG_TAG_MLS_FILE_URL:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),this._mlsFileUrl=e.getXMLsubstring(a).trim(),t.NString.IsNullOrEmpty(this._mlsFileUrl)?t.NString.IsNullOrEmpty(this._mlsFileUrl)&&null!=this._mlsFileUrl&&(this._mlsFileUrl=null,null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null)):null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null),e.setCurrIndex(a);break;case E.MG_TAG_CONSTMESSAGES_END:case E.MG_TAG_MLS_FILE_URL_END:case E.MG_TAG_CONSTMESSAGESCONTENT_END:case E.MG_TAG_MLS_CONTENT_END:e.setCurrIndex2EndOfTag();break;case E.MG_TAG_LANGUAGE_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LanguageData.initInnerObjects(): "+n),!1}return!0},e.prototype.getConstMessage=function(e){if(null===this._constMessages){this._constMessages=new t.Hashtable;for(var n=0;n<=r.MsgInterface.DefaultMessages.length-1;n+=1)this._constMessages.set_Item(r.MsgInterface.DefaultMessages[n].MsgID,r.MsgInterface.DefaultMessages[n].MsgString)}return this._constMessages.get_Item(e)},e.prototype.InitConstMessagesTable=function(){return T(this,void 0,void 0,(function(){var e,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:if(o.trys.push([0,9,,10]),e=null,null==this._constMessagesUrl&&null==this._constMessagesContent)return[3,7];if(null==this._constMessagesUrl)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Te.GetContent(this._constMessagesUrl,!0)];case 2:return e=o.sent(),[3,4];case 3:return o.sent(),r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format('Unknown message file: "{0}"',this._constMessagesUrl)),[3,4];case 4:return[3,6];case 5:e=this._constMessagesContent,o.label=6;case 6:return null!=e&&(n=e.indexOf("<ErrorCodes>"),a=e.indexOf(he)+he.length,s=e.substr(n,a-n),this.fillConstMessagesTable(s)),[3,8];case 7:r.Logger.Instance.WriteDevToLog("'constMessagesUrl' and 'constMessagesContent' were not initialized."),o.label=8;case 8:return[3,10];case 9:return i=o.sent(),r.Logger.Instance.WriteExceptionToLog(i),[3,10];case 10:return[2]}}))}))},e.prototype.fillConstMessagesTable=function(e){try{null!==e&&(this._constMessages=new t.Hashtable,r.JSON_Utils.JSONFromXML(e,this.FillConstMessagesFromJSON.bind(this)))}catch(e){r.Logger.Instance.WriteExceptionToLog(e)}},e.prototype.FillConstMessagesFromJSON=function(e,t){if(null!=e)throw e;for(var r=t.ErrorCodes.ErrorMessage,n=0;n<r.length;n++){var s=r[n].$.id,i=r[n]._;this._constMessages.set_Item(s,a.isUndefined(i)?"":i.trim())}},e.prototype.translate=function(e){var t=null;if(null==this._mlsStrings)return e;try{null==(t=this._mlsStrings.get_Item(e))&&(t=e)}catch(e){console.log(e)}return t},e.prototype.fillMlsMessagesTable=function(){return T(this,void 0,void 0,(function(){var e,n,a,s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:if(h.trys.push([0,4,,5]),null==this._mlsContent)return[3,1];if(this._mlsContent.length>0)for(s=this._mlsContent.length,o=0,l=this._mlsContent+3,this._mlsStrings=new t.Hashtable,i=this._mlsContent.substring(this._mlsContent.length-10,8),o=parseInt(i.toString(),16),c=r.StrUtil.tokenize(l.toString(),"\n"),e=0;e<2*o;e+=2)null==this._mlsStrings.get_Item(c[e].toString())&&this._mlsStrings.set_Item(c[e].toString(),c[e+1].toString());return[3,3];case 1:return null==this._mlsFileUrl?[3,3]:[4,Te.GetContent(this._mlsFileUrl,!0)];case 2:if(n=h.sent(),null!=(a=n)&&a.length>0)for(s=a.length,this._mlsStrings=new t.Hashtable,i=a.substr(s-10,8),o=parseInt(i,16),l=void 0,u=void 0,c=r.StrUtil.tokenize(a.toString(),"\n"),_=0;_<2*o;_+=2)l=c[_].substr(0,c[_].length-1),u=c[_+1].substr(0,c[_+1].length-1),null==this._mlsStrings.get_Item(l)&&this._mlsStrings.set_Item(l,u);h.label=3;case 3:return[3,5];case 4:return T=h.sent(),r.Logger.Instance.WriteExceptionToLog(T),r.Misc.WriteStackTrace(T),[3,5];case 5:return[2]}}))}))},e}();pe.Instance=new pe;var ge=function(){function e(){}return Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.execGuiCommandQueue=function(){n.Commands.beginInvoke()},e.prototype.startTimer=function(e,t,r){t>0&&(new K(e,1e3*t,r).Start(),n.Commands.beginInvoke())},e.prototype.stopTimer=function(e,t,r){t>0&&K.StopTimer(e,1e3*t,r)},e.prototype.abort=function(e){1===arguments.length?this.abort_0(e):this.abort_1()},e.prototype.abort_0=function(e){if(null!==e){var t=o.mgDataTable.GetMainProgByCtlIdx(-1,e.getTask().getCtlIdx());n.Manager.Abort(e,t)}},e.prototype.abort_1=function(){for(var e=o.mgDataTable.getSize();e>0;e--){var t=o.mgDataTable.getMGData(e-1).getFirstTask();null!==t&&this.abort(t.Form)}},e.prototype.MessageBox=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(a){switch(a.label){case 0:return[4,o.eventsManager.CheckAndShowSpinner(!1)];case 1:return a.sent(),[4,n.Commands.messageBox(e,t,r)];case 2:return[2,a.sent()]}}))}))},e.prototype.writeToMessageBox=function(e,t,r){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return n=pe.Instance.getConstMessage(e),a=pe.Instance.getConstMessage(t),[4,this.MessageBox(n,a,r)];case 1:return[2,s.sent()]}}))}))},e.prototype.confirm=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.writeToMessageBox(r.MsgInterface.CONFIRM_STR_WINDOW_TITLE,e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.confirm_bool=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.confirm(e,n.Styles.MSGBOX_BUTTON_OK_CANCEL)];case 1:return[2,t.sent()==n.Styles.MSGBOX_RESULT_OK]}}))}))},e}();ge._instance=null;var de=function(){function e(e){this._expressionEvaluator=null,this._expressionEvaluator=e}return e.prototype.eval_op_han=function(n){for(var a,s=new t.StringBuilder(r.StrUtil.rtrim(n)),i=new t.StringBuilder(0),o=0;o<s.Length;o+=1){var l=s.get_Item(o);if(65281<=l.charCodeAt(0)&&l.charCodeAt(0)<=65374&&65340!==l.charCodeAt(0)&&65344!==l.charCodeAt(0))i.Append(String.fromCharCode(l.charCodeAt(0)-65248));else if(12443<=l.charCodeAt(0)&&l.charCodeAt(0)<=12534)i.Append(e.tableZen2Han[l.charCodeAt(0)-12443][0]),e.tableZen2Han[l.charCodeAt(0)-12443][1].charCodeAt(0)>0&&i.Append(e.tableZen2Han[l.charCodeAt(0)-12443][1]);else{var u=void 0;for(u=0;u<e.tableExceptZen2Han.length;u++)if(l===e.tableExceptZen2Han[u][0]){i.Append(e.tableExceptZen2Han[u][1]);break}u===e.tableExceptZen2Han.length&&i.Append(l)}}return a=i.ToString(),s=null,i=null,a},e.prototype.eval_op_zens=function(n,a){for(var s,i=new t.StringBuilder(r.StrUtil.rtrim(n)),o=new t.StringBuilder(0),l=0;l<i.Length;l+=1){var u=i.get_Item(l);if(32<=u.charCodeAt(0)&&u.charCodeAt(0)<=126)switch(u){case String.fromCharCode(32):1===a?o.Append(String.fromCharCode(12288)):2===a?(o.Append(String.fromCharCode(32)),o.Append(String.fromCharCode(32))):o.Append(String.fromCharCode(32));break;case String.fromCharCode(34):o.Append(String.fromCharCode(8221));break;case String.fromCharCode(39):o.Append(String.fromCharCode(8217));break;case String.fromCharCode(92):o.Append(String.fromCharCode(65509));break;case String.fromCharCode(96):o.Append(String.fromCharCode(8216));break;default:o.Append(String.fromCharCode(u.charCodeAt(0)+65248))}else if(65377<=u.charCodeAt(0)&&u.charCodeAt(0)<=65439){var c=String.fromCharCode(0);l+1<i.Length&&65438!==(c=i.get_Item(l+1)).charCodeAt(0)&&65439!==c.charCodeAt(0)&&(c=String.fromCharCode(0)),65438===c.charCodeAt(0)?65398<=u.charCodeAt(0)&&u.charCodeAt(0)<=65412||65418<=u.charCodeAt(0)&&u.charCodeAt(0)<=65422?o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377]+1):65395===u.charCodeAt(0)?o.Append(String.fromCharCode(12532)):c=String.fromCharCode(0):65439===c.charCodeAt(0)&&(65418<=u.charCodeAt(0)&&u.charCodeAt(0)<=65422?o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377]+2):c=String.fromCharCode(0)),0!==c.charCodeAt(0)?l++:o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377])}else o.Append(u)}return s=o.ToString(),i=null,o=null,s},e.prototype.eval_op_zimeread=function(e){var t=null,r=n.Manager.UtilImeJpn;return null!==r&&(t=r.StrImeRead),t},e.prototype.eval_op_zkana=function(e,n){for(var a,s=new t.StringBuilder(r.StrUtil.rtrim(e)),i=0;i<s.Length;i+=1){var o=s.get_Item(i);0===n?12353<=o.charCodeAt(0)&&o.charCodeAt(0)<=12435&&s.set_Item(i,String.fromCharCode(o.charCodeAt(0)+96)):12449<=o.charCodeAt(0)&&o.charCodeAt(0)<=12531&&s.set_Item(i,String.fromCharCode(o.charCodeAt(0)-96))}return a=s.ToString(),s=null,a},e.prototype.eval_op_jcdow=function(e,t,r){this._expressionEvaluator.eval_op_date_str(e,t,"SSSSSST",r)},e.prototype.eval_op_jmonth=function(e,t){if(null!==t.MgNumVal){t.MgNumVal=this._expressionEvaluator.mul_add(t.MgNumVal,31,-30),this._expressionEvaluator.eval_op_month(e,t);var n=e.MgNumVal.NUM_2_LONG();e.Attr=r.StorageAttribute.ALPHA,e.StrVal=r.UtilDateJpn.convertStrMonth(n)}else this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e.prototype.eval_op_jndow=function(e,t,n){null!==t.MgNumVal?(t.MgNumVal=this._expressionEvaluator.mul_add(t.MgNumVal,0,6),this.eval_op_jcdow(e,t.MgNumVal,n)):this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e.prototype.eval_op_jyear=function(e,t){this._expressionEvaluator.eval_op_date_brk(e,t.MgNumVal,4)},e.prototype.eval_op_jgengo=function(e,t,n,a){var s;if(e.Attr=r.StorageAttribute.ALPHA,null!==t&&null!==n){var i=n.NUM_2_LONG();if(i>=4)s="JJJJ";else if(i>=2)s="JJ";else{if(!(i>=1))return void(e.StrVal="");s="J"}this._expressionEvaluator.eval_op_date_str(e,t,s,a)}else this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e}();de.tableZen2Han=[[String.fromCharCode(65438),String.fromCharCode(0)],[String.fromCharCode(65439),String.fromCharCode(0)],[String.fromCharCode(12445),String.fromCharCode(0)],[String.fromCharCode(12446),String.fromCharCode(0)],[String.fromCharCode(12447),String.fromCharCode(0)],[String.fromCharCode(12448),String.fromCharCode(0)],[String.fromCharCode(65383),String.fromCharCode(0)],[String.fromCharCode(65393),String.fromCharCode(0)],[String.fromCharCode(65384),String.fromCharCode(0)],[String.fromCharCode(65394),String.fromCharCode(0)],[String.fromCharCode(65385),String.fromCharCode(0)],[String.fromCharCode(65395),String.fromCharCode(0)],[String.fromCharCode(65386),String.fromCharCode(0)],[String.fromCharCode(65396),String.fromCharCode(0)],[String.fromCharCode(65387),String.fromCharCode(0)],[String.fromCharCode(65397),String.fromCharCode(0)],[String.fromCharCode(65398),String.fromCharCode(0)],[String.fromCharCode(65398),String.fromCharCode(65438)],[String.fromCharCode(65399),String.fromCharCode(0)],[String.fromCharCode(65399),String.fromCharCode(65438)],[String.fromCharCode(65400),String.fromCharCode(0)],[String.fromCharCode(65400),String.fromCharCode(65438)],[String.fromCharCode(65401),String.fromCharCode(0)],[String.fromCharCode(65401),String.fromCharCode(65438)],[String.fromCharCode(65402),String.fromCharCode(0)],[String.fromCharCode(65402),String.fromCharCode(65438)],[String.fromCharCode(65403),String.fromCharCode(0)],[String.fromCharCode(65403),String.fromCharCode(65438)],[String.fromCharCode(65404),String.fromCharCode(0)],[String.fromCharCode(65404),String.fromCharCode(65438)],[String.fromCharCode(65405),String.fromCharCode(0)],[String.fromCharCode(65405),String.fromCharCode(65438)],[String.fromCharCode(65406),String.fromCharCode(0)],[String.fromCharCode(65406),String.fromCharCode(65438)],[String.fromCharCode(65407),String.fromCharCode(0)],[String.fromCharCode(65407),String.fromCharCode(65438)],[String.fromCharCode(65408),String.fromCharCode(0)],[String.fromCharCode(65408),String.fromCharCode(65438)],[String.fromCharCode(65409),String.fromCharCode(0)],[String.fromCharCode(65409),String.fromCharCode(65438)],[String.fromCharCode(65391),String.fromCharCode(0)],[String.fromCharCode(65410),String.fromCharCode(0)],[String.fromCharCode(65410),String.fromCharCode(65438)],[String.fromCharCode(65411),String.fromCharCode(0)],[String.fromCharCode(65411),String.fromCharCode(65438)],[String.fromCharCode(65412),String.fromCharCode(0)],[String.fromCharCode(65412),String.fromCharCode(65438)],[String.fromCharCode(65413),String.fromCharCode(0)],[String.fromCharCode(65414),String.fromCharCode(0)],[String.fromCharCode(65415),String.fromCharCode(0)],[String.fromCharCode(65416),String.fromCharCode(0)],[String.fromCharCode(65417),String.fromCharCode(0)],[String.fromCharCode(65418),String.fromCharCode(0)],[String.fromCharCode(65418),String.fromCharCode(65438)],[String.fromCharCode(65418),String.fromCharCode(65439)],[String.fromCharCode(65419),String.fromCharCode(0)],[String.fromCharCode(65419),String.fromCharCode(65438)],[String.fromCharCode(65419),String.fromCharCode(65439)],[String.fromCharCode(65420),String.fromCharCode(0)],[String.fromCharCode(65420),String.fromCharCode(65438)],[String.fromCharCode(65420),String.fromCharCode(65439)],[String.fromCharCode(65421),String.fromCharCode(0)],[String.fromCharCode(65421),String.fromCharCode(65438)],[String.fromCharCode(65421),String.fromCharCode(65439)],[String.fromCharCode(65422),String.fromCharCode(0)],[String.fromCharCode(65422),String.fromCharCode(65438)],[String.fromCharCode(65422),String.fromCharCode(65439)],[String.fromCharCode(65423),String.fromCharCode(0)],[String.fromCharCode(65424),String.fromCharCode(0)],[String.fromCharCode(65425),String.fromCharCode(0)],[String.fromCharCode(65426),String.fromCharCode(0)],[String.fromCharCode(65427),String.fromCharCode(0)],[String.fromCharCode(65388),String.fromCharCode(0)],[String.fromCharCode(65428),String.fromCharCode(0)],[String.fromCharCode(65389),String.fromCharCode(0)],[String.fromCharCode(65429),String.fromCharCode(0)],[String.fromCharCode(65390),String.fromCharCode(0)],[String.fromCharCode(65430),String.fromCharCode(0)],[String.fromCharCode(65431),String.fromCharCode(0)],[String.fromCharCode(65432),String.fromCharCode(0)],[String.fromCharCode(65433),String.fromCharCode(0)],[String.fromCharCode(65434),String.fromCharCode(0)],[String.fromCharCode(65435),String.fromCharCode(0)],[String.fromCharCode(12526),String.fromCharCode(0)],[String.fromCharCode(65436),String.fromCharCode(0)],[String.fromCharCode(12528),String.fromCharCode(0)],[String.fromCharCode(12529),String.fromCharCode(0)],[String.fromCharCode(65382),String.fromCharCode(0)],[String.fromCharCode(65437),String.fromCharCode(0)],[String.fromCharCode(65395),String.fromCharCode(65438)],[String.fromCharCode(65398),String.fromCharCode(0)],[String.fromCharCode(65401),String.fromCharCode(0)]],de.tableExceptZen2Han=[[String.fromCharCode(8216),String.fromCharCode(96)],[String.fromCharCode(8217),String.fromCharCode(39)],[String.fromCharCode(8221),String.fromCharCode(34)],[String.fromCharCode(12288),String.fromCharCode(32)],[String.fromCharCode(12289),String.fromCharCode(65380)],[String.fromCharCode(12290),String.fromCharCode(65377)],[String.fromCharCode(12300),String.fromCharCode(65378)],[String.fromCharCode(12301),String.fromCharCode(65379)],[String.fromCharCode(12539),String.fromCharCode(65381)],[String.fromCharCode(12540),String.fromCharCode(65392)],[String.fromCharCode(65509),String.fromCharCode(92)]],de.tableHan2Zen=[String.fromCharCode(12290),String.fromCharCode(12300),String.fromCharCode(12301),String.fromCharCode(12289),String.fromCharCode(12539),String.fromCharCode(12530),String.fromCharCode(12449),String.fromCharCode(12451),String.fromCharCode(12453),String.fromCharCode(12455),String.fromCharCode(12457),String.fromCharCode(12515),String.fromCharCode(12517),String.fromCharCode(12519),String.fromCharCode(12483),String.fromCharCode(12540),String.fromCharCode(12450),String.fromCharCode(12452),String.fromCharCode(12454),String.fromCharCode(12456),String.fromCharCode(12458),String.fromCharCode(12459),String.fromCharCode(12461),String.fromCharCode(12463),String.fromCharCode(12465),String.fromCharCode(12467),String.fromCharCode(12469),String.fromCharCode(12471),String.fromCharCode(12473),String.fromCharCode(12475),String.fromCharCode(12477),String.fromCharCode(12479),String.fromCharCode(12481),String.fromCharCode(12484),String.fromCharCode(12486),String.fromCharCode(12488),String.fromCharCode(12490),String.fromCharCode(12491),String.fromCharCode(12492),String.fromCharCode(12493),String.fromCharCode(12494),String.fromCharCode(12495),String.fromCharCode(12498),String.fromCharCode(12501),String.fromCharCode(12504),String.fromCharCode(12507),String.fromCharCode(12510),String.fromCharCode(12511),String.fromCharCode(12512),String.fromCharCode(12513),String.fromCharCode(12514),String.fromCharCode(12516),String.fromCharCode(12518),String.fromCharCode(12520),String.fromCharCode(12521),String.fromCharCode(12522),String.fromCharCode(12523),String.fromCharCode(12524),String.fromCharCode(12525),String.fromCharCode(12527),String.fromCharCode(12531),String.fromCharCode(12443),String.fromCharCode(12444)];var Ee,Ie=function(e,t,r,n,a,s){this.Attr_="\0",this.Prec_=0,this.ArgCount_=0,this.ArgEvalCount_=0,this.ArgAttr_=null,this.RtfAsAlpha_=!1,this.Attr_=e,this.Prec_=t,this.ArgCount_=r,this.ArgEvalCount_=n,this.ArgAttr_=a,this.RtfAsAlpha_=s},fe=function(){};fe.expDesc=[new Ie(" ",0,0,0,"",!1),new Ie(" ",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",4,2,2,"NN",!1),new Ie("N",4,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",4,1,1,"N",!1),new Ie("N",0,3,3,"NNN",!1),new Ie("N",0,3,3,"NNN",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",2,1,1,"B",!1),new Ie("B",1,2,1,"BB",!1),new Ie("B",2,2,1,"BB",!1),new Ie(" ",0,3,1,"B ",!1),new Ie("N",0,1,1,"U",!0),new Ie("A",4,2,2,"UU",!0),new Ie("A",0,3,3,"UNN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("N",0,2,2,"UU",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,2,2,"NU",!0),new Ie("N",0,2,2,"UU",!0),new Ie("B",0,2,2,"NA",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("*",0,1,1,"V",!1),new Ie("*",0,1,1,"V",!1),new Ie("B",0,1,1,"V",!1),new Ie("N",0,1,1,"N",!1),new Ie("A",0,1,1,"V",!1),new Ie("B",0,1,1,"N",!1),new Ie("H",0,1,1,"A",!0),new Ie("A",0,1,1,"A",!0),new Ie("B",0,2,2,"AB",!0),null,null,new Ie("N",0,0,0,"",!1),null,new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("H",0,0,0,"",!1),null,new Ie("U",0,0,0,"",!1),new Ie("H",0,0,0,"",!1),null,new Ie("N",6,2,2,"NN",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie(" ",0,-2,-2," ",!1),new Ie(" ",0,-2,-2," ",!1),new Ie("B",0,3,3," ",!1),new Ie("A",0,4,4,"UUNN",!0),new Ie("A",0,4,4,"UUNN",!0),new Ie("A",0,3,3,"UNN",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,2,2,"AN",!0),new Ie("N",0,2,2,"AN",!0),new Ie("A",0,1,1,"A",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"A",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"A",!0),null,null,null,null,null,null,null,null,new Ie("A",0,2,2,"NN",!1),new Ie("N",0,1,1,"A",!0),new Ie("A",0,2,2,"DU",!0),new Ie("D",0,2,2,"UU",!0),new Ie("A",0,2,2,"TU",!0),new Ie("T",0,2,2,"UU",!0),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("A",0,1,1,"D",!1),new Ie("A",0,1,1,"D",!1),new Ie("A",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"T",!1),new Ie("N",0,1,1,"T",!1),new Ie("N",0,1,1,"T",!1),new Ie("B",0,1,1,"N",!1),new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("D",0,4,4,"DNNN",!1),new Ie("T",0,4,4,"TNNN",!1),new Ie("H",0,0,0,"",!1),new Ie("A",0,1,1,"V",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),null,new Ie("N",0,0,0,"",!1),null,new Ie("B",0,2,2,"BN",!1),new Ie("B",0,2,2,"V ",!1),null,null,null,null,new Ie("*",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("B",0,1,1," ",!1),new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),null,null,null,new Ie("A",0,1,1,"U",!1),new Ie("A",0,0,0,"",!0),new Ie("N",0,2,2,"NA",!0),new Ie("N",0,1,1,"N",!1),null,null,null,new Ie("A",0,0,0,"",!1),new Ie("B",0,2,2,"AB",!1),new Ie("B",0,2,2,"AB",!1),new Ie("B",0,2,2,"AB",!1),new Ie("O",0,0,0,"",!1),null,new Ie("*",0,1,1,"A",!1),new Ie("B",0,2,2,"A ",!1),null,null,null,null,null,new Ie("*",0,2,2,"B*",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"V",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,3,3,"UNU",!0),null,null,null,new Ie("A",0,2,2,"AN",!0),new Ie("A",0,1,1,"N",!0),new Ie("N",0,0,0,"",!0),new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),null,null,new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"N",!1),null,new Ie("N",0,1,1,"A",!1),new Ie("A",0,1,1,"N",!0),null,null,new Ie("A",0,1,1,"AAAA",!0),null,null,null,null,new Ie("N",0,1,1,"N",!0),new Ie(" ",0,-4,-4," ",!1),null,new Ie("B",2,2,2,"AA",!0),null,null,null,null,null,null,null,new Ie("B",0,-1,-1,"A",!1),null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,new Ie("A",0,3,3,"UUU",!1),null,null,new Ie("N",0,2,2,"NN",!1),new Ie("A",0,2,2,"NN",!1),null,new Ie("N",0,2,2,"UU",!1),new Ie("*",0,1,1,"A",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,-2,-2," U",!0),new Ie("B",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),null,null,new Ie("A",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,2,2,"AA",!1),null,null,new Ie("A",0,1,1,"A",!0),new Ie("A",0,1,1,"A",!0),new Ie("A",0,2,2,"AA",!0),new Ie("A",0,1,1,"N",!1),new Ie("A",0,2,2,"AA",!0),null,null,null,null,null,null,null,null,new Ie("B",0,2,2,"AU",!1),null,null,null,null,new Ie("B",0,3,3,"ANN",!1),null,null,null,null,new Ie("A",0,1,1,"A",!1),new Ie("U",0,2,2,"UU",!1),null,new Ie("B",0,2,2,"AA",!1),new Ie("B",0,-3,-3,"AAA",!1),new Ie("N",0,0,0,"",!1),new Ie("*",0,1,1,"N",!1),new Ie("B",0,-2,-2,"*NA",!1),null,new Ie("B",0,-1,-1,"*NA",!1),new Ie("*",0,-1,-1,"*NA",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),null,null,new Ie("*",0,2,2,"ON",!1),new Ie("B",0,3,3,"VN ",!1),new Ie("N",0,1,1,"O",!1),new Ie("A",0,1,1,"O",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,1,1,"O",!1),null,null,null,null,null,new Ie("N",0,3,3,"UUU",!1),new Ie("N",0,0,0,"",!1),new Ie("T",0,2,2,"UU",!0),new Ie("A",0,2,2,"NU",!0),null,null,null,null,null,new Ie("B",0,1,1," ",!1),null,null,null,null,new Ie("B",0,-2,-2," ",!0),null,null,new Ie("B",0,0,0,"",!1),null,null,null,null,null,null,new Ie("N",0,2,2,"NN",!0),new Ie("B",0,1,1,"U",!0),new Ie("A",0,0,0,"",!0),new Ie("N",0,0,0,"",!0),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("U",0,0,0,"",!1),new Ie("B",0,2,2,"NA",!1),new Ie("B",0,-1,-1,"NA",!1),new Ie("B",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie(" ",0,-16,-16," ",!1),new Ie("N",0,1,1,"N",!1),null,null,null,null,null,null,null,new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"U",!1),new Ie("U",0,2,2,"AN",!1),new Ie("A",0,2,2,"UN",!1),new Ie("B",0,8,8,"VVNNNNNN",!1),new Ie("B",0,6,6,"DTDTVV",!1),new Ie("B",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),null,null,new Ie("N",0,1,1,"N",!1),null,null,new Ie("B",0,1,1,"U",!1),new Ie("N",0,2,2,"AB",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("S",0,0,0,"",!1),new Ie("B",0,1,1,"A",!1),new Ie("A",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),null,null,null,null,new Ie("A",0,-2,-2,"UU",!1),null,new Ie("O",0,1,1,"A",!1),new Ie("B",0,2,2,"OA",!1),new Ie("B",0,2,2,"AA",!1),new Ie("B",0,1,1,"A",!1),new Ie("B",0,1,1,"A",!1),new Ie("O",0,3,3,"AAB",!1),new Ie("B",0,2,2,"AA",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("B",0,2,2,"AA",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,2,2,"AA",!1),new Ie("A",0,1,1,"A",!1),new Ie("B",0,-3,-3,"AABU",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),new Ie("A",0,1,1,"U",!1),null,null,new Ie("A",0,2,2,"AN",!1),new Ie("A",0,5,5,"AAABB",!0),new Ie("A",0,5,5,"AAAAB",!0),new Ie("A",0,3,3,"AAB",!0),null,null,new Ie("B",0,4,4,"UUUB",!0),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,0,0,"",!0),new Ie("A",0,0,0,"",!0),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,-3,-3,"ENA",!1),new Ie(" ",0,-3,-3,"ENA",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-3,-3,"NE ",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,2,2,"EA",!1),new Ie(" ",0,2,2,"EE",!1),new Ie(" ",0,1,1," ",!1),new Ie(" ",0,2,2," ",!1),new Ie(" ",0,2,2,"NA",!1),new Ie(" ",0,0,0,"",!1),new Ie(" ",0,0,0,"",!1),new Ie("A",0,1,1,"N",!1),null,new Ie("A",0,1,1,"A",!1),new Ie("N",0,2,2,"AA",!1),new Ie("B",0,-2,-2,"V ",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,-2,-2,"V ",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,2,2,"VB",!1),new Ie("B",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),null,null,new Ie(" ",0,3,3,"NAA",!1),null,null,null,null,null,null,new Ie("B",0,2,2,"A ",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,1,1,"A",!1),new Ie("B",0,5,5,"NANAA",!1),new Ie("B",0,2,2,"NA",!1),null,null,null,null,null,null,new Ie("*",0,-2,-2,"AA",!1),null,new Ie("U",0,1,1,"V",!1),new Ie("B",0,2,2,"NB",!1),new Ie("B",0,2,2,"AN",!1),new Ie("N",0,1,1,"V",!1),new Ie("U",0,1,1,"N",!1),new Ie("U",0,1,1,"N",!1),new Ie("B",0,-2,-2,"AU",!1),new Ie("N",0,2,2,"NB",!1),new Ie("N",0,2,2,"NB",!1),new Ie("N",0,1,1,"N",!1),null,null,null,null,null,null,null,null,new Ie("S",0,5,5,"NNNNB",!1),new Ie("B",0,2,2,"UU",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"U",!1),null,new Ie("B",0,1,1,"N",!1),new Ie("B",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,new Ie("B",0,-2,-2,"*",!1),new Ie("*",0,1,1,"A",!1),new Ie("B",0,1,1,"A",!1),null,new Ie("U",0,0,0,"",!1)],(Ee=e.DataViewCommandType||(e.DataViewCommandType={}))[Ee.Init=0]="Init",Ee[Ee.Clear=1]="Clear",Ee[Ee.Prepare=2]="Prepare",Ee[Ee.FirstChunk=3]="FirstChunk",Ee[Ee.RecomputeUnit=4]="RecomputeUnit",Ee[Ee.ExecuteLocalUpdates=5]="ExecuteLocalUpdates",Ee[Ee.InitDataControlViews=6]="InitDataControlViews",Ee[Ee.OpenTransaction=7]="OpenTransaction",Ee[Ee.CloseTransaction=8]="CloseTransaction",Ee[Ee.SetTransactionState=9]="SetTransactionState",Ee[Ee.AddUserRange=10]="AddUserRange",Ee[Ee.ResetUserRange=11]="ResetUserRange",Ee[Ee.DbDisconnect=12]="DbDisconnect",Ee[Ee.AddUserLocate=13]="AddUserLocate",Ee[Ee.ResetUserLocate=14]="ResetUserLocate",Ee[Ee.AddUserSort=15]="AddUserSort",Ee[Ee.ResetUserSort=16]="ResetUserSort",Ee[Ee.DataViewToDataSource=17]="DataViewToDataSource",Ee[Ee.DbDelete=18]="DbDelete",Ee[Ee.ControlItemsRefresh=19]="ControlItemsRefresh",Ee[Ee.SQLExecute=20]="SQLExecute";var Ce=function(e){function r(){var t=e.call(this)||this;return t.CommandType=0,t.TaskTag=null,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){throw new t.NotImplementedException},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){return t.Debug.Assert(!1,"Dataview commands need not be serialized"),null},Object.defineProperty(r.prototype,"ShouldSerialize",{get:function(){return!1},enumerable:!1,configurable:!0}),r}(C),Ae=function(){function e(){this._handlerIdx=0,this._handlersTab=null,this._orgPrevTask=null,this._orgTask=null,this._phase=0,this._prevTask=null,this._rtEvt=null,this._task=null}return e.prototype.init=function(t){this._rtEvt=t,this._task=this._rtEvt.getTask(),this._task.isMainProg()&&(this._prevTask=this._rtEvt.getMainPrgCreator(),null!==this._prevTask&&this._prevTask.isMainProg()&&(this._prevTask=null)),t.getType()===E.EVENT_TYPE_USER_FUNC||t.getType()===E.EVENT_TYPE_USER_FUNC?this._phase=e.PHASE_CONTROL_NON_SPECIFIC:this._phase=e.PHASE_CONTROL_SPECIFIC,this._orgTask=this._task,this._orgPrevTask=this._prevTask,this._handlersTab=this._task.getHandlersTab(),null===this._handlersTab&&this.goUpTaskChain(),this._handlerIdx=-1},e.prototype.getNext=function(e){return a.isNullOrUndefined(e)?this.getNext_1():this.getNext_0(e)},e.prototype.getNext_0=function(e){return this._rtEvt=e,this.getNext()},e.prototype.getNext_1=function(){if(null===this._handlersTab)return null;if(this._rtEvt.getType()===E.EVENT_TYPE_INTERNAL&&this._rtEvt.getInternalCode()!==r.InternalInterface.MG_ACT_VARIABLE)switch(this._rtEvt.getInternalCode()){case r.InternalInterface.MG_ACT_TASK_PREFIX:case r.InternalInterface.MG_ACT_TASK_SUFFIX:case r.InternalInterface.MG_ACT_REC_PREFIX:case r.InternalInterface.MG_ACT_REC_SUFFIX:case r.InternalInterface.MG_ACT_CTRL_PREFIX:case r.InternalInterface.MG_ACT_CTRL_SUFFIX:if(-1===this._handlerIdx)for(this._handlerIdx=this._handlersTab.getSize()-1;this._handlerIdx>=0;this._handlerIdx--){if((t=this._handlersTab.getHandler(this._handlerIdx)).isNonSpecificHandlerOf(this._rtEvt)||t.isSpecificHandlerOf(this._rtEvt))return t}return null}for(;this.setNextHandlerIdx();){var t=this._handlersTab.getHandler(this._handlerIdx);switch(this._phase){case e.PHASE_CONTROL_SPECIFIC:if(t.isSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_CONTROL_NON_SPECIFIC:if(t.isNonSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_GLOBAL_SPECIFIC:if(t.isGlobalSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_GLOBAL:if(t.isGlobalHandlerOf(this._rtEvt))return t;continue;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in EventHandlerPosition.getNext() invalid phase: "+this._phase)}}return null},e.prototype.setNextHandlerIdx=function(){return this._handlerIdx<0?this._handlerIdx=this._handlersTab.getSize()-1:this._handlerIdx=this._handlerIdx-1,!(this._handlerIdx<0||this._task.isAborting())||!!this.goUpTaskChain()&&this.setNextHandlerIdx()},e.prototype.goUpTaskChain=function(){var t=this._task.getMGData(),n=this._task.getCtlIdx();switch(this._phase){case e.PHASE_CONTROL_SPECIFIC:case e.PHASE_CONTROL_NON_SPECIFIC:if(this._task.isMainProg()){if((this._rtEvt.getType()===E.EVENT_TYPE_PUBLIC||this._rtEvt.getType()===E.EVENT_TYPE_INTERNAL||this._rtEvt.getType()===E.EVENT_TYPE_SYSTEM||this._rtEvt.getType()===E.EVENT_TYPE_USER)&&n>0){null===this._prevTask?(this._task=t.getNextMainProg(n),null===this._task&&n>0&&(this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,o.eventsManager.getCompMainPrgTab().getCtlIdx(0)))):(this._task=this._prevTask.PathParentTask,this._prevTask=null),this._rtEvt.setMainPrgCreator(null);break}if(this._phase===e.PHASE_CONTROL_SPECIFIC?this._phase=e.PHASE_GLOBAL_SPECIFIC:this._phase=e.PHASE_GLOBAL,this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,o.eventsManager.getCompMainPrgTab().getCtlIdx(0)),this._rtEvt.setMainPrgCreator(this._task),null===this._task)return!1;break}this.getParentOrCompMainPrg();break;case e.PHASE_GLOBAL_SPECIFIC:case e.PHASE_GLOBAL:if(this._task=t.getNextMainProg(n),null===this._task){if(this._phase===e.PHASE_GLOBAL)return!1;this._phase=e.PHASE_CONTROL_NON_SPECIFIC,this._task=this._orgTask,this._prevTask=this._orgPrevTask}break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in EventHandlerPosition.goUpTaskChain() invalid phase: "+this._phase)}return null!==this._task&&(this._handlersTab=this._task.getHandlersTab(),null===this._handlersTab?this.goUpTaskChain():(this._handlerIdx=-1,!0))},e.prototype.getParentOrCompMainPrg=function(){var e=this._task.getCtlIdx();this._prevTask=this._task;var t=this._task.PathParentTask;null!==t?e!==t.getCtlIdx()?(this._rtEvt.setMainPrgCreator(this._task),this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,e)):(this._rtEvt.setMainPrgCreator(null),this._task=t):this._task=null},e}();Ae.PHASE_CONTROL_SPECIFIC=1,Ae.PHASE_CONTROL_NON_SPECIFIC=2,Ae.PHASE_GLOBAL=3,Ae.PHASE_GLOBAL_SPECIFIC=4;var Re,Se=function(t){function r(){var r=t.call(this)||this;return r.Range=null,r.CommandType=e.DataViewCommandType.AddUserRange,r}return u(r,t),r}(Ce),Me=function(t){function r(){var r=t.call(this)||this;return r.Sort=null,r.CommandType=e.DataViewCommandType.AddUserSort,r}return u(r,t),r}(Ce),me=function(t){function r(){var r=t.call(this)||this;return r.CommandType=e.DataViewCommandType.AddUserLocate,r}return u(r,t),r}(Se),ve=function(t){function r(){var r=t.call(this)||this;return r.TransactionIsOpen=!1,r.CommandType=e.DataViewCommandType.SetTransactionState,r}return u(r,t),r}(Ce),Le=function(e){function t(){var t=e.call(this)||this;return t.Control=null,t}return u(t,e),t}(Ce),be=function(e){function r(t){var r=e.call(this,t)||this;return r.RefreshMode=0,r.KeepUserSort=!1,r.CurrentRecordRow=0,r.IsInternalRefresh=!1,r}return u(r,e),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),this.IsInternalRefresh||t.SerializeRefreshMode(this.RefreshMode),this.KeepUserSort&&t.SerializeAttribute(E.MG_ATTR_KEEP_USER_SORT,"1"),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} {1}]",this.EventDescription,this.IsInternalRefresh?"Raised by Magic":"Raised by User")},r}(R),Ne=function(e){function t(t){var r=e.call(this)||this;return r.Generation=0,r.TaskVarNames=null,r.DestinationDataSourceNumber=0,r.DestinationDataSourceName=null,r.DestinationColumns=null,r.CommandType=t,r}return u(t,e),t}(Ce),ye=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_FETCH_DATA_CONTROL_VALUES)||this;return t.ControlName=null,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_CONTROL_NAME,this.ControlName),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for control {1} in {2}]",this.EventDescription,this.ControlName,this.Task.getTaskInfo())},n}(R),Oe=function(e){function t(){var t=e.call(this,r.InternalInterface.MG_ACT_WRITE_ERROR_TO_SERVER_LOG)||this;return t.ErrorMessage=null,t}return u(t,e),t.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_ERROR_MESSAGE,this.ErrorMessage),t.GetString()},t}(R),Ge=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_SUBFORM_REFRESH)||this;return t.SubformTaskTag=null,t.ExplicitSubformRefresh=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeRefreshMode(this.RefreshMode),t.SerializeAttribute(E.MG_ATTR_SUBFORM_TASK,this.SubformTaskTag),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for {1}]",this.EventDescription,this.Task.getTaskInfo())},n}(be),Pe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_BROWSER_ESC)||this;return t.CloseSubformOnly=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.SerializeCloseSubformOnly(this.CloseSubformOnly),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,this.CloseSubformOnly?" Subform Only":t.NString.Empty,a.isNullOrUndefined(this.Task)?t.NString.Empty:this.Task.getTaskInfo())},n}(R),De=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_INDEX_CHANGE)||this;return t.KeyIndex=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeKeyIndex(this.KeyIndex),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} with Key Index {1} in {2}]",this.EventDescription,this.KeyIndex,this.Task.getTaskInfo())},n}(R),ke=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_COL_SORT)||this;return t.FldId=0,t.DitIdx=0,t.Direction=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeFldId(this.FldId),t.SerializeMagicEvent(this.MagicEvent),t.SerializeDitIdx(this.DitIdx),t.SerializeAttribute(E.MG_ATTR_DIRECTION,this.Direction),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for column {1} in {2}]",this.EventDescription,this.Task.getForm().getCtrl(this.DitIdx).getName(),this.Task.getTaskInfo())},n}(R),xe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN)||this;return t.TopRecIdx=0,t.RefreshMode=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,this.TopRecIdx),t.SerializeRefreshMode(this.RefreshMode),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]",this.EventDescription,this.Task.getTaskInfo())},n}(R),Fe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_SUBFORM_OPEN)||this;return t.DitIdx=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeDitIdx(this.DitIdx),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} {1} in {2}]",this.EventDescription,this.Task.getForm().getCtrl(this.DitIdx).getName(),this.Task.getTaskInfo())},n}(R),we=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_COMPUTE)||this;return t.Subforms=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),this.Subforms&&t.SerializeAttribute(E.MG_ATTR_OBJECT,"99999"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for {1} in {2}] ",this.EventDescription,this.Subforms?"Form and Subform":"Form",this.Task.getTaskInfo())},n}(R),Ve=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_EXIT)||this;return t.CloseSubformOnly=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_REVERSIBLE,"0"),t.SerializeCloseSubformOnly(this.CloseSubformOnly),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,this.CloseSubformOnly?" Closing Subform Only":t.NString.Empty,this.Task.getTaskInfo())},n}(R),Ue=function(e){function r(){var t=e.call(this)||this;return t.TaskTag=null,t.FldId=0,t.IgnoreSubformRecompute=!1,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_RECOMP},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeFldId(this.FldId),this.IgnoreSubformRecompute&&t.SerializeAttribute(E.MG_ATTR_IGNORE_SUBFORM_RECOMPUTE,"1"),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1} for Field {2}]",this.CommandTypeAttribute.charAt(0).toUpperCase()+this.CommandTypeAttribute.substr(1,this.CommandTypeAttribute.length),this.Task.getTaskInfo(),this.Task.getFieldDef(this.FldId).getName())},r}(C),Be=function(e){function r(){var t=e.call(this)||this;return t.TaskTag=null,t.ReversibleExit=!1,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_TRANS},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeAttribute(E.MG_ATTR_OPER,this.Oper),this.ReversibleExit||t.SerializeAttribute(E.MG_ATTR_REVERSIBLE,"0"),"\0"!==this.Level&&t.SerializeAttribute(E.MG_ATTR_TRANS_LEVEL,this.Level),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]","C"===this.Oper?"Commit Transaction":"Abort Transaction",this.Task.getTaskInfo())},r}(C),Xe=function(e){function r(){return e.call(this)||this}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_UNLOAD},enumerable:!1,configurable:!0}),r.prototype.getCommandInfo=function(){return t.NString.Format("[{0}]",this.CommandTypeAttribute)},r}(f),He=function(e){function n(){var r=e.call(this)||this;return r.TaskTag=null,r.ExpIdx=0,r.LengthExpVal=0,r.MprgCreator=null,r.LengthExpVal=t.Int32.MinValue,r}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EVAL},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){var t=new A;if(t.SerializeTaskTag(this.TaskTag),t.SerializeAttribute(E.MG_ATTR_EXP_IDX,this.ExpIdx),this.ExpType!==r.StorageAttribute.NONE){var n="";this.LengthExpVal>0&&(n+=this.LengthExpVal),t.SerializeAttribute(E.MG_ATTR_EXP_TYPE,this.ExpType+n)}return null!==this.MprgCreator&&t.SerializeAttribute(E.MG_ATTR_MPRG_SOURCE,this.MprgCreator.getTaskTag()),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} ExpID {1} in {2}]",this.CommandTypeAttribute.charAt(0).toUpperCase()+this.CommandTypeAttribute.substr(1,this.CommandTypeAttribute.length),this.ExpIdx,this.Task.getTaskInfo())},n}(C),We=function(e){function r(){return e.call(this)||this}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_QUERY},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ShouldSerializeRecords",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var r=new t.StringBuilder;return r.Append(" "+E.MG_ATTR_VAL_QUERY_TYPE+'="'),r.Append(this.SerializeQueryCommandData()),r.ToString()},r}(f),Ke=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.SerializeQueryCommandData=function(){return E.MG_ATTR_VAL_QUERY_GLOBAL_PARAMS+'"'},t}(We),Ye=function(e){function n(){var t=e.call(this)||this;return t.Text=null,t}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_INIPUT_FORCE_WRITE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShouldSerializeRecords",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){return" "+E.MG_ATTR_VAL_INIPUT_PARAM+'="'+r.XmlParser.escape(this.Text)+'"'},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} with {1}] ",this.CommandTypeAttribute,this.Text)},n}(f),ze=function(e){function n(){return e.call(this,r.InternalInterface.MG_ACT_CONTEXT_TERMINATION)||this}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Empty},n}(R),qe=function(e){function n(){return e.call(this,r.InternalInterface.MG_ACT_CONTEXT_TIMEOUT_RESET)||this}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Empty},n}(R),je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.getCommandInfo=function(){return"Select Program on Control "+o.eventsManager.getLastRtEvent().Control.Name},t.prototype.getTask=function(){return o.eventsManager.getLastRtEvent().getTask()},t}(q),Qe=function(){function t(){}return t.CreateEventCommand=function(e,t){var r=new R(t);return r.TaskTag=e,r},t.CreateRollbackEventCommand=function(e,t){var r=new S;return r.TaskTag=e,r.Rollback=t,r},t.CreateDataViewCommand=function(e,t){var r=new Ce;return r.CommandType=t,r.TaskTag=e,r},t.CreateAddUserRangeDataviewCommand=function(e,t){var r=new Se;return r.TaskTag=e,r.Range=t,r},t.CreateAddUserSortDataviewCommand=function(e,t){var r=new Me;return r.TaskTag=e,r.Sort=t,r},t.CreateAddUserLocateDataviewCommand=function(e,t){var r=new me;return r.TaskTag=e,r.Range=t,r},t.CreateSetTransactionStateDataviewCommand=function(e,t){var r=new ve;return r.TaskTag=e,r.TransactionIsOpen=t,r},t.CreateControlItemsRefreshCommand=function(t,r){var n=new Le;return n.TaskTag=t,n.CommandType=e.DataViewCommandType.ControlItemsRefresh,n.Control=r,n},t.CreateInternalRefreshCommand=function(e,t,n,a){var s=new be(t);return s.TaskTag=e,s.RefreshMode=r.ViewRefreshMode.CurrentLocation,s.ClientRecId=n,s.IsInternalRefresh=!0,s.CurrentRecordRow=a,s},t.CreateRealRefreshCommand=function(e,t,a,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:if((o=new be(t)).TaskTag=e,o.RefreshMode=r.ViewRefreshMode.CurrentLocation,o.KeepUserSort=!1,o.ClientRecId=i,o.CurrentRecordRow=a,l=o,t===r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||null===s||0===s.getSize())return[3,8];T.label=1;case 1:return T.trys.push([1,3,,4]),c=n.NUM_TYPE.bind,[4,s.getArgValue(0,r.StorageAttribute.NUMERIC,0)];case 2:return u=new(c.apply(n.NUM_TYPE,[void 0,T.sent()])),l.RefreshMode=u.NUM_2_LONG()+1,[3,4];case 3:return T.sent(),l.RefreshMode=r.ViewRefreshMode.CurrentLocation,[3,4];case 4:if(!(s.getSize()>1))return[3,8];T.label=5;case 5:return T.trys.push([5,7,,8]),_=l,[4,s.getArgValue(1,r.StorageAttribute.BOOLEAN,0)];case 6:return _.KeepUserSort="1"===T.sent(),[3,8];case 7:return T.sent(),l.KeepUserSort=!1,[3,8];case 8:return[2,l]}}))}))},t.CreateDataViewToDataSourceCommand=function(t,r,n,a,s,i){var o=new Ne(e.DataViewCommandType.DataViewToDataSource);return o.TaskTag=t,o.Generation=r,o.TaskVarNames=n,o.DestinationDataSourceNumber=a,o.DestinationDataSourceName=s,o.DestinationColumns=i,o},t.CreatecFetchDataControlValuesCommand=function(e,t){var r=new ye;return r.TaskTag=e,r.ControlName=t,r},t.CreateWriteMessageToServerLogCommand=function(e,t){var r=new Oe;return r.TaskTag=e,r.ErrorMessage=t,r},t.CreateSubformRefreshCommand=function(e,t,n){var a=new Ge;return a.TaskTag=e,a.SubformTaskTag=t,a.ExplicitSubformRefresh=n,a.RefreshMode=r.ViewRefreshMode.UseTaskLocate,a},t.CreateSubformOpenCommand=function(e,t){var r=new Fe;return r.TaskTag=e,r.DitIdx=t,r},t.CreateScreenRefreshCommand=function(e,t,n){var a=new xe;return a.TaskTag=e,a.TopRecIdx=t,a.RefreshMode=r.ViewRefreshMode.CurrentLocation,a.ClientRecId=n,a},t.CreateColumnSortCommand=function(e,t,r,n,a){var s=new ke;return s.TaskTag=e,s.DitIdx=r,s.FldId=n+1,s.ClientRecId=a,s.Direction=t,s},t.CreateIndexChangeCommand=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if((s=new De).TaskTag=e,s.ClientRecId=t,i=s,null===a||0===a.getSize())return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),l=n.NUM_TYPE.bind,[4,a.getArgValue(0,r.StorageAttribute.NUMERIC,0)];case 2:return o=new(l.apply(n.NUM_TYPE,[void 0,u.sent()])),i.KeyIndex=o.NUM_2_LONG(),[3,4];case 3:return u.sent(),i.KeyIndex=0,[3,4];case 4:return[2,i]}}))}))},t.CreateBrowserEscEventCommand=function(e,t){var r=new Pe;return r.TaskTag=e,r.CloseSubformOnly=t,r},t.CreateComputeEventCommand=function(e,t,r){var n=new we;return n.TaskTag=e,n.Subforms=t,n.ClientRecId=r,n},t.CreateContextTerminationEventCommand=function(e){var t=new ze;return t.TaskTag=e,t},t.CreateContextTimeoutResetEventCommand=function(){return new qe},t.CreateNonReversibleExitCommand=function(e,t){var r=new Ve;return r.TaskTag=e,r.CloseSubformOnly=t,r},t.CreateRecomputeCommand=function(e,t,r){var n=new Ue;return n.TaskTag=e,n.FldId=t,n.IgnoreSubformRecompute=r,n},t.CreateTransactionCommand=function(e,t,r,n){var a=new Be;return a.TaskTag=t,a.Oper=e,a.ReversibleExit=r,a.Level=n,a},t.CreateUnloadCommand=function(){return new Xe},t.CreateExecOperCommand=function(e,t,r,n,a){var s=new q;s.OperIdx=r,s.TaskTag=e,s.HandlerId=t,s.DitIdx=n;var i=s;return null!==a&&0===a.length?i.Val=" ":i.Val=a,i},t.CreateSelectProgramCommand=function(e,t,r,n,a){var s=new je;s.OperIdx=r,s.TaskTag=e,s.HandlerId=t,s.DitIdx=n;var i=s;return null!==a&&0===a.length?i.Val=" ":i.Val=a,i},t.CreateEvaluateCommand=function(e,t,r,n,a){var s=new He;return s.TaskTag=e,s.ExpIdx=r,s.ExpType=t,s.MprgCreator=a,n>0&&(s.LengthExpVal=n),s},t.CreateQueryGlobalParamsCommand=function(){return new Ke},t.CreateIniputForceWriteCommand=function(e){var t=new Ye;return t.Text=e,t},t}(),Ze=function(){this.fldIdx=0,this.dir=!1};(Re=e.ParamParseResult||(e.ParamParseResult={}))[Re.OK=0]="OK",Re[Re.TOUPPER=1]="TOUPPER",Re[Re.DELETE=2]="DELETE",Re[Re.FAILED=3]="FAILED";var Je=function(){function e(){this.values=null,this.values=new t.Dictionary}return e.prototype.getvalue=function(e){return this.values.ContainsKey(e)?this.values.get_Item(e):null},e.prototype.setValue=function(e,t){this.values.set_Item(e,t)},e.prototype.remove=function(e){this.values.Remove(e)},e}(),$e=function(n){function a(e){var r=n.call(this)||this;return r.changes=null,r.mirroredID=null,r.type=e,r.changes=new t.List,r}return u(a,n),a.prototype.new=function(){return new this.type},a.prototype.setValue=function(e,t,r){3===arguments.length?this.setValue_0(e,t,r):this.setValue_1(e,t)},a.prototype.setValue_0=function(e,t,r){r&&!this.changes.Contains(e)&&this.changes.push(e),n.prototype.setValue.call(this,e,t)},a.prototype.setValue_1=function(e,t){this.changes.Contains(e)||this.changes.push(e),n.prototype.setValue.call(this,e,t)},a.prototype.remove=function(e){this.changes.Contains(e)||this.changes.push(e),n.prototype.remove.call(this,e)},a.prototype.mirrorAllToXML=function(){var e,n,a=new t.StringBuilder;if(null!=this.values){a.Append("<"+this.mirroredID+">");try{for(var s=p(this.values.Keys),i=s.next();!i.done;i=s.next()){var o=i.value;this.CheckIfSystemReservedParam(o)||(a.Append("<"+E.MG_TAG_PARAM+" "+r.XMLConstants.MG_ATTR_NAME+'="'+r.XmlParser.escape(o)+'" '),a.Append(this.values.get_Item(o).mirrorToXML()),a.Append(r.XMLConstants.TAG_TERM))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}a.Append("</"+this.mirroredID+">")}return a.ToString()},a.prototype.CheckIfSystemReservedParam=function(e){return"UTF8TRANS"==e||"REMOTE_HOST"===e||"REMOTE_ADDR"===e||"CTX"===e||"MGARG0"===e||"DATA"===e||"MGCURRENTREQUESTID"===e||"HTTP_MGXPARIAGLOBALUNIQUESESSIONID"===e||"MG_POST_BODY"===e},a.prototype.mirrorToXML=function(){var e=this,n=new t.StringBuilder;return this.changes.length>0&&(n.Append("<"+this.mirroredID+">"),this.changes.forEach((function(t){n.Append("<"+E.MG_TAG_PARAM+" "+r.XMLConstants.MG_ATTR_NAME+'="'+r.XmlParser.escape(t)+'" '),e.values.ContainsKey(t)?n.Append(e.values.get_Item(t).mirrorToXML()):n.Append('removed="Y"'),n.Append(">")})),n.Append("</"+this.mirroredID+">")),this.changes.Clear(),n.ToString()},a.prototype.fillData=function(e){for(;this.mirrorFromXML(e.getNextTag(),e););},a.prototype.RestoreGlobalParams=function(e){for(var t=new r.XmlParser(e);this.mirrorFromXML(t.getNextTag(),t););},a.prototype.mirrorFromXML=function(e,t){return null!==e&&(e===this.mirroredID?(t.setCurrIndex2EndOfTag(),this.fillDataEntry(t),!0):e==="/"+this.mirroredID?(this.changes.Clear(),t.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in MirrorPrmMap.mirrorFromXML(): "+e),!1))},a.prototype.fillDataEntry=function(t){for(var n=t.getNextTag();n===E.MG_TAG_PARAM;){var a=t.getXMLdata().indexOf(r.XMLConstants.MG_ATTR_NAME+'="',t.getCurrIndex())+r.XMLConstants.MG_ATTR_NAME.length+2;t.setCurrIndex(a);var s=t.getXMLdata().indexOf('"',a),i=t.getXMLsubstring(s).trim();t.setCurrIndex(s);var o=this.new();switch(o.init(i,t)){case e.ParamParseResult.OK:this.values.set_Item(i,o);break;case e.ParamParseResult.TOUPPER:this.values.set_Item(i.toUpperCase(),o);break;case e.ParamParseResult.DELETE:this.values.Remove(i)}t.setCurrIndex2EndOfTag(),n=t.getNextTag()}},a}(Je),et=function(){function e(){this._environments=new t.Hashtable,this._contextInactivityTimeout=0,this._clientContextInactivityTimeout=0,this._contextInactivityWarningTime=0,this._toolitipTimeout=0,this._contextUnloadTimeout=0,this._accessTest=!1,this._canReplaceDecimalSeparator=!1,this._codePage=0,this._dateSeparator="\0",this._decimalSeparator="\0",this._thousandsSeparator="\0",this._timeSeparator="\0",this._defaultColor=0,this._defaultFocusColor=0,this._guid=null,this._controlsPersistencyPath=null,this._imeAutoOff=!1,this._language="\0",this._localAs400Set=!1,this._localExtraGengo=null,this._localFlags=null,this._lowHigh=!0,this._owner=null,this._debugMode=0,this._significantNumSize=0,this._specialAnsiExpression=!1,this._specialShowStatusBarPanes=!1,this._specialRouteToRootProgOnContextRecreation=!1,this._specialEditLeftAlign=!1,this._specialSwfControlName=!1,this._specialExitCtrl=!1,this._specialTextSizeFactoring=!1,this._specialFlatEditOnClassicTheme=!1,this._specialCancelOnCreate=!1,this._system=null,this._terminal=0,this._userId=null,this._userInfo=null,this._forwardSlash=r.Constants.ForwardSlashWebUsage,this._dropUserFormats=null,this._webclientReinitSession="N",this._specialValNewPolicy=!1,this.SpecialOldZorder=!1,this.IgnoreReplaceDecimalSeparator=!1}return Object.defineProperty(e.prototype,"Language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialNumpadPlusChar",{get:function(){return!0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialRestoreMaximizedForm",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialIgnoreBGinModify",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ForwardSlashUsage",{get:function(){return this._forwardSlash},set:function(e){this._forwardSlash=e},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e){arguments[0]instanceof r.XmlParser?this.fillData_0(e):this.fillData_1(e)},e.prototype.fillData_0=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_ENV)+E.MG_TAG_ENV.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);this.fillData(a),e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.FillData() out of string bounds")},e.prototype.fillData_1=function(e){var t,a,s,i;n.Manager.UtilImeJpn;i=new tt;for(var o=0;o<e.length;o+=2)switch(t=e.get_Item(o),a=e.get_Item(o+1),a=r.XmlParser.unescape(a),t){case E.MG_ATTR_THOUSANDS:this._thousandsSeparator=a[0];break;case E.MG_ATTR_DECIMAL_SEPARATOR:this._decimalSeparator=a[0];break;case E.MG_ATTR_WEBCLIENT_REINIT_SESSION:this._webclientReinitSession=a[0];break;case E.MG_ATTR_DATE:this._dateSeparator=a[0],n.DisplayConvertor.Instance.setDateChar(this._dateSeparator.charCodeAt(0));break;case E.MG_ATTR_TIME:this._timeSeparator=a[0];break;case E.MG_ATTR_OWNER:this._owner=a;break;case E.MG_ATTR_SIGNIFICANT_NUM_SIZE:this._significantNumSize=r.XmlParser.getInt(a);break;case E.MG_ATTR_DEBUG_MODE:this._debugMode=r.XmlParser.getInt(a);break;case E.MG_ATTR_POINT_TRANSLATION:this._canReplaceDecimalSeparator=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_EXITCTRL:this._specialExitCtrl=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOWHIGH:this._lowHigh=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ACCESS_TEST:this._accessTest=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_TEXT_SIZE_FACTORING:this._specialTextSizeFactoring=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME:this._specialFlatEditOnClassicTheme=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ENCODING:" "!==a&&(this._codePage=r.XmlParser.getInt(a),r.UtilStrByteMode.Encoding=this.GetEncoding());break;case E.MG_ATTR_SYSTEM:this._system=r.XmlParser.unescape(a);break;case E.MG_ATTR_COMPONENT:i.CompIdx=r.XmlParser.getInt(a);break;case E.MG_ATTR_DATEMODE:i.DateMode=a[0];break;case E.MG_ATTR_CENTURY:i.Century=r.XmlParser.getInt(a);break;case E.MG_ATTR_IDLETIME:i.IdleTime=r.XmlParser.getInt(a),0===i.IdleTime&&(i.IdleTime=1);break;case E.MG_ATTR_UPD_IN_QUERY:i.UpdateInQueryMode=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_CRE_IN_MODIFY:i.CreateInModifyMode=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_DEFAULT_COLOR:this._defaultColor=r.XmlParser.getInt(a);break;case E.MG_ATTR_DEFAULT_FOCUS_COLOR:this._defaultFocusColor=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT:this._contextInactivityTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CLIENT_CONTEXT_INACTIVITY_TIMEOUT:this._clientContextInactivityTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME:this._contextInactivityWarningTime=r.XmlParser.getInt(a);break;case E.MG_ATTR_TOOLTIP_TIMEOUT:this._toolitipTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT:this._contextUnloadTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_IME_AUTO_OFF:this._imeAutoOff=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOCAL_AS400SET:this._localAs400Set=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOCAL_EXTRA_GENGO:this._localExtraGengo=a,r.UtilDateJpn.getInstance().addExtraGengo(this._localExtraGengo);break;case E.MG_ATTR_LOCAL_FLAGS:this._localFlags=a;break;case E.MG_ATTR_SPEACIAL_ANSI_EXP:this._specialAnsiExpression=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES:this._specialShowStatusBarPanes=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION:this._specialRouteToRootProgOnContextRecreation=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN:this._specialEditLeftAlign=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPEACIAL_SWF_CONTROL_NAME:this._specialSwfControlName=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LANGUAGE:this._language=a[0];break;case E.MG_ATTR_USERID:this._userId=a;break;case E.MG_TAG_USERNAME:ne.Instance.setUsername(a);break;case E.MG_ATTR_TERMINAL:this._terminal=r.XmlParser.getInt(a);break;case E.MG_ATTR_USERINFO:this._userInfo=a;break;case E.MG_ATTR_GUID:this._guid=a;break;case E.MG_ATTR_CONTROLS_PERSISTENCY_PATH:this._controlsPersistencyPath=a;break;case E.MG_ATTR_PROJDIR:i.ProjDir=a;break;case E.MG_ATTR_DROP_USERFORMATS:this._dropUserFormats=a;break;case E.MG_ATTR_SPECIAL_VAL_NEW_POLICY:this._specialValNewPolicy=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_CANCEL_ON_CREATE:this._specialCancelOnCreate=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_LEGACY_TRIM_RANGE:case E.MG_ATTR_SPECIAL_LEGACY_EMPTY_RANGE:case E.MG_ATTR_DEFAULT_DISABLED_COLOR:case E.MG_ATTR_SPECIAL_ANSI_BLOB_CHECK_NULL:case E.MG_ATTR_SPECIAL_TABLE_REDUCE_TITLE_HEIGHT:case E.MG_ATTR_SPECIAL_DOTNET_ALLOW_ZERO_DATE:case E.MG_ATTR_SPECIAL_REUSE_TABLE_EDITOR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.fillData(): unknown attribute: "+t)}s=i.CompIdx,this._environments.set_Item(s,i)},e.prototype.fillFromUrl=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=n.getXMLdata(),-1!==(s=n.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,n.getCurrIndex()))&&s<a.length?(i=n.getXMLsubstring(s),n.add2CurrIndex(i.indexOf(e)+e.length),l=r.XmlParser.getTokens(n.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM),t.Debug.Assert(l.get_Item(0)===r.XMLConstants.MG_ATTR_VALUE),""!==(u=l.get_Item(1)).trim()?[3,1]:(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Empty cached file URL: '{0}'",i.trim())),[3,3])):[3,4];case 1:return[4,Te.GetContent(u,!0)];case 2:c=T.sent();try{switch(e){case E.MG_TAG_KBDMAP_URL:break;case E.MG_TAG_ENV_PARAM_URL:for(_=new r.XmlParser(c);o.envParamsTable.mirrorFromXML(_.getNextTag(),_););}}catch(n){switch(e){case E.MG_TAG_KBDMAP_URL:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Keyboard Mapping: '{0}'{1}{2}",u,r.OSEnvironment.EolSeq,n.Message));break;case E.MG_TAG_ENV_PARAM_URL:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Env Params Table: '{0}'{1}{2}",u,r.OSEnvironment.EolSeq,n.Message))}}T.label=3;case 3:-1!==(s=a.indexOf(r.XMLConstants.TAG_OPEN,s))&&n.setCurrIndex(s),T.label=4;case 4:return[2]}}))}))},e.prototype.getEnvDet=function(e){var t=this._environments.get_Item(e);return null===t&&r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.getEnvDet() there is no env"),t},e.prototype.GetDateMode=function(e){return this.getEnvDet(e).DateMode},e.prototype.GetThousands=function(){return this._thousandsSeparator},e.prototype.GetDecimal=function(){return this._decimalSeparator},e.prototype.setDecimalSeparator=function(e){this._decimalSeparator=e},e.prototype.setThousandsSeparator=function(e){this._thousandsSeparator=e},e.prototype.setDateSeparator=function(e){this._dateSeparator=e},e.prototype.setTimeSeparator=function(e){this._timeSeparator=e},e.prototype.GetDate=function(){return this._dateSeparator},e.prototype.getIdleTime=function(e){return this.getEnvDet(e).IdleTime},e.prototype.getOwner=function(){return this._owner},e.prototype.GetTime=function(){return this._timeSeparator},e.prototype.GetCentury=function(e){return this.getEnvDet(e).Century},e.prototype.allowUpdateInQueryMode=function(e){return this.getEnvDet(e).allowUpdateInQueryMode()},e.prototype.allowCreateInModifyMode=function(e){return this.getEnvDet(e).allowCreateInModifyMode()},e.prototype.GetSignificantNumSize=function(){return this._significantNumSize},e.prototype.setSignificantNumSize=function(e){this._significantNumSize=e},e.prototype.getCodePage=function(){return this._codePage},e.prototype.GetEncoding=function(){var e;try{e=t.Encoding.GetEncoding(this._codePage)}catch(t){e=null}return e},e.prototype.getSystem=function(){return this._system},e.prototype.GetDebugLevel=function(){return this._debugMode},e.prototype.CanReplaceDecimalSeparator=function(){return!this.IgnoreReplaceDecimalSeparator&&this._canReplaceDecimalSeparator},e.prototype.getClientContextInactivityTimeout=function(){return this._clientContextInactivityTimeout},e.prototype.getContextInactivityTimeout=function(){return this._contextInactivityTimeout},e.prototype.getContextInactivityWarningTime=function(){return this._contextInactivityWarningTime},e.prototype.getContextUnloadTimeout=function(){return this._contextUnloadTimeout},e.prototype.GetTooltipTimeout=function(){return this._toolitipTimeout},e.prototype.GetSpecialEditLeftAlign=function(){return this._specialEditLeftAlign},e.prototype.getLowHigh=function(){return this._lowHigh},e.prototype.GetDefaultColor=function(){return this._defaultColor},e.prototype.GetDefaultFocusColor=function(){return this._defaultFocusColor},e.prototype.getSpecialExitCtrl=function(){return this._specialExitCtrl},e.prototype.GetImeAutoOff=function(){return this._imeAutoOff},e.prototype.GetLocalAs400Set=function(){return this._localAs400Set},e.prototype.getLocalExtraGengo=function(){return this._localExtraGengo},e.prototype.GetLocalFlag=function(e){return null!==this._localFlags&&this._localFlags.indexOf(e)>=0},e.prototype.getSpecialAnsiExpression=function(){return this._specialAnsiExpression},e.prototype.getSpecialShowStatusBarPanes=function(){return this._specialShowStatusBarPanes},e.prototype.getTerminal=function(){return this._terminal},e.prototype.getWebClientReinitSession=function(){return this._webclientReinitSession},e.prototype.setWebClientReinitSession=function(e){this._webclientReinitSession=e},e.prototype.getSpecialRouteToRootProgOnContextRecreation=function(){return this._specialRouteToRootProgOnContextRecreation},e.prototype.getUserID=function(){return this._userId},e.prototype.getUserInfo=function(){return this._userInfo},e.prototype.GetGUID=function(){return this._guid},e.prototype.GetControlsPersistencyPath=function(){return this._controlsPersistencyPath},e.prototype.getProjDir=function(e){return this.getEnvDet(e).ProjDir},e.prototype.GetSpecialEngLogon=function(){return!1},e.prototype.GetSpecialIgnoreButtonFormat=function(){return!1},e.prototype.GetSpecialSwfControlNameProperty=function(){return this._specialSwfControlName},e.prototype.GetSpecialLogInternalExceptions=function(){return!0},e.prototype.setOwner=function(e){this._owner=e},e.prototype.setDateMode=function(e,t){this.getEnvDet(e).DateMode=t},e.prototype.setCentury=function(e,t){this.getEnvDet(e).Century=t},e.prototype.setIdleTime=function(e,t){this.getEnvDet(e).IdleTime=t},e.prototype.setAllowUpdateInQueryMode=function(e,t){this.getEnvDet(e).UpdateInQueryMode=t},e.prototype.setAllowCreateInModifyMode=function(e,t){this.getEnvDet(e).CreateInModifyMode=t},e.prototype.setContextInactivityTimeout=function(e){this._contextInactivityTimeout=e},e.prototype.setClientContextInactivityTimeout=function(e){this._clientContextInactivityTimeout=e},e.prototype.setContextInactivityWarningTime=function(e){this._contextInactivityWarningTime=e},e.prototype.setContextUnloadTimeout=function(e){this._contextUnloadTimeout=e},e.prototype.setTerminal=function(e){this._terminal=e},e.prototype.GetDropUserFormats=function(){return this._dropUserFormats},e.prototype.GetSpecialTextSizeFactoring=function(){return this._specialTextSizeFactoring},e.prototype.GetSpecialFlatEditOnClassicTheme=function(){return this._specialFlatEditOnClassicTheme},e.prototype.GetSpecialDisableMouseWheel=function(){throw new t.NotImplementedException},e.prototype.GetSpecialValNewPolicy=function(){return this._specialValNewPolicy},e.prototype.GetSpecialCancelOnCreate=function(){return this._specialCancelOnCreate},e}();et.Instance=new et;var tt=function(){function e(){this._createInModifyMode=!1,this._updateInQueryMode=!1,this.CompIdx=0,this.DateMode="\0",this.Century=0,this.IdleTime=0,this.ProjDir=null,this.CompIdx=0}return Object.defineProperty(e.prototype,"UpdateInQueryMode",{set:function(e){this._updateInQueryMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreateInModifyMode",{set:function(e){this._createInModifyMode=e},enumerable:!1,configurable:!0}),e.prototype.allowUpdateInQueryMode=function(){return this._updateInQueryMode},e.prototype.allowCreateInModifyMode=function(){return this._createInModifyMode},e}(),rt=function(a){function s(e){var t=this;if(0!==arguments.length)return(t=a.call(this)||this).constructor_3(e),t;(t=a.call(this)||this).constructor_2()}return u(s,a),s.prototype.constructor_2=function(){},s.prototype.constructor_3=function(e){a.prototype.Copy.call(this,e)},s.prototype.mirrorToXML=function(){var e,t=et.Instance.GetDebugLevel()<=1,s=this.Attr===r.StorageAttribute.BLOB_VECTOR?this.VectorField.getCellsType():r.StorageAttribute.SKIP;return e=n.RecordUtils.itemValToXML(a.prototype.ToMgVal.call(this),this.Attr,s,t),E.MG_ATTR_PAR_ATTRS+'="'+this.Attr+'" '+E.MG_ATTR_LEN+"="+e.length+" "+E.MG_ATTR_ENV_VALUE+'="'+e+'"'},s.prototype.init=function(s,i){var o,l,u,c,_,T,h,p,g,d,I=null;if(T=i.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,i.getCurrIndex())-i.getCurrIndex(),-1!==(l=t.NString.IndexOf(i.getXMLdata(),E.MG_ATTR_PAR_ATTRS,i.getCurrIndex(),T)))l+=E.MG_ATTR_PAR_ATTRS.length+2,g=i.getXMLdata().substr(l,1),u=i.getXMLdata().indexOf(E.MG_ATTR_LEN,l),u+=E.MG_ATTR_LEN.length+1,_=i.getXMLdata().indexOf(" ",u),c=r.XmlParser.getInt(i.getXMLdata().substr(u,_-u)),o=i.getXMLdata().indexOf(E.MG_ATTR_ENV_VALUE,u),o+=E.MG_ATTR_ENV_VALUE.length+2,d=i.getXMLdata().substr(o,c),h=g[0],I=n.RecordUtils.getString(d,h),p=!1,i.setCurrIndex(o+c);else{if(-1!==i.getXMLdata().indexOf(E.MG_ATTR_ENV_REMOVED,i.getCurrIndex()))return e.ParamParseResult.DELETE;h=r.StorageAttribute.NONE,p=!0}return a.prototype.Init.call(this,h,p,I),e.ParamParseResult.TOUPPER},s}(n.ExpVal),nt=function(e){function t(){var t=e.call(this,rt)||this;return t.mirroredID=E.MG_TAG_GLOBALPARAMSCHANGES,t}return u(t,e),t.prototype.set=function(t,r){r.IsNull||r.isEmptyString()?e.prototype.remove.call(this,t.trim().toUpperCase()):e.prototype.setValue.call(this,t.trim().toUpperCase(),new rt(r))},t.prototype.get=function(t){try{return e.prototype.getvalue.call(this,t.trim().toUpperCase())}catch(e){return null}},t}($e);nt.Instance=new nt;var at=function(){function e(){this.UserName=null,this.UserID=null,this.UserInfo=null,this.Password=null,this.IsLoggedIn=!1,this.UserName=t.NString.Empty,this.UserInfo=t.NString.Empty,this.IsLoggedIn=!1,this.setUserID(t.NString.Empty)}return e.prototype.setIsLoggedIn=function(e){this.IsLoggedIn=e},e.prototype.getIsLoggedIn=function(){return this.IsLoggedIn},e.prototype.setUserID=function(e){this.UserID=e,0==this.UserID.length||this.UserID===t.NString.Empty?this.setIsLoggedIn(!1):this.setIsLoggedIn(!0)},Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e){var t,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_USER_DETAILS)+E.MG_TAG_USER_DETAILS.length),t=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),this.initElements(t),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in UserDetails.fillData(): out of bounds")},e.prototype.initElements=function(e){var t,a,s,i=!0;for(s=0;s<e.length;s+=2)if(t=e.get_Item(s),a=e.get_Item(s+1),t===E.MG_TAG_IS_LOGGED_IN)this.setIsLoggedIn("1"===a[0]),n.Commands.addIsLoggedIn(this.getIsLoggedIn());else r.Logger.Instance.WriteExceptionToLogWithMsg("in UserDetails.initElements(): unknown attribute: "+t),i=!1;return i},e}();at._instance=null;var st=function(){function e(e){this._exp=null,this._val=!1,this._val=e,this._exp=null}return e.prototype.setVal=function(e,t){switch(t[0]){case"Y":this._val=!0;break;case"N":this._val=!1;break;default:var n=r.XmlParser.getInt(t);null!=e&&(this._exp=e.getExpById(n))}},e.prototype.getVal=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(a){switch(a.label){case 0:return null===this._exp?[3,3]:(t=(e=n.DisplayConvertor).toBoolean,[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)]);case 1:return[4,t.apply(e,[a.sent()])];case 2:return[2,a.sent()];case 3:return[2,this._val]}}))}))},e.prototype.isServerExp=function(){return null!=this._exp&&this._exp.computedByServerOnly()},e.prototype.isClientExp=function(){return null!=this._exp&&this._exp.computedByClientOnly()},e}(),it=function(){function e(){this._condExp=new st(!0),this._retainFocus=new st(!1),this._waitExp=new st(!1),this._syncData=new st(!1),this._argList=null,this._blockClose=0,this._blockEnd=0,this._buttons="\0",this._checkByServer=!1,this._cmdToServer=null,this._display="S",this._errLogAppend=!1,this._evtHandler=null,this._execOnServer=!1,this._execOnClient=!1,this._exp=null,this._field=null,this._globalParamsShouldBeCopied=!1,this._image="\0",this._incremental=!1,this._methodNameSnippet=null,this._mode="\0",this._prgDescription=null,this._publicName=null,this._returnVal=null,this._rtEvt=null,this._serverId=-1,this.calledTaskDefinitionId=null,this._show=r.CallOsShow.Normal,this._subformCtrlName=null,this._subtype="\0",this._task=null,this._text=null,this._title=null,this._titleExp=null,this._type=0,this._undo=!0,this._isRoute=!1,this._routerPath=null,this._originalRouterOutletName=null,this._routeParams=null,this.OperCallMode=0}return Object.defineProperty(e.prototype,"CalledTaskDefinitionId",{get:function(){return this.calledTaskDefinitionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Task",{get:function(){return this._task},set:function(e){this._task=e},enumerable:!1,configurable:!0}),e.prototype.Immediate=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._waitExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.fillData=function(e,t,r){for(this._task=e,this._evtHandler=t;this.initInnerObjects(r,r.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EVENT)this._rtEvt=new w(n),this._rtEvt.fillData(e,n);else if(t===E.MG_TAG_OPER)this.fillAttributes(e,n);else{if(t==="/"+E.MG_TAG_OPER)return e.setCurrIndex2EndOfTag(),!1;if(t!==r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY)return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Operation. Insert else if to Operation.initInnerObjects for "+t),!1;this.InitTaskDefinitionID(e)}return!0},e.prototype.fillAttributes=function(e,t){var n,a=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==a&&a<e.getXMLdata().length){var s=e.getXMLsubstring(a);return e.add2CurrIndex(s.indexOf(E.MG_TAG_OPER)+E.MG_TAG_OPER.length),n=r.XmlParser.getTokens(e.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),this.initElements(n,t),void e.setCurrIndex(a+r.XMLConstants.TAG_CLOSE.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of string bounds")},e.prototype.initElements=function(n,a){for(var s,i,o,l=0;l<n.length;l+=2)switch(s=n.get_Item(l),i=n.get_Item(l+1),s){case r.XMLConstants.MG_ATTR_TYPE:this._type=r.XmlParser.getInt(i);break;case E.MG_ATTR_FLD:this._field=e.InitField(i,this._task);break;case r.XMLConstants.MG_ATTR_EXP:o=r.XmlParser.getInt(i),this._exp=a.getExpById(o);break;case E.MG_ATTR_TEXT:this._text=r.XmlParser.unescape(i);break;case E.MG_ATTR_MODE:this._mode=i[0];break;case E.MG_ATTR_SUBTYPE:this._subtype=i[0],this._type===E.MG_OPER_BLOCK&&("E"===this._subtype?this._type=E.MG_OPER_ELSE:"L"===this._subtype&&(this._type=E.MG_OPER_LOOP));break;case E.MG_ATTR_CLOSE:this._blockClose=r.XmlParser.getInt(i);break;case E.MG_ATTR_END:this._blockEnd=r.XmlParser.getInt(i);break;case E.MG_ATTR_HOW:this._incremental="I"===i;break;case E.MG_ATTR_UNDO:"N"===i[0]?this._undo=!1:"Y"===i[0]?this._undo=!0:r.Logger.Instance.WriteExceptionToLogWithMsg("in Operation.initElements(): No such value to the MG_ATTR_UNDO for "+i);break;case E.MG_ATTR_DISPLAY:this._display=i[0];break;case E.MG_ATTR_WAIT:this._waitExp.setVal(a,i);break;case E.MG_ATTR_RETAIN_FOCUS:this._retainFocus.setVal(a,i);break;case E.MG_ATTR_SYNC_DATA:this._syncData.setVal(a,i);break;case E.MG_ATTR_SHOW:this._show=r.XmlParser.getInt(i);break;case E.MG_ATTR_CND:this._condExp.setVal(a,i);break;case E.MG_ATTR_ARGLIST:this._argList=new L,this._argList.fillList(i,this._task);break;case E.MG_ATTR_REFRESHON:this._argList.RefreshOnString=i.Trim();break;case E.MG_ATTR_SERVER_ID:this._serverId=r.XmlParser.getInt(i);break;case E.MG_ATTR_OPER_CALLMODE:this.OperCallMode=i[0];break;case E.MG_ATTR_SUBFORM_CTRL:this._subformCtrlName=r.XmlParser.unescape(i);break;case E.MG_ATTR_CHECK_BY_SERVER:this._checkByServer=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_PUBLIC:this._publicName=i;break;case E.MG_ATTR_PRG_DESCRIPTION:this._prgDescription=i;break;case E.MG_ATTR_CPY_GLB_PRMS:this._globalParamsShouldBeCopied=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_EXEC_ON_SERVER:this._execOnServer=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_EXEC_ON_CLIENT:this._execOnClient=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_TITLE:this._title=r.XmlParser.unescape(i);break;case E.MG_ATTR_TITLE_EXP:o=r.XmlParser.getInt(i),this._titleExp=a.getExpById(o);break;case E.MG_ATTR_IMAGE:this._image=i[0];break;case E.MG_ATTR_BUTTONS:this._buttons=i[0];break;case E.MG_ATTR_RETURN_VAL:this._returnVal=e.InitField(i,this._task);break;case E.MG_ATTR_ERR_LOG_APPEND:this._errLogAppend=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_OPER_METHODNAME:this._methodNameSnippet=i;break;case E.MG_ATTR_IS_GUI_THREAD_EXECUTION:r.XmlParser.getBoolean(i);break;case E.MG_ATTR_IS_ROUTE:this._isRoute=r.XmlParser.getBoolean(i);break;case r.XMLConstants.MG_ATTR_ROUTER_PATH:this._routerPath=r.XmlParser.unescape(i);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Operation class. Insert case to Operation.initElements for "+s)}if(this._serverId>-1&&(this._cmdToServer=Qe.CreateExecOperCommand(this._task.getTaskTag(),""+this._evtHandler.getId(),this._serverId,t.Int32.MinValue,null)),this._isRoute&&(this._originalRouterOutletName=null!==this._subformCtrlName?this._subformCtrlName:"",null==this._subformCtrlName)){var u=this._task.getForm().DefaultRouterOutlet;this._subformCtrlName=null!==u?u.Name:""}},e.prototype.InitTaskDefinitionID=function(e){var t=e.ReadToEndOfCurrentElement();new n.TaskDefinitionIdTableSaxHandler(this.SetTaskDefinitionId).parse(t)},e.prototype.SetTaskDefinitionId=function(e){this.calledTaskDefinitionId=e},e.InitField=function(e,n){var a=r.XmlParser.getTokens(e,",");if(2===a.length){var s=t.NNumber.Parse(a.get_Item(0)),i=t.NNumber.Parse(a.get_Item(1));return n.getFieldDef(s,i)}return r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unknown field: '{0}'",e)),null},e.prototype.execute=function(e){return T(this,void 0,void 0,(function(){var n,a,s,i,l,u,c,_,T,p,g,d,I,f;return h(this,(function(h){switch(h.label){case 0:return n=o.eventsManager.getLastRtEvent(),a=null,s=U.Instance,null!==n&&(a=n.getMainPrgCreator()),!e&&(e||this._type===E.MG_OPER_SERVER&&this._condExp.isServerExp())?[3,4]:[4,this.canExecute()];case 1:return h.sent()?[3,4]:this._type===E.MG_OPER_LOOP?[3,3]:[4,s.addFlowFieldOperation(this,!1,this._task.GetTaskDetails())];case 2:h.sent(),h.label=3;case 3:return[2,!1];case 4:return this._type===E.MG_OPER_LOOP||this._type===E.MG_OPER_ENDBLOCK?[3,6]:[4,s.addFlowFieldOperation(this,!0,this._task.GetTaskDetails())];case 5:h.sent(),h.label=6;case 6:switch(h.trys.push([6,42,,43]),this._type){case E.MG_OPER_VERIFY:return[3,7];case E.MG_OPER_BLOCK:return[3,9];case E.MG_OPER_LOOP:return[3,10];case E.MG_OPER_ELSE:return[3,13];case E.MG_OPER_EVALUATE:return[3,14];case E.MG_OPER_UPDATE:return[3,16];case E.MG_OPER_RAISE_EVENT:return[3,18];case E.MG_OPER_SERVER:return[3,20];case E.MG_OPER_CALL:return[3,22]}return[3,40];case 7:return[4,this.operVerify()];case 8:return[2,h.sent()];case 9:return[2,this.operBlock()];case 10:return this.getExecOnServer()?[3,11]:[2,this.operBlock()];case 11:return[4,this.operServer(a)];case 12:return h.sent(),[3,41];case 13:return[2,this.operElse()];case 14:return[4,this.operEvaluate()];case 15:return h.sent(),[3,41];case 16:return[4,this.operUpdate(a)];case 17:return h.sent(),[3,41];case 18:return[4,this.operRaiseEvent(a,e)];case 19:return h.sent(),[3,41];case 20:return[4,this.operServer(a)];case 21:return h.sent(),[3,41];case 22:return null==this._publicName?[3,23]:(this.operCallParallel(),[3,39]);case 23:return null!=this._subformCtrlName?[3,25]:[4,this.operCall(a)];case 24:return h.sent(),[3,39];case 25:return i=void 0,l=!0,this._checkByServer?(this._cmdToServer instanceof q||t.Debug.Assert(!1),(u=this._cmdToServer).CheckOnly=!0,[4,this.operCall(a)]):[3,27];case 26:h.sent(),u.CheckOnly=!1,o.eventsManager.getNextOperIdx(this,!0)>-1&&(l=!1),h.label=27;case 27:return l?(c=this._task.getForm().getSubFormCtrlByName(this._subformCtrlName),!this._isRoute||null!==c&&c.IsRouterOutlet()?null==c?[3,37]:this._isRoute?(_=!1,null===(d=o.eventsManager.getLastRtEvent())?[3,32]:(this._routeParams=d.getRouteParamList(),[4,d.getArgList().getArg(0).getValue(r.StorageAttribute.ALPHA,0)])):[3,32]:[2,!1]):[3,39];case 28:return(T=h.sent().trim()===this._routerPath)?(p=d.getArgList().getArg(1).skipArg())?[3,30]:[4,d.getArgList().getArg(1).getValue(r.StorageAttribute.ALPHA,0)]:[3,31];case 29:p=h.sent().trim()===this._originalRouterOutletName,h.label=30;case 30:T=p,h.label=31;case 31:if(T&&(_=!0),!_)return[2,!1];h.label=32;case 32:return null==(i=c.getSubformTask())?[3,34]:(g=!0,d=o.eventsManager.getLastRtEvent(),this._isRoute&&null!==d&&d.isGuiTriggeredEvent()&&(g=!1,o.eventsManager.setStopExecution(!0)),[4,i.endTask(!0,!1,!g,!0)]);case 33:if(!h.sent())return[3,41];(I=c.getForm().getTask()).TaskService.RemoveRecomputes(I,i),h.label=34;case 34:return null!=G.getLastFocusedControl()&&G.getLastFocusedControl().isDescendentOfControl(c)?(this._task.RetainFocus=!1,[3,37]):[3,35];case 35:return f=this._task,[4,this._retainFocus.getVal()];case 36:f.RetainFocus=h.sent(),h.label=37;case 37:return[4,this.operCall(a)];case 38:h.sent(),h.label=39;case 39:return[2,this._isRoute];case 40:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such type of operation "+this._type),[3,41];case 41:return[3,43];case 42:throw h.sent();case 43:return[2,!0]}}))}))},e.prototype.operCallParallel=function(){e.callParallel(this._task,this._publicName,this._argList,this._globalParamsShouldBeCopied,this._prgDescription)},e.callParallel=function(e,t,r,n,a){},e.prototype.getCondVal=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._condExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.getType=function(){return this._type},e.prototype.getRouteParams=function(){return this._routeParams},e.prototype.getServerId=function(){return this._serverId},e.prototype.operVerify=function(){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return a=this._mode===E.FLW_VERIFY_MODE_ERROR,null!==this._exp?[3,1]:(i=this._text,[3,3]);case 1:return[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.UNICODE,255)];case 2:i=h.sent(),h.label=3;case 3:return s=i,null!==this._titleExp?[3,4]:(l=this._title,[3,6]);case 4:return[4,this._titleExp.evaluateWithResultTypeAndLength(r.StorageAttribute.UNICODE,255)];case 5:l=h.sent(),h.label=6;case 6:return o=l,s=null===s?"":r.StrUtil.rtrim(s),o=null===o?"":r.StrUtil.rtrim(o),this._errLogAppend&&(u=this._task.GetContextTask().GetComputedProperty(n.PropInterface.PROP_TYPE_NAME).GetComputedValue(),r.Logger.Instance.WriteExceptionToLogWithMsg(s+", program : "+u)),this._display!==E.DISPLAY_STATUS?[3,7]:(t.NString.IsNullOrEmpty(s)||(U.Instance.addFlowVerifyInfo(s,this._task.GetTaskDetails()),this._task.GetContextTask().WriteToMessagePane(s,!1)),[3,12]);case 7:return t.NString.IsNullOrEmpty(s)?[3,12]:(c=pe.Instance.translate(s),_=pe.Instance.translate(o),T=T=(T=e.getButtons(this._buttons))||e.getImage(this._image),r.UtilStrByteMode.isLocaleDefLangJPN()&&0<=(p=c.indexOf("|"))&&p<c.length&&(_=c.substr(p+1),c=c.substr(0,p)),g=null,this._task.GetContextTask().getMGData().IsAborting||(g=this._task.GetContextTask().getTopMostForm()),null==g&&null!=G.Instance.getLastFocusedTask()&&(g=G.Instance.getLastFocusedTask().getTopMostForm()),null==g?[3,9]:(g.RefreshUI(),n.Commands.invoke(),[4,t.Thread.Sleep(10)]));case 8:h.sent(),h.label=9;case 9:return[4,ge.Instance.MessageBox(_,c,T)];case 10:return d=h.sent(),[4,e.setoperVerifyReturnValue(d,this._returnVal)];case 11:h.sent(),h.label=12;case 12:return[2,a]}}))}))},e.getButtons=function(e){var t=0;switch(e){case E.BUTTONS_OK:t=n.Styles.MSGBOX_BUTTON_OK;break;case E.BUTTONS_OK_CANCEL:t=n.Styles.MSGBOX_BUTTON_OK_CANCEL;break;case E.BUTTONS_ABORT_RETRY_IGNORE:t=n.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE;break;case E.BUTTONS_YES_NO_CANCEL:t=n.Styles.MSGBOX_BUTTON_YES_NO_CANCEL;break;case E.BUTTONS_YES_NO:t=n.Styles.MSGBOX_BUTTON_YES_NO;break;case E.BUTTONS_RETRY_CANCEL:t=n.Styles.MSGBOX_BUTTON_RETRY_CANCEL}return t},e.getImage=function(e){var t=0;switch(e){case E.IMAGE_EXCLAMATION:t=n.Styles.MSGBOX_ICON_EXCLAMATION;break;case E.IMAGE_CRITICAL:t=n.Styles.MSGBOX_ICON_ERROR;break;case E.IMAGE_QUESTION:t=n.Styles.MSGBOX_ICON_QUESTION;break;case E.IMAGE_INFORMATION:t=n.Styles.MSGBOX_ICON_INFORMATION}return t},e.setoperVerifyReturnValue=function(e,t){return T(this,void 0,void 0,(function(){var r,a;return h(this,(function(s){switch(s.label){case 0:return null===t?[3,3]:((r=new n.NUM_TYPE).NUM_4_LONG(e),a=r.toXMLrecord(),[4,t.setValueAndStartRecompute(a,!1,!0,!0,!1)]);case 1:return s.sent(),[4,t.updateDisplay()];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},e.prototype.operBlock=function(){return!0},e.prototype.operElse=function(){return!0},e.prototype.operEvaluate=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e="\0",null===this._field?[3,4]:[4,this._exp.evaluateWithResultTypeAndLength(this._field.getType(),this._field.getSize())];case 1:return e=t.sent(),[4,this._field.setValueAndStartRecompute(e,null===e,!0,!0,!1)];case 2:return t.sent(),[4,this._field.updateDisplay()];case 3:return t.sent(),[3,6];case 4:return[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)];case 5:e=t.sent(),t.label=6;case 6:return[2]}}))}))},e.prototype.operUpdate=function(t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return(p=U.Instance).addFlowOperationUpdate(V.FLWMTR_START,this._task.GetTaskDetails()),this._field.DbModifiable||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,2]:[4,this.CanModify(t)];case 1:if(!h.sent())return[2];h.label=2;case 2:return g=this._field.getType(),this._incremental?this._field.IsLinkField?[3,9]:(o=this._field.getValue(!0),T=null!=o?new n.NUM_TYPE(o):null,this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,6]:(this._task.setEvalOldValues(!0),this._field.isNull()?(d=this._field.getMagicDefaultValue(),[3,5]):[3,3])):[3,12];case 3:return[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 4:d=h.sent(),h.label=5;case 5:s=d,this._task.setEvalOldValues(!1),c=new n.NUM_TYPE(s),T=n.NUM_TYPE.sub(T,c),h.label=6;case 6:return this._task.getMode()===r.Constants.TASK_MODE_DELETE?[3,8]:[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 7:null!=(i=h.sent())?(_=new n.NUM_TYPE(i),T=n.NUM_TYPE.add(T,_)):_=T=null,h.label=8;case 8:return a=null!=T?T.toXMLrecord():this._field.getMagicDefaultValue(),[3,11];case 9:return[4,this.operServer(t)];case 10:return h.sent(),[2];case 11:return[3,14];case 12:return[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 13:a=h.sent(),h.label=14;case 14:return g===r.StorageAttribute.BLOB_VECTOR&&null!=a&&(a=e.operUpdateVectors(this._field,a)),u=this._field.getTask()===this._task,l=!u||!this._undo,[4,this._field.setValueAndStartRecompute(a,null==a,!0,l,!1)];case 15:return h.sent(),this._undo||this._field.setUpdated(),this._field.setModified(),[4,this._field.updateDisplay()];case 16:return h.sent(),p.addFlowOperationUpdate(V.FLWMTR_END,this._task.GetTaskDetails()),[2]}}))}))},e.prototype.CanModify=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return(t=this._cmdToServer instanceof q?this._cmdToServer:null).Operation=this,t.MprgCreator=e,[4,this.Task.DataviewManager.Execute(this._cmdToServer)];case 1:return[2,r.sent().Success]}}))}))},e.operUpdateVectors=function(e,a){if(e.getType()===r.StorageAttribute.BLOB_VECTOR){var s=n.VectorType.getCellsAttr(a),i=e.getCellsType();if(r.StorageAttributeCheck.isTheSameType(s,i)){var o=new n.VectorType(a);return o.adjustToFit(e),o.toString()}return null}throw new t.ApplicationException("in operUpdateVectors "+e.getName()+" is not of type vector")},e.prototype.operRaiseEvent=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.Immediate()];case 1:return r=s.sent(),[4,(n=this._rtEvt.replicate()).setPublicName()];case 2:return s.sent(),n.setImmediate(r),n.setMainPrgCreator(null),r?(n.setCtrl(this._task.getLastParkedCtrl()),n.setArgList(this._argList),n.getTask().isMainProg()&&n.setMainPrgCreator(e),o.eventsManager.checkAndSaveRouteEventIfCtxRemovedFromSrvr(n),o.eventsManager.pushExecStack(this._task.getTaskTag(),this._evtHandler.getId().toString(),this._serverId),[4,o.eventsManager.handleEvent(n,t)]):[3,4];case 3:return s.sent(),o.eventsManager.popExecStack(),[3,6];case 4:return[4,(a=new L).Initialize(this._argList)];case 5:s.sent(),n.setArgList(a),n.setTask(null),o.eventsManager.addToTail(n),o.eventsManager.checkAndSaveRouteEventIfCtxRemovedFromSrvr(n),s.label=6;case 6:return[2]}}))}))},e.prototype.operCall=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.operServer(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.operServer=function(e){return T(this,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return r=this._cmdToServer instanceof q?this._cmdToServer:null,t.Debug.Assert(null!==r),this._task.isMainProg()?r.MprgCreator=e:r.MprgCreator=null,r.SetExecutionStack(o.eventsManager.getExecStack()),r.Operation=this,[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._task.getMGData().CmdsToServer,this._cmdToServer,null)];case 1:return n.sent(),[2]}}))}))},e.prototype.getBlockEnd=function(){return this._blockEnd},e.prototype.setBlockEnd=function(e){this._blockEnd=e},e.prototype.getBlockClose=function(){return this._blockClose},e.prototype.setBlockClose=function(e){this._blockClose=e},e.prototype.getTaskTag=function(){return this._task.getTaskTag()},e.prototype.getHandlerId=function(){return this._evtHandler.getId().toString()},e.prototype.getEventHandler=function(){return this._evtHandler},e.prototype.getExecOnServer=function(){return this._execOnServer},e.prototype.setExecOnServer=function(e){this._execOnServer=e},e.prototype.getExecOnClient=function(){return this._execOnClient},e.prototype.canExecute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getCondVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.AddFlowDescription=function(e){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:switch(this._type){case E.MG_OPER_VERIFY:return[3,1];case E.MG_OPER_BLOCK:return[3,2];case E.MG_OPER_LOOP:return[3,3];case E.MG_OPER_ELSE:return[3,4];case E.MG_OPER_EVALUATE:return[3,5];case E.MG_OPER_UPDATE:return[3,6];case E.MG_OPER_ENDBLOCK:return[3,7];case E.MG_OPER_USR_EXIT:return[3,8];case E.MG_OPER_RAISE_EVENT:return[3,9];case E.MG_OPER_SERVER:return[3,11];case E.MG_OPER_CALL:return[3,12]}return[3,13];case 1:return e.Append("Verify: "),null==this._exp?e.Append(this._text):e.Append("Exp #").Append(this._exp.getId()),[3,14];case 2:return e.Append("Block If"),[3,14];case 3:return e.Append("Block Loop"),[3,14];case 4:return e.Append("Block Else"),[3,14];case 5:return e.Append("Evaluate Exp #").Append(this._exp.getId()),[3,14];case 6:return e.AppendFormat("Update {0} with Exp #{1}",this._field.getVarName(),this._exp.getId()),[3,14];case 7:return e.Append("End Block"),[3,14];case 8:return e.Append("Invoke OS"),[3,14];case 9:return e.Append("Raise Event:"),this._rtEvt.AppendDescription(e),r=(t=e).AppendFormat,n=[" (Wait={0})"],[4,this.Immediate()];case 10:return r.apply(t,n.concat([a.sent()?"Y":"N"])),[3,14];case 11:return e.Append("Run server-side operation"),[3,14];case 12:return e.Append("Call program"),[3,14];case 13:return e.AppendFormat("<<Unknown Operation Code {0}>>",this._type),[3,14];case 14:return[2]}}))}))},e.prototype.GetArgList=function(){return this._argList},e.prototype.GetReturnValueField=function(){return this._field},e.prototype.GetSubformControlName=function(){return this._subformCtrlName},e.prototype.toString=function(){return t.NString.Format("Executing operation number {0}",this._serverId+1)},e}(),ot=function(){function n(e){this._reserved=!1,this._value=null,0!==arguments.length?this.constructor_1(e):this.constructor_0()}return n.prototype.constructor_0=function(){this._reserved=!1},n.prototype.constructor_1=function(e){this._value=e,this._reserved=!1},n.prototype.mirrorToXML=function(){return E.MG_ATTR_ENV_VALUE+'="'+r.XmlParser.escape(this._value)+'" '+E.MG_ATTR_ENV_WRITEINI+"=F"},n.prototype.init=function(r,n){var a,s,i,o,l=n.getXMLdata(),u=E.MG_ATTR_ENV_VALUE+'="';return o=l.indexOf("/>",n.getCurrIndex()),-1!==(a=t.NString.IndexOf(l,u,n.getCurrIndex(),o-n.getCurrIndex()))?(a+=u.length,s=-1!==(i=t.NString.IndexOf(l,E.MG_ATTR_ENV_RESERVED+'="',n.getCurrIndex(),o-n.getCurrIndex()))?l.indexOf(E.MG_ATTR_ENV_RESERVED+'="',a)-2:o-1,this._value=l.substr(a,s-a).trim(),-1!==i?(i+=E.MG_ATTR_ENV_RESERVED.length+2,this._reserved="Y"===l[i]):this._reserved=!1,n.setCurrIndex(s),r.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)?e.ParamParseResult.OK:e.ParamParseResult.TOUPPER):-1!==t.NString.IndexOf(l,E.MG_ATTR_ENV_REMOVED,n.getCurrIndex(),o-n.getCurrIndex())?e.ParamParseResult.DELETE:(t.Debug.Assert(!1,"bad XML parsing"),e.ParamParseResult.FAILED)},n.prototype.ToString=function(){return this._value},n.prototype.isReserved=function(){return this._reserved},n}(),lt=function(r){function a(){var e=r.call(this,ot)||this;return e.mirroredID=E.MG_TAG_ENV_PARAM,e}return u(a,r),a.prototype.get=function(e){var n=null,a=null;if("["!==e.charAt(0)?(n=e,e=t.NString.Insert(e,0,E.INI_SECTION_MAGIC_ENV_BRACKETS)):e.startsWith(E.INI_SECTION_MAGIC_ENV_BRACKETS)&&(n=e.substr(E.INI_SECTION_MAGIC_ENV_BRACKETS.length)),e.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)||(e=e.toUpperCase()),null!==n&&(a=this.getFromEnvironment(n)),null!==a)return a;try{var s=r.prototype.getvalue.call(this,e);null!==s&&(a=s.ToString(),null!==n&&(a=this.getProcessedValue(n,a)))}catch(e){}return a},a.prototype.getln=function(e,t){e=e.toUpperCase().trim();for(var r=!1,n=this.values.Keys,a=0;a<n.length;a++){var s=n[a];if(s.startsWith(e)){if(r=!0,!(t>1))return s.substr(e.length)+"="+this.values.get_Item(s);t--}else if(r)break}return null},a.prototype.getFromEnvironment=function(e){switch(e.toLowerCase()){case E.MG_ATTR_DECIMAL_SEPARATOR:return et.Instance.GetDecimal();case E.MG_ATTR_DATE:return n.DisplayConvertor.Instance.getDateChar().toString();case E.MG_ATTR_TIME:return et.Instance.GetTime();case E.MG_ATTR_OWNER:return et.Instance.getOwner();case E.MG_ATTR_DATEMODE:return et.Instance.GetDateMode(G.Instance.getCurrTask().getCompIdx());case E.MG_ATTR_CENTURY:return et.Instance.GetCentury(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_IDLETIME:return et.Instance.getIdleTime(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_UPD_IN_QUERY:return et.Instance.allowUpdateInQueryMode(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_CRE_IN_MODIFY:return et.Instance.allowCreateInModifyMode(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT:return et.Instance.getContextInactivityTimeout().toString();case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT:return et.Instance.getContextUnloadTimeout().toString();case E.MG_ATTR_TERMINAL:return et.Instance.getTerminal().toString();case E.MG_ATTR_WEBCLIENT_REINIT_SESSION:return et.Instance.getWebClientReinitSession()}return null},a.prototype.getProcessedValue=function(e,r){switch(e.toLowerCase()){case E.MG_ATTR_HTTP_TIMEOUT:case E.MG_ATTR_RTF_BUFFER_SIZE:case E.MG_ATTR_RANGE_POP_TIME:case E.MG_ATTR_TEMP_POP_TIME:case E.MG_ATTR_BATCH_PAINT_TIME:return t.NNumber.Parse(r).toString();case E.MG_ATTR_USE_SIGNED_BROWSER_CLIENT:case E.MG_ATTR_CLOSE_PRINTED_TABLES_IN_SUBTASKS:case E.MG_ATTR_GENERIC_TEXT_PRINTING:case E.MG_ATTR_HIGH_RESOLUTION_PRINT:case E.MG_ATTR_MERGE_TRIM:case E.MG_ATTR_ORIGINAL_IMAGE_LOAD:case E.MG_ATTR_PRINT_DATA_TRIM:case E.MG_ATTR_PSCRIPT_PRINT_NT:case E.MG_ATTR_SPECIAL_CONV_ADD_SLASH:case E.MG_ATTR_SPECIAL_FULL_EXPAND_PRINT:case E.MG_ATTR_SPECIAL_FULL_TEXT:case E.MG_ATTR_SPECIAL_LAST_LINE_PRINT:case E.MG_ATTR_SPECIAL_PRINTER_OEM:case E.MG_ATTR_EMBED_FONTS:case E.MG_ATTR_CENTER_SCREEN_IN_ONLINE:case E.MG_ATTR_REPOSITION_AFTER_MODIFY:case E.MG_ATTR_ISAM_TRANSACTION:return"Y"===r[0]||"1"===r[0]?"Y":"N";case E.MG_ATTR_TIME_SEPARATOR:case E.MG_ATTR_IOTIMING:case E.MG_ATTR_THOUSAND_SEPARATOR:return r[0].toString();default:return r}},a.prototype.set=function(n,a){var s=Object.create(null,{setValue:{get:function(){return r.prototype.setValue}},remove:{get:function(){return r.prototype.remove}}});return T(this,void 0,void 0,(function(){var r,i,l,u,c,_,T,p,g,d,I,f,C;return h(this,(function(h){switch(h.label){case 0:for(r=!0,i=!1,_=n,T=new Array(n.length+1),p=new Array(n.length+1),T[0]=0,p[0]="s",g=1,c=1;c<n.length;c++){if("="!==n[c]&&","!==n[c]||"\\"===n[c-1]||(T[g]=c+1,p[g]=n[c],g++),"*"===n[c]){n=t.NString.Remove(n,c,1);break}"\\"===n[c]&&(n=t.NString.Remove(n,c,1))}for(T[g]=n.length+1,p[g]="\0",g++,c=0;c<g-1;c++){if(l=n.substr(T[c],T[c+1]-T[c]-1),"="===n[T[c+1]-1]){for(c++,d=c,I=this.getAllowedSeparators(l),f=0;f<I&&","===p[c+1];f++)c++;u=n.substr(T[d],T[c+1]-T[d]-1)}else u=null;this.isReservedLogicalName(l)?r=!1:("["!==l[0]&&(l=t.NString.Insert(l,0,E.INI_SECTION_MAGIC_ENV_BRACKETS)),l.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)||(l=l.toUpperCase()),l=l.trim(),u=u.trim(),i=!0,!t.NString.IsNullOrEmpty(u)||l.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)?(s.setValue.call(this,l,new ot(u),!a),this.checkSetInEnvironment(l,u)):s.remove.call(this,l))}return a&&i?(C=Qe.CreateIniputForceWriteCommand(_),o.mgDataTable.getMGData(0).CmdsToServer.Add(C),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)]):[3,2];case 1:h.sent(),h.label=2;case 2:return[2,r]}}))}))},a.prototype.isReservedLogicalName=function(e){return!(e.startsWith("[")||(e=t.NString.Insert(e,0,E.INI_SECTION_LOGICAL_NAMES_BRACKETS),!this.values.ContainsKey(e)||!this.values.get_Item(e).isReserved()))},a.prototype.getAllowedSeparators=function(e){if("["!==e.charAt(0))return 0;var t=e.substr(1,e.indexOf("]")-1),r=e.substr(e.indexOf("]")+1);switch(t.toUpperCase()){case E.INI_SECTION_MAGIC_ENV:return r.toUpperCase()===E.MG_ATTR_LANGUAGE.toUpperCase()?999:0;case E.INI_SECTION_MAGIC_SYSTEMS:return 8;case E.INI_SECTION_MAGIC_DBMS:return 13;case E.INI_SECTION_MAGIC_SERVERS:return 6;case E.INI_SECTION_MAGIC_COMMS:return 2;case E.INI_SECTION_MAGIC_PRINTERS:return 3;case E.INI_SECTION_MAGIC_SYSTEM_MENU:return 11;case E.INI_SECTION_MAGIC_DATABASES:return 21;case E.INI_SECTION_MAGIC_LANGUAGE:return 1;case E.INI_SECTION_MAGIC_SERVICES:return 8;case E.INI_SECTION_TOOLS_MENU:return 7;default:return 0}},a.prototype.checkSetInEnvironment=function(e,r){if(e.startsWith(E.INI_SECTION_MAGIC_ENV_BRACKETS))switch((e=e.substr(E.INI_SECTION_MAGIC_ENV_BRACKETS.length)).toLowerCase()){case E.MG_ATTR_DECIMAL_SEPARATOR:et.Instance.setDecimalSeparator(r[0]);break;case E.MG_ATTR_DATE:n.DisplayConvertor.Instance.setDateChar(r[0].charCodeAt(0));break;case E.MG_ATTR_TIME:et.Instance.setTimeSeparator(r[0]);break;case E.MG_ATTR_OWNER:et.Instance.setOwner(r);break;case E.MG_ATTR_DATEMODE:et.Instance.setDateMode(G.Instance.getCurrTask().getCompIdx(),r[0]);break;case E.MG_ATTR_CENTURY:et.Instance.setCentury(G.Instance.getCurrTask().getCompIdx(),t.NNumber.Parse(r));break;case E.MG_ATTR_IDLETIME:et.Instance.setIdleTime(G.Instance.getCurrTask().getCompIdx(),t.NNumber.Parse(r));break;case E.MG_ATTR_UPD_IN_QUERY_LOWER:et.Instance.setAllowUpdateInQueryMode(G.Instance.getCurrTask().getCompIdx(),"1"===r[0]);break;case E.MG_ATTR_CRE_IN_MODIFY_LOWER:et.Instance.setAllowCreateInModifyMode(G.Instance.getCurrTask().getCompIdx(),"1"===r[0]);break;case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT_LOWER:et.Instance.setContextInactivityTimeout(t.NNumber.Parse(r));break;case E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME_LOWER:et.Instance.setContextInactivityWarningTime(t.NNumber.Parse(r));break;case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT_LOWER:et.Instance.setContextUnloadTimeout(t.NNumber.Parse(r));break;case E.MG_ATTR_TERMINAL:et.Instance.setTerminal(t.NNumber.Parse(r))}},a.prototype.translate=function(e){var r=new t.StringBuilder(e);return this.log(r),r.ToString()},a.prototype.log=function(e){var t;do{var r=0;for(t=!0;r<e.Length&&e.get_Item(r)>"\0";)if("%"===e.get_Item(r)){var n=e.Length;r=this.log_trans(e,r),n!==e.Length&&(t=!1)}else r+=1}while(!t)},a.prototype.log_trans=function(e,t){for(var r=!1,n=t,a=t+1;a<e.Length&&"%"!==e.get_Item(a);)a++;if(a>=e.Length?(t=a,r=!0):"%"!==e.get_Item(a)&&t++,!r){var s=E.INI_SECTION_LOGICAL_NAMES_BRACKETS+e.ToString(n+1,a-n-1),i=this.get(s);null===i?(e.Replace(e.ToString(t,a+1-t),"",t,a+1-t),t+=1):e.Replace(e.ToString(n,a+1-n),i,n,a+1-n)}return t},a}($e);lt.Instance=new lt;var ut=function(){function e(){}return e.getCookies=function(e){return"*"==e?document.cookie:this.getCookie(e)},e.setCookie=function(t,r,n,a,s,i,o){var l=encodeURIComponent(t)+"="+encodeURIComponent(e.encode_cookie(r))+";";if(n)if("number"==typeof n)l+="expires="+new Date(n).toUTCString()+";";else if("string"==typeof n){l+="expires="+new Date(n).toUTCString()+";"}else l+="expires="+n.toUTCString()+";";return a&&(l+="path="+a+";"),s&&(l+="domain="+s+";"),!1===i&&"None"===o&&(i=!0,console.warn("cookie "+t+" was forced with secure flag because sameSite=None.")),i&&(l+="secure;"),o||(o="Lax"),l+="sameSite="+o+";",document.cookie=l,this.getCookie(t)},e.encode_cookie=function(e){e=e.trim();for(var t="",r=0;r<e.length;r++)t+=e.charCodeAt(r),r<e.length-1&&(t+="+");return t},e.decode_cookie=function(e){for(var t="",r=e.split("+"),n=0;n<r.length;n++)t+=String.fromCharCode(r[n]);return t},e.getCookie=function(r){for(var n=t.NString.TrimStart(r+"="),a=decodeURIComponent(document.cookie).split(";"),s=0;s<a.length;s++){for(var i=a[s];" "==i.charAt(0);)i=i.substring(1);if(i.indexOf(n)>=0)return e.decode_cookie(i.substring(n.length,i.length))}return""},e.deleteCookie=function(e){for(var t=document.cookie.split(";"),r=0;r<t.length;r++){var n=t[r],a=n.indexOf("="),s=a>-1?n.substr(0,a):n;if(e===decodeURI(s))return document.cookie=s+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT",!0}return!1},e}(),ct=function(s){function i(){var e=s.call(this)||this;return e._charsToTrim=[" ","\0"],e._expressionLocalJpn=null,e._expressionLocalJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new de(e):null,e}return u(i,s),i.prototype.getExpBasicValue=function(e,t){var a,s,i,o,l,u=new n.ExpVal;switch(t){case n.ExpressionInterface.EXP_OP_A:case n.ExpressionInterface.EXP_OP_H:u.Attr=r.StorageAttribute.UNICODE,a=e.get4ByteNumber(),u.StrVal=e.getString(a,!0,!0),a=e.get4ByteNumber(),e.getString(a,!0,!1);break;case n.ExpressionInterface.EXP_OP_EXT_A:u.Attr=r.StorageAttribute.ALPHA,a=e.get4ByteNumber(),e.getString(a,!0,!0),a=e.get4ByteNumber(),u.StrVal=e.getString(a,!0,!1);break;case n.ExpressionInterface.EXP_OP_N:case n.ExpressionInterface.EXP_OP_T:case n.ExpressionInterface.EXP_OP_D:case n.ExpressionInterface.EXP_OP_E:t===n.ExpressionInterface.EXP_OP_D?u.Attr=r.StorageAttribute.DATE:t===n.ExpressionInterface.EXP_OP_T?u.Attr=r.StorageAttribute.TIME:u.Attr=r.StorageAttribute.NUMERIC,a=e.get2ByteNumber(),u.MgNumVal=e.getMagicNumber(a,!0);break;case n.ExpressionInterface.EXP_OP_L:u.Attr=r.StorageAttribute.BOOLEAN,u.BoolVal=1===e.get2ByteNumber();break;case n.ExpressionInterface.EXP_OP_V:s=e.getVarIdx(),i=e.get4ByteNumber(),o=this.ExpTask.getFieldDef(s,i-1),u.Attr=o.getType();var c=o.getType()===r.StorageAttribute.BLOB_VECTOR||o.NullAllowed;switch(u.IsNull=o.isNull()&&c,u.OriginalNull=u.IsNull,null!=(l=o.getValue(!0))&&u.IsNull&&o.getTask().getNullArithmetic()===r.Constants.NULL_ARITH_USE_DEF&&(u.IsNull=!1),u.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:u.StrVal=l;break;case r.StorageAttribute.BLOB_VECTOR:u.VectorField=o;case r.StorageAttribute.BLOB:u.StrVal=l,null==u.StrVal?(u.IsNull=!0,u.IncludeBlobPrefix=!1):u.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:u.MgNumVal=null!=l?new n.NUM_TYPE(l):null;break;case r.StorageAttribute.BOOLEAN:null!=l&&(u.BoolVal=n.DisplayConvertor.toBoolean(l))}break;case n.ExpressionInterface.EXP_OP_FORM:s=e.getVarIdx();var _=e.get4ByteNumber();_=this.ExpTask.GetRealMainDisplayIndexOnDepth(_),this.ConstructMagicNum(u,_,r.StorageAttribute.NUMERIC);break;case n.ExpressionInterface.EXP_OP_VAR:s=e.getVarIdx(),i=e.get4ByteNumber();var T=this.ExpTask.ctl_itm_4_parent_vee(s,i);this.ConstructMagicNum(u,T,r.StorageAttribute.NUMERIC);break;case n.ExpressionInterface.EXP_OP_RIGHT_LITERAL:a=e.get2ByteNumber(),u.MgNumVal=e.getMagicNumber(a,!0),a=e.get2ByteNumber(),u.Attr=r.StorageAttribute.NUMERIC,e.getString(a,!0,!1)}return u},i.isBasicItem=function(e){return e<=n.ExpressionInterface.EXP_OP_L||e===n.ExpressionInterface.EXP_OP_EXT_A||e===n.ExpressionInterface.EXP_OP_RIGHT_LITERAL||e===n.ExpressionInterface.EXP_OP_E||e===n.ExpressionInterface.EXP_OP_FORM},i.isVarArgList=function(e){return e.ArgCount_<0||e.ArgAttr_.length>e.ArgCount_},i.prototype.execOperation=function(e,a,o,l,u){var c=Object.create(null,{SetNULL:{get:function(){return s.prototype.SetNULL}}});return T(this,void 0,void 0,(function(){var s,_,T,p,g,d,E,I,f,C,A,R,S,M,m,v,L,b,N,y,O,G,P,D,k,x,F,w,V,U,B,X;return h(this,(function(h){switch(h.label){case 0:if(f=new ht,R=new n.ExpVal,M=!0,v=et.Instance.getSpecialAnsiExpression(),y=0,G=fe.expDesc[e],!i.isVarArgList(G))return[3,7];m=a.get1ByteNumber(),y=0,h.label=1;case 1:if(!(y<m))return[3,6];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,this.execExpression(a,o,r.StorageAttribute.NONE)];case 3:return h.sent(),[3,5];case 4:if((P=h.sent())instanceof t.Exception)return[3,6];throw P;case 5:return y++,[3,1];case 6:i.isVarArgList(G)&&y===m?(D=m,o.push(D)):r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.execOperation() there is problem with arguments of "+e+"(see ExpressionDict for name)"),h.label=7;case 7:switch(e){case n.ExpressionInterface.EXP_OP_ADD:return[3,8];case n.ExpressionInterface.EXP_OP_SUB:return[3,9];case n.ExpressionInterface.EXP_OP_MUL:return[3,10];case n.ExpressionInterface.EXP_OP_DIV:return[3,11];case n.ExpressionInterface.EXP_OP_MOD:return[3,12];case n.ExpressionInterface.EXP_OP_NEG:return[3,13];case n.ExpressionInterface.EXP_OP_FIX:return[3,14];case n.ExpressionInterface.EXP_OP_ROUND:return[3,15];case n.ExpressionInterface.EXP_OP_EQ:return[3,16];case n.ExpressionInterface.EXP_OP_NE:return[3,17];case n.ExpressionInterface.EXP_OP_LE:return[3,18];case n.ExpressionInterface.EXP_OP_LT:return[3,19];case n.ExpressionInterface.EXP_OP_GE:return[3,20];case n.ExpressionInterface.EXP_OP_GT:return[3,21];case n.ExpressionInterface.EXP_OP_NOT:return[3,22];case n.ExpressionInterface.EXP_OP_OR:return[3,23];case n.ExpressionInterface.EXP_OP_AND:return[3,24];case n.ExpressionInterface.EXP_OP_IF:return[3,25];case n.ExpressionInterface.EXP_OP_LEN:return[3,26];case n.ExpressionInterface.EXP_OP_CON:return[3,27];case n.ExpressionInterface.EXP_OP_MID:return[3,28];case n.ExpressionInterface.EXP_OP_LEFT:return[3,29];case n.ExpressionInterface.EXP_OP_RIGHT:return[3,30];case n.ExpressionInterface.EXP_OP_FILL:return[3,31];case n.ExpressionInterface.EXP_OP_INSTR:return[3,32];case n.ExpressionInterface.EXP_OP_TRIM:case n.ExpressionInterface.EXP_OP_LTRIM:case n.ExpressionInterface.EXP_OP_RTRIM:return[3,33];case n.ExpressionInterface.EXP_OP_STR:return[3,34];case n.ExpressionInterface.EXP_OP_VAL:return[3,35];case n.ExpressionInterface.EXP_OP_M:return[3,36];case n.ExpressionInterface.EXP_OP_K:return[3,37];case n.ExpressionInterface.EXP_OP_F:case n.ExpressionInterface.EXP_OP_P:return[3,38];case n.ExpressionInterface.EXP_OP_STAT:return[3,39];case n.ExpressionInterface.EXP_OP_SUBFORM_EXEC_MODE:return[3,40];case n.ExpressionInterface.EXP_OP_IS_LOGGED_IN:return[3,41];case n.ExpressionInterface.EXP_OP_SYS:return[3,42];case n.ExpressionInterface.EXP_OP_PROG:return[3,43];case n.ExpressionInterface.EXP_OP_LEVEL:return[3,44];case n.ExpressionInterface.EXP_OP_COUNTER:return[3,45];case n.ExpressionInterface.EXP_OP_EMPTY_DATA_VIEW:return[3,46];case n.ExpressionInterface.EXP_OP_MAINLEVEL:return[3,47];case n.ExpressionInterface.EXP_OP_MAINDISPLAY:return[3,48];case n.ExpressionInterface.EXP_OP_ISFIRSTRECORDCYCLE:return[3,49];case n.ExpressionInterface.EXP_OP_DATE:case n.ExpressionInterface.EXP_OP_UTCDATE:return[3,50];case n.ExpressionInterface.EXP_OP_ADDDT:return[3,51];case n.ExpressionInterface.EXP_OP_DIFDT:return[3,53];case n.ExpressionInterface.EXP_OP_VARPREV:return[3,55];case n.ExpressionInterface.EXP_OP_VARCURR:return[3,56];case n.ExpressionInterface.EXP_OP_VARMOD:return[3,57];case n.ExpressionInterface.EXP_OP_VARINP:return[3,58];case n.ExpressionInterface.EXP_OP_VARNAME:return[3,59];case n.ExpressionInterface.EXP_OP_VARDISPLAYNAME:return[3,60];case n.ExpressionInterface.EXP_OP_VARCONTROLID:return[3,61];case n.ExpressionInterface.EXP_OP_CONTROLITEMSLIST:return[3,62];case n.ExpressionInterface.EXP_OP_CONTROLDISPLAYLIST:return[3,64];case n.ExpressionInterface.EXP_OP_VIEWMOD:return[3,66];case n.ExpressionInterface.EXP_OP_TIME:case n.ExpressionInterface.EXP_OP_UTCTIME:return[3,67];case n.ExpressionInterface.EXP_OP_MTIME:case n.ExpressionInterface.EXP_OP_UTCMTIME:return[3,68];case n.ExpressionInterface.EXP_OP_PWR:return[3,69];case n.ExpressionInterface.EXP_OP_LOG:return[3,70];case n.ExpressionInterface.EXP_OP_EXP:return[3,71];case n.ExpressionInterface.EXP_OP_ABS:return[3,72];case n.ExpressionInterface.EXP_OP_SIN:return[3,73];case n.ExpressionInterface.EXP_OP_COS:return[3,74];case n.ExpressionInterface.EXP_OP_TAN:return[3,75];case n.ExpressionInterface.EXP_OP_ASIN:return[3,76];case n.ExpressionInterface.EXP_OP_ACOS:return[3,77];case n.ExpressionInterface.EXP_OP_ATAN:return[3,78];case n.ExpressionInterface.EXP_OP_RAND:return[3,79];case n.ExpressionInterface.EXP_OP_MIN:case n.ExpressionInterface.EXP_OP_MAX:return[3,80];case n.ExpressionInterface.EXP_OP_RANGE:return[3,81];case n.ExpressionInterface.EXP_OP_REP:return[3,82];case n.ExpressionInterface.EXP_OP_INS:return[3,83];case n.ExpressionInterface.EXP_OP_DEL:return[3,84];case n.ExpressionInterface.EXP_OP_FLIP:return[3,85];case n.ExpressionInterface.EXP_OP_UPPER:return[3,86];case n.ExpressionInterface.EXP_OP_LOWER:return[3,87];case n.ExpressionInterface.EXP_OP_CRC:return[3,88];case n.ExpressionInterface.EXP_OP_CHKDGT:return[3,89];case n.ExpressionInterface.EXP_OP_SOUNDX:return[3,90];case n.ExpressionInterface.EXP_OP_HSTR:return[3,91];case n.ExpressionInterface.EXP_OP_HVAL:return[3,92];case n.ExpressionInterface.EXP_OP_CHR:return[3,93];case n.ExpressionInterface.EXP_OP_ASC:return[3,94];case n.ExpressionInterface.EXP_OP_MSTR:return[3,95];case n.ExpressionInterface.EXP_OP_MVAL:return[3,96];case n.ExpressionInterface.EXP_OP_DSTR:return[3,97];case n.ExpressionInterface.EXP_OP_DVAL:return[3,98];case n.ExpressionInterface.EXP_OP_TSTR:return[3,99];case n.ExpressionInterface.EXP_OP_MTSTR:return[3,100];case n.ExpressionInterface.EXP_OP_TVAL:return[3,101];case n.ExpressionInterface.EXP_OP_MTVAL:return[3,102];case n.ExpressionInterface.EXP_OP_DAY:return[3,103];case n.ExpressionInterface.EXP_OP_MONTH:return[3,104];case n.ExpressionInterface.EXP_OP_YEAR:return[3,105];case n.ExpressionInterface.EXP_OP_DOW:return[3,106];case n.ExpressionInterface.EXP_OP_CDOW:return[3,107];case n.ExpressionInterface.EXP_OP_CMONTH:return[3,108];case n.ExpressionInterface.EXP_OP_NDOW:return[3,109];case n.ExpressionInterface.EXP_OP_NMONTH:return[3,110];case n.ExpressionInterface.EXP_OP_SECOND:return[3,111];case n.ExpressionInterface.EXP_OP_MINUTE:return[3,112];case n.ExpressionInterface.EXP_OP_HOUR:return[3,113];case n.ExpressionInterface.EXP_OP_DELAY:return[3,114];case n.ExpressionInterface.EXP_OP_IDLE:return[3,115];case n.ExpressionInterface.EXP_OP_ADDDATE:return[3,116];case n.ExpressionInterface.EXP_OP_ADDTIME:return[3,117];case n.ExpressionInterface.EXP_OP_OWNER:return[3,118];case n.ExpressionInterface.EXP_OP_VARATTR:return[3,119];case n.ExpressionInterface.EXP_OP_VARPIC:return[3,120];case n.ExpressionInterface.EXP_OP_DBROUND:return[3,121];case n.ExpressionInterface.EXP_OP_NULL:case n.ExpressionInterface.EXP_OP_NULL_A:case n.ExpressionInterface.EXP_OP_NULL_N:case n.ExpressionInterface.EXP_OP_NULL_B:case n.ExpressionInterface.EXP_OP_NULL_D:case n.ExpressionInterface.EXP_OP_NULL_T:case n.ExpressionInterface.EXP_OP_NULL_U:case n.ExpressionInterface.EXP_OP_NULL_O:return[3,122];case n.ExpressionInterface.EXP_OP_ISNULL:return[3,123];case n.ExpressionInterface.EXP_OP_BOM:return[3,124];case n.ExpressionInterface.EXP_OP_BOY:return[3,125];case n.ExpressionInterface.EXP_OP_EOM:return[3,126];case n.ExpressionInterface.EXP_OP_EOY:return[3,127];case n.ExpressionInterface.EXP_OP_ROLLBACK:return[3,128];case n.ExpressionInterface.EXP_OP_VARSET:return[3,130];case n.ExpressionInterface.EXP_OP_CTRL_NAME:return[3,132];case n.ExpressionInterface.EXP_OP_TDEPTH:return[3,133];case n.ExpressionInterface.EXP_OP_ISDEFAULT:return[3,134];case n.ExpressionInterface.EXP_OP_STRTOKEN:return[3,135];case n.ExpressionInterface.EXP_OP_STRTOK_CNT:return[3,136];case n.ExpressionInterface.EXP_OP_STRTOKEN_IDX:return[3,137];case n.ExpressionInterface.EXP_OP_BLOBSIZE:return[3,138];case n.ExpressionInterface.EXP_OP_WEB_REFERENCE:return[3,139];case n.ExpressionInterface.EXP_OP_CASE:return[3,140];case n.ExpressionInterface.EXP_OP_THIS:return[3,141];case n.ExpressionInterface.EXP_OP_LIKE:return[3,142];case n.ExpressionInterface.EXP_OP_REPSTR:return[3,143];case n.ExpressionInterface.EXP_OP_VARCURRN:return[3,144];case n.ExpressionInterface.EXP_OP_VARINDEX:return[3,145];case n.ExpressionInterface.EXP_OP_JCDOW:return[3,146];case n.ExpressionInterface.EXP_OP_JMONTH:return[3,147];case n.ExpressionInterface.EXP_OP_JNDOW:return[3,148];case n.ExpressionInterface.EXP_OP_JYEAR:return[3,149];case n.ExpressionInterface.EXP_OP_JGENGO:return[3,150];case n.ExpressionInterface.EXP_OP_HAN:return[3,151];case n.ExpressionInterface.EXP_OP_ZEN:return[3,152];case n.ExpressionInterface.EXP_OP_ZENS:return[3,153];case n.ExpressionInterface.EXP_OP_ZIMEREAD:return[3,154];case n.ExpressionInterface.EXP_OP_ZKANA:return[3,155];case n.ExpressionInterface.EXP_OP_GOTO_CTRL:return[3,156];case n.ExpressionInterface.EXP_OP_TRANSLATE:return[3,157];case n.ExpressionInterface.EXP_OP_ASTR:return[3,158];case n.ExpressionInterface.EXP_OP_LOOPCOUNTER:return[3,159];case n.ExpressionInterface.EXP_OP_VECCELLATTR:return[3,160];case n.ExpressionInterface.EXP_OP_VECGET:return[3,161];case n.ExpressionInterface.EXP_OP_VECSET:return[3,162];case n.ExpressionInterface.EXP_OP_VECSIZE:return[3,164];case n.ExpressionInterface.EXP_OP_IN:return[3,165];case n.ExpressionInterface.EXP_OP_ISCOMPONENT:return[3,166];case n.ExpressionInterface.EXP_OP_USER_DEFINED_FUNC:return[3,167];case n.ExpressionInterface.EXP_OP_UNICODEASC:return[3,170];case n.ExpressionInterface.EXP_OP_PUBLICNAME:return[3,171];case n.ExpressionInterface.EXP_OP_TASKID:return[3,172];case n.ExpressionInterface.EXP_OP_DBVIEWSIZE:return[3,173];case n.ExpressionInterface.EXP_OP_DBVIEWROWIDX:return[3,174];case n.ExpressionInterface.EXP_OP_PROJECTDIR:return[3,175];case n.ExpressionInterface.EXP_OP_MLS_TRANS:return[3,176];case n.ExpressionInterface.EXP_OP_STR_BUILD:return[3,177];case n.ExpressionInterface.EXP_OP_STATUSBARSETTEXT:return[3,178];case n.ExpressionInterface.EXP_OP_SET_TITLE:return[3,179];case n.ExpressionInterface.EXP_OP_IS_ROW_EDITING:return[3,180];case n.ExpressionInterface.EXP_OP_GETPARAM:return[3,181];case n.ExpressionInterface.EXP_OP_SETPARAM:return[3,182];case n.ExpressionInterface.EXP_OP_INIPUT:return[3,183];case n.ExpressionInterface.EXP_OP_INIGET:return[3,185];case n.ExpressionInterface.EXP_OP_INIGETLN:return[3,186];case n.ExpressionInterface.EXP_OP_EXPCALC:return[3,187];case n.ExpressionInterface.EXP_OP_TASKTYPE:return[3,189];case n.ExpressionInterface.EXP_OP_RANGE_ADD:return[3,190];case n.ExpressionInterface.EXP_OP_RANGE_RESET:return[3,193];case n.ExpressionInterface.EXP_OP_LOCATE_ADD:return[3,195];case n.ExpressionInterface.EXP_OP_LOCATE_RESET:return[3,198];case n.ExpressionInterface.EXP_OP_SORT_ADD:return[3,200];case n.ExpressionInterface.EXP_OP_SORT_RESET:return[3,202];case n.ExpressionInterface.EXP_OP_TSK_INSTANCE:return[3,204];case n.ExpressionInterface.EXP_OP_TERM:return[3,205];case n.ExpressionInterface.EXP_OP_FORMSTATECLEAR:return[3,206];case n.ExpressionInterface.EXP_OP_CLIENTSESSION_SET:return[3,207];case n.ExpressionInterface.EXP_OP_CND_RANGE:return[3,208];case n.ExpressionInterface.EXP_OP_CONTROL_SELECT_PROGRAM:return[3,209];case n.ExpressionInterface.EXP_OP_CALLJS:return[3,211];case n.ExpressionInterface.EXP_OP_SET_COOKIE:return[3,212];case n.ExpressionInterface.EXP_OP_GET_COOKIE:return[3,213];case n.ExpressionInterface.EXP_OP_DELETE_COOKIE:return[3,214];case n.ExpressionInterface.EXP_OP_ROUTEGET:return[3,215]}return[3,216];case 8:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.add(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 9:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.sub(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 10:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.mul(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 11:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.div(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 12:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.mod(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 13:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(s.MgNumVal.num_neg(),R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),[3,217]);case 14:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal||null==_.MgNumVal||null==T.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),C=_.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_fix(C),A=T.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_trunc(A),[3,217]);case 15:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal||null==_.MgNumVal||null==T.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),C=_.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_fix(C),A=T.MgNumVal.NUM_2_LONG(),R.MgNumVal.round(A),[3,217]);case 16:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=0===i.val_cmp_any(s,_,!1)}catch(e){if(!(e instanceof _t))throw e;R.BoolVal=!1}return a.resetNullResult(),[3,217];case 17:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=0!==i.val_cmp_any(s,_,!1)}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 18:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)<=0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 19:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)<0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 20:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)>=0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 21:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)>0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 22:return(R=o.pop()).BoolVal=!R.BoolVal,[3,217];case 23:return R=o.pop(),(f=new ht).argCount_=1,R.BoolVal?(f.opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)):(f.opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),M=!1),[3,217];case 24:return R=o.pop(),f=new ht,R.BoolVal?(f.opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),M=!1):(f.opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)),[3,217];case 25:return(s=o.pop()).BoolVal?((f=new ht).opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),(f=new ht).opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)):((f=new ht).opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f),(f=new ht).opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f)),M=!1,a.resetNullResult(),[3,217];case 26:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.StrVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE,v||s.Attr!==r.StorageAttribute.UNICODE?R.MgNumVal.NUM_4_LONG(r.UtilStrByteMode.lenB(s.StrVal)):R.MgNumVal.NUM_4_LONG(s.StrVal.length),[3,217]);case 27:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,s.Attr===r.StorageAttribute.UNICODE&&null==s.StrVal||_.Attr===r.StorageAttribute.UNICODE&&null==_.StrVal?c.SetNULL.call(this,R,r.StorageAttribute.UNICODE):R.StrVal=(t.NString.IsNullOrEmpty(s.StrVal)?"":s.StrVal)+(t.NString.IsNullOrEmpty(_.StrVal)?"":_.StrVal),[3,217];case 28:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==T.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,R.Attr),[3,217]):(L=(L=_.MgNumVal.NUM_2_LONG())>1?L-1:0,b=T.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.midB(s.StrVal,L,b)):((N=s.StrVal.length-L)<b&&(b=N),b<0&&(b=0),R.StrVal=s.StrVal.substr(L,b)),null==R.StrVal&&(R.StrVal=""),[3,217]);case 29:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,s.Attr),[3,217]):(b=_.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.leftB(s.StrVal,b),null==R.StrVal&&(R.StrVal="")):(b>s.StrVal.length&&(b=s.StrVal.length),b<0&&(b=0),R.StrVal=s.StrVal.substr(0,b)),[3,217]);case 30:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,s.Attr),[3,217]):(b=_.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.rightB(s.StrVal,b),null==R.StrVal&&(R.StrVal="")):(b>s.StrVal.length&&(b=s.StrVal.length),b<0&&(b=0),L=s.StrVal.length-b,R.StrVal=s.StrVal.substr(L)),[3,217]);case 31:if(_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,null==_.MgNumVal||null==s.StrVal)return c.SetNULL.call(this,R,r.StorageAttribute.UNICODE),[3,217];if(b=s.StrVal.length,(y=_.MgNumVal.NUM_2_LONG())<0&&(y=0),(N=b*y)>32767&&(N=Math.floor(32767/b)*b),N>0)if(b<=0)R.StrVal="";else if(1===N)R.StrVal=s.StrVal;else{for(k=new t.StringBuilder(N);N>0;N-=b)k.Append(s.StrVal);R.StrVal=k.ToString()}return null==R.StrVal&&(R.StrVal=""),[3,217];case 32:if(_=o.pop(),s=o.pop(),L=0,R.Attr=r.StorageAttribute.NUMERIC,null==s.StrVal||null==_.StrVal)return c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217];if(R.MgNumVal=new n.NUM_TYPE,v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE)L=r.UtilStrByteMode.instrB(s.StrVal,_.StrVal);else{if(0===_.StrVal.length)return R.MgNumVal.NUM_4_LONG(L),[3,217];(L=s.StrVal.indexOf(_.StrVal))<0?L=0:L++}return R.MgNumVal.NUM_4_LONG(L),[3,217];case 33:if(s=o.pop(),R.Attr=s.Attr===r.StorageAttribute.ALPHA?r.StorageAttribute.ALPHA:r.StorageAttribute.UNICODE,null==s.StrVal)return c.SetNULL.call(this,R,R.Attr),[3,217];switch(e){case n.ExpressionInterface.EXP_OP_TRIM:s.StrVal=i.trimStr(s.StrVal,"B");break;case n.ExpressionInterface.EXP_OP_LTRIM:s.StrVal=i.trimStr(s.StrVal,"L");break;case n.ExpressionInterface.EXP_OP_RTRIM:s.StrVal=i.trimStr(s.StrVal,"R")}return R.StrVal=s.StrVal,[3,217];case 34:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,null==_.StrVal||null==s.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.UNICODE),[3,217]):(O=new n.PIC(i.set_a_pic(_.StrVal),r.StorageAttribute.NUMERIC,this.ExpTask.getCompIdx()),R.StrVal=s.MgNumVal.to_a(O),[3,217]);case 35:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==_.StrVal||null==s.StrVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(O=new n.PIC(i.set_a_pic(_.StrVal),r.StorageAttribute.NUMERIC,this.ExpTask.getCompIdx()),R.MgNumVal=new n.NUM_TYPE(s.StrVal,O,this.ExpTask.getCompIdx()),[3,217]);case 36:return b=a.get2ByteNumber(),x=a.getString(b,!0,!1),this.eval_op_m(R,x),[3,217];case 37:return R.Attr=r.StorageAttribute.NUMERIC,b=a.get2ByteNumber(),R.MgNumVal=a.getMagicNumber(b,!0),[3,217];case 38:return R.Attr=r.StorageAttribute.NUMERIC,b=a.get2ByteNumber(),R.MgNumVal=a.getMagicNumber(b,!0),b=a.get2ByteNumber(),a.getMagicNumber(b,!0),[3,217];case 39:return _=o.pop(),s=o.pop(),this.eval_op_stat(R,s,_),[3,217];case 40:return s=o.pop(),this.eval_op_subformExecMode(R,s),[3,217];case 41:return this.eval_op_IsLoggedIn(R),[3,217];case 42:return this.eval_op_appname(R),[3,217];case 43:return this.eval_op_prog(R),[3,217];case 44:return s=o.pop(),this.eval_op_level(R,s),[3,217];case 45:return s=o.pop(),this.eval_op_counter(R,s),[3,217];case 46:return s=o.pop(),this.eval_op_emptyDataview(R,s),[3,217];case 47:return s=o.pop(),this.eval_op_mainlevel(R,s),[3,217];case 48:return s=o.pop(),this.eval_op_maindisplay(R,s),[3,217];case 49:return s=o.pop(),this.eval_op_IsFirstRecordCycle(R,s),[3,217];case 50:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.date_magic(e===n.ExpressionInterface.EXP_OP_UTCDATE)),R.Attr=r.StorageAttribute.DATE,[3,217];case 51:return I=o.pop(),E=o.pop(),d=o.pop(),g=o.pop(),p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_addDateTime(R,s,_,T,p,g,d,E,I)];case 52:return h.sent(),[3,217];case 53:return d=o.pop(),g=o.pop(),p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_difdt(R,s,_,T,p,g,d)];case 54:return h.sent(),[3,217];case 55:return s=o.pop(),this.exp_get_var(R,s,!0),[3,217];case 56:return s=o.pop(),this.exp_get_var(R,s,!1),[3,217];case 57:return s=o.pop(),this.eval_op_varmod(R,s),[3,217];case 58:return s=o.pop(),this.eval_op_varinp(R,s),[3,217];case 59:return s=o.pop(),this.eval_op_varname(R,s),[3,217];case 60:return s=o.pop(),this.eval_op_VarDisplayName(R,s),a.resetNullResult(),[3,217];case 61:return s=o.pop(),this.eval_op_VarControlID(R,s),a.resetNullResult(),[3,217];case 62:return s=o.pop(),[4,this.eval_op_ControlItemsList(R,s)];case 63:return h.sent(),a.resetNullResult(),[3,217];case 64:return s=o.pop(),[4,this.eval_op_ControlDisplayList(R,s)];case 65:return h.sent(),a.resetNullResult(),[3,217];case 66:return s=o.pop(),this.eval_op_viewmod(R,s),[3,217];case 67:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.time_magic(e===n.ExpressionInterface.EXP_OP_UTCTIME)),R.Attr=r.StorageAttribute.TIME,[3,217];case 68:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.mtime_magic(e===n.ExpressionInterface.EXP_OP_UTCMTIME)),R.Attr=r.StorageAttribute.TIME,[3,217];case 69:return _=o.pop(),s=o.pop(),R.MgNumVal=new n.NUM_TYPE,R.MgNumVal=n.NUM_TYPE.eval_op_pwr(s.MgNumVal,_.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 70:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_log(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 71:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_exp(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 72:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_abs(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 73:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_sin(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 74:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_cos(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 75:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_tan(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 76:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_asin(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 77:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_acos(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 78:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_atan(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 79:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_rand(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 80:m=o.pop(),this.val_cpy(o.pop(),R);try{for(y=1;y<m;y++)s=o.pop(),e===n.ExpressionInterface.EXP_OP_MIN?i.val_cmp_any(s,R,!0)<0&&this.val_cpy(s,R):i.val_cmp_any(s,R,!0)>0&&this.val_cpy(s,R)}catch(e){if(!(e instanceof _t))throw e;for(;o.count()>0&&y<m;y++)o.pop();R.IsNull=!0,R.Attr=e.getAttr()}return[3,217];case 81:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_range(s,_,T,R),[3,217];case 82:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.repB(s.StrVal,_.StrVal,T.MgNumVal.NUM_2_LONG(),p.MgNumVal.NUM_2_LONG())):this.eval_op_rep_1(R,s,_,T,p),[3,217];case 83:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.insB(s.StrVal,_.StrVal,T.MgNumVal.NUM_2_LONG(),p.MgNumVal.NUM_2_LONG())):this.eval_op_ins(R,s,_,T,p),[3,217];case 84:return T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.delB(s.StrVal,_.MgNumVal.NUM_2_LONG(),T.MgNumVal.NUM_2_LONG())):this.eval_op_del(R,s,_,T),[3,217];case 85:return s=o.pop(),this.eval_op_flip(R,s),[3,217];case 86:return s=o.pop(),this.eval_op_upper(R,s),[3,217];case 87:return s=o.pop(),this.eval_op_lower(R,s),[3,217];case 88:return _=o.pop(),s=o.pop(),this.eval_op_crc(R,s,_),[3,217];case 89:return _=o.pop(),s=o.pop(),this.eval_op_chkdgt(R,s,_),[3,217];case 90:return s=o.pop(),this.eval_op_soundx(R,s),[3,217];case 91:return s=o.pop(),this.eval_op_hstr(R,s),[3,217];case 92:return s=o.pop(),this.eval_op_hval(R,s),[3,217];case 93:return s=o.pop(),this.eval_op_chr(R,s),[3,217];case 94:return s=o.pop(),this.eval_op_asc(R,s),[3,217];case 95:return _=o.pop(),s=o.pop(),this.eval_op_mstr(R,s,_),[3,217];case 96:return s=o.pop(),this.eval_op_mval(R,s),[3,217];case 97:return _=o.pop(),s=o.pop(),this.eval_op_dstr(R,s,_,n.DisplayConvertor.Instance),[3,217];case 98:return _=o.pop(),s=o.pop(),this.eval_op_dval(R,s,_,n.DisplayConvertor.Instance),[3,217];case 99:return _=o.pop(),s=o.pop(),this.eval_op_tstr(R,s,_,n.DisplayConvertor.Instance,!1),[3,217];case 100:return _=o.pop(),s=o.pop(),this.eval_op_tstr(R,s,_,n.DisplayConvertor.Instance,!0),[3,217];case 101:return _=o.pop(),s=o.pop(),this.eval_op_tval(R,s,_,n.DisplayConvertor.Instance,!1),[3,217];case 102:return _=o.pop(),s=o.pop(),this.eval_op_tval(R,s,_,n.DisplayConvertor.Instance,!0),[3,217];case 103:return s=o.pop(),this.eval_op_day(R,s),[3,217];case 104:return s=o.pop(),this.eval_op_month(R,s),[3,217];case 105:return s=o.pop(),this.eval_op_year(R,s),[3,217];case 106:return s=o.pop(),this.eval_op_dow(R,s),[3,217];case 107:return s=o.pop(),this.eval_op_cdow(R,s.MgNumVal,n.DisplayConvertor.Instance),[3,217];case 108:return s=o.pop(),this.eval_op_cmonth(R,s.MgNumVal,n.DisplayConvertor.Instance),[3,217];case 109:return s=o.pop(),this.eval_op_ndow(R,s,n.DisplayConvertor.Instance),[3,217];case 110:return s=o.pop(),this.eval_op_nmonth(R,s,n.DisplayConvertor.Instance),[3,217];case 111:return s=o.pop(),this.eval_op_second(R,s),[3,217];case 112:return s=o.pop(),this.eval_op_minute(R,s),[3,217];case 113:return s=o.pop(),this.eval_op_hour(R,s),[3,217];case 114:return s=o.pop(),this.eval_op_delay(s),R.Attr=r.StorageAttribute.BOOLEAN,R.BoolVal=!0,[3,217];case 115:return this.eval_op_idle(R),[3,217];case 116:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_adddate(R,s,_,T,p),[3,217];case 117:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_addtime(R,s,_,T,p),[3,217];case 118:return R.Attr=r.StorageAttribute.ALPHA,R.StrVal=et.Instance.getOwner(),[3,217];case 119:return s=o.pop(),this.eval_op_varattr(R,s),[3,217];case 120:return _=o.pop(),s=o.pop(),this.eval_op_varpic(R,s,_),[3,217];case 121:return _=o.pop(),s=o.pop(),this.eval_op_dbround(R,s,_),[3,217];case 122:return this.exp_null_val_get(u,e,R),[3,217];case 123:if(s=o.pop(),R.BoolVal=s.IsNull,!s.IsNull&&s.OriginalNull&&(R.BoolVal=s.OriginalNull),R.Attr=r.StorageAttribute.BOOLEAN,a.isNull()){for(F=new t.List,w=!1,V=void 0;0!==o.count()&&!w;)F.push(o.pop()),F.get_Item(F.length-1).IsNull&&(w=!0);for(V=F.length-1;V>=0;V--)o.push(F.get_Item(V));w||a.resetNullResult()}return[3,217];case 124:return s=o.pop(),this.eval_op_bom(R,s),[3,217];case 125:return s=o.pop(),this.eval_op_boy(R,s),[3,217];case 126:return s=o.pop(),this.eval_op_eom(R,s),[3,217];case 127:return s=o.pop(),this.eval_op_eoy(R,s),[3,217];case 128:return _=o.pop(),s=o.pop(),[4,this.eval_op_rollback(R,s,_)];case 129:return h.sent(),[3,217];case 130:return _=o.pop(),s=o.pop(),[4,this.eval_op_varset(R,_,s)];case 131:return h.sent(),[3,217];case 132:return this.eval_op_ctrl_name(R),[3,217];case 133:return U=this.ExpTask.GetContextTask(),b=U.getTaskDepth(!1)-1,this.ConstructMagicNum(R,b,r.StorageAttribute.NUMERIC),[3,217];case 134:return s=o.pop(),this.exp_is_default(R,s),[3,217];case 135:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_strtok(R,s,_,T),[3,217];case 136:return _=o.pop(),s=o.pop(),this.eval_op_strTokenCnt(s,_,R),[3,217];case 137:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_strTokenIdx(s,_,T,R),[3,217];case 138:return s=o.pop(),this.eval_op_blobsize(R,s),[3,217];case 139:return s=o.pop(),R.Attr=r.StorageAttribute.ALPHA,R.StrVal="%"+s.StrVal+"%",[3,217];case 140:for(m=o.pop(),S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();for(this.val_cpy(S[0],R),y=1;y<m;y+=2){s=S[y],B=void 0;try{B=0===i.val_cmp_any(s,R,!1)}catch(e){if(!(e instanceof _t))throw e;B=!1}if(B){this.val_cpy(S[y+1],R);break}if(y===m-3){this.val_cpy(S[y+2],R);break}}return a.resetNullResult(),[3,217];case 141:return this.eval_op_this(R),[3,217];case 142:return _=o.pop(),s=o.pop(),this.eval_op_like(s,_,R),[3,217];case 143:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_repstr(s,_,T,R),[3,217];case 144:return s=o.pop(),this.exp_get_var(s,R),[3,217];case 145:return s=o.pop(),this.exp_get_indx(s,R),[3,217];case 146:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jcdow(R,s.MgNumVal,n.DisplayConvertor.Instance)),[3,217];case 147:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jmonth(R,s)),[3,217];case 148:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jndow(R,s,n.DisplayConvertor.Instance)),[3,217];case 149:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jyear(R,s)),[3,217];case 150:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(_=o.pop(),s=o.pop(),this._expressionLocalJpn.eval_op_jgengo(R,s.MgNumVal,_.MgNumVal,n.DisplayConvertor.Instance)),[3,217];case 151:return s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_han(s.StrVal),null==R.StrVal&&(R.StrVal="")),[3,217];case 152:return s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zens(s.StrVal,0),null==R.StrVal&&(R.StrVal="")),[3,217];case 153:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==_.MgNumVal||null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zens(s.StrVal,_.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 154:return s=o.pop(),R.Attr=r.StorageAttribute.ALPHA,null==this._expressionLocalJpn?R.StrVal=s.StrVal:(R.StrVal=this._expressionLocalJpn.eval_op_zimeread(s.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 155:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==_.MgNumVal||null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zkana(s.StrVal,_.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 156:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_gotoCtrl(s,_,T,R),[3,217];case 157:return s=o.pop(),this.eval_op_translate(s,R),[3,217];case 158:return _=o.pop(),s=o.pop(),this.eval_op_astr(s,_,R),[3,217];case 159:return this.ConstructMagicNum(R,this.ExpTask.getLoopCounter(),r.StorageAttribute.NUMERIC),[3,217];case 160:return s=o.pop(),i.eval_op_vecCellAttr(s,R),[3,217];case 161:return _=o.pop(),s=o.pop(),this.eval_op_vecGet(s,_,R),[3,217];case 162:return T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_vecSet(s,_,T,R)];case 163:return h.sent(),R.IsNull=!1,a.isNull()&&a.resetNullResult(),[3,217];case 164:return s=o.pop(),this.eval_op_vecSize(s,R),a.resetNullResult(),[3,217];case 165:for(m=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN,R.BoolVal=!1,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();try{for(y=1;y<m;y++)if(0===i.val_cmp_any(S[0],S[y],!1)){R.BoolVal=!0;break}}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 166:return this.eval_op_iscomponent(R),[3,217];case 167:if(!((m=o.pop())>0))return[3,169];for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return X=o.pop().StrVal,[4,this.eval_op_ExecUserDefinedFunc(X,S,R,u)];case 168:h.sent(),a.resetNullResult(),h.label=169;case 169:return[3,217];case 170:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=!1,!s.IsNull&&s.StrVal.length>0?(R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(s.StrVal[0].charCodeAt(0))):R.IsNull=!0,[3,217];case 171:return s=o.pop(),this.eval_op_publicName(R,s),[3,217];case 172:return s=o.pop(),this.eval_op_taskId(R,s),[3,217];case 173:return s=o.pop(),this.eval_op_dbviewsize(R,s),[3,217];case 174:return s=o.pop(),this.eval_op_dbviewrowidx(R,s),[3,217];case 175:return this.eval_op_projectdir(R),[3,217];case 176:return s=o.pop(),this.eval_op_MlsTrans(R,s),[3,217];case 177:return m=o.pop(),this.eval_op_StrBuild(o,R,m),[3,217];case 178:return s=o.pop(),this.eval_op_statusbar_set_text(R,s),a.resetNullResult(),[3,217];case 179:return s=o.pop(),this.eval_op_set_title(R,s),a.resetNullResult(),[3,217];case 180:return s=o.pop(),this.eval_op_is_row_editing(R,s),a.resetNullResult(),[3,217];case 181:return s=o.pop(),this.eval_op_getParam(R,s),[3,217];case 182:return _=o.pop(),s=o.pop(),this.eval_op_setParam(R,s,_),[3,217];case 183:return _=o.pop(),s=o.pop(),[4,this.eval_op_iniput(R,s,_)];case 184:return h.sent(),[3,217];case 185:return s=o.pop(),this.eval_op_iniget(R,s),[3,217];case 186:return _=o.pop(),s=o.pop(),this.eval_op_inigetln(R,s,_),[3,217];case 187:return s=o.pop(),[4,this.eval_op_expcalc(R,s)];case 188:return h.sent(),[3,217];case 189:return s=o.pop(),this.eval_op_taskType(R,s),[3,217];case 190:if(!((m=o.pop())>0))return[3,192];for(S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return[4,this.eval_op_range_add(R,S)];case 191:h.sent(),h.label=192;case 192:return[3,217];case 193:return s=o.pop(),[4,this.eval_op_range_reset(R,s)];case 194:return h.sent(),[3,217];case 195:if(!((m=o.pop())>0))return[3,197];for(S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return[4,this.eval_op_locate_add(R,S)];case 196:h.sent(),h.label=197;case 197:return[3,217];case 198:return s=o.pop(),[4,this.eval_op_locate_reset(R,s)];case 199:return h.sent(),[3,217];case 200:return _=o.pop(),s=o.pop(),[4,this.eval_op_sort_add(R,s,_)];case 201:return h.sent(),[3,217];case 202:return s=o.pop(),[4,this.eval_op_sort_reset(R,s)];case 203:return h.sent(),[3,217];case 204:return s=o.pop(),this.eval_op_tsk_instance(R,s),[3,217];case 205:return this.eval_op_terminal(R),[3,217];case 206:return s=o.pop(),this.eval_op_formStateClear(s,R),[3,217];case 207:return _=o.pop(),s=o.pop(),this.eval_op_ClientSessionSet(s,_,R),[3,217];case 208:return _=o.pop(),s=o.pop(),this.eval_op_CndRange(R,s,_),[3,217];case 209:return s=o.pop(),[4,this.eval_op_control_select_program(s,R)];case 210:return h.sent(),[3,217];case 211:if((m=o.pop())>0){for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();this.eval_op_CallJS(this.ExpTask,o.pop().StrVal,S,R)}return[3,217];case 212:if((m=o.pop())>0){for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();this.eval_op_set_cookie(o.pop().StrVal,S,R)}return[3,217];case 213:return R.Attr=r.StorageAttribute.ALPHA,R.IsNull=!1,this.eval_op_get_cookie(o.pop().StrVal,R),[3,217];case 214:return R.Attr=r.StorageAttribute.BOOLEAN,R.IsNull=!1,this.eval_op_delete_cookie(o.pop().StrVal,R),[3,217];case 215:return this.eval_op_route_get(R),[3,217];case 216:return[2];case 217:return M&&(this.ConvertExpVal(R,u),o.push(R),R.IsNull&&a.setNullResult()),[2]}}))}))},i.prototype.eval_op_ClientSessionSet=function(e,t,n){if(n.BoolVal=!1,n.Attr=r.StorageAttribute.BOOLEAN,!e.isEmptyString())if(e.StrVal===E.ENABLE_COMMUNICATION_DIALOGS)t.Attr===r.StorageAttribute.BOOLEAN?n.BoolVal=!0:r.Logger.Instance.WriteExceptionToLogWithMsg("Invalid attribute for "+E.ENABLE_COMMUNICATION_DIALOGS+" key in ClientSessionSet()");else r.Logger.Instance.WriteExceptionToLogWithMsg("Invalid Key in ClientSessionSet()")},i.prototype.execExpression=function(e,r,a){return T(this,void 0,void 0,(function(){var s,o,l,u,c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:if(l=new t.List,c=e.getOpCode(),i.isBasicItem(c))return s=this.getExpBasicValue(e,c),this.ConvertExpVal(s,a),r.push(s),s.IsNull&&e.setNullResult(),[2];if(_=fe.expDesc[c],T=!1,!(_.ArgEvalCount_>0))return[3,4];o=0,h.label=1;case 1:return o<_.ArgEvalCount_?(e.resetNullResult(),[4,this.execExpression(e,r,_.ArgAttr_[o])]):[3,4];case 2:h.sent(),e.isNull()&&(T=!0),h.label=3;case 3:return o++,[3,1];case 4:return T&&e.setNullResult(),[4,this.execOperation(c,e,r,l,a)];case 5:if(h.sent(),!((p=l.length)>0))return[3,11];o=0,h.label=6;case 6:if(!(o<p))return[3,11];switch(u=l.get_Item(0),l.RemoveAt(0),u.opCode_){case n.ExpressionInterface.EXP_OP_IGNORE:return[3,7];case n.ExpressionInterface.EXP_OP_EVALX:return[3,8]}return[3,10];case 7:for(g=void 0,g=0;g<u.argCount_;g++)e.skipOperator();return[3,10];case 8:return[4,this.execExpression(e,r,a)];case 9:return h.sent(),[3,10];case 10:return o++,[3,6];case 11:return[2]}}))}))},i.prototype.DiscardCndRangeExpression=function(e,a){return T(this,void 0,void 0,(function(){var s,i,o;return h(this,(function(l){switch(l.label){case 0:return new t.List,(i=e.getOpCode())!==n.ExpressionInterface.EXP_OP_CND_RANGE?[2,!1]:(o=fe.expDesc[i],[4,this.execExpression(e,a,o.ArgAttr_[0])]);case 1:return l.sent(),[2,(s=a.pop()).Attr===r.StorageAttribute.BOOLEAN&&!s.BoolVal]}}))}))},i.val_cmp_any=function(e,a,s){var o=0,l=e.Attr,u=a.Attr,c=new i;if(e.IsNull&&a.IsNull)return 0;if(e.IsNull||a.IsNull)throw new _t(l);if(r.StorageAttributeCheck.isTypeBlob(l)&&(e.IncludeBlobPrefix&&n.BlobType.getContentType(e.StrVal)===n.BlobType.CONTENT_TYPE_BINARY?(e.StrVal=n.BlobType.removeBlobPrefix(e.StrVal),e.Attr=r.StorageAttribute.ALPHA,e.IncludeBlobPrefix=!1):c.ConvertExpVal(e,r.StorageAttribute.UNICODE)),r.StorageAttributeCheck.isTypeBlob(u)&&(a.IncludeBlobPrefix&&n.BlobType.getContentType(a.StrVal)===n.BlobType.CONTENT_TYPE_BINARY?(a.StrVal=n.BlobType.removeBlobPrefix(a.StrVal),a.Attr=r.StorageAttribute.ALPHA,a.IncludeBlobPrefix=!1):c.ConvertExpVal(a,r.StorageAttribute.UNICODE)),(l=e.Attr)!==(u=a.Attr)&&!(r.StorageAttributeCheck.isTypeNumeric(l)&&r.StorageAttributeCheck.isTypeNumeric(u)||r.StorageAttributeCheck.IsTypeAlphaOrUnicode(l)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(u)))return 1;switch(l){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:if(null===e.StrVal&&null===a.StrVal)return 0;if(null===e.StrVal||null===a.StrVal)throw new _t(l);var _=r.StrUtil.rtrim(e.StrVal),T=r.StrUtil.rtrim(a.StrVal);o=et.Instance.getSpecialAnsiExpression()||r.UtilStrByteMode.isLocaleDefLangDBCS()&&l===r.StorageAttribute.ALPHA&&u===r.StorageAttribute.ALPHA?r.UtilStrByteMode.strcmp(_,T):t.NString.CompareOrdinal(_,T);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(null===e.MgNumVal&&null===a.MgNumVal)return 0;if(null===e.MgNumVal||null===a.MgNumVal)throw new _t(l);o=n.NUM_TYPE.num_cmp(e.MgNumVal,a.MgNumVal);break;case r.StorageAttribute.BOOLEAN:o=(e.BoolVal?1:0)-(a.BoolVal?1:0)}return o},i.eval=function(e,n,a){return T(this,void 0,void 0,(function(){var s,o,l,u;return h(this,(function(c){switch(c.label){case 0:return s=null,o=new t.Stack,null!==e&&e.length>0?(l=new i,u=new Tt(e,a.getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY),l.ExpTask=a,[4,l.execExpression(u,o,n)]):[3,2];case 1:c.sent(),s=o.pop(),u.isNull()&&(s.IsNull=!0),c.label=2;case 2:return[2,s]}}))}))},i.DiscardCndRangeResult=function(e,n){return T(this,void 0,void 0,(function(){var a,s,o;return h(this,(function(l){switch(l.label){case 0:return a=new t.Stack,null!==e&&e.length>0?(s=new i,o=new Tt(e,n.getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY),s.ExpTask=n,[4,s.DiscardCndRangeExpression(o,a)]):[3,2];case 1:return[2,l.sent()];case 2:return[2,!1]}}))}))},i.set_a_pic=function(e){var t=Math.min(e.length,99);return r.StrUtil.ZstringMake(e,t)},i.prototype.eval_op_range=function(e,t,n,a){a.BoolVal=!1,a.Attr=r.StorageAttribute.BOOLEAN;try{i.val_cmp_any(e,t,!0)>=0&&(t=n,i.val_cmp_any(e,t,!0)<=0&&(a.BoolVal=!0))}catch(e){if(!(e instanceof _t))throw e;s.prototype.SetNULL.call(this,a,e.getAttr())}},i.prototype.eval_op_rep_1=function(e,t,n,a,o){if(null!==t.StrVal&&null!==n.StrVal&&null!==a.MgNumVal&&null!==o.MgNumVal){i.val_s_cpy(t,e);var l=a.MgNumVal.NUM_2_LONG();l<1&&(l=1);var u=o.MgNumVal.NUM_2_LONG();if(u>n.StrVal.length&&(u=n.StrVal.length),l+u-1>e.StrVal.length&&(u=e.StrVal.length-l+1),!(u<=0)){var c=r.StrUtil.memcpy("",0,e.StrVal,l+u-1,e.StrVal.length-l-u+1);e.StrVal=r.StrUtil.memcpy(e.StrVal,l-1,n.StrVal,0,u),e.StrVal=r.StrUtil.memcpy(e.StrVal,l-1+u,c,0,e.StrVal.length-l-u+1),u-n.StrVal.length>0&&(e.StrVal=r.StrUtil.memset(e.StrVal,l+n.StrVal.length-1," ",u-n.StrVal.length))}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.val_s_cpy=function(e,t){t.Attr=e.Attr,t.StrVal=e.StrVal,t.IsNull=e.IsNull,t.IncludeBlobPrefix=e.IncludeBlobPrefix},i.prototype.val_cpy=function(e,t){switch(e.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:i.val_s_cpy(e,t);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:e.IsNull||(t.MgNumVal=new n.NUM_TYPE(e.MgNumVal));break;case r.StorageAttribute.BOOLEAN:t.BoolVal=e.BoolVal;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("Expression Evaluator.val_cpy no such type of attribute : "+e.Attr)}t.Attr=e.Attr,t.IsNull=e.IsNull},i.prototype.eval_op_ins=function(e,t,n,a,i){if(e.Attr=r.StorageAttribute.UNICODE,null!==t.StrVal&&null!==n.StrVal&&null!==a.MgNumVal&&null!==i.MgNumVal){var o=t.StrVal.length,l=a.MgNumVal.NUM_2_LONG()-1;l=Math.max(l,0),l=Math.min(l,o);var u=i.MgNumVal.NUM_2_LONG();u=Math.max(u,0),u=Math.min(u,n.StrVal.length),e.StrVal=r.StrUtil.memcpy("",0,t.StrVal,0,l),e.StrVal=r.StrUtil.memcpy(e.StrVal,l,n.StrVal,0,u),e.StrVal=r.StrUtil.memcpy(e.StrVal,l+u,t.StrVal,l,o-l)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_del=function(e,t,n,a){if(null!==t.StrVal&&null!==n.MgNumVal&&null!==a.MgNumVal){i.val_s_cpy(t,e);var o=n.MgNumVal.NUM_2_LONG()-1;o<0&&(o=0),o>e.StrVal.length&&(o=e.StrVal.length);var l=a.MgNumVal.NUM_2_LONG();o+l>e.StrVal.length&&(l=e.StrVal.length-o),l<=0||(e.StrVal=r.StrUtil.memcpy(e.StrVal,o,e.StrVal,o+l,e.StrVal.length-o))}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_flip=function(e,n){if(e.Attr=r.StorageAttribute.UNICODE,null!==n.StrVal){var a=new t.StringBuilder(n.StrVal);e.StrVal=r.StrUtil.ReverseString(a).ToString()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_upper=function(e,t){e.Attr=r.StorageAttribute.UNICODE,null!==t.StrVal?e.StrVal=t.StrVal.toUpperCase():s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_lower=function(e,t){e.Attr=r.StorageAttribute.UNICODE,null!=t.StrVal?e.StrVal=t.StrVal.toLowerCase():s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_crc=function(e,t,n){if(e.Attr=r.StorageAttribute.ALPHA,null!=t.StrVal&&null!=n.MgNumVal){var a=0;if(0===n.MgNumVal.NUM_2_LONG())a=i.eval_crc_16(t.StrVal);var o=String.fromCharCode(a%256),l=String.fromCharCode(a/256);e.StrVal=""+o+l}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.eval_crc_16=function(e){for(var t=[40961,61441,55297,52225,50689,49921,49537,49345],r=0,n=e.length,a=0;n>0;n--){var s=e.charCodeAt(r++);s^=i.LO_CHAR(a),a=i.LO_CHAR(i.MK_SHRT(0,i.HI_CHAR(a)));var o=void 0,l=void 0;for(l=0,o=i.LO_CHAR(128);l<8;l++,o=i.LO_CHAR(o)>>1)0!==i.LO_CHAR(s&i.LO_CHAR(o))&&(a^=t[l])}return a},i.LO_CHAR=function(e){return 255&e},i.HI_CHAR=function(e){return(65280&e)>>8},i.MK_SHRT=function(e,t){return e<<8|t},i.MK_LONG=function(e,t,r,n){return e<<24|t<<16|r<<8|n},i.prototype.eval_op_chkdgt=function(e,n,a){var i,o,l,u,c=[String.fromCharCode(1),String.fromCharCode(2),String.fromCharCode(5),String.fromCharCode(3),String.fromCharCode(6),String.fromCharCode(4),String.fromCharCode(8),String.fromCharCode(7),String.fromCharCode(10),String.fromCharCode(9)];if(null!==n.StrVal&&null!==a.MgNumVal){var _=0;switch(a.MgNumVal.NUM_2_LONG()){case 0:for(o=2,i=n.StrVal.length;i>=1;i--)l=n.StrVal.substr(i-1),_+=(u=this.a_2_long(l,1)*o)+(u>9?1:0),o=3-o;0!==(_%=10)&&(_=10-_);break;case 1:for(i=n.StrVal.length;i>=1;i--){o=c[(n.StrVal.length-i)%10].charCodeAt(0);var T=n.StrVal[i-1].toUpperCase();l=n.StrVal.substr(i-1),_+=u=r.UtilStrByteMode.isDigit(T)?this.a_2_long(l,1)*o:t.NChar.IsUpper(l[0])?(l[0].charCodeAt(0)-"A".charCodeAt(0)+1)*o:0}0!==(_%=11)&&(_=11-_)}s.prototype.ConstructMagicNum.call(this,e,_,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.a_2_long=function(e,t){for(var n=0,a=0;a<t;a+=1)r.UtilStrByteMode.isDigit(e.charAt(a))&&(n*=10,n+=e.charCodeAt(a)-"0".charCodeAt(0));return n},i.prototype.eval_op_soundx=function(e,t){var n=["0","1","2","3","0","1","2","0","0","2","2","4","5","5","0","1","2","6","2","3","0","1","0","2","0","2"];if(null!==t.StrVal){e.Attr=r.StorageAttribute.ALPHA,e.StrVal="0000";for(var a=" ",o=0,l=0;l<t.StrVal.length;l++){var u=t.StrVal.charAt(l).toUpperCase(),c=n[u.charCodeAt(0)-"A".charCodeAt(0)];if(0===l)e.StrVal=i.setAt(e.StrVal,o++,u);else if(c>"0"&&c!==a&&(e.StrVal=i.setAt(e.StrVal,o++,c),o>3))break;a=c}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.setAt=function(e,r,n){var a=new t.StringBuilder(e);return r<e.length?a.set_Item(r,n):a.Append(n),a.ToString()},i.prototype.eval_op_hstr=function(e,a){var o,l,u=new n.NUM_TYPE,c=new Array(30),_=new t.StringBuilder(c.length),T=!1;if(e.Attr=r.StorageAttribute.ALPHA,null!=a.MgNumVal){u.num_4_a_std("16");var h=new n.NUM_TYPE(a.MgNumVal);h.num_is_neg()&&(T=!0,h.num_abs());for(var p=0;o=n.NUM_TYPE.mod(h,u),(h=n.NUM_TYPE.div(h,u)).num_trunc(0),l=o.NUM_2_LONG(),p++,i.int_2_hex(c,c.length-p,1,l,0),!h.num_is_zero(););for(T&&(p++,c[c.length-p]="-"),l=c.length-p;l<c.length;l++)_.Append(c[l]);e.StrVal=_.ToString()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.int_2_hex=function(e,t,r,n,a){var s=r;do{var o=n%16;e[--s+t]=o<10?String.fromCharCode("0".charCodeAt(0)+o):String.fromCharCode("A".charCodeAt(0)+o-10),n=Math.floor(n/16)}while(s>0&&0!==n);i.lib_a_fill(e,r,s+t,a)},i.lib_a_fill=function(e,t,n,a){0===a?(t-=n)>0&&n>0&&(r.StrUtil.memcpy(e,0,e,n,t),r.StrUtil.memset(e,t," ",n)):n>0&&r.StrUtil.memset(e,0,String.fromCharCode(a),n)},i.prototype.eval_op_hval=function(e,t){var a,i=new n.NUM_TYPE,o=new n.NUM_TYPE,l=0,u=!1;if(null!==t.StrVal){for(i.num_4_a_std("16"),e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_ZERO(),a=0;a<t.StrVal.length;a++){var c=t.StrVal[a];"-"===c&&0===l&&(u=!0);var _=this.hex_2_long(t.StrVal,a,1);0===_&&"0"!==c||(l=1,e.MgNumVal=n.NUM_TYPE.mul(e.MgNumVal,i),o.NUM_4_LONG(_),e.MgNumVal=n.NUM_TYPE.add(e.MgNumVal,o))}u&&e.MgNumVal.num_neg(),e.Attr=r.StorageAttribute.NUMERIC}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.hex_2_long=function(e,t,n){var a,s=0;for(a=t;a<t+n;a++){var i=e.charAt(a).toUpperCase();r.UtilStrByteMode.isDigit(i)?(s*=16,s+=i.charCodeAt(0)-"0".charCodeAt(0)):i>="A"&&i<="F"&&(s*=16,s+=i.charCodeAt(0)-"A".charCodeAt(0)+10)}return s},i.prototype.eval_op_chr=function(e,t){e.Attr=r.StorageAttribute.ALPHA,null!==t.MgNumVal?e.StrVal=String.fromCharCode(t.MgNumVal.NUM_2_LONG())[0]:s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_asc=function(e,n){if(null!==n.StrVal){var a=n.StrVal.length>0?t.Encoding.ASCII.GetBytes(n.StrVal)[0]:0;this.ConstructMagicNum(e,a,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_mstr=function(e,t,a){if(e.Attr=r.StorageAttribute.ALPHA,null!=t.MgNumVal||null!=a.MgNumVal){var i=new n.NUM_TYPE(t.MgNumVal);i.NUM_IS_LONG()&&i.num_4_std_long();var o=a.MgNumVal.NUM_2_LONG();o=Math.max(o,2);for(var l=new Int8Array(o),u=0;u<o;u++)l[u]=i.Data[u];var c=r.Misc.ToByteArray(l);e.StrVal=et.Instance.GetEncoding().GetString(c,0,c.length)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_mval=function(e,t){if(e.Attr=r.StorageAttribute.NUMERIC,null!=t.StrVal){e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_SET_ZERO();var a=Math.min(t.StrVal.length,n.NUM_TYPE.NUM_SIZE);e.MgNumVal=new n.NUM_TYPE(r.Misc.ToSByteArray(et.Instance.GetEncoding().GetBytes(t.StrVal)),0,a)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_dstr=function(e,t,n,a){e.Attr=r.StorageAttribute.UNICODE,null!=t.MgNumVal&&null!=n.StrVal?e.StrVal=a.to_a(e.StrVal,100,t.MgNumVal.NUM_2_ULONG(),n.StrVal,this.ExpTask.getCompIdx()):s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_tstr=function(e,t,n,a,i){e.Attr=r.StorageAttribute.ALPHA,null!=t.MgNumVal&&null!=n.StrVal?e.StrVal=a.time_2_a(e.StrVal,100,t.MgNumVal.NUM_2_ULONG(),n.StrVal,this.ExpTask.getCompIdx(),i):s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_dval=function(e,a,i,o){if(null!==a.StrVal&&null!==i.StrVal){if(a.Attr===r.StorageAttribute.UNICODE)if(a.StrVal.length+2<=n.NUM_TYPE.NUM_SIZE);else{for(var l=new Array(a.StrVal.length+2),u=0;u<l.length;++u)l[u]="\0";r.StrUtil.memcpy(l,0,t.NString.ToCharArray(a.StrVal),0,a.StrVal.length)}var c=o.a_2_date(a.StrVal,i.StrVal,this.ExpTask.getCompIdx());c>=1e9&&(c=0),s.prototype.ConstructMagicNum.call(this,e,c,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_tval=function(e,t,a,i,o){if(null!==t.StrVal&&null!==a.StrVal){var l=new n.PIC(a.StrVal,r.StorageAttribute.TIME,this.ExpTask.getCompIdx()),u=i.a_2_time(t.StrVal,l,o);u>=1e9&&(u=0),s.prototype.ConstructMagicNum.call(this,e,u,r.StorageAttribute.TIME)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.TIME)},i.prototype.eval_op_day=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,0)},i.prototype.eval_op_month=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,1)},i.prototype.eval_op_year=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,2)},i.prototype.eval_op_dow=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,3)},i.prototype.eval_op_second=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,2)},i.prototype.eval_op_minute=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,1)},i.prototype.eval_op_hour=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,0)},i.prototype.eval_op_date_brk=function(e,t,a){if(null!==t){var i=t.NUM_2_LONG(),o=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(o,i,!1,this.ExpTask.getCompIdx());var l=o.year,u=o.month,c=o.day,_=o.doy,T=o.dow;switch(a){case 0:i=c;break;case 1:i=u;break;case 2:i=l;break;case 3:i=T;break;case 4:i=r.UtilDateJpn.getInstance().date_jpn_year_ofs(l,_);break;default:i=0}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_time_brk=function(e,t,a){if(null!==t){var i=t.NUM_2_ULONG(),o=n.DisplayConvertor.Instance.getNewTimeBreakParams();n.DisplayConvertor.time_break(o,i);var l=o.hour,u=o.minute,c=o.second;switch(a){case 0:i=l;break;case 1:i=u;break;case 2:i=c;break;default:i=0}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_addDateTime=function(e,t,a,i,o,l,u,c,_){var p=Object.create(null,{SetVal:{get:function(){return s.prototype.SetVal}}});return T(this,void 0,void 0,(function(){var s,T,g,d,E;return h(this,(function(h){switch(h.label){case 0:return s=new n.ExpVal,null===t.MgNumVal||null===a.MgNumVal?(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,[2]):(T=this.GetFieldOfContextTask(a.MgNumVal.NUM_2_LONG()),p.SetVal.call(this,s,T.getType(),T.getValue(!0),null),this.eval_op_addtime(e,s,u,c,_),g=e.MgNumVal.NUM_2_LONG(),d=Math.floor(g/86400),(g%=86400)<0&&(d--,g=86400- -g),E=this.GetFieldOfContextTask(t.MgNumVal.NUM_2_LONG()),p.SetVal.call(this,s,E.getType(),E.getValue(!0),null),this.eval_op_adddate(e,s,i,o,l),d+=e.MgNumVal.NUM_2_LONG(),s.MgNumVal.NUM_4_LONG(g),[4,T.setValueAndStartRecompute(s.ToMgVal(),!1,!0,!1,!1)]);case 1:return h.sent(),[4,T.updateDisplay()];case 2:return h.sent(),s.MgNumVal.NUM_4_LONG(d),[4,E.setValueAndStartRecompute(s.ToMgVal(),!1,!0,!1,!1)];case 3:return h.sent(),[4,E.updateDisplay()];case 4:return h.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_difdt=function(e,t,a,s,i,o,l){return T(this,void 0,void 0,(function(){var u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return(u=new n.ExpVal).MgNumVal=new n.NUM_TYPE,u.Attr=r.StorageAttribute.NUMERIC,u,null===o.MgNumVal||null===l.MgNumVal?(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,[2]):(c=t.MgNumVal.NUM_2_LONG()-s.MgNumVal.NUM_2_LONG(),(_=a.MgNumVal.NUM_2_LONG()-i.MgNumVal.NUM_2_LONG())<0&&_>-86400&&c>0&&(c--,_=86400- -_),T=this.GetFieldOfContextTask(o.MgNumVal.NUM_2_LONG()),p=this.GetFieldOfContextTask(l.MgNumVal.NUM_2_LONG()),u.MgNumVal.NUM_4_LONG(c),[4,T.setValueAndStartRecompute(u.ToMgVal(),!1,!0,!1,!1)]);case 1:return h.sent(),[4,T.updateDisplay()];case 2:return h.sent(),u.MgNumVal.NUM_4_LONG(_),[4,p.setValueAndStartRecompute(u.ToMgVal(),!1,!0,!1,!1)];case 3:return h.sent(),[4,p.updateDisplay()];case 4:return h.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_ndow=function(e,t,n){null!==t.MgNumVal?(t.MgNumVal=this.mul_add(t.MgNumVal,0,6),this.eval_op_cdow(e,t.MgNumVal,n)):s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_nmonth=function(e,t,n){null!=t.MgNumVal?(t.MgNumVal=this.mul_add(t.MgNumVal,31,-30),this.eval_op_cmonth(e,t.MgNumVal,n)):s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.mul_add=function(e,t,r){var a=new n.NUM_TYPE;return null===e?null:(0!==t&&(a.NUM_4_LONG(t),e=n.NUM_TYPE.mul(e,a)),0!==r&&(a.NUM_4_LONG(r),e=n.NUM_TYPE.add(e,a)),e)},i.prototype.eval_op_cdow=function(e,t,r){this.eval_op_date_str(e,t,"WWWWWWWWWWT",r)},i.prototype.eval_op_cmonth=function(e,t,r){this.eval_op_date_str(e,t,"MMMMMMMMMMT",r)},i.prototype.eval_op_date_str=function(e,t,n,a){if(e.Attr=r.StorageAttribute.ALPHA,null!==t){var i=t.NUM_2_ULONG();e.StrVal=a.to_a(e.StrVal,10,i,n,this.ExpTask.getCompIdx())}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_delay=function(e){},i.prototype.eval_op_idle=function(e){var t=0,a=et.Instance.getIdleTime(this.ExpTask.getCompIdx());if(a>0){var s=r.Misc.getSystemMilliseconds();t=Math.floor(Math.floor((s-G.Instance.LastActionTime)/1e3)/a)}e.MgNumVal=new n.NUM_TYPE,e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal.NUM_4_LONG(t*a*10)},i.prototype.eval_op_adddate=function(e,t,a,i,o){var l;if(null!==t.MgNumVal&&null!==a.MgNumVal&&null!==i.MgNumVal&&null!==o.MgNumVal){var u=t.MgNumVal.NUM_2_LONG(),c=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(c,u,!1,this.ExpTask.getCompIdx());var _=c.year,T=c.month,h=c.day;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(_=Math.max(_-r.PICInterface.DATE_BUDDHIST_GAP,0)),_+=a.MgNumVal.NUM_2_LONG(),T+=i.MgNumVal.NUM_2_LONG();var p=o.MgNumVal.NUM_2_LONG(),g=0===h&&0!==_&&0!==T&&0!==p?1:0,d=T+12*_;for(_=Math.floor((d-1)/12),T=(d-1)%12+1,l=0;l<4&&!((u=n.DisplayConvertor.Instance.date_4_calender(_,T,h+g,0,!1))<1e9);l++)h--;1e9===u?u=0:(u+=p-g,u=Math.max(u,0)),s.prototype.ConstructMagicNum.call(this,e,u,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_addtime=function(e,t,n,a,i){if(null!==t.MgNumVal&&null!==n.MgNumVal&&null!==a.MgNumVal&&null!==i.MgNumVal){var o=t.MgNumVal.NUM_2_ULONG()+3600*n.MgNumVal.NUM_2_LONG()+60*a.MgNumVal.NUM_2_LONG()+i.MgNumVal.NUM_2_LONG();s.prototype.ConstructMagicNum.call(this,e,o,r.StorageAttribute.TIME)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.TIME)},i.prototype.eval_op_bom=function(e,t){var a;if(null!=t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i)a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx()),i-=a.day-1;s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_boy=function(e,t){var a;if(null!==t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i){a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx());var o=a.year;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0)),i=n.DisplayConvertor.Instance.date_4_calender(o,1,1,0,!1)}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_eom=function(e,t){var a;if(null!==t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i){a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx());var o=a.year,l=a.month,u=31;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0));var c=void 0;for(c=0;c<4&&!((i=n.DisplayConvertor.Instance.date_4_calender(o,l,u,0,!1))<1e9);c++)u--}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_eoy=function(e,t){if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_ULONG();if(0!==a){var i=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(i,a,!1,this.ExpTask.getCompIdx());var o=i.year;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0)),a=n.DisplayConvertor.Instance.date_4_calender(o,12,31,0,!1)}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_strtok=function(e,n,a,i){var o,l,u,c,_="";if(null!==n.StrVal&&null!==a.MgNumVal&&null!==i.StrVal||s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE),!t.NString.IsNullOrEmpty(n.StrVal)&&i.StrVal.length>0&&(o=new t.StringBuilder(n.StrVal.length+2),(u=a.MgNumVal.NUM_2_LONG())>0))if(c=t.NString.TrimEnd(i.StrVal,this._charsToTrim),o.Append(n.StrVal),0===c.length)1===u&&(_=o.ToString());else{l=o.ToString();var T=void 0;for(T=0;T<u;T++){if(null===(_=r.StrUtil.strstr(l,c))){T===u-1&&(_=l);break}_=l.substr(0,l.length-_.length),l=l.substr(_.length+c.length)}}null!==_?(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=_):(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=""),u=a.MgNumVal.NUM_2_LONG(),t.NString.IsNullOrEmpty(n.StrVal)||0!==i.StrVal.length||1!==u||(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=n.StrVal)},i.prototype.eval_op_dbround=function(e,t,a){if(null!==t.MgNumVal&&null!==a.MgNumVal){e.MgNumVal=new n.NUM_TYPE(t.MgNumVal);var i=a.MgNumVal.NUM_2_LONG();i<0?e.MgNumVal.dbRound(-i):e.MgNumVal.round(i),e.Attr=r.StorageAttribute.NUMERIC}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varpic=function(e,n,a){var i,o;if(null!==a.MgNumVal)if(null!==n.MgNumVal){var l=a.MgNumVal.NUM_2_LONG(),u=n.MgNumVal.NUM_2_LONG();e.Attr=r.StorageAttribute.UNICODE;try{i=this.GetFieldOfContextTask(u)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),i=null}if(null===i)return r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.eval_op_varpic there is no control number "+u),void(e.StrVal="");0===l||null===(o=i.getCtrl())?i.getType()===r.StorageAttribute.BLOB||i.getType()===r.StorageAttribute.BLOB_VECTOR?e.StrVal="":e.StrVal=i.getPicture():e.StrVal=o.getPIC().getFormat()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE);else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_varattr=function(e,n){var a;if(e.Attr=r.StorageAttribute.ALPHA,null!==n.MgNumVal){var o=n.MgNumVal.NUM_2_LONG();try{a=this.GetFieldOfContextTask(o)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),a=null}if(null===a)return r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.eval_op_varattr there is no control number "+o),void(e.StrVal="");var l=a.getType();e.StrVal=""+i.GetAttributeChar(l)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.exp_null_val_get=function(e,a,s){var i="",o=0;if(s.IsNull=!0,a===n.ExpressionInterface.EXP_OP_NULL)switch(s.Attr=e,e===r.StorageAttribute.ALPHA&&(i=""),e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.MEMO:a=n.ExpressionInterface.EXP_OP_NULL_A;break;case r.StorageAttribute.NUMERIC:a=n.ExpressionInterface.EXP_OP_NULL_N;break;case r.StorageAttribute.BOOLEAN:a=n.ExpressionInterface.EXP_OP_NULL_B;break;case r.StorageAttribute.DATE:a=n.ExpressionInterface.EXP_OP_NULL_D;break;case r.StorageAttribute.TIME:a=n.ExpressionInterface.EXP_OP_NULL_T;break;case r.StorageAttribute.UNICODE:a=n.ExpressionInterface.EXP_OP_NULL_U}switch(a){case n.ExpressionInterface.EXP_OP_NULL:case n.ExpressionInterface.EXP_OP_NULL_A:e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR&&(s.Attr=r.StorageAttribute.ALPHA),i="";break;case n.ExpressionInterface.EXP_OP_NULL_N:s.Attr=r.StorageAttribute.NUMERIC;break;case n.ExpressionInterface.EXP_OP_NULL_B:s.Attr=r.StorageAttribute.BOOLEAN,o=0;break;case n.ExpressionInterface.EXP_OP_NULL_D:s.Attr=r.StorageAttribute.DATE,o=t.NNumber.Parse(r.PICInterface.DEFAULT_DATE);break;case n.ExpressionInterface.EXP_OP_NULL_T:s.Attr=r.StorageAttribute.TIME,o=t.NNumber.Parse(r.PICInterface.DEFAULT_TIME);break;case n.ExpressionInterface.EXP_OP_NULL_U:e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR&&(s.Attr=r.StorageAttribute.UNICODE),i="";break;case n.ExpressionInterface.EXP_OP_NULL_O:s.Attr=r.StorageAttribute.BLOB}switch(s.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:s.StrVal=i;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(a===n.ExpressionInterface.EXP_OP_NULL_N){for(var l=new Int8Array(n.NUM_TYPE.NUM_SIZE),u=0;u<l.length;u++)l[u]=0;s.MgNumVal=new n.NUM_TYPE(l)}else this.ConstructMagicNum(s,o,s.Attr);break;case r.StorageAttribute.UNICODE:s.StrVal=i;break;case r.StorageAttribute.BOOLEAN:s.BoolVal=!1}},i.prototype.exp_get_var=function(e,t,r){a.isNullOrUndefined(r)?this.exp_get_var_1(e,t):this.exp_get_var_0(e,t,r)},i.prototype.exp_get_var_0=function(e,n,a){var i=null;if(null!==n.MgNumVal){var o=n.MgNumVal.NUM_2_LONG();i=this.GetFieldOfContextTask(o)}if(null!==i){if(!1===i.IsExposedToClient){var l=new t.StringBuilder;return l.Append(t.NString.Format("Error: Variable '{0}' is not exposed to client.",i.getVarName())),alert(l.ToString()),void(e.IsNull=!0)}a&&i.getTask().setEvalOldValues(!0),s.prototype.SetVal.call(this,e,i.getType(),i.getValue(!0),null),a?i.isOriginalValueNull()&&s.prototype.SetNULL.call(this,e,r.StorageAttribute.NONE):e.IsNull=i.isNull(),a&&i.getTask().setEvalOldValues(!1)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NONE)},i.prototype.eval_op_varmod=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n);if(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,null!==a){var i=a.getId(),o=a.getTask().DataView,l=o.getCurrRec();e.BoolVal=!l.fldValsEqual(o.getOriginalRec(),i)}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN)},i.prototype.eval_op_varinp=function(e,t){var n=0;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&(n=o.ctl_itm_4_parent_vee(0,o.getCurrFieldIdx()+1))}s.prototype.ConstructMagicNum.call(this,e,n,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varname=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n),i=null!==a?a.getName():"";e.StrVal=i,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_VarDisplayName=function(e,t){if(e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n);null!==a&&(e.StrVal=a.VarDisplayName)}},i.prototype.eval_op_VarControlID=function(e,t){var a=0;if(null!==t.MgNumVal){var s=t.MgNumVal.NUM_2_LONG();s===i.TRIGGER_TASK&&(s=this.ExpTask.GetContextTask().ctl_itm_4_parent_vee(0,this.ExpTask.GetContextTask().getCurrFieldIdx()+1)),a=this.ExpTask.GetContextTask().GetControlIDFromVarItem(s-1)}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_ControlItemsList=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null===n.MgNumVal?[3,2]:(a=n.MgNumVal.NUM_2_LONG(),s=0,i=new t.RefParam(s),o=this.ExpTask.GetContextTask().GetControlFromControlID(a-1,i),s=i.value,null!==o&&o.isChoiceControl()?(l=e,[4,o.getForm().GetChoiceControlItemList(o)]):[3,2]);case 1:l.StrVal=u.sent(),u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_ControlDisplayList=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null===n.MgNumVal?[3,2]:(a=n.MgNumVal.NUM_2_LONG(),s=0,i=new t.RefParam(s),o=this.ExpTask.GetContextTask().GetControlFromControlID(a-1,i),s=i.value,null!==o&&o.isChoiceControl()?(l=e,[4,o.getForm().GetChoiceControlDisplayList(o)]):[3,2]);case 1:l.StrVal=u.sent(),u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_viewmod=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG();if(n>=0&&n<this.ExpTask.getTaskDepth(!1)||n===i.TRIGGER_TASK){var a=s.prototype.GetContextTask.call(this,n);if(a.isMainProg())e.BoolVal=!1;else if(e.BoolVal=a.DataView.getCurrRec().Modified,!e.BoolVal){var o=a.DataView.getCurrRec(),l=a.DataView.getOriginalRec();e.BoolVal=!o.isSameRecData(l,!0,!0)}}else e.BoolVal=!1;e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN)},i.prototype.eval_op_level=function(e,t){var n="";if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);if(n=o.getBrkLevel(),a!==i.TRIGGER_TASK&&o!==this.ExpTask&&n.toUpperCase()===E.BRK_LEVEL_REC_MAIN.toUpperCase())if(o.isMainProg())n=E.BRK_LEVEL_MAIN_PROG;else{for(var l=new Array(this.ExpTask.getTaskDepth(!1)),u=0;u<l.length;++u)l[u]=null;this.ExpTask.pathToRoot(l,!1),a>0&&l[a-1].IsSubForm&&(n=E.BRK_LEVEL_SUBFORM)}}e.StrVal=n,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_counter=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);a=null===l?0:l.getCounter()}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_emptyDataview=function(e,t){var n=!1,a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&o.DataView.isEmptyDataview()&&(n=!0)}e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=n},i.prototype.eval_op_mainlevel=function(e,t){var n="";if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK)n=s.prototype.GetContextTask.call(this,a).getMainLevel();e.StrVal=n,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_maindisplay=function(e,t){var a=0;if(null!==t.MgNumVal){var o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK)a=s.prototype.GetContextTask.call(this,o).getProp(n.PropInterface.PROP_TYPE_MAIN_DISPLAY).GetComputedValueInteger();s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_IsFirstRecordCycle=function(e,t){var n=!1;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK)n=s.prototype.GetContextTask.call(this,a).isFirstRecordCycle();e.BoolVal=n,e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.exp_is_default=function(e,t){e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1;var n=t.MgNumVal.NUM_2_LONG(),a=this.ExpTask.ctl_itm_2_parent_vee(n-1);if(null!==a){a.isNull()&&(a.isNullDefault()||a.getType()===r.StorageAttribute.BLOB_VECTOR)&&(e.BoolVal=!0);var s=a.getValue(!1),o=a.getDefaultValue(),l=a.getType();e.BoolVal=i.mgValsEqual(s,a.isNull(),l,o,a.isNullDefault(),l)}},i.prototype.eval_op_IsLoggedIn=function(e){e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=at.Instance.getIsLoggedIn()},i.prototype.eval_op_appname=function(e){e.Attr=r.StorageAttribute.ALPHA,e.StrVal=ne.Instance.getAppName()},i.prototype.eval_op_prog=function(e){e.Attr=r.StorageAttribute.ALPHA,e.StrVal=this.ExpTask.queryTaskPath().ToString()},i.prototype.eval_op_this=function(e){var t=0;null!==this.ExpTask&&(t=i.TRIGGER_TASK),s.prototype.ConstructMagicNum.call(this,e,t,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_stat=function(e,t,n){var a=!1,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);if(null!==l)for(var u=l.getMode().toUpperCase(),c=0;c<n.StrVal.length;c+=1){var _=n.StrVal.charAt(c).toUpperCase(),T=this.cst_code_trans_buf("I","MCDEPLRKSONB",_,r.MsgInterface.EXPTAB_TSK_MODE_RT);if("\0"===T&&"Q"===(T=_.toUpperCase())&&(T="E"),T===u){a=!0;break}}}e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=a},i.prototype.eval_op_subformExecMode=function(t,n){var a=e.Task_SubformExecModeEnum.NO_SUBFORM,o=n.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.IsSubForm&&(a=l.SubformExecMode)}s.prototype.ConstructMagicNum.call(this,t,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varset=function(e,t,a){var i=Object.create(null,{SetNULL:{get:function(){return s.prototype.SetNULL}}});return T(this,void 0,void 0,(function(){var s,o,l,u;return h(this,(function(c){switch(c.label){case 0:if(e.BoolVal=!0,e.Attr=r.StorageAttribute.BOOLEAN,null===a.MgNumVal)return[2];if(s=a.MgNumVal.NUM_2_LONG(),null===(o=this.GetFieldOfContextTask(s)))return e.BoolVal=!1,[2];if(r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(o.getType(),t.Attr)&&this.ConvertExpVal(t,o.getType()),r.StorageAttributeCheck.isTheSameType(o.getType(),t.Attr))switch(o.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:l=t.StrVal;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:l=t.MgNumVal.toXMLrecord();break;case r.StorageAttribute.BOOLEAN:l=t.BoolVal?"1":"0";break;case r.StorageAttribute.BLOB:l=t.ToMgVal();break;case r.StorageAttribute.BLOB_VECTOR:if(l=t.ToMgVal(),!t.IsNull&&(t.Attr===r.StorageAttribute.BLOB&&(n.VectorType.validateBlobContents(t.StrVal)||(l=null)),null!=l&&(l=it.operUpdateVectors(o,l)),null!=l))break;default:return i.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN),[2]}else l=o.getDefaultValue();return t.IsNull&&null===(l=o.getNullValue())&&o.getMagicDefaultValue(),u=o.getTask()!==this.ExpTask||o.getTask().getBrkLevel()===E.BRK_LEVEL_REC_SUFFIX,[4,o.setValueAndStartRecompute(l,t.IsNull,!0,u,!1)];case 1:return c.sent(),[4,o.updateDisplay()];case 2:return c.sent(),[2]}}))}))},i.prototype.eval_op_rollback=function(e,t,n){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t=this.ExpTask.GetContextTask()||this.ExpTask,[4,o.eventsManager.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_ROLLBACK)];case 1:return n.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_like=function(e,n,a){var o,l,u,c=e.StrVal,_=n.StrVal,T=0,h=!0;if(null!==c&&null!==_){var p=c.length,g=_.length,d=new Array(g),E=new t.StringBuilder(g);for(o=0,l=0,u=!1;o<g;o++){var I=_[o];switch(I){case"\\":u&&(d[l++]=I),u=!u;break;case"*":u?d[l++]=I:(d[l++]=i.ASTERISK_CHR,T++),u=!1;break;case"?":d[l++]=u?I:i.QUESTION_CHR,u=!1;break;default:d[l++]=I,u=!1}}g=l;var f=(_=i.arrToStr(d,0,d.length)).lastIndexOf(i.ASTERISK_CHR);if(-1===f)h=i.op_like_cmp(c,_);else{for(o=0;d[o]!==i.ASTERISK_CHR&&h;o++,g--,p--)h=0!==p&&(d[o]===i.QUESTION_CHR||d[o]===c[o]);for(c=c.substr(o),d=i.cutArray(d,o);h&&1!==T;){var C=void 0,A=void 0;for(C=1,A=0;C+o!==f&&d[C]!==i.ASTERISK_CHR;C++,A++);T--,p=c.length,0!==A&&(p>0?(E.Remove(0,E.Length),E.Append(c),h=i.op_like_map(E,i.arrToStr(d,1,A+1),!1),c=E.ToString()):h=!1),o+=C,d=i.cutArray(d,C)}d[0]===i.ASTERISK_CHR&&(d=i.cutArray(d,1)),h&&d.length>0&&(E.Remove(0,E.Length),E.Append(c),h=i.op_like_map(E,i.arrToStr(d),!0))}a.Attr=r.StorageAttribute.BOOLEAN,a.BoolVal=h}else s.prototype.SetNULL.call(this,a,r.StorageAttribute.BOOLEAN)},i.cutArray=function(e,t){for(var r=e.length-t,n=new Array(r),a=0;a<r;a++)n[a]=e[t+a];return n},i.prototype.eval_op_repstr=function(e,n,a,i){null!==e.StrVal&&null!==n.StrVal&&null!==a.StrVal&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(e.Attr)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(n.Attr)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)?(i.StrVal=t.NString.Replace(e.StrVal,n.StrVal,a.StrVal),i.Attr=r.StorageAttribute.UNICODE):s.prototype.SetNULL.call(this,i,r.StorageAttribute.UNICODE)},i.arrToStr=function(e,t,r){return 1===arguments.length?i.arrToStr_0(e):i.arrToStr_1(e,t,r)},i.arrToStr_0=function(e){return i.arrToStr(e,0,e.length)},i.arrToStr_1=function(e,r,n){for(var a=new t.StringBuilder(n-r);r<n;r++)a.Append(e[r]);return a.ToString()},i.op_like_cmp=function(e,t){var r=!0,n=t,a=e.length,s=t.length;for(a<s?r=!1:a>s&&(n=t);n.length<a;)n+=" ";for(var o=0;o<a&&r;o++)r=n.charAt(o)===i.QUESTION_CHR||n.charAt(o)===e.charAt(o);return r},i.op_like_map=function(e,t,r){var n=!1,a=e.ToString(),s=0;if(!r&&e.Length<t.length)return!1;var o=0;for(o=0;o<e.Length&&!n;o++)if(n=!0,r)n=i.op_like_cmp(a.substr(o),t);else for(s=0;s<t.length&&n;s++){if(o+s===e.Length)return!1;n=t.charAt(s)===i.QUESTION_CHR||t.charAt(s)===a.charAt(o+s)}return n&&(e.Remove(0,e.Length),e.Append(a.substr(o+s-1))),n},i.prototype.exp_get_var_1=function(e,n){var a=e.StrVal,i=this.ExpTask.getFieldByName(a);if(null!==i){if(!1===i.IsExposedToClient){var o=new t.StringBuilder;return o.Append(t.NString.Format("Error: Variable '{0}' is not exposed to client.",i.getVarName())),alert(o.ToString()),void(n.IsNull=!0)}var l=i.getValue(!0);n.IsNull=i.isNull(),s.prototype.SetVal.call(this,n,i.getType(),l,null)}else s.prototype.SetNULL.call(this,n,r.StorageAttribute.NONE)},i.prototype.exp_get_indx=function(e,t){var n=this.ExpTask.GetContextTask().getIndexOfFieldByName(e.StrVal);s.prototype.ConstructMagicNum.call(this,t,n,r.StorageAttribute.NUMERIC)},i.prototype.getField=function(e){return e!==i.TRIGGER_TASK?this.ExpTask.ctl_itm_2_parent_vee(e-1):o.eventsManager.getCurrField()},i.prototype.GetFieldOfContextTask=function(e){return e!==i.TRIGGER_TASK?this.ExpTask.GetContextTask().ctl_itm_2_parent_vee(e-1):o.eventsManager.getCurrField()},i.trimStr=function(e,r){var n=0;if(t.NString.IsNullOrEmpty(e))return e;var a=e.length-1;if("R"!==r)for(;n<e.length&&" "===e.charAt(n);)n++;if("L"!==r)for(;a>=n&&" "===e.charAt(a);)a--;return++a>n?e.substr(n,a-n):""},i.mgValsEqual=function(e,t,r,a,s,o){var l=null,u=null,c=!1;if(t===s&&(t||null!==e&&null!==a))try{l=new n.ExpVal(r,t,e),u=new n.ExpVal(o,s,a),c=0===i.val_cmp_any(l,u,!1)}catch(e){if(!(e instanceof _t))throw e;l.IsNull&&u.IsNull&&(c=!0)}return c},i.prototype.eval_op_translate=function(e,n){n.Attr=r.StorageAttribute.ALPHA,n.StrVal="";var a=e.StrVal;t.NString.IsNullOrEmpty(a)?s.prototype.SetNULL.call(this,n,r.StorageAttribute.ALPHA):n.StrVal=lt.Instance.translate(a)},i.prototype.eval_op_astr=function(e,t,a){if(a.Attr=r.StorageAttribute.UNICODE,null!==e.StrVal&&null!==t.StrVal){if(t.StrVal.length>0&&e.StrVal.length>0){var o=new n.PIC(i.set_a_pic(t.StrVal),r.StorageAttribute.UNICODE,this.ExpTask.getCompIdx());a.StrVal=n.DisplayConvertor.Instance.mg2disp(e.ToMgVal(),null,o,!1,!1,this.ExpTask.getCompIdx(),!0,!1)}}else s.prototype.SetNULL.call(this,a,r.StorageAttribute.UNICODE)},i.eval_op_vecCellAttr=function(e,t){t.Attr=r.StorageAttribute.ALPHA,t.IsNull=!1;var a=r.StorageAttribute.NONE;e.IsNull&&null!==e.VectorField?a=e.VectorField.getCellsType():i.IsValidVector(e)&&(a=n.VectorType.getCellsAttr(e.StrVal)),t.StrVal=""+i.GetAttributeChar(a)},i.prototype.eval_op_vecGet=function(e,a,s){if(null===a.MgNumVal||!i.IsValidVector(e)||a.MgNumVal.NUM_2_LONG()<=0)s.IsNull=!0;else{var o=void 0,l=void 0;if(null!==e.VectorField)o=e.VectorField.getCellsType(),l=e.VectorField.getVecCellValue(a.MgNumVal.NUM_2_LONG());else{var u=new n.VectorType(e.StrVal);l=u.getVecCell(a.MgNumVal.NUM_2_LONG()),o=u.getCellsAttr()}if(null==l)s.IsNull=!0;else switch(o){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:s.Attr=r.StorageAttribute.ALPHA,s.StrVal=l;break;case r.StorageAttribute.UNICODE:s.Attr=o,s.StrVal=l;break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:s.Attr=o,s.StrVal=l,s.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:s.Attr=o,s.MgNumVal=new n.NUM_TYPE(l);break;case r.StorageAttribute.BOOLEAN:s.Attr=o,s.BoolVal=n.DisplayConvertor.toBoolean(l);break;default:throw new t.ApplicationException("in ExpressionEvaluator.eval_op_vecGet unknowen storage type: "+o)}}},i.prototype.eval_op_vecSize=function(e,t){t.Attr=r.StorageAttribute.NUMERIC,t.IsNull=!1,t.MgNumVal=new n.NUM_TYPE,t.MgNumVal.NUM_4_LONG(-1),i.IsValidVector(e)&&t.MgNumVal.NUM_4_LONG(new n.VectorType(e.StrVal).getVecSize())},i.prototype.eval_op_vecSet=function(e,n,a,s){return T(this,void 0,void 0,(function(){var i,o;return h(this,(function(l){switch(l.label){case 0:if(s.Attr=r.StorageAttribute.BOOLEAN,s.BoolVal=!1,null===e.MgNumVal||null===n.MgNumVal)return[3,2];i=void 0;try{i=this.getField(e.MgNumVal.NUM_2_LONG())}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),i=null}return r.StorageAttributeCheck.IsTypeAlphaOrUnicode(i.getCellsType())&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)||null!==i&&(i.IsVirtual||i.getTask().getMode()===r.Constants.TASK_MODE_CREATE||i.DbModifiable)&&i.getType()===r.StorageAttribute.BLOB_VECTOR&&(r.StorageAttributeCheck.isTheSameType(i.getCellsType(),a.Attr)||a.IsNull||r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)&&i.getCellsType()===r.StorageAttribute.BLOB)?(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)&&i.getCellsType()===r.StorageAttribute.BLOB&&this.ConvertExpVal(a,r.StorageAttribute.BLOB),o=s,[4,i.setCellVecValue(n.MgNumVal.NUM_2_LONG(),a.ToMgVal(),a.IsNull)]):[3,2];case 1:o.BoolVal=l.sent(),l.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_strTokenCnt=function(e,a,s){s.Attr=r.StorageAttribute.NUMERIC,s.MgNumVal=new n.NUM_TYPE;var i=0;if(!e.IsNull&&null!==e.StrVal&&0!==t.NString.TrimEnd(e.StrVal,this._charsToTrim).length)if(a.IsNull||0===t.NString.TrimEnd(a.StrVal,this._charsToTrim).length)i=1;else{var o=this.strTokenCount(e.StrVal,a.StrVal);i=0===o?1:o}s.MgNumVal.NUM_4_LONG(i)},i.prototype.eval_op_strTokenIdx=function(e,a,s,i){i.Attr=r.StorageAttribute.NUMERIC,i.MgNumVal=new n.NUM_TYPE;var o=0;!e.IsNull&&null!==e.StrVal&&!a.IsNull&&null!==a.StrVal&&0!==t.NString.TrimEnd(e.StrVal,this._charsToTrim).length&&a.StrVal.trim().length>0&&(o=s.IsNull||0===t.NString.TrimEnd(s.StrVal,this._charsToTrim).length?e.StrVal===a.StrVal?1:0:this.strTokenIndex(e.StrVal,s.StrVal,a.StrVal)),i.MgNumVal.NUM_4_LONG(o)},i.prototype.strTokenIndex=function(e,r,n){var a=t.NString.TrimEnd(r,this._charsToTrim),s=a+t.NString.TrimEnd(e,this._charsToTrim)+a,i=null!==n?t.NString.TrimEnd(n,this._charsToTrim):null;if(null===i)return 0;i=a+i+a;var o=s.indexOf(i);if(-1===o)return 0;var l=this.strTokenCount(s.substr(0,o+a.length),a);return--l},i.prototype.strTokenCount=function(e,r){var n=1,a=t.NString.TrimEnd(r,this._charsToTrim),s=t.NString.TrimEnd(e,this._charsToTrim),i=a.length,o=s,l=0,u=0;if(null===e||0===e.length)return 0;for(u=o.indexOf(a,l);u>=0;)n++,l=u+i,u=o.indexOf(a,l);return n},i.prototype.eval_op_blobsize=function(e,t){var a=0;switch(t.Attr){case r.StorageAttribute.BLOB_VECTOR:a=n.VectorType.getVecSize(t.StrVal);break;case r.StorageAttribute.BLOB:a=n.BlobType.getBlobSize(t.StrVal)}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_iscomponent=function(e){var t=o.eventsManager.getCurrTask()||this.ExpTask;e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=0!==t.getCompIdx()},i.prototype.eval_op_ExecUserDefinedFunc=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return(i=new w(this.ExpTask)).setType(E.EVENT_TYPE_USER_FUNC),i.setUserDefinedFuncName(e),(l=new Ae).init(i),u=l.getNext(),c=null!==u&&u.argsMatch(t),_=null,T=!1,c?(p=u.getTask().GetContextTask(),u.getTask()===u.getTask().GetContextTask()&&u.getTask().SetContextTask(i.getTask()),g=new L(t),i.setArgList(g),o.eventsManager.pushNewExecStacks(),[4,u.execute(i,!1,!1)]):[3,4];case 1:return h.sent(),o.eventsManager.popNewExecStacks(),null===(d=u.getTask().getExpById(u.getEvent().getUserDefinedFuncRetExp()))?[3,3]:[4,d.evaluateWithResType(s)];case 2:_=h.sent(),T=!0,h.label=3;case 3:u.getTask().SetContextTask(p),h.label=4;case 4:return T||(s===r.StorageAttribute.NONE&&(s=r.StorageAttribute.ALPHA),_=new n.ExpVal(s,!0,null)),a.Copy(_),[2]}}))}))},i.prototype.eval_op_publicName=function(e,t){var n="NULL",a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&o.isProgram()&&!o.isMainProg()&&(n=o.getPublicName())}e.Attr=r.StorageAttribute.ALPHA,e.StrVal=n},i.prototype.eval_op_taskId=function(e,t){var n="NULL",a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&(n=o.getExternalTaskId())}e.Attr=r.StorageAttribute.ALPHA,e.StrVal=n},i.prototype.eval_op_dbviewsize=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.DataView.HasMainTable&&(l.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()?a=l.DataView.DBViewSize:l.isTableWithAbsolutesScrollbar()&&(a=l.DataView.TotalRecordsCount))}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_dbviewrowidx=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()&&l.DataView.getCurrRec().getMode()!==n.DataModificationTypes.Insert&&(a=l.DataviewManager.CurrentDataviewManager.GetDbViewRowIdx())}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_MlsTrans=function(e,n){e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",e.StrVal=pe.Instance.translate(t.NString.TrimEnd(n.StrVal,this._charsToTrim))},i.prototype.eval_op_StrBuild=function(e,r,n){for(var a=new Array(n),s=0;s<n;s++)a[n-1-s]=e.pop();this.val_cpy(a[0],r);var i=new t.StringBuilder(r.StrVal);for(s=1;s<n;s++)for(var o="@"+s.toString().trim()+"@",l=0;-1!==l;){var u=i.ToString().indexOf(o,l);if(-1===u)break;var c=!1,_=i.ToString().indexOf("\\"+o,l);-1!==_&&(c=!0),c&&u!==_+1||!c?(i.Replace(i.ToString(u,u+o.length-u),a[s].StrVal.trim(),u,u+o.length-u),l=u+a[s].StrVal.trim().length):l=u+1}i.Replace("\\@","@"),r.StrVal=i.ToString()},i.prototype.eval_op_range_add=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,n=e,[4,this.add_rt_ranges(t,!1)];case 1:return n.BoolVal=a.sent(),[2]}}))}))},i.prototype.eval_op_range_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserRange),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_locate_add=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,n=e,[4,this.add_rt_ranges(t,!0)];case 1:return n.BoolVal=a.sent(),[2]}}))}))},i.prototype.eval_op_locate_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserLocate),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_sort_add=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,a=e,[4,this.add_sort(t,n)];case 1:return a.BoolVal=s.sent(),[2]}}))}))},i.prototype.eval_op_sort_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserSort),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_tsk_instance=function(e,a){var o=0,l=a.MgNumVal.NUM_2_LONG();if(l>=0&&l<this.ExpTask.getTaskDepth(!1)||l===i.TRIGGER_TASK){var u=s.prototype.GetContextTask.call(this,l);null!==u&&(o=t.NNumber.Parse(u.getTaskTag()))}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(o)},i.prototype.add_sort=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return null===e.MgNumVal||(0===(r=e.MgNumVal.NUM_2_LONG())||null===(n=this.GetFieldOfContextTask(r)))?[2,!1]:(a=n.getTask(),s=n.getId()+1,(i=new Ze).fldIdx=s,i.dir=t.BoolVal,o=i,l=Qe.CreateAddUserSortDataviewCommand(a.getTaskTag(),o),[4,a.DataviewManager.Execute(l)]);case 1:return u.sent(),[2,!0]}}))}))},i.prototype.add_rt_ranges=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:if(n=e[0],a=e[1],null===n.MgNumVal)return[2,!1];if(0===(s=n.MgNumVal.NUM_2_LONG()))return[2,!1];if(null===(i=this.GetFieldOfContextTask(s)))return[2,!1];if(o=i.getTask(),l=i.getId()+1,(u=new N).veeIdx=l,c=u,a.IsNull&&(c.nullMin=!0),c.nullMin||a.Attr!==r.StorageAttribute.ALPHA&&a.Attr!==r.StorageAttribute.UNICODE||0!==a.StrVal.length){if(!c.nullMin){if(!r.StorageAttributeCheck.isTheSameType(i.getType(),a.Attr))return[2,!1];r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(i.getType(),a.Attr)&&this.ConvertExpVal(a,i.getType()),c.min=a.ToMgVal()}}else c.discardMin=!0;if(3===e.length)if((_=e[2]).IsNull&&(c.nullMax=!0),c.nullMax||_.Attr!==r.StorageAttribute.ALPHA&&_.Attr!==r.StorageAttribute.UNICODE||0!==_.StrVal.length){if(!c.nullMax){if(!r.StorageAttributeCheck.isTheSameType(i.getType(),_.Attr))return[2,!1];r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(i.getType(),_.Attr)&&this.ConvertExpVal(_,i.getType()),c.max=_.ToMgVal()}}else c.discardMax=!0;else c.discardMax=!0;return c.discardMin&&c.discardMax?[3,4]:t?(T=Qe.CreateAddUserLocateDataviewCommand(o.getTaskTag(),c),[4,o.DataviewManager.Execute(T)]):[3,2];case 1:return h.sent(),[3,4];case 2:return p=Qe.CreateAddUserRangeDataviewCommand(o.getTaskTag(),c),[4,o.DataviewManager.Execute(p)];case 3:h.sent(),h.label=4;case 4:return[2,!0]}}))}))},i.prototype.eval_op_getParam=function(e,r){t.Debug.Assert(!r.IsNull&&null!==r.StrVal);var n=nt.Instance.get(r.StrVal);null!==n?e.Copy(n):e.Nullify()},i.prototype.eval_op_setParam=function(e,n,a){t.Debug.Assert(!n.IsNull&&null!==n.StrVal),e.Attr=r.StorageAttribute.BOOLEAN,nt.Instance.set(n.StrVal,a),e.BoolVal=!0},i.prototype.eval_op_iniput=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,a=e,[4,lt.Instance.set(t.StrVal,n.BoolVal)];case 1:return a.BoolVal=s.sent(),[2]}}))}))},i.prototype.eval_op_iniget=function(e,t){e.StrVal=lt.Instance.get(t.StrVal),e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_inigetln=function(e,t,n){e.StrVal=lt.Instance.getln(t.StrVal,n.MgNumVal.NUM_2_LONG()),e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_m=function(e,t){e.Attr=r.StorageAttribute.ALPHA,e.StrVal="";for(var n=0;n<t.length;n++){var a=this.cst_code_trans_buf("O","MCDELRKSON ",t.charAt(n),r.MsgInterface.EXPTAB_TSK_MODE_RT);e.StrVal=e.StrVal+a}},i.prototype.cst_code_trans_buf=function(e,n,a,s){var i,o,l=pe.Instance.getConstMessage(s),u=new t.Array_Enumerator(r.StrUtil.tokenize(l,",")),c="\0";for(i=0;i<n.length&&u.MoveNext();i++){var _=(o=u.Current).indexOf("&");_++;var T=o.charAt(_).toUpperCase();if("I"===e){if(a===T){c=n.charAt(i);break}}else if(a===n.charAt(i)){c=T;break}}return c},i.prototype.eval_op_expcalc=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.IsNull=!0,i._recursiveExpCalcCount<50?(i._recursiveExpCalcCount++,[4,this.ExpTask.getExpById(t.MgNumVal.NUM_2_LONG()).evaluateWithResType(r.StorageAttribute.NONE)]):[3,2];case 1:n=a.sent(),i._recursiveExpCalcCount--,null!==n&&e.Copy(n),a.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_CndRange=function(e,t,r){t.BoolVal?e.Copy(r):e.IsNull=!0},i.prototype.eval_op_taskType=function(e,t){var n=t.MgNumVal.NUM_2_LONG();if(n>=0&&n<this.ExpTask.getTaskDepth(!1)||n===i.TRIGGER_TASK){var a=s.prototype.GetContextTask.call(this,n);e.StrVal=null!==a?a.isMainProg()?"MW":"W":" "}e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_terminal=function(e){var t=et.Instance.getTerminal();s.prototype.ConstructMagicNum.call(this,e,t,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_projectdir=function(e){e.StrVal=et.Instance.getProjDir(this.ExpTask.getCompIdx()),e.Attr=r.StorageAttribute.ALPHA},i.IsValidVector=function(e){return null!==e&&e.Attr===r.StorageAttribute.BLOB_VECTOR&&n.VectorType.validateBlobContents(e.StrVal)},i.GetAttributeChar=function(e){var t=e;switch(e){case r.StorageAttribute.BLOB:t="B";break;case r.StorageAttribute.BOOLEAN:t="L"}return t},i.prototype.GetTopMostForms=function(e){return o.mgDataTable.GetTopMostForms()},i.prototype.HandleControlGoto=function(e,t,n){var a=e;if(null!==t){var s=a.DataView,i=t,l=a.getForm().DisplayLine;if(t.IsRepeatable&&n>0){a.getForm().getTopIndexFromGUI();var u=s.getTopRecIdx();if((l=u+n-1)-u-1>=a.getForm().getRowsInPage())return!1;if(!a.getForm().IsValidRow(l))return!1}if(i.isVisible()){if(i.isSubform())return!1;var c=a.getForm().getIsRowEditingFromGui(l);if(i.isRepeatable()&&!c)return o.eventsManager.addGuiTriggeredEventWithTaskAndCodeAndLine(a,r.InternalInterface.MG_ACT_REC_PREFIX,l),console.log("Unable to park on control: "+i.Name+" as row is not in editing mode"),!0;var _=new w(i,l);return _.setInternal(r.InternalInterface.MG_ACT_CTRL_FOCUS),o.eventsManager.addToTail(_),!0}}return!1},i.prototype.eval_op_set_title=function(e,t){if(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,(t.Attr===r.StorageAttribute.ALPHA||t.Attr===r.StorageAttribute.UNICODE)&&!t.IsNull){var n=t.StrVal,a=this.ExpTask.GetContextTask();null!==a.getTopMostForm()&&a.getTopMostForm().setTitle(n)}},i.prototype.eval_op_is_row_editing=function(e,t){var n=!1;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a).getForm();n=o.getIsRowEditingFromGui(o.DisplayLine)}e.BoolVal=n,e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_control_select_program=function(e,a){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return s=e.MgNumVal.NUM_2_LONG(),i=0,o=new t.RefParam(i),l=this.ExpTask.GetContextTask().GetControlFromControlID(s-1,o),i=o.value,a.Attr=r.StorageAttribute.NUMERIC,a.MgNumVal=new n.NUM_TYPE,null!==l&&l.HasSelectProgram()?(u=l.getProp(n.PropInterface.PROP_TYPE_SELECT_PROGRAM),T=(_=t.NNumber).Parse,[4,u.getValue()]):[3,2];case 1:c=T.apply(_,[h.sent()]),p=0,c>0&&(p=i>0?c+i/100:c),a.MgNumVal=n.NUM_TYPE.from_double(p),h.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_CallJS=function(e,t,s,i){if(i.Attr=r.StorageAttribute.ALPHA,i.StrVal="",e.isMainProg())console.error("CallJS cannot be used in Main Program");else{var o=e.getForm(),l=this.params2arguments(s,0,s.length);a.isNullOrUndefined(l)||(i.StrVal=n.Commands.addCallJS(o,o.UniqueName,t,l),i.Attr=r.StorageAttribute.ALPHA)}},i.prototype.eval_op_set_cookie=function(e,t,a){a.Attr=r.StorageAttribute.BOOLEAN,a.StrVal="";var s,i,o,l=this.params2arguments(t,0,t.length);s=l[1];var u,c=l[2];if(s){var _=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(_,s,!1,this.ExpTask.getCompIdx());_.year,_.month,_.day;if(0==_.year&&0==_.month&&0==_.day)return null;if(u=new Date(_.year,_.month-1,_.day),c){var T=n.DisplayConvertor.Instance.getNewTimeBreakParams();n.DisplayConvertor.time_break(T,c),u.setHours(T.hour),u.setMinutes(T.minute),u.setSeconds(T.second)}}i=l[3],o=l[4],a.BoolVal=ut.setCookie(e,l[0],u,i,o,undefined,undefined)},i.prototype.eval_op_get_cookie=function(e,t){t.StrVal=ut.getCookie(e)},i.prototype.eval_op_delete_cookie=function(e,t){t.Attr=r.StorageAttribute.BOOLEAN,t.BoolVal=ut.deleteCookie(e)},i.prototype.eval_op_route_get=function(e){e.Attr=r.StorageAttribute.UNICODE,e.IsNull=!1,e.StrVal=n.Commands.getLastRoute()},i.prototype.params2arguments=function(e,t,s){for(var i=new Array,o=t;o<t+s;o++)if(a.isNullOrUndefined(e[o]))i.push("");else switch(e[o].Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:null!=e[o].StrVal&&e[o].StrVal.length>0?i.push(e[o].StrVal):i.push("");break;case r.StorageAttribute.BOOLEAN:i.push(!!e[o].BoolVal);break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:i.push(e[o].MgNumVal.NUM_2_LONG());break;case r.StorageAttribute.NUMERIC:i.push(e[o].MgNumVal.to_double());break;case r.StorageAttribute.BLOB:var l=e[o].StrVal;if(!a.isNullOrUndefined(l)){if(n.BlobType.getContentType(l)===n.BlobType.CONTENT_TYPE_BINARY)return r.Logger.Instance.WriteErrorToLog("Argument "+(o+1)+" of type Binary Blob is not supported in CallJS"),null;i.push(n.BlobType.getString(l))}break;case r.StorageAttribute.NONE:default:return r.Logger.Instance.WriteErrorToLog(" Argument "+(o+1)+" is not supported in CallJS"),null}return i},i}(n.GuiExpressionEvaluator);ct.ASTERISK_CHR=String.fromCharCode(1),ct.QUESTION_CHR=String.fromCharCode(2),ct.PARENT_LEN=2,ct.SHORT_OBJECT_LEN=2,ct.LONG_OBJECT_LEN=4,ct._recursiveExpCalcCount=0,ct.ErrorToBeWrittenInServerLog=null;var _t=function(e){function t(t){var n=e.call(this)||this;return n._attr=r.StorageAttribute.NONE,n._attr=t,n.name="NullValueException",n}return u(t,e),t.prototype.getAttr=function(){return this._attr},t}(t.Exception),Tt=function(){function e(e,t){this._expBytes=null,this._lowHigh=!0,this._nullArithmetic=!1,this._isNull=!1,this._posIdx=0,this._expBytes=new Int8Array(e.length);for(var r=0;r<this._expBytes.length;++r)this._expBytes[r]=0;for(var n=0;n<e.length;n++)this._expBytes[n]=e[n];this._nullArithmetic=t,this._lowHigh=et.Instance.getLowHigh()}return e.prototype.setNullResult=function(){this._nullArithmetic&&(this._isNull=!0)},e.prototype.resetNullResult=function(){this._nullArithmetic&&(this._isNull=!1)},e.prototype.isNull=function(){return this._isNull},e.prototype.get1ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,e},e.prototype.get2ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var t=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,this._lowHigh?ct.MK_SHRT(t,e):ct.MK_SHRT(e,t)},e.prototype.get4ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var t=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var r=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var n=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,this._lowHigh?ct.MK_LONG(n,r,t,e):ct.MK_LONG(e,t,r,n)},e.prototype.getString=function(e,n,a){var s,i="";if(!1===a){s=e;for(var o=new Array(this._expBytes.length),l=0;l<this._expBytes.length;l+=1)o[l]=String.fromCharCode(this._expBytes[l]);i=t.NString.FromChars(o,this._posIdx,e)}else{s=2*e;var u=new Uint8Array(s),c=this._lowHigh?1:E.BYTES_IN_CHAR;for(l=this._posIdx;l<this._posIdx+s;l+=c)this._lowHigh?u[l-this._posIdx]=this._expBytes[l]:(u[l-this._posIdx]=this._expBytes[l+1],u[l+1-this._posIdx]=this._expBytes[l]);try{i=t.Encoding.Unicode.GetString(u,0,u.length)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e)}}return n&&(this._posIdx+=s),i},e.prototype.skipOpFunctionPtr=function(){this._posIdx+=n.ExpressionInterface.EXP_OPER_FUNC_PTR_LEN},e.prototype.getOpCode=function(){var e=[this._lowHigh?this._expBytes[this._posIdx]:this._expBytes[this._posIdx+1],this._lowHigh?this._expBytes[this._posIdx+1]:this._expBytes[this._posIdx]],t=e[1]>=0?e[1]:256+e[1];return t<<=8,t|=e[0]>=0?e[0]:256+e[0],this._posIdx+=n.ExpressionInterface.EXP_OPER_LEN,this.skipOpFunctionPtr(),t},e.prototype.getVarIdx=function(){var e=0;this._lowHigh&&(e=1-e);var t=this._expBytes[this._posIdx+e]>=0?this._expBytes[this._posIdx+e]:256+this._expBytes[this._posIdx+e];return t<<=8,e=1-e,t|=this._expBytes[this._posIdx+e]>=0?this._expBytes[this._posIdx+e]:256+this._expBytes[this._posIdx+e],this._posIdx+=n.ExpressionInterface.EXP_OPER_LEN,t},e.prototype.getMagicNumber=function(e,t){var r=new n.NUM_TYPE(this._expBytes,this._posIdx,e);return t&&(this._posIdx+=e),r},e.prototype.skipOperator=function(){for(var e,t,r=1;r>0;){r--;var a=this.getOpCode();switch(a){case n.ExpressionInterface.EXP_OP_A:case n.ExpressionInterface.EXP_OP_H:t=this.get4ByteNumber(),this._posIdx+=t*E.BYTES_IN_CHAR,t=this.get4ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_EXT_A:case n.ExpressionInterface.EXP_OP_N:case n.ExpressionInterface.EXP_OP_T:case n.ExpressionInterface.EXP_OP_D:case n.ExpressionInterface.EXP_OP_M:case n.ExpressionInterface.EXP_OP_K:case n.ExpressionInterface.EXP_OP_E:t=this.get2ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_F:case n.ExpressionInterface.EXP_OP_P:t=this.get2ByteNumber(),this._posIdx+=t,t=this.get2ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_L:this._posIdx+=2;break;case n.ExpressionInterface.EXP_OP_V:case n.ExpressionInterface.EXP_OP_FORM:case n.ExpressionInterface.EXP_OP_VAR:this._posIdx+=ct.PARENT_LEN+ct.LONG_OBJECT_LEN;break;case n.ExpressionInterface.EXP_OP_RIGHT_LITERAL:t=this.get2ByteNumber(),this._posIdx+=t,t=this.get2ByteNumber(),this._posIdx+=t;break;default:(e=fe.expDesc[a]).ArgCount_<0?r+=this.get1ByteNumber():r+=e.ArgCount_}}},e}(),ht=function(){this.argCount_=0,this.opCode_=n.ExpressionInterface.EXP_OP_NONE},pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(n.GuiDataViewBase),gt=function(){function e(r,a){this._id=t.Int32.MinValue,this.dbViewRowIdx=0,this._mode=n.DataModificationTypes.None,this._dcRefs=null,this._inCompute=!1,this._inRecompute=!1,this._newRec=!1,this._dataview=null,this._sendToServer=!0,r instanceof e?Object.assign(this,r):1===arguments.length?this.constructor_0(r):this.constructor_1(r,a)}return Object.defineProperty(e.prototype,"InCompute",{get:function(){return this._inCompute},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"InRecompute",{get:function(){return this._inRecompute},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e){e instanceof pt?this._dataview=e:this._tableCache=e,this._fieldsData=new Array(this.getFieldsTab().getSize()),this._flags=new Uint8Array(this.getFieldsTab().getSize()),this._flagsHistory=new Uint8Array(this.getFieldsTab().getSize()),this._dcRefs=new n.ObjectReferencesCollection},e.prototype.Initialize=function(){for(var t=0;t<this._flags.length;t+=1){var n=this.getFieldsTab().getField(t);if(this._flags[t]=n.isNullDefault()||n.getType()===r.StorageAttribute.BLOB_VECTOR?e.FLAG_NULL:0,null!==this._dataview&&n.IsVirtual){var a=this._dataview.getCurrRec();null!=a&&a.IsFldModifiedAtLeastOnce(t)&&this.setFlag(t,e.FLAG_MODIFIED_ATLEAST_ONCE)}this._flagsHistory[t]=this._flags[t]}this.setNewRec()},e.prototype.constructor_1=function(e,t){this.constructor_0(t),this.setId(e)},Object.defineProperty(e.prototype,"Modified",{get:function(){return this._modified},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Updated",{get:function(){return this._updated},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SendToServer",{get:function(){return this._sendToServer},enumerable:!1,configurable:!0}),e.prototype.CompareTo=function(e){var t=0,a=e,s=this._tableCache.GetKeyById(this._tableCache.GetCurrSortKey());if(null!=s){for(var i=0;i<s.Columns.length;i++){var o=s.Columns.get_Item(i),l=o.getId();if(!this.IsNull(l)||!a.IsNull(l)){if(this.IsNull(l)&&!a.IsNull(l)){t=1;break}if(!this.IsNull(l)&&a.IsNull(l)){t=-1;break}try{var u=new n.ExpVal(o.getType(),!1,this.GetFieldValue(l)),c=new n.ExpVal(o.getType(),!1,a.GetFieldValue(l));if(0!==(t=ct.val_cmp_any(u,c,!1)))break}catch(e){e instanceof _t&&r.Logger.Instance.WriteExceptionToLogWithMsg(" in Record.CompareTo null value was reached")}}}return t}return t=-1},e.prototype.getMode=function(){return this._mode},e.prototype.getId=function(){return this._id},e.prototype.isNewRec=function(){return this._newRec},e.prototype.getFieldDataXML=function(e,t){return 2===arguments.length?this.getFieldDataXML_0(e,t):this.getFieldDataXML_1(e)},e.prototype.getFieldDataXML_0=function(e,n){var a;if(null==(a=n?this.getFieldsTab().getField(e).getOriginalValue():this.GetFieldValue(e)))throw new t.ApplicationException("in Record.buildFieldsData() null field value!\nField id: "+e);var s=this.getXMLForValue(e,a);return r.XmlParser.escape(s.toString()).toString()},e.prototype.getFieldDataXML_1=function(e){var r=this.GetFieldValue(e);if(null===r)throw new t.ApplicationException("in Record.buildFieldsData() null field value!\nField id: "+e);var a=this.getFieldsTab().getType(e);return n.RecordUtils.serializeItemVal(r,a)},e.prototype.getFieldsTab=function(){return null!==this._dataview?this._dataview.GetFieldsTab():this._tableCache.FldsTab},e.prototype.setInitialFldVals=function(t,r){var n,a,s=null;for(a=this.getSizeFld(!0),n=0;n<a;n++)null!==this._fieldsData[n]&&void 0!==this._fieldsData[n]||(s=this.getFieldsTab().getField(n),this._fieldsData[n]=s.getNewRecValue(t),r&&s.IsVirtual&&!s.isNull()&&this.clearFlag(s.getId(),e.FLAG_NULL),s.IsVirtual&&s.getModifiedAtLeastOnce()&&this.setFlag(s.getId(),e.FLAG_MODIFIED_ATLEAST_ONCE),null!==this._fieldsData[n]&&void 0!==this._fieldsData[n]||(this._fieldsData[n]=s.getDefaultValue()))},e.prototype.setId=function(e){this._id=e,this._hashKey=this._id},e.prototype.setDBViewRowIdx=function(e){this.dbViewRowIdx=e},e.prototype.getDBViewRowIdx=function(){return this.dbViewRowIdx},e.prototype.fillData=function(e){var t=!1,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_REC)+E.MG_TAG_REC.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);t=this.initElements(s),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.FillInnerData() out of bounds");return t},e.prototype.initElements=function(e){var n,a,s,i=null,o=null,l=0;for(s=this.peekIsCurrRec(e);l<e.length;l+=2)switch(n=e.get_Item(l),a=e.get_Item(l+1),n){case E.MG_ATTR_MODE:this._mode=a[0];break;case r.XMLConstants.MG_ATTR_ID:this.setId(r.XmlParser.getInt(a));break;case r.XMLConstants.MG_ATTR_VB_VIEW_ROWIDX:this.setDBViewRowIdx(r.XmlParser.getInt(a));break;case r.XMLConstants.MG_ATTR_VALUE:i=this.ValueInBase64?r.Base64.decode(a):r.XmlParser.unescape(a);break;case E.MG_ATTR_CURR_REC:break;case E.MG_ATTR_ADD_AFTER:this._addAfter=r.XmlParser.getInt(a);break;case E.MG_ATTR_FLAGS:o=a;break;case E.MG_ATTR_MODIFIED:this._modified=!0;break;case E.MG_ATTR_DC_REFS:this.fillDCRef(a);break;case E.MG_ATTR_DBPOS:this._dbPosBase64Val=a;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.initElements() unknown attribute: "+n)}if(this.ValueInBase64){var u=t.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(i);this.fillFieldsData(u,o)}else this.fillFieldsData(i,o,s);return s},e.prototype.peekIsCurrRec=function(e){for(var t,n=0;n<e.length;n+=2)if(e.get_Item(n)===E.MG_ATTR_CURR_REC)return t=e.get_Item(n+1),r.XmlParser.getBoolean(t);return!1},e.prototype.fillFieldsData=function(e,t,r){a.isNullOrUndefined(r)?this.fillFieldsData_0(e,t):this.fillFieldsData_1(e,t,r)},e.prototype.fillFieldsData_0=function(e,t){},e.prototype.fillFieldsData_1=function(a,s,i){var o,l,u,c,_,T,h=null,p=null,g=new t.RefParam(0),d=0,E=null;for(l=this.getFromFldIdx(i),u=this.getSizeFld(i),o=l;d<u;o++,d++)c=(E=this.getFieldsTab().getField(o)).getType(),_=et.Instance.GetDebugLevel()>1||c===r.StorageAttribute.ALPHA||c===r.StorageAttribute.UNICODE||r.StorageAttributeCheck.isTypeLogical(c),"."===s[d]?this._flags[o]=0:"/"===s[d]?this._flags[o]=1:(p=s.substr(2*d,2),this._flags[o]=parseInt(p,16)),T=e.FLAG_VALUE_NOT_PASSED===(this._flags[o]&e.FLAG_VALUE_NOT_PASSED),this._flags[o]=this._flags[o]&~e.FLAG_VALUE_NOT_PASSED,this._flagsHistory[o]=this._flags[o],e.FLAG_UPDATED===(this._flags[o]&e.FLAG_UPDATED)&&(this._updated=!0),T?h=e.FLAG_NULL===(this._flags[o]&e.FLAG_NULL)?E.getDefaultValue():this._dataview.getCurrRec().GetFieldValue(o):(h=n.RecordUtils.deSerializeItemVal(a,c,E.getSize(),_,E.getCellsType(),g),a=a.substr(g.value)),this._fieldsData[o]=h;this.setInitialFldVals(!1,!1)},e.prototype.fillDCRef=function(e){if(!t.NString.IsNullOrEmpty(e))for(var n=r.StrUtil.tokenize(e,"$"),a=n.length,s=0;s<a;s+=1)this._dcRefs.Add(dt.Parse(n[s],this._dataview))},e.prototype.buildFieldsData=function(e,t,r){3===arguments.length?this.buildFieldsData_0(e,t,r):this.buildFieldsData_1(e)},e.prototype.buildFieldsData_0=function(r,n,a){for(var s=new t.StringBuilder,i=this.getFromFldIdx(n),o=this.getSizeFld(n),l=i;l<i+o;l+=1){!1===this.getFieldsTab().getField(l).IsExposedToClient&&this.setShrinkFlag(l),e.FLAG_VALUE_NOT_PASSED!==(this._flags[l]&e.FLAG_VALUE_NOT_PASSED)&&s.Append(this.getFieldDataXML(l,a).toString())}0===s.Length&&s.Append(" "),r.Append(s.ToString())},e.prototype.buildFieldsData_1=function(n){var a,s,i,o=new t.List;for(s=this.getFromFldIdx(!1),i=this.getSizeFld(!1),a=0;a<s+i;a++){if(e.FLAG_VALUE_NOT_PASSED!==(this._flags[a]&e.FLAG_VALUE_NOT_PASSED))this.getFieldDataXML(a).forEach((function(e){return o.push(e)}))}var l=new Uint8Array(o.length);for(a=0;a<o.length;a++)l[a]=o.get_Item(a);var u=r.Base64.encode(l),c=et.Instance.GetEncoding().GetString(u,0,u.length);n.Append(c)},e.prototype.getXMLForValue=function(t,n){var a=r.StorageAttribute.SKIP,s=this.getFieldsTab().getType(t);s===r.StorageAttribute.BLOB_VECTOR&&(a=this.getFieldsTab().getField(t).getCellsType());var i=et.Instance.GetDebugLevel()<=1;return e.serializeItemVal(n,s,a,i)},e.prototype.getFromFldIdx=function(e){return e?0:this.getFieldsTab().getRMIdx()},e.prototype.getSizeFld=function(e){return e?this.getFieldsTab().getSize():this.getFieldsTab().getRMSize()},e.prototype.buildXML=function(e,t,r){a.isNullOrUndefined(r)?this.buildXML_0(e,t):this.buildXML_1(e,t,r)},e.prototype.buildXML_0=function(e,t){this.buildXML_1(e,t,!1)},e.prototype.buildXML_1=function(a,s,i){var o,l,u,c,_,T;if(i||this._mode===n.DataModificationTypes.Insert||this._mode===n.DataModificationTypes.Update||this._mode===n.DataModificationTypes.Delete||s){var h;if(a.Append("\n <"+E.MG_TAG_REC),this._id>t.Int32.MinValue&&a.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),a.Append(" "+E.MG_ATTR_MODE+'="'+this._mode+'"'),this._mode===n.DataModificationTypes.Insert&&null!=this._prev&&a.Append(" "+E.MG_ATTR_ADD_AFTER+'="'+this._prev.getId()+'"'),i||s||this.clearMode(),a.Append(" "+r.XMLConstants.MG_ATTR_VALUE+'="'),!i&&s&&this.setShrinkFlags(),this.Synced)h=!1;else{var p=this._dataview.getTask();h=!s&&(p.getLevel()===r.Constants.TASK_LEVEL_RECORD||p.getLevel()===r.Constants.TASK_LEVEL_CONTROL)&&null!=this._dataview.getCurrRec()&&this._dataview.getCurrRec().getId()===this._id}for(this.buildFieldsData(a,s,h),a.Append('"'),o=new t.StringBuilder,l=this.getFromFldIdx(s),u=this.getSizeFld(s),c=l;c<l+u;c++)_=this._flagsHistory[c],_&=e.FLAG_CRSR_MODIFIED,_|=this._flags[c],T=t.NNumber.ToString(_,"X2"),o.Append(T),s&&(this._flags[c]=this._flags[c]&~e.FLAG_VALUE_NOT_PASSED);a.Append(" "+E.MG_ATTR_FLAGS+'="'+o.ToString()+'"'),s&&(a.Append(" "+E.MG_ATTR_CURR_REC+'="1"'),this.Modified&&a.Append(" "+E.MG_ATTR_MODIFIED+'="1"')),null!=this._linksFldsPos&&a.Append(" "+E.MG_ATTR_DBPOS+'="'+r.XmlParser.escape(this._linksFldsPos)+'" '),a.Append(r.XMLConstants.TAG_TERM)}},e.prototype.buildXMLForDataViewToDataSource=function(a){var s,i,o,l,u,c;for(a.Append("\n <"+E.MG_TAG_REC),this._id>t.Int32.MinValue&&a.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),a.Append(" "+E.MG_ATTR_MODE+'="'+this._mode+'"'),this._mode===n.DataModificationTypes.Insert&&null!=this._prev&&a.Append(" "+E.MG_ATTR_ADD_AFTER+'="'+this._prev.getId()+'"'),a.Append(" "+r.XMLConstants.MG_ATTR_VALUE+'="'),this.buildFieldsData(a),a.Append('"'),s=new t.StringBuilder,i=this.getFromFldIdx(!1),o=this.getSizeFld(!1),l=i;l<i+o;l++)u=this._flagsHistory[l],u&=e.FLAG_CRSR_MODIFIED,u|=this._flags[l],c=t.NNumber.ToString(u,"X2"),s.Append(c);a.Append(" "+E.MG_ATTR_FLAGS+'="'+s+'"'),null!=this._linksFldsPos&&a.Append(" "+E.MG_ATTR_DBPOS+'="'+r.XmlParser.escape(this._linksFldsPos)+'" '),a.Append(r.XMLConstants.TAG_TERM)},e.prototype.setShrinkFlags=function(){var t,r=this.getSizeFld(!0),n=this._dataview.getServerCurrRec();if(null!=n)for(t=0;t<r;t++)(this.fldValsEqual(n,t)||e.FLAG_NULL===(this._flags[t]&e.FLAG_NULL))&&(this._flags[t]=this._flags[t]|e.FLAG_VALUE_NOT_PASSED)},e.prototype.setShrinkFlag=function(t){this._flags[t]|=e.FLAG_VALUE_NOT_PASSED},e.prototype.SetFieldValue=function(t,r,n){var a=this.getFieldsTab().getField(t);a.UpdateNull(r,this),n=this.CheckMgValue(n,r,a),this._fieldsData[t]=n,a.takeValFromRec(),this.clearFlag(a.getId(),e.FLAG_INVALID),a.invalidate(!0,!1)},e.prototype.setFieldValue=function(e,t,a){var s=this.getFieldsTab().getField(e);s.PrevIsNull()===s.isNull()&&t===this.GetFieldValue(e)||(t=this.CheckMgValue(t,s.isNull(),s),e>=0&&e<this.getFieldsTab().getSize()?(this._fieldsData[e]=t,a&&(s.PartOfDataview&&(this._modified=!0),le.GetInstance().DelayCommandExecution&&(le.GetInstance().DelayCommandExecution=!1,this._dataview.getTask().DelayCommandExecution=!0),this._dataview.setChanged(!0),this.setMode(n.DataModificationTypes.Update))):r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.setFieldValue() illegal field index: "+e))},e.prototype.CheckMgValue=function(e,t,n){(null===e||t)&&null===(e=n.getNullValue())&&(e=n.getMagicDefaultValue());var a=n.getSize();return r.UtilStrByteMode.isLocaleDefLangDBCS()&&n.getType()!==r.StorageAttribute.UNICODE?null!==e&&r.UtilStrByteMode.lenB(e)>a&&(e=r.UtilStrByteMode.leftB(e,a)):null!==e&&e.length>a&&(e=e.substr(0,a)),e},e.prototype.setModified=function(){this._modified=!0},e.prototype.resetModified=function(){this._modified=!1},e.prototype.setUpdated=function(){this._updated=!0},e.prototype.resetUpdated=function(){this._updated=!1},e.prototype.GetFieldValue=function(e){var t=null;return e>=0&&e<this._fieldsData.length&&(t=this._fieldsData[e]),t.toString()},e.prototype.replicate=function(){var t=new e(this);return t._fieldsData=this._fieldsData.slice(),t._flags=this._flags.subarray(0),t._flagsHistory=this._flagsHistory.subarray(0),t._dcRefs=this._dcRefs.Clone(),t},e.prototype.setSameAs=function(e,t,r){3===arguments.length?this.setSameAs_0(e,t,r):this.setSameAs_1(e,t)},e.prototype.setSameAs_0=function(e,t,r){this.setSameAs(e,t),this.setId(r)},e.prototype.setSameAs_1=function(e,t){if(this._id=e._id,this._hashKey=e._hashKey,this._dataview.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)||this.setMode(e._mode),this._addAfter=e._addAfter,t)for(var r=0;r<this.getFieldsTab().getSize();r+=1){e.getFieldsTab().getField(r).IsVirtual||(this._fieldsData[r]=e._fieldsData[r],this._flags[r]=e._flags[r],this._flagsHistory[r]=e._flagsHistory[r])}else this._fieldsData=e._fieldsData,this._flags=e._flags,this._flagsHistory=e._flagsHistory;this._modified=e._modified,this._dataview=e._dataview,this._computed=e._computed,this._updated=e._updated,this.setDcRefs(e._dcRefs),e._next!==this&&(this._next=e._next),e._prev!==this&&(this._prev=e._prev)},e.prototype.IsNull=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_NULL)===e.FLAG_NULL},e.prototype.isLinkInvalid=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_INVALID)===e.FLAG_INVALID},e.prototype.isFldModified=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_MODIFIED)===e.FLAG_MODIFIED},e.prototype.IsFldModifiedAtLeastOnce=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_MODIFIED_ATLEAST_ONCE)===e.FLAG_MODIFIED_ATLEAST_ONCE},e.prototype.isFldUpdated=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_UPDATED)===e.FLAG_UPDATED},e.prototype.setFlag=function(t,r){this.checkFlags(t),this._flags[t]=this._flags[t]|r,r===e.FLAG_CRSR_MODIFIED&&(this._flagsHistory[t]=this._flagsHistory[t]|r)},e.prototype.clearFlag=function(e,t){this.checkFlags(e),this._flags[e]=this._flags[e]&~t},e.prototype.clearFlagsHistory=function(){for(var e=0;e<this._flags.length;e+=1)this._flagsHistory[e]=0},e.prototype.clearFlags=function(e){for(var t=0;t<this._flags.length;t+=1)this.clearFlag(t,e)},e.prototype.clearFlagsForRealOnly=function(e){for(var t=0;t<this._flags.length;t+=1){this.getFieldsTab().getField(t).IsVirtual||this.clearFlag(t,e)}},e.prototype.clearHistoryFlag=function(e){null!==this._flagsHistory&&e<this.getFieldsTab().getSize()&&e>=0&&(this._flagsHistory[e]=0)},e.prototype.checkFlags=function(e){if(null===this._flags||e>=this.getFieldsTab().getSize()||e<0)throw new t.ApplicationException("Cannot find flags")},e.prototype.restart=function(e){var t=this._dataview.getTask();if(e===n.DataModificationTypes.None){var a=this._dataview.getCurrRec(),s=null!=a&&a.getId()===this._id;e=this._dataview.getTask().getMode()===r.Constants.TASK_MODE_CREATE?s&&!t.getAfterRetry()&&t.TryingToCommit&&!this._dataview.inRollback()?n.DataModificationTypes.Update:n.DataModificationTypes.Insert:n.DataModificationTypes.Update}this.setMode(e),e===n.DataModificationTypes.Insert&&this.setNewRec()},e.prototype.setLateCompute=function(e){this._lateCompute=e},e.prototype.lateCompute=function(){return this._lateCompute},e.prototype.setInDeleteProcess=function(e){this._inDeleteProcess=e},e.prototype.inDeleteProcess=function(){return this._inDeleteProcess},e.prototype.removeRecFromDc=function(){null!==this._dcRefs&&this._dcRefs.Dispose()},e.prototype.isSameRecData=function(e,r,n){var a,s,i=this.getSizeFld(r),o=this.getFromFldIdx(r);if(this===e)return!0;try{if(e.getSizeFld(r)!==i)return!1;if(e.getFromFldIdx(r)!==o)return!1;for(a=0;a<o+i;a++)if(s=this.getFieldsTab().getField(a),(!n||s.PartOfDataview)&&!this.fldValsEqual(e,a))return!1}catch(e){if(e instanceof t.ApplicationException)return!1;throw e}return!0},e.prototype.fldValsEqual=function(e,t){var r=this.getFieldsTab().getField(t).getType();return ct.mgValsEqual(this.GetFieldValue(t),this.IsNull(t),r,e.GetFieldValue(t),e.IsNull(t),r)},e.prototype.getHashKey=function(){return this._hashKey},e.prototype.setNextRec=function(e){this._next=e},e.prototype.setPrevRec=function(e){this._prev=e},e.prototype.getPrevRec=function(){return this._prev},e.prototype.getNextRec=function(){return this._next},e.prototype.getDcRefs=function(){return this._dcRefs.Clone()},e.prototype.setDcRefs=function(e){this.removeRecFromDc(),this._dcRefs=e.Clone(),this.SetDcValueId()},e.prototype.realModified=function(){var t,r=!1,n=this.getFieldsTab().getSize();for(t=0;t<n;t++)if((this._flags[t]&e.FLAG_MODIFIED)===e.FLAG_MODIFIED&&!this.getFieldsTab().getField(t).IsVirtual){r=!0;break}return r},e.prototype.ToString=function(){var e=new t.StringBuilder;return this.buildXML(e,this._dataview.getCurrRec().getId()===this._id,!0),e.ToString()},e.prototype.setSendToServer=function(e){this._sendToServer=e},e.prototype.getRecSize=function(){for(var e=0,t=0;t<this.getFieldsTab().getSize();t+=1){e+=this.getFieldsTab().getField(t).getSize()}return e},e.prototype.copyCrsrModifiedFlags=function(t){var r,n=this.getFieldsTab().getSize();for(r=0;r<n;r++)this._flags[r]=t._flags[r],this._flags[r]=this._flags[r]&e.FLAG_CRSR_MODIFIED},e.prototype.getDbPosVal=function(){return this._dbPosBase64Val},e.prototype.buildLinksPosStr=function(){var e=this._dataview.getTask().getDataviewHeaders();null!==e&&(this._linksFldsPos=e.buildDbPosString())},e.prototype.setForceSaveOrg=function(e){this._forceSaveOrg=e},e.prototype.getForceSaveOrg=function(){return this._forceSaveOrg},e.prototype.isCauseInvalidation=function(){return this._causeInvalidation},e.prototype.setCauseInvalidation=function(e){this._causeInvalidation=e},e.prototype.isComputed=function(){return this._computed},e.prototype.setComputed=function(e){this._computed=e},e.prototype.setInCompute=function(e){e||this.setComputed(!0),this._inCompute=e},e.prototype.setInRecompute=function(e){this._inRecompute=e},e.prototype.setMode=function(e){switch(e){case n.DataModificationTypes.None:case n.DataModificationTypes.Insert:case n.DataModificationTypes.Update:case n.DataModificationTypes.Delete:(this._mode===n.DataModificationTypes.None||this._mode===n.DataModificationTypes.Update&&e===n.DataModificationTypes.Delete)&&(this._mode=e);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.setMode(): illegal mode: "+e)}},e.prototype.clearMode=function(){this._mode=n.DataModificationTypes.None},e.prototype.setOldRec=function(){this._newRec=!1},e.prototype.setNewRec=function(){this._newRec=!0},e.serializeItemVal=function(e,t,r,a){return n.RecordUtils.serializeItemVal(e,t,r,a)},e.prototype.SetDcValueId=function(){var e=this._dataview.getTask().getForm(),t=null;null!=e&&null!=this._dcRefs&&this._dcRefs.Refs.forEach((function(r){null!=(t=e.getCtrl(r.ditIdx))&&t.setDcValId(r.DcValues.getId())}))},e.prototype.resetDcValueId=function(){var e=this._dataview.getTask().getForm(),t=null;null!=e&&null!=this._dcRefs&&this._dcRefs.Refs.forEach((function(r){null!=(t=e.getCtrl(r.ditIdx))&&t.setDcValId(n.EMPTY_DCREF)}))},e.prototype.AddDcValuesReference=function(e,t){var r=this._dataview.getDcValues(t),a=new dt(e,r);null===this._dcRefs&&(this._dcRefs=new n.ObjectReferencesCollection),this._dcRefs.Add(a)},e}();gt.FLAG_NULL=1,gt.FLAG_INVALID=2,gt.FLAG_MODIFIED=4,gt.FLAG_UPDATED=8,gt.FLAG_CRSR_MODIFIED=16,gt.FLAG_VALUE_NOT_PASSED=32,gt.FLAG_MODIFIED_ATLEAST_ONCE=64,gt.INCREASE=!0,gt.DECREASE=!1;var dt=function(e){function r(t,r){var n=e.call(this,r)||this;return n.ditIdx=0,n.ditIdx=t,n}return u(r,e),Object.defineProperty(r.prototype,"DcValues",{get:function(){return this.Referent},enumerable:!1,configurable:!0}),r.prototype.Clone=function(){return new r(this.ditIdx,this.Referent)},r.Parse=function(e,n){var a=e.indexOf(","),s=t.NNumber.Parse(e.substr(0,a)),i=t.NNumber.Parse(e.substr(a+1));return new r(s,n.getDcValues(i))},r}(n.ObjectReferenceBase),Et=function(){function e(e){this._useLinkedList=!1,this._hashTab=null,this._initialCurrRecId=t.Int32.MinValue,this._records=null,this._serverCurrRec=null,this.InsertedRecordsCount=0,e.constructor===Boolean?(this._records=new t.List,this._hashTab=new t.Hashtable(100,.7),this._useLinkedList=e,this.InsertedRecordsCount=t.Int32.MinValue):Object.assign(this,e)}return e.prototype.fillData=function(e,r,a){var s="N",i=null,o=!1;this.InsertedRecordsCount=0,this._initialCurrRecId=t.Int32.MinValue;for(var l=a.getNextTag();null!==l&&"rec"===l;){var u=new gt(e);u.Initialize();var c=u.fillData(a);if(c&&!e.HasMainTable){var _=void 0,T=_=u.getDcRefs();try{for(var h=0;h<this.getSize();h+=1)this.getRecByIdx(h).setDcRefs(T)}finally{null!==_&&_.Dispose()}}c?("C"!==e.getTask().getMode()&&u.setOldRec(),this._initialCurrRecId=u.getId(),this._serverCurrRec=u.replicate(),s="N"===s?"C":"F"):(u.setOldRec(),s="T");var p=this.getRecord(u.getId());if(null!==p){var g=p.Updated,d=p.Modified,E=p.isComputed(),I=p.getPrevRec(),f=p.getNextRec();p.setSameAs(u,!1),p.setPrevRec(I),p.setNextRec(f),p.setComputed(E),d&&p.setModified(),g&&p.setUpdated()}else this.InsertRecord(r,u),e.getTask().isTableWithAbsolutesScrollbar()&&(0===e.TotalRecordsCount&&0==e.RecordsBeforeCurrentView&&(e.TotalRecordsCount=e.TotalRecordsCount+1),e.RecordsBeforeCurrentView>0&&"B"===r&&(e.RecordsBeforeCurrentView=e.RecordsBeforeCurrentView-1)),c&&"C"===e.getTask().getMode()&&u.setMode(n.DataModificationTypes.Insert),u.setComputed(!0);l=a.getNextTag(),c||(i=u),o=!0}for(var C=0;!e.HasMainTable&&null!==i&&C<e.getChunkSize()-1;){var A=new gt(e);A.Initialize(),A.setSameAs(i,!1,i.getId()+C+1),A.setOldRec(),this.addRec(A),C+=1}return this._initialCurrRecId===t.Int32.MinValue&&(o?this._serverCurrRec=null:null!==e.getCurrRec()?this._serverCurrRec=e.getCurrRec().replicate():this._serverCurrRec=null),s},e.prototype.InsertRecord=function(e,t){if("B"===e){var r=this.InsertedRecordsCount;this.InsertedRecordsCount=r+1,this.insertRecord(t,0)}else this.addRec(t)},e.prototype.buildXML=function(t,r,a,s){for(var i=0;i<this._records.length;i+=1){var o=this._records.get_Item(i);if(o.SendToServer&&(!a||o.getId()!==s)){for(var l=void 0,u=l=o.getPrevRec(),c=void 0;null!=l&&(l.getMode()===n.DataModificationTypes.Insert||!l.SendToServer)&&o.getMode()===n.DataModificationTypes.Insert&&((c=this.getRecIdx(l.getId()))>i||c===e.REC_NOT_FOUND||!l.SendToServer);)l=l.getPrevRec(),o.setPrevRec(l);o.buildXML(r,!1),l!==u&&o.setPrevRec(u)}}},e.prototype.getRecord=function(e){return this._hashTab.get_Item(e)},e.prototype.getRecIdx=function(t){var r=e.REC_NOT_FOUND,n=this.getRecord(t);return null!==n&&(r=this._records.indexOf(n)),r},e.prototype.getRecByIdx=function(e){return e<0||e>=this._records.length?(r.Logger.Instance.WriteDevToLog("in RecordsTable.getRecByIdx() index out of bounds: "+e),null):this._records.get_Item(e)},e.prototype.removeAll=function(){this._records.Clear(),this._hashTab.Clear()},e.prototype.getSize=function(){return this._records.length},e.prototype.getInitialCurrRecId=function(){return this._initialCurrRecId},e.prototype.addRecord=function(e){this._records.indexOf(e)<0&&this.addRec(e)},e.prototype.addRec=function(e){if(this._useLinkedList&&this._records.length>0){var t=this._records.get_Item(this._records.length-1);t.setNextRec(e),e.setPrevRec(t)}this._records.push(e),this._hashTab.set_Item(e.getHashKey(),e)},e.prototype.insertRecord=function(e,t){if(this._useLinkedList){if(t>0){var r=this._records.get_Item(t-1);e.setPrevRec(r),r.setNextRec(e)}if(t!==this._records.length){var n=this._records.get_Item(t);e.setNextRec(n),n.setPrevRec(e)}}this._records.Insert(t,e),this._hashTab.set_Item(e.getHashKey(),e)},e.prototype.removeRecord=function(e){1!==arguments.length||null!==e&&e.constructor!==Number?this.removeRecord_1(e):this.removeRecord_0(e)},e.prototype.removeRecord_0=function(e){if(e>=0&&e<this._records.length){var r=this._records.get_Item(e);if(this._useLinkedList){if(e>0)this._records.get_Item(e-1).setNextRec(r.getNextRec());if(e+1<this._records.length)this._records.get_Item(e+1).setPrevRec(r.getPrevRec())}return this._hashTab.Remove(r.getHashKey()),void this._records.RemoveAt(e)}throw new t.ApplicationException("in RecordsTable.removeRecord(): invalid index: "+e)},e.prototype.removeRecord_1=function(e){var t=this._records.indexOf(e);t>=0&&this.removeRecord(t)},e.prototype.replicate=function(){var r=new e(this);r._records=new t.List,r._hashTab=new t.Hashtable(100,.7);for(var n=0;n<this._records.length;n+=1){var a=this._records.get_Item(n).replicate();r._records.push(a),r._hashTab.set_Item(a.getHashKey(),a)}return r},e.prototype.getServerCurrRec=function(){return this._serverCurrRec},e.prototype.zeroServerCurrRec=function(){this._serverCurrRec=null},e.prototype.GetSize=function(){return this.getSize()},e.prototype.GetRecByIdx=function(e){return this.getRecByIdx(e)},e.prototype.RemoveAll=function(){this.removeAll()},e}();Et.REC_NOT_FOUND=-1;var It,ft=function(){function e(e){this._cond=null,this._task=null,this.Loc=null,this._dir="\0",this._id=0,this._keyIdx=0,this._retVal=null,this.returnfield=null,this.LinkStartAfterField=0,this.KeyExpression=0,this._task=e,this._keyIdx=-1,this._cond=new st(!0)}return Object.defineProperty(e.prototype,"ReturnField",{get:function(){return null===this.returnfield&&null!==this._retVal&&(this.returnfield=this.Task.getFieldByValueStr(this._retVal)),this.returnfield},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"IsMainSource",{get:function(){return-1===this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Task",{get:function(){return this._task},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Fields",{get:function(){return this._task.DataView.GetFieldsTab().getLinkFields(this._id)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LinkEvaluateCondition",{get:function(){return this._linkEvalCondition},enumerable:!1,configurable:!0}),e.prototype.SetAttributes=function(e){var t=this;e.Keys.forEach((function(r){t.setAttribute(r,e.get_Item(r))}))},e.prototype.setAttribute=function(e,n){switch(e){case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(n);break;case E.MG_ATTR_KEY:this._keyIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_KEY_EXP:this.KeyExpression=r.XmlParser.getInt(n);break;case E.MG_ATTR_DIR:this._dir=n[0];break;case E.MG_ATTR_COND:case E.MG_ATTR_COND_RES:this._cond.setVal(this._task,n);break;case E.MG_ATTR_RET_VAL:this._retVal=n;break;case E.MG_ATTR_LINK_EVAL_CONDITION:this._linkEvalCondition=n[0];break;case E.MG_ATTR_LINK_MODE:this.Mode=n[0];break;case E.MG_ATTR_LINK_START:this.LinkStartAfterField=r.XmlParser.getInt(n);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e))}},e.prototype.InitLinkFields=function(e){return T(this,void 0,void 0,(function(){var r,n,a,s;return h(this,(function(i){switch(i.label){case 0:r=0,i.label=1;case 1:return r<this.Fields.length?(n=this.Fields.get_Item(r),a=new t.RefParam(n.isNull()),s=new t.RefParam(n.getValue(!1)),[4,n.getInitExpVal(s,a)]):[3,4];case 2:i.sent(),e.SetFieldValue(n.getId(),a.value,s.value),n.invalidate(!0,!1),i.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},e}();(It=e.Recompute_RcmpBy||(e.Recompute_RcmpBy={})).CLIENT="C",It.SERVER_ON_CHANGE="O";var Ct=function(){function a(){this._ctrlProps=null,this._formProps=null,this._isOwnerFld=!0,this.OwnerFld=null,this._rcmpOrder=null,this._subForms=null,this._subFormsOnlyRecomp=!1,this._hasServerLinksRecomputes=!1,this.RcmpMode=null,this.Task=null}return a.prototype.fillData=function(e,t,r){for(this.Task=t,this._isOwnerFld=!0;this.initInnerObjects(r,r.getNextTag(),e););},a.prototype.initInnerObjects=function(e,t,a){switch(t){case r.XMLConstants.MG_TAG_FLD:this._isOwnerFld?(this.fillFldField(e,a),this._isOwnerFld=!1):this.fillFldField(e,a);break;case E.MG_TAG_LINK:this.fillLink(e,a);break;case r.XMLConstants.MG_TAG_CONTROL:null==this._ctrlProps&&(this._ctrlProps=new n.PropTable),this._ctrlProps.fillDataByExists(this.Task,e),null!=this._ctrlProps.getCtrlRef()&&this._ctrlProps.getCtrlRef().IsRepeatable&&this.OwnerFld.IsVirtual&&!this.OwnerFld.hasInitExp()&&this.OwnerFld.causeTableInvalidation(!0);break;case r.XMLConstants.MG_TAG_FORM_PROPERTIES:null==this._formProps&&(this._formProps=new n.PropTable),this._formProps.fillDataByExists(this.Task,e);break;case E.MG_TAG_FLD_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute. Insert else if to Recompute.initInnerObjects for "+t),!1}return!0},a.prototype.AddRecomputeItem=function(e){null===this._rcmpOrder&&(this._rcmpOrder=new t.List),this._rcmpOrder.push(e)},a.prototype.fillLink=function(e,t){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_LINK)+E.MG_TAG_LINK.length);for(var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),i=0;i<s.length;i+=2){var o=s.get_Item(i),l=s.get_Item(i+1);o===r.XMLConstants.MG_ATTR_ID?this.AddRecomputeItem(t.getTask().getDataviewHeaders().getDataviewHeaderById(r.XmlParser.getInt(l))):r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute class. Insert case to Recompute.fillLink for "+o)}e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Recompute.fillLink() out of bounds")},a.prototype.fillFldField=function(e,t){var n=e.getXMLdata().indexOf(this._isOwnerFld?r.XMLConstants.TAG_CLOSE:r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_FLD)+r.XMLConstants.MG_TAG_FLD.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.initElements(s,t),this._isOwnerFld?void e.setCurrIndex(++n):void e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of bounds")},a.prototype.initElements=function(e,t){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case r.XMLConstants.MG_ATTR_ID:var i=r.XmlParser.getInt(s),o=t.getField(i);this._isOwnerFld?(this.OwnerFld=o,this.OwnerFld.setRecompute(this)):(o.setRecomputed(),this.AddRecomputeItem(o));break;case E.MG_ATTR_RECOMPUTEBY:this.RcmpMode=s[0];break;case E.MG_ATTR_SUB_FORM_RCMP:this._subFormsOnlyRecomp=!0;break;case E.MG_ATTR_HAS_LINK_RECOMPUTES:this._hasServerLinksRecomputes=!0;break;case r.XMLConstants.MG_ATTR_NAME:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute class. Insert case to Recompute.initElements for "+a)}}},a.prototype.execute=function(t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p,g,d,E;return h(this,(function(h){switch(h.label){case 0:s=this.Task.getMGData().CmdsToServer,h.label=1;case 1:return h.trys.push([1,,36,37]),t.setInRecompute(!0),this.Task.SetInRecompute(!0),this.SetSubformsInRecompute(!0),(l=this._hasServerLinksRecomputes)?[3,4]:(u=this.Task.getForm().AllowedSubformRecompute)?[4,this.checkRefreshSubForms()]:[3,3];case 2:u=h.sent(),h.label=3;case 3:l=u,h.label=4;case 4:return o=l,this.RcmpMode!==e.Recompute_RcmpBy.CLIENT&&o?(c=this._subFormsOnlyRecomp,this.Task.ExecuteClientSubformRefresh=!1,c?[4,this.Task.prepareCache(!0)]:[3,7]):[3,16];case 5:return(c=h.sent())?[4,this.Task.testAndSet(!0)]:[3,7];case 6:c=h.sent(),h.label=7;case 7:return c?[3,9]:(this.Task.DataView.GetFieldsTab().setServerRcmp(!0),i=Qe.CreateRecomputeCommand(this.Task.getTaskTag(),this.OwnerFld.getId(),!this.Task.getForm().AllowedSubformRecompute),s.Add(i),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)]);case 8:h.sent(),h.label=9;case 9:return this.Task.ExecuteClientSubformRefresh?[4,this.RefreshSubforms()]:[3,11];case 10:return h.sent(),[3,15];case 11:return[4,this.recPrefixSubForms()];case 12:return h.sent()?[4,this.recSuffixSubForms()]:[3,14];case 13:h.sent(),h.label=14;case 14:this.Task.CleanDoSubformPrefixSuffix(),h.label=15;case 15:return[3,35];case 16:return h.trys.push([16,34,,35]),U.Instance.addRecompute(this.OwnerFld.getVarName(),this.Task.GetTaskDetails()),null==this._formProps?[3,18]:[4,this._formProps.RefreshDisplay(!1,!1)];case 17:h.sent(),h.label=18;case 18:return null==this._ctrlProps?[3,20]:[4,this._ctrlProps.RefreshDisplay(!1,!1)];case 19:h.sent(),h.label=20;case 20:if(null==this._rcmpOrder)return[3,32];n=0,h.label=21;case 21:return n<this._rcmpOrder.length?this._rcmpOrder.get_Item(n)instanceof M?(a=this._rcmpOrder.get_Item(n),[4,this.fldRcmp(a,!0)]):[3,23]:[3,32];case 22:return h.sent(),[3,31];case 23:return this._rcmpOrder.get_Item(n)instanceof ft?[4,(_=this._rcmpOrder.get_Item(n)).getLinkedRecord(t)]:[3,31];case 24:h.sent(),T=this.Task.DataView.GetFieldsTab().getLinkFields(_.Id),t.setInCompute(!0),p=t.InForceUpdate,t.InForceUpdate=!1,g=0,h.label=25;case 25:return g<T.length?[4,this.fldRcmp(T.get_Item(g),!1)]:[3,28];case 26:h.sent(),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_UPDATED),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_MODIFIED),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_CRSR_MODIFIED),t.clearHistoryFlag(T.get_Item(g).getId()),h.label=27;case 27:return g++,[3,25];case 28:return t.InForceUpdate=p,null==(d=_.ReturnField)?[3,30]:[4,this.fldRcmp(d,!1)];case 29:h.sent(),h.label=30;case 30:t.setInCompute(!1),t.setForceSaveOrg(!0),h.label=31;case 31:return n++,[3,21];case 32:return[4,this.RefreshSubforms()];case 33:return h.sent(),[3,35];case 34:return E=h.sent(),r.Logger.Instance.WriteExceptionToLogWithMsg("in Recompute.execute(): "+E.Message),[3,35];case 35:return this.Task.SetInRecompute(!1),this.SetSubformsInRecompute(!1),[3,37];case 36:return t.buildLinksPosStr(),t.setInRecompute(!1),[7];case 37:return[2]}}))}))},a.prototype.RefreshSubforms=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(n){switch(n.label){case 0:return this.Task.getForm().AllowedSubformRecompute?[4,this.GetSubformsToRefresh()]:[3,5];case 1:e=n.sent(),t=0,n.label=2;case 2:return t<e.length?(r=e.get_Item(t),[4,this.Task.SubformRefresh(r,!0)]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[2]}}))}))},a.prototype.SetSubformsInRecompute=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return[4,this.GetSubformsToRefresh()];case 1:for(t=n.sent(),r=0;r<t.length;r++)t.get_Item(r).SetInRecompute(e);return[2]}}))}))},a.prototype.fldRcmp=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return e.IsVirtual||this.Task.getMode()!==r.Constants.TASK_MODE_QUERY||et.Instance.allowUpdateInQueryMode(this.Task.getCompIdx())?e.isInEvalProcess()?[3,6]:t?[4,e.compute(!0)]:[3,2]:[3,6];case 1:return n.sent(),[3,4];case 2:return[4,e.setValueAndStartRecompute(e.getValue(!1),e.isNull(),!0,!1,!1)];case 3:n.sent(),n.label=4;case 4:return[4,e.updateDisplay()];case 5:n.sent(),n.label=6;case 6:return[2]}}))}))},a.prototype.buildSubFormList=function(){if(null===this._subForms){this._subForms=new t.List;var e=this.Task.getSubTasks();if(null!==e)for(var r=0;r<e.getSize();r+=1){var n=e.getTask(r);null!==n.getForm().getSubFormCtrl()&&n.refreshesOn(this.OwnerFld.getId())&&this._subForms.push(n)}}},a.prototype.RemoveSubform=function(e){this._subForms.Remove(e)},a.prototype.AddSubform=function(e){null===this._subForms&&(this._subForms=new t.List),this._subForms.Contains(e)||this._subForms.push(e)},a.prototype.recSuffixSubForms=function(){return T(this,void 0,void 0,(function(){var e,t,a,s,i;return h(this,(function(l){switch(l.label){case 0:a=!0,this.buildSubFormList(),e=0,l.label=1;case 1:return a&&e<this._subForms.length?(t=this._subForms.get_Item(e),s=t.getForm().getSubFormCtrl(),(i=t.isStarted()&&!s.RefreshOnVisible)?[4,s.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,6];case 2:i=l.sent(),l.label=3;case 3:return i&&!t.InSelect&&t.DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,5];case 4:l.sent(),a=!o.eventsManager.GetStopExecutionFlag(),l.label=5;case 5:return e++,[3,1];case 6:return this.Task.DataView.setPrevCurrRec(),[2,a]}}))}))},a.prototype.checkRefreshSubForms=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!this._subFormsOnlyRecomp,[4,this.GetSubformsToRefresh()];case 1:return t.sent().length>0&&(e=!0),[2,e]}}))}))},a.prototype.GetSubformsToRefresh=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:e=new t.List,this.buildSubFormList(),a=0,l.label=1;case 1:return a<this._subForms.length?(s=this._subForms[a],r=s.getForm().getSubFormCtrl(),(i=s.isStarted())?[4,r.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,8];case 2:i=l.sent(),l.label=3;case 3:return!i||s.InSelect||s.InEndTask?[3,7]:[4,r.checkProp(n.PropInterface.PROP_TYPE_VISIBLE,!0)];case 4:return l.sent(),(o=!r.isVisible())?[4,r.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,6];case 5:o=!l.sent(),l.label=6;case 6:o?r.RefreshOnVisible=!0:e.push(s),l.label=7;case 7:return a++,[3,1];case 8:return[2,e]}}))}))},a.prototype.recPrefixSubForms=function(){return T(this,void 0,void 0,(function(){var e,t,a,s,i;return h(this,(function(l){switch(l.label){case 0:a=!0,this.buildSubFormList(),e=0,l.label=1;case 1:return a&&e<this._subForms.length?(t=this._subForms.get_Item(e),s=t.getForm().getSubFormCtrl(),(i=t.isStarted()&&!s.RefreshOnVisible)?[4,s.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,6];case 2:i=l.sent(),l.label=3;case 3:return i&&!t.InSelect&&t.DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(t,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]:[3,5];case 4:l.sent(),a=!o.eventsManager.GetStopExecutionFlag(),l.label=5;case 5:return e++,[3,1];case 6:return[2,a]}}))}))},a.prototype.notifyServerOnChange=function(){return this.RcmpMode===e.Recompute_RcmpBy.SERVER_ON_CHANGE},a.prototype.isServerRcmp=function(){return this.RcmpMode!==e.Recompute_RcmpBy.CLIENT},a}(),At=function(){function e(e,t,n,a,s,i){this._cacheTableFldId=0,this._max=null,this._min=null,this._retType=r.StorageAttribute.NONE,this._size=0,this._maxExpVal=null,this._minExpVal=null,this.DiscardMin=!1,this.DiscardMax=!1,this.MaxEqualsMin=!1,5===arguments.length?this.constructor_0(e,t,n,a,s):this.constructor_1(e,t,n,a,s,i)}return Object.defineProperty(e.prototype,"MaxExpVal",{get:function(){return this._maxExpVal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"MinExpVal",{get:function(){return this._minExpVal},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e,t,r,n,a){this.constructor_1(e,t,r,n,a,-1)},e.prototype.constructor_1=function(e,t,r,n,a,s){this._retType=n,this._size=a,this._cacheTableFldId=s,-1!==t&&(this._min=e.getExpById(t)),-1!==r&&(this._max=e.getExpById(r))},e.prototype.hasMinExp=function(){return null!==this._min},e.prototype.hasMaxExp=function(){return null!==this._max},e.prototype.getExpType=function(){return this._retType},e.prototype.getCacheTableFldId=function(){return this._cacheTableFldId},e.prototype.compute=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o;return h(this,(function(l){switch(l.label){case 0:return this.hasMinExp()?[4,this._min.evaluateWithResultTypeAndLength(this.getExpType(),this._size)]:[3,3];case 1:return null!==(a=l.sent())&&(a=t.NString.TrimEnd(a,new Array(0))),this._minExpVal=new n.ExpVal(this.getExpType(),null===a,a),this.MaxEqualsMin=this.IsMaxEqualsMin(),this._minExpVal.IsNull||this._minExpVal.Attr!==r.StorageAttribute.ALPHA&&this._minExpVal.Attr!==r.StorageAttribute.UNICODE||(e&&(this._minExpVal.StrVal=n.DisplayConvertor.StringValueToMgValue(this._minExpVal.StrVal,this._minExpVal.Attr,t.Char.MinValue,this._size).toString(),this.MaxEqualsMin=!1),this._minExpVal.StrVal=r.StrUtil.SearchAndReplaceWildChars(this._minExpVal.StrVal,this._size,t.Char.MinValue)),s=this,[4,this._min.DiscardCndRangeResult()];case 2:s.DiscardMin=l.sent(),l.label=3;case 3:return this.hasMaxExp()?[4,this._max.evaluateWithResultTypeAndLength(this.getExpType(),this._size)]:[3,6];case 4:return i=l.sent(),this._maxExpVal=new n.ExpVal(this.getExpType(),null===i,i),this._maxExpVal.IsNull||this._maxExpVal.Attr!==r.StorageAttribute.ALPHA&&this._maxExpVal.Attr!==r.StorageAttribute.UNICODE||(e&&(this._maxExpVal.StrVal=n.DisplayConvertor.StringValueToMgValue(this._maxExpVal.StrVal,this._maxExpVal.Attr,t.Char.MaxValue,this._size)),this._maxExpVal.StrVal=r.StrUtil.SearchAndReplaceWildChars(this._maxExpVal.StrVal,this._size,t.Char.MaxValue)),o=this,[4,this._max.DiscardCndRangeResult()];case 5:o.DiscardMax=l.sent(),l.label=6;case 6:return[2]}}))}))},e.prototype.checkRange=function(e,t){var r=!0,a=new n.ExpVal(this.getExpType(),t,e);if(a.IsNull&&(this.hasMinExp()&&this._minExpVal.IsNull||this.hasMaxExp()&&this._maxExpVal.IsNull))r=!0;else{if(this.hasMinExp())if(this._minExpVal.IsNull||a.IsNull)a.IsNull!==this._minExpVal.IsNull&&(r=!1);else try{ct.val_cmp_any(a,this._minExpVal,!0)<0&&(r=!1)}catch(e){if(!(e instanceof _t))throw e;r=!1}if(this.hasMaxExp()&&r)if(this._maxExpVal.IsNull||a.IsNull)a.IsNull!==this._maxExpVal.IsNull&&(r=!1);else try{ct.val_cmp_any(a,this._maxExpVal,!0)>0&&(r=!1)}catch(e){if(!(e instanceof _t))throw e;r=!1}}return r},e.prototype.IsMaxEqualsMin=function(){var e=!1;return this.hasMaxExp()&&this.hasMinExp()&&this._min.getId()===this._max.getId()&&(e=this._retType!==r.StorageAttribute.ALPHA&&this._retType!==r.StorageAttribute.UNICODE||!this.WildCharExist()),e},e.prototype.WildCharExist=function(){var e=["*","?"],t=!1;if(!this._minExpVal.IsNull)for(var r=this._minExpVal.StrVal,n=0;n<e.length;n+=1)if(r.endsWith(e[n])){t=!0;break}return t},e.prototype.toString=function(){return t.NString.Format("{{Boundary: {0}-{1}, {2}, {3}}}",[this._max,this._max,this._retType,this._size])},e}(),Rt=function(s){function i(e,t){var a=s.call(this,t)||this;return a._linkExp=null,a._recompute=null,a.CacheTableFldIdx=0,a._causeTableInvalidation=!1,a._form=null,a._hasChangeEvent=!1,a._hasZoomHandler=!1,a._inEvalProcess=!1,a._initExp=null,a._invalidValue=!0,a._isLinkFld=!1,a._isVirtual=!1,a._dataviewHeaderId=-1,a._linkCreate=!1,a.Locate=null,a.Range=null,a._isParam=!1,a._isExposedRouteParam=!1,a._isExposedToClient=!0,a._prevIsNull=!1,a._prevValue=null,a._tableName=null,a._indexInTable=-1,a._virAsReal=!1,a._val=null,a.modifiedAtLeastOnce=!1,a._isNull=!1,a._clearVectorType=!0,a._vectorType=null,null===i.NUM0&&(i.NUM0=new n.NUM_TYPE,i.NUM1=new n.NUM_TYPE,i.NUM0.NUM_4_LONG(0),i.NUM1.NUM_4_LONG(1)),a._dataview=e,a._linkExp=new st(!1),n.FieldDef._default_date=n.DisplayConvertor.Instance.disp2mg(r.PICInterface.DEFAULT_DATE,null,new n.PIC("6",r.StorageAttribute.NUMERIC,s.prototype.getTask.call(a).getCompIdx()),s.prototype.getTask.call(a).getCompIdx(),n.BlobType.CONTENT_TYPE_UNKNOWN),a}return u(i,s),Object.defineProperty(i.prototype,"VirAsReal",{get:function(){return this._virAsReal},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsVirtual",{get:function(){return this._isVirtual},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsExposedRouteParam",{get:function(){return this._isExposedRouteParam},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsExposedToClient",{get:function(){return this._isExposedToClient},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IndexInTable",{get:function(){return this._indexInTable},enumerable:!1,configurable:!0}),i.prototype.setAttribute=function(e,n){var a=s.prototype.setAttribute.call(this,e,n);if(!a){var i=r.StrUtil.tokenize(n,",");switch(a=!0,e){case E.MG_ATTR_VIRTUAL:this._isVirtual=0!==r.XmlParser.getInt(n);break;case E.MG_ATTR_PARAM:if(this._isParam=0!==r.XmlParser.getInt(n),!this._isVirtual&&this._isParam)throw new t.ApplicationException("in Field.initElements(): non virtual field is defined as a parameter");break;case E.MG_ATTR_EXPOSED_ROUTE_PARAMS:if(this._isExposedRouteParam=0!==r.XmlParser.getInt(n),!this._isParam&&this._isExposedRouteParam)throw new t.ApplicationException("in Field.initElements(): non parameter field is defined as a exposed route parameter");break;case E.MG_ATTR_EXPOSED_TO_CLIENT:0==r.XmlParser.getInt(n)&&(this._isExposedToClient=!1);break;case E.MG_ATTR_VIR_AS_REAL:this._virAsReal=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_LNK_CREATE:this._linkCreate=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_LNKEXP:this._linkExp.setVal(this.getTask(),n);break;case E.MG_ATTR_TABLE_NAME:this._tableName=r.XmlParser.unescape(n);break;case E.MG_ATTR_INDEX_IN_TABLE:this._indexInTable=r.XmlParser.getInt(n);break;case E.MG_ATTR_INIT:var o=r.XmlParser.getInt(n);this._initExp=this.getTask().getExpById(o);break;case r.XMLConstants.MG_ATTR_NAME:break;case E.MG_ATTR_CHACHED_FLD_ID:this.CacheTableFldIdx=t.NNumber.Parse(i[1]);break;case E.MG_ATTR_LOCATE:this.Locate=new At(this.getTask(),t.NNumber.Parse(i[1]),t.NNumber.Parse(i[0]),this.getType(),this.getSize(),this.CacheTableFldIdx);break;case E.MG_ATTR_RANGE:this.Range=new At(this.getTask(),t.NNumber.Parse(i[1]),t.NNumber.Parse(i[0]),this.getType(),this.getSize(),this.CacheTableFldIdx);break;case E.MG_ATTR_LINK:this._dataviewHeaderId=t.NNumber.Parse(n);break;case E.MG_ATTR_IS_LINK_FIELD:this._isLinkFld=r.XmlParser.getBoolean(n);break;default:a=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e))}}return a},i.prototype.setRecompute=function(e){this._recompute=e},i.prototype.RemoveSubformFromRecompute=function(e){null!==this._recompute&&this._recompute.RemoveSubform(e)},i.prototype.AddSubformRecompute=function(t){null===this._recompute&&(this._recompute=new Ct,this._recompute.Task=s.prototype.getTask.call(this),this._recompute.OwnerFld=this,this._recompute.RcmpMode=e.Recompute_RcmpBy.CLIENT),this._recompute.AddSubform(t)},i.prototype.SetControl=function(e){s.prototype.SetControl.call(this,e),this._isVirtual&&e.IsRepeatable&&null===this._initExp&&(this._causeTableInvalidation=!0)},i.prototype.compute=function(e){var n=Object.create(null,{getTask:{get:function(){return s.prototype.getTask}}});return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=new t.RefParam(this.getValue(!1)),s=new t.RefParam(this._isNull),i=this._dataview.getCurrRec(),l=n.getTask.call(this),u=this._linkCreate&&i.InCompute&&!e&&l.getMode()===r.Constants.TASK_MODE_CREATE,null==this._form&&(this._form=l.getForm()),(null!=this._form&&this._form.InRestore||o.eventsManager.GetStopExecutionFlag())&&(u=!1),c=o.eventsManager.getLastRtEvent(),_=!1,null!=c&&(_=c.getInternalCode()===r.InternalInterface.MG_ACT_CANCEL),this._virAsReal||null!=this._form&&this._form.InRestore||!(this._isVirtual||l.getMode()===r.Constants.TASK_MODE_CREATE&&_||e||u||i.isNewRec()&&!i.isComputed())?[3,3]:(!l.DataView.isEmptyDataview()||l.DataView.isEmptyDataview()&&!this.PartOfDataview)&&(this._isVirtual||l.getMode()===r.Constants.TASK_MODE_CREATE||this._dataview.computeByClient()||!i.InCompute||u||i.lateCompute())?null==this._initExp?[3,2]:[4,this.EvaluateInitExpression(a,s)]:[3,3];case 1:return T.sent(),[3,3];case 2:u&&(a.value=this.getDefaultValue()),T.label=3;case 3:return this._invalidValue&&(this._prevValue=a.value,this._prevIsNull=s.value),[4,this.setValue(a.value,s.value,e,!1,e&&!this._isVirtual,!1,!1)];case 4:return T.sent(),[2]}}))}))},i.prototype.EvaluateInitExpression=function(e,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:t.Debug.Assert(null!==this._initExp),a.label=1;case 1:return a.trys.push([1,,3,4]),this._inEvalProcess=!0,n=e,[4,this._initExp.evaluateWithResultTypeAndLength(this._type,this._size)];case 2:return n.value=a.sent(),[3,4];case 3:return this._inEvalProcess=!1,[7];case 4:return r.value=null===e.value,r.value&&this.NullAllowed&&(e.value=this.getValue(!1)),[2]}}))}))},i.prototype.getValue=function(e){return s.prototype.getTask.call(this).getEvalOldValues()?this.getOriginalValue():(this._invalidValue&&this.takeValFromRec(),this._isNull&&(this._val=this.getValueForNull(e)),this._val)},i.prototype.isChanged=function(e,t){return!(null===this._prevValue||this._prevValue===e&&this._prevIsNull===t)},i.prototype.takeValFromRec=function(){var e=this._dataview.getCurrRec();null!==e&&(this._val=e.GetFieldValue(this._id),this._isNull=e.IsNull(this._id)),this._invalidValue&&(null!==e&&this._causeTableInvalidation&&this.isChanged(this._val,this._isNull)&&null!==this._form&&e.setCauseInvalidation(!0),this._prevValue=this._val,this._prevIsNull=this._isNull,this._invalidValue=!1),this._vectorType=null},i.prototype.getOriginalValue=function(){var e=this._dataview.getOriginalRec();return e.IsNull(this._id)?this.getMagicDefaultValue():e.GetFieldValue(this._id)},i.prototype.isOriginalValueNull=function(){return this._dataview.getOriginalRec().IsNull(this._id)},i.prototype.getValueByRecIdx=function(e){var t=this._dataview.getRecByIdx(e),r=t.GetFieldValue(this._id);return t.IsNull(this._id)?this.getValueForNull(!1):r},i.prototype.getModifiedAtLeastOnce=function(){return this.modifiedAtLeastOnce},i.prototype.isNullByRecIdx=function(e){return this._dataview.getRecByIdx(e).IsNull(this._id)},i.prototype.isEqual=function(e,t,r,n){var a=this._dataview.getRecByIdx(n),s=!1;if(null!=a){var i=a.GetFieldValue(this._id),o=a.IsNull(this._id);s=ct.mgValsEqual(i,o,this._type,e,t,r)}return s},i.prototype.getNewRecValue=function(e){return this._isVirtual&&null==this._initExp?this._val:e?null:this.getDefaultValue()},i.prototype.setValueAndStartRecompute=function(e,t,r,n,s,i){return T(this,void 0,void 0,(function(){return h(this,(function(o){switch(o.label){case 0:return a.isNullOrUndefined(i)&&(i=!1),[4,this.setValueAndStartRecompute_1(e,t,r,n,s,!1)];case 1:return o.sent(),[2]}}))}))},i.prototype.setValueAndStartRecompute_1=function(e,t,r,n,a,s){return T(this,void 0,void 0,(function(){var i,o;return h(this,(function(l){switch(l.label){case 0:return null!=(i=this.getTask())&&i.VewFirst++,[4,this.setValue(e,t,r,n,!this._isVirtual,a,s)];case 1:return o=l.sent(),null===i||1!==i.VewFirst||null===this._form||this.IsEventHandlerField?[3,3]:r&&o?[4,this._form.refreshOnExpressions()]:[3,3];case 2:l.sent(),l.label=3;case 3:return null!=i&&i.VewFirst--,[2]}}))}))},i.prototype.setValue=function(e,a,l,u,c,_,p){var g=Object.create(null,{getTask:{get:function(){return s.prototype.getTask}}});return T(this,void 0,void 0,(function(){var s,T,d,E,I,f,C,A,R,S,M,m,v,b,N,y,O,P,D,k;return h(this,(function(h){switch(h.label){case 0:if(d=!1,f=null,C=this.getCtrl(),S=!1,M=l||p,m=this.getTask(),null===this._form&&(this._form=m.getForm()),a&&!this.NullAllowed&&this._type!==r.StorageAttribute.BLOB_VECTOR&&(e=this.getDefaultValue(),a=!1),this._type!==r.StorageAttribute.NUMERIC||null==e||n.NUM_TYPE.numHexStrIsLong(e)||(v=new n.NUM_TYPE(e),b=new n.PIC(this._picture,this._type,g.getTask.call(this).getCompIdx()),N=b.getDec(),v.round(N),e=v.toXMLrecord()),null==(s=this._dataview.getCurrRec()))throw new t.ApplicationException(pe.Instance.getConstMessage(r.MsgInterface.RT_STR_NO_RECS_IN_RNG));if(!this.IsVirtual&&(m.getMode()===r.Constants.TASK_MODE_QUERY&&!et.Instance.allowUpdateInQueryMode(m.getCompIdx())||s.InForceUpdate&&s.InCompute))return[2,!d];M&&this.getHasChangeEvent()&&((y=new Array(2))[0]=new n.ExpVal(r.StorageAttribute.NUMERIC,!1,null!==C&&C.IsInteractiveUpdate?i.NUM0.toXMLrecord():i.NUM1.toXMLrecord()),y[1]=new n.ExpVal(this.getType(),this.isNull(),this.getValue(!1)),f=new L(y)),null!=C&&(C.IsInteractiveUpdate=!1),this._type!==r.StorageAttribute.UNICODE&&r.UtilStrByteMode.isLocaleDefLangDBCS()?(E=null!=e?this._size-r.UtilStrByteMode.lenB(e):0,null!=e&&this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BLOB_VECTOR&&E<0?this._val=r.UtilStrByteMode.leftB(e,this._size):this._type===r.StorageAttribute.ALPHA&&E>0?this._val=e+t.NString.FromChars(this._spaces,0,E):this._type===r.StorageAttribute.BLOB?this._val=n.BlobType.copyBlob(this._val,e):this._val=e):(E=null!=e?this._size-e.length:0,null!=e&&this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BLOB_VECTOR&&E<0?this._val=e.substr(0,this._size):(this._type===r.StorageAttribute.ALPHA||this._type===r.StorageAttribute.UNICODE)&&E>0?this._val=e+t.NString.FromChars(this._spaces,0,E):this._type===r.StorageAttribute.BLOB?(null===this._val&&(this._val=this.getMagicDefaultValue()),this._val=n.BlobType.copyBlob(this._val,e)):this._val=e),T=s.GetFieldValue(this._id),O=this._isNull,l||_||null!=this._initExp||(O=s.IsNull(this._id));try{d=ct.mgValsEqual(this._val,a,this._type,T,O,this._type)}catch(e){this._val=this.getMagicDefaultValue(),d=!1}if(this._clearVectorType&&(this._vectorType=null),this._invalidValue&&(this._invalidValue=!1,s.clearFlag(this._id,gt.FLAG_UPDATED),s.clearFlag(this._id,gt.FLAG_MODIFIED)),I=this._linkCreate&&s.InCompute&&!l&&(null==this._form||!this._form.InRestore)&&!o.eventsManager.GetStopExecutionFlag(),!this._isVirtual&&!I||s.isNewRec()||d||(S=!0),!(M||S||s.isNewRec()))return[3,9];if(this.UpdateNull(a,s),c&&s.setFlag(this._id,gt.FLAG_CRSR_MODIFIED),s.setFieldValue(this._id,this._val,u),R=i._variableChangeEvts,A=R.length,M&&this.getHasChangeEvent()&&!R.Contains(this)&&!d&&((P=new w(this)).setInternal(r.InternalInterface.MG_ACT_VARIABLE),P.setArgList(f),R.push(this),R.push(P)),null==this._recompute||!l&&!S||this._dataview.InLocalDataviewCommand)return[3,4];h.label=1;case 1:return h.trys.push([1,,3,4]),S&&(s.InForceUpdate=!0),[4,this._recompute.execute(s)];case 2:return h.sent(),[3,4];case 3:return S&&(s.InForceUpdate=!1),[7];case 4:return this._causeTableInvalidation&&this.isChanged(this._val,a)&&s.setCauseInvalidation(!0),!l&&!S||this._dataview.InLocalDataviewCommand||null==C?[3,6]:C.isChoiceControl()?[4,this.updateDisplay()]:[3,6];case 5:h.sent(),h.label=6;case 6:if(0!==A||!M||!this.getHasChangeEvent())return[3,9];h.label=7;case 7:return R.length>0?(D=R.get_Item(1),R.RemoveAt(0),R.RemoveAt(0),null==G.Instance.getLastFocusedTask()?D.setTask(this.getTask()):((k=G.Instance.getLastFocusedTask()).TaskSuffixExecuted&&(k=null!=k.PathParentTask?k.PathParentTask:k),D.setTask(k)),D.setCtrl(G.getLastFocusedControl()),[4,o.eventsManager.handleEvent(D,!1)]):[3,9];case 8:return h.sent(),[3,7];case 9:return l&&!d&&this.setModified(),[2,!d]}}))}))},i.prototype.UpdateNull=function(e,t){e?t.setFlag(this._id,gt.FLAG_NULL):t.clearFlag(this._id,gt.FLAG_NULL),this._isNull=e},i.prototype.setCellVecValue=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return s=!1,this._type!==r.StorageAttribute.BLOB_VECTOR?[3,2]:(null==this._vectorType&&(this._vectorType=this.isNull()?new n.VectorType(this._vecCellsType,this._vecCellsContentType,this.DefaultValue,this.isNullDefault(),this.NullAllowed,this._vecCellsSize):new n.VectorType(this._val)),this._vecCellsType===r.StorageAttribute.BLOB&&(i=this.getCellDefualtValue(),t=n.BlobType.copyBlob(i,t)),(s=this._vectorType.setVecCell(e,t,a))?(this._clearVectorType=!1,[4,this.setValueAndStartRecompute(this._vectorType.toString(),!1,!0,!1,!1)]):[3,2]);case 1:o.sent(),this._clearVectorType=!0,o.label=2;case 2:return[2,s]}}))}))},i.prototype.getVecCellValue=function(e){return this._type===r.StorageAttribute.BLOB_VECTOR?(null==this._vectorType&&(this._vectorType=new n.VectorType(this._val)),this._vectorType.getVecCell(e)):null},i.prototype.setRecomputed=function(){},i.prototype.invalidate=function(e,t){var r=this._dataview.getCurrRec();(!this._isVirtual||this._virAsReal||null!==this._initExp||e)&&(this._invalidValue=!0),t&&null!==r&&(r.clearFlag(this._id,gt.FLAG_UPDATED),r.clearFlag(this._id,gt.FLAG_MODIFIED))},i.prototype.getTableName=function(){return null==this._tableName?"":this._tableName},i.prototype.getName=function(){return this._isParam?"Parameter."+this.getVarName():this._isVirtual?"Virtual."+this.getVarName():this.getTableName()+"."+this.getVarName()},i.prototype.isNull=function(){return s.prototype.getTask.call(this).getEvalOldValues()?this.isOriginalValueNull():(this._invalidValue&&this.takeValFromRec(),this._isNull)},i.prototype.PrevIsNull=function(){return this._prevIsNull},i.prototype.isModified=function(){return this._dataview.getCurrRec().isFldModified(this._id)},i.prototype.setModified=function(){var e=this._dataview.getCurrRec();e.setFlag(this._id,gt.FLAG_MODIFIED),e.setFlag(this._id,gt.FLAG_MODIFIED_ATLEAST_ONCE),this.IsVirtual&&(this.modifiedAtLeastOnce=!0)},i.prototype.setUpdated=function(){var e=this._dataview.getCurrRec();e.setFlag(this._id,gt.FLAG_UPDATED),e.setUpdated()},i.prototype.isParam=function(){return this._isParam},i.prototype.isInEvalProcess=function(){return this._inEvalProcess},i.prototype.hasInitExp=function(){return null!==this._initExp},i.prototype.isServerRcmp=function(){return null!==this._recompute&&this._recompute.isServerRcmp()},i.prototype.getPicture=function(){return this._picture},i.prototype.getDataviewHeaderId=function(){return this._dataviewHeaderId},Object.defineProperty(i.prototype,"IsLinkField",{get:function(){return this._isLinkFld},enumerable:!1,configurable:!0}),i.prototype.getInitExpVal=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null==this._initExp?[3,2]:[4,this.EvaluateInitExpression(e,t)];case 1:return r.sent(),[3,3];case 2:e.value=this.getDefaultValue(),r.label=3;case 3:return[2]}}))}))},i.prototype.setHasChangeEvent=function(){this._hasChangeEvent=!0},i.prototype.getHasChangeEvent=function(){return this._hasChangeEvent},i.prototype.setHasZoomHandler=function(){this._hasZoomHandler=!0},i.prototype.getHasZoomHandler=function(){return this._hasZoomHandler},i.prototype.isCauseTableInvalidation=function(){return this._causeTableInvalidation},i.prototype.causeTableInvalidation=function(e){this._causeTableInvalidation=e},i.prototype.getValueForNull=function(e){var t;return this.NullAllowed?e&&s.prototype.getTask.call(this).getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY?t=null:(null===this._nullValue&&(this._nullValue=s.prototype.getMagicDefaultValue.call(this)),t=this._nullValue):t=s.prototype.getMagicDefaultValue.call(this),t},i.prototype.getCtrl=function(){var e;if(null!=this._controls)for(var t=0;t<this._controls.length;t++)if((e=this._controls.get_Item(t)).getForm().getTask()===this.getTask())return e;return null},i.prototype.updateDisplay=function(){var e=Object.create(null,{updateDisplayWithValue:{get:function(){return s.prototype.updateDisplayWithValue}}});return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.updateDisplayWithValue.call(this,this.getDispValue(),this.isNull())];case 1:return t.sent(),[2]}}))}))},i.prototype.getDispValue=function(){return this.isNull()?null!=this._nullDisplay?this.getNullDisplay():s.prototype.getMagicDefaultValue.call(this):this.getValue(!1)},Object.defineProperty(i.prototype,"ShouldCheckRangeInCompute",{get:function(){return this.IsLinkField||this.IsVirtual&&this._dataview.HasMainTable},enumerable:!1,configurable:!0}),i.prototype.IsForArgument=function(e){if(e){if(!this.isParam())return!1}else if(!this.IsVirtual)return!1;return!0},i}(M);Rt.LEAVE_FLAGS=!1,Rt.NUM0=null,Rt.NUM1=null,Rt._variableChangeEvts=new t.List;var St,Mt=function(e){function a(){var t=e.call(this)||this;return t._rmIdx=0,t._rmSize=-1,t._serverRcmpDone=!1,t}return u(a,e),a.prototype.fillData=function(t,r){if(2===arguments.length)e.prototype.fillData.call(this,t,r);else for(;this.initFields(t.getNextTag(),t););},a.prototype.initFields=function(e,t){if(null==e)return!1;if(e!==r.XMLConstants.MG_TAG_FLDH)return!1;var n=this.initField(t);return this._fields.push(n),!0},a.prototype.initField=function(e,t){return 2===arguments.length?this.initField_0(t,e):this.initField_1(e)},a.prototype.initField_0=function(e,t){var r=new Rt(e,this._fields.length);return r.fillData(t),r},a.prototype.initField_1=function(e){var t=new n.FieldDef(this._fields.length);return t.fillData(e),t},a.prototype.getRMSize=function(){return-1===this._rmSize?this._fields.length:this._rmSize},a.prototype.getRMIdx=function(){return this._rmIdx},a.prototype.setRMPos=function(e,t){e<0&&-1!==this._rmSize?r.Logger.Instance.WriteExceptionToLogWithMsg("in FieldsTable.setRMSize(): illegal record main size: "+e):this._rmSize>=0?r.Logger.Instance.WriteExceptionToLogWithMsg("in FieldsTable.setRMSize(): record main size already set !"):(this._rmSize=e,this._rmIdx=t)},a.prototype.getSizeOfField=function(t){var n=e.prototype.getField.call(this,t);return null!==n?n.getSize():(r.Logger.Instance.WriteExceptionToLogWithMsg("FieldTable.GetSizeOfField() field id: "+t),0)},a.prototype.getType=function(t){return e.prototype.getField.call(this,t).getType()},a.prototype.invalidate=function(e,t){for(var r=0;r<this._fields.length;r++){this._fields[r].invalidate(e,t)}},a.prototype.takeValsFromRec=function(){for(var e=0;e<this._fields.length;e++){this._fields[e].takeValFromRec()}},a.prototype.serverRcmpDone=function(){return this._serverRcmpDone},a.prototype.setServerRcmp=function(e){this._serverRcmpDone=e},a.prototype.getLinkFields=function(e){var r=new t.List;return this._fields.forEach((function(t){t.getDataviewHeaderId()===e&&r.push(t)})),r},a.prototype.resetRecomp=function(){this._fields.forEach((function(e){return e.setRecompute(null)}))},a}(n.FieldsTable);(St=e.RecordOutOfDataViewException_ExceptionType||(e.RecordOutOfDataViewException_ExceptionType={}))[St.TOP=0]="TOP",St[St.BOTTOM=1]="BOTTOM",St[St.REC_SUFFIX_FAILED=2]="REC_SUFFIX_FAILED",St[St.NONE=3]="NONE";var mt=function(t){function r(r){var n=t.call(this,r===e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED?"Record Suffix Failed":"Record out of the "+(r===e.RecordOutOfDataViewException_ExceptionType.TOP?"top":"bottom")+" bound of the Data View")||this;return n._type=e.RecordOutOfDataViewException_ExceptionType.NONE,n._type=r,n.name="RecordOutOfDataViewException",n}return u(r,t),r.prototype.getEnd=function(){return this._type},r.prototype.noRecord=function(){return this._type===e.RecordOutOfDataViewException_ExceptionType.TOP||this._type===e.RecordOutOfDataViewException_ExceptionType.BOTTOM},r}(t.ApplicationException),vt=function(e){function t(){var t=e.call(this)||this;return t.dcv=null,t.parser=null,t.parser=new r.XmlParser,t}return u(t,e),Object.defineProperty(t.prototype,"SerializedDCVals",{set:function(e){this.parser.setXMLdata(e),this.parser.setCurrIndex(0)},enumerable:!1,configurable:!0}),t.prototype.Build=function(){this.dcv=null;var e=this.parser.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,this.parser.getCurrIndex());if(-1!==e&&e<this.parser.getXMLdata().length){var t=this.parser.getXMLsubstring(e);this.parser.add2CurrIndex(t.indexOf(E.MG_TAG_DC_VALS)+E.MG_TAG_DC_VALS.length);var n=r.XmlParser.getTokens(this.parser.getXMLsubstring(e),r.XMLConstants.XML_ATTR_DELIM);this.dcv=this.CreateDcValues(!1),this.InitDCValues(this.dcv,n)}return this.dcv},t.prototype.InitDCValues=function(e,t){for(var n=r.StorageAttribute.NONE,a=null,s=null,i=0;i<t.length;i+=2){var o=t.get_Item(i),l=t.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:this.SetId(e,r.XmlParser.getInt(l));break;case r.XMLConstants.MG_ATTR_TYPE:n=l[0],this.SetType(e,n);break;case E.MG_ATTR_DISP:l=r.XmlParser.unescape(l),a=this.ParseValues(l,r.StorageAttribute.UNICODE);break;case E.MG_ATTR_LINKED:s=l=r.XmlParser.unescape(l);break;case E.MG_ATTR_NULL_FLAGS:this.SetNullFlags(e,l);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in DcValues.initElements() unknown attribute: "+o)}}this.SetDisplayValues(e,a),null==s?this.SetLinkValues(e,a):this.SetLinkValues(e,this.ParseValues(s,n))},t.prototype.ParseValues=function(t,n){var a=!1;return(et.Instance.GetDebugLevel()>1||n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BOOLEAN)&&(a=!0),e.prototype.ParseValues.call(this,t,n,a)},t}(n.DcValuesBuilderBase),Lt=t.Int32.MinValue,bt="P",Nt="</"+E.MG_TAG_DATAVIEW+">",yt=function(s){function i(e){var r=s.call(this)||this;return r._cacheLruTimeStamp=0,r._changed=!1,r._chunkSize=30,r._chunkSizeExpression=0,r._computeBy="\0",r._currRecId=0,r._currRecIdx=0,r._dvPosValue=0,r._firstDv=!0,r._flushUpdates=!1,r._hasMainTable=!0,r._insertAt=" ",r.InLocalDataviewCommand=!1,r._lastCreatedRecId=0,r._lastSessionCounter=t.Int64.MinValue,r._locateFirstRec=-1,r._modifiedRecordsTab=null,r._oldTopRecIdx=t.Int32.MinValue,r._original=null,r._pendingRecovery="N",r._prevCurrRec=null,r._recordsTab=null,r._recovery=E.RECOVERY_NONE,r._rmIdx=0,r._rmSize=0,r._skipParsing=!1,r._topRecId=0,r._topRecIdx=t.Int32.MinValue,r._topRecIdxModified=!1,r._transCleared=!1,r._unknownRcmp="M",r.IsOneWayKey=!1,r._includesFirst=!1,r._includesLast=!1,r._serverTransCacheEmpty=!0,r._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER=null,r.DBViewSize=0,r.Dvcount=0,r.TotalRecordsCount=0,r.RecordsBeforeCurrentView=0,e instanceof b?(r._task=e,r._fieldsTab=new Mt,r._recordsTab=new Et(!0),r._modifiedRecordsTab=new Et(!1)):Object.assign(r,e),r}return u(i,s),Object.defineProperty(i.prototype,"InsertAt",{get:function(){return this._insertAt},set:function(e){this._insertAt=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"CurrRec",{get:function(){return this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER},set:function(e){null!==this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER&&null===e&&this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.resetDcValueId(),this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER=e,null!==this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER&&this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.SetDcValueId()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"FlushUpdates",{get:function(){return this._flushUpdates},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"HasMainTable",{get:function(){return this._hasMainTable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"CurrentRecId",{get:function(){return this._currRecId},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"FirstRecord",{get:function(){return this._recordsTab.getRecByIdx(0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"LastRecord",{get:function(){return this._recordsTab.getRecByIdx(this._recordsTab.getSize()-1)},enumerable:!1,configurable:!0}),i.prototype.Init=function(){this.init()},i.prototype.IncludesFirst=function(){return this._includesFirst},Object.defineProperty(i.prototype,"ServerTransactionCacheEmpty",{get:function(){return this._serverTransCacheEmpty},enumerable:!1,configurable:!0}),i.prototype.IncludesLast=function(){return this._includesLast},i.prototype.fillHeaderData=function(e){for(;this.initHeaderInnerObjects(e,e.getNextTag()););this.Dvcount=this._task.ctl_itm_4_parent_vee(0,1)},i.prototype.initHeaderInnerObjects=function(e,t){return null!==t&&(t!==r.XMLConstants.MG_TAG_DVHEADER?t==="/"+r.XMLConstants.MG_TAG_DVHEADER&&(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteDevToLog("dvheader found"),this.getHeaderAttributes(e),this._fieldsTab.fillData(e,this),this._fieldsTab.setRMPos(this._rmSize,this._rmIdx),!0))},i.prototype.getHeaderAttributes=function(e){var n,a,s,i,o=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==o&&o<e.getXMLdata().length){a=e.getXMLsubstring(o),e.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_DVHEADER)+r.XMLConstants.MG_TAG_DVHEADER.length),n=r.XmlParser.getTokens(e.getXMLsubstring(o),r.XMLConstants.XML_ATTR_DELIM);for(var l=0;l<n.length;l+=2)switch(s=n.get_Item(l),i=n.get_Item(l+1),s){case E.MG_ATTR_RMPOS:var u=i.indexOf(",");u>-1&&(this._rmSize=t.NNumber.Parse(i.substr(0,u)),this._rmIdx=t.NNumber.Parse(i.substr(u+1)));break;case E.MG_ATTR_COMPUTE_BY:this._computeBy=i[0],"H"===this._computeBy?(this._computeBy="S",this._flushUpdates=!0):this._flushUpdates=!1;break;case E.MG_ATTR_HAS_MAIN_TBL:this._hasMainTable=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_CHUNK_SIZE:this._chunkSize=r.XmlParser.getInt(i);break;case E.MG_ATTR_CHUNK_SIZE_EXPRESSION:this._chunkSizeExpression=r.XmlParser.getInt(i);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("Unknown attribute for <"+r.XMLConstants.MG_TAG_DVHEADER+"> tag: "+s)}e.setCurrIndex(++o)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getHeaderAttributes(): out of bounds")},i.prototype.fillData=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:this._skipParsing=!1,t.label=1;case 1:return[4,this.initInnerObjects(e,e.getNextTag())];case 2:return t.sent()?[3,1]:[3,3];case 3:return this.ResetFirstDv(),[2]}}))}))},i.prototype.GetTransactionBegin=function(){var e="\0",t=this._task.getProp(n.PropInterface.PROP_TYPE_TRASACTION_BEGIN);return null!==t&&(e=t.GetComputedValue().charAt(0)),e},i.prototype.initInnerObjects=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return a=this._task.getForm(),null==n?[2,!1]:n!==E.MG_TAG_DATAVIEW?[3,19]:[4,this.getAttributes(e)];case 1:return s=h.sent(),this._skipParsing?(i=e.getXMLdata().indexOf(Nt,e.getCurrIndex()),e.setCurrIndex(i+Nt.length),[3,18]):[3,2];case 2:return this.fillExecStack(e),this.fillDataDc(e),s&&null!=a&&a.SetTableItemsCount(0,!0),l=this._recordsTab.fillData(this,this._insertAt,e),null!=a&&a.Opened&&("B"===this._insertAt&&(s||this._recordsTab.InsertedRecordsCount>0)?s||!this._task.getForm().isTableWithPagination()?(a.SetTableItemsCount(0,!0),a.setTableItemsCount(!1)):a.InsertTableItems(0,this._recordsTab.InsertedRecordsCount):a.setTableItemsCount(!1)),null!=this.CurrRec&&this.CurrRec.InRecompute&&l===r.Constants.TASK_REFRESH_NONE&&(l=r.Constants.TASK_REFRESH_CURR_REC),s&&(l=r.Constants.TASK_REFRESH_FORM,this._task.IsSubForm&&(this.getTask().DoSubformPrefixSuffix=!0)),this.getTask().SetRefreshType(l),this.UpdateDataviewAfterInsert(),(u=this._recordsTab.getInitialCurrRecId())===t.Int32.MinValue||this._recovery!==E.RECOVERY_NONE&&!this._firstDv?[3,6]:(!this._firstDv||this._recovery!==E.RECOVERY_NONE||0!==this._task.getLevel().charCodeAt(0)&&this._task.getLevel()!==r.Constants.TASK_LEVEL_TASK||this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._fieldsTab.invalidate(!0,Rt.LEAVE_FLAGS),u===this._currRecId?[3,4]:[4,this.setCurrRec(u,!this._firstDv)]);case 3:return h.sent(),this._original=this.CurrRec.replicate(),this._firstDv&&this.takeFldValsFromCurrRec(),null!=this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,5];case 4:this.takeFldValsFromCurrRec(),h.label=5;case 5:return[3,17];case 6:if(!(s&&this._recordsTab.getSize()>0))return[3,17];if(null!=a&&!a.isScreenMode())return[3,11];h.label=7;case 7:return h.trys.push([7,9,,10]),[4,this.setCurrRecByIdx(0,!1,!0,!1,0)];case 8:return h.sent(),[3,10];case 9:if(!((c=h.sent())instanceof mt))throw c;return[3,10];case 10:return[3,16];case 11:this._fieldsTab.invalidate(!0,Rt.LEAVE_FLAGS),this.setTopRecIdx(0),null!=this._task.getForm()&&this._task.getForm().SetTableTopIndex(),h.label=12;case 12:return h.trys.push([12,14,,15]),[4,this.setCurrRecByIdx(0,!1,!0,!0,0)];case 13:return h.sent(),null!=this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,15];case 14:if(!((_=h.sent())instanceof mt))throw _;return[3,15];case 15:this._task.getLevel()===r.Constants.TASK_LEVEL_CONTROL&&null!=this._task.getLastParkedCtrl()&&this._task.getLastParkedCtrl().resetPrevVal(),h.label=16;case 16:this.saveOriginal(),this._fieldsTab.invalidate(!0,M.CLEAR_FLAGS),h.label=17;case 17:if(this._firstDv&&this.setPrevCurrRec(),s&&this._task.IsSubForm&&(this._task.getForm().getSubFormCtrl().RefreshOnVisible=!1),this._recovery===E.RECOVERY_NONE)this.getTask().getAfterRetry(E.RECOVERY_RETRY)&&!this.getTask().IsAfterRetryBeforeBuildXML&&this._task.setLevel(r.Constants.TASK_LEVEL_RECORD);else{switch(T=this.GetTransactionBegin(),p=!0,this._recovery){case E.RECOVERY_ROLLBACK:T===E.TRANS_RECORD_PREFIX?this._task.getMode()!==r.Constants.TASK_MODE_DELETE&&this._task.IsInteractive?(this.getTask().setAfterRetry(E.RECOVERY_ROLLBACK),this.CurrRec.restart(this.CurrRec.getMode()),this.CurrRec.resetModified(),this._original=this.CurrRec.replicate(),this._pendingRecovery="C"):p=!1:T!==E.TRANS_NONE&&(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._pendingRecovery="T",this.getTask().setAfterRetry(E.RECOVERY_ROLLBACK));break;case E.RECOVERY_RETRY:this.RecoveryRetry(T)}p&&(o.eventsManager.setStopExecution(!0),this.getTask().TaskSuffixExecuted=!1)}h.label=18;case 18:return[3,20];case 19:return n==="/"+E.MG_TAG_DATAVIEW?(this._includesFirst&&this._includesLast&&this.isEmpty()&&(this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this.setTopRecIdx(t.Int32.MinValue)),e.setCurrIndex2EndOfTag(),[2,!1]):[2,!1];case 20:return[2,!0]}}))}))},i.prototype.RecoveryRetry=function(e){e===E.TRANS_RECORD_PREFIX?(this._task.setLevel(r.Constants.TASK_LEVEL_RECORD),this.getTask().setTransactionFailed(!0),this.getTask().setAfterRetry(E.RECOVERY_RETRY),this.CurrRec.restart(this.CurrRec.getMode()),this._firstDv||(this.takeFldValsFromCurrRec(),this._pendingRecovery="B")):e!==E.TRANS_NONE&&(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._pendingRecovery="S",this.getTask().setAfterRetry(E.RECOVERY_RETRY),this.getTask().setTransactionFailed(!0))},i.prototype.InsertSingleRecord=function(e){this._recordsTab.InsertedRecordsCount=0,this._recordsTab.InsertRecord(this._insertAt,e),this.UpdateDataviewAfterInsert()},i.prototype.UpdateDataviewAfterInsert=function(){if("B"===this._insertAt){var e=this._recordsTab.InsertedRecordsCount;this._currRecIdx!==t.Int32.MinValue&&(this._currRecIdx+=e),this._topRecIdx!==t.Int32.MinValue&&(this._topRecIdx+=e),this._oldTopRecIdx!==t.Int32.MinValue&&(this._oldTopRecIdx+=e)}},i.prototype.getAttributes=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:if(o=null,l=!1,this._recovery=E.RECOVERY_NONE,!(-1!==(u=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()))&&u<e.getXMLdata().length))return[3,31];s=e.getXMLsubstring(u),e.add2CurrIndex(s.indexOf(E.MG_TAG_DATAVIEW)+E.MG_TAG_DATAVIEW.length),a=r.XmlParser.getTokens(e.getXMLsubstring(u),r.XMLConstants.XML_ATTR_DELIM),this._insertAt=" ",c=this.peekInvalidate(a),this._locateFirstRec=0,_=0,h.label=1;case 1:if(!(_<a.length))return[3,30];switch(T=a.get_Item(_),p=a.get_Item(_+1),T){case E.MG_ATTR_INSERT_AT:return[3,2];case E.MG_ATTR_INCLUDE_FIRST:return[3,3];case E.MG_ATTR_INCLUDE_LAST:return[3,4];case E.MG_ATTR_IS_ONEWAY_KEY:return[3,5];case E.MG_ATTR_DBVIEWSIZE:return[3,6];case E.MG_ATTR_INVALIDATE:return[3,7];case E.MG_ATTR_TOP_REC_ID:return[3,8];case E.MG_ATTR_TASKMODE:return[3,9];case E.MG_ATTR_EMPTY_DATAVIEW:return[3,10];case r.XMLConstants.MG_ATTR_TASKID:return[3,11];case E.MG_ATTR_LOW_ID:return[3,12];case E.MG_ATTR_TRANS_STAT:return[3,13];case E.MG_ATTR_RECOVERY:return[3,20];case E.MG_ATTR_DVPOS_VALUE:return[3,21];case E.MG_ATTR_LOCATE_FIRST_ID:return[3,22];case E.MG_ATTR_OFFSET:return[3,23];case E.MG_ATTR_USER_SORT:return[3,24];case E.MG_ATTR_VAL_TOTAL_RECORDS_COUNT:return[3,25];case E.MG_ATTR_VAL_RECORDS_BEFORE_CURRENT_VIEW:return[3,26];case E.MG_ATTR_VAL_SERVER_TRANS_CACHE_EMPTY:return[3,27]}return[3,28];case 2:return this._insertAt=p[0],[3,29];case 3:return i=r.XmlParser.getBoolean(p),this.SetIncludesFirst(i),[3,29];case 4:return i=r.XmlParser.getBoolean(p),this.SetIncludesLast(i),[3,29];case 5:return i=r.XmlParser.getBoolean(p),this.SetOneWayKey(i),[3,29];case 6:return this.DBViewSize=r.XmlParser.getInt(p),[3,29];case 7:return[3,29];case 8:return this._topRecId=t.NNumber.Parse(p),[3,29];case 9:return(this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_NONE||c)&&this._task.setOriginalTaskMode(p),this._task.setProp(n.PropInterface.PROP_TYPE_TASK_MODE,p),[3,29];case 10:return l=!0,[3,29];case 11:return[3,29];case 12:return this._lastCreatedRecId=t.NNumber.Parse(p),[3,29];case 13:switch(g=p[0],g){case"O":return[3,14];case"C":return[3,16]}return[3,18];case 14:return o=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!0),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(o)];case 15:return h.sent(),[3,19];case 16:return o=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!1),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(o)];case 17:return h.sent(),this.getTask().setTransactionFailed(!1),[3,19];case 18:return[3,19];case 19:return[3,29];case 20:return this._task.IsTryingToStop&&this.getTask().setTryingToStop(!1),this.getTask().resetExecEndTask(),this._recovery=p[0],[3,29];case 21:return this._dvPosValue=t.NNumber.Parse(p),[3,29];case 22:return this._locateFirstRec=t.NNumber.Parse(p),[3,29];case 23:return[3,29];case 24:return this._task.getForm().clearTableColumnSortMark(r.XmlParser.getBoolean(p)),[3,29];case 25:return this.TotalRecordsCount=r.XmlParser.getInt(p),[3,29];case 26:return this.RecordsBeforeCurrentView=r.XmlParser.getInt(p),[3,29];case 27:return this._serverTransCacheEmpty=r.XmlParser.getBoolean(p),[3,29];case 28:return r.Logger.Instance.WriteExceptionToLogWithMsg("Unknown attribute for <"+E.MG_TAG_DATAVIEW+"> tag: "+T),[3,29];case 29:return _+=2,[3,1];case 30:return this.setEmptyDataview(l),e.setCurrIndex(++u),[2,c];case 31:return r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getAttributes(): out of bounds"),[2,!1]}}))}))},i.prototype.SetOneWayKey=function(e){this.IsOneWayKey=e},i.prototype.SetIncludesLast=function(e){this._includesLast=e},i.prototype.SetIncludesFirst=function(e){var t=this._includesFirst;if(this._includesFirst=e,this._includesFirst!==t){var r=this._task.getForm();null!==r&&r.SetTableItemsCount(0,!0)}},i.prototype.fillDataDc=function(e){for(var t=new vt,n=e.getNextTag();null!==n&&n===E.MG_TAG_DC_VALS;){var a=e.getCurrIndex();t.SerializedDCVals=e.ReadToEndOfCurrentElement();var s=t.Build();null!==s?this.AddDcValues(s):r.Logger.Instance.WriteExceptionToLogWithMsg("Error while parsing DC values at position "+a),n=e.getNextTag()}},i.prototype.AddDcValues=function(e){this._dcValsCollection.Add(e.getId().toString(),e)},i.prototype.fillExecStack=function(e){for(var t=e.getNextTag(),r=!1;null!==t&&t===E.MG_TAG_EXEC_STACK_ENTRY;)this.fillInnerExecStack(e),t=e.getNextTag(),r=!0;r&&o.eventsManager.reverseServerExecStack()},i.prototype.fillInnerExecStack=function(e){var t,n,a=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex()),s="",i="",l=0;if(-1!==a&&a<e.getXMLdata().length){var u=e.getXMLsubstring(a);e.add2CurrIndex(u.indexOf(E.MG_TAG_EXEC_STACK_ENTRY)+E.MG_TAG_EXEC_STACK_ENTRY.length),t=r.XmlParser.getTokens(e.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM);for(var c=0;c<t.length;c+=2){n=t.get_Item(c);var _=t.get_Item(c+1);switch(n){case r.XMLConstants.MG_ATTR_TASKID:s=_;break;case E.MG_ATTR_HANDLERID:i=_;break;case E.MG_ATTR_OPER_IDX:l=r.XmlParser.getInt(_)}}o.eventsManager.pushServerExecStack(s,i,l),e.setCurrIndex(a+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fillInnerExecStack() out of bounds")},i.prototype.peekInvalidate=function(e){for(var t=Te.GetCommandsProcessor().GetSessionCounter(),n=0;n<e.length;n+=2){if(e.get_Item(n)===E.MG_ATTR_INVALIDATE){var a=e.get_Item(n+1);if(r.XmlParser.getBoolean(a)){if(!(t<this._lastSessionCounter))return this._lastSessionCounter=t,this.clear(),!0;this._skipParsing=!0}return!1}}return!1},i.prototype.getFieldByName=function(e){return null!==this._fieldsTab?this._fieldsTab.getField(e):(r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getField(String): There is no fieldsTab object"),null)},i.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M=this;return h(this,(function(h){switch(h.label){case 0:return s=this._task.getTaskTag(),i=this._task.getBrkLevelIndex(),l=!1,c=this.getTask().GetContextTask(),_=c.IsOffline?"-99999":c.getTaskTag(),e.Append("\n <"+E.MG_TAG_DATAVIEW+" "+r.XMLConstants.MG_ATTR_TASKID+'="'+s+'"'),e.Append(" "+E.MG_ATTR_TASKLEVEL+'="'+i+'"'),u="0",null!=(T=this.getTask().getTriggeringTask())&&(T.IsOffline?(p=T.getCtlIdx(),g=o.mgDataTable.GetMainProgByCtlIdx(-1,p),u=g.getTaskTag()):u=T.getTaskTag()),this._currRecId>t.Int32.MinValue?(null!=this.CurrRec&&e.Append(" "+E.MG_ATTR_CURR_REC+'="'+this._currRecId+'"'),e.Append(" "+E.MG_ATTR_TASKMODE+'="'+this._task.getMode()+'"'),!this._transCleared||oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI||(e.Append(" "+E.MG_ATTR_TRANS_CLEARED+'="1"'),this._transCleared=!1),e.Append(" "+E.MG_ATTR_INVOKER_ID+'="'+_+","+u+'"'),[4,this.getTask().isCached()]):[3,6];case 1:return h.sent()&&e.Append(" "+E.MG_ATTR_DVPOS_VALUE+'="'+this._dvPosValue+'"'),e.Append(" "+E.MG_ATTR_LOOP_COUNTER+'="'+this.getTask().getLoopCounter()+'"'),this._task.IsSubForm?(d=this._task.getForm().getSubFormCtrl(),(I=!d.isVisible())?[4,d.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,3]):[3,4];case 2:I=!h.sent(),h.label=3;case 3:I&&e.Append(" "+E.MG_ATTR_SUBFORM_VISIBLE+'="0"'),h.label=4;case 4:return this._task.IsInteractive||e.Append(" "+E.MG_ATTR_TASK_COUNTER+'="'+this.getTask().getCounter()+'"'),null!=this._task&&this._task.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()&&(e.Append(" "+E.MG_ATTR_LAST_REC_ID+'="'+this._recordsTab.getRecByIdx(this.getSize()-1).getId()+'"'),e.Append(" "+E.MG_ATTR_OLD_FIRST_REC_ID+'="'+this._recordsTab.getRecByIdx(0).getId()+'"')),this._task.IsInteractive&&null!=(f=this._task.getForm())&&this._recordsTab.getSize()>1&&e.Append(" "+E.MG_ATTR_CURR_REC_POS_IN_FORM+'="'+f.getCurrRecPosInForm()+'"'),e.Append(r.XMLConstants.TAG_CLOSE),(this.getTask().ResetRange||null!=this.getTask().UserRngs)&&(e.Append(r.XMLConstants.START_TAG+E.USER_RANGES),this.getTask().ResetRange&&(e.Append(" "+E.CLEAR_RANGE+'="1"'),this.getTask().ResetRange=!1),null!=this.getTask().UserRngs?(this.getTask().buildXMLForRngs(e,this.getTask().UserRngs,!1),this.getTask().UserRngs.Clear(),this.getTask().UserRngs=null):e.Append(r.XMLConstants.TAG_TERM)),(this.getTask().ResetLocate||null!=this.getTask().UserLocs)&&(e.Append(r.XMLConstants.START_TAG+E.USER_LOCATES),this.getTask().ResetLocate&&(e.Append(" "+E.CLEAR_LOCATES+'="1"'),this.getTask().ResetLocate=!1),null!=this.getTask().UserLocs?(this.getTask().buildXMLForRngs(e,this.getTask().UserLocs,!0),this.getTask().UserLocs.Clear(),this.getTask().UserLocs=null):e.Append(r.XMLConstants.TAG_TERM)),(this.getTask().ResetSort||null!=this.getTask().UserSorts)&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_SORTS),this.getTask().ResetSort&&(e.Append(" "+E.CLEAR_SORTS+'="1"'),this.getTask().ResetSort=!1),null!=this.getTask().UserSorts?this.getTask().buildXMLForSorts(e):e.Append(r.XMLConstants.TAG_TERM)),[4,this.getTask().isCached()];case 5:for(h.sent()&&""!==(C=this.getTask().getTaskCache().getDeletedListToXML())&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_DEL_LIST),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._task.getTaskTag()+'"'),e.Append(" "+E.MG_ATTR_REMOVE+'="'+C+'"'),e.Append(r.XMLConstants.TAG_TERM),this.getTask().getTaskCache().isDeleted(this._dvPosValue)&&this.setChanged(!0),this.getTask().getTaskCache().clearDeletedList()),this._dcValsCollection.Keys.forEach((function(t){(a=M._dcValsCollection.get_Item(t)).HasReferences||(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_DC_VALS),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+a.getId()+'"'),e.Append(" "+E.MG_ATTR_REMOVE+'="1"'),e.Append(r.XMLConstants.TAG_TERM),M._dcValsCollection.Remove(t))})),null!=this.CurrRec&&(l=this.CurrRec.getMode()===n.DataModificationTypes.Delete&&null!=this._modifiedRecordsTab.getRecord(this.CurrRec.getId())&&this.CurrRec.SendToServer),A=!1,null!=this.CurrRec&&null!=this._modifiedRecordsTab.getRecord(this.CurrRec.getId())&&(A=o.eventsManager.isForceExitPreRecordUpdate(this.getTask())),this._modifiedRecordsTab.buildXML(this._fieldsTab,e,A,this.CurrRec.getId()),null!=this._original&&this._original.clearMode(),R=this._modifiedRecordsTab.getSize()-1;R>=0;R--)A&&this._modifiedRecordsTab.getRecByIdx(R).getId()===this.CurrRec.getId()||(this._modifiedRecordsTab.getRecByIdx(R).clearFlagsHistory(),this._modifiedRecordsTab.removeRecord(R));return null==this.CurrRec||l||(S=this._task.isMainProg()&&le.IsSessionReInitializing,this.CurrRec.buildXML(e,!0,S)),[3,7];case 6:e.Append(" "+E.MG_ATTR_INVOKER_ID+'="'+_+","+u+'"'+r.XMLConstants.TAG_CLOSE),h.label=7;case 7:return e.Append("\n </"+E.MG_TAG_DATAVIEW+r.XMLConstants.TAG_CLOSE),[2]}}))}))},i.prototype.getCurrRec=function(){return null===this.CurrRec&&this._currRecId>t.Int32.MinValue&&r.Logger.Instance.WriteExceptionToLogWithMsg("DataView.getCurrRec(): record "+this._currRecId+" not found"),this.CurrRec},i.prototype.getPrevCurrRec=function(){return this._prevCurrRec},i.prototype.getOriginalRec=function(){return null===this._original||this._original.getId()!==this.CurrRec.getId()?this.CurrRec:this._original},i.prototype.setCurrRec=function(e,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return n=this._currRecId,e>t.Int32.MinValue?-1!==(a=this._recordsTab.getRecIdx(e))?[3,1]:(this._original=null,[3,4]):[3,5];case 1:return o.trys.push([1,3,,4]),s=this._currRecId===t.Int32.MinValue,[4,this.setCurrRecByIdx(a,!s,s,r,t.Int32.MinValue)];case 2:return o.sent(),e!==n&&this.saveOriginal(),[2,!0];case 3:if(!((i=o.sent())instanceof mt))throw i;return[3,4];case 4:return[3,6];case 5:this.CurrRec=null,this._original=null,this._currRecId=t.Int32.MinValue,o.label=6;case 6:return[2,!1]}}))}))},i.prototype.setCurrRecByIdx=function(s,i,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,I,f,C,A,R,S;return h(this,(function(h){switch(h.label){case 0:if(_=this._recordsTab.getSize()-1,g=!1,s!==r.Constants.MG_DATAVIEW_FIRST_RECORD)return[3,5];if(this.getTask().isTableWithAbsolutesScrollbar()&&(this.RecordsBeforeCurrentView=0),!this._includesFirst)return[3,1];if(!(this._currRecIdx>=0||this._currRecIdx===t.Int32.MinValue))throw new mt(e.RecordOutOfDataViewException_ExceptionType.TOP);return s=0,g=!0,[3,4];case 1:return[4,this.fetchChunkFromServer("T",i)];case 2:return h.sent(),[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 3:return h.sent(),[2];case 4:return[3,24];case 5:if(s!==r.Constants.MG_DATAVIEW_LAST_RECORD)return[3,13];if(!this._includesLast)return[3,6];if(!(this._currRecIdx<=_))throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);return s=_,g=!0,[3,12];case 6:return this.getTask().isTableWithAbsolutesScrollbar()&&(this.RecordsBeforeCurrentView=this.TotalRecordsCount),[4,this.fetchChunkFromServer("B",i)];case 7:if(h.sent(),!this._includesLast)throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);if(null==(d=this._task.getForm()))return[3,10];h.label=8;case 8:return!this._includesFirst&&d.getRowsInPage()>=this.getSize()?[4,this.fetchChunkFromServer(bt,!1)]:[3,10];case 9:return h.sent(),[3,8];case 10:return[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 11:return h.sent(),[2];case 12:return[3,24];case 13:if(!(s<0))return[3,21];if(this._includesFirst)throw new mt(e.RecordOutOfDataViewException_ExceptionType.TOP);return T=this._recordsTab.getRecByIdx(0),this._recordsTab.getSize()>0||this.IncludesLast()?[4,this.fetchChunkFromServer(bt,i)]:[3,15];case 14:return h.sent(),[3,18];case 15:return 0===this._recordsTab.getSize()&&this.IncludesFirst()?[4,this.fetchChunkFromServer("T",i)]:[3,17];case 16:return h.sent(),[3,18];case 17:r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fetchChunkFromServer() wrong option"),h.label=18;case 18:return 0===(I=null!=T?this._recordsTab.getRecIdx(T.getId()):this._recordsTab.getSize())?[3,20]:[4,this.setCurrRecByIdx(I+s,!1,l,u,Lt)];case 19:h.sent(),h.label=20;case 20:return[2];case 21:if(!(s>_))return[3,24];if(this._includesLast)throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);return this.getForm().isRowCreated(s)&&this.getForm().markRowNOTCreated(s),[4,this.fetchChunkFromServer("N",i)];case 22:return h.sent(),[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 23:return h.sent(),[2];case 24:return f=!1,C=a.isNullOrUndefined(o.eventsManager.getLastRtEvent())?0:o.eventsManager.getLastRtEvent().getInternalCode(),s>=0&&!this.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)&&C===r.InternalInterface.MG_ACT_CRELINE_ABOVE&&this.getTask().getInCreateLine()&&s==this._currRecIdx&&this._recordsTab.getRecByIdx(s).getMode()==n.DataModificationTypes.Insert&&(f=!0),g||f||s!==this._currRecIdx||l&&u?l||!i||null==this.CurrRec?[3,30]:(A=this._recordsTab.getSize(),(p=this._recordsTab.getRecByIdx(s)).isNewRec()?(R=this._task.getMode()!==r.Constants.TASK_MODE_CREATE)?[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)]:[3,26]:[3,27]):[3,32];case 25:R=!h.sent(),h.label=26;case 26:R&&o.eventsManager.setStopExecution(!0),h.label=27;case 27:return o.eventsManager.GetStopExecutionFlag()?[3,29]:(S=0,this._topRecIdxModified&&(S=this.getTopRecIdx(),this.restoreTopRecIdx()),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]);case 28:h.sent(),this._topRecIdxModified&&this.setTopRecIdx(S),h.label=29;case 29:if(o.eventsManager.GetStopExecutionFlag())throw new mt(e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);if(p!==this.CurrRec&&this.getTask().getAfterRetry()&&this._task.setLevel(r.Constants.TASK_LEVEL_TASK),A-1===this._recordsTab.getSize()&&this._currRecIdx<s&&s--,s===this._currRecIdx)return this._task.getMode()!==r.Constants.TASK_MODE_CREATE||this.CurrRec.isNewRec()||this._task.getForm().inRefreshDisplay()||this._task.setMode(r.Constants.TASK_MODE_MODIFY),[2];h.label=30;case 30:if(this.CurrRec=this._recordsTab.getRecByIdx(s),null==this.CurrRec)throw new t.ApplicationException("in DataView.setCurrRecByIdx() current record not found!");return this._currRecId=this.CurrRec.getId(),this._currRecIdx=s,null!=this._task.getForm()&&(c===Lt?this._task.getForm().updateDisplayLineByDV():this._task.getForm().DisplayLine=c),this._task.getMode()!==r.Constants.TASK_MODE_CREATE||this.CurrRec.isNewRec()||this._task.getForm().inRefreshDisplay()||this._task.setMode(r.Constants.TASK_MODE_MODIFY),u?[4,this.currRecCompute(!1)]:[3,32];case 31:h.sent(),h.label=32;case 32:return[2]}}))}))},i.prototype.currRecCompute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this._fieldsTab.invalidate(!1,!0),[4,this.compute(!1,e)];case 1:return t.sent(),[2]}}))}))},i.prototype.saveOriginal=function(){this.CurrRec.Modified||(this._original=this.CurrRec.replicate())},i.prototype.fetchChunkFromServer=function(t,n){return T(this,void 0,void 0,(function(){var a,s,i;return h(this,(function(l){switch(l.label){case 0:return this._task.getForm().FormRefreshed=!0,n&&null!=this.CurrRec?[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,2];case 1:if(l.sent(),o.eventsManager.GetStopExecutionFlag()||this._task.isAborting())throw new mt(e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);this._task.getForm().setSuffixDone(),l.label=2;case 2:switch(s=this._currRecId,t){case"T":a=r.InternalInterface.MG_ACT_DATAVIEW_TOP;break;case"B":a=r.InternalInterface.MG_ACT_DATAVIEW_BOTTOM;break;case bt:s=null==this.FirstRecord?0:this.FirstRecord.getId(),a=r.InternalInterface.MG_ACT_CACHE_PREV;break;case"N":a=r.InternalInterface.MG_ACT_CACHE_NEXT,s=null==this.LastRecord?0:this.LastRecord.getId();break;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fetchChunkFromServer() unknown chunk id: "+t),[2]}return(i=Qe.CreateEventCommand(this._task.getTaskTag(),a)).ClientRecId=s,[4,this.getTask().DataviewManager.Execute(i)];case 3:return l.sent(),[2]}}))}))},i.prototype.FetchRecordsAheadFromServer=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._includesLast?[3,2]:[4,this.fetchChunkFromServer("N",!1)];case 1:return e.sent(),[3,4];case 2:return this._includesFirst?[3,4]:[4,this.fetchChunkFromServer(bt,!1)];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))},i.prototype.recExists=function(e){var t=this._recordsTab.getSize()-1;return e>=0&&e<=t},i.prototype.checkFirst=function(e){return null!==this._recordsTab.getRecord(e)},i.prototype.getCurrRecIdx=function(){return this._currRecIdx===t.Int32.MinValue&&(this.setCurrRec(this._currRecId,!0)||r.Logger.Instance.WriteWarningToLogWithMsg("DataView.getCurrRecIdx(): _task "+this.getTask().PreviouslyActiveTaskId+", record "+this._currRecId+" not found")),this._currRecIdx},i.prototype.getCurrDBViewRowIdx=function(){return this.CurrRec.getDBViewRowIdx()},i.prototype.setTopRecIdx=function(e){this._oldTopRecIdx=this.getTopRecIdx(),this._topRecIdx=e},i.prototype.getTopRecIdx=function(){return this._topRecIdx},i.prototype.setTopRecIdxModified=function(e){this._topRecIdxModified=e},i.prototype.getChunkSize=function(){return this._chunkSize},i.prototype.restoreTopRecIdx=function(){this._topRecIdx=this._oldTopRecIdx},i.prototype.clear=function(){this._recordsTab.removeAll(),this._original=null,null!==this._task.getForm()&&this._task.getForm().SetTableItemsCount(0,!0),this._modifiedRecordsTab.removeAll(),this.init()},i.prototype.init=function(){this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this._prevCurrRec=null,this._includesFirst=!1,this._includesLast=!1,this.IsOneWayKey=!1,this.setTopRecIdx(t.Int32.MinValue),this._fieldsTab.invalidate(!1,!0)},i.prototype.computeSubForms=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getTask().prepareCache(!0)];case 1:return e.sent()?[4,this.getTask().testAndSet(!0)]:[3,5];case 2:return e.sent()?[3,4]:[4,this.compute(!0,!1)];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,this.compute(!0,!1)];case 6:e.sent(),e.label=7;case 7:return[2]}}))}))},i.prototype.compute=function(e,t){var n=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}}});return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:a=null,s=!this.computeByClient(),i=this._computeBy,t&&(this._computeBy="C"),h.label=1;case 1:return h.trys.push([1,,8,9]),this.CurrRec.setInCompute(!0),e||(this.CurrRec.isNewRec()?this._task.getMode()===r.Constants.TASK_MODE_CREATE||n.isEmptyDataview.call(this)||this._task.setMode(r.Constants.TASK_MODE_CREATE):this._task.getMode()===r.Constants.TASK_MODE_CREATE&&this._task.setMode(r.Constants.TASK_MODE_MODIFY)),o=s,e||o&&!this.CurrRec.isComputed()&&!t?(l=Qe.CreateComputeEventCommand(this._task.getTaskTag(),e,this._currRecId),[4,this._task.DataviewManager.Execute(l)]):[3,3];case 2:return h.sent(),[3,7];case 3:o&&((a=new gt(this.CurrRec.getId(),this)).Initialize(),a.setInitialFldVals(!0,!0)),this._fieldsTab.setServerRcmp(!1),u=this._fieldsTab.getRMIdx(),c=this._fieldsTab.getRMSize(),_=u,h.label=4;case 4:if(!(_<u+c))return[3,7];if(T=this._fieldsTab.getField(_),o&&this._fieldsTab.serverRcmpDone()&&T.IsVirtual&&!T.VirAsReal&&!T.hasInitExp()){p=this.CurrRec,this.CurrRec=a;try{T.takeValFromRec()}finally{this.CurrRec=p}}return this._task.getForm().TransferringDataToGUI?[3,6]:[4,T.compute(!1)];case 5:h.sent(),h.label=6;case 6:return _+=1,[3,4];case 7:return[3,9];case 8:return this.CurrRec.setInCompute(!1),this.CurrRec.setLateCompute(!1),this._computeBy=i,[7];case 9:return[2]}}))}))},i.prototype.addRecord=function(e,t,r){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=--this._lastCreatedRecId,s=n.DataModificationTypes.Insert,[4,this.addRecord_1(e,t,!1,a,s,r)];case 1:return[2,i.sent()]}}))}))},i.prototype.addRecord_1=function(e,n,a,s,i,l){return T(this,void 0,void 0,(function(){var u,c,_,T;return h(this,(function(h){switch(h.label){case 0:(u=new gt(s,this)).Initialize(),u.setInitialFldVals(!1,!a),c=0,c=l?this._currRecIdx>=0?this._currRecIdx:0:this._currRecIdx!=t.Int32.MinValue?this._currRecIdx+1:0,this._recordsTab.insertRecord(u,c),u.setMode(i),h.label=1;case 1:return h.trys.push([1,3,,4]),_=!a,[4,this.setCurrRecByIdx(c,e,n,_,t.Int32.MinValue)];case 2:return h.sent(),a&&this.getTask().getMode()!==r.Constants.TASK_MODE_CREATE&&u.setOldRec(),[3,4];case 3:if(!((T=h.sent())instanceof mt))throw T;if(!o.eventsManager.GetStopExecutionFlag())throw new t.ApplicationException("in DataView.addRecord() invalid exception");return c=-1,[3,4];case 4:return[2,c]}}))}))},i.prototype.removeCurrRec=function(){var e=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}}});return T(this,void 0,void 0,(function(){var t,r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return t=this._task.getForm(),this.CurrRec.getMode()!==n.DataModificationTypes.Insert||this.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)?(this.CurrRec.clearMode(),this.CurrRec.setMode(n.DataModificationTypes.Delete),r=!0):(this._modifiedRecordsTab.removeRecord(this.CurrRec),r=!1),this.CurrRec.removeRecFromDc(),this._recordsTab.removeRecord(this._currRecIdx),this.setChanged(!0),!this.isEmpty()||this._task.IsTryingToStop?[3,2]:[4,this.MoveToEmptyDataviewIfAllowed()];case 1:o.sent(),o.label=2;case 2:a=this.calcLineToMove(r),o.label=3;case 3:return o.trys.push([3,8,,18]),t.isScreenMode()?[4,this.setCurrRecByIdx(a,!1,!1,!0,Lt)]:[3,5];case 4:return o.sent(),[3,7];case 5:return[4,t.setCurrRowByDisplayLine(a,!1,!0)];case 6:o.sent(),o.label=7;case 7:return[3,18];case 8:if(!((s=o.sent())instanceof mt))return[3,16];o.label=9;case 9:return o.trys.push([9,14,,15]),e.isEmptyDataview.call(this)||(a=t.getPrevLine(a)),t.isScreenMode()?[4,this.setCurrRecByIdx(a,!1,!1,!0,Lt)]:[3,11];case 10:return o.sent(),[3,13];case 11:return[4,t.setCurrRowByDisplayLine(a,!1,!0)];case 12:o.sent(),o.label=13;case 13:return[3,15];case 14:if(!((i=o.sent())instanceof mt))throw i;return this.reset(),[3,15];case 15:return[3,17];case 16:throw s;case 17:return[3,18];case 18:return[2]}}))}))},i.prototype.RemoveRecord=function(e){var t=this._recordsTab.getRecIdx(e.getId());this._topRecIdx>t&&this._topRecIdx--,this._oldTopRecIdx>t&&this._oldTopRecIdx--,this._currRecIdx>t&&this._currRecIdx--,this._recordsTab.removeRecord(e)},i.prototype.MoveToEmptyDataviewIfAllowed=function(){var e=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}},setEmptyDataview:{get:function(){return s.prototype.setEmptyDataview}}});return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return e.isEmptyDataview.call(this)||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,2]:[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW,!0)];case 1:return t.sent()&&e.setEmptyDataview.call(this,!0),[3,3];case 2:this._task.getMode()===r.Constants.TASK_MODE_CREATE&&e.isEmptyDataview.call(this)&&e.setEmptyDataview.call(this,!1),t.label=3;case 3:return[2]}}))}))},i.prototype.calcLineToMove=function(e){return e?this._currRecIdx:this._currRecIdx>0?this._currRecIdx-1:this._currRecIdx},i.prototype.reset=function(){this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this.setTopRecIdx(t.Int32.MinValue),this.SetIncludesFirst(!0),this.SetIncludesLast(!0)},i.prototype.cancelEdit=function(e,t){return T(this,void 0,void 0,(function(){var r,a,s;return h(this,(function(i){switch(i.label){case 0:return r=null,a=!1,this._task.InEndTask&&(e=!0),this.CurrRec.getMode()===n.DataModificationTypes.Insert&&this.CurrRec.isNewRec()?this._includesFirst&&this._includesLast&&(null===this._recordsTab||1===this._recordsTab.getSize())||!this.HasMainTable?(null!==this._original&&this.CurrRec.setSameAs(this._original,e),[3,3]):[3,1]:[3,4];case 1:return[4,this.removeCurrRec()];case 2:i.sent(),a=!0,this._original=this.CurrRec.replicate(),i.label=3;case 3:return[3,7];case 4:return this.CurrRec.Modified||null!==(s=this._task.getLastParkedCtrl())&&s.resetPrevVal(),t&&(r=this.CurrRec.replicate()),null!==this._original&&this.CurrRec.setSameAs(this._original,e),null===this._original||!t||this.CurrRec.isSameRecData(r,!1,!1)?[3,6]:[4,this.execUnknownRcmps(this._original)];case 5:i.sent(),i.label=6;case 6:this.takeFldValsFromCurrRec(),this._original=this.CurrRec.replicate(),i.label=7;case 7:return[2,a]}}))}))},i.prototype.isEmpty=function(){return this._includesFirst&&this._includesLast&&(null===this._recordsTab||0===this._recordsTab.getSize())},i.prototype.addCurrToModified=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return a.isNullOrUndefined(e)?[4,this.addCurrToModified_0()]:[3,2];case 1:case 3:return t.sent(),[2];case 2:return[4,this.addCurrToModified_1(e)]}}))}))},i.prototype.addCurrToModified_0=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.addCurrToModified(!0)];case 1:return e.sent(),[2]}}))}))},i.prototype.addCurrToModified_1=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return this._modifiedRecordsTab.addRecord(this.CurrRec),e&&this.CurrRec.setOldRec(),t=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!0),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(t)];case 1:return r.sent(),[2]}}))}))},i.prototype.takeFldValsFromCurrRec=function(){this._fieldsTab.takeValsFromRec()},i.prototype.currEqualsPrev=function(e){if(null!==this.CurrRec&&null!==this._prevCurrRec){if(this.CurrRec===this._prevCurrRec)return!0;for(var t=0;t<e.length;t+=1)if(!this.CurrRec.fldValsEqual(this._prevCurrRec,e[t]))return!1}else if(this.CurrRec!==this._prevCurrRec)return!1;return!0},i.prototype.getTask=function(){return t.Debug.Assert(this._task instanceof b),this._task},i.prototype.getForm=function(){return this._task.getForm()},i.prototype.modifiedRecordsNumber=function(){return this._modifiedRecordsTab.getSize()},i.prototype.getSize=function(){return this._recordsTab.getSize()},i.prototype.computeByClient=function(){return"C"===this._computeBy},i.prototype.recExistsById=function(e){return null!==this._recordsTab.getRecord(e)},i.prototype.ParametersExist=function(e,t){return 2===arguments.length?this.ParametersExist_0(e,t):this.ParametersExist_1()},i.prototype.ParametersExist_0=function(e,t){for(var r=e;r<e+t;r+=1)if(s.prototype.getField.call(this,r).isParam())return!0;return!1},i.prototype.ParametersExist_1=function(){return this.ParametersExist(this._rmIdx,this._rmSize)},i.prototype.recInModifiedTab=function(e){return null!==this._modifiedRecordsTab.getRecord(e)},i.prototype.setPrevCurrRec=function(e){0!==arguments.length?this.setPrevCurrRec_1(e):this.setPrevCurrRec_0()},i.prototype.setPrevCurrRec_0=function(){this._prevCurrRec=this.CurrRec},i.prototype.setPrevCurrRec_1=function(e){this._prevCurrRec=e},i.prototype.isPrevCurrRecNull=function(){return null===this._prevCurrRec},i.prototype.execUnknownRcmps=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:if(r=this._fieldsTab.getRMIdx(),n=this._fieldsTab.getRMSize(),a=this.getCurrRec(),"M"===this._unknownRcmp)for(t=r;t<r+n&&"M"===this._unknownRcmp;t++)(s=this._fieldsTab.getField(t)).IsVirtual&&!s.hasInitExp()&&s.isServerRcmp()&&(this._unknownRcmp="Y");if("Y"!==this._unknownRcmp||null===a)return[3,4];t=r,l.label=1;case 1:return t<r+n?!(s=this._fieldsTab.getField(t)).IsVirtual||s.hasInitExp()||!s.isServerRcmp()||a.fldValsEqual(e,t)?[3,3]:(i=a.GetFieldValue(t),o=a.IsNull(t),a.setFieldValue(t,e.GetFieldValue(t),!1),[4,s.setValueAndStartRecompute(i,o,!1,!1,!1)]):[3,4];case 2:l.sent(),l.label=3;case 3:return t+=1,[3,1];case 4:return[2]}}))}))},i.prototype.setTransCleared=function(){this._transCleared=!0},i.prototype.processRecovery=function(){return T(this,void 0,void 0,(function(){var t,a,s,i;return h(this,(function(l){switch(l.label){case 0:if(this._task.isAborting())return[3,12];switch(t=this._pendingRecovery,a=o.eventsManager.GetStopExecutionFlag(),this._pendingRecovery="N",a&&o.eventsManager.setStopExecution(!1),(s=this._task.InCtrlPrefix)&&(this._task.InCtrlPrefix=!1),t){case"C":return[3,1];case"B":return[3,3];case"S":return[3,6];case"T":return[3,8]}return[3,10];case 1:return this._task.DataView.getCurrRec().resetUpdated(),this.getTask().getTaskCache().clearCache(),1===this.getSize()&&this._task.getMode()===r.Constants.TASK_MODE_CREATE&&(this.CurrRec.resetModified(),this.CurrRec.clearMode(),this.CurrRec.setMode(n.DataModificationTypes.Insert),this.CurrRec.setNewRec(),this._original.setSameAs(this.CurrRec,!1)),[4,o.eventsManager.handleInternalEventWithTaskAndEventSubtype(this.getTask(),r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelWithNoRollback)];case 2:return l.sent(),[3,11];case 3:return null===(i=this._task.getLastParkedCtrl())?[3,5]:[4,i.invoke()];case 4:l.sent(),l.label=5;case 5:return[3,11];case 6:return this.getTask().setPreventRecordSuffix(!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_TBL_BEGPAGE)];case 7:return l.sent(),this.getTask().setPreventRecordSuffix(!1),[3,11];case 8:return this._task.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_TBL_BEGTBL)];case 9:return l.sent(),this.getTask().getTaskCache().clearCache(),[3,11];case 10:return o.eventsManager.setStopExecution(a),[3,11];case 11:s&&(this._task.InCtrlPrefix=!0),"N"!==t&&o.eventsManager.setStopExecution(!0,"T"!==t),l.label=12;case 12:return[2]}}))}))},i.prototype.replicate=function(){var e=new i(this);return e._recordsTab=this._recordsTab.replicate(),e._currRecId=e._recordsTab.getRecByIdx(0).getId(),e._currRecIdx=0,e.CurrRec=e._recordsTab.getRecByIdx(0),e._prevCurrRec=e._recordsTab.getRecByIdx(0),e._original=e._recordsTab.getRecByIdx(0),e.setTopRecIdx(t.Int32.MinValue),e},i.prototype.getDvPosValue=function(){return this._dvPosValue},i.prototype.getFirstDv=function(){return this._firstDv},i.prototype.ResetFirstDv=function(){this._firstDv=!1},i.prototype.getCacheLRU=function(){return this._cacheLruTimeStamp},i.prototype.setCacheLRU=function(){this._cacheLruTimeStamp=r.Misc.getSystemMilliseconds()},i.prototype.setSameAs=function(e){var n=Object.create(null,{setEmptyDataview:{get:function(){return s.prototype.setEmptyDataview}}});return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:this._rmSize=e._rmSize,this._rmIdx=e._rmIdx,this._computeBy=e._computeBy,this._flushUpdates=e._flushUpdates,this._currRecId=e._currRecId,this._currRecIdx=e._currRecIdx,this._topRecId=e._topRecId,this.CurrRec=e.CurrRec,this._original=e._original,this._prevCurrRec=null,this._fieldsTab=e._fieldsTab,this._recordsTab=e._recordsTab,this._modifiedRecordsTab=e._modifiedRecordsTab,this._includesFirst=e._includesFirst,this._includesLast=e._includesLast,this._insertAt=e._insertAt,this._lastCreatedRecId=e._lastCreatedRecId,this._task=e._task,this._dcValsCollection=e._dcValsCollection,this._recovery=e._recovery,this._pendingRecovery=e._pendingRecovery,this._hasMainTable=e._hasMainTable,this._chunkSize=e._chunkSize,this._firstDv=e._firstDv,this._lastSessionCounter=e._lastSessionCounter,this._skipParsing=e._skipParsing,this._unknownRcmp=e._unknownRcmp,this._transCleared=e._transCleared,this._dvPosValue=e._dvPosValue,this._cacheLruTimeStamp=e._cacheLruTimeStamp,this._changed=e._changed,this._locateFirstRec=e._locateFirstRec,n.setEmptyDataview.call(this,e.isEmptyDataview()),this._task.setMode(e.taskModeFromCache),s.label=1;case 1:return s.trys.push([1,8,,9]),this.getTask().HasLoacte()?[4,this.setCurrRec(this._locateFirstRec,!0)]:[3,3];case 2:return s.sent(),this.setTopRecIdx(this._recordsTab.getRecIdx(this._locateFirstRec)),[3,5];case 3:return this.getTask().setPreventRecordSuffix(!0),[4,this.setCurrRecByIdx(t.Int32.MinValue,!0,!1,!0,t.Int32.MinValue)];case 4:s.sent(),this.getTask().setPreventRecordSuffix(!1),this.setTopRecIdx(0),s.label=5;case 5:return this._task.getForm().isScreenMode()?[3,7]:(this._task.getForm().isTableWithPagination()&&(this.TotalRecordsCount=e.TotalRecordsCount,this.RecordsBeforeCurrentView=e.RecordsBeforeCurrentView),[4,this.setCurrRecByIdx(this._topRecIdx,!0,!1,!0,t.Int32.MinValue)]);case 6:s.sent(),s.label=7;case 7:return null!==this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,9];case 8:if(!((a=s.sent())instanceof mt))throw a;return r.Logger.Instance.WriteDevToLog("wrong top record idx in DataView.setSameAs"+a.Message),[3,9];case 9:return[2]}}))}))},i.prototype.setChanged=function(e){this._changed=e},i.prototype.getChanged=function(){return this._changed},i.prototype.getLocateFirstRec=function(){return this._locateFirstRec},i.prototype.setLocateFirstRec=function(e){this._locateFirstRec=e},i.prototype.getRecByIdx=function(e){return this._recordsTab.getRecByIdx(e)},i.prototype.getServerCurrRec=function(){return this._recordsTab.getServerCurrRec()},i.prototype.zeroServerCurrRec=function(){this._recordsTab.zeroServerCurrRec()},i.prototype.inRollback=function(){var e=!1;return this._recovery===E.RECOVERY_ROLLBACK&&this.getTask().isTransactionOwner()&&(e=!0),e},i.prototype.getRecIdx=function(e){return this._recordsTab.getRecIdx(e)},i.prototype.backupCurrent=function(){return this.CurrRec.replicate()},i.prototype.restoreCurrent=function(e){t.Debug.Assert(null!==e),this._currRecId=e.getId(),this._currRecIdx=this._recordsTab.getRecIdx(this._currRecId),this.CurrRec=this._recordsTab.getRecByIdx(this._currRecIdx),this.CurrRec.setSameAs(e,!1),this.takeFldValsFromCurrRec()},i.prototype.GetRecordById=function(e){return this._recordsTab.getRecord(e)},i.prototype.GetModifiedRecord=function(){var e=null;return this._modifiedRecordsTab.getSize()>0&&(t.Debug.Assert(1===this._modifiedRecordsTab.getSize()),e=this._modifiedRecordsTab.getRecByIdx(0)),e},i.prototype.GetCurrentRecId=function(){return this._currRecId},i.prototype.DataviewBoundriesAreChanged=function(e,t){return e!==this.IncludesFirst()||t!==this.IncludesLast()},i.prototype.GetRecordMainIdx=function(){return this._rmIdx},i.prototype.GetRecordMainSize=function(){return this._rmSize},i.prototype.GetRouteParams=function(){for(var e=new t.List,a=0;a<this._fieldsTab.getSize();a++){var s=this._fieldsTab.getField(a),i=void 0;if(s.IsExposedRouteParam&&!s.isNull())switch(s.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:i=s.getDispValue(),s.isNull()&&(i=s.getNullDisplay()),i=i.trim(),e.push(0===i.length?" ":i);break;case r.StorageAttribute.BOOLEAN:s.isNull()?e.push(!1):e.push("1"===s.getDispValue().charAt(0));break;case r.StorageAttribute.NUMERIC:i=s.getDispValue(),s.isNull()&&(i=s.getNullDisplay());var o=new n.PIC(s.getPicture(),s.getType(),this.getTask().getCompIdx());i=n.DisplayConvertor.Instance.mg2disp(i,"",o,!0,0,!1),e.push(i)}}return e.length>0?e:null},i}(pt),Ot=function(){function e(e){this._cacheTable=null,this._deletedList=null,this._task=null,this._cacheSize=0,this._recordsBeforeCurrentView=0,this._totalRecordsCount=0,this._task=e,this._cacheTable=new t.Hashtable(100,.7),this._deletedList=new t.List,this._cacheSize=0}return e.prototype.putInCache=function(e){var t=e.getDvPosValue(),r=e.getSize()*e.getCurrRec().getRecSize();return null!==this._cacheTable.get_Item(t)&&this.removeDvFromCache(t,!1),e.setCacheLRU(),e.taskModeFromCache=this._task.getMode(),e.zeroServerCurrRec(),this._cacheTable.set_Item(t,e),this._deletedList.Remove(t),this._cacheSize+=r,this._recordsBeforeCurrentView=e.RecordsBeforeCurrentView,this._totalRecordsCount=e.TotalRecordsCount,!0},e.prototype.removeDvFromCache=function(e,t){var r=this._cacheTable.get_Item(e);return null!==r&&(this._cacheSize-=r.getSize()*r.getCurrRec().getRecSize(),t&&this._deletedList.push(e),this._cacheTable.Remove(e),!0)},e.prototype.getDeletedListToXML=function(){for(var e="",t=0;t<this._deletedList.length;t++)t>0&&(e+=","),e+=this._deletedList.get_Item(t).toString();return e},e.prototype.clearDeletedList=function(){this._deletedList.Clear()},e.prototype.getCachedDataView=function(e){var t=this._cacheTable.get_Item(e);return null!==t&&(t=t.replicate()),t},e.prototype.getLastUsedDv=function(){for(var e=r.Misc.getSystemMilliseconds(),t=-1,n=-1,a=this._cacheTable.Keys;a.MoveNext();){var s=this._cacheTable.get_Item(a.Current),i=e-s.getCacheLRU();i>t&&(t=i,n=s.getDvPosValue())}return n},e.prototype.clearCache=function(){for(var e=new t.List(this._cacheTable.Keys),r=0;r<e.length;r++){var n=e[r];this.removeDvFromCache(n,!0)}if(this._task.hasSubTasks())for(var a=this._task.getSubTasks(),s=0;s<a.getSize();s+=1)a.getTask(s).getTaskCache().clearCache();this._task.DataView.setChanged(!0)},e.prototype.isDeleted=function(e){return this._deletedList.Contains(e)},e}(),Gt=function(){function e(e){this.InnerResult=null,1===arguments.length?this.constructor_0(e):this.constructor_1()}return e.prototype.constructor_0=function(e){this.InnerResult=e},e.prototype.constructor_1=function(){},e.ErroNeedToBeHandled=function(){return!1},e}(),Pt=function(e){function t(t,r){var n=e.call(this)||this;return n.errorDescription=null,n.success=!1,n.ErrorId=null,1!==arguments.length||null!==t&&t.constructor!==String?0===arguments.length?n.constructor_01():2===arguments.length?n.constructor_02(t,r):n.constructor_03(t):n.constructor_00(t),n}return u(t,e),Object.defineProperty(t.prototype,"Success",{get:function(){return this.success},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ErrorDescription",{get:function(){return this.errorDescription},enumerable:!1,configurable:!0}),t.prototype.constructor_00=function(e){this.success=!1,this.ErrorId=e,this.errorDescription=pe.Instance.getConstMessage(e)},t.prototype.constructor_01=function(){this.success=!0,this.ErrorId=""},t.prototype.constructor_02=function(e,t){this.success=!1,this.errorDescription=e},t.prototype.constructor_03=function(e){this.success=e.Success,this.errorDescription=e.ErrorDescription},t.prototype.GetErrorId=function(){return this.ErrorId},t}(Gt);Pt.SuccessfulResult=new Pt;var Dt=function(){function e(){}return e.CreateFirstRecord=function(e){e.AfterFirstRecordPrefix=!0},e.prototype.PrepareTask=function(e){return Pt.SuccessfulResult},e.PreparePropOpenTaskWindow=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(a){switch(a.label){case 0:return t=e.getProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW),r=!1,e.isMainProg()&&0!==e.getCtlIdx()?[3,2]:[4,t.getValueBoolean()];case 1:r=a.sent(),a.label=2;case 2:return e.SetOpenWin(r),[2]}}))}))},e.Exit=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,e.Exit(t,r)];case 1:return n.sent(),[2]}}))}))},e.prototype.GetOwnerTransactionTask=function(e){return null},e}(),kt=function(){function e(e,t,r){this._transId=null,this._afterTransRetry=E.RECOVERY_NONE,this._transBegin="\0",this.Opened=!1,this.OwnerTask=null,this.LocalTransactionId=0,this.OwnerTask=e,this._transId=t,this._transBegin=E.TRANS_TASK_PREFIX}return e.prototype.isOwner=function(e){return e===this.OwnerTask},e.prototype.close=function(){this.Opened=!1},e.prototype.open=function(){this.Opened=!0},e.prototype.isOpened=function(){return this.Opened},e.prototype.setAfterRetry=function(e){this._afterTransRetry=e},e.prototype.getAfterRetry=function(e){return 0===arguments.length?this.getAfterRetry_0():this.getAfterRetry_1(e)},e.prototype.getAfterRetry_0=function(){return this._afterTransRetry!==E.RECOVERY_NONE},e.prototype.getAfterRetry_1=function(e){return this._afterTransRetry===e},e.prototype.getLevel=function(){return this._transBegin},e.prototype.setTransBegin=function(e){this._transBegin=e},e.prototype.getTransId=function(){return this._transId},e.prototype.setOwnerTask=function(e){this.OwnerTask=e},e}(),xt=function(){function r(e){this.task=null,this.task=e}return Object.defineProperty(r.prototype,"isClosingTopmostTask",{get:function(){return oe.Instance.StartupMgData.getFirstTask().InEndTask},enumerable:!1,configurable:!0}),r.prototype.AllowTransaction=function(e,t){return t?e===E.TRANS_TASK_PREFIX||e===E.TRANS_RECORD_PREFIX:e===E.TRANS_TASK_PREFIX||e===E.TRANS_RECORD_PREFIX||e===E.TRANS_NONE},r.prototype.PrepareTransactionProperties=function(e,t){var r=this.GetTransactionBeginValue(t);null!==e&&this.AllowTransaction(r,t)&&e.setTransBegin(r)},r.prototype.GetTransactionBeginValue=function(e){var t=E.TRANS_NONE,r=this.task.getProp(n.PropInterface.PROP_TYPE_TRASACTION_BEGIN);if(null!==r){var a=e?r.StudioValue:r.GetComputedValue();null!==a&&(t=a.charAt(0))}return t},r.prototype.checkAndCommit=function(r,n,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return s=a?E.TRANS_ABORT:E.TRANS_COMMIT,[4,this.ExecuteLocalUpdatesCommand()];case 1:return(i=u.sent()).Success?(o=new t.RefParam(i),[4,this.checkAndCommitPerDataview(this.task.DataviewManager.RemoteDataviewManager,r,n,s,o)]):(this.task.IsInteractive||this.task.abort(),[2,!1]);case 2:if(l=u.sent(),i=o.value,l)return[3,6];if(!(n===E.TRANS_RECORD_PREFIX&&this.task.DataView.modifiedRecordsNumber()>0&&this.task.DataView.FlushUpdates))return[3,6];u.label=3;case 3:return u.trys.push([3,,5,6]),this.task.TryingToCommit=!0,[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 4:return u.sent(),[3,6];case 5:return this.task.TryingToCommit=!1,[7];case 6:return[2,!1]}}))}))},r.prototype.ExecuteLocalUpdatesCommand=function(){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=Qe.CreateDataViewCommand(this.task.getTaskTag(),e.DataViewCommandType.ExecuteLocalUpdates),[4,this.task.DataviewManager.Execute(t)];case 1:return[2,r.sent()]}}))}))},r.prototype.checkAndCommitPerDataview=function(e,t,r,n,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(a.value=new Pt,s=!1,null===(i=e.Transaction)||this.task.isAborting()||!i.isOpened()||!i.isOwner(this.task)||i.getLevel()!==r)return[3,6];o=Qe.CreateTransactionCommand(n,this.task.getTaskTag(),t,r),this.isClosingTopmostTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI&&this.task.getMGData().CmdsToServer.Add(o),u.label=1;case 1:return u.trys.push([1,,4,5]),this.task.TryingToCommit=!0,this.isClosingTopmostTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,3]:(l=a,[4,e.Execute(o)]);case 2:l.value=u.sent(),u.label=3;case 3:return[3,5];case 4:return this.task.TryingToCommit=!1,[7];case 5:s=!0,u.label=6;case 6:return[2,s]}}))}))},r.prototype.HandelTransactionErrorHandlingsRetry=function(e){var t=this.task;null===t.Transaction&&e[0]===E.TRANS_NONE&&(t.TransactionErrorHandlingsRetry=new kt(t,t.getTaskTag(),!1),t.TransactionErrorHandlingsRetry.setTransBegin(E.TRANS_RECORD_PREFIX),e[0]=E.TRANS_RECORD_PREFIX)},r}(),Ft=function(){function e(e){this.Task=null,this.Transaction=null,this.Task=e}return e.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,new Pt]}))}))},e.prototype.GetDbViewRowIdx=function(){return this.Task.DataView.getCurrDBViewRowIdx()},e}(),wt=function(){this.DataviewManager=null},Vt=function(t){function r(e){var r=t.call(this)||this;return r.Command=null,r.Task=null,r.Command=e,e instanceof C&&(r.Task=o.mgDataTable.GetTaskByID(e.TaskTag)),r}return u(r,t),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.Task.getMGData().CmdsToServer.Add(this.Command),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return t.sent(),[2,new Pt]}}))}))},r}(wt),Ut=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,new Pt]}))}))},t}(Vt),Bt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),Object.defineProperty(t.prototype,"execOperCommand",{get:function(){return this.Command},enumerable:!1,configurable:!0}),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.execOperCommand.Operation.operServer(this.execOperCommand.MprgCreator)];case 1:return e.sent(),[2,new Pt(r.MsgInterface.RT_STR_NON_MODIFIABLE)]}}))}))},t}(Vt),Xt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),Object.defineProperty(t.prototype,"dataviewCommand",{get:function(){return this.Command},enumerable:!1,configurable:!0}),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){return null!==this.Task&&null!==(e=this.Task.DataviewManager.RemoteDataviewManager.Transaction)&&(e.Opened=this.dataviewCommand.TransactionIsOpen),[2,new Pt]}))}))},t}(Vt),Ht=function(e){function r(t){var r=e.call(this,t)||this;return r.userRange=null,r.userRange=t.Range,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserRngs&&(this.Task.UserRngs=new t.List),this.Task.UserRngs.push(this.userRange),[2,new Pt]}))}))},r}(Vt),Wt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return this.Task.UserRngs=null,this.Task.ResetRange=!0,[2,new Pt]}))}))},t}(Vt),Kt=function(e){function r(t){var r=e.call(this,t)||this;return r.userRange=null,r.userRange=t.Range,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserLocs&&(this.Task.UserLocs=new t.List),this.Task.UserLocs.push(this.userRange),[2,new Pt]}))}))},r}(Vt),Yt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null!==this.Task.UserLocs&&(this.Task.UserLocs.Clear(),this.Task.UserLocs=null),this.Task.ResetLocate=!0,[2,new Pt]}))}))},t}(Vt),zt=function(e){function r(t){var r=e.call(this,t)||this;return r.sort=null,r.sort=t.Sort,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserSorts&&(this.Task.UserSorts=new t.List),this.Task.UserSorts.push(this.sort),[2,new Pt]}))}))},r}(Vt),qt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null!==this.Task.UserSorts&&(this.Task.UserSorts.Clear(),this.Task.UserSorts=null),this.Task.ResetSort=!0,[2,new Pt]}))}))},t}(Vt),jt=function(){function e(){this.Value=null,this.Type=r.StorageAttribute.NONE}return e.prototype.SetResultValue=function(e,t){this.Value=e,this.Type=t},e}(),Qt=function(t){function r(e){var r=t.call(this,e)||this;return r.control=null,r.control=e.Control,r}return u(r,t),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:return t=new jt,r=Qe.CreatecFetchDataControlValuesCommand(this.Task.getTaskTag(),this.control.getName()),this.Task.getMGData().CmdsToServer.Add(r),[4,le.GetInstance().Execute_1(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.NORMAL,t)];case 1:for(a.sent(),n=0;n<this.Task.DataView.getSize();n+=1)this.Task.DataView.getRecByIdx(n).AddDcValuesReference(this.control.getDitIdx(),this.control.getDcRef());return this.Task.DataView.getOriginalRec().AddDcValuesReference(this.control.getDitIdx(),this.control.getDcRef()),[2,new Pt]}}))}))},r}(Vt),Zt=function(){function t(){}return t.prototype.CreateDataViewCommand=function(t){var r=new Ut(t),n=t instanceof q?t:null;if(null!==n&&null!==n.Operation&&n.Operation.getType()===E.MG_OPER_UPDATE)r=new Bt(n);else if(t instanceof Ce){var a=t instanceof Ce?t:null;switch(a.CommandType){case e.DataViewCommandType.SetTransactionState:r=new Xt(a);break;case e.DataViewCommandType.AddUserRange:r=new Ht(t);break;case e.DataViewCommandType.ResetUserRange:r=new Wt(t);break;case e.DataViewCommandType.AddUserLocate:r=new Kt(t);break;case e.DataViewCommandType.ResetUserLocate:r=new Yt(t);break;case e.DataViewCommandType.AddUserSort:r=new zt(t);break;case e.DataViewCommandType.ResetUserSort:r=new qt(t);break;case e.DataViewCommandType.ControlItemsRefresh:r=new Qt(t)}}else r=new Vt(t);return r},t}(),Jt=function(e){function t(t){var r=e.call(this,t)||this;return r._remoteDataViewCommandFactory=null,r._remoteDataViewCommandFactory=new Zt,r}return u(t,e),t.prototype.Execute=function(t){var r=Object.create(null,{Execute:{get:function(){return e.prototype.Execute}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return[4,r.Execute.call(this,t)];case 1:return n.sent(),[4,this._remoteDataViewCommandFactory.CreateDataViewCommand(t).Execute()];case 2:return e=n.sent(),[2,new Pt(e)]}}))}))},t}(Ft),$t=function(e){function t(t){var r=e.call(this,t)||this;return r.RemoteDataviewManager=null,r.HasRemoteData=!0,r.RemoteDataviewManager=new Jt(t),r}return u(t,e),Object.defineProperty(t.prototype,"TaskService",{get:function(){return this.Task.TaskService},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CurrentDataviewManager",{get:function(){return this.HasRemoteData?this.RemoteDataviewManager:this.VirtualDataviewManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VirtualDataviewManager",{get:function(){return this.TaskService.GetDataviewManagerForVirtuals(this.Task)},enumerable:!1,configurable:!0}),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.CurrentDataviewManager.Execute(e)];case 1:return[2,t.sent()]}}))}))},t}(Ft),er=function(){function e(){this._sortTab=null,this._sortTab=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,n,a){if(null===n)return!1;switch(n){case E.MG_TAG_SORTS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_SORT:var s=new Ze;this._sortTab.push(s);var i=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==i&&i<e.getXMLdata().length){var o=e.getXMLsubstring(i);e.add2CurrIndex(o.indexOf(E.MG_TAG_SORT)+E.MG_TAG_SORT.length);var l=new t.List(r.XmlParser.getTokens(e.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM).GetEnumerator());this.InitElements(l,s),e.setCurrIndex(i+r.XMLConstants.TAG_TERM.length)}break;case E.MG_TAG_SORTS_END:return e.setCurrIndex2EndOfTag(),!1}return!0},e.prototype.InitElements=function(e,n){for(var a=0;a<e.length;a+=2){var s=e.get_Item(a),i=e.get_Item(a+1);switch(s){case r.XMLConstants.MG_ATTR_ID:n.fldIdx=r.XmlParser.getInt(i);break;case E.MG_ATTR_DIR:n.dir="A"===i;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",s))}}},e.prototype.getSort=function(e){return e<0||null===this._sortTab||e>=this._sortTab.length?null:this._sortTab.get_Item(e)},e.prototype.getSize=function(){return null===this._sortTab?0:this._sortTab.length},e.prototype.add=function(e){this._sortTab.push(e)},e}(),tr=function(){function e(){this._createdFormVec=null,this._createdFormVec=new t.List}return e.prototype.add=function(e){this._createdFormVec.push(e)},e.prototype.remove=function(e){this._createdFormVec.Remove(e)},e.prototype.Count=function(){return this._createdFormVec.length},e.prototype.Clear=function(){this._createdFormVec.Clear()},e.prototype.get=function(e){return this._createdFormVec.get_Item(e)},e}(),rr=function(e){function s(){var t=e.call(this)||this;return t.IsMovingInView=!1,t.PrevDisplayLine=0,t.RefreshAllRows=!1,t.IgnoreFirstRecordCycle=!1,t.MovedToFirstControl=!1,t._suffixDone=!1,t.hiddenControlsIsnsList=null,t._transferringDataToGUI=!1,t.isFetchingRecordsAhead=!1,t}return u(s,e),Object.defineProperty(s,"CreatedForms",{get:function(){return s._createdForms},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"InRestore",{get:function(){return this._inRestore},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"TransferringDataToGUI",{get:function(){return this._transferringDataToGUI},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"shouldFetchRecordsAheadFromServer",{get:function(){if(this.isTableWithPagination()){var e=this._tableMgControl.GetComputedProperty(n.PropInterface.PROP_TYPE_SERVER_READ_AHEAD);return null!=e&&e.GetComputedValueBoolean()}return!1},enumerable:!1,configurable:!0}),s.prototype.FetchRecordsAheadFromServer=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this.isFetchingRecordsAhead=!0,[4,this.GetDataview().FetchRecordsAheadFromServer()];case 1:return e.sent(),this.isFetchingRecordsAhead=!1,[2]}}))}))},s.prototype.GetDataview=function(){var e=null;return null!=this._task&&(e=this._task.DataView),e},s.prototype.moveInView=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return a.isNullOrUndefined(r)?[4,this.moveInView_0(e,t)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this.moveInView_1(e,t,r)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},s.prototype.moveInView_0=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.moveInView(e,t,!0)];case 1:return r.sent(),[2]}}))}))},s.prototype.moveInView_1=function(e,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d,E,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:i=t.Int32.MinValue,u=this.GetDataview().getCurrRec(),c=" ",_=!1,T=!1,p=0,h.label=1;case 1:if(h.trys.push([1,96,97,98]),this.IsMovingInView=!0,g=this.DisplayLine,e!==r.Constants.MOVE_UNIT_TABLE)return[3,15];h.label=2;case 2:return h.trys.push([2,13,,14]),a!==r.Constants.MOVE_DIRECTION_BEGIN?[3,6]:[4,this.GetDataview().setCurrRecByIdx(r.Constants.MG_DATAVIEW_FIRST_RECORD,!0,!1,!0,Lt)];case 3:return h.sent(),this.isLineMode()?(this.GetDataview().setTopRecIdx(0),[4,this.setCurrRowByDisplayLine(0,!1,!1)]):[3,5];case 4:h.sent(),h.label=5;case 5:return[3,11];case 6:return[4,this.GetDataview().setCurrRecByIdx(r.Constants.MG_DATAVIEW_LAST_RECORD,!0,!1,!0,Lt)];case 7:return h.sent(),this.isLineMode()?(this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()-this._rowsInPage+1),this.GetDataview().getTopRecIdx()>=0?[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(),!1,!1)]:[3,9]):[3,11];case 8:return h.sent(),[3,11];case 9:return this.GetDataview().setTopRecIdx(0),[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(),!1,!1)];case 10:h.sent(),h.label=11;case 11:return this.updateDisplayLineByDV(),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 12:return h.sent(),[3,14];case 13:return(d=h.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(d.Message),[3,14];case 14:return[3,86];case 15:if(this.getTopIndexFromGUI(),E=void 0,e===r.Constants.MOVE_UNIT_PAGE&&this.isLineMode())switch(a){case r.Constants.MOVE_DIRECTION_BEGIN:E=this.GetDataview().getCurrRecIdx()-this.GetDataview().getTopRecIdx();break;case r.Constants.MOVE_DIRECTION_END:I=this.GetDataview().getTopRecIdx()+this._rowsInPage-1,I=Math.min(I,this.GetDataview().getSize()-1),E=I-this.GetDataview().getCurrRecIdx();break;default:_=!0,E=this._rowsInPage}else E=1;if(E=a===r.Constants.MOVE_DIRECTION_PREV||a===r.Constants.MOVE_DIRECTION_BEGIN?-E:E,!this.isLineMode())return[3,72];if((p=this.getVisibleLine())<0&&(p=0,T=!0),p>this._rowsInPage+1&&(p=this._rowsInPage,T=!0),!(e===r.Constants.MOVE_UNIT_PAGE&&(a===r.Constants.MOVE_DIRECTION_NEXT||a===r.Constants.MOVE_DIRECTION_PREV)||e===r.Constants.MOVE_UNIT_ROW&&(a===r.Constants.MOVE_DIRECTION_NEXT&&p===this._rowsInPage-1||a===r.Constants.MOVE_DIRECTION_PREV&&0===p)))return[3,45];if(a===r.Constants.MOVE_DIRECTION_PREV&&(e===r.Constants.MOVE_UNIT_ROW||e===r.Constants.MOVE_UNIT_PAGE)&&0===p&&0===this.GetDataview().getCurrRecIdx()&&this.GetDataview().IncludesFirst())return[2];if(a===r.Constants.MOVE_DIRECTION_NEXT&&e===r.Constants.MOVE_UNIT_PAGE&&p===this.getLastValidRow()&&this.GetDataview().getCurrRecIdx()===this.GetDataview().getSize()-1&&this.GetDataview().IncludesLast())return[2];i=this.GetDataview().getCurrRec().getId(),this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx()+E),this.GetDataview().setTopRecIdxModified(!0),h.label=16;case 16:return h.trys.push([16,19,,44]),this._suffixDone=!1,[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx()+E,!0,!1)];case 17:return h.sent(),this.GetDataview().setTopRecIdxModified(!1),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 18:return h.sent(),[3,44];case 19:return(f=h.sent())instanceof mt?(this.GetDataview().setTopRecIdxModified(!1),o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,21]):[3,43];case 20:return h.sent(),[2];case 21:if(!(this.GetDataview().getTopRecIdx()<0))return[3,29];this.GetDataview().setTopRecIdx(0),h.label=22;case 22:return h.trys.push([22,24,,27]),[4,this.setCurrRowByDisplayLine(0,!0,!1)];case 23:return h.sent(),[3,27];case 24:return h.sent()instanceof t.Exception&&o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,26];case 25:return h.sent(),[2];case 26:return[3,27];case 27:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 28:return h.sent(),[3,42];case 29:return e!==r.Constants.MOVE_UNIT_ROW&&this.GetDataview().recExists(this.GetDataview().getTopRecIdx())?this.GetDataview().getCurrRec().getId()!==i||this._suffixDone?[3,36]:[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,37];case 30:return h.sent(),o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,32];case 31:return h.sent(),[2];case 32:return h.trys.push([32,35,,36]),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 33:return h.sent(),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+this.getLastValidRow(),!1,!0)];case 34:return h.sent(),[3,36];case 35:return h.sent(),[3,36];case 36:return[3,42];case 37:return this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)];case 38:return h.sent(),e!==r.Constants.MOVE_UNIT_ROW||a!==r.Constants.MOVE_DIRECTION_NEXT?[3,41]:this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,39]:(this._task.setExecEndTask(),[3,41]);case 39:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)];case 40:h.sent(),h.label=41;case 41:return[2];case 42:r.Logger.Instance.WriteDevToLog(f.Message),h.label=43;case 43:return[3,44];case 44:return[3,71];case 45:return h.trys.push([45,54,,71]),c=this._task.getMode(),i=this.GetDataview().getCurrRec().getId(),[4,this.setCurrRowByDisplayLine(g+E,!0,!1)];case 46:return h.sent(),this.GetDataview().recExistsById(i)?[3,51]:E>0||c!==r.Constants.TASK_MODE_CREATE?-1!==E||this.GetDataview().recExists(g)?[4,this.setCurrRowByDisplayLine(g,!1,!1)]:[3,48]:[3,49];case 47:return h.sent(),[3,49];case 48:r.Logger.Instance.WriteDevToLog(t.NString.Format("skipped setcurrRow for row {0}",g)),h.label=49;case 49:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 50:return h.sent(),[3,53];case 51:return o.eventsManager.GetStopExecutionFlag()?[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]:[3,53];case 52:h.sent(),h.label=53;case 53:return[3,71];case 54:return(C=h.sent())instanceof mt?this.GetDataview().recExistsById(i)?[4,this.restoreOldDisplayLine(g)]:[3,57]:[3,70];case 55:return h.sent(),u.Synced||c!==r.Constants.TASK_MODE_CREATE||(this._task.setMode(r.Constants.TASK_MODE_CREATE),u.clearMode(),u.setMode(n.DataModificationTypes.Insert),u.setNewRec()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 56:return h.sent(),[3,61];case 57:return c===r.Constants.TASK_MODE_CREATE&&g>0?[4,this.restoreOldDisplayLine(g-1)]:[3,59];case 58:h.sent(),h.label=59;case 59:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 60:h.sent(),h.label=61;case 61:return E<=0||o.eventsManager.GetStopExecutionFlag()?(r.Logger.Instance.WriteDevToLog(C.Message),[3,69]):[3,62];case 62:return this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,63]:(this._task.setExecEndTask(),[2]);case 63:return this._task.ActionManager.isEnabled(r.InternalInterface.MG_ACT_CRELINE)?[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]:[3,65];case 64:return h.sent(),[3,69];case 65:return A=!0,R=new t.RefParam(A),[4,o.eventsManager.DoTaskLevelRecordSuffix(this._task,R)];case 66:return h.sent()?[3,68]:[4,o.eventsManager.DoTaskLevelRecordPrefix(this._task,this)];case 67:h.sent(),h.label=68;case 68:A=R.value,h.label=69;case 69:return[2];case 70:return[3,71];case 71:return[3,86];case 72:return h.trys.push([72,75,,86]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx()+E,!0,!1,!0,Lt)];case 73:return h.sent(),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 74:return h.sent(),[3,86];case 75:return(S=h.sent())instanceof mt?E>0?this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,76]:(this._task.setExecEndTask(),[3,78]):[3,79]:[3,81];case 76:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)];case 77:h.sent(),h.label=78;case 78:return[3,80];case 79:r.Logger.Instance.WriteDevToLog(S.Message),h.label=80;case 80:return[2];case 81:return S instanceof ae?[4,this._task.stop()]:[3,84];case 82:return h.sent(),this._task.abort(),[4,o.eventsManager.ProcessAbortingError(S)];case 83:return h.sent(),[3,85];case 84:if(S instanceof t.Exception)return r.Logger.Instance.WriteDevToLog(S.Message),[2];h.label=85;case 85:return[3,86];case 86:return _?T?(0===p?this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()):this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()-this._rowsInPage),this.SetTableTopIndex(),[3,89]):[3,87]:[3,90];case 87:return this.SetTableTopIndex(),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+p,!1,!0)];case 88:h.sent(),h.label=89;case 89:return[3,91];case 90:this.SetTableTopIndex(),h.label=91;case 91:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_PREFIX)];case 92:return h.sent(),s?null==(l=this._task.getLastParkedCtrl())?[3,95]:[4,l.invoke()]:[3,95];case 93:return h.sent()?[3,95]:[4,o.eventsManager.HandleNonParkableControls(this._task)];case 94:h.sent(),h.label=95;case 95:return[3,98];case 96:return(M=h.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(M.Message),[3,98];case 97:return this.SelectRow(),this.IsMovingInView=!1,[7];case 98:return[2]}}))}))},s.prototype.addRec=function(e,n,a,s){return T(this,void 0,void 0,(function(){var n,a,i,o;return h(this,(function(l){switch(l.label){case 0:return n=1,a=-1,this._task.DataView.isEmptyDataview()||(a=this.getVisibleLine()),this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount+=1,this.RefreshAllRows=!0),[4,this.GetDataview().addRecord(e,!1,s)];case 1:if(!(l.sent()>-1))return[3,8];if(!this.isLineMode())return[3,7];i=void 0,0===this.GetDataview().getSize()||this.GetDataview().getTopRecIdx()===t.Int32.MinValue?(this.GetDataview().setTopRecIdx(0),i=0):a===this._rowsInPage-1?(this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx()+1),i=this.getVisibleLine()):i=s?a>0?a:0:a+1,n=this.GetDataview().getTopRecIdx()+i,this.removeRecordsAfterIdx(this.GetDataview().getTopRecIdx()+i),l.label=2;case 2:return l.trys.push([2,4,,5]),this._task.DataView.isEmptyDataview()||this._task.setMode(r.Constants.TASK_MODE_CREATE),[4,this.setCurrRowByDisplayLine(n,!1,!1)];case 3:return l.sent(),[3,5];case 4:return(o=l.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(t.NString.Format("in Form.addRec() {0}",o.Message)),[3,5];case 5:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_TABLE)];case 6:l.sent(),l.label=7;case 7:return[3,9];case 8:this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount-=1,this.RefreshAllRows=!1),l.label=9;case 9:return[2]}}))}))},s.prototype.delCurrRec=function(){var t=Object.create(null,{isLineMode:{get:function(){return e.prototype.isLineMode}},HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e,a;return h(this,(function(s){switch(s.label){case 0:return e=t.isLineMode.call(this)&&this.GetDataview().getTopRecIdx()===this.GetDataview().getCurrRecIdx(),[4,this.GetDataview().removeCurrRec()];case 1:return s.sent(),!this.GetDataview().isEmpty()||this._task.IsTryingToStop?[3,8]:this._task.DataView.isEmptyDataview()?[4,this.addRec(!1,0,0,!1)]:[3,3];case 2:return s.sent(),[3,8];case 3:return[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 4:return s.sent()?(this._task.getMode()!==r.Constants.TASK_MODE_CREATE&&this._task.setMode(r.Constants.TASK_MODE_CREATE),this._task.enableCreateActs(!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]):[3,6];case 5:return s.sent(),[3,8];case 6:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_EXIT)];case 7:s.sent(),s.label=8;case 8:return this.GetDataview().isEmpty()?[3,18]:(e&&this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()),t.isLineMode.call(this)?t.HasTable.call(this)?(this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount--,this.RefreshAllRows=!0),this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)]):[3,10]:[3,13]);case 9:return s.sent(),[3,12];case 10:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 11:s.sent(),s.label=12;case 12:return[3,18];case 13:return s.trys.push([13,15,,16]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(),!0,!0,!0,Lt)];case 14:return s.sent(),[3,16];case 15:if(!((a=s.sent())instanceof mt))throw a;return[3,16];case 16:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 17:s.sent(),s.label=18;case 18:return[2]}}))}))},s.prototype.cancelEdit=function(a,s){var i=Object.create(null,{isLineMode:{get:function(){return e.prototype.isLineMode}},HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e,l,u,c,_,T,p,g,d,E,I,f;return h(this,(function(h){switch(h.label){case 0:return e=this._task.getMode(),u=0,c=!1,l=1===this.GetDataview().getSize()&&e===r.Constants.TASK_MODE_CREATE?r.Constants.TASK_MODE_CREATE:r.Constants.TASK_MODE_MODIFY,[4,this.GetDataview().cancelEdit(!1,!1)];case 1:return _=h.sent(),this.GetDataview().setPrevCurrRec(null),!(this.GetDataview().isEmpty()||a&&_&&!n.GuiEnvironment.Environment.GetSpecialCancelOnCreate()&&this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_CREATE)||this._task.IsTryingToStop?[3,3]:(T=this._task.cancelWasRaised(),this._task.setCancelWasRaised(a),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]);case 2:return h.sent(),this._task.setCancelWasRaised(T),[3,4];case 3:a&&(c=!0),h.label=4;case 4:if(this.GetDataview().isEmpty())return[3,17];if(!i.isLineMode.call(this))return[3,10];h.label=5;case 5:return h.trys.push([5,8,,9]),i.HasTable.call(this)?(((u=this.getVisibleLine())<0||u>=this._rowsInPage)&&(p=this.GetDataview().getTopRecIdx(),g=this.GetDataview().getCurrRecIdx(),p>g&&this.GetDataview().setTopRecIdx(g),u=0),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+u,!1,!0)]):[3,7];case 6:h.sent(),h.label=7;case 7:return[3,9];case 8:if(!((d=h.sent())instanceof mt))throw d;return 0!==u&&r.Logger.Instance.WriteDevToLog(t.NString.Format("in Form.cancelEdit() {0}",d.Message)),[3,9];case 9:return i.HasTable.call(this)&&(this.isTableWithAbsoluteScrollbar()&&_&&(this.GetDataview().TotalRecordsCount--,this.RefreshAllRows=!0),this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx())),[3,13];case 10:return h.trys.push([10,12,,13]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(),!1,!0,!0,Lt)];case 11:return h.sent(),[3,13];case 12:if(!((E=h.sent())instanceof mt))throw E;return r.Logger.Instance.WriteDevToLog("in Form.cancelEdit() error in Screen mode for Current Record"),[3,13];case 13:return this._task.setMode(l),this._task.InEndTask?[3,15]:[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 14:h.sent(),h.label=15;case 15:return this._task.InEndTask?[3,17]:[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 16:h.sent(),h.label=17;case 17:if(!c)return[3,20];if(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),null!==(I=G.getLastFocusedControl()))if(I.getForm().getTask().pathContains(this._task))for(f=I.getForm().getTask();null!==f&&f!==this._task;f=f.getParent())f.setLevel(r.Constants.TASK_LEVEL_TASK),f.DataView.getCurrRec().resetModified();else I.getForm().getTask().setLevel(r.Constants.TASK_LEVEL_TASK);return s?[3,20]:[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_PREFIX)];case 18:return h.sent(),[4,o.eventsManager.HandleParkabilityOnRowChange(this._task)];case 19:h.sent(),h.label=20;case 20:return[2]}}))}))},s.prototype.refreshOnExpressions=function(){var r=Object.create(null,{refreshPropsOnExpression:{get:function(){return e.prototype.refreshPropsOnExpression}}});return T(this,void 0,void 0,(function(){var e,n;return h(this,(function(a){switch(a.label){case 0:e=0,a.label=1;case 1:return e<this.CtrlTab.getSize()?null==(n=this.CtrlTab.getCtrl(e)instanceof P?this.CtrlTab.getCtrl(e):null)?[3,3]:[4,n.refreshOnExpression()]:[3,5];case 2:return a.sent(),[3,4];case 3:t.Debug.Assert(!1),a.label=4;case 4:return e+=1,[3,1];case 5:return[4,r.refreshPropsOnExpression.call(this)];case 6:return a.sent(),[2]}}))}))},s.prototype.removeRefsToCtrls=function(){var t=G.getLastFocusedControl();null!==t&&t.getForm()===this&&G.setLastFocusedControl(this._task,null),e.prototype.removeRefsToCtrls.call(this)},s.prototype.getCtrlByCtrlName=function(e){return this.CtrlTab.getCtrl(e)},s.prototype.getSubFormCtrlByName=function(e){var n,a=null;for(n=this._task;null===a&&null!==n&&null!==n.getForm()&&(null!=(a=n.getForm().getCtrlByName(e,r.MgControlType.CTRL_TYPE_SUBFORM))||n.IsSubForm&&!t.NString.Equals(n.getForm().getSubFormCtrl().Name,e,!0));n=n.getParent());return a},s.prototype.setSuffixDone=function(){this._suffixDone=!0},s.prototype.getDestinationRow=function(){return this._destTblRow},s.prototype.setSubFormCtrl=function(e){t.Debug.Assert(null===this._subFormCtrl&&null!==e),this._subFormCtrl=e},s.prototype.getSubFormCtrlForTask=function(e){var t,r=null,n=null,a=null;for(n=this;null!=n;n=n.ParentForm){t=n.CtrlTab;for(var s=0;s<t.getSize();s++)if(null!=(r=t.getCtrl(s)instanceof P?t.getCtrl(s):null)&&r.isSubform()&&null!=r.getSubformTaskId()&&r.getSubformTaskId()===e){a=r;break}if(null!=a)break}return a},s.prototype.removeRecordsAfterIdx=function(t){var r=!1;this.isTableWithPagination()||(t<=this._rowsInPage+1&&this.GetDataview().getSize()>this._rowsInPage&&(t=0),0===t&&(r=!0),e.prototype.SetTableItemsCount.call(this,t,r)),this.setTableItemsCount(!1)},s.prototype.isRowValidated=function(e){if(this.Rows.length<=e||e<0)return!1;var t=this.Rows.get_Item(e);return null!=t&&(t.Created&&t.Validated)},s.prototype.transferDataToGui=function(){var t=Object.create(null,{getTask:{get:function(){return e.prototype.getTask}},checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}}});return T(this,void 0,void 0,(function(){var e,n,a,i,o,l;return h(this,(function(u){switch(u.label){case 0:e=this.GetDataview().getCurrRecIdx(),n=r.Misc.getSystemMilliseconds()+s.TIME_LIMIT,a=!1,i=t.getTask.call(this).CurrentEditingControl,u.label=1;case 1:u.trys.push([1,10,,11]),o=this.GetDataview().backupCurrent(),u.label=2;case 2:return r.Misc.getSystemMilliseconds()<n&&this.RefreshRepeatableAllowed?this._lastRowSent+1>=this.GetDataview().getSize()||this.isTableWithPagination()&&this._lastRowSent+1>=this.getMaxRowsInPaginatedTable()?(this.RefreshUI(),[3,6]):(this._lastRowSent++,this._transferringDataToGUI=!0,this.AllowedSubformRecompute=!1,this.isRowValidated(this._lastRowSent)?[3,5]:(t.checkAndCreateRow.call(this,this._lastRowSent),this._lastRowSent===e?[3,5]:(t.getTask.call(this).CurrentEditingControl=null,[4,this.setCurrRowByDisplayLine(this._lastRowSent,!1,!0)]))):[3,6];case 3:return u.sent(),[4,t.refreshControls.call(this,!0)];case 4:u.sent(),a=!0,u.label=5;case 5:return this.AllowedSubformRecompute=!0,this._transferringDataToGUI=!1,[3,2];case 6:return a?[4,this.restoreBackup(e,o)]:[3,9];case 7:return u.sent(),[4,t.refreshControls.call(this,!0)];case 8:u.sent(),t.getTask.call(this).CurrentEditingControl=i,u.label=9;case 9:return[3,11];case 10:if(!((l=u.sent())instanceof mt))throw l;return r.Logger.Instance.WriteDevToLog(l.Message),[3,11];case 11:return this._transferingData=!1,this.checkAndCreateRowsEvent(),[2]}}))}))},s.prototype.checkAndCreateRowsEvent=function(){if(null!==this._tableMgControl&&this.Opened&&this.RefreshRepeatableAllowed){var e=this.GetDataview().getSize();this._lastRowSent>=this.Rows.length&&(this._lastRowSent=this.Rows.length-1);var t=this._lastRowSent<e-1;this.isTableWithPagination()&&this._lastRowSent+1>=this.getMaxRowsInPaginatedTable()&&(t=!1),t&&!this._transferingData?(o.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl,r.InternalInterface.MG_ACT_DV_TO_GUI,r.Priority.LOWEST),this._transferingData=!0):!this.shouldFetchRecordsAheadFromServer||t||this.GetDataview().IncludesLast()&&this.GetDataview().IncludesFirst()||o.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl,r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER,r.Priority.LOWEST)}},s.prototype.setRowData=function(r,n,a){var s=Object.create(null,{refreshControls:{get:function(){return e.prototype.refreshControls}},SelectRow:{get:function(){return e.prototype.SelectRow}}});return T(this,void 0,void 0,(function(){var e,a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return e=this.GetDataview().getCurrRecIdx(),a=0,i=!1,o=!1,l=!1,r!==t.Int32.MinValue?r<0?(i=!0,this.GetDataview().setTopRecIdx(0)):r+this._rowsInPage+1>=this.GetDataview().getSize()&&(o=!0):r=this.GetDataview().getTopRecIdx(),u=this.GetDataview().backupCurrent(),this._transferringDataToGUI=!0,this.AllowedSubformRecompute=!1,c=new t.RefParam(a),[4,this.refreshRows(r,n,e,c)];case 1:return l=T.sent(),a=c.value,(i&&0!==a||o)&&(this.GetDataview().setTopRecIdx(r+a),this.SetTableTopIndex(),this._topIndexUpdated&&(this._topIndexUpdated=!1)),this.AllowedSubformRecompute=!0,this._transferringDataToGUI=!1,l?[4,this.restoreBackup(e+a,u)]:[3,4];case 2:return T.sent(),[4,s.refreshControls.call(this,!0)];case 3:T.sent(),T.label=4;case 4:return s.SelectRow.call(this),i&&null!==(_=G.getLastFocusedControl())&&(_.getParentTable(),this._tableMgControl),[2]}}))}))},s.prototype.refreshRows=function(t,r,n,a){var s=Object.create(null,{checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}},isRowCreated:{get:function(){return e.prototype.isRowCreated}},markRowNOTCreated:{get:function(){return e.prototype.markRowNOTCreated}}});return T(this,void 0,void 0,(function(){var e,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:e=0,i=!1,a.value=0,o=this.GetDataview().IncludesFirst(),l=this.GetDataview().IncludesLast(),u=0,h.label=1;case 1:if(!(u<this._rowsInPage))return[3,10];c=t+u,_=this.GetDataview().getTopRecIdx(),h.label=2;case 2:return h.trys.push([2,7,8,9]),e=c+a.value,!this.isRowValidated(c)||r||this.RefreshAllRows?(e>=0&&s.checkAndCreateRow.call(this,e),n+a.value===e?[3,5]:[4,this.setCurrRowByDisplayLine(e,!1,!0)]):[3,6];case 3:return h.sent(),[4,s.refreshControls.call(this,!0)];case 4:h.sent(),h.label=5;case 5:i=!0,h.label=6;case 6:return[3,9];case 7:if((T=h.sent())instanceof mt)return s.isRowCreated.call(this,e)&&s.markRowNOTCreated.call(this,e),[3,10];throw T;case 8:return a.value=a.value+(this.GetDataview().getTopRecIdx()-_),_=this.GetDataview().getTopRecIdx(),!i&&this.GetDataview().DataviewBoundriesAreChanged(o,l)&&(i=!0),[7];case 9:return u++,[3,1];case 10:return this.RefreshUI(),this.RefreshAllRows=!1,[2,i]}}))}))},s.prototype.getVisibleLine=function(){var e=0;return this.GetDataview().getCurrRecIdx()!==t.Int32.MinValue&&(e=this.GetDataview().getCurrRecIdx()),e-Math.max(this.GetDataview().getTopRecIdx(),0)},s.prototype.bringRecordToPage=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return null===this._tableMgControl||this._task.DataView.isEmptyDataview()?[3,2]:(e=n.Commands.getTopIndex(this._tableMgControl),r=this.GetDataview().getCurrRecIdx(),a=e,this.isTableWithPagination()?(s=this.getGuiRowidx(r),i=s-s%this._rowsInPage,((a=this.getDvRowIdx(i))!==this._prevGuiTopIndex||this.IsMovingInView)&&(this._topIndexUpdated=!0)):e>r?(this._topIndexUpdated=!0,a=r):e+this._rowsInPage-1<r&&(this._topIndexUpdated=!0,a=this._rowsInPage>0?r-this._rowsInPage+1:r),this.GetDataview().getTopRecIdx()!==a||this._topIndexUpdated?(this.GetDataview().setTopRecIdx(a),this.SetTableTopIndex(),[4,this.setRowData(t.Int32.MinValue,!1,null)]):[3,2]);case 1:o.sent(),this._topIndexUpdated=!1,o.label=2;case 2:return[2]}}))}))},s.prototype.invalidateTable=function(){for(var e=0;e<this.Rows.length;e++){var t=this.Rows.get_Item(e);null!==t&&(t.Validated=!1)}this._lastRowSent=-1,this.checkAndCreateRowsEvent()},s.prototype.getPrevLine=function(e){return e-1},s.prototype.clearTableColumnSortMark=function(e){},s.prototype.stopRowEditing=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.getIsRowEditingFromGui(e)?(n.Commands.addValueWithLine(n.CommandType.SET_NOT_IS_ROW_EDITING,this,this.isLineMode()?e:0,this.isLineMode()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]):[3,2];case 1:t.sent(),n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),t.label=2;case 2:return[2]}}))}))},s.prototype.startRowEditing=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.getIsRowEditingFromGui(e)?[3,2]:(n.Commands.addValueWithLine(n.CommandType.SET_IS_ROW_EDITING,this,this.isLineMode()?e:0,this.isLineMode()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]);case 1:t.sent(),n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),t.label=2;case 2:return[2]}}))}))},s.prototype.getIsRowEditingFromGui=function(e){return n.Commands.getIsRowEditing(this,this.isLineMode()?e:0,this.isLineMode())},s.prototype.RefreshDisplay=function(n){var a=Object.create(null,{HasTable:{get:function(){return e.prototype.HasTable}},hasTable:{get:function(){return e.prototype.hasTable}},SelectRow:{get:function(){return e.prototype.SelectRow}},refreshProps:{get:function(){return e.prototype.refreshProps}},refreshControls:{get:function(){return e.prototype.refreshControls}},getTask:{get:function(){return e.prototype.getTask}},isLineMode:{get:function(){return e.prototype.isLineMode}}});return T(this,void 0,void 0,(function(){var e,s,i;return h(this,(function(o){switch(o.label){case 0:if(e=this._task,this.isFetchingRecordsAhead)return[2,!1];if(e.isAborting())return[2,!1];if(null!==(s=this.GetDataview().getCurrRec())&&s.InCompute&&!s.isNewRec())return[2,!1];if(this._inRefreshDisp)return[2,!1];this._inRefreshDisp=!0,o.label=1;case 1:return o.trys.push([1,9,10,11]),n!==r.Constants.TASK_REFRESH_FORM&&n!==r.Constants.TASK_REFRESH_TABLE?[3,3]:a.HasTable.call(this)&&this.Opened?[4,this.refreshTable()]:[3,3];case 2:o.sent(),o.label=3;case 3:return n!==r.Constants.TASK_REFRESH_FORM&&n!==r.Constants.TASK_REFRESH_CURR_REC?[3,8]:n===r.Constants.TASK_REFRESH_CURR_REC&&a.hasTable.call(this)?(this.SetTableTopIndex(),a.SelectRow.call(this),[4,this.fetchPrevChunkForCurrentPage()]):[3,5];case 4:o.sent(),o.label=5;case 5:return[4,a.refreshProps.call(this)];case 6:return o.sent(),[4,a.refreshControls.call(this,!1)];case 7:o.sent(),o.label=8;case 8:return[3,11];case 9:if(!((i=o.sent())instanceof t.Exception))throw i;return r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("{0} : {1} in task {2}",i.GetType(),i.Message,a.getTask.call(this).PreviouslyActiveTaskId)),[3,11];case 10:return this._inRefreshDisp=!1,[7];case 11:return n!==r.Constants.TASK_REFRESH_CURR_REC||a.isLineMode.call(this)&&!this._tableRefreshed||(this.FormRefreshed=!0),[2,!0]}}))}))},s.prototype.RefreshUI=function(){this.getTask().isMainProg()||n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm())},s.prototype.refreshTable=function(){var n=Object.create(null,{checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}},isRowCreated:{get:function(){return e.prototype.isRowCreated}},markRowNOTCreated:{get:function(){return e.prototype.markRowNOTCreated}}});return T(this,void 0,void 0,(function(){var e,a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:if(this.isFetchingRecordsAhead)return[2];if(r.Logger.Instance.WriteGuiToLog("Start form.refreshTable()"),this.updateDisplayLineByDV(),e=this.DisplayLine,a=this.GetDataview().getCurrRecIdx(),!this._tableRefreshed&&a>=0?(e=this.GetDataview().getCurrRecIdx())+1>this._rowsInPage?this.GetDataview().setTopRecIdx(e-Math.floor(this._rowsInPage/2)+1):this.GetDataview().setTopRecIdx(0):(e===t.Int32.MinValue&&(e=0),this.GetDataview().getTopRecIdx()===t.Int32.MinValue&&this.GetDataview().setTopRecIdx(a)),this.GetDataview().getTopRecIdx()<0)return[2];e-=this.GetDataview().getTopRecIdx(),s=this.GetDataview().backupCurrent(),this._tableRefreshed=!0,(i=this._transferringDataToGUI)||(this._transferringDataToGUI=!0),this.AllowedSubformRecompute=!1,o=0,_.label=1;case 1:if(!(o<this._rowsInPage))return[3,8];(l=this.GetDataview().getTopRecIdx())<0&&(this.GetDataview().setTopRecIdx(0),l=0),u=l+o,_.label=2;case 2:return _.trys.push([2,6,,7]),n.checkAndCreateRow.call(this,u),o===e?[3,5]:[4,this.setCurrRowByDisplayLine(u,!1,!0)];case 3:return _.sent(),[4,n.refreshControls.call(this,!0)];case 4:_.sent(),_.label=5;case 5:return[3,7];case 6:if("RecordOutOfDataViewException"==(c=_.sent()).name)return n.isRowCreated.call(this,u)&&n.markRowNOTCreated.call(this,u),[3,8];throw c;case 7:return o++,[3,1];case 8:return this.AllowedSubformRecompute=!0,i||(this._transferringDataToGUI=!1),[4,this.restoreBackup(e+this.GetDataview().getTopRecIdx(),s)];case 9:return _.sent(),[4,n.refreshControls.call(this,!0)];case 10:return _.sent(),this.RefreshUI(),r.Logger.Instance.WriteGuiToLog("End form.refreshTable()"),[2]}}))}))},s.prototype.updateDisplayLineByDV=function(){this.DisplayLine=this.recordIdx2DisplayLine(this.GetDataview().getCurrRecIdx())},s.prototype.setCurrRowByDisplayLine=function(t,r,n){var a=Object.create(null,{HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(s){switch(s.label){case 0:return e=this.displayLine2RecordIdx(t),[4,this.setCurrRowByRecIdx(e,r,n,t)];case 1:return s.sent(),a.HasTable.call(this)?this.updateDisplayLineByDV():this.DisplayLine=t,[2]}}))}))},s.prototype.setCurrRowByRecIdx=function(r,n,a,s){var i=Object.create(null,{hasTable:{get:function(){return e.prototype.hasTable}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:if(null===this.GetDataview()||!i.hasTable.call(this)&&0!==r)throw new t.ApplicationException("in Form.setCurrRow() no table ");e.label=1;case 1:return e.trys.push([1,,3,4]),this._destTblRow=r,[4,this.GetDataview().setCurrRecByIdx(r,n,a,!0,s)];case 2:return e.sent(),[3,4];case 3:return this._destTblRow=r-this.GetDataview().getTopRecIdx(),[7];case 4:return[2]}}))}))},s.prototype.getLastValidRow=function(){return Math.min(this._rowsInPage-1,this.GetDataview().getSize()-1-this.GetDataview().getTopRecIdx())},s.prototype.recordIdx2DisplayLine=function(e){return e},s.prototype.displayLine2RecordIdx=function(e){return e},s.prototype.restoreOldDisplayLine=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),this._inRestore=!0,[4,this.setCurrRowByDisplayLine(e,!1,!0)];case 1:return r.sent(),[3,4];case 2:if(!((t=r.sent())instanceof mt))throw t;return[3,4];case 3:return this._inRestore=!1,[7];case 4:return[2]}}))}))},s.prototype.getTopIndexFromGUI=function(){var t=e.prototype.getTopIndexFromGUI.call(this);return e.prototype.hasTable.call(this)&&this.GetDataview().setTopRecIdx(this.displayLine2RecordIdx(t)),t},s.prototype.getCurrRecPosInForm=function(){var t=e.prototype.getTopIndexFromGUI.call(this);return this.DisplayLine-t+1},s.prototype.restoreBackup=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return t.getId()>=0&&this.GetDataview().getRecIdx(t.getId())>=0&&e>=0&&e<this.GetDataview().getSize()&&this.GetDataview().getCurrRecIdx()>=0&&t.getMode()===n.DataModificationTypes.None?(this.GetDataview().restoreCurrent(t),this.updateDisplayLineByDV(),[3,3]):[3,1];case 1:return[4,this.restoreOldDisplayLine(e)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},s.prototype.ConstructMgControl=function(e,t,r){return 0===arguments.length?this.ConstructMgControl_0():3!==arguments.length||null!==e&&e.constructor!==Number||!(null===t||t instanceof b)||null!==r&&r.constructor!==Number?this.ConstructMgControl_2(e,t,r):this.ConstructMgControl_1(e,t,r)},s.prototype.ConstructMgControl_0=function(){return new P},s.prototype.ConstructMgControl_1=function(e,t,r){return new P(e,t,r)},s.prototype.ConstructMgControl_2=function(e,t,r){return new P(e,t,r)},s.prototype.alreadyMovedToFirstControl=function(){return this._task.getMGData().AlreadyMovedToFirstControl()},s.prototype.firstTableRefresh=function(){var t=Object.create(null,{firstTableRefresh:{get:function(){return e.prototype.firstTableRefresh}},SelectRow:{get:function(){return e.prototype.SelectRow}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return null===this._tableMgControl?[3,2]:(t.firstTableRefresh.call(this),this.setTableItemsCount(!1),[4,this.refreshTable()]);case 1:e.sent(),t.SelectRow.call(this),e.label=2;case 2:return[2]}}))}))},s.prototype.InsertTableItems=function(e,t){null!=this._tableMgControl&&(this.Rows.InsertRange(e,new Array(t)),this.InsertTableChildrenArrays(e,t),this._lastRowSent=-1),this.setTableItemsCount(!1)},s.prototype.setTableItemsCount=function(t){var n;this.isTableWithAbsoluteScrollbar()?this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_CREATE&&this._task.getMode()==r.Constants.TASK_MODE_CREATE?(n=this.GetDataview().getSize(),this.GetDataview().RecordsBeforeCurrentView>0&&(this.GetDataview().RecordsBeforeCurrentView=0,this.SetRecordsBeforeCurrentView(0),this.RefreshUI())):(n=this.GetDataview().TotalRecordsCount>0?this.GetDataview().TotalRecordsCount:1,this.SetRecordsBeforeCurrentView(this.GetDataview().RecordsBeforeCurrentView)):n=this.GetDataview().getSize(),e.prototype.SetTableItemsCount.call(this,this.GetDataview().getSize(),n,t)},s.prototype.InitTableControl=function(e,t,r){0!==arguments.length?this.InitTableControl_01(e,t,r):this.InitTableControl_00()},s.prototype.InitTableControl_00=function(){var e=1;if(this.isTableWithAbsoluteScrollbar()&&this.GetDataview().TotalRecordsCount>0){var t=this.GetDataview().RecordsBeforeCurrentView;e=this.GetDataview().TotalRecordsCount,n.Commands.addWithNumber(n.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW,this._tableMgControl,t)}this.InitTableControl(1,e,!1),this.SetTableTopIndex()},s.prototype.InitTableControl_01=function(t,r,a){null!==this._tableMgControl&&(a?(n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_FIRST,this._tableMgControl,0,!0),n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_LAST,this._tableMgControl,0,!0)):(n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_FIRST,this._tableMgControl,0,this.GetDataview().IncludesFirst()||this.GetDataview().IsOneWayKey),n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_LAST,this._tableMgControl,0,this.GetDataview().IncludesLast()),n.Commands.addBoolWithLine(n.CommandType.SET_EMPTY_DATAVIEW,this._tableMgControl,0,this.GetDataview().isEmptyDataview())),e.prototype.InitTableControl.call(this,t,r,a),this.checkAndCreateRowsEvent())},s.prototype.SetTableTopIndex=function(){if(null!==this._tableMgControl){var e=this.GetDataview().getTopRecIdx();e===t.Int32.MinValue&&(e=0),this.isTableWithPagination()||this.GetDataview().IncludesLast()&&e+this._rowsInPage>this.GetDataview().getSize()&&(this.GetDataview().IncludesFirst()||this.GetDataview().getSize()>this._rowsInPage+1)&&(e=Math.max(this.GetDataview().getSize()-this._rowsInPage,0),this.GetDataview().setTopRecIdx(e),this._topIndexUpdated=!0),(e!==this._prevGuiTopIndex||this.IsMovingInView)&&(n.Commands.addWithNumber(n.CommandType.SET_TABLE_TOP_INDEX,this._tableMgControl,e),this._prevGuiTopIndex=this.getGuiRowidx(e))}},s.prototype.createForm=function(){e.prototype.createForm.call(this),s.CreatedForms.add(this)},s.prototype.UpdateStatusBar=function(e,t,r){},s.prototype.initInnerObjects=function(t){if(null===t)return!1;var a=n.Manager.GetCurrentRuntimeContext().Parser;return t===r.XMLConstants.MG_TAG_RECOMPUTE?(r.Logger.Instance.WriteDevToLog("goes to recompute form"),this._task.RecomputeFillData(a),!0):e.prototype.initInnerObjects.call(this,t)},s.prototype.toString=function(){return"{"+this.constructor.name+": task="+this._task+", Id="+this._userStateId+"}"},s.prototype.GetHiddenControlListXML=function(){var e=new t.StringBuilder;return null!==this.hiddenControlsIsnsList&&this.hiddenControlsIsnsList.length>0&&(e.Append("<"+E.MG_TAG_HIDDEN_CONTOLS+" "+E.MG_ATTR_ISNS+'="'),this.hiddenControlsIsnsList.forEach((function(t){e.Append(t+",")})),e.Remove(e.Length-1,1),e.Append('"/>'),this.hiddenControlsIsnsList=null),e.ToString()},s.prototype.ShouldBehaveAsModal=function(){var e=!1;if(this._task.IsInteractive||this._task.isMainProg()){var t=this._task.ParentTask;null===t||t.IsInteractive||t.isMainProg()||(e=t.ShouldNonInteractiveChildBeModal())}else e=b.ShouldNonInteractiveBeModal();return e},s.prototype.isTableWithPagination=function(){return this.isTableWithAbsoluteScrollbar()},s.prototype.isTableWithAbsoluteScrollbar=function(){var e=!1;return null!==this._tableMgControl&&(e=this._tableMgControl.IsTableWithAbsoluteScrollbar()),e},s.prototype.SetRecordsBeforeCurrentView=function(e){null!==this._tableMgControl&&n.Commands.addWithNumber(n.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW,this._tableMgControl,e)},s.prototype.buildFormName=function(){var e=this.UniqueName,t=this.getTask();for(e=t.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"_"+e;t.IsSubtask;)e=(t=t.StudioParentTask).getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"_"+e;return e=(e=e.replace(/ /g,"_")).replace(/-/g,"_")},s.prototype.fetchPrevChunkForCurrentPage=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(r){switch(r.label){case 0:return this.isTableWithAbsoluteScrollbar()&&this.GetDataview().TotalRecordsCount>0&&((e=this.GetDataview().RecordsBeforeCurrentView%this._rowsInPage)>0&&0===this.DisplayLine)?(t={guiMgControl:this.getTableCtrl(),Line:e,Val:""},[4,this.setRowData(-e,!1,t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},s.prototype.getGuiRowidx=function(e){return e+this.GetDataview().RecordsBeforeCurrentView},s.prototype.getDvRowIdx=function(e){return e-this.GetDataview().RecordsBeforeCurrentView},s}(n.MgFormBase);rr.TIME_LIMIT=50,rr._createdForms=new tr;var nr=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.GetTaskTag=function(e){return e},t.prototype.GetDataviewManagerForVirtuals=function(e){return e.DataviewManager.RemoteDataviewManager},t.prototype.PrepareTask=function(t){t.DataViewWasRetrieved=!0;var n=e.prototype.PrepareTask.call(this,t);return t.getMGData().IsModal&&null!==t.getForm()&&(t.getForm().ConcreteWindowType=r.WindowType.Overlay),n},t.prototype.GetEventTaskId=function(e,t,r){return t},t.prototype.ShouldEvaluatePropertyLocally=function(e){return!1},t.prototype.InitTaskPrefixExecutedFlag=function(e){e.TaskPrefixExecuted=!0},t.prototype.RemoveRecomputes=function(e,t){e.DataView.GetFieldsTab().resetRecomp()},t.prototype.GetOwnerTransactionTask=function(e){var t=e;return null!==e.DataviewManager.RemoteDataviewManager.Transaction&&(t=e.DataviewManager.RemoteDataviewManager.Transaction.OwnerTask),t},t.PreparePropMainDisplay=function(e){return e.ComputeMainDisplay(),e.FormIsLegal()?Pt.SuccessfulResult:new Pt(r.MsgInterface.BRKTAB_STR_ERR_FORM)},t}(Dt),ar=function(){function e(e){this.Columns=null,this._table=null,this._id=0,this._table=e,this.Columns=new t.List}return e.prototype.FillData=function(e){for(this.FillAttributes(e);this.InitInnerObjects(e,e.getNextTag()););},e.prototype.FillAttributes=function(e){var n,a,s,i=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==i&&i<e.getXMLdata().length){a=e.getXMLsubstring(i),e.add2CurrIndex(a.indexOf(E.MG_ATTR_KEY)+E.MG_ATTR_KEY.length),n=r.XmlParser.getTokens(e.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM);for(var o=0;o<n.length;o+=2){s=n.get_Item(o);var l=n.get_Item(o+1);s===r.XMLConstants.MG_ATTR_ID?this._id=r.XmlParser.getInt(l):s===r.XMLConstants.MG_ATTR_TYPE?r.Logger.Instance.WriteDevToLog("in Key.fillAttributes() obsolete attribute (TODO: remove from server)"+s):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",s))}e.setCurrIndex(++i)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Key.fillAttributes() out of string bounds")},e.prototype.InitElements=function(e){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case r.XMLConstants.MG_ATTR_ID:this.Columns.push(this._table.FldsTab.getField(r.XmlParser.getInt(s)));break;case r.XMLConstants.MG_ATTR_SIZE:case E.MG_ATTR_DIR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",a))}}},e.prototype.InitInnerObjects=function(e,t){if(null===t)return!1;if(t!==E.MG_TAG_COLUMN)return t==="/"+E.MG_ATTR_KEY?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LinksTable.initInnerObjects(): "+t),!1);var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_COLUMN)+E.MG_TAG_COLUMN.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);this.InitElements(s),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Key.initInnerObjects() out of string bounds");return!0},e.prototype.GetKeyId=function(){return this._id},e}(),sr=function(){function e(){}return e.left=function(e){return 2*e+1},e.right=function(e){return 2*e+2},e.sort=function(t){var r,n,a,s,i,o=t.length;if(!(o<=1)){var l=o-1,u=Math.floor(o/2);do{n=u-=1;do{a=n,s=e.left(n),i=e.right(n),s<=l&&t[s].CompareTo(t[a])>0&&(n=s),i<=l&&t[i].CompareTo(t[n])>0&&(n=i),n!==a&&(r=t[n],t[n]=t[a],t[a]=r)}while(n!==a)}while(u>0);u=o;do{l-=1;var c=u-=1;r=t[c],t[c]=t[0],t[0]=r,n=0;do{a=n,s=e.left(n),i=e.right(n),s<=l&&t[s].CompareTo(t[a])>0&&(n=s),i<=l&&t[i].CompareTo(t[n])>0&&(n=i),n!==a&&(r=t[n],t[n]=t[a],t[a]=r)}while(n!==a)}while(u>1)}},e}(),ir=function(){function e(){this._tables=null,this._tables=new t.Hashtable}return e.prototype.GetTableById=function(e){return this._tables.get_Item(e)},e.prototype.TableExists=function(e){var t=!0;return null===this.GetTableById(e)&&(t=!1),t},e.prototype.InsertTable=function(e){var t=!1;return this.TableExists(e.GetTableUniqueId())||(this._tables.set_Item(e.GetTableUniqueId(),e),t=!0),t},e.prototype.LoadTable=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:if(a=le.GetInstance(),!this.TableExists(e))return[3,5];s=this._tables.get_Item(e),T.label=1;case 1:return T.trys.push([1,3,,4]),[4,a.GetContent(e,!0)];case 2:i=T.sent();try{n.RuntimeContextBase.Instance.Parser.loadTableCacheData(i)}catch(r){throw r instanceof t.Exception?new t.ApplicationException("Unable to parse resident table "+e+", due to unsupported encoding.",r):r}return[3,4];case 3:if(!((o=T.sent())instanceof t.Exception))throw o;return r.Misc.WriteStackTrace(o),[3,4];case 4:for(s.FillData(),l=new t.List,u=this._tables.Values;u.MoveNext();)c=u.Current,c.GetTableCommonIdentifier()===s.GetTableCommonIdentifier()&&c.GetTableUniqueId()!==e&&l.push(c.GetTableUniqueId());for(_=0;_<l.length;_+=1)this._tables.Remove(l.get_Item(_));T.label=5;case 5:return[2]}}))}))},e}();ir.Instance=new ir;var or=function(){function e(e){this._keys=null,this._records=null,this._currSortDir="\0",this._currSortKey=0,this.FldsTab=null,this._isLoaded=!1,this._tableIdent=null,this._tableUId=null,this._tableUId=e,this._keys=new t.List,this._records=new t.List,this._isLoaded=!1}return e.prototype.SetTableIdent=function(e){null===this._tableIdent?this._tableIdent=e:this._tableIdent!==e&&r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.setTableIdent() already set and table identifier does not match")},e.prototype.FillData=function(){var e=n.RuntimeContextBase.Instance.Parser;for(this.FillAttributes(e);this.InitInnerObjects(e,e.getNextTag()););},e.prototype.FillAttributes=function(e){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_CACHED_TABLE)+E.MG_TAG_CACHED_TABLE.length);for(var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),i=0;i<s.length;i+=2){var o=s.get_Item(i),l=s.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:-1===this._tableUId.indexOf(l)&&(this._tableUId=l,r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() table unique id does not match"));break;case r.XMLConstants.MG_ATTR_NAME:break;case E.MG_ATTR_IDENT:this._tableIdent!==l&&(this._tableIdent=l,r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() table identifier id does not match"));break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",o))}}e.setCurrIndex(++n)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() out of string bounds")},e.prototype.InitInnerObjects=function(e,t){if(null==t)return!1;switch(t){case r.XMLConstants.MG_TAG_FLDH:this.FldsTab=new Mt,this.FldsTab.fillData(e);break;case E.MG_ATTR_KEY:(n=new ar(this)).FillData(e),this._keys.push(n);break;case E.MG_TAG_RECORDS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_RECORDS_END:e.setCurrIndex2EndOfTag();break;case E.MG_TAG_CACHED_TABLE_END:return e.setCurrIndex2EndOfTag(),!1;case E.MG_TAG_REC:var n;(n=new gt(this)).Initialize(),n.fillData(e),this._records.push(n)}return!0},e.prototype.GetTableUniqueId=function(){return this._tableUId},e.prototype.GetTableCommonIdentifier=function(){return this._tableIdent},e.prototype.GetCurrSortKey=function(){return this._currSortKey},e.prototype.GetKeyById=function(e){for(var t=0;t<this._keys.length;t+=1)if(this._keys.get_Item(t).GetKeyId()===e)return this._keys.get_Item(t);return null},e.prototype.Load=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._isLoaded?[3,2]:[4,ir.Instance.LoadTable(this._tableUId)];case 1:e.sent(),this._isLoaded=!0,e.label=2;case 2:return[2]}}))}))},e.prototype.SortTable=function(e,t){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:return this._isLoaded?[3,2]:[4,this.Load()];case 1:a.sent(),a.label=2;case 2:if(e!==this._currSortKey||t!==this._currSortDir)for(this._currSortDir=t,this._currSortKey=e,r=this._records.ToArray(),sr.sort(r),"D"===this._currSortDir&&this.ReverseVector(r),n=0;n<this._records.length;n+=1)this._records.set_Item(n,r[n]);return[2]}}))}))},e.prototype.Fetch=function(t){var r=t.length>0;if(this._isLoaded){if(!r)return 0!==this._records.length?this._records.get_Item(0):null;for(var n=0;n<this._records.length;n+=1){var a=this._records.get_Item(n);if(e.validateRec(a,t))return a}}return null},e.validateRec=function(e,t){for(var r=!0,n=0;n<t.length;n+=1){var a=t.get_Item(n);if(!a.checkRange(e.GetFieldValue(a.getCacheTableFldId()),e.IsNull(a.getCacheTableFldId()))){r=!1;break}}return r},e.prototype.ReverseVector=function(e){for(var t=e.length-1,r=0;r<Math.floor((e.length-1)/2);r++,t--){var n=e[r];e[r]=e[t],e[t]=n}},e}(),lr=function(e){function a(t){var r=e.call(this,t)||this;return r._table=null,r._lastFetchRecPos=null,r}return u(a,e),a.prototype.setAttribute=function(t,r){switch(t){case E.MG_ATTR_CACHED_TABLE:ir.Instance.TableExists(r)?this._table=ir.Instance.GetTableById(r):(this._table=new or(r),ir.Instance.InsertTable(this._table));break;case E.MG_ATTR_IDENT:this._table.SetTableIdent(r);break;default:e.prototype.setAttribute.call(this,t,r)}},a.prototype.getLinkedRecord=function(e){return T(this,void 0,void 0,(function(){var r,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:if(r=this._task.DataView.GetFieldsTab().getLinkFields(this._id),n=!1,!this._cond.getVal())return[3,15];if(null!=this.Loc)return[3,5];this.Loc=new t.List,s=0,o.label=1;case 1:return s<r.length?null==(a=r.get_Item(s).Locate)?[3,3]:(this.Loc.push(a),[4,a.compute(!1)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return[3,9];case 5:s=0,o.label=6;case 6:return s<this.Loc.length?[4,this.Loc.get_Item(s).compute(!1)]:[3,9];case 7:o.sent(),o.label=8;case 8:return s++,[3,6];case 9:return[4,this._table.SortTable(this._keyIdx,this._dir)];case 10:return o.sent(),null!=(i=this._table.Fetch(this.Loc))?[3,12]:[4,this.initRec(e,r,!1)];case 11:return o.sent(),[3,14];case 12:return n=!0,[4,this.copyLinkFldToRec(e,r,i,!0)];case 13:o.sent(),o.label=14;case 14:return[3,17];case 15:return[4,this.initRec(e,r,!1)];case 16:o.sent(),o.label=17;case 17:return[2,n]}}))}))},a.prototype.copyLinkFldToRec=function(e,t,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:for(this._lastFetchRecPos=r.getDbPosVal(),a=0;a<t.length;a++)s=t.get_Item(a),e.setFieldValue(s.getId(),r.GetFieldValue(s.CacheTableFldIdx),!1),e.clearFlag(s.getId(),gt.FLAG_INVALID),s.invalidate(!0,!1);return[4,this.SetReturnValue(e,n,!0)];case 1:return i.sent(),[2]}}))}))},a.prototype.initRec=function(e,t,r){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return this._lastFetchRecPos="#",[4,this.InitLinkFields(e)];case 1:return n.sent(),null!=(t=this.ReturnField)&&(e.setFieldValue(t.getId(),r?"1":"0",!1),t.invalidate(!0,!1)),[2]}}))}))},a.prototype.getLastFetchedDbPos=function(){return this._lastFetchRecPos},a.prototype.SetReturnValue=function(e,t,a){return T(this,void 0,void 0,(function(){var e,s,i;return h(this,(function(l){switch(l.label){case 0:return null===(e=this.ReturnField)?[3,3]:(s=e.getTask()!==this.Task,o.eventsManager.pushNewExecStacks(),i=t?"1":"0",e.getType()===r.StorageAttribute.NUMERIC&&(i=n.DisplayConvertor.Instance.toNum(i,new n.PIC(e.getPicture(),r.StorageAttribute.NUMERIC,0),0)),[4,e.setValueAndStartRecompute(i,!1,a,!1,!1,s)]);case 1:return l.sent(),o.eventsManager.popNewExecStacks(),a||e.setModified(),e.invalidate(!0,!1),e.getTask()===this.Task?[3,3]:[4,e.updateDisplay()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))},a}(ft),ur=function(){function e(){}return e.prototype.CreateDataviewHeaders=function(e,t){return new lr(e)},e}(),cr=function(){function e(e,t,n){this._dataviewHeaders=null,this._task=null,this._dataviewHeadersFactory=null,this._dataviewHeaders=t,this._task=e,this._dataviewHeadersFactory=new ur,r.JSON_Utils.JSONFromXML(n,this.FillFromJSON.bind(this))}return e.prototype.FillFromJSON=function(e,r){if(null!=e)throw e;var n=r[E.MG_TAG_LINKS][E.MG_TAG_LINK];if(!a.isNullOrUndefined(n)&&n.constructor===Array)for(var s=0;s<n.length;s++){var i=n[s].$;if(!a.isNullOrUndefined(i[E.MG_ATTR_TABLE_INDEX])){var o=+i[E.MG_ATTR_TABLE_INDEX],l=this._dataviewHeadersFactory.CreateDataviewHeaders(this._task,o),u=new t.Dictionary;for(var c in i)c!==E.MG_ATTR_TABLE_INDEX&&u.Add(c,i[c]);l.SetAttributes(u),this._dataviewHeaders.set_Item(l.Id,l)}}},e}(),_r=function(){function e(e){this._dataviewHeaders=null,this._task=null,this._task=e,this._dataviewHeaders=new t.Hashtable}return e.prototype.fillData=function(e){for(;this.initInnerObjects(e,e.getNextTag()););},e.prototype.initInnerObjects=function(e,t){if(null===t)return!1;if(t===E.MG_TAG_LINKS){var n=e.getXMLdata().indexOf(E.MG_TAG_LINKS_END,e.getCurrIndex())+E.MG_TAG_LINKS_END.length+1,a=e.getXMLsubstring(n);a=r.XmlParser.escapeUrl(a);new cr(this._task,this._dataviewHeaders,a);e.setCurrIndex(n+r.XMLConstants.TAG_CLOSE.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LinksTable.initInnerObjects(): "+t)},e.prototype.getDataviewHeaderById=function(e){return this._dataviewHeaders.get_Item(e)},e.prototype.buildDbPosString=function(){if(0===this._dataviewHeaders.Count)return null;for(var e=new t.StringBuilder,r=this._dataviewHeaders.Values;r.MoveNext();){var n=r.Current instanceof lr?r.Current:null;if(null!==n){var a=n.getLastFetchedDbPos();e.Append("@"),null!==a&&e.Append(a)}}return e.Append("@"),e.ToString()},e.prototype.getDataiewHeadersCount=function(){return this._dataviewHeaders.Count},e}(),Tr=function(){function e(){this._operations=new t.List,this._firstBlockOperIdx=t.Int32.MaxValue}return e.prototype.fillData=function(e,t,r){for(;this.initInnerObjects(r.getNextTag(),e,t,r););for(var n=this._firstBlockOperIdx;n<this._operations.length;n+=1){var a=this._operations.get_Item(n),s=a.getType();if(s===E.MG_OPER_LOOP||s===E.MG_OPER_BLOCK||s===E.MG_OPER_ELSE){var i=this.serverId2operIdx(a.getBlockClose(),n+1);a.setBlockClose(i),i=this.serverId2operIdx(a.getBlockEnd(),i),a.setBlockEnd(i)}}},e.prototype.initInnerObjects=function(e,r,n,a){if(null!=e&&e===E.MG_TAG_OPER){var s=new it;return s.fillData(r,n,a),this._operations.push(s),this._firstBlockOperIdx!==t.Int32.MaxValue||s.getType()!==E.MG_OPER_LOOP&&s.getType()!==E.MG_OPER_BLOCK||(this._firstBlockOperIdx=this._operations.length-1),!0}return!1},e.prototype.getSize=function(){return this._operations.length},e.prototype.getOperation=function(e){if(e>=0&&e<this._operations.length)return this._operations.get_Item(e);throw new t.ApplicationException("in OperationTable.getOperation() index out of bounds: "+e)},e.prototype.serverId2operIdx=function(e,t){for(var r=-1,n=t;n<this._operations.length;n+=1){if(e===this._operations.get_Item(n).getServerId()){r=n;break}}return r},e.prototype.serverId2FollowingOperIdx=function(e,t){for(var r=-1,n=t;n<this._operations.length;n+=1){if(e<this._operations.get_Item(n).getServerId()){r=n;break}}return r},e}(),hr=function(){function e(){this._enabledExp=new st(!0),this._operationTab=null,this._propagateExp=new st(!0),this._isHandlerOnForm=!1,this._ctrl=null,this._ctrlName=null,this._dvLen=0,this._dvPos=0,this._evt=null,this._handledByClient=!1,this._handlerFld=null,this._hasParameters=!1,this._id=0,this._level="\0",this._scope=null,this._task=null,this._taskMgdID=-1,this._operationTab=new Tr}return e.prototype.getCtrlName=function(){return this._ctrlName},e.prototype.fillData=function(e,t){for(null===this._task&&(this._task=e,this._taskMgdID=this._task.getMgdID());this.initInnerObjects(t,t.getNextTag()););var r=this._task.DataView;this._hasParameters=r.ParametersExist(this._dvPos,this._dvLen)},e.prototype.initInnerObjects=function(e,t){if(null===t)return!1;if(t===E.MG_TAG_HANDLER)this.initInnerElements(e,this._task);else if(t===E.MG_TAG_OPER)this._operationTab.fillData(this._task,this,e);else{if(t!==E.MG_TAG_EVENT||null!==this._evt)return t==="/"+E.MG_TAG_HANDLER?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("there is no such tag in EventHandler.initInnerObjects() "+t),!1);this._evt=new k,this._evt.fillData(e,this._task),(this._evt.getType()===E.EVENT_TYPE_TIMER||this._evt.getType()===E.EVENT_TYPE_USER&&this._evt.getUserEventType()===E.EVENT_TYPE_TIMER)&&this._task.getMGData().addTimerHandler(this),(this._evt.getType()===E.EVENT_TYPE_INTERNAL&&this._evt.getInternalCode()===r.InternalInterface.MG_ACT_ZOOM||this._evt.getType()===E.EVENT_TYPE_USER&&null!==this._evt.getUserEvent()&&this._evt.getUserEventType()===E.EVENT_TYPE_INTERNAL&&this._evt.getUserEvent().getInternalCode()===r.InternalInterface.MG_ACT_ZOOM)&&!this._task.getEnableZoomHandler()&&(null!==this._handlerFld?this._handlerFld.setHasZoomHandler():null!==this._ctrl?this._ctrl.HasZoomHandler=!0:this._task.setEnableZoomHandler())}return!0},e.prototype.initInnerElements=function(e,t){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_HANDLER)+E.MG_TAG_HANDLER.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.initElements(s,t),void e.setCurrIndex(++n)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Handler.FillData() out of string bounds")},e.prototype.initElements=function(e,t){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case E.MG_ATTR_HANDLEDBY:this._handledByClient=s.toUpperCase()==="C".toUpperCase();break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(s);break;case E.MG_ATTR_LEVEL:this._level=s[0];break;case E.MG_ATTR_OBJECT:var i=r.XmlParser.unescape(s);this._ctrlName=r.XmlParser.unescape(i).toUpperCase(),this.calculateCtrlFromControlName(t);break;case E.MG_ATTR_VARIABLE:this._handlerFld=this._task.DataView.getField(r.XmlParser.getInt(s)),this._handlerFld.setHasChangeEvent();break;case E.MG_ATTR_SCOPE:this._scope=s[0];break;case E.MG_ATTR_PROPAGATE:this._propagateExp.setVal(t,s);break;case E.MG_ATTR_ENABLED:this._enabledExp.setVal(t,s);break;case E.MG_ATTR_DVPOS:var o=s.indexOf(",");if(o>-1){this._dvLen=r.XmlParser.getInt(s.substr(0,o)),this._dvPos=r.XmlParser.getInt(s.substr(o+1));for(var l=this._dvPos;l<this._dvPos+this._dvLen;l++){this._task.DataView.getField(l).IsEventHandlerField=!0}}break;case E.MG_ATTR_HANDLER_ONFORM:this._isHandlerOnForm=r.XmlParser.getBoolean(s);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventHandler class. Insert case to EventHandler.initElements for "+a)}}},e.prototype.calculateCtrlFromControlName=function(e){t.NString.IsNullOrEmpty(this._ctrlName)||(this._ctrl=null!==e.getForm()?e.getForm().getCtrlByCtrlName(this._ctrlName):null)},e.prototype.isSpecificHandlerOf=function(e){if(null===this._ctrl&&null===this._ctrlName&&null===this._handlerFld&&!this._isHandlerOnForm)return!1;if(this._scope===r.BrkScope.Task&&this._task!==e.getTask())return!1;if(this._evt.equals(e)){if(null!==this._handlerFld)return this._handlerFld===e.getFld();if(null===e.Control||this._isHandlerOnForm){if(null===e.Control&&this._isHandlerOnForm)return!0}else{var t=e.Control.getControlNameForHandlerSearch();if(null!==t&&this._ctrlName.toLowerCase()===t.toLowerCase())return!0}}return!1},e.prototype.isNonSpecificHandlerOf=function(e){if(null!==this._ctrl||null!==this._ctrlName||null!==this._handlerFld||this._isHandlerOnForm)return!1;if(this._scope===r.BrkScope.Task&&this._task!==e.getTask()&&e.getType()!==E.EVENT_TYPE_TIMER)return!1;if(this._scope===r.BrkScope.Global&&this._task!==e.getTask())return!1;if(this._evt.getType()===E.EVENT_TYPE_USER&&this._evt.getUserEventType()===E.EVENT_TYPE_NOTINITED)try{this._evt.findUserEvent()}catch(e){if(!(e instanceof t.ApplicationException))throw e}return this._evt.equals(e)},e.prototype.isGlobalHandlerOf=function(e){return this._scope===r.BrkScope.Global&&(null==this._ctrl&&null==this._ctrlName&&null==this._handlerFld&&!this._isHandlerOnForm&&this._evt.equals(e))},e.prototype.isGlobalSpecificHandlerOf=function(e){return this._scope===r.BrkScope.Global&&((null!=this._ctrl||null!=this._ctrlName||null!=this._handlerFld)&&(null!=this._ctrlName&&this._evt.equals(e)&&t.NString.Equals(this._ctrlName,e.Control.Name,!0)))},e.prototype.execute=function(e,n,a){return T(this,void 0,void 0,(function(){var s,i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L;return h(this,(function(h){switch(h.label){case 0:s=null,l=0,u=!1,c=this._task.getBrkLevel(),_=this._task.getBrkLevelIndex(),T=0,null!==u&&this._evt.getType()!==E.EVENT_TYPE_EXPRESSION&&(this._evt.getType()!==E.EVENT_TYPE_USER||this._evt.getUserEvent().getType()!==E.EVENT_TYPE_EXPRESSION&&this._evt.getUserEvent().getType()!==E.EVENT_TYPE_TIMER)?this._evt.getType()!==E.EVENT_TYPE_USER_FUNC&&this._task.setBrkLevel(e.getBrkLevel(),this._id):this._task.setBrkLevel(this._evt.getBrkLevel(),this._id),p=e.getArgList(),h.label=1;case 1:return h.trys.push([1,,18,19]),g=U.Instance,e.getType()!==E.EVENT_TYPE_INTERNAL||e.getInternalCode()!==r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE||this._task.IsRoute()||this._task===o.mgDataTable.StartupMgData.getFirstTask()?(d=-1,n&&(d=o.eventsManager.getNextOperIdx(this._operationTab.getOperation(0),!1)),(I=-1===d&&!a)?[4,this.isEnabled()]:[3,3]):[2,new pr(!0,!0)];case 2:I=!h.sent(),h.label=3;case 3:return I?[2,new pr(!0,!1)]:this._scope!==r.BrkScope.Task||e.getType()!==E.EVENT_TYPE_TIMER&&e.getType()!==E.EVENT_TYPE_EXPRESSION||(f=G.Instance.getLastFocusedTask(),this._task===f)?this._handledByClient?(C=e.getType()!==E.EVENT_TYPE_USER)?[4,this._evt.dataEventIsTrue()]:[3,5]:[2,new pr(!1,!0)]:[2,new pr(!0,!0)];case 4:C=!h.sent(),h.label=5;case 5:if(C)return[2,new pr(!1,!0)];if(e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_TASK_SUFFIX&&(u=!0),e.getType()===E.EVENT_TYPE_INTERNAL)switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_PREFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_REC_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_SUFFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_SUFFIX,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_PREFIX,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_VARIABLE:g.addTaskFlowFld(r.InternalInterface.MG_ACT_VARIABLE,e.getFld().getName(),V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_VERIFICATION,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_PREFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_SUFFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;default:g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_START,this._task.GetTaskDetails())}else g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_START,this._task.GetTaskDetails());h.label=6;case 6:return h.trys.push([6,12,13,15]),null!==u&&(s=e.Control),A=o.mgDataTable.currMgdID,R=!1,S=new t.RefParam(R),this._evt.getType()===E.EVENT_TYPE_TIMER&&A!==e.getMgdID()&&(o.mgDataTable.currMgdID=e.getMgdID(),S.value=!0),[4,this.resetLocalVariables(p)];case 7:return h.sent(),T=this._task.getLoopStackSize(),M=null,this._operationTab.getSize()>0?[4,this.executeOperations(0,this._operationTab.getSize()-1,u,A,l,S,!1,!1,-1)]:[3,9];case 8:M=h.sent(),h.label=9;case 9:return R=S.value,null!==M?[2,M]:u?[3,11]:[4,this._task.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 10:h.sent(),h.label=11;case 11:return R&&(null===(m=o.mgDataTable.getMGData(A))||m.IsAborting||(o.mgDataTable.currMgdID=A)),[3,15];case 12:if((v=h.sent())instanceof ae)throw r.Logger.Instance.LogLevel!==r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteExceptionToLog(v),v;if(v instanceof t.Exception)return r.Logger.Instance.WriteExceptionToLog(v),[2,new pr(!1,!0)];throw v;case 13:return[4,this._propagateExp.getVal()];case 14:for(i=h.sent(),L=this._task.getLoopStackSize();L>T;L=L--)this._task.popLoopCounter();return[7];case 15:return null===p?[3,17]:[4,this.getArgValsFromFlds(p)];case 16:h.sent(),h.label=17;case 17:if(e.getType()===E.EVENT_TYPE_INTERNAL)switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_PREFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_REC_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_SUFFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_PREFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_SUFFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_SUFFIX,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_PREFIX,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_VARIABLE:g.addTaskFlowFld(r.InternalInterface.MG_ACT_VARIABLE,e.getFld().getName(),V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_VERIFICATION,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;default:g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_END,this._task.GetTaskDetails())}else g.addTaskFlowHandler(this._evt.getBrkLevel(!0),1,this._task.GetTaskDetails());return[3,19];case 18:return this._task.setBrkLevel(c,_),[7];case 19:return[2,new pr(i,!0)]}}))}))},e.prototype.executeOperations=function(e,t,n,a,s,i,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:p=-1,g=!1,d=this._task.getMGData(),I=e,C=!1,S=U.Instance,M=!1,u?(g=u,p=c):(_=this._operationTab.getOperation(I),(p=o.eventsManager.getNextOperIdx(_,!0))>-1?(g=!0,l&&(C=!0)):g=!1),h.label=1;case 1:return!(I<=t)||o.eventsManager.GetStopExecutionFlag()||d.IsAborting||M||l&&C&&this._operationTab.getOperation(t).getServerId()<p?[3,35]:(_=this._operationTab.getOperation(I),T=_.getType(),C=!1,le.GetInstance().DelayCommandExecution?(this._task.setUseLoopStack(s>0),[4,_.operServer(null)]):[3,3]);case 2:return h.sent(),[3,35];case 3:if(g&&_.getServerId()<p){if(T!==E.MG_OPER_BLOCK)return[3,34];if(this._operationTab.getOperation(_.getBlockEnd()).getServerId()<p)return[3,34]}return n?[3,5]:[4,this._task.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 4:h.sent(),h.label=5;case 5:return this._taskMgdID!==a&&(i.value=!0),!this._task.isMainProg()&&this._task.isOpenWin()&&(o.mgDataTable.currMgdID=this._taskMgdID),[4,o.eventsManager.CheckAndShowSpinner(!0)];case 6:switch(h.sent(),T){case E.MG_OPER_VERIFY:return[3,7];case E.MG_OPER_LOOP:return[3,9];case E.MG_OPER_BLOCK:return[3,18];case E.MG_OPER_ENDBLOCK:return[3,27];case E.MG_OPER_CALL:return[3,29]}return[3,31];case 7:return[4,_.execute(g)];case 8:return h.sent()?("TS"!==this._task.getBrkLevel()&&o.eventsManager.setStopExecution(!0),this._task.getInRecordSuffix()&&this._task.getLevel()===r.Constants.TASK_LEVEL_TASK&&this._task.setLevel(r.Constants.TASK_LEVEL_RECORD),[2,new pr(!1,!0)]):[3,33];case 9:return this._task.enterLoop(),this._task.increaseLoopCounter(),this._task.setUseLoopStack(!0),[4,S.addFlowFieldOperation(_,!0,this._task.GetTaskDetails())];case 10:if(h.sent(),R=!1,_.getExecOnServer())return[3,15];h.label=11;case 11:return[4,_.execute(!1)];case 12:return h.sent()?[4,this.executeOperations(I+1,_.getBlockClose()-1,n,a,s+1,i,!1,!1,-1)]:[3,14];case 13:return null!==(f=h.sent())?[2,f]:d.IsAborting||o.eventsManager.GetStopExecutionFlag()?[3,14]:(this._task.increaseLoopCounter(),this._task.setUseLoopStack(!0),[3,11]);case 14:return[3,17];case 15:return[4,_.execute(!1)];case 16:h.sent()&&(R=!0),h.label=17;case 17:return R||(I=_.getBlockEnd()-1),this._task.leaveLoop(),[3,33];case 18:return I,!_.getExecOnServer()||g&&_.getServerId()<p?(this._task.setUseLoopStack(!0),!g||_.getServerId()>=p?[4,this.getSignificantBlock(I,_.getBlockEnd())]:[3,20]):[3,22];case 19:return I=h.sent(),[3,21];case 20:I=this.getStartBlockIfIdxByOper(I,p),h.label=21;case 21:return[3,24];case 22:return this._task.setUseLoopStack(s>0),[4,_.operServer(null)];case 23:if(h.sent(),(p=o.eventsManager.getNextOperIdx(_,!0))>-1){if(g=!0,l&&(C=!0),p<this._operationTab.getOperation(_.getBlockEnd()).getServerId())for(;this._operationTab.getOperation(_.getBlockClose()).getServerId()<p;)I=_.getBlockClose(),_=this._operationTab.getOperation(I)}else g=!1,I=-1;h.label=24;case 24:return-1===I?[3,26]:(A=!0,_=this._operationTab.getOperation(I),g&&this._operationTab.getOperation(_.getBlockClose()).getServerId()<=p&&(A=!1,C=!0),A?[4,this.executeOperations(I+1,_.getBlockClose()-1,n,a,s+1,i,!0,g,p)]:[3,26]);case 25:if(null!==(f=h.sent()))return f.ReturnedFromServer?(g=f.ReturnedFromServer,p=f.NextOperIdx,C=f.BlockIfReturnedFromServer,I=_.getBlockEnd()-1,[3,34]):[2,f];h.label=26;case 26:return I=_.getBlockEnd()-1,[3,33];case 27:return[4,S.addFlowFieldOperation(_,!0,this._task.GetTaskDetails())];case 28:return h.sent(),[3,33];case 29:return this._task.setUseLoopStack(s>0),[4,_.execute(g)];case 30:return M=h.sent(),[3,33];case 31:return this._task.setUseLoopStack(s>0),[4,_.execute(g)];case 32:return h.sent(),[3,33];case 33:C||((p=o.eventsManager.getNextOperIdx(_,!0))>-1?(g=!0,l&&(C=!0)):g=!1),h.label=34;case 34:return I+=1,[3,1];case 35:return[2,f=M?new pr(!1,!0):C?new pr(p,g,C):null]}}))}))},e.prototype.getSignificantBlock=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:r=-1,s.label=1;case 1:return e<t?(n=this._operationTab.getOperation(e),(a=n.getType())!==E.MG_OPER_BLOCK&&a!==E.MG_OPER_ELSE&&a!==E.MG_OPER_SERVER?[3,3]:[4,n.execute(!1)]):[3,3];case 2:return s.sent()?(r=e,[3,3]):(e=n.getBlockClose(),[3,1]);case 3:return[2,r]}}))}))},e.prototype.getStartBlockIdxByEnd=function(e){var t,r=-1,n=!1;for(t=e-1;t>=0&&!n;t--){var a=this._operationTab.getOperation(t),s=a.getType();s!==E.MG_OPER_BLOCK&&s!==E.MG_OPER_LOOP||a.getBlockEnd()===e&&(r=t,n=!0)}return r},e.prototype.getStartBlockIdxByElse=function(e){var t,r=-1,n=!1,a=this._operationTab.getOperation(e).getBlockEnd();for(t=e-1;t>=0&&!n;t--){var s=this._operationTab.getOperation(t);s.getType()===E.MG_OPER_BLOCK&&s.getBlockEnd()===a&&(r=t,n=!0)}return r},e.prototype.getStartBlockIfIdxByOper=function(e,t){var r=-1,n=!1,a=this._operationTab.serverId2operIdx(t,e)-1;for(-2===a&&(a=this._operationTab.serverId2FollowingOperIdx(t,e)-1);a>=0&&!n;){var s=this._operationTab.getOperation(a).getType();if(s===E.MG_OPER_BLOCK)a===e?(r=a,n=!0):a--;else if(s===E.MG_OPER_ELSE){var i=this.getStartBlockIdxByElse(a);i===e?(r=a,n=!0):a=i-1}else s===E.MG_OPER_ENDBLOCK?a=this.getStartBlockIdxByEnd(a)-1:a--}return r},e.prototype.getLevel=function(){return this._level},e.prototype.getEvent=function(){return this._evt},e.prototype.getId=function(){return this._id},e.prototype.getStaticCtrl=function(){return this._ctrl},e.prototype.getRunTimeCtrl=function(){return o.eventsManager.getLastRtEvent().Control},e.prototype.isEnabled=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._enabledExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.resetLocalVariables=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s;return h(this,(function(i){switch(i.label){case 0:t=this._task.DataView,r=0,i.label=1;case 1:i.trys.push([1,13,,14]),n=this._dvPos,i.label=2;case 2:return n<this._dvPos+this._dvLen?(a=t.getField(n),s=!this._hasParameters||a.isParam(),null!==e&&r<e.getSize()&&s?e.getArg(r).skipArg()?[3,4]:[4,e.getArg(r).setValueToField(a)]:[3,7]):[3,12];case 3:return i.sent(),[3,6];case 4:return a.invalidate(!0,M.CLEAR_FLAGS),[4,a.compute(!1)];case 5:i.sent(),i.label=6;case 6:return r++,[3,9];case 7:return a.invalidate(!0,M.CLEAR_FLAGS),[4,a.compute(!1)];case 8:i.sent(),i.label=9;case 9:return[4,a.updateDisplay()];case 10:i.sent(),i.label=11;case 11:return n++,[3,2];case 12:return[3,14];case 13:throw i.sent();case 14:return[2]}}))}))},e.prototype.getArgValsFromFlds=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:t=this._task.DataView,r=0,n=this._dvPos,l.label=1;case 1:return n<this._dvPos+this._dvLen&&r<e.getSize()?(a=t.getField(n),this._hasParameters&&!a.isParam()?[3,5]:(s=e.getArg(r)).getType()!==E.ARG_TYPE_FIELD||null===(i=s.getField()).getTask()||i.getTask().isAborting()?[3,4]:(o=a.getValue(!1),[4,i.setValueAndStartRecompute(o,a.isNull(),!0,a.isModified(),!1)])):[3,6];case 2:return l.sent(),[4,i.updateDisplay()];case 3:l.sent(),l.label=4;case 4:r++,l.label=5;case 5:return n++,[3,1];case 6:return[2]}}))}))},e.prototype.getTask=function(){return this._task},e.prototype.argsMatch=function(e){for(var t=!0,n=this._task.DataView,a=0,s=0,i=this._dvPos;i<this._dvPos+this._dvLen;i++){var o=n.getField(i);if(o.isParam()&&(s++,a<e.length)){var l=o.getType(),u=e[a].Attr;if(!e[a].IsNull&&!r.StorageAttributeCheck.isTheSameType(l,u)&&!r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(l,u)){t=!1;break}a++}}return s!==e.length&&(t=!1),t},e.prototype.getOperationTab=function(){return this._operationTab},e.prototype.getControlNameForControlHeader=function(){return this.getEvent().getType()==E.EVENT_TYPE_INTERNAL&&this.getEvent().isControlHeader()&&!a.isNullOrUndefined(this._ctrl)?this.getCtrlName():t.NString.Empty},e.prototype.getVarNameForVariableHeader=function(){return this.getEvent().isVariableHeader()&&!a.isNullOrUndefined(this._handlerFld)?this._handlerFld.getVarName().toUpperCase():t.NString.Empty},e.prototype.getEventHandlerInfo=function(){var e=new t.StringBuilder;this.getEvent().AppendDescription(e);var r=this.getControlNameForControlHeader()+this.getVarNameForVariableHeader();return e.Append(r),t.NString.IsNullOrEmpty(e.toString())||(e=new t.StringBuilder(" "+e.toString(),e.toString().length+1)),t.NString.Format("Handler {0}{1}",this.getEvent().getEventType(),e)},e.prototype.checkTaskScope=function(e){return!(this._scope===r.BrkScope.Task&&!e)},e.prototype.toString=function(){return t.NString.Format("(Handler for {0} on task {1}, scope {2})",this._evt,this._task,this._scope)},e}(),pr=function(){function e(e,t,r){this.BlockIfReturnedFromServer=!1,this.Enabled=!1,this.NextOperIdx=0,this.Propagate=!1,this.ReturnedFromServer=!1,2===arguments.length?this.constructor_0(e,t):this.constructor_1(e,t,r)}return e.prototype.constructor_0=function(e,t){this.Propagate=e,this.Enabled=t,this.NextOperIdx=0,this.ReturnedFromServer=!1,this.BlockIfReturnedFromServer=!1},e.prototype.constructor_1=function(e,t,r){this.Propagate=!1,this.Enabled=!0,this.NextOperIdx=e,this.ReturnedFromServer=t,this.BlockIfReturnedFromServer=r},e}(),gr=function(){function e(){this._handlers=null,this._handlers=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EVENTHANDLERS)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==E.MG_TAG_HANDLER)return t==="/"+E.MG_TAG_EVENTHANDLERS?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in HandlersTable. Insert else if to HandlersTable.initInnerObjects for "+t),!1);var a=new hr;a.fillData(n,e),this._handlers.push(a)}return!0},e.prototype.add=function(e){this._handlers.push(e)},e.prototype.CalculateControlFormControlName=function(){this._handlers.forEach((function(e){e.calculateCtrlFromControlName(e.getTask())}))},e.prototype.remove=function(e){this._handlers.RemoveAt(e)},e.prototype.insertAfter=function(e,t){this._handlers.Insert(t,e)},e.prototype.getSize=function(){return this._handlers.length},e.prototype.getHandler=function(e){return e<0||e>=this._handlers.length?null:this._handlers.get_Item(e)},e.prototype.hasExpressionHandler=function(){for(var e=0;e<this._handlers.length;e++){var t=this.getHandler(e).getEvent();if(t.getType()===E.EVENT_TYPE_EXPRESSION||t.getType()===E.EVENT_TYPE_USER&&t.getUserEventType()===E.EVENT_TYPE_EXPRESSION)return!0}return!1},e.prototype.startTimers=function(e){var t=ge.Instance;if(null!==this._handlers)for(var r=this.getTimersVector(),n=0;n<r.length;n++)t.startTimer(e,r.get_Item(n),!1)},e.prototype.getTimersVector=function(){for(var e=new t.List,r=0;r<this._handlers.length;r++){var n=this.getHandler(r).getEvent(),a=void 0;a=n.getType()===E.EVENT_TYPE_TIMER?n.getSeconds():n.getSecondsOfUserEvent();for(var s=!1,i=0;i<e.length;i++)if(a===e.get_Item(i)){s=!0;break}s||e.push(a)}return e},e}(),dr=function(){function e(){}return e.prototype.fillAttributes=function(e){for(var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),a=e.getXMLdata().indexOf(r.XMLConstants.MG_TAG_RECOMPUTE,e.getCurrIndex())+r.XMLConstants.MG_TAG_RECOMPUTE.length,s=null,i=r.XmlParser.getTokens(e.getXMLdata().substr(a,n-a),'"'),l=0;l<i.length;l+=2){var u=i.get_Item(l),c=i.get_Item(l+1);u===r.XMLConstants.MG_ATTR_TASKID?s=o.mgDataTable.GetTaskByID(c):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",u))}return e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),s},e.prototype.fillData=function(e){var n=this.fillAttributes(e);if(null===n)throw new t.ApplicationException("in RecomputeTable.fillData() invalid task id: ");r.Logger.Instance.WriteDevToLog("goes to refill recompute"),this.fillData_1(n.DataView,n,e)},e.prototype.fillData_1=function(e,t,r){for(;this.initInnerObjects(r,r.getNextTag(),e,t););},e.prototype.initInnerObjects=function(e,t,n,a){if(null===t)return!1;if(t===r.XMLConstants.MG_TAG_RECOMPUTE)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==r.XMLConstants.MG_TAG_FLD)return t==="/"+r.XMLConstants.MG_TAG_RECOMPUTE?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in <recompute>, add case to RecomputeTable.initInnerObjects for "+t),!1);(new Ct).fillData(n,a,e)}return!0},e}(),Er=function(){function e(){this._cmdToServer=null,this._cmdsToServer=null,this._computeBy="\0",this._expBytes=null,this._id=-1,this._prevResType=r.StorageAttribute.NONE,this._resultValue=null,this._task=null,this._type=r.StorageAttribute.NONE,this._clientStorageAttribute=r.StorageAttribute.NONE}return e.prototype.GetStorageAttribute=function(){return this._clientStorageAttribute},e.prototype.evaluateWithResultTypeAndLength=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,l,u;return h(this,(function(c){switch(c.label){case 0:return s=r.StorageAttribute.NONE,this.computedByClient()?[4,ct.eval(this._expBytes,e,this._task)]:[3,2];case 1:return i=c.sent(),a=i.IsNull?null:e===r.StorageAttribute.BLOB_VECTOR&&i.Attr===r.StorageAttribute.BLOB?n.VectorType.validateBlobContents(i.StrVal)?i.ToMgVal():null:i.Attr===r.StorageAttribute.BLOB_VECTOR&&e!==r.StorageAttribute.BLOB_VECTOR&&e!==r.StorageAttribute.BLOB?null:i.ToMgVal(),i.IsNull||(s=i.Attr),[3,4];case 2:return l=o.eventsManager.getLastRtEvent(),u=null,null!==l&&(u=l.getMainPrgCreator()),e!==this._prevResType&&(this._cmdToServer=Qe.CreateEvaluateCommand(this._task.getTaskTag(),e,this._id,t,u)),[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._cmdsToServer,this._cmdToServer,this)];case 3:c.sent(),a=e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR?this._resultValue:null!==this._resultValue&&" "===this._resultValue?"":n.RecordUtils.byteStreamToString(this._resultValue),c.label=4;case 4:return this._prevResType=e,e===r.StorageAttribute.NONE&&(this._clientStorageAttribute=s),[2,a]}}))}))},e.prototype.DiscardCndRangeResult=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,ct.DiscardCndRangeResult(this._expBytes,this._task)];case 1:return[2,e.sent()]}}))}))},e.prototype.evaluateWithResType=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,l;return h(this,(function(u){switch(u.label){case 0:return t=!1,this.computedByClient()?[4,ct.eval(this._expBytes,e,this._task)]:[3,2];case 1:return a=u.sent(),[3,4];case 2:return s=o.eventsManager.getLastRtEvent(),i=null,null!==s&&(i=s.getMainPrgCreator()),e!==this._prevResType&&(this._cmdToServer=Qe.CreateEvaluateCommand(this._task.getTaskTag(),e,this._id,0,i)),[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._cmdsToServer,this._cmdToServer,this)];case 3:u.sent(),l=void 0,null===(l=e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR?this._resultValue:null!==this._resultValue&&" "===this._resultValue?"":n.RecordUtils.byteStreamToString(this._resultValue))&&(t=!0),e===r.StorageAttribute.NONE&&(e=this._type),a=new n.ExpVal(e,t,l),u.label=4;case 4:return this._prevResType=e,[2,a]}}))}))},e.prototype.evaluateWithResLength=function(e){return T(this,void 0,void 0,(function(){var t,n,a;return h(this,(function(s){switch(s.label){case 0:return t=r.StorageAttribute.NONE,this.computedByClient()?[4,ct.eval(this._expBytes,t,this._task)]:[3,2];case 1:return a=s.sent(),n=a.IsNull?null:a.ToMgVal(),t=a.Attr,[3,4];case 2:return[4,this.evaluateWithResultTypeAndLength(t,e)];case 3:n=s.sent(),t=this._type,s.label=4;case 4:return[2,new Ir(n,t)]}}))}))},e.prototype.fillData=function(e,t){var n,a=t.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,t.getCurrIndex());if(null==this._task&&(this._task=e),-1!==a&&a<t.getXMLdata().length){var s=t.getXMLsubstring(a);t.add2CurrIndex(s.indexOf(E.MG_TAG_EXP)+E.MG_TAG_EXP.length),n=r.XmlParser.getTokens(t.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),this.initElements(n),t.setCurrIndex(a+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var t,n,a,s=0;s<e.length;s+=2)switch(n=e.get_Item(s),a=e.get_Item(s+1),n){case r.XMLConstants.MG_ATTR_VALUE:et.Instance.GetDebugLevel()>1?(t=a,this.buildByteArray(t)):this._expBytes=r.Misc.ToSByteArray(r.Base64.decodeToByte(a));break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(a);break;case E.MG_ATTR_COMPUTE_BY:this._computeBy=a[0];break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Expression.initElements class. Insert case to Expression.initElements for "+n)}this.computedByClient()||(this._cmdsToServer=this._task.getMGData().CmdsToServer)},e.prototype.buildByteArray=function(e){if(null===e||0===e.length||e.length%2>0)r.Logger.Instance.WriteExceptionToLogWithMsg("in Expression.buildByteArray() expStr cannot be changed "+e);else{this._expBytes=new Int8Array(e.length/2);for(var a=0;a<e.length;a+=2){var s=e.substr(a,2);this._expBytes[a/2]=n.NUM_TYPE.toSByte(t.NNumber.Parse(s,t.NumberStyles.HexNumber))}}},e.prototype.getId=function(){return this._id},e.prototype.computedByClient=function(){return"S"!==this._computeBy},e.prototype.computedByClientOnly=function(){return"C"===this._computeBy},e.prototype.computedByServerOnly=function(){return"S"===this._computeBy},e.prototype.getTask=function(){return this._task},e.prototype.SetResultValue=function(e,t){this._resultValue=e,this._type=t},e.prototype.toString=function(){return t.NString.Format("{{Expression #{0} of {1}}}",this._id,this._task)},e}(),Ir=function(e,t){this.mgVal=null,this.type=r.StorageAttribute.NONE,this.mgVal=e,this.type=t},fr=function(){function e(){this._exps=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EXP){var a=new Er;a.fillData(n,e),this._exps.push(a)}else{if(t!==E.MG_TAG_EXPTABLE)return t==="/"+E.MG_TAG_EXPTABLE?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in ExpTable.initInnerObjects(): "+t),!1);e.setCurrIndex(e.getXMLdata().indexOf(">",e.getCurrIndex())+1)}return!0},e.prototype.getExpById=function(e){var t;if(e<0)return null;for(var r=0;r<this._exps.length;r++){if((t=this._exps.get_Item(r)).getId()===e)return t;t=null}return t},e.prototype.getExp=function(e){var t=null;return e>=0&&e<this._exps.length&&(t=this._exps.get_Item(e)),t},e.prototype.getSize=function(){var e=0;return null!==this._exps&&(e=this._exps.length),e},e}(),Cr=function(){function e(){this._userEventsTab=null,this._userEventsTab=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;switch(t){case E.MG_TAG_EVENT:var a=new k;a.fillData(e,n),this._userEventsTab.push(a);break;case E.MG_TAG_USER_EVENTS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_USER_EVENTS_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in UserEventsTable.initInnerObjects : "+t),!1}return!0},e.prototype.getEvent=function(e){return e<0||null===this._userEventsTab||e>=this._userEventsTab.length?null:this._userEventsTab.get_Item(e)},e.prototype.getIdxByEvent=function(e){return this._userEventsTab.indexOf(e)},e.prototype.getSize=function(){return null===this._userEventsTab?0:this._userEventsTab.length},e}(),Ar=function(){function e(e,t){this._task=null,this._parentForm=null,this._formsStringXml=null,this._task=e,this._parentForm=t}return Object.defineProperty(e.prototype,"Count",{get:function(){return this._formsStringXml.length},enumerable:!1,configurable:!0}),e.prototype.get_Item=function(e){return e>0&&e<=this._formsStringXml.length?this._formsStringXml.get_Item(e-1):null},e.prototype.fillData=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:this._formsStringXml=new t.List,e=n.Manager.GetCurrentRuntimeContext().Parser,r.label=1;case 1:return[4,this.initInnerObjects(e.getNextTag())];case 2:return r.sent()?[3,1]:[3,3];case 3:return[2]}}))}))},e.prototype.InitFormFromXmlString=function(e){var t=this.get_Item(1);e>0&&e<=this._formsStringXml.length&&(t=this.get_Item(e)),null!==t&&(n.RuntimeContextBase.Instance.Parser.push(),n.RuntimeContextBase.Instance.Parser.PrepareFormReadString(t),this._task.FormInitData(this._parentForm),n.RuntimeContextBase.Instance.Parser.pop())},e.prototype.initInnerObjects=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return null===e?[2,!1]:(t=n.Manager.GetCurrentRuntimeContext().Parser,e!==r.XMLConstants.MG_TAG_FORMS?[3,1]:(t.setCurrIndex(t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex())+1),[3,5]));case 1:return e!==r.XMLConstants.MG_TAG_FORM?[3,2]:(a=n.RuntimeContextBase.Instance.Parser.ReadToEndOfCurrentElement(),this._formsStringXml.push(a),[2,!0]);case 2:return e!=="/"+r.XMLConstants.MG_TAG_FORM?[3,3]:(t.setCurrIndex2EndOfTag(),[2,!0]);case 3:return e!=="/"+r.XMLConstants.MG_TAG_FORMS?[3,5]:[4,this.PrepareMainDisplayForConnectedTask()];case 4:return s.sent(),t.setCurrIndex2EndOfTag(),[2,!1];case 5:return[2,!0]}}))}))},e.prototype.PrepareMainDisplayForConnectedTask=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._task.TaskService instanceof nr?[4,this._task.PrepareTaskForm()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}(),Rr=function(){function e(e){this._actCount=null,this._actState=null,this._parentTask=null,this._numerator=0,this._parentTask=e,this._numerator=0,this._actState=new Array(r.InternalInterface.MG_ACT_TOT_CNT);for(var t=0;t<this._actState.length;++t)this._actState[t]=!1;this._actCount=new Array(r.InternalInterface.MG_ACT_TOT_CNT);for(t=0;t<this._actCount.length;++t)this._actCount[t]=0}return e.prototype.enable=function(e,t){this._actState[e];this._actState[e]=t,t&&(this._numerator++,this._actCount[e]=this._numerator)},e.prototype.isEnabled=function(e){return this._actState[e]},e.prototype.getActCount=function(e){return this._actCount[e]},e.prototype.enableList=function(e,t,r){for(var n=0;n<e.length;n+=1){var a=e[n];(!r||this._actState[a]!==t)&&this.enable(a,t)}},e.prototype.enableNavigationActions=function(t){this.enableList(e.actNavigation,t,!1)},e}();Rr.actEnabled=[r.InternalInterface.MG_ACT_CLOSE,r.InternalInterface.MG_ACT_EXIT,r.InternalInterface.MG_ACT_RTO_MODIFY,r.InternalInterface.MG_ACT_RTO_CREATE,r.InternalInterface.MG_ACT_RTO_QUERY,r.InternalInterface.MG_ACT_OK,r.InternalInterface.MG_ACT_CANCEL,r.InternalInterface.MG_ACT_TBL_PRVFLD,r.InternalInterface.MG_ACT_TBL_NXTFLD,r.InternalInterface.MG_ACT_TBL_BEGLINE,r.InternalInterface.MG_ACT_TBL_ENDLINE,r.InternalInterface.MG_ACT_TBL_BEGPAGE,r.InternalInterface.MG_ACT_TAB_NEXT,r.InternalInterface.MG_ACT_TAB_PREV,r.InternalInterface.MG_ACT_TBL_ENDPAGE,r.InternalInterface.MG_ACT_USING_HELP,r.InternalInterface.MG_ACT_ABOUT,r.InternalInterface.MG_ACT_CTRL_HIT,r.InternalInterface.MG_ACT_HIT,r.InternalInterface.MG_ACT_WEB_ON_DBLICK,r.InternalInterface.MG_ACT_WEB_CLICK,r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW,r.InternalInterface.MG_ACT_RT_QUIT,r.InternalInterface.MG_ACT_SERVER_TERMINATION,r.InternalInterface.MG_ACT_SUBFORM_REFRESH,r.InternalInterface.MG_ACT_SUBFORM_CLOSE,r.InternalInterface.MG_ACT_EXIT_SYSTEM,r.InternalInterface.MG_ACT_SUBFORM_OPEN,r.InternalInterface.MG_ACT_COL_SORT,r.InternalInterface.MG_ACT_CTRL_MODIFY,r.InternalInterface.MG_ACT_ROLLBACK,r.InternalInterface.MG_ACT_EXT_EVENT,r.InternalInterface.MG_ACT_COL_CLICK,r.InternalInterface.MG_ACT_PRESS,r.InternalInterface.MG_ACT_ENABLE_EVENTS,r.InternalInterface.MG_ACT_COL_FILTER,r.InternalInterface.MG_ACT_INDEX_CHANGE,r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE,r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE,r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER,r.InternalInterface.MG_ACT_CONTEXT_REMOVE],Rr.actNavigation=[r.InternalInterface.MG_ACT_TBL_PRVLINE,r.InternalInterface.MG_ACT_TBL_PRVPAGE,r.InternalInterface.MG_ACT_TBL_BEGTBL,r.InternalInterface.MG_ACT_TBL_NXTLINE,r.InternalInterface.MG_ACT_TBL_NXTPAGE,r.InternalInterface.MG_ACT_TBL_ENDTBL];var Sr,Mr,mr,vr,Lr=function(){function e(){this._CommandsExecutedAfterTaskStarted=null,this._cmdFrame=0,this._unframedCmds=null,this._CommandsExecutedAfterTaskStarted=new t.List,this._cmdFrame=0,this._unframedCmds=new t.List}return e.prototype.getCommandsExecutedAfterTaskStarted=function(){return this._CommandsExecutedAfterTaskStarted},e.prototype.addCommandsExecutedAfterTaskStarted=function(e){this._CommandsExecutedAfterTaskStarted.push(e)},e.prototype.removeCommandsExecutedAfterTaskStarted=function(e){this._CommandsExecutedAfterTaskStarted.Remove(e)},e.prototype.add1toCmdFrame=function(){this._cmdFrame++},e.prototype.getCmdFrame=function(){return this._cmdFrame},e.prototype.addUnframedCmd=function(e){this._unframedCmds.push(e)},e.prototype.getUnframedCmds=function(){return this._unframedCmds},e}();Lr.Instance=new Lr,(Sr=e.EventsAllowedType||(e.EventsAllowedType={}))[Sr.NONE=0]="NONE",Sr[Sr.NON_INTERACTIVE=1]="NON_INTERACTIVE",Sr[Sr.ALL=2]="ALL",(Mr=e.Task_Flow||(e.Task_Flow={}))[Mr.NONE=0]="NONE",Mr[Mr.STEP=1]="STEP",Mr[Mr.FAST=2]="FAST",(mr=e.Task_Direction||(e.Task_Direction={}))[mr.BACK=-1]="BACK",mr[mr.NONE=0]="NONE",mr[mr.FORE=1]="FORE",function(e){e.NONE=" ",e.FAST_BACKWARD="R",e.FAST_FORWARD="F",e.STEP_BACKWARD="P",e.STEP_FORWARD="N"}(vr||(vr={}));var br=function(s){function i(e){var t=s.call(this)||this;return t._dvCache=null,t._mgData=null,t._aborting=!1,t._bExecEndTask=!1,t._isStarted=!1,t._evalOldValues=!1,t._inRecordSuffix=!1,t._cancelWasRaised=!1,t._counter=0,t._currStartProgLevel=0,t._destinationSubform=!1,t._enableZoomHandler=!1,t._firstRecordCycle=!1,t._originalTaskMode=" ",t._inCreateLine=!1,t.InSelect=!1,t.InStartProcess=!1,t._isDestinationCall=!1,t._knownToServer=!0,t._loopStack=null,t.DelayCommandExecution=!1,t._parentTask=null,t.ContextTask=null,t._triggeringTask=null,t.PathParentTask=null,t._preventControlChange=!1,t._preventRecordSuffix=!1,t._taskPath=null,t._tryingToCommit=!1,t._useLoopStack=!1,t._inProcessingTopMostEndTaskSaved=!1,t.InHandleActCancel=!1,t.RuntimeSorts=null,t.VewFirst=0,t.dataViewContent=null,t.PerformParentRecordPrefix=!1,t.ModeAsParent=!1,t.TaskTransactionManager=null,t.ExecuteClientSubformRefresh=!1,t.InCommonHandlerBeforeRP=!1,t._taskService=null,t.hasLocate=!1,t.taskDefinitionId=null,t.ArgumentsList=null,t.ConfirmUpdateNo=!1,t.DataSynced=!1,t.UniqueSort=null,t.RefreshOnVars=null,t.DvPosDescriptor=null,t.SubTasks=null,t.ExpTab=null,t.UserEvtTab=null,t.DataviewHeadersTable=null,t.HandlersTab=null,t._forms=null,t.Name=null,t.PublicName=null,t.TaskSuffixExecuted=!1,t.RetrunValueExp=0,t.SubformControl=null,a.isNullOrUndefined(e)?(t.constructor_0(),t):(t.constructor_1(e),t)}return u(i,s),Object.defineProperty(i.prototype,"ParentTask",{get:function(){return this._parentTask},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TryingToCommit",{get:function(){return this._tryingToCommit},set:function(e){this._tryingToCommit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskService",{get:function(){return null==this._taskService&&(this._taskService=new nr),this._taskService},enumerable:!1,configurable:!0}),Object.defineProperty(i,"CommandsProcessor",{get:function(){return Te.GetCommandsProcessor()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"LogicalStudioParentTask",{get:function(){return null!==this.StudioParentTask||s.prototype.isMainProg.call(this)?this.StudioParentTask:n.GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID,this._ctlIdx)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"KnownToServer",{get:function(){return this._knownToServer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Transaction",{get:function(){return this.DataviewManager.CurrentDataviewManager.Transaction},set:function(e){this.DataviewManager.CurrentDataviewManager.Transaction=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskDefinitionId",{get:function(){return null===this.taskDefinitionId&&(this.taskDefinitionId=new n.TaskDefinitionId(this._ctlIdx,this.ProgramIsn,this.TaskIsn,this._isPrg)),this.taskDefinitionId},enumerable:!1,configurable:!0}),Object.defineProperty(i,"IsBlockingBatch",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.constructor_0=function(){this.ActionManager=new Rr(this),this.DataView=new yt(this),this._flowMonitor=U.Instance,this.ContextTask=this,this._dvCache=new Ot(this),this.PerformParentRecordPrefix=!0,this.DataviewManager=new $t(this),this.allowRemoteCmdExecution=!0,this.TaskTransactionManager=new xt(this)},i.prototype.Init=function(){this.DataView.Init()},i.prototype.constructor_1=function(e){this.constructor_0(),this.PathParentTask=e,this._parentTask=e,this._triggeringTask=null,this.buildTaskPath()},i.CreateTask=function(){var e=new i;return e.Init(),e},i.prototype.isAborting=function(){return this._aborting},i.prototype.buildTaskPath=function(){this._taskPath=new t.List,null!==this._parentTask._taskPath&&this._taskPath.AddRange(this._parentTask._taskPath.GetEnumerator()),this._taskPath.push(this)},i.prototype.fillData=function(e,t){var r=Object.create(null,{isMainProg:{get:function(){return s.prototype.isMainProg}}});return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:r.isMainProg.call(this)||(null===this._parentTask&&null!==t.CallingTask&&(this._parentTask=t.CallingTask,this.buildTaskPath(),t.CallingTask.addSubTask(this)),null===this.PathParentTask&&null!==t.PathParentTask&&(this.PathParentTask=t.PathParentTask)),null!==this._parentTask&&this._parentTask.getEnableZoomHandler()&&this.setEnableZoomHandler(),this._mgData=e,this.fillAttributes(),this._mgData.addTask(this),a=null!==this._parentTask?this._parentTask.getForm():null,i.label=1;case 1:return[4,this.initInnerObjects(n.RuntimeContextBase.Instance.Parser.getNextTag(),a)];case 2:return i.sent()?[3,1]:[3,3];case 3:return this.TaskTransactionManager.PrepareTransactionProperties(this.DataviewManager.RemoteDataviewManager.Transaction,!1),this.HandleTriggerTask(),this.HandlePreviouslyActiveTaskId(),this.CheckAndSetSubForm(),this.IsSubForm&&(null!==(s=this.getParent().getForm().getSubFormCtrlForTask(this._taskTag))&&s.setSubformTaskId(this._taskTag),null!==this.Form&&this.Form.setSubFormCtrl(s)),[2]}}))}))},i.prototype.HandlePreviouslyActiveTaskId=function(){null!==this._parentTask&&null!==this._parentTask.GetContextTask()&&this._mgData!==this._parentTask.getMGData()?this.PreviouslyActiveTaskId=this._parentTask.GetContextTask().getTaskTag():null!==this._parentTask&&(this.PreviouslyActiveTaskId=this._parentTask.getTaskTag())},i.prototype.HandleTriggerTask=function(){this._triggeringTask=this._parentTask},i.prototype.FillTaskTables=function(e){1!==arguments.length?this.FillTaskTables_1():this.FillTaskTables_0(e)},i.prototype.FillTaskTables_0=function(e){},i.prototype.fillAttributes=function(){var e=n.RuntimeContextBase.Instance.Parser,t=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());-1!==t&&t<e.getXMLdata().length?(s.prototype.fillAttributes.call(this,e),s.prototype.isMainProg.call(this)&&(this._mgData=o.mgDataTable.getMGData(0))):r.Logger.Instance.WriteExceptionToLogWithMsg("in Task.fillAttributes() out of string bounds")},i.prototype.setAttribute=function(e,n){var a;if(!(a=s.prototype.setAttribute.call(this,e,n)))switch(a=!0,e){case E.MG_ATTR_REFRESHON:""!==n.trim()&&this.SetRefreshOnVars(n);break;case r.XMLConstants.MG_ATTR_NAME:this.Name=n;break;case E.MG_ATTR_DVPOS_DEC:""!==n.trim()&&this.setDescriptor(n);break;case E.MG_ATTR_HAS_LOCATE:this.hasLocate=!0;break;case E.MG_ATTR_AS_PARENT:this.ModeAsParent=!0;break;case E.MG_ATTR_TASK_UNIQUE_SORT:this.UniqueSort=n[0];break;case E.MG_ATTR_TRANS_ID:this.setRemoteTransaction(n);break;case E.MG_ATTR_PUBLIC:this.PublicName=r.XmlParser.unescape(n);break;case r.XMLConstants.MG_ATTR_IS_OFFLINE:this.IsOffline=r.XmlParser.getBoolean(n);break;case r.XMLConstants.MG_ATTR_RETURN_VALUE_EXP:this.RetrunValueExp=r.XmlParser.getInt(n);break;case r.XMLConstants.MG_ATTR_MENUS_FILE_NAME:break;default:a=!1}return a||r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e)),!0},i.prototype.initInnerObjects=function(e,a){return T(this,void 0,void 0,(function(){var s,l,u,c;return h(this,(function(_){switch(_.label){case 0:if(null==e)return[2,!1];switch(s=n.RuntimeContextBase.Instance.Parser,e){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,3];case r.XMLConstants.MG_TAG_FORM:return[3,4];case r.XMLConstants.MG_ATTR_MENU_CONTENT:return[3,5];case"assemblies":return[3,6];case r.XMLConstants.MG_TAG_FORMS:return[3,7];case r.XMLConstants.MG_TAG_TASK:return[3,9];case E.MG_TAG_TASKURL:return[3,11];case E.MG_TAG_EXPTABLE:return[3,13];case E.MG_TAG_USER_EVENTS:return[3,14];case E.MG_TAG_LINKS:return[3,15];case E.MG_TAG_SORTS:return[3,16];case E.MG_TAG_TASK_TABLES:return[3,17];case r.XMLConstants.MG_TAG_RECOMPUTE:return[3,18];case E.MG_TAG_EVENTHANDLERS:return[3,19]}return[3,20];case 1:return null==this._helpTab&&(this._helpTab=new n.Helps),n.Events.ShouldLog(r.Logger_LogLevels.Development)&&n.Events.WriteDevToLog(t.NString.Format("{0} ...",e)),this._helpTab.fillData(s),[3,21];case 2:return n.Events.ShouldLog(r.Logger_LogLevels.Development)&&n.Events.WriteDevToLog(t.NString.Format("{0} ...",e)),this.DataView.fillHeaderData(s),[3,21];case 3:return this._propTab.fillData(this,"T",s),[3,21];case 4:return this.Form=this.FormInitData(a),[3,21];case 5:return[3,21];case 6:return s.getCurrIndex(),l=s.getXMLdata().indexOf("/assemblies",s.getCurrIndex()),s.setCurrIndex(l),s.setCurrIndex2EndOfTag(),[3,21];case 7:return this._forms=new Ar(this,a),r.Logger.Instance.WriteDevToLog(t.NString.Format("{0} ...",e)),[4,this._forms.fillData()];case 8:case 10:case 12:return _.sent(),[3,21];case 9:return null==this.SubTasks&&(this.SubTasks=new O),(u=new i(this)).Init(),this.SubTasks.addTask(u),c=this._mgData,this.isMainProg()&&(c=o.mgDataTable.GetMGDataForStartupProgram()),[4,u.fillData(c,new y)];case 11:return[4,i.ProcessTaskURL()];case 13:return null==this.ExpTab&&(this.ExpTab=new fr),r.Logger.Instance.WriteDevToLog("goes to exp"),this.ExpTab.fillData(this,s),[3,21];case 14:return null==this.UserEvtTab&&(this.UserEvtTab=new Cr),r.Logger.Instance.WriteDevToLog("goes to user event tab"),this.UserEvtTab.fillData(this,s),[3,21];case 15:return this.DataviewHeadersTable=new _r(this),this.DataviewHeadersTable.fillData(s),[3,21];case 16:return this.RuntimeSorts=new er,this.RuntimeSorts.fillData(this,s),[3,21];case 17:return this.FillTaskTables(),[3,21];case 18:return r.Logger.Instance.WriteDevToLog("goes to recompute"),this.RecomputeFillData(s),[3,21];case 19:return r.Logger.Instance.WriteDevToLog("goes to eventhandlers"),null==this.HandlersTab&&(this.HandlersTab=new gr),this.HandlersTab.fillData(this,s),this.addExpHandlersToMGData(),[3,21];case 20:return e==="/"+r.XMLConstants.MG_TAG_TASK?(n.RuntimeContextBase.Instance.Parser.setCurrIndex2EndOfTag(),[2,!1]):(r.Logger.Instance.WriteDevToLog("There is no such tag in Task.initInnerObjects . Enter case for "+e),[2,!1]);case 21:return[2,!0]}}))}))},i.prototype.RecomputeFillData=function(e){(new dr).fillData_1(this.DataView,this,e)},i.prototype.FillTaskTables_1=function(){var e=n.RuntimeContextBase.Instance.Parser,t=e.getXMLdata().indexOf(E.MG_TAG_TASK_TABLES_END,e.getCurrIndex());t=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t)+r.XMLConstants.TAG_CLOSE.length;var a=e.getXMLsubstring(t);this.FillTaskTables(a),e.setCurrIndex(t)},i.prototype.addExpHandlersToMGData=function(){for(var e=0,t=this.HandlersTab.getSize()-1;t>=0;t--){var r=this.HandlersTab.getHandler(t),n=r.getEvent();(n.getType()===E.EVENT_TYPE_EXPRESSION||n.getType()===E.EVENT_TYPE_USER&&n.getUserEventType()===E.EVENT_TYPE_EXPRESSION)&&(this._mgData.addExpHandler(r,e),e++)}},i.prototype.SetRefreshOnVars=function(e){var n,a,s=r.StrUtil.tokenize(e,","),i=new t.List;for(a=0;a<s.length;a++)n=t.NNumber.Parse(s[a]),i.push(n);for(this.RefreshOnVars=new Array(i.length),a=0;a<i.length;a++)n=i.get_Item(a),this.RefreshOnVars[a]=n},i.prototype.setDataSynced=function(e){this.DataSynced=e},i.prototype.getField=function(e){return this.DataView.getFieldByName(e)},i.prototype.getExpById=function(e){return null!==this.ExpTab?this.ExpTab.getExpById(e):(r.Logger.Instance.WriteExceptionToLogWithMsg("in Task.GetExpById(): no expression table"),null)},i.prototype.getExpObjectById=function(e){return this.getExpById(e)},i.prototype.GetExpressionStorage=function(e){var r=null;if(e>0){var n=this.getExpById(e);t.Debug.Assert(null!==n),r=n.GetStorageAttribute()}return r},i.prototype.CalculateExpression=function(e,r,n,a,s){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=null,e>0?(s=this.getExpById(e),t.Debug.Assert(null!==s),[4,s.evaluateWithResultTypeAndLength(r,n)]):[3,2];case 1:a=i.sent(),i.label=2;case 2:return[2,a]}}))}))},i.prototype.insertRecordTable=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.isCached()];case 1:return r.sent()&&!this.DataView.getFirstDv()&&e&&(this.hasLocate?this.locatePutInCache():this.DataView.IncludesFirst()&&(this.DataView.getChanged()?this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0):this._dvCache.putInCache(this.DataView.replicate()))),[4,this.DataView.fillData(t)];case 2:return r.sent(),e&&this.DataView.setChanged(!1),[2]}}))}))},i.prototype.getHandlersTab=function(){return this.HandlersTab},i.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.IsAfterRetryBeforeBuildXML=this.getAfterRetry(),!this.KnownToServer||this.IsOffline?[3,2]:(e.Append(r.XMLConstants.START_TAG+r.XMLConstants.MG_TAG_TASK),e.Append(" "+r.XMLConstants.MG_ATTR_TASKID+'="'+this.getTaskTag()+'"'),e.Append(" "+E.MG_ATTR_TASK_MAINLEVEL+'="'+this.getMainLevel()+'"'),e.Append(r.XMLConstants.TAG_CLOSE),[4,this.DataView.buildXML(e)]);case 1:t.sent(),null!=this.Form&&this.Form.Opened&&e.Append(this.Form.GetHiddenControlListXML()),e.Append("\n </"+r.XMLConstants.MG_TAG_TASK+r.XMLConstants.TAG_CLOSE),t.label=2;case 2:return[2]}}))}))},i.prototype.buildXMLForRngs=function(e,t,a){var s,i=r.StorageAttribute.SKIP,o=et.Instance.GetDebugLevel()<=1;for(e.Append(r.XMLConstants.TAG_CLOSE),s=0;s<t.length;s++){e.Append(r.XMLConstants.START_TAG+E.USER_RNG);var l=t.get_Item(s);e.Append(" "+r.XMLConstants.MG_TAG_FLD+'="'+l.veeIdx+'"');var u=this.DataView.getField(l.veeIdx-1).getType();if(l.nullMin&&e.Append(" "+E.NULL_MIN_RNG+'="1"'),!l.discardMin&&null!=l.min){var c=n.RecordUtils.itemValToXML(l.min,u,i,o);e.Append(" "+E.MIN_RNG+'="'+c+'"')}if(l.nullMax&&e.Append(" "+E.NULL_MAX_RNG+'="1"'),!l.discardMax&&null!=l.max){c=n.RecordUtils.itemValToXML(l.max,u,i,o);e.Append(" "+E.MAX_RNG+'="'+c+'"')}e.Append(r.XMLConstants.TAG_TERM)}a?e.Append(r.XMLConstants.END_TAG+E.USER_LOCATES+r.XMLConstants.TAG_CLOSE):e.Append(r.XMLConstants.END_TAG+E.USER_RANGES+r.XMLConstants.TAG_CLOSE)},i.prototype.buildXMLForSorts=function(e){if(null!=this.UserSorts&&this.UserSorts.length>0){var t=void 0;for(t=0;t<this.UserSorts.length;t++){e.Append(r.XMLConstants.TAG_CLOSE);var n=this.UserSorts.get_Item(t);e.Append(r.XMLConstants.START_TAG+E.SORT),e.Append(" "+r.XMLConstants.MG_TAG_FLD+'="'+n.fldIdx+'"'),n.dir&&e.Append(" "+E.MG_ATTR_DIR+'="1"'),e.Append(r.XMLConstants.TAG_TERM)}this.UserSorts.Clear(),this.UserSorts=null,e.Append(r.XMLConstants.END_TAG+E.MG_TAG_SORTS+r.XMLConstants.TAG_CLOSE)}},i.prototype.getUserEvent=function(e){t.Debug.Assert(null!==this.UserEvtTab);var r=null;return null!==this.UserEvtTab&&(r=this.UserEvtTab.getEvent(e)),r},i.prototype.SetMoveToFirstControl=function(e){!e&&this.IsSubForm||null!==this.Form&&(this.Form.alreadyMovedToFirstControl()||(this.Form.MovedToFirstControl=!0))},i.prototype.Start=function(t,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return n=null,this._isStarted?[3,5]:(this._isStarted=!0,this.InitializeExecution(),this.InStartProcess=!0,[4,this.Setup()]);case 1:return(a=l.sent()).Success?(this._inProcessingTopMostEndTaskSaved=o.eventsManager.getProcessingTopMostEndTask(),o.eventsManager.setProcessingTopMostEndTask(!1),[4,this.EnableActions()]):[2,null];case 2:return l.sent(),[4,this.InitializeForm(t)];case 3:return(a=l.sent()).Success?(this.IsInteractive||this._isMainPrg||(n=this),this.DataViewWasRetrieved=!0,s=this.SubTasks,this.isMainProg()&&(this.SubTasks=null),this.isMainProg()&&(this.SubTasks=s),a.Success?this._aborting?[2,null]:(i=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.FirstChunk),[4,this.DataviewManager.Execute(i)]):[2,null]):[2,null];case 4:if(!(a=l.sent()).Success)return[2,null];l.label=5;case 5:return[4,this.StartSubTasks(t,n,r)];case 6:return n=l.sent(),this.InStartProcess=!1,[2,n]}}))}))},i.prototype.InitializeExecution=function(){s.prototype.setBrkLevel.call(this,E.BRK_LEVEL_REC_MAIN,-1),this._firstRecordCycle=!0,this._currStartProgLevel=this.IsSubForm&&this.getParent().getForm().alreadyMovedToFirstControl()?this.getParent()._currStartProgLevel:i.StartProgLevel},i.prototype.InitializeForm=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return null===this.Form?[3,2]:(this.SetMoveToFirstControl(e),o.eventsManager.pushNewExecStacks(),this.routeParams=this.DataView.GetRouteParams(),[4,this.InitForm()]);case 1:t.sent(),o.eventsManager.popNewExecStacks(),this.getMGData().StartTimers(),n.Commands.beginInvoke(),t.label=2;case 2:return[2,new Pt]}}))}))},i.prototype.StartSubTasks=function(e,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:if(!this.hasSubTasks())return[3,4];a=0,i.label=1;case 1:return a<this.SubTasks.getSize()?[4,this.SubTasks.getTask(a).Start(e,n)]:[3,4];case 2:s=i.sent(),null===r?r=s:null!==s&&t.Debug.Assert(!1,"more than 1 non interactive in task.start"),i.label=3;case 3:return a+=1,[3,1];case 4:return[2,r]}}))}))},i.prototype.EnableActions=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(a){switch(a.label){case 0:return e=Rr.actEnabled,this.ActionManager.enableList(e,!0,!1),this.IsSubForm&&this.ActionManager.enable(r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT,!0),[4,this.enableModes()];case 1:return a.sent(),[4,this.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)];case 2:return a.sent()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_SELECT,!0),[4,this.checkProp(n.PropInterface.PROP_TYPE_PRINT_DATA,!1)];case 3:return t=a.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_PRINT_DATA,t),this.getEnableZoomHandler()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),[2]}}))}))},i.prototype.ShowError=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(a){switch(a.label){case 0:return t=pe.Instance.translate(e),r=pe.Instance.translate(E.ERROR_STRING),[4,ge.Instance.MessageBox(r,t,n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)];case 1:return a.sent(),[2]}}))}))},i.prototype.EndTaskOnError=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return e.Success||this.isAborting()?[3,8]:this.InStartProcess?[4,this.endTask(!1,!1,!1)]:[3,4];case 1:return n.sent(),t?[4,this.ShowError(e.ErrorDescription)]:[3,3];case 2:n.sent(),n.label=3;case 3:return this.InStartProcess=!1,[2,!0];case 4:return t?[4,this.ShowError(e.ErrorDescription)]:[3,6];case 5:n.sent(),n.label=6;case 6:return[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_EXIT)];case 7:n.sent(),n.label=8;case 8:return[2,!1]}}))}))},i.prototype.Setup=function(){return T(this,void 0,void 0,(function(){var t,r,n,a,s;return h(this,(function(i){switch(i.label){case 0:return this.TaskService.InitTaskPrefixExecutedFlag(this),this.TaskSuffixExecuted=!1,Dt.CreateFirstRecord(this),r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Init),[4,this.DataviewManager.Execute(r)];case 1:if(!(t=i.sent()).Success)return[2,t];if(!t.Success)return[3,7];n=Lr.Instance.getCommandsExecutedAfterTaskStarted(),a=0,i.label=2;case 2:return a<n.length?(s=n.get_Item(a)).TaskTag!==this.getTaskTag()?[3,4]:[4,s.Execute(null)]:[3,5];case 3:i.sent(),Lr.Instance.removeCommandsExecutedAfterTaskStarted(s),i.label=4;case 4:return a++,[3,2];case 5:return r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Prepare),[4,this.DataviewManager.Execute(r)];case 6:t=i.sent(),i.label=7;case 7:return t.Success?(t=this.TaskService.PrepareTask(this)).Success?[3,9]:[4,this.EndTaskOnError(t,!0)]:[3,9];case 8:i.sent(),i.label=9;case 9:return t.Success?(r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.InitDataControlViews),[4,this.DataviewManager.Execute(r)]):[3,11];case 10:t=i.sent(),i.label=11;case 11:return[2,t]}}))}))},i.prototype.doFirstRecordCycle=function(){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:return this._isMainPrg?[3,8]:(o.eventsManager.pushNewExecStacks(),this.SubformExecMode=e.Task_SubformExecModeEnum.FIRST_TIME,[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(this,r.InternalInterface.MG_ACT_REC_PREFIX,this.IsSubForm)]);case 1:if(a.sent(),o.eventsManager.GetStopExecutionFlag())return[3,7];if(!this.IsSubForm)return[3,7];if(!this.hasSubTasks())return[3,5];t=0,a.label=2;case 2:return t<this.SubTasks.getSize()?(n=this.SubTasks.getTask(t)).IsSubForm?(n.getForm().IgnoreFirstRecordCycle=!0,[4,n.doFirstRecordCycle()]):[3,4]:[3,5];case 3:a.sent(),a.label=4;case 4:return t++,[3,2];case 5:return[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 6:a.sent(),a.label=7;case 7:this.SubformExecMode=e.Task_SubformExecModeEnum.SET_FOCUS,o.eventsManager.popNewExecStacks(),a.label=8;case 8:return[2]}}))}))},i.prototype.CheckAndSetSubForm=function(){this.IsSubForm=!s.prototype.isMainProg.call(this)&&this!==this._mgData.getFirstTask()},i.prototype.IsRoute=function(){return null!=this.RouterPath},i.prototype.stop=function(){return T(this,void 0,void 0,(function(){var r,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(this.getForm(),this._aborting)return[2];if(!this.hasSubTasks())return[3,3];u.label=1;case 1:return null==(r=this.SubTasks.getTask(0))?[3,3]:(r.setDestinationSubform(this._destinationSubform),[4,r.stop()]);case 2:return u.sent(),[3,1];case 3:return this._isMainPrg||(this._aborting=!0),null!=this._parentTask&&(this._parentTask.removeSubTask(this),this.IsSubForm&&(a=new t.List,s=new t.List,null!=(i=this.getMGData()).getTimerHandlers()&&(a=i.getTimerHandlers().getTimersVector()),i.removeTimerHandler(this),i.removeExpressionHandler(this),null!=i.getTimerHandlers()&&(s=i.getTimerHandlers().getTimersVector()),i.changeTimers(a,s),i.removeTask(this),ge.Instance.abort(this.getForm()))),this.AbortTransaction(),null!=this.getClickedControl()&&(n.RuntimeContextBase.Instance.CurrentClickedCtrl=null),null!=this.Form&&this.Form.removeRefsToCtrls(),this.IsSubForm?((o=this.Form.getSubFormCtrl()).setSubformTaskId(null),o.initSubformTask(),G.Instance.getLastFocusedTask()===this&&G.Instance.setLastFocusedTask(this._parentTask),o.SubformLoaded?[4,o.getProp(n.PropInterface.PROP_TYPE_VISIBLE).RefreshDisplay(!0)]:[3,5]):[3,5];case 4:u.sent(),u.label=5;case 5:return l=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Clear),[4,this.DataviewManager.Execute(l)];case 6:return u.sent(),[2]}}))}))},i.prototype.abort=function(){this.getMGData().abort()},i.prototype.hasSubTasks=function(){return null!==this.SubTasks&&this.SubTasks.getSize()>0},i.prototype.getTaskDepth=function(e){if(e)return this.getTaskDepth_(e);var t=this.GetContextTask().getTaskDepth_(e);return this.isMainProg()&&this.getCtlIdx()!==E.TOP_LEVEL_CONTAINER&&(t+=1),t},i.prototype.getTaskDepth_=function(e){var t=this.getTriggeringTask();return null==t||e?null==this._parentTask?1:e&&this.getCtlIdx()!==this._parentTask.getCtlIdx()?2+this._parentTask.getTaskDepth_(e):1+this._parentTask.getTaskDepth_(e):1+t.getTaskDepth_(e)},i.prototype.GetTaskAncestor=function(e){return this.getTaskAncestor_(e)},i.prototype.getTaskAncestor_=function(e){var t=null;if(0===e)t=this;else{var r=this.getTriggeringTask();null===r&&(r=this._parentTask),null!==r&&(t=r.getTaskAncestor_(--e))}return t},i.prototype.GetTaskDepth=function(){return this.getTaskDepth(!1)},i.prototype.pathContains=function(e){return this._taskPath.Contains(e)},i.prototype.SetContextTask=function(e){this.ContextTask=e},i.prototype.GetContextTask=function(){var e=this.DataView.getCurrRec();return this.InStartProcess||null!==e&&(e.InCompute||e.InRecompute)||null!==this.Form&&this.Form.inRefreshDisplay()?this:this.ContextTask},i.prototype.getTriggeringTask=function(){return null!==this._triggeringTask&&this._triggeringTask.getMGData().IsAborting&&(this._triggeringTask=this._parentTask),this._triggeringTask},i.prototype.setLastParkedCtrl=function(e){s.prototype.setLastParkedCtrl.call(this,e),G.setLastFocusedControl(this,e)},i.prototype.queryTaskPath=function(){var e=0,r=new t.StringBuilder(7936),a=new Array(this.getTaskDepth(!1));this.pathToRoot(a,!1);for(var s=a.length-1;s>=0;s--){var i=a[s];if(!i.isMainProg()){var o=i.getProp(n.PropInterface.PROP_TYPE_NAME);if(null!=o){var l=o.GetComputedValue();t.NString.IsNullOrEmpty(l)||(0!=e++&&r.Append(";"),r.Append(l))}}}return r},i.prototype.ctl_itm_2_parent_vee=function(e){var t,r=0,n=0,a=new Array(this.getTaskDepth(!0));this.pathToRoot(a,!0);for(var s=a.length-1;s>=0;s--){if(e<(r+=(t=a[s]).DataView.GetFieldsTab().getSize()))return e-=n,t.DataView.getField(e);n=r}return null},i.prototype.GetControlIDFromVarItem=function(e){var t,r=0,n=0,a=0,s=new Array(this.getTaskDepth(!0));this.pathToRoot(s,!0);for(var i=s.length-1;i>=0;i--){if(e<(r+=(t=s[i]).DataView.GetFieldsTab().getSize())){e-=n;var o=t.DataView.getField(e);return null!=o.getCtrl()?a+t.Form.getControlIdx(o.getCtrl())+1:0}null!=t.Form&&(a+=t.Form.getCtrlCount()),n=r}return 0},i.prototype.GetControlFromControlID=function(e,t){var r=null;if(t.value=-1,e>=0){var n=null,a=null,s=0,i=0,o=0,l=new Array(this.getTaskDepth(!0));this.pathToRoot(l,!0);for(var u=l.length-1;u>=0;u--)if(null!=(n=l[u]).Form){if(e<i+(s=n.Form.getCtrlCount())){o=e-i,r=n.Form.CtrlTab.getCtrl(o),a=n;break}i+=s}if(null!=r){t.value=0;var c=l[0].TaskDefinitionId.CtlIndex;for(u=0;u<l.length-1&&(c!==(n=l[u]).TaskDefinitionId.CtlIndex&&t.value++,a.TaskDefinitionId.CtlIndex!==n.TaskDefinitionId.CtlIndex);u++)c=n.TaskDefinitionId.CtlIndex}}return r},i.prototype.ctl_itm_4_parent_vee=function(e,t){var r=this.getTaskDepth(!0);if(e!==b.MAIN_PRG_PARENT_ID&&r<=e)return t;var n=new Array(r);if(0!==t){this.pathToRoot(n,!0);var a=this.getIndOfParentInTaskTree(e,n),s=void 0;for(s=n.length-1;s>a;s--)t+=n[s].DataView.GetFieldsTab().getSize()}return t},i.prototype.getIndOfParentInTaskTree=function(e,t){var r=0;if(e===b.MAIN_PRG_PARENT_ID){for(var n=1;n<t.length;n+=1)if(t[n].isMainProg()&&this._ctlIdx===t[n].getCtlIdx()){r=n;break}}else r=e;return r},i.prototype.getFieldByName=function(e){return this.GetContextTask().getFieldByName_(e)},i.prototype.getFieldByName_=function(e){var t;if(null==e)return null;var r=this.getField(e);if(null==r&&null!=(t=null!=this.getTriggeringTask()?this.getTriggeringTask():this._parentTask)){if(!this.isMainProg()&&this.getCtlIdx()!==t.getCtlIdx())r=o.mgDataTable.GetMainProgByCtlIdx(-1,this.getCtlIdx()).getFieldByName_(e);null==r&&(r=t.getFieldByName_(e))}return r},i.prototype.getIndexOfFieldByName=function(e){var t=this.getTaskDepth(!0),r=0,n=this.getFieldByName(e);if(null==n)return 0;var a=new Array(t);this.pathToRoot(a,!0);for(var s=t-1;s>=0;s--){var i=a[s];if(i===n.getTask()){s=n.getId(),r+=++s;break}r+=i.DataView.GetFieldsTab().getSize()}return r},i.prototype.pathToRoot=function(e,t){for(var r=t?this:this.GetContextTask(),n=0;n<e.length;n++){e[n]=r;var a=r.getCtlIdx(),s=t?null:r.getTriggeringTask();if(null!=s)r=s;else{if(null==(r=r.getParent())){!t&&this.isMainProg()&&this.getCtlIdx()!==E.TOP_LEVEL_CONTAINER&&(e[n+1]=this);break}t&&a!==r.getCtlIdx()&&(e[++n]=o.mgDataTable.GetMainProgByCtlIdx(-1,a))}}},i.prototype.shouldBeRefreshed=function(){var e=this._parentTask.DataView,t=!1;return(null===this._parentTask||e.isPrevCurrRecNull()||null!==this.RefreshOnVars&&!e.currEqualsPrev(this.RefreshOnVars))&&(t=!0),t},i.prototype.CheckRefreshSubTasks=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!1,this._enteredRecLevel?[4,this.GetSubformsToRefresh()]:[3,2];case 1:t.sent().length>0&&(e=!0),t.label=2;case 2:return[2,e]}}))}))},i.prototype.GetSubTasks=function(){var e=new t.List;if(this.hasSubTasks())for(var r=0;r<this.SubTasks.getSize();r+=1)e.push(this.SubTasks.getTask(r));return e},i.prototype.GetSubformsToRefresh=function(){return T(this,void 0,void 0,(function(){var e,r,n,a;return h(this,(function(s){switch(s.label){case 0:e=this.GetSubTasks(),r=new t.List,n=0,s.label=1;case 1:return n<e.length?(a=e.get_Item(n),[4,this.ShouldRefreshSubformTask(a)]):[3,4];case 2:s.sent()&&r.push(a),s.label=3;case 3:return n++,[3,1];case 4:return[2,r]}}))}))},i.prototype.ShouldRefreshSubformTask=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:return t=!1,a=e.getForm().getSubFormCtrl(),e.DoSubformPrefixSuffix=!1,null==a||e.InSelect||!e.AfterFirstRecordPrefix?[3,13]:(s=this.getMode(),i=s===r.Constants.TASK_MODE_QUERY?n.PropInterface.PROP_TYPE_ALLOW_QUERY:s===r.Constants.TASK_MODE_MODIFY?n.PropInterface.PROP_TYPE_ALLOW_MODIFY:n.PropInterface.PROP_TYPE_ALLOW_CREATE,(l=e.ModeAsParent&&s!==e.getMode()&&this.getLevel()===r.Constants.TASK_LEVEL_RECORD)?[4,e.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,2]);case 1:l=_.sent(),_.label=2;case 2:return(o=l)?[4,e.checkProp(i,!0)]:[3,4];case 3:o=_.sent(),_.label=4;case 4:return o?(u=!a.isVisible())?[4,a.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,6]:[3,8];case 5:u=!_.sent(),_.label=6;case 6:return u?(a.RefreshOnVisible=!0,t=!1):t=!0,[4,e.SetModeAsParent(s)];case 7:return _.sent(),[3,12];case 8:return[4,a.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)];case 9:return(t=_.sent()&&e.shouldBeRefreshed())?(c=!a.isVisible())?[4,a.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,11]:[3,12];case 10:c=!_.sent(),_.label=11;case 11:c&&(a.RefreshOnVisible=!0,t=!1),_.label=12;case 12:t&&(e.DoSubformPrefixSuffix=!0),_.label=13;case 13:return[2,t]}}))}))},i.prototype.SetModeAsParent=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.enableModes()];case 1:return s.sent(),e!==r.Constants.TASK_MODE_CREATE?[3,3]:(t=Qe.CreateEventCommand(this.getTaskTag(),r.InternalInterface.MG_ACT_RTO_CREATE),[4,this.DataviewManager.Execute(t)]);case 2:return s.sent(),[3,7];case 3:return this.getMode()!==r.Constants.TASK_MODE_CREATE?[3,6]:(this.setPreventRecordSuffix(!0),this.setPreventControlChange(!0),[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)]);case 4:return s.sent(),this.setPreventRecordSuffix(!1),this.setPreventControlChange(!1),(a=this.DataView).isEmpty()||a.getCurrRec().getMode()===n.DataModificationTypes.Insert?this.setMode(r.Constants.TASK_MODE_CREATE):this.setMode(e),[4,this.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 5:return s.sent(),[3,7];case 6:this.setMode(e),s.label=7;case 7:return this.setOriginalTaskMode(e),[4,this.setCreateDeleteActsEnableState()];case 8:return s.sent(),[2]}}))}))},i.prototype.doSubformRecPrefixSuffix=function(){return T(this,void 0,void 0,(function(){var e,t,n;return h(this,(function(a){switch(a.label){case 0:e=this.GetSubTasks(),t=0,a.label=1;case 1:return t<e.length?(n=e.get_Item(t)).DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(n,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]:[3,4]:[3,5];case 2:return a.sent(),o.eventsManager.GetStopExecutionFlag()?[3,4]:[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:a.sent(),a.label=4;case 4:return t++,[3,1];case 5:return[2]}}))}))},i.prototype.CleanDoSubformPrefixSuffix=function(){for(var e=this.GetSubTasks(),t=0;t<e.length;t++){e.get_Item(t).DoSubformPrefixSuffix=!1}},i.prototype.mustConfirmInDeleteMode=function(){return!this.getProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE).isExpression()},i.prototype.addSubTask=function(e){null===this.SubTasks&&(this.SubTasks=new O),this.SubTasks.addTask(e)},i.prototype.removeSubTask=function(e){null!==this.SubTasks&&this.SubTasks.removeTask(e)},i.prototype.setTransactionFailed=function(e){this._transactionFailed=e,e||(this.TransactionErrorHandlingsRetry=null)},i.prototype.transactionFailed=function(e){return(e===E.TRANS_NONE||null!=this.Transaction&&this.Transaction.getLevel()===e||e===E.TRANS_NONE||null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getLevel()===e)&&this._transactionFailed},i.prototype.setAfterRetry=function(e){null!=this.Transaction?this.Transaction.setAfterRetry(e):null!=this.TransactionErrorHandlingsRetry&&(e===E.RECOVERY_NONE?this.TransactionErrorHandlingsRetry=null:this.TransactionErrorHandlingsRetry.setAfterRetry(e))},i.prototype.getAfterRetry=function(e){return 0===arguments.length?this.getAfterRetry_0():this.getAfterRetry_1(e)},i.prototype.getAfterRetry_0=function(){return null!=this.Transaction?this.Transaction.getAfterRetry():null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getAfterRetry()},i.prototype.getAfterRetry_1=function(e){return null!=this.Transaction?this.Transaction.getAfterRetry(e):null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getAfterRetry(e)},i.prototype.getExecEndTask=function(){return this._bExecEndTask},i.prototype.resetExecEndTask=function(){this._bExecEndTask=!1},i.prototype.setExecEndTask=function(){this._bExecEndTask=!0},i.prototype.evalEndCond=function(e){return T(this,void 0,void 0,(function(){var r,a,s,i,o,l,u;return h(this,(function(c){switch(c.label){case 0:return a=this.getProp(n.PropInterface.PROP_TYPE_EVAL_END_CONDITION),this.InEndTask?[2,!1]:this._bExecEndTask?[2,!0]:(s=null!=a)?(l=(o=t.NString).Compare,[4,a.getValue()]):[3,4];case 1:return(i=0===l.apply(o,[c.sent(),E.END_COND_EVAL_IMMIDIATE,!0]))?[3,3]:[4,a.getValue()];case 2:i=c.sent().toLowerCase()===e.toLowerCase(),c.label=3;case 3:s=i,c.label=4;case 4:return s?null==(r=this.getProp(n.PropInterface.PROP_TYPE_END_CONDITION))?[2,!1]:[4,r.getValue()]:[3,6];case 5:return u=c.sent(),n.DisplayConvertor.toBoolean(u)?(this._bExecEndTask=!0,[2,!0]):[2,!1];case 6:return[2,!1]}}))}))},i.prototype.setTryingToStop=function(e){if(this.hasSubTasks())for(var t=0;t<this.SubTasks.getSize();t+=1){this.SubTasks.getTask(t).setTryingToStop(e)}this.IsTryingToStop=e},i.prototype.getInRecordSuffix=function(){return this._inRecordSuffix},i.prototype.setInRecordSuffix=function(e){return e!==this._inRecordSuffix&&(this._inRecordSuffix=e,!0)},i.prototype.setEvalOldValues=function(e){return e!==this._evalOldValues&&(this._evalOldValues=e,!0)},i.prototype.getEvalOldValues=function(){return this._evalOldValues},i.prototype.endTask=function(e,t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(s){switch(s.label){case 0:return a.isNullOrUndefined(n)?[4,this.endTask_1(e,t,!1,r)]:[3,2];case 1:case 3:return[2,s.sent()];case 2:return[4,this.endTask_1(e,t,n,r)]}}))}))},i.prototype.endTask_1=function(t,a,s,i){return T(this,void 0,void 0,(function(){var l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m;return h(this,(function(h){switch(h.label){case 0:return l=!0,u=!1,_=o.mgDataTable,!this.IsSubForm||s||this._parentTask.InEndTask?[3,2]:[4,this._parentTask.endTask(t,a,i)];case 1:return l=h.sent(),[3,41];case 2:if(this.isAborting()||this.InEndTask)return[3,40];h.label=3;case 3:return h.trys.push([3,,38,39]),this.InEndTask=!0,oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI&&o.eventsManager.GetStopExecutionFlag()?(T=Qe.CreateUnloadCommand(),oe.Instance.getMGData(0).CmdsToServer.Add(T),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)]):[3,5];case 4:return h.sent(),[2];case 5:return this.IsTryingToStop||this.setTryingToStop(!0),p=void 0,t?this.hasSubTasks()?le.GetInstance().DelayCommandExecution?[3,9]:(g=!0,[4,this.CheckIfClientOperationExistsInSubformTasks(this,r.InternalInterface.MG_ACT_TASK_SUFFIX)]):[3,15]:[3,20];case 6:return(d=h.sent())?[3,8]:[4,this.CheckIfClientOperationExistsInSubformTasks(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 7:(d=h.sent())||(g=this.CheckIfPendingTransactions(this)),h.label=8;case 8:return d||g||(this.allowRemoteCmdExecution=!1,this.SetServerSideTaskSuffix(this),le.GetInstance().DelayCommandExecution=!0),[3,10];case 9:this.SetServerSideTaskSuffix(this),h.label=10;case 10:p=0,h.label=11;case 11:return p<this.SubTasks.getSize()&&l?(c=this.SubTasks.getTask(p),u=u||c.IsSubForm,[4,o.eventsManager.handleInternalEventWithTask(c,r.InternalInterface.MG_ACT_EXIT)]):[3,14];case 12:h.sent(),l=!o.eventsManager.GetStopExecutionFlag()||i,h.label=13;case 13:return p++,[3,11];case 14:return[3,16];case 15:le.GetInstance().DelayCommandExecution&&this.SetServerSideTaskSuffix(this),h.label=16;case 16:if(this!==_.StartupMgData.getFirstTask())return[3,20];p=_.getSize()-1,h.label=17;case 17:return p>0&&l?null==_.getMGData(p)?[3,19]:[4,o.eventsManager.handleInternalEventWithTask(_.getMGData(p).getFirstTask(),r.InternalInterface.MG_ACT_EXIT)]:[3,20];case 18:h.sent(),l=!o.eventsManager.GetStopExecutionFlag()||i,h.label=19;case 19:return p--,[3,17];case 20:return l?!t||i?[3,23]:[4,this.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]:[3,37];case 21:return I=h.sent(),this.IsInteractive||!0!==I||this.getMode()!==r.Constants.TASK_MODE_CREATE||this.setProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,"0"),[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 22:h.sent(),this.IsInteractive||!0!==I||this.getMode()!==r.Constants.TASK_MODE_CREATE||this.setProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,"1"),h.label=23;case 23:return(l=!o.eventsManager.GetStopExecutionFlag()||i)&&!a&&this.HandleTransactionInfo(),f=l,!l||a||!t||i||this.IsSubForm&&!s||!this.TaskPrefixExecuted||this.TaskSuffixExecuted?[3,25]:[4,this.handleTaskSuffix(!0)];case 24:l=h.sent(),h.label=25;case 25:if(!t||!this.hasSubTasks())return[3,29];p=0,h.label=26;case 26:return p<this.SubTasks.getSize()?(c=this.SubTasks.getTask(p)).IsSubForm?[3,28]:[4,o.eventsManager.handleNonReversibleEvent(c,r.InternalInterface.MG_ACT_EXIT)]:[3,29];case 27:h.sent(),h.label=28;case 28:return p++,[3,26];case 29:return t&&(l=!o.eventsManager.GetStopExecutionFlag()||i),f&&o.eventsManager.setStopExecution(!1),this.setAfterRetry(E.RECOVERY_NONE),this.isAborting()||!l||a?[3,37]:t?(this.setTransactionFailed(!1),[4,this.TaskTransactionManager.checkAndCommit(!1,E.TRANS_TASK_PREFIX,!1)]):[3,31];case 30:h.sent(),l=(!o.eventsManager.GetStopExecutionFlag()||i)&&!this.isAborting()&&!this.transactionFailed(E.TRANS_TASK_PREFIX),h.label=31;case 31:return this.setAfterRetry(E.RECOVERY_NONE),l?(this.allowRemoteCmdExecution?this.DelayCommandExecution&&(this.DelayCommandExecution=!1,le.GetInstance().DelayCommandExecution=!0):(this.allowRemoteCmdExecution=!0,le.GetInstance().DelayCommandExecution=!1),C=o.mgDataTable.StartupMgData,t&&C.getFirstTask().getTaskTag()===this.getTaskTag()?(o.eventsManager.setProcessingTopMostEndTask(!0),[4,o.eventsManager.handleEvents(C,0)]):[3,33]):[3,37];case 32:if(h.sent(),o.eventsManager.setProcessingTopMostEndTask(!1),this.isAborting())return le.GetInstance().DelayCommandExecution=!1,this.DelayCommandExecution=!1,this.allowRemoteCmdExecution=!0,[2,!0];h.label=33;case 33:return[4,Dt.Exit(this,t,s)];case 34:return h.sent(),null!=this._parentTask&&this._parentTask.isMainProg()?(A=o.mgDataTable.getMGData(0),R=A.getMainProg(0),S=o.mgDataTable.StartupMgData.getFirstTask(),[4,R.checkProp(n.PropInterface.PROP_TYPE_END_CONDITION,!1)]):[3,36];case 35:M=h.sent(),this!==S&&M&&((m=new w(S)).setInternal(r.InternalInterface.MG_ACT_CLOSE),m.setCtrl(null),m.setArgList(null),o.eventsManager.addToTail(m)),h.label=36;case 36:rr.CreatedForms.remove(this.Form),h.label=37;case 37:return[3,39];case 38:return this.IsSubForm&&!s||this.handleFinallyEndTask(l,t),[7];case 39:return[3,41];case 40:this.InEndTask&&(l=!1),h.label=41;case 41:return o.eventsManager.setProcessingTopMostEndTask(this._inProcessingTopMostEndTaskSaved),[2,l]}}))}))},i.prototype.SetServerSideTaskSuffix=function(e){var t=new w(e);t.setInternal(r.InternalInterface.MG_ACT_TASK_SUFFIX);var n=null,a=new Ae;if(a.init(t),null!=(n=a.getNext()))for(var s=0;s<n.getOperationTab().getSize();s++){n.getOperationTab().getOperation(s).setExecOnServer(!0)}if(e.hasSubTasks())for(s=0;s<e.GetSubTasks().length;s++){var i=e.SubTasks.getTask(s);this.SetServerSideTaskSuffix(i)}},i.prototype.CheckIfClientOperationExistsInSubformTasks=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=!1,(s=new w(e)).setInternal(t),i=null,(o=new Ae).init(s),i=o.getNext(),t!=r.InternalInterface.MG_ACT_REC_SUFFIX?[3,2]:(l=e.DataView.getCurrRec(),(e.DataView.modifiedRecordsNumber()>0||null!=l&&l.Modified)&&(a=!0),a?[3,2]:[4,e.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 1:!0===T.sent()&&(e.IsInteractive||e.getMode()!==r.Constants.TASK_MODE_CREATE)&&(a=!0),T.label=2;case 2:if(null!=i&&!a)for(u=i.getOperationTab().getSize(),c=0;c<u;c++)if(i.getOperationTab().getOperation(c).getExecOnClient()){a=!0;break}if(a||!e.hasSubTasks())return[3,6];c=0,T.label=3;case 3:return!a&&c<e.getSubTasks().getSize()?(_=e.SubTasks.getTask(c),[4,this.CheckIfClientOperationExistsInSubformTasks(_,t)]):[3,6];case 4:a=T.sent(),T.label=5;case 5:return c++,[3,3];case 6:return[2,a]}}))}))},i.prototype.CheckIfPendingTransactions=function(e){var t=!1,r=e.DataView.getCurrRec();if((e.DataView.modifiedRecordsNumber()>0||null!=r&&r.Modified)&&(t=!0),!t&&e.hasSubTasks())for(var n=0;!t&&n<e.getSubTasks().getSize();n++){var a=e.SubTasks.getTask(n);t=this.CheckIfPendingTransactions(a)}return t},i.prototype.HandleTransactionInfo=function(){var e=this.DataviewManager.RemoteDataviewManager.Transaction;null!==e&&e.isOwner(this)&&"P"===e.getLevel()&&(this.DataviewManager.RemoteDataviewManager.Transaction=null,this.DataView.setTransCleared())},i.prototype.Exit=function(t,r){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:if(n=t?Qe.CreateBrowserEscEventCommand(this.getTaskTag(),r):Qe.CreateNonReversibleExitCommand(this.getTaskTag(),r),this._mgData.CmdsToServer.Add(n),r)return[3,5];s.label=1;case 1:return s.trys.push([1,4,,5]),this.getTaskTag()!=oe.Instance.StartupMgData.getFirstTask().getTaskTag()&&oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,3]:[4,i.CommandsProcessor.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 2:s.sent(),s.label=3;case 3:return[3,5];case 4:if(a=s.sent(),!this.isMainProg())throw a;return this._mgData.CmdsToServer.Add(n),[3,5];case 5:return[2]}}))}))},i.prototype.handleFinallyEndTask=function(e,t){if(this.hasSubTasks())for(var r=0;r<this.SubTasks.getSize();r++)this.SubTasks.getTask(r).handleFinallyEndTask(e,t);this.InEndTask=!1,e&&(this._isStarted=!1),!e&&t&&this.IsTryingToStop&&this.setTryingToStop(!1)},i.prototype.handleTaskSuffix=function(e){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:if(t=!0,!e)return[3,4];if(!this.hasSubTasks())return[3,4];n=0,a.label=1;case 1:return n<this.SubTasks.getSize()&&t?[4,this.SubTasks.getTask(n).handleTaskSuffix(e)]:[3,4];case 2:t=a.sent(),a.label=3;case 3:return n++,[3,1];case 4:return t?[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_TASK_SUFFIX)]:[3,6];case 5:a.sent(),a.label=6;case 6:return t=!o.eventsManager.GetStopExecutionFlag(),this.TaskSuffixExecuted=!0,[2,t]}}))}))},i.prototype.setInCreateLine=function(e){this._inCreateLine=e},i.prototype.getInCreateLine=function(){return this._inCreateLine},i.prototype.handleEventOnSlaveTasks=function(e){return T(this,void 0,void 0,(function(){var n,a,s,i,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:if(a=null,s=null,i=o.mgDataTable,l=i.getTriggeredTasks(this),u=null,_=!1,T=null!=this.Transaction&&this.Transaction.isOwner(this))for(o.eventsManager.setEventScopeTrans(),u=new t.List,i.startTasksIteration();null!=(a=i.getNextTask());)c=null!=a.Transaction&&this.Transaction.getTransId()===a.Transaction.getTransId(),a!==this&&c&&null!=a.PreviouslyActiveTaskId&&null==i.GetTaskByID(a.PreviouslyActiveTaskId)&&u.push(a);p=o.eventsManager.isEventScopeTrans(),n=0,h.label=1;case 1:return n<l.length&&!o.eventsManager.GetStopExecutionFlag()?(a=l.get_Item(n),c=null!=this.Transaction&&null!=a.Transaction&&this.Transaction.getTransId()===a.Transaction.getTransId(),!a.IsSubForm&&p&&c&&a.isStarted()?a.getForm().FormRefreshed&&e===r.InternalInterface.MG_ACT_REC_PREFIX&&a.getLevel()===r.Constants.TASK_LEVEL_TASK?[4,a.DataView.currRecCompute(!1)]:[3,3]:[3,5]):[3,6];case 2:h.sent(),h.label=3;case 3:return[4,o.eventsManager.handleInternalEventWithTask(a,e)];case 4:h.sent(),_=!0,h.label=5;case 5:return n++,[3,1];case 6:return T&&n<u.length&&!o.eventsManager.GetStopExecutionFlag()?(a=u.get_Item(n)).getForm().FormRefreshed&&e===r.InternalInterface.MG_ACT_REC_PREFIX&&a.getLevel()===r.Constants.TASK_LEVEL_TASK?[4,a.DataView.currRecCompute(!1)]:[3,8]:[3,11];case 7:h.sent(),h.label=8;case 8:return[4,o.eventsManager.handleInternalEventWithTask(a,e)];case 9:h.sent(),_=!0,h.label=10;case 10:return n++,[3,6];case 11:return _&&o.eventsManager.GetStopExecutionFlag()&&(s=a),T&&o.eventsManager.clearEventScope(),[2,s]}}))}))},i.prototype.enableRecordActions=function(){return T(this,void 0,void 0,(function(){var e,t,a,s;return h(this,(function(i){switch(i.label){case 0:return e=this.DataView,[4,this.setCreateDeleteActsEnableState()];case 1:return i.sent(),e.IncludesFirst()||e.IsOneWayKey?(e.isEmptyDataview()||0===e.getCurrRecIdx()?(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!1),e.IsOneWayKey?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!1),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!1)):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0)),this.Form.isScreenMode()||(e.isEmptyDataview()||0===e.getCurrRecIdx()||0===e.getTopRecIdx()?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0))):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!0)),e.IncludesLast()?(t=this.getMode()===r.Constants.TASK_MODE_QUERY||e.isEmptyDataview())?[3,5]:(a=this.getMode()===r.Constants.TASK_MODE_MODIFY)?(s=!et.Instance.allowCreateInModifyMode(this.getCompIdx()))?[3,3]:[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)]:[3,4]:[3,6];case 2:s=!i.sent(),i.label=3;case 3:a=s,i.label=4;case 4:t=a,i.label=5;case 5:return t&&e.getCurrRecIdx()+1===e.getSize()?(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!1),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!1),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!1)):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!0),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0)),this.Form.isScreenMode()||(e.isEmptyDataview()||e.getSize()-e.getTopRecIdx()<=this.Form.getRowsInPage()?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0)),[3,7];case 6:this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!0),i.label=7;case 7:return e.isEmptyDataview()?this.ActionManager.enable(r.InternalInterface.MG_ACT_CANCEL,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_CANCEL,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_ENTER_ROW_EDITING,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS,!0),[2]}}))}))},i.prototype.isStarted=function(){return this._isStarted},i.prototype.getSubTasks=function(){return this.SubTasks},i.prototype.refreshesOn=function(e){for(var t=!1,r=0;!t&&null!==this.RefreshOnVars&&r<this.RefreshOnVars.length;r++)t=this.RefreshOnVars[r]===e;return t},i.prototype.AbortTransaction=function(){this.DataviewManager.RemoteDataviewManager.Transaction=null},i.prototype.setPreventRecordSuffix=function(e){this._preventRecordSuffix=e},i.prototype.getPreventRecordSuffix=function(){return this._preventRecordSuffix},i.prototype.setPreventControlChange=function(e){this._preventControlChange=e},i.prototype.getPreventControlChange=function(){return this._preventControlChange},i.prototype.resetKnownToServer=function(){this._knownToServer=!1},i.prototype.evaluateDescriptor=function(){var e,a="";if(null==this.DvPosDescriptor)return t.HashUtils.GetHashCode(a);for(var s=!0,i=0;i<this.DvPosDescriptor.length;i++){s||(a+=";");var l=this.DvPosDescriptor.get_Item(i),u=l[0],c=t.NNumber.Parse(l[1]),_=o.mgDataTable.GetTaskByID(u).DataView.getField(c),T=_.getDispValue();_.isNull()&&(T="");var h=void 0;switch(_.getType()){case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:a+=T;break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(""!==T)h=new n.PIC(_.getPicture(),_.getType(),0),a+=n.DisplayConvertor.Instance.mg2disp(T,"",h,!1,this.getCompIdx(),!1);break;case r.StorageAttribute.NUMERIC:""!==T&&(e=new n.NUM_TYPE(T),h=new n.PIC(_.getPicture(),_.getType(),0),a+=e.to_a(h))}s=!1}var p=r.StrUtil.stringToHexaDump(a,4);return t.HashUtils.GetHashCode(p)},i.prototype.setDescriptor=function(e){if(""!==e.trim()){var n=r.StrUtil.tokenize(e,";");this.DvPosDescriptor=new t.List;for(var a=0;a<n.length;a+=1){var s=new Array(2),i=r.StrUtil.tokenize(n[a],",");s[0]=i[0],s[1]=i[1],this.DvPosDescriptor.push(s)}}},i.prototype.getTaskCache=function(){return this._dvCache},i.prototype.prepareCache=function(e){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:return t=!0,e?[3,5]:[4,this.isCached()];case 1:return a.sent()?(this.DataView.getChanged()&&(this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0),t=!1),[3,5]):[3,2];case 2:return(r=this.IsSubForm)?[4,this.isCached()]:[3,4];case 3:r=!a.sent(),a.label=4;case 4:r&&(t=!1),a.label=5;case 5:if(!this.hasSubTasks())return[3,9];n=0,a.label=6;case 6:return n<this.SubTasks.getSize()?[4,this.SubTasks.getTask(n).prepareCache(!1)]:[3,9];case 7:a.sent()||(t=!1),a.label=8;case 8:return n+=1,[3,6];case 9:return[2,t]}}))}))},i.prototype.testAndSet=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a;return h(this,(function(s){switch(s.label){case 0:return(t=!e)?[4,this.isCached()]:[3,2];case 1:t=s.sent(),s.label=2;case 2:return t?(r=this.evaluateDescriptor())===this.DataView.getDvPosValue()?[3,4]:null==(n=this._dvCache.getCachedDataView(r))?[2,!1]:[4,this.changeDv(n)]:[3,5];case 3:s.sent(),s.label=4;case 4:this.DoSubformPrefixSuffix=!0,s.label=5;case 5:if(!this.hasSubTasks())return[3,9];a=0,s.label=6;case 6:return a<this.SubTasks.getSize()?[4,this.SubTasks.getTask(a).testAndSet(!1)]:[3,9];case 7:if(!s.sent())return[2,!1];s.label=8;case 8:return a++,[3,6];case 9:return[2,!0]}}))}))},i.prototype.changeDv=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t=this.DataView,this.hasLocate?this.locatePutInCache():!t.getChanged()&&t.IncludesFirst()&&this._dvCache.putInCache(t.replicate()),[4,t.setSameAs(e)];case 1:return n.sent(),t.takeFldValsFromCurrRec(),this.Form.SetTableItemsCount(0,!0),this.Form.setTableItemsCount(!1),[4,this.Form.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 2:return n.sent(),this.setOriginalTaskMode(this.getMode()),[2]}}))}))},i.prototype.setOriginalTaskMode=function(e){this._originalTaskMode=e.charAt(0)},i.prototype.getOriginalTaskMode=function(){return this._originalTaskMode},i.prototype.isCached=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return(e=this.IsSubForm)?[4,this.Form.getSubFormCtrl().checkProp(n.PropInterface.PROP_TYPE_IS_CACHED,!1)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,e]}}))}))},i.prototype.locatePutInCache=function(){var e=this._dvCache.getCachedDataView(this.DataView.getDvPosValue());null!=e?this.DataView.checkFirst(e.getLocateFirstRec())&&!this.DataView.getChanged()?(this.DataView.setLocateFirstRec(e.getLocateFirstRec()),this._dvCache.putInCache(this.DataView.replicate())):this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0):this.DataView.getChanged()||this._dvCache.putInCache(this.DataView.replicate())},i.prototype.HasLoacte=function(){return this.hasLocate},i.prototype.setRemoteTransaction=function(e){var t,r=o.mgDataTable,n=!1;for(r.startTasksIteration();null!=(t=r.getNextTask());)if(null!=t.DataviewManager.RemoteDataviewManager.Transaction&&t.DataviewManager.RemoteDataviewManager.Transaction.getTransId()===e){n=!0;break}this.DataviewManager.RemoteDataviewManager.Transaction=n?t.DataviewManager.RemoteDataviewManager.Transaction:new kt(this,e,!1)},i.prototype.setTransOwnerTask=function(){this.Transaction.setOwnerTask(this),this.Transaction.setTransBegin("T")},i.prototype.getLoopCounter=function(){var e=0;return this._useLoopStack&&null!==this._loopStack&&0!==this._loopStack.count()&&(e=this._loopStack.peek()),e},i.prototype.enterLoop=function(){null===this._loopStack&&(this._loopStack=new t.Stack),this._loopStack.push(0)},i.prototype.leaveLoop=function(){this.popLoopCounter()},i.prototype.popLoopCounter=function(){var e=0;return null!==this._loopStack&&0!==this._loopStack.count()&&(e=this._loopStack.pop()),e},i.prototype.increaseLoopCounter=function(){this._loopStack.push(this.popLoopCounter()+1)},i.prototype.getLoopStackSize=function(){return null!==this._loopStack?this._loopStack.count():0},i.prototype.setUseLoopStack=function(e){this._useLoopStack=e},i.prototype.getDataviewHeaders=function(){return this.DataviewHeadersTable},i.prototype.isFirstRecordCycle=function(e){return 0===arguments.length?this.isFirstRecordCycle_0():this.isFirstRecordCycle_1(e)},i.prototype.isFirstRecordCycle_0=function(){return this._firstRecordCycle},i.prototype.isFirstRecordCycle_1=function(e){this._firstRecordCycle=e},i.prototype.getPublicName=function(){return this.PublicName},i.prototype.isAllowEvents=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS).getValueBoolean()];case 1:return[2,e.sent()]}}))}))},i.prototype.getExternalTaskId=function(){var e="",t=this.getProp(n.PropInterface.PROP_TYPE_TASK_ID);return null!=t&&(e=t.GetComputedValue()),e},i.prototype.isTransactionOwner=function(){var e=!1;return null!=this.Transaction&&this.Transaction.isOwner(this)&&(e=!0),e},i.prototype.isTransactionOnLevel=function(e){return this.isTransactionOwner()&&this.Transaction.getLevel()===e},i.prototype.isProgram=function(){return this._isPrg},i.prototype.enableModes=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)];case 1:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_MODIFY,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 2:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_CREATE,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_QUERY,!0)];case 3:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_QUERY,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_RANGE,!0)];case 4:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_RANGE,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_LOCATE,!0)];case 5:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_LOCATE,e),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_SEARCH,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_SORT,!0)];case 6:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_SORT_RECORDS,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX,!0)];case 7:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_VIEW_BY_KEY,e),[2]}}))}))},i.prototype.setEnableZoomHandler=function(){this._enableZoomHandler=!0},i.prototype.getEnableZoomHandler=function(){return this._enableZoomHandler},i.prototype.isDestinationSubform=function(){return this._destinationSubform},i.prototype.setDestinationSubform=function(e){this._destinationSubform=e},i.prototype.getIsDestinationCall=function(){return this._isDestinationCall},i.prototype.setIsDestinationCall=function(e){this._isDestinationCall=e},i.prototype.setCancelWasRaised=function(e){this._cancelWasRaised=e},i.prototype.cancelWasRaised=function(){return this._cancelWasRaised},i.prototype.enableCreateActs=function(e){this.ActionManager.enable(r.InternalInterface.MG_ACT_CRELINE,e),this.ActionManager.enable(r.InternalInterface.MG_ACT_CRELINE_ABOVE,!!this.getForm().HasTable()&&e)},i.prototype.setCreateDeleteActsEnableState=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return(e=!this.DataView.isEmptyDataview())?[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_DELETE,!0)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return e&&this.getMode()===r.Constants.TASK_MODE_MODIFY&&this.DataView.HasMainTable?this.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!0):this.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!1),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 3:return t.sent()&&(this.DataView.HasMainTable&&this.getMode()===r.Constants.TASK_MODE_MODIFY&&et.Instance.allowCreateInModifyMode(this.getCompIdx())||this.getMode()===r.Constants.TASK_MODE_CREATE)?this.enableCreateActs(!0):this.enableCreateActs(!1),[2]}}))}))},i.prototype.setEmptyDataview=function(e){this.DataView.setEmptyDataview(e)},i.prototype.getName=function(){return this.Name},i.prototype.emptyDataviewOpen=function(t){return T(this,void 0,void 0,(function(){var n,a,s;return h(this,(function(i){switch(i.label){case 0:return this.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,11]:(this.ActionManager.enable(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW,!0),this.IsSubForm?null!=(n=o.eventsManager.getLastRtEvent())&&n.getInternalCode()==r.InternalInterface.MG_ACT_RT_REFRESH_VIEW||t?((a=new w(this)).setInternal(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW),a.SetEventSubType(e.EventSubType.Normal),[4,o.eventsManager.handleEvent(a,!1)]):[3,2]:[3,3]);case 1:i.sent(),i.label=2;case 2:return[3,4];case 3:o.eventsManager.addInternalEventWithItaskAndCode(this,r.InternalInterface.MG_ACT_EMPTY_DATAVIEW),i.label=4;case 4:return this.setLevel(r.Constants.TASK_LEVEL_RECORD),(s=this.SubformExecMode!==e.Task_SubformExecModeEnum.FIRST_TIME&&t)?[4,this.CheckRefreshSubTasks()]:[3,6];case 5:s=i.sent(),i.label=6;case 6:return s?[4,this.DataView.computeSubForms()]:[3,9];case 7:return i.sent(),[4,this.doSubformRecPrefixSuffix()];case 8:i.sent(),i.label=9;case 9:return[4,this.enableRecordActions()];case 10:i.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,!1),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,!1),i.label=11;case 11:return[2]}}))}))},i.prototype.emptyDataviewClose=function(){this.ActionManager.enable(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW,!1),this.setLevel(r.Constants.TASK_LEVEL_TASK),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,!0)},i.prototype.SubformRefresh=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return n=G.Instance.getLastFocusedTask(),[4,e.ExecuteNestedRS(n)];case 1:return a=l.sent(),o.eventsManager.GetStopExecutionFlag()?[2]:e.getLevel()===r.Constants.TASK_LEVEL_TASK||o.eventsManager.GetStopExecutionFlag()?[3,3]:(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(e,r.InternalInterface.MG_ACT_REC_SUFFIX,!0)]);case 2:if(l.sent(),o.eventsManager.popNewExecStacks(),a=!0,o.eventsManager.GetStopExecutionFlag())return[2];l.label=3;case 3:return s=Qe.CreateSubformRefreshCommand(this.getTaskTag(),e.getTaskTag(),t),[4,e.DataviewManager.Execute(s)];case 4:return l.sent(),e.isAborting()?[2]:t?(o.eventsManager.pushNewExecStacks(),i=e.PerformParentRecordPrefix,e.PerformParentRecordPrefix=!1,[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(e,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]):[3,6];case 5:if(l.sent(),e.PerformParentRecordPrefix=i,o.eventsManager.popNewExecStacks(),o.eventsManager.GetStopExecutionFlag())return[2];l.label=6;case 6:return a?[3,9]:[3,7];case 7:return o.eventsManager.GetStopExecutionFlag()?[3,9]:t?[4,o.eventsManager.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,9];case 8:l.sent(),null!=n&&n.DataView.setPrevCurrRec(),e.DoSubformPrefixSuffix=!1,l.label=9;case 9:return[2]}}))}))},i.prototype.ExecuteNestedRS=function(e){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:if(t=!1,null==e)return[2,t];if(this.getLevel()!==r.Constants.TASK_LEVEL_TASK&&e.getMgdID()!==this.getMgdID())return[2,t];n=e,a.label=1;case 1:return n!==this&&n.pathContains(this)&&n.getLevel()!==r.Constants.TASK_LEVEL_TASK?(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,4];case 2:a.sent(),o.eventsManager.popNewExecStacks(),t=!0,a.label=3;case 3:return n=n.getParent(),[3,1];case 4:return[2,t]}}))}))},i.prototype.execSubformRecSuffix=function(e){return T(this,void 0,void 0,(function(){var n,a,s;return h(this,(function(i){switch(i.label){case 0:s=0,a=this._taskPath.length,i.label=1;case 1:return a>0?(n=this._taskPath.get_Item(a-1),e._taskPath.Contains(n)?[3,3]:[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,5];case 2:return i.sent(),o.eventsManager.GetStopExecutionFlag()?[3,5]:(n.getMode()!==r.Constants.TASK_MODE_CREATE||n.DataView.getCurrRec().isNewRec()||n.setMode(r.Constants.TASK_MODE_MODIFY),[3,4]);case 3:return s=e._taskPath.indexOf(n),[3,5];case 4:return a--,[3,1];case 5:return t.Debug.Assert(a>0),[2,s]}}))}))},i.prototype.getCounter=function(){return this._counter},i.prototype.increaseCounter=function(){this._counter=this._counter+1},i.prototype.setCounter=function(e){this._counter=e},i.prototype.isCurrentStartProgLevel=function(){return this._currStartProgLevel===i.StartProgLevel},i.isMainProgramField=function(e){var n=r.XmlParser.getTokens(e,","),a=!1;2===n.length&&(t.NNumber.Parse(n.get_Item(0))===b.MAIN_PRG_PARENT_ID&&(a=!0));return a},i.prototype.getTaskInfo=function(){var e=this.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue();return t.NString.Format("{0} {1}",this.isProgram()?"Program":"Subtask",e)},i.prototype.toString=function(){return t.NString.Format('(task {0}-"{1}"{2})',this._taskTag,this.Name,s.prototype.isMainProg.call(this)?" ctl "+this._ctlIdx:"")},i.prototype.ConstructMgForm=function(e){for(var t=new rr,r=null!=this.ParentTask?this.ParentTask.getForm():null;null!=r&&!r.getTask().isOpenWin();)r=r.ParentForm;return t.ParentForm=r,e.value=!0,t},i.prototype.getMgdID=function(){return this._mgData.GetId()},i.prototype.getMGData=function(){return this._mgData},i.prototype.RefreshDisplay=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return null===this.Form||this.isAborting()||!this.isStarted()?[3,3]:(r.Logger.Instance.WriteDevToLog("Start task.RefreshDisplay()"),this._refreshType===r.Constants.TASK_REFRESH_NONE?[3,2]:[4,this.Form.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)]);case 1:e.sent()&&(this._refreshType=r.Constants.TASK_REFRESH_NONE),e.label=2;case 2:r.Logger.Instance.WriteDevToLog("End task.RefreshDisplay()"),e.label=3;case 3:return[2]}}))}))},i.prototype.getFieldDisplayValue=function(e,t,r){t.value=e.getDispValue(),r.value=e.isNull()},i.prototype.UpdateFieldValueAndStartRecompute=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return this.TaskPrefixExecuted?[4,e.setValueAndStartRecompute(t,r,!0,!1,!1)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},i.prototype.ShouldNonInteractiveChildBeModal=function(){return this.ShouldChildBeModal()},i.prototype.ShouldChildBeModal=function(){var e=!1;return this.Form.ConcreteWindowType===r.WindowType.Overlay&&this.getForm().Opened?e=!0:this.IsInteractive||(e=!0),e},i.prototype.getParent=function(){return this._parentTask},i.prototype.isDescendentOf=function(e){return e===this||null!==e&&null!==this._parentTask&&this._parentTask.isDescendentOf(e)},i.prototype.GetSubformModalParentTask=function(){for(var e=this;null!=e._parentTask&&e._parentTask.getIsDestinationCall();){var t=e._parentTask.getForm().getSubFormCtrl();if(t.IsModal())return t;e=e._parentTask}return null},i.prototype.ShouldEvaluatePropertyLocally=function(e){return this.TaskService.ShouldEvaluatePropertyLocally(e)},i.prototype.EnsureValidForm=function(){this._isMainPrg&&null!==this.Form&&(this._openWin&&this.Form.isLegalForm||(this.Form=null))},i.prototype.ComputeMainDisplay=function(){var e=this.getProp(n.PropInterface.PROP_TYPE_MAIN_DISPLAY).GetComputedValueInteger();e=this.GetRealMainDisplayIndexOnCurrentTask(e),this._forms.InitFormFromXmlString(e),this.EnsureValidForm()},i.prototype.PrepareTaskForm=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,Dt.PreparePropOpenTaskWindow(this)];case 1:return e.sent(),[2,nr.PreparePropMainDisplay(this)]}}))}))},i.prototype.FormIsLegal=function(){return s.prototype.isMainProg.call(this)||s.prototype.getForm.call(this).isLegalForm},i.prototype.GetRealMainDisplayIndexOnDepth=function(e){for(var t=this.LogicalStudioParentTask;null!=t;)e+=t._forms.Count,t=t.LogicalStudioParentTask;return e},i.prototype.GetRealMainDisplayIndexOnCurrentTask=function(e){if(e>1)for(var t=this.LogicalStudioParentTask;null!=t;)e-=t._forms.Count,t=t.LogicalStudioParentTask;return e},i.prototype.GetAncestorTaskByTaskDefinitionId=function(e){var t=this;if(e.IsMainProgram())return n.GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID,e.CtlIndex);for(;null!=t;){if(t.TaskDefinitionId.Equals(e))return t;t=t._parentTask}return null},i.prototype.SetDataControlValuesReference=function(e,t){s.prototype.getForm.call(this).getCtrl(e).setDcValId(t)},i.prototype.DisplayMessageToStatusBar=function(e){var t=this.GetContextTask();null==t.getForm()&&(t=G.Instance.getLastFocusedTask()),t.WriteToMessagePane(e,!0)},i.prototype.isTableWithAbsolutesScrollbar=function(){var e=!1;return null!=this.getForm()&&(e=this.getForm().isTableWithAbsoluteScrollbar()),e},i.prototype.GetTaskDetails=function(){for(var e=this.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue(),t=this;null!==t.ParentTask&&!t.ParentTask.isMainProg();)e=(t=t.ParentTask).getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"."+e;return e},i.ProcessTaskURL=function(){return T(this,void 0,void 0,(function(){var e,a,s,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return e=n.RuntimeContextBase.Instance.Parser.getXMLdata(),a=e.indexOf(r.XMLConstants.TAG_CLOSE,n.RuntimeContextBase.Instance.Parser.getCurrIndex()),t.Debug.Assert(-1!==a&&a<e.length),s=n.RuntimeContextBase.Instance.Parser.getXMLsubstring(a),n.RuntimeContextBase.Instance.Parser.add2CurrIndex(s.indexOf(E.MG_TAG_TASKURL)+E.MG_TAG_TASKURL.length),o=r.XmlParser.getTokens(n.RuntimeContextBase.Instance.Parser.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),l=o.get_Item(1),u=o.get_Item(3),[4,i.CommandsProcessor.GetContent(l,!0)];case 1:for(c=h.sent(),_=new t.StringBuilder(e.substr(0,n.RuntimeContextBase.Instance.Parser.getCurrIndex()-(E.MG_TAG_TASKURL.length+1)),c.length),T=this.getReflist(u,";",!0,-1),p=0,g=c.indexOf("[:"),d=0;-1!==g;)_.Append(c.substr(d,g-d)),_.Append(T.get_Item(p++)),d=g+=2,g=c.indexOf("[:",d);return _.Append(c.substr(d)),_.Append(e.substr(e.indexOf(r.XMLConstants.TAG_CLOSE,a+1)+1)),e=_.ToString(),r.Logger.Instance.WriteDevToLog(t.NString.Format("{0} -------\x3e {1}",l,e)),n.RuntimeContextBase.Instance.Parser.setXMLdata(e),n.RuntimeContextBase.Instance.Parser.setCurrIndex(n.RuntimeContextBase.Instance.Parser.getCurrIndex()-(E.MG_TAG_TASKURL.length+1)),[2]}}))}))},i.getReflist=function(e,r,n,a){for(var s=new t.StringBuilder,i=new t.List,o=0,l=1;l<e.length;l++){var u=e.charAt(l);if("\\"!==u&&u!==r)s.Append(u);else if(u===r){if(i.push(s.ToString()),s=new t.StringBuilder,++o===a)break}else"\\"===u&&(n||e.charAt(l+1)===r||s.Append(e.charAt(l)),l++,s.Append(e.charAt(l)))}return i.push(s.ToString()),i},i.StartProgram=function(n,a){return T(this,void 0,void 0,(function(){var s,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return s=o.eventsManager.GetStopExecutionFlag(),l=null,u=o.eventsManager.getAllowEvents(),o.eventsManager.setAllowEvents(e.EventsAllowedType.ALL),r.Logger.Instance.WriteDevToLog('Start "startProg"'),i.StartProgLevel++,o.eventsManager.setStopExecution(!1),[4,this.ExecuteComponentMainPrograms(n,a)];case 1:return l=h.sent(),c=new t.RefParam(l),_=new t.RefParam(null),[4,i.ExecuteMainProgram(0,n,a,c,_,o.mgDataTable)];case 2:return h.sent(),l=c.value,i._idleTimerStarted||(ge.Instance.startTimer(o.mgDataTable.getMGData(0),et.Instance.getIdleTime(0),!0),i._idleTimerStarted=!0),[4,this.OpenForms(n)];case 3:return h.sent(),[4,this.DoFirstRecordCycle()];case 4:return h.sent(),[4,this.MoveToFirstControls(n)];case 5:return h.sent(),1!==i.StartProgLevel?[3,11]:(T=!1,p=!0,null!==l&&l.isStarted()?(T=!0,d=(g=o.eventsManager).setNonInteractiveAllowEvents,[4,l.isAllowEvents()]):[3,8]);case 6:return d.apply(g,[h.sent(),l]),[4,l.isAllowEvents()];case 7:p=h.sent(),h.label=8;case 8:return null!==G.Instance.getLastFocusedTask()&&p?(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleEvents(o.mgDataTable.getCurrMGData(),0)]):[3,10];case 9:h.sent(),o.eventsManager.popNewExecStacks(),h.label=10;case 10:T&&o.eventsManager.setAllowEvents(u),h.label=11;case 11:return i.StartProgLevel--,r.Logger.Instance.WriteDevToLog('End "startProg"'),s&&!o.eventsManager.GetStopExecutionFlag()&&s&&!o.eventsManager.GetStopExecutionFlag()&&o.eventsManager.setStopExecution(s),[2,l]}}))}))},i.ExecuteComponentMainPrograms=function(e,r){return T(this,void 0,void 0,(function(){var n,a,s,l;return h(this,(function(u){switch(u.label){case 0:n=new t.RefParam(null),a=new t.RefParam(null),s=o.mgDataTable.getMGData(0).getMaxCtlIdx(),l=1,u.label=1;case 1:return l<=s?null===o.mgDataTable.GetMainProgByCtlIdx(-1,l)?[3,3]:[4,i.ExecuteMainProgram(l,e,r,n,a,o.mgDataTable)]:[3,4];case 2:u.sent(),u.label=3;case 3:return l+=1,[3,1];case 4:return[2,a.value]}}))}))},i.ExecuteMainProgram=function(e,n,a,s,i,o){return T(this,void 0,void 0,(function(){var l,u;return h(this,(function(c){switch(c.label){case 0:return l=o.GetMainProgByCtlIdx(-1,e),r.Logger.Instance.WriteDevToLog(t.NString.Format(" ClientManager.startProg: ctlIdx={0}, task={1}",e,l)),u=s,[4,l.Start(a,n)];case 1:return u.value=c.sent(),null===i.value?i.value=s.value:null!==s.value&&t.Debug.Assert(!1,"more than 1 non interactive tasks in startProg"),[2]}}))}))},i.OpenForms=function(e){return T(this,void 0,void 0,(function(){var t,r,a,s;return h(this,(function(i){switch(i.label){case 0:if(t=rr.CreatedForms,null,!(t.Count()>0))return[3,4];r=0,i.label=1;case 1:return r<t.Count()?(a=t.get(r),s=!1,a.isSubForm()?a.getSubFormCtrl().getForm().Opened&&(s=!0):a.getTask().isCurrentStartProgLevel()&&(s=!0),s?(n.Manager.OpenForm(a),[4,n.Manager.DoFirstRefreshTable(a)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return a.Opened?(e&&a.isSubForm()&&a.getTopMostForm(),t.remove(a)):r++,[3,1];case 4:return[2]}}))}))},i.DoFirstRecordCycle=function(){return T(this,void 0,void 0,(function(){var e,t,r,n,a;return h(this,(function(s){switch(s.label){case 0:e=0,s.label=1;case 1:if(!(e<o.mgDataTable.getSize()))return[3,6];if(null===(t=o.mgDataTable.getMGData(e))||t.IsAborting)return[3,5];r=0,s.label=2;case 2:return r<t.getTasksCount()?null===(n=t.getTask(r))||null===(a=n.getForm())||!n.isCurrentStartProgLevel()||a.IgnoreFirstRecordCycle?[3,4]:(a.IgnoreFirstRecordCycle=!0,[4,n.doFirstRecordCycle()]):[3,5];case 3:s.sent(),s.label=4;case 4:return r++,[3,2];case 5:return e++,[3,1];case 6:return[2]}}))}))},i.MoveToFirstControls=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i;return h(this,(function(l){switch(l.label){case 0:t=0,l.label=1;case 1:if(!(t<o.mgDataTable.getSize()))return[3,6];if(null===(r=o.mgDataTable.getMGData(t))||r.IsAborting)return[3,5];n=r.getTasksCount(),a=0,l.label=2;case 2:return a<n?(s=r.getTask(a),i=s.getForm(),s.isCurrentStartProgLevel()&&null!==i&&i.MovedToFirstControl?(i.MovedToFirstControl=!1,e?[3,4]:[4,o.eventsManager.HandleNonParkableControls(s)]):[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return a++,[3,2];case 5:return t++,[3,1];case 6:return[2]}}))}))},i}(b);br.StartProgLevel=0,br._idleTimerStarted=!1;var Nr,yr=function(){function e(){this._ctlIdxTab=null}return e.prototype.fillData=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_COMPMAINPRG)+E.MG_TAG_COMPMAINPRG.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);return r.Logger.Instance.WriteDevToLog("in CompMainPrg.FillData: "+a.toString()),this.initElements(a),void e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in CompMainPrg.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);a===r.XMLConstants.MG_ATTR_VALUE?(s=r.StrUtil.DeleteStringsFromEnds(s,'"'),this.initCtlIdxTab(s)):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("There is no such index in CompMainPrg. Add case to CompMainPrg.initElements for {0}",a))}r.Logger.Instance.WriteDevToLog("End CompMainPrg ")},e.prototype.initCtlIdxTab=function(e){t.NString.IsNullOrEmpty(e)||(-1!==e.indexOf(",")?this._ctlIdxTab=r.StrUtil.tokenize(e,","):(this._ctlIdxTab=new Array(1),this._ctlIdxTab[0]=e))},e.prototype.getCtlIdx=function(e){if(e>=0&&e<this.getSize()){var r=this._ctlIdxTab[e];return t.NNumber.Parse(r)}return-1},e.prototype.getIndexOf=function(e){var t;for(t=0;t<this.getSize();t++)if(e===this.getCtlIdx(t))return t;return-1},e.prototype.getSize=function(){return null===this._ctlIdxTab?0:this._ctlIdxTab.length},e}(),Or=function(){function e(e,t,r,n,a,s){this._expHandlers=null,this._id=0,this._parent=null,this._mprgTab=null,this._tasksTab=null,this._timerHandlers=null,this._timersStarted=!1,this.forceModal=!1,this.CmdsToClient=null,this.CmdsToServer=null,this.IsModal=!1,this.IsAborting=!1,this.CmdsToServer=e,this.CmdsToClient=t,5===arguments.length?this.constructor_0(r,n,a):this.constructor_1(r,n,a,s)}return Object.defineProperty(e.prototype,"ForceModal",{get:function(){return this.forceModal},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e,t,r){if(this._timerHandlers=new gr,this._expHandlers=new gr,this._mprgTab=new O,this._tasksTab=new O,this._id=e,this._parent=t,null===o.eventsManager.getCompMainPrgTab()){var n=new yr;o.eventsManager.setCompMainPrgTab(n)}this.IsModal=r},e.prototype.constructor_1=function(e,t,r,n){this.constructor_0(e,t,r),this.forceModal=n},e.prototype.GetId=function(){return this._id},e.prototype.AlreadyMovedToFirstControl=function(){for(var e=!1,t=this.getTasksCount(),r=0;r<t;r+=1){var n=this.getTask(r).getForm();if(null!==n&&n.MovedToFirstControl){e=!0;break}}return e},e.prototype.StartTimers=function(){null===this._timerHandlers||this._timersStarted||(this._timerHandlers.startTimers(this),this._timersStarted=!0)},e.prototype.fillData=function(e,t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return a=t.getNextTag(),[4,this.initInnerObjects(t,a,e)];case 1:n=s.sent(),s.label=2;case 2:if(n)return[3,0];s.label=3;case 3:return r.Logger.Instance.WriteDevToLog("MGData.FillData(): THE END of the parsing "+t.getCurrIndex()+" characters"),[2]}}))}))},e.prototype.initInnerObjects=function(e,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b;return h(this,(function(h){switch(h.label){case 0:if(null==a)return[2,!1];switch(a){case r.XMLConstants.MG_TAG_XML:return[3,1];case E.MG_TAG_DATAVIEW:return[3,2];case E.MG_TAG_COMPLETE_DV:return[3,4];case E.MG_TAG_CONTEXT:return[3,5];case r.XMLConstants.MG_TAG_RECOMPUTE:return[3,6];case E.MG_TAG_COMMAND:return[3,7];case E.MG_TAG_LANGUAGE:return[3,8];case E.MG_TAG_KBDMAP_URL:return[3,10];case E.MG_TAG_KBDMAP:return[3,12];case E.MG_TAG_COMPMAINPRG:return[3,13];case E.MG_TAG_EVENTS_QUEUE:return[3,14];case E.MG_TAG_TASKURL:return[3,15];case r.XMLConstants.MG_TAG_TASK:return[3,17];case E.MG_TAG_ENV:return[3,19];case E.MG_TAG_FLWMTR_CONFIG:return[3,20];case r.XMLConstants.MG_TAG_XML_END:return[3,21];case E.MG_TAG_USER_DETAILS:return[3,22];case E.MG_TAG_DBH_REAL_IDXS:return[3,23];case E.MG_TAG_GLOBALPARAMSCHANGES:return[3,24];case E.MG_TAG_GLOBALPARAMS:return[3,25];case E.MG_TAG_ENV_PARAM_URL:return[3,26];case E.MG_TAG_ENV_PARAM:return[3,28];case E.MG_TAG_CONTEXT_ID:return[3,29];case E.MG_TAG_SESSION_ID:return[3,30];case E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT:return[3,31];case E.MG_TAG_DATABASE_URL:case E.MG_TAG_DATABASES_HEADER:case E.MG_TAG_TASKDEFINITION_IDS_URL:case E.MG_TAG_DBH_DATA_IDS_URL:case E.MG_TAG_DBHS_END:case E.MG_TAG_OFFLINE_SNIPPETS_URL:return[3,32];case E.MG_TAG_DBHS:case E.MG_TAG_STARTUP_PROGRAM:return[3,33];case r.XMLConstants.MG_TAG_MENUS_OPEN:return[3,34]}return[3,35];case 1:return e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),[3,36];case 2:return[4,this.insertDataView(e)];case 3:return h.sent()||(d=e.getXMLdata().indexOf("/"+E.MG_TAG_DATAVIEW,e.getCurrIndex()),e.setCurrIndex(d),e.setCurrIndex2EndOfTag()),[3,36];case 4:return i=null,d=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),l=e.getXMLdata().indexOf(E.MG_TAG_COMPLETE_DV,e.getCurrIndex())+E.MG_TAG_COMPLETE_DV.length,u=r.XmlParser.getTokens(e.getXMLdata().substr(l,d-l),'"'),c=u.get_Item(0),_=void 0,c===r.XMLConstants.MG_ATTR_TASKID&&(_=u.get_Item(1),T=_,i=null===this.getTask(T)?o.mgDataTable.GetTaskByID(T):this.getTask(T)),p=d+1,d=e.getXMLdata().indexOf(r.XMLConstants.END_TAG+E.MG_TAG_COMPLETE_DV,e.getCurrIndex()),g=e.getXMLdata().substr(p,d-p),i.dataViewContent=g,e.setCurrIndex(d),e.setCurrIndex2EndOfTag(),[3,36];case 5:return-1!==(d=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex()))&&d<e.getXMLdata().length&&(I=e.getXMLsubstring(d),e.add2CurrIndex(I.indexOf(E.MG_TAG_CONTEXT)+E.MG_TAG_CONTEXT.length),e.setCurrIndex(d+r.XMLConstants.TAG_TERM.length)),[3,36];case 6:return(new dr).fillData(e),[3,36];case 7:return r.Logger.Instance.WriteDevToLog("goes to command"),this.CmdsToClient.fillData(e),[3,36];case 8:return r.Logger.Instance.WriteDevToLog("goes to language data"),[4,pe.Instance.fillData(e)];case 9:case 11:case 16:case 27:return h.sent(),[3,36];case 10:return r.Logger.Instance.WriteDevToLog("goes to keyBoard"),[4,et.Instance.fillFromUrl(a,e)];case 12:case 34:return[3,36];case 13:return r.Logger.Instance.WriteDevToLog("goes to compmainprg"),o.eventsManager.getCompMainPrgTab().fillData(e),[3,36];case 14:return r.Logger.Instance.WriteDevToLog("goes to eventsqueue"),this.fillEventsQueue(e),[3,36];case 15:return[4,br.ProcessTaskURL()];case 17:return r.Logger.Instance.WriteDevToLog("goes to task"),f=this._mprgTab.getSize(),[4,this._mprgTab.fillData(this,s,e)];case 18:if(h.sent(),0!==this._id)for(C=this._mprgTab.getSize(),A=o.mgDataTable.getMGData(0),R=f;R<C;R++)(S=this._mprgTab.getTask(R)).isMainProg()&&null==A._mprgTab.getTask(S.getTaskTag())&&(A._mprgTab.addTask(S),A.addTask(S));return[3,36];case 19:return r.Logger.Instance.WriteDevToLog("goes to environment"),et.Instance.fillData(e),[3,36];case 20:return U.Instance.fillData(e),[3,36];case 21:return e.setCurrIndex2EndOfTag(),[2,!1];case 22:return at.Instance.fillData(e),[3,36];case 23:case 32:return e.SkipXMLElement(),[3,36];case 24:return r.Logger.Instance.WriteDevToLog("applying global params changes from the server (Set/GetParams)"),nt.Instance.fillData(e),[3,36];case 25:return r.Logger.Instance.WriteDevToLog("processing base64 encoded image of all global params from the server"),this.fillGlobalParams(e),[3,36];case 26:return r.Logger.Instance.WriteDevToLog("goes to env params name "),[4,et.Instance.fillFromUrl(a,e)];case 28:return r.Logger.Instance.WriteDevToLog("goes to env params name "),lt.Instance.fillData(e),[3,36];case 29:return void 0,void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),m=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),M=e.getXMLsubstring(m).trim(),e.setCurrIndex(m),e.setCurrIndex2EndOfTag(),n.RuntimeContextBase.Instance.ContextID=M,[3,36];case 30:return void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),v=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),le.GetInstance().SessionId=e.getXMLsubstring(v).trim(),e.setCurrIndex(v),e.setCurrIndex2EndOfTag(),[3,36];case 31:return void 0,void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),b=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),L=t.NNumber.Parse(e.getXMLsubstring(b)),e.setCurrIndex(b),e.setCurrIndex2EndOfTag(),re.GetInstance().HttpCommunicationTimeoutMS=1e3*L,[3,36];case 33:return e.ReadContentOfCurrentElement(),[3,36];case 35:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag name in MGData, add case to MGData.initInnerObjects and case to while of MGData.FillData "+a),[2,!1];case 36:return[2,!0]}}))}))},e.prototype.insertDataView=function(e){return T(this,void 0,void 0,(function(){var t,n,a,s,i,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:for(t=null,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),a=e.getXMLdata().indexOf(E.MG_TAG_DATAVIEW,e.getCurrIndex())+E.MG_TAG_DATAVIEW.length,s=r.XmlParser.getTokens(e.getXMLdata().substr(a,n-a),'"'),i=!1,l=0;l<s.length;l+=2)if((u=s.get_Item(l))===r.XMLConstants.MG_ATTR_TASKID&&(_=s.get_Item(l+1),c=_,t=this.getTask(c)||o.mgDataTable.GetTaskByID(c)),u===E.MG_ATTR_INVALIDATE){_=s.get_Item(l+1),i=r.XmlParser.getBoolean(_);break}return null===t?[3,2]:[4,t.insertRecordTable(i,e)];case 1:return h.sent(),T=!0,[3,3];case 2:T=!1,h.label=3;case 3:return[2,T]}}))}))},e.prototype.addTask=function(e){this._tasksTab.addTask(e)},e.prototype.removeTask=function(e){this._tasksTab.removeTask(e),this._mprgTab.removeTask(e)},e.prototype.getTasksCount=function(){return null!==this._tasksTab?this._tasksTab.getSize():0},e.prototype.getTask=function(e){return 1!==arguments.length||null!=e&&e.constructor!==String?this.getTask_1(e):this.getTask_0(e)},e.prototype.getTask_0=function(e){return null!==this._tasksTab&&void 0!==this._tasksTab?this._tasksTab.getTask(e):null},e.prototype.getTask_1=function(e){return this._tasksTab.getTask(e)},e.prototype.buildXML=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null!==this.CmdsToServer&&this.CmdsToServer.buildXML(e),t&&null!==this._tasksTab?[4,this._tasksTab.buildXML(e)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.getFirstTask=function(){for(var e=null,t=0;t<this._tasksTab.getSize()&&(e=this._tasksTab.getTask(t)).isMainProg();t+=1)e=null;return null===e&&0===this._id&&(e=null),e},e.prototype.getMainProg=function(e){for(var t=0;t<this._mprgTab.getSize();t+=1){var r=this._mprgTab.getTask(t);if(r.getCtlIdx()===e&&r.isMainProg())return r}return null},e.prototype.getNextMainProg=function(e){var t=o.eventsManager.getCompMainPrgTab(),r=t.getIndexOf(e),n=t.getCtlIdx(r+1);return-1===n?null:this.getMainProg(n)},e.prototype.clientTransactionCacheExists=function(){for(var e,t=0;t<this._tasksTab.getSize();t+=1)if(!(e=this._tasksTab.getTask(t)).isMainProg()&&e.DataView.modifiedRecordsNumber()>0)return!0;return!1},e.prototype.serverTransactionCacheExists=function(){for(var e,t=0;t<this._tasksTab.getSize();t+=1)if(!(e=this._tasksTab.getTask(t)).isMainProg()&&!e.DataView.ServerTransactionCacheEmpty)return!0;return!1},e.prototype.getTaskByTaskDefinitionID=function(e){for(var t,r=0;r<this._tasksTab.getSize();r+=1)if((t=this._tasksTab.getTask(r)).TaskDefinitionId.Equals(e))return t;return null},e.prototype.getTimerHandlers=function(){return this._timerHandlers},e.prototype.addTimerHandler=function(e){this._timerHandlers.add(e)},e.prototype.removeTimerHandler=function(e){for(var t=0;t<this._timerHandlers.getSize();){var r=this._timerHandlers.getHandler(t).getTask();r.isDescendentOf(e)&&r.getMGData()===this?this._timerHandlers.remove(t):t++}},e.prototype.removeExpressionHandler=function(e){for(var t=0;t<this._expHandlers.getSize();){var r=this._expHandlers.getHandler(t).getTask();r.isDescendentOf(e)&&r.getMGData()===this?this._expHandlers.remove(t):t++}},e.prototype.getExpHandlers=function(){return this._expHandlers},e.prototype.addExpHandler=function(e,t){this._expHandlers.insertAfter(e,t)},e.prototype.changeTimers=function(e,t){var r=0,n=0,a=ge.Instance;for(e.sort(),t.sort();r<e.length&&n<t.length;)e.get_Item(r)>t.get_Item(n)?(a.startTimer(this,t.get_Item(n),!1),n+=1):e.get_Item(r)<t.get_Item(n)?(a.stopTimer(this,e.get_Item(r),!1),r+=1):(r+=1,n+=1);for(;r<e.length;)a.stopTimer(this,e.get_Item(r),!1),r+=1;for(;n<t.length;)a.startTimer(this,t.get_Item(n),!1),n+=1},e.prototype.fillEventsQueue=function(e){for(;this.initEvents(e,e.getNextTag()););},e.prototype.initEvents=function(e,t){var n;if(null===t)n=!1;else{if(t===E.MG_TAG_EVENT){var a=new w(null);a.fillData(e,null),a.convertParamsToArgs(),a.setTask(null),a.setFromServer(),o.eventsManager.addToTail(a)}else{if(t!==E.MG_TAG_EVENTS_QUEUE)return t==="/"+E.MG_TAG_EVENTS_QUEUE?(e.setCurrIndex2EndOfTag(),n=!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventsQueue: "+t),n=!1);e.setCurrIndex(e.getXMLdata().indexOf(">",e.getCurrIndex())+1)}n=!0}return n},e.prototype.isMainWindow=function(){return null===this._parent},e.prototype.getParentMGdata=function(){return this._parent},e.prototype.abort=function(){this.IsAborting=!0},e.prototype.copyUnframedCmds=function(){for(var e=Lr.Instance.getUnframedCmds(),t=0;t<e.length;t+=1)this.CmdsToClient.Add(e.get_Item(t));e.SetSize(0)},e.prototype.getValidAncestor=function(){return this._parent},e.prototype.getMaxCtlIdx=function(){for(var e=0,t=0;t<this._tasksTab.getSize();t+=1){var r=this._tasksTab.getTask(t);null!==r&&(e=Math.max(e,r.getCtlIdx()))}return e},e.prototype.fillGlobalParams=function(e){var a=e.getXMLdata(),s=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==s&&s<a.length){var i=e.getXMLsubstring(s);e.add2CurrIndex(i.indexOf(E.MG_TAG_GLOBALPARAMS)+E.MG_TAG_GLOBALPARAMS.length);var o=r.XmlParser.getTokens(n.RuntimeContextBase.Instance.Parser.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM);t.Debug.Assert(o.get_Item(0)===r.XMLConstants.MG_ATTR_VALUE),ne.Instance.setGlobalParams(o.get_Item(1)),-1===(s=a.indexOf(r.XMLConstants.TAG_OPEN,s))&&(s=a.length),e.setCurrIndex(s)}},e}(),Gr=function(){function e(){}return Object.defineProperty(e.prototype,"ShouldExecute",{get:function(){return this.shouldExecute},enumerable:!1,configurable:!0}),e}(),Pr=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.Frame=0,t.TaskTag=null,t.Obj=null,t}return u(t,e),Object.defineProperty(t.prototype,"IsBlocking",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ShouldExecute",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.HandleAttribute=function(e,t){if(e===r.XMLConstants.MG_ATTR_TASKID)this.TaskTag=t},t}(Gr),Dr=function(e){function r(){return e.call(this)||this}return u(r,e),r.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),t.Debug.Assert(e.IsSubForm),r.ClientIsInRollbackCommand?[2]:!e.AfterFirstRecordPrefix||e.InEndTask?[3,3]:e.DataView.getCurrRec().InRecompute?(e.ExecuteClientSubformRefresh=!0,[3,3]):[3,1];case 1:return e.PerformParentRecordPrefix=!1,[4,e.getParent().SubformRefresh(e,!0)];case 2:n.sent(),e.PerformParentRecordPrefix=!0,n.label=3;case 3:return[2]}}))}))},r}(Pr);Dr.ClientIsInRollbackCommand=!1,function(e){e.NONE=" ",e.TRANS="T"}(Nr||(Nr={}));var kr=function(){function s(){this._eventsQueue=null,this._execStack=null,this._rtEvents=null,this._serverExecStack=null,this._allowEvents=e.EventsAllowedType.ALL,this._compMainPrgTab=null,this._currCtrl=null,this._currField=null,this._currKbdItem=null,this._endOfWork=!1,this._eventScope=Nr.NONE,this._forceExit=r.ForceExit.None,this._forceExitTask=null,this._ignoreUnknownAbort=!1,this._initialized=!1,this._isHandlingForceExit=!1,this._isNonReversibleExit=!1,this._isInRecordFlushEvent=!1,this.lastSavedRouteEvent=null,this._stopExecution=!1,this._processingTopMostEndTask=!1,this._stopExecutionCtrl=null,this._isSorting=!1,this._nextParkedCtrl=null,this.guiPendingEvent=null,this.KBI_DOWN=null,this.KBI_UP=null,this.confirmationDialogMsg="The server context serving this application is about to time out. Do you want to continue your work?",this.confirmationDialogTitle="Session is about to be terminated!",this._lastFailedFocusedControl=null,this.isSpinnerShown=!1,this.SpinnerStopped=new i.Subject,this._rtEvents=new t.Stack,this._eventsQueue=new F,this._execStack=new t.Stack,this._execStack.push(new z),this._serverExecStack=new t.Stack,this._serverExecStack.push(null),this._nextParkedCtrl=null,this.KBI_DOWN=new n.KeyboardItem(n.GuiConstants.KEY_DOWN,n.Modifiers.MODIFIER_NONE),this.KBI_UP=new n.KeyboardItem(n.GuiConstants.KEY_UP,n.Modifiers.MODIFIER_NONE)}return s.prototype.getPendingGuiEvent=function(){return this.guiPendingEvent},s.prototype.setPendingGuiEvent=function(e){this.guiPendingEvent=e},s.prototype.addToTail=function(e){e.isIdleTimer()?null!=this.getLastSavedRouteEvent()&&(this.addToTail(this.getLastSavedRouteEvent()),this.setLastSavedRouteEvent(null)):s.clientInactivityTimerON&&(s.clientContextInactivityTimerAborted=!0),this._eventsQueue.put(e)},s.prototype.AddKeyboardEvent=function(e,t,a,s,i,o,l,u,c,_){var T=null!==t?new w(t,!0,!1):new w(e.getTask(),!0);T.setInternal(_);var h=new n.KeyboardItem(s,a);u&&null!==t&&t.isTextControl()&&h.setAction(r.InternalInterface.MG_ACT_CHAR),T.setKeyboardItem(h),_===r.InternalInterface.MG_ACT_CTRL_KEYDOWN?T.setEditParms(i,o,l):T.setValue(c),this.addToTail(T)},s.prototype.checkParkability=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(n){switch(n.label){case 0:return e=G.getLastFocusedControl(),(t=null!==e&&e.getForm().getTask().getLevel()===r.Constants.TASK_LEVEL_CONTROL)?[4,e.IsParkable()]:[3,2];case 1:t=!n.sent(),n.label=2;case 2:return t?[4,this.HandleNonParkableControls(e.getForm().getTask())]:[3,4];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},s.prototype.HandleParkabilityOnRowChange=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.HandleNonParkableControls(e)];case 1:return t.sent(),[2]}}))}))},s.prototype.HandleNonParkableControls=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return(t=e).getMode()===r.Constants.TASK_MODE_CREATE&&t.IsInteractive?[4,t.enableModes()]:[3,7];case 1:return s.sent(),a=t.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 2:return s.sent(),this.GetStopExecutionFlag()?[3,7]:a===r.Constants.TASK_MODE_CREATE?[3,7]:(t.setMode(a),[4,t.DataView.currRecCompute(!0)]);case 3:return s.sent(),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 4:return s.sent(),[4,t.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 5:return s.sent(),t.setLastParkedCtrl(null),[4,n.FocusManager.SetFocus(t,null,-1,!0)];case 6:return s.sent(),[2];case 7:return t.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,9]:[4,this.handleInternalEventWithMgControlBase(t.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 8:s.sent(),s.label=9;case 9:return t.setLastParkedCtrl(null),P.ReturnToCtrl=null,[4,n.FocusManager.SetFocus(t,null,-1,!0)];case 10:return s.sent(),[2]}}))}))},s.prototype.handleEvent=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:if(n=null,a=new Ae,s=e.getTask(),i=s.getLastParkedCtrl(),o=!1,l=!1,u=null,c=this.getForceExit(),_=this.getForceExitTask(),T=this._isHandlingForceExit,p=!1,g=null,d=null,e.getType()===E.EVENT_TYPE_INTERNAL){if(e.InternalEvent<r.InternalInterface.MG_ACT_TOT_CNT&&(!s.ActionManager.isEnabled(e.InternalEvent)||!e.isImmediate()&&this.NoEventsAllowed()))return[2]}else if(!e.isImmediate()&&this.NoEventsAllowed())return[2];g=this._currCtrl,this._currCtrl=i,I=e.getType()!==E.EVENT_TYPE_INTERNAL||e.getInternalCode()<1e3,h.label=1;case 1:return h.trys.push([1,,24,25]),this.pushRtEvent(e),[4,this.CheckAndShowSpinner(!0)];case 2:return h.sent(),[4,this.commonHandlerBefore(e)];case 3:if(f=h.sent(),d=this._currField,this._currField=s.getCurrField(),!f)return[3,19];a.init(e),null!==(n=a.getNext())&&null!==n.getEvent()&&null!==n.getEvent().UserEvt&&this.setForceExit(n.getEvent().UserEvt.ForceExit,s),h.label=4;case 4:if(null===n)return[3,17];C=null,A=void 0,h.label=5;case 5:return h.trys.push([5,,15,16]),R=!1,C=n.getTask().GetContextTask(),e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()>=1e3&&e.getInternalCode()!==r.InternalInterface.MG_ACT_VARIABLE?n.getTask().SetContextTask(n.getTask()):n.getTask().SetContextTask(e.getTask()),(S=n.getEvent().getType()===E.EVENT_TYPE_USER)?[4,n.isEnabled()]:[3,7];case 6:S=h.sent(),h.label=7;case 7:return S?(R=!0,this._isHandlingForceExit=!1,p=!0,[4,this.handleForceExitBefore(n.getEvent(),e)]):[3,9];case 8:h.sent()&&(o=!0),h.label=9;case 9:return e!==n.getEvent()?(u=e,e=new w(n.getEvent(),e),A=!0,this.popRtEvent(),this.pushRtEvent(e)):A=!1,e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getTask().setInRecordSuffix(!0),this.createEventArguments(e),[4,n.execute(e,t,R)];case 10:return M=h.sent(),e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getTask().setInRecordSuffix(!1),I=M.Propagate,!M.Enabled&&A&&(e=u,u=null,A=!1,this.popRtEvent(),this.pushRtEvent(e)),e.getInternalCode()!==r.InternalInterface.MG_ACT_TASK_PREFIX&&s.isStarted()&&s.getExecEndTask()?[4,s.endTask(!0,!1,!1)]:[3,12];case 11:if(l=h.sent())return[3,17];h.label=12;case 12:return this.GetStopExecutionFlag()?[4,this.handleStopExecution(e)]:[3,14];case 13:if(h.sent())return[3,17];h.label=14;case 14:return[3,16];case 15:return n.getTask().SetContextTask(C),[7];case 16:return I?(null!==(n=A?a.getNext(e):a.getNext())&&U.Instance.addTaskEvent(e.getBrkLevel(!0),V.FLWMTR_PROPAGATE,s.GetTaskDetails()),[3,4]):[3,17];case 17:return!I||l?[3,19]:[4,this.commonHandler(e)];case 18:h.sent(),h.label=19;case 19:return l?[3,21]:[4,this.commonHandlerAfter(e,f,I)];case 20:h.sent(),h.label=21;case 21:return o&&this._isHandlingForceExit?(this._isHandlingForceExit=!1,[4,this.handleForceExitAfter(e)]):[3,23];case 22:h.sent(),h.label=23;case 23:return this.setForceExit(c,_),p&&(this._isHandlingForceExit=T),[3,25];case 24:return this._currCtrl=g,this._currField=d,this.popRtEvent(),[7];case 25:return ge.Instance.execGuiCommandQueue(),[2]}}))}))},s.prototype.simulateSelection=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return o=(i=e).getForm().getTask(),l=o.cancelWasRaised(),i.Type!==r.MgControlType.CTRL_TYPE_BUTTON?[3,2]:(u=new w(i),[4,i.getProp(n.PropInterface.PROP_TYPE_RAISE_AT).getValueInt()]);case 1:c=h.sent(),u.getType()!==E.EVENT_TYPE_INTERNAL||u.InternalEvent!==r.InternalInterface.MG_ACT_CANCEL&&u.InternalEvent!==r.InternalInterface.MG_ACT_RT_QUIT||(c===r.RaiseAt.TaskInFocus&&(o=G.Instance.getLastFocusedTask()),l=o.cancelWasRaised(),o.setCancelWasRaised(!0)),c===r.RaiseAt.TaskInFocus&&i.setRtEvtTask(G.Instance.getLastFocusedTask()),h.label=2;case 2:return[4,this.handleFocus(i,a,s)];case 3:return h.sent(),o.setCancelWasRaised(l),this._stopExecution?[2]:[4,i.IsParkable()];case 4:return _=h.sent(),i.Type!==r.MgControlType.CTRL_TYPE_BUTTON||null===i.getField()||_?i.Type!==r.MgControlType.CTRL_TYPE_BUTTON||_?[3,8]:(T=i.getForm().getTask()).IsSubForm?(o=G.Instance.getLastFocusedTask(),T!==o&&T.pathContains(o)?T.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(T,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,8]):[3,8]:[3,10];case 5:h.sent(),h.label=6;case 6:return[4,this.HandleNonParkableControls(T)];case 7:h.sent(),h.label=8;case 8:return p=new w(i),n.RuntimeContextBase.Instance.CurrentClickedCtrl=i,p.setInternal(r.InternalInterface.MG_ACT_CTRL_HIT),[4,this.handleEvent(p,!1)];case 9:if(h.sent(),this._stopExecution)return[2];h.label=10;case 10:return i.Type===r.MgControlType.CTRL_TYPE_BUTTON?[3,12]:[4,this.handleSelection(i,a,t)];case 11:h.sent(),h.label=12;case 12:return this._stopExecution?[2]:[4,this.handleMouseUp(i,a,s)];case 13:return h.sent(),[2]}}))}))},s.prototype.handleInternalEventWithTask=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.handleInternalEventWithTaskAndSubformRefresh(e,t,!1)];case 1:return r.sent(),[2]}}))}))},s.prototype.handleInternalEventWithTaskAndSubformRefresh=function(t,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return s=t,n===r.InternalInterface.MG_ACT_REC_PREFIX&&s.IsSubForm&&s.SubformExecMode!==e.Task_SubformExecModeEnum.FIRST_TIME&&(s.SubformExecMode=a?e.Task_SubformExecModeEnum.REFRESH:e.Task_SubformExecModeEnum.SET_FOCUS),a?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT)]:[3,2];case 1:i.sent(),i.label=2;case 2:return s.DataView.isEmptyDataview()?n!==r.InternalInterface.MG_ACT_REC_PREFIX&&n!==r.InternalInterface.MG_ACT_REC_SUFFIX?[3,9]:n!==r.InternalInterface.MG_ACT_REC_PREFIX?[3,4]:[4,s.emptyDataviewOpen(a)]:[3,12];case 3:return i.sent(),[3,5];case 4:s.emptyDataviewClose(),i.label=5;case 5:return null===s.getForm()?[3,8]:n!==r.InternalInterface.MG_ACT_REC_PREFIX?[3,7]:[4,s.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 6:i.sent(),i.label=7;case 7:s.getForm().SelectRow(),i.label=8;case 8:return[3,11];case 9:return[4,this.handleInternalEventWithTaskAndEventSubtype(s,n,e.EventSubType.Normal)];case 10:i.sent(),i.label=11;case 11:return[3,14];case 12:return[4,this.handleInternalEventWithTaskAndEventSubtype(s,n,e.EventSubType.Normal)];case 13:i.sent(),i.label=14;case 14:return[2]}}))}))},s.prototype.handleInternalEventWithMgControlBase=function(t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.handleInternalEventWithMgControl(t,r,e.EventSubType.Normal)];case 1:return n.sent(),[2]}}))}))},s.prototype.GetStopExecutionFlag=function(){return this._stopExecution},s.prototype.getStopExecutionCtrl=function(){return this._stopExecutionCtrl},s.prototype.Init=function(){this._initialized&&(this._isHandlingForceExit=!1,this._forceExit=r.ForceExit.None,this._forceExitTask=null,this._currField=null,this.setEndOfWork(!0)),this._initialized=!0},s.prototype.addInternalEventWithItaskAndCode=function(e,t){this.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(e,t,!1)},s.prototype.addInternalEventWithCtrlAndCode=function(e,t){var r=new w(e);r.setInternal(t),this.addToTail(r)},s.prototype.addInternalEventWithCtrlAndDisplayLineAndCode=function(e,t,r){var n=new w(e,t,!1);n.setInternal(r),this.addToTail(n)},s.prototype.addInternalEventWithCtrlAndCodeAndPriority=function(e,t,r){var n=new w(e);n.setInternal(t),n.setPriority(r),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark=function(e,t,r){var n=new w(e);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndLineAndModifier=function(e,t,r,n){var a=new w(e,r,!1);a.setInternal(t),this.addToTail(a)},s.prototype.addGuiTriggeredEventWithTaskAndCodeAndLine=function(e,t,r){var n=null;null!==e&&(n=e);var a=new w(n);a.setInternal(t),a.DisplayLine=r,this.addToTail(a)},s.prototype.AddColumnClickEvent=function(e,t,a){var s=new w(e,t,0);s.setInternal(r.InternalInterface.MG_ACT_COL_CLICK);var i=new Array;i[0]=new n.ExpVal(r.StorageAttribute.UNICODE,!1,a);var o=new L(i);s.setArgList(o),this.addToTail(s)},s.prototype.AddRouteEvent=function(e,t,a,s,i){var o=new w(e,!0);o.setInternal(t);var l=new Array(2);l[0]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,a),null===s&&(s=""),l[1]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,s);var u=new L(l);o.setArgList(u),o.setRouteParamList(i),this.addToTail(o)},s.prototype.AddRouterClosedEvent=function(e){var t=e.getForm().getSubFormCtrl(),a=new w(t.getForm().getTask(),!0);a.setInternal(r.InternalInterface.MG_ACT_SUBFORM_CLOSE);var i=new Array(1);i[0]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,t.getName());var o=new L(i);a.setArgList(o),s.Instance.addToTail(a)},s.prototype.AddLastSavedRouteEvent=function(e,t){var n=new w(G.Instance.getLastFocusedTask(),!0);n.setInternal(r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE),null!=e&&(n.setTask(e),null!=t&&n.setArgList(t),this.setLastSavedRouteEvent(n))},s.prototype.AddExternalValueEvent=function(e,t,a){var s=new w(e,0,!0);s.setInternal(r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE),s.setValue(t);var i=new Array(1);i[0]=new n.ExpVal(r.StorageAttribute.BOOLEAN,!1,a?"1":"0");var o=new L(i);s.setArgList(o),this.addToTail(s)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndLine=function(e,t,r){var n=new w(e,r,!0);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick=function(e,t,r,n){var a=new w(e,r,!0);a.setInternal(t),a.setProduceClick(n),this.addToTail(a)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndList=function(e,t,r){var n=new w(e,r,!0);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithTaskAndCode=function(e,t){var r=new w(e,!0);r.setInternal(t),this.addToTail(r)},s.prototype.addGuiTriggeredEventTaskAndCodeAndRaisedBy=function(e,t,r){this.addGuiTriggeredEventWithTaskAndCode(e,t)},s.prototype.getEvent=function(){return this._eventsQueue.poll()},s.prototype.getForceExit=function(){return this._forceExit},s.prototype.setForceExit=function(e,t){this._forceExit=e,this.setForceExitTask(t)},s.prototype.getForceExitTask=function(){return this._forceExitTask},s.prototype.setForceExitTask=function(e){this._forceExitTask=e},s.prototype.isForceExitPreRecordUpdate=function(e){return this._isHandlingForceExit&&this.getForceExit()===r.ForceExit.PreRecordUpdate&&e===this.getForceExitTask()},s.prototype.ExecuteClientContextInactivityTimer=function(){return T(this,void 0,void 0,(function(){var e,n,a;return h(this,(function(i){switch(i.label){case 0:e=r.Misc.getSystemMilliseconds(),n=100*et.Instance.getClientContextInactivityTimeout(),s.clientInactivityTimerON=!0,i.label=1;case 1:return s.clientInactivityTimerON?[4,t.Thread.Sleep(1e3)]:[3,3];case 2:return i.sent(),a=r.Misc.getSystemMilliseconds()-e,(s.clientContextInactivityTimerAborted||a>=n)&&(s.clientInactivityTimerON=!1),[3,1];case 3:return[2]}}))}))},s.prototype.CheckAndShowSpinner=function(e){return T(this,void 0,void 0,(function(){var a,i;return h(this,(function(o){switch(o.label){case 0:return a=!1,null!==this.getLastRtEvent()&&this.getLastRtEvent().getPriority()===r.Priority.LOWEST&&(e=!1),e==this.isSpinnerShown?[3,2]:(e?r.Misc.getSystemMilliseconds()-this.GetEventTime()>1e3&&(a=!0,s.clientBusyTimeStart=r.Misc.getSystemMilliseconds()):a=!0,a?(n.Commands.addShowSpinner(e),n.Commands.beginInvoke(),[4,t.Thread.Sleep(50)]):[3,2]);case 1:o.sent(),this.isSpinnerShown=e,this.isSpinnerShown||(i=r.Misc.getSystemMilliseconds()-s.clientBusyTimeStart,this.SpinnerStopped.next(i),s.clientBusyTimeStart=0),o.label=2;case 2:return[2]}}))}))},s.prototype.EventsLoop=function(t){return T(this,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:r=this.getAllowEvents(),this.setAllowEvents(e.EventsAllowedType.ALL),this.pushNewExecStacks(),n.label=1;case 1:return t.IsAborting?[3,7]:[4,this.CheckAndShowSpinner(!1)];case 2:return n.sent(),[4,this._eventsQueue.waitForElement()];case 3:return n.sent(),[4,this.handleEvents(t,0)];case 4:return n.sent(),t.IsAborting?[3,6]:[4,this.checkParkability()];case 5:n.sent(),n.label=6;case 6:return[3,1];case 7:return this.popNewExecStacks(),this.setAllowEvents(r),[2]}}))}))},s.prototype.NonInteractiveEventsLoop=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o;return h(this,(function(l){switch(l.label){case 0:return a=n,s=this.getAllowEvents(),i=this.setNonInteractiveAllowEvents,[4,a.isAllowEvents()];case 1:i.apply(this,[l.sent(),a]),this.pushNewExecStacks(),l.label=2;case 2:return e.IsAborting?[3,12]:a.getMode()!==r.Constants.TASK_MODE_DELETE?[3,4]:[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC)];case 3:return l.sent(),[3,6];case 4:return[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_CYCLE_NEXT_REC)];case 5:l.sent(),l.label=6;case 6:return[4,t.Thread.Sleep(10)];case 7:return l.sent(),(o=!e.IsAborting)?[4,a.isAllowEvents()]:[3,9];case 8:o=l.sent(),l.label=9;case 9:return o?[4,this.handleEvents(e,1)]:[3,11];case 10:l.sent(),l.label=11;case 11:return[3,2];case 12:return this.popNewExecStacks(),this.setAllowEvents(s),[2]}}))}))},s.prototype.handleEvents=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return!(null===e||e instanceof Or)||null!==t&&t.constructor!==Number?[3,2]:[4,this.handleEvents_0(e,t)];case 1:case 3:return r.sent(),[2];case 2:return[4,this.handleEvents_1(e,t)]}}))}))},s.prototype.handleEvents_0=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:n=null,a=0,s=0,this.setStopExecution(!1),u.label=1;case 1:if(this._eventsQueue.isEmpty()||this._stopExecution||!(0===t||s<t))return[3,8];if(null!==(i=this.getEvent())&&i.isGuiTriggeredEvent()){if(a=r.Misc.getSystemMilliseconds(),this._currKbdItem=null,(o=i.isBlockedByModalWindow(e))&&i.getInternalCode()!==r.InternalInterface.MG_ACT_TIMER)return[3,1];i.isIdleTimer()||o||i.getInternalCode()===r.InternalInterface.MG_ACT_ENABLE_EVENTS||i.getInternalCode()===r.InternalInterface.MG_ACT_DISABLE_EVENTS||null===i.getTask()||i.getTask().getMGData().IsAborting||(oe.Instance.currMgdID=i.getTask().getMGData().GetId())}if(null!==(l=oe.Instance.getCurrMGData()))for(;null!==l&&l.IsAborting;)null!==(l=l.getParentMGdata())&&(oe.Instance.currMgdID=oe.Instance.getMgDataIdx(l));else for(n=i.getTask();null===l&&null!==n&&null!==n.getParent();)n=n.getParent(),(l=n.getMGData()).IsAborting&&(l=null),null!==l&&(oe.Instance.currMgdID=oe.Instance.getMgDataIdx(l));if(null===l)return[3,8];if(null===i.getTask()){for(n=G.Instance.getLastFocusedTask();null!==n&&(n.isAborting()||n.InEndTask);)n=n.getParent();null!==n&&(i.setCtrl(n.getLastParkedCtrl()),i.setTask(n))}else n=i.getTask();return null===n?[3,3]:[4,this.handleEvent(i,!1)];case 2:u.sent(),u.label=3;case 3:return ge.Instance.execGuiCommandQueue(),this._currCtrl=null,null===n?[3,5]:[4,br.CommandsProcessor.SendMonitorOnly()];case 4:return u.sent(),[3,7];case 5:return oe.Instance.GetMainProgByCtlIdx(0),[4,br.CommandsProcessor.SendMonitorOnly()];case 6:u.sent(),u.label=7;case 7:return null!==i&&i.isGuiTriggeredEvent()&&a>0&&(a=r.Misc.getSystemMilliseconds()-a),t>0&&null!==i&&i.getType()===E.EVENT_TYPE_INTERNAL&&i.InternalEvent<r.InternalInterface.MG_ACT_TOT_CNT&&s++,[3,1];case 8:return[2]}}))}))},s.prototype.handleStopExecution=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:if(t=!1,!this.GetStopExecutionFlag())return[2,t];if(a=e.getTask(),s=e.Control,i=G.getLastFocusedControl(),o=!1,e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,12];switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,1];case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,2];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,3];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,4];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,9]}return[3,10];case 1:case 2:return o=!0,[3,10];case 3:return this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(a.getLastParkedCtrl()),[3,10];case 4:return this.setStopExecution(!1),a.InCtrlPrefix=!1,null!==i?[3,6]:(a.setCurrField(null),this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(s),[4,this.HandleNonParkableControls(a)]);case 5:return l.sent(),[3,8];case 6:return a.setCurrField(i.getField()),[4,n.FocusManager.SetFocus(i,-1)];case 7:l.sent(),l.label=8;case 8:return this.setStopExecution(!0),[3,10];case 9:return s.setInControlSuffix(!1),[3,10];case 10:return o?[4,a.endTask(!0,!1,!0)]:[3,12];case 11:l.sent(),t=!0,l.label=12;case 12:return[2,t]}}))}))},s.prototype.handleForceExitBefore=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return a=e.UserEvt.ForceExit,s=!1,i=0,a===r.ForceExit.None||t.isImmediate()?[2,!1]:(this._isHandlingForceExit=!0,o=t.getTask(),null!==(l=o.DataView.getCurrRec())&&l.getMode()===n.DataModificationTypes.Insert&&l.isNewRec()&&(s=!0,i=l.getId()),a===r.ForceExit.Editing||o.getLevel()!==r.Constants.TASK_LEVEL_CONTROL||null===(u=o.getLastParkedCtrl())?[3,2]:[4,this.handleInternalEventWithMgControlBase(u,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]);case 1:h.sent(),h.label=2;case 2:return a!==r.ForceExit.PreRecordUpdate&&a!==r.ForceExit.PostRecordUpdate||o.getLevel()!==r.Constants.TASK_LEVEL_RECORD?[3,4]:[4,this.handleInternalEventWithTask(o,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:h.sent(),o.getMode()!==r.Constants.TASK_MODE_CREATE||this._stopExecution||o.setMode(r.Constants.TASK_MODE_MODIFY),null!==(c=o.DataView.getCurrRec())&&this._stopExecution&&s&&i===c.getId()&&o.getMode()===r.Constants.TASK_MODE_CREATE&&(c.clearMode(),c.restart(n.DataModificationTypes.Insert)),h.label=4;case 4:return a!==r.ForceExit.PostRecordUpdate||this._stopExecution||o.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(o,r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:h.sent(),h.label=6;case 6:return a!==r.ForceExit.Editing||(null===(_=t.Control)||null===_.getField())?[3,8]:(T=n.Manager.GetCtrlVal(_),_.Value,[4,_.validateAndSetValue(T,!0)]);case 7:h.sent(),h.label=8;case 8:return[2,!0]}}))}))},s.prototype.handleForceExitAfter=function(e){return T(this,void 0,void 0,(function(){var t,n,a,s;return h(this,(function(i){switch(i.label){case 0:return t=e.UserEvt.ForceExit,n=e.getTask(),t!==r.ForceExit.PreRecordUpdate?[3,4]:[4,this.commitRecord(n,!0)];case 1:return i.sent(),n.transactionFailed(E.TRANS_RECORD_PREFIX)||n.isAborting()?[3,4]:[4,n.evalEndCond(E.END_COND_EVAL_AFTER)];case 2:return i.sent()?[4,n.endTask(!0,!1,!1)]:[3,4];case 3:i.sent(),i.label=4;case 4:return t===r.ForceExit.PostRecordUpdate||(n=e.getTask()).getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:i.sent(),i.label=6;case 6:return null===(a=G.getLastFocusedControl())||t===r.ForceExit.Editing?[3,8]:[4,this.handleInternalEventWithMgControlBase(a,r.InternalInterface.MG_ACT_CTRL_PREFIX)];case 7:i.sent(),i.label=8;case 8:return t!==r.ForceExit.Editing||(null===(s=e.Control)||null===s.getField())?[3,10]:[4,s.getField().updateDisplay()];case 9:i.sent(),i.label=10;case 10:return[2]}}))}))},s.prototype.handleEvents_1=function(e,t){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:a.trys.push([0,,5,6]),this.pushRtEvent(t),r=0,a.label=1;case 1:return r<e.getSize()?(n=e.getHandler(r),t.getType()===E.EVENT_TYPE_EXPRESSION||n.isSpecificHandlerOf(t)||n.isNonSpecificHandlerOf(t)||n.isGlobalHandlerOf(t)?[4,n.execute(t,!1,!1)]:[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[3,6];case 5:return this.popRtEvent(),[7];case 6:return[2]}}))}))},s.prototype.handleKeyDown=function(e,t,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(a=n.getKbdItmAlways(),s=a.getKeyCode(),a.getModifier(),this._currKbdItem=a,n.IgnoreSpecifiedControl&&(t=this.getCurrCtrl(),e=t.getForm().getTask()instanceof br?t.getForm().getTask():null,t.Type!==r.MgControlType.CTRL_TYPE_TEXT))return[2];r.Logger.Instance.WriteDevToLog("Start handling KEYDOWN event. Key code: "+s),u.label=1;case 1:if(u.trys.push([1,,10,11]),(this._currKbdItem.equals(this.KBI_DOWN)||this._currKbdItem.equals(this.KBI_UP))&&null!==t&&(t.Type===r.MgControlType.CTRL_TYPE_LIST||t.Type===r.MgControlType.CTRL_TYPE_RADIO))return[2];(i=new w(e,t)).setSystem(this._currKbdItem),i.setEditParms(n.getStartSelection(),n.getEndSelection(),n.getValue()),u.label=2;case 2:return u.trys.push([2,,4,5]),[4,this.handleEvent(i,!1)];case 3:return u.sent(),[3,5];case 4:return this._stopExecution&&null!==(o=P.ReturnToCtrl)&&P.validReturnToCtrl()&&o.getForm().getTask().setLastParkedCtrl(o),[7];case 5:return null===(l=oe.Instance.getCurrMGData())||l.IsAborting?[3,7]:[4,this.handleExpressionHandlers()];case 6:u.sent(),u.label=7;case 7:return r.Logger.Instance.WriteDevToLog("End handling KEYDOWN event. Key code: "+s),null!==t&&t.IsRepeatable&&t===P.ReturnToCtrl?[4,t.getForm().bringRecordToPage()]:[3,9];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:return[7];case 11:return[2]}}))}))},s.prototype.handleSelection=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o;return h(this,(function(l){switch(l.label){case 0:return e.Type!==r.MgControlType.CTRL_TYPE_TAB&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&e.Type!==r.MgControlType.CTRL_TYPE_RADIO&&e.Type!==r.MgControlType.CTRL_TYPE_COMBO&&e.Type!==r.MgControlType.CTRL_TYPE_LIST?[3,8]:(s=e.Type!==r.MgControlType.CTRL_TYPE_TAB&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX,i=!s||e.getForm().getTask().getLastParkedCtrl()===e,(o=!i||!e.isModifiable())?[3,2]:[4,e.IsParkable()]);case 1:o=!l.sent(),l.label=2;case 2:return o?[4,e.restoreOldValue()]:[3,4];case 3:return l.sent(),[3,8];case 4:return e.isChoiceControl()&&n.Commands.setGetSuggestedValueOfChoiceControlOnTagData(e,e.IsRepeatable?t:0,!0),e.isDifferentValue(a,e.IsNull,!0)?(e.ModifiedByUser=!0,[4,this.handleCtrlModify(e,r.InternalInterface.MG_ACT_SELECTION)]):[3,6];case 5:l.sent(),l.label=6;case 6:return e.isChoiceControl()&&n.Commands.setGetSuggestedValueOfChoiceControlOnTagData(e,e.IsRepeatable?t:0,!1),e.IsMultipleSelectionListBox()?[3,8]:[4,e.validateAndSetValue(a,!0)];case 7:l.sent(),l.label=8;case 8:return[2]}}))}))},s.prototype.handleMouseUp=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(null===e)return[2];e.Type===r.MgControlType.CTRL_TYPE_RADIO&&(n.RuntimeContextBase.Instance.CurrentClickedRadio=e),u.label=1;case 1:return u.trys.push([1,,8,9]),e.Type===r.MgControlType.CTRL_TYPE_TABLE?[3,7]:[4,e.checkPropWithLine(n.PropInterface.PROP_TYPE_ENABLED,!0,t)];case 2:return u.sent()?(s=this.canGoToControl(e,t,!0),i=e.isFocusedStopExecution(),o=P.ReturnToCtrl,s&&(!this._stopExecution&&!i||o===e)||null===o?[3,6]:(oe.Instance.currMgdID=o.getForm().getTask().getMgdID(),o.IsRepeatable?[4,o.getForm().bringRecordToPage()]:[3,4])):[2];case 3:u.sent(),u.label=4;case 4:return[4,n.FocusManager.SetFocus(o,-1)];case 5:u.sent(),o.getForm().getTask().setLastParkedCtrl(o),u.label=6;case 6:if(this._stopExecution||i)return[2];u.label=7;case 7:return!a||e.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&e.Type!==r.MgControlType.CTRL_TYPE_LIST||((l=new w(e)).setInternal(r.InternalInterface.MG_ACT_WEB_CLICK),this.addToTail(l)),[3,9];case 8:return n.RuntimeContextBase.Instance.CurrentClickedRadio=null,[7];case 9:return[2]}}))}))},s.prototype.checkAndSaveRouteEventIfCtxRemovedFromSrvr=function(e){e.getType()==E.EVENT_TYPE_INTERNAL&&e.getInternalCode()==r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE&&n.RuntimeContextBase.Instance.RemovedContextFromServer&&this.setLastSavedRouteEvent(e)},s.prototype.handleFocus=function(e,a,s){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return h.trys.push([0,,19,22]),e!==this._lastFailedFocusedControl&&e.HasExpOrParentTaskField()&&(e.isListBox()||e.isCheckBox()||e.isComboBox()||e.isTextControl()||e.isRadio()||e.isTabControl())?(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Control either has expression or has parent task variable attached to it. Failed to park on control with name: {0}",e.Name)),n.FocusManager.SetFocus(G.Instance.getLastFocusedTask(),G.getLastFocusedControl(),0,null===G.getLastFocusedControl()),this._lastFailedFocusedControl=e,[2]):(this._lastFailedFocusedControl=null,s&&(n.RuntimeContextBase.Instance.CurrentClickedCtrl=e),i=G.getLastFocusedControl(),e!==i||e.isRepeatable()?[3,2]:[4,e.getForm().bringRecordToPage()]);case 1:return h.sent(),[2];case 2:return o=G.Instance.getLastFocusedTask(),this._nextParkedCtrl=e,null!==e&&e.Type!==r.MgControlType.CTRL_TYPE_TABLE?[3,5]:null!==i?[3,4]:[4,this.HandleNonParkableControls(e.getForm().getTask())];case 3:h.sent(),h.label=4;case 4:return[2];case 5:return l=void 0,(u=e.Type===r.MgControlType.CTRL_TYPE_BUTTON)?[4,e.getProp(n.PropInterface.PROP_TYPE_RAISE_AT).getValueInt()]:[3,7];case 6:u=h.sent()===r.RaiseAt.TaskInFocus,h.label=7;case 7:return l=u?o:e.getForm().getTask(),this.canGoToControl(e,a,s)?null!=this.guiPendingEvent?[2]:[4,this.HandleSubformModality(e,o,l)]:[3,10];case 8:return h.sent()?[2]:(c=e.isRepeatable()||e.isRadio()?a:t.Int32.MinValue,(_=new w(e,c)).setInternal(r.InternalInterface.MG_ACT_CTRL_PREFIX),[4,this.handleEvent(_,!1)]);case 9:return h.sent(),[3,18];case 10:return null===i?[3,16]:i.isModifiable()?[3,13]:i.isChoiceControl()?[4,i.restoreOldValue()]:[3,12];case 11:h.sent(),h.label=12;case 12:return[3,15];case 13:return l.cancelWasRaised()?[3,15]:(T=n.Manager.GetCtrlVal(i),[4,i.validateAndSetValue(T,!0)]);case 14:h.sent()||this.setStopExecution(!0),h.label=15;case 15:return P.ReturnToCtrl=i,[3,18];case 16:return[4,this.HandleNonParkableControls(e.getForm().getTask())];case 17:h.sent(),h.label=18;case 18:return this._stopExecution||P.ReturnToCtrl!==e||G.setLastFocusedControl(e.getForm().getTask(),e),[2];case 19:return e.setFocusedStopExecution(this._stopExecution),this._stopExecution?null===(p=P.ReturnToCtrl)?[3,21]:(oe.Instance.currMgdID=p.getForm().getTask().getMgdID(),[4,n.FocusManager.SetFocus(p,-1)]):[3,21];case 20:h.sent(),p.getForm().getTask().setLastParkedCtrl(p),h.label=21;case 21:return[7];case 22:return[2]}}))}))},s.prototype.HandleSubformModality=function(e,t,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return n=!1,a=t.getMGData().getTasksCount(),s=t.getMGData().getTask(a-1),r!=t&&t==s||null!=s&&t!=s&&s.IsSubForm&&(i=s.getForm().getSubFormCtrl()).IsModal()&&(t=s),t!=e.getForm().getTask()&&t.getIsDestinationCall()?r.isDescendentOf(t)?[3,2]:((i=t.getForm().getSubFormCtrl()).IsModal()||r.getIsDestinationCall()||(i=t.GetSubformModalParentTask()),null!=i&&e!=i&&i.IsModal()?[4,this.performSubformClose(i)]:[3,2]):[3,2];case 1:o.sent(),this._stopExecution||(this.guiPendingEvent=this.getLastRtEvent()),n=!0,o.label=2;case 2:return[2,n]}}))}))},s.prototype.handleFocusOnNonMagicControl=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(a){switch(a.label){case 0:return a.trys.push([0,,2,5]),[4,s.Instance.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 1:return a.sent(),[3,5];case 2:return e.setFocusedStopExecution(this._stopExecution),this._stopExecution?null===(t=P.ReturnToCtrl)?[3,4]:(oe.Instance.currMgdID=t.getForm().getTask().getMgdID(),[4,n.FocusManager.SetFocus(t,-1)]):[3,4];case 3:a.sent(),t.getForm().getTask().setLastParkedCtrl(t),a.label=4;case 4:return[7];case 5:return[2]}}))}))},s.prototype.canGoToControl=function(e,t,n){if(n&&(e.Type===r.MgControlType.CTRL_TYPE_SUBFORM||e.Type===r.MgControlType.CTRL_TYPE_BROWSER))return!1;var a=!0;return!!e.getForm().getTask().IsInteractive&&(e.Type!==r.MgControlType.CTRL_TYPE_IMAGE||e.IsRepeatable||(a=!1),a)},s.prototype.handleTimer=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return e.setType(E.EVENT_TYPE_TIMER),e.isIdleTimer()?[4,this.handleExpressionHandlers()]:[3,3];case 1:return r.sent(),[4,this.handleContextInactivityAlert(e)];case 2:return r.sent(),[3,5];case 3:return t=oe.Instance.getMGData(e.getMgdID()),[4,this.handleEvents(t.getTimerHandlers(),e)];case 4:r.sent(),r.label=5;case 5:return[2]}}))}))},s.prototype.handleContextInactivityAlert=function(t){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=r.Misc.getSystemMilliseconds(),i=t.getTask().getMGData(),o=le.GetInstance().GetLastRequestTime,l=et.Instance.getContextInactivityTimeout()/10,u=et.Instance.getContextInactivityWarningTime()/10,c=(a-o)/1e3,0==l||0==u?[2]:s.userGrantedForContextActivity&&c>=l-u?[4,ge.Instance.MessageBox(this.confirmationDialogTitle,this.confirmationDialogMsg,n.Styles.MSGBOX_BUTTON_YES_NO)]:[3,4];case 1:return T.sent()!=n.Styles.MSGBOX_RESULT_YES?[3,3]:(_=Qe.CreateContextTimeoutResetEventCommand(),i.CmdsToServer.Add(_),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)]);case 2:return T.sent(),[3,4];case 3:s.userGrantedForContextActivity=!1,T.label=4;case 4:return[2]}}))}))},s.prototype.handleExpressionHandlers=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(n){switch(n.label){case 0:(e=new w(G.Instance.getLastFocusedTask(),G.getLastFocusedControl())).setExpression(null),e.setMainPrgCreator(e.getTask()),t=0,n.label=1;case 1:return t<oe.Instance.getSize()?null===(r=oe.Instance.getMGData(t))||r.IsAborting?[3,3]:[4,this.handleEvents(r.getExpHandlers(),e)]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},s.prototype.handleResize=function(e,t){e.getForm().setRowsInPage(t)},s.prototype.handleRowDataCurPage=function(e,t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(a){switch(a.label){case 0:return[4,e.getForm().setRowData(t,r,n)];case 1:return a.sent(),[2]}}))}))},s.prototype.handleTransferDataToGui=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.getForm().transferDataToGui()];case 1:return t.sent(),[2]}}))}))},s.prototype.fetchRecordsAheadFromServer=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.getForm().FetchRecordsAheadFromServer()];case 1:return t.sent(),[2]}}))}))},s.prototype.handleEnableEvents=function(e,t){e.getTask().ActionManager.enableList(e.getActEnableList(),t,!0)},s.prototype.handleCtrlPrefix=function(a){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p,g,d,E,I,f,C;return h(this,(function(h){switch(h.label){case 0:return i=a.getTask(),o=n.RuntimeContextBase.Instance.CurrentClickedCtrl,l=i.getForm(),u=a.getDisplayLine(),c=a.Control,l.isLineMode()?(u===t.Int32.MinValue||c.isRadio())&&(u=l.DisplayLine):u=t.Int32.MinValue,null===(_=G.getLastFocusedControl())||_.getForm().getTask().getMGData().GetId()!==c.getForm().getTask().getMGData().GetId()||_.getForm().getTask().getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,6]:!(c!==_||c.isRepeatable()&&u!==c.getDisplayLine(!0))||_.isInControlSuffix()?[3,5]:[4,this.handleInternalEventWithMgControlBase(_,r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 1:return h.sent(),this._stopExecution?c.Type===r.MgControlType.CTRL_TYPE_LIST||c.Type===r.MgControlType.CTRL_TYPE_RADIO||c.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||c.isTabControl()?(c.resetPrevVal(),[4,c.RefreshDisplay()]):[3,3]:[3,4];case 2:h.sent(),h.label=3;case 3:return[2,!1];case 4:return[3,6];case 5:return[2,!1];case 6:return i.InCtrlPrefix?[2,!1]:(i.InCtrlPrefix=!0,T=_,null!==o&&o.getForm().getTask().getMgdID()===c.getForm().getTask().getMgdID()&&c.onDiffForm(o)&&(T=o),null!==T&&c.onDiffForm(T)?[4,T.getForm().getTask().execSubformRecSuffix(c.getForm().getTask())]:[3,12]);case 7:return h.sent(),this._stopExecution?c.Type===r.MgControlType.CTRL_TYPE_LIST||c.Type===r.MgControlType.CTRL_TYPE_RADIO||c.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||c.isTabControl()?(c.resetPrevVal(),[4,c.RefreshDisplay()]):[3,9]:[3,10];case 8:h.sent(),h.label=9;case 9:return i.InCtrlPrefix=!1,[2,!1];case 10:return c.getForm().getTask().isAborting()?(i.InCtrlPrefix=!1,[2,!1]):[4,s.doSyncForSubformParent(i)];case 11:h.sent(),h.label=12;case 12:return i.DataView.isEmptyDataview()?[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,14];case 13:return h.sent(),[3,16];case 14:return i.SubformExecMode=e.Task_SubformExecModeEnum.SET_FOCUS,(p=new w(c,u)).setInternal(r.InternalInterface.MG_ACT_REC_PREFIX),[4,this.handleEvent(p,!1)];case 15:h.sent(),h.label=16;case 16:return this.GetStopExecutionFlag()?(i.InCtrlPrefix=!1,[2,!1]):[4,c.IsParkable()];case 17:return h.sent()||c===_?[3,22]:(i.InCtrlPrefix=!1,(g=null===_)?[3,19]:[4,_.invoke()]);case 18:g=!h.sent(),h.label=19;case 19:return g?[4,this.HandleNonParkableControls(c.getForm().getTask())]:[3,21];case 20:h.sent(),h.label=21;case 21:return[2,!1];case 22:return r.Logger.Instance.WriteSupportToLog(t.NString.Format("{0} Entering control: control {1}, row {2}",i.GetTaskDetails(),c.Name,u<0?0:u),!0),i.setLevel(r.Constants.TASK_LEVEL_CONTROL),c.KeyStrokeOn=!1,c.ModifiedByUser=!1,i.setCurrField(c.getField()),c.IsRepeatable?[4,l.bringRecordToPage()]:[3,24];case 23:h.sent(),h.label=24;case 24:if(_===c)return[3,30];if(!(null===_&&c.getForm().isSubForm()||null!==_&&(c.getForm().isSubForm()||_.getForm().isSubForm())))return[3,30];if(d=null,null!==_&&(d=_.getForm().getTask()),d===i)return[3,30];if(E=!0,I=void 0,f=void 0,null!==d)for(I=d.IsSubForm,f=d;null!==f&&I;f=f.getParent())E?E=!1:(I=f.IsSubForm,f.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!1),f.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!1),f.enableCreateActs(!1));I=i.IsSubForm,f=i.getParent(),h.label=25;case 25:return null!==f&&I?(I=f.IsSubForm,f.getEnableZoomHandler()&&f.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),[4,f.setCreateDeleteActsEnableState()]):[3,28];case 26:h.sent(),h.label=27;case 27:return f=f.getParent(),[3,25];case 28:return[4,i.enableModes()];case 29:h.sent(),h.label=30;case 30:return(i.getEnableZoomHandler()||c.useZoomHandler())&&i.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),(c.isTextControl()||c.isChoiceControl())&&c.SetKeyboardLanguage(!1),c.Type===r.MgControlType.CTRL_TYPE_BUTTON&&i.ActionManager.enable(r.InternalInterface.MG_ACT_BUTTON,!0),[4,i.setCreateDeleteActsEnableState()];case 31:return h.sent(),null!==(C=c.getField())&&C.NullAllowed&&c.isModifiable()&&c.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&i.ActionManager.enable(r.InternalInterface.MG_ACT_RT_EDT_NULL,!0),[2,!0]}}))}))},s.prototype.commonHandlerBefore=function(e){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N;return h(this,(function(h){switch(h.label){case 0:if(s=e,i=e.getTask(),o=null,l=null,c=t.Int32.MinValue,this._stopExecution)return[2,!1];if(i.isAborting())return[2,!1];if(e.getType()===E.EVENT_TYPE_SYSTEM&&0!==(_=this.getMatchingAction(i,e.getKbdItm()))&&null!==e.Control&&((e=new w(e,e)).setInternal(_),e.setArgList(null),T=e.Control,s.setCtrl(T),null===T))return[2,!1];if(e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,83];switch(p=i.getForm(),g=e.getDisplayLine(),d=i.DataView,o=d.getCurrRec(),I=e.Control,f=e.getInternalCode(),C=G.getLastFocusedControl(),f){case r.InternalInterface.MG_ACT_ZOOM:return[3,1];case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:return[3,3];case r.InternalInterface.MG_ACT_CTRL_FOCUS:return[3,4];case r.InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL:return[3,6];case r.InternalInterface.MG_ACT_CTRL_KEYDOWN:return[3,8];case r.InternalInterface.MG_ACT_CTRL_MOUSEUP:return[3,10];case r.InternalInterface.MG_ACT_SELECTION:return[3,12];case r.InternalInterface.MG_ACT_TIMER:return[3,14];case r.InternalInterface.MG_ACT_RESIZE:return[3,16];case r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:return[3,17];case r.InternalInterface.MG_ACT_DV_TO_GUI:return[3,19];case r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER:return[3,21];case r.InternalInterface.MG_ACT_ENABLE_EVENTS:return[3,23];case r.InternalInterface.MG_ACT_DISABLE_EVENTS:return[3,24];case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,25];case r.InternalInterface.MG_ACT_TASK_SUFFIX:return[3,26];case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,27];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,63];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,75];case r.InternalInterface.MG_ACT_CANCEL:return[3,77];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,78]}return[3,83];case 1:return[4,this.selectProg(I)];case 2:if(h.sent())return[2,!1];h.label=3;case 3:return[3,83];case 4:return[4,this.handleFocus(I,g,e.isProduceClick())];case 5:return h.sent(),[2,!1];case 6:return[4,this.handleFocusOnNonMagicControl(I)];case 7:return h.sent(),[2,!1];case 8:return[4,this.handleKeyDown(i,I,e)];case 9:return h.sent(),[2,!1];case 10:return[4,this.handleMouseUp(I,g,e.isProduceClick())];case 11:return h.sent(),[2,!1];case 12:return[4,this.onActSelection(I,p,e)];case 13:return h.sent(),[2,!1];case 14:return[4,this.handleTimer(e)];case 15:return h.sent(),[2,!1];case 16:return this.handleResize(I,g),[2,!1];case 17:return[4,this.handleRowDataCurPage(I,g,e.isSendAll(),e.LastFocusedVal)];case 18:return h.sent(),[2,!1];case 19:return[4,this.handleTransferDataToGui(I)];case 20:return h.sent(),[2,!1];case 21:return[4,this.fetchRecordsAheadFromServer(I)];case 22:return h.sent(),[3,83];case 23:return this.handleEnableEvents(e,!0),[2,!1];case 24:return this.handleEnableEvents(e,!1),[2,!1];case 25:case 26:return i.setLevel(r.Constants.TASK_LEVEL_TASK),[3,83];case 27:if(i.IsSubForm&&i.getParent().InCommonHandlerBeforeRP)return[2,!1];if(i.setAfterRetry(E.RECOVERY_NONE),i.DataSynced=!1,!i.isStarted())return[2,!1];if(!(p.getRowsInPage()>t.Int32.MinValue&&g>t.Int32.MinValue))return[3,47];for(;!d.recExists(g)&&g>0;)g--;if(!(g>=0))return[3,46];l=d.getCurrRec(),A=i.getMode(),R=l.getId(),h.label=28;case 28:return h.trys.push([28,33,,45]),c=p.DisplayLine,p.PrevDisplayLine=c,[4,p.setCurrRowByDisplayLine(g,!0,!1)];case 29:return h.sent(),null==l||d.recExistsById(l.getId())?[3,32]:[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_TABLE)];case 30:return h.sent(),[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 31:h.sent(),h.label=32;case 32:return o=d.getCurrRec(),[3,45];case 33:return(S=h.sent())instanceof mt?this._stopExecution?A===r.Constants.TASK_MODE_CREATE&&c>0&&!d.recExistsById(R)?(M=p.getPrevLine(c),[4,p.restoreOldDisplayLine(M)]):[3,35]:[3,41]:[3,43];case 34:return h.sent(),[3,37];case 35:return[4,p.restoreOldDisplayLine(c)];case 36:h.sent(),h.label=37;case 37:return[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 38:return h.sent(),this.setStopExecution(!1),C=i.getLastParkedCtrl(),i.getLastParkedCtrl(),null==C?[3,40]:[4,C.invoke()];case 39:h.sent(),h.label=40;case 40:return this.setStopExecution(!0),[2,!1];case 41:r.Logger.Instance.WriteDevToLog(S.StackTrace),h.label=42;case 42:return[3,44];case 43:throw S;case 44:return[3,45];case 45:return[3,47];case 46:throw new t.ApplicationException("in EventsManager.commonHandlerBefore(): invalid line number: "+g);case 47:if(null==o)throw new t.ApplicationException("in EventsManager.commonHandlerBefore(): no current record available !");return i.IsInteractive||i.getLevel()!==r.Constants.TASK_LEVEL_TASK||i.increaseCounter(),[4,i.evalEndCond(E.END_COND_EVAL_BEFORE)];case 48:return h.sent()?[4,i.endTask(!0,!1,!1)]:[3,50];case 49:return h.sent(),[2,!1];case 50:return p.HasTable()?[4,p.bringRecordToPage()]:[3,52];case 51:h.sent(),h.label=52;case 52:return i.getLevel()!==r.Constants.TASK_LEVEL_TASK?[2,!1]:[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 53:if(h.sent(),r.Logger.Instance.WriteDevToLog("RECORD PREFIX: "+i.queryTaskPath()),d.getCurrRec().setForceSaveOrg(!1),d.getCurrRec().Synced=!1,d.saveOriginal(),!i.IsSubForm||!i.PerformParentRecordPrefix)return[3,58];m=i.getParent(),h.label=54;case 54:return m.IsSubForm?m.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,56]:[4,this.handleInternalEventWithTask(m,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,58];case 55:return h.sent(),m=m.getParent(),this.GetStopExecutionFlag()?[3,58]:[3,57];case 56:return[3,58];case 57:return[3,54];case 58:return i.InCommonHandlerBeforeRP=!0,[4,i.CheckRefreshSubTasks()];case 59:return h.sent()?[4,d.computeSubForms()]:[3,61];case 60:h.sent(),h.label=61;case 61:return i.InCommonHandlerBeforeRP=!1,i.setLevel(r.Constants.TASK_LEVEL_RECORD),[4,i.enableRecordActions()];case 62:return h.sent(),[3,83];case 63:return v=!1,L=void 0,i.ConfirmUpdateNo=!1,null==o?[2,!1]:[4,i.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 64:return v=h.sent(),(o.Modified||v)&&o.getMode()===n.DataModificationTypes.Delete&&i.getMode()===r.Constants.TASK_MODE_DELETE?[2,!0]:i.getLevel()===r.Constants.TASK_LEVEL_TASK?[2,!1]:i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,66]:(i.setInRecordSuffix(!0),[4,this.handleInternalEventWithMgControlBase(i.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)]);case 65:if(h.sent(),i.setInRecordSuffix(!1),this._stopExecution)return[2,!1];h.label=66;case 66:return[4,i.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_SUFFIX)];case 67:return h.sent(),this._stopExecution?[2,!1]:(r.Logger.Instance.WriteDevToLog("RECORD SUFFIX: "+i.queryTaskPath()),i.setLevel(r.Constants.TASK_LEVEL_TASK),[4,i.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)]);case 68:return L=h.sent(),i.getMode()!==r.Constants.TASK_MODE_QUERY||v||o.Modified||L?o.Modified||v||L&&i.InSelect?[3,71]:o.getMode()!==n.DataModificationTypes.Delete?[3,70]:[4,this.executeControlVerification(i)]:[2,!1];case 69:return[2,h.sent()];case 70:return[2,!1];case 71:return i.getMode()!==r.Constants.TASK_MODE_DELETE&&o.Modified?[4,this.updateConfirmed(i)]:[3,73];case 72:if(!h.sent())return[2,!1];h.label=73;case 73:return[4,this.executeControlVerification(i)];case 74:return!h.sent()?[2,!1]:[3,83];case 75:return[4,this.handleCtrlPrefix(e)];case 76:return h.sent()?[2,!0]:(e.Control.InControl=!1,[2,!1]);case 77:return n.Manager.CleanMessagePane(i),[3,83];case 78:return null==I||null!=this.getStopExecutionCtrl()||i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[2,!1]:I.isSubform()?[3,82]:(u=n.Manager.GetCtrlVal(I),i.CurrentEditingControl=null,(b=!i.cancelWasRaised())?(N=I.Type!==r.MgControlType.CTRL_TYPE_BROWSER&&(!a.isNullOrUndefined(I._field)&&I._field.getType()===r.StorageAttribute.DATE||null!==u)&&void 0!==u)?[4,I.validateAndSetValue(u,!0)]:[3,80]:[3,81]);case 79:N=!h.sent(),h.label=80;case 80:b=N,h.label=81;case 81:if(b)return this.setStopExecution(!0),[2,!1];h.label=82;case 82:return this._stopExecution||n.Manager.CleanMessagePane(i),I.InControl=!1,I.ClipBoardDataExists=!1,I.ValidateControl=!0,I.setInControlSuffix(!0),[3,83];case 83:return[2,!0]}}))}))},s.prototype.selectProg=function(r){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:return o=!1,l=r.getForm().getTask(),r.HasSelectProgram()?r.IsParkable()?(s=n.Manager.GetCtrlVal(r),r.validateAndSetValue(s,!1)?[3,1]:(this.setStopExecution(!0),[3,4])):[3,4]:[3,4];case 1:return u=null,[4,r.getMgValue(s)];case 2:return i=_.sent(),c=l.DataView.getCurrRec(),u=c.getXMLForValue(r.getField().getId(),i),a=Qe.CreateSelectProgramCommand(l.getTaskTag(),null,t.Int32.MinValue,r.getDitIdx(),u),l.getMGData().CmdsToServer.Add(a),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 3:_.sent(),o=!0,_.label=4;case 4:return[2,o]}}))}))},s.prototype.executeControlVerification=function(e){return T(this,void 0,void 0,(function(){var t,n,s,i,o;return h(this,(function(l){switch(l.label){case 0:t=e.getHandlersTab(),n=0,l.label=1;case 1:return n<t.getSize()?(s=t.getHandler(n),s.getEvent().getInternalCode()!==r.InternalInterface.MG_ACT_CTRL_VERIFICATION?[3,3]:(i=null!==e.getForm()?e.getForm().getCtrlByCtrlName(s.getCtrlName()):null,a.isNullOrUndefined(i)?[3,3]:((o=new w(i)).setInternal(r.InternalInterface.MG_ACT_CTRL_VERIFICATION),[4,this.handleEvent(o,!1)]))):[3,4];case 2:if(l.sent(),this._stopExecution)return G.setLastFocusedControl(e,i),this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(i),[2,!1];l.label=3;case 3:return n++,[3,1];case 4:return[2,!0]}}))}))},s.prototype.onActSelection=function(e,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return(s=a.getDisplayLine())===t.Int32.MinValue&&(s=n.DisplayLine),e.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||e.Type===r.MgControlType.CTRL_TYPE_LIST||e.Type===r.MgControlType.CTRL_TYPE_RADIO||e.Type===r.MgControlType.CTRL_TYPE_BUTTON||e.Type===r.MgControlType.CTRL_TYPE_TAB&&!a.isProduceClick()?[4,this.simulateSelection(e,a.getValue(),s,a.isProduceClick())]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this.handleSelection(e,s,a.getValue())];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},s.prototype.onSubformClose=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return null==t.getArgList()||1!==t.getArgList().getSize()?[3,5]:(n=null,[4,t.getArgList().getArgValue(0,r.StorageAttribute.ALPHA,0)]);case 1:if(null==(a=o.sent()))return[2];s=e,o.label=2;case 2:return null==s.getForm()||s.getMgdID()!==e.getMgdID()?[3,5]:null==(n=s.getForm().getCtrlByName(a.trim(),r.MgControlType.CTRL_TYPE_SUBFORM))||null==(i=n.getSubformTask())||i.IsRoute()?[3,4]:[4,this.performSubformClose(n)];case 3:return o.sent(),[3,5];case 4:return s=s.getParent(),[3,2];case 5:return[2]}}))}))},s.prototype.performSubformClose=function(t){return T(this,void 0,void 0,(function(){var r,a,s;return h(this,(function(i){switch(i.label){case 0:return r=t.getSubformTask(),a=t.getForm().getTask(),s=r.getMGData(),this.pushNewExecStacks(),[4,r.endTask(!0,!1,!1,!0)];case 1:return i.sent(),this.popNewExecStacks(),this._stopExecution?[3,4]:(a.TaskService.RemoveRecomputes(a,r),[4,r.stop()]);case 2:return i.sent(),t.resetSubformTask(),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 3:i.sent(),n.Commands.addClosesubform(n.CommandType.CLOSE_SUB_FORM,t,r.getTaskTag(),t.getName(),r.getForm().buildFormName()),t.IsModal()&&s.abort(),i.label=4;case 4:return[2]}}))}))},s.prototype.moveToLine=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return(a=new w(n,t)).setInternal(r.InternalInterface.MG_ACT_REC_PREFIX),[4,this.handleEvent(a,!1)];case 1:return s.sent(),null===n?[3,3]:[4,n.invoke()];case 2:s.sent(),s.label=3;case 3:return e.SelectRow(!0),[2]}}))}))},s.prototype.createEventArguments=function(e){null===e.getArgList()&&e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()},s.prototype.DoTaskLevelRecordSuffix=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return n=!1,e.getLevel()!==r.Constants.TASK_LEVEL_RECORD?[3,2]:(t.value=!1,[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)]);case 1:a.sent(),this.GetStopExecutionFlag()&&(n=!0),a.label=2;case 2:return[2,n]}}))}))},s.prototype.DoTaskLevelRecordPrefix=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.GetStopExecutionFlag()?[3,2]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},s.prototype.commonHandler=function(a){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N,y,O,P,D,k,x,F,V,U,B,X,H;return h(this,(function(h){switch(h.label){case 0:if(i=a.getTask(),o=i.getMGData(),l=i.getForm(),u=a.Control,_=!0,p=br.CommandsProcessor,this._stopExecution)return[2];a.getType()===E.EVENT_TYPE_USER&&(a=new w(a.getUserEvent(),a)),h.label=1;case 1:if(h.trys.push([1,,181,182]),this.pushRtEvent(a),a.getType()===E.EVENT_TYPE_SYSTEM&&0!==(g=this.getMatchingAction(i,a.getKbdItm()))&&((a=new w(a,a)).setInternal(g),a.setArgList(null)),d=void 0,a.getType()!==E.EVENT_TYPE_INTERNAL||a.isImmediate()||!this.ActAllowed(a.getInternalCode())||this._processingTopMostEndTask)return[3,180];switch(I=o.CmdsToServer,f=i.DataView,C=f.getCurrRec(),A=a.getInternalCode(),A){case r.InternalInterface.MG_ACT_SUBFORM_CLOSE:return[3,2];case r.InternalInterface.MG_ACT_BUTTON:case r.InternalInterface.MG_ACT_CTRL_HIT:return[3,4];case r.InternalInterface.MG_ACT_TOGGLE_INSERT:return[3,9];case r.InternalInterface.MG_ACT_CLOSE:return[3,10];case r.InternalInterface.MG_ACT_EXIT:return[3,11];case r.InternalInterface.MG_ACT_EXIT_SYSTEM:return[3,13];case r.InternalInterface.MG_ACT_TBL_NXTLINE:return[3,15];case r.InternalInterface.MG_ACT_TBL_PRVLINE:return[3,18];case r.InternalInterface.MG_ACT_TBL_NXTPAGE:return[3,21];case r.InternalInterface.MG_ACT_TBL_PRVPAGE:return[3,24];case r.InternalInterface.MG_ACT_TBL_BEGPAGE:return[3,27];case r.InternalInterface.MG_ACT_TBL_ENDPAGE:return[3,30];case r.InternalInterface.MG_ACT_TBL_BEGTBL:return[3,33];case r.InternalInterface.MG_ACT_TBL_ENDTBL:return[3,36];case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:return[3,39];case r.InternalInterface.MG_ACT_DELLINE:return[3,40];case r.InternalInterface.MG_ACT_CRELINE:case r.InternalInterface.MG_ACT_CRELINE_ABOVE:return[3,42];case r.InternalInterface.MG_ACT_CANCEL:return[3,62];case r.InternalInterface.MG_ACT_ENTER_ROW_EDITING:return[3,64];case r.InternalInterface.MG_ACT_RT_QUIT:return[3,66];case r.InternalInterface.MG_ACT_RTO_CREATE:return[3,68];case r.InternalInterface.MG_ACT_RTO_QUERY:return[3,73];case r.InternalInterface.MG_ACT_RTO_MODIFY:return[3,91];case r.InternalInterface.MG_ACT_SELECT:return[3,108];case r.InternalInterface.MG_ACT_SUBFORM_REFRESH:return[3,114];case r.InternalInterface.MG_ACT_SUBFORM_OPEN:return[3,131];case r.InternalInterface.MG_ACT_RTO_SEARCH:return[3,133];case r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN:case r.InternalInterface.MG_ACT_RT_REFRESH_VIEW:case r.InternalInterface.MG_ACT_RT_REFRESH_RECORD:return[3,141];case r.InternalInterface.MG_ACT_ACT_CLOSE_APPL:return[3,143];case r.InternalInterface.MG_ACT_CONTEXT_REMOVE:return[3,145];case r.InternalInterface.MG_ACT_SERVER_TERMINATION:return[3,150];case r.InternalInterface.MG_ACT_RT_EDT_NULL:return[3,152];case r.InternalInterface.MG_ACT_ROLLBACK:return[3,156];case r.InternalInterface.MG_ACT_OK:case r.InternalInterface.MG_ACT_INDEX_CHANGE:case r.InternalInterface.MG_ACT_COL_SORT:return[3,158];case r.InternalInterface.MG_ACT_COL_CLICK:return[3,179]}return[3,180];case 2:return[4,this.onSubformClose(i,a)];case 3:return h.sent(),[3,180];case 4:return u.Type!==r.MgControlType.CTRL_TYPE_BUTTON||A!==r.InternalInterface.MG_ACT_BUTTON&&a.isGuiTriggeredEvent()&&!u.isParkable(!0)?[3,7]:(H=new w(u),null!=u.getRtEvtTask()&&H.setTask(u.getRtEvtTask()),E.EVENT_TYPE_NONE===H.getType()?[3,6]:(u.useZoomHandler()&&null!=(R=H.getTask())&&R.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),H.setArgList(u.ArgList),[4,H.setPublicName()]));case 5:h.sent(),this.addToTail(H),this.checkAndSaveRouteEventIfCtxRemovedFromSrvr(H),h.label=6;case 6:return[3,8];case 7:u.Type===r.MgControlType.CTRL_TYPE_TAB?this.addInternalEventWithCtrlAndCode(u,r.InternalInterface.MG_ACT_ZOOM):u.Type===r.MgControlType.CTRL_TYPE_RADIO&&u.setControlToFocus(),h.label=8;case 8:return[3,180];case 9:return n.RuntimeContextBase.Instance.ToggleInsertMode(),[3,180];case 10:return(S=new w(a,a)).setInternal(r.InternalInterface.MG_ACT_EXIT),this.addToTail(S),[3,180];case 11:return[4,(i.isMainProg()?oe.Instance.StartupMgData.getFirstTask():i).endTask(a.reversibleExit(),!1,a.ExitDueToError())];case 12:return h.sent(),[3,180];case 13:return[4,oe.Instance.StartupMgData.getFirstTask().endTask(a.reversibleExit(),!1,!1)];case 14:return h.sent(),[3,180];case 15:return null==l?[3,17]:[4,l.moveInView(r.Constants.MOVE_UNIT_ROW,r.Constants.MOVE_DIRECTION_NEXT)];case 16:h.sent(),h.label=17;case 17:return[3,180];case 18:return null==l?[3,20]:[4,l.moveInView(r.Constants.MOVE_UNIT_ROW,r.Constants.MOVE_DIRECTION_PREV)];case 19:h.sent(),h.label=20;case 20:return[3,180];case 21:return null==l?[3,23]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_NEXT)];case 22:h.sent(),h.label=23;case 23:return[3,180];case 24:return null==l?[3,26]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_PREV)];case 25:h.sent(),h.label=26;case 26:return[3,180];case 27:return null==l?[3,29]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_BEGIN)];case 28:h.sent(),h.label=29;case 29:return[3,180];case 30:return null==l?[3,32]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_END)];case 31:h.sent(),h.label=32;case 32:return[3,180];case 33:return null!=(c=i.getLastParkedCtrl())&&c.isListBox()||null==l?[3,35]:[4,l.moveInView(r.Constants.MOVE_UNIT_TABLE,r.Constants.MOVE_DIRECTION_BEGIN)];case 34:h.sent(),h.label=35;case 35:return[3,180];case 36:return null!==(c=i.getLastParkedCtrl())&&c.isListBox()||null==l?[3,38]:[4,l.moveInView(r.Constants.MOVE_UNIT_TABLE,r.Constants.MOVE_DIRECTION_END)];case 37:h.sent(),h.label=38;case 38:return[3,180];case 39:return M=u.Type,m=r.InternalInterface.MG_ACT_NONE,M!==r.MgControlType.CTRL_TYPE_TABLE&&M!==r.MgControlType.CTRL_TYPE_LABEL&&M!==r.MgControlType.CTRL_TYPE_IMAGE&&(u.getForm().getTask().ActionManager.isEnabled(r.InternalInterface.MG_ACT_SELECT)?m=r.InternalInterface.MG_ACT_SELECT:u.getForm().getTask().ActionManager.isEnabled(r.InternalInterface.MG_ACT_ZOOM)&&(m=r.InternalInterface.MG_ACT_ZOOM),m!==r.InternalInterface.MG_ACT_NONE&&this.addInternalEventWithCtrlAndCode(u,m)),[3,180];case 40:return[4,this.HandleActionDelline(a,i,f,C,!1)];case 41:return h.sent()?[2]:[3,180];case 42:return i.DataView.isEmptyDataview()?[4,this.gotoCreateMode(i,I)]:[3,44];case 43:return h.sent(),[3,180];case 44:if(i.getInCreateLine())return[3,180];i.setInCreateLine(!0),h.label=45;case 45:return h.trys.push([45,,60,61]),i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,47]:[4,this.handleInternalEventWithMgControlBase(i.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 46:if(h.sent(),this.GetStopExecutionFlag())return[2];h.label=47;case 47:return i.getMode()!==r.Constants.TASK_MODE_CREATE||null==C||C.Modified?[3,54]:[4,i.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 48:return h.sent()?(_=!1,[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,50];case 49:return h.sent(),this.GetStopExecutionFlag()||i.isAborting()?[2]:[3,54];case 50:return i.setLevel(r.Constants.TASK_LEVEL_TASK),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 51:return h.sent(),this.GetStopExecutionFlag()||null==l?[3,53]:null===(v=i.getLastParkedCtrl())?[3,53]:[4,v.invoke()];case 52:h.sent(),h.label=53;case 53:return[2];case 54:return L=new t.RefParam(_),[4,this.DoTaskLevelRecordSuffix(i,L)];case 55:return h.sent()?[2]:(_=L.value,null==l?[3,57]:(0,0,i.getMode()===r.Constants.TASK_MODE_CREATE&&i.ConfirmUpdateNo?[3,57]:[4,l.addRec(_,0,0,A==r.InternalInterface.MG_ACT_CRELINE_ABOVE)]));case 56:h.sent(),h.label=57;case 57:return[4,this.DoTaskLevelRecordPrefix(i,l)];case 58:return h.sent(),[4,this.HandleActEnterRowEditing(i)];case 59:return h.sent(),[3,61];case 60:return i.setInCreateLine(!1),[7];case 61:return[3,180];case 62:return[4,this.HandleActCancel(a,i,l,u,C,!0)];case 63:return h.sent(),[3,180];case 64:return[4,this.HandleActEnterRowEditing(i)];case 65:return h.sent(),[3,180];case 66:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_QUIT)];case 67:return h.sent(),[3,180];case 68:return(b=i.getMode()===r.Constants.TASK_MODE_CREATE)?[3,70]:[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()];case 69:b=h.sent(),h.label=70;case 70:return b?[4,this.gotoCreateMode(i,I)]:[3,72];case 71:h.sent(),h.label=72;case 72:return[3,180];case 73:return(N=i.getMode()!==r.Constants.TASK_MODE_QUERY)?[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,75];case 74:N=!1===h.sent(),h.label=75;case 75:return N?[3,180]:[4,i.enableModes()];case 76:return h.sent(),T=i.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 77:return h.sent(),this.GetStopExecutionFlag()?[3,90]:(i.setMode(r.Constants.TASK_MODE_QUERY),T===r.Constants.TASK_MODE_CREATE?[3,83]:[4,f.currRecCompute(!0)]);case 78:return h.sent(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 79:return h.sent(),null==u?[3,81]:[4,u.invoke()];case 80:h.sent(),h.label=81;case 81:return[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 82:return h.sent(),[3,88];case 83:return i.setPreventRecordSuffix(!0),i.setPreventControlChange(!0),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)];case 84:return h.sent(),null==u?[3,86]:[4,u.invoke()];case 85:h.sent(),h.label=86;case 86:return i.setPreventRecordSuffix(!1),i.setPreventControlChange(!1),f.isEmpty()||f.getCurrRec().getMode()===n.DataModificationTypes.Insert?i.setMode(r.Constants.TASK_MODE_CREATE):i.setMode(r.Constants.TASK_MODE_QUERY),[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 87:h.sent(),h.label=88;case 88:return i.setOriginalTaskMode(r.Constants.TASK_MODE_QUERY),[4,i.setCreateDeleteActsEnableState()];case 89:h.sent(),h.label=90;case 90:return[3,180];case 91:return(y=i.getMode()!==r.Constants.TASK_MODE_MODIFY)?[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,93];case 92:y=!1===h.sent(),h.label=93;case 93:return y?[3,180]:[4,i.enableModes()];case 94:return h.sent(),T=i.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 95:return h.sent(),this.GetStopExecutionFlag()?[3,107]:(i.setMode(r.Constants.TASK_MODE_MODIFY),T===r.Constants.TASK_MODE_CREATE?[3,100]:[4,f.currRecCompute(!0)]);case 96:return h.sent(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 97:return h.sent(),null==u?[3,99]:[4,u.invoke()];case 98:h.sent(),h.label=99;case 99:return[3,105];case 100:return i.setPreventRecordSuffix(!0),i.setPreventControlChange(!0),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)];case 101:return h.sent(),null==u?[3,103]:[4,u.invoke()];case 102:h.sent(),h.label=103;case 103:return i.setPreventRecordSuffix(!1),i.setPreventControlChange(!1),f.isEmpty()||f.getCurrRec().getMode()===n.DataModificationTypes.Insert?i.setMode(r.Constants.TASK_MODE_CREATE):i.setMode(r.Constants.TASK_MODE_MODIFY),[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 104:h.sent(),h.label=105;case 105:return i.setOriginalTaskMode(r.Constants.TASK_MODE_MODIFY),[4,i.setCreateDeleteActsEnableState()];case 106:h.sent(),h.label=107;case 107:return[3,180];case 108:return h.trys.push([108,,110,111]),i.InSelect=!0,[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 109:return h.sent(),[3,111];case 110:return i.InSelect=!1,[7];case 111:return this._stopExecution?[3,113]:[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_EXIT)];case 112:h.sent(),h.label=113;case 113:return[3,180];case 114:return null==a.getArgList()||1!==a.getArgList().getSize()?[3,125]:(O=null,[4,a.getArgList().getArgValue(0,r.StorageAttribute.ALPHA,0)]);case 115:if(null==(P=h.sent()))return[3,180];k=i,h.label=116;case 116:return null==k.getForm()||k.getMgdID()!==i.getMgdID()?[3,124]:null==(O=k.getForm().getCtrlByName(P.trim(),r.MgControlType.CTRL_TYPE_SUBFORM))?[3,123]:null!=(D=O.getSubformTask())?[3,120]:[4,O.getProp(n.PropInterface.PROP_TYPE_SUBFORM_TYPE).getValueInt()];case 117:return h.sent()===r.SubformType.None?[3,119]:[4,this.OpenSubform(k,O)];case 118:h.sent(),h.label=119;case 119:return[3,122];case 120:return[4,k.SubformRefresh(D,!0)];case 121:h.sent(),h.label=122;case 122:return[3,124];case 123:return k=k.getParent(),[3,116];case 124:return[3,130];case 125:return null==a.getArgList()||2!==a.getArgList().getSize()?[3,130]:(D=i,k=void 0,[4,a.getArgList().getArgValue(1,r.StorageAttribute.NUMERIC,0)]);case 126:x=h.sent(),h.label=127;case 127:return D.IsSubForm?(k=D.getParent(),D.getTaskTag()!==x?[3,129]:[4,k.SubformRefresh(D,!0)]):[3,130];case 128:return h.sent(),[3,130];case 129:return D=k,[3,127];case 130:return[3,180];case 131:return[4,this.OpenSubform(i,a.Control)];case 132:return h.sent(),[3,180];case 133:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 134:return h.sent(),this.GetStopExecutionFlag()?[3,140]:(d=Qe.CreateEventCommand(i.getTaskTag(),A),i.getTaskCache().clearCache(),[4,i.DataviewManager.Execute(d)]);case 135:return h.sent(),l.isScreenMode()?[3,137]:(f.setTopRecIdx(0),l.HasTable()?[4,l.restoreOldDisplayLine(l.recordIdx2DisplayLine(f.getCurrRecIdx()))]:[3,137]);case 136:h.sent(),h.label=137;case 137:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 138:return h.sent(),null==u?[3,140]:[4,u.invoke()];case 139:h.sent(),h.label=140;case 140:return[3,180];case 141:return[4,this.handleRefreshEvents(a)];case 142:return h.sent(),[3,180];case 143:return d=Qe.CreateEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag(),r.InternalInterface.MG_ACT_BROWSER_ESC),I.Add(d),[4,p.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 144:return h.sent(),[3,180];case 145:return F=G.Instance.getLastFocusedTask().DataView.getCurrRec(),en.TransCacheExists()||null!=F&&F.Modified?(console.log("Pending transaction/record is modified, discarded 'Context Remove' event."),[3,149]):[3,146];case 146:return et.Instance.getClientContextInactivityTimeout()>0?[4,this.ExecuteClientContextInactivityTimer()]:[3,148];case 147:h.sent(),h.label=148;case 148:if(s.clientContextInactivityTimerAborted)return console.log("Discarded 'Context Remove' event as user event occurred."),s.clientContextInactivityTimerAborted=!1,[3,180];V=Qe.CreateContextTerminationEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag()),oe.Instance.getCurrMGData().CmdsToServer.Add(V),le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS),console.log("Removed context from server"),n.RuntimeContextBase.Instance.RemovingContextFromServer=!0,h.label=149;case 149:return[3,180];case 150:return d=Qe.CreateEventCommand(i.getTaskTag(),A),I.Add(d),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 151:return h.sent(),[3,180];case 152:return null!=this._currField&&this._currField.NullAllowed?[4,this._currField.setValueAndStartRecompute(this._currField.getMagicDefaultValue(),!0,!0,!0,!1)]:[3,155];case 153:return h.sent(),[4,this._currField.updateDisplay()];case 154:h.sent(),h.label=155;case 155:return[3,180];case 156:return[4,s.HandleRollbackAction(i,I,e.RollbackEventCommand_RollbackType.ROLLBACK)];case 157:return h.sent(),[3,180];case 158:return A===r.InternalInterface.MG_ACT_INDEX_CHANGE&&i.DataviewManager.HasRemoteData||A===r.InternalInterface.MG_ACT_COL_SORT&&null!=u.getField()?(U=G.Instance.getLastFocusedTask(),null==(B=G.getLastFocusedControl(G.LastFocusMgdID))?[3,160]:[4,this.handleInternalEventWithMgControlBase(B,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]):[3,178];case 159:h.sent(),h.label=160;case 160:return this.GetStopExecutionFlag()?[3,162]:[4,i.ExecuteNestedRS(U)];case 161:h.sent(),h.label=162;case 162:return this.GetStopExecutionFlag()||i.getLevel()===r.Constants.TASK_LEVEL_TASK?[3,164]:[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 163:h.sent(),h.label=164;case 164:return this.GetStopExecutionFlag()?[3,178]:(i.getTaskCache().clearCache(),A!==r.InternalInterface.MG_ACT_INDEX_CHANGE?[3,166]:(i.getForm().HasTable()&&l.clearTableColumnSortMark(!0),[4,Qe.CreateIndexChangeCommand(i.getTaskTag(),i.DataView.GetCurrentRecId(),a.getArgList())]));case 165:return d=h.sent(),[3,167];case 166:d=Qe.CreateColumnSortCommand(i.getTaskTag(),a.Direction,u.getDitIdx(),u.getField().getId(),i.DataView.GetCurrentRecId()),h.label=167;case 167:return[4,i.DataviewManager.Execute(d)];case 168:return h.sent(),f.setTopRecIdx(0),[4,l.restoreOldDisplayLine(0)];case 169:return h.sent(),this._isSorting=!0,i!==G.Instance.getLastFocusedTask()&&i.pathContains(G.Instance.getLastFocusedTask())?[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,175];case 170:return h.sent(),this.GetStopExecutionFlag()||i.getPreventControlChange()?[3,172]:[4,U.ExecuteNestedRS(i)];case 171:h.sent(),h.label=172;case 172:return this.GetStopExecutionFlag()||null==B?[3,174]:[4,B.invoke()];case 173:h.sent(),h.label=174;case 174:return[3,177];case 175:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 176:h.sent(),h.label=177;case 177:this._isSorting=!1,h.label=178;case 178:return[3,180];case 179:return!this.GetStopExecutionFlag()&&a.isGuiTriggeredEvent()&&u.isColumnSortable()&&null!=(X=u.getColumnChildControl())&&((H=new w(X,a.Direction,0)).setInternal(r.InternalInterface.MG_ACT_COL_SORT),this.addToTail(H)),[3,180];case 180:return[3,182];case 181:return this.popRtEvent(),[7];case 182:return[2]}}))}))},s.prototype.HandleActEnterRowEditing=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return e.getMode()!==r.Constants.TASK_MODE_QUERY?[3,1]:(e.WriteToMessagePane("Cannot enter Row Editing when in Query Mode.",!1),[3,3]);case 1:return[4,(t=e.getForm()).startRowEditing(t.DisplayLine)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},s.prototype.HandleStopRowEditing=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,(t=e.getForm()).stopRowEditing(t.DisplayLine)];case 1:return r.sent(),[2]}}))}))},s.prototype.OpenSubform=function(t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return t.TaskService.RemoveRecomputes(t,null),n=Qe.CreateSubformOpenCommand(t.getTaskTag(),r.getDitIdx()),t.getMGData().CmdsToServer.Add(n),[4,br.CommandsProcessor.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return a.sent(),[2]}}))}))},s.HandleRollbackAction=function(t,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=br.CommandsProcessor,Dr.ClientIsInRollbackCommand=!0,t=t.TaskService.GetOwnerTransactionTask(t),s=Qe.CreateRollbackEventCommand(t.getTaskTag(),n),r.Add(s),[4,a.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return i.sent(),Dr.ClientIsInRollbackCommand=!1,[2]}}))}))},s.prototype.HandleActCancel=function(t,a,i,o,l,u){return T(this,void 0,void 0,(function(){var c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:return a.InHandleActCancel?[2]:(a.InHandleActCancel=!0,c=a.getMode(),_=a.getForm().DisplayLine,c===r.Constants.TASK_MODE_QUERY||l.Updated?[3,10]:u&&(l.Modified||null!==a.getLastParkedCtrl()&&a.getLastParkedCtrl().ModifiedByUser)?[4,a.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_CANCEL,!1)]:[3,3]);case 1:return h.sent()?[4,ge.Instance.confirm_bool(r.MsgInterface.CONFIRM_STR_CANCEL)]:[3,3];case 2:if(!h.sent())return a.InHandleActCancel=!1,[2];h.label=3;case 3:return T=l.getMode(),n.GuiEnvironment.Environment.GetSpecialCancelOnCreate()&&a.getMode()==r.Constants.TASK_MODE_CREATE&&a.getOriginalTaskMode()==r.Constants.TASK_MODE_CREATE?[4,a.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)]:[3,6];case 4:return h.sent()?[4,a.checkProp(n.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW,!0)]:[3,6];case 5:p=h.sent(),1==a.DataView.getSize()&&p&&(a.setMode("M"),a.DataView.setEmptyDataview(!0)),h.label=6;case 6:return u&&(a.isTransactionOnLevel(E.TRANS_RECORD_PREFIX)&&t.RollbackInCancel())?[4,s.HandleRollbackAction(a,a.getMGData().CmdsToServer,e.RollbackEventCommand_RollbackType.CANCEL)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[4,s.HandleCancelEdit(t,a,i,l,T)];case 9:return h.sent(),[3,13];case 10:return a.setLevel(r.Constants.TASK_LEVEL_TASK),null!==(g=G.getLastFocusedControl())&&g.getForm().getTask().setLevel(r.Constants.TASK_LEVEL_TASK),t.isQuit()?[3,13]:[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_REC_PREFIX)];case 11:return h.sent(),[4,this.HandleParkabilityOnRowChange(a)];case 12:h.sent(),h.label=13;case 13:return t.isQuit()?[4,this.handleInternalEventWithMgControlBase(o,r.InternalInterface.MG_ACT_EXIT)]:[3,15];case 14:h.sent(),h.label=15;case 15:return[4,i.stopRowEditing(_)];case 16:return h.sent(),a.InHandleActCancel=!1,[2]}}))}))},s.HandleCancelEdit=function(e,t,r,a,s){return T(this,void 0,void 0,(function(){return h(this,(function(i){switch(i.label){case 0:return a.Synced&&s===n.DataModificationTypes.Insert&&a.setMode(s),null===r?[3,2]:(null!==t.getLastParkedCtrl()&&t.getLastParkedCtrl().resetPrevVal(),[4,r.cancelEdit(!0,e.isQuit())]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},s.prototype.HandleActionDelline=function(e,t,a,s,i){return T(this,void 0,void 0,(function(){var e,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return o=t.getForm(),l=o.getIsRowEditingFromGui(o.DisplayLine),[4,t.checkProp(n.PropInterface.PROP_TYPE_ALLOW_DELETE,!0)];case 1:return h.sent()?null===(e=t.getLastParkedCtrl())?[3,3]:[4,this.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]:[3,32];case 2:h.sent(),h.label=3;case 3:return this.GetStopExecutionFlag()?[3,32]:(u=s.getMode(),s.clearMode(),s.setMode(n.DataModificationTypes.Delete),u===n.DataModificationTypes.Insert&&s.setSendToServer(!1),(c=s.Modified)?[3,5]:[4,t.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 4:c=h.sent(),h.label=5;case 5:return c?(t.setMode(r.Constants.TASK_MODE_MODIFY),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,10];case 6:return h.sent(),this._stopExecution?s.SendToServer?[3,8]:[4,a.addCurrToModified()]:[3,10];case 7:h.sent(),s.setSendToServer(!0),h.label=8;case 8:return s.clearMode(),s.setMode(u),this.setStopExecution(!1),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 9:return h.sent(),this.setStopExecution(!0),[2,!0];case 10:return s.setInDeleteProcess(!0),t.setMode(r.Constants.TASK_MODE_DELETE),i?[3,18]:(_=t.mustConfirmInDeleteMode())?[3,12]:[4,t.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE,!1)];case 11:_=h.sent(),h.label=12;case 12:return _?[4,ge.Instance.confirm_bool(r.MsgInterface.CONFIRM_STR_DELETE)]:[3,18];case 13:return h.sent()?[3,18]:(s.clearMode(),s.setMode(u),t.setMode(r.Constants.TASK_MODE_MODIFY),null===e?[3,15]:[4,this.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_PREFIX)]);case 14:h.sent(),h.label=15;case 15:return l?[4,(T=t.getForm()).startRowEditing(T.DisplayLine)]:[3,17];case 16:h.sent(),h.label=17;case 17:return[2,!0];case 18:return[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 19:return h.sent(),s.setInDeleteProcess(!1),this._stopExecution?s.SendToServer?[3,21]:[4,a.addCurrToModified()]:[3,23];case 20:h.sent(),s.setSendToServer(!0),h.label=21;case 21:return s.clearMode(),s.setMode(u),this.setStopExecution(!1),t.setMode(r.Constants.TASK_MODE_MODIFY),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 22:return h.sent(),this.setStopExecution(!0),[2,!0];case 23:u===n.DataModificationTypes.Insert&&(s.clearMode(),s.setMode(u)),p=a.getCurrRec(),h.label=24;case 24:return h.trys.push([24,,29,32]),s===p?[3,26]:[4,a.setCurrRec(s.getId(),!1)];case 25:h.sent(),h.label=26;case 26:return t.isAborting()?[3,28]:[4,this.delCurrRec(t,!1)];case 27:h.sent(),h.label=28;case 28:return[3,32];case 29:return s===p?[3,31]:[4,a.setCurrRec(p.getId(),!1)];case 30:h.sent(),1===a.getSize()&&t.setMode(r.Constants.TASK_MODE_CREATE),h.label=31;case 31:return i&&t.setMode(r.Constants.TASK_MODE_DELETE),[7];case 32:return[2,!1]}}))}))},s.prototype.handleRefreshEvents=function(e){return T(this,void 0,void 0,(function(){var t,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return t=e.getTask(),s=t.getForm(),i=t.DataView,o=e.getInternalCode(),l=null,o===r.InternalInterface.MG_ACT_RT_REFRESH_RECORD&&(this._isInRecordFlushEvent=!0),(u=o===r.InternalInterface.MG_ACT_RT_REFRESH_VIEW&&t.getMode()===r.Constants.TASK_MODE_CREATE)?[4,t.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)]:[3,2];case 1:u=!h.sent(),h.label=2;case 2:return u?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_EXIT)]:[3,4];case 3:return h.sent(),[3,25];case 4:return[4,t.ExecuteNestedRS(G.Instance.getLastFocusedTask())];case 5:return h.sent(),this.GetStopExecutionFlag()?[3,7]:[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 6:h.sent(),h.label=7;case 7:return this.GetStopExecutionFlag()||t.InEndTask||t.isAborting()?[3,25]:o===r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN?[3,13]:(c=0,e.getRefreshType()?[3,8]:(e.RtViewRefreshUseCurrentRow()&&t.IsInteractive&&(c=s.getCurrRecPosInForm()),l=Qe.CreateInternalRefreshCommand(t.getTaskTag(),o,i.CurrentRecId,c),[3,12]));case 8:return t.IsInteractive&&(c=s.getCurrRecPosInForm()),_=!0,o!==r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||null===e.getArgList()||0===e.getArgList().getSize()?[3,10]:(T=void 0,[4,e.getArgList().getArgValue(0,r.StorageAttribute.BOOLEAN,0)]);case 9:T=h.sent(),_=a.isNullOrUndefined(T)||"1"===T,h.label=10;case 10:return _?[4,Qe.CreateRealRefreshCommand(t.getTaskTag(),o,c,e.getArgList(),i.CurrentRecId)]:[3,12];case 11:l=h.sent(),h.label=12;case 12:return[3,14];case 13:p=void 0,p=null===t.getForm()?0:t.getForm().isScreenMode()?t.DataView.getCurrRec().getId():t.DataView.getRecByIdx(t.DataView.getTopRecIdx()).getId(),l=Qe.CreateScreenRefreshCommand(t.getTaskTag(),p,i.CurrentRecId),h.label=14;case 14:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN&&t.getTaskCache().clearCache(),null===l?[3,16]:[4,t.DataviewManager.Execute(l)];case 15:h.sent(),h.label=16;case 16:return this._isInRecordFlushEvent=!1,this.GetStopExecutionFlag()||t.InEndTask||t.isAborting()?[3,25]:o!==r.InternalInterface.MG_ACT_RT_REFRESH_VIEW||s.isScreenMode()?[3,18]:(i.setTopRecIdx(0),s.HasTable()?(s.clearTableColumnSortMark(!0),[4,s.restoreOldDisplayLine(s.recordIdx2DisplayLine(i.getCurrRecIdx()))]):[3,18]);case 17:h.sent(),h.label=18;case 18:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||t.getMode()===r.Constants.TASK_MODE_QUERY||t.getAfterRetry()?[3,20]:(t.getMode()===r.Constants.TASK_MODE_CREATE&&(t.setMode(r.Constants.TASK_MODE_MODIFY),t.DataView.getCurrRec().setOldRec()),[4,i.currRecCompute(!0)]);case 19:return h.sent(),[3,22];case 20:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN||t.getMode()===r.Constants.TASK_MODE_QUERY||t.getAfterRetry()?[3,22]:[4,i.currRecCompute(!0)];case 21:h.sent(),h.label=22;case 22:return[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 23:return h.sent(),this.GetStopExecutionFlag()||t.getPreventControlChange()?[3,25]:t!==G.Instance.getLastFocusedTask()&&t.pathContains(G.Instance.getLastFocusedTask())?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,25];case 24:h.sent(),h.label=25;case 25:return[2]}}))}))},s.prototype.gotoCreateMode=function(e,t){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return[4,e.enableModes()];case 1:return n.sent(),[4,e.ExecuteNestedRS(G.Instance.getLastFocusedTask())];case 2:return n.sent(),this.GetStopExecutionFlag()?[3,4]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:n.sent(),n.label=4;case 4:return this.GetStopExecutionFlag()?[3,11]:(t=Qe.CreateEventCommand(e.getTaskTag(),r.InternalInterface.MG_ACT_RTO_CREATE),[4,e.DataviewManager.Execute(t)]);case 5:return n.sent(),e.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,7]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 6:n.sent(),n.label=7;case 7:return[4,this.HandleNonParkableControls(e)];case 8:return n.sent(),[4,e.setCreateDeleteActsEnableState()];case 9:return n.sent(),e.setOriginalTaskMode(r.Constants.TASK_MODE_CREATE),[4,this.HandleActEnterRowEditing(e)];case 10:n.sent(),n.label=11;case 11:return[2]}}))}))},s.prototype.commonHandlerAfter=function(e,t,a){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_,T,p,g,d,I;return h(this,(function(h){switch(h.label){case 0:if(a=e.getTask(),o=null,u=!1,c=!1,this._stopExecution&&e.getInternalCode()!==r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getInternalCode()!==r.InternalInterface.MG_ACT_CTRL_SUFFIX)return[2];if(e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,56];switch(i=a.DataView,o=i.getCurrRec(),l=e.Control,e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,1];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,8];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,25];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,33];case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,41];case r.InternalInterface.MG_ACT_TASK_SUFFIX:return[3,42];case r.InternalInterface.MG_ACT_CYCLE_NEXT_REC:return[3,43];case r.InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC:return[3,47];case r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE:return[3,53]}return[3,56];case 1:return t?[4,a.CheckRefreshSubTasks()]:[3,7];case 2:return h.sent()?[4,a.doSubformRecPrefixSuffix()]:[3,4];case 3:h.sent(),h.label=4;case 4:return[4,a.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:return h.sent(),[4,a.enableModes()];case 6:h.sent(),h.label=7;case 7:return[3,56];case 8:return a.isFirstRecordCycle(!1),a.getPreventRecordSuffix()?(a.setPreventRecordSuffix(!1),[2]):(a.DoSubformPrefixSuffix=!1,this._stopExecution?(o.getMode()===n.DataModificationTypes.Delete&&o.clearMode(),a.getLevel()===r.Constants.TASK_LEVEL_CONTROL?[3,11]:(null===(T=this.getStopExecutionCtrl())&&(T=a.getLastParkedCtrl()),this.setStopExecution(!1),this.setStopExecutionCtrl(null),null==T?[3,10]:(a.setLevel(r.Constants.TASK_LEVEL_RECORD),p=a.InCtrlPrefix,a.InCtrlPrefix=!1,[4,this.handleInternalEventWithMgControlBase(T,r.InternalInterface.MG_ACT_CTRL_PREFIX)]))):[3,12]);case 9:h.sent(),a.InCtrlPrefix=p,h.label=10;case 10:this.setStopExecution(!0),h.label=11;case 11:return[2];case 12:return[4,this.HandleStopRowEditing(a)];case 13:h.sent(),h.label=14;case 14:return null==o?[3,24]:(u=o.Modified,!this._stopExecution&&o.isCauseInvalidation()&&(a.getForm().invalidateTable(),o.setCauseInvalidation(!1)),c=o.getMode()===n.DataModificationTypes.Delete,[4,a.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 15:return _=h.sent(),c&&a.getMode()===r.Constants.TASK_MODE_DELETE||!c&&!o.inDeleteProcess()&&(u||_)?(o.setMode(n.DataModificationTypes.Update),[4,i.addCurrToModified()]):[3,19];case 16:return h.sent(),i.setChanged(!0),u&&a.getMode()===r.Constants.TASK_MODE_QUERY?!o.realModified()||et.Instance.allowUpdateInQueryMode(a.getCompIdx())?[3,19]:[4,i.cancelEdit(s.REAL_ONLY,!1)]:[3,19];case 17:return h.sent(),a.WriteToMessagePanebyMsgId(r.MsgInterface.RT_STR_UPDATE_IN_QUERY,!1),[4,a.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 18:h.sent(),h.label=19;case 19:return this.isForceExitPreRecordUpdate(a)||a.isAborting()&&null==oe.Instance.GetTaskByID(a.getTaskTag())||c&&a.getMode()!==r.Constants.TASK_MODE_DELETE?[3,21]:[4,this.commitRecord(a,e.reversibleExit())];case 20:h.sent(),h.label=21;case 21:return a.transactionFailed(E.TRANS_RECORD_PREFIX)||a.isAborting()?[3,24]:o.getMode()===n.DataModificationTypes.Delete&&a.getMode()===r.Constants.TASK_MODE_DELETE||o.getMode()!==n.DataModificationTypes.Delete?[4,a.evalEndCond(E.END_COND_EVAL_AFTER)]:[3,24];case 22:return h.sent()?[4,a.endTask(!0,!1,!1)]:[3,24];case 23:h.sent(),h.label=24;case 24:return[3,56];case 25:return t?[4,l.IsParkable()]:[3,32];case 26:return h.sent()||l===G.getLastFocusedControl()?(l.InControl=!0,l.ShouldRefreshOnControlEnter()?[4,l.getField().updateDisplay()]:[3,28]):[3,30];case 27:h.sent(),h.label=28;case 28:return a.setLastParkedCtrl(l),n.RuntimeContextBase.Instance.CurrentClickedCtrl=null,[4,l.SetFocus(l,l.getDisplayLine(!1),!0,!0)];case 29:return h.sent(),this.setStopExecutionCtrl(null),P.ReturnToCtrl=l,a.InCtrlPrefix=!1,[3,32];case 30:return a.InCtrlPrefix=!1,[4,this.HandleNonParkableControls(l.getForm().getTask())];case 31:h.sent(),h.label=32;case 32:return[3,56];case 33:return this.GetStopExecutionFlag()||(l.isChoiceControl()&&l.SetKeyboardLanguage(!0),l.Type===r.MgControlType.CTRL_TYPE_BUTTON&&a.ActionManager.enable(r.InternalInterface.MG_ACT_BUTTON,!1),(a.getEnableZoomHandler()||l.useZoomHandler())&&a.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!1),a.ActionManager.enable(r.InternalInterface.MG_ACT_RT_EDT_NULL,!1)),t?this.GetStopExecutionFlag()?(l.InControl=!0,[2]):(this._nextParkedCtrl=null,null==(g=l.getField())||l.Type!==r.MgControlType.CTRL_TYPE_TEXT?[3,35]:[4,g.updateDisplay()]):[3,40];case 34:h.sent(),h.label=35;case 35:return a.setLevel(r.Constants.TASK_LEVEL_RECORD),l.setInControlSuffix(!1),l.IsInteractiveUpdate=!1,l.PropertyExists(n.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS)?[4,l.getProp(n.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS).RefreshDisplay(!0)]:[3,37];case 36:h.sent(),h.label=37;case 37:return l.ValidateControl=!1,G.setLastFocusedControl(a,null),[4,a.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 38:return h.sent()?[4,a.endTask(!0,!1,!1)]:[3,40];case 39:h.sent(),h.label=40;case 40:return[3,56];case 41:return a.setLevel(r.Constants.TASK_LEVEL_TASK),[3,56];case 42:return a.setLevel(r.Constants.TASK_LEVEL_NONE),[3,56];case 43:return d=a.getForm(),a.isMainProg()||null==d?[3,46]:[4,d.moveInView(d.isLineMode()?r.Constants.MOVE_UNIT_ROW:r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_NEXT)];case 44:return h.sent(),a.getExecEndTask()?[4,a.endTask(!0,!1,!1)]:[3,46];case 45:h.sent(),h.label=46;case 46:return[3,56];case 47:return a.DataView.isEmptyDataview()?(a.setExecEndTask(),[3,50]):[3,48];case 48:return[4,this.HandleActionDelline(e,a,i,o,!0)];case 49:h.sent(),h.label=50;case 50:return a.getExecEndTask()?[4,a.endTask(!0,!1,!1)]:[3,52];case 51:h.sent(),h.label=52;case 52:return[3,56];case 53:return[4,e.getArgList().getArgValue(1,r.StorageAttribute.BOOLEAN,0)];case 54:return I="1"===h.sent(),[4,l.validateAndSetValueIfAllowed(e.getValue(),I)];case 55:return h.sent(),[3,56];case 56:return[2]}}))}))},s.prototype.handleNonReversibleEvent=function(e,t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:n=new w(e),a=t===r.InternalInterface.MG_ACT_EXIT||t===r.InternalInterface.MG_ACT_CLOSE,n.setInternal(t),a&&(this._isNonReversibleExit=!0),s.label=1;case 1:return s.trys.push([1,,3,4]),n.setNonReversibleExit(),n.setCtrl(e.getLastParkedCtrl()),n.setArgList(null),[4,this.handleEvent(n,!1)];case 2:return s.sent(),[3,4];case 3:return a&&(this._isNonReversibleExit=!1),[7];case 4:return[2]}}))}))},s.prototype.handleInternalEventWithTaskAndEventSubtype=function(t,n,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return s=t.getLastParkedCtrl(),n<r.InternalInterface.MG_ACT_TOT_CNT&&null!=t&&a!==e.EventSubType.CancelIsQuit&&!t.ActionManager.isEnabled(n)?[2]:null===s?[3,2]:[4,this.handleInternalEventWithMgControl(s,n,a)];case 1:return o.sent(),[3,8];case 2:return n!==r.InternalInterface.MG_ACT_RT_QUIT?[3,4]:[4,this.handleInternalEventWithTaskAndEventSubtype(t,r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelIsQuit)];case 3:return o.sent(),[3,8];case 4:return(i=new w(t)).setInternal(n),i.SetEventSubType(a),r.InternalInterface.BuiltinEvent(n)?[4,this.handleEvent(i,!1)]:[3,6];case 5:return o.sent(),[3,8];case 6:return[4,this.commonHandler(i)];case 7:o.sent(),o.label=8;case 8:return[2]}}))}))},s.prototype.handleInternalEventWithMgControl=function(t,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return n!==r.InternalInterface.MG_ACT_RT_QUIT?[3,2]:[4,this.handleInternalEventWithMgControl(t,r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelIsQuit)];case 1:return i.sent(),[3,6];case 2:return(s=new w(t)).setInternal(n),s.SetEventSubType(a),n===r.InternalInterface.MG_ACT_RT_REFRESH_VIEW&&s.setIsRealRefresh(!1),r.InternalInterface.BuiltinEvent(n)?[4,this.handleEvent(s,!1)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,this.commonHandler(s)];case 5:i.sent(),i.label=6;case 6:return[2]}}))}))},s.prototype.getCurrField=function(){return this._currField},s.prototype.getCurrCtrl=function(){return this._currCtrl},s.prototype.getCurrTask=function(){return null==this._currField?null:this._currField.getTask()},s.prototype.setStopExecution=function(e,t){1===arguments.length?this.setStopExecution_0(e):this.setStopExecution_1(e,t)},s.prototype.setStopExecution_0=function(e){this.setStopExecution(e,!0)},s.prototype.setStopExecution_1=function(e,r){if(e)if(r)this._eventsQueue.clear();else{for(var n=new t.List,a=void 0,s=void 0;!this._eventsQueue.isEmpty();)(a=this._eventsQueue.poll()).isFromServer()&&(a.resetFromServer(),n.push(a));for(s=0;s<n.length;s++)this._eventsQueue.put(n.get_Item(s))}this._stopExecution=e},s.prototype.setStopExecutionCtrl=function(e){null!==this._stopExecutionCtrl&&null!==e||(this._stopExecutionCtrl=e)},s.prototype.delCurrRec=function(e,t){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=e.DataView,e.setMode(r.Constants.TASK_MODE_MODIFY),[4,e.getForm().delCurrRec()];case 1:return i.sent(),e.DataView.isEmptyDataview()?[3,10]:a.getCurrRecIdx()>=0?a.getCurrRec().getMode()===n.DataModificationTypes.Delete||t?[3,6]:(s=e.getLastParkedCtrl(),[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)]):[3,7];case 2:return i.sent(),this.GetStopExecutionFlag()?[3,6]:null!==s?[3,4]:[4,this.HandleNonParkableControls(e)];case 3:return i.sent(),[3,6];case 4:return[4,this.handleInternalEventWithMgControlBase(s,r.InternalInterface.MG_ACT_CTRL_PREFIX)];case 5:i.sent(),i.label=6;case 6:return[3,9];case 7:return e.getInCreateLine()?[3,9]:[4,this.handleNonReversibleEvent(e,r.InternalInterface.MG_ACT_EXIT)];case 8:i.sent(),i.label=9;case 9:return[3,13];case 10:return[4,this.HandleNonParkableControls(e)];case 11:return i.sent(),[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 12:i.sent(),i.label=13;case 13:return[2]}}))}))},s.prototype.updateConfirmed=function(e){return T(this,void 0,void 0,(function(){var t,a,s;return h(this,(function(i){switch(i.label){case 0:return null==e?[2,!1]:[4,e.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE,!1)];case 1:return t=i.sent(),this._isInRecordFlushEvent||!t||e.DataSynced?[3,3]:[4,ge.Instance.confirm(r.MsgInterface.CRF_STR_CONF_UPD,n.Styles.MSGBOX_ICON_QUESTION|n.Styles.MSGBOX_BUTTON_YES_NO_CANCEL)];case 2:return s=i.sent(),a=s===n.Styles.MSGBOX_RESULT_YES?"Y":s===n.Styles.MSGBOX_RESULT_NO?"N":"C",[3,4];case 3:a="Y",i.label=4;case 4:switch(a){case"Y":return[3,5];case"N":return[3,6];case"C":return[3,9]}return[3,11];case 5:return[3,12];case 6:return[4,e.getForm().cancelEdit(!1,!1)];case 7:return i.sent(),[4,e.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 8:return i.sent(),e.ConfirmUpdateNo=!0,[2,!1];case 9:return this.setStopExecution(!0),this.setStopExecutionCtrl(G.getLastFocusedControl()),[4,n.FocusManager.SetFocus(G.getLastFocusedControl(),-1)];case 10:return i.sent(),[2,!1];case 11:return r.Logger.Instance.WriteExceptionToLogWithMsg("in ClientManager.Instance.updateConfirmed() illegal confirmation code: "+t),[3,12];case 12:return[2,!0]}}))}))},s.prototype.setCompMainPrgTab=function(e){this._compMainPrgTab=e},s.prototype.setEndOfWork=function(e){this._endOfWork=e},s.prototype.getEndOfWork=function(){return this._endOfWork},s.prototype.getCompMainPrgTab=function(){return this._compMainPrgTab},s.prototype.inNonReversibleExit=function(){return this._isNonReversibleExit},s.prototype.pushRtEvent=function(e){this._rtEvents.push(e)},s.prototype.popRtEvent=function(){return 0===this._rtEvents.count()?null:this._rtEvents.pop()},s.prototype.storeLastSavedRouteEventOnLocalStorage=function(){var e=window.localStorage;if(null!=this.getLastSavedRouteEvent()){var r=this.getLastSavedRouteEvent();if(e.setItem(E.LAST_ROUTE_EVENT,"1"),e.setItem(E.LAST_ROUTE_EVENT_SRC_TSK,JSON.stringify(r.getTask().TaskDefinitionId)),r.getArgList().getSize()>0){var n=new t.StringBuilder;r.getArgList().buildXML(n),e.setItem(E.LAST_ROUTE_EVENT_ARG_LIST,n.toString())}}},s.prototype.restoreLastSavedRouteEventFromLocalStorage=function(){var e=window.localStorage;if("1"===e.getItem(E.LAST_ROUTE_EVENT)){var t=e.getItem(E.LAST_ROUTE_EVENT_SRC_TSK),r=e.getItem(E.LAST_ROUTE_EVENT_ARG_LIST),a=new n.TaskDefinitionId;a.fromJSON(t);var i=oe.Instance.getCurrMGData().getTaskByTaskDefinitionID(a),o=null;null!=r&&(o=new L).fillList(r,i),s.Instance.AddLastSavedRouteEvent(i,o)}},s.prototype.getLastSavedRouteEvent=function(){return this.lastSavedRouteEvent},s.prototype.setLastSavedRouteEvent=function(e){this.lastSavedRouteEvent=null==e?null:e.replicate()},s.prototype.getLastRtEvent=function(){return 0===this._rtEvents.count()?null:this._rtEvents.peek()},s.prototype.setIgnoreUnknownAbort=function(e){this._ignoreUnknownAbort=e},s.prototype.ignoreUnknownAbort=function(){return this._ignoreUnknownAbort},s.prototype.failTaskOverlay=function(t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:if(null===t)return[3,4];this.setIgnoreUnknownAbort(!0),a.label=1;case 1:return a.trys.push([1,,3,4]),n=Qe.CreateNonReversibleExitCommand(t,!1),r.CmdsToServer.Add(n),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 2:return a.sent(),[3,4];case 3:return this.setIgnoreUnknownAbort(!1),[7];case 4:return[2]}}))}))},s.prototype.isEventScopeTrans=function(){return this._eventScope===Nr.TRANS},s.prototype.setEventScopeTrans=function(){this._eventScope=Nr.TRANS},s.prototype.clearEventScope=function(){this._eventScope=Nr.NONE},s.prototype.GetEventTime=function(){return this._eventsQueue.GetTime()},s.prototype.getMatchingAction=function(e,t){var a=0;return null==t||0===a&&(0!==t.getAction()?a=t.getAction():45===t.getKeyCode()&&t.getModifier()===n.Modifiers.MODIFIER_NONE&&0===t.getStates()&&(a=r.InternalInterface.MG_ACT_TOGGLE_INSERT)),a},s.prototype.getExecStack=function(){return this._execStack.peek()},s.prototype.pushExecStack=function(e,t,r){this._execStack.peek().push(oe.Instance.getTaskIdById(e),t,r)},s.prototype.popExecStack=function(){return this._execStack.peek().pop()},s.prototype.pushNewExecStacks=function(){this._serverExecStack.push(null),this._execStack.push(new z)},s.prototype.popNewExecStacks=function(){this._serverExecStack.pop(),this._execStack.pop()},s.prototype.pushServerExecStack=function(e,t,r){null===this._serverExecStack.peek()&&(this._serverExecStack.pop(),this._serverExecStack.push(new z)),this._serverExecStack.peek().push(e,t,r)},s.prototype.clearServerExecStack=function(){null!==this._serverExecStack.peek()&&this._serverExecStack.peek().clear()},s.prototype.reverseServerExecStack=function(){null!==this._serverExecStack.peek()&&this._serverExecStack.peek().reverse()},s.prototype.getNextOperIdx=function(e,t){var r=null,n=-1;if(0!==this._serverExecStack.count()&&null!==this._serverExecStack.peek()&&!this._serverExecStack.peek().empty())if(this._serverExecStack.peek().size()>this._execStack.peek().size()){for(var a=new z(this._serverExecStack.peek());a.size()>this._execStack.peek().size();)r=a.pop();this._execStack.peek().Equals(a)&&r.TaskId===e.getTaskTag()&&r.HandlerId===e.getHandlerId()&&r.OperIdx>=e.getServerId()?(n=r.OperIdx,t&&this._serverExecStack.peek().size()===this._execStack.peek().size()+1&&this._serverExecStack.peek().clear()):n=s.MAX_OPER}else n=s.MAX_OPER;return n},s.prototype.setProcessingTopMostEndTask=function(e){this._processingTopMostEndTask=e},s.prototype.getProcessingTopMostEndTask=function(){return this._processingTopMostEndTask},s.prototype.setAllowEvents=function(e){this._allowEvents=e},s.prototype.setNonInteractiveAllowEvents=function(t,r){this._allowEvents=t?e.EventsAllowedType.NON_INTERACTIVE:e.EventsAllowedType.NONE},s.prototype.getAllowEvents=function(){return this._allowEvents},s.prototype.NoEventsAllowed=function(){return this._allowEvents===e.EventsAllowedType.NONE},s.prototype.handleCtrlModify=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:if(null==e||!e.isModifiable())return[2];switch(t){case r.InternalInterface.MG_ACT_RT_EDT_NULL:case r.InternalInterface.MG_ACT_CTRL_MODIFY:case r.InternalInterface.MG_ACT_SELECTION:break;default:return[2]}return(n=new w(e)).setInternal(r.InternalInterface.MG_ACT_CTRL_MODIFY),[4,this.handleEvent(n,!1)];case 1:return a.sent(),[2]}}))}))},s.prototype.ActAllowed=function(t){var n=!0;switch(this.getAllowEvents()){case e.EventsAllowedType.ALL:n=!0;break;case e.EventsAllowedType.NONE:n=t===r.InternalInterface.MG_ACT_CRELINE;break;case e.EventsAllowedType.NON_INTERACTIVE:switch(t){case r.InternalInterface.MG_ACT_EXIT_SYSTEM:case r.InternalInterface.MG_ACT_EXIT:case r.InternalInterface.MG_ACT_CLOSE:case r.InternalInterface.MG_ACT_CRELINE:case r.InternalInterface.MG_ACT_CRELINE_ABOVE:case r.InternalInterface.MG_ACT_ROLLBACK:n=!0;break;default:n=!1}}return n},s.prototype.commitRecord=function(e,t){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=e.DataView,i=a.getCurrRec(),[4,e.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 1:return o=T.sent(),[4,e.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)];case 2:return l=T.sent(),u=i.isNewRec(),c=!0,_=i.Modified,a.recInModifiedTab(i.getId())||i.clearFlagsHistory(),[4,e.TaskTransactionManager.checkAndCommit(t,E.TRANS_RECORD_PREFIX,e.ConfirmUpdateNo)];case 3:if(T.sent(),!e.transactionFailed(E.TRANS_RECORD_PREFIX))return[3,8];T.label=4;case 4:return T.trys.push([4,,6,7]),e.DataSynced=!0,this.setStopExecution(!1),[4,e.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:return T.sent(),[3,7];case 6:return this.setStopExecution(!0),[7];case 7:return[3,17];case 8:return e.isAborting()?(this.setStopExecution(!0),[3,17]):[3,9];case 9:return _&&i.setLateCompute(!0),this._stopExecution||e.setLevel(r.Constants.TASK_LEVEL_TASK),i.resetUpdated(),i.resetModified(),_||o||l&&e.InSelect?[3,16]:u?(a.setPrevCurrRec(),c=!1,i.setNewRec(),[4,e.getForm().cancelEdit(!1,!1)]):[3,12];case 10:return T.sent(),[4,this.HandleStopRowEditing(e)];case 11:return T.sent(),[3,15];case 12:return i.getForceSaveOrg()?[3,14]:[4,a.cancelEdit(s.REAL_ONLY,!0)];case 13:return T.sent(),[3,15];case 14:a.saveOriginal(),T.label=15;case 15:return[3,17];case 16:a.saveOriginal(),T.label=17;case 17:return c&&a.setPrevCurrRec(),[2]}}))}))},s.prototype.incLocateTimerCB=function(e){var t=e,n=new w(t,!0);n.setInternal(r.InternalInterface.MG_ACT_INCREMENTAL_LOCATE),n.setMainPrgCreator(t),n.setCtrl(t.getLastParkedCtrl()),this.addToTail(n)},s.doSyncForSubformParent=function(t){return T(this,void 0,void 0,(function(){var r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return r=t.getParent(),a=r.DataView,s=a.getCurrRec(),t.IsSubForm&&null!=s&&s.Modified&&!a.isEmptyDataview()?(s.setMode(n.DataModificationTypes.Update),[4,a.addCurrToModified(!1)]):[3,3];case 1:return o.sent(),a.getCurrRec().Synced=!0,a.setChanged(!0),i=Qe.CreateDataViewCommand(r.getTaskTag(),e.DataViewCommandType.ExecuteLocalUpdates),[4,r.DataviewManager.Execute(i)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},s.prototype.ProcessAbortingError=function(a){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return s=a instanceof ae?a.GetMessage():null!==a.Message?a.Message:a.GetType(),i=r.StrUtil.getConsoleErorString(s),o=r.StrUtil.getMsgBoxErorString(s),null!==a.InnerException?r.Logger.Instance.WriteExceptionToLog(a.InnerException,i):a instanceof ae&&r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic||r.Logger.Instance.WriteExceptionToLogWithMsg(i),l=n.RuntimeContextBase.Instance.ContextID!==n.RuntimeContextBase.noContextId,oe.Instance.currMgdID=0,u=pe.Instance.getConstMessage(r.MsgInterface.BRKTAB_STR_ERROR),c=16,a.Message.startsWith("<HTML")?(this.processHTMLContent(a.Message),[3,4]):[3,1];case 1:return this.ShowErrorInMessageBox(a)?[4,ge.Instance.MessageBox(u,o,c)]:[3,3];case 2:h.sent(),h.label=3;case 3:a instanceof ae&&(a.GetCode()!=ae.ERR_WEBCLIENT_PROGRAM_RELOADED&&a.GetCode()!=ae.ERR_EXECUTED_PROGRAM_CHANGED||(n.Commands.addGlobalCommand(n.CommandType.RELOAD_PAGE),n.Commands.beginInvoke())),h.label=4;case 4:if(a instanceof ae&&(a.GetCode()!==ae.ERR_CTX_NOT_FOUND&&a.GetCode()!==ae.ERR_WEBCLIENT_PROGRAM_RELOADED&&a.GetCode()!==ae.ERR_EXECUTED_PROGRAM_CHANGED||(l=!1)),!l)return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),_=Qe.CreateUnloadCommand(),oe.Instance.getMGData(0).CmdsToServer.Add(_),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 6:return h.sent(),[3,8];case 7:if(!((T=h.sent())instanceof t.ApplicationException))throw T;return r.Logger.Instance.WriteExceptionToLog(T),[3,8];case 8:return ge.Instance.abort(),[2]}}))}))},s.prototype.processHTMLContent=function(e){n.Commands.addShowHTMLError(n.CommandType.SHOW_HTML_ERROR,e),n.Commands.beginInvoke()},s.prototype.ShowErrorInMessageBox=function(e){return!(e instanceof ae)||(e.GetCode()!=ae.ERR_EXECUTED_PROGRAM_CHANGED&&e.GetCode()!=ae.ERR_WEBCLIENT_PROGRAM_RELOADED||n.RuntimeContextBase.Instance.ContextID!==n.RuntimeContextBase.noContextId)},s}();kr.Timer_Timeout_Infinite=-1,kr.REAL_ONLY=!0,kr.MAX_OPER=9999,kr.userGrantedForContextActivity=!0,kr.clientInactivityTimerON=!1,kr.clientContextInactivityTimerAborted=!1,kr.Instance=new kr,kr.clientBusyTimeStart=0;var xr=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.RegisterSubclassHandlers=function(){n.Events.FocusEvent=t.processFocus,n.Events.FocusOnNonMagicControlEvent=t.processFocusOnNonMagicControl,n.Events.MouseUpEvent=t.processMouseUp,n.Events.SelectionEvent=t.processSelection,n.Events.DisposeEvent=t.processDispose,n.Events.TimerEvent=t.ProcessTimer,n.Events.TableResizeEvent=t.processTableResize,n.Events.GetRowsDataEvent=t.processGetRowsData,n.Events.NonParkableLastParkedCtrlEvent=t.OnNonParkableLastParkedCtrl,n.Events.ShowSessionStatisticsEvent=t.ShowSessionStatistics,n.Events.WriteExceptionToLogEvent=r.Logger.Instance.WriteExceptionToLogWithMsg.bind(r.Logger.Instance),n.Events.WriteErrorToLogEvent=r.Logger.Instance.WriteErrorToLog.bind(r.Logger.Instance),n.Events.WriteWarningToLogEvent=r.Logger.Instance.WriteWarningToLogWithMsg.bind(r.Logger.Instance),n.Events.ShouldLogEvent=r.Logger.Instance.ShouldLog.bind(r.Logger.Instance),n.Events.WriteGuiToLogEvent=r.Logger.Instance.WriteGuiToLog.bind(r.Logger.Instance),n.Events.WriteDevToLogEvent=r.Logger.Instance.WriteDevToLog.bind(r.Logger.Instance),n.Events.TranslateEvent=pe.Instance.translate.bind(pe.Instance),n.Events.PeekEndOfWorkEvent=t.peekEndOfWork,n.Events.TranslateLogicalNameEvent=lt.Instance.translate.bind(lt.Instance),n.Events.GetMainProgramEvent=t.getMainProgram,n.Events.GetMessageStringEvent=pe.Instance.getConstMessage.bind(pe.Instance),n.Events.CtrlFocusEvent=t.processCtrlFocus,n.Events.GetRuntimeContextEvent=t.GetRuntimeContext,n.Events.SaveLastClickedCtrlEvent=t.SaveLastClickedControlName,n.Events.SaveLastClickInfoEvent=t.SaveLastClickInfo,n.Events.OnIsLogonRTLEvent=t.IsLogonRTL,n.Events.ShouldAddEnterAsKeyEvent=t.ShouldAddEnterAsKeyEvent},t.processCtrlFocus=function(e,t){G.setLastFocusedControl(e,t)},t.processFocus=function(e,t,n,a){var s=e;kr.Instance.addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick(s,r.InternalInterface.MG_ACT_CTRL_FOCUS,t,n)},t.processFocusOnNonMagicControl=function(e){var t=e;kr.Instance.addGuiTriggeredEventWithCtrlAndCodeAndLine(t,r.InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL,t.getDisplayLine(!0))},t.processMouseUp=function(e,t){var n=e,a=new w(n,t,!0),s=!0;n.Type===r.MgControlType.CTRL_TYPE_BUTTON&&e.ButtonStyle===r.CtrlButtonTypeGui.Hypertext&&(s=!1),a.setProduceClick(s),a.setInternal(r.InternalInterface.MG_ACT_CTRL_MOUSEUP),kr.Instance.addToTail(a)},t.processDispose=function(e){var t=e.getTask().getMGData();K.StopAll(t),t.IsAborting&&oe.Instance.deleteMGDataTree(t.GetId())},t.ProcessTimer=function(e){var t=e.GetMgdata(),n=t.getFirstTask(),a=Math.floor(e.TimerIntervalMiliSeconds/1e3),s=e.IsIdleTimer;if(!t.IsAborting){var i=new w(n,!0);i.setTimer(a,t.GetId(),s),i.setMainPrgCreator(i.getTask()),s||i.setCtrl(n.getLastParkedCtrl()),i.setInternal(r.InternalInterface.MG_ACT_TIMER),kr.Instance.addToTail(i)}},t.processTableResize=function(e,t){if(null!=e){var n=new w(e,t,!0);n.setInternal(r.InternalInterface.MG_ACT_RESIZE),kr.Instance.addToTail(n)}},t.processGetRowsData=function(e,t,n,a){var s=e;if(null!=s&&s.Type===r.MgControlType.CTRL_TYPE_TABLE){var i=new w(s,t,!0);i.setInternal(r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE),i.setSendAll(n),i.LastFocusedVal=a,kr.Instance.addToTail(i)}},t.processEnableActs=function(e,t,n){var a=new w(e,!0);a.setInternal(n?r.InternalInterface.MG_ACT_ENABLE_EVENTS:r.InternalInterface.MG_ACT_DISABLE_EVENTS),a.setActEnableList(t),kr.Instance.addToTail(a)},t.OnNonParkableLastParkedCtrl=function(e){},t.processSelection=function(e,t,n,a){var s,i=t;(i.Type===r.MgControlType.CTRL_TYPE_BUTTON&&i.getForm().getTask().getLastParkedCtrl()!==i&&(a=!0),t.ConnectedControl)?((s=new w(i,+n,!0)).setInternal(r.InternalInterface.MG_ACT_ZOOM),s.setProduceClick(a),kr.Instance.addToTail(s)):((s=new w(i,+n,!0)).setInternal(r.InternalInterface.MG_ACT_SELECTION),s.setValue(e),s.setProduceClick(a),kr.Instance.addToTail(s))},t.prototype.processKeyDown=function(t,n,a,s,i,o,l,u,c,_,T){return G.Instance.LastActionTime=r.Misc.getSystemMilliseconds(),e.prototype.processKeyDown.call(this,t,n,a,s,i,o,l,u,c,_,T)},t.peekEndOfWork=function(){return kr.Instance.getEndOfWork()},t.getMainProgram=function(e,t){return oe.Instance.GetMainProgByCtlIdx(e,t)},t.GetRuntimeContext=function(e){return n.RuntimeContextBase.Instance},t.SaveLastClickedControlName=function(e,t){n.RuntimeContextBase.Instance.LastClickedCtrlName=t},t.SaveLastClickInfo=function(e,t,r,a,s,i,o){n.RuntimeContextBase.Instance.SaveLastClickInfo(t,r,a,s,i,o)},t.ProcessPress=function(e,t,a){var s=t;null==s?n.Manager.EventsManager.addGuiTriggeredEventWithTaskAndCode(e.getTask(),r.InternalInterface.MG_ACT_HIT):s.isSubform()?s.OnSubformClick():n.Manager.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(s,r.InternalInterface.MG_ACT_CTRL_HIT,a),n.Manager.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(s,r.InternalInterface.MG_ACT_PRESS,a)},t.IsLogonRTL=function(){return ne.Instance.IsLogonRTL()},t.ShowSessionStatistics=function(){},t.ShouldAddEnterAsKeyEvent=function(){return!1},t}(n.EventsProcessor),Fr=function(){function e(){}return e.GetUniqueMachineID=function(){if(!e.id){var r=new Date,n=r.toDateString()+r.toTimeString()+r.getMilliseconds();e.id=t.HashUtils.GetHashCode(n).toString()+"_"}return e.id},e}(),wr=function(e){function n(){var r=e.call(this)||this;return r._callingTaskTag=null,r._pathParentTaskTag=null,r._subformCtrlName=null,r._ditIdx=t.Int32.MinValue,r._isModal=!0,r._transOwner=null,r._newId=null,r._forceModal=!1,r._key=null,r._varList=null,r._isRoute=!1,r.NewTaskXML=null,r}return u(n,e),Object.defineProperty(n.prototype,"IsBlocking",{get:function(){return this._isModal&&null===this._subformCtrlName},enumerable:!1,configurable:!0}),n.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,a,s,i,l,u,c,_,T,p,g,d,E,I,f,C,A,R,S,M,m,v,L;return h(this,(function(h){switch(h.label){case 0:if(e=null,a=!1,s=!0,i=0,l=null,u=new t.List,c=new t.List,_=!0,p=null,g=null!=this._callingTaskTag?o.mgDataTable.GetTaskByID(this._callingTaskTag):null,d=null!=this._pathParentTaskTag?o.mgDataTable.GetTaskByID(this._pathParentTaskTag):null,G.Instance.getLastFocusedTask(),T=g=o.mgDataTable.GetTaskByID(this._callingTaskTag),!t.NString.IsNullOrEmpty(this._subformCtrlName)||this._ditIdx!==t.Int32.MinValue||this._isRoute)if(this._isRoute&&t.NString.IsNullOrEmpty(this._subformCtrlName.trim()))l=g.getForm().DefaultRouterOutlet;else if(g.IsInteractive)l=this._ditIdx!==t.Int32.MinValue?g.getForm().getCtrl(this._ditIdx):g.getForm().getSubFormCtrlByName(this._subformCtrlName);else for(E=g;null!=E.getForm();E=E.getParent())if(null!=(l=E.getForm().getCtrlByName(this._subformCtrlName,r.MgControlType.CTRL_TYPE_SUBFORM))){g=T=E;break}return null!=g&&(e=g.getMGData()),null==l?[3,5]:(C=l.getSubformTask(),T=l.getForm().getTask(),i=T.getMgdID(),null!=(p=T.getMGData()).getTimerHandlers()&&(u=p.getTimerHandlers().getTimersVector()),this._ditIdx===t.Int32.MinValue?[3,1]:(s=!1,_=!1,[3,4]));case 1:return a=!0,null!=this._transOwner&&null!=(I=o.mgDataTable.GetTaskByID(this._transOwner))&&I.setTransOwnerTask(),null==C?[3,3]:(C.setDestinationSubform(!0),[4,C.stop()]);case 2:h.sent(),h.label=3;case 3:P.validReturnToCtrl()||(P.ReturnToCtrl=G.getLastFocusedControl()),h.label=4;case 4:l.setSubformTaskId(this._newId),h.label=5;case 5:return f=null==g?o.mgDataTable.getMGData(0):g.getMGData(),a||!s?[3,7]:(i=o.mgDataTable.getAvailableIdx(),t.Debug.Assert(i>0),(e=new Or(n.createNewCommandsTable(),n.createNewCommandsTable(),i,f,this._isModal,this._forceModal)).copyUnframedCmds(),[4,o.mgDataTable.addMGData(e,i,!1)]);case 6:h.sent(),o.mgDataTable.currMgdID=i,h.label=7;case 7:this.Obj=this._key,this._key=null,h.label=8;case 8:return h.trys.push([8,,10,11]),[4,le.GetInstance().ProcessResponse(this.NewTaskXML,i,new y(g,d),null)];case 9:return h.sent(),[3,11];case 10:return o.eventsManager.setIgnoreUnknownAbort(!1),[7];case 11:return!a&&s||(l.initSubformTask(),a&&(C=l.getSubformTask(),_=!g.RetainFocus,C.setIsDestinationCall(!0))),A=!1,R=e.IsModal,null!=l&&(null!=p.getTimerHandlers()&&(c=p.getTimerHandlers().getTimersVector()),p.changeTimers(u,c),l.IsModal()&&(this._isModal=A=e.IsModal=!0)),[4,br.StartProgram(a,_)];case 12:if(S=h.sent(),A||(this._isModal=e.IsModal),null!=S)return[3,19];if(null==g||(!this._isModal||!A&&a||!s)&&(g.IsInteractive||g.isMainProg()&&null!=g.getForm()))return[3,18];if(!this._isModal)return[3,16];o.mgDataTable.startTasksIteration(),M=void 0,h.label=13;case 13:return null===(M=o.mgDataTable.getNextTask())?[3,16]:M.DataViewWasRetrieved?[4,M.RefreshDisplay()]:[3,15];case 14:h.sent(),h.label=15;case 15:return[3,13];case 16:return[4,o.eventsManager.EventsLoop(e)];case 17:h.sent(),A&&(e.IsAborting=!1,e.IsModal=R),h.label=18;case 18:return[3,21];case 19:return[4,o.eventsManager.NonInteractiveEventsLoop(e,S)];case 20:h.sent(),h.label=21;case 21:return null==o.eventsManager.getPendingGuiEvent()||!A&&null==S?[3,26]:(m=o.eventsManager.getPendingGuiEvent()).getTask()==g&&this._callingTaskTag===g.getTaskTag()?[3,25]:(g=o.mgDataTable.GetTaskByID(this._callingTaskTag)).getIsDestinationCall()?(v=g.getForm().getSubFormCtrl(),[4,o.eventsManager.performSubformClose(v)]):[3,23];case 22:return h.sent(),[3,24];case 23:(L=new w(g)).setInternal(r.InternalInterface.MG_ACT_CLOSE),L.setCtrl(null),L.setArgList(null),o.eventsManager.addToTail(L),h.label=24;case 24:return[3,26];case 25:o.eventsManager.addToTail(m),o.eventsManager.setPendingGuiEvent(null),h.label=26;case 26:return[2]}}))}))},n.prototype.HandleAttribute=function(n,a){switch(n){case E.MG_ATTR_CALLINGTASK:this._callingTaskTag=a;break;case E.MG_ATTR_PATH_PARENT_TASK:this._pathParentTaskTag=a;break;case E.MG_ATTR_SUBFORM_CTRL:this._subformCtrlName=a;break;case r.XMLConstants.MG_ATTR_DITIDX:this._ditIdx=r.XmlParser.getInt(a);break;case E.MG_ATTR_MODAL:this._isModal="1"===a[0];break;case E.MG_ATTR_TRANS_OWNER:this._transOwner=a;break;case E.MG_ATTR_NEWID:this._newId=t.NString.TrimEnd(a);break;case E.MG_ATTR_KEY:this._key=a;break;case E.MG_ATTR_ARGLIST:this._varList=new L,this._varList.fillList(a,o.mgDataTable.GetTaskByID(this.TaskTag));break;case E.MG_ATTR_OBJECT:this.Obj=a;break;case E.MG_ATTR_IS_ROUTE:this._isRoute="1"===a[0];break;default:e.prototype.HandleAttribute.call(this,n,a)}},n}(Pr);wr.createNewCommandsTable=null;var Vr=function(e){function n(t){var r=e.call(this)||this;return r._transOwner=null,0===arguments.length?(r.constructor_0(),r):(r.constructor_1(t),r)}return u(n,e),n.prototype.constructor_0=function(){},n.prototype.constructor_1=function(e){this.TaskTag=e},n.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return e=o.mgDataTable.currMgdID,r=o.mgDataTable.GetTaskByID(this.TaskTag),null!==this._transOwner&&null!==(n=o.mgDataTable.GetTaskByID(this._transOwner))&&n.setTransOwnerTask(),null===r&&o.eventsManager.ignoreUnknownAbort()?[2]:(t.Debug.Assert(null!==r),a=r.getMGData(),[4,r.stop()]);case 1:return l.sent(),a.abort(),o.mgDataTable.currMgdID=a.GetId(),s=r.getForm(),ge.Instance.abort(s),o.mgDataTable.currMgdID=a.GetId()!==e||null===a.getParentMGdata()?e:a.getParentMGdata().GetId(),P.validReturnToCtrl()||(i=G.getLastFocusedControl(),P.ReturnToCtrl=i),[2]}}))}))},n.prototype.HandleAttribute=function(t,n){if(t===E.MG_ATTR_TRANS_OWNER)this._transOwner=n;else e.prototype.HandleAttribute.call(this,t,n);if(t===r.XMLConstants.MG_ATTR_TASKID){var a=o.mgDataTable.GetTaskByID(this.TaskTag);null!=a&&a.resetKnownToServer()}},n}(Pr),Ur=function(){function e(){}return e.getStringOfOption=function(e,t,r){var n="",a=t.indexOf(r);if(a>-1){var s=e.split(",");a<s.length&&(n=s[a])}return n},e}(),Br=function(e){function a(){var t=e.call(this)||this;return t._callingTaskTag=null,t._title=null,t._errLogAppend=!1,t._text=null,t._display="\0",t._mode="\0",t._sendAck=!0,t}return u(a,e),a.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,n,a,s,i,l,u;return h(this,(function(c){switch(c.label){case 0:return e=r.StrUtil.getConsoleErorString(this._text),null===(n=o.mgDataTable.GetTaskByID(this.TaskTag)||o.mgDataTable.GetTaskByID(this._callingTaskTag))&&(n=G.Instance.getLastFocusedTask()),this._errLogAppend&&r.Logger.Instance.WriteExceptionToLogWithMsg(e),t.NString.IsNullOrEmpty(this._text)?[3,4]:this._display!==E.DISPLAY_BOX?[3,3]:(a=new t.RefParam(0),s=r.StrUtil.getMsgBoxErorString(this._text),i=pe.Instance.translate(s),l=new t.RefParam(t.NString.Empty),this.PrepareMessageBoxForDisplay(n,l,a),[4,ge.Instance.MessageBox(l.value,i,a.value)]);case 1:return u=c.sent(),[4,this.ProcessMessageBoxResponse(n,u)];case 2:return c.sent(),[3,4];case 3:this._display===E.DISPLAY_STATUS&&null!=n&&n.DisplayMessageToStatusBar(e),c.label=4;case 4:return[2]}}))}))},a.prototype.PrepareMessageBoxForDisplay=function(e,t,a){var s=pe.Instance.getConstMessage(r.MsgInterface.BRKTAB_STOP_MODE_TITLE);this._title=Ur.getStringOfOption(s,"EW",this._mode),t.value=pe.Instance.translate(this._title),a.value=n.Styles.MSGBOX_BUTTON_OK|("E"===this._mode?n.Styles.MSGBOX_ICON_ERROR:n.Styles.MSGBOX_ICON_WARNING)},a.prototype.ProcessMessageBoxResponse=function(e,t){},a.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_TITLE:this._title=n;break;case E.MG_ATTR_CALLINGTASK:this._callingTaskTag=n;break;case E.MG_ATTR_ERR_LOG_APPEND:this._errLogAppend=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_TEXT:this._text=r.XmlParser.unescape(n);break;case E.MG_ATTR_DISPLAY:this._display=n[0];break;case E.MG_ATTR_MODE:this._mode=n[0];break;case E.MG_ATTR_ACK:this._sendAck=0!==r.XmlParser.getInt(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},a}(Pr),Xr=function(e){function t(){var t=e.call(this)||this;return t._buttonsID="\0",t._image="\0",t._returnValStr=null,t._returnVal=null,t}return u(t,e),t.prototype.ProcessMessageBoxResponse=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null===e?[3,2]:[4,it.setoperVerifyReturnValue(t,this._returnVal)];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.PrepareMessageBoxForDisplay=function(e,t,r){t.value=pe.Instance.translate(this._title),r.value=it.getButtons(this._buttonsID),r.value|=it.getImage(this._image),null!==e&&br.isMainProgramField(this._returnValStr)&&(this._returnVal=it.InitField(this._returnValStr,e))},t.prototype.HandleAttribute=function(t,r){switch(t){case E.MG_ATTR_IMAGE:this._image=r[0];break;case E.MG_ATTR_BUTTONS:this._buttonsID=r[0];break;case E.MG_ATTR_RETURN_VAL:this._returnValStr=r;break;default:e.prototype.HandleAttribute.call(this,t,r)}},t}(Br),Hr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserRange),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),Wr=function(e){function a(){var t=e.call(this)||this;return t.UserRange=null,t}return u(a,e),Object.defineProperty(a.prototype,"ShouldExecute",{get:function(){return o.mgDataTable.GetTaskByID(this.TaskTag).isStarted()},enumerable:!1,configurable:!0}),a.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,a,s;return h(this,(function(i){switch(i.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),r=e.DataView.getField(this.UserRange.veeIdx-1),a=new t.RefParam(0),s=Qe.CreateAddUserRangeDataviewCommand(this.TaskTag,this.UserRange),this.UserRange.nullMin||(s.Range.min=n.RecordUtils.deSerializeItemVal(this.UserRange.min,r.getType(),r.getSize(),!0,r.getType(),a)),this.UserRange.nullMax||(s.Range.max=n.RecordUtils.deSerializeItemVal(this.UserRange.max,r.getType(),r.getSize(),!0,r.getType(),a)),[4,e.DataviewManager.Execute(s)];case 1:return i.sent(),[2]}}))}))},a.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_FIELD_INDEX:null==this.UserRange&&(this.UserRange=new N,this.UserRange.nullMin=this.UserRange.nullMax=this.UserRange.discardMin=this.UserRange.discardMax=!0),this.UserRange.veeIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_MIN_VALUE:this.UserRange.min=n,this.UserRange.nullMin=!1,this.UserRange.discardMin=!1;break;case E.MG_ATTR_NULL_MIN_VALUE:this.UserRange.nullMin=!0,this.UserRange.discardMin=!1;break;case E.MG_ATTR_NULL_MAX_VALUE:this.UserRange.nullMax=!0,this.UserRange.discardMax=!1;break;case E.MG_ATTR_MAX_VALUE:this.UserRange.max=n,this.UserRange.discardMax=!1,this.UserRange.nullMax=!1;break;default:e.prototype.HandleAttribute.call(this,t,n)}},a}(Pr),Kr=function(e){function r(){return e.call(this)||this}return u(r,e),r.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,a,s;return h(this,(function(i){switch(i.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),r=e.DataView.getField(this.UserRange.veeIdx-1),a=new t.RefParam(0),s=Qe.CreateAddUserLocateDataviewCommand(this.TaskTag,this.UserRange),this.UserRange.nullMin||(s.Range.min=n.RecordUtils.deSerializeItemVal(this.UserRange.min,r.getType(),r.getSize(),!0,r.getType(),a)),this.UserRange.nullMax||(s.Range.max=n.RecordUtils.deSerializeItemVal(this.UserRange.max,r.getType(),r.getSize(),!0,r.getType(),a)),[4,e.DataviewManager.Execute(s)];case 1:return i.sent(),[2]}}))}))},r}(Wr),Yr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserLocate),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),zr=function(e){function t(){var t=e.call(this)||this;return t._isNull=!1,t._attr=r.StorageAttribute.NONE,t._val=null,t}return u(t,e),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){return this._isNull?e.SetResultValue(null,r.StorageAttribute.NONE):(null==this._val&&(this._val=""),e.SetResultValue(this._val,this._attr)),[2]}))}))},t.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_NULL:this._isNull=1===r.XmlParser.getInt(n);break;case E.MG_ATTR_PAR_ATTRS:this._attr=n[0];break;case r.XMLConstants.MG_ATTR_VALUE:this._val=r.XmlParser.unescape(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},t}(Pr),qr=function(e){function t(){var t=e.call(this)||this;return t.UserSort=null,t}return u(t,e),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(r){switch(r.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),t=Qe.CreateAddUserSortDataviewCommand(this.TaskTag,this.UserSort),[4,e.DataviewManager.Execute(t)];case 1:return r.sent(),[2]}}))}))},t.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_FIELD_INDEX:null==this.UserSort&&(this.UserSort=new Ze),this.UserSort.fldIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_DIR:this.UserSort.dir=1===r.XmlParser.getInt(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},t}(Pr),jr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserSort),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),Qr=function(){function n(){this.newTaskXML=null}return n.prototype.fillData=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_COMMAND)+E.MG_TAG_COMMAND.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM),s=this.initElements(a);e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length);var i=s instanceof wr?s:null;return null!=i&&(this.getTaskXML(e),i.NewTaskXML=this.newTaskXML),s}return r.Logger.Instance.WriteDevToLog("in Command.FillData() out of string bounds"),null},n.prototype.initElements=function(e){t.Debug.Assert(e.get_Item(0)===r.XMLConstants.MG_ATTR_TYPE,"The first attribute of a <command> element must be the command type.");for(var n=this.getType(e.get_Item(1).toLowerCase()),a=this.CreateCommand(n),s=2;s<e.length;s+=2){var i=e.get_Item(s),o=e.get_Item(s+1);a.HandleAttribute(i,o)}return a},n.prototype.CreateCommand=function(r){switch(r){case e.ClientTargetedCommandType.Abort:return new Vr;case e.ClientTargetedCommandType.Verify:return new Br;case e.ClientTargetedCommandType.EnhancedVerify:return new Xr;case e.ClientTargetedCommandType.OpenURL:return new wr;case e.ClientTargetedCommandType.Result:return new zr;case e.ClientTargetedCommandType.AddRange:return new Wr;case e.ClientTargetedCommandType.AddLocate:return new Kr;case e.ClientTargetedCommandType.AddSort:return new qr;case e.ClientTargetedCommandType.ResetRange:return new Hr;case e.ClientTargetedCommandType.ResetLocate:return new Yr;case e.ClientTargetedCommandType.ResetSort:return new jr;case e.ClientTargetedCommandType.ClientRefresh:return new Dr;default:throw new t.ApplicationException("Unknown client targeted command type "+r)}},n.prototype.getTaskXML=function(e){if(e.getNextTag()!==E.MG_TAG_TASK_XML)throw new t.ApplicationException("Task's XML is missing");this.newTaskXML=e.ReadContentOfCurrentElement()},n.prototype.getType=function(t){var n;switch(t){case E.MG_ATTR_VAL_ABORT:n=e.ClientTargetedCommandType.Abort;break;case E.MG_ATTR_VAL_VERIFY:n=e.ClientTargetedCommandType.Verify;break;case E.MG_ATTR_VAL_ENHANCED_VERIFY:n=e.ClientTargetedCommandType.EnhancedVerify;break;case E.MG_ATTR_VAL_RESULT:n=e.ClientTargetedCommandType.Result;break;case E.MG_ATTR_VAL_OPENURL:n=e.ClientTargetedCommandType.OpenURL;break;case E.MG_ATTR_VAL_ADD_RANGE:n=e.ClientTargetedCommandType.AddRange;break;case E.MG_ATTR_VAL_ADD_LOCATE:n=e.ClientTargetedCommandType.AddLocate;break;case E.MG_ATTR_VAL_ADD_SORT:n=e.ClientTargetedCommandType.AddSort;break;case E.MG_ATTR_VAL_RESET_RANGE:n=e.ClientTargetedCommandType.ResetRange;break;case E.MG_ATTR_VAL_RESET_LOCATE:n=e.ClientTargetedCommandType.ResetLocate;break;case E.MG_ATTR_VAL_RESET_SORT:n=e.ClientTargetedCommandType.ResetSort;break;case E.MG_ATTR_VAL_CLIENT_REFRESH:n=e.ClientTargetedCommandType.ClientRefresh;break;default:n=t[0],r.Logger.Instance.WriteExceptionToLogWithMsg("Command.getType there is no such SERVER to CLIENT command : "+t)}return n},n}(),Zr=function(){function e(){}return e.Serialize=function(n,a){if(!n.ShouldSerialize)return null;var s=new t.StringBuilder,i=!1;s.Append(r.XMLConstants.START_TAG+E.MG_TAG_COMMAND),s.Append(" "+r.XMLConstants.MG_ATTR_TYPE+'="'+n.CommandTypeAttribute+'"');var o=new t.RefParam(i);return s.Append(n.SerializeCommandData(o)),i=o.value,n.ShouldSerializeRecords&&s.Append(e.SerializeRecords(a)),i?s.Append(r.XMLConstants.TAG_CLOSE):s.Append(r.XMLConstants.TAG_TERM),s.Append(n.SerializeDataAfterCommand()),s.ToString()},e.SerializeRecords=function(e){var n=new t.StringBuilder;try{for(var a=e.getTasksCount(),s=!1,i=G.Instance.getLastFocusedTask(),o=0;o<a;o++){var l=e.getTask(o);null!==l.getLastParkedCtrl()&&(s?n.Append("$"):(n.Append(" "+E.MG_ATTR_FOCUSLIST+'="'),s=!0),n.Append(l.getTaskTag()+","),n.Append(l.getLastParkedCtrl().getDitIdx()))}s&&n.Append('"'),null!==i&&n.Append(" "+E.MG_ATTR_FOCUSTASK+'="'+i.getTaskTag()+'"')}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e)}return n.ToString()},e}(),Jr=function(){function e(){this._cmds=null,this._iterationIdx=0,this._cmds=new t.List}return e.createCommandsTable=function(){return new e},e.prototype.fillData=function(e){for(;this.initInnerObjects(e.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t){if(null==e)return!1;if(e!==E.MG_TAG_COMMAND)return!1;var r=(new Qr).fillData(t);return this._cmds.push(r),!0},e.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:for(t=Lr.Instance.getCmdFrame(),Lr.Instance.add1toCmdFrame(),r=-1,n=0;n<this.getSize();n+=1)(s=this.getCmd(n)).IsBlocking&&-1===r?r=n:s instanceof zr&&-1!==r&&(this._cmds.Insert(r,s),this._cmds.RemoveAt(n+1));for(n=0;n<this.getSize();n+=1)if((s=this.getCmd(n)).Frame=t,s.IsBlocking){for(a=n+1;a<this.getSize();a+=1)Lr.Instance.addUnframedCmd(this.getCmd(a));this._cmds.SetSize(n+1);break}o.label=1;case 1:return this.getSize()>0?((i=this.extractCmd(t))instanceof Gr&&(s=i),null==s?[3,5]:s.ShouldExecute?[4,s.Execute(e)]:[3,3]):[3,7];case 2:return o.sent(),[3,4];case 3:Lr.Instance.addCommandsExecutedAfterTaskStarted(s),o.label=4;case 4:return[3,6];case 5:return[3,7];case 6:return[3,1];case 7:return[2]}}))}))},e.prototype.extractCmd=function(e){var t,r,n,a=this.getSize(),s=null,i=null,l=null,u=null;if(0===a)return null;for(this._iterationIdx>=a&&(this._iterationIdx=0),r=this._iterationIdx;this._iterationIdx<a;this._iterationIdx++)if(null!=(s=this.getCmd(this._iterationIdx)instanceof Vr?this.getCmd(this._iterationIdx):null)&&!s.TaskTag.startsWith("-")&&s.Frame===e){for(t=0;t<this._iterationIdx;t++)if(null!=(i=this.getCmd(t)instanceof Br?this.getCmd(t):null)&&i.Frame===e&&(l=o.mgDataTable.GetTaskByID(i.TaskTag),u=o.mgDataTable.GetTaskByID(s.TaskTag),null!=l&&l.isDescendentOf(u)))return this._cmds.RemoveAt(t),this._iterationIdx--,i;for(this._cmds.RemoveAt(this._iterationIdx),a=this.getSize(),r=0;r<a;r++)if(null!=(n=this.getCmd(r).TaskTag)&&n.substr(1)===s.TaskTag){this._cmds.RemoveAt(r);break}return s}for(t=0;t<a;t++)if(null!=(i=this.getCmd(t)instanceof Br?this.getCmd(t):null)&&i.Frame===e&&null!=o.mgDataTable.GetTaskByID(i.TaskTag))return this._cmds.RemoveAt(t),i;for(this._iterationIdx=0;this._iterationIdx<a;this._iterationIdx++)if((s=this.getCmd(this._iterationIdx)).Frame===e)return this._cmds.RemoveAt(this._iterationIdx),s;return null},e.prototype.getCmd=function(e){return this._cmds.get_Item(e)},e.prototype.buildXML=function(e){for(var r=0;r<this._cmds.length;r+=1){var n=this._cmds.get_Item(r);new t.RefParam(!1);e.Append(Zr.Serialize(n,o.mgDataTable.getCurrMGData()))}this.clear()},e.prototype.Add=function(e){this._cmds.push(e)},e.prototype.Clear=function(){this._cmds.Clear()},e.prototype.ExtractCommand=function(e){var t=this.getCmd(e);return this._cmds.RemoveAt(e),t},e.prototype.clear=function(){this._cmds.Clear()},e.prototype.getSize=function(){return this._cmds.length},e}(),$r="4.800.0",en=function(){function a(){this._guiEventsProcessor=null,this._tableCacheManager=null,this._delayInProgress=!1,this._debugClient=null,this._globalUniqueSessionId=null,this._buttonIsClicked=!1,n.RuntimeContextBase.Instance.Init(le.RC_NO_CONTEXT_ID),G.Instance.Init(oe.Instance),G.Instance.LastActionTime=r.Misc.getSystemMilliseconds(),le.ShouldScrambleAndUnscrambleMessages=!0,this._globalUniqueSessionId=Fr.GetUniqueMachineID()+"_",this.RegisterDelegates()}return Object.defineProperty(a,"Instance",{get:function(){return null===a._instance&&(a._instance=new a),a._instance},enumerable:!1,configurable:!0}),a.prototype.AddEvent=function(e){var a=oe.Instance.GetTaskByID(e.TaskID),s=+e.Line,i=0;if(null!=a){var o=null;if(null!==e.ControlName&&(o=a.getForm().GetCtrl(e.ControlName)),null!=o){var l=a.DataView;switch(o.IsTableChild&&(s-=l.RecordsBeforeCurrentView),e.EventType){case"columnSort":o.isColumnSortable()&&n.Events.OnColumnClick(o,e.Line,e.ControlName);break;case"mousedown":o.isButton()?this._buttonIsClicked=!0:o.isSubform()||(n.Events.GetRuntimeContext(n.Manager.GetCurrentContextID()).LastClickedCtrlName=o.getName());break;case"click":if(o.isButton()||o.ConnectedControl&&e.fromButton)n.Events.OnSelection("",o,s,!0),n.Events.GetRuntimeContext(n.Manager.GetCurrentContextID()).LastClickedCtrlName=o.getName(),this._buttonIsClicked=!1;else{n.Events.OnFocus(o,s,!0,!1);var u=o.isButton()||o.isTextControl()||o.isLabel()||o.isTabControl()||o.isTableControl()||o.isComboBox()||o.isImageControl();n.Events.OnMouseDown(o.getForm(),o,null,!0,s,!1,u)}break;case"focus":if(this._buttonIsClicked)return;n.Events.OnFocus(o,s,!0,!1);break;case"dblclick":n.Events.OnDblClick(o,s);break;case"selectionchanged":n.Events.OnSelection(e.Value,o,s,!0);break;case"keydown":n.Events.OnKeyDown(a.getForm(),o,e.modifiers,e.keyCode,0,0,"",!1,"",!0);break;case"setexternalvalue":kr.Instance.AddExternalValueEvent(o,e.externalValue,e.param)}}else switch(e.EventType){case"focusOnNonMagicControl":null!==(o=G.getLastFocusedControl())&&n.Events.OnFocusOnNonMagicControl(o);break;case"click":"magicRow"===e.ControlName&&(i=e.Line-a.DataView.RecordsBeforeCurrentView,kr.Instance.addGuiTriggeredEventWithTaskAndCodeAndLine(a,r.InternalInterface.MG_ACT_REC_PREFIX,i));break;case"close":a.IsRoute()?kr.Instance.AddRouterClosedEvent(a):n.Events.CloseFormEvent(a.getForm());break;case"dispose":oe.Instance.deleteMGDataTree(a.getMgdID());break;case"resize":n.Events.TableResizeEvent(a.getForm().getTableCtrl(),e.PageSize);case"getRows":i=s-a.DataView.RecordsBeforeCurrentView;var c={guiMgControl:a.getForm().getTableCtrl(),Line:i,Val:""};n.Events.OnGetRowsData(a.getForm().getTableCtrl(),i,!0,c);break;case"RouterNavigate":kr.Instance.AddRouteEvent(a,r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE,e.RouterPath,e.RouterOutletName,e.RouterParams);break;case"setexternalvalue":r.Logger.Instance.WriteErrorToLog(t.NString.Format("Unable to find {0}: Trying to set value for a non-existing control.",e.ControlName))}}else if("confirmationClosed"===e.EventType)this.ConfirmationClosed(e.keyCode)},a.prototype.ConfirmationClosed=function(e){n.Commands.ResolvePromise(e)},a.prototype.WorkThreadExecution=function(){return T(this,void 0,void 0,(function(){var e,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:r.Logger.Instance.ShouldLog()&&(r.Logger.Instance.WriteToLog("",!0),r.Logger.Instance.WriteToLog("Started on "+r.DateTimeUtils.ToString(t.DateTime.Now,r.XMLConstants.ERROR_LOG_DATE_FORMAT,r.Logger.Instance),!0),this.WriteExecutionPropertiesToLog()),l.label=1;case 1:return l.trys.push([1,10,15,17]),[4,Te.StartSession()];case 2:return l.sent()?(e=oe.Instance,a=e.StartupMgData,e.currMgdID=a.GetId(),s=null,a.IsAborting?[3,4]:[4,br.StartProgram(!1,!1)]):[3,9];case 3:s=l.sent(),l.label=4;case 4:return null!==s?[3,6]:[4,kr.Instance.EventsLoop(a)];case 5:return l.sent(),[3,8];case 6:return[4,kr.Instance.NonInteractiveEventsLoop(a,s)];case 7:l.sent(),l.label=8;case 8:kr.Instance.setEndOfWork(!0),l.label=9;case 9:return[3,17];case 10:return(i=l.sent())instanceof t.ApplicationException?(o=!1,i instanceof ae&&i.GetCode()===ae.INF_NO_RESULT&&(o=!0),o?[3,12]:[4,kr.Instance.ProcessAbortingError(i)]):[3,13];case 11:l.sent(),l.label=12;case 12:return kr.Instance.setEndOfWork(!0),[3,14];case 13:throw i;case 14:return[3,17];case 15:return[4,kr.Instance.CheckAndShowSpinner(!1)];case 16:return l.sent(),n.Commands.addGlobalCommand(n.CommandType.EXIT_MAGIC),n.Commands.beginInvoke(),[7];case 17:return[2]}}))}))},a.prototype.WriteExecutionPropertiesToLog=function(){if(r.Logger.Instance.ShouldLogServerRelatedMessages()){r.Logger.Instance.WriteToLog("-----------------------------------------------------------------------------",!0),r.Logger.Instance.WriteToLog("Execution Properties:",!0);var e=JSON.stringify(ne.Instance);r.Logger.Instance.WriteToLog(e,!0),r.Logger.Instance.WriteToLog("-----------------------------------------------------------------------------",!0)}},a.prototype.InitGuiManager=function(){n.Manager.EventsManager=kr.Instance,n.Manager.DefaultServerName=ne.Instance.getServer(),n.Manager.DefaultProtocol=ne.Instance.getProtocol(),n.GuiEnvironment.Environment=et.Instance,n.GuiDataCollection.MGDataTable=oe.Instance,n.RuntimeContextBase.noContextId=le.RC_NO_CONTEXT_ID},a.prototype.InitCircularReferencesBypasses=function(){O.createNewtask=br.CreateTask,wr.createNewCommandsTable=Jr.createCommandsTable,o.eventsManager=kr.Instance,o.mgDataTable=oe.Instance,o.envParamsTable=lt.Instance,o.globalParams=nt.Instance,o.languageData=pe.Instance,o.environment=et.Instance},a.Main=function(e){a.StartExecution(e),r.Logger.Instance.Flush()},a.StopExecution=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),re.GetInstance().IsAbortingMagicEngine=!0,oe.Instance.StartupMgData.getFirstTask().ClosingFormUI=!0,[4,oe.Instance.StartupMgData.getFirstTask().endTask(!0,!1,!1)];case 1:return n.sent(),[3,3];case 2:if(!((e=n.sent())instanceof t.ApplicationException))throw e;return r.Logger.Instance.WriteExceptionToLog(e),[3,3];case 3:return[2]}}))}))},a.StartExecution=function(e){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return re.setNativeHttpClient(e),[4,a.Instance.LoadExecutionProps()];case 1:return i.sent()?(a.Instance._guiEventsProcessor=new xr,a.Instance.InitGuiManager(),a.Instance.InitCircularReferencesBypasses(),"Version : 4.800.0",console.log("Magic Web Client. Version : 4.800.0"),re.GetInstance().HttpCommunicationTimeoutMS=ne.Instance.GetFirstHttpRequestTimeout(),kr.Instance.Init(),r.Logger.Instance.Initialize(le.GetInstance().parseLogLevel(ne.Instance.getInternalLogLevel()),ne.Instance.getInternalLogSync(),!1),s=new Or(new Jr,new Jr,0,null,!1),[4,oe.Instance.addMGData(s,0,!0)]):[3,4];case 2:return i.sent(),[4,a.Instance.WorkThreadExecution()];case 3:return i.sent(),r.Logger.Instance.ShouldLog()&&r.Logger.Instance.WriteToLog(r.OSEnvironment.EolSeq+"Ended on "+r.DateTimeUtils.ToString(t.DateTime.Now,"dd/MM/yyyy",r.Logger.Instance)+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq,!1),[3,6];case 4:return[4,ge.Instance.MessageBox("Error","Failed to load server configuration file ("+this._executionPropertiesFileName+")",n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)];case 5:i.sent(),i.label=6;case 6:return[2]}}))}))},a.prototype.LoadExecutionProps=function(){return T(this,void 0,void 0,(function(){var e,r,n;return h(this,(function(s){switch(s.label){case 0:e="",r=!0,s.label=1;case 1:return s.trys.push([1,3,,4]),n=new t.RefParam(!1),[4,re.GetInstance().GetContent(a._executionPropertiesFileName,null,!1,n)];case 2:return e=s.sent(),ne.Instance.Init(JSON.parse(e)),[3,4];case 3:return s.sent(),r=!1,[3,4];case 4:return[2,r]}}))}))},a.prototype.copyExecutionProps=function(){throw new t.Exception("copyExecutionProps not implemented")},a.prototype.getDebugClient=function(){return this._debugClient},a.prototype.getURLFromExecutionProperties=function(e){var n=null,a=ne.Instance.GetExecutionProperty[e];if(null!=a){a.startsWith("/")&&(a=ne.Instance.getProtocol()+"://"+ne.Instance.getServer()+a);try{n=new URL(a),t.Debug.Assert("http:"===n.protocol||"https:"===n.protocol)}catch(e){r.Logger.Instance.WriteExceptionToLog(e)}}return n},a.prototype.getLogonWindowIconURL=function(){return this.getURLFromExecutionProperties(n.GuiConstants.STR_LOGO_WIN_ICON_URL)},a.prototype.getLogonWindowImageURL=function(){return this.getURLFromExecutionProperties(n.GuiConstants.STR_LOGON_IMAGE_URL)},a.prototype.isDelayInProgress=function(){return this._delayInProgress},a.prototype.setDelayInProgress=function(e){this._delayInProgress=e},a.prototype.GetGlobalUniqueSessionID=function(){return this._globalUniqueSessionId},a.getExecutionPropertiesFileName=function(){var e=null,r=e.lastIndexOf("\\");return t.NString.Remove(e,r+1,e.length-r-1)+E.EXECUTION_PROPERTIES_FILE_NAME},a.GetControlPictureMask=function(e,t){var r=null,n=oe.Instance.GetTaskByID(e);return null!==t&&(r=n.getForm().GetCtrl(t).getPIC()),r},a.GetFormattedValue=function(e,t,a){var s=null,i=oe.Instance.GetTaskByID(e),o=null,l=a;if(null!==t&&(o=i.getForm().GetCtrl(t)),null!=o&&o.DataType==r.StorageAttribute.NUMERIC){s=o.getPIC();var u=String(a),c=s.getUnformattedNumericPic(),_=n.DisplayConvertor.Instance.toNum(u,c,0);l=n.DisplayConvertor.Instance.fromNum(_,s)}return l},a.GetRangedValue=function(e,t,r){var n=oe.Instance.GetTaskByID(e);return null!==t?n.getForm().GetCtrl(t).getRangedValue(r):null},a.ValidateControlValue=function(e,t,r){var n=oe.Instance.GetTaskByID(e);return null!==t?n.getForm().GetCtrl(t).validate(r):null},a.GetFldRanges=function(e,t){var r=oe.Instance.GetTaskByID(e);return null!==t?r.getForm().GetCtrl(t).getRanges():null},a.TransCacheExists=function(){var e=o.mgDataTable.getCurrMGData().clientTransactionCacheExists(),t=o.mgDataTable.getCurrMGData().serverTransactionCacheExists();return e||t},a.prototype.RegisterDelegates=function(){Z.GetExecutionProperty_Event=ne.Instance.GetExecutionProperty.bind(ne.Instance),Z.GetRuntimeCtxID_Event=this.GetRuntimeCtxID.bind(this),Z.GetGlobalUniqueSessionID_Event=this.GetGlobalUniqueSessionID.bind(this),Z.ShouldDisplayGenericError_Event=ne.Instance.ShouldDisplayGenericError.bind(ne.Instance)},a.prototype.GetRuntimeCtxID=function(){return n.RuntimeContextBase.Instance.ContextID},a.TerminateContextUsingFetchAPI=function(){if(!le.IsSessionReInitializing){re.GetInstance().IsAbortingMagicEngine=!0,oe.Instance.getCurrMGData().CmdsToServer.Clear();var t=Qe.CreateContextTerminationEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag());oe.Instance.getCurrMGData().CmdsToServer.Add(t),le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)}},a}();en._instance=null,en._executionPropertiesFileName="./assets/server-config.json";var tn=function(){function e(){}return e.Initialize=function(e){en.Main(e)},e.TerminateMagic=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,en.StopExecution()];case 1:return e.sent(),[2]}}))}))},e.registerExecuteCommandsCallback=function(e){n.UIBridge.getInstance().registerExecuteCommandsCallback(e)},e.registerInteractiveCallback=function(e){n.UIBridge.getInstance().registerInteractiveCallback(e)},e.insertEvent=function(e){en.Instance.AddEvent(e)},e.GetControlPictureMask=function(e,t){return en.GetControlPictureMask(e,t)},e.GetFormattedValue=function(e,t,r){return en.GetFormattedValue(e,t,r)},e.GetRangedValue=function(e,t,r){return en.GetRangedValue(e,t,r)},e.ValidateControlValue=function(e,t,r){return en.ValidateControlValue(e,t,r)},e.GetFldRanges=function(e,t){return en.GetFldRanges(e,t)},e.TransCacheExists=function(){return en.TransCacheExists()},e.TerminateContextUsingFetchAPI=function(){en.TerminateContextUsingFetchAPI()},e}(),rn=function(e,t){this.taskCtlIdx=0,this.realIdx=0,this.taskCtlIdx=e,this.realIdx=t};rn.PRIME_NUMBER=37,rn.SEED=23;var nn=function(){},an=function(){function e(){}return e.StartCurrentExecutable=function(e){throw new t.NotImplementedException},e}();e.AbortCommand=Vr,e.AccessHelper=o,e.ActionManager=Rr,e.AddLocateCommand=Kr,e.AddRangeCommand=Wr,e.AddSortCommand=qr,e.AddUserLocateDataViewCommand=me,e.AddUserLocateRemoteDataViewCommand=Kt,e.AddUserRangeDataviewCommand=Se,e.AddUserRangeRemoteDataViewCommand=Ht,e.AddUserSortDataViewCommand=Me,e.AddUserSortRemoteDataViewCommand=zt,e.Argument=v,e.ArgumentsList=L,e.Boundary=At,e.BrowserEscEventCommand=Pe,e.ClientManager=en,e.ClientOriginatedCommand=f,e.ClientOriginatedCommandSerializer=Zr,e.ClientOriginatedCommandTaskTag=C,e.ClientRefreshCommand=Dr,e.ClientTargetedCommandBase=Pr,e.ColumnSortEventCommand=ke,e.CommandFactory=Qe,e.CommandSerializationHelper=A,e.CommandsProcessorBase=Q,e.CommandsProcessorManager=Te,e.CommandsTable=Jr,e.CompMainPrgTable=yr,e.ComputeEventCommand=we,e.ConstInterface=E,e.ConstUtils=Ur,e.ContextTerminationEventCommand=ze,e.ContextTimeoutResetCommand=qe,e.ControlItemsRefreshCommand=Le,e.CookieService=ut,e.CreatedFormVector=tr,e.CurrentClientVersion=$r,e.DataSourceIdKey=rn,e.DataView=yt,e.DataViewBase=pt,e.DataViewCommandBase=wt,e.DataViewOutputCommand=Ne,e.DataviewCommand=Ce,e.DataviewHeaderBase=ft,e.DataviewHeaderFactory=ur,e.DataviewHeaders=_r,e.DataviewHeadersSaxHandler=cr,e.DataviewManager=$t,e.DataviewManagerBase=Ft,e.DcValuesReference=dt,e.DummyDataViewCommand=Ut,e.DvCache=Ot,e.EnhancedVerifyCommand=Xr,e.EnvParamsTable=lt,e.Environment=et,e.EnvironmentDetails=tt,e.EvaluateCommand=He,e.Event=k,e.EventCommand=R,e.EventHandler=hr,e.EventHandlerPosition=Ae,e.EventsManager=kr,e.ExecOperCommand=q,e.ExecutionStack=z,e.ExecutionStackEntry=Y,e.ExpDesc=Ie,e.ExpStrTracker=Tt,e.ExpTable=fr,e.Expression=Er,e.ExpressionDict=fe,e.ExpressionEvaluator=ct,e.ExpressionLocalJpn=de,e.Expression_ReturnValue=Ir,e.FetchDataControlValuesEventCommand=ye,e.Field=Rt,e.FieldBase=M,e.FieldsTableExt=Mt,e.FlowMonitorInterface=V,e.FlowMonitorQueue=U,e.FormsTable=Ar,e.GUIManager=ge,e.GlobalCommandsManager=Lr,e.GlobalParams=nt,e.GlobalParamsQueryCommand=Ke,e.GuiEventsProcessor=xr,e.HandlersTable=gr,e.HeapSort=sr,e.HttpClientAsync=te,e.HttpClientBase=$,e.HttpClientEvents=Z,e.HttpClientSync=ee,e.HttpManager=re,e.HttpUtility=se,e.IClientTargetedCommand=Gr,e.IndexChangeEventCommand=De,e.IniputForceWriteCommand=Ye,e.InteractiveCommunicationsFailureHandler=_e,e.Key=ar,e.LanguageData=pe,e.LastFocusedManager=G,e.MGData=Or,e.MGDataCollection=oe,e.MagicBridge=tn,e.MenusDeserializer=nn,e.MgControl=P,e.MgForm=rr,e.MgPriorityBlockingQueue=F,e.MgPriorityQueue=D,e.MirrorExpVal=rt,e.MirrorPrmMap=$e,e.MirrorString=ot,e.NonReversibleExitEventCommand=Ve,e.NullValueException=_t,e.OpenURLCommand=wr,e.OpeningTaskDetails=y,e.Operation=it,e.OperationTable=Tr,e.PrmMap=Je,e.Process=an,e.QueryCommand=We,e.RCTimer=K,e.Recompute=Ct,e.RecomputeCommand=Ue,e.RecomputeTable=dr,e.Record=gt,e.RecordOutOfDataViewException=mt,e.RecordsTable=Et,e.RefreshEventCommand=be,e.RefreshScreenEventCommand=xe,e.RemoteCommandsProcessor=le,e.RemoteControlItemsRefreshCommand=Qt,e.RemoteDataViewCommandBase=Vt,e.RemoteDataViewCommandFactory=Zt,e.RemoteDataViewCommandUpdateNonModifiable=Bt,e.RemoteDataviewHeader=lr,e.RemoteDataviewManager=Jt,e.RemoteTaskService=nr,e.ResetLocateCommand=Yr,e.ResetRangeCommand=Hr,e.ResetSortCommand=jr,e.ResetUserLocateRemoteDataviewCommand=Yt,e.ResetUserRangeRemoteDataviewCommand=Wt,e.ResetUserSortRemoteDataviewCommand=qt,e.ResultCommand=zr,e.ResultValue=jt,e.RetVals=pr,e.ReturnResult=Pt,e.ReturnResultBase=Gt,e.RollbackEventCommand=S,e.RunTimeEvent=w,e.RunTimeEventBase=x,e.SET_DISPLAYLINE_BY_DV=Lt,e.Scrambler=j,e.SelectProgramCommand=je,e.ServerConfig=ne,e.ServerError=ae,e.SetTransactionStateDataviewCommand=ve,e.SetTransactionStateRemoteDataViewCommand=Xt,e.Sort=Ze,e.SortCollection=er,e.SubformOpenEventCommand=Fe,e.SubformRefreshEventCommand=Ge,e.TableCache=or,e.TableCacheManager=ir,e.Task=br,e.TaskBase=b,e.TaskServiceBase=Dt,e.TaskTransactionManager=xt,e.TasksTable=O,e.Transaction=kt,e.TransactionCommand=Be,e.UniqueIDUtils=Fr,e.UnloadCommand=Xe,e.UserDetails=at,e.UserEventsTable=Cr,e.UserRange=N,e.VerifyCommand=Br,e.WriteMessageToServerLogCommand=Oe,e.XMLBasedCommandBuilder=Qr,e.XMLBasedDcValuesBuilder=vt,e.YesNoExp=st,e.getGuiEventObj=function(e,t,r,a){return void 0===a&&(a=!1),{EventType:e,TaskID:null,ControlName:t,Line:r,PageSize:0,Value:null,RouterPath:null,RouterOutletName:null,RouterParams:null,modifiers:n.Modifiers.MODIFIER_NONE,keyCode:0,externalValue:null,param:null,fromButton:a}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */function u(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c,_;function T(e,t,r,n){return new(r||(r=Promise))((function(a,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,o)}l((n=n.apply(e,t||[])).next())}))}function h(e,t){var r,n,a,s,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(6===s[0]&&i.label<a[1]){i.label=a[1],a=s;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(s);break}a[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],n=0}finally{r=a=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(a)throw a.error}}return i}function d(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}e.EventSubType=void 0,(c=e.EventSubType||(e.EventSubType={}))[c.Normal=0]="Normal",c[c.CancelWithNoRollback=1]="CancelWithNoRollback",c[c.CancelIsQuit=2]="CancelIsQuit",c[c.RtRefreshViewUseCurrentRow=3]="RtRefreshViewUseCurrentRow",c[c.ExitDueToError=4]="ExitDueToError",e.ClientTargetedCommandType=void 0,(_=e.ClientTargetedCommandType||(e.ClientTargetedCommandType={})).Abort="A",_.OpenURL="P",_.Verify="V",_.EnhancedVerify="E",_.Result="S",_.AddRange="R",_.ClientRefresh="C",_.AddLocate="L",_.AddSort="T",_.ResetRange="G",_.ResetLocate="O",_.ResetSort="U";var E=function(){};E.EXECUTION_PROPERTIES_FILE_NAME="execution.properties",E.FORMS_USER_STATE_FILE_NAME="FormsUserStateRIA",E.NAMES_SEPARATOR="#+%",E.MG_TAG_CONTEXT="context",E.MG_TAG_PROTOCOL="protocol",E.MG_TAG_ENV="env",E.MG_TAG_COMMAND="command",E.MG_TAG_LANGUAGE="language",E.MG_TAG_LANGUAGE_END="/language",E.MG_TAG_CONSTMESSAGES="ConstMessages",E.MG_TAG_CONSTMESSAGES_END="/ConstMessages",E.MG_TAG_CONSTMESSAGESCONTENT="ConstLangFileContent",E.MG_TAG_CONSTMESSAGESCONTENT_END="/ConstLangFileContent",E.MG_TAG_MLS_FILE_URL="MlsFileUrl",E.MG_TAG_MLS_FILE_URL_END="/MlsFileUrl",E.MG_TAG_MLS_CONTENT="MlsContent",E.MG_TAG_MLS_CONTENT_END="/MlsContent",E.MG_TAG_COMPMAINPRG="compmainprg",E.MG_TAG_STARTUP_PROGRAM="StartupProgram",E.MG_TAG_CONTEXT_ID="ContextID",E.MG_TAG_SESSION_ID="SessionID",E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT="HttpTimeout",E.MG_TAG_UNSYNCRONIZED_METADATA="UnsynchronizedMetadata",E.MG_TAG_TASKDEFINITION_IDS_URL="taskDefinitionIdsUrl",E.MG_TAG_OFFLINE_SNIPPETS_URL="offlineSnippetsUrl",E.MG_TAG_DEFAULT_TAG_LIST="defaultTagList",E.MG_TAG_TASK_INFO="taskinfo",E.MG_TAG_EXECUTION_RIGHT="executionRightIdx",E.MG_ATTR_ISSPECIFIC="isSpecific",E.MG_ATTR_IS_GUI_THREAD_EXECUTION="isGuiThreadExecution",E.MG_ATTR_FULLNAME="fullname",E.MG_ATTR_PUBLIC_NAME="publicName",E.MG_TAG_TASKURL="taskURL",E.MG_TAG_TASK_IS_OFFLINE="IsOffline",E.MG_TAG_EXPTABLE="exptable",E.MG_TAG_EXP="exp",E.MG_TAG_DATAVIEW="dataview",E.MG_TAG_COMPLETE_DV="CompleteDataView",E.MG_TAG_REC="rec",E.MG_TAG_FLD_END="/fld",E.MG_TAG_HANDLER="handler",E.MG_TAG_EVENTHANDLERS="eventhandlers",E.MG_TAG_EVENT="event",E.MG_TAG_OPER="oper",E.MG_TAG_KBDMAP_URL="kbdmapurl",E.MG_TAG_KBDMAP="kbdmap",E.MG_TAG_KBDITM="kbditm",E.MG_TAG_USER_EVENTS="userevents",E.MG_TAG_USER_EVENTS_END="/userevents",E.MG_TAG_EVENTS_QUEUE="eventsqueue",E.MG_TAG_DC_VALS="dc_vals",E.MG_TAG_FLWMTR_CONFIG="flwmtr_config",E.MG_TAG_FLWMTR_MSG="flwmtr_msg",E.MG_TAG_FLWMTR_ACT="act",E.MG_TAG_DEL_LIST="cacheDelList",E.MG_TAG_LINKS="links",E.MG_TAG_LINKS_END="/links",E.MG_TAG_LINK="link",E.MG_TAG_TASK_TABLES="taskTables",E.MG_TAG_TASK_TABLES_END="/taskTables",E.MG_TAG_TASK_TABLE="taskTable",E.MG_TAG_COLUMN="column",E.MG_TAG_SORT="sort",E.MG_TAG_SORTS="sorts",E.MG_TAG_SORTS_END="/sorts",E.MG_TAG_CACHED_TABLE="cachedTable",E.MG_TAG_CACHED_TABLE_END="/cachedTable",E.MG_TAG_RECORDS="records",E.MG_TAG_RECORDS_END="/records",E.MG_TAG_TASK_XML="taskxml",E.MG_TAG_EXEC_STACK_ENTRY="execstackentry",E.MG_TAG_DBH_REAL_IDXS="dbhRealIdxs",E.MG_TAG_USER_DETAILS="userDetails",E.MG_SSL_STORE_ARG_PREFIX="STORE:",E.MG_ATTR_VALUE_TAGGED=r.XMLConstants.TAG_OPEN+r.XMLConstants.MG_ATTR_VALUE+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_VALUE_END_TAGGED=r.XMLConstants.END_TAG+r.XMLConstants.MG_ATTR_VALUE+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_HANDLER="handler",E.MG_ATTR_OBJECT="object",E.MG_ATTR_RECOMPUTE="recompute",E.MG_ATTR_MESSAGE="message",E.MG_ATTR_HTML="html",E.MG_ATTR_ARGLIST="arglist",E.MG_ATTR_EXTRA="extra",E.MG_ATTR_FIRSTPOS="firstpos",E.MG_ATTR_LASTPOS="lastpos",E.MG_ATTR_VIRTUAL="virtual",E.MG_ATTR_SUBFORM_TASK="subform_task",E.MG_ATTR_PARAM="param",E.MG_ATTR_PARAMS="params",E.MG_ATTR_ROUTE_PARAMS="routeParams",E.MG_ATTR_EXPOSED_ROUTE_PARAMS="exposedRouteParam",E.MG_ATTR_EXPOSED_TO_CLIENT="exposedToClient",E.MG_ATTR_PAR_ATTRS="attr",E.MG_ATTR_PAR_ATTRS_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_ATTR_PAR_ATTRS+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_PAR_ATTRS_END_TAGGED=r.XMLConstants.END_TAG+E.MG_ATTR_PAR_ATTRS+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_VIR_AS_REAL="vir_as_real",E.MG_ATTR_LNK_CREATE="link_create",E.MG_ATTR_LENGTH="length",E.MG_ATTR_RANGE="range",E.MG_ATTR_NULLVALUE="nullvalue",E.MG_ATTR_INIT="init",E.MG_ATTR_CURRPOS="currpos",E.MG_ATTR_POS="pos",E.MG_ATTR_OLDPOS="oldpos",E.MG_ATTR_MODE="mode",E.MG_ATTR_RECOMPUTEBY="recompute_by",E.MG_ATTR_NAME_TAGGED=r.XMLConstants.TAG_OPEN+r.XMLConstants.MG_ATTR_NAME+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_NAME_END_TAGGED=r.XMLConstants.END_TAG+r.XMLConstants.MG_ATTR_NAME+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_TRANS="trans",E.MG_ATTR_HANDLEDBY="handledby",E.MG_ATTR_LEVEL="level",E.MG_ATTR_DESTINATION_DATASOURCE_NAME="destDataSourceName",E.MG_ATTR_DESTINATION_COLUMNLIST="destColumnList",E.MG_ATTR_SOURCE_DATAVIEW="sourceDataView",E.MG_ATTR_SECONDS="seconds",E.MG_ATTR_SCOPE="scope",E.MG_ATTR_RETURN="return",E.MG_ATTR_PROPAGATE="propagate",E.MG_ATTR_ENABLED="enabled",E.MG_ATTR_FLD="fld",E.MG_ATTR_FIELDID="fieldid",E.MG_ATTR_IGNORE_SUBFORM_RECOMPUTE="ignoreSubformRecompute",E.MG_ATTR_MAGICEVENT="magicevent",E.MG_ATTR_EXIT_BY_MENU="exitByMenu",E.MG_ATTR_FOCUSLIST="focuslist",E.MG_ATTR_FOCUSTASK="currFocusedTask",E.MG_ATTR_TEXT="text",E.MG_ATTR_TITLE="title",E.MG_ATTR_TITLE_EXP="titleExp",E.MG_ATTR_IMAGE="image",E.MG_ATTR_BUTTONS="buttons",E.MG_ATTR_RETURN_VAL="returnVal",E.MG_ATTR_ERR_LOG_APPEND="errorLogAppend",E.MG_ATTR_EVENTVALUE="eventvalue",E.MG_ATTR_EVENTTYPE="eventtype",E.MG_ATTR_HOW="how",E.MG_ATTR_UNDO="undo",E.MG_ATTR_CND="cnd",E.MG_ATTR_ACTIONID="actionid",E.MG_ATTR_KEYCODE="keycode",E.MG_ATTR_MODIFIER="modifier",E.MG_ATTR_STATES="states",E.MG_ATTR_CURR_REC="curr_rec",E.MG_ATTR_LAST_REC_ID="lastRecIdx",E.MG_ATTR_OLD_FIRST_REC_ID="oldFirstRecIdx",E.MG_ATTR_CURR_REC_POS_IN_FORM="currRecPosInForm",E.MG_ATTR_REPEATABLE="repeatable",E.MG_ATTR_FIELD="field",E.MG_ATTR_IDX="idx",E.MG_ATTR_URL="url",E.MG_ATTR_DATEMODE="datemode",E.MG_ATTR_THOUSANDS="thousands",E.MG_ATTR_DECIMAL_SEPARATOR="decimalseparator",E.MG_ATTR_DATE="date",E.MG_ATTR_TIME="time",E.MG_ATTR_LANGUAGE="language",E.MG_ATTR_MODAL="modal",E.MG_ATTR_IS_ROUTE="is_route",E.MG_ATTR_TASK="task",E.MG_ATTR_INTERNALEVENT="internalevent",E.MG_ATTR_VARIABLE="variable",E.MG_ATTR_HANDLERID="handlerid",E.MG_ATTR_ROLLBACK_TYPE="rollbackType",E.MG_ATTR_CENTURY="century",E.MG_ATTR_DATATYPE="datatype",E.MG_ATTR_INCLUDE_FIRST="include_first",E.MG_ATTR_INCLUDE_LAST="include_last",E.MG_ATTR_IS_ONEWAY_KEY="isonewaykey",E.MG_ATTR_INSERT_AT="insert_at",E.MG_ATTR_DBVIEWSIZE="dbviewsize",E.MG_ATTR_FRAME_EXP="frameexp",E.MG_ATTR_PICLEN="piclen",E.MG_ATTR_SRCTASK="srctask",E.MG_ATTR_INVALIDATE="invalidate",E.MG_ATTR_RMPOS="rmpos",E.MG_ATTR_DISPLAY="display",E.MG_ATTR_SUBTYPE="subtype",E.MG_ATTR_ADD_AFTER="add_after",E.MG_ATTR_TOP_REC_ID="top_rec_id",E.MG_ATTR_LOW_ID="low_id",E.MG_ATTR_OWNER="owner",E.MG_ATTR_UPD_IN_QUERY="updateInQuery",E.MG_ATTR_UPD_IN_QUERY_LOWER="updateinquery",E.MG_ATTR_CRE_IN_MODIFY="createInModify",E.MG_ATTR_CRE_IN_MODIFY_LOWER="createinmodify",E.MG_ATTR_IDLETIME="idletime",E.MG_ATTR_VER="ver",E.MG_ATTR_SUBVER="subver",E.MG_ATTR_WAIT="wait",E.MG_ATTR_RETAIN_FOCUS="retainFocus",E.MG_ATTR_SYNC_DATA="syncData",E.MG_ATTR_SHOW="show",E.MG_ATTR_COMPONENT="component",E.MG_ATTR_PATH_PARENT_TASK="path_parent_task",E.MG_ATTR_USER="user",E.MG_ATTR_FORCE_EXIT="force_exit",E.MG_ATTR_PUBLIC="public_name",E.MG_ATTR_PRG_DESCRIPTION="prgDescription",E.MG_ATTR_MENU_CONTENTEND="MenusContentEnd",E.MG_ATTR_OBJECT_TYPE="object_type",E.MG_ATTR_TABLE_NAME="table_name",E.MG_ATTR_INDEX_IN_TABLE="index_in_table",E.MG_ATTR_CALLINGTASK="callingtask",E.MG_ATTR_FLAGS="flags",E.MG_ATTR_LNKEXP="link_exp",E.MG_ATTR_MODIFIED="modi",E.MG_ATTR_OPER="oper",E.MG_ATTR_REFRESHON="refreshon",E.MG_ATTR_TASKMODE="taskmode",E.MG_ATTR_EMPTY_DATAVIEW="EmptyDataview",E.MG_ATTR_TASKLEVEL="tasklevel",E.MG_ATTR_TRANS_CLEARED="trans_cleared",E.MG_ATTR_TRANS_STAT="trans_stat",E.MG_ATTR_SUBFORM_VISIBLE="visible",E.MG_ATTR_ACK="ack",E.MG_ATTR_COMPUTE_BY="compute_by",E.MG_ATTR_CHUNK_SIZE="chunk_size",E.MG_ATTR_CHUNK_SIZE_EXPRESSION="chunk_size_expression",E.MG_ATTR_HAS_MAIN_TBL="has_main_tbl",E.MG_ATTR_SERVER_ID="serverid",E.MG_ATTR_SUBFORM_CTRL="subformCtrl",E.MG_ATTR_CHECK_BY_SERVER="checkByServer",E.MG_ATTR_OPER_IDX="operidx",E.MG_ATTR_EXP_IDX="expidx",E.MG_ATTR_EXP_TYPE="exptype",E.MG_ATTR_NULL="null",E.MG_ATTR_NULLS="nulls",E.MG_ATTR_DC_REFS="dc_refs",E.MG_ATTR_LINKED="linked",E.MG_ATTR_DISP="disp",E.MG_ATTR_REMOVE="remove",E.MG_ATTR_DVPOS="dvpos",E.MG_ATTR_SIGNIFICANT_NUM_SIZE="significant_num_size",E.MG_ATTR_DEBUG_MODE="debug",E.MG_ATTR_POINT_TRANSLATION="changePoint",E.MG_ATTR_SPECIAL_EXITCTRL="specialExitCtrl",E.MG_ATTR_DEFAULT_COLOR="defaultColor",E.MG_ATTR_DEFAULT_FOCUS_COLOR="defaultFocusColor",E.MG_ATTR_DEFAULT_DISABLED_COLOR="defaultDisabledColor",E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT="ContextInactivityTimeout",E.MG_ATTR_CLIENT_CONTEXT_INACTIVITY_TIMEOUT="ClientContextInactivityTimeout",E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT_LOWER="contextinactivitytimeout",E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME="ContextInactivityWarningTime",E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME_LOWER="contextinactivitywarningtime",E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT="ContextUnloadTimeout",E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT_LOWER="contextunloadtimeout",E.MG_ATTR_TOOLTIP_TIMEOUT="TooltipTimeout",E.MG_ATTR_WEBCLIENT_REINIT_SESSION="WebClientReInitSession",E.MG_ATTR_LOWHIGH="lowhigh",E.MG_ATTR_ACCESS_TEST="AccessTest",E.MG_ATTR_SPECIAL_TEXT_SIZE_FACTORING="SpecialTextSizeFactoring",E.MG_ATTR_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME="SpecialFlatEditOnClassicTheme",E.MG_ATTR_SPECIAL_LEGACY_TRIM_RANGE="SpecialLegacyTrimRange",E.MG_ATTR_SPECIAL_LEGACY_EMPTY_RANGE="SpecialFirstRangeOnEmptyField",E.MG_ATTR_ENCODING="encoding",E.MG_ATTR_SYSTEM="system",E.MG_ATTR_RECOVERY="recovery",E.MG_ATTR_REVERSIBLE="reversible",E.MG_ATTR_NEWID="newid",E.MG_ATTR_MPRG_SOURCE="mprg_source",E.MG_ATTR_INVOKER_ID="invokerid",E.MG_ATTR_TRANS_LEVEL="level",E.MG_ATTR_TOP="top",E.MG_ATTR_LEFT="left",E.MG_ATTR_HEIGHT="height",E.MG_ATTR_WIDTH="width",E.MG_ATTR_LEN="len",E.MG_ATTR_SCAN="scan",E.MG_ATTR_STANDALONE="standalone",E.MG_ATTR_DESC="desc",E.MG_ATTR_CLOSE_SUBFORM_ONLY="closeSubformOnly",E.MG_ATTR_CHECK_ONLY="checkOnly",E.MG_ATTR_EXEC_ON_SERVER="execOnServer",E.MG_ATTR_EXEC_ON_CLIENT="execOnClient",E.MG_ATTR_USER_SORT="userSort",E.MG_TAG_USERNAME="userName",E.MG_TAG_IS_LOGGED_IN="isLoggedIn",E.MG_TAG_PASSWORD="password",E.MG_ATTR_USERID="userId",E.MG_ATTR_USERINFO="userInfo",E.MG_ATTR_CPY_GLB_PRMS="copy_global_params",E.MG_TAG_GLOBALPARAMS="globalparams",E.MG_TAG_GLOBALPARAMSCHANGES="globalParamChanges",E.MG_TAG_GLOBALPARAMSCHANGES_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_TAG_GLOBALPARAMSCHANGES+r.XMLConstants.TAG_CLOSE,E.MG_TAG_GLOBALPARAMSCHANGES_END_TAGGED=r.XMLConstants.END_TAG+E.MG_TAG_GLOBALPARAMSCHANGES+r.XMLConstants.TAG_CLOSE,E.MG_TAG_PARAM="param",E.MG_TAG_PARAM_TAGGED=r.XMLConstants.TAG_OPEN+E.MG_TAG_PARAM+r.XMLConstants.TAG_CLOSE,E.MG_TAG_PARAM_END_TAGGED=r.XMLConstants.END_TAG+E.MG_TAG_PARAM+r.XMLConstants.TAG_CLOSE,E.MG_ATTR_IME_AUTO_OFF="imeAutoOff",E.MG_ATTR_LOCAL_AS400SET="local_as400set",E.MG_ATTR_LOCAL_EXTRA_GENGO="local_extraGengo",E.MG_ATTR_LOCAL_FLAGS="local_flags",E.MG_ATTR_SPEACIAL_ANSI_EXP="SpecialAnsiExpression",E.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES="SpecialShowStatusBarPanes",E.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION="SpecialRouteToRootProgramOnContextRecreation",E.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN="SpecialEditLeftAlign",E.MG_ATTR_SPECIAL_IGNORE_BUTTON_FORMAT="SpecialIgnoreButtonFormat",E.MG_ATTR_SPEACIAL_SWF_CONTROL_NAME="SpecialSwfControlNameProperty",E.MG_ATTR_FRAMESET_STYLE="frameSetStyle",E.MG_ATTR_SPECIAL_VAL_NEW_POLICY="SpecialValNewPolicy",E.MG_ATTR_OPER_CALLMODE="operCallMode",E.MG_ATTR_TASK_FLOW_DIRECTION="taskFlowDir",E.MG_ATTR_TASK_MAINLEVEL="mainlevel",E.MG_ATTR_OPER_METHODNAME="method_name",E.MG_ATTR_OPER_ASMURL="asm_url",E.MG_ATTR_OPER_ASMFILE="asm_file",E.MG_ATTR_OPER_ASMNAME="asm_name",E.MG_ATTR_OPER_ASMCONTENT="asm_content",E.MG_ATTR_GUID="GUID",E.MG_ATTR_CONTROLS_PERSISTENCY_PATH="ControlsPersistencyPath",E.MG_ATTR_PROJDIR="projdir",E.MG_ATTR_TERMINAL="terminal",E.MG_TAG_ENV_PARAM_URL="envparamurl",E.MG_TAG_ENV_PARAM="environment",E.MG_ATTR_CLOSE_TASKS_ON_PARENT_ACTIVATE="closeTasksOnParentActivate",E.MG_ATTR_HANDLER_ONFORM="HandlerOnForm",E.MG_ATTR_DROP_USERFORMATS="dropuserformats",E.MG_ATTR_CACHED_FILES="cachedFiles",E.MG_ATTR_CONTROL_NAME="ControlName",E.MG_TAG_HIDDEN_CONTOLS="HiddenControls",E.MG_ATTR_ISNS="Isns",E.MG_ATTR_SPECIAL_CANCEL_ON_CREATE="SpecialCancelOnCreate",E.MG_ATTR_TEMP_DATABASE="tempdatabase",E.MG_ATTR_TIME_SEPARATOR="timeseparator",E.MG_ATTR_IOTIMING="iotiming",E.MG_ATTR_HTTP_TIMEOUT="httptimeout",E.MG_ATTR_USE_SIGNED_BROWSER_CLIENT="usesignedbrowserclient",E.MG_ATTR_CLOSE_PRINTED_TABLES_IN_SUBTASKS="closeprintedtablesinsubtasks",E.MG_ATTR_GENERIC_TEXT_PRINTING="generictextprinting",E.MG_ATTR_HIGH_RESOLUTION_PRINT="highresolutionprint",E.MG_ATTR_MERGE_TRIM="mergetrim",E.MG_ATTR_ORIGINAL_IMAGE_LOAD="originalimageload",E.MG_ATTR_PRINT_DATA_TRIM="printdatatrim",E.MG_ATTR_PSCRIPT_PRINT_NT="pscriptprintnt",E.MG_ATTR_THOUSAND_SEPARATOR="thousandseparator",E.MG_ATTR_RTF_BUFFER_SIZE="rtfbuffersize",E.MG_ATTR_SPECIAL_CONV_ADD_SLASH="specialconvaddslash",E.MG_ATTR_SPECIAL_FULL_EXPAND_PRINT="specialfullexpandprint",E.MG_ATTR_SPECIAL_FULL_TEXT="specialfulltext",E.MG_ATTR_SPECIAL_LAST_LINE_PRINT="speciallastlineprint",E.MG_ATTR_SPECIAL_PRINTER_OEM="specialprinteroem",E.MG_ATTR_RANGE_POP_TIME="rangepoptime",E.MG_ATTR_TEMP_POP_TIME="temppoptime",E.MG_ATTR_EMBED_FONTS="embedfonts",E.MG_ATTR_BATCH_PAINT_TIME="batchpainttime",E.MG_ATTR_ISAM_TRANSACTION="isamtransaction",E.MG_ATTR_CENTER_SCREEN_IN_ONLINE="centerscreeninonline",E.MG_ATTR_REPOSITION_AFTER_MODIFY="repositionaftermodify",E.MG_ATTR_OVERLAY="overlayid",E.MG_ATTR_TASKFLW="taskflw",E.MG_ATTR_DATAVIEW="dataview",E.MG_ATTR_RECOMP="recomp",E.MG_ATTR_FLWOP="flwop",E.MG_ATTR_START="start",E.MG_ATTR_END="end",E.MG_ATTR_INFO="info",E.MG_ATTR_KEY="key",E.MG_ATTR_KEY_EXP="key_exp",E.MG_ATTR_NULL_FLAGS="nullFlags",E.MG_ATTR_NEXTOPERIDX="nextOperIdx",E.MG_ATTR_DVPOS_VALUE="dvPosValue",E.MG_ATTR_DVPOS_DEC="DvPosDec",E.MG_ATTR_TRANS_ID="transId",E.MG_ATTR_REALREFRESH="realRefresh",E.MG_ATTR_SUB_FORM_RCMP="sub_form_recomp",E.MG_ATTR_HAS_LINK_RECOMPUTES="has_link_recomputes",E.MG_ATTR_LOCATE_FIRST_ID="locateFirstRec",E.MG_ATTR_OFFSET="offset",E.MG_ATTR_HAS_LOCATE="hasLocate",E.MG_ATTR_AS_PARENT="AsParent",E.MG_ATTR_TASK_UNIQUE_SORT="TaskUniqueSort",E.MG_ATTR_TRANS_OWNER="newTransOwner",E.MG_ATTR_CLOSE="close",E.MG_ATTR_TASK_COUNTER="task_counter",E.MG_ATTR_LOOP_COUNTER="loop_counter",E.MG_ATTR_CHACHED_FLD_ID="cachedFldId",E.MG_ATTR_LOCATE="locate",E.MG_ATTR_LINK="link",E.MG_ATTR_IS_LINK_FIELD="isLinkFld",E.MG_ATTR_CACHED_TABLE="cached_table",E.MG_ATTR_TABLE_INDEX="tableIndex",E.MG_ATTR_LINK_EVAL_CONDITION="evalCondition",E.MG_ATTR_LINK_MODE="linkmode",E.MG_ATTR_LINK_START="linkBeginAfterField",E.MG_ATTR_IDENT="tid",E.MG_ATTR_DIR="dir",E.MG_ATTR_COND="cndExp",E.MG_ATTR_COND_RES="tskCndRes",E.MG_ATTR_RET_VAL="retVal",E.MG_ATTR_DBPOS="db_pos",E.MG_TAG_USR_DEF_FUC_RET_EXP_ID="returnexp",E.MG_TAG_USR_DEF_FUC_RET_EXP_ATTR="returnexpattr",E.MG_TAG_PROPERTIES="properties",E.MG_TAG_PROPERTY="property",E.MG_ATTR_IS_VECTOR="is_vector",E.MG_ATTR_DIRECTION="direction",E.MG_ATTR_KEEP_USER_SORT="keepUserSort",E.MG_ATTR_SEARCH_STR="searchStr",E.MG_ATTR_RESET_SEARCH="resetSearch",E.MG_TAG_DBHS="DBHS",E.MG_TAG_DBHS_END="/DBHS",E.MG_TAG_DBH_DATA_IDS_URL="dbhDataIdsUrl",E.MG_TAG_DBH_DATA_ID="dbhDataId",E.MG_TAG_DBH="DBH",E.MG_TAG_DBH_END="/DBH",E.MG_TAG_FLDS="FLDS",E.MG_TAG_FLDS_END="/FLDS",E.MG_TAG_FLD="FLD",E.MG_TAG_KEYS="KEYS",E.MG_TAG_KEYS_END="/KEYS",E.MG_TAG_KEY="KEY",E.MG_TAG_KEY_END="/KEY",E.MG_TAG_SEGS="SEGS",E.MG_TAG_SEGS_END="/SEGS",E.MG_TAG_SEG="SEG",E.MG_ATTR_ISN="isn",E.MG_ATTR_ATTR="Attr",E.MG_ATTR_ALLOW_NULL="AllowNull",E.MG_ATTR_DEFAULT_NULL="DefaultNull",E.MG_ATTR_STORAGE="Storage",E.MG_ATTR_DATASOURCE_DEFINITION="DataSourceDefinition",E.MG_ATTR_DIFF_UPDATE="DiffUpdate",E.MG_ATTR_DEC="Dec",E.MG_ATTR_WHOLE="Whole",E.MG_ATTR_PART_OF_DATETIME="PartOfDateTime",E.MG_ATTR_DEFAULT_STORAGE="DefaultStorage",E.MG_ATTR_CONTENT="Content",E.MG_ATTR_PICTURE="Picture",E.MG_ATTR_DB_DEFAULT_VALUE="DbDefaultValue",E.MG_ATTR_FLD_DB_INFO="DbInfo",E.MG_ATTR_DB_NAME="DbName",E.MG_ATTR_DB_TYPE="DbType",E.MG_ATTR_USER_TYPE="UserType",E.MG_ATTR_NULL_DISPLAY="NullDisplay",E.MG_ATTR_FIELD_NAME="Name",E.MG_ATTR_FLD_ISN="fld_isn",E.MG_TAG_KEY_SEGMENTS="KeySegs",E.MG_TAG_SEGMENT="segment",E.MG_ATTR_KEY_DB_NAME="KeyDBName",E.MG_ATTR_NAME="name",E.MG_ATTR_DBASE_NAME="dbase_name",E.MG_ATTR_POSITION_ISN="position_isn",E.MG_ATTR_ARRAY_SIZE="array_size",E.MG_ATTR_ROW_IDENTIFIER="row_identifier",E.MG_ATTR_CHECK_EXIST="check_exist",E.MG_ATTR_DEL_UPD_MODE="del_upd_mode",E.MG_ATTR_DBH_DATA_URL="dbhDataURL",E.MG_ATTR_FIELD_INDEX="fieldindex",E.MG_ATTR_MIN_VALUE="min",E.MG_ATTR_MAX_VALUE="max",E.MG_ATTR_NULL_MIN_VALUE="null_min",E.MG_ATTR_NULL_MAX_VALUE="null_max",E.MG_ATTR_TASK_TABLE_NAME_EXP="tableNameExp",E.MG_ATTR_TASK_TABLE_ACCESS="access",E.MG_ATTR_TASK_TABLE_IDENTIFIER="dataSourceIdentifier",E.MG_TAG_DATABASES_HEADER="Databases",E.MG_TAG_DATABASES_END="/Databases",E.MG_TAG_DATABASE_INFO="database",E.MG_TAG_DATABASE_URL="databaseUrl",E.MG_ATTR_DATABASE_NAME="name",E.MG_ATTR_DATABASE_LOCATION="location",E.MG_ATTR_DATABASE_TYPE="dbtype",E.MG_ATTR_DATABASE_USER_PASSWORD="userPassword",E.BYTES_IN_CHAR=2,E.MG_OPER_VERIFY=2,E.MG_OPER_BLOCK=5,E.MG_OPER_LOOP=97,E.MG_OPER_ELSE=98,E.MG_OPER_ENDBLOCK=6,E.MG_OPER_CALL=7,E.MG_OPER_EVALUATE=8,E.MG_OPER_UPDATE=9,E.MG_OPER_USR_EXIT=13,E.MG_OPER_RAISE_EVENT=14,E.MG_OPER_SERVER=99,E.TRANS_BEGIN="B",E.TRANS_COMMIT="C",E.TRANS_ABORT="A",E.FRAME_SET_STYLE_HOR="H",E.FRAME_SET_STYLE_VER="V",E.EVENT_TYPE_SYSTEM="S",E.EVENT_TYPE_INTERNAL="I",E.EVENT_TYPE_TIMER="T",E.EVENT_TYPE_EXPRESSION="E",E.EVENT_TYPE_USER="U",E.EVENT_TYPE_PUBLIC="P",E.EVENT_TYPE_NONE="N",E.EVENT_TYPE_NOTINITED="X",E.EVENT_TYPE_USER_FUNC="F",E.BRK_LEVEL_TASK_PREFIX="TP",E.BRK_LEVEL_TASK_SUFFIX="TS",E.BRK_LEVEL_REC_PREFIX="RP",E.BRK_LEVEL_REC_MAIN="RM",E.BRK_LEVEL_REC_SUFFIX="RS",E.BRK_LEVEL_CTRL_PREFIX="CP",E.BRK_LEVEL_CTRL_SUFFIX="CS",E.BRK_LEVEL_CTRL_VERIFICATION="CV",E.BRK_LEVEL_HANDLER_INTERNAL="HI",E.BRK_LEVEL_HANDLER_SYSTEM="HS",E.BRK_LEVEL_HANDLER_TIMER="HT",E.BRK_LEVEL_HANDLER_EXPRESSION="HE",E.BRK_LEVEL_HANDLER_ERROR="HR",E.BRK_LEVEL_HANDLER_USER="HU",E.BRK_LEVEL_HANDLER_DOTNET="HD",E.BRK_LEVEL_USER_FUNCTION="UF",E.BRK_LEVEL_VARIABLE="VC",E.BRK_LEVEL_MAIN_PROG="MP",E.BRK_LEVEL_SUBFORM="SUBFORM",E.BRK_LEVEL_FRAME="FRAME",E.BRK_LEVEL_TASK_PREFIX_FM="Task Prefix ",E.BRK_LEVEL_TASK_SUFFIX_FM="Task Suffix ",E.BRK_LEVEL_REC_PREFIX_FM="Record Prefix ",E.BRK_LEVEL_REC_SUFFIX_FM="Record Suffix ",E.BRK_LEVEL_CTRL_PREFIX_FM="Control Prefix ",E.BRK_LEVEL_CTRL_SUFFIX_FM="Control Suffix ",E.BRK_LEVEL_VARIABLE_FM="Variable Change ",E.BRK_LEVEL_CTRL_VERIFICATION_FM="Control Verification ",E.BRK_LEVEL_HANDLER_INTERNAL_FM="Internal: ",E.BRK_LEVEL_HANDLER_SYSTEM_FM="System: ",E.BRK_LEVEL_HANDLER_TIMER_FM="Timer:",E.BRK_LEVEL_HANDLER_EXPRESSION_FM="Expression: ",E.BRK_LEVEL_HANDLER_ERROR_FM="Handler Error ",E.BRK_LEVEL_HANDLER_USER_FM="User",E.BRK_LEVEL_HANDLER_DOTNET_FM="Dotnet: ",E.BRK_LEVEL_USER_FUNCTION_FM="User Defined Function",E.HANDLER_LEVEL_VARIABLE="V",E.TRANS_NONE="O",E.TRANS_RECORD_PREFIX="P",E.TRANS_TASK_PREFIX="T",E.TRANS_IGNORE="I",E.TRANS_FORCE_OPEN="F",E.RECOVERY_NONE="\0",E.RECOVERY_ROLLBACK="R",E.RECOVERY_RETRY="T",E.FLW_VERIFY_MODE_ERROR="E",E.FLW_VERIFY_MODE_WARNING="W",E.IMAGE_EXCLAMATION="E",E.IMAGE_CRITICAL="C",E.IMAGE_QUESTION="Q",E.IMAGE_INFORMATION="I",E.IMAGE_NONE="N",E.BUTTONS_OK="O",E.BUTTONS_OK_CANCEL="K",E.BUTTONS_ABORT_RETRY_IGNORE="A",E.BUTTONS_YES_NO_CANCEL="Y",E.BUTTONS_YES_NO="N",E.BUTTONS_RETRY_CANCEL="R",E.DISPLAY_BOX="B",E.DISPLAY_STATUS="S",E.END_COND_EVAL_BEFORE="B",E.END_COND_EVAL_AFTER="A",E.END_COND_EVAL_IMMIDIATE="I",E.OPENWIN_STATE_NONE="N",E.OPENWIN_STATE_INPROCESS="I",E.OPENWIN_STATE_OVER="O",E.ARG_TYPE_FIELD="F",E.ARG_TYPE_EXP="E",E.ARG_TYPE_VALUE="V",E.ARG_TYPE_SKIP="X",E.TOP_LEVEL_CONTAINER=0,E.MG_HYPER_ARGS="MG_HYPER_ARGS",E.REQ_ARG_ALPHA="-A",E.REQ_ARG_UNICODE="-C",E.REQ_ARG_NUMERIC="-N",E.REQ_ARG_DOUBLE="-D",E.REQ_ARG_LOGICAL="-L",E.REQ_ARG_NULL="-U",E.REQ_ARG_SEPARATOR="&",E.REQ_ARG_START="?",E.REQ_ARG_COMMA=",",E.REQ_APP_NAME="appname",E.REQ_PRG_NAME="prgname",E.REQ_PRG_DESCRIPTION="prgdescription",E.REQ_ARGS="arguments",E.REQ_SKIP_AUTHENTICATION="SkipAuthentication",E.RC_INDICATION_INITIAL="WEBCLIENT=INITIAL&",E.RC_INDICATION_SCRAMBLED="SCRAMBLED&",E.RC_INDICATION="WEBCLIENT=Y&",E.UTF8TRANS="UTF8TRANS=Y&",E.DEBUG_CLIENT_NETWORK_RECOVERY="&DEBUGCLIENTNETWORKRECOVERY=Y",E.RC_TOKEN_CTX_ID="CTX=",E.RC_TOKEN_SESSION_ID="SI=",E.RC_TOKEN_CTX_GROUP="CTXGROUP=",E.RC_TOKEN_SESSION_COUNT="SESSION=",E.RC_TOKEN_DATA="DATA=",E.RC_TOKEN_TARGET_FILE="TARGETFILE=",E.WEBCLIENT_REINITIALIZE_REQUEST="WCREINITIALIZEREQUEST=Y",E.MAIN_PROG_VIEW="MainProgramsDataView",E.GLOBAL_PARAM_LIST="GlobalParamList",E.LAST_EXCEPTION="LastException",E.CTX_REMOVED_FROM_SRVR="CtxRemovedFromSrvr",E.LAST_ROUTE_EVENT="LastRouteEvent",E.LAST_ROUTE_EVENT_ARG_LIST="LastRouteEventArgList",E.LAST_ROUTE_EVENT_SRC_TSK="LastRouteEventSourceTask",E.IS_SESSION_REINITIALIZING="IsSessionReInitializing",E.RC_AUTHENTICATION_REQUEST="RCAUTHENTICATIONREQUEST=Y",E.V24_RIA_ERROR_PREFIX="<RIA_ERROR_RESPONSE>",E.SESSION_COUNTER_CLOSE_CTX_INDICATION=-1,E.SERVER="server",E.REQUESTER="requester",E.LOCALID="localid",E.DEBUGCLIENT="debugclient",E.ENVVARS="envvars",E.INTERNAL_LOG_LEVEL="InternalLogLevel",E.INTERNAL_LOG_SYNC="InternalLogSync",E.LOG_CLIENTSEQUENCE_FOR_ACTIVITY_MONITOR="LogClientSequenceForActivityMonitor",E.CTX_GROUP="CtxGroup",E.PARALLEL_EXECUTION="ParallelExecution",E.DISPLAY_GENERIC_ERROR="DisplayGenericError",E.FIRST_HTTP_REQUEST_TIMEOUT="FirstHTTPRequestTimeout",E.MG_TAG_CHNG_PASS_CAPTION="LogonChangePasswordCaption",E.MG_TAG_CHNG_PASS_WIN_TITLE="ChangePasswordWindowTitle",E.MG_TAG_CHNG_PASS_OLD_PASS_CAPTION="ChangePasswordOldPasswordCaption",E.MG_TAG_CHNG_PASS_NEW_PASS_CAPTION="ChangePasswordNewPasswordCaption",E.MG_TAG_CHNG_PASS_CONFIRM_PASS_CAPTION="ChangePasswordConfirmPasswordCaption",E.MG_TAG_CHNG_PASS_MISMATCH_MSG="ChangePasswordMismatchMessage",E.DEPLOYMENT_MANIFEST="APPLICATION",E.PUBLISH_HTML="publish.html",E.PROPS_START_TAG="<properties>",E.PROPS_END_TAG="</properties>",E.APPL_LOGON_SUB_CAPTION="Logon Parameters",E.DEFAULT_ERROR_LOGON_FAILED="Error during authentication process",E.DEFAULT_ERROR_WRONG_PASSWORD="Incorrect password",E.ERROR_STRING="Error",E.INFORMATION_STRING="Information",E.DEFAULT_MSG_PASSWORD_CHANGE="Password was changed successfully",E.PASSWORD_MISMATCH="New password and confirm password not same",E.ROW_CONTROLS_KEY="ROW_CONTROLS_KEY",E.ROW_INVALIDATED_KEY="ROW_INVALIDATED_KEY",E.IS_EDITOR_KEY="IS_EDITOR_KEY",E.TMP_EDITOR="TMP_EDITOR",E.LAST_FOCUSED_WIDGET="LAST_FOCUSED_WIDGET",E.LAST_CURSOR="LAST_CURSOR",E.KEYDOWN_IGNORE_KEY="KEYDOWN_IGNORE_key",E.STATUS_BAR_WIDGET_KEY="STATUS_BAR_WIDGET_KEY",E.MGBROWSER_KEY="MGBROWSER_Key",E.POPUP_WAS_OPENED="COMBO_BOX_WAS_OPENED",E.POPUP_WAS_CLOSED_COUNT="COMBO_BOX_WAS_CLOSED_COUNT",E.IGNORE_SELECTION_KEY="IGNORE_SELECTION_KEY",E.CP_ISO_8859_ANSI="8859_1",E.CP_UNICODE="UTF-16LE",E.INCREMENTAL_LOCATE_TIMEOUT=500,E.USER_RANGES="ranges",E.USER_LOCATES="locates",E.SORT="srt",E.MIN_RNG="min",E.MAX_RNG="max",E.NULL_MIN_RNG="isNullMin",E.NULL_MAX_RNG="isNullMax",E.CLEAR_RANGE="rangeReset",E.CLEAR_LOCATES="locateReset",E.CLEAR_SORTS="sortReset",E.USER_RNG="rng",E.TASK_MODE_QUERY_STR="Query",E.TASK_MODE_MODIFY_STR="Modify",E.TASK_MODE_CREATE_STR="Create",E.TASK_MODE_DELETE_STR="Delete",E.MG_ZOOM="ZOOM",E.MG_NORMAL="NORMAL",E.MG_INSERT="INS",E.MG_OVERWRITE="OVR",E.MG_TAG_ENV_CHANGES="changes",E.MG_ATTR_ENV_VALUE="value",E.MG_ATTR_ENV_WRITEINI="writeToINI",E.MG_ATTR_ENV_RESERVED="reserved",E.MG_ATTR_ENV_REMOVED="removed",E.INI_SECTION_MAGIC_ENV_BRACKETS="[MAGIC_ENV]",E.INI_SECTION_LOGICAL_NAMES_BRACKETS="[MAGIC_LOGICAL_NAMES]",E.INI_SECTION_MAGIC_ENV="MAGIC_ENV",E.INI_SECTION_MAGIC_SYSTEMS="MAGIC_SYSTEMS",E.INI_SECTION_MAGIC_DBMS="MAGIC_DBMS",E.INI_SECTION_MAGIC_SERVERS="MAGIC_SERVERS",E.INI_SECTION_MAGIC_COMMS="MAGIC_COMMS",E.INI_SECTION_MAGIC_PRINTERS="MAGIC_PRINTERS",E.INI_SECTION_MAGIC_SYSTEM_MENU="MAGIC_SYSTEM_MENU",E.INI_SECTION_MAGIC_DATABASES="MAGIC_DATABASES",E.INI_SECTION_MAGIC_LANGUAGE="MAGIC_LANGUAGE",E.INI_SECTION_MAGIC_SERVICES="MAGIC_SERVICES",E.INI_SECTION_TOOLS_MENU="TOOLS_MENU",E.MENU_PROGRAM_FLOW_ONLINE="O",E.MENU_PROGRAM_FLOW_BATCH="B",E.MENU_PROGRAM_FLOW_BROWSER="R",E.MENU_PROGRAM_FLOW_RC="C",E.SB_IMG_PANE_LAYER=1,E.SB_IMG_PANE_WIDTH=33,E.GUI_COMMAND_EXEC_WAIT_TIME=100,E.STARTUP_IMAGE_FILENAME="Resources\\startup.png",E.V2L_DLL="v2l32.dll",E.SQLITE_DLL_NAME="MgRIASqliteGateway.dll",E.INITIAL_OFFLINE_TASK_TAG=1e9,E.ENABLE_COMMUNICATION_DIALOGS="EnableCommunicationDialogs",E.MG_ATTR_VAL_ABORT="abort",E.MG_ATTR_VAL_ENHANCED_VERIFY="enhancedverify",E.MG_ATTR_VAL_OPENURL="openurl",E.MG_ATTR_VAL_RESULT="result",E.MG_ATTR_VAL_VERIFY="verify",E.MG_ATTR_VAL_ADD_RANGE="addrange",E.MG_ATTR_VAL_ADD_LOCATE="addlocate",E.MG_ATTR_VAL_ADD_SORT="addsort",E.MG_ATTR_VAL_RESET_RANGE="resetrange",E.MG_ATTR_VAL_RESET_LOCATE="resetlocate",E.MG_ATTR_VAL_RESET_SORT="resetsort",E.MG_ATTR_VAL_CLIENT_REFRESH="clientrefresh",E.MG_ATTR_VAL_EVAL="evaluate",E.MG_ATTR_VAL_EVENT="event",E.MG_ATTR_VAL_EXEC_OPER="execoper",E.MG_ATTR_VAL_EXPAND="expand",E.MG_ATTR_VAL_MENU="execmenu",E.MG_ATTR_VAL_QUERY="query",E.MG_ATTR_VAL_QUERY_GLOBAL_PARAMS="globalparams",E.MG_ATTR_VAL_QUERY_TYPE="query_type",E.MG_ATTR_VAL_RECOMP="recompute",E.MG_ATTR_VAL_TRANS="trans",E.MG_ATTR_VAL_UNLOAD="unload",E.MG_ATTR_VAL_INIPUT_FORCE_WRITE="iniputForceWrite",E.MG_ATTR_VAL_INIPUT_PARAM="iniputParam",E.MG_ATTR_ERROR_MESSAGE="errorMessage",E.MG_ATTR_VAL_TOTAL_RECORDS_COUNT="totalRecordsCount",E.MG_ATTR_VAL_RECORDS_BEFORE_CURRENT_VIEW="recordsBeforeCurrentView",E.MG_ATTR_VAL_SERVER_TRANS_CACHE_EMPTY="serverTransCacheEmpty",E.MG_ATTR_SPECIAL_ANSI_BLOB_CHECK_NULL="SpecialAnsiBlobCheckNull",E.MG_ATTR_SPECIAL_TABLE_REDUCE_TITLE_HEIGHT="SpecialTableReduceTitleHeight",E.MG_ATTR_SPECIAL_DOTNET_ALLOW_ZERO_DATE="SpecialDotNetAllowZeroDate",E.MG_ATTR_SPECIAL_REUSE_TABLE_EDITOR="SpecialReuseTableEditor",E.MG_TAG_LAST_ROUTE="LastRoute";var I,f=function(){function e(){}return Object.defineProperty(e.prototype,"ShouldSerialize",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ShouldSerializeRecords",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.SerializeCommandData=function(e){return null},e.prototype.SerializeDataAfterCommand=function(){return null},e}(),C=function(e){function t(){return e.call(this)||this}return u(t,e),Object.defineProperty(t.prototype,"Task",{get:function(){return o.mgDataTable.getCurrMGData().getTask(this.TaskTag)},enumerable:!1,configurable:!0}),t}(f),A=function(){function e(){this.message=new t.StringBuilder}return e.prototype.GetString=function(){return this.message.ToString()},e.prototype.SerializeTaskTag=function(e){var t=o.mgDataTable.getTaskIdById(e);this.SerializeAttribute(r.XMLConstants.MG_ATTR_TASKID,t)},e.prototype.SerializeFldId=function(e){this.SerializeAttribute(E.MG_ATTR_FIELDID,e)},e.prototype.SerializeDitIdx=function(e){e>t.Int32.MinValue&&this.SerializeAttribute(r.XMLConstants.MG_ATTR_DITIDX,e)},e.prototype.SerializeRouteParams=function(e){for(var t=e.getRouteParams(),a="",s=0;s<t.length;s++)a=a.concat(n.RecordUtils.serializeItemVal(t[s],r.StorageAttribute.UNICODE,r.StorageAttribute.SKIP,!0));this.SerializeAttribute(E.MG_ATTR_ROUTE_PARAMS,a)},e.prototype.SerializeRefreshMode=function(e){e!==r.ViewRefreshMode.None&&this.SerializeAttribute(E.MG_ATTR_REALREFRESH,e)},e.prototype.SerializeMagicEvent=function(e){this.SerializeAttribute(E.MG_ATTR_MAGICEVENT,e)},e.prototype.SerializeCloseSubformOnly=function(e){e&&this.SerializeAttribute(E.MG_ATTR_CLOSE_SUBFORM_ONLY,"1")},e.prototype.SerializeKeyIndex=function(e){this.SerializeAttribute(E.MG_ATTR_KEY,e)},e.prototype.SerializeAttribute=function(e,t){2!==arguments.length||null!==e&&e.constructor!==String||null!==t&&t.constructor!==String?2!==arguments.length||null!==e&&e.constructor!==String||null!==t&&t.constructor!==Number?this.SerializeAttribute_2(e,t):this.SerializeAttribute_1(e,t):this.SerializeAttribute_0(e,t)},e.prototype.SerializeAttribute_0=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e.prototype.SerializeAttribute_1=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e.prototype.SerializeAttribute_2=function(e,t){this.message.Append(" "+e+'="'+t+'"')},e}(),R=function(e){function r(t){var r=e.call(this)||this;return r.TaskTag=null,r.MagicEvent=0,r.ClientRecId=0,r.MagicEvent=t,r}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EVENT},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"EventDescription",{get:function(){return k.getInternalEvtDescription(this.MagicEvent)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"Task",{get:function(){return o.mgDataTable.getCurrMGData().getTask(this.TaskTag)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ShouldSerialize",{get:function(){return!(null!==this.TaskTag&&null!==o.mgDataTable.GetTaskByID(this.TaskTag)&&!o.mgDataTable.GetTaskByID(this.TaskTag).KnownToServer)},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]",this.EventDescription,this.Task.getTaskInfo())},r}(C);e.RollbackEventCommand_RollbackType=void 0,(I=e.RollbackEventCommand_RollbackType||(e.RollbackEventCommand_RollbackType={})).NONE=" ",I.CANCEL="C",I.ROLLBACK="R";var S=function(n){function a(){var t=n.call(this,r.InternalInterface.MG_ACT_ROLLBACK)||this;return t.Rollback=e.RollbackEventCommand_RollbackType.NONE,t}return u(a,n),a.prototype.SerializeCommandData=function(t){var r=new A;return r.SerializeTaskTag(this.TaskTag),r.SerializeMagicEvent(this.MagicEvent),this.Rollback!==e.RollbackEventCommand_RollbackType.NONE&&r.SerializeAttribute(E.MG_ATTR_ROLLBACK_TYPE,this.Rollback),r.GetString()},a.prototype.getRollbackTypeString=function(){switch(this.Rollback){case e.RollbackEventCommand_RollbackType.CANCEL:return"Cancel";case e.RollbackEventCommand_RollbackType.ROLLBACK:return"Rollback"}},a.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,t.NString.IsNullOrEmpty(this.getRollbackTypeString())?t.NString.Empty:t.NString.Format(" while handling {0}",this.getRollbackTypeString()),this.Task.getTaskInfo())},a}(R),M=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.IsEventHandlerField=!1,t}return u(t,e),t}(n.GuiFieldBase);M.CLEAR_FLAGS=!0;var m,v=function(){function e(e){this._exp=null,this._fld=null,this._skip=!1,this._type="\0",this._val=null,this._valueAttr=r.StorageAttribute.NONE,this._valueIsNull=!1,0!==arguments.length?1===arguments.length&&(null===e||e instanceof M)?this.constructor_1(e):1===arguments.length&&(null===e||e instanceof n.ExpVal)?this.constructor_2(e):this.constructor_3(e):this.constructor_0()}return e.prototype.constructor_0=function(){this._type="\0",this._fld=null,this._exp=null,this._skip=!1},e.prototype.constructor_1=function(e){this._fld=e,this._type=E.ARG_TYPE_FIELD,this._exp=null,this._skip=!1},e.prototype.constructor_2=function(e){this._type=E.ARG_TYPE_VALUE,this._fld=null,this._exp=null,this._skip=!1,e.IsNull?this._val=null:this._val=e.ToMgVal(),this._valueIsNull=null===this._val,this._valueAttr=e.Attr},e.prototype.constructor_3=function(e){switch(this._type=E.ARG_TYPE_VALUE,e._type){case E.ARG_TYPE_FIELD:this._valueAttr=e._fld.getType();break;case E.ARG_TYPE_EXP:break;case E.ARG_TYPE_SKIP:this._skip=!0;break;default:throw new t.ApplicationException("in Argument.Argument(): illegal source Argument type!")}},e.prototype.Initialize=function(t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:switch(t._type){case E.ARG_TYPE_FIELD:return[3,1];case E.ARG_TYPE_EXP:return[3,2]}return[3,4];case 1:return this._val=t._fld.getValue(!0),this._valueIsNull=t._fld.isNull(),[3,4];case 2:return[4,t._exp.evaluateWithResLength(255)];case 3:return n=a.sent(),this._val=n.mgVal,this._valueAttr=n.type,this._valueIsNull=null==this._val,this._valueIsNull&&(this._val=e.getEmptyValue(n.type===r.StorageAttribute.BLOB||n.type===r.StorageAttribute.BLOB_VECTOR)),[3,4];case 4:return[2]}}))}))},e.prototype.fillData=function(e,n){this._type=e[0];var a=e.substr(2);switch(this._type){case E.ARG_TYPE_FIELD:var s=a.split(","),i=t.NNumber.Parse(s[0]),o=t.NNumber.Parse(s[1]);this._fld=n.getFieldDef(i,o);break;case E.ARG_TYPE_EXP:var l=t.NNumber.Parse(a);this._exp=n.getExpById(l);break;case E.ARG_TYPE_SKIP:this._skip=!0;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Argument.FillData() illegal type: "+e)}},e.prototype.buildXML=function(e){switch(this._type){case E.ARG_TYPE_FIELD:e.Append("F:"+this._fld.getTask().getTaskTag()+","+this._fld.getId());break;case E.ARG_TYPE_EXP:e.Append("E:"+this._exp.getId());break;case E.ARG_TYPE_SKIP:e.Append("X:0");break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Argument.buildXML() illegal type: "+this._type)}},e.prototype.getType=function(){return this._type},e.prototype.getField=function(){return this._type===E.ARG_TYPE_FIELD?this._fld:null},e.prototype.getExp=function(){return this._type===E.ARG_TYPE_EXP?this._exp:null},e.prototype.setValueToField=function(t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:switch(this._type){case E.ARG_TYPE_FIELD:return[3,1];case E.ARG_TYPE_EXP:return[3,2];case E.ARG_TYPE_VALUE:return[3,4]}return[3,5];case 1:return n=this._fld.getValue(!0),n=e.convertArgs(n,this._fld.getType(),t.getType()),a=this._fld.isNull()||null==n,[3,6];case 2:return[4,this._exp.evaluateWithResultTypeAndLength(t.getType(),t.getSize())];case 3:return n=s.sent(),(a=null==n)&&(n=e.getEmptyValue(t.getType()===r.StorageAttribute.BLOB||t.getType()===r.StorageAttribute.BLOB_VECTOR)),[3,6];case 4:return n=e.convertArgs(this._val,this._valueAttr,t.getType()),a=this._valueIsNull||null==n,[3,6];case 5:return[2];case 6:return t.takeValFromRec(),[4,t.setValueAndStartRecompute(n,a,t.getTask().DataViewWasRetrieved,!1,!0)];case 7:return s.sent(),[2]}}))}))},e.convertArgs=function(e,t,a){var s=!1;switch(a){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:t===r.StorageAttribute.BLOB?n.BlobType.isValidBlob(e)&&(e=n.BlobType.getString(e)):r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t)||(s=!0);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:r.StorageAttributeCheck.isTypeNumeric(t)||(s=!0);break;case r.StorageAttribute.BLOB:if(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(t)){var i=t===r.StorageAttribute.ALPHA?n.BlobType.CONTENT_TYPE_ANSI:n.BlobType.CONTENT_TYPE_UNICODE;e=n.BlobType.createFromString(e,i)}else r.StorageAttributeCheck.isTypeBlob(t)||(s=!0)}return s&&(e=n.FieldDef.getMagicDefaultValue(a)),e},e.prototype.getValue=function(t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:switch(this._type){case E.ARG_TYPE_EXP:return[3,1];case E.ARG_TYPE_FIELD:return[3,3];case E.ARG_TYPE_VALUE:return[3,4]}return[3,5];case 1:return a=this,[4,this._exp.evaluateWithResultTypeAndLength(t,n)];case 2:return a._val=s.sent(),null==this._val&&(this._val=e.getEmptyValue(t===r.StorageAttribute.BLOB||t===r.StorageAttribute.BLOB_VECTOR)),[3,6];case 3:return this._val=this._fld.getValue(!0),[3,6];case 4:return[3,6];case 5:return[2,null];case 6:return[2,this._val]}}))}))},e.prototype.skipArg=function(){return this._skip},e.prototype.fillDataByParams=function(e,t,n){this._valueAttr=e,this._val=t,this._valueIsNull=n,this._valueAttr===r.StorageAttribute.SKIP?(this._type=E.ARG_TYPE_SKIP,this._skip=!0):this._type=E.ARG_TYPE_VALUE},e.getEmptyValue=function(e){return e?n.BlobType.getEmptyBlobPrefix("\0")+";":""},e.prototype.FillFromString=function(e){this._type=E.ARG_TYPE_VALUE;var t=null;switch(e.length>2&&(t=e.substr(0,2)),t){case E.REQ_ARG_ALPHA:this._valueAttr=r.StorageAttribute.ALPHA;break;case E.REQ_ARG_UNICODE:this._valueAttr=r.StorageAttribute.UNICODE;break;case E.REQ_ARG_NUMERIC:case E.REQ_ARG_DOUBLE:this._valueAttr=r.StorageAttribute.NUMERIC;break;case E.REQ_ARG_LOGICAL:this._valueAttr=r.StorageAttribute.BOOLEAN;break;case E.REQ_ARG_NULL:this._valueAttr=r.StorageAttribute.NONE;break;default:return this._valueAttr=r.StorageAttribute.ALPHA,void(this._val=e)}this._val=e.substr(2)},e.prototype.makeURLPrintable=function(e){return r.StrUtil.searchAndReplace(e,["\\","\0",","],["\\\\","\\0","\\,"])},e}(),L=function(){function e(e){this._list=null,this.RefreshOnString=null,0!==arguments.length?1===arguments.length&&(null===e||e instanceof Array)?this.constructor_2(e):this.constructor_3(e):this.constructor_0()}return e.prototype.constructor_0=function(){},e.prototype.Initialize=function(e){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:return this.constructor_0(),null!==e?[3,1]:(this._list=null,[3,5]);case 1:this._list=new t.List,r=0,a.label=2;case 2:return r<e.getSize()?[4,(n=new v(e.getArg(r))).Initialize(e.getArg(r))]:[3,5];case 3:a.sent(),this._list.push(n),a.label=4;case 4:return r+=1,[3,2];case 5:return[2]}}))}))},e.prototype.constructor_2=function(e){this.constructor_0();var r=e.length;if(0===r)this._list=null;else{this._list=new t.List;for(var n=0;n<r;n+=1)this._list.push(new v(e[n]))}},e.prototype.constructor_3=function(e){this.Add(e)},e.prototype.fillList=function(e,n){var a=r.StrUtil.tokenize(e,"$"),s=a.length;this._list=new t.List;for(var i=0;i<s;i+=1){var o=new v;o.fillData(a[i],n),this._list.push(o)}},e.prototype.buildListFromParams=function(e,r,n,a){this._list=new t.List;for(var s=0;s<e;s+=1){var i=new v;i.fillDataByParams(r.charAt(s),n[s],"0"!==a.charAt(s)),this._list.push(i)}},e.prototype.buildXML=function(e){for(var t=0;t<this._list.length;t+=1)t>0&&e.Append("$"),this._list.get_Item(t).buildXML(e)},e.prototype.getSize=function(){return null===this._list?0:this._list.length},e.prototype.getArg=function(e){return e<0||e>=this._list.length?null:this._list.get_Item(e)},e.prototype.getArgValue=function(e,t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return null===(n=this.getArg(e))?[2,null]:[4,n.getValue(t,r)];case 1:return[2,a.sent()]}}))}))},e.prototype.FillListFromString=function(e){var r=new RegExp("(?<!\\\\),"),n=e.split(r);this._list=new t.List;for(var a=0;a<n.length;a+=1){var s=new v;s.FillFromString(n[a]),this._list.push(s)}},e.prototype.Add=function(e){null===this._list&&(this._list=new t.List),this._list.push(e)},e}();e.Task_SubformExecModeEnum=void 0,(m=e.Task_SubformExecModeEnum||(e.Task_SubformExecModeEnum={}))[m.NO_SUBFORM=-1]="NO_SUBFORM",m[m.SET_FOCUS=0]="SET_FOCUS",m[m.FIRST_TIME=1]="FIRST_TIME",m[m.REFRESH=2]="REFRESH";var b=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.IsTryingToStop=!1,t.DoSubformPrefixSuffix=!1,t.IsAfterRetryBeforeBuildXML=!1,t.TaskSuffixExecuted=!1,t.DataviewManager=null,t.IsOffline=!1,t.ResetRange=!1,t.UserRngs=null,t.ResetLocate=!1,t.UserLocs=null,t.ResetSort=!1,t.UserSorts=null,t._transactionFailed=!1,t.InEndTask=!1,t.InCtrlPrefix=!1,t.RetainFocus=!1,t.SubformExecMode=0,t.TransactionErrorHandlingsRetry=null,t.ClosingFormUI=!1,t.AfterFirstRecordPrefix=!1,t}return u(t,e),t.ShouldNonInteractiveBeModal=function(){return!0},t}(n.GuiTaskBase),N=function(){this.veeIdx=0,this.min=null,this.max=null,this.nullMax=!1,this.nullMin=!1,this.discardMax=!1,this.discardMin=!1},y=function(){function e(e,t){this.CallingTask=null,this.PathParentTask=null,0!==arguments.length?this.constructor_1(e,t):this.constructor_0()}return e.prototype.constructor_0=function(){this.CallingTask=this.PathParentTask=null},e.prototype.constructor_1=function(e,t){this.CallingTask=e,this.PathParentTask=t},e}(),O=function(){function e(){this._tasks=null,this._tasks=new t.List}return e.prototype.fillData=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.initInnerObjects(r.getNextTag(),e,t)];case 1:return n.sent()?[3,0]:[3,2];case 2:return[2]}}))}))},e.prototype.initInnerObjects=function(t,n,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return null!==t?[3,1]:(s=!1,[3,4]);case 1:return t!==r.XMLConstants.MG_TAG_TASK?[3,3]:(i=e.createNewtask(),this._tasks.push(i),[4,i.fillData(n,a)]);case 2:return o.sent(),s=!0,[3,4];case 3:s=!1,o.label=4;case 4:return[2,s]}}))}))},e.prototype.addTask=function(e){this._tasks.push(e)},e.prototype.removeTask=function(e){this._tasks.Remove(e)},e.prototype.getTask=function(e){return 1!==arguments.length||null!=e&&e.constructor!==String?this.getTask_1(e):this.getTask_0(e)},e.prototype.getTask_0=function(e){for(var t=0;t<this._tasks.length;t+=1){var r=this._tasks.get_Item(t);if(e===r.getTaskTag())return r}return null},e.prototype.getTask_1=function(e){return e>=0&&e<this._tasks.length?this._tasks.get_Item(e):null},e.prototype.getSize=function(){return this._tasks.length},e.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:t=0,r.label=1;case 1:return t<this.getSize()?[4,this.getTask(t).buildXML(e)]:[3,4];case 2:r.sent(),r.label=3;case 3:return t+=1,[3,1];case 4:return[2]}}))}))},e.prototype.setTaskAt=function(e,t){this._tasks.length<=t&&this._tasks.SetSize(t+1),this._tasks.set_Item(t,e)},e}();O.createNewtask=null;var G=function(){function e(){this._lastFocusedTasks=null,this.LastActionTime=0}return e.prototype.Init=function(e){this._lastFocusedTasks=new O},e.prototype.getCurrTask=function(){var e=o.eventsManager.getLastRtEvent();return null!==e&&null!==e.getTask()&&null!==e.getTask().GetContextTask()?this.getLastFocusedTask(e.getTask().GetContextTask().getMgdID()):this.getLastFocusedTask()},e.prototype.getLastFocusedTask=function(e){return 0===arguments.length?this._lastFocusedTasks.getTask(o.mgDataTable.currMgdID):this._lastFocusedTasks.getTask(e)},e.prototype.setLastFocusedTask=function(e){var t=this.getLastFocusedTask();if(null!==t&&t!==e)t.getForm();var r=e,n=r.getMgdID();this._lastFocusedTasks.setTaskAt(r,n)},e.prototype.clean=function(t){e.deleteLastFocusedControlAt(t),null!==this._lastFocusedTasks&&this._lastFocusedTasks.setTaskAt(null,t)},e.getLastFocusedControl=function(t){return 1===arguments.length?e.getLastFocusedControl_1(t):e.getLastFocusedControl_0()},e.getLastFocusedControl_0=function(){return e._lastFocusedControls.getCtrl(o.mgDataTable.currMgdID)},e.getLastFocusedControl_1=function(t){return e._lastFocusedControls.getCtrl(t)},e.deleteLastFocusedControlAt=function(t){null!==e._lastFocusedControls&&null!=e._lastFocusedControls.getCtrl(t)&&e._lastFocusedControls.deleteControlAt(t)},e.setLastFocusedControlAt=function(t,r){e._lastFocusedControls.setControlAt(t,r)},e.setLastFocusedControl=function(r,n){var a=r.getMgdID();t.Debug.Assert(null===n||r===n.getForm().getTask()),e.LastFocusMgdID=a,e.setLastFocusedControlAt(n,a),e.Instance.setLastFocusedTask(r)},e}();G.Instance=new G,G._lastFocusedControls=new n.ControlTable,G.LastFocusMgdID=0;var P=function(e){function a(t,r,n){var a=this;return(a=0===arguments.length?e.call(this)||this:3!==arguments.length||null!==t&&t.constructor!==Number||!(null===r||r instanceof b)||null!==n&&n.constructor!==Number?e.call(this,t,r,n)||this:e.call(this,t,r.getForm(),n)||this).initialize(),a}return u(a,e),a.prototype.initialize=function(){this._focusedStopExecution=!1,this._inControlSuffix=!1,this._rtEvtTask=null,this._subformTaskId=null,this._subformTask=null,this.IsInteractiveUpdate=!1,this.refreshOnString=null,this.SubformLoaded=!1,this.HasZoomHandler=!1,this.ArgList=null},a.prototype.GetVarIndex=function(){return e.prototype.getForm.call(this).getTask().DataView.Dvcount+this.veeIndx},a.prototype.fillData=function(t,r,n){var a=Object.create(null,{fillData:{get:function(){return e.prototype.fillData}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(s){switch(s.label){case 0:return a.fillData.call(this,t,r,n),e=this,[4,this.GetArgumentList()];case 1:return e.ArgList=s.sent(),[2]}}))}))},a.prototype.SetAttribute=function(n,a){var s=e.prototype.SetAttribute.call(this,n,a);if(!s)switch(n){case E.MG_ATTR_SUBFORM_TASK:this._subformTaskId=a;break;case E.MG_ATTR_REFRESHON:this.refreshOnString=a.trim();break;default:s=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",n))}return s},a.prototype.GetArgumentList=function(){var t=Object.create(null,{getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){var e,r,a;return h(this,(function(s){switch(s.label){case 0:return e=null,null===this._propTab?[2,e]:null===(r=this._propTab.getPropById(n.PropInterface.PROP_TYPE_PARAMETERS))?[2,e]:[4,r.getValue()];case 1:return null!==(a=s.sent())&&((e=new L).fillList(a,t.getForm.call(this).getTask()),null!==this.refreshOnString&&(e.RefreshOnString=this.refreshOnString)),[2,e]}}))}))},a.prototype.isDescendent=function(r){var n=!1,a=e.prototype.getForm.call(this);for(t.Debug.Assert(null!==r);!n&&null!==a;)if(r===a)n=!0;else{var s=a.getTask();if(null===s.getParent())break;a=s.getParent().getForm()}return n},a.prototype.refreshOnExpression=function(){return T(this,void 0,void 0,(function(){var e,t,r,a;return h(this,(function(s){switch(s.label){case 0:t=null===this._propTab?0:this._propTab.getSize(),a=!1,e=0,s.label=1;case 1:if(!(e<t)||a)return[3,4];switch((r=this._propTab.getProp(e)).getID()){case n.PropInterface.PROP_TYPE_DATA:if(!r.isExpression()&&null!==this._field&&this._field.getTask()!==this.getForm().getTask()){a=!0;break}case n.PropInterface.PROP_TYPE_FORMAT:case n.PropInterface.PROP_TYPE_VISIBLE:case n.PropInterface.PROP_TYPE_ENABLED:case n.PropInterface.PROP_TYPE_RANGE:case n.PropInterface.PROP_TYPE_TRANSLATOR:r.isExpression()&&(a=!0)}return a?[4,this.RefreshDisplay()]:[3,3];case 2:s.sent(),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},a.prototype.invoke=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!1,[4,this.isParkable(!0)];case 1:return t.sent()?[4,o.eventsManager.handleInternalEventWithMgControlBase(this,r.InternalInterface.MG_ACT_CTRL_PREFIX)]:[3,3];case 2:t.sent(),e=!0,t.label=3;case 3:return[2,e]}}))}))},a.prototype.isParkable=function(t){var r=Object.create(null,{isImageControl:{get:function(){return e.prototype.isImageControl}},checkProp:{get:function(){return e.prototype.checkProp}},isParkable:{get:function(){return e.prototype.isParkable}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(a){switch(a.label){case 0:return(e=!r.isImageControl.call(this))?[4,r.checkProp.call(this,n.PropInterface.PROP_TYPE_ENABLED,!0)]:[3,4];case 1:return a.sent(),[4,r.checkProp.call(this,n.PropInterface.PROP_TYPE_VISIBLE,!0)];case 2:return a.sent(),[4,r.isParkable.call(this,t)];case 3:e=a.sent(),a.label=4;case 4:return[2,e]}}))}))},a.prototype.getSubformTaskId=function(){return this._subformTaskId},a.prototype.initSubformTask=function(){e.prototype.isSubform.call(this)&&(this._subformTask=n.GuiDataCollection.MGDataTable.GetTaskByID(this._subformTaskId))},a.prototype.getParentTable=function(){return this._parentTable},a.prototype.restoreOldValue=function(){var t=Object.create(null,{resetPrevVal:{get:function(){return e.prototype.resetPrevVal}},SetAndRefreshDisplayValue:{get:function(){return e.prototype.SetAndRefreshDisplayValue}}});return T(this,void 0,void 0,(function(){var e,r,n;return h(this,(function(a){switch(a.label){case 0:return null===this._field?[3,2]:[4,this._field.updateDisplay()];case 1:return a.sent(),[3,5];case 2:return t.resetPrevVal.call(this),r=(e=t.SetAndRefreshDisplayValue).call,n=[this],[4,this.getMgValue(this.Value)];case 3:return[4,r.apply(e,n.concat([a.sent(),this.IsNull]))];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))},a.prototype.setRtEvtTask=function(e){this._rtEvtTask=e},a.prototype.getRtEvtTask=function(){return this._rtEvtTask},a.prototype.setSubformTaskId=function(e){this._subformTaskId=e},a.prototype.isFocusedStopExecution=function(){return this._focusedStopExecution},a.prototype.setFocusedStopExecution=function(e){this._focusedStopExecution=e},a.prototype.onTheSameSubFormControl=function(t){var r=!1;return null!==t&&e.prototype.getForm.call(this).isSubForm()&&t.getForm().isSubForm()&&e.prototype.getForm.call(this).getTask()===t.getForm().getTask()&&(r=!0),r},a.prototype.onDiffForm=function(t){return(e.prototype.getForm.call(this).isSubForm()||t.getForm().isSubForm())&&!this.onTheSameSubFormControl(t)},a.prototype.isInControlSuffix=function(){return this._inControlSuffix},a.prototype.setInControlSuffix=function(e){this._inControlSuffix=e},a.prototype.HasSelectProgram=function(){var t=!1,r=e.prototype.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SELECT_PROGRAM);return null!==r&&null!==r.GetComputedValue()&&(t=!0),t},a.prototype.useZoomHandler=function(){return this.HasZoomHandler||null!==e.prototype.getField.call(this)&&(e.prototype.getField.call(this).getHasZoomHandler()||this.HasSelectProgram())},a.prototype.updatePropertyLogicNesting=function(t,r,a,s){var i=Object.create(null,{haveToCheckParentValue:{get:function(){return e.prototype.haveToCheckParentValue}},isParentPropValue:{get:function(){return e.prototype.isParentPropValue}},isSubform:{get:function(){return e.prototype.isSubform}},getDisplayLine:{get:function(){return e.prototype.getDisplayLine}},updateChildrenPropValue:{get:function(){return e.prototype.updateChildrenPropValue}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return a&&i.haveToCheckParentValue.call(this)&&(a=i.isParentPropValue.call(this,t)),a&&i.isSubform.call(this)&&r===n.CommandType.PROP_SET_VISIBLE&&this.ShouldSetSubformInvisible()&&(a=!1),s&&n.Commands.addOperationWithLine(n.CommandType.SET_PROPERTY,this,i.getDisplayLine.call(this,!1),r===n.CommandType.PROP_SET_VISIBLE?n.HtmlProperties.Visible:n.HtmlProperties.Enabled,a),[4,i.updateChildrenPropValue.call(this,t,r,a)];case 1:return e.sent(),[2]}}))}))},a.prototype.ShouldSetSubformInvisible=function(){var t=!1;return e.prototype.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SUBFORM_TYPE).GetComputedValueInteger()===r.SubformType.None&&null===this.getSubformTaskId()&&(t=!0),t},a.prototype.updateSubformChildrenPropValue=function(a,s,i){var l=Object.create(null,{isSubform:{get:function(){return e.prototype.isSubform}},getForm:{get:function(){return e.prototype.getForm}},GetComputedProperty:{get:function(){return e.prototype.GetComputedProperty}}});return T(this,void 0,void 0,(function(){var e,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return t.Debug.Assert(l.isSubform.call(this)),l.getForm.call(this).getTask().AfterFirstRecordPrefix?(e=l.GetComputedProperty.call(this,n.PropInterface.PROP_TYPE_SUBFORM_TYPE).GetComputedValueInteger(),null===this._subformTaskId&&e!==r.SubformType.None?[3,8]:null!==this._subformTask&&this._subformTask.isStarted()?(this.SubformLoaded=!0,s===n.CommandType.PROP_SET_VISIBLE&&i&&this.RefreshOnVisible?(this.RefreshOnVisible=!1,[4,l.getForm.call(this).getTask().SubformRefresh(this._subformTask,!0)]):[3,2]):[3,7]):[2];case 1:h.sent(),h.label=2;case 2:u=this._subformTask.getForm(),c=0,h.label=3;case 3:return c<u.getCtrlCount()?(_=u.getCtrl(c)).isColumnControl()?[4,_.checkProp(a,!0)]:[3,6]:[3,7];case 4:return(T=h.sent()&&i)&&(T=_.isParentPropValue(a)),[4,_.updateChildrenPropValue(a,s,T)];case 5:h.sent(),h.label=6;case 6:return c++,[3,3];case 7:return[3,10];case 8:return s!==n.CommandType.PROP_SET_VISIBLE||!i||this.SubformLoaded?[3,10]:(this.SubformLoaded=!0,[4,o.eventsManager.handleInternalEventWithMgControlBase(this,r.InternalInterface.MG_ACT_SUBFORM_OPEN)]);case 9:h.sent(),h.label=10;case 10:return[2]}}))}))},a.prototype.Init=function(){this.initSubformTask()},a.prototype.GetTableBehaviour=function(){return r.TableBehaviour.UnlimitedItems},a.prototype.getFieldXML=function(t){return t<0?"":e.prototype.getForm.call(this).getTask().DataView.getRecByIdx(t).getFieldDataXML(this._nodeIdField.getId(),!1)},a.prototype.getParentFieldXML=function(t){return t<0?"":e.prototype.getForm.call(this).getTask().DataView.getRecByIdx(t).getFieldDataXML(this._nodeParentIdField.getId(),!1)},a.prototype.validateAndSetValue=function(t,n){var a=Object.create(null,{UpdateModifiedByUser:{get:function(){return e.prototype.UpdateModifiedByUser}},getPIC:{get:function(){return e.prototype.getPIC}},buildPicture:{get:function(){return e.prototype.buildPicture}},getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){var e,s;return h(this,(function(i){switch(i.label){case 0:return a.UpdateModifiedByUser.call(this,t),this.ModifiedByUser?(e=this.Value,s=void 0,null===a.getPIC.call(this)?[2,!0]:((s=a.buildPicture.call(this,e,t)).evaluate(),s.ValidationFailed?(this.ModifiedByUser=!1,[2,!1]):(this.IsInteractiveUpdate=!0,a.getForm.call(this).getTask().setDataSynced(!1),n?(null!==this._field&&this._field.getType()===r.StorageAttribute.NUMERIC&&"string"==typeof t&&t.trim().length>0&&s.setValue(t),[4,this.setValue(s)]):[3,2]))):[3,2];case 1:i.sent(),i.label=2;case 2:return[2,!0]}}))}))},a.prototype.setValue=function(t){var n=Object.create(null,{getMgValue:{get:function(){return e.prototype.getMgValue}},isCheckBox:{get:function(){return e.prototype.isCheckBox}},SetAndRefreshDisplayValue:{get:function(){return e.prototype.SetAndRefreshDisplayValue}}});return T(this,void 0,void 0,(function(){var e,a,s;return h(this,(function(i){switch(i.label){case 0:return e=t.getIsNull(),a=t.getDispValue(),e&&this._field.hasNullDisplayValue()?[3,2]:[4,n.getMgValue.call(this,a)];case 1:return s=i.sent(),[3,3];case 2:s=this._field.getType()===r.StorageAttribute.BLOB_VECTOR?this._field.getCellDefualtValue():this._field.getDefaultValue(),i.label=3;case 3:return null===s?[3,7]:null===this._field||a===this.Value&&!this.KeyStrokeOn&&this.IsNull===e?[3,5]:[4,this._field.setValueAndStartRecompute(s,e,!0,!0,!1)];case 4:i.sent(),n.isCheckBox.call(this)&&(this.forceRefresh=!0,s=this._field.getValue(!1)),i.label=5;case 5:return null!==this._field&&e&&this._field.hasNullDisplayValue()&&(s=a),[4,n.SetAndRefreshDisplayValue.call(this,s,e)];case 6:i.sent(),this.forceRefresh=!1,this.KeyStrokeOn=!1,i.label=7;case 7:return[2]}}))}))},a.prototype.refreshAndSetItemsListForRadioButton=function(t,r){var n=Object.create(null,{refreshAndSetItemsListForRadioButton:{get:function(){return e.prototype.refreshAndSetItemsListForRadioButton}},getForm:{get:function(){return e.prototype.getForm}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,n.refreshAndSetItemsListForRadioButton.call(this,t,r)];case 1:return e.sent(),G.Instance.getLastFocusedTask(n.getForm.call(this).getTask().getMgdID()),[2]}}))}))},a.prototype.getSubformTask=function(){return this._subformTask},a.prototype.resetSubformTask=function(){this._subformTask=null,this._subformTaskId="0"},a.prototype.GetSubformMgForm=function(){var e=null;return null!==this._subformTask&&(e=this._subformTask.getForm()),e},a.prototype.IsTableWithAbsoluteScrollbar=function(){var e=!1;return t.Debug.Assert(this.Type===r.MgControlType.CTRL_TYPE_TABLE,"In MgControl.IsTableWithAbsoluteScrollbar(): Not a table control."),this._propTab.propExists(n.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB)&&(e=this._propTab.getPropById(n.PropInterface.PROP_TYPE_SCROLL_BAR_THUMB).GetComputedValueInteger()===r.ScrollBarThumbType.Absolute),e},a.validReturnToCtrl=function(){return null===a.ReturnToCtrl||!a.ReturnToCtrl.getForm().getTask().isAborting()},a.prototype.maySetValue=function(){switch(this.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:case r.MgControlType.CTRL_TYPE_TAB:break;default:return!1}return!(null===this._field||this._valExpId>0)&&this.isModifiable()},a.prototype.validateAndSetValueIfAllowed=function(e,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return this.maySetValue()?[4,this.validateAndSetValue(e,!0)]:(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Unable to change value of control {0}: The control is read-only.",this.Name)),[2,!1]);case 1:return(s=i.sent())||r.Logger.Instance.WriteErrorToLog(t.NString.Format("Value validation failed for {0}.",this.Name)),a&&(n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),n.Commands.invoke()),[2,s]}}))}))},a}(n.MgControlBase);P.ReturnToCtrl=null;var D=function(){function e(){this._queue=null,this.Size=0,this._queue=new Array(e.DEFAULT_INITIAL_CAPACITY+1);for(var t=0;t<this._queue.length;++t)this._queue[t]=null}return e.prototype.offer=function(e){return++this.Size,this.Size>=this._queue.length&&(this._queue.length=this.Size),this._queue[this.Size]=e,this.fixUp(this.Size),!0},e.prototype.peek=function(){return 0===this.Size?null:this._queue[1]},e.prototype.isEmpty=function(){return 0===this.Size},e.prototype.clear=function(){for(var e=1;e<=this.Size;e++)this._queue[e]=null;this.Size=0},e.prototype.poll=function(){if(0===this.Size)return null;var e=this._queue[1];return this._queue[1]=this._queue[this.Size],this._queue[this.Size--]=null,this.Size>1&&this.fixDown(1),e},e.prototype.fixUp=function(e){for(;e>1;){var t=e>>1;if(this._queue[t].CompareTo(this._queue[e])<=0)break;var r=this._queue[t];this._queue[t]=this._queue[e],this._queue[e]=r,e=t}},e.prototype.fixDown=function(e){for(var t;(t=e<<1)<=this.Size&&t>0&&(t<this.Size&&this._queue[t].CompareTo(this._queue[t+1])>0&&t++,!(this._queue[e].CompareTo(this._queue[t])<=0));){var r=this._queue[t];this._queue[t]=this._queue[e],this._queue[e]=r,e=t}},e}();D.DEFAULT_INITIAL_CAPACITY=11;var k=function(){function e(n,a){this.Exp=null,this._forceExit=r.ForceExit.None,this.kbdItm=null,this._osCommandShow=0,this._osCommandText=null,this._osCommandWait=!1,this._paramAttrs=null,this._paramNulls=null,this._paramVals=null,this._parameters=0,this._returnExp=0,this._seconds=t.Int32.MinValue,this._timestamp=0,this._type=t.Char.MinValue,this._userDefinedFuncName=null,this._userDefinedFuncNameHashCode=0,this._userEvtDesc="",this._userEvtIdx=t.Int32.MinValue,this.ownerTaskDefinitionId=null,this.InternalEvent=0,this.PrgDescription=null,this.PublicName=null,this.UserEvt=null,this.UserEvtTaskTag=null,0===arguments.length?this.constructor_0():1===arguments.length&&(null===n||n instanceof e)?this.constructor_1(n):this.constructor_4(n)}return e.prototype.constructor_0=function(){this.InternalEvent=t.Int32.MinValue,this.setTimestamp()},e.prototype.constructor_1=function(e){this._type=e._type,this.kbdItm=e.kbdItm,this.InternalEvent=e.InternalEvent,this._seconds=e._seconds,this.Exp=e.Exp,this._forceExit=e._forceExit,this.UserEvt=e.UserEvt,this.UserEvtTaskTag=e.UserEvtTaskTag,this._userEvtIdx=e._userEvtIdx,this._timestamp=0},e.prototype.constructor_4=function(e){this.setType(e)},Object.defineProperty(e.prototype,"ForceExit",{get:function(){return this._forceExit},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e,n){var a,s=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==s&&s<e.getXMLdata().length){var i=e.getXMLsubstring(s);e.add2CurrIndex(i.indexOf(E.MG_TAG_EVENT)+E.MG_TAG_EVENT.length);var o=r.XmlParser.getTokens(e.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM),l=new t.RefParam(a);this.initElements(o,n,l),a=l.value,e.setCurrIndex(s+r.XMLConstants.TAG_CLOSE.length),this.InitInnerObjects(e),null!==a&&this.InitUserData(n,a)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Event.FillData() out of string bounds")},e.prototype.InitInnerObjects=function(e){if(e.getNextTag()===r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY){var t=e.ReadToEndOfCurrentElement();this.InitTaskDefinitionId(t);var n=e.getXMLdata().indexOf(E.MG_TAG_EVENT+r.XMLConstants.TAG_CLOSE,e.getCurrIndex());e.setCurrIndex(n+(E.MG_TAG_EVENT+r.XMLConstants.TAG_CLOSE).length)}},e.prototype.initElements=function(e,a,s){var i=n.Modifiers.MODIFIER_NONE,o=-1;s.value=null;for(var l=0;l<e.length;l+=2){var u=e.get_Item(l),c=e.get_Item(l+1);switch(u){case E.MG_ATTR_EVENTTYPE:this._type=c[0];break;case E.MG_ATTR_MODIFIER:i=c[0];break;case E.MG_ATTR_INTERNALEVENT:this.InternalEvent=r.XmlParser.getInt(c);break;case E.MG_ATTR_KEYCODE:o=r.XmlParser.getInt(c);break;case E.MG_ATTR_SECONDS:this._seconds=r.XmlParser.getInt(c);break;case r.XMLConstants.MG_ATTR_EXP:this.Exp=a.getExpById(r.XmlParser.getInt(c));break;case E.MG_ATTR_FORCE_EXIT:this._forceExit=c[0];break;case E.MG_ATTR_DESC:this._userEvtDesc=r.XmlParser.unescape(c);break;case E.MG_ATTR_PUBLIC:this.PublicName=r.XmlParser.unescape(c);break;case E.MG_ATTR_PARAMS:this._parameters=r.XmlParser.getInt(c);break;case E.MG_ATTR_PAR_ATTRS:this._paramAttrs=c;break;case r.XMLConstants.MG_ATTR_VALUE:var _=r.XmlParser.unescape(c);this._paramVals=new Array(this._parameters),this.parseParamVal(_);break;case E.MG_ATTR_NULLS:this._paramNulls=c;break;case E.MG_ATTR_USER:s.value=c;break;case r.XMLConstants.MG_ATTR_NAME:this.setUserDefinedFuncName(c);break;case E.MG_TAG_USR_DEF_FUC_RET_EXP_ID:this._returnExp=r.XmlParser.getInt(c);break;case E.MG_TAG_USR_DEF_FUC_RET_EXP_ATTR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("There is no such tag in Event class. Insert case to Event.initElements for {0}",u))}}this._type===E.EVENT_TYPE_SYSTEM&&(this.kbdItm=new n.KeyboardItem(o,i))},e.prototype.InitUserData=function(e,n){var a=n.indexOf(",");if(a>-1){var s=n.substr(0,a);null!==e&&(s=e.TaskService.GetEventTaskId(e,s,this));var i=o.mgDataTable.GetTaskByID(s),l=r.XmlParser.getInt(n.substr(a+1));if(null!==i){if(this.UserEvt=i.getUserEvent(l),null===this.UserEvt)throw new t.ApplicationException("in Event.fillData(): user event not found. task id = "+s+", user event index = "+l);this.UserEvtTaskTag=s,this._userEvtIdx=l}else this.UserEvtTaskTag=s,this._userEvtIdx=l,this.UserEvt=null}},e.prototype.InitTaskDefinitionId=function(e){new n.TaskDefinitionIdTableSaxHandler(this.SetTaskDefinitionId).parse(e)},e.prototype.SetTaskDefinitionId=function(e){this.ownerTaskDefinitionId=e},e.prototype.findUserEvent=function(){if(this._type===E.EVENT_TYPE_USER&&null===this.UserEvt){var e=o.mgDataTable.GetTaskByID(this.UserEvtTaskTag);if(null!==e&&(this.UserEvt=e.getUserEvent(this._userEvtIdx)),null===this.UserEvt)throw new t.ApplicationException(t.NString.Format("in Event.findUserEvent(): user event not found. task id = {0} doesn't exist",this.UserEvtTaskTag))}},e.prototype.equals=function(e){var r=!1;if(this===e)r=!0;else if(this._type===e._type)switch(this._type){case E.EVENT_TYPE_SYSTEM:r=this.kbdItm.equals(e.kbdItm);break;case E.EVENT_TYPE_INTERNAL:r=this.InternalEvent===e.InternalEvent;break;case E.EVENT_TYPE_TIMER:r=this._seconds===e._seconds;break;case E.EVENT_TYPE_EXPRESSION:case E.EVENT_TYPE_PUBLIC:r=this.Exp===e.Exp;break;case E.EVENT_TYPE_USER:r=this.UserEvt===e.UserEvt;break;case E.EVENT_TYPE_USER_FUNC:this._userDefinedFuncNameHashCode===e.getUserDefinedFuncNameHashCode()&&t.NString.Equals(e.getUserDefinedFuncName(),this._userDefinedFuncName,!0)&&(r=!0);break;default:r=!1}if(this._type===E.EVENT_TYPE_PUBLIC||e._type===E.EVENT_TYPE_PUBLIC){var n=null,a=null;this._type!==E.EVENT_TYPE_USER&&e._type!==E.EVENT_TYPE_USER?r=!1:this._type===E.EVENT_TYPE_PUBLIC?(n=this.PublicName,a=e.getUserEvent().PublicName):(n=e.PublicName,a=this.getUserEvent().PublicName),r=null!==n&&null!==a&&n===a}else this._type===E.EVENT_TYPE_INTERNAL&&e._type===E.EVENT_TYPE_SYSTEM?null!==G.Instance.getCurrTask()&&o.eventsManager.getMatchingAction(G.Instance.getCurrTask(),e.getKbdItm())===this.getInternalCode()&&(r=!0):this._type===E.EVENT_TYPE_USER&&e._type!==E.EVENT_TYPE_USER&&(this.findUserEvent(),r=this.UserEvt.equals(e));return r},e.prototype.setPublicName=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return this._type!==E.EVENT_TYPE_PUBLIC||null===this.Exp?[3,2]:(e=this,[4,this.Exp.evaluateWithResLength(255)]);case 1:e.PublicName=t.sent().mgVal,null!==this.PublicName&&(this.PublicName=r.StrUtil.rtrim(this.PublicName)),t.label=2;case 2:return[2]}}))}))},e.prototype.setInternal=function(e){this._type=E.EVENT_TYPE_INTERNAL,this.InternalEvent=e,e!==r.InternalInterface.MG_ACT_HIT&&e!==r.InternalInterface.MG_ACT_CTRL_HIT||(G.Instance.LastActionTime=r.Misc.getSystemMilliseconds())},e.prototype.setExpression=function(e){this._type=E.EVENT_TYPE_EXPRESSION,this.Exp=e},e.prototype.getExpression=function(){return this.Exp},e.prototype.getUsrEvntDesc=function(){return null!==this.UserEvt?this.UserEvt._userEvtDesc:this._userEvtDesc},e.prototype.setSystem=function(e){this._type=E.EVENT_TYPE_SYSTEM,this.kbdItm=e},e.prototype.setKeyboardItem=function(e){this.kbdItm=e},e.prototype.getType=function(){return this._type},e.prototype.setType=function(e){this._type=e},e.prototype.getInternalCode=function(){return this._type===E.EVENT_TYPE_INTERNAL?this.InternalEvent:t.Int32.MinValue},e.prototype.getKbdItm=function(){return this._type===E.EVENT_TYPE_SYSTEM?this.kbdItm:null},e.prototype.getKbdItmAlways=function(){return this.kbdItm},e.prototype.dataEventIsTrue=function(){return T(this,void 0,void 0,(function(){var e,t,a,s;return h(this,(function(i){switch(i.label){case 0:return this._type===E.EVENT_TYPE_EXPRESSION||this._type===E.EVENT_TYPE_USER&&this.getUserEventType()===E.EVENT_TYPE_EXPRESSION?this._type===E.EVENT_TYPE_USER?[3,2]:(t=(e=n.DisplayConvertor).toBoolean,[4,this.Exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)]):[2,!0];case 1:return[2,t.apply(e,[i.sent()])];case 2:return s=(a=n.DisplayConvertor).toBoolean,[4,this.UserEvt.getExpression().evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)];case 3:return[2,s.apply(a,[i.sent()])]}}))}))},e.prototype.getSeconds=function(){return this._seconds},e.prototype.getBrkLevel=function(e){return 0===arguments.length?this.getBrkLevel_0():this.getBrkLevel_1(e)},e.prototype.getBrkLevel_0=function(){return this.getBrkLevel(!1)},e.prototype.getBrkLevel_1=function(t){var n="";switch(this._type){case E.EVENT_TYPE_INTERNAL:switch(this.InternalEvent){case r.InternalInterface.MG_ACT_TASK_PREFIX:n=t?E.BRK_LEVEL_TASK_PREFIX_FM:E.BRK_LEVEL_TASK_PREFIX;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:n=t?E.BRK_LEVEL_TASK_SUFFIX_FM:E.BRK_LEVEL_TASK_SUFFIX;break;case r.InternalInterface.MG_ACT_REC_PREFIX:n=t?E.BRK_LEVEL_REC_PREFIX_FM:E.BRK_LEVEL_REC_PREFIX;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:n=t?E.BRK_LEVEL_REC_SUFFIX_FM:E.BRK_LEVEL_REC_SUFFIX;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:n=t?E.BRK_LEVEL_CTRL_PREFIX_FM:E.BRK_LEVEL_CTRL_PREFIX+"_";break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:n=t?E.BRK_LEVEL_CTRL_SUFFIX_FM:E.BRK_LEVEL_CTRL_SUFFIX+"_";break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:n=t?E.BRK_LEVEL_CTRL_VERIFICATION_FM:E.BRK_LEVEL_CTRL_VERIFICATION+"_";break;case r.InternalInterface.MG_ACT_VARIABLE:n=t?E.BRK_LEVEL_VARIABLE_FM:E.BRK_LEVEL_VARIABLE+"_";break;default:n=t?E.BRK_LEVEL_HANDLER_INTERNAL_FM:E.BRK_LEVEL_HANDLER_INTERNAL+"_"}n+=e.getInternalEvtDescription(this.InternalEvent);break;case E.EVENT_TYPE_SYSTEM:n=t?E.BRK_LEVEL_HANDLER_SYSTEM_FM:E.BRK_LEVEL_HANDLER_SYSTEM+"_",n+=this.getKeyboardItemString();break;case E.EVENT_TYPE_TIMER:n=t?E.BRK_LEVEL_HANDLER_TIMER_FM+" "+this.seconds2String():E.BRK_LEVEL_HANDLER_TIMER+"_"+this.seconds2String();break;case E.EVENT_TYPE_EXPRESSION:n=t?E.BRK_LEVEL_HANDLER_EXPRESSION_FM:E.BRK_LEVEL_HANDLER_EXPRESSION+"_"+this.Exp.getId();break;case E.EVENT_TYPE_USER:n=(t?E.BRK_LEVEL_HANDLER_USER_FM+": ":E.BRK_LEVEL_HANDLER_USER+"_")+(null!=this.UserEvt?this.UserEvt._userEvtDesc:this._userEvtDesc);break;case E.EVENT_TYPE_USER_FUNC:n=(t?E.BRK_LEVEL_USER_FUNCTION_FM+":":E.BRK_LEVEL_USER_FUNCTION+"_")+this._userDefinedFuncName}return n},e.getInternalEvtDescription=function(e){var t;switch(e){case r.InternalInterface.MG_ACT_ABOUT:t="About Magic";break;case r.InternalInterface.MG_ACT_ACTION_LIST:t="Action List";break;case r.InternalInterface.MG_ACT_ADD_HYPERLINK:t="";break;case r.InternalInterface.MG_ACT_ALIGN_LEFT:t="Left";break;case r.InternalInterface.MG_ACT_ALIGN_RIGHT:t="Right";break;case r.InternalInterface.MG_ACT_APPL_PROPERTIES:t="";break;case r.InternalInterface.MG_ACT_APPLICATIONS:t="Applications";break;case r.InternalInterface.MG_ACT_APPLICATIONS_LIST:t="Applications List";break;case r.InternalInterface.MG_ACT_ATTACH_TO_TABLE:t="Attach to Table";break;case r.InternalInterface.MG_ACT_AUTHORIZE:t="Authorize";break;case r.InternalInterface.MG_ACT_EDT_BEGFLD:t="Begin Field";break;case r.InternalInterface.MG_ACT_EDT_BEGFORM:t="Begin Form";break;case r.InternalInterface.MG_ACT_EDT_BEGLINE:t="Begin Line";break;case r.InternalInterface.MG_ACT_EDT_BEGNXTLINE:t="Begin Next Line";break;case r.InternalInterface.MG_ACT_EDT_BEGPAGE:t="Begin Page";break;case r.InternalInterface.MG_ACT_TBL_BEGLINE:t="Begin Row";break;case r.InternalInterface.MG_ACT_TBL_BEGPAGE:t="Begin Screen";break;case r.InternalInterface.MG_ACT_TBL_BEGTBL:t="Begin table";break;case r.InternalInterface.MG_ACT_BOTTOM:t="Bottom";break;case r.InternalInterface.MG_ACT_BULLET:t="Bullet";break;case r.InternalInterface.MG_ACT_BUTTON:t="Button Press";break;case r.InternalInterface.MG_ACT_CANCEL:t="Cancel";break;case r.InternalInterface.MG_ACT_RT_QUIT:t="Quit";break;case r.InternalInterface.MG_ACT_CENTER:t="Center";break;case r.InternalInterface.MG_ACT_CHECK_SYNTAX:t="Check Syntax";break;case r.InternalInterface.MG_ACT_CHECK_TO_END:t="Check to End";break;case r.InternalInterface.MG_ACT_CLEAR_TEMPLATE:t="Clear Template";break;case r.InternalInterface.MG_ACT_CLEAR_VALUE:t="Clear Value";break;case r.InternalInterface.MG_ACT_CLOSE:t="Close";break;case r.InternalInterface.MG_ACT_ACT_CLOSE_APPL:t="Close Application";break;case r.InternalInterface.MG_ACT_COMMUNICATIONS:t="Communications";break;case r.InternalInterface.MG_ACT_COMPONENTS:t="Components";break;case r.InternalInterface.MG_ACT_CTRL_HIT:t="Control Hit";break;case r.InternalInterface.MG_ACT_CONTROL_NAME_LIST:t="Control Name List";break;case r.InternalInterface.MG_ACT_CLIP_COPY:t="Copy";break;case r.InternalInterface.MG_ACT_COPY_LAYOUT:t="Copy Layout";break;case r.InternalInterface.MG_ACT_COPY_SUBTREE:t="Copy Subtree";break;case r.InternalInterface.MG_ACT_CRELINE:t="Create Line";break;case r.InternalInterface.MG_ACT_CRELINE_ABOVE:t="Create Line Above";break;case r.InternalInterface.MG_ACT_CREATE_PARENT:t="Create Parent";break;case r.InternalInterface.MG_ACT_RTO_CREATE:t="Create Records";break;case r.InternalInterface.MG_ACT_CREATE_SUBTASK:t="Create Subtask";break;case r.InternalInterface.MG_ACT_CROSS_REFERENCE:t="Cross Reference";break;case r.InternalInterface.MG_ACT_CUT:t="Cut";break;case r.InternalInterface.MG_ACT_DB_TABLES:t="";break;case r.InternalInterface.MG_ACT_DBMS:t="DBMS";break;case r.InternalInterface.MG_ACT_DDF_MAKE:t="DDF Make";break;case r.InternalInterface.MG_ACT_DATABASES:t="Databases";break;case r.InternalInterface.MG_ACT_DEFAULT_LAYOUT:t="Default Layout";break;case r.InternalInterface.MG_ACT_DEFINE_EXPRESSION:t="Define Expression";break;case r.InternalInterface.MG_ACT_EDT_DELCURCH:t="Current Char";break;case r.InternalInterface.MG_ACT_EDT_DELPRVCH:t="Previous Char";break;case r.InternalInterface.MG_ACT_DELETE_HYPERLINK:t="Delete Hyperlink";break;case r.InternalInterface.MG_ACT_DELLINE:t="Delete Line";break;case r.InternalInterface.MG_ACT_DELETE_SUBTREE:t="Delete Subtree";break;case r.InternalInterface.MG_ACT_RT_COPYFLD:t="Ditto";break;case r.InternalInterface.MG_ACT_DISPLAY_REFRESH:t="Display Refresh";break;case r.InternalInterface.MG_ACT_EDIT_MAIN_FORM:t="Edit Main Form";break;case r.InternalInterface.MG_ACT_EDT_ENDFLD:t="End Field";break;case r.InternalInterface.MG_ACT_EDT_ENDFORM:t="End Form";break;case r.InternalInterface.MG_ACT_EDT_ENDLINE:t="End Line";break;case r.InternalInterface.MG_ACT_EDT_ENDPAGE:t="End Page";break;case r.InternalInterface.MG_ACT_TBL_ENDLINE:t="End Row";break;case r.InternalInterface.MG_ACT_TBL_ENDPAGE:t="End Screen";break;case r.InternalInterface.MG_ACT_TBL_ENDTBL:t="End Table";break;case r.InternalInterface.MG_ACT_ENVIRONMENT:t="Environment";break;case r.InternalInterface.MG_ACT_EXECUTE_PROGRAM:t="Execute Program";break;case r.InternalInterface.MG_ACT_EXECUTE_REPORT:t="Execute Report";break;case r.InternalInterface.MG_ACT_EXIT:t="Exit";break;case r.InternalInterface.MG_ACT_EXIT_SYSTEM:t="Exit System";break;case r.InternalInterface.MG_ACT_EXPORT_IMPORT:t="Export/Import";break;case r.InternalInterface.MG_ACT_EXPRESSION_RULES:t="Expression rules";break;case r.InternalInterface.MG_ACT_EXTERNAL_EDITOR:t="External Editor";break;case r.InternalInterface.MG_ACT_EXT_EVENT:t="External Event";break;case r.InternalInterface.MG_ACT_FORMS:t="Forms";break;case r.InternalInterface.MG_ACT_FROM_VALUE:t="From Value";break;case r.InternalInterface.MG_ACT_FUNCTION_LIST:t="Function List";break;case r.InternalInterface.MG_ACT_GENERATE_FORM:t="Generate Form";break;case r.InternalInterface.MG_ACT_GENERATE_PROGRAM:t="Generate Program";break;case r.InternalInterface.MG_ACT_GO_TO_TOP:t="Go to Top";break;case r.InternalInterface.MG_ACT_H_CENTER_OF_FORM:t="";break;case r.InternalInterface.MG_ACT_HTML_STYLES:t="HTML Styles";break;case r.InternalInterface.MG_ACT_HELP:t="Help";break;case r.InternalInterface.MG_ACT_HELP_SCREENS:t="Help Screens";break;case r.InternalInterface.MG_ACT_HORIZ_CENTER:t="Horiz. Center";break;case r.InternalInterface.MG_ACT_I_O_FILES:t="Tables";break;case r.InternalInterface.MG_ACT_INDENT:t="Indent";break;case r.InternalInterface.MG_ACT_INSERT_OBJECT:t="Insert Object";break;case r.InternalInterface.MG_ACT_JUMP_TO_ROW:t="Jump to Row";break;case r.InternalInterface.MG_ACT_KEYBOARD_LIST:t="Keyboard List";break;case r.InternalInterface.MG_ACT_KEYBOARD_MAPPING:t="Keyboard Mapping";break;case r.InternalInterface.MG_ACT_LANGUAGES:t="languages";break;case r.InternalInterface.MG_ACT_RTO_SEARCH:t="Locate Next";break;case r.InternalInterface.MG_ACT_RTO_LOCATE:t="Locate a Record";break;case r.InternalInterface.MG_ACT_LOGICALPNAMES:t="";break;case r.InternalInterface.MG_ACT_LOGON:t="Logon";break;case r.InternalInterface.MG_ACT_USING_HELP:t="Help Topics";break;case r.InternalInterface.MG_ACT_EDT_MARKNXTCH:t="Mark Next Char";break;case r.InternalInterface.MG_ACT_MARK_NEXT_LINE:t="Mark Next Line MLE";break;case r.InternalInterface.MG_ACT_EDT_MARKPRVCH:t="Mark Previous Char";break;case r.InternalInterface.MG_ACT_EDT_MARKPRVLINE:t="Mark Previous Line MLE";break;case r.InternalInterface.MG_ACT_MARK_SUBTREE:t="";break;case r.InternalInterface.MG_ACT_EDT_MARKTOBEG:t="Mark To Beginning";break;case r.InternalInterface.MG_ACT_EDT_MARKTOEND:t="Mark To End";break;case r.InternalInterface.MG_ACT_MAXIMUM_HEIGHT:t="Maximum Height";break;case r.InternalInterface.MG_ACT_MAXIMUM_WIDTH:t="Maximum Width";break;case r.InternalInterface.MG_ACT_MENU_BAR:t="Menu Bar";break;case r.InternalInterface.MG_ACT_MENUS:t="";break;case r.InternalInterface.MG_ACT_MINIMUM_HEIGHT:t="Minimum Height";break;case r.InternalInterface.MG_ACT_MINIMUM_WIDTH:t="Minimum Width";break;case r.InternalInterface.MG_ACT_RTO_MODIFY:t="Modify Records";break;case r.InternalInterface.MG_ACT_MONITOR_DEBUGGER:t="Monitor/Debugger";break;case r.InternalInterface.MG_ACT_MOVE_ENTRY:t="Move Entry";break;case r.InternalInterface.MG_ACT_MOVE_SUBTREE:t="Move Subtree";break;case r.InternalInterface.MG_ACT_NULL_SETTINGS:t="NULL Settings";break;case r.InternalInterface.MG_ACT_EDT_NXTCHAR:t="Next Char";break;case r.InternalInterface.MG_ACT_EDT_NXTLINE:t="Next Line";break;case r.InternalInterface.MG_ACT_EDT_NXTPAGE:t="Next Page";break;case r.InternalInterface.MG_ACT_TBL_NXTLINE:t="Next Row";break;case r.InternalInterface.MG_ACT_TBL_NXTPAGE:t="Next Screen";break;case r.InternalInterface.MG_ACT_EDT_NXTTAB:t="Next Tab";break;case r.InternalInterface.MG_ACT_EDT_NXTWORD:t="Next Word";break;case r.InternalInterface.MG_ACT_NORMAL:t="Normal";break;case r.InternalInterface.MG_ACT_OK:t="OK";break;case r.InternalInterface.MG_ACT_OLE2:t="OLE2";break;case r.InternalInterface.MG_ACT_OPEN_APPLICATION:t="Open Application";break;case r.InternalInterface.MG_ACT_OVERWRITE_ENTRY:t="Overwrite Entry";break;case r.InternalInterface.MG_ACT_OVERWRITE_SUBTREE:t="Overwrite Subtree";break;case r.InternalInterface.MG_ACT_PPD:t="PPD";break;case r.InternalInterface.MG_ACT_PAGE_FOOTER:t="Page Footer";break;case r.InternalInterface.MG_ACT_PAGE_HEADER:t="Page Header";break;case r.InternalInterface.MG_ACT_CLIP_PASTE:t="Paste";break;case r.InternalInterface.MG_ACT_PASTE_LINK:t="Paste Link";break;case r.InternalInterface.MG_ACT_PASTE_SUBTREE:t="Paste Subtree";break;case r.InternalInterface.MG_ACT_EDT_PRVCHAR:t="Previous Char";break;case r.InternalInterface.MG_ACT_EDT_PRVLINE:t="Previous Line";break;case r.InternalInterface.MG_ACT_EDT_PRVPAGE:t="Previous Page";break;case r.InternalInterface.MG_ACT_TBL_PRVLINE:t="Previous Row";break;case r.InternalInterface.MG_ACT_TBL_PRVPAGE:t="Previous Screen";break;case r.InternalInterface.MG_ACT_EDT_PRVTAB:t="Previous Tab";break;case r.InternalInterface.MG_ACT_EDT_PRVWORD:t="Previous Word";break;case r.InternalInterface.MG_ACT_PRINT_ATTRIBUTES:t="Print Attributes";break;case r.InternalInterface.MG_ACT_PRINTER_SETUP:t="Printer Setup";break;case r.InternalInterface.MG_ACT_PRINTERS:t="Printers";break;case r.InternalInterface.MG_ACT_PROGRAMS:t="Programs";break;case r.InternalInterface.MG_ACT_PROPERTIES:t="Properties";break;case r.InternalInterface.MG_ACT_RTO_QUERY:t="Query Records";break;case r.InternalInterface.MG_ACT_RTO_RANGE:t="Range of Records";break;case r.InternalInterface.MG_ACT_RT_REFRESH_RECORD:t="Record Flush";break;case r.InternalInterface.MG_ACT_REDIRECT_FILES:t="Redirect Files";break;case r.InternalInterface.MG_ACT_REDRAW_LAYOUT:t="";break;case r.InternalInterface.MG_ACT_REPEAT_ENTRY:t="Repeat Entry";break;case r.InternalInterface.MG_ACT_REPEAT_SUBTREE:t="Repeat Subtree";break;case r.InternalInterface.MG_ACT_REPORT_GENERATOR:t="";break;case r.InternalInterface.MG_ACT_RESTORE_DEFAULTS:t="Restore Defaults";break;case r.InternalInterface.MG_ACT_RETURN_TO_TREE:t="";break;case r.InternalInterface.MG_ACT_RIGHT:t="Right";break;case r.InternalInterface.MG_ACT_RIGHTS:t="";break;case r.InternalInterface.MG_ACT_RIGHTS_LIST:t="Rights List";break;case r.InternalInterface.MG_ACT_SQL_ASSIST:t="SQL Assist";break;case r.InternalInterface.MG_ACT_SQL_COLUMNS:t="SQL Columns";break;case r.InternalInterface.MG_ACT_SQL_COMMAND:t="SQL Command";break;case r.InternalInterface.MG_ACT_SQL_FLIP_DESC:t="SQL Flip Desc.";break;case r.InternalInterface.MG_ACT_SQL_KEYWORDS:t="SQL Keywords";break;case r.InternalInterface.MG_ACT_SQL_OPERATORS:t="SQL Operators";break;case r.InternalInterface.MG_ACT_SQL_TABLES:t="SQL Tables";break;case r.InternalInterface.MG_ACT_SQL_WHERE_CLAUSE:t="";break;case r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN:t="Screen Refresh";break;case r.InternalInterface.MG_ACT_SECRET_NAMES:t="Secret Names";break;case r.InternalInterface.MG_ACT_SELECT:t="Select";break;case r.InternalInterface.MG_ACT_EDT_MARKALL:t="Select All";break;case r.InternalInterface.MG_ACT_SERVERS:case r.InternalInterface.MG_ACT_SERVICES:t="";break;case r.InternalInterface.MG_ACT_RT_EDT_NULL:t="Set to NULL";break;case r.InternalInterface.MG_ACT_SHELL_TO_OS:t="Shell to OS";break;case r.InternalInterface.MG_ACT_SHOW_EXPRESSION:t="Show Expression";break;case r.InternalInterface.MG_ACT_SHOW_FULL_LAYOUT:case r.InternalInterface.MG_ACT_SHRINK_TREE:t="";break;case r.InternalInterface.MG_ACT_SORT:t="Sort";break;case r.InternalInterface.MG_ACT_SORT_RECORDS:t="Sort Records";break;case r.InternalInterface.MG_ACT_TABLE_LOCATE:t="Table Locate";break;case r.InternalInterface.MG_ACT_TABLE_LOCATE_NEXT:t="Table Locate Next";break;case r.InternalInterface.MG_ACT_TABLES:case r.InternalInterface.MG_ACT_TASK_CONTROL:case r.InternalInterface.MG_ACT_TASK_EVENTS:t="";break;case r.InternalInterface.MG_ACT_TO_VALUE:t="To Value";break;case r.InternalInterface.MG_ACT_TOOLKIT_RUNTIME:t="Toolkit/Runtime";break;case r.InternalInterface.MG_ACT_TOP:t="Top";break;case r.InternalInterface.MG_ACT_TYPES:t="";break;case r.InternalInterface.MG_ACT_EDT_UNDO:t="Undo Editing";break;case r.InternalInterface.MG_ACT_UNINDENT:t="Unindent";break;case r.InternalInterface.MG_ACT_UPDATE_LINK:t="";break;case r.InternalInterface.MG_ACT_USER_ACTION_1:case r.InternalInterface.MG_ACT_USER_ACTION_2:case r.InternalInterface.MG_ACT_USER_ACTION_3:case r.InternalInterface.MG_ACT_USER_ACTION_4:case r.InternalInterface.MG_ACT_USER_ACTION_5:case r.InternalInterface.MG_ACT_USER_ACTION_6:case r.InternalInterface.MG_ACT_USER_ACTION_7:case r.InternalInterface.MG_ACT_USER_ACTION_8:case r.InternalInterface.MG_ACT_USER_ACTION_9:case r.InternalInterface.MG_ACT_USER_ACTION_10:case r.InternalInterface.MG_ACT_USER_ACTION_11:case r.InternalInterface.MG_ACT_USER_ACTION_12:case r.InternalInterface.MG_ACT_USER_ACTION_13:case r.InternalInterface.MG_ACT_USER_ACTION_14:case r.InternalInterface.MG_ACT_USER_ACTION_15:case r.InternalInterface.MG_ACT_USER_ACTION_16:case r.InternalInterface.MG_ACT_USER_ACTION_17:case r.InternalInterface.MG_ACT_USER_ACTION_18:case r.InternalInterface.MG_ACT_USER_ACTION_19:case r.InternalInterface.MG_ACT_USER_ACTION_20:t="User Action "+(e-r.InternalInterface.MG_ACT_USER_ACTION_1+1);break;case r.InternalInterface.MG_ACT_USER_GROUPS:t="";break;case r.InternalInterface.MG_ACT_USER_IDS:t="User IDs";break;case r.InternalInterface.MG_ACT_V_CENTER_OF_FORM:t="Center of Form";break;case r.InternalInterface.MG_ACT_VERTICAL_CENTER:t="Vertical Center";break;case r.InternalInterface.MG_ACT_VIEW_BY_KEY:t="View by Key";break;case r.InternalInterface.MG_ACT_RT_REFRESH_VIEW:t="View Refresh";break;case r.InternalInterface.MG_ACT_VIRTUAL_VARIABLES:t="Variables";break;case r.InternalInterface.MG_ACT_VISUAL_CONNECTION:t="Visual Connection";break;case r.InternalInterface.MG_ACT_HIT:t="Window Hit";break;case r.InternalInterface.MG_ACT_WINMOVE:t="Window Reposition";break;case r.InternalInterface.MG_ACT_WINSIZE:t="Window Resize";break;case r.InternalInterface.MG_ACT_ZOOM:t="Zoom";break;case r.InternalInterface.MG_ACT_LOCKING_DETAILS:t="Locking Details";break;case r.InternalInterface.MG_ACT_LOCKING_ABORT:t="Locking Abort";break;case r.InternalInterface.MG_ACT_LOCKING_RETRY:t="Locking Retry";break;case r.InternalInterface.MG_ACT_CHECK_OBJECT_LIST:t="Check Object List";break;case r.InternalInterface.MG_ACT_USERS_LIST:t="Users List";break;case r.InternalInterface.MG_ACT_MODELS:t="Models";break;case r.InternalInterface.MG_ACT_WEB_CLICK:t="Click";break;case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:t="DblClick";break;case r.InternalInterface.MG_ACT_BROWSER_ESC:t="Esc";break;case r.InternalInterface.MG_ACT_ROLLBACK:t="Rollback";break;case r.InternalInterface.MG_ACT_EMPTY_DATAVIEW:t="Empty Dataview";break;case r.InternalInterface.MG_ACT_CTRL_MODIFY:t="Control Modify";break;case r.InternalInterface.MG_ACT_PRINT_DATA:t="Print Data";break;case r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT:t="Post Refresh by Parent";break;case r.InternalInterface.MG_ACT_SWITCH_TO_OFFLINE:t="Switch To Offline";break;case r.InternalInterface.MG_ACT_UNAVAILABLE_SERVER:t="Unavailable Server";break;case r.InternalInterface.MG_ACT_CONTEXT_MENU:t="Context Menu";break;case r.InternalInterface.MG_ACT_ENTER_ROW_EDITING:t="Enter Row Editing";break;case r.InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS:t="No Program Execution Rights";break;case r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE:t="Route";break;case r.InternalInterface.MG_ACT_COL_SORT:t="Column Sort";break;case r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:t="Get Rows";break;case r.InternalInterface.MG_ACT_SUBFORM_CLOSE:t="Subform Close";break;case r.InternalInterface.MG_ACT_SUBFORM_REFRESH:t="Subform Refresh";break;case r.InternalInterface.MG_ACT_SUBFORM_OPEN:t="Subform Open";break;case r.InternalInterface.MG_ACT_COMPUTE:t="Compute";break;case r.InternalInterface.MG_ACT_CACHE_NEXT:t="Get Next Data";break;case r.InternalInterface.MG_ACT_CACHE_PREV:t="Get Previous Data";break;case r.InternalInterface.MG_ACT_FETCH_DATA_CONTROL_VALUES:t="Fetch data control values";break;case r.InternalInterface.MG_ACT_INDEX_CHANGE:t="Index Change";break;default:t=""}return t},e.prototype.getUserEventType=function(){return null===this.UserEvt?E.EVENT_TYPE_NOTINITED:this.UserEvt.getType()},e.prototype.getSecondsOfUserEvent=function(){return this.UserEvt.getSeconds()},e.prototype.getUserEvent=function(){return this.UserEvt},e.prototype.getKeyboardItemString=function(){var e=this.getKbdItm();return null===e?"":e.ToString()},e.prototype.seconds2String=function(){var e=new Array(3),t="";e[0]=Math.floor(this._seconds/3600),e[1]=Math.floor((this._seconds-3600*e[0])/60),e[2]=this._seconds%60;for(var r=0;r<e.length;r++)0===e[r]?t+="00":e[r]<10?t+="0"+e[r]:t+=e[r],r<e.length-1&&(t+=":");return t},e.prototype.getParamVal=function(e){return this._paramVals[e]},e.prototype.parseParamVal=function(e){var a,s,i,l=0,u=0,c=null;for(s=0;s<this._parameters;s++){switch(this._paramAttrs[s]){case r.StorageAttribute.SKIP:c="";break;case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.BLOB:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:if(u=l+4,i=e.substr(l,u-l),a=t.NNumber.Parse(i,t.NumberStyles.HexNumber),l=u,o.environment.GetDebugLevel()>1||this._paramAttrs[s]===r.StorageAttribute.ALPHA||this._paramAttrs[s]===r.StorageAttribute.UNICODE||this._paramAttrs[s]===r.StorageAttribute.MEMO)if((32768&a)>0){a&=32767,a*=2;var _=new t.StringBuilder;u+=n.RecordUtils.getSpannedField(e,a,l,this._paramAttrs[s],_,!0),e=_.ToString()}else u=l+a,c=e.substr(l,u-l);else if((32768&a)>0){a&=32767,a=4*Math.floor((a+2)/3);_=new t.StringBuilder;u+=n.RecordUtils.getSpannedField(e,a,l,this._paramAttrs[s],_,!1),c=_.ToString()}else u=l+4*Math.floor((a+2)/3),c=r.Base64.decode(e.substr(l,u-l));break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:o.environment.GetDebugLevel()>1?(u=l+2*o.environment.GetSignificantNumSize(),c=e.substr(l,u-l)):(u=l+4*Math.floor((o.environment.GetSignificantNumSize()+2)/3),c=r.Base64.decodeToHex(e.substr(l,u-l)));break;case r.StorageAttribute.BOOLEAN:u=l+1,c=e.substr(l,u-l)}this._paramVals[s]=c,l=u}return u},e.prototype.setParamVals=function(e){if(this._paramVals=e,this._paramAttrs=this._paramNulls="",this._parameters=0,null!==this._paramVals){this._parameters=this._paramVals.length;for(var t=0;t<this._parameters;t++)this._paramAttrs+=r.StorageAttribute.ALPHA,this._paramNulls+="0"}},e.prototype.setParamType=function(e,a){var s,i,o=a.getType(),l=null,u=!1;if(null!=this._paramVals&&this.getParamNum()>=e&&!(u=(s=this._paramAttrs[e])===o)){var c=null;switch(i=this._paramVals[e],o){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.MEMO:case r.StorageAttribute.UNICODE:break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(s===r.StorageAttribute.ALPHA)try{l=n.PIC.buildPicture(o,i,a.getTask().getCompIdx(),!0),this._paramVals[e]=n.DisplayConvertor.Instance.disp2mg(i,"",l,a.getTask().getCompIdx(),n.BlobType.CONTENT_TYPE_UNKNOWN),u=!0}catch(e){if(!(e instanceof t.Exception))throw e;u=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Event.setParamType() cannot transfer {0} to Numeric with picture {1}",i,null!=l?l.getFormat():"null"))}break;case r.StorageAttribute.BOOLEAN:s===r.StorageAttribute.ALPHA&&("1"===(i=i.trim())||"true"===i.toLowerCase()?this._paramVals[e]="1":this._paramVals[e]="0",u=!0)}u&&((c=t.NString.ToCharArray(this._paramAttrs))[e]=o,this._paramAttrs=t.NString.FromChars(c))}return u},e.prototype.getParamNum=function(){return this._parameters},e.prototype.getParamNull=function(e){return"0"!==this._paramNulls.charAt(e)},e.prototype.getParamAttr=function(e){return this._paramAttrs.charAt(e)},e.prototype.isControlHeader=function(){return this.getType()==E.EVENT_TYPE_INTERNAL&&(this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_PREFIX||this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_SUFFIX||this.getInternalCode()==r.InternalInterface.MG_ACT_CTRL_VERIFICATION)},e.prototype.isVariableHeader=function(){return this.getType()==E.EVENT_TYPE_INTERNAL&&this.getInternalCode()==r.InternalInterface.MG_ACT_VARIABLE},e.prototype.AppendDescription=function(t){switch(this._type){case E.EVENT_TYPE_INTERNAL:t.Append(e.getInternalEvtDescription(this.InternalEvent));break;case E.EVENT_TYPE_SYSTEM:t.Append(this.getKeyboardItemString());break;case E.EVENT_TYPE_USER:t.Append(this.getUsrEvntDesc());break;case E.EVENT_TYPE_USER_FUNC:t.Append(this._userDefinedFuncName);break;case E.EVENT_TYPE_TIMER:t.Append(this.seconds2String());break;case E.EVENT_TYPE_EXPRESSION:t.Append("ID "+this.Exp.getId().toString());break;default:t.Append("unknown event type ")}},e.prototype.isNewInternalEvent=function(){return this.InternalEvent>=1001&&this.InternalEvent<=1008},e.prototype.getNewInternalEventDescription=function(){var e=t.NString.Empty;switch(this.InternalEvent){case r.InternalInterface.MG_ACT_TASK_PREFIX:e=E.BRK_LEVEL_TASK_PREFIX_FM;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:e=E.BRK_LEVEL_TASK_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_REC_PREFIX:e=E.BRK_LEVEL_REC_PREFIX_FM;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:e=E.BRK_LEVEL_REC_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:e=E.BRK_LEVEL_CTRL_PREFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:e=E.BRK_LEVEL_CTRL_SUFFIX_FM;break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:e=E.BRK_LEVEL_CTRL_VERIFICATION_FM;break;case r.InternalInterface.MG_ACT_VARIABLE:e=E.BRK_LEVEL_VARIABLE_FM}return e},e.prototype.getEventType=function(){return this.isNewInternalEvent()?t.NString.TrimEnd(this.getNewInternalEventDescription()):this.getEventTypeString()},e.prototype.getEventTypeString=function(){var e;switch(this.getType()){case E.EVENT_TYPE_INTERNAL:e="Internal Event:";break;case E.EVENT_TYPE_SYSTEM:e="System Event:";break;case E.EVENT_TYPE_EXPRESSION:e="Expression Event:";break;case E.EVENT_TYPE_TIMER:e="Timer Event:";break;case E.EVENT_TYPE_USER:e="User Event:";break;default:e=""}return e},e.prototype.setUserDefinedFuncName=function(e){this._userDefinedFuncName=e;var r=this._userDefinedFuncName.toUpperCase();this._userDefinedFuncNameHashCode=t.HashUtils.GetHashCode(r)},e.prototype.getUserDefinedFuncName=function(){return this._userDefinedFuncName},e.prototype.getUserDefinedFuncNameHashCode=function(){return this._userDefinedFuncNameHashCode},e.prototype.getUserDefinedFuncRetExp=function(){return this._returnExp},e.prototype.getOsCommandText=function(){return this._osCommandText},e.prototype.setOsCommandText=function(e){this._osCommandText=e},e.prototype.getOsCommandWait=function(){return this._osCommandWait},e.prototype.setOsCommandWait=function(e){this._osCommandWait=e},e.prototype.getOsCommandShow=function(){return this._osCommandShow},e.prototype.setOsCommandShow=function(e){this._osCommandShow=e},e.prototype.setTimestamp=function(){this._timestamp=e._lastTimestamp++},e.prototype.getTimestamp=function(){return this._timestamp},e.prototype.toString=function(){return t.NString.Format("{{Event: {0}}}",this.getBrkLevel())},e}();k._lastTimestamp=0;var x=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(k),F=function(){function e(){this._queue=null,this._timeFirstEvent=0,this._queue=new D}return e.prototype.isBackgroundEvent=function(e){var t=!1;e instanceof x&&(e.getPriority()===r.Priority.LOWEST&&(t=!0));return t},e.prototype.offer=function(e){try{var n=this._queue.offer(e);return 0===this._timeFirstEvent&&(this.isBackgroundEvent(e)||(this._timeFirstEvent=r.Misc.getSystemMilliseconds())),t.Debug.Assert(n),r.SyncExecutionHelper.Instance.Pulse(),!0}finally{}},e.prototype.put=function(e){this.offer(e)},e.prototype.waitForElement=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return 0!==this._queue.Size?[3,2]:(this._timeFirstEvent=0,[4,r.SyncExecutionHelper.Instance.Wait()]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.GetTime=function(){return this._timeFirstEvent},e.prototype.poll=function(){var e;try{var t=this._queue.poll();this.isBackgroundEvent(t)&&(this._timeFirstEvent=0),e=t}finally{}return e},e.prototype.peek=function(){return this._queue.peek()},e.prototype.size=function(){return this._queue.Size},e.prototype.remainingCapacity=function(){return t.Int32.MaxValue},e.prototype.clear=function(){this._queue.clear()},e.prototype.isEmpty=function(){return this._queue.isEmpty()},e}(),w=function(a){function s(i,o,l,u,c,_){var T=a.call(this)||this;return T._controlsList=null,T._direction=0,T._displayLine=t.Int32.MinValue,T._eventSubType=e.EventSubType.Normal,T._actEnableList=null,T._argList=null,T._ctrl=null,T._dotNetObject=null,T._eventFld=null,T._fromServer=!1,T._guiTriggeredEvent=!1,T._immediate=!1,T._isIdleTimer=!1,T._isRealRefresh=!0,T._mgdId=0,T._routeParams=null,T._mprgCreator=null,T._priority=r.Priority.HIGH,T._produceClick=!1,T._reversibleExit=!0,T._selectionEnd=0,T._selectionStart=0,T._sendAll=!1,T._task=null,T._taskTag=null,T._val=null,T.IsSubTree=!1,T.IsFormFocus=!1,T.ActivatedFromMDIFrame=!1,T.PrgFlow="\0",T.CopyGlobalParams=!1,T.MainProgVars=null,T.IgnoreSpecifiedControl=!1,T.LastFocusedVal=null,1===arguments.length&&(null===i||i instanceof b)?T.constructor_5(i):2===arguments.length&&(null===i||i instanceof b)&&(null===o||o instanceof n.MgControlBase)?T.constructor_6(i,o):1===arguments.length&&(null===i||i instanceof n.MgControlBase)?T.constructor_7(i):2!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Boolean?3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Boolean||null!==l&&l.constructor!==Boolean?2!==arguments.length||!(null===i||i instanceof b)||null!==o&&o.constructor!==Boolean?1===arguments.length&&(null===i||i instanceof n.GuiFieldBase)?T.constructor_11(i):2!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number?3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number||null!==l&&l.constructor!==Boolean?3===arguments.length&&(null===i||i instanceof n.MgControlBase)&&(null===o||o instanceof t.List)&&(null===l||l.constructor===Boolean)?T.constructor_14(i,o,l):3!==arguments.length||!(null===i||i instanceof n.MgControlBase)||null!==o&&o.constructor!==Number||null!==l&&l.constructor!==Number?6===arguments.length?T.constructor_16(i,o,l,u,c,_):2===arguments.length&&(null===i||i instanceof k)&&(null===o||o instanceof s)?(a.prototype.constructor_1.call(T,i),T.constructor_17(i,o)):1===arguments.length&&i instanceof s&&Object.assign(T,i):T.constructor_15(i,o,l):T.constructor_13(i,o,l):T.constructor_12(i,o):T.constructor_10(i,o):T.constructor_9(i,o,l):T.constructor_8(i,o),T}return u(s,a),Object.defineProperty(s.prototype,"Control",{get:function(){return this._ctrl},set:function(e){this._ctrl=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"DisplayLine",{set:function(e){this._displayLine=e},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"ControlsList",{get:function(){return this._controlsList},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"Direction",{get:function(){return this._direction},enumerable:!1,configurable:!0}),s.prototype.constructor_5=function(e){this.init(e)},s.prototype.constructor_6=function(e,t){this.constructor_5(null!==t?t.getForm().getTask():e),this.Control=t},s.prototype.constructor_7=function(e){if(this.constructor_6(null,e),null!==e&&a.prototype.getType.call(this)===t.Char.MinValue){var s=e.GetComputedProperty(n.PropInterface.PROP_TYPE_TRIGGER);if(null!==s){var i=new r.XmlParser(s.GetComputedValue());a.prototype.fillData.call(this,i,e.getForm().getTask())}}},s.prototype.constructor_8=function(e,t){this.constructor_7(e),this._guiTriggeredEvent=t,t&&(this._priority=r.Priority.LOW)},s.prototype.constructor_9=function(e,t,r){this.constructor_8(e,t),this.IgnoreSpecifiedControl=r},s.prototype.constructor_10=function(e,t){this.constructor_5(e),this._guiTriggeredEvent=t,t&&(this._priority=r.Priority.LOW)},s.prototype.constructor_11=function(e){this._eventFld=e,this.init(null!==e?e.getTask():null)},s.prototype.constructor_12=function(e,t){this.constructor_7(e),this._displayLine=t},s.prototype.constructor_13=function(e,t,r){this.constructor_8(e,r),this._displayLine=t},s.prototype.constructor_14=function(e,t,r){this.constructor_8(e,r),this._controlsList=t},s.prototype.constructor_15=function(e,t,r){this.constructor_8(e,!0),this._direction=t},s.prototype.constructor_16=function(e,t,r,n,a,s){this.constructor_8(e,!0)},s.prototype.constructor_17=function(e,t){this._taskTag=t._taskTag,this._task=t._task,this.Control=t.Control,this._eventFld=t._eventFld,this._mgdId=t._mgdId,this._displayLine=t._displayLine,this._reversibleExit=t._reversibleExit,this._argList=t._argList,this._immediate=t._immediate,this._mprgCreator=t._mprgCreator,this._priority=t._priority,this._guiTriggeredEvent=t._guiTriggeredEvent,this._isIdleTimer=t._isIdleTimer,this._val=t._val,this._selectionStart=t._selectionStart,this._selectionEnd=t._selectionEnd,this._controlsList=t._controlsList,this._direction=t._direction,this._dotNetObject=t._dotNetObject,this.LastFocusedVal=t.LastFocusedVal,this._routeParams=t._routeParams},s.prototype.CompareTo=function(e){var t=e,r=t._priority-this._priority;return 0===r&&(r=this._timestamp-t._timestamp),r},s.prototype.replicate=function(){var e=new s(this);return e.setTimestamp(),e},s.prototype.init=function(e){this._task=e||o.mgDataTable.getCurrMGData().getFirstTask(),this._taskTag=null===this._task?"":this._task.getTaskTag(),this._mprgCreator=null},s.prototype.convertParamsToArgs=function(){this._argList=new L,this._argList.buildListFromParams(this._parameters,this._paramAttrs,this._paramVals,this._paramNulls),this._parameters=0,this._paramAttrs=null,this._paramVals=null,this._paramNulls=null},s.prototype.getTask=function(){return a.prototype.findUserEvent.call(this),this._task},s.prototype.setTask=function(e){this._task=e,null!==this._task?this._taskTag=this._task.getTaskTag():this._taskTag=null},s.prototype.setTimer=function(e,t,r){this._type=E.EVENT_TYPE_TIMER,this._seconds=e,this._mgdId=t,this._isIdleTimer=r},s.prototype.setClose=function(e,t){a.prototype.setInternal.call(this,t),this._mgdId=e,this._guiTriggeredEvent=!0},s.prototype.getDisplayLine=function(){return this._displayLine},s.prototype.getMgdID=function(){return this._mgdId},s.prototype.getBrkLevel=function(e){return 0===arguments.length?this.getBrkLevel_00():this.getBrkLevel_01(e)},s.prototype.getBrkLevel_00=function(){var e=a.prototype.getBrkLevel.call(this);if(this._type===E.EVENT_TYPE_INTERNAL)switch(this.InternalEvent){case r.InternalInterface.MG_ACT_CTRL_PREFIX:case r.InternalInterface.MG_ACT_CTRL_SUFFIX:case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:e+=this.Control.Name;break;case r.InternalInterface.MG_ACT_VARIABLE:e+=this._eventFld.getVarName()}return e},s.prototype.getBrkLevel_01=function(e){return a.prototype.getBrkLevel.call(this,e)},s.prototype.setCtrl=function(e){this._ctrl=e},s.prototype.setNonReversibleExit=function(){this._reversibleExit=!1},s.prototype.reversibleExit=function(){return this._reversibleExit},s.prototype.buildXML=function(e){if(e.Append("\n "+r.XMLConstants.TAG_OPEN+E.MG_TAG_EVENT),this._type!==t.Char.MinValue&&e.Append(" "+E.MG_ATTR_EVENTTYPE+'="'+this._type+'"'),this._type===E.EVENT_TYPE_SYSTEM&&null!=this.kbdItm){var a=this.kbdItm.getModifier();a!==n.Modifiers.MODIFIER_NONE&&e.Append(" "+E.MG_ATTR_MODIFIER+'="'+a+'"'),e.Append(" "+E.MG_ATTR_KEYCODE+'="'+this.kbdItm.getKeyCode()+'"')}this.InternalEvent!==t.Int32.MinValue&&e.Append(" "+E.MG_ATTR_INTERNALEVENT+'="'+this.InternalEvent+'"'),this._seconds!==t.Int32.MinValue&&e.Append(" "+E.MG_ATTR_SECONDS+'="'+this._seconds+'"'),null!=this.Exp&&e.Append(" "+r.XMLConstants.MG_ATTR_EXP+'="'+this.Exp.getId()+'"'),this._forceExit!==r.ForceExit.None&&e.Append(" "+r.XMLConstants.MG_ATTR_EXP+'="'+this._forceExit+'"'),null!=this.UserEvt&&e.Append(" "+E.MG_ATTR_USER+'="'+this.UserEvtTaskTag+","+this._userEvtIdx+'"'),e.Append(r.XMLConstants.TAG_TERM)},s.prototype.getArgList=function(){return this._argList},s.prototype.setArgList=function(e){var t=null===this._argList;return this._argList=e,t},s.prototype.setRouteParamList=function(e){this._routeParams=e},s.prototype.getRouteParamList=function(){return this._routeParams},s.prototype.setImmediate=function(e){this._immediate=e},s.prototype.isImmediate=function(){return this._immediate},s.prototype.setMainPrgCreator=function(e){this._mprgCreator=e},s.prototype.getMainPrgCreator=function(){return this._mprgCreator},s.prototype.setIsRealRefresh=function(e){this._isRealRefresh=e},s.prototype.getRefreshType=function(){return this._isRealRefresh},s.prototype.setFromServer=function(){this._fromServer=!0},s.prototype.resetFromServer=function(){this._fromServer=!1},s.prototype.isFromServer=function(){return this._fromServer},s.prototype.isQuit=function(){return this._eventSubType===e.EventSubType.CancelIsQuit},s.prototype.RollbackInCancel=function(){return this._eventSubType!==e.EventSubType.CancelWithNoRollback},s.prototype.ExitDueToError=function(){return this._eventSubType===e.EventSubType.ExitDueToError},s.prototype.RtViewRefreshUseCurrentRow=function(){return this._eventSubType===e.EventSubType.RtRefreshViewUseCurrentRow},s.prototype.SetEventSubType=function(e){this._eventSubType=e},s.prototype.getFld=function(){return this._eventFld},s.prototype.isGuiTriggeredEvent=function(){return this._guiTriggeredEvent},s.prototype.getPriority=function(){return this._priority},s.prototype.setPriority=function(e){this._priority=e},s.prototype.isIdleTimer=function(){return this._isIdleTimer},s.prototype.getValue=function(){return this._val},s.prototype.setValue=function(e){this._val=e},s.prototype.getStartSelection=function(){return this._selectionStart},s.prototype.getEndSelection=function(){return this._selectionEnd},s.prototype.setEditParms=function(e,t,r){this._selectionStart=e,this._selectionEnd=t,this.setValue(r)},s.prototype.isProduceClick=function(){return this._produceClick},s.prototype.setProduceClick=function(e){this._produceClick=e},s.prototype.setActEnableList=function(e){this._actEnableList=e},s.prototype.getActEnableList=function(){return this._actEnableList},s.prototype.isSendAll=function(){return this._sendAll},s.prototype.setSendAll=function(e){this._sendAll=e},s.prototype.isBlockedByModalWindow=function(e){if(e.IsModal){var t=this.getTask(),r=e.getTask(0);if(t!==r&&r.isDescendentOf(t))return!0}return!1},s.prototype.toString=function(){return t.NString.Format("{{RTEvent {0} ({1}), type {2}{3}}}",[this.getBrkLevel(),this.InternalEvent,this._type,null===this._task?"":" on "+this._task])},s}(x),V=function(){};V.FLWMTR_START=0,V.FLWMTR_END=1,V.FLWMTR_PROPAGATE=2,V.FLWMTR_USE_COMP=3,V.FLWMTR_EVENT=7,V.FLWMTR_CHNG_MODE=8,V.FLWMTR_PREFIX=15,V.FLWMTR_SUFFIX=16,V.FLWMTR_CTRL_PREFIX=18,V.FLWMTR_CTRL_SUFFIX=19,V.FLWMTR_TSK_HANDLER=20,V.FLWMTR_CTRL_VERIFY=21,V.FLWMTR_SORT=22,V.FLWMTR_LOCATE=23,V.FLWMTR_RANGE=24,V.FLWMTR_KEY_CHANGE=25,V.FLWMTR_TRANS=26,V.FLWMTR_LOADREC=27,V.FLWMTR_UPDATE=28,V.FLWMTR_DELETE=29,V.FLWMTR_INSERT=30,V.FLWMTR_RECOMP=31,V.FLWMTR_DATA_OPER=41,V.FLWMTR_LOG_MSG=51,V.FLWMTR_USER_MSG=96,V.FLWMTR_ERROR_MSG=97,V.FLWMTR_FREE_MSG=98,V.FLWMTR_DEBUG_MSG=99,V.FLWMTR_WARN_MSG=100,V.FLWMTR_VARCHG_VALUE=119,V.FLWMTR_VARCHG_REASON=120,V.FLWMTR_EVENT_KBD=1,V.FLWMTR_EVENT_ACT=2,V.FLWMTR_EVENT_TIME=4,V.FLWMTR_EVENT_EXP=8;var U=function(){function e(){this._queue=new r.Queue,this._enabled=!1,this._isFlowOperation=!1,this._isRecompute=!1,this._isTask=!1,this._isTaskFlow=!1,this.ShouldSerialize=!1}return Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.addTaskCngMode=function(t,n,a){var s="Task Mode Change - ";if(this._enabled&&this._isTask){var i=new B(this,e.ACT_TASK,V.FLWMTR_CHNG_MODE);switch(n){case r.Constants.TASK_MODE_MODIFY:s+="Modify";break;case r.Constants.TASK_MODE_CREATE:s+="Create";break;case r.Constants.TASK_MODE_DELETE:s+="Delete";break;case r.Constants.TASK_MODE_QUERY:s+="Query";break;default:s=null}i.setInfo(s),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(a+": "+s,!0)}},e.prototype.fillData=function(e){var t=e.getXMLdata().indexOf("/>",e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf("flwmtr_config")+"flwmtr_config".length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);return r.Logger.Instance.WriteDevToLog("in FlowMonitorQueue.FillData: "+a.toString()),this.initElements(a),void e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in FlowMonitorQueue.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var t=0;t<e.length;t+=2){var n=e.get_Item(t),a=e.get_Item(t+1);switch(r.Logger.Instance.WriteDevToLog(n+" value: "+a),n){case E.MG_ATTR_TASK:this._isTask=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_TASKFLW:this._isTaskFlow=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_RECOMP:this._isRecompute=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_FLWOP:this._isFlowOperation=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ENABLED:this.enable(r.XmlParser.getBoolean(a));break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in FlowMonitorQueue.initElements(): unknown attribute: "+n)}}},e.prototype.buildXML=function(e){if(!this._queue.isEmpty()&&this.ShouldSerialize){for(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_FLWMTR_MSG+r.XMLConstants.TAG_CLOSE);!this._queue.isEmpty();){this._queue.get().buildXML(e)}e.Append("</"+E.MG_TAG_FLWMTR_MSG+r.XMLConstants.TAG_CLOSE)}},e.prototype.isEmpty=function(){return this._queue.isEmpty()},e.prototype.enable=function(e){var t=this._enabled;return this._enabled=e,this.ShouldSerialize=this._enabled,t},e.prototype.addTaskEvent=function(t,n,a){if(this._enabled&&this._isTask){var s=new B(this,e.ACT_TASK,V.FLWMTR_EVENT),i=void 0;switch(n){case V.FLWMTR_START:i=e.S_EVENT_STR1+t+e.S_EVENT_STR2;break;case V.FLWMTR_END:i=e.E_EVENT_STR+t;break;case V.FLWMTR_PROPAGATE:i=e.S_EVENT_PROPAGATED;break;default:i=null}s.setInfo(i),this._queue.put(s),r.Logger.Instance.WriteSupportToLog(a+": "+i,!0)}},e.prototype.addTaskFlowRec=function(t,n,a){if(this._enabled&&this._isTaskFlow){var s=void 0;switch(t){case r.InternalInterface.MG_ACT_REC_PREFIX:s=n===V.FLWMTR_START?e.S_RECPRF_STR:e.E_RECPRF_STR,t=V.FLWMTR_PREFIX;break;case r.InternalInterface.MG_ACT_REC_SUFFIX:s=n===V.FLWMTR_START?e.S_RECSUF_STR:e.E_RECSUF_STR,t=V.FLWMTR_SUFFIX;break;case r.InternalInterface.MG_ACT_TASK_PREFIX:s=n===V.FLWMTR_START?e.S_TASKPRF_STR:e.E_TASKPRF_STR,t=V.FLWMTR_PREFIX;break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:s=n===V.FLWMTR_START?e.S_TASKSUF_STR:e.E_TASKSUF_STR,t=V.FLWMTR_SUFFIX;break;default:s=null}var i=new B(this,e.ACT_TASK_FLW,t);i.setInfo(s),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(a+": "+s,!0)}},e.prototype.addTaskFlowFld=function(e,t,r,n){this.addTaskFlowCtrl(e,t,r,n)},e.prototype.addTaskFlowCtrl=function(t,n,a,s){if(this._enabled&&this._isTaskFlow){var i=void 0;switch(t){case r.InternalInterface.MG_ACT_VARIABLE:i=a===V.FLWMTR_START?e.S_VARIABLE_STR:e.E_VARIABLE_STR,t=V.FLWMTR_VARCHG_VALUE;break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:i=a===V.FLWMTR_START?e.S_CTRLPRF_STR:e.E_CTRLPRF_STR,t=V.FLWMTR_CTRL_PREFIX;break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:i=a===V.FLWMTR_START?e.S_CTRLSUF_STR:e.E_CTRLSUF_STR,t=V.FLWMTR_CTRL_SUFFIX;break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:i=a===V.FLWMTR_START?e.S_CTRLVER_STR:e.E_CTRLVER_STR,t=V.FLWMTR_CTRL_SUFFIX;break;default:i=null}var o=new B(this,e.ACT_TASK_FLW,t);null!==i&&(i+=n,t===V.FLWMTR_VARCHG_VALUE&&a===V.FLWMTR_START&&(i+=e.VARIABLE_REASON_STR),o.setInfo(i),r.Logger.Instance.WriteSupportToLog(s+": "+i,!0)),this._queue.put(o)}},e.prototype.addTaskFlowHandler=function(n,a,s){if(this._enabled&&this._isTaskFlow){var i=new B(this,e.ACT_TASK_FLW,V.FLWMTR_TSK_HANDLER),o=void 0;switch(a){case V.FLWMTR_START:o=t.NString.Format(e.S_HANDLER_STR,n);break;case V.FLWMTR_END:o=t.NString.Format(e.E_HANDLER_STR,n);break;default:o=null}null!==o&&(i.setInfo(o),r.Logger.Instance.WriteSupportToLog(s+": "+o,!0)),this._queue.put(i)}},e.prototype.addRecompute=function(t,n){if(this._enabled&&this._isRecompute){var a=new B(this,e.ACT_RECOMPUTE,V.FLWMTR_RECOMP),s=e.RECOMP_STR+t;a.setInfo(s),this._queue.put(a),r.Logger.Instance.WriteSupportToLog(n+": "+s,!0)}},e.prototype.addFlowFieldOperation=function(n,a,s){return T(this,void 0,void 0,(function(){var i,o,l;return h(this,(function(u){switch(u.label){case 0:return this._enabled&&this._isFlowOperation?(i=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),o=new t.StringBuilder(e.FLW_PERFIX),[4,n.AddFlowDescription(o)]):[3,2];case 1:u.sent(),o.Append(" "),a||o.Append("[Not Executed]"),l=o.ToString(),i.setInfo(l),this._queue.put(i),r.Logger.Instance.WriteSupportToLog(s+": "+l,!0),u.label=2;case 2:return[2]}}))}))},e.prototype.addFlowOperationUpdate=function(t,n){if(this._enabled&&this._isFlowOperation){var a=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),s=void 0;s=t===V.FLWMTR_START?"Starts Update":"Ends Update",a.setInfo(s),this._queue.put(a),r.Logger.Instance.WriteSupportToLog(n+": "+s,!0)}},e.prototype.addFlowVerifyInfo=function(e,t){this.addFlowInfo(e,t)},e.prototype.addFlowInvokeOsInfo=function(e,t){this.addFlowInfo(e,t)},e.prototype.addFlowInfo=function(n,a){if(this._enabled){var s=new B(this,e.ACT_FLW_OPER,V.FLWMTR_DATA_OPER),i=new t.StringBuilder("");""!==n&&(i.Append(" >> INFORMATION >> "),i.Append(n));var o=i.ToString();s.setInfo(o),this._queue.put(s),r.Logger.Instance.WriteSupportToLog(a+": "+o,!0)}},e}();U._instance=null,U.S_EVENT_STR1=">>Starts ",U.S_EVENT_STR2=" Event",U.S_EVENT_PROPAGATED="Event was propagated",U.E_EVENT_STR="<<Ends Event",U.TSK_CHNG_MODE="Task Mode Change - ",U.S_RECPRF_STR="Starts Record Prefix",U.E_RECPRF_STR="Ends Record Prefix",U.S_RECSUF_STR="Starts Record Suffix",U.E_RECSUF_STR="Ends Record Suffix",U.S_TASKSUF_STR="Starts Task Suffix",U.E_TASKSUF_STR="Ends Task Suffix",U.S_TASKPRF_STR="Starts Task Prefix",U.E_TASKPRF_STR="Ends Task Prefix",U.S_CTRLPRF_STR="Starts Control Prefix - ",U.E_CTRLPRF_STR="Ends Control Prefix - ",U.S_CTRLSUF_STR="Starts Control Suffix - ",U.E_CTRLSUF_STR="Ends Control Suffix - ",U.S_HANDLER_STR="Starts handling event {0}",U.E_HANDLER_STR="Ends handling event {0}",U.S_CTRLVER_STR="Starts Control Verification for Control - ",U.E_CTRLVER_STR="Ends Control Verification for Control - ",U.RECOMP_STR="Recomputes - ",U.S_VARIABLE_STR="Starts Variable Change - ",U.E_VARIABLE_STR="Ends Variable Change - ",U.VARIABLE_REASON_STR=" - Reason - Previous value",U.INFORM_STR=" >> INFORMATION >> ",U.FLW_STEP_FWD="(Step Forward)",U.FLW_FAST_FWD="(Fast Forward)",U.FLW_STEP_BWD="(Step Backward)",U.FLW_FAST_BWD="(Fast Backward)",U.FLW_NOT_EXEC="[Not Executed]",U.FLW_FORWARD="(Forward)",U.FLW_BACKWARD="(Backward)",U.FLW_PERFIX="Flow - ",U.S_UPDATE_STR="Starts Update",U.E_UPDATE_STR="Ends Update",U.ACT_TASK="T",U.ACT_TASK_FLW="F",U.ACT_RECOMPUTE="R",U.ACT_FLW_OPER="T",U.LongTimePattern="HH:mm:ss:SSS";var B=function(){function e(e,t,r){this._enclosingInstance=null,this._id=0,this._type=null,this._info=null,this._time=null,this._enclosingInstance=e,this._type=t,this._id=r,this.setTime()}return e.prototype.setTime=function(){this._time=r.DateTimeUtils.ToString(t.DateTime.Now,U.LongTimePattern,r.Logger.Instance)},e.prototype.setInfo=function(e){this._info=null!==e?r.XmlParser.escape(e):e},e.prototype.buildXML=function(e){e.Append(r.XMLConstants.START_TAG+E.MG_TAG_FLWMTR_ACT),e.Append(" "+r.XMLConstants.MG_ATTR_TYPE+'="'+this._type+'"'),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),null!=this._info&&e.Append(" "+E.MG_ATTR_INFO+'="'+this._info+'"'),e.Append(" "+E.MG_ATTR_TIME+'="'+this._time+'"'),e.Append(r.XMLConstants.TAG_TERM)},e}(),X=function(){};X.MgDataToTimerObjList=new t.Dictionary;var H,W,K=function(e){function r(r,n,a){var s=e.call(this,n)||this;s._mgData=null,s._isIdle=!1,s._mgData=r,s.IsIdleTimer=a;var i=s._mgData.GetId().toString();return X.MgDataToTimerObjList.ContainsKey(i)||X.MgDataToTimerObjList.Add(i,new t.List),X.MgDataToTimerObjList.get_Item(i).push(s),s}return u(r,e),Object.defineProperty(r.prototype,"TimerIntervalMiliSeconds",{get:function(){return this._timerIntervalMilliSeconds},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"IsIdleTimer",{get:function(){return this._isIdle},set:function(e){this._isIdle=e},enumerable:!1,configurable:!0}),r.prototype.GetMgdata=function(){return this._mgData},r.StopTimer=function(e,t,r){var n=null,a=null,s=e.GetId().toString();X.MgDataToTimerObjList.ContainsKey(s)&&(null!=(a=(n=X.MgDataToTimerObjList.get_Item(s)).find((function(e){return null!==e&&e._timerIntervalMilliSeconds===t&&e._isIdle===r})))&&(a.Stop(),n.Remove(a)),0===n.length&&X.MgDataToTimerObjList.Remove(s))},r.StopAll=function(e){var t=null,r=e.GetId().toString();X.MgDataToTimerObjList.ContainsKey(r)&&(t=X.MgDataToTimerObjList.get_Item(r)),null!==t&&(t.forEach((function(e){null!==e&&e.Stop()})),t.Clear(),X.MgDataToTimerObjList.Remove(r))},r}(n.MgTimer),Y=function(){function e(e,t,r){this.TaskId=null,this.HandlerId=null,this.OperIdx=0,this.TaskId=e,this.HandlerId=t,this.OperIdx=r}return e.prototype.Equals=function(t){var r=t instanceof e?t:null;return null!==r&&r.HandlerId===this.HandlerId&&r.TaskId===this.TaskId&&r.OperIdx===this.OperIdx},e}(),z=function(){function e(e){this._execStack=null,0!==arguments.length?this.constructor_1(e):this.constructor_0()}return e.prototype.constructor_0=function(){this._execStack=new t.Stack},e.prototype.constructor_1=function(e){this._execStack=e.getStack().Clone()},e.prototype.getStack=function(){return this._execStack},e.prototype.push=function(e,t,r){1===arguments.length?this.push_0(e):this.push_1(e,t,r)},e.prototype.push_0=function(e){this._execStack.push(e)},e.prototype.push_1=function(e,t,r){var n=new Y(e,t,r);this._execStack.push(n)},e.prototype.pop=function(){return this._execStack.pop()},e.prototype.empty=function(){return 0===this._execStack.count()},e.prototype.clear=function(){this._execStack.Clear()},e.prototype.size=function(){return this._execStack.count()},e.prototype.Equals=function(t){var r=new e(this),n=new e(t),a=!1;if(r.size()===n.size())for(a=!0;!r.empty()&&a;)r.pop().Equals(n.pop())||(a=!1);return a},e.prototype.pushUpSideDown=function(t){for(var r=new e(t);!r.empty();){var n=r.pop();this._execStack.push(n)}},e.prototype.reverse=function(){var t=new e(this);for(this.clear();!t.empty();){var r=t.pop();this.push(r)}},e.prototype.buildXML=function(e){for(var n=new t.StringBuilder;0!==this._execStack.count();){var a=this._execStack.pop();t.NNumber.Parse(a.TaskId)>E.INITIAL_OFFLINE_TASK_TAG?n.Remove(0,n.Length):(n.Append("\n "+r.XMLConstants.TAG_OPEN+E.MG_TAG_EXEC_STACK_ENTRY),n.Append(" "+r.XMLConstants.MG_ATTR_TASKID+'="'+a.TaskId+'"'),n.Append(" "+E.MG_ATTR_HANDLERID+'="'+a.HandlerId+'"'),n.Append(" "+E.MG_ATTR_OPER_IDX+'="'+a.OperIdx+'"'),n.Append(" "+r.XMLConstants.TAG_TERM))}e.Append(n.ToString())},e}(),q=function(e){function n(){var r=e.call(this)||this;return r.ExecutionStack=null,r.TaskTag=null,r.HandlerId=null,r.OperIdx=0,r.DitIdx=0,r.Val=null,r.MprgCreator=null,r.Operation=null,r.CheckOnly=!1,r.DitIdx=t.Int32.MinValue,r}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EXEC_OPER},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){var n=new A,a=null!==this.ExecutionStack&&!this.ExecutionStack.empty();return n.SerializeTaskTag(this.TaskTag),null===this.HandlerId||a||n.SerializeAttribute(E.MG_ATTR_HANDLERID,this.HandlerId),this.OperIdx>t.Int32.MinValue&&!a&&n.SerializeAttribute(E.MG_ATTR_OPER_IDX,this.OperIdx),this.DitIdx>t.Int32.MinValue&&n.SerializeDitIdx(this.DitIdx),null!=this.Operation&&this.Operation.getType()===E.MG_OPER_CALL&&null!==this.Operation.getRouteParams()&&n.SerializeRouteParams(this.Operation),null!==this.Val&&n.SerializeAttribute(r.XMLConstants.MG_ATTR_VALUE,r.XmlParser.escape(this.Val)),this.CheckOnly&&n.SerializeAttribute(E.MG_ATTR_CHECK_ONLY,"1"),n.GetString()},n.prototype.SetExecutionStack=function(e){this.ExecutionStack=new z,this.ExecutionStack.push(o.mgDataTable.getTaskIdById(this.TaskTag),this.HandlerId,this.OperIdx),this.ExecutionStack.pushUpSideDown(e)},n.prototype.SerializeDataAfterCommand=function(){if(null!==this.ExecutionStack&&!this.ExecutionStack.empty()){var e=new t.StringBuilder;return this.ExecutionStack.buildXML(e),e.ToString()}return null},n.prototype.getCommandInfo=function(){return"Line number ["+(this.Operation.getServerId()+1)+"] in ["+this.Operation.getEventHandler().getEventHandlerInfo()+"] on ["+this.Operation.Task.getTaskInfo()+"]"},n.prototype.getTask=function(){return this.Operation.Task},n}(C),j=function(){function e(){}return e.Scramble=function(r){if(!this.ScramblingEnabled)return r;var n,a=0,s=r.length,i=e.RandomScramble(s),o=Math.floor(Math.sqrt(s))+i,l=new t.StringBuilder(s+1);l.Append(String.fromCharCode(i+81));for(var u=0;u<o;u++)for(a=u;a<s;)n=r[a],l.Append(n),a+=o;return l.Append("_"),l.ToString()},e.LocateScramble=function(e,r){for(var n=r;n<e.length&&t.NChar.IsWhiteSpace(e.charAt(n));)n+=1;return n+1},e.RandomScramble=function(t){var r,n=Math.sqrt(t),a=e.XML_MIN_RANDOM,s=e.XML_MAX_RANDOM;return a<-1*n/2&&(a=Math.floor(-1*n/2)),s>n/2&&(s=Math.floor(n/2)),r=Math.random()*(s-a)+a,(r=Math.floor(r))===e.XML_ILLEGAL_RANDOM&&r++,r},e.UnScramble=function(r,n,a){if(e.ScramblingEnabled){var s,i,o,l,u,c=void 0,_=void 0,T=void 0,h=(p=void 0,void 0);for(s=(a-=1)-(u=this.LocateScramble(r,n))+1,i=r[u-1].charCodeAt(0)-81+Math.floor(Math.sqrt(s)),p=new Array(s),o=Math.floor(s/i),l=s%i,T=c=0;c<s;T++)for(_=T,h=1;_<s&&c<s;)p[c]=r[_+u],_+=o,h<=l&&_++,c++,h++;return t.NString.FromChars(p)}var p;return p=r.substr(n,a-n+1)},e}();j.ScramblingEnabled=!0,j.XML_MIN_RANDOM=-48,j.XML_MAX_RANDOM=47,j.XML_ILLEGAL_RANDOM=-21,e.CommandsProcessorBase_SessionStage=void 0,(H=e.CommandsProcessorBase_SessionStage||(e.CommandsProcessorBase_SessionStage={}))[H.HANDSHAKE=1]="HANDSHAKE",H[H.INITIAL=2]="INITIAL",H[H.NORMAL=3]="NORMAL",e.CommandsProcessorBase_SendingInstruction=void 0,(W=e.CommandsProcessorBase_SendingInstruction||(e.CommandsProcessorBase_SendingInstruction={}))[W.NO_TASKS_OR_COMMANDS=0]="NO_TASKS_OR_COMMANDS",W[W.ONLY_COMMANDS=1]="ONLY_COMMANDS",W[W.TASKS_AND_COMMANDS=2]="TASKS_AND_COMMANDS";var Q=function(){function t(){this._sessionCounter=0}return t.prototype.GetSessionCounter=function(){return this._sessionCounter},t.prototype.Execute=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return a.isNullOrUndefined(t)?[4,this.Execute_0(e)]:[3,2];case 1:case 3:return n.sent(),[2];case 2:return[4,this.Execute_1(e,t,r)]}}))}))},t.prototype.Execute_0=function(t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.Execute_1(t,e.CommandsProcessorBase_SessionStage.NORMAL,null)];case 1:return r.sent(),[2]}}))}))},t.UnScramble=function(e){var t,n=e.indexOf(r.XMLConstants.MG_TAG_OPEN);if(-1!==n){var a=n+r.XMLConstants.MG_TAG_OPEN.length,s=e.substr(0,a),i=e.lastIndexOf(r.XMLConstants.TAG_OPEN),o=e.substr(i);t=s+j.UnScramble(e,a,i-1)+o}else t=j.UnScramble(e,0,e.length-1);return t},t}(),Z=function(){function e(){}return e.GetHttpCommunicationTimeout=function(){return null!==e.GetHttpCommunicationTimeout_Event?e.GetHttpCommunicationTimeout_Event():5e3},e.GetExecutionProperty=function(t){return null!==e.GetExecutionProperty_Event?e.GetExecutionProperty_Event(t):null},e.GetGlobalUniqueSessionID=function(){return null!==e.GetGlobalUniqueSessionID_Event?e.GetGlobalUniqueSessionID_Event():null},e.ShouldDisplayGenericError=function(){return null===e.ShouldDisplayGenericError_Event||e.ShouldDisplayGenericError_Event()},e.GetRuntimeCtxID=function(){return null!==e.GetRuntimeCtxID_Event?e.GetRuntimeCtxID_Event():""},e.GetSessionCounter=function(){return null!==e.GetSessionCounter_Event?e.GetSessionCounter_Event():0},e.CheckAndSetSessionCounter=function(t){null!==e.CheckAndSetSessionCounter_Event&&e.CheckAndSetSessionCounter_Event(t)},e.ComputeAndLogRequestInfo=function(t,r,n){null!==e.ComputeAndLogRequestInfo_Event&&e.ComputeAndLogRequestInfo_Event(t,r,n)},e}();Z.GetHttpCommunicationTimeout_Event=null,Z.GetExecutionProperty_Event=null,Z.GetGlobalUniqueSessionID_Event=null,Z.ShouldDisplayGenericError_Event=null,Z.GetRuntimeCtxID_Event=null,Z.GetSessionCounter_Event=null,Z.CheckAndSetSessionCounter_Event=null,Z.ComputeAndLogRequestInfo_Event=null;var J;e.RequestMethod=void 0,(J=e.RequestMethod||(e.RequestMethod={}))[J.Get=0]="Get",J[J.Post=1]="Post",J[J.Put=2]="Put",J[J.Delete=3]="Delete",J[J.Options=4]="Options",J[J.Head=5]="Head",J[J.Patch=6]="Patch";var $=function(){function n(){this._HTTPMaxURLLength=2048,this.CommunicationsFailureHandler=null,this.CommunicationsFailureHandler=null}return n.prototype.DecideOnRequestMethod=function(t,r){var n=e.RequestMethod.Get;return null===t?n=e.RequestMethod.Get:r.value.length+1+t.length<=this._HTTPMaxURLLength?(r.value=r.value+"?"+t,n=e.RequestMethod.Get):n=e.RequestMethod.Post,n},n.prototype.GetContent=function(e,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:o=new t.RefParam(null),l=new t.RefParam(e),u=this.DecideOnRequestMethod(s,l),e=l.value,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this.ExecuteHttpRequest(e,s,i,u,o)];case 2:return null!=(c=h.sent())&&(r.Logger.Instance.WriteServerToLog("Incoming Headers : "+n.HeadersToString(c.headers,!0)),_=c.headers.get("MgxpaNextSessionCounter".toLowerCase()),a.isNullOrUndefined(_)||Z.CheckAndSetSessionCounter(+_)),[3,4];case 3:throw T=h.sent(),r.Logger.Instance.WriteWarningToLog(T),T;case 4:return[2,o.value]}}))}))},n.prototype.ExecuteHttpRequest=function(i,o,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,E,I,f,C,A,R,S;return h(this,(function(h){switch(h.label){case 0:_=null,this.prepareRequest(u,i),T=Z.GetHttpCommunicationTimeout(),p=Z.GetGlobalUniqueSessionID(),g=0,d=r.Misc.getSystemMilliseconds(),h.label=1;case 1:0,g++,h.label=2;case 2:return h.trys.push([2,4,,5]),E=new s.HttpHeaders,E=this.addHeaders(i,l,E,p),r.Logger.Instance.WriteServerToLog(t.NString.Format("Request Timeout set to {0} ms",T)),r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&(I=0,u===e.RequestMethod.Get?2===(f=i.split("?")).length&&(I=f[1].length):I=o.length,r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageLeaving,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),p,Z.ShouldDisplayGenericError()?"-":new URL(i).host,0,"-",JSON.stringify(E),I)),C=r.Misc.getSystemMilliseconds(),r.Logger.Instance.WriteServerToLog(t.NString.Format("Accessing (method: '{0}'): '{1}'",u,i)),r.Logger.Instance.WriteServerToLog("Outgoing Headers : "+n.HeadersToString(E,!1)),e.RequestMethod.Post,A=r.Misc.getSystemMilliseconds(),this.LogRequestInfo(a.isNullOrUndefined(o)?0:o.length,A,!1),[4,this.sendRequestToServer(u,i,E,o,c,C,p)];case 3:return _=h.sent(),this.logResponse(_,p,i,c,C),this.LogRequestInfo(a.isNullOrUndefined(o)?0:o.length,r.Misc.getSystemMilliseconds()-A,!0),[3,6];case 4:return R=h.sent(),r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic?r.Logger.Instance.WriteBasicErrorToLog(Z.GetRuntimeCtxID(),Z.GetSessionCounter(),p,Z.ShouldDisplayGenericError()?"-":new URL(i).host,R):r.Logger.Instance.WriteWarningToLog(R),this.handleHttpErrorException(R,i),S=new t.RefParam(d),this.shouldRetry(T,i,this.CommunicationsFailureHandler,R,S)?(d=S.value,[3,1]):(this.logAndThrowException(R),[3,5]);case 5:return[3,1];case 6:return this.logExecutionAttempts(g),[2,_]}}))}))},n.prototype.LogRequestInfo=function(e,t,n){r.Logger.Instance.LogLevel==r.Logger_LogLevels.RequestInfo&&Z.ComputeAndLogRequestInfo(e,t,n)},n.HeadersToString=function(e,r){var n=new t.StringBuilder,a=e.keys();for(var s in a)r&&!a[s].startsWith("Mg")||n.Append(t.NString.Format("{0}:{1} ",a[s],e.get(a[s])));return n},n.GetHTTPExpect100Continue=function(){var e=!0,r=Z.GetExecutionProperty("Expect100Continue");return t.NString.IsNullOrEmpty(r)||(e="Y"===r.toUpperCase()),e},n.GetUseHighestSecurityProtocol=function(){var e=!1,r=Z.GetExecutionProperty("UseHighestSecurityProtocol");return t.NString.IsNullOrEmpty(r)||(e="Y"===r.toUpperCase()),e},n}(),ee=function(e){function n(){var t=e.call(this)||this;return t.httpRequest=null,t.headers=new Headers,t}return u(n,e),n.prototype.prepareRequest=function(e,t){},n.prototype.addHeaders=function(e,t,r,n){return e.startsWith("/")||this.headers.append("MgxpaRIAglobalUniqueSessionID",n),t||this.headers.append("Cache-Control","no-cache"),r},n.prototype.sendRequestToServer=function(e,r,n,a,s,i,o){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,fetch(r,{method:"POST",headers:this.headers,body:a,keepalive:!0})];case 1:return e.sent(),[2,t.NString.Empty]}}))}))},n.prototype.logResponse=function(e,t,n,a,s){var i=r.Misc.getSystemMilliseconds()-s;r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageEntering,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),t,Z.ShouldDisplayGenericError()?"-":new URL(n).host,i,this.httpRequest.status.toString(),JSON.stringify(this.httpRequest.getAllResponseHeaders()),a.value.length)},n.prototype.handleHttpErrorException=function(e,t){throw e},n.prototype.shouldRetry=function(e,t,r,n,a){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,!1]}))}))},n.prototype.logAndThrowException=function(e){},n.prototype.logExecutionAttempts=function(e){},n}($),te=function(n){function a(e){var t=n.call(this)||this;return t.httpClient=e,t}return u(a,n),a.prototype.prepareRequest=function(e,t){},a.prototype.addHeaders=function(e,t,r,n){return e.startsWith("/")||(r=r.append("MgxpaRIAglobalUniqueSessionID",n)),t||(r=r.append("Cache-Control","no-cache")),r},a.prototype.sendRequestToServer=function(t,r,n,a,s,i,o){return T(this,void 0,void 0,(function(){var i;return h(this,(function(o){switch(o.label){case 0:return[4,this.httpClient.request(e.RequestMethod[t],r,{headers:n,responseType:"text",observe:"response",body:a}).toPromise()];case 1:return i=o.sent(),s.value=i.body,[2,i]}}))}))},a.prototype.logResponse=function(e,t,n,a,s){var i=e.status,o=r.Misc.getSystemMilliseconds()-s;r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteBasicToLog(r.Logger_MessageDirection.MessageEntering,Z.GetRuntimeCtxID(),Z.GetSessionCounter(),t,Z.ShouldDisplayGenericError()?"-":new URL(n).host,o,i.toString(),JSON.stringify(e.headers),a.value.length)},a.prototype.handleHttpErrorException=function(e,r){if(e instanceof s.HttpErrorResponse){var n=e.status;if(404===n||403===n)throw new t.WebException(new Error("bad URL: "+r+" - StatusCode = "+n),n)}},a.prototype.shouldRetry=function(e,n,a,s,i){return T(this,void 0,void 0,(function(){var o,l;return h(this,(function(u){switch(u.label){case 0:return o=Math.floor(e/10),(l=r.Misc.getSystemMilliseconds()-i.value+o)<=e?[4,t.Thread.Sleep(o)]:[3,2];case 1:return u.sent(),r.Logger.Instance.WriteWarningToLogWithMsg(t.NString.Format("Retrying {0} : elapsed time {1:N0}ms out of {2:N0}ms",n,l,e)),[2,!0];case 2:return r.Logger.Instance.WriteWarningToLogWithMsg(t.NString.Format("{0} : http timeout {1:N0}ms expired",n,e)),null!=a&&(a.CommunicationFailed(n,s),a.ShouldRetryLastRequest)?(r.Logger.Instance.WriteServerToLog(t.NString.Format("Retrying {0}, confirmed by user ...",n)),i.value=r.Misc.getSystemMilliseconds(),[2,!0]):[2,!1]}}))}))},a.prototype.logAndThrowException=function(e){throw r.Logger.Instance.WriteWarningToLogWithMsg("Re-throwing ..."),r.Logger.Instance.WriteWarningToLog(e),new t.WebException(e)},a.prototype.logExecutionAttempts=function(e){e>1&&r.Logger.Instance.WriteServerToLog(t.NString.Format("Succeeded after {0} attempts ...",e))},a}($),re=function(){function e(){this._httpCommunicationTimeoutMS=e.DEFAULT_HTTP_COMMUNICATION_TIMEOUT,this._httpClientAsync=null,this._isAbortingMagicEngine=!1,this._httpClientAsync=new te(e._nativeHttpClient),this.RegisterBasicDelegates()}return e.prototype.getHttpClient=function(){return this.IsAbortingMagicEngine?new ee:this._httpClientAsync},Object.defineProperty(e.prototype,"HttpCommunicationTimeoutMS",{set:function(e){this._httpCommunicationTimeoutMS=e},enumerable:!1,configurable:!0}),e.setNativeHttpClient=function(t){e._nativeHttpClient=t},e.GetInstance=function(){return null===e._instance&&(e._instance=new e),e._instance},Object.defineProperty(e.prototype,"IsAbortingMagicEngine",{get:function(){return this._isAbortingMagicEngine},set:function(e){this._isAbortingMagicEngine=e},enumerable:!1,configurable:!0}),e.prototype.RegisterBasicDelegates=function(){Z.GetHttpCommunicationTimeout_Event=this.GetHttpCommunicationTimeoutMS.bind(this)},e.prototype.GetHttpCommunicationTimeoutMS=function(){return this._httpCommunicationTimeoutMS},e.prototype.SetCommunicationsFailureHandler=function(e){this.getHttpClient().CommunicationsFailureHandler=e},e.prototype.GetContent=function(n,a,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c;return h(this,(function(_){switch(_.label){case 0:t.Debug.Assert(null!=this.getHttpClient()),_.label=1;case 1:return _.trys.push([1,3,4,5]),r.Logger.Instance.WriteServerToLog("*************************************************************************************************"),i.value=!1,r.Logger.Instance.WriteServerToLog(n),e.LogAccessToServer("",a),[4,this.getHttpClient().GetContent(n,a,s)];case 2:return o=_.sent(),t.Debug.Assert(null!==o),null!==(l=e.CheckAndGetErrorResponse(o))&&(o=l,i.value=!0),[2,o];case 3:throw u=_.sent(),c=new URL(n),new t.ApplicationException(u.Message+"\n"+c.origin+c.pathname,u);case 4:return[7];case 5:return[2]}}))}))},e.CheckAndGetErrorResponse=function(e){var t=null;return e.startsWith(E.V24_RIA_ERROR_PREFIX)&&(t=e.substr(E.V24_RIA_ERROR_PREFIX.length)),t},e.LogAccessToServer=function(e,n){r.Logger.Instance.ShouldLogServerRelatedMessages()&&(t.NString.IsNullOrEmpty(e)||(e+="; accessing server ..."),null===n?t.NString.IsNullOrEmpty(e)||r.Logger.Instance.WriteServerToLog(e):(t.NString.IsNullOrEmpty(e)||(e+=" "),e=e+"uploading "+n.length+" bytes",r.Logger.Instance.WriteServerToLog(e)))},e}();re._instance=null,re.DEFAULT_HTTP_COMMUNICATION_TIMEOUT=5e3,re.DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT=2e3,re._nativeHttpClient=null;var ne=function(){function e(){this._protocol=null,this._server=null,this._httpReq=null,this._appName=null,this._serverUrl=null}return e.prototype.Init=function(e){this._executionProps=e},e.prototype.ShouldDisplayGenericError=function(){return this._executionProps.DisplayGenericError},e.prototype.setUsername=function(e){this._executionProps[E.MG_TAG_USERNAME]=e},e.prototype.setPassword=function(e){this._executionProps[E.MG_TAG_PASSWORD]=e},e.prototype.setSkipAuthenticationDialog=function(e){this._executionProps[E.REQ_SKIP_AUTHENTICATION]=e.toString()},e.prototype.setGlobalParams=function(e){null!==e?this._executionProps[E.MG_TAG_GLOBALPARAMS]=e:delete this._executionProps[E.MG_TAG_GLOBALPARAMS]},e.prototype.getGlobalParams=function(){var e=this._executionProps[E.MG_TAG_GLOBALPARAMS];return void 0===e?null:e},e.prototype.getProtocol=function(){return null===this._protocol&&(this._protocol=this._executionProps.protocol),this._protocol},e.prototype.getServer=function(){return null===this._server&&(this._server=this._executionProps.server),this._server},e.prototype.getHttpReq=function(){if(null===this._httpReq&&(this._httpReq=this._executionProps.requester,null!==this._httpReq)){for(;this._httpReq.startsWith("/");)this._httpReq=this._httpReq.substr(1);for(;this._httpReq.endsWith("/");)this._httpReq=this._httpReq.substr(0,this._httpReq.length-1)}return this._httpReq},e.prototype.getAppName=function(){return null===this._appName&&(this._appName=this._executionProps.appname),this._appName},e.prototype.getInternalLogLevel=function(){return this._executionProps.InternalLogLevel},e.prototype.setInternalLogLevel=function(e){this._executionProps.InternalLogLevel=e},e.prototype.getInternalLogSync=function(){return this._executionProps.InternalLogSync},e.prototype.getUsername=function(){var e=this._executionProps[E.MG_TAG_USERNAME];return void 0===e?null:e},e.prototype.getPassword=function(){var e=this._executionProps[E.MG_TAG_PASSWORD];return void 0===e?null:e},e.prototype.getCtxGroup=function(){var e=this._executionProps[E.CTX_GROUP];return void 0===e?null:e},e.prototype.setCtxGroup=function(e){this._executionProps[E.CTX_GROUP]=e},e.prototype.getSkipAuthenticationDialog=function(){var e=this._executionProps[E.REQ_SKIP_AUTHENTICATION];return!t.NString.IsNullOrEmpty(e)&&e===(!0).toString()},e.prototype.GetFirstHttpRequestTimeout=function(){var e=this._executionProps.FirstHTTPRequestTimeout;return e>0?1e3*e:re.DEFAULT_OFFLINE_HTTP_COMMUNICATION_TIMEOUT},e.prototype.GetExecutionProperty=function(e){var t=this._executionProps[e];return void 0===t?null:t},e.prototype.getServerURL=function(){if(null===this._serverUrl){var t=e.Instance.getHttpReq();null!==t&&t.toLowerCase().startsWith("http")?this._serverUrl=t:this._serverUrl=e.Instance.getProtocol()+"://"+e.Instance.getServer()+"/"+e.Instance.getHttpReq()}return this._serverUrl},e.prototype.IsLogonRTL=function(){var t=e.Instance.GetExecutionProperty[n.GuiConstants.STR_LOGON_RTL];return null!=t&&"Y"===t},e}();ne.Instance=new ne;var ae=function(e){function n(t,r){var n=e.call(this,t)||this;return n._code=0,1===arguments.length||a.isNullOrUndefined(r)||("number"==typeof r?n._code=r:n.InnerException=r,n.errorLevel=3),n}return u(n,e),n.prototype.GetCode=function(){return this._code},n.prototype.GetMessage=function(){var e;if(ne.Instance.ShouldDisplayGenericError()&&this.GetCode()>0){var n=o.languageData.getConstMessage(r.MsgInterface.STR_GENERIC_ERROR_MESSAGE);n=r.StrUtil.replaceStringTokens(n,"%d",1,"{0}"),e=t.NString.Format(n,this.GetCode())}else e=this.Message;return e},n}(t.ApplicationException);ae.INF_NO_RESULT=-11,ae.ERR_CTX_NOT_FOUND=-197,ae.ERR_AUTHENTICATION=-157,ae.ERR_ACCESS_DENIED=-133,ae.ERR_LIMITED_LICENSE_CS=-136,ae.ERR_UNSYNCHRONIZED_METADATA=-271,ae.ERR_CANNOT_EXECUTE_OFFLINE_RC_IN_ONLINE_MODE=-272,ae.ERR_INCOMPATIBLE_CLIENT=-275,ae.ERR_WEBCLIENT_PROGRAM_RELOADED=-278,ae.ERR_EXECUTED_PROGRAM_CHANGED=-283,ae.ERR_THREAD_ABORTED=-138;var se=function(){function e(){}return e.ASCIIGetString=function(e){return t.Encoding.ASCII.GetString(e,0,e.length)},e.IntToHexCharCode=function(e){return e<=9?e+48:e-10+97},e.IsSafe=function(e){if(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9")return!0;switch(e){case"'":case"(":case")":case"*":case"-":case".":case"_":case"!":return!0}return!1},e.UrlEncode=function(n,a){var s=null;return null!==n&&(s=e.ASCIIGetString(e.UrlEncodeToBytes(n,a)),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("\n String: {0} \n UrlEncoded by: {1} \n To: {2}",n,a,s))),s},e.UrlEncodeToBytes=function(t,r){if(null===t)return null;var n=r.GetBytes(t);return e.UrlEncodeBytesToBytesInternal(n,0,n.length)},e.UrlEncodeBytesToBytesInternal=function(t,r,n){if(!e.EncodingEnabled)return t;for(var a=0,s=0,i=0;i<n;i++){" "===(_=String.fromCharCode(t[r+i]))?a=a++:e.IsSafe(_)||(s+=1)}if(0===a&&0===s)return t;for(var o=new Uint8Array(n+2*s),l=0,u=0;u<n;u++){var c=t[r+u],_=String.fromCharCode(c);e.IsSafe(_)?o[l++]=c:" "===_?o[l++]=43:(o[l++]=37,o[l++]=e.IntToHexCharCode(c>>4&15),o[l++]=e.IntToHexCharCode(15&c))}return o},e}();se.EncodingEnabled=!0;var ie,oe=function(){function a(){this._mgDataTab=new t.List,this._iteratorMgdIdx=0,this._iteratorTaskIdx=0,this.currMgdID=0,this.StartupMgData=null,this._lastRouteSentToServer=""}return a.prototype.GetTaskByID=function(e){for(var t=null,r=0;r<this.getSize()&&null==t;r++){var n=this.getMGData(r);null!=n&&(t=n.getTask(e))}return t},Object.defineProperty(a,"Instance",{get:function(){return null==a._instance&&null==a._instance&&(a._instance=new a),a._instance},enumerable:!1,configurable:!0}),a.prototype.addMGData=function(e,r,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:if(r<0||r>this.getSize())throw new t.ApplicationException("Illegal MGData requested");return n&&(this.StartupMgData=e),r!==this.getSize()?[3,1]:(this._mgDataTab.push(e),[3,4]);case 1:return null==(a=this.getMGData(r))||a.IsAborting?[3,3]:[4,a.getFirstTask().stop()];case 2:s.sent(),a.abort(),s.label=3;case 3:this._mgDataTab.set_Item(r,e),s.label=4;case 4:return[2]}}))}))},a.prototype.getMGData=function(e){var t=null;return e>=0&&e<this.getSize()&&(t=this._mgDataTab.get_Item(e)),t},a.prototype.getAvailableIdx=function(){var e;for(e=0;e<this._mgDataTab.length&&null!==this._mgDataTab.get_Item(e);e+=1);return e},a.prototype.getMgDataIdx=function(e){return this._mgDataTab.indexOf(e)},a.prototype.deleteMGDataTree=function(e){var r,n,a;if(e<0||e>=this.getSize())throw new t.ApplicationException("in deleteMGData() illegal index: "+e);if(null!=(r=this.getMGData(e)))for(e>0&&null!=r.getParentMGdata()&&this._mgDataTab.set_Item(e,null),G.Instance.clean(e),a=0;a<this.getSize();a++)null!=(n=this.getMGData(a))&&n.getParentMGdata()===r&&this.deleteMGDataTree(a)},a.prototype.getCurrMGData=function(){return this.getMGData(this.currMgdID)},a.prototype.GetMainProgByCtlIdx=function(e,t){return 2===arguments.length?this.GetMainProgByCtlIdx_0(e,t):this.GetMainProgByCtlIdx_1(e)},a.prototype.GetMainProgByCtlIdx_0=function(e,t){for(var r=null,n=0;n<this.getSize()&&null==r;n++){var a=this.getMGData(n);null!=a&&(r=a.getMainProg(t))}return r},a.prototype.GetMainProgByCtlIdx_1=function(e){return this.GetMainProgByCtlIdx(-1,e)},a.prototype.startTasksIteration=function(){this._iteratorMgdIdx=0,this._iteratorTaskIdx=0},a.prototype.getNextTask=function(){var e,t=this.getMGData(this._iteratorMgdIdx);if(null==t)return null;if(null==(e=t.getTask(this._iteratorTaskIdx))){do{this._iteratorMgdIdx++}while(this._iteratorMgdIdx<this.getSize()&&null==this.getMGData(this._iteratorMgdIdx));return this._iteratorTaskIdx=0,this.getNextTask()}return this._iteratorTaskIdx++,e},a.prototype.buildXML=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i;return h(this,(function(o){switch(o.label){case 0:(a=n.Commands.getLastRoute())!==this._lastRouteSentToServer&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_LAST_ROUTE),e.Append(" "+E.MG_ATTR_ENV_VALUE+'="'+a+'"'),e.Append(r.XMLConstants.TAG_TERM),this._lastRouteSentToServer=a),s=0,o.label=1;case 1:return s<this.getSize()?null===(i=this.getMGData(s))||i.IsAborting?[3,3]:[4,i.buildXML(e,t)]:[3,4];case 2:o.sent(),o.label=3;case 3:return s+=1,[3,1];case 4:return U.Instance.buildXML(e),[2]}}))}))},a.prototype.RemoveServerCommands=function(){for(var e=0;e<this.getSize();e+=1){var t=this.getMGData(e);null!==t&&t.CmdsToServer.clear()}},a.prototype.getSize=function(){return this._mgDataTab.length},a.prototype.processRecovery=function(){return T(this,void 0,void 0,(function(){var e,t,r,n;return h(this,(function(a){switch(a.label){case 0:e=0,a.label=1;case 1:if(!(e<this.getSize()))return[3,6];if(null===(t=this.getMGData(e)))return[3,5];r=0,a.label=2;case 2:return r<t.getTasksCount()?null===(n=t.getTask(r))?[3,4]:[4,n.DataView.processRecovery()]:[3,5];case 3:a.sent(),a.label=4;case 4:return r+=1,[3,2];case 5:return e+=1,[3,1];case 6:return[2]}}))}))},a.prototype.getTriggeredTasks=function(e){var r,n=new t.List,a=e.getTaskTag();for(this.startTasksIteration();null!==(r=this.getNextTask());)a===r.PreviouslyActiveTaskId&&n.push(r);return n},a.prototype.GetTasks=function(e){var r=new t.List;return this._mgDataTab.forEach((function(t){if(null!==t&&!t.IsAborting)for(var n=0;n<t.getTasksCount();n+=1){var a=t.getTask(n);null!==a&&e(a)&&r.push(a)}})),r},a.prototype.getTaskIdById=function(e){var t=this.GetTaskByID(e),r=e;return null!=t&&(r=t.getTaskTag()),r},a.prototype.GetTopMostForms=function(){var e,r=new t.List;for(this.startTasksIteration();null!=(e=this.getNextTask());){var n=e.getForm();e.isAborting()||null==n||n.isSubForm()||r.push(n)}return r},a.prototype.GetMGDataForStartupProgram=function(){t.Debug.Assert(this._mgDataTab.length>0,"The main program must be processed before invoking this method.");var e=this.GetMainProgByCtlIdx(0);return t.Debug.Assert(null!==e,"The main program must be processed before invoking this method."),t.Debug.Assert(0===e.getMgdID(),"Main program is expected to be on MGData 0. Is this an error?"),this._mgDataTab.get_Item(0)},a.prototype.execRequestWithSubformRecordCycle=function(t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(s){switch(s.label){case 0:return this.cleanDoSubformPrefixSuffix(),t.Add(r),a.Instance.StartupMgData.getFirstTask().InEndTask&&a.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,2]:[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.NORMAL,n)];case 1:s.sent(),s.label=2;case 2:return[4,this.execAllSubformRecordCycle()];case 3:return s.sent(),[2]}}))}))},a.prototype.cleanDoSubformPrefixSuffix=function(){for(var e=0;e<this.getSize();e++){var t=this.getMGData(e);if(null!==t&&!t.IsAborting)for(var r=t.getTasksCount(),n=0;n<r;n++){t.getTask(n).DoSubformPrefixSuffix=!1}}},a.prototype.execAllSubformRecordCycle=function(){return T(this,void 0,void 0,(function(){var e,t,n,a,s;return h(this,(function(i){switch(i.label){case 0:e=0,i.label=1;case 1:if(!(e<this.getSize()))return[3,8];if(null===(t=this.getMGData(e))||t.IsAborting)return[3,7];n=t.getTasksCount(),a=0,i.label=2;case 2:return a<n?(s=t.getTask(a)).IsSubForm&&s.DoSubformPrefixSuffix?(s.PerformParentRecordPrefix=!1,o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(s,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]):[3,6]:[3,7];case 3:return i.sent(),o.eventsManager.GetStopExecutionFlag()?[3,5]:[4,o.eventsManager.handleInternalEventWithTask(s,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 4:i.sent(),i.label=5;case 5:o.eventsManager.popNewExecStacks(),s.PerformParentRecordPrefix=!0,i.label=6;case 6:return a+=1,[3,2];case 7:return e+=1,[3,1];case 8:return[2]}}))}))},a}();oe._instance=null,function(e){e[e.Handled=0]="Handled",e[e.Retry=1]="Retry",e[e.Abort=2]="Abort"}(ie||(ie={}));var le=function(s){function l(){var e=s.call(this)||this;return e._lastRequestTime=0,e.ServerUrl=null,e.DelayCommandExecution=!1,e._requestInfo=new r.RequestInfo,e.ServerUrl=ne.Instance.getServerURL(),re.GetInstance(),e.RegisterDelegates(),e}return u(l,s),l.GetInstance=function(){return null===l._instance&&(l._instance=new l),l._instance},l.prototype.CheckAndSetSessionCounter=function(e){e===E.SESSION_COUNTER_CLOSE_CTX_INDICATION?t.Debug.Assert(this.GetSessionCounter()===E.SESSION_COUNTER_CLOSE_CTX_INDICATION):(t.Debug.Assert(e===this.GetSessionCounter()+1),this.SetSessionCounter(e),r.Logger.Instance.WriteServerToLog(t.NString.Format("Session Counter --\x3e {0}",this._sessionCounter)))},l.prototype.ClearSessionCounter=function(){this._sessionCounter=0,r.Logger.Instance.WriteServerToLog(t.NString.Format("Session Counter --\x3e {0}",this._sessionCounter))},l.prototype.SetSessionCounter=function(e){this._sessionCounter=e},Object.defineProperty(l.prototype,"GetLastRequestTime",{get:function(){return this._lastRequestTime},enumerable:!1,configurable:!0}),l.prototype.ReStartSession=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:return l.IsSessionReInitializing=!0,[4,this.StoreSessionReInitializingDataOnLocalStorage()];case 1:throw r.sent(),e=!1,n.RuntimeContextBase.Instance.RemovedContextFromServer||(e=!!et.Instance.getSpecialRouteToRootProgOnContextRecreation()),n.Commands.addRefreshPage(e,l.InitialUrl),new t.Exception("")}}))}))},l.prototype.StoreSessionReInitializingDataOnLocalStorage=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(a){switch(a.label){case 0:return[4,this.BuildXMLForMainProgramDataView()];case 1:return e=a.sent(),t=o.globalParams.mirrorAllToXML(),(r=window.localStorage).setItem(E.IS_SESSION_REINITIALIZING,"true"),r.setItem(E.MAIN_PROG_VIEW,e.toString()),r.setItem(E.GLOBAL_PARAM_LIST,t),r.setItem(E.LAST_EXCEPTION,l.lastExceptionMessage),n.RuntimeContextBase.Instance.RemovedContextFromServer&&r.setItem(E.CTX_REMOVED_FROM_SRVR,"1"),kr.Instance.storeLastSavedRouteEventOnLocalStorage(),[2]}}))}))},l.prototype.RestoreSessionReInitializingDataFromLocalStorage=function(e){return window.localStorage.getItem(e)},l.prototype.StartSession=function(){return T(this,void 0,void 0,(function(){var s,i,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N;return h(this,(function(h){switch(h.label){case 0:s=!1,i=null,u=null,h.label=1;case 1:h.trys.push([1,17,,18]),c=null,(_=new t.StringBuilder).Append(E.UTF8TRANS+E.REQ_APP_NAME+"="+se.UrlEncode(ne.Instance.getAppName(),t.Encoding.UTF8)),_.Append("&"+E.REQ_ARGS+"="+E.REQ_ARG_ALPHA+'<Richclient><Requires EncryptionKey="False"/><RIAProtocolVersion="'+l.WEB_COMMUNICATION_PROTOCOL_VERSION+'"/></Richclient>'),r.Logger.Instance.WriteDevToLog(t.NString.Format("Handshake request #1 (not scrambled) : {0}",this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION_INITIAL+_)),T=this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION_INITIAL+E.RC_TOKEN_DATA+se.UrlEncode(j.Scramble(_.ToString()),t.Encoding.UTF8),r.Logger.Instance.WriteServerMessagesToLog(""),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #1: {0}",T)),p=ne.Instance.getCtxGroup(),h.label=2;case 2:return s?[3,14]:(g=new t.RefParam(ie.Handled),[4,this.DispatchRequest(T,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,g)]);case 3:if(d=h.sent(),t.NString.IsNullOrEmpty(d))throw new ae("Client failed to initialize a session."+r.OSEnvironment.EolSeq+"Empty response was received from the web server."+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq+this.ServerUrl);return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake response #1: {0}",d)),r.Logger.Instance.WriteServerMessagesToLog(""),i=new ue(d),n.RuntimeContextBase.Instance.ContextID=i.ContextId,this.SessionId=i.GetSessionId,re.GetInstance().HttpCommunicationTimeoutMS=1e3*i.HttpTimeout,t.NString.IsNullOrEmpty(ne.Instance.getCtxGroup())&&(p=i.ContextId),I=null,ne.Instance.getSkipAuthenticationDialog()?(null!==ne.Instance.getUsername()&&(I=new n.UsernamePasswordCredentials(ne.Instance.getUsername(),ne.Instance.getPassword()),ne.Instance.setUsername(""),ne.Instance.setPassword("")),[3,6]):[3,4];case 4:return i.InputPassword&&i.SystemLogin!==ue.SYSTEM_LOGIN_AD?null===c?[3,6]:(f=o.languageData.getConstMessage(r.MsgInterface.BRKTAB_STR_ERROR),C=o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW),[4,ge.Instance.MessageBox(f,C,n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)]):[3,6];case 5:h.sent(),h.label=6;case 6:s&&this.SetSessionCounter(E.SESSION_COUNTER_CLOSE_CTX_INDICATION),A=this.PrepareAuthenticationUrl(i.ContextId,p,this.GetSessionCounter()),h.label=7;case 7:return h.trys.push([7,12,,13]),null===I?[3,9]:(R=I.Username+":",t.NString.IsNullOrEmpty(I.Password)||(R=R+I.Password+":"),R+=i.ContextId,R=j.Scramble(R),R=r.Base64.encode(R,!0,t.Encoding.UTF8),A+="&USERNAME="+se.UrlEncode(R,t.Encoding.UTF8),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #2: {0}",A)),S=new t.RefParam(ie.Handled),[4,this.DispatchRequest(A,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,S)]);case 8:if(-1===(d=h.sent()).indexOf(i.ContextId))throw new ae(o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW));return ne.Instance.setUsername(I.Username),ne.Instance.setPassword(I.Password),[3,11];case 9:return M=new t.RefParam(ie.Handled),r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake request #2: {0}",A)),[4,this.DispatchRequest(A,null,e.CommandsProcessorBase_SessionStage.HANDSHAKE,M)];case 10:d=h.sent(),h.label=11;case 11:return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("Handshake response #2: {0}",d)),r.Logger.Instance.WriteServerMessagesToLog(""),[3,14];case 12:if(!((m=h.sent())instanceof ae))throw m;if(v=m,ne.Instance.getSkipAuthenticationDialog())switch(v.GetCode()){case ae.ERR_ACCESS_DENIED:case ae.ERR_AUTHENTICATION:throw ne.Instance.setSkipAuthenticationDialog(!1),v}if(!i.InputPassword)throw v;if(v.GetCode()!==ae.ERR_AUTHENTICATION&&(!s||v.GetCode()!==ae.INF_NO_RESULT))throw v;return[3,13];case 13:return[3,2];case 14:return ne.Instance.setSkipAuthenticationDialog(!0),ne.Instance.setCtxGroup(p),null!==u&&u.closeDialog(),l.ShouldScrambleAndUnscrambleMessages=i.ScrambleMessages,r.Logger.Instance.LogLevel!==r.Logger_LogLevels.Basic&&null!==(L=i.MaxInternalLogLevel)&&(b=this.parseLogLevel(L))<r.Logger.Instance.LogLevel&&(ne.Instance.setInternalLogLevel(L),r.Logger.Instance.WriteToLog(t.NString.Format("Internal log level was restricted to '{0}' by the Magic xpa server.",L),!1),r.Logger.Instance.LogLevel=b),s?[3,16]:[4,this.ExecuteInitialRequest()];case 15:h.sent(),h.label=16;case 16:return[3,18];case 17:if((N=h.sent())instanceof ae)throw N;throw a.isNullOrUndefined(N.InnerException)?new ae(N.message,new t.Exception(N)):new ae(N.message,N.InnerException);case 18:return[2,!s]}}))}))},l.prototype.PrepareAuthenticationUrl=function(e,t,r){var n=this.ServerUrl+E.REQ_ARG_START+E.RC_INDICATION+E.UTF8TRANS+E.RC_TOKEN_CTX_ID+e;return a.isNullOrUndefined(this.SessionId)||(n+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_ID+this.SessionId),n+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_COUNT+r+E.REQ_ARG_SEPARATOR+E.RC_TOKEN_CTX_GROUP+t+E.REQ_ARG_SEPARATOR+E.RC_AUTHENTICATION_REQUEST},l.prototype.ExecuteInitialRequest=function(){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.Execute_1(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.INITIAL,null)];case 1:return t.sent(),[2]}}))}))},l.prototype.GetTaskTree=function(e){for(var r=new t.List;!a.isNullOrUndefined(e);)r.push(e.getTaskInfo()),e=e.getParent();return r},l.prototype.UpdateRequestInfo=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i,l,u,c,_,T;return h(this,(function(h){for(e=o.mgDataTable.getCurrMGData(),r=o.eventsManager,a=!1,s=e.CmdsToServer,i=0;i<s.getSize();i++)if(s.getCmd(i)instanceof q){l=e.CmdsToServer.getCmd(i),this._requestInfo.serverCallAt=l.getCommandInfo(),this._requestInfo.runtimeTaskTree=this.GetTaskTree(l.getTask()),a=!0;break}return this._requestInfo.extraInfo.contextID=n.RuntimeContextBase.Instance.ContextID,this._requestInfo.extraInfo.sessionCounter=this.GetSessionCounter(),a||null!=r.getLastRtEvent()&&0!=r.getLastRtEvent().InternalEvent&&(u=r.getLastRtEvent(),this._requestInfo.runtimeTaskTree=this.GetTaskTree(u.getTask()),c=u.isNewInternalEvent()?t.NString.TrimEnd(u.getNewInternalEventDescription()):k.getInternalEvtDescription(u.InternalEvent),(_=s.getCmd(s.getSize()-1))&&(T=t.NString.IsNullOrEmpty(_.getCommandInfo())?t.NString.Empty:_.getCommandInfo(),_ instanceof R&&u.InternalEvent==_.MagicEvent&&(c=t.NString.Empty),this._requestInfo.serverCallAt="Event "+T+(t.NString.IsNullOrEmpty(c)?t.NString.Empty:t.NString.Format(" while executing [{0}]",c)))),[2]}))}))},l.prototype.BuildXMLForMainProgramDataView=function(){return T(this,void 0,void 0,(function(){var e,n,a,s;return h(this,(function(i){switch(i.label){case 0:e=new t.StringBuilder,n=oe.Instance.getMGData(0),a=n.getMainProg(0),i.label=1;case 1:return null==a?[3,3]:[4,a.buildXML(e)];case 2:return i.sent(),a=n.getNextMainProg(a.getCtlIdx()),[3,1];case 3:return l.ShouldScrambleAndUnscrambleMessages&&(s=j.Scramble(e.ToString()),e=new t.StringBuilder(s)),e.Insert(0,r.XMLConstants.MG_TAG_OPEN),e.Append(r.XMLConstants.MG_TAG_XML_END_TAGGED),[2,e.ToString()]}}))}))},l.prototype.Execute_1=function(a,s,i){return T(this,void 0,void 0,(function(){var u,c,_,T,p,g,d,I,f,C,A;return h(this,(function(h){switch(h.label){case 0:return c=s===e.CommandsProcessorBase_SessionStage.INITIAL,_=null,this.DelayCommandExecution?[2]:r.Logger.Instance.LogLevel!=r.Logger_LogLevels.RequestInfo||c?[3,2]:[4,this.UpdateRequestInfo()];case 1:h.sent(),h.label=2;case 2:return c&&"true"===(T=this.RestoreSessionReInitializingDataFromLocalStorage(E.IS_SESSION_REINITIALIZING))&&(l.IsSessionReInitializing="true"===T,l.lastExceptionMessage=this.RestoreSessionReInitializingDataFromLocalStorage(E.LAST_EXCEPTION),"1"!==this.RestoreSessionReInitializingDataFromLocalStorage(E.CTX_REMOVED_FROM_SRVR)&&(r.Logger.Instance.WriteErrorToLog(l.lastExceptionMessage),r.Logger.Instance.WriteToLog("Session is reinitializing...",!0))),a!==e.CommandsProcessorBase_SendingInstruction.NO_TASKS_OR_COMMANDS?[3,3]:(u=null,[3,5]);case 3:return[4,this.PrepareRequest(a===e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 4:u=h.sent(),!l.IsSessionReInitializing&&c||(p=new t.StringBuilder,g=new t.StringBuilder,l.IsSessionReInitializing||g.Append(u),_=l.IsSessionReInitializing?this.RestoreSessionReInitializingDataFromLocalStorage(E.GLOBAL_PARAM_LIST):o.globalParams.mirrorToXML(),p.Append(_),p.Append(o.envParamsTable.mirrorToXML()),p.Length>0&&(p.Insert(0,"<"+E.MG_TAG_ENV_CHANGES+">"),p.Append("</"+E.MG_TAG_ENV_CHANGES+">"),l.ShouldScrambleAndUnscrambleMessages&&(d=j.Scramble(p.ToString()),p=new t.StringBuilder(d)),p.Insert(0,r.XMLConstants.MG_TAG_OPEN),p.Append(r.XMLConstants.MG_TAG_XML_END_TAGGED),g.Append(p.ToString())),u=g.ToString()),h.label=5;case 5:return I=new t.RefParam(ie.Handled),f=null,l.IsSessionReInitializing&&(u+=this.RestoreSessionReInitializingDataFromLocalStorage(E.MAIN_PROG_VIEW)),n.RuntimeContextBase.Instance.RemovedContextFromServer?(I.value=ie.Retry,[3,8]):[3,6];case 6:return n.RuntimeContextBase.Instance.RemovingContextFromServer&&(n.RuntimeContextBase.Instance.RemovedContextFromServer=!0),[4,this.DispatchRequest(this.ServerUrl,u,s,I)];case 7:f=h.sent(),h.label=8;case 8:return I.value!=ie.Retry?[3,10]:[4,this.ReStartSession()];case 9:h.sent(),h.label=10;case 10:return null==f?[2]:(c&&(l.InitialUrl=window.location.href,l.IsSessionReInitializing&&((C=window.localStorage).removeItem(E.IS_SESSION_REINITIALIZING),C.removeItem(E.MAIN_PROG_VIEW),C.removeItem(E.GLOBAL_PARAM_LIST),C.removeItem(E.LAST_EXCEPTION))),U.Instance.enable(!1),[4,this.ProcessResponse(f,o.mgDataTable.currMgdID,null,i)]);case 11:if(h.sent(),l.IsSessionReInitializing&&(o.globalParams.RestoreGlobalParams(_),C=window.localStorage,"1"===C.getItem(E.CTX_REMOVED_FROM_SRVR)&&(kr.Instance.restoreLastSavedRouteEventFromLocalStorage(),C.removeItem(E.CTX_REMOVED_FROM_SRVR),C.removeItem(E.LAST_ROUTE_EVENT),C.removeItem(E.LAST_ROUTE_EVENT_SRC_TSK),C.removeItem(E.LAST_ROUTE_EVENT_ARG_LIST)),l.IsSessionReInitializing=!1),a!==e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)return[3,15];o.mgDataTable.startTasksIteration(),A=void 0,h.label=12;case 12:return null===(A=o.mgDataTable.getNextTask())?[3,15]:A.DataViewWasRetrieved?[4,A.RefreshDisplay()]:[3,14];case 13:h.sent(),h.label=14;case 14:return[3,12];case 15:return c&&ne.Instance.setGlobalParams(null),[2]}}))}))},l.prototype.DispatchRequest=function(a,s,i,o){return T(this,void 0,void 0,(function(){var u,c,_,T,p,g,d,E;return h(this,(function(h){switch(h.label){case 0:if(u=null,c=null,o.value=ie.Handled,null===a)return r.Logger.Instance.WriteExceptionToLogWithMsg("in sendMsgToSrvr() unknown server"),[2,u];i!==e.CommandsProcessorBase_SessionStage.HANDSHAKE&&(_=this.BuildUrlSuffix(null!==s,i===e.CommandsProcessorBase_SessionStage.INITIAL),T=se.UrlEncode(s,t.Encoding.UTF8),c=_+T),h.label=1;case 1:return h.trys.push([1,3,,11]),r.Logger.Instance.ShouldLogExtendedServerRelatedMessages()&&r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("MESSAGE TO SERVER:\n URL: {0}\n BODY: {1}",a,c)),[4,this.ExecuteRequest(a,c)];case 2:return(u=h.sent()).toUpperCase().startsWith("<HTML")||(p=u.indexOf('<xml id="MGDATA">'))>0&&(u=u.substr(p)),r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+u),(i===e.CommandsProcessorBase_SessionStage.HANDSHAKE||u.length>0&&l.ShouldScrambleAndUnscrambleMessages&&'<xml id="MGDATA">\n</xml>'!==u)&&(i===e.CommandsProcessorBase_SessionStage.HANDSHAKE&&t.Debug.Assert(u.length>0&&"<"!==u[0]),u=Q.UnScramble(u)),r.Logger.Instance.WriteDevToLog("MESSAGE FROM SERVER: (size = "+u.length+")"+r.OSEnvironment.EolSeq+u),this._lastRequestTime=r.Misc.getSystemMilliseconds(),[3,11];case 3:return(g=h.sent())instanceof ae?(o.value=ie.Abort,i!=e.CommandsProcessorBase_SessionStage.NORMAL||g.GetCode()!=ae.ERR_CTX_NOT_FOUND&&g.GetCode()!=ae.ERR_THREAD_ABORTED?[3,10]:n.RuntimeContextBase.Instance.RemovedContextFromServer?(o.value=ie.Retry,[3,9]):[3,4]):[3,10];case 4:switch(et.Instance.getWebClientReinitSession()){case"Y":return[3,5];case"A":return[3,6];case"N":return[3,8]}return[3,8];case 5:return o.value=ie.Retry,[3,9];case 6:return[4,ge.Instance.MessageBox("Error","Unknown error occurred at server-side. Would you like to reinitialize the session?",n.Styles.MSGBOX_BUTTON_YES_NO)];case 7:return d=h.sent(),o.value=d==n.Styles.MSGBOX_RESULT_YES?ie.Retry:ie.Abort,[3,9];case 8:return o.value=ie.Abort,[3,9];case 9:if(o.value==ie.Abort)throw et.Instance.setWebClientReinitSession("N"),g;return E=r.StrUtil.getConsoleErorString(g.GetMessage()),l.lastExceptionMessage="Exception Occured at server side : "+g.GetCode().toString()+" : "+E,console.log(l.lastExceptionMessage),[2,null];case 10:throw window.localStorage.clear(),g;case 11:return[2,u]}}))}))},l.prototype.HandleErrorResponse=function(e){try{r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+e),e=Q.UnScramble(e),r.Logger.Instance.WriteServerMessagesToLog("MESSAGE FROM SERVER: "+r.StrUtil.getConsoleErorString(e))}catch(e){}if(e.startsWith("<xmlerr")){var t=new ce(e,this._lastRequestTime,o.environment.getContextInactivityTimeout());throw new ae(t.GetMessage(),t.GetCode())}if(e.toUpperCase().startsWith("<HTML"))throw new ae(e)},l.prototype.ExecuteRequest=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.GetContent(e,!1,t)];case 1:return[2,r.sent()]}}))}))},l.prototype.GetContent=function(e,n,s){return T(this,void 0,void 0,(function(){var u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:a.isUndefined(s)&&(s=null),h.label=1;case 1:return h.trys.push([1,3,4,5]),e.startsWith("/")&&(e=ne.Instance.getProtocol()+"://"+ne.Instance.getServer()+e),c=i.timer(50,50),_=c.subscribe((function(e){o.eventsManager.CheckAndShowSpinner(!0)})),T=new t.RefParam(!1),l.requestNumber++,[4,re.GetInstance().GetContent(e,s,n,T)];case 2:return u=h.sent(),l.totalResponseDataLength+=l.totalResponseDataLength+(a.isNullOrUndefined(u)?0:u.length),_.unsubscribe(),_=null,T.value&&this.HandleErrorResponse(u),[3,5];case 3:throw(p=h.sent())instanceof ae&&r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic||r.Logger.Instance.WriteExceptionToLog(p,t.NString.Format('requested URL = "{0}"',e)),p instanceof ae||(p=new ae(p.Message,p.InnerException?p.InnerException:p)),p;case 4:return null!=_&&_.unsubscribe(),[7];case 5:return[2,u]}}))}))},l.prototype.ClientActivated=function(e){},l.prototype.BuildUrlSuffix=function(e,r){var s=E.RC_INDICATION+E.RC_TOKEN_CTX_ID+n.RuntimeContextBase.Instance.ContextID;if(a.isNullOrUndefined(this.SessionId)||(s+=E.REQ_ARG_SEPARATOR+E.RC_TOKEN_SESSION_ID+this.SessionId),r){l.IsSessionReInitializing&&(s+=E.REQ_ARG_SEPARATOR+E.WEBCLIENT_REINITIALIZE_REQUEST);var i=ne.Instance.getGlobalParams();null!==i&&(i=t.NString.Replace(i,"+","%2B"),s+="&"+E.MG_TAG_GLOBALPARAMS+"="+i)}return e&&(s+="&"+E.RC_TOKEN_SESSION_COUNT+this.GetSessionCounter()+E.REQ_ARG_SEPARATOR+E.RC_TOKEN_DATA),s},l.prototype.SendMonitorOnly=function(){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:return r=U.Instance,null==o.mgDataTable||null==o.mgDataTable.getMGData(0)||o.mgDataTable.getMGData(0).IsAborting?[2]:r.isEmpty()?[3,4]:(n=this.BuildMonitorMessage(),!1,[3,1]);case 1:return s.trys.push([1,3,,4]),a=new t.RefParam(ie.Handled),[4,this.DispatchRequest(this.ServerUrl,n.ToString(),e.CommandsProcessorBase_SessionStage.NORMAL,a)];case 2:return s.sent(),[3,4];case 3:return s.sent(),[3,4];case 4:return[2]}}))}))},l.prototype.BuildMonitorMessage=function(){var e=new t.StringBuilder(1e3),n=U.Instance;if(l.ShouldScrambleAndUnscrambleMessages){n.buildXML(e);var a=j.Scramble(e.ToString());(e=new t.StringBuilder(1e3)).Append(r.XMLConstants.MG_TAG_OPEN+a)}else e.Append(r.XMLConstants.MG_TAG_OPEN),n.buildXML(e);return e.Append("</"+r.XMLConstants.MG_TAG_XML+r.XMLConstants.TAG_CLOSE),e},l.prototype.RegisterDelegates=function(){var e=this;Z.GetSessionCounter_Event=this.GetSessionCounter.bind(this),Z.CheckAndSetSessionCounter_Event=this.CheckAndSetSessionCounter.bind(this),Z.ComputeAndLogRequestInfo_Event=this.ComputeAndLogRequestInfo.bind(this),o.eventsManager.SpinnerStopped.subscribe((function(t){return e.ClientActivated(t)}))},l.prototype.ComputeAndLogRequestInfo=function(e,t,n){if(!a.isNullOrUndefined(this._requestInfo.serverCallAt)){this._requestInfo.extraInfo.contentLength=e,this._requestInfo.extraInfo.timeStamp=(new Date).toString();var s=n?"Response ⤵":"Request ⤵";n?(this._requestInfo.roundtripTime=t,l.totalTimeForHTTPRequests+=t):l.totalRequestDataLength+=e,r.Logger.Instance.WriteRequestInfoToLog(this._requestInfo,s),n&&this._requestInfo.clear()}},Object.defineProperty(l,"ShouldScrambleAndUnscrambleMessages",{get:function(){return r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("ShouldScrambleAndUnscrambleMessages.Get: {0}",this._shouldScrambleAndUnscrambleMessages)),l._shouldScrambleAndUnscrambleMessages},set:function(e){l._shouldScrambleAndUnscrambleMessages=e,r.Logger.Instance.WriteServerMessagesToLog(t.NString.Format("ShouldScrambleAndUnscrambleMessages.Set: {0}",this._shouldScrambleAndUnscrambleMessages))},enumerable:!1,configurable:!0}),l.prototype.parseLogLevel=function(e){var n=r.Logger_LogLevels.None;return t.NString.IsNullOrEmpty(e)||(e.toUpperCase().startsWith("SERVER")?n=e.endsWith("#")?r.Logger_LogLevels.ServerMessages:r.Logger_LogLevels.Server:e.toUpperCase().startsWith("S")||e.toUpperCase().startsWith("Q")?n=r.Logger_LogLevels.Support:e.toUpperCase().startsWith("G")?n=r.Logger_LogLevels.Gui:e.toUpperCase().startsWith("D")?n=r.Logger_LogLevels.Development:e.toUpperCase().startsWith("B")?n=r.Logger_LogLevels.Basic:e.toUpperCase().startsWith("R")&&(n=r.Logger_LogLevels.RequestInfo)),n},l.prototype.PrepareRequest=function(e){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return(n=new t.StringBuilder).Append(r.XMLConstants.MG_TAG_OPEN),null===o.mgDataTable.getCurrMGData()?[3,2]:(a=new t.StringBuilder,[4,o.mgDataTable.buildXML(a,e)]);case 1:s.sent(),l.ShouldScrambleAndUnscrambleMessages?n.Append(j.Scramble(a.ToString())):n.Append(a.ToString()),s.label=2;case 2:return n.Append("</"+r.XMLConstants.MG_TAG_XML+r.XMLConstants.TAG_CLOSE),[2,n.ToString()]}}))}))},l.prototype.ProcessResponse=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,l;return h(this,(function(u){switch(u.label){case 0:return r.Logger.Instance.WriteDevToLog("<-- ProcessResponse started --\x3e"),null===a&&(a=new y),i=r.Misc.getSystemMilliseconds(),null===e||0===e.trim().length?[2]:(o.mgDataTable.currMgdID=t,n.RuntimeContextBase.Instance.Parser.push(),n.RuntimeContextBase.Instance.Parser.setXMLdata(e),n.RuntimeContextBase.Instance.Parser.setCurrIndex(0),[4,(l=o.mgDataTable.getCurrMGData()).fillData(a,n.RuntimeContextBase.Instance.Parser)]);case 1:return u.sent(),n.RuntimeContextBase.Instance.Parser.setXMLdata(null),n.RuntimeContextBase.Instance.Parser.pop(),r.Logger.Instance.WriteDevToLog("<-- ProcessResponse finished --\x3e ("+(r.Misc.getSystemMilliseconds()-i)+")"),[4,l.CmdsToClient.Execute(s)];case 2:return u.sent(),[4,this.ProcessRecovery()];case 3:return u.sent(),[2]}}))}))},l.prototype.ProcessRecovery=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return o.eventsManager.pushNewExecStacks(),[4,o.mgDataTable.processRecovery()];case 1:return e.sent(),o.eventsManager.popNewExecStacks(),[2]}}))}))},l}(Q);le.RC_NO_CONTEXT_ID="-1",le._instance=null,le.IsSessionReInitializing=!1,le.lastExceptionMessage=null,le.InitialUrl=null,le.requestNumber=0,le.totalTimeForHTTPRequests=0,le.totalRequestDataLength=0,le.totalResponseDataLength=0,le.WEB_COMMUNICATION_PROTOCOL_VERSION="14002",le._shouldScrambleAndUnscrambleMessages=!1;var ue=function(){function e(e){this._scrambleMessages=!0,this._contextId=null,this._privateSessionId=null,this._inputPassword=!1,this._httpTimeout=0,this._systemLogin=null,this._maxInternalLogLevel=null;try{r.JSON_Utils.JSONFromXML(e,this.FillFromJSON.bind(this))}catch(t){r.Logger.Instance.WriteExceptionToLog(t,e)}}return Object.defineProperty(e.prototype,"ScrambleMessages",{get:function(){return this._scrambleMessages},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ContextId",{get:function(){return this._contextId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"GetSessionId",{get:function(){return this._privateSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"InputPassword",{get:function(){return this._inputPassword},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HttpTimeout",{get:function(){return this._httpTimeout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SystemLogin",{get:function(){return this._systemLogin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"MaxInternalLogLevel",{get:function(){return this._maxInternalLogLevel},enumerable:!1,configurable:!0}),e.prototype.FillFromJSON=function(e,r){if(null!=e)throw e;var n=r.Richclientresponse;for(var s in n)if(n.hasOwnProperty(s))switch(s){case"ContextID":this._contextId=n[s][0];break;case"SessionID":this._privateSessionId=n[s][0];break;case"Environment":var i=n.Environment[0].$;a.isNullOrUndefined(i.ScrambleMessages)||(t.Debug.Assert("N"===i.ScrambleMessages),this._scrambleMessages=!1),a.isNullOrUndefined(i.MaxInternalLogLevel)||(this._maxInternalLogLevel=i.MaxInternalLogLevel),a.isNullOrUndefined(i.InputPassword)||"y"!==i.InputPassword.toLocaleLowerCase()||(this._inputPassword=!0),a.isNullOrUndefined(i.SystemLogin)||(this._systemLogin=i.SystemLogin),a.isNullOrUndefined(i[E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT])||(this._httpTimeout=+i[E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT]),a.isNullOrUndefined(i.ForwardSlash)||(o.environment.ForwardSlashUsage=i.ForwardSlash)}},e}();ue.SYSTEM_LOGIN_AD="D";var ce=function(){function e(e,t,n){this._lastRequestTime=0,this._errorMessage=null,this._errorCode=0,this._middlewareAddress=null,this._parsingFailed=!1,this._lastRequestTime=t,this.contextInactivityTimeout=n;try{r.JSON_Utils.JSONFromXML(e,this.FillFromJSON.bind(this))}catch(e){r.Logger.Instance.WriteExceptionToLog(e),r.Misc.WriteStackTrace(e),this._parsingFailed=!0}}return e.prototype.FillFromJSON=function(e,n){if(null!=e)throw e;var a=n.xmlerr;for(var s in a)if(a.hasOwnProperty(s))switch(s){case"errmsg":this._errorMessage=a[s][0];break;case"errcode":this._errorCode=+a[s];break;case"server":this._middlewareAddress=a[s][0];break;case"appname":case"prgname":case"arguments":case"username":case"xmlerr":break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unknown element: '{0}'",s))}},e.prototype.GetCode=function(){return this._errorCode},e.prototype.GetMessage=function(){var e=new t.StringBuilder;if(this._parsingFailed)e.Append(o.languageData.getConstMessage(r.MsgInterface.RC_STR_F7_UNEXPECTED_ERR));else{switch(this._errorCode){case ae.ERR_CTX_NOT_FOUND:this.InactivityTimeoutExpired()?e.Append(t.NString.Format("{0} ({1} {2})",o.languageData.getConstMessage(r.MsgInterface.STR_ERR_SESSION_CLOSED_INACTIVITY),Math.floor(this.contextInactivityTimeout/600),o.languageData.getConstMessage(r.MsgInterface.STR_MINUTES))):e.Append(t.NString.Format("{0} ({1}).",o.languageData.getConstMessage(r.MsgInterface.STR_ERR_SESSION_CLOSED),this._errorCode));break;case ae.ERR_WEBCLIENT_PROGRAM_RELOADED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_WEBCLIENT_PROGRAM_RELOADED));break;case ae.ERR_EXECUTED_PROGRAM_CHANGED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_EXECUTED_PROGRAM_CHANGED));break;case ae.ERR_AUTHENTICATION:e.Append(o.languageData.getConstMessage(r.MsgInterface.USRINP_STR_BADPASSW));break;case ae.ERR_ACCESS_DENIED:e.Append(o.languageData.getConstMessage(r.MsgInterface.STR_ERR_AUTHORIZATION_FAILURE));break;default:e.Append(this._errorMessage)}e.Append(r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq),ne.Instance.ShouldDisplayGenericError()||(e.Append(o.languageData.getConstMessage(r.MsgInterface.BROWSER_OPT_INFO_SERVER_STR)+": "),e.Append(ne.Instance.getServer()),t.NString.IsNullOrEmpty(this._middlewareAddress)||(e.Append(" --\x3e "),e.Append(this._middlewareAddress)),e.Append(r.OSEnvironment.EolSeq)),e.Append(o.languageData.getConstMessage(r.MsgInterface.TASKRULE_STR_APPLICATION)+': "'),e.Append(ne.Instance.getAppName()),e.Append('" ("'),e.Append('")')}return e.ToString()},e.prototype.InactivityTimeoutExpired=function(){var e=!1;this.contextInactivityTimeout>0&&(e=r.Misc.getSystemMilliseconds()-this._lastRequestTime>100*this.contextInactivityTimeout);return e},e}(),_e=function(){function e(){this.ShouldRetryLastRequest=!1}return Object.defineProperty(e.prototype,"ShowCommunicationErrors",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.CommunicationFailed=function(e,t){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return"",a=e.split("?")[0]+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq+t.message+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq,s=this,[4,ge.Instance.MessageBox("",a+"Do you wish to retry connecting?",n.Styles.MSGBOX_BUTTON_YES_NO)];case 1:return s.ShouldRetryLastRequest=i.sent()===n.Styles.MSGBOX_RESULT_YES,[2]}}))}))},e}(),Te=function(){function e(){}return e.GetCommandsProcessor=function(){return le.GetInstance()},e.GetContent=function(t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,e.GetCommandsProcessor().GetContent(t,r)];case 1:return[2,n.sent()]}}))}))},e.StartSession=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(n){switch(n.label){case 0:e=!1,n.label=1;case 1:return n.trys.push([1,3,,4]),re.GetInstance().SetCommunicationsFailureHandler(new _e),[4,le.GetInstance().StartSession()];case 2:return e=n.sent(),[3,4];case 3:throw t=n.sent(),r.Logger.Instance.WriteServerToLog("Failed connecting to the server: "+r.StrUtil.getConsoleErorString(t.Message)),t;case 4:return[2,e]}}))}))},e}(),he="</ErrorCodes>",pe=function(){function e(){this._constMessages=null,this._constMessagesContent=null,this._constMessagesUrl=null,this._mlsContent=null,this._mlsFileUrl=null,this._mlsStrings=null}return e.prototype.fillData=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:for(;this.initInnerObjects(e,e.getNextTag()););return[4,this.InitConstMessagesTable()];case 1:return t.sent(),[4,this.fillMlsMessagesTable()];case 2:return t.sent(),[2]}}))}))},e.prototype.initInnerObjects=function(e,n){if(null==n)return!1;switch(n){case E.MG_TAG_LANGUAGE:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_CONSTMESSAGES:var a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),this._constMessagesUrl=e.getXMLsubstring(a),e.setCurrIndex(a);break;case E.MG_TAG_CONSTMESSAGESCONTENT:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(E.MG_TAG_CONSTMESSAGESCONTENT,e.getCurrIndex())-2,this._constMessagesContent=e.getXMLsubstring(a),e.setCurrIndex(a);break;case E.MG_TAG_MLS_CONTENT:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(E.MG_TAG_MLS_CONTENT,e.getCurrIndex())-2,this._mlsContent=e.getXMLsubstring(a),e.setCurrIndex(a),t.NString.IsNullOrEmpty(this._mlsContent)||null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null),t.NString.IsNullOrEmpty(this._mlsContent)&&null!=this._mlsContent&&(this._mlsContent=null,null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null));break;case E.MG_TAG_MLS_FILE_URL:a=void 0;e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),a=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),this._mlsFileUrl=e.getXMLsubstring(a).trim(),t.NString.IsNullOrEmpty(this._mlsFileUrl)?t.NString.IsNullOrEmpty(this._mlsFileUrl)&&null!=this._mlsFileUrl&&(this._mlsFileUrl=null,null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null)):null!=this._mlsStrings&&(this._mlsStrings.Clear(),this._mlsStrings=null),e.setCurrIndex(a);break;case E.MG_TAG_CONSTMESSAGES_END:case E.MG_TAG_MLS_FILE_URL_END:case E.MG_TAG_CONSTMESSAGESCONTENT_END:case E.MG_TAG_MLS_CONTENT_END:e.setCurrIndex2EndOfTag();break;case E.MG_TAG_LANGUAGE_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LanguageData.initInnerObjects(): "+n),!1}return!0},e.prototype.getConstMessage=function(e){if(null===this._constMessages){this._constMessages=new t.Hashtable;for(var n=0;n<=r.MsgInterface.DefaultMessages.length-1;n+=1)this._constMessages.set_Item(r.MsgInterface.DefaultMessages[n].MsgID,r.MsgInterface.DefaultMessages[n].MsgString)}return this._constMessages.get_Item(e)},e.prototype.InitConstMessagesTable=function(){return T(this,void 0,void 0,(function(){var e,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:if(o.trys.push([0,9,,10]),e=null,null==this._constMessagesUrl&&null==this._constMessagesContent)return[3,7];if(null==this._constMessagesUrl)return[3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Te.GetContent(this._constMessagesUrl,!0)];case 2:return e=o.sent(),[3,4];case 3:return o.sent(),r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format('Unknown message file: "{0}"',this._constMessagesUrl)),[3,4];case 4:return[3,6];case 5:e=this._constMessagesContent,o.label=6;case 6:return null!=e&&(n=e.indexOf("<ErrorCodes>"),a=e.indexOf(he)+he.length,s=e.substr(n,a-n),this.fillConstMessagesTable(s)),[3,8];case 7:r.Logger.Instance.WriteDevToLog("'constMessagesUrl' and 'constMessagesContent' were not initialized."),o.label=8;case 8:return[3,10];case 9:return i=o.sent(),r.Logger.Instance.WriteExceptionToLog(i),[3,10];case 10:return[2]}}))}))},e.prototype.fillConstMessagesTable=function(e){try{null!==e&&(this._constMessages=new t.Hashtable,r.JSON_Utils.JSONFromXML(e,this.FillConstMessagesFromJSON.bind(this)))}catch(e){r.Logger.Instance.WriteExceptionToLog(e)}},e.prototype.FillConstMessagesFromJSON=function(e,t){if(null!=e)throw e;for(var r=t.ErrorCodes.ErrorMessage,n=0;n<r.length;n++){var s=r[n].$.id,i=r[n]._;this._constMessages.set_Item(s,a.isUndefined(i)?"":i.trim())}},e.prototype.translate=function(e){var t=null;if(null==this._mlsStrings)return e;try{null==(t=this._mlsStrings.get_Item(e))&&(t=e)}catch(e){console.log(e)}return t},e.prototype.fillMlsMessagesTable=function(){return T(this,void 0,void 0,(function(){var e,n,a,s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:if(h.trys.push([0,4,,5]),null==this._mlsContent)return[3,1];if(this._mlsContent.length>0)for(s=this._mlsContent.length,o=0,l=this._mlsContent+3,this._mlsStrings=new t.Hashtable,i=this._mlsContent.substring(this._mlsContent.length-10,8),o=parseInt(i.toString(),16),c=r.StrUtil.tokenize(l.toString(),"\n"),e=0;e<2*o;e+=2)null==this._mlsStrings.get_Item(c[e].toString())&&this._mlsStrings.set_Item(c[e].toString(),c[e+1].toString());return[3,3];case 1:return null==this._mlsFileUrl?[3,3]:[4,Te.GetContent(this._mlsFileUrl,!0)];case 2:if(n=h.sent(),null!=(a=n)&&a.length>0)for(s=a.length,this._mlsStrings=new t.Hashtable,i=a.substr(s-10,8),o=parseInt(i,16),l=void 0,u=void 0,c=r.StrUtil.tokenize(a.toString(),"\n"),_=0;_<2*o;_+=2)l=c[_].substr(0,c[_].length-1),u=c[_+1].substr(0,c[_+1].length-1),null==this._mlsStrings.get_Item(l)&&this._mlsStrings.set_Item(l,u);h.label=3;case 3:return[3,5];case 4:return T=h.sent(),r.Logger.Instance.WriteExceptionToLog(T),r.Misc.WriteStackTrace(T),[3,5];case 5:return[2]}}))}))},e}();pe.Instance=new pe;var ge=function(){function e(){}return Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.execGuiCommandQueue=function(){n.Commands.beginInvoke()},e.prototype.startTimer=function(e,t,r){t>0&&(new K(e,1e3*t,r).Start(),n.Commands.beginInvoke())},e.prototype.stopTimer=function(e,t,r){t>0&&K.StopTimer(e,1e3*t,r)},e.prototype.abort=function(e){1===arguments.length?this.abort_0(e):this.abort_1()},e.prototype.abort_0=function(e){if(null!==e){var t=o.mgDataTable.GetMainProgByCtlIdx(-1,e.getTask().getCtlIdx());n.Manager.Abort(e,t)}},e.prototype.abort_1=function(){for(var e=o.mgDataTable.getSize();e>0;e--){var t=o.mgDataTable.getMGData(e-1).getFirstTask();null!==t&&this.abort(t.Form)}},e.prototype.MessageBox=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(a){switch(a.label){case 0:return[4,o.eventsManager.CheckAndShowSpinner(!1)];case 1:return a.sent(),[4,n.Commands.messageBox(e,t,r)];case 2:return[2,a.sent()]}}))}))},e.prototype.writeToMessageBox=function(e,t,r){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return n=pe.Instance.getConstMessage(e),a=pe.Instance.getConstMessage(t),[4,this.MessageBox(n,a,r)];case 1:return[2,s.sent()]}}))}))},e.prototype.confirm=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.writeToMessageBox(r.MsgInterface.CONFIRM_STR_WINDOW_TITLE,e,t)];case 1:return[2,n.sent()]}}))}))},e.prototype.confirm_bool=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.confirm(e,n.Styles.MSGBOX_BUTTON_OK_CANCEL)];case 1:return[2,t.sent()==n.Styles.MSGBOX_RESULT_OK]}}))}))},e}();ge._instance=null;var de=function(){function e(e){this._expressionEvaluator=null,this._expressionEvaluator=e}return e.prototype.eval_op_han=function(n){for(var a,s=new t.StringBuilder(r.StrUtil.rtrim(n)),i=new t.StringBuilder(0),o=0;o<s.Length;o+=1){var l=s.get_Item(o);if(65281<=l.charCodeAt(0)&&l.charCodeAt(0)<=65374&&65340!==l.charCodeAt(0)&&65344!==l.charCodeAt(0))i.Append(String.fromCharCode(l.charCodeAt(0)-65248));else if(12443<=l.charCodeAt(0)&&l.charCodeAt(0)<=12534)i.Append(e.tableZen2Han[l.charCodeAt(0)-12443][0]),e.tableZen2Han[l.charCodeAt(0)-12443][1].charCodeAt(0)>0&&i.Append(e.tableZen2Han[l.charCodeAt(0)-12443][1]);else{var u=void 0;for(u=0;u<e.tableExceptZen2Han.length;u++)if(l===e.tableExceptZen2Han[u][0]){i.Append(e.tableExceptZen2Han[u][1]);break}u===e.tableExceptZen2Han.length&&i.Append(l)}}return a=i.ToString(),s=null,i=null,a},e.prototype.eval_op_zens=function(n,a){for(var s,i=new t.StringBuilder(r.StrUtil.rtrim(n)),o=new t.StringBuilder(0),l=0;l<i.Length;l+=1){var u=i.get_Item(l);if(32<=u.charCodeAt(0)&&u.charCodeAt(0)<=126)switch(u){case String.fromCharCode(32):1===a?o.Append(String.fromCharCode(12288)):2===a?(o.Append(String.fromCharCode(32)),o.Append(String.fromCharCode(32))):o.Append(String.fromCharCode(32));break;case String.fromCharCode(34):o.Append(String.fromCharCode(8221));break;case String.fromCharCode(39):o.Append(String.fromCharCode(8217));break;case String.fromCharCode(92):o.Append(String.fromCharCode(65509));break;case String.fromCharCode(96):o.Append(String.fromCharCode(8216));break;default:o.Append(String.fromCharCode(u.charCodeAt(0)+65248))}else if(65377<=u.charCodeAt(0)&&u.charCodeAt(0)<=65439){var c=String.fromCharCode(0);l+1<i.Length&&65438!==(c=i.get_Item(l+1)).charCodeAt(0)&&65439!==c.charCodeAt(0)&&(c=String.fromCharCode(0)),65438===c.charCodeAt(0)?65398<=u.charCodeAt(0)&&u.charCodeAt(0)<=65412||65418<=u.charCodeAt(0)&&u.charCodeAt(0)<=65422?o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377]+1):65395===u.charCodeAt(0)?o.Append(String.fromCharCode(12532)):c=String.fromCharCode(0):65439===c.charCodeAt(0)&&(65418<=u.charCodeAt(0)&&u.charCodeAt(0)<=65422?o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377]+2):c=String.fromCharCode(0)),0!==c.charCodeAt(0)?l++:o.Append(e.tableHan2Zen[u.charCodeAt(0)-65377])}else o.Append(u)}return s=o.ToString(),i=null,o=null,s},e.prototype.eval_op_zimeread=function(e){var t=null,r=n.Manager.UtilImeJpn;return null!==r&&(t=r.StrImeRead),t},e.prototype.eval_op_zkana=function(e,n){for(var a,s=new t.StringBuilder(r.StrUtil.rtrim(e)),i=0;i<s.Length;i+=1){var o=s.get_Item(i);0===n?12353<=o.charCodeAt(0)&&o.charCodeAt(0)<=12435&&s.set_Item(i,String.fromCharCode(o.charCodeAt(0)+96)):12449<=o.charCodeAt(0)&&o.charCodeAt(0)<=12531&&s.set_Item(i,String.fromCharCode(o.charCodeAt(0)-96))}return a=s.ToString(),s=null,a},e.prototype.eval_op_jcdow=function(e,t,r){this._expressionEvaluator.eval_op_date_str(e,t,"SSSSSST",r)},e.prototype.eval_op_jmonth=function(e,t){if(null!==t.MgNumVal){t.MgNumVal=this._expressionEvaluator.mul_add(t.MgNumVal,31,-30),this._expressionEvaluator.eval_op_month(e,t);var n=e.MgNumVal.NUM_2_LONG();e.Attr=r.StorageAttribute.ALPHA,e.StrVal=r.UtilDateJpn.convertStrMonth(n)}else this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e.prototype.eval_op_jndow=function(e,t,n){null!==t.MgNumVal?(t.MgNumVal=this._expressionEvaluator.mul_add(t.MgNumVal,0,6),this.eval_op_jcdow(e,t.MgNumVal,n)):this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e.prototype.eval_op_jyear=function(e,t){this._expressionEvaluator.eval_op_date_brk(e,t.MgNumVal,4)},e.prototype.eval_op_jgengo=function(e,t,n,a){var s;if(e.Attr=r.StorageAttribute.ALPHA,null!==t&&null!==n){var i=n.NUM_2_LONG();if(i>=4)s="JJJJ";else if(i>=2)s="JJ";else{if(!(i>=1))return void(e.StrVal="");s="J"}this._expressionEvaluator.eval_op_date_str(e,t,s,a)}else this._expressionEvaluator.SetNULL(e,r.StorageAttribute.ALPHA)},e}();de.tableZen2Han=[[String.fromCharCode(65438),String.fromCharCode(0)],[String.fromCharCode(65439),String.fromCharCode(0)],[String.fromCharCode(12445),String.fromCharCode(0)],[String.fromCharCode(12446),String.fromCharCode(0)],[String.fromCharCode(12447),String.fromCharCode(0)],[String.fromCharCode(12448),String.fromCharCode(0)],[String.fromCharCode(65383),String.fromCharCode(0)],[String.fromCharCode(65393),String.fromCharCode(0)],[String.fromCharCode(65384),String.fromCharCode(0)],[String.fromCharCode(65394),String.fromCharCode(0)],[String.fromCharCode(65385),String.fromCharCode(0)],[String.fromCharCode(65395),String.fromCharCode(0)],[String.fromCharCode(65386),String.fromCharCode(0)],[String.fromCharCode(65396),String.fromCharCode(0)],[String.fromCharCode(65387),String.fromCharCode(0)],[String.fromCharCode(65397),String.fromCharCode(0)],[String.fromCharCode(65398),String.fromCharCode(0)],[String.fromCharCode(65398),String.fromCharCode(65438)],[String.fromCharCode(65399),String.fromCharCode(0)],[String.fromCharCode(65399),String.fromCharCode(65438)],[String.fromCharCode(65400),String.fromCharCode(0)],[String.fromCharCode(65400),String.fromCharCode(65438)],[String.fromCharCode(65401),String.fromCharCode(0)],[String.fromCharCode(65401),String.fromCharCode(65438)],[String.fromCharCode(65402),String.fromCharCode(0)],[String.fromCharCode(65402),String.fromCharCode(65438)],[String.fromCharCode(65403),String.fromCharCode(0)],[String.fromCharCode(65403),String.fromCharCode(65438)],[String.fromCharCode(65404),String.fromCharCode(0)],[String.fromCharCode(65404),String.fromCharCode(65438)],[String.fromCharCode(65405),String.fromCharCode(0)],[String.fromCharCode(65405),String.fromCharCode(65438)],[String.fromCharCode(65406),String.fromCharCode(0)],[String.fromCharCode(65406),String.fromCharCode(65438)],[String.fromCharCode(65407),String.fromCharCode(0)],[String.fromCharCode(65407),String.fromCharCode(65438)],[String.fromCharCode(65408),String.fromCharCode(0)],[String.fromCharCode(65408),String.fromCharCode(65438)],[String.fromCharCode(65409),String.fromCharCode(0)],[String.fromCharCode(65409),String.fromCharCode(65438)],[String.fromCharCode(65391),String.fromCharCode(0)],[String.fromCharCode(65410),String.fromCharCode(0)],[String.fromCharCode(65410),String.fromCharCode(65438)],[String.fromCharCode(65411),String.fromCharCode(0)],[String.fromCharCode(65411),String.fromCharCode(65438)],[String.fromCharCode(65412),String.fromCharCode(0)],[String.fromCharCode(65412),String.fromCharCode(65438)],[String.fromCharCode(65413),String.fromCharCode(0)],[String.fromCharCode(65414),String.fromCharCode(0)],[String.fromCharCode(65415),String.fromCharCode(0)],[String.fromCharCode(65416),String.fromCharCode(0)],[String.fromCharCode(65417),String.fromCharCode(0)],[String.fromCharCode(65418),String.fromCharCode(0)],[String.fromCharCode(65418),String.fromCharCode(65438)],[String.fromCharCode(65418),String.fromCharCode(65439)],[String.fromCharCode(65419),String.fromCharCode(0)],[String.fromCharCode(65419),String.fromCharCode(65438)],[String.fromCharCode(65419),String.fromCharCode(65439)],[String.fromCharCode(65420),String.fromCharCode(0)],[String.fromCharCode(65420),String.fromCharCode(65438)],[String.fromCharCode(65420),String.fromCharCode(65439)],[String.fromCharCode(65421),String.fromCharCode(0)],[String.fromCharCode(65421),String.fromCharCode(65438)],[String.fromCharCode(65421),String.fromCharCode(65439)],[String.fromCharCode(65422),String.fromCharCode(0)],[String.fromCharCode(65422),String.fromCharCode(65438)],[String.fromCharCode(65422),String.fromCharCode(65439)],[String.fromCharCode(65423),String.fromCharCode(0)],[String.fromCharCode(65424),String.fromCharCode(0)],[String.fromCharCode(65425),String.fromCharCode(0)],[String.fromCharCode(65426),String.fromCharCode(0)],[String.fromCharCode(65427),String.fromCharCode(0)],[String.fromCharCode(65388),String.fromCharCode(0)],[String.fromCharCode(65428),String.fromCharCode(0)],[String.fromCharCode(65389),String.fromCharCode(0)],[String.fromCharCode(65429),String.fromCharCode(0)],[String.fromCharCode(65390),String.fromCharCode(0)],[String.fromCharCode(65430),String.fromCharCode(0)],[String.fromCharCode(65431),String.fromCharCode(0)],[String.fromCharCode(65432),String.fromCharCode(0)],[String.fromCharCode(65433),String.fromCharCode(0)],[String.fromCharCode(65434),String.fromCharCode(0)],[String.fromCharCode(65435),String.fromCharCode(0)],[String.fromCharCode(12526),String.fromCharCode(0)],[String.fromCharCode(65436),String.fromCharCode(0)],[String.fromCharCode(12528),String.fromCharCode(0)],[String.fromCharCode(12529),String.fromCharCode(0)],[String.fromCharCode(65382),String.fromCharCode(0)],[String.fromCharCode(65437),String.fromCharCode(0)],[String.fromCharCode(65395),String.fromCharCode(65438)],[String.fromCharCode(65398),String.fromCharCode(0)],[String.fromCharCode(65401),String.fromCharCode(0)]],de.tableExceptZen2Han=[[String.fromCharCode(8216),String.fromCharCode(96)],[String.fromCharCode(8217),String.fromCharCode(39)],[String.fromCharCode(8221),String.fromCharCode(34)],[String.fromCharCode(12288),String.fromCharCode(32)],[String.fromCharCode(12289),String.fromCharCode(65380)],[String.fromCharCode(12290),String.fromCharCode(65377)],[String.fromCharCode(12300),String.fromCharCode(65378)],[String.fromCharCode(12301),String.fromCharCode(65379)],[String.fromCharCode(12539),String.fromCharCode(65381)],[String.fromCharCode(12540),String.fromCharCode(65392)],[String.fromCharCode(65509),String.fromCharCode(92)]],de.tableHan2Zen=[String.fromCharCode(12290),String.fromCharCode(12300),String.fromCharCode(12301),String.fromCharCode(12289),String.fromCharCode(12539),String.fromCharCode(12530),String.fromCharCode(12449),String.fromCharCode(12451),String.fromCharCode(12453),String.fromCharCode(12455),String.fromCharCode(12457),String.fromCharCode(12515),String.fromCharCode(12517),String.fromCharCode(12519),String.fromCharCode(12483),String.fromCharCode(12540),String.fromCharCode(12450),String.fromCharCode(12452),String.fromCharCode(12454),String.fromCharCode(12456),String.fromCharCode(12458),String.fromCharCode(12459),String.fromCharCode(12461),String.fromCharCode(12463),String.fromCharCode(12465),String.fromCharCode(12467),String.fromCharCode(12469),String.fromCharCode(12471),String.fromCharCode(12473),String.fromCharCode(12475),String.fromCharCode(12477),String.fromCharCode(12479),String.fromCharCode(12481),String.fromCharCode(12484),String.fromCharCode(12486),String.fromCharCode(12488),String.fromCharCode(12490),String.fromCharCode(12491),String.fromCharCode(12492),String.fromCharCode(12493),String.fromCharCode(12494),String.fromCharCode(12495),String.fromCharCode(12498),String.fromCharCode(12501),String.fromCharCode(12504),String.fromCharCode(12507),String.fromCharCode(12510),String.fromCharCode(12511),String.fromCharCode(12512),String.fromCharCode(12513),String.fromCharCode(12514),String.fromCharCode(12516),String.fromCharCode(12518),String.fromCharCode(12520),String.fromCharCode(12521),String.fromCharCode(12522),String.fromCharCode(12523),String.fromCharCode(12524),String.fromCharCode(12525),String.fromCharCode(12527),String.fromCharCode(12531),String.fromCharCode(12443),String.fromCharCode(12444)];var Ee,Ie=function(e,t,r,n,a,s){this.Attr_="\0",this.Prec_=0,this.ArgCount_=0,this.ArgEvalCount_=0,this.ArgAttr_=null,this.RtfAsAlpha_=!1,this.Attr_=e,this.Prec_=t,this.ArgCount_=r,this.ArgEvalCount_=n,this.ArgAttr_=a,this.RtfAsAlpha_=s},fe=function(){};fe.expDesc=[new Ie(" ",0,0,0,"",!1),new Ie(" ",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",4,2,2,"NN",!1),new Ie("N",4,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",5,2,2,"NN",!1),new Ie("N",4,1,1,"N",!1),new Ie("N",0,3,3,"NNN",!1),new Ie("N",0,3,3,"NNN",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",3,2,2," ",!1),new Ie("B",2,1,1,"B",!1),new Ie("B",1,2,1,"BB",!1),new Ie("B",2,2,1,"BB",!1),new Ie(" ",0,3,1,"B ",!1),new Ie("N",0,1,1,"U",!0),new Ie("A",4,2,2,"UU",!0),new Ie("A",0,3,3,"UNN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("A",0,2,2,"UN",!0),new Ie("N",0,2,2,"UU",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,2,2,"NU",!0),new Ie("N",0,2,2,"UU",!0),new Ie("B",0,2,2,"NA",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("*",0,1,1,"V",!1),new Ie("*",0,1,1,"V",!1),new Ie("B",0,1,1,"V",!1),new Ie("N",0,1,1,"N",!1),new Ie("A",0,1,1,"V",!1),new Ie("B",0,1,1,"N",!1),new Ie("H",0,1,1,"A",!0),new Ie("A",0,1,1,"A",!0),new Ie("B",0,2,2,"AB",!0),null,null,new Ie("N",0,0,0,"",!1),null,new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("H",0,0,0,"",!1),null,new Ie("U",0,0,0,"",!1),new Ie("H",0,0,0,"",!1),null,new Ie("N",6,2,2,"NN",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie(" ",0,-2,-2," ",!1),new Ie(" ",0,-2,-2," ",!1),new Ie("B",0,3,3," ",!1),new Ie("A",0,4,4,"UUNN",!0),new Ie("A",0,4,4,"UUNN",!0),new Ie("A",0,3,3,"UNN",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,1,1,"U",!0),new Ie("A",0,2,2,"AN",!0),new Ie("N",0,2,2,"AN",!0),new Ie("A",0,1,1,"A",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"A",!0),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"A",!0),null,null,null,null,null,null,null,null,new Ie("A",0,2,2,"NN",!1),new Ie("N",0,1,1,"A",!0),new Ie("A",0,2,2,"DU",!0),new Ie("D",0,2,2,"UU",!0),new Ie("A",0,2,2,"TU",!0),new Ie("T",0,2,2,"UU",!0),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("N",0,1,1,"D",!1),new Ie("A",0,1,1,"D",!1),new Ie("A",0,1,1,"D",!1),new Ie("A",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"T",!1),new Ie("N",0,1,1,"T",!1),new Ie("N",0,1,1,"T",!1),new Ie("B",0,1,1,"N",!1),new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("D",0,4,4,"DNNN",!1),new Ie("T",0,4,4,"TNNN",!1),new Ie("H",0,0,0,"",!1),new Ie("A",0,1,1,"V",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),new Ie("D",0,1,1,"D",!1),null,new Ie("N",0,0,0,"",!1),null,new Ie("B",0,2,2,"BN",!1),new Ie("B",0,2,2,"V ",!1),null,null,null,null,new Ie("*",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("B",0,1,1," ",!1),new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),new Ie("B",0,0,0,"",!1),null,null,null,new Ie("A",0,1,1,"U",!1),new Ie("A",0,0,0,"",!0),new Ie("N",0,2,2,"NA",!0),new Ie("N",0,1,1,"N",!1),null,null,null,new Ie("A",0,0,0,"",!1),new Ie("B",0,2,2,"AB",!1),new Ie("B",0,2,2,"AB",!1),new Ie("B",0,2,2,"AB",!1),new Ie("O",0,0,0,"",!1),null,new Ie("*",0,1,1,"A",!1),new Ie("B",0,2,2,"A ",!1),null,null,null,null,null,new Ie("*",0,2,2,"B*",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"V",!1),new Ie("N",0,0,0,"",!1),new Ie("A",0,3,3,"UNU",!0),null,null,null,new Ie("A",0,2,2,"AN",!0),new Ie("A",0,1,1,"N",!0),new Ie("N",0,0,0,"",!0),new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),null,null,new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"N",!1),null,new Ie("N",0,1,1,"A",!1),new Ie("A",0,1,1,"N",!0),null,null,new Ie("A",0,1,1,"AAAA",!0),null,null,null,null,new Ie("N",0,1,1,"N",!0),new Ie(" ",0,-4,-4," ",!1),null,new Ie("B",2,2,2,"AA",!0),null,null,null,null,null,null,null,new Ie("B",0,-1,-1,"A",!1),null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,new Ie("A",0,3,3,"UUU",!1),null,null,new Ie("N",0,2,2,"NN",!1),new Ie("A",0,2,2,"NN",!1),null,new Ie("N",0,2,2,"UU",!1),new Ie("*",0,1,1,"A",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,-2,-2," U",!0),new Ie("B",0,0,0,"",!1),new Ie("A",0,0,0,"",!1),null,null,new Ie("A",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,2,2,"AA",!1),null,null,new Ie("A",0,1,1,"A",!0),new Ie("A",0,1,1,"A",!0),new Ie("A",0,2,2,"AA",!0),new Ie("A",0,1,1,"N",!1),new Ie("A",0,2,2,"AA",!0),null,null,null,null,null,null,null,null,new Ie("B",0,2,2,"AU",!1),null,null,null,null,new Ie("B",0,3,3,"ANN",!1),null,null,null,null,new Ie("A",0,1,1,"A",!1),new Ie("U",0,2,2,"UU",!1),null,new Ie("B",0,2,2,"AA",!1),new Ie("B",0,-3,-3,"AAA",!1),new Ie("N",0,0,0,"",!1),new Ie("*",0,1,1,"N",!1),new Ie("B",0,-2,-2,"*NA",!1),null,new Ie("B",0,-1,-1,"*NA",!1),new Ie("*",0,-1,-1,"*NA",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),null,null,new Ie("*",0,2,2,"ON",!1),new Ie("B",0,3,3,"VN ",!1),new Ie("N",0,1,1,"O",!1),new Ie("A",0,1,1,"O",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,1,1,"O",!1),null,null,null,null,null,new Ie("N",0,3,3,"UUU",!1),new Ie("N",0,0,0,"",!1),new Ie("T",0,2,2,"UU",!0),new Ie("A",0,2,2,"NU",!0),null,null,null,null,null,new Ie("B",0,1,1," ",!1),null,null,null,null,new Ie("B",0,-2,-2," ",!0),null,null,new Ie("B",0,0,0,"",!1),null,null,null,null,null,null,new Ie("N",0,2,2,"NN",!0),new Ie("B",0,1,1,"U",!0),new Ie("A",0,0,0,"",!0),new Ie("N",0,0,0,"",!0),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("U",0,0,0,"",!1),new Ie("B",0,2,2,"NA",!1),new Ie("B",0,-1,-1,"NA",!1),new Ie("B",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie(" ",0,-16,-16," ",!1),new Ie("N",0,1,1,"N",!1),null,null,null,null,null,null,null,new Ie("A",0,1,1,"N",!1),new Ie("N",0,1,1,"U",!1),new Ie("U",0,2,2,"AN",!1),new Ie("A",0,2,2,"UN",!1),new Ie("B",0,8,8,"VVNNNNNN",!1),new Ie("B",0,6,6,"DTDTVV",!1),new Ie("B",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),null,null,new Ie("N",0,1,1,"N",!1),null,null,new Ie("B",0,1,1,"U",!1),new Ie("N",0,2,2,"AB",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("N",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),new Ie("S",0,0,0,"",!1),new Ie("B",0,1,1,"A",!1),new Ie("A",0,1,1,"N",!1),new Ie("A",0,1,1,"N",!1),null,null,null,null,new Ie("A",0,-2,-2,"UU",!1),null,new Ie("O",0,1,1,"A",!1),new Ie("B",0,2,2,"OA",!1),new Ie("B",0,2,2,"AA",!1),new Ie("B",0,1,1,"A",!1),new Ie("B",0,1,1,"A",!1),new Ie("O",0,3,3,"AAB",!1),new Ie("B",0,2,2,"AA",!1),new Ie("N",0,1,1,"A",!1),new Ie("A",0,1,1,"A",!1),new Ie("B",0,2,2,"AA",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,2,2,"AA",!1),new Ie("A",0,1,1,"A",!1),new Ie("B",0,-3,-3,"AABU",!1),new Ie("A",0,0,0,"",!1),new Ie("N",0,2,2,"AN",!1),new Ie("N",0,2,2,"AN",!1),new Ie("A",0,1,1,"U",!1),null,null,new Ie("A",0,2,2,"AN",!1),new Ie("A",0,5,5,"AAABB",!0),new Ie("A",0,5,5,"AAAAB",!0),new Ie("A",0,3,3,"AAB",!0),null,null,new Ie("B",0,4,4,"UUUB",!0),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,0,0,"",!0),new Ie("A",0,0,0,"",!0),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,-3,-3,"ENA",!1),new Ie(" ",0,-3,-3,"ENA",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-2,-2,"EN",!1),new Ie(" ",0,-3,-3,"NE ",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,3,3,"ENA",!1),new Ie(" ",0,2,2,"EA",!1),new Ie(" ",0,2,2,"EE",!1),new Ie(" ",0,1,1," ",!1),new Ie(" ",0,2,2," ",!1),new Ie(" ",0,2,2,"NA",!1),new Ie(" ",0,0,0,"",!1),new Ie(" ",0,0,0,"",!1),new Ie("A",0,1,1,"N",!1),null,new Ie("A",0,1,1,"A",!1),new Ie("N",0,2,2,"AA",!1),new Ie("B",0,-2,-2,"V ",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,-2,-2,"V ",!1),new Ie("B",0,1,1,"N",!1),new Ie("B",0,2,2,"VB",!1),new Ie("B",0,1,1,"N",!1),new Ie("N",0,1,1,"N",!1),null,null,new Ie(" ",0,3,3,"NAA",!1),null,null,null,null,null,null,new Ie("B",0,2,2,"A ",!1),new Ie("D",0,0,0,"",!1),new Ie("T",0,0,0,"",!1),new Ie("N",0,0,0,"",!1),new Ie("B",0,1,1,"A",!1),new Ie("B",0,5,5,"NANAA",!1),new Ie("B",0,2,2,"NA",!1),null,null,null,null,null,null,new Ie("*",0,-2,-2,"AA",!1),null,new Ie("U",0,1,1,"V",!1),new Ie("B",0,2,2,"NB",!1),new Ie("B",0,2,2,"AN",!1),new Ie("N",0,1,1,"V",!1),new Ie("U",0,1,1,"N",!1),new Ie("U",0,1,1,"N",!1),new Ie("B",0,-2,-2,"AU",!1),new Ie("N",0,2,2,"NB",!1),new Ie("N",0,2,2,"NB",!1),new Ie("N",0,1,1,"N",!1),null,null,null,null,null,null,null,null,new Ie("S",0,5,5,"NNNNB",!1),new Ie("B",0,2,2,"UU",!1),null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,new Ie("B",0,1,1,"U",!1),null,new Ie("B",0,1,1,"N",!1),new Ie("B",0,0,0,"",!1),null,null,null,null,null,null,null,null,null,null,new Ie("B",0,-2,-2,"*",!1),new Ie("*",0,1,1,"A",!1),new Ie("B",0,1,1,"A",!1),null,new Ie("U",0,0,0,"",!1)],e.DataViewCommandType=void 0,(Ee=e.DataViewCommandType||(e.DataViewCommandType={}))[Ee.Init=0]="Init",Ee[Ee.Clear=1]="Clear",Ee[Ee.Prepare=2]="Prepare",Ee[Ee.FirstChunk=3]="FirstChunk",Ee[Ee.RecomputeUnit=4]="RecomputeUnit",Ee[Ee.ExecuteLocalUpdates=5]="ExecuteLocalUpdates",Ee[Ee.InitDataControlViews=6]="InitDataControlViews",Ee[Ee.OpenTransaction=7]="OpenTransaction",Ee[Ee.CloseTransaction=8]="CloseTransaction",Ee[Ee.SetTransactionState=9]="SetTransactionState",Ee[Ee.AddUserRange=10]="AddUserRange",Ee[Ee.ResetUserRange=11]="ResetUserRange",Ee[Ee.DbDisconnect=12]="DbDisconnect",Ee[Ee.AddUserLocate=13]="AddUserLocate",Ee[Ee.ResetUserLocate=14]="ResetUserLocate",Ee[Ee.AddUserSort=15]="AddUserSort",Ee[Ee.ResetUserSort=16]="ResetUserSort",Ee[Ee.DataViewToDataSource=17]="DataViewToDataSource",Ee[Ee.DbDelete=18]="DbDelete",Ee[Ee.ControlItemsRefresh=19]="ControlItemsRefresh",Ee[Ee.SQLExecute=20]="SQLExecute";var Ce=function(e){function r(){var t=e.call(this)||this;return t.CommandType=0,t.TaskTag=null,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){throw new t.NotImplementedException},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){return t.Debug.Assert(!1,"Dataview commands need not be serialized"),null},Object.defineProperty(r.prototype,"ShouldSerialize",{get:function(){return!1},enumerable:!1,configurable:!0}),r}(C),Ae=function(){function e(){this._handlerIdx=0,this._handlersTab=null,this._orgPrevTask=null,this._orgTask=null,this._phase=0,this._prevTask=null,this._rtEvt=null,this._task=null}return e.prototype.init=function(t){this._rtEvt=t,this._task=this._rtEvt.getTask(),this._task.isMainProg()&&(this._prevTask=this._rtEvt.getMainPrgCreator(),null!==this._prevTask&&this._prevTask.isMainProg()&&(this._prevTask=null)),t.getType()===E.EVENT_TYPE_USER_FUNC||t.getType()===E.EVENT_TYPE_USER_FUNC?this._phase=e.PHASE_CONTROL_NON_SPECIFIC:this._phase=e.PHASE_CONTROL_SPECIFIC,this._orgTask=this._task,this._orgPrevTask=this._prevTask,this._handlersTab=this._task.getHandlersTab(),null===this._handlersTab&&this.goUpTaskChain(),this._handlerIdx=-1},e.prototype.getNext=function(e){return a.isNullOrUndefined(e)?this.getNext_1():this.getNext_0(e)},e.prototype.getNext_0=function(e){return this._rtEvt=e,this.getNext()},e.prototype.getNext_1=function(){if(null===this._handlersTab)return null;if(this._rtEvt.getType()===E.EVENT_TYPE_INTERNAL&&this._rtEvt.getInternalCode()!==r.InternalInterface.MG_ACT_VARIABLE)switch(this._rtEvt.getInternalCode()){case r.InternalInterface.MG_ACT_TASK_PREFIX:case r.InternalInterface.MG_ACT_TASK_SUFFIX:case r.InternalInterface.MG_ACT_REC_PREFIX:case r.InternalInterface.MG_ACT_REC_SUFFIX:case r.InternalInterface.MG_ACT_CTRL_PREFIX:case r.InternalInterface.MG_ACT_CTRL_SUFFIX:if(-1===this._handlerIdx)for(this._handlerIdx=this._handlersTab.getSize()-1;this._handlerIdx>=0;this._handlerIdx--){if((t=this._handlersTab.getHandler(this._handlerIdx)).isNonSpecificHandlerOf(this._rtEvt)||t.isSpecificHandlerOf(this._rtEvt))return t}return null}for(;this.setNextHandlerIdx();){var t=this._handlersTab.getHandler(this._handlerIdx);switch(this._phase){case e.PHASE_CONTROL_SPECIFIC:if(t.isSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_CONTROL_NON_SPECIFIC:if(t.isNonSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_GLOBAL_SPECIFIC:if(t.isGlobalSpecificHandlerOf(this._rtEvt))return t;continue;case e.PHASE_GLOBAL:if(t.isGlobalHandlerOf(this._rtEvt))return t;continue;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in EventHandlerPosition.getNext() invalid phase: "+this._phase)}}return null},e.prototype.setNextHandlerIdx=function(){return this._handlerIdx<0?this._handlerIdx=this._handlersTab.getSize()-1:this._handlerIdx=this._handlerIdx-1,!(this._handlerIdx<0||this._task.isAborting())||!!this.goUpTaskChain()&&this.setNextHandlerIdx()},e.prototype.goUpTaskChain=function(){var t=this._task.getMGData(),n=this._task.getCtlIdx();switch(this._phase){case e.PHASE_CONTROL_SPECIFIC:case e.PHASE_CONTROL_NON_SPECIFIC:if(this._task.isMainProg()){if((this._rtEvt.getType()===E.EVENT_TYPE_PUBLIC||this._rtEvt.getType()===E.EVENT_TYPE_INTERNAL||this._rtEvt.getType()===E.EVENT_TYPE_SYSTEM||this._rtEvt.getType()===E.EVENT_TYPE_USER)&&n>0){null===this._prevTask?(this._task=t.getNextMainProg(n),null===this._task&&n>0&&(this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,o.eventsManager.getCompMainPrgTab().getCtlIdx(0)))):(this._task=this._prevTask.PathParentTask,this._prevTask=null),this._rtEvt.setMainPrgCreator(null);break}if(this._phase===e.PHASE_CONTROL_SPECIFIC?this._phase=e.PHASE_GLOBAL_SPECIFIC:this._phase=e.PHASE_GLOBAL,this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,o.eventsManager.getCompMainPrgTab().getCtlIdx(0)),this._rtEvt.setMainPrgCreator(this._task),null===this._task)return!1;break}this.getParentOrCompMainPrg();break;case e.PHASE_GLOBAL_SPECIFIC:case e.PHASE_GLOBAL:if(this._task=t.getNextMainProg(n),null===this._task){if(this._phase===e.PHASE_GLOBAL)return!1;this._phase=e.PHASE_CONTROL_NON_SPECIFIC,this._task=this._orgTask,this._prevTask=this._orgPrevTask}break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in EventHandlerPosition.goUpTaskChain() invalid phase: "+this._phase)}return null!==this._task&&(this._handlersTab=this._task.getHandlersTab(),null===this._handlersTab?this.goUpTaskChain():(this._handlerIdx=-1,!0))},e.prototype.getParentOrCompMainPrg=function(){var e=this._task.getCtlIdx();this._prevTask=this._task;var t=this._task.PathParentTask;null!==t?e!==t.getCtlIdx()?(this._rtEvt.setMainPrgCreator(this._task),this._task=o.mgDataTable.GetMainProgByCtlIdx(-1,e)):(this._rtEvt.setMainPrgCreator(null),this._task=t):this._task=null},e}();Ae.PHASE_CONTROL_SPECIFIC=1,Ae.PHASE_CONTROL_NON_SPECIFIC=2,Ae.PHASE_GLOBAL=3,Ae.PHASE_GLOBAL_SPECIFIC=4;var Re,Se=function(t){function r(){var r=t.call(this)||this;return r.Range=null,r.CommandType=e.DataViewCommandType.AddUserRange,r}return u(r,t),r}(Ce),Me=function(t){function r(){var r=t.call(this)||this;return r.Sort=null,r.CommandType=e.DataViewCommandType.AddUserSort,r}return u(r,t),r}(Ce),me=function(t){function r(){var r=t.call(this)||this;return r.CommandType=e.DataViewCommandType.AddUserLocate,r}return u(r,t),r}(Se),ve=function(t){function r(){var r=t.call(this)||this;return r.TransactionIsOpen=!1,r.CommandType=e.DataViewCommandType.SetTransactionState,r}return u(r,t),r}(Ce),Le=function(e){function t(){var t=e.call(this)||this;return t.Control=null,t}return u(t,e),t}(Ce),be=function(e){function r(t){var r=e.call(this,t)||this;return r.RefreshMode=0,r.KeepUserSort=!1,r.CurrentRecordRow=0,r.IsInternalRefresh=!1,r}return u(r,e),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),this.IsInternalRefresh||t.SerializeRefreshMode(this.RefreshMode),this.KeepUserSort&&t.SerializeAttribute(E.MG_ATTR_KEEP_USER_SORT,"1"),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} {1}]",this.EventDescription,this.IsInternalRefresh?"Raised by Magic":"Raised by User")},r}(R),Ne=function(e){function t(t){var r=e.call(this)||this;return r.Generation=0,r.TaskVarNames=null,r.DestinationDataSourceNumber=0,r.DestinationDataSourceName=null,r.DestinationColumns=null,r.CommandType=t,r}return u(t,e),t}(Ce),ye=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_FETCH_DATA_CONTROL_VALUES)||this;return t.ControlName=null,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_CONTROL_NAME,this.ControlName),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for control {1} in {2}]",this.EventDescription,this.ControlName,this.Task.getTaskInfo())},n}(R),Oe=function(e){function t(){var t=e.call(this,r.InternalInterface.MG_ACT_WRITE_ERROR_TO_SERVER_LOG)||this;return t.ErrorMessage=null,t}return u(t,e),t.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_ERROR_MESSAGE,this.ErrorMessage),t.GetString()},t}(R),Ge=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_SUBFORM_REFRESH)||this;return t.SubformTaskTag=null,t.ExplicitSubformRefresh=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeRefreshMode(this.RefreshMode),t.SerializeAttribute(E.MG_ATTR_SUBFORM_TASK,this.SubformTaskTag),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for {1}]",this.EventDescription,this.Task.getTaskInfo())},n}(be),Pe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_BROWSER_ESC)||this;return t.CloseSubformOnly=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.SerializeCloseSubformOnly(this.CloseSubformOnly),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,this.CloseSubformOnly?" Subform Only":t.NString.Empty,a.isNullOrUndefined(this.Task)?t.NString.Empty:this.Task.getTaskInfo())},n}(R),De=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_INDEX_CHANGE)||this;return t.KeyIndex=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeKeyIndex(this.KeyIndex),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} with Key Index {1} in {2}]",this.EventDescription,this.KeyIndex,this.Task.getTaskInfo())},n}(R),ke=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_COL_SORT)||this;return t.FldId=0,t.DitIdx=0,t.Direction=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeFldId(this.FldId),t.SerializeMagicEvent(this.MagicEvent),t.SerializeDitIdx(this.DitIdx),t.SerializeAttribute(E.MG_ATTR_DIRECTION,this.Direction),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for column {1} in {2}]",this.EventDescription,this.Task.getForm().getCtrl(this.DitIdx).getName(),this.Task.getTaskInfo())},n}(R),xe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN)||this;return t.TopRecIdx=0,t.RefreshMode=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,this.TopRecIdx),t.SerializeRefreshMode(this.RefreshMode),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]",this.EventDescription,this.Task.getTaskInfo())},n}(R),Fe=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_SUBFORM_OPEN)||this;return t.DitIdx=0,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeDitIdx(this.DitIdx),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} {1} in {2}]",this.EventDescription,this.Task.getForm().getCtrl(this.DitIdx).getName(),this.Task.getTaskInfo())},n}(R),we=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_COMPUTE)||this;return t.Subforms=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),this.Subforms&&t.SerializeAttribute(E.MG_ATTR_OBJECT,"99999"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} for {1} in {2}] ",this.EventDescription,this.Subforms?"Form and Subform":"Form",this.Task.getTaskInfo())},n}(R),Ve=function(e){function n(){var t=e.call(this,r.InternalInterface.MG_ACT_EXIT)||this;return t.CloseSubformOnly=!1,t}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_REVERSIBLE,"0"),t.SerializeCloseSubformOnly(this.CloseSubformOnly),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0}{1} in {2}]",this.EventDescription,this.CloseSubformOnly?" Closing Subform Only":t.NString.Empty,this.Task.getTaskInfo())},n}(R),Ue=function(e){function r(){var t=e.call(this)||this;return t.TaskTag=null,t.FldId=0,t.IgnoreSubformRecompute=!1,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_RECOMP},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeFldId(this.FldId),this.IgnoreSubformRecompute&&t.SerializeAttribute(E.MG_ATTR_IGNORE_SUBFORM_RECOMPUTE,"1"),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1} for Field {2}]",this.CommandTypeAttribute.charAt(0).toUpperCase()+this.CommandTypeAttribute.substr(1,this.CommandTypeAttribute.length),this.Task.getTaskInfo(),this.Task.getFieldDef(this.FldId).getName())},r}(C),Be=function(e){function r(){var t=e.call(this)||this;return t.TaskTag=null,t.ReversibleExit=!1,t}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_TRANS},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeAttribute(E.MG_ATTR_OPER,this.Oper),this.ReversibleExit||t.SerializeAttribute(E.MG_ATTR_REVERSIBLE,"0"),"\0"!==this.Level&&t.SerializeAttribute(E.MG_ATTR_TRANS_LEVEL,this.Level),t.GetString()},r.prototype.getCommandInfo=function(){return t.NString.Format("[{0} in {1}]","C"===this.Oper?"Commit Transaction":"Abort Transaction",this.Task.getTaskInfo())},r}(C),Xe=function(e){function r(){return e.call(this)||this}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_UNLOAD},enumerable:!1,configurable:!0}),r.prototype.getCommandInfo=function(){return t.NString.Format("[{0}]",this.CommandTypeAttribute)},r}(f),He=function(e){function n(){var r=e.call(this)||this;return r.TaskTag=null,r.ExpIdx=0,r.LengthExpVal=0,r.MprgCreator=null,r.LengthExpVal=t.Int32.MinValue,r}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_EVAL},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){var t=new A;if(t.SerializeTaskTag(this.TaskTag),t.SerializeAttribute(E.MG_ATTR_EXP_IDX,this.ExpIdx),this.ExpType!==r.StorageAttribute.NONE){var n="";this.LengthExpVal>0&&(n+=this.LengthExpVal),t.SerializeAttribute(E.MG_ATTR_EXP_TYPE,this.ExpType+n)}return null!==this.MprgCreator&&t.SerializeAttribute(E.MG_ATTR_MPRG_SOURCE,this.MprgCreator.getTaskTag()),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} ExpID {1} in {2}]",this.CommandTypeAttribute.charAt(0).toUpperCase()+this.CommandTypeAttribute.substr(1,this.CommandTypeAttribute.length),this.ExpIdx,this.Task.getTaskInfo())},n}(C),We=function(e){function r(){return e.call(this)||this}return u(r,e),Object.defineProperty(r.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_QUERY},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ShouldSerializeRecords",{get:function(){return!1},enumerable:!1,configurable:!0}),r.prototype.SerializeCommandData=function(e){var r=new t.StringBuilder;return r.Append(" "+E.MG_ATTR_VAL_QUERY_TYPE+'="'),r.Append(this.SerializeQueryCommandData()),r.ToString()},r}(f),Ke=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.SerializeQueryCommandData=function(){return E.MG_ATTR_VAL_QUERY_GLOBAL_PARAMS+'"'},t}(We),Ye=function(e){function n(){var t=e.call(this)||this;return t.Text=null,t}return u(n,e),Object.defineProperty(n.prototype,"CommandTypeAttribute",{get:function(){return E.MG_ATTR_VAL_INIPUT_FORCE_WRITE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ShouldSerializeRecords",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.SerializeCommandData=function(e){return" "+E.MG_ATTR_VAL_INIPUT_PARAM+'="'+r.XmlParser.escape(this.Text)+'"'},n.prototype.getCommandInfo=function(){return t.NString.Format("[{0} with {1}] ",this.CommandTypeAttribute,this.Text)},n}(f),ze=function(e){function n(){return e.call(this,r.InternalInterface.MG_ACT_CONTEXT_TERMINATION)||this}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeTaskTag(this.TaskTag),t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Empty},n}(R),qe=function(e){function n(){return e.call(this,r.InternalInterface.MG_ACT_CONTEXT_TIMEOUT_RESET)||this}return u(n,e),n.prototype.SerializeCommandData=function(e){var t=new A;return t.SerializeMagicEvent(this.MagicEvent),t.SerializeAttribute(E.MG_ATTR_OBJECT,"1"),t.GetString()},n.prototype.getCommandInfo=function(){return t.NString.Empty},n}(R),je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.getCommandInfo=function(){return"Select Program on Control "+o.eventsManager.getLastRtEvent().Control.Name},t.prototype.getTask=function(){return o.eventsManager.getLastRtEvent().getTask()},t}(q),Qe=function(){function t(){}return t.CreateEventCommand=function(e,t){var r=new R(t);return r.TaskTag=e,r},t.CreateRollbackEventCommand=function(e,t){var r=new S;return r.TaskTag=e,r.Rollback=t,r},t.CreateDataViewCommand=function(e,t){var r=new Ce;return r.CommandType=t,r.TaskTag=e,r},t.CreateAddUserRangeDataviewCommand=function(e,t){var r=new Se;return r.TaskTag=e,r.Range=t,r},t.CreateAddUserSortDataviewCommand=function(e,t){var r=new Me;return r.TaskTag=e,r.Sort=t,r},t.CreateAddUserLocateDataviewCommand=function(e,t){var r=new me;return r.TaskTag=e,r.Range=t,r},t.CreateSetTransactionStateDataviewCommand=function(e,t){var r=new ve;return r.TaskTag=e,r.TransactionIsOpen=t,r},t.CreateControlItemsRefreshCommand=function(t,r){var n=new Le;return n.TaskTag=t,n.CommandType=e.DataViewCommandType.ControlItemsRefresh,n.Control=r,n},t.CreateInternalRefreshCommand=function(e,t,n,a){var s=new be(t);return s.TaskTag=e,s.RefreshMode=r.ViewRefreshMode.CurrentLocation,s.ClientRecId=n,s.IsInternalRefresh=!0,s.CurrentRecordRow=a,s},t.CreateRealRefreshCommand=function(e,t,a,s,i){return T(this,void 0,void 0,(function(){var o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:if((o=new be(t)).TaskTag=e,o.RefreshMode=r.ViewRefreshMode.CurrentLocation,o.KeepUserSort=!1,o.ClientRecId=i,o.CurrentRecordRow=a,l=o,t===r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||null===s||0===s.getSize())return[3,8];T.label=1;case 1:return T.trys.push([1,3,,4]),c=n.NUM_TYPE.bind,[4,s.getArgValue(0,r.StorageAttribute.NUMERIC,0)];case 2:return u=new(c.apply(n.NUM_TYPE,[void 0,T.sent()])),l.RefreshMode=u.NUM_2_LONG()+1,[3,4];case 3:return T.sent(),l.RefreshMode=r.ViewRefreshMode.CurrentLocation,[3,4];case 4:if(!(s.getSize()>1))return[3,8];T.label=5;case 5:return T.trys.push([5,7,,8]),_=l,[4,s.getArgValue(1,r.StorageAttribute.BOOLEAN,0)];case 6:return _.KeepUserSort="1"===T.sent(),[3,8];case 7:return T.sent(),l.KeepUserSort=!1,[3,8];case 8:return[2,l]}}))}))},t.CreateDataViewToDataSourceCommand=function(t,r,n,a,s,i){var o=new Ne(e.DataViewCommandType.DataViewToDataSource);return o.TaskTag=t,o.Generation=r,o.TaskVarNames=n,o.DestinationDataSourceNumber=a,o.DestinationDataSourceName=s,o.DestinationColumns=i,o},t.CreatecFetchDataControlValuesCommand=function(e,t){var r=new ye;return r.TaskTag=e,r.ControlName=t,r},t.CreateWriteMessageToServerLogCommand=function(e,t){var r=new Oe;return r.TaskTag=e,r.ErrorMessage=t,r},t.CreateSubformRefreshCommand=function(e,t,n){var a=new Ge;return a.TaskTag=e,a.SubformTaskTag=t,a.ExplicitSubformRefresh=n,a.RefreshMode=r.ViewRefreshMode.UseTaskLocate,a},t.CreateSubformOpenCommand=function(e,t){var r=new Fe;return r.TaskTag=e,r.DitIdx=t,r},t.CreateScreenRefreshCommand=function(e,t,n){var a=new xe;return a.TaskTag=e,a.TopRecIdx=t,a.RefreshMode=r.ViewRefreshMode.CurrentLocation,a.ClientRecId=n,a},t.CreateColumnSortCommand=function(e,t,r,n,a){var s=new ke;return s.TaskTag=e,s.DitIdx=r,s.FldId=n+1,s.ClientRecId=a,s.Direction=t,s},t.CreateIndexChangeCommand=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if((s=new De).TaskTag=e,s.ClientRecId=t,i=s,null===a||0===a.getSize())return[3,4];u.label=1;case 1:return u.trys.push([1,3,,4]),l=n.NUM_TYPE.bind,[4,a.getArgValue(0,r.StorageAttribute.NUMERIC,0)];case 2:return o=new(l.apply(n.NUM_TYPE,[void 0,u.sent()])),i.KeyIndex=o.NUM_2_LONG(),[3,4];case 3:return u.sent(),i.KeyIndex=0,[3,4];case 4:return[2,i]}}))}))},t.CreateBrowserEscEventCommand=function(e,t){var r=new Pe;return r.TaskTag=e,r.CloseSubformOnly=t,r},t.CreateComputeEventCommand=function(e,t,r){var n=new we;return n.TaskTag=e,n.Subforms=t,n.ClientRecId=r,n},t.CreateContextTerminationEventCommand=function(e){var t=new ze;return t.TaskTag=e,t},t.CreateContextTimeoutResetEventCommand=function(){return new qe},t.CreateNonReversibleExitCommand=function(e,t){var r=new Ve;return r.TaskTag=e,r.CloseSubformOnly=t,r},t.CreateRecomputeCommand=function(e,t,r){var n=new Ue;return n.TaskTag=e,n.FldId=t,n.IgnoreSubformRecompute=r,n},t.CreateTransactionCommand=function(e,t,r,n){var a=new Be;return a.TaskTag=t,a.Oper=e,a.ReversibleExit=r,a.Level=n,a},t.CreateUnloadCommand=function(){return new Xe},t.CreateExecOperCommand=function(e,t,r,n,a){var s=new q;s.OperIdx=r,s.TaskTag=e,s.HandlerId=t,s.DitIdx=n;var i=s;return null!==a&&0===a.length?i.Val=" ":i.Val=a,i},t.CreateSelectProgramCommand=function(e,t,r,n,a){var s=new je;s.OperIdx=r,s.TaskTag=e,s.HandlerId=t,s.DitIdx=n;var i=s;return null!==a&&0===a.length?i.Val=" ":i.Val=a,i},t.CreateEvaluateCommand=function(e,t,r,n,a){var s=new He;return s.TaskTag=e,s.ExpIdx=r,s.ExpType=t,s.MprgCreator=a,n>0&&(s.LengthExpVal=n),s},t.CreateQueryGlobalParamsCommand=function(){return new Ke},t.CreateIniputForceWriteCommand=function(e){var t=new Ye;return t.Text=e,t},t}(),Ze=function(){this.fldIdx=0,this.dir=!1};e.ParamParseResult=void 0,(Re=e.ParamParseResult||(e.ParamParseResult={}))[Re.OK=0]="OK",Re[Re.TOUPPER=1]="TOUPPER",Re[Re.DELETE=2]="DELETE",Re[Re.FAILED=3]="FAILED";var Je=function(){function e(){this.values=null,this.values=new t.Dictionary}return e.prototype.getvalue=function(e){return this.values.ContainsKey(e)?this.values.get_Item(e):null},e.prototype.setValue=function(e,t){this.values.set_Item(e,t)},e.prototype.remove=function(e){this.values.Remove(e)},e}(),$e=function(n){function a(e){var r=n.call(this)||this;return r.changes=null,r.mirroredID=null,r.type=e,r.changes=new t.List,r}return u(a,n),a.prototype.new=function(){return new this.type},a.prototype.setValue=function(e,t,r){3===arguments.length?this.setValue_0(e,t,r):this.setValue_1(e,t)},a.prototype.setValue_0=function(e,t,r){r&&!this.changes.Contains(e)&&this.changes.push(e),n.prototype.setValue.call(this,e,t)},a.prototype.setValue_1=function(e,t){this.changes.Contains(e)||this.changes.push(e),n.prototype.setValue.call(this,e,t)},a.prototype.remove=function(e){this.changes.Contains(e)||this.changes.push(e),n.prototype.remove.call(this,e)},a.prototype.mirrorAllToXML=function(){var e,n,a=new t.StringBuilder;if(null!=this.values){a.Append("<"+this.mirroredID+">");try{for(var s=p(this.values.Keys),i=s.next();!i.done;i=s.next()){var o=i.value;this.CheckIfSystemReservedParam(o)||(a.Append("<"+E.MG_TAG_PARAM+" "+r.XMLConstants.MG_ATTR_NAME+'="'+r.XmlParser.escape(o)+'" '),a.Append(this.values.get_Item(o).mirrorToXML()),a.Append(r.XMLConstants.TAG_TERM))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}a.Append("</"+this.mirroredID+">")}return a.ToString()},a.prototype.CheckIfSystemReservedParam=function(e){return"UTF8TRANS"==e||"REMOTE_HOST"===e||"REMOTE_ADDR"===e||"CTX"===e||"MGARG0"===e||"DATA"===e||"MGCURRENTREQUESTID"===e||"HTTP_MGXPARIAGLOBALUNIQUESESSIONID"===e||"MG_POST_BODY"===e},a.prototype.mirrorToXML=function(){var e=this,n=new t.StringBuilder;return this.changes.length>0&&(n.Append("<"+this.mirroredID+">"),this.changes.forEach((function(t){n.Append("<"+E.MG_TAG_PARAM+" "+r.XMLConstants.MG_ATTR_NAME+'="'+r.XmlParser.escape(t)+'" '),e.values.ContainsKey(t)?n.Append(e.values.get_Item(t).mirrorToXML()):n.Append('removed="Y"'),n.Append(">")})),n.Append("</"+this.mirroredID+">")),this.changes.Clear(),n.ToString()},a.prototype.fillData=function(e){for(;this.mirrorFromXML(e.getNextTag(),e););},a.prototype.RestoreGlobalParams=function(e){for(var t=new r.XmlParser(e);this.mirrorFromXML(t.getNextTag(),t););},a.prototype.mirrorFromXML=function(e,t){return null!==e&&(e===this.mirroredID?(t.setCurrIndex2EndOfTag(),this.fillDataEntry(t),!0):e==="/"+this.mirroredID?(this.changes.Clear(),t.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in MirrorPrmMap.mirrorFromXML(): "+e),!1))},a.prototype.fillDataEntry=function(t){for(var n=t.getNextTag();n===E.MG_TAG_PARAM;){var a=t.getXMLdata().indexOf(r.XMLConstants.MG_ATTR_NAME+'="',t.getCurrIndex())+r.XMLConstants.MG_ATTR_NAME.length+2;t.setCurrIndex(a);var s=t.getXMLdata().indexOf('"',a),i=t.getXMLsubstring(s).trim();t.setCurrIndex(s);var o=this.new();switch(o.init(i,t)){case e.ParamParseResult.OK:this.values.set_Item(i,o);break;case e.ParamParseResult.TOUPPER:this.values.set_Item(i.toUpperCase(),o);break;case e.ParamParseResult.DELETE:this.values.Remove(i)}t.setCurrIndex2EndOfTag(),n=t.getNextTag()}},a}(Je),et=function(){function e(){this._environments=new t.Hashtable,this._contextInactivityTimeout=0,this._clientContextInactivityTimeout=0,this._contextInactivityWarningTime=0,this._toolitipTimeout=0,this._contextUnloadTimeout=0,this._accessTest=!1,this._canReplaceDecimalSeparator=!1,this._codePage=0,this._dateSeparator="\0",this._decimalSeparator="\0",this._thousandsSeparator="\0",this._timeSeparator="\0",this._defaultColor=0,this._defaultFocusColor=0,this._guid=null,this._controlsPersistencyPath=null,this._imeAutoOff=!1,this._language="\0",this._localAs400Set=!1,this._localExtraGengo=null,this._localFlags=null,this._lowHigh=!0,this._owner=null,this._debugMode=0,this._significantNumSize=0,this._specialAnsiExpression=!1,this._specialShowStatusBarPanes=!1,this._specialRouteToRootProgOnContextRecreation=!1,this._specialEditLeftAlign=!1,this._specialSwfControlName=!1,this._specialExitCtrl=!1,this._specialTextSizeFactoring=!1,this._specialFlatEditOnClassicTheme=!1,this._specialCancelOnCreate=!1,this._system=null,this._terminal=0,this._userId=null,this._userInfo=null,this._forwardSlash=r.Constants.ForwardSlashWebUsage,this._dropUserFormats=null,this._webclientReinitSession="N",this._specialValNewPolicy=!1,this.SpecialOldZorder=!1,this.IgnoreReplaceDecimalSeparator=!1}return Object.defineProperty(e.prototype,"Language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialNumpadPlusChar",{get:function(){return!0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialRestoreMaximizedForm",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SpecialIgnoreBGinModify",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ForwardSlashUsage",{get:function(){return this._forwardSlash},set:function(e){this._forwardSlash=e},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e){arguments[0]instanceof r.XmlParser?this.fillData_0(e):this.fillData_1(e)},e.prototype.fillData_0=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_ENV)+E.MG_TAG_ENV.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);this.fillData(a),e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.FillData() out of string bounds")},e.prototype.fillData_1=function(e){var t,a,s,i;n.Manager.UtilImeJpn;i=new tt;for(var o=0;o<e.length;o+=2)switch(t=e.get_Item(o),a=e.get_Item(o+1),a=r.XmlParser.unescape(a),t){case E.MG_ATTR_THOUSANDS:this._thousandsSeparator=a[0];break;case E.MG_ATTR_DECIMAL_SEPARATOR:this._decimalSeparator=a[0];break;case E.MG_ATTR_WEBCLIENT_REINIT_SESSION:this._webclientReinitSession=a[0];break;case E.MG_ATTR_DATE:this._dateSeparator=a[0],n.DisplayConvertor.Instance.setDateChar(this._dateSeparator.charCodeAt(0));break;case E.MG_ATTR_TIME:this._timeSeparator=a[0];break;case E.MG_ATTR_OWNER:this._owner=a;break;case E.MG_ATTR_SIGNIFICANT_NUM_SIZE:this._significantNumSize=r.XmlParser.getInt(a);break;case E.MG_ATTR_DEBUG_MODE:this._debugMode=r.XmlParser.getInt(a);break;case E.MG_ATTR_POINT_TRANSLATION:this._canReplaceDecimalSeparator=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_EXITCTRL:this._specialExitCtrl=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOWHIGH:this._lowHigh=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ACCESS_TEST:this._accessTest=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_TEXT_SIZE_FACTORING:this._specialTextSizeFactoring=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_FLAT_EDIT_ON_CLASSIC_THEME:this._specialFlatEditOnClassicTheme=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_ENCODING:" "!==a&&(this._codePage=r.XmlParser.getInt(a),r.UtilStrByteMode.Encoding=this.GetEncoding());break;case E.MG_ATTR_SYSTEM:this._system=r.XmlParser.unescape(a);break;case E.MG_ATTR_COMPONENT:i.CompIdx=r.XmlParser.getInt(a);break;case E.MG_ATTR_DATEMODE:i.DateMode=a[0];break;case E.MG_ATTR_CENTURY:i.Century=r.XmlParser.getInt(a);break;case E.MG_ATTR_IDLETIME:i.IdleTime=r.XmlParser.getInt(a),0===i.IdleTime&&(i.IdleTime=1);break;case E.MG_ATTR_UPD_IN_QUERY:i.UpdateInQueryMode=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_CRE_IN_MODIFY:i.CreateInModifyMode=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_DEFAULT_COLOR:this._defaultColor=r.XmlParser.getInt(a);break;case E.MG_ATTR_DEFAULT_FOCUS_COLOR:this._defaultFocusColor=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT:this._contextInactivityTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CLIENT_CONTEXT_INACTIVITY_TIMEOUT:this._clientContextInactivityTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME:this._contextInactivityWarningTime=r.XmlParser.getInt(a);break;case E.MG_ATTR_TOOLTIP_TIMEOUT:this._toolitipTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT:this._contextUnloadTimeout=r.XmlParser.getInt(a);break;case E.MG_ATTR_IME_AUTO_OFF:this._imeAutoOff=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOCAL_AS400SET:this._localAs400Set=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LOCAL_EXTRA_GENGO:this._localExtraGengo=a,r.UtilDateJpn.getInstance().addExtraGengo(this._localExtraGengo);break;case E.MG_ATTR_LOCAL_FLAGS:this._localFlags=a;break;case E.MG_ATTR_SPEACIAL_ANSI_EXP:this._specialAnsiExpression=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES:this._specialShowStatusBarPanes=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION:this._specialRouteToRootProgOnContextRecreation=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN:this._specialEditLeftAlign=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPEACIAL_SWF_CONTROL_NAME:this._specialSwfControlName=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_LANGUAGE:this._language=a[0];break;case E.MG_ATTR_USERID:this._userId=a;break;case E.MG_TAG_USERNAME:ne.Instance.setUsername(a);break;case E.MG_ATTR_TERMINAL:this._terminal=r.XmlParser.getInt(a);break;case E.MG_ATTR_USERINFO:this._userInfo=a;break;case E.MG_ATTR_GUID:this._guid=a;break;case E.MG_ATTR_CONTROLS_PERSISTENCY_PATH:this._controlsPersistencyPath=a;break;case E.MG_ATTR_PROJDIR:i.ProjDir=a;break;case E.MG_ATTR_DROP_USERFORMATS:this._dropUserFormats=a;break;case E.MG_ATTR_SPECIAL_VAL_NEW_POLICY:this._specialValNewPolicy=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_CANCEL_ON_CREATE:this._specialCancelOnCreate=r.XmlParser.getBoolean(a);break;case E.MG_ATTR_SPECIAL_LEGACY_TRIM_RANGE:case E.MG_ATTR_SPECIAL_LEGACY_EMPTY_RANGE:case E.MG_ATTR_DEFAULT_DISABLED_COLOR:case E.MG_ATTR_SPECIAL_ANSI_BLOB_CHECK_NULL:case E.MG_ATTR_SPECIAL_TABLE_REDUCE_TITLE_HEIGHT:case E.MG_ATTR_SPECIAL_DOTNET_ALLOW_ZERO_DATE:case E.MG_ATTR_SPECIAL_REUSE_TABLE_EDITOR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.fillData(): unknown attribute: "+t)}s=i.CompIdx,this._environments.set_Item(s,i)},e.prototype.fillFromUrl=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=n.getXMLdata(),-1!==(s=n.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,n.getCurrIndex()))&&s<a.length?(i=n.getXMLsubstring(s),n.add2CurrIndex(i.indexOf(e)+e.length),l=r.XmlParser.getTokens(n.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM),t.Debug.Assert(l.get_Item(0)===r.XMLConstants.MG_ATTR_VALUE),""!==(u=l.get_Item(1)).trim()?[3,1]:(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Empty cached file URL: '{0}'",i.trim())),[3,3])):[3,4];case 1:return[4,Te.GetContent(u,!0)];case 2:c=T.sent();try{switch(e){case E.MG_TAG_KBDMAP_URL:break;case E.MG_TAG_ENV_PARAM_URL:for(_=new r.XmlParser(c);o.envParamsTable.mirrorFromXML(_.getNextTag(),_););}}catch(n){switch(e){case E.MG_TAG_KBDMAP_URL:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Keyboard Mapping: '{0}'{1}{2}",u,r.OSEnvironment.EolSeq,n.Message));break;case E.MG_TAG_ENV_PARAM_URL:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Env Params Table: '{0}'{1}{2}",u,r.OSEnvironment.EolSeq,n.Message))}}T.label=3;case 3:-1!==(s=a.indexOf(r.XMLConstants.TAG_OPEN,s))&&n.setCurrIndex(s),T.label=4;case 4:return[2]}}))}))},e.prototype.getEnvDet=function(e){var t=this._environments.get_Item(e);return null===t&&r.Logger.Instance.WriteExceptionToLogWithMsg("in Environment.getEnvDet() there is no env"),t},e.prototype.GetDateMode=function(e){return this.getEnvDet(e).DateMode},e.prototype.GetThousands=function(){return this._thousandsSeparator},e.prototype.GetDecimal=function(){return this._decimalSeparator},e.prototype.setDecimalSeparator=function(e){this._decimalSeparator=e},e.prototype.setThousandsSeparator=function(e){this._thousandsSeparator=e},e.prototype.setDateSeparator=function(e){this._dateSeparator=e},e.prototype.setTimeSeparator=function(e){this._timeSeparator=e},e.prototype.GetDate=function(){return this._dateSeparator},e.prototype.getIdleTime=function(e){return this.getEnvDet(e).IdleTime},e.prototype.getOwner=function(){return this._owner},e.prototype.GetTime=function(){return this._timeSeparator},e.prototype.GetCentury=function(e){return this.getEnvDet(e).Century},e.prototype.allowUpdateInQueryMode=function(e){return this.getEnvDet(e).allowUpdateInQueryMode()},e.prototype.allowCreateInModifyMode=function(e){return this.getEnvDet(e).allowCreateInModifyMode()},e.prototype.GetSignificantNumSize=function(){return this._significantNumSize},e.prototype.setSignificantNumSize=function(e){this._significantNumSize=e},e.prototype.getCodePage=function(){return this._codePage},e.prototype.GetEncoding=function(){var e;try{e=t.Encoding.GetEncoding(this._codePage)}catch(t){e=null}return e},e.prototype.getSystem=function(){return this._system},e.prototype.GetDebugLevel=function(){return this._debugMode},e.prototype.CanReplaceDecimalSeparator=function(){return!this.IgnoreReplaceDecimalSeparator&&this._canReplaceDecimalSeparator},e.prototype.getClientContextInactivityTimeout=function(){return this._clientContextInactivityTimeout},e.prototype.getContextInactivityTimeout=function(){return this._contextInactivityTimeout},e.prototype.getContextInactivityWarningTime=function(){return this._contextInactivityWarningTime},e.prototype.getContextUnloadTimeout=function(){return this._contextUnloadTimeout},e.prototype.GetTooltipTimeout=function(){return this._toolitipTimeout},e.prototype.GetSpecialEditLeftAlign=function(){return this._specialEditLeftAlign},e.prototype.getLowHigh=function(){return this._lowHigh},e.prototype.GetDefaultColor=function(){return this._defaultColor},e.prototype.GetDefaultFocusColor=function(){return this._defaultFocusColor},e.prototype.getSpecialExitCtrl=function(){return this._specialExitCtrl},e.prototype.GetImeAutoOff=function(){return this._imeAutoOff},e.prototype.GetLocalAs400Set=function(){return this._localAs400Set},e.prototype.getLocalExtraGengo=function(){return this._localExtraGengo},e.prototype.GetLocalFlag=function(e){return null!==this._localFlags&&this._localFlags.indexOf(e)>=0},e.prototype.getSpecialAnsiExpression=function(){return this._specialAnsiExpression},e.prototype.getSpecialShowStatusBarPanes=function(){return this._specialShowStatusBarPanes},e.prototype.getTerminal=function(){return this._terminal},e.prototype.getWebClientReinitSession=function(){return this._webclientReinitSession},e.prototype.setWebClientReinitSession=function(e){this._webclientReinitSession=e},e.prototype.getSpecialRouteToRootProgOnContextRecreation=function(){return this._specialRouteToRootProgOnContextRecreation},e.prototype.getUserID=function(){return this._userId},e.prototype.getUserInfo=function(){return this._userInfo},e.prototype.GetGUID=function(){return this._guid},e.prototype.GetControlsPersistencyPath=function(){return this._controlsPersistencyPath},e.prototype.getProjDir=function(e){return this.getEnvDet(e).ProjDir},e.prototype.GetSpecialEngLogon=function(){return!1},e.prototype.GetSpecialIgnoreButtonFormat=function(){return!1},e.prototype.GetSpecialSwfControlNameProperty=function(){return this._specialSwfControlName},e.prototype.GetSpecialLogInternalExceptions=function(){return!0},e.prototype.setOwner=function(e){this._owner=e},e.prototype.setDateMode=function(e,t){this.getEnvDet(e).DateMode=t},e.prototype.setCentury=function(e,t){this.getEnvDet(e).Century=t},e.prototype.setIdleTime=function(e,t){this.getEnvDet(e).IdleTime=t},e.prototype.setAllowUpdateInQueryMode=function(e,t){this.getEnvDet(e).UpdateInQueryMode=t},e.prototype.setAllowCreateInModifyMode=function(e,t){this.getEnvDet(e).CreateInModifyMode=t},e.prototype.setContextInactivityTimeout=function(e){this._contextInactivityTimeout=e},e.prototype.setClientContextInactivityTimeout=function(e){this._clientContextInactivityTimeout=e},e.prototype.setContextInactivityWarningTime=function(e){this._contextInactivityWarningTime=e},e.prototype.setContextUnloadTimeout=function(e){this._contextUnloadTimeout=e},e.prototype.setTerminal=function(e){this._terminal=e},e.prototype.GetDropUserFormats=function(){return this._dropUserFormats},e.prototype.GetSpecialTextSizeFactoring=function(){return this._specialTextSizeFactoring},e.prototype.GetSpecialFlatEditOnClassicTheme=function(){return this._specialFlatEditOnClassicTheme},e.prototype.GetSpecialDisableMouseWheel=function(){throw new t.NotImplementedException},e.prototype.GetSpecialValNewPolicy=function(){return this._specialValNewPolicy},e.prototype.GetSpecialCancelOnCreate=function(){return this._specialCancelOnCreate},e}();et.Instance=new et;var tt=function(){function e(){this._createInModifyMode=!1,this._updateInQueryMode=!1,this.CompIdx=0,this.DateMode="\0",this.Century=0,this.IdleTime=0,this.ProjDir=null,this.CompIdx=0}return Object.defineProperty(e.prototype,"UpdateInQueryMode",{set:function(e){this._updateInQueryMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreateInModifyMode",{set:function(e){this._createInModifyMode=e},enumerable:!1,configurable:!0}),e.prototype.allowUpdateInQueryMode=function(){return this._updateInQueryMode},e.prototype.allowCreateInModifyMode=function(){return this._createInModifyMode},e}(),rt=function(a){function s(e){var t=this;if(0!==arguments.length)return(t=a.call(this)||this).constructor_3(e),t;(t=a.call(this)||this).constructor_2()}return u(s,a),s.prototype.constructor_2=function(){},s.prototype.constructor_3=function(e){a.prototype.Copy.call(this,e)},s.prototype.mirrorToXML=function(){var e,t=et.Instance.GetDebugLevel()<=1,s=this.Attr===r.StorageAttribute.BLOB_VECTOR?this.VectorField.getCellsType():r.StorageAttribute.SKIP;return e=n.RecordUtils.itemValToXML(a.prototype.ToMgVal.call(this),this.Attr,s,t),E.MG_ATTR_PAR_ATTRS+'="'+this.Attr+'" '+E.MG_ATTR_LEN+"="+e.length+" "+E.MG_ATTR_ENV_VALUE+'="'+e+'"'},s.prototype.init=function(s,i){var o,l,u,c,_,T,h,p,g,d,I=null;if(T=i.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,i.getCurrIndex())-i.getCurrIndex(),-1!==(l=t.NString.IndexOf(i.getXMLdata(),E.MG_ATTR_PAR_ATTRS,i.getCurrIndex(),T)))l+=E.MG_ATTR_PAR_ATTRS.length+2,g=i.getXMLdata().substr(l,1),u=i.getXMLdata().indexOf(E.MG_ATTR_LEN,l),u+=E.MG_ATTR_LEN.length+1,_=i.getXMLdata().indexOf(" ",u),c=r.XmlParser.getInt(i.getXMLdata().substr(u,_-u)),o=i.getXMLdata().indexOf(E.MG_ATTR_ENV_VALUE,u),o+=E.MG_ATTR_ENV_VALUE.length+2,d=i.getXMLdata().substr(o,c),h=g[0],I=n.RecordUtils.getString(d,h),p=!1,i.setCurrIndex(o+c);else{if(-1!==i.getXMLdata().indexOf(E.MG_ATTR_ENV_REMOVED,i.getCurrIndex()))return e.ParamParseResult.DELETE;h=r.StorageAttribute.NONE,p=!0}return a.prototype.Init.call(this,h,p,I),e.ParamParseResult.TOUPPER},s}(n.ExpVal),nt=function(e){function t(){var t=e.call(this,rt)||this;return t.mirroredID=E.MG_TAG_GLOBALPARAMSCHANGES,t}return u(t,e),t.prototype.set=function(t,r){r.IsNull||r.isEmptyString()?e.prototype.remove.call(this,t.trim().toUpperCase()):e.prototype.setValue.call(this,t.trim().toUpperCase(),new rt(r))},t.prototype.get=function(t){try{return e.prototype.getvalue.call(this,t.trim().toUpperCase())}catch(e){return null}},t}($e);nt.Instance=new nt;var at=function(){function e(){this.UserName=null,this.UserID=null,this.UserInfo=null,this.Password=null,this.IsLoggedIn=!1,this.UserName=t.NString.Empty,this.UserInfo=t.NString.Empty,this.IsLoggedIn=!1,this.setUserID(t.NString.Empty)}return e.prototype.setIsLoggedIn=function(e){this.IsLoggedIn=e},e.prototype.getIsLoggedIn=function(){return this.IsLoggedIn},e.prototype.setUserID=function(e){this.UserID=e,0==this.UserID.length||this.UserID===t.NString.Empty?this.setIsLoggedIn(!1):this.setIsLoggedIn(!0)},Object.defineProperty(e,"Instance",{get:function(){return null===e._instance&&(e._instance=new e),e._instance},enumerable:!1,configurable:!0}),e.prototype.fillData=function(e){var t,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_USER_DETAILS)+E.MG_TAG_USER_DETAILS.length),t=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),this.initElements(t),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in UserDetails.fillData(): out of bounds")},e.prototype.initElements=function(e){var t,a,s,i=!0;for(s=0;s<e.length;s+=2)if(t=e.get_Item(s),a=e.get_Item(s+1),t===E.MG_TAG_IS_LOGGED_IN)this.setIsLoggedIn("1"===a[0]),n.Commands.addIsLoggedIn(this.getIsLoggedIn());else r.Logger.Instance.WriteExceptionToLogWithMsg("in UserDetails.initElements(): unknown attribute: "+t),i=!1;return i},e}();at._instance=null;var st=function(){function e(e){this._exp=null,this._val=!1,this._val=e,this._exp=null}return e.prototype.setVal=function(e,t){switch(t[0]){case"Y":this._val=!0;break;case"N":this._val=!1;break;default:var n=r.XmlParser.getInt(t);null!=e&&(this._exp=e.getExpById(n))}},e.prototype.getVal=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(a){switch(a.label){case 0:return null===this._exp?[3,3]:(t=(e=n.DisplayConvertor).toBoolean,[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)]);case 1:return[4,t.apply(e,[a.sent()])];case 2:return[2,a.sent()];case 3:return[2,this._val]}}))}))},e.prototype.isServerExp=function(){return null!=this._exp&&this._exp.computedByServerOnly()},e.prototype.isClientExp=function(){return null!=this._exp&&this._exp.computedByClientOnly()},e}(),it=function(){function e(){this._condExp=new st(!0),this._retainFocus=new st(!1),this._waitExp=new st(!1),this._syncData=new st(!1),this._argList=null,this._blockClose=0,this._blockEnd=0,this._buttons="\0",this._checkByServer=!1,this._cmdToServer=null,this._display="S",this._errLogAppend=!1,this._evtHandler=null,this._execOnServer=!1,this._execOnClient=!1,this._exp=null,this._field=null,this._globalParamsShouldBeCopied=!1,this._image="\0",this._incremental=!1,this._methodNameSnippet=null,this._mode="\0",this._prgDescription=null,this._publicName=null,this._returnVal=null,this._rtEvt=null,this._serverId=-1,this.calledTaskDefinitionId=null,this._show=r.CallOsShow.Normal,this._subformCtrlName=null,this._subtype="\0",this._task=null,this._text=null,this._title=null,this._titleExp=null,this._type=0,this._undo=!0,this._isRoute=!1,this._routerPath=null,this._originalRouterOutletName=null,this._routeParams=null,this.OperCallMode=0}return Object.defineProperty(e.prototype,"CalledTaskDefinitionId",{get:function(){return this.calledTaskDefinitionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Task",{get:function(){return this._task},set:function(e){this._task=e},enumerable:!1,configurable:!0}),e.prototype.Immediate=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._waitExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.fillData=function(e,t,r){for(this._task=e,this._evtHandler=t;this.initInnerObjects(r,r.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EVENT)this._rtEvt=new w(n),this._rtEvt.fillData(e,n);else if(t===E.MG_TAG_OPER)this.fillAttributes(e,n);else{if(t==="/"+E.MG_TAG_OPER)return e.setCurrIndex2EndOfTag(),!1;if(t!==r.XMLConstants.MG_TAG_TASKDEFINITIONID_ENTRY)return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Operation. Insert else if to Operation.initInnerObjects for "+t),!1;this.InitTaskDefinitionID(e)}return!0},e.prototype.fillAttributes=function(e,t){var n,a=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==a&&a<e.getXMLdata().length){var s=e.getXMLsubstring(a);return e.add2CurrIndex(s.indexOf(E.MG_TAG_OPER)+E.MG_TAG_OPER.length),n=r.XmlParser.getTokens(e.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),this.initElements(n,t),void e.setCurrIndex(a+r.XMLConstants.TAG_CLOSE.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of string bounds")},e.prototype.initElements=function(n,a){for(var s,i,o,l=0;l<n.length;l+=2)switch(s=n.get_Item(l),i=n.get_Item(l+1),s){case r.XMLConstants.MG_ATTR_TYPE:this._type=r.XmlParser.getInt(i);break;case E.MG_ATTR_FLD:this._field=e.InitField(i,this._task);break;case r.XMLConstants.MG_ATTR_EXP:o=r.XmlParser.getInt(i),this._exp=a.getExpById(o);break;case E.MG_ATTR_TEXT:this._text=r.XmlParser.unescape(i);break;case E.MG_ATTR_MODE:this._mode=i[0];break;case E.MG_ATTR_SUBTYPE:this._subtype=i[0],this._type===E.MG_OPER_BLOCK&&("E"===this._subtype?this._type=E.MG_OPER_ELSE:"L"===this._subtype&&(this._type=E.MG_OPER_LOOP));break;case E.MG_ATTR_CLOSE:this._blockClose=r.XmlParser.getInt(i);break;case E.MG_ATTR_END:this._blockEnd=r.XmlParser.getInt(i);break;case E.MG_ATTR_HOW:this._incremental="I"===i;break;case E.MG_ATTR_UNDO:"N"===i[0]?this._undo=!1:"Y"===i[0]?this._undo=!0:r.Logger.Instance.WriteExceptionToLogWithMsg("in Operation.initElements(): No such value to the MG_ATTR_UNDO for "+i);break;case E.MG_ATTR_DISPLAY:this._display=i[0];break;case E.MG_ATTR_WAIT:this._waitExp.setVal(a,i);break;case E.MG_ATTR_RETAIN_FOCUS:this._retainFocus.setVal(a,i);break;case E.MG_ATTR_SYNC_DATA:this._syncData.setVal(a,i);break;case E.MG_ATTR_SHOW:this._show=r.XmlParser.getInt(i);break;case E.MG_ATTR_CND:this._condExp.setVal(a,i);break;case E.MG_ATTR_ARGLIST:this._argList=new L,this._argList.fillList(i,this._task);break;case E.MG_ATTR_REFRESHON:this._argList.RefreshOnString=i.Trim();break;case E.MG_ATTR_SERVER_ID:this._serverId=r.XmlParser.getInt(i);break;case E.MG_ATTR_OPER_CALLMODE:this.OperCallMode=i[0];break;case E.MG_ATTR_SUBFORM_CTRL:this._subformCtrlName=r.XmlParser.unescape(i);break;case E.MG_ATTR_CHECK_BY_SERVER:this._checkByServer=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_PUBLIC:this._publicName=i;break;case E.MG_ATTR_PRG_DESCRIPTION:this._prgDescription=i;break;case E.MG_ATTR_CPY_GLB_PRMS:this._globalParamsShouldBeCopied=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_EXEC_ON_SERVER:this._execOnServer=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_EXEC_ON_CLIENT:this._execOnClient=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_TITLE:this._title=r.XmlParser.unescape(i);break;case E.MG_ATTR_TITLE_EXP:o=r.XmlParser.getInt(i),this._titleExp=a.getExpById(o);break;case E.MG_ATTR_IMAGE:this._image=i[0];break;case E.MG_ATTR_BUTTONS:this._buttons=i[0];break;case E.MG_ATTR_RETURN_VAL:this._returnVal=e.InitField(i,this._task);break;case E.MG_ATTR_ERR_LOG_APPEND:this._errLogAppend=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_OPER_METHODNAME:this._methodNameSnippet=i;break;case E.MG_ATTR_IS_GUI_THREAD_EXECUTION:r.XmlParser.getBoolean(i);break;case E.MG_ATTR_IS_ROUTE:this._isRoute=r.XmlParser.getBoolean(i);break;case r.XMLConstants.MG_ATTR_ROUTER_PATH:this._routerPath=r.XmlParser.unescape(i);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Operation class. Insert case to Operation.initElements for "+s)}if(this._serverId>-1&&(this._cmdToServer=Qe.CreateExecOperCommand(this._task.getTaskTag(),""+this._evtHandler.getId(),this._serverId,t.Int32.MinValue,null)),this._isRoute&&(this._originalRouterOutletName=null!==this._subformCtrlName?this._subformCtrlName:"",null==this._subformCtrlName)){var u=this._task.getForm().DefaultRouterOutlet;this._subformCtrlName=null!==u?u.Name:""}},e.prototype.InitTaskDefinitionID=function(e){var t=e.ReadToEndOfCurrentElement();new n.TaskDefinitionIdTableSaxHandler(this.SetTaskDefinitionId).parse(t)},e.prototype.SetTaskDefinitionId=function(e){this.calledTaskDefinitionId=e},e.InitField=function(e,n){var a=r.XmlParser.getTokens(e,",");if(2===a.length){var s=t.NNumber.Parse(a.get_Item(0)),i=t.NNumber.Parse(a.get_Item(1));return n.getFieldDef(s,i)}return r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unknown field: '{0}'",e)),null},e.prototype.execute=function(e){return T(this,void 0,void 0,(function(){var n,a,s,i,l,u,c,_,T,p,g,d,I,f;return h(this,(function(h){switch(h.label){case 0:return n=o.eventsManager.getLastRtEvent(),a=null,s=U.Instance,null!==n&&(a=n.getMainPrgCreator()),!e&&(e||this._type===E.MG_OPER_SERVER&&this._condExp.isServerExp())?[3,4]:[4,this.canExecute()];case 1:return h.sent()?[3,4]:this._type===E.MG_OPER_LOOP?[3,3]:[4,s.addFlowFieldOperation(this,!1,this._task.GetTaskDetails())];case 2:h.sent(),h.label=3;case 3:return[2,!1];case 4:return this._type===E.MG_OPER_LOOP||this._type===E.MG_OPER_ENDBLOCK?[3,6]:[4,s.addFlowFieldOperation(this,!0,this._task.GetTaskDetails())];case 5:h.sent(),h.label=6;case 6:switch(h.trys.push([6,42,,43]),this._type){case E.MG_OPER_VERIFY:return[3,7];case E.MG_OPER_BLOCK:return[3,9];case E.MG_OPER_LOOP:return[3,10];case E.MG_OPER_ELSE:return[3,13];case E.MG_OPER_EVALUATE:return[3,14];case E.MG_OPER_UPDATE:return[3,16];case E.MG_OPER_RAISE_EVENT:return[3,18];case E.MG_OPER_SERVER:return[3,20];case E.MG_OPER_CALL:return[3,22]}return[3,40];case 7:return[4,this.operVerify()];case 8:return[2,h.sent()];case 9:return[2,this.operBlock()];case 10:return this.getExecOnServer()?[3,11]:[2,this.operBlock()];case 11:return[4,this.operServer(a)];case 12:return h.sent(),[3,41];case 13:return[2,this.operElse()];case 14:return[4,this.operEvaluate()];case 15:return h.sent(),[3,41];case 16:return[4,this.operUpdate(a)];case 17:return h.sent(),[3,41];case 18:return[4,this.operRaiseEvent(a,e)];case 19:return h.sent(),[3,41];case 20:return[4,this.operServer(a)];case 21:return h.sent(),[3,41];case 22:return null==this._publicName?[3,23]:(this.operCallParallel(),[3,39]);case 23:return null!=this._subformCtrlName?[3,25]:[4,this.operCall(a)];case 24:return h.sent(),[3,39];case 25:return i=void 0,l=!0,this._checkByServer?(this._cmdToServer instanceof q||t.Debug.Assert(!1),(u=this._cmdToServer).CheckOnly=!0,[4,this.operCall(a)]):[3,27];case 26:h.sent(),u.CheckOnly=!1,o.eventsManager.getNextOperIdx(this,!0)>-1&&(l=!1),h.label=27;case 27:return l?(c=this._task.getForm().getSubFormCtrlByName(this._subformCtrlName),!this._isRoute||null!==c&&c.IsRouterOutlet()?null==c?[3,37]:this._isRoute?(_=!1,null===(d=o.eventsManager.getLastRtEvent())?[3,32]:(this._routeParams=d.getRouteParamList(),[4,d.getArgList().getArg(0).getValue(r.StorageAttribute.ALPHA,0)])):[3,32]:[2,!1]):[3,39];case 28:return(T=h.sent().trim()===this._routerPath)?(p=d.getArgList().getArg(1).skipArg())?[3,30]:[4,d.getArgList().getArg(1).getValue(r.StorageAttribute.ALPHA,0)]:[3,31];case 29:p=h.sent().trim()===this._originalRouterOutletName,h.label=30;case 30:T=p,h.label=31;case 31:if(T&&(_=!0),!_)return[2,!1];h.label=32;case 32:return null==(i=c.getSubformTask())?[3,34]:(g=!0,d=o.eventsManager.getLastRtEvent(),this._isRoute&&null!==d&&d.isGuiTriggeredEvent()&&(g=!1,o.eventsManager.setStopExecution(!0)),[4,i.endTask(!0,!1,!g,!0)]);case 33:if(!h.sent())return[3,41];(I=c.getForm().getTask()).TaskService.RemoveRecomputes(I,i),h.label=34;case 34:return null!=G.getLastFocusedControl()&&G.getLastFocusedControl().isDescendentOfControl(c)?(this._task.RetainFocus=!1,[3,37]):[3,35];case 35:return f=this._task,[4,this._retainFocus.getVal()];case 36:f.RetainFocus=h.sent(),h.label=37;case 37:return[4,this.operCall(a)];case 38:h.sent(),h.label=39;case 39:return[2,this._isRoute];case 40:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such type of operation "+this._type),[3,41];case 41:return[3,43];case 42:throw h.sent();case 43:return[2,!0]}}))}))},e.prototype.operCallParallel=function(){e.callParallel(this._task,this._publicName,this._argList,this._globalParamsShouldBeCopied,this._prgDescription)},e.callParallel=function(e,t,r,n,a){},e.prototype.getCondVal=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._condExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.getType=function(){return this._type},e.prototype.getRouteParams=function(){return this._routeParams},e.prototype.getServerId=function(){return this._serverId},e.prototype.operVerify=function(){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return a=this._mode===E.FLW_VERIFY_MODE_ERROR,null!==this._exp?[3,1]:(i=this._text,[3,3]);case 1:return[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.UNICODE,255)];case 2:i=h.sent(),h.label=3;case 3:return s=i,null!==this._titleExp?[3,4]:(l=this._title,[3,6]);case 4:return[4,this._titleExp.evaluateWithResultTypeAndLength(r.StorageAttribute.UNICODE,255)];case 5:l=h.sent(),h.label=6;case 6:return o=l,s=null===s?"":r.StrUtil.rtrim(s),o=null===o?"":r.StrUtil.rtrim(o),this._errLogAppend&&(u=this._task.GetContextTask().GetComputedProperty(n.PropInterface.PROP_TYPE_NAME).GetComputedValue(),r.Logger.Instance.WriteExceptionToLogWithMsg(s+", program : "+u)),this._display!==E.DISPLAY_STATUS?[3,7]:(t.NString.IsNullOrEmpty(s)||(U.Instance.addFlowVerifyInfo(s,this._task.GetTaskDetails()),this._task.GetContextTask().WriteToMessagePane(s,!1)),[3,12]);case 7:return t.NString.IsNullOrEmpty(s)?[3,12]:(c=pe.Instance.translate(s),_=pe.Instance.translate(o),T=(T=e.getButtons(this._buttons))||e.getImage(this._image),r.UtilStrByteMode.isLocaleDefLangJPN()&&0<=(p=c.indexOf("|"))&&p<c.length&&(_=c.substr(p+1),c=c.substr(0,p)),g=null,this._task.GetContextTask().getMGData().IsAborting||(g=this._task.GetContextTask().getTopMostForm()),null==g&&null!=G.Instance.getLastFocusedTask()&&(g=G.Instance.getLastFocusedTask().getTopMostForm()),null==g?[3,9]:(g.RefreshUI(),n.Commands.invoke(),[4,t.Thread.Sleep(10)]));case 8:h.sent(),h.label=9;case 9:return[4,ge.Instance.MessageBox(_,c,T)];case 10:return d=h.sent(),[4,e.setoperVerifyReturnValue(d,this._returnVal)];case 11:h.sent(),h.label=12;case 12:return[2,a]}}))}))},e.getButtons=function(e){var t=0;switch(e){case E.BUTTONS_OK:t=n.Styles.MSGBOX_BUTTON_OK;break;case E.BUTTONS_OK_CANCEL:t=n.Styles.MSGBOX_BUTTON_OK_CANCEL;break;case E.BUTTONS_ABORT_RETRY_IGNORE:t=n.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE;break;case E.BUTTONS_YES_NO_CANCEL:t=n.Styles.MSGBOX_BUTTON_YES_NO_CANCEL;break;case E.BUTTONS_YES_NO:t=n.Styles.MSGBOX_BUTTON_YES_NO;break;case E.BUTTONS_RETRY_CANCEL:t=n.Styles.MSGBOX_BUTTON_RETRY_CANCEL}return t},e.getImage=function(e){var t=0;switch(e){case E.IMAGE_EXCLAMATION:t=n.Styles.MSGBOX_ICON_EXCLAMATION;break;case E.IMAGE_CRITICAL:t=n.Styles.MSGBOX_ICON_ERROR;break;case E.IMAGE_QUESTION:t=n.Styles.MSGBOX_ICON_QUESTION;break;case E.IMAGE_INFORMATION:t=n.Styles.MSGBOX_ICON_INFORMATION}return t},e.setoperVerifyReturnValue=function(e,t){return T(this,void 0,void 0,(function(){var r,a;return h(this,(function(s){switch(s.label){case 0:return null===t?[3,3]:((r=new n.NUM_TYPE).NUM_4_LONG(e),a=r.toXMLrecord(),[4,t.setValueAndStartRecompute(a,!1,!0,!0,!1)]);case 1:return s.sent(),[4,t.updateDisplay()];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},e.prototype.operBlock=function(){return!0},e.prototype.operElse=function(){return!0},e.prototype.operEvaluate=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e="\0",null===this._field?[3,4]:[4,this._exp.evaluateWithResultTypeAndLength(this._field.getType(),this._field.getSize())];case 1:return e=t.sent(),[4,this._field.setValueAndStartRecompute(e,null===e,!0,!0,!1)];case 2:return t.sent(),[4,this._field.updateDisplay()];case 3:return t.sent(),[3,6];case 4:return[4,this._exp.evaluateWithResultTypeAndLength(r.StorageAttribute.BOOLEAN,0)];case 5:e=t.sent(),t.label=6;case 6:return[2]}}))}))},e.prototype.operUpdate=function(t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return(p=U.Instance).addFlowOperationUpdate(V.FLWMTR_START,this._task.GetTaskDetails()),this._field.DbModifiable||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,2]:[4,this.CanModify(t)];case 1:if(!h.sent())return[2];h.label=2;case 2:return g=this._field.getType(),this._incremental?this._field.IsLinkField?[3,9]:(o=this._field.getValue(!0),T=null!=o?new n.NUM_TYPE(o):null,this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,6]:(this._task.setEvalOldValues(!0),this._field.isNull()?(d=this._field.getMagicDefaultValue(),[3,5]):[3,3])):[3,12];case 3:return[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 4:d=h.sent(),h.label=5;case 5:s=d,this._task.setEvalOldValues(!1),c=new n.NUM_TYPE(s),T=n.NUM_TYPE.sub(T,c),h.label=6;case 6:return this._task.getMode()===r.Constants.TASK_MODE_DELETE?[3,8]:[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 7:null!=(i=h.sent())?(_=new n.NUM_TYPE(i),T=n.NUM_TYPE.add(T,_)):_=T=null,h.label=8;case 8:return a=null!=T?T.toXMLrecord():this._field.getMagicDefaultValue(),[3,11];case 9:return[4,this.operServer(t)];case 10:return h.sent(),[2];case 11:return[3,14];case 12:return[4,this._exp.evaluateWithResultTypeAndLength(g,this._field.getSize())];case 13:a=h.sent(),h.label=14;case 14:return g===r.StorageAttribute.BLOB_VECTOR&&null!=a&&(a=e.operUpdateVectors(this._field,a)),u=this._field.getTask()===this._task,l=!u||!this._undo,[4,this._field.setValueAndStartRecompute(a,null==a,!0,l,!1)];case 15:return h.sent(),this._undo||this._field.setUpdated(),this._field.setModified(),[4,this._field.updateDisplay()];case 16:return h.sent(),p.addFlowOperationUpdate(V.FLWMTR_END,this._task.GetTaskDetails()),[2]}}))}))},e.prototype.CanModify=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return(t=this._cmdToServer instanceof q?this._cmdToServer:null).Operation=this,t.MprgCreator=e,[4,this.Task.DataviewManager.Execute(this._cmdToServer)];case 1:return[2,r.sent().Success]}}))}))},e.operUpdateVectors=function(e,a){if(e.getType()===r.StorageAttribute.BLOB_VECTOR){var s=n.VectorType.getCellsAttr(a),i=e.getCellsType();if(r.StorageAttributeCheck.isTheSameType(s,i)){var o=new n.VectorType(a);return o.adjustToFit(e),o.toString()}return null}throw new t.ApplicationException("in operUpdateVectors "+e.getName()+" is not of type vector")},e.prototype.operRaiseEvent=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.Immediate()];case 1:return r=s.sent(),[4,(n=this._rtEvt.replicate()).setPublicName()];case 2:return s.sent(),n.setImmediate(r),n.setMainPrgCreator(null),r?(n.setCtrl(this._task.getLastParkedCtrl()),n.setArgList(this._argList),n.getTask().isMainProg()&&n.setMainPrgCreator(e),o.eventsManager.checkAndSaveRouteEventIfCtxRemovedFromSrvr(n),o.eventsManager.pushExecStack(this._task.getTaskTag(),this._evtHandler.getId().toString(),this._serverId),[4,o.eventsManager.handleEvent(n,t)]):[3,4];case 3:return s.sent(),o.eventsManager.popExecStack(),[3,6];case 4:return[4,(a=new L).Initialize(this._argList)];case 5:s.sent(),n.setArgList(a),n.setTask(null),o.eventsManager.addToTail(n),o.eventsManager.checkAndSaveRouteEventIfCtxRemovedFromSrvr(n),s.label=6;case 6:return[2]}}))}))},e.prototype.operCall=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.operServer(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.operServer=function(e){return T(this,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return r=this._cmdToServer instanceof q?this._cmdToServer:null,t.Debug.Assert(null!==r),this._task.isMainProg()?r.MprgCreator=e:r.MprgCreator=null,r.SetExecutionStack(o.eventsManager.getExecStack()),r.Operation=this,[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._task.getMGData().CmdsToServer,this._cmdToServer,null)];case 1:return n.sent(),[2]}}))}))},e.prototype.getBlockEnd=function(){return this._blockEnd},e.prototype.setBlockEnd=function(e){this._blockEnd=e},e.prototype.getBlockClose=function(){return this._blockClose},e.prototype.setBlockClose=function(e){this._blockClose=e},e.prototype.getTaskTag=function(){return this._task.getTaskTag()},e.prototype.getHandlerId=function(){return this._evtHandler.getId().toString()},e.prototype.getEventHandler=function(){return this._evtHandler},e.prototype.getExecOnServer=function(){return this._execOnServer},e.prototype.setExecOnServer=function(e){this._execOnServer=e},e.prototype.getExecOnClient=function(){return this._execOnClient},e.prototype.canExecute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getCondVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.AddFlowDescription=function(e){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:switch(this._type){case E.MG_OPER_VERIFY:return[3,1];case E.MG_OPER_BLOCK:return[3,2];case E.MG_OPER_LOOP:return[3,3];case E.MG_OPER_ELSE:return[3,4];case E.MG_OPER_EVALUATE:return[3,5];case E.MG_OPER_UPDATE:return[3,6];case E.MG_OPER_ENDBLOCK:return[3,7];case E.MG_OPER_USR_EXIT:return[3,8];case E.MG_OPER_RAISE_EVENT:return[3,9];case E.MG_OPER_SERVER:return[3,11];case E.MG_OPER_CALL:return[3,12]}return[3,13];case 1:return e.Append("Verify: "),null==this._exp?e.Append(this._text):e.Append("Exp #").Append(this._exp.getId()),[3,14];case 2:return e.Append("Block If"),[3,14];case 3:return e.Append("Block Loop"),[3,14];case 4:return e.Append("Block Else"),[3,14];case 5:return e.Append("Evaluate Exp #").Append(this._exp.getId()),[3,14];case 6:return e.AppendFormat("Update {0} with Exp #{1}",this._field.getVarName(),this._exp.getId()),[3,14];case 7:return e.Append("End Block"),[3,14];case 8:return e.Append("Invoke OS"),[3,14];case 9:return e.Append("Raise Event:"),this._rtEvt.AppendDescription(e),r=(t=e).AppendFormat,n=[" (Wait={0})"],[4,this.Immediate()];case 10:return r.apply(t,n.concat([a.sent()?"Y":"N"])),[3,14];case 11:return e.Append("Run server-side operation"),[3,14];case 12:return e.Append("Call program"),[3,14];case 13:return e.AppendFormat("<<Unknown Operation Code {0}>>",this._type),[3,14];case 14:return[2]}}))}))},e.prototype.GetArgList=function(){return this._argList},e.prototype.GetReturnValueField=function(){return this._field},e.prototype.GetSubformControlName=function(){return this._subformCtrlName},e.prototype.toString=function(){return t.NString.Format("Executing operation number {0}",this._serverId+1)},e}(),ot=function(){function n(e){this._reserved=!1,this._value=null,0!==arguments.length?this.constructor_1(e):this.constructor_0()}return n.prototype.constructor_0=function(){this._reserved=!1},n.prototype.constructor_1=function(e){this._value=e,this._reserved=!1},n.prototype.mirrorToXML=function(){return E.MG_ATTR_ENV_VALUE+'="'+r.XmlParser.escape(this._value)+'" '+E.MG_ATTR_ENV_WRITEINI+"=F"},n.prototype.init=function(r,n){var a,s,i,o,l=n.getXMLdata(),u=E.MG_ATTR_ENV_VALUE+'="';return o=l.indexOf("/>",n.getCurrIndex()),-1!==(a=t.NString.IndexOf(l,u,n.getCurrIndex(),o-n.getCurrIndex()))?(a+=u.length,s=-1!==(i=t.NString.IndexOf(l,E.MG_ATTR_ENV_RESERVED+'="',n.getCurrIndex(),o-n.getCurrIndex()))?l.indexOf(E.MG_ATTR_ENV_RESERVED+'="',a)-2:o-1,this._value=l.substr(a,s-a).trim(),-1!==i?(i+=E.MG_ATTR_ENV_RESERVED.length+2,this._reserved="Y"===l[i]):this._reserved=!1,n.setCurrIndex(s),r.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)?e.ParamParseResult.OK:e.ParamParseResult.TOUPPER):-1!==t.NString.IndexOf(l,E.MG_ATTR_ENV_REMOVED,n.getCurrIndex(),o-n.getCurrIndex())?e.ParamParseResult.DELETE:(t.Debug.Assert(!1,"bad XML parsing"),e.ParamParseResult.FAILED)},n.prototype.ToString=function(){return this._value},n.prototype.isReserved=function(){return this._reserved},n}(),lt=function(r){function a(){var e=r.call(this,ot)||this;return e.mirroredID=E.MG_TAG_ENV_PARAM,e}return u(a,r),a.prototype.get=function(e){var n=null,a=null;if("["!==e.charAt(0)?(n=e,e=t.NString.Insert(e,0,E.INI_SECTION_MAGIC_ENV_BRACKETS)):e.startsWith(E.INI_SECTION_MAGIC_ENV_BRACKETS)&&(n=e.substr(E.INI_SECTION_MAGIC_ENV_BRACKETS.length)),e.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)||(e=e.toUpperCase()),null!==n&&(a=this.getFromEnvironment(n)),null!==a)return a;try{var s=r.prototype.getvalue.call(this,e);null!==s&&(a=s.ToString(),null!==n&&(a=this.getProcessedValue(n,a)))}catch(e){}return a},a.prototype.getln=function(e,t){e=e.toUpperCase().trim();for(var r=!1,n=this.values.Keys,a=0;a<n.length;a++){var s=n[a];if(s.startsWith(e)){if(r=!0,!(t>1))return s.substr(e.length)+"="+this.values.get_Item(s);t--}else if(r)break}return null},a.prototype.getFromEnvironment=function(e){switch(e.toLowerCase()){case E.MG_ATTR_DECIMAL_SEPARATOR:return et.Instance.GetDecimal();case E.MG_ATTR_DATE:return n.DisplayConvertor.Instance.getDateChar().toString();case E.MG_ATTR_TIME:return et.Instance.GetTime();case E.MG_ATTR_OWNER:return et.Instance.getOwner();case E.MG_ATTR_DATEMODE:return et.Instance.GetDateMode(G.Instance.getCurrTask().getCompIdx());case E.MG_ATTR_CENTURY:return et.Instance.GetCentury(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_IDLETIME:return et.Instance.getIdleTime(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_UPD_IN_QUERY:return et.Instance.allowUpdateInQueryMode(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_CRE_IN_MODIFY:return et.Instance.allowCreateInModifyMode(G.Instance.getCurrTask().getCompIdx()).toString();case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT:return et.Instance.getContextInactivityTimeout().toString();case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT:return et.Instance.getContextUnloadTimeout().toString();case E.MG_ATTR_TERMINAL:return et.Instance.getTerminal().toString();case E.MG_ATTR_WEBCLIENT_REINIT_SESSION:return et.Instance.getWebClientReinitSession()}return null},a.prototype.getProcessedValue=function(e,r){switch(e.toLowerCase()){case E.MG_ATTR_HTTP_TIMEOUT:case E.MG_ATTR_RTF_BUFFER_SIZE:case E.MG_ATTR_RANGE_POP_TIME:case E.MG_ATTR_TEMP_POP_TIME:case E.MG_ATTR_BATCH_PAINT_TIME:return t.NNumber.Parse(r).toString();case E.MG_ATTR_USE_SIGNED_BROWSER_CLIENT:case E.MG_ATTR_CLOSE_PRINTED_TABLES_IN_SUBTASKS:case E.MG_ATTR_GENERIC_TEXT_PRINTING:case E.MG_ATTR_HIGH_RESOLUTION_PRINT:case E.MG_ATTR_MERGE_TRIM:case E.MG_ATTR_ORIGINAL_IMAGE_LOAD:case E.MG_ATTR_PRINT_DATA_TRIM:case E.MG_ATTR_PSCRIPT_PRINT_NT:case E.MG_ATTR_SPECIAL_CONV_ADD_SLASH:case E.MG_ATTR_SPECIAL_FULL_EXPAND_PRINT:case E.MG_ATTR_SPECIAL_FULL_TEXT:case E.MG_ATTR_SPECIAL_LAST_LINE_PRINT:case E.MG_ATTR_SPECIAL_PRINTER_OEM:case E.MG_ATTR_EMBED_FONTS:case E.MG_ATTR_CENTER_SCREEN_IN_ONLINE:case E.MG_ATTR_REPOSITION_AFTER_MODIFY:case E.MG_ATTR_ISAM_TRANSACTION:return"Y"===r[0]||"1"===r[0]?"Y":"N";case E.MG_ATTR_TIME_SEPARATOR:case E.MG_ATTR_IOTIMING:case E.MG_ATTR_THOUSAND_SEPARATOR:return r[0].toString();default:return r}},a.prototype.set=function(n,a){var s=Object.create(null,{setValue:{get:function(){return r.prototype.setValue}},remove:{get:function(){return r.prototype.remove}}});return T(this,void 0,void 0,(function(){var r,i,l,u,c,_,T,p,g,d,I,f,C;return h(this,(function(h){switch(h.label){case 0:for(r=!0,i=!1,_=n,T=new Array(n.length+1),p=new Array(n.length+1),T[0]=0,p[0]="s",g=1,c=1;c<n.length;c++){if("="!==n[c]&&","!==n[c]||"\\"===n[c-1]||(T[g]=c+1,p[g]=n[c],g++),"*"===n[c]){n=t.NString.Remove(n,c,1);break}"\\"===n[c]&&(n=t.NString.Remove(n,c,1))}for(T[g]=n.length+1,p[g]="\0",g++,c=0;c<g-1;c++){if(l=n.substr(T[c],T[c+1]-T[c]-1),"="===n[T[c+1]-1]){for(c++,d=c,I=this.getAllowedSeparators(l),f=0;f<I&&","===p[c+1];f++)c++;u=n.substr(T[d],T[c+1]-T[d]-1)}else u=null;this.isReservedLogicalName(l)?r=!1:("["!==l[0]&&(l=t.NString.Insert(l,0,E.INI_SECTION_MAGIC_ENV_BRACKETS)),l.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)||(l=l.toUpperCase()),l=l.trim(),u=u.trim(),i=!0,!t.NString.IsNullOrEmpty(u)||l.startsWith(E.INI_SECTION_LOGICAL_NAMES_BRACKETS)?(s.setValue.call(this,l,new ot(u),!a),this.checkSetInEnvironment(l,u)):s.remove.call(this,l))}return a&&i?(C=Qe.CreateIniputForceWriteCommand(_),o.mgDataTable.getMGData(0).CmdsToServer.Add(C),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)]):[3,2];case 1:h.sent(),h.label=2;case 2:return[2,r]}}))}))},a.prototype.isReservedLogicalName=function(e){return!(e.startsWith("[")||(e=t.NString.Insert(e,0,E.INI_SECTION_LOGICAL_NAMES_BRACKETS),!this.values.ContainsKey(e)||!this.values.get_Item(e).isReserved()))},a.prototype.getAllowedSeparators=function(e){if("["!==e.charAt(0))return 0;var t=e.substr(1,e.indexOf("]")-1),r=e.substr(e.indexOf("]")+1);switch(t.toUpperCase()){case E.INI_SECTION_MAGIC_ENV:return r.toUpperCase()===E.MG_ATTR_LANGUAGE.toUpperCase()?999:0;case E.INI_SECTION_MAGIC_SYSTEMS:return 8;case E.INI_SECTION_MAGIC_DBMS:return 13;case E.INI_SECTION_MAGIC_SERVERS:return 6;case E.INI_SECTION_MAGIC_COMMS:return 2;case E.INI_SECTION_MAGIC_PRINTERS:return 3;case E.INI_SECTION_MAGIC_SYSTEM_MENU:return 11;case E.INI_SECTION_MAGIC_DATABASES:return 21;case E.INI_SECTION_MAGIC_LANGUAGE:return 1;case E.INI_SECTION_MAGIC_SERVICES:return 8;case E.INI_SECTION_TOOLS_MENU:return 7;default:return 0}},a.prototype.checkSetInEnvironment=function(e,r){if(e.startsWith(E.INI_SECTION_MAGIC_ENV_BRACKETS))switch((e=e.substr(E.INI_SECTION_MAGIC_ENV_BRACKETS.length)).toLowerCase()){case E.MG_ATTR_DECIMAL_SEPARATOR:et.Instance.setDecimalSeparator(r[0]);break;case E.MG_ATTR_DATE:n.DisplayConvertor.Instance.setDateChar(r[0].charCodeAt(0));break;case E.MG_ATTR_TIME:et.Instance.setTimeSeparator(r[0]);break;case E.MG_ATTR_OWNER:et.Instance.setOwner(r);break;case E.MG_ATTR_DATEMODE:et.Instance.setDateMode(G.Instance.getCurrTask().getCompIdx(),r[0]);break;case E.MG_ATTR_CENTURY:et.Instance.setCentury(G.Instance.getCurrTask().getCompIdx(),t.NNumber.Parse(r));break;case E.MG_ATTR_IDLETIME:et.Instance.setIdleTime(G.Instance.getCurrTask().getCompIdx(),t.NNumber.Parse(r));break;case E.MG_ATTR_UPD_IN_QUERY_LOWER:et.Instance.setAllowUpdateInQueryMode(G.Instance.getCurrTask().getCompIdx(),"1"===r[0]);break;case E.MG_ATTR_CRE_IN_MODIFY_LOWER:et.Instance.setAllowCreateInModifyMode(G.Instance.getCurrTask().getCompIdx(),"1"===r[0]);break;case E.MG_ATTR_CONTEXT_INACTIVITY_TIMEOUT_LOWER:et.Instance.setContextInactivityTimeout(t.NNumber.Parse(r));break;case E.MG_ATTR_CONTEXT_INACTIVITY_WARNING_TIME_LOWER:et.Instance.setContextInactivityWarningTime(t.NNumber.Parse(r));break;case E.MG_ATTR_CONTEXT_UNLOAD_TIMEOUT_LOWER:et.Instance.setContextUnloadTimeout(t.NNumber.Parse(r));break;case E.MG_ATTR_TERMINAL:et.Instance.setTerminal(t.NNumber.Parse(r))}},a.prototype.translate=function(e){var r=new t.StringBuilder(e);return this.log(r),r.ToString()},a.prototype.log=function(e){var t;do{var r=0;for(t=!0;r<e.Length&&e.get_Item(r)>"\0";)if("%"===e.get_Item(r)){var n=e.Length;r=this.log_trans(e,r),n!==e.Length&&(t=!1)}else r+=1}while(!t)},a.prototype.log_trans=function(e,t){for(var r=!1,n=t,a=t+1;a<e.Length&&"%"!==e.get_Item(a);)a++;if(a>=e.Length?(t=a,r=!0):"%"!==e.get_Item(a)&&t++,!r){var s=E.INI_SECTION_LOGICAL_NAMES_BRACKETS+e.ToString(n+1,a-n-1),i=this.get(s);null===i?(e.Replace(e.ToString(t,a+1-t),"",t,a+1-t),t+=1):e.Replace(e.ToString(n,a+1-n),i,n,a+1-n)}return t},a}($e);lt.Instance=new lt;var ut=function(){function e(){}return e.getCookies=function(e){return"*"==e?document.cookie:this.getCookie(e)},e.setCookie=function(t,r,n,a,s,i,o){var l=encodeURIComponent(t)+"="+encodeURIComponent(e.encode_cookie(r))+";";if(n)if("number"==typeof n)l+="expires="+new Date(n).toUTCString()+";";else if("string"==typeof n){l+="expires="+new Date(n).toUTCString()+";"}else l+="expires="+n.toUTCString()+";";return a&&(l+="path="+a+";"),s&&(l+="domain="+s+";"),!1===i&&"None"===o&&(i=!0,console.warn("cookie "+t+" was forced with secure flag because sameSite=None.")),i&&(l+="secure;"),o||(o="Lax"),l+="sameSite="+o+";",document.cookie=l,this.getCookie(t)},e.encode_cookie=function(e){e=e.trim();for(var t="",r=0;r<e.length;r++)t+=e.charCodeAt(r),r<e.length-1&&(t+="+");return t},e.decode_cookie=function(e){for(var t="",r=e.split("+"),n=0;n<r.length;n++)t+=String.fromCharCode(r[n]);return t},e.getCookie=function(r){for(var n=t.NString.TrimStart(r+"="),a=decodeURIComponent(document.cookie).split(";"),s=0;s<a.length;s++){for(var i=a[s];" "==i.charAt(0);)i=i.substring(1);if(i.indexOf(n)>=0)return e.decode_cookie(i.substring(n.length,i.length))}return""},e.deleteCookie=function(e){for(var t=document.cookie.split(";"),r=0;r<t.length;r++){var n=t[r],a=n.indexOf("="),s=a>-1?n.substr(0,a):n;if(e===decodeURI(s))return document.cookie=s+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT",!0}return!1},e}(),ct=function(s){function i(){var e=s.call(this)||this;return e._charsToTrim=[" ","\0"],e._expressionLocalJpn=null,e._expressionLocalJpn=r.UtilStrByteMode.isLocaleDefLangJPN()?new de(e):null,e}return u(i,s),i.prototype.getExpBasicValue=function(e,t){var a,s,i,o,l,u=new n.ExpVal;switch(t){case n.ExpressionInterface.EXP_OP_A:case n.ExpressionInterface.EXP_OP_H:u.Attr=r.StorageAttribute.UNICODE,a=e.get4ByteNumber(),u.StrVal=e.getString(a,!0,!0),a=e.get4ByteNumber(),e.getString(a,!0,!1);break;case n.ExpressionInterface.EXP_OP_EXT_A:u.Attr=r.StorageAttribute.ALPHA,a=e.get4ByteNumber(),e.getString(a,!0,!0),a=e.get4ByteNumber(),u.StrVal=e.getString(a,!0,!1);break;case n.ExpressionInterface.EXP_OP_N:case n.ExpressionInterface.EXP_OP_T:case n.ExpressionInterface.EXP_OP_D:case n.ExpressionInterface.EXP_OP_E:t===n.ExpressionInterface.EXP_OP_D?u.Attr=r.StorageAttribute.DATE:t===n.ExpressionInterface.EXP_OP_T?u.Attr=r.StorageAttribute.TIME:u.Attr=r.StorageAttribute.NUMERIC,a=e.get2ByteNumber(),u.MgNumVal=e.getMagicNumber(a,!0);break;case n.ExpressionInterface.EXP_OP_L:u.Attr=r.StorageAttribute.BOOLEAN,u.BoolVal=1===e.get2ByteNumber();break;case n.ExpressionInterface.EXP_OP_V:s=e.getVarIdx(),i=e.get4ByteNumber(),o=this.ExpTask.getFieldDef(s,i-1),u.Attr=o.getType();var c=o.getType()===r.StorageAttribute.BLOB_VECTOR||o.NullAllowed;switch(u.IsNull=o.isNull()&&c,u.OriginalNull=u.IsNull,null!=(l=o.getValue(!0))&&u.IsNull&&o.getTask().getNullArithmetic()===r.Constants.NULL_ARITH_USE_DEF&&(u.IsNull=!1),u.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:u.StrVal=l;break;case r.StorageAttribute.BLOB_VECTOR:u.VectorField=o;case r.StorageAttribute.BLOB:u.StrVal=l,null==u.StrVal?(u.IsNull=!0,u.IncludeBlobPrefix=!1):u.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:u.MgNumVal=null!=l?new n.NUM_TYPE(l):null;break;case r.StorageAttribute.BOOLEAN:null!=l&&(u.BoolVal=n.DisplayConvertor.toBoolean(l))}break;case n.ExpressionInterface.EXP_OP_FORM:s=e.getVarIdx();var _=e.get4ByteNumber();_=this.ExpTask.GetRealMainDisplayIndexOnDepth(_),this.ConstructMagicNum(u,_,r.StorageAttribute.NUMERIC);break;case n.ExpressionInterface.EXP_OP_VAR:s=e.getVarIdx(),i=e.get4ByteNumber();var T=this.ExpTask.ctl_itm_4_parent_vee(s,i);this.ConstructMagicNum(u,T,r.StorageAttribute.NUMERIC);break;case n.ExpressionInterface.EXP_OP_RIGHT_LITERAL:a=e.get2ByteNumber(),u.MgNumVal=e.getMagicNumber(a,!0),a=e.get2ByteNumber(),u.Attr=r.StorageAttribute.NUMERIC,e.getString(a,!0,!1)}return u},i.isBasicItem=function(e){return e<=n.ExpressionInterface.EXP_OP_L||e===n.ExpressionInterface.EXP_OP_EXT_A||e===n.ExpressionInterface.EXP_OP_RIGHT_LITERAL||e===n.ExpressionInterface.EXP_OP_E||e===n.ExpressionInterface.EXP_OP_FORM},i.isVarArgList=function(e){return e.ArgCount_<0||e.ArgAttr_.length>e.ArgCount_},i.prototype.execOperation=function(e,a,o,l,u){var c=Object.create(null,{SetNULL:{get:function(){return s.prototype.SetNULL}}});return T(this,void 0,void 0,(function(){var s,_,T,p,g,d,E,I,f,C,A,R,S,M,m,v,L,b,N,y,O,G,P,D,k,x,F,w,V,U,B,X;return h(this,(function(h){switch(h.label){case 0:if(f=new ht,R=new n.ExpVal,M=!0,v=et.Instance.getSpecialAnsiExpression(),y=0,G=fe.expDesc[e],!i.isVarArgList(G))return[3,7];m=a.get1ByteNumber(),y=0,h.label=1;case 1:if(!(y<m))return[3,6];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,this.execExpression(a,o,r.StorageAttribute.NONE)];case 3:return h.sent(),[3,5];case 4:if((P=h.sent())instanceof t.Exception)return[3,6];throw P;case 5:return y++,[3,1];case 6:i.isVarArgList(G)&&y===m?(D=m,o.push(D)):r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.execOperation() there is problem with arguments of "+e+"(see ExpressionDict for name)"),h.label=7;case 7:switch(e){case n.ExpressionInterface.EXP_OP_ADD:return[3,8];case n.ExpressionInterface.EXP_OP_SUB:return[3,9];case n.ExpressionInterface.EXP_OP_MUL:return[3,10];case n.ExpressionInterface.EXP_OP_DIV:return[3,11];case n.ExpressionInterface.EXP_OP_MOD:return[3,12];case n.ExpressionInterface.EXP_OP_NEG:return[3,13];case n.ExpressionInterface.EXP_OP_FIX:return[3,14];case n.ExpressionInterface.EXP_OP_ROUND:return[3,15];case n.ExpressionInterface.EXP_OP_EQ:return[3,16];case n.ExpressionInterface.EXP_OP_NE:return[3,17];case n.ExpressionInterface.EXP_OP_LE:return[3,18];case n.ExpressionInterface.EXP_OP_LT:return[3,19];case n.ExpressionInterface.EXP_OP_GE:return[3,20];case n.ExpressionInterface.EXP_OP_GT:return[3,21];case n.ExpressionInterface.EXP_OP_NOT:return[3,22];case n.ExpressionInterface.EXP_OP_OR:return[3,23];case n.ExpressionInterface.EXP_OP_AND:return[3,24];case n.ExpressionInterface.EXP_OP_IF:return[3,25];case n.ExpressionInterface.EXP_OP_LEN:return[3,26];case n.ExpressionInterface.EXP_OP_CON:return[3,27];case n.ExpressionInterface.EXP_OP_MID:return[3,28];case n.ExpressionInterface.EXP_OP_LEFT:return[3,29];case n.ExpressionInterface.EXP_OP_RIGHT:return[3,30];case n.ExpressionInterface.EXP_OP_FILL:return[3,31];case n.ExpressionInterface.EXP_OP_INSTR:return[3,32];case n.ExpressionInterface.EXP_OP_TRIM:case n.ExpressionInterface.EXP_OP_LTRIM:case n.ExpressionInterface.EXP_OP_RTRIM:return[3,33];case n.ExpressionInterface.EXP_OP_STR:return[3,34];case n.ExpressionInterface.EXP_OP_VAL:return[3,35];case n.ExpressionInterface.EXP_OP_M:return[3,36];case n.ExpressionInterface.EXP_OP_K:return[3,37];case n.ExpressionInterface.EXP_OP_F:case n.ExpressionInterface.EXP_OP_P:return[3,38];case n.ExpressionInterface.EXP_OP_STAT:return[3,39];case n.ExpressionInterface.EXP_OP_SUBFORM_EXEC_MODE:return[3,40];case n.ExpressionInterface.EXP_OP_IS_LOGGED_IN:return[3,41];case n.ExpressionInterface.EXP_OP_SYS:return[3,42];case n.ExpressionInterface.EXP_OP_PROG:return[3,43];case n.ExpressionInterface.EXP_OP_LEVEL:return[3,44];case n.ExpressionInterface.EXP_OP_COUNTER:return[3,45];case n.ExpressionInterface.EXP_OP_EMPTY_DATA_VIEW:return[3,46];case n.ExpressionInterface.EXP_OP_MAINLEVEL:return[3,47];case n.ExpressionInterface.EXP_OP_MAINDISPLAY:return[3,48];case n.ExpressionInterface.EXP_OP_ISFIRSTRECORDCYCLE:return[3,49];case n.ExpressionInterface.EXP_OP_DATE:case n.ExpressionInterface.EXP_OP_UTCDATE:return[3,50];case n.ExpressionInterface.EXP_OP_ADDDT:return[3,51];case n.ExpressionInterface.EXP_OP_DIFDT:return[3,53];case n.ExpressionInterface.EXP_OP_VARPREV:return[3,55];case n.ExpressionInterface.EXP_OP_VARCURR:return[3,56];case n.ExpressionInterface.EXP_OP_VARMOD:return[3,57];case n.ExpressionInterface.EXP_OP_VARINP:return[3,58];case n.ExpressionInterface.EXP_OP_VARNAME:return[3,59];case n.ExpressionInterface.EXP_OP_VARDISPLAYNAME:return[3,60];case n.ExpressionInterface.EXP_OP_VARCONTROLID:return[3,61];case n.ExpressionInterface.EXP_OP_CONTROLITEMSLIST:return[3,62];case n.ExpressionInterface.EXP_OP_CONTROLDISPLAYLIST:return[3,64];case n.ExpressionInterface.EXP_OP_VIEWMOD:return[3,66];case n.ExpressionInterface.EXP_OP_TIME:case n.ExpressionInterface.EXP_OP_UTCTIME:return[3,67];case n.ExpressionInterface.EXP_OP_MTIME:case n.ExpressionInterface.EXP_OP_UTCMTIME:return[3,68];case n.ExpressionInterface.EXP_OP_PWR:return[3,69];case n.ExpressionInterface.EXP_OP_LOG:return[3,70];case n.ExpressionInterface.EXP_OP_EXP:return[3,71];case n.ExpressionInterface.EXP_OP_ABS:return[3,72];case n.ExpressionInterface.EXP_OP_SIN:return[3,73];case n.ExpressionInterface.EXP_OP_COS:return[3,74];case n.ExpressionInterface.EXP_OP_TAN:return[3,75];case n.ExpressionInterface.EXP_OP_ASIN:return[3,76];case n.ExpressionInterface.EXP_OP_ACOS:return[3,77];case n.ExpressionInterface.EXP_OP_ATAN:return[3,78];case n.ExpressionInterface.EXP_OP_RAND:return[3,79];case n.ExpressionInterface.EXP_OP_MIN:case n.ExpressionInterface.EXP_OP_MAX:return[3,80];case n.ExpressionInterface.EXP_OP_RANGE:return[3,81];case n.ExpressionInterface.EXP_OP_REP:return[3,82];case n.ExpressionInterface.EXP_OP_INS:return[3,83];case n.ExpressionInterface.EXP_OP_DEL:return[3,84];case n.ExpressionInterface.EXP_OP_FLIP:return[3,85];case n.ExpressionInterface.EXP_OP_UPPER:return[3,86];case n.ExpressionInterface.EXP_OP_LOWER:return[3,87];case n.ExpressionInterface.EXP_OP_CRC:return[3,88];case n.ExpressionInterface.EXP_OP_CHKDGT:return[3,89];case n.ExpressionInterface.EXP_OP_SOUNDX:return[3,90];case n.ExpressionInterface.EXP_OP_HSTR:return[3,91];case n.ExpressionInterface.EXP_OP_HVAL:return[3,92];case n.ExpressionInterface.EXP_OP_CHR:return[3,93];case n.ExpressionInterface.EXP_OP_ASC:return[3,94];case n.ExpressionInterface.EXP_OP_MSTR:return[3,95];case n.ExpressionInterface.EXP_OP_MVAL:return[3,96];case n.ExpressionInterface.EXP_OP_DSTR:return[3,97];case n.ExpressionInterface.EXP_OP_DVAL:return[3,98];case n.ExpressionInterface.EXP_OP_TSTR:return[3,99];case n.ExpressionInterface.EXP_OP_MTSTR:return[3,100];case n.ExpressionInterface.EXP_OP_TVAL:return[3,101];case n.ExpressionInterface.EXP_OP_MTVAL:return[3,102];case n.ExpressionInterface.EXP_OP_DAY:return[3,103];case n.ExpressionInterface.EXP_OP_MONTH:return[3,104];case n.ExpressionInterface.EXP_OP_YEAR:return[3,105];case n.ExpressionInterface.EXP_OP_DOW:return[3,106];case n.ExpressionInterface.EXP_OP_CDOW:return[3,107];case n.ExpressionInterface.EXP_OP_CMONTH:return[3,108];case n.ExpressionInterface.EXP_OP_NDOW:return[3,109];case n.ExpressionInterface.EXP_OP_NMONTH:return[3,110];case n.ExpressionInterface.EXP_OP_SECOND:return[3,111];case n.ExpressionInterface.EXP_OP_MINUTE:return[3,112];case n.ExpressionInterface.EXP_OP_HOUR:return[3,113];case n.ExpressionInterface.EXP_OP_DELAY:return[3,114];case n.ExpressionInterface.EXP_OP_IDLE:return[3,115];case n.ExpressionInterface.EXP_OP_ADDDATE:return[3,116];case n.ExpressionInterface.EXP_OP_ADDTIME:return[3,117];case n.ExpressionInterface.EXP_OP_OWNER:return[3,118];case n.ExpressionInterface.EXP_OP_VARATTR:return[3,119];case n.ExpressionInterface.EXP_OP_VARPIC:return[3,120];case n.ExpressionInterface.EXP_OP_DBROUND:return[3,121];case n.ExpressionInterface.EXP_OP_NULL:case n.ExpressionInterface.EXP_OP_NULL_A:case n.ExpressionInterface.EXP_OP_NULL_N:case n.ExpressionInterface.EXP_OP_NULL_B:case n.ExpressionInterface.EXP_OP_NULL_D:case n.ExpressionInterface.EXP_OP_NULL_T:case n.ExpressionInterface.EXP_OP_NULL_U:case n.ExpressionInterface.EXP_OP_NULL_O:return[3,122];case n.ExpressionInterface.EXP_OP_ISNULL:return[3,123];case n.ExpressionInterface.EXP_OP_BOM:return[3,124];case n.ExpressionInterface.EXP_OP_BOY:return[3,125];case n.ExpressionInterface.EXP_OP_EOM:return[3,126];case n.ExpressionInterface.EXP_OP_EOY:return[3,127];case n.ExpressionInterface.EXP_OP_ROLLBACK:return[3,128];case n.ExpressionInterface.EXP_OP_VARSET:return[3,130];case n.ExpressionInterface.EXP_OP_CTRL_NAME:return[3,132];case n.ExpressionInterface.EXP_OP_TDEPTH:return[3,133];case n.ExpressionInterface.EXP_OP_ISDEFAULT:return[3,134];case n.ExpressionInterface.EXP_OP_STRTOKEN:return[3,135];case n.ExpressionInterface.EXP_OP_STRTOK_CNT:return[3,136];case n.ExpressionInterface.EXP_OP_STRTOKEN_IDX:return[3,137];case n.ExpressionInterface.EXP_OP_BLOBSIZE:return[3,138];case n.ExpressionInterface.EXP_OP_WEB_REFERENCE:return[3,139];case n.ExpressionInterface.EXP_OP_CASE:return[3,140];case n.ExpressionInterface.EXP_OP_THIS:return[3,141];case n.ExpressionInterface.EXP_OP_LIKE:return[3,142];case n.ExpressionInterface.EXP_OP_REPSTR:return[3,143];case n.ExpressionInterface.EXP_OP_VARCURRN:return[3,144];case n.ExpressionInterface.EXP_OP_VARINDEX:return[3,145];case n.ExpressionInterface.EXP_OP_JCDOW:return[3,146];case n.ExpressionInterface.EXP_OP_JMONTH:return[3,147];case n.ExpressionInterface.EXP_OP_JNDOW:return[3,148];case n.ExpressionInterface.EXP_OP_JYEAR:return[3,149];case n.ExpressionInterface.EXP_OP_JGENGO:return[3,150];case n.ExpressionInterface.EXP_OP_HAN:return[3,151];case n.ExpressionInterface.EXP_OP_ZEN:return[3,152];case n.ExpressionInterface.EXP_OP_ZENS:return[3,153];case n.ExpressionInterface.EXP_OP_ZIMEREAD:return[3,154];case n.ExpressionInterface.EXP_OP_ZKANA:return[3,155];case n.ExpressionInterface.EXP_OP_GOTO_CTRL:return[3,156];case n.ExpressionInterface.EXP_OP_TRANSLATE:return[3,157];case n.ExpressionInterface.EXP_OP_ASTR:return[3,158];case n.ExpressionInterface.EXP_OP_LOOPCOUNTER:return[3,159];case n.ExpressionInterface.EXP_OP_VECCELLATTR:return[3,160];case n.ExpressionInterface.EXP_OP_VECGET:return[3,161];case n.ExpressionInterface.EXP_OP_VECSET:return[3,162];case n.ExpressionInterface.EXP_OP_VECSIZE:return[3,164];case n.ExpressionInterface.EXP_OP_IN:return[3,165];case n.ExpressionInterface.EXP_OP_ISCOMPONENT:return[3,166];case n.ExpressionInterface.EXP_OP_USER_DEFINED_FUNC:return[3,167];case n.ExpressionInterface.EXP_OP_UNICODEASC:return[3,170];case n.ExpressionInterface.EXP_OP_PUBLICNAME:return[3,171];case n.ExpressionInterface.EXP_OP_TASKID:return[3,172];case n.ExpressionInterface.EXP_OP_DBVIEWSIZE:return[3,173];case n.ExpressionInterface.EXP_OP_DBVIEWROWIDX:return[3,174];case n.ExpressionInterface.EXP_OP_PROJECTDIR:return[3,175];case n.ExpressionInterface.EXP_OP_MLS_TRANS:return[3,176];case n.ExpressionInterface.EXP_OP_STR_BUILD:return[3,177];case n.ExpressionInterface.EXP_OP_STATUSBARSETTEXT:return[3,178];case n.ExpressionInterface.EXP_OP_SET_TITLE:return[3,179];case n.ExpressionInterface.EXP_OP_IS_ROW_EDITING:return[3,180];case n.ExpressionInterface.EXP_OP_GETPARAM:return[3,181];case n.ExpressionInterface.EXP_OP_SETPARAM:return[3,182];case n.ExpressionInterface.EXP_OP_INIPUT:return[3,183];case n.ExpressionInterface.EXP_OP_INIGET:return[3,185];case n.ExpressionInterface.EXP_OP_INIGETLN:return[3,186];case n.ExpressionInterface.EXP_OP_EXPCALC:return[3,187];case n.ExpressionInterface.EXP_OP_TASKTYPE:return[3,189];case n.ExpressionInterface.EXP_OP_RANGE_ADD:return[3,190];case n.ExpressionInterface.EXP_OP_RANGE_RESET:return[3,193];case n.ExpressionInterface.EXP_OP_LOCATE_ADD:return[3,195];case n.ExpressionInterface.EXP_OP_LOCATE_RESET:return[3,198];case n.ExpressionInterface.EXP_OP_SORT_ADD:return[3,200];case n.ExpressionInterface.EXP_OP_SORT_RESET:return[3,202];case n.ExpressionInterface.EXP_OP_TSK_INSTANCE:return[3,204];case n.ExpressionInterface.EXP_OP_TERM:return[3,205];case n.ExpressionInterface.EXP_OP_FORMSTATECLEAR:return[3,206];case n.ExpressionInterface.EXP_OP_CLIENTSESSION_SET:return[3,207];case n.ExpressionInterface.EXP_OP_CND_RANGE:return[3,208];case n.ExpressionInterface.EXP_OP_CONTROL_SELECT_PROGRAM:return[3,209];case n.ExpressionInterface.EXP_OP_CALLJS:return[3,211];case n.ExpressionInterface.EXP_OP_SET_COOKIE:return[3,212];case n.ExpressionInterface.EXP_OP_GET_COOKIE:return[3,213];case n.ExpressionInterface.EXP_OP_DELETE_COOKIE:return[3,214];case n.ExpressionInterface.EXP_OP_ROUTEGET:return[3,215]}return[3,216];case 8:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.add(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 9:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.sub(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 10:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.mul(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 11:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.div(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 12:return _=o.pop(),s=o.pop(),R.MgNumVal=n.NUM_TYPE.mod(s.MgNumVal,_.MgNumVal),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=null==R.MgNumVal,[3,217];case 13:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(s.MgNumVal.num_neg(),R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),[3,217]);case 14:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal||null==_.MgNumVal||null==T.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),C=_.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_fix(C),A=T.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_trunc(A),[3,217]);case 15:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.MgNumVal||null==_.MgNumVal||null==T.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE(s.MgNumVal),C=_.MgNumVal.NUM_2_LONG(),R.MgNumVal.num_fix(C),A=T.MgNumVal.NUM_2_LONG(),R.MgNumVal.round(A),[3,217]);case 16:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=0===i.val_cmp_any(s,_,!1)}catch(e){if(!(e instanceof _t))throw e;R.BoolVal=!1}return a.resetNullResult(),[3,217];case 17:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=0!==i.val_cmp_any(s,_,!1)}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 18:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)<=0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 19:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)<0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 20:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)>=0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 21:_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN;try{R.BoolVal=i.val_cmp_any(s,_,!0)>0}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 22:return(R=o.pop()).BoolVal=!R.BoolVal,[3,217];case 23:return R=o.pop(),(f=new ht).argCount_=1,R.BoolVal?(f.opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)):(f.opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),M=!1),[3,217];case 24:return R=o.pop(),f=new ht,R.BoolVal?(f.opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),M=!1):(f.opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)),[3,217];case 25:return(s=o.pop()).BoolVal?((f=new ht).opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f),(f=new ht).opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f)):((f=new ht).opCode_=n.ExpressionInterface.EXP_OP_IGNORE,f.argCount_=1,l.push(f),(f=new ht).opCode_=n.ExpressionInterface.EXP_OP_EVALX,f.argCount_=0,l.push(f)),M=!1,a.resetNullResult(),[3,217];case 26:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==s.StrVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(R.MgNumVal=new n.NUM_TYPE,v||s.Attr!==r.StorageAttribute.UNICODE?R.MgNumVal.NUM_4_LONG(r.UtilStrByteMode.lenB(s.StrVal)):R.MgNumVal.NUM_4_LONG(s.StrVal.length),[3,217]);case 27:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,s.Attr===r.StorageAttribute.UNICODE&&null==s.StrVal||_.Attr===r.StorageAttribute.UNICODE&&null==_.StrVal?c.SetNULL.call(this,R,r.StorageAttribute.UNICODE):R.StrVal=(t.NString.IsNullOrEmpty(s.StrVal)?"":s.StrVal)+(t.NString.IsNullOrEmpty(_.StrVal)?"":_.StrVal),[3,217];case 28:return T=o.pop(),_=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==T.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,R.Attr),[3,217]):(L=(L=_.MgNumVal.NUM_2_LONG())>1?L-1:0,b=T.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.midB(s.StrVal,L,b)):((N=s.StrVal.length-L)<b&&(b=N),b<0&&(b=0),R.StrVal=s.StrVal.substr(L,b)),null==R.StrVal&&(R.StrVal=""),[3,217]);case 29:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,s.Attr),[3,217]):(b=_.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.leftB(s.StrVal,b),null==R.StrVal&&(R.StrVal="")):(b>s.StrVal.length&&(b=s.StrVal.length),b<0&&(b=0),R.StrVal=s.StrVal.substr(0,b)),[3,217]);case 30:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==_.MgNumVal||null==s.StrVal?(c.SetNULL.call(this,R,s.Attr),[3,217]):(b=_.MgNumVal.NUM_2_LONG(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.rightB(s.StrVal,b),null==R.StrVal&&(R.StrVal="")):(b>s.StrVal.length&&(b=s.StrVal.length),b<0&&(b=0),L=s.StrVal.length-b,R.StrVal=s.StrVal.substr(L)),[3,217]);case 31:if(_=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,null==_.MgNumVal||null==s.StrVal)return c.SetNULL.call(this,R,r.StorageAttribute.UNICODE),[3,217];if(b=s.StrVal.length,(y=_.MgNumVal.NUM_2_LONG())<0&&(y=0),(N=b*y)>32767&&(N=Math.floor(32767/b)*b),N>0)if(b<=0)R.StrVal="";else if(1===N)R.StrVal=s.StrVal;else{for(k=new t.StringBuilder(N);N>0;N-=b)k.Append(s.StrVal);R.StrVal=k.ToString()}return null==R.StrVal&&(R.StrVal=""),[3,217];case 32:if(_=o.pop(),s=o.pop(),L=0,R.Attr=r.StorageAttribute.NUMERIC,null==s.StrVal||null==_.StrVal)return c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217];if(R.MgNumVal=new n.NUM_TYPE,v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE)L=r.UtilStrByteMode.instrB(s.StrVal,_.StrVal);else{if(0===_.StrVal.length)return R.MgNumVal.NUM_4_LONG(L),[3,217];(L=s.StrVal.indexOf(_.StrVal))<0?L=0:L++}return R.MgNumVal.NUM_4_LONG(L),[3,217];case 33:if(s=o.pop(),R.Attr=s.Attr===r.StorageAttribute.ALPHA?r.StorageAttribute.ALPHA:r.StorageAttribute.UNICODE,null==s.StrVal)return c.SetNULL.call(this,R,R.Attr),[3,217];switch(e){case n.ExpressionInterface.EXP_OP_TRIM:s.StrVal=i.trimStr(s.StrVal,"B");break;case n.ExpressionInterface.EXP_OP_LTRIM:s.StrVal=i.trimStr(s.StrVal,"L");break;case n.ExpressionInterface.EXP_OP_RTRIM:s.StrVal=i.trimStr(s.StrVal,"R")}return R.StrVal=s.StrVal,[3,217];case 34:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.UNICODE,null==_.StrVal||null==s.MgNumVal?(c.SetNULL.call(this,R,r.StorageAttribute.UNICODE),[3,217]):(O=new n.PIC(i.set_a_pic(_.StrVal),r.StorageAttribute.NUMERIC,this.ExpTask.getCompIdx()),R.StrVal=s.MgNumVal.to_a(O),[3,217]);case 35:return _=o.pop(),s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,null==_.StrVal||null==s.StrVal?(c.SetNULL.call(this,R,r.StorageAttribute.NUMERIC),[3,217]):(O=new n.PIC(i.set_a_pic(_.StrVal),r.StorageAttribute.NUMERIC,this.ExpTask.getCompIdx()),R.MgNumVal=new n.NUM_TYPE(s.StrVal,O,this.ExpTask.getCompIdx()),[3,217]);case 36:return b=a.get2ByteNumber(),x=a.getString(b,!0,!1),this.eval_op_m(R,x),[3,217];case 37:return R.Attr=r.StorageAttribute.NUMERIC,b=a.get2ByteNumber(),R.MgNumVal=a.getMagicNumber(b,!0),[3,217];case 38:return R.Attr=r.StorageAttribute.NUMERIC,b=a.get2ByteNumber(),R.MgNumVal=a.getMagicNumber(b,!0),b=a.get2ByteNumber(),a.getMagicNumber(b,!0),[3,217];case 39:return _=o.pop(),s=o.pop(),this.eval_op_stat(R,s,_),[3,217];case 40:return s=o.pop(),this.eval_op_subformExecMode(R,s),[3,217];case 41:return this.eval_op_IsLoggedIn(R),[3,217];case 42:return this.eval_op_appname(R),[3,217];case 43:return this.eval_op_prog(R),[3,217];case 44:return s=o.pop(),this.eval_op_level(R,s),[3,217];case 45:return s=o.pop(),this.eval_op_counter(R,s),[3,217];case 46:return s=o.pop(),this.eval_op_emptyDataview(R,s),[3,217];case 47:return s=o.pop(),this.eval_op_mainlevel(R,s),[3,217];case 48:return s=o.pop(),this.eval_op_maindisplay(R,s),[3,217];case 49:return s=o.pop(),this.eval_op_IsFirstRecordCycle(R,s),[3,217];case 50:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.date_magic(e===n.ExpressionInterface.EXP_OP_UTCDATE)),R.Attr=r.StorageAttribute.DATE,[3,217];case 51:return I=o.pop(),E=o.pop(),d=o.pop(),g=o.pop(),p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_addDateTime(R,s,_,T,p,g,d,E,I)];case 52:return h.sent(),[3,217];case 53:return d=o.pop(),g=o.pop(),p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_difdt(R,s,_,T,p,g,d)];case 54:return h.sent(),[3,217];case 55:return s=o.pop(),this.exp_get_var(R,s,!0),[3,217];case 56:return s=o.pop(),this.exp_get_var(R,s,!1),[3,217];case 57:return s=o.pop(),this.eval_op_varmod(R,s),[3,217];case 58:return s=o.pop(),this.eval_op_varinp(R,s),[3,217];case 59:return s=o.pop(),this.eval_op_varname(R,s),[3,217];case 60:return s=o.pop(),this.eval_op_VarDisplayName(R,s),a.resetNullResult(),[3,217];case 61:return s=o.pop(),this.eval_op_VarControlID(R,s),a.resetNullResult(),[3,217];case 62:return s=o.pop(),[4,this.eval_op_ControlItemsList(R,s)];case 63:return h.sent(),a.resetNullResult(),[3,217];case 64:return s=o.pop(),[4,this.eval_op_ControlDisplayList(R,s)];case 65:return h.sent(),a.resetNullResult(),[3,217];case 66:return s=o.pop(),this.eval_op_viewmod(R,s),[3,217];case 67:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.time_magic(e===n.ExpressionInterface.EXP_OP_UTCTIME)),R.Attr=r.StorageAttribute.TIME,[3,217];case 68:return R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(n.DisplayConvertor.Instance.mtime_magic(e===n.ExpressionInterface.EXP_OP_UTCMTIME)),R.Attr=r.StorageAttribute.TIME,[3,217];case 69:return _=o.pop(),s=o.pop(),R.MgNumVal=new n.NUM_TYPE,R.MgNumVal=n.NUM_TYPE.eval_op_pwr(s.MgNumVal,_.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 70:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_log(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 71:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_exp(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 72:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_abs(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 73:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_sin(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 74:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_cos(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 75:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_tan(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 76:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_asin(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 77:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_acos(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 78:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_atan(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 79:return s=o.pop(),R.MgNumVal=n.NUM_TYPE.eval_op_rand(s.MgNumVal),R.IsNull=null==R.MgNumVal,R.Attr=r.StorageAttribute.NUMERIC,[3,217];case 80:m=o.pop(),this.val_cpy(o.pop(),R);try{for(y=1;y<m;y++)s=o.pop(),e===n.ExpressionInterface.EXP_OP_MIN?i.val_cmp_any(s,R,!0)<0&&this.val_cpy(s,R):i.val_cmp_any(s,R,!0)>0&&this.val_cpy(s,R)}catch(e){if(!(e instanceof _t))throw e;for(;o.count()>0&&y<m;y++)o.pop();R.IsNull=!0,R.Attr=e.getAttr()}return[3,217];case 81:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_range(s,_,T,R),[3,217];case 82:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.repB(s.StrVal,_.StrVal,T.MgNumVal.NUM_2_LONG(),p.MgNumVal.NUM_2_LONG())):this.eval_op_rep_1(R,s,_,T,p),[3,217];case 83:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE&&_.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.insB(s.StrVal,_.StrVal,T.MgNumVal.NUM_2_LONG(),p.MgNumVal.NUM_2_LONG())):this.eval_op_ins(R,s,_,T,p),[3,217];case 84:return T=o.pop(),_=o.pop(),s=o.pop(),v||s.Attr!==r.StorageAttribute.UNICODE?(R.Attr=r.StorageAttribute.ALPHA,R.StrVal=r.UtilStrByteMode.delB(s.StrVal,_.MgNumVal.NUM_2_LONG(),T.MgNumVal.NUM_2_LONG())):this.eval_op_del(R,s,_,T),[3,217];case 85:return s=o.pop(),this.eval_op_flip(R,s),[3,217];case 86:return s=o.pop(),this.eval_op_upper(R,s),[3,217];case 87:return s=o.pop(),this.eval_op_lower(R,s),[3,217];case 88:return _=o.pop(),s=o.pop(),this.eval_op_crc(R,s,_),[3,217];case 89:return _=o.pop(),s=o.pop(),this.eval_op_chkdgt(R,s,_),[3,217];case 90:return s=o.pop(),this.eval_op_soundx(R,s),[3,217];case 91:return s=o.pop(),this.eval_op_hstr(R,s),[3,217];case 92:return s=o.pop(),this.eval_op_hval(R,s),[3,217];case 93:return s=o.pop(),this.eval_op_chr(R,s),[3,217];case 94:return s=o.pop(),this.eval_op_asc(R,s),[3,217];case 95:return _=o.pop(),s=o.pop(),this.eval_op_mstr(R,s,_),[3,217];case 96:return s=o.pop(),this.eval_op_mval(R,s),[3,217];case 97:return _=o.pop(),s=o.pop(),this.eval_op_dstr(R,s,_,n.DisplayConvertor.Instance),[3,217];case 98:return _=o.pop(),s=o.pop(),this.eval_op_dval(R,s,_,n.DisplayConvertor.Instance),[3,217];case 99:return _=o.pop(),s=o.pop(),this.eval_op_tstr(R,s,_,n.DisplayConvertor.Instance,!1),[3,217];case 100:return _=o.pop(),s=o.pop(),this.eval_op_tstr(R,s,_,n.DisplayConvertor.Instance,!0),[3,217];case 101:return _=o.pop(),s=o.pop(),this.eval_op_tval(R,s,_,n.DisplayConvertor.Instance,!1),[3,217];case 102:return _=o.pop(),s=o.pop(),this.eval_op_tval(R,s,_,n.DisplayConvertor.Instance,!0),[3,217];case 103:return s=o.pop(),this.eval_op_day(R,s),[3,217];case 104:return s=o.pop(),this.eval_op_month(R,s),[3,217];case 105:return s=o.pop(),this.eval_op_year(R,s),[3,217];case 106:return s=o.pop(),this.eval_op_dow(R,s),[3,217];case 107:return s=o.pop(),this.eval_op_cdow(R,s.MgNumVal,n.DisplayConvertor.Instance),[3,217];case 108:return s=o.pop(),this.eval_op_cmonth(R,s.MgNumVal,n.DisplayConvertor.Instance),[3,217];case 109:return s=o.pop(),this.eval_op_ndow(R,s,n.DisplayConvertor.Instance),[3,217];case 110:return s=o.pop(),this.eval_op_nmonth(R,s,n.DisplayConvertor.Instance),[3,217];case 111:return s=o.pop(),this.eval_op_second(R,s),[3,217];case 112:return s=o.pop(),this.eval_op_minute(R,s),[3,217];case 113:return s=o.pop(),this.eval_op_hour(R,s),[3,217];case 114:return s=o.pop(),this.eval_op_delay(s),R.Attr=r.StorageAttribute.BOOLEAN,R.BoolVal=!0,[3,217];case 115:return this.eval_op_idle(R),[3,217];case 116:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_adddate(R,s,_,T,p),[3,217];case 117:return p=o.pop(),T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_addtime(R,s,_,T,p),[3,217];case 118:return R.Attr=r.StorageAttribute.ALPHA,R.StrVal=et.Instance.getOwner(),[3,217];case 119:return s=o.pop(),this.eval_op_varattr(R,s),[3,217];case 120:return _=o.pop(),s=o.pop(),this.eval_op_varpic(R,s,_),[3,217];case 121:return _=o.pop(),s=o.pop(),this.eval_op_dbround(R,s,_),[3,217];case 122:return this.exp_null_val_get(u,e,R),[3,217];case 123:if(s=o.pop(),R.BoolVal=s.IsNull,!s.IsNull&&s.OriginalNull&&(R.BoolVal=s.OriginalNull),R.Attr=r.StorageAttribute.BOOLEAN,a.isNull()){for(F=new t.List,w=!1,V=void 0;0!==o.count()&&!w;)F.push(o.pop()),F.get_Item(F.length-1).IsNull&&(w=!0);for(V=F.length-1;V>=0;V--)o.push(F.get_Item(V));w||a.resetNullResult()}return[3,217];case 124:return s=o.pop(),this.eval_op_bom(R,s),[3,217];case 125:return s=o.pop(),this.eval_op_boy(R,s),[3,217];case 126:return s=o.pop(),this.eval_op_eom(R,s),[3,217];case 127:return s=o.pop(),this.eval_op_eoy(R,s),[3,217];case 128:return _=o.pop(),s=o.pop(),[4,this.eval_op_rollback(R,s,_)];case 129:return h.sent(),[3,217];case 130:return _=o.pop(),s=o.pop(),[4,this.eval_op_varset(R,_,s)];case 131:return h.sent(),[3,217];case 132:return this.eval_op_ctrl_name(R),[3,217];case 133:return U=this.ExpTask.GetContextTask(),b=U.getTaskDepth(!1)-1,this.ConstructMagicNum(R,b,r.StorageAttribute.NUMERIC),[3,217];case 134:return s=o.pop(),this.exp_is_default(R,s),[3,217];case 135:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_strtok(R,s,_,T),[3,217];case 136:return _=o.pop(),s=o.pop(),this.eval_op_strTokenCnt(s,_,R),[3,217];case 137:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_strTokenIdx(s,_,T,R),[3,217];case 138:return s=o.pop(),this.eval_op_blobsize(R,s),[3,217];case 139:return s=o.pop(),R.Attr=r.StorageAttribute.ALPHA,R.StrVal="%"+s.StrVal+"%",[3,217];case 140:for(m=o.pop(),S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();for(this.val_cpy(S[0],R),y=1;y<m;y+=2){s=S[y],B=void 0;try{B=0===i.val_cmp_any(s,R,!1)}catch(e){if(!(e instanceof _t))throw e;B=!1}if(B){this.val_cpy(S[y+1],R);break}if(y===m-3){this.val_cpy(S[y+2],R);break}}return a.resetNullResult(),[3,217];case 141:return this.eval_op_this(R),[3,217];case 142:return _=o.pop(),s=o.pop(),this.eval_op_like(s,_,R),[3,217];case 143:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_repstr(s,_,T,R),[3,217];case 144:return s=o.pop(),this.exp_get_var(s,R),[3,217];case 145:return s=o.pop(),this.exp_get_indx(s,R),[3,217];case 146:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jcdow(R,s.MgNumVal,n.DisplayConvertor.Instance)),[3,217];case 147:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jmonth(R,s)),[3,217];case 148:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jndow(R,s,n.DisplayConvertor.Instance)),[3,217];case 149:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(s=o.pop(),this._expressionLocalJpn.eval_op_jyear(R,s)),[3,217];case 150:return null==this._expressionLocalJpn?c.SetNULL.call(this,R,r.StorageAttribute.ALPHA):(_=o.pop(),s=o.pop(),this._expressionLocalJpn.eval_op_jgengo(R,s.MgNumVal,_.MgNumVal,n.DisplayConvertor.Instance)),[3,217];case 151:return s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_han(s.StrVal),null==R.StrVal&&(R.StrVal="")),[3,217];case 152:return s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zens(s.StrVal,0),null==R.StrVal&&(R.StrVal="")),[3,217];case 153:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==_.MgNumVal||null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zens(s.StrVal,_.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 154:return s=o.pop(),R.Attr=r.StorageAttribute.ALPHA,null==this._expressionLocalJpn?R.StrVal=s.StrVal:(R.StrVal=this._expressionLocalJpn.eval_op_zimeread(s.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 155:return _=o.pop(),s=o.pop(),R.Attr=s.Attr,null==this._expressionLocalJpn?R.StrVal=s.StrVal:null==_.MgNumVal||null==s.StrVal?c.SetNULL.call(this,R,s.Attr):(R.StrVal=this._expressionLocalJpn.eval_op_zkana(s.StrVal,_.MgNumVal.NUM_2_LONG()),null==R.StrVal&&(R.StrVal="")),[3,217];case 156:return T=o.pop(),_=o.pop(),s=o.pop(),this.eval_op_gotoCtrl(s,_,T,R),[3,217];case 157:return s=o.pop(),this.eval_op_translate(s,R),[3,217];case 158:return _=o.pop(),s=o.pop(),this.eval_op_astr(s,_,R),[3,217];case 159:return this.ConstructMagicNum(R,this.ExpTask.getLoopCounter(),r.StorageAttribute.NUMERIC),[3,217];case 160:return s=o.pop(),i.eval_op_vecCellAttr(s,R),[3,217];case 161:return _=o.pop(),s=o.pop(),this.eval_op_vecGet(s,_,R),[3,217];case 162:return T=o.pop(),_=o.pop(),s=o.pop(),[4,this.eval_op_vecSet(s,_,T,R)];case 163:return h.sent(),R.IsNull=!1,a.isNull()&&a.resetNullResult(),[3,217];case 164:return s=o.pop(),this.eval_op_vecSize(s,R),a.resetNullResult(),[3,217];case 165:for(m=o.pop(),R.Attr=r.StorageAttribute.BOOLEAN,R.BoolVal=!1,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();try{for(y=1;y<m;y++)if(0===i.val_cmp_any(S[0],S[y],!1)){R.BoolVal=!0;break}}catch(e){if(!(e instanceof _t))throw e;c.SetNULL.call(this,R,r.StorageAttribute.BOOLEAN)}return[3,217];case 166:return this.eval_op_iscomponent(R),[3,217];case 167:if(!((m=o.pop())>0))return[3,169];for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return X=o.pop().StrVal,[4,this.eval_op_ExecUserDefinedFunc(X,S,R,u)];case 168:h.sent(),a.resetNullResult(),h.label=169;case 169:return[3,217];case 170:return s=o.pop(),R.Attr=r.StorageAttribute.NUMERIC,R.IsNull=!1,!s.IsNull&&s.StrVal.length>0?(R.MgNumVal=new n.NUM_TYPE,R.MgNumVal.NUM_4_LONG(s.StrVal[0].charCodeAt(0))):R.IsNull=!0,[3,217];case 171:return s=o.pop(),this.eval_op_publicName(R,s),[3,217];case 172:return s=o.pop(),this.eval_op_taskId(R,s),[3,217];case 173:return s=o.pop(),this.eval_op_dbviewsize(R,s),[3,217];case 174:return s=o.pop(),this.eval_op_dbviewrowidx(R,s),[3,217];case 175:return this.eval_op_projectdir(R),[3,217];case 176:return s=o.pop(),this.eval_op_MlsTrans(R,s),[3,217];case 177:return m=o.pop(),this.eval_op_StrBuild(o,R,m),[3,217];case 178:return s=o.pop(),this.eval_op_statusbar_set_text(R,s),a.resetNullResult(),[3,217];case 179:return s=o.pop(),this.eval_op_set_title(R,s),a.resetNullResult(),[3,217];case 180:return s=o.pop(),this.eval_op_is_row_editing(R,s),a.resetNullResult(),[3,217];case 181:return s=o.pop(),this.eval_op_getParam(R,s),[3,217];case 182:return _=o.pop(),s=o.pop(),this.eval_op_setParam(R,s,_),[3,217];case 183:return _=o.pop(),s=o.pop(),[4,this.eval_op_iniput(R,s,_)];case 184:return h.sent(),[3,217];case 185:return s=o.pop(),this.eval_op_iniget(R,s),[3,217];case 186:return _=o.pop(),s=o.pop(),this.eval_op_inigetln(R,s,_),[3,217];case 187:return s=o.pop(),[4,this.eval_op_expcalc(R,s)];case 188:return h.sent(),[3,217];case 189:return s=o.pop(),this.eval_op_taskType(R,s),[3,217];case 190:if(!((m=o.pop())>0))return[3,192];for(S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return[4,this.eval_op_range_add(R,S)];case 191:h.sent(),h.label=192;case 192:return[3,217];case 193:return s=o.pop(),[4,this.eval_op_range_reset(R,s)];case 194:return h.sent(),[3,217];case 195:if(!((m=o.pop())>0))return[3,197];for(S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();return[4,this.eval_op_locate_add(R,S)];case 196:h.sent(),h.label=197;case 197:return[3,217];case 198:return s=o.pop(),[4,this.eval_op_locate_reset(R,s)];case 199:return h.sent(),[3,217];case 200:return _=o.pop(),s=o.pop(),[4,this.eval_op_sort_add(R,s,_)];case 201:return h.sent(),[3,217];case 202:return s=o.pop(),[4,this.eval_op_sort_reset(R,s)];case 203:return h.sent(),[3,217];case 204:return s=o.pop(),this.eval_op_tsk_instance(R,s),[3,217];case 205:return this.eval_op_terminal(R),[3,217];case 206:return s=o.pop(),this.eval_op_formStateClear(s,R),[3,217];case 207:return _=o.pop(),s=o.pop(),this.eval_op_ClientSessionSet(s,_,R),[3,217];case 208:return _=o.pop(),s=o.pop(),this.eval_op_CndRange(R,s,_),[3,217];case 209:return s=o.pop(),[4,this.eval_op_control_select_program(s,R)];case 210:return h.sent(),[3,217];case 211:if((m=o.pop())>0){for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();this.eval_op_CallJS(this.ExpTask,o.pop().StrVal,S,R)}return[3,217];case 212:if((m=o.pop())>0){for(m--,S=new Array(m),y=0;y<m;y++)S[m-1-y]=o.pop();this.eval_op_set_cookie(o.pop().StrVal,S,R)}return[3,217];case 213:return R.Attr=r.StorageAttribute.ALPHA,R.IsNull=!1,this.eval_op_get_cookie(o.pop().StrVal,R),[3,217];case 214:return R.Attr=r.StorageAttribute.BOOLEAN,R.IsNull=!1,this.eval_op_delete_cookie(o.pop().StrVal,R),[3,217];case 215:return this.eval_op_route_get(R),[3,217];case 216:return[2];case 217:return M&&(this.ConvertExpVal(R,u),o.push(R),R.IsNull&&a.setNullResult()),[2]}}))}))},i.prototype.eval_op_ClientSessionSet=function(e,t,n){if(n.BoolVal=!1,n.Attr=r.StorageAttribute.BOOLEAN,!e.isEmptyString())if(e.StrVal===E.ENABLE_COMMUNICATION_DIALOGS)t.Attr===r.StorageAttribute.BOOLEAN?n.BoolVal=!0:r.Logger.Instance.WriteExceptionToLogWithMsg("Invalid attribute for "+E.ENABLE_COMMUNICATION_DIALOGS+" key in ClientSessionSet()");else r.Logger.Instance.WriteExceptionToLogWithMsg("Invalid Key in ClientSessionSet()")},i.prototype.execExpression=function(e,r,a){return T(this,void 0,void 0,(function(){var s,o,l,u,c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:if(l=new t.List,c=e.getOpCode(),i.isBasicItem(c))return s=this.getExpBasicValue(e,c),this.ConvertExpVal(s,a),r.push(s),s.IsNull&&e.setNullResult(),[2];if(_=fe.expDesc[c],T=!1,!(_.ArgEvalCount_>0))return[3,4];o=0,h.label=1;case 1:return o<_.ArgEvalCount_?(e.resetNullResult(),[4,this.execExpression(e,r,_.ArgAttr_[o])]):[3,4];case 2:h.sent(),e.isNull()&&(T=!0),h.label=3;case 3:return o++,[3,1];case 4:return T&&e.setNullResult(),[4,this.execOperation(c,e,r,l,a)];case 5:if(h.sent(),!((p=l.length)>0))return[3,11];o=0,h.label=6;case 6:if(!(o<p))return[3,11];switch(u=l.get_Item(0),l.RemoveAt(0),u.opCode_){case n.ExpressionInterface.EXP_OP_IGNORE:return[3,7];case n.ExpressionInterface.EXP_OP_EVALX:return[3,8]}return[3,10];case 7:for(g=void 0,g=0;g<u.argCount_;g++)e.skipOperator();return[3,10];case 8:return[4,this.execExpression(e,r,a)];case 9:return h.sent(),[3,10];case 10:return o++,[3,6];case 11:return[2]}}))}))},i.prototype.DiscardCndRangeExpression=function(e,a){return T(this,void 0,void 0,(function(){var s,i,o;return h(this,(function(l){switch(l.label){case 0:return new t.List,(i=e.getOpCode())!==n.ExpressionInterface.EXP_OP_CND_RANGE?[2,!1]:(o=fe.expDesc[i],[4,this.execExpression(e,a,o.ArgAttr_[0])]);case 1:return l.sent(),[2,(s=a.pop()).Attr===r.StorageAttribute.BOOLEAN&&!s.BoolVal]}}))}))},i.val_cmp_any=function(e,a,s){var o=0,l=e.Attr,u=a.Attr,c=new i;if(e.IsNull&&a.IsNull)return 0;if(e.IsNull||a.IsNull)throw new _t(l);if(r.StorageAttributeCheck.isTypeBlob(l)&&(e.IncludeBlobPrefix&&n.BlobType.getContentType(e.StrVal)===n.BlobType.CONTENT_TYPE_BINARY?(e.StrVal=n.BlobType.removeBlobPrefix(e.StrVal),e.Attr=r.StorageAttribute.ALPHA,e.IncludeBlobPrefix=!1):c.ConvertExpVal(e,r.StorageAttribute.UNICODE)),r.StorageAttributeCheck.isTypeBlob(u)&&(a.IncludeBlobPrefix&&n.BlobType.getContentType(a.StrVal)===n.BlobType.CONTENT_TYPE_BINARY?(a.StrVal=n.BlobType.removeBlobPrefix(a.StrVal),a.Attr=r.StorageAttribute.ALPHA,a.IncludeBlobPrefix=!1):c.ConvertExpVal(a,r.StorageAttribute.UNICODE)),(l=e.Attr)!==(u=a.Attr)&&!(r.StorageAttributeCheck.isTypeNumeric(l)&&r.StorageAttributeCheck.isTypeNumeric(u)||r.StorageAttributeCheck.IsTypeAlphaOrUnicode(l)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(u)))return 1;switch(l){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.UNICODE:if(null===e.StrVal&&null===a.StrVal)return 0;if(null===e.StrVal||null===a.StrVal)throw new _t(l);var _=r.StrUtil.rtrim(e.StrVal),T=r.StrUtil.rtrim(a.StrVal);o=et.Instance.getSpecialAnsiExpression()||r.UtilStrByteMode.isLocaleDefLangDBCS()&&l===r.StorageAttribute.ALPHA&&u===r.StorageAttribute.ALPHA?r.UtilStrByteMode.strcmp(_,T):t.NString.CompareOrdinal(_,T);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(null===e.MgNumVal&&null===a.MgNumVal)return 0;if(null===e.MgNumVal||null===a.MgNumVal)throw new _t(l);o=n.NUM_TYPE.num_cmp(e.MgNumVal,a.MgNumVal);break;case r.StorageAttribute.BOOLEAN:o=(e.BoolVal?1:0)-(a.BoolVal?1:0)}return o},i.eval=function(e,n,a){return T(this,void 0,void 0,(function(){var s,o,l,u;return h(this,(function(c){switch(c.label){case 0:return s=null,o=new t.Stack,null!==e&&e.length>0?(l=new i,u=new Tt(e,a.getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY),l.ExpTask=a,[4,l.execExpression(u,o,n)]):[3,2];case 1:c.sent(),s=o.pop(),u.isNull()&&(s.IsNull=!0),c.label=2;case 2:return[2,s]}}))}))},i.DiscardCndRangeResult=function(e,n){return T(this,void 0,void 0,(function(){var a,s,o;return h(this,(function(l){switch(l.label){case 0:return a=new t.Stack,null!==e&&e.length>0?(s=new i,o=new Tt(e,n.getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY),s.ExpTask=n,[4,s.DiscardCndRangeExpression(o,a)]):[3,2];case 1:return[2,l.sent()];case 2:return[2,!1]}}))}))},i.set_a_pic=function(e){var t=Math.min(e.length,99);return r.StrUtil.ZstringMake(e,t)},i.prototype.eval_op_range=function(e,t,n,a){a.BoolVal=!1,a.Attr=r.StorageAttribute.BOOLEAN;try{i.val_cmp_any(e,t,!0)>=0&&(t=n,i.val_cmp_any(e,t,!0)<=0&&(a.BoolVal=!0))}catch(e){if(!(e instanceof _t))throw e;s.prototype.SetNULL.call(this,a,e.getAttr())}},i.prototype.eval_op_rep_1=function(e,t,n,a,o){if(null!==t.StrVal&&null!==n.StrVal&&null!==a.MgNumVal&&null!==o.MgNumVal){i.val_s_cpy(t,e);var l=a.MgNumVal.NUM_2_LONG();l<1&&(l=1);var u=o.MgNumVal.NUM_2_LONG();if(u>n.StrVal.length&&(u=n.StrVal.length),l+u-1>e.StrVal.length&&(u=e.StrVal.length-l+1),!(u<=0)){var c=r.StrUtil.memcpy("",0,e.StrVal,l+u-1,e.StrVal.length-l-u+1);e.StrVal=r.StrUtil.memcpy(e.StrVal,l-1,n.StrVal,0,u),e.StrVal=r.StrUtil.memcpy(e.StrVal,l-1+u,c,0,e.StrVal.length-l-u+1),u-n.StrVal.length>0&&(e.StrVal=r.StrUtil.memset(e.StrVal,l+n.StrVal.length-1," ",u-n.StrVal.length))}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.val_s_cpy=function(e,t){t.Attr=e.Attr,t.StrVal=e.StrVal,t.IsNull=e.IsNull,t.IncludeBlobPrefix=e.IncludeBlobPrefix},i.prototype.val_cpy=function(e,t){switch(e.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:i.val_s_cpy(e,t);break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:e.IsNull||(t.MgNumVal=new n.NUM_TYPE(e.MgNumVal));break;case r.StorageAttribute.BOOLEAN:t.BoolVal=e.BoolVal;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("Expression Evaluator.val_cpy no such type of attribute : "+e.Attr)}t.Attr=e.Attr,t.IsNull=e.IsNull},i.prototype.eval_op_ins=function(e,t,n,a,i){if(e.Attr=r.StorageAttribute.UNICODE,null!==t.StrVal&&null!==n.StrVal&&null!==a.MgNumVal&&null!==i.MgNumVal){var o=t.StrVal.length,l=a.MgNumVal.NUM_2_LONG()-1;l=Math.max(l,0),l=Math.min(l,o);var u=i.MgNumVal.NUM_2_LONG();u=Math.max(u,0),u=Math.min(u,n.StrVal.length),e.StrVal=r.StrUtil.memcpy("",0,t.StrVal,0,l),e.StrVal=r.StrUtil.memcpy(e.StrVal,l,n.StrVal,0,u),e.StrVal=r.StrUtil.memcpy(e.StrVal,l+u,t.StrVal,l,o-l)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_del=function(e,t,n,a){if(null!==t.StrVal&&null!==n.MgNumVal&&null!==a.MgNumVal){i.val_s_cpy(t,e);var o=n.MgNumVal.NUM_2_LONG()-1;o<0&&(o=0),o>e.StrVal.length&&(o=e.StrVal.length);var l=a.MgNumVal.NUM_2_LONG();o+l>e.StrVal.length&&(l=e.StrVal.length-o),l<=0||(e.StrVal=r.StrUtil.memcpy(e.StrVal,o,e.StrVal,o+l,e.StrVal.length-o))}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_flip=function(e,n){if(e.Attr=r.StorageAttribute.UNICODE,null!==n.StrVal){var a=new t.StringBuilder(n.StrVal);e.StrVal=r.StrUtil.ReverseString(a).ToString()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_upper=function(e,t){e.Attr=r.StorageAttribute.UNICODE,null!==t.StrVal?e.StrVal=t.StrVal.toUpperCase():s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_lower=function(e,t){e.Attr=r.StorageAttribute.UNICODE,null!=t.StrVal?e.StrVal=t.StrVal.toLowerCase():s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_crc=function(e,t,n){if(e.Attr=r.StorageAttribute.ALPHA,null!=t.StrVal&&null!=n.MgNumVal){var a=0;if(0===n.MgNumVal.NUM_2_LONG())a=i.eval_crc_16(t.StrVal);var o=String.fromCharCode(a%256),l=String.fromCharCode(a/256);e.StrVal=""+o+l}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.eval_crc_16=function(e){for(var t=[40961,61441,55297,52225,50689,49921,49537,49345],r=0,n=e.length,a=0;n>0;n--){var s=e.charCodeAt(r++);s^=i.LO_CHAR(a),a=i.LO_CHAR(i.MK_SHRT(0,i.HI_CHAR(a)));var o=void 0,l=void 0;for(l=0,o=i.LO_CHAR(128);l<8;l++,o=i.LO_CHAR(o)>>1)0!==i.LO_CHAR(s&i.LO_CHAR(o))&&(a^=t[l])}return a},i.LO_CHAR=function(e){return 255&e},i.HI_CHAR=function(e){return(65280&e)>>8},i.MK_SHRT=function(e,t){return e<<8|t},i.MK_LONG=function(e,t,r,n){return e<<24|t<<16|r<<8|n},i.prototype.eval_op_chkdgt=function(e,n,a){var i,o,l,u,c=[String.fromCharCode(1),String.fromCharCode(2),String.fromCharCode(5),String.fromCharCode(3),String.fromCharCode(6),String.fromCharCode(4),String.fromCharCode(8),String.fromCharCode(7),String.fromCharCode(10),String.fromCharCode(9)];if(null!==n.StrVal&&null!==a.MgNumVal){var _=0;switch(a.MgNumVal.NUM_2_LONG()){case 0:for(o=2,i=n.StrVal.length;i>=1;i--)l=n.StrVal.substr(i-1),_+=(u=this.a_2_long(l,1)*o)+(u>9?1:0),o=3-o;0!==(_%=10)&&(_=10-_);break;case 1:for(i=n.StrVal.length;i>=1;i--){o=c[(n.StrVal.length-i)%10].charCodeAt(0);var T=n.StrVal[i-1].toUpperCase();l=n.StrVal.substr(i-1),_+=u=r.UtilStrByteMode.isDigit(T)?this.a_2_long(l,1)*o:t.NChar.IsUpper(l[0])?(l[0].charCodeAt(0)-"A".charCodeAt(0)+1)*o:0}0!==(_%=11)&&(_=11-_)}s.prototype.ConstructMagicNum.call(this,e,_,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.a_2_long=function(e,t){for(var n=0,a=0;a<t;a+=1)r.UtilStrByteMode.isDigit(e.charAt(a))&&(n*=10,n+=e.charCodeAt(a)-"0".charCodeAt(0));return n},i.prototype.eval_op_soundx=function(e,t){var n=["0","1","2","3","0","1","2","0","0","2","2","4","5","5","0","1","2","6","2","3","0","1","0","2","0","2"];if(null!==t.StrVal){e.Attr=r.StorageAttribute.ALPHA,e.StrVal="0000";for(var a=" ",o=0,l=0;l<t.StrVal.length;l++){var u=t.StrVal.charAt(l).toUpperCase(),c=n[u.charCodeAt(0)-"A".charCodeAt(0)];if(0===l)e.StrVal=i.setAt(e.StrVal,o++,u);else if(c>"0"&&c!==a&&(e.StrVal=i.setAt(e.StrVal,o++,c),o>3))break;a=c}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.setAt=function(e,r,n){var a=new t.StringBuilder(e);return r<e.length?a.set_Item(r,n):a.Append(n),a.ToString()},i.prototype.eval_op_hstr=function(e,a){var o,l,u=new n.NUM_TYPE,c=new Array(30),_=new t.StringBuilder(c.length),T=!1;if(e.Attr=r.StorageAttribute.ALPHA,null!=a.MgNumVal){u.num_4_a_std("16");var h=new n.NUM_TYPE(a.MgNumVal);h.num_is_neg()&&(T=!0,h.num_abs());for(var p=0;o=n.NUM_TYPE.mod(h,u),(h=n.NUM_TYPE.div(h,u)).num_trunc(0),l=o.NUM_2_LONG(),p++,i.int_2_hex(c,c.length-p,1,l,0),!h.num_is_zero(););for(T&&(p++,c[c.length-p]="-"),l=c.length-p;l<c.length;l++)_.Append(c[l]);e.StrVal=_.ToString()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.int_2_hex=function(e,t,r,n,a){var s=r;do{var o=n%16;e[--s+t]=o<10?String.fromCharCode("0".charCodeAt(0)+o):String.fromCharCode("A".charCodeAt(0)+o-10),n=Math.floor(n/16)}while(s>0&&0!==n);i.lib_a_fill(e,r,s+t,a)},i.lib_a_fill=function(e,t,n,a){0===a?(t-=n)>0&&n>0&&(r.StrUtil.memcpy(e,0,e,n,t),r.StrUtil.memset(e,t," ",n)):n>0&&r.StrUtil.memset(e,0,String.fromCharCode(a),n)},i.prototype.eval_op_hval=function(e,t){var a,i=new n.NUM_TYPE,o=new n.NUM_TYPE,l=0,u=!1;if(null!==t.StrVal){for(i.num_4_a_std("16"),e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_ZERO(),a=0;a<t.StrVal.length;a++){var c=t.StrVal[a];"-"===c&&0===l&&(u=!0);var _=this.hex_2_long(t.StrVal,a,1);0===_&&"0"!==c||(l=1,e.MgNumVal=n.NUM_TYPE.mul(e.MgNumVal,i),o.NUM_4_LONG(_),e.MgNumVal=n.NUM_TYPE.add(e.MgNumVal,o))}u&&e.MgNumVal.num_neg(),e.Attr=r.StorageAttribute.NUMERIC}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.hex_2_long=function(e,t,n){var a,s=0;for(a=t;a<t+n;a++){var i=e.charAt(a).toUpperCase();r.UtilStrByteMode.isDigit(i)?(s*=16,s+=i.charCodeAt(0)-"0".charCodeAt(0)):i>="A"&&i<="F"&&(s*=16,s+=i.charCodeAt(0)-"A".charCodeAt(0)+10)}return s},i.prototype.eval_op_chr=function(e,t){e.Attr=r.StorageAttribute.ALPHA,null!==t.MgNumVal?e.StrVal=String.fromCharCode(t.MgNumVal.NUM_2_LONG())[0]:s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_asc=function(e,n){if(null!==n.StrVal){var a=n.StrVal.length>0?t.Encoding.ASCII.GetBytes(n.StrVal)[0]:0;this.ConstructMagicNum(e,a,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_mstr=function(e,t,a){if(e.Attr=r.StorageAttribute.ALPHA,null!=t.MgNumVal||null!=a.MgNumVal){var i=new n.NUM_TYPE(t.MgNumVal);i.NUM_IS_LONG()&&i.num_4_std_long();var o=a.MgNumVal.NUM_2_LONG();o=Math.max(o,2);for(var l=new Int8Array(o),u=0;u<o;u++)l[u]=i.Data[u];var c=r.Misc.ToByteArray(l);e.StrVal=et.Instance.GetEncoding().GetString(c,0,c.length)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_mval=function(e,t){if(e.Attr=r.StorageAttribute.NUMERIC,null!=t.StrVal){e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_SET_ZERO();var a=Math.min(t.StrVal.length,n.NUM_TYPE.NUM_SIZE);e.MgNumVal=new n.NUM_TYPE(r.Misc.ToSByteArray(et.Instance.GetEncoding().GetBytes(t.StrVal)),0,a)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_dstr=function(e,t,n,a){e.Attr=r.StorageAttribute.UNICODE,null!=t.MgNumVal&&null!=n.StrVal?e.StrVal=a.to_a(e.StrVal,100,t.MgNumVal.NUM_2_ULONG(),n.StrVal,this.ExpTask.getCompIdx()):s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_tstr=function(e,t,n,a,i){e.Attr=r.StorageAttribute.ALPHA,null!=t.MgNumVal&&null!=n.StrVal?e.StrVal=a.time_2_a(e.StrVal,100,t.MgNumVal.NUM_2_ULONG(),n.StrVal,this.ExpTask.getCompIdx(),i):s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_dval=function(e,a,i,o){if(null!==a.StrVal&&null!==i.StrVal){if(a.Attr===r.StorageAttribute.UNICODE)if(a.StrVal.length+2<=n.NUM_TYPE.NUM_SIZE);else{for(var l=new Array(a.StrVal.length+2),u=0;u<l.length;++u)l[u]="\0";r.StrUtil.memcpy(l,0,t.NString.ToCharArray(a.StrVal),0,a.StrVal.length)}var c=o.a_2_date(a.StrVal,i.StrVal,this.ExpTask.getCompIdx());c>=1e9&&(c=0),s.prototype.ConstructMagicNum.call(this,e,c,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_tval=function(e,t,a,i,o){if(null!==t.StrVal&&null!==a.StrVal){var l=new n.PIC(a.StrVal,r.StorageAttribute.TIME,this.ExpTask.getCompIdx()),u=i.a_2_time(t.StrVal,l,o);u>=1e9&&(u=0),s.prototype.ConstructMagicNum.call(this,e,u,r.StorageAttribute.TIME)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.TIME)},i.prototype.eval_op_day=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,0)},i.prototype.eval_op_month=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,1)},i.prototype.eval_op_year=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,2)},i.prototype.eval_op_dow=function(e,t){this.eval_op_date_brk(e,t.MgNumVal,3)},i.prototype.eval_op_second=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,2)},i.prototype.eval_op_minute=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,1)},i.prototype.eval_op_hour=function(e,t){this.eval_op_time_brk(e,t.MgNumVal,0)},i.prototype.eval_op_date_brk=function(e,t,a){if(null!==t){var i=t.NUM_2_LONG(),o=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(o,i,!1,this.ExpTask.getCompIdx());var l=o.year,u=o.month,c=o.day,_=o.doy,T=o.dow;switch(a){case 0:i=c;break;case 1:i=u;break;case 2:i=l;break;case 3:i=T;break;case 4:i=r.UtilDateJpn.getInstance().date_jpn_year_ofs(l,_);break;default:i=0}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_time_brk=function(e,t,a){if(null!==t){var i=t.NUM_2_ULONG(),o=n.DisplayConvertor.Instance.getNewTimeBreakParams();n.DisplayConvertor.time_break(o,i);var l=o.hour,u=o.minute,c=o.second;switch(a){case 0:i=l;break;case 1:i=u;break;case 2:i=c;break;default:i=0}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_addDateTime=function(e,t,a,i,o,l,u,c,_){var p=Object.create(null,{SetVal:{get:function(){return s.prototype.SetVal}}});return T(this,void 0,void 0,(function(){var s,T,g,d,E;return h(this,(function(h){switch(h.label){case 0:return s=new n.ExpVal,null===t.MgNumVal||null===a.MgNumVal?(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,[2]):(T=this.GetFieldOfContextTask(a.MgNumVal.NUM_2_LONG()),p.SetVal.call(this,s,T.getType(),T.getValue(!0),null),this.eval_op_addtime(e,s,u,c,_),g=e.MgNumVal.NUM_2_LONG(),d=Math.floor(g/86400),(g%=86400)<0&&(d--,g=86400- -g),E=this.GetFieldOfContextTask(t.MgNumVal.NUM_2_LONG()),p.SetVal.call(this,s,E.getType(),E.getValue(!0),null),this.eval_op_adddate(e,s,i,o,l),d+=e.MgNumVal.NUM_2_LONG(),s.MgNumVal.NUM_4_LONG(g),[4,T.setValueAndStartRecompute(s.ToMgVal(),!1,!0,!1,!1)]);case 1:return h.sent(),[4,T.updateDisplay()];case 2:return h.sent(),s.MgNumVal.NUM_4_LONG(d),[4,E.setValueAndStartRecompute(s.ToMgVal(),!1,!0,!1,!1)];case 3:return h.sent(),[4,E.updateDisplay()];case 4:return h.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_difdt=function(e,t,a,s,i,o,l){return T(this,void 0,void 0,(function(){var u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return(u=new n.ExpVal).MgNumVal=new n.NUM_TYPE,u.Attr=r.StorageAttribute.NUMERIC,u,null===o.MgNumVal||null===l.MgNumVal?(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,[2]):(c=t.MgNumVal.NUM_2_LONG()-s.MgNumVal.NUM_2_LONG(),(_=a.MgNumVal.NUM_2_LONG()-i.MgNumVal.NUM_2_LONG())<0&&_>-86400&&c>0&&(c--,_=86400- -_),T=this.GetFieldOfContextTask(o.MgNumVal.NUM_2_LONG()),p=this.GetFieldOfContextTask(l.MgNumVal.NUM_2_LONG()),u.MgNumVal.NUM_4_LONG(c),[4,T.setValueAndStartRecompute(u.ToMgVal(),!1,!0,!1,!1)]);case 1:return h.sent(),[4,T.updateDisplay()];case 2:return h.sent(),u.MgNumVal.NUM_4_LONG(_),[4,p.setValueAndStartRecompute(u.ToMgVal(),!1,!0,!1,!1)];case 3:return h.sent(),[4,p.updateDisplay()];case 4:return h.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_ndow=function(e,t,n){null!==t.MgNumVal?(t.MgNumVal=this.mul_add(t.MgNumVal,0,6),this.eval_op_cdow(e,t.MgNumVal,n)):s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_nmonth=function(e,t,n){null!=t.MgNumVal?(t.MgNumVal=this.mul_add(t.MgNumVal,31,-30),this.eval_op_cmonth(e,t.MgNumVal,n)):s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.mul_add=function(e,t,r){var a=new n.NUM_TYPE;return null===e?null:(0!==t&&(a.NUM_4_LONG(t),e=n.NUM_TYPE.mul(e,a)),0!==r&&(a.NUM_4_LONG(r),e=n.NUM_TYPE.add(e,a)),e)},i.prototype.eval_op_cdow=function(e,t,r){this.eval_op_date_str(e,t,"WWWWWWWWWWT",r)},i.prototype.eval_op_cmonth=function(e,t,r){this.eval_op_date_str(e,t,"MMMMMMMMMMT",r)},i.prototype.eval_op_date_str=function(e,t,n,a){if(e.Attr=r.StorageAttribute.ALPHA,null!==t){var i=t.NUM_2_ULONG();e.StrVal=a.to_a(e.StrVal,10,i,n,this.ExpTask.getCompIdx())}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_delay=function(e){},i.prototype.eval_op_idle=function(e){var t=0,a=et.Instance.getIdleTime(this.ExpTask.getCompIdx());if(a>0){var s=r.Misc.getSystemMilliseconds();t=Math.floor(Math.floor((s-G.Instance.LastActionTime)/1e3)/a)}e.MgNumVal=new n.NUM_TYPE,e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal.NUM_4_LONG(t*a*10)},i.prototype.eval_op_adddate=function(e,t,a,i,o){var l;if(null!==t.MgNumVal&&null!==a.MgNumVal&&null!==i.MgNumVal&&null!==o.MgNumVal){var u=t.MgNumVal.NUM_2_LONG(),c=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(c,u,!1,this.ExpTask.getCompIdx());var _=c.year,T=c.month,h=c.day;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(_=Math.max(_-r.PICInterface.DATE_BUDDHIST_GAP,0)),_+=a.MgNumVal.NUM_2_LONG(),T+=i.MgNumVal.NUM_2_LONG();var p=o.MgNumVal.NUM_2_LONG(),g=0===h&&0!==_&&0!==T&&0!==p?1:0,d=T+12*_;for(_=Math.floor((d-1)/12),T=(d-1)%12+1,l=0;l<4&&!((u=n.DisplayConvertor.Instance.date_4_calender(_,T,h+g,0,!1))<1e9);l++)h--;1e9===u?u=0:(u+=p-g,u=Math.max(u,0)),s.prototype.ConstructMagicNum.call(this,e,u,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_addtime=function(e,t,n,a,i){if(null!==t.MgNumVal&&null!==n.MgNumVal&&null!==a.MgNumVal&&null!==i.MgNumVal){var o=t.MgNumVal.NUM_2_ULONG()+3600*n.MgNumVal.NUM_2_LONG()+60*a.MgNumVal.NUM_2_LONG()+i.MgNumVal.NUM_2_LONG();s.prototype.ConstructMagicNum.call(this,e,o,r.StorageAttribute.TIME)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.TIME)},i.prototype.eval_op_bom=function(e,t){var a;if(null!=t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i)a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx()),i-=a.day-1;s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_boy=function(e,t){var a;if(null!==t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i){a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx());var o=a.year;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0)),i=n.DisplayConvertor.Instance.date_4_calender(o,1,1,0,!1)}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_eom=function(e,t){var a;if(null!==t.MgNumVal){var i=t.MgNumVal.NUM_2_ULONG();if(0!==i){a=n.DisplayConvertor.Instance.getNewDateBreakParams(),n.DisplayConvertor.Instance.date_break_datemode(a,i,!1,this.ExpTask.getCompIdx());var o=a.year,l=a.month,u=31;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0));var c=void 0;for(c=0;c<4&&!((i=n.DisplayConvertor.Instance.date_4_calender(o,l,u,0,!1))<1e9);c++)u--}s.prototype.ConstructMagicNum.call(this,e,i,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_eoy=function(e,t){if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_ULONG();if(0!==a){var i=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(i,a,!1,this.ExpTask.getCompIdx());var o=i.year;"B"===et.Instance.GetDateMode(this.ExpTask.getCompIdx())&&(o=Math.max(o-r.PICInterface.DATE_BUDDHIST_GAP,0)),a=n.DisplayConvertor.Instance.date_4_calender(o,12,31,0,!1)}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.DATE)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.DATE)},i.prototype.eval_op_strtok=function(e,n,a,i){var o,l,u,c,_="";if(null!==n.StrVal&&null!==a.MgNumVal&&null!==i.StrVal||s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE),!t.NString.IsNullOrEmpty(n.StrVal)&&i.StrVal.length>0&&(o=new t.StringBuilder(n.StrVal.length+2),(u=a.MgNumVal.NUM_2_LONG())>0))if(c=t.NString.TrimEnd(i.StrVal,this._charsToTrim),o.Append(n.StrVal),0===c.length)1===u&&(_=o.ToString());else{l=o.ToString();var T=void 0;for(T=0;T<u;T++){if(null===(_=r.StrUtil.strstr(l,c))){T===u-1&&(_=l);break}_=l.substr(0,l.length-_.length),l=l.substr(_.length+c.length)}}null!==_?(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=_):(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=""),u=a.MgNumVal.NUM_2_LONG(),t.NString.IsNullOrEmpty(n.StrVal)||0!==i.StrVal.length||1!==u||(e.Attr=r.StorageAttribute.UNICODE,e.StrVal=n.StrVal)},i.prototype.eval_op_dbround=function(e,t,a){if(null!==t.MgNumVal&&null!==a.MgNumVal){e.MgNumVal=new n.NUM_TYPE(t.MgNumVal);var i=a.MgNumVal.NUM_2_LONG();i<0?e.MgNumVal.dbRound(-i):e.MgNumVal.round(i),e.Attr=r.StorageAttribute.NUMERIC}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varpic=function(e,n,a){var i,o;if(null!==a.MgNumVal)if(null!==n.MgNumVal){var l=a.MgNumVal.NUM_2_LONG(),u=n.MgNumVal.NUM_2_LONG();e.Attr=r.StorageAttribute.UNICODE;try{i=this.GetFieldOfContextTask(u)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),i=null}if(null===i)return r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.eval_op_varpic there is no control number "+u),void(e.StrVal="");0===l||null===(o=i.getCtrl())?i.getType()===r.StorageAttribute.BLOB||i.getType()===r.StorageAttribute.BLOB_VECTOR?e.StrVal="":e.StrVal=i.getPicture():e.StrVal=o.getPIC().getFormat()}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE);else s.prototype.SetNULL.call(this,e,r.StorageAttribute.UNICODE)},i.prototype.eval_op_varattr=function(e,n){var a;if(e.Attr=r.StorageAttribute.ALPHA,null!==n.MgNumVal){var o=n.MgNumVal.NUM_2_LONG();try{a=this.GetFieldOfContextTask(o)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),a=null}if(null===a)return r.Logger.Instance.WriteExceptionToLogWithMsg("ExpressionEvaluator.eval_op_varattr there is no control number "+o),void(e.StrVal="");var l=a.getType();e.StrVal=""+i.GetAttributeChar(l)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.exp_null_val_get=function(e,a,s){var i="",o=0;if(s.IsNull=!0,a===n.ExpressionInterface.EXP_OP_NULL)switch(s.Attr=e,e===r.StorageAttribute.ALPHA&&(i=""),e){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:case r.StorageAttribute.MEMO:a=n.ExpressionInterface.EXP_OP_NULL_A;break;case r.StorageAttribute.NUMERIC:a=n.ExpressionInterface.EXP_OP_NULL_N;break;case r.StorageAttribute.BOOLEAN:a=n.ExpressionInterface.EXP_OP_NULL_B;break;case r.StorageAttribute.DATE:a=n.ExpressionInterface.EXP_OP_NULL_D;break;case r.StorageAttribute.TIME:a=n.ExpressionInterface.EXP_OP_NULL_T;break;case r.StorageAttribute.UNICODE:a=n.ExpressionInterface.EXP_OP_NULL_U}switch(a){case n.ExpressionInterface.EXP_OP_NULL:case n.ExpressionInterface.EXP_OP_NULL_A:e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR&&(s.Attr=r.StorageAttribute.ALPHA),i="";break;case n.ExpressionInterface.EXP_OP_NULL_N:s.Attr=r.StorageAttribute.NUMERIC;break;case n.ExpressionInterface.EXP_OP_NULL_B:s.Attr=r.StorageAttribute.BOOLEAN,o=0;break;case n.ExpressionInterface.EXP_OP_NULL_D:s.Attr=r.StorageAttribute.DATE,o=t.NNumber.Parse(r.PICInterface.DEFAULT_DATE);break;case n.ExpressionInterface.EXP_OP_NULL_T:s.Attr=r.StorageAttribute.TIME,o=t.NNumber.Parse(r.PICInterface.DEFAULT_TIME);break;case n.ExpressionInterface.EXP_OP_NULL_U:e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR&&(s.Attr=r.StorageAttribute.UNICODE),i="";break;case n.ExpressionInterface.EXP_OP_NULL_O:s.Attr=r.StorageAttribute.BLOB}switch(s.Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:s.StrVal=i;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(a===n.ExpressionInterface.EXP_OP_NULL_N){for(var l=new Int8Array(n.NUM_TYPE.NUM_SIZE),u=0;u<l.length;u++)l[u]=0;s.MgNumVal=new n.NUM_TYPE(l)}else this.ConstructMagicNum(s,o,s.Attr);break;case r.StorageAttribute.UNICODE:s.StrVal=i;break;case r.StorageAttribute.BOOLEAN:s.BoolVal=!1}},i.prototype.exp_get_var=function(e,t,r){a.isNullOrUndefined(r)?this.exp_get_var_1(e,t):this.exp_get_var_0(e,t,r)},i.prototype.exp_get_var_0=function(e,n,a){var i=null;if(null!==n.MgNumVal){var o=n.MgNumVal.NUM_2_LONG();i=this.GetFieldOfContextTask(o)}if(null!==i){if(!1===i.IsExposedToClient){var l=new t.StringBuilder;return l.Append(t.NString.Format("Error: Variable '{0}' is not exposed to client.",i.getVarName())),alert(l.ToString()),void(e.IsNull=!0)}a&&i.getTask().setEvalOldValues(!0),s.prototype.SetVal.call(this,e,i.getType(),i.getValue(!0),null),a?i.isOriginalValueNull()&&s.prototype.SetNULL.call(this,e,r.StorageAttribute.NONE):e.IsNull=i.isNull(),a&&i.getTask().setEvalOldValues(!1)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NONE)},i.prototype.eval_op_varmod=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n);if(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1,null!==a){var i=a.getId(),o=a.getTask().DataView,l=o.getCurrRec();e.BoolVal=!l.fldValsEqual(o.getOriginalRec(),i)}}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN)},i.prototype.eval_op_varinp=function(e,t){var n=0;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&(n=o.ctl_itm_4_parent_vee(0,o.getCurrFieldIdx()+1))}s.prototype.ConstructMagicNum.call(this,e,n,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varname=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n),i=null!==a?a.getName():"";e.StrVal=i,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_VarDisplayName=function(e,t){if(e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG(),a=this.GetFieldOfContextTask(n);null!==a&&(e.StrVal=a.VarDisplayName)}},i.prototype.eval_op_VarControlID=function(e,t){var a=0;if(null!==t.MgNumVal){var s=t.MgNumVal.NUM_2_LONG();s===i.TRIGGER_TASK&&(s=this.ExpTask.GetContextTask().ctl_itm_4_parent_vee(0,this.ExpTask.GetContextTask().getCurrFieldIdx()+1)),a=this.ExpTask.GetContextTask().GetControlIDFromVarItem(s-1)}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_ControlItemsList=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null===n.MgNumVal?[3,2]:(a=n.MgNumVal.NUM_2_LONG(),s=0,i=new t.RefParam(s),o=this.ExpTask.GetContextTask().GetControlFromControlID(a-1,i),s=i.value,null!==o&&o.isChoiceControl()?(l=e,[4,o.getForm().GetChoiceControlItemList(o)]):[3,2]);case 1:l.StrVal=u.sent(),u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_ControlDisplayList=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",null===n.MgNumVal?[3,2]:(a=n.MgNumVal.NUM_2_LONG(),s=0,i=new t.RefParam(s),o=this.ExpTask.GetContextTask().GetControlFromControlID(a-1,i),s=i.value,null!==o&&o.isChoiceControl()?(l=e,[4,o.getForm().GetChoiceControlDisplayList(o)]):[3,2]);case 1:l.StrVal=u.sent(),u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_viewmod=function(e,t){if(null!==t.MgNumVal){var n=t.MgNumVal.NUM_2_LONG();if(n>=0&&n<this.ExpTask.getTaskDepth(!1)||n===i.TRIGGER_TASK){var a=s.prototype.GetContextTask.call(this,n);if(a.isMainProg())e.BoolVal=!1;else if(e.BoolVal=a.DataView.getCurrRec().Modified,!e.BoolVal){var o=a.DataView.getCurrRec(),l=a.DataView.getOriginalRec();e.BoolVal=!o.isSameRecData(l,!0,!0)}}else e.BoolVal=!1;e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN)},i.prototype.eval_op_level=function(e,t){var n="";if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);if(n=o.getBrkLevel(),a!==i.TRIGGER_TASK&&o!==this.ExpTask&&n.toUpperCase()===E.BRK_LEVEL_REC_MAIN.toUpperCase())if(o.isMainProg())n=E.BRK_LEVEL_MAIN_PROG;else{for(var l=new Array(this.ExpTask.getTaskDepth(!1)),u=0;u<l.length;++u)l[u]=null;this.ExpTask.pathToRoot(l,!1),a>0&&l[a-1].IsSubForm&&(n=E.BRK_LEVEL_SUBFORM)}}e.StrVal=n,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_counter=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);a=null===l?0:l.getCounter()}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_emptyDataview=function(e,t){var n=!1,a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&o.DataView.isEmptyDataview()&&(n=!0)}e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=n},i.prototype.eval_op_mainlevel=function(e,t){var n="";if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK)n=s.prototype.GetContextTask.call(this,a).getMainLevel();e.StrVal=n,e.Attr=r.StorageAttribute.ALPHA}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_maindisplay=function(e,t){var a=0;if(null!==t.MgNumVal){var o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK)a=s.prototype.GetContextTask.call(this,o).getProp(n.PropInterface.PROP_TYPE_MAIN_DISPLAY).GetComputedValueInteger();s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_IsFirstRecordCycle=function(e,t){var n=!1;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK)n=s.prototype.GetContextTask.call(this,a).isFirstRecordCycle();e.BoolVal=n,e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.exp_is_default=function(e,t){e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!1;var n=t.MgNumVal.NUM_2_LONG(),a=this.ExpTask.ctl_itm_2_parent_vee(n-1);if(null!==a){a.isNull()&&(a.isNullDefault()||a.getType()===r.StorageAttribute.BLOB_VECTOR)&&(e.BoolVal=!0);var s=a.getValue(!1),o=a.getDefaultValue(),l=a.getType();e.BoolVal=i.mgValsEqual(s,a.isNull(),l,o,a.isNullDefault(),l)}},i.prototype.eval_op_IsLoggedIn=function(e){e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=at.Instance.getIsLoggedIn()},i.prototype.eval_op_appname=function(e){e.Attr=r.StorageAttribute.ALPHA,e.StrVal=ne.Instance.getAppName()},i.prototype.eval_op_prog=function(e){e.Attr=r.StorageAttribute.ALPHA,e.StrVal=this.ExpTask.queryTaskPath().ToString()},i.prototype.eval_op_this=function(e){var t=0;null!==this.ExpTask&&(t=i.TRIGGER_TASK),s.prototype.ConstructMagicNum.call(this,e,t,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_stat=function(e,t,n){var a=!1,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);if(null!==l)for(var u=l.getMode().toUpperCase(),c=0;c<n.StrVal.length;c+=1){var _=n.StrVal.charAt(c).toUpperCase(),T=this.cst_code_trans_buf("I","MCDEPLRKSONB",_,r.MsgInterface.EXPTAB_TSK_MODE_RT);if("\0"===T&&"Q"===(T=_.toUpperCase())&&(T="E"),T===u){a=!0;break}}}e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=a},i.prototype.eval_op_subformExecMode=function(t,n){var a=e.Task_SubformExecModeEnum.NO_SUBFORM,o=n.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.IsSubForm&&(a=l.SubformExecMode)}s.prototype.ConstructMagicNum.call(this,t,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_varset=function(e,t,a){var i=Object.create(null,{SetNULL:{get:function(){return s.prototype.SetNULL}}});return T(this,void 0,void 0,(function(){var s,o,l,u;return h(this,(function(c){switch(c.label){case 0:if(e.BoolVal=!0,e.Attr=r.StorageAttribute.BOOLEAN,null===a.MgNumVal)return[2];if(s=a.MgNumVal.NUM_2_LONG(),null===(o=this.GetFieldOfContextTask(s)))return e.BoolVal=!1,[2];if(r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(o.getType(),t.Attr)&&this.ConvertExpVal(t,o.getType()),r.StorageAttributeCheck.isTheSameType(o.getType(),t.Attr))switch(o.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:l=t.StrVal;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:l=t.MgNumVal.toXMLrecord();break;case r.StorageAttribute.BOOLEAN:l=t.BoolVal?"1":"0";break;case r.StorageAttribute.BLOB:l=t.ToMgVal();break;case r.StorageAttribute.BLOB_VECTOR:if(l=t.ToMgVal(),!t.IsNull&&(t.Attr===r.StorageAttribute.BLOB&&(n.VectorType.validateBlobContents(t.StrVal)||(l=null)),null!=l&&(l=it.operUpdateVectors(o,l)),null!=l))break;default:return i.SetNULL.call(this,e,r.StorageAttribute.BOOLEAN),[2]}else l=o.getDefaultValue();return t.IsNull&&null===(l=o.getNullValue())&&o.getMagicDefaultValue(),u=o.getTask()!==this.ExpTask||o.getTask().getBrkLevel()===E.BRK_LEVEL_REC_SUFFIX,[4,o.setValueAndStartRecompute(l,t.IsNull,!0,u,!1)];case 1:return c.sent(),[4,o.updateDisplay()];case 2:return c.sent(),[2]}}))}))},i.prototype.eval_op_rollback=function(e,t,n){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t=this.ExpTask.GetContextTask()||this.ExpTask,[4,o.eventsManager.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_ROLLBACK)];case 1:return n.sent(),e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,[2]}}))}))},i.prototype.eval_op_like=function(e,n,a){var o,l,u,c=e.StrVal,_=n.StrVal,T=0,h=!0;if(null!==c&&null!==_){var p=c.length,g=_.length,d=new Array(g),E=new t.StringBuilder(g);for(o=0,l=0,u=!1;o<g;o++){var I=_[o];switch(I){case"\\":u&&(d[l++]=I),u=!u;break;case"*":u?d[l++]=I:(d[l++]=i.ASTERISK_CHR,T++),u=!1;break;case"?":d[l++]=u?I:i.QUESTION_CHR,u=!1;break;default:d[l++]=I,u=!1}}g=l;var f=(_=i.arrToStr(d,0,d.length)).lastIndexOf(i.ASTERISK_CHR);if(-1===f)h=i.op_like_cmp(c,_);else{for(o=0;d[o]!==i.ASTERISK_CHR&&h;o++,g--,p--)h=0!==p&&(d[o]===i.QUESTION_CHR||d[o]===c[o]);for(c=c.substr(o),d=i.cutArray(d,o);h&&1!==T;){var C=void 0,A=void 0;for(C=1,A=0;C+o!==f&&d[C]!==i.ASTERISK_CHR;C++,A++);T--,p=c.length,0!==A&&(p>0?(E.Remove(0,E.Length),E.Append(c),h=i.op_like_map(E,i.arrToStr(d,1,A+1),!1),c=E.ToString()):h=!1),o+=C,d=i.cutArray(d,C)}d[0]===i.ASTERISK_CHR&&(d=i.cutArray(d,1)),h&&d.length>0&&(E.Remove(0,E.Length),E.Append(c),h=i.op_like_map(E,i.arrToStr(d),!0))}a.Attr=r.StorageAttribute.BOOLEAN,a.BoolVal=h}else s.prototype.SetNULL.call(this,a,r.StorageAttribute.BOOLEAN)},i.cutArray=function(e,t){for(var r=e.length-t,n=new Array(r),a=0;a<r;a++)n[a]=e[t+a];return n},i.prototype.eval_op_repstr=function(e,n,a,i){null!==e.StrVal&&null!==n.StrVal&&null!==a.StrVal&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(e.Attr)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(n.Attr)&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)?(i.StrVal=t.NString.Replace(e.StrVal,n.StrVal,a.StrVal),i.Attr=r.StorageAttribute.UNICODE):s.prototype.SetNULL.call(this,i,r.StorageAttribute.UNICODE)},i.arrToStr=function(e,t,r){return 1===arguments.length?i.arrToStr_0(e):i.arrToStr_1(e,t,r)},i.arrToStr_0=function(e){return i.arrToStr(e,0,e.length)},i.arrToStr_1=function(e,r,n){for(var a=new t.StringBuilder(n-r);r<n;r++)a.Append(e[r]);return a.ToString()},i.op_like_cmp=function(e,t){var r=!0,n=t,a=e.length,s=t.length;for(a<s?r=!1:a>s&&(n=t);n.length<a;)n+=" ";for(var o=0;o<a&&r;o++)r=n.charAt(o)===i.QUESTION_CHR||n.charAt(o)===e.charAt(o);return r},i.op_like_map=function(e,t,r){var n=!1,a=e.ToString(),s=0;if(!r&&e.Length<t.length)return!1;var o=0;for(o=0;o<e.Length&&!n;o++)if(n=!0,r)n=i.op_like_cmp(a.substr(o),t);else for(s=0;s<t.length&&n;s++){if(o+s===e.Length)return!1;n=t.charAt(s)===i.QUESTION_CHR||t.charAt(s)===a.charAt(o+s)}return n&&(e.Remove(0,e.Length),e.Append(a.substr(o+s-1))),n},i.prototype.exp_get_var_1=function(e,n){var a=e.StrVal,i=this.ExpTask.getFieldByName(a);if(null!==i){if(!1===i.IsExposedToClient){var o=new t.StringBuilder;return o.Append(t.NString.Format("Error: Variable '{0}' is not exposed to client.",i.getVarName())),alert(o.ToString()),void(n.IsNull=!0)}var l=i.getValue(!0);n.IsNull=i.isNull(),s.prototype.SetVal.call(this,n,i.getType(),l,null)}else s.prototype.SetNULL.call(this,n,r.StorageAttribute.NONE)},i.prototype.exp_get_indx=function(e,t){var n=this.ExpTask.GetContextTask().getIndexOfFieldByName(e.StrVal);s.prototype.ConstructMagicNum.call(this,t,n,r.StorageAttribute.NUMERIC)},i.prototype.getField=function(e){return e!==i.TRIGGER_TASK?this.ExpTask.ctl_itm_2_parent_vee(e-1):o.eventsManager.getCurrField()},i.prototype.GetFieldOfContextTask=function(e){return e!==i.TRIGGER_TASK?this.ExpTask.GetContextTask().ctl_itm_2_parent_vee(e-1):o.eventsManager.getCurrField()},i.trimStr=function(e,r){var n=0;if(t.NString.IsNullOrEmpty(e))return e;var a=e.length-1;if("R"!==r)for(;n<e.length&&" "===e.charAt(n);)n++;if("L"!==r)for(;a>=n&&" "===e.charAt(a);)a--;return++a>n?e.substr(n,a-n):""},i.mgValsEqual=function(e,t,r,a,s,o){var l=null,u=null,c=!1;if(t===s&&(t||null!==e&&null!==a))try{l=new n.ExpVal(r,t,e),u=new n.ExpVal(o,s,a),c=0===i.val_cmp_any(l,u,!1)}catch(e){if(!(e instanceof _t))throw e;l.IsNull&&u.IsNull&&(c=!0)}return c},i.prototype.eval_op_translate=function(e,n){n.Attr=r.StorageAttribute.ALPHA,n.StrVal="";var a=e.StrVal;t.NString.IsNullOrEmpty(a)?s.prototype.SetNULL.call(this,n,r.StorageAttribute.ALPHA):n.StrVal=lt.Instance.translate(a)},i.prototype.eval_op_astr=function(e,t,a){if(a.Attr=r.StorageAttribute.UNICODE,null!==e.StrVal&&null!==t.StrVal){if(t.StrVal.length>0&&e.StrVal.length>0){var o=new n.PIC(i.set_a_pic(t.StrVal),r.StorageAttribute.UNICODE,this.ExpTask.getCompIdx());a.StrVal=n.DisplayConvertor.Instance.mg2disp(e.ToMgVal(),null,o,!1,!1,this.ExpTask.getCompIdx(),!0,!1)}}else s.prototype.SetNULL.call(this,a,r.StorageAttribute.UNICODE)},i.eval_op_vecCellAttr=function(e,t){t.Attr=r.StorageAttribute.ALPHA,t.IsNull=!1;var a=r.StorageAttribute.NONE;e.IsNull&&null!==e.VectorField?a=e.VectorField.getCellsType():i.IsValidVector(e)&&(a=n.VectorType.getCellsAttr(e.StrVal)),t.StrVal=""+i.GetAttributeChar(a)},i.prototype.eval_op_vecGet=function(e,a,s){if(null===a.MgNumVal||!i.IsValidVector(e)||a.MgNumVal.NUM_2_LONG()<=0)s.IsNull=!0;else{var o=void 0,l=void 0;if(null!==e.VectorField)o=e.VectorField.getCellsType(),l=e.VectorField.getVecCellValue(a.MgNumVal.NUM_2_LONG());else{var u=new n.VectorType(e.StrVal);l=u.getVecCell(a.MgNumVal.NUM_2_LONG()),o=u.getCellsAttr()}if(null==l)s.IsNull=!0;else switch(o){case r.StorageAttribute.ALPHA:case r.StorageAttribute.MEMO:s.Attr=r.StorageAttribute.ALPHA,s.StrVal=l;break;case r.StorageAttribute.UNICODE:s.Attr=o,s.StrVal=l;break;case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:s.Attr=o,s.StrVal=l,s.IncludeBlobPrefix=!0;break;case r.StorageAttribute.NUMERIC:case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:s.Attr=o,s.MgNumVal=new n.NUM_TYPE(l);break;case r.StorageAttribute.BOOLEAN:s.Attr=o,s.BoolVal=n.DisplayConvertor.toBoolean(l);break;default:throw new t.ApplicationException("in ExpressionEvaluator.eval_op_vecGet unknowen storage type: "+o)}}},i.prototype.eval_op_vecSize=function(e,t){t.Attr=r.StorageAttribute.NUMERIC,t.IsNull=!1,t.MgNumVal=new n.NUM_TYPE,t.MgNumVal.NUM_4_LONG(-1),i.IsValidVector(e)&&t.MgNumVal.NUM_4_LONG(new n.VectorType(e.StrVal).getVecSize())},i.prototype.eval_op_vecSet=function(e,n,a,s){return T(this,void 0,void 0,(function(){var i,o;return h(this,(function(l){switch(l.label){case 0:if(s.Attr=r.StorageAttribute.BOOLEAN,s.BoolVal=!1,null===e.MgNumVal||null===n.MgNumVal)return[3,2];i=void 0;try{i=this.getField(e.MgNumVal.NUM_2_LONG())}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e),i=null}return r.StorageAttributeCheck.IsTypeAlphaOrUnicode(i.getCellsType())&&r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)||null!==i&&(i.IsVirtual||i.getTask().getMode()===r.Constants.TASK_MODE_CREATE||i.DbModifiable)&&i.getType()===r.StorageAttribute.BLOB_VECTOR&&(r.StorageAttributeCheck.isTheSameType(i.getCellsType(),a.Attr)||a.IsNull||r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)&&i.getCellsType()===r.StorageAttribute.BLOB)?(r.StorageAttributeCheck.IsTypeAlphaOrUnicode(a.Attr)&&i.getCellsType()===r.StorageAttribute.BLOB&&this.ConvertExpVal(a,r.StorageAttribute.BLOB),o=s,[4,i.setCellVecValue(n.MgNumVal.NUM_2_LONG(),a.ToMgVal(),a.IsNull)]):[3,2];case 1:o.BoolVal=l.sent(),l.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_strTokenCnt=function(e,a,s){s.Attr=r.StorageAttribute.NUMERIC,s.MgNumVal=new n.NUM_TYPE;var i=0;if(!e.IsNull&&null!==e.StrVal&&0!==t.NString.TrimEnd(e.StrVal,this._charsToTrim).length)if(a.IsNull||0===t.NString.TrimEnd(a.StrVal,this._charsToTrim).length)i=1;else{var o=this.strTokenCount(e.StrVal,a.StrVal);i=0===o?1:o}s.MgNumVal.NUM_4_LONG(i)},i.prototype.eval_op_strTokenIdx=function(e,a,s,i){i.Attr=r.StorageAttribute.NUMERIC,i.MgNumVal=new n.NUM_TYPE;var o=0;!e.IsNull&&null!==e.StrVal&&!a.IsNull&&null!==a.StrVal&&0!==t.NString.TrimEnd(e.StrVal,this._charsToTrim).length&&a.StrVal.trim().length>0&&(o=s.IsNull||0===t.NString.TrimEnd(s.StrVal,this._charsToTrim).length?e.StrVal===a.StrVal?1:0:this.strTokenIndex(e.StrVal,s.StrVal,a.StrVal)),i.MgNumVal.NUM_4_LONG(o)},i.prototype.strTokenIndex=function(e,r,n){var a=t.NString.TrimEnd(r,this._charsToTrim),s=a+t.NString.TrimEnd(e,this._charsToTrim)+a,i=null!==n?t.NString.TrimEnd(n,this._charsToTrim):null;if(null===i)return 0;i=a+i+a;var o=s.indexOf(i);if(-1===o)return 0;var l=this.strTokenCount(s.substr(0,o+a.length),a);return--l},i.prototype.strTokenCount=function(e,r){var n=1,a=t.NString.TrimEnd(r,this._charsToTrim),s=t.NString.TrimEnd(e,this._charsToTrim),i=a.length,o=s,l=0,u=0;if(null===e||0===e.length)return 0;for(u=o.indexOf(a,l);u>=0;)n++,l=u+i,u=o.indexOf(a,l);return n},i.prototype.eval_op_blobsize=function(e,t){var a=0;switch(t.Attr){case r.StorageAttribute.BLOB_VECTOR:a=n.VectorType.getVecSize(t.StrVal);break;case r.StorageAttribute.BLOB:a=n.BlobType.getBlobSize(t.StrVal)}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(a)},i.prototype.eval_op_iscomponent=function(e){var t=o.eventsManager.getCurrTask()||this.ExpTask;e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=0!==t.getCompIdx()},i.prototype.eval_op_ExecUserDefinedFunc=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return(i=new w(this.ExpTask)).setType(E.EVENT_TYPE_USER_FUNC),i.setUserDefinedFuncName(e),(l=new Ae).init(i),u=l.getNext(),c=null!==u&&u.argsMatch(t),_=null,T=!1,c?(p=u.getTask().GetContextTask(),u.getTask()===u.getTask().GetContextTask()&&u.getTask().SetContextTask(i.getTask()),g=new L(t),i.setArgList(g),o.eventsManager.pushNewExecStacks(),[4,u.execute(i,!1,!1)]):[3,4];case 1:return h.sent(),o.eventsManager.popNewExecStacks(),null===(d=u.getTask().getExpById(u.getEvent().getUserDefinedFuncRetExp()))?[3,3]:[4,d.evaluateWithResType(s)];case 2:_=h.sent(),T=!0,h.label=3;case 3:u.getTask().SetContextTask(p),h.label=4;case 4:return T||(s===r.StorageAttribute.NONE&&(s=r.StorageAttribute.ALPHA),_=new n.ExpVal(s,!0,null)),a.Copy(_),[2]}}))}))},i.prototype.eval_op_publicName=function(e,t){var n="NULL",a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&o.isProgram()&&!o.isMainProg()&&(n=o.getPublicName())}e.Attr=r.StorageAttribute.ALPHA,e.StrVal=n},i.prototype.eval_op_taskId=function(e,t){var n="NULL",a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a);null!==o&&(n=o.getExternalTaskId())}e.Attr=r.StorageAttribute.ALPHA,e.StrVal=n},i.prototype.eval_op_dbviewsize=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.DataView.HasMainTable&&(l.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()?a=l.DataView.DBViewSize:l.isTableWithAbsolutesScrollbar()&&(a=l.DataView.TotalRecordsCount))}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_dbviewrowidx=function(e,t){var a=0,o=t.MgNumVal.NUM_2_LONG();if(o>=0&&o<this.ExpTask.getTaskDepth(!1)||o===i.TRIGGER_TASK){var l=s.prototype.GetContextTask.call(this,o);null!==l&&l.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()&&l.DataView.getCurrRec().getMode()!==n.DataModificationTypes.Insert&&(a=l.DataviewManager.CurrentDataviewManager.GetDbViewRowIdx())}s.prototype.ConstructMagicNum.call(this,e,a,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_MlsTrans=function(e,n){e.Attr=r.StorageAttribute.UNICODE,e.StrVal="",e.StrVal=pe.Instance.translate(t.NString.TrimEnd(n.StrVal,this._charsToTrim))},i.prototype.eval_op_StrBuild=function(e,r,n){for(var a=new Array(n),s=0;s<n;s++)a[n-1-s]=e.pop();this.val_cpy(a[0],r);var i=new t.StringBuilder(r.StrVal);for(s=1;s<n;s++)for(var o="@"+s.toString().trim()+"@",l=0;-1!==l;){var u=i.ToString().indexOf(o,l);if(-1===u)break;var c=!1,_=i.ToString().indexOf("\\"+o,l);-1!==_&&(c=!0),c&&u!==_+1||!c?(i.Replace(i.ToString(u,u+o.length-u),a[s].StrVal.trim(),u,u+o.length-u),l=u+a[s].StrVal.trim().length):l=u+1}i.Replace("\\@","@"),r.StrVal=i.ToString()},i.prototype.eval_op_range_add=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,n=e,[4,this.add_rt_ranges(t,!1)];case 1:return n.BoolVal=a.sent(),[2]}}))}))},i.prototype.eval_op_range_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserRange),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_locate_add=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,n=e,[4,this.add_rt_ranges(t,!0)];case 1:return n.BoolVal=a.sent(),[2]}}))}))},i.prototype.eval_op_locate_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserLocate),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_sort_add=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,a=e,[4,this.add_sort(t,n)];case 1:return a.BoolVal=s.sent(),[2]}}))}))},i.prototype.eval_op_sort_reset=function(t,n){var a=Object.create(null,{GetContextTask:{get:function(){return s.prototype.GetContextTask}}});return T(this,void 0,void 0,(function(){var s,o,l;return h(this,(function(u){switch(u.label){case 0:return t.Attr=r.StorageAttribute.BOOLEAN,(s=n.MgNumVal.NUM_2_LONG())>=0&&s<this.ExpTask.getTaskDepth(!1)||s===i.TRIGGER_TASK?null===(o=a.GetContextTask.call(this,s))?[3,2]:(l=Qe.CreateDataViewCommand(o.getTaskTag(),e.DataViewCommandType.ResetUserSort),[4,o.DataviewManager.Execute(l)]):[3,2];case 1:u.sent(),t.BoolVal=!0,u.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_tsk_instance=function(e,a){var o=0,l=a.MgNumVal.NUM_2_LONG();if(l>=0&&l<this.ExpTask.getTaskDepth(!1)||l===i.TRIGGER_TASK){var u=s.prototype.GetContextTask.call(this,l);null!==u&&(o=t.NNumber.Parse(u.getTaskTag()))}e.Attr=r.StorageAttribute.NUMERIC,e.MgNumVal=new n.NUM_TYPE,e.MgNumVal.NUM_4_LONG(o)},i.prototype.add_sort=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return null===e.MgNumVal||(0===(r=e.MgNumVal.NUM_2_LONG())||null===(n=this.GetFieldOfContextTask(r)))?[2,!1]:(a=n.getTask(),s=n.getId()+1,(i=new Ze).fldIdx=s,i.dir=t.BoolVal,o=i,l=Qe.CreateAddUserSortDataviewCommand(a.getTaskTag(),o),[4,a.DataviewManager.Execute(l)]);case 1:return u.sent(),[2,!0]}}))}))},i.prototype.add_rt_ranges=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:if(n=e[0],a=e[1],null===n.MgNumVal)return[2,!1];if(0===(s=n.MgNumVal.NUM_2_LONG()))return[2,!1];if(null===(i=this.GetFieldOfContextTask(s)))return[2,!1];if(o=i.getTask(),l=i.getId()+1,(u=new N).veeIdx=l,c=u,a.IsNull&&(c.nullMin=!0),c.nullMin||a.Attr!==r.StorageAttribute.ALPHA&&a.Attr!==r.StorageAttribute.UNICODE||0!==a.StrVal.length){if(!c.nullMin){if(!r.StorageAttributeCheck.isTheSameType(i.getType(),a.Attr))return[2,!1];r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(i.getType(),a.Attr)&&this.ConvertExpVal(a,i.getType()),c.min=a.ToMgVal()}}else c.discardMin=!0;if(3===e.length)if((_=e[2]).IsNull&&(c.nullMax=!0),c.nullMax||_.Attr!==r.StorageAttribute.ALPHA&&_.Attr!==r.StorageAttribute.UNICODE||0!==_.StrVal.length){if(!c.nullMax){if(!r.StorageAttributeCheck.isTheSameType(i.getType(),_.Attr))return[2,!1];r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(i.getType(),_.Attr)&&this.ConvertExpVal(_,i.getType()),c.max=_.ToMgVal()}}else c.discardMax=!0;else c.discardMax=!0;return c.discardMin&&c.discardMax?[3,4]:t?(T=Qe.CreateAddUserLocateDataviewCommand(o.getTaskTag(),c),[4,o.DataviewManager.Execute(T)]):[3,2];case 1:return h.sent(),[3,4];case 2:return p=Qe.CreateAddUserRangeDataviewCommand(o.getTaskTag(),c),[4,o.DataviewManager.Execute(p)];case 3:h.sent(),h.label=4;case 4:return[2,!0]}}))}))},i.prototype.eval_op_getParam=function(e,r){t.Debug.Assert(!r.IsNull&&null!==r.StrVal);var n=nt.Instance.get(r.StrVal);null!==n?e.Copy(n):e.Nullify()},i.prototype.eval_op_setParam=function(e,n,a){t.Debug.Assert(!n.IsNull&&null!==n.StrVal),e.Attr=r.StorageAttribute.BOOLEAN,nt.Instance.set(n.StrVal,a),e.BoolVal=!0},i.prototype.eval_op_iniput=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return e.Attr=r.StorageAttribute.BOOLEAN,a=e,[4,lt.Instance.set(t.StrVal,n.BoolVal)];case 1:return a.BoolVal=s.sent(),[2]}}))}))},i.prototype.eval_op_iniget=function(e,t){e.StrVal=lt.Instance.get(t.StrVal),e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_inigetln=function(e,t,n){e.StrVal=lt.Instance.getln(t.StrVal,n.MgNumVal.NUM_2_LONG()),e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_m=function(e,t){e.Attr=r.StorageAttribute.ALPHA,e.StrVal="";for(var n=0;n<t.length;n++){var a=this.cst_code_trans_buf("O","MCDELRKSON ",t.charAt(n),r.MsgInterface.EXPTAB_TSK_MODE_RT);e.StrVal=e.StrVal+a}},i.prototype.cst_code_trans_buf=function(e,n,a,s){var i,o,l=pe.Instance.getConstMessage(s),u=new t.Array_Enumerator(r.StrUtil.tokenize(l,",")),c="\0";for(i=0;i<n.length&&u.MoveNext();i++){var _=(o=u.Current).indexOf("&");_++;var T=o.charAt(_).toUpperCase();if("I"===e){if(a===T){c=n.charAt(i);break}}else if(a===n.charAt(i)){c=T;break}}return c},i.prototype.eval_op_expcalc=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return e.IsNull=!0,i._recursiveExpCalcCount<50?(i._recursiveExpCalcCount++,[4,this.ExpTask.getExpById(t.MgNumVal.NUM_2_LONG()).evaluateWithResType(r.StorageAttribute.NONE)]):[3,2];case 1:n=a.sent(),i._recursiveExpCalcCount--,null!==n&&e.Copy(n),a.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_CndRange=function(e,t,r){t.BoolVal?e.Copy(r):e.IsNull=!0},i.prototype.eval_op_taskType=function(e,t){var n=t.MgNumVal.NUM_2_LONG();if(n>=0&&n<this.ExpTask.getTaskDepth(!1)||n===i.TRIGGER_TASK){var a=s.prototype.GetContextTask.call(this,n);e.StrVal=null!==a?a.isMainProg()?"MW":"W":" "}e.Attr=r.StorageAttribute.ALPHA},i.prototype.eval_op_terminal=function(e){var t=et.Instance.getTerminal();s.prototype.ConstructMagicNum.call(this,e,t,r.StorageAttribute.NUMERIC)},i.prototype.eval_op_projectdir=function(e){e.StrVal=et.Instance.getProjDir(this.ExpTask.getCompIdx()),e.Attr=r.StorageAttribute.ALPHA},i.IsValidVector=function(e){return null!==e&&e.Attr===r.StorageAttribute.BLOB_VECTOR&&n.VectorType.validateBlobContents(e.StrVal)},i.GetAttributeChar=function(e){var t=e;switch(e){case r.StorageAttribute.BLOB:t="B";break;case r.StorageAttribute.BOOLEAN:t="L"}return t},i.prototype.GetTopMostForms=function(e){return o.mgDataTable.GetTopMostForms()},i.prototype.HandleControlGoto=function(e,t,n){var a=e;if(null!==t){var s=a.DataView,i=t,l=a.getForm().DisplayLine;if(t.IsRepeatable&&n>0){a.getForm().getTopIndexFromGUI();var u=s.getTopRecIdx();if((l=u+n-1)-u-1>=a.getForm().getRowsInPage())return!1;if(!a.getForm().IsValidRow(l))return!1}if(i.isVisible()){if(i.isSubform())return!1;var c=a.getForm().getIsRowEditingFromGui(l);if(i.isRepeatable()&&!c)return o.eventsManager.addGuiTriggeredEventWithTaskAndCodeAndLine(a,r.InternalInterface.MG_ACT_REC_PREFIX,l),console.log("Unable to park on control: "+i.Name+" as row is not in editing mode"),!0;var _=new w(i,l);return _.setInternal(r.InternalInterface.MG_ACT_CTRL_FOCUS),o.eventsManager.addToTail(_),!0}}return!1},i.prototype.eval_op_set_title=function(e,t){if(e.Attr=r.StorageAttribute.BOOLEAN,e.BoolVal=!0,(t.Attr===r.StorageAttribute.ALPHA||t.Attr===r.StorageAttribute.UNICODE)&&!t.IsNull){var n=t.StrVal,a=this.ExpTask.GetContextTask();null!==a.getTopMostForm()&&a.getTopMostForm().setTitle(n)}},i.prototype.eval_op_is_row_editing=function(e,t){var n=!1;if(null!==t.MgNumVal){var a=t.MgNumVal.NUM_2_LONG();if(a>=0&&a<this.ExpTask.getTaskDepth(!1)||a===i.TRIGGER_TASK){var o=s.prototype.GetContextTask.call(this,a).getForm();n=o.getIsRowEditingFromGui(o.DisplayLine)}e.BoolVal=n,e.Attr=r.StorageAttribute.BOOLEAN}else s.prototype.SetNULL.call(this,e,r.StorageAttribute.ALPHA)},i.prototype.eval_op_control_select_program=function(e,a){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return s=e.MgNumVal.NUM_2_LONG(),i=0,o=new t.RefParam(i),l=this.ExpTask.GetContextTask().GetControlFromControlID(s-1,o),i=o.value,a.Attr=r.StorageAttribute.NUMERIC,a.MgNumVal=new n.NUM_TYPE,null!==l&&l.HasSelectProgram()?(u=l.getProp(n.PropInterface.PROP_TYPE_SELECT_PROGRAM),T=(_=t.NNumber).Parse,[4,u.getValue()]):[3,2];case 1:c=T.apply(_,[h.sent()]),p=0,c>0&&(p=i>0?c+i/100:c),a.MgNumVal=n.NUM_TYPE.from_double(p),h.label=2;case 2:return[2]}}))}))},i.prototype.eval_op_CallJS=function(e,t,s,i){if(i.Attr=r.StorageAttribute.ALPHA,i.StrVal="",e.isMainProg())console.error("CallJS cannot be used in Main Program");else{var o=e.getForm(),l=this.params2arguments(s,0,s.length);a.isNullOrUndefined(l)||(i.StrVal=n.Commands.addCallJS(o,o.UniqueName,t,l),i.Attr=r.StorageAttribute.ALPHA)}},i.prototype.eval_op_set_cookie=function(e,t,a){a.Attr=r.StorageAttribute.BOOLEAN,a.StrVal="";var s,i,o,l=this.params2arguments(t,0,t.length);s=l[1];var u,c=l[2];if(s){var _=n.DisplayConvertor.Instance.getNewDateBreakParams();n.DisplayConvertor.Instance.date_break_datemode(_,s,!1,this.ExpTask.getCompIdx());_.year,_.month,_.day;if(0==_.year&&0==_.month&&0==_.day)return null;if(u=new Date(_.year,_.month-1,_.day),c){var T=n.DisplayConvertor.Instance.getNewTimeBreakParams();n.DisplayConvertor.time_break(T,c),u.setHours(T.hour),u.setMinutes(T.minute),u.setSeconds(T.second)}}i=l[3],o=l[4],a.BoolVal=ut.setCookie(e,l[0],u,i,o,undefined,undefined)},i.prototype.eval_op_get_cookie=function(e,t){t.StrVal=ut.getCookie(e)},i.prototype.eval_op_delete_cookie=function(e,t){t.Attr=r.StorageAttribute.BOOLEAN,t.BoolVal=ut.deleteCookie(e)},i.prototype.eval_op_route_get=function(e){e.Attr=r.StorageAttribute.UNICODE,e.IsNull=!1,e.StrVal=n.Commands.getLastRoute()},i.prototype.params2arguments=function(e,t,s){for(var i=new Array,o=t;o<t+s;o++)if(a.isNullOrUndefined(e[o]))i.push("");else switch(e[o].Attr){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:null!=e[o].StrVal&&e[o].StrVal.length>0?i.push(e[o].StrVal):i.push("");break;case r.StorageAttribute.BOOLEAN:i.push(!!e[o].BoolVal);break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:i.push(e[o].MgNumVal.NUM_2_LONG());break;case r.StorageAttribute.NUMERIC:i.push(e[o].MgNumVal.to_double());break;case r.StorageAttribute.BLOB:var l=e[o].StrVal;if(!a.isNullOrUndefined(l)){if(n.BlobType.getContentType(l)===n.BlobType.CONTENT_TYPE_BINARY)return r.Logger.Instance.WriteErrorToLog("Argument "+(o+1)+" of type Binary Blob is not supported in CallJS"),null;i.push(n.BlobType.getString(l))}break;case r.StorageAttribute.NONE:default:return r.Logger.Instance.WriteErrorToLog(" Argument "+(o+1)+" is not supported in CallJS"),null}return i},i}(n.GuiExpressionEvaluator);ct.ASTERISK_CHR=String.fromCharCode(1),ct.QUESTION_CHR=String.fromCharCode(2),ct.PARENT_LEN=2,ct.SHORT_OBJECT_LEN=2,ct.LONG_OBJECT_LEN=4,ct._recursiveExpCalcCount=0,ct.ErrorToBeWrittenInServerLog=null;var _t=function(e){function t(t){var n=e.call(this)||this;return n._attr=r.StorageAttribute.NONE,n._attr=t,n.name="NullValueException",n}return u(t,e),t.prototype.getAttr=function(){return this._attr},t}(t.Exception),Tt=function(){function e(e,t){this._expBytes=null,this._lowHigh=!0,this._nullArithmetic=!1,this._isNull=!1,this._posIdx=0,this._expBytes=new Int8Array(e.length);for(var r=0;r<this._expBytes.length;++r)this._expBytes[r]=0;for(var n=0;n<e.length;n++)this._expBytes[n]=e[n];this._nullArithmetic=t,this._lowHigh=et.Instance.getLowHigh()}return e.prototype.setNullResult=function(){this._nullArithmetic&&(this._isNull=!0)},e.prototype.resetNullResult=function(){this._nullArithmetic&&(this._isNull=!1)},e.prototype.isNull=function(){return this._isNull},e.prototype.get1ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,e},e.prototype.get2ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var t=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,this._lowHigh?ct.MK_SHRT(t,e):ct.MK_SHRT(e,t)},e.prototype.get4ByteNumber=function(){var e=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var t=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var r=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];this._posIdx+=1;var n=this._expBytes[this._posIdx]>=0?this._expBytes[this._posIdx]:256+this._expBytes[this._posIdx];return this._posIdx+=1,this._lowHigh?ct.MK_LONG(n,r,t,e):ct.MK_LONG(e,t,r,n)},e.prototype.getString=function(e,n,a){var s,i="";if(!1===a){s=e;for(var o=new Array(this._expBytes.length),l=0;l<this._expBytes.length;l+=1)o[l]=String.fromCharCode(this._expBytes[l]);i=t.NString.FromChars(o,this._posIdx,e)}else{s=2*e;var u=new Uint8Array(s),c=this._lowHigh?1:E.BYTES_IN_CHAR;for(l=this._posIdx;l<this._posIdx+s;l+=c)this._lowHigh?u[l-this._posIdx]=this._expBytes[l]:(u[l-this._posIdx]=this._expBytes[l+1],u[l+1-this._posIdx]=this._expBytes[l]);try{i=t.Encoding.Unicode.GetString(u,0,u.length)}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e)}}return n&&(this._posIdx+=s),i},e.prototype.skipOpFunctionPtr=function(){this._posIdx+=n.ExpressionInterface.EXP_OPER_FUNC_PTR_LEN},e.prototype.getOpCode=function(){var e=[this._lowHigh?this._expBytes[this._posIdx]:this._expBytes[this._posIdx+1],this._lowHigh?this._expBytes[this._posIdx+1]:this._expBytes[this._posIdx]],t=e[1]>=0?e[1]:256+e[1];return t<<=8,t|=e[0]>=0?e[0]:256+e[0],this._posIdx+=n.ExpressionInterface.EXP_OPER_LEN,this.skipOpFunctionPtr(),t},e.prototype.getVarIdx=function(){var e=0;this._lowHigh&&(e=1-e);var t=this._expBytes[this._posIdx+e]>=0?this._expBytes[this._posIdx+e]:256+this._expBytes[this._posIdx+e];return t<<=8,e=1-e,t|=this._expBytes[this._posIdx+e]>=0?this._expBytes[this._posIdx+e]:256+this._expBytes[this._posIdx+e],this._posIdx+=n.ExpressionInterface.EXP_OPER_LEN,t},e.prototype.getMagicNumber=function(e,t){var r=new n.NUM_TYPE(this._expBytes,this._posIdx,e);return t&&(this._posIdx+=e),r},e.prototype.skipOperator=function(){for(var e,t,r=1;r>0;){r--;var a=this.getOpCode();switch(a){case n.ExpressionInterface.EXP_OP_A:case n.ExpressionInterface.EXP_OP_H:t=this.get4ByteNumber(),this._posIdx+=t*E.BYTES_IN_CHAR,t=this.get4ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_EXT_A:case n.ExpressionInterface.EXP_OP_N:case n.ExpressionInterface.EXP_OP_T:case n.ExpressionInterface.EXP_OP_D:case n.ExpressionInterface.EXP_OP_M:case n.ExpressionInterface.EXP_OP_K:case n.ExpressionInterface.EXP_OP_E:t=this.get2ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_F:case n.ExpressionInterface.EXP_OP_P:t=this.get2ByteNumber(),this._posIdx+=t,t=this.get2ByteNumber(),this._posIdx+=t;break;case n.ExpressionInterface.EXP_OP_L:this._posIdx+=2;break;case n.ExpressionInterface.EXP_OP_V:case n.ExpressionInterface.EXP_OP_FORM:case n.ExpressionInterface.EXP_OP_VAR:this._posIdx+=ct.PARENT_LEN+ct.LONG_OBJECT_LEN;break;case n.ExpressionInterface.EXP_OP_RIGHT_LITERAL:t=this.get2ByteNumber(),this._posIdx+=t,t=this.get2ByteNumber(),this._posIdx+=t;break;default:(e=fe.expDesc[a]).ArgCount_<0?r+=this.get1ByteNumber():r+=e.ArgCount_}}},e}(),ht=function(){this.argCount_=0,this.opCode_=n.ExpressionInterface.EXP_OP_NONE},pt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(n.GuiDataViewBase),gt=function(){function e(r,a){this._id=t.Int32.MinValue,this.dbViewRowIdx=0,this._mode=n.DataModificationTypes.None,this._dcRefs=null,this._inCompute=!1,this._inRecompute=!1,this._newRec=!1,this._dataview=null,this._sendToServer=!0,r instanceof e?Object.assign(this,r):1===arguments.length?this.constructor_0(r):this.constructor_1(r,a)}return Object.defineProperty(e.prototype,"InCompute",{get:function(){return this._inCompute},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"InRecompute",{get:function(){return this._inRecompute},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e){e instanceof pt?this._dataview=e:this._tableCache=e,this._fieldsData=new Array(this.getFieldsTab().getSize()),this._flags=new Uint8Array(this.getFieldsTab().getSize()),this._flagsHistory=new Uint8Array(this.getFieldsTab().getSize()),this._dcRefs=new n.ObjectReferencesCollection},e.prototype.Initialize=function(){for(var t=0;t<this._flags.length;t+=1){var n=this.getFieldsTab().getField(t);if(this._flags[t]=n.isNullDefault()||n.getType()===r.StorageAttribute.BLOB_VECTOR?e.FLAG_NULL:0,null!==this._dataview&&n.IsVirtual){var a=this._dataview.getCurrRec();null!=a&&a.IsFldModifiedAtLeastOnce(t)&&this.setFlag(t,e.FLAG_MODIFIED_ATLEAST_ONCE)}this._flagsHistory[t]=this._flags[t]}this.setNewRec()},e.prototype.constructor_1=function(e,t){this.constructor_0(t),this.setId(e)},Object.defineProperty(e.prototype,"Modified",{get:function(){return this._modified},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Updated",{get:function(){return this._updated},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SendToServer",{get:function(){return this._sendToServer},enumerable:!1,configurable:!0}),e.prototype.CompareTo=function(e){var t=0,a=e,s=this._tableCache.GetKeyById(this._tableCache.GetCurrSortKey());if(null!=s){for(var i=0;i<s.Columns.length;i++){var o=s.Columns.get_Item(i),l=o.getId();if(!this.IsNull(l)||!a.IsNull(l)){if(this.IsNull(l)&&!a.IsNull(l)){t=1;break}if(!this.IsNull(l)&&a.IsNull(l)){t=-1;break}try{var u=new n.ExpVal(o.getType(),!1,this.GetFieldValue(l)),c=new n.ExpVal(o.getType(),!1,a.GetFieldValue(l));if(0!==(t=ct.val_cmp_any(u,c,!1)))break}catch(e){e instanceof _t&&r.Logger.Instance.WriteExceptionToLogWithMsg(" in Record.CompareTo null value was reached")}}}return t}return t=-1},e.prototype.getMode=function(){return this._mode},e.prototype.getId=function(){return this._id},e.prototype.isNewRec=function(){return this._newRec},e.prototype.getFieldDataXML=function(e,t){return 2===arguments.length?this.getFieldDataXML_0(e,t):this.getFieldDataXML_1(e)},e.prototype.getFieldDataXML_0=function(e,n){var a;if(null==(a=n?this.getFieldsTab().getField(e).getOriginalValue():this.GetFieldValue(e)))throw new t.ApplicationException("in Record.buildFieldsData() null field value!\nField id: "+e);var s=this.getXMLForValue(e,a);return r.XmlParser.escape(s.toString()).toString()},e.prototype.getFieldDataXML_1=function(e){var r=this.GetFieldValue(e);if(null===r)throw new t.ApplicationException("in Record.buildFieldsData() null field value!\nField id: "+e);var a=this.getFieldsTab().getType(e);return n.RecordUtils.serializeItemVal(r,a)},e.prototype.getFieldsTab=function(){return null!==this._dataview?this._dataview.GetFieldsTab():this._tableCache.FldsTab},e.prototype.setInitialFldVals=function(t,r){var n,a,s=null;for(a=this.getSizeFld(!0),n=0;n<a;n++)null!==this._fieldsData[n]&&void 0!==this._fieldsData[n]||(s=this.getFieldsTab().getField(n),this._fieldsData[n]=s.getNewRecValue(t),r&&s.IsVirtual&&!s.isNull()&&this.clearFlag(s.getId(),e.FLAG_NULL),s.IsVirtual&&s.getModifiedAtLeastOnce()&&this.setFlag(s.getId(),e.FLAG_MODIFIED_ATLEAST_ONCE),null!==this._fieldsData[n]&&void 0!==this._fieldsData[n]||(this._fieldsData[n]=s.getDefaultValue()))},e.prototype.setId=function(e){this._id=e,this._hashKey=this._id},e.prototype.setDBViewRowIdx=function(e){this.dbViewRowIdx=e},e.prototype.getDBViewRowIdx=function(){return this.dbViewRowIdx},e.prototype.fillData=function(e){var t=!1,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_REC)+E.MG_TAG_REC.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);t=this.initElements(s),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.FillInnerData() out of bounds");return t},e.prototype.initElements=function(e){var n,a,s,i=null,o=null,l=0;for(s=this.peekIsCurrRec(e);l<e.length;l+=2)switch(n=e.get_Item(l),a=e.get_Item(l+1),n){case E.MG_ATTR_MODE:this._mode=a[0];break;case r.XMLConstants.MG_ATTR_ID:this.setId(r.XmlParser.getInt(a));break;case r.XMLConstants.MG_ATTR_VB_VIEW_ROWIDX:this.setDBViewRowIdx(r.XmlParser.getInt(a));break;case r.XMLConstants.MG_ATTR_VALUE:i=this.ValueInBase64?r.Base64.decode(a):r.XmlParser.unescape(a);break;case E.MG_ATTR_CURR_REC:break;case E.MG_ATTR_ADD_AFTER:this._addAfter=r.XmlParser.getInt(a);break;case E.MG_ATTR_FLAGS:o=a;break;case E.MG_ATTR_MODIFIED:this._modified=!0;break;case E.MG_ATTR_DC_REFS:this.fillDCRef(a);break;case E.MG_ATTR_DBPOS:this._dbPosBase64Val=a;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.initElements() unknown attribute: "+n)}if(this.ValueInBase64){var u=t.ISO_8859_1_Encoding.ISO_8859_1.GetBytes(i);this.fillFieldsData(u,o)}else this.fillFieldsData(i,o,s);return s},e.prototype.peekIsCurrRec=function(e){for(var t,n=0;n<e.length;n+=2)if(e.get_Item(n)===E.MG_ATTR_CURR_REC)return t=e.get_Item(n+1),r.XmlParser.getBoolean(t);return!1},e.prototype.fillFieldsData=function(e,t,r){a.isNullOrUndefined(r)?this.fillFieldsData_0(e,t):this.fillFieldsData_1(e,t,r)},e.prototype.fillFieldsData_0=function(e,t){},e.prototype.fillFieldsData_1=function(a,s,i){var o,l,u,c,_,T,h=null,p=null,g=new t.RefParam(0),d=0,E=null;for(l=this.getFromFldIdx(i),u=this.getSizeFld(i),o=l;d<u;o++,d++)c=(E=this.getFieldsTab().getField(o)).getType(),_=et.Instance.GetDebugLevel()>1||c===r.StorageAttribute.ALPHA||c===r.StorageAttribute.UNICODE||r.StorageAttributeCheck.isTypeLogical(c),"."===s[d]?this._flags[o]=0:"/"===s[d]?this._flags[o]=1:(p=s.substr(2*d,2),this._flags[o]=parseInt(p,16)),T=e.FLAG_VALUE_NOT_PASSED===(this._flags[o]&e.FLAG_VALUE_NOT_PASSED),this._flags[o]=this._flags[o]&~e.FLAG_VALUE_NOT_PASSED,this._flagsHistory[o]=this._flags[o],e.FLAG_UPDATED===(this._flags[o]&e.FLAG_UPDATED)&&(this._updated=!0),T?h=e.FLAG_NULL===(this._flags[o]&e.FLAG_NULL)?E.getDefaultValue():this._dataview.getCurrRec().GetFieldValue(o):(h=n.RecordUtils.deSerializeItemVal(a,c,E.getSize(),_,E.getCellsType(),g),a=a.substr(g.value)),this._fieldsData[o]=h;this.setInitialFldVals(!1,!1)},e.prototype.fillDCRef=function(e){if(!t.NString.IsNullOrEmpty(e))for(var n=r.StrUtil.tokenize(e,"$"),a=n.length,s=0;s<a;s+=1)this._dcRefs.Add(dt.Parse(n[s],this._dataview))},e.prototype.buildFieldsData=function(e,t,r){3===arguments.length?this.buildFieldsData_0(e,t,r):this.buildFieldsData_1(e)},e.prototype.buildFieldsData_0=function(r,n,a){for(var s=new t.StringBuilder,i=this.getFromFldIdx(n),o=this.getSizeFld(n),l=i;l<i+o;l+=1){!1===this.getFieldsTab().getField(l).IsExposedToClient&&this.setShrinkFlag(l),e.FLAG_VALUE_NOT_PASSED!==(this._flags[l]&e.FLAG_VALUE_NOT_PASSED)&&s.Append(this.getFieldDataXML(l,a).toString())}0===s.Length&&s.Append(" "),r.Append(s.ToString())},e.prototype.buildFieldsData_1=function(n){var a,s,i,o=new t.List;for(s=this.getFromFldIdx(!1),i=this.getSizeFld(!1),a=0;a<s+i;a++){if(e.FLAG_VALUE_NOT_PASSED!==(this._flags[a]&e.FLAG_VALUE_NOT_PASSED))this.getFieldDataXML(a).forEach((function(e){return o.push(e)}))}var l=new Uint8Array(o.length);for(a=0;a<o.length;a++)l[a]=o.get_Item(a);var u=r.Base64.encode(l),c=et.Instance.GetEncoding().GetString(u,0,u.length);n.Append(c)},e.prototype.getXMLForValue=function(t,n){var a=r.StorageAttribute.SKIP,s=this.getFieldsTab().getType(t);s===r.StorageAttribute.BLOB_VECTOR&&(a=this.getFieldsTab().getField(t).getCellsType());var i=et.Instance.GetDebugLevel()<=1;return e.serializeItemVal(n,s,a,i)},e.prototype.getFromFldIdx=function(e){return e?0:this.getFieldsTab().getRMIdx()},e.prototype.getSizeFld=function(e){return e?this.getFieldsTab().getSize():this.getFieldsTab().getRMSize()},e.prototype.buildXML=function(e,t,r){a.isNullOrUndefined(r)?this.buildXML_0(e,t):this.buildXML_1(e,t,r)},e.prototype.buildXML_0=function(e,t){this.buildXML_1(e,t,!1)},e.prototype.buildXML_1=function(a,s,i){var o,l,u,c,_,T;if(i||this._mode===n.DataModificationTypes.Insert||this._mode===n.DataModificationTypes.Update||this._mode===n.DataModificationTypes.Delete||s){var h;if(a.Append("\n <"+E.MG_TAG_REC),this._id>t.Int32.MinValue&&a.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),a.Append(" "+E.MG_ATTR_MODE+'="'+this._mode+'"'),this._mode===n.DataModificationTypes.Insert&&null!=this._prev&&a.Append(" "+E.MG_ATTR_ADD_AFTER+'="'+this._prev.getId()+'"'),i||s||this.clearMode(),a.Append(" "+r.XMLConstants.MG_ATTR_VALUE+'="'),!i&&s&&this.setShrinkFlags(),this.Synced)h=!1;else{var p=this._dataview.getTask();h=!s&&(p.getLevel()===r.Constants.TASK_LEVEL_RECORD||p.getLevel()===r.Constants.TASK_LEVEL_CONTROL)&&null!=this._dataview.getCurrRec()&&this._dataview.getCurrRec().getId()===this._id}for(this.buildFieldsData(a,s,h),a.Append('"'),o=new t.StringBuilder,l=this.getFromFldIdx(s),u=this.getSizeFld(s),c=l;c<l+u;c++)_=this._flagsHistory[c],_&=e.FLAG_CRSR_MODIFIED,_|=this._flags[c],T=t.NNumber.ToString(_,"X2"),o.Append(T),s&&(this._flags[c]=this._flags[c]&~e.FLAG_VALUE_NOT_PASSED);a.Append(" "+E.MG_ATTR_FLAGS+'="'+o.ToString()+'"'),s&&(a.Append(" "+E.MG_ATTR_CURR_REC+'="1"'),this.Modified&&a.Append(" "+E.MG_ATTR_MODIFIED+'="1"')),null!=this._linksFldsPos&&a.Append(" "+E.MG_ATTR_DBPOS+'="'+r.XmlParser.escape(this._linksFldsPos)+'" '),a.Append(r.XMLConstants.TAG_TERM)}},e.prototype.buildXMLForDataViewToDataSource=function(a){var s,i,o,l,u,c;for(a.Append("\n <"+E.MG_TAG_REC),this._id>t.Int32.MinValue&&a.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._id+'"'),a.Append(" "+E.MG_ATTR_MODE+'="'+this._mode+'"'),this._mode===n.DataModificationTypes.Insert&&null!=this._prev&&a.Append(" "+E.MG_ATTR_ADD_AFTER+'="'+this._prev.getId()+'"'),a.Append(" "+r.XMLConstants.MG_ATTR_VALUE+'="'),this.buildFieldsData(a),a.Append('"'),s=new t.StringBuilder,i=this.getFromFldIdx(!1),o=this.getSizeFld(!1),l=i;l<i+o;l++)u=this._flagsHistory[l],u&=e.FLAG_CRSR_MODIFIED,u|=this._flags[l],c=t.NNumber.ToString(u,"X2"),s.Append(c);a.Append(" "+E.MG_ATTR_FLAGS+'="'+s+'"'),null!=this._linksFldsPos&&a.Append(" "+E.MG_ATTR_DBPOS+'="'+r.XmlParser.escape(this._linksFldsPos)+'" '),a.Append(r.XMLConstants.TAG_TERM)},e.prototype.setShrinkFlags=function(){var t,r=this.getSizeFld(!0),n=this._dataview.getServerCurrRec();if(null!=n)for(t=0;t<r;t++)(this.fldValsEqual(n,t)||e.FLAG_NULL===(this._flags[t]&e.FLAG_NULL))&&(this._flags[t]=this._flags[t]|e.FLAG_VALUE_NOT_PASSED)},e.prototype.setShrinkFlag=function(t){this._flags[t]|=e.FLAG_VALUE_NOT_PASSED},e.prototype.SetFieldValue=function(t,r,n){var a=this.getFieldsTab().getField(t);a.UpdateNull(r,this),n=this.CheckMgValue(n,r,a),this._fieldsData[t]=n,a.takeValFromRec(),this.clearFlag(a.getId(),e.FLAG_INVALID),a.invalidate(!0,!1)},e.prototype.setFieldValue=function(e,t,a){var s=this.getFieldsTab().getField(e);s.PrevIsNull()===s.isNull()&&t===this.GetFieldValue(e)||(t=this.CheckMgValue(t,s.isNull(),s),e>=0&&e<this.getFieldsTab().getSize()?(this._fieldsData[e]=t,a&&(s.PartOfDataview&&(this._modified=!0),le.GetInstance().DelayCommandExecution&&(le.GetInstance().DelayCommandExecution=!1,this._dataview.getTask().DelayCommandExecution=!0),this._dataview.setChanged(!0),this.setMode(n.DataModificationTypes.Update))):r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.setFieldValue() illegal field index: "+e))},e.prototype.CheckMgValue=function(e,t,n){(null===e||t)&&null===(e=n.getNullValue())&&(e=n.getMagicDefaultValue());var a=n.getSize();return r.UtilStrByteMode.isLocaleDefLangDBCS()&&n.getType()!==r.StorageAttribute.UNICODE?null!==e&&r.UtilStrByteMode.lenB(e)>a&&(e=r.UtilStrByteMode.leftB(e,a)):null!==e&&e.length>a&&(e=e.substr(0,a)),e},e.prototype.setModified=function(){this._modified=!0},e.prototype.resetModified=function(){this._modified=!1},e.prototype.setUpdated=function(){this._updated=!0},e.prototype.resetUpdated=function(){this._updated=!1},e.prototype.GetFieldValue=function(e){var t=null;return e>=0&&e<this._fieldsData.length&&(t=this._fieldsData[e]),t.toString()},e.prototype.replicate=function(){var t=new e(this);return t._fieldsData=this._fieldsData.slice(),t._flags=this._flags.subarray(0),t._flagsHistory=this._flagsHistory.subarray(0),t._dcRefs=this._dcRefs.Clone(),t},e.prototype.setSameAs=function(e,t,r){3===arguments.length?this.setSameAs_0(e,t,r):this.setSameAs_1(e,t)},e.prototype.setSameAs_0=function(e,t,r){this.setSameAs(e,t),this.setId(r)},e.prototype.setSameAs_1=function(e,t){if(this._id=e._id,this._hashKey=e._hashKey,this._dataview.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)||this.setMode(e._mode),this._addAfter=e._addAfter,t)for(var r=0;r<this.getFieldsTab().getSize();r+=1){e.getFieldsTab().getField(r).IsVirtual||(this._fieldsData[r]=e._fieldsData[r],this._flags[r]=e._flags[r],this._flagsHistory[r]=e._flagsHistory[r])}else this._fieldsData=e._fieldsData,this._flags=e._flags,this._flagsHistory=e._flagsHistory;this._modified=e._modified,this._dataview=e._dataview,this._computed=e._computed,this._updated=e._updated,this.setDcRefs(e._dcRefs),e._next!==this&&(this._next=e._next),e._prev!==this&&(this._prev=e._prev)},e.prototype.IsNull=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_NULL)===e.FLAG_NULL},e.prototype.isLinkInvalid=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_INVALID)===e.FLAG_INVALID},e.prototype.isFldModified=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_MODIFIED)===e.FLAG_MODIFIED},e.prototype.IsFldModifiedAtLeastOnce=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_MODIFIED_ATLEAST_ONCE)===e.FLAG_MODIFIED_ATLEAST_ONCE},e.prototype.isFldUpdated=function(t){return this.checkFlags(t),(this._flags[t]&e.FLAG_UPDATED)===e.FLAG_UPDATED},e.prototype.setFlag=function(t,r){this.checkFlags(t),this._flags[t]=this._flags[t]|r,r===e.FLAG_CRSR_MODIFIED&&(this._flagsHistory[t]=this._flagsHistory[t]|r)},e.prototype.clearFlag=function(e,t){this.checkFlags(e),this._flags[e]=this._flags[e]&~t},e.prototype.clearFlagsHistory=function(){for(var e=0;e<this._flags.length;e+=1)this._flagsHistory[e]=0},e.prototype.clearFlags=function(e){for(var t=0;t<this._flags.length;t+=1)this.clearFlag(t,e)},e.prototype.clearFlagsForRealOnly=function(e){for(var t=0;t<this._flags.length;t+=1){this.getFieldsTab().getField(t).IsVirtual||this.clearFlag(t,e)}},e.prototype.clearHistoryFlag=function(e){null!==this._flagsHistory&&e<this.getFieldsTab().getSize()&&e>=0&&(this._flagsHistory[e]=0)},e.prototype.checkFlags=function(e){if(null===this._flags||e>=this.getFieldsTab().getSize()||e<0)throw new t.ApplicationException("Cannot find flags")},e.prototype.restart=function(e){var t=this._dataview.getTask();if(e===n.DataModificationTypes.None){var a=this._dataview.getCurrRec(),s=null!=a&&a.getId()===this._id;e=this._dataview.getTask().getMode()===r.Constants.TASK_MODE_CREATE?s&&!t.getAfterRetry()&&t.TryingToCommit&&!this._dataview.inRollback()?n.DataModificationTypes.Update:n.DataModificationTypes.Insert:n.DataModificationTypes.Update}this.setMode(e),e===n.DataModificationTypes.Insert&&this.setNewRec()},e.prototype.setLateCompute=function(e){this._lateCompute=e},e.prototype.lateCompute=function(){return this._lateCompute},e.prototype.setInDeleteProcess=function(e){this._inDeleteProcess=e},e.prototype.inDeleteProcess=function(){return this._inDeleteProcess},e.prototype.removeRecFromDc=function(){null!==this._dcRefs&&this._dcRefs.Dispose()},e.prototype.isSameRecData=function(e,r,n){var a,s,i=this.getSizeFld(r),o=this.getFromFldIdx(r);if(this===e)return!0;try{if(e.getSizeFld(r)!==i)return!1;if(e.getFromFldIdx(r)!==o)return!1;for(a=0;a<o+i;a++)if(s=this.getFieldsTab().getField(a),(!n||s.PartOfDataview)&&!this.fldValsEqual(e,a))return!1}catch(e){if(e instanceof t.ApplicationException)return!1;throw e}return!0},e.prototype.fldValsEqual=function(e,t){var r=this.getFieldsTab().getField(t).getType();return ct.mgValsEqual(this.GetFieldValue(t),this.IsNull(t),r,e.GetFieldValue(t),e.IsNull(t),r)},e.prototype.getHashKey=function(){return this._hashKey},e.prototype.setNextRec=function(e){this._next=e},e.prototype.setPrevRec=function(e){this._prev=e},e.prototype.getPrevRec=function(){return this._prev},e.prototype.getNextRec=function(){return this._next},e.prototype.getDcRefs=function(){return this._dcRefs.Clone()},e.prototype.setDcRefs=function(e){this.removeRecFromDc(),this._dcRefs=e.Clone(),this.SetDcValueId()},e.prototype.realModified=function(){var t,r=!1,n=this.getFieldsTab().getSize();for(t=0;t<n;t++)if((this._flags[t]&e.FLAG_MODIFIED)===e.FLAG_MODIFIED&&!this.getFieldsTab().getField(t).IsVirtual){r=!0;break}return r},e.prototype.ToString=function(){var e=new t.StringBuilder;return this.buildXML(e,this._dataview.getCurrRec().getId()===this._id,!0),e.ToString()},e.prototype.setSendToServer=function(e){this._sendToServer=e},e.prototype.getRecSize=function(){for(var e=0,t=0;t<this.getFieldsTab().getSize();t+=1){e+=this.getFieldsTab().getField(t).getSize()}return e},e.prototype.copyCrsrModifiedFlags=function(t){var r,n=this.getFieldsTab().getSize();for(r=0;r<n;r++)this._flags[r]=t._flags[r],this._flags[r]=this._flags[r]&e.FLAG_CRSR_MODIFIED},e.prototype.getDbPosVal=function(){return this._dbPosBase64Val},e.prototype.buildLinksPosStr=function(){var e=this._dataview.getTask().getDataviewHeaders();null!==e&&(this._linksFldsPos=e.buildDbPosString())},e.prototype.setForceSaveOrg=function(e){this._forceSaveOrg=e},e.prototype.getForceSaveOrg=function(){return this._forceSaveOrg},e.prototype.isCauseInvalidation=function(){return this._causeInvalidation},e.prototype.setCauseInvalidation=function(e){this._causeInvalidation=e},e.prototype.isComputed=function(){return this._computed},e.prototype.setComputed=function(e){this._computed=e},e.prototype.setInCompute=function(e){e||this.setComputed(!0),this._inCompute=e},e.prototype.setInRecompute=function(e){this._inRecompute=e},e.prototype.setMode=function(e){switch(e){case n.DataModificationTypes.None:case n.DataModificationTypes.Insert:case n.DataModificationTypes.Update:case n.DataModificationTypes.Delete:(this._mode===n.DataModificationTypes.None||this._mode===n.DataModificationTypes.Update&&e===n.DataModificationTypes.Delete)&&(this._mode=e);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in Record.setMode(): illegal mode: "+e)}},e.prototype.clearMode=function(){this._mode=n.DataModificationTypes.None},e.prototype.setOldRec=function(){this._newRec=!1},e.prototype.setNewRec=function(){this._newRec=!0},e.serializeItemVal=function(e,t,r,a){return n.RecordUtils.serializeItemVal(e,t,r,a)},e.prototype.SetDcValueId=function(){var e=this._dataview.getTask().getForm(),t=null;null!=e&&null!=this._dcRefs&&this._dcRefs.Refs.forEach((function(r){null!=(t=e.getCtrl(r.ditIdx))&&t.setDcValId(r.DcValues.getId())}))},e.prototype.resetDcValueId=function(){var e=this._dataview.getTask().getForm(),t=null;null!=e&&null!=this._dcRefs&&this._dcRefs.Refs.forEach((function(r){null!=(t=e.getCtrl(r.ditIdx))&&t.setDcValId(n.EMPTY_DCREF)}))},e.prototype.AddDcValuesReference=function(e,t){var r=this._dataview.getDcValues(t),a=new dt(e,r);null===this._dcRefs&&(this._dcRefs=new n.ObjectReferencesCollection),this._dcRefs.Add(a)},e}();gt.FLAG_NULL=1,gt.FLAG_INVALID=2,gt.FLAG_MODIFIED=4,gt.FLAG_UPDATED=8,gt.FLAG_CRSR_MODIFIED=16,gt.FLAG_VALUE_NOT_PASSED=32,gt.FLAG_MODIFIED_ATLEAST_ONCE=64,gt.INCREASE=!0,gt.DECREASE=!1;var dt=function(e){function r(t,r){var n=e.call(this,r)||this;return n.ditIdx=0,n.ditIdx=t,n}return u(r,e),Object.defineProperty(r.prototype,"DcValues",{get:function(){return this.Referent},enumerable:!1,configurable:!0}),r.prototype.Clone=function(){return new r(this.ditIdx,this.Referent)},r.Parse=function(e,n){var a=e.indexOf(","),s=t.NNumber.Parse(e.substr(0,a)),i=t.NNumber.Parse(e.substr(a+1));return new r(s,n.getDcValues(i))},r}(n.ObjectReferenceBase),Et=function(){function e(e){this._useLinkedList=!1,this._hashTab=null,this._initialCurrRecId=t.Int32.MinValue,this._records=null,this._serverCurrRec=null,this.InsertedRecordsCount=0,e.constructor===Boolean?(this._records=new t.List,this._hashTab=new t.Hashtable(100,.7),this._useLinkedList=e,this.InsertedRecordsCount=t.Int32.MinValue):Object.assign(this,e)}return e.prototype.fillData=function(e,r,a){var s="N",i=null,o=!1;this.InsertedRecordsCount=0,this._initialCurrRecId=t.Int32.MinValue;for(var l=a.getNextTag();null!==l&&"rec"===l;){var u=new gt(e);u.Initialize();var c=u.fillData(a);if(c&&!e.HasMainTable){var _=void 0,T=_=u.getDcRefs();try{for(var h=0;h<this.getSize();h+=1)this.getRecByIdx(h).setDcRefs(T)}finally{null!==_&&_.Dispose()}}c?("C"!==e.getTask().getMode()&&u.setOldRec(),this._initialCurrRecId=u.getId(),this._serverCurrRec=u.replicate(),s="N"===s?"C":"F"):(u.setOldRec(),s="T");var p=this.getRecord(u.getId());if(null!==p){var g=p.Updated,d=p.Modified,E=p.isComputed(),I=p.getPrevRec(),f=p.getNextRec();p.setSameAs(u,!1),p.setPrevRec(I),p.setNextRec(f),p.setComputed(E),d&&p.setModified(),g&&p.setUpdated()}else this.InsertRecord(r,u),e.getTask().isTableWithAbsolutesScrollbar()&&(0===e.TotalRecordsCount&&0==e.RecordsBeforeCurrentView&&(e.TotalRecordsCount=e.TotalRecordsCount+1),e.RecordsBeforeCurrentView>0&&"B"===r&&(e.RecordsBeforeCurrentView=e.RecordsBeforeCurrentView-1)),c&&"C"===e.getTask().getMode()&&u.setMode(n.DataModificationTypes.Insert),u.setComputed(!0);l=a.getNextTag(),c||(i=u),o=!0}for(var C=0;!e.HasMainTable&&null!==i&&C<e.getChunkSize()-1;){var A=new gt(e);A.Initialize(),A.setSameAs(i,!1,i.getId()+C+1),A.setOldRec(),this.addRec(A),C+=1}return this._initialCurrRecId===t.Int32.MinValue&&(o?this._serverCurrRec=null:null!==e.getCurrRec()?this._serverCurrRec=e.getCurrRec().replicate():this._serverCurrRec=null),s},e.prototype.InsertRecord=function(e,t){if("B"===e){var r=this.InsertedRecordsCount;this.InsertedRecordsCount=r+1,this.insertRecord(t,0)}else this.addRec(t)},e.prototype.buildXML=function(t,r,a,s){for(var i=0;i<this._records.length;i+=1){var o=this._records.get_Item(i);if(o.SendToServer&&(!a||o.getId()!==s)){for(var l=void 0,u=l=o.getPrevRec(),c=void 0;null!=l&&(l.getMode()===n.DataModificationTypes.Insert||!l.SendToServer)&&o.getMode()===n.DataModificationTypes.Insert&&((c=this.getRecIdx(l.getId()))>i||c===e.REC_NOT_FOUND||!l.SendToServer);)l=l.getPrevRec(),o.setPrevRec(l);o.buildXML(r,!1),l!==u&&o.setPrevRec(u)}}},e.prototype.getRecord=function(e){return this._hashTab.get_Item(e)},e.prototype.getRecIdx=function(t){var r=e.REC_NOT_FOUND,n=this.getRecord(t);return null!==n&&(r=this._records.indexOf(n)),r},e.prototype.getRecByIdx=function(e){return e<0||e>=this._records.length?(r.Logger.Instance.WriteDevToLog("in RecordsTable.getRecByIdx() index out of bounds: "+e),null):this._records.get_Item(e)},e.prototype.removeAll=function(){this._records.Clear(),this._hashTab.Clear()},e.prototype.getSize=function(){return this._records.length},e.prototype.getInitialCurrRecId=function(){return this._initialCurrRecId},e.prototype.addRecord=function(e){this._records.indexOf(e)<0&&this.addRec(e)},e.prototype.addRec=function(e){if(this._useLinkedList&&this._records.length>0){var t=this._records.get_Item(this._records.length-1);t.setNextRec(e),e.setPrevRec(t)}this._records.push(e),this._hashTab.set_Item(e.getHashKey(),e)},e.prototype.insertRecord=function(e,t){if(this._useLinkedList){if(t>0){var r=this._records.get_Item(t-1);e.setPrevRec(r),r.setNextRec(e)}if(t!==this._records.length){var n=this._records.get_Item(t);e.setNextRec(n),n.setPrevRec(e)}}this._records.Insert(t,e),this._hashTab.set_Item(e.getHashKey(),e)},e.prototype.removeRecord=function(e){1!==arguments.length||null!==e&&e.constructor!==Number?this.removeRecord_1(e):this.removeRecord_0(e)},e.prototype.removeRecord_0=function(e){if(e>=0&&e<this._records.length){var r=this._records.get_Item(e);if(this._useLinkedList){if(e>0)this._records.get_Item(e-1).setNextRec(r.getNextRec());if(e+1<this._records.length)this._records.get_Item(e+1).setPrevRec(r.getPrevRec())}return this._hashTab.Remove(r.getHashKey()),void this._records.RemoveAt(e)}throw new t.ApplicationException("in RecordsTable.removeRecord(): invalid index: "+e)},e.prototype.removeRecord_1=function(e){var t=this._records.indexOf(e);t>=0&&this.removeRecord(t)},e.prototype.replicate=function(){var r=new e(this);r._records=new t.List,r._hashTab=new t.Hashtable(100,.7);for(var n=0;n<this._records.length;n+=1){var a=this._records.get_Item(n).replicate();r._records.push(a),r._hashTab.set_Item(a.getHashKey(),a)}return r},e.prototype.getServerCurrRec=function(){return this._serverCurrRec},e.prototype.zeroServerCurrRec=function(){this._serverCurrRec=null},e.prototype.GetSize=function(){return this.getSize()},e.prototype.GetRecByIdx=function(e){return this.getRecByIdx(e)},e.prototype.RemoveAll=function(){this.removeAll()},e}();Et.REC_NOT_FOUND=-1;var It,ft=function(){function e(e){this._cond=null,this._task=null,this.Loc=null,this._dir="\0",this._id=0,this._keyIdx=0,this._retVal=null,this.returnfield=null,this.LinkStartAfterField=0,this.KeyExpression=0,this._task=e,this._keyIdx=-1,this._cond=new st(!0)}return Object.defineProperty(e.prototype,"ReturnField",{get:function(){return null===this.returnfield&&null!==this._retVal&&(this.returnfield=this.Task.getFieldByValueStr(this._retVal)),this.returnfield},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"IsMainSource",{get:function(){return-1===this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Task",{get:function(){return this._task},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Fields",{get:function(){return this._task.DataView.GetFieldsTab().getLinkFields(this._id)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"LinkEvaluateCondition",{get:function(){return this._linkEvalCondition},enumerable:!1,configurable:!0}),e.prototype.SetAttributes=function(e){var t=this;e.Keys.forEach((function(r){t.setAttribute(r,e.get_Item(r))}))},e.prototype.setAttribute=function(e,n){switch(e){case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(n);break;case E.MG_ATTR_KEY:this._keyIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_KEY_EXP:this.KeyExpression=r.XmlParser.getInt(n);break;case E.MG_ATTR_DIR:this._dir=n[0];break;case E.MG_ATTR_COND:case E.MG_ATTR_COND_RES:this._cond.setVal(this._task,n);break;case E.MG_ATTR_RET_VAL:this._retVal=n;break;case E.MG_ATTR_LINK_EVAL_CONDITION:this._linkEvalCondition=n[0];break;case E.MG_ATTR_LINK_MODE:this.Mode=n[0];break;case E.MG_ATTR_LINK_START:this.LinkStartAfterField=r.XmlParser.getInt(n);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e))}},e.prototype.InitLinkFields=function(e){return T(this,void 0,void 0,(function(){var r,n,a,s;return h(this,(function(i){switch(i.label){case 0:r=0,i.label=1;case 1:return r<this.Fields.length?(n=this.Fields.get_Item(r),a=new t.RefParam(n.isNull()),s=new t.RefParam(n.getValue(!1)),[4,n.getInitExpVal(s,a)]):[3,4];case 2:i.sent(),e.SetFieldValue(n.getId(),a.value,s.value),n.invalidate(!0,!1),i.label=3;case 3:return r++,[3,1];case 4:return[2]}}))}))},e}();e.Recompute_RcmpBy=void 0,(It=e.Recompute_RcmpBy||(e.Recompute_RcmpBy={})).CLIENT="C",It.SERVER_ON_CHANGE="O";var Ct=function(){function a(){this._ctrlProps=null,this._formProps=null,this._isOwnerFld=!0,this.OwnerFld=null,this._rcmpOrder=null,this._subForms=null,this._subFormsOnlyRecomp=!1,this._hasServerLinksRecomputes=!1,this.RcmpMode=null,this.Task=null}return a.prototype.fillData=function(e,t,r){for(this.Task=t,this._isOwnerFld=!0;this.initInnerObjects(r,r.getNextTag(),e););},a.prototype.initInnerObjects=function(e,t,a){switch(t){case r.XMLConstants.MG_TAG_FLD:this._isOwnerFld?(this.fillFldField(e,a),this._isOwnerFld=!1):this.fillFldField(e,a);break;case E.MG_TAG_LINK:this.fillLink(e,a);break;case r.XMLConstants.MG_TAG_CONTROL:null==this._ctrlProps&&(this._ctrlProps=new n.PropTable),this._ctrlProps.fillDataByExists(this.Task,e),null!=this._ctrlProps.getCtrlRef()&&this._ctrlProps.getCtrlRef().IsRepeatable&&this.OwnerFld.IsVirtual&&!this.OwnerFld.hasInitExp()&&this.OwnerFld.causeTableInvalidation(!0);break;case r.XMLConstants.MG_TAG_FORM_PROPERTIES:null==this._formProps&&(this._formProps=new n.PropTable),this._formProps.fillDataByExists(this.Task,e);break;case E.MG_TAG_FLD_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute. Insert else if to Recompute.initInnerObjects for "+t),!1}return!0},a.prototype.AddRecomputeItem=function(e){null===this._rcmpOrder&&(this._rcmpOrder=new t.List),this._rcmpOrder.push(e)},a.prototype.fillLink=function(e,t){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_LINK)+E.MG_TAG_LINK.length);for(var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),i=0;i<s.length;i+=2){var o=s.get_Item(i),l=s.get_Item(i+1);o===r.XMLConstants.MG_ATTR_ID?this.AddRecomputeItem(t.getTask().getDataviewHeaders().getDataviewHeaderById(r.XmlParser.getInt(l))):r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute class. Insert case to Recompute.fillLink for "+o)}e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Recompute.fillLink() out of bounds")},a.prototype.fillFldField=function(e,t){var n=e.getXMLdata().indexOf(this._isOwnerFld?r.XMLConstants.TAG_CLOSE:r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_FLD)+r.XMLConstants.MG_TAG_FLD.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.initElements(s,t),this._isOwnerFld?void e.setCurrIndex(++n):void e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of bounds")},a.prototype.initElements=function(e,t){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case r.XMLConstants.MG_ATTR_ID:var i=r.XmlParser.getInt(s),o=t.getField(i);this._isOwnerFld?(this.OwnerFld=o,this.OwnerFld.setRecompute(this)):(o.setRecomputed(),this.AddRecomputeItem(o));break;case E.MG_ATTR_RECOMPUTEBY:this.RcmpMode=s[0];break;case E.MG_ATTR_SUB_FORM_RCMP:this._subFormsOnlyRecomp=!0;break;case E.MG_ATTR_HAS_LINK_RECOMPUTES:this._hasServerLinksRecomputes=!0;break;case r.XMLConstants.MG_ATTR_NAME:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Recompute class. Insert case to Recompute.initElements for "+a)}}},a.prototype.execute=function(t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p,g,d,E;return h(this,(function(h){switch(h.label){case 0:s=this.Task.getMGData().CmdsToServer,h.label=1;case 1:return h.trys.push([1,,36,37]),t.setInRecompute(!0),this.Task.SetInRecompute(!0),this.SetSubformsInRecompute(!0),(l=this._hasServerLinksRecomputes)?[3,4]:(u=this.Task.getForm().AllowedSubformRecompute)?[4,this.checkRefreshSubForms()]:[3,3];case 2:u=h.sent(),h.label=3;case 3:l=u,h.label=4;case 4:return o=l,this.RcmpMode!==e.Recompute_RcmpBy.CLIENT&&o?(c=this._subFormsOnlyRecomp,this.Task.ExecuteClientSubformRefresh=!1,c?[4,this.Task.prepareCache(!0)]:[3,7]):[3,16];case 5:return(c=h.sent())?[4,this.Task.testAndSet(!0)]:[3,7];case 6:c=h.sent(),h.label=7;case 7:return c?[3,9]:(this.Task.DataView.GetFieldsTab().setServerRcmp(!0),i=Qe.CreateRecomputeCommand(this.Task.getTaskTag(),this.OwnerFld.getId(),!this.Task.getForm().AllowedSubformRecompute),s.Add(i),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)]);case 8:h.sent(),h.label=9;case 9:return this.Task.ExecuteClientSubformRefresh?[4,this.RefreshSubforms()]:[3,11];case 10:return h.sent(),[3,15];case 11:return[4,this.recPrefixSubForms()];case 12:return h.sent()?[4,this.recSuffixSubForms()]:[3,14];case 13:h.sent(),h.label=14;case 14:this.Task.CleanDoSubformPrefixSuffix(),h.label=15;case 15:return[3,35];case 16:return h.trys.push([16,34,,35]),U.Instance.addRecompute(this.OwnerFld.getVarName(),this.Task.GetTaskDetails()),null==this._formProps?[3,18]:[4,this._formProps.RefreshDisplay(!1,!1)];case 17:h.sent(),h.label=18;case 18:return null==this._ctrlProps?[3,20]:[4,this._ctrlProps.RefreshDisplay(!1,!1)];case 19:h.sent(),h.label=20;case 20:if(null==this._rcmpOrder)return[3,32];n=0,h.label=21;case 21:return n<this._rcmpOrder.length?this._rcmpOrder.get_Item(n)instanceof M?(a=this._rcmpOrder.get_Item(n),[4,this.fldRcmp(a,!0)]):[3,23]:[3,32];case 22:return h.sent(),[3,31];case 23:return this._rcmpOrder.get_Item(n)instanceof ft?[4,(_=this._rcmpOrder.get_Item(n)).getLinkedRecord(t)]:[3,31];case 24:h.sent(),T=this.Task.DataView.GetFieldsTab().getLinkFields(_.Id),t.setInCompute(!0),p=t.InForceUpdate,t.InForceUpdate=!1,g=0,h.label=25;case 25:return g<T.length?[4,this.fldRcmp(T.get_Item(g),!1)]:[3,28];case 26:h.sent(),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_UPDATED),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_MODIFIED),t.clearFlag(T.get_Item(g).getId(),gt.FLAG_CRSR_MODIFIED),t.clearHistoryFlag(T.get_Item(g).getId()),h.label=27;case 27:return g++,[3,25];case 28:return t.InForceUpdate=p,null==(d=_.ReturnField)?[3,30]:[4,this.fldRcmp(d,!1)];case 29:h.sent(),h.label=30;case 30:t.setInCompute(!1),t.setForceSaveOrg(!0),h.label=31;case 31:return n++,[3,21];case 32:return[4,this.RefreshSubforms()];case 33:return h.sent(),[3,35];case 34:return E=h.sent(),r.Logger.Instance.WriteExceptionToLogWithMsg("in Recompute.execute(): "+E.Message),[3,35];case 35:return this.Task.SetInRecompute(!1),this.SetSubformsInRecompute(!1),[3,37];case 36:return t.buildLinksPosStr(),t.setInRecompute(!1),[7];case 37:return[2]}}))}))},a.prototype.RefreshSubforms=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(n){switch(n.label){case 0:return this.Task.getForm().AllowedSubformRecompute?[4,this.GetSubformsToRefresh()]:[3,5];case 1:e=n.sent(),t=0,n.label=2;case 2:return t<e.length?(r=e.get_Item(t),[4,this.Task.SubformRefresh(r,!0)]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[2]}}))}))},a.prototype.SetSubformsInRecompute=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return[4,this.GetSubformsToRefresh()];case 1:for(t=n.sent(),r=0;r<t.length;r++)t.get_Item(r).SetInRecompute(e);return[2]}}))}))},a.prototype.fldRcmp=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return e.IsVirtual||this.Task.getMode()!==r.Constants.TASK_MODE_QUERY||et.Instance.allowUpdateInQueryMode(this.Task.getCompIdx())?e.isInEvalProcess()?[3,6]:t?[4,e.compute(!0)]:[3,2]:[3,6];case 1:return n.sent(),[3,4];case 2:return[4,e.setValueAndStartRecompute(e.getValue(!1),e.isNull(),!0,!1,!1)];case 3:n.sent(),n.label=4;case 4:return[4,e.updateDisplay()];case 5:n.sent(),n.label=6;case 6:return[2]}}))}))},a.prototype.buildSubFormList=function(){if(null===this._subForms){this._subForms=new t.List;var e=this.Task.getSubTasks();if(null!==e)for(var r=0;r<e.getSize();r+=1){var n=e.getTask(r);null!==n.getForm().getSubFormCtrl()&&n.refreshesOn(this.OwnerFld.getId())&&this._subForms.push(n)}}},a.prototype.RemoveSubform=function(e){this._subForms.Remove(e)},a.prototype.AddSubform=function(e){null===this._subForms&&(this._subForms=new t.List),this._subForms.Contains(e)||this._subForms.push(e)},a.prototype.recSuffixSubForms=function(){return T(this,void 0,void 0,(function(){var e,t,a,s,i;return h(this,(function(l){switch(l.label){case 0:a=!0,this.buildSubFormList(),e=0,l.label=1;case 1:return a&&e<this._subForms.length?(t=this._subForms.get_Item(e),s=t.getForm().getSubFormCtrl(),(i=t.isStarted()&&!s.RefreshOnVisible)?[4,s.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,6];case 2:i=l.sent(),l.label=3;case 3:return i&&!t.InSelect&&t.DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,5];case 4:l.sent(),a=!o.eventsManager.GetStopExecutionFlag(),l.label=5;case 5:return e++,[3,1];case 6:return this.Task.DataView.setPrevCurrRec(),[2,a]}}))}))},a.prototype.checkRefreshSubForms=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!this._subFormsOnlyRecomp,[4,this.GetSubformsToRefresh()];case 1:return t.sent().length>0&&(e=!0),[2,e]}}))}))},a.prototype.GetSubformsToRefresh=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:e=new t.List,this.buildSubFormList(),a=0,l.label=1;case 1:return a<this._subForms.length?(s=this._subForms[a],r=s.getForm().getSubFormCtrl(),(i=s.isStarted())?[4,r.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,8];case 2:i=l.sent(),l.label=3;case 3:return!i||s.InSelect||s.InEndTask?[3,7]:[4,r.checkProp(n.PropInterface.PROP_TYPE_VISIBLE,!0)];case 4:return l.sent(),(o=!r.isVisible())?[4,r.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,6];case 5:o=!l.sent(),l.label=6;case 6:o?r.RefreshOnVisible=!0:e.push(s),l.label=7;case 7:return a++,[3,1];case 8:return[2,e]}}))}))},a.prototype.recPrefixSubForms=function(){return T(this,void 0,void 0,(function(){var e,t,a,s,i;return h(this,(function(l){switch(l.label){case 0:a=!0,this.buildSubFormList(),e=0,l.label=1;case 1:return a&&e<this._subForms.length?(t=this._subForms.get_Item(e),s=t.getForm().getSubFormCtrl(),(i=t.isStarted()&&!s.RefreshOnVisible)?[4,s.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)]:[3,3]):[3,6];case 2:i=l.sent(),l.label=3;case 3:return i&&!t.InSelect&&t.DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(t,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]:[3,5];case 4:l.sent(),a=!o.eventsManager.GetStopExecutionFlag(),l.label=5;case 5:return e++,[3,1];case 6:return[2,a]}}))}))},a.prototype.notifyServerOnChange=function(){return this.RcmpMode===e.Recompute_RcmpBy.SERVER_ON_CHANGE},a.prototype.isServerRcmp=function(){return this.RcmpMode!==e.Recompute_RcmpBy.CLIENT},a}(),At=function(){function e(e,t,n,a,s,i){this._cacheTableFldId=0,this._max=null,this._min=null,this._retType=r.StorageAttribute.NONE,this._size=0,this._maxExpVal=null,this._minExpVal=null,this.DiscardMin=!1,this.DiscardMax=!1,this.MaxEqualsMin=!1,5===arguments.length?this.constructor_0(e,t,n,a,s):this.constructor_1(e,t,n,a,s,i)}return Object.defineProperty(e.prototype,"MaxExpVal",{get:function(){return this._maxExpVal},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"MinExpVal",{get:function(){return this._minExpVal},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e,t,r,n,a){this.constructor_1(e,t,r,n,a,-1)},e.prototype.constructor_1=function(e,t,r,n,a,s){this._retType=n,this._size=a,this._cacheTableFldId=s,-1!==t&&(this._min=e.getExpById(t)),-1!==r&&(this._max=e.getExpById(r))},e.prototype.hasMinExp=function(){return null!==this._min},e.prototype.hasMaxExp=function(){return null!==this._max},e.prototype.getExpType=function(){return this._retType},e.prototype.getCacheTableFldId=function(){return this._cacheTableFldId},e.prototype.compute=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o;return h(this,(function(l){switch(l.label){case 0:return this.hasMinExp()?[4,this._min.evaluateWithResultTypeAndLength(this.getExpType(),this._size)]:[3,3];case 1:return null!==(a=l.sent())&&(a=t.NString.TrimEnd(a,new Array(0))),this._minExpVal=new n.ExpVal(this.getExpType(),null===a,a),this.MaxEqualsMin=this.IsMaxEqualsMin(),this._minExpVal.IsNull||this._minExpVal.Attr!==r.StorageAttribute.ALPHA&&this._minExpVal.Attr!==r.StorageAttribute.UNICODE||(e&&(this._minExpVal.StrVal=n.DisplayConvertor.StringValueToMgValue(this._minExpVal.StrVal,this._minExpVal.Attr,t.Char.MinValue,this._size).toString(),this.MaxEqualsMin=!1),this._minExpVal.StrVal=r.StrUtil.SearchAndReplaceWildChars(this._minExpVal.StrVal,this._size,t.Char.MinValue)),s=this,[4,this._min.DiscardCndRangeResult()];case 2:s.DiscardMin=l.sent(),l.label=3;case 3:return this.hasMaxExp()?[4,this._max.evaluateWithResultTypeAndLength(this.getExpType(),this._size)]:[3,6];case 4:return i=l.sent(),this._maxExpVal=new n.ExpVal(this.getExpType(),null===i,i),this._maxExpVal.IsNull||this._maxExpVal.Attr!==r.StorageAttribute.ALPHA&&this._maxExpVal.Attr!==r.StorageAttribute.UNICODE||(e&&(this._maxExpVal.StrVal=n.DisplayConvertor.StringValueToMgValue(this._maxExpVal.StrVal,this._maxExpVal.Attr,t.Char.MaxValue,this._size)),this._maxExpVal.StrVal=r.StrUtil.SearchAndReplaceWildChars(this._maxExpVal.StrVal,this._size,t.Char.MaxValue)),o=this,[4,this._max.DiscardCndRangeResult()];case 5:o.DiscardMax=l.sent(),l.label=6;case 6:return[2]}}))}))},e.prototype.checkRange=function(e,t){var r=!0,a=new n.ExpVal(this.getExpType(),t,e);if(a.IsNull&&(this.hasMinExp()&&this._minExpVal.IsNull||this.hasMaxExp()&&this._maxExpVal.IsNull))r=!0;else{if(this.hasMinExp())if(this._minExpVal.IsNull||a.IsNull)a.IsNull!==this._minExpVal.IsNull&&(r=!1);else try{ct.val_cmp_any(a,this._minExpVal,!0)<0&&(r=!1)}catch(e){if(!(e instanceof _t))throw e;r=!1}if(this.hasMaxExp()&&r)if(this._maxExpVal.IsNull||a.IsNull)a.IsNull!==this._maxExpVal.IsNull&&(r=!1);else try{ct.val_cmp_any(a,this._maxExpVal,!0)>0&&(r=!1)}catch(e){if(!(e instanceof _t))throw e;r=!1}}return r},e.prototype.IsMaxEqualsMin=function(){var e=!1;return this.hasMaxExp()&&this.hasMinExp()&&this._min.getId()===this._max.getId()&&(e=this._retType!==r.StorageAttribute.ALPHA&&this._retType!==r.StorageAttribute.UNICODE||!this.WildCharExist()),e},e.prototype.WildCharExist=function(){var e=["*","?"],t=!1;if(!this._minExpVal.IsNull)for(var r=this._minExpVal.StrVal,n=0;n<e.length;n+=1)if(r.endsWith(e[n])){t=!0;break}return t},e.prototype.toString=function(){return t.NString.Format("{{Boundary: {0}-{1}, {2}, {3}}}",[this._max,this._max,this._retType,this._size])},e}(),Rt=function(s){function i(e,t){var a=s.call(this,t)||this;return a._linkExp=null,a._recompute=null,a.CacheTableFldIdx=0,a._causeTableInvalidation=!1,a._form=null,a._hasChangeEvent=!1,a._hasZoomHandler=!1,a._inEvalProcess=!1,a._initExp=null,a._invalidValue=!0,a._isLinkFld=!1,a._isVirtual=!1,a._dataviewHeaderId=-1,a._linkCreate=!1,a.Locate=null,a.Range=null,a._isParam=!1,a._isExposedRouteParam=!1,a._isExposedToClient=!0,a._prevIsNull=!1,a._prevValue=null,a._tableName=null,a._indexInTable=-1,a._virAsReal=!1,a._val=null,a.modifiedAtLeastOnce=!1,a._isNull=!1,a._clearVectorType=!0,a._vectorType=null,null===i.NUM0&&(i.NUM0=new n.NUM_TYPE,i.NUM1=new n.NUM_TYPE,i.NUM0.NUM_4_LONG(0),i.NUM1.NUM_4_LONG(1)),a._dataview=e,a._linkExp=new st(!1),n.FieldDef._default_date=n.DisplayConvertor.Instance.disp2mg(r.PICInterface.DEFAULT_DATE,null,new n.PIC("6",r.StorageAttribute.NUMERIC,s.prototype.getTask.call(a).getCompIdx()),s.prototype.getTask.call(a).getCompIdx(),n.BlobType.CONTENT_TYPE_UNKNOWN),a}return u(i,s),Object.defineProperty(i.prototype,"VirAsReal",{get:function(){return this._virAsReal},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsVirtual",{get:function(){return this._isVirtual},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsExposedRouteParam",{get:function(){return this._isExposedRouteParam},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IsExposedToClient",{get:function(){return this._isExposedToClient},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"IndexInTable",{get:function(){return this._indexInTable},enumerable:!1,configurable:!0}),i.prototype.setAttribute=function(e,n){var a=s.prototype.setAttribute.call(this,e,n);if(!a){var i=r.StrUtil.tokenize(n,",");switch(a=!0,e){case E.MG_ATTR_VIRTUAL:this._isVirtual=0!==r.XmlParser.getInt(n);break;case E.MG_ATTR_PARAM:if(this._isParam=0!==r.XmlParser.getInt(n),!this._isVirtual&&this._isParam)throw new t.ApplicationException("in Field.initElements(): non virtual field is defined as a parameter");break;case E.MG_ATTR_EXPOSED_ROUTE_PARAMS:if(this._isExposedRouteParam=0!==r.XmlParser.getInt(n),!this._isParam&&this._isExposedRouteParam)throw new t.ApplicationException("in Field.initElements(): non parameter field is defined as a exposed route parameter");break;case E.MG_ATTR_EXPOSED_TO_CLIENT:0==r.XmlParser.getInt(n)&&(this._isExposedToClient=!1);break;case E.MG_ATTR_VIR_AS_REAL:this._virAsReal=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_LNK_CREATE:this._linkCreate=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_LNKEXP:this._linkExp.setVal(this.getTask(),n);break;case E.MG_ATTR_TABLE_NAME:this._tableName=r.XmlParser.unescape(n);break;case E.MG_ATTR_INDEX_IN_TABLE:this._indexInTable=r.XmlParser.getInt(n);break;case E.MG_ATTR_INIT:var o=r.XmlParser.getInt(n);this._initExp=this.getTask().getExpById(o);break;case r.XMLConstants.MG_ATTR_NAME:break;case E.MG_ATTR_CHACHED_FLD_ID:this.CacheTableFldIdx=t.NNumber.Parse(i[1]);break;case E.MG_ATTR_LOCATE:this.Locate=new At(this.getTask(),t.NNumber.Parse(i[1]),t.NNumber.Parse(i[0]),this.getType(),this.getSize(),this.CacheTableFldIdx);break;case E.MG_ATTR_RANGE:this.Range=new At(this.getTask(),t.NNumber.Parse(i[1]),t.NNumber.Parse(i[0]),this.getType(),this.getSize(),this.CacheTableFldIdx);break;case E.MG_ATTR_LINK:this._dataviewHeaderId=t.NNumber.Parse(n);break;case E.MG_ATTR_IS_LINK_FIELD:this._isLinkFld=r.XmlParser.getBoolean(n);break;default:a=!1,r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e))}}return a},i.prototype.setRecompute=function(e){this._recompute=e},i.prototype.RemoveSubformFromRecompute=function(e){null!==this._recompute&&this._recompute.RemoveSubform(e)},i.prototype.AddSubformRecompute=function(t){null===this._recompute&&(this._recompute=new Ct,this._recompute.Task=s.prototype.getTask.call(this),this._recompute.OwnerFld=this,this._recompute.RcmpMode=e.Recompute_RcmpBy.CLIENT),this._recompute.AddSubform(t)},i.prototype.SetControl=function(e){s.prototype.SetControl.call(this,e),this._isVirtual&&e.IsRepeatable&&null===this._initExp&&(this._causeTableInvalidation=!0)},i.prototype.compute=function(e){var n=Object.create(null,{getTask:{get:function(){return s.prototype.getTask}}});return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=new t.RefParam(this.getValue(!1)),s=new t.RefParam(this._isNull),i=this._dataview.getCurrRec(),l=n.getTask.call(this),u=this._linkCreate&&i.InCompute&&!e&&l.getMode()===r.Constants.TASK_MODE_CREATE,null==this._form&&(this._form=l.getForm()),(null!=this._form&&this._form.InRestore||o.eventsManager.GetStopExecutionFlag())&&(u=!1),c=o.eventsManager.getLastRtEvent(),_=!1,null!=c&&(_=c.getInternalCode()===r.InternalInterface.MG_ACT_CANCEL),this._virAsReal||null!=this._form&&this._form.InRestore||!(this._isVirtual||l.getMode()===r.Constants.TASK_MODE_CREATE&&_||e||u||i.isNewRec()&&!i.isComputed())?[3,3]:(!l.DataView.isEmptyDataview()||l.DataView.isEmptyDataview()&&!this.PartOfDataview)&&(this._isVirtual||l.getMode()===r.Constants.TASK_MODE_CREATE||this._dataview.computeByClient()||!i.InCompute||u||i.lateCompute())?null==this._initExp?[3,2]:[4,this.EvaluateInitExpression(a,s)]:[3,3];case 1:return T.sent(),[3,3];case 2:u&&(a.value=this.getDefaultValue()),T.label=3;case 3:return this._invalidValue&&(this._prevValue=a.value,this._prevIsNull=s.value),[4,this.setValue(a.value,s.value,e,!1,e&&!this._isVirtual,!1,!1)];case 4:return T.sent(),[2]}}))}))},i.prototype.EvaluateInitExpression=function(e,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:t.Debug.Assert(null!==this._initExp),a.label=1;case 1:return a.trys.push([1,,3,4]),this._inEvalProcess=!0,n=e,[4,this._initExp.evaluateWithResultTypeAndLength(this._type,this._size)];case 2:return n.value=a.sent(),[3,4];case 3:return this._inEvalProcess=!1,[7];case 4:return r.value=null===e.value,r.value&&this.NullAllowed&&(e.value=this.getValue(!1)),[2]}}))}))},i.prototype.getValue=function(e){return s.prototype.getTask.call(this).getEvalOldValues()?this.getOriginalValue():(this._invalidValue&&this.takeValFromRec(),this._isNull&&(this._val=this.getValueForNull(e)),this._val)},i.prototype.isChanged=function(e,t){return!(null===this._prevValue||this._prevValue===e&&this._prevIsNull===t)},i.prototype.takeValFromRec=function(){var e=this._dataview.getCurrRec();null!==e&&(this._val=e.GetFieldValue(this._id),this._isNull=e.IsNull(this._id)),this._invalidValue&&(null!==e&&this._causeTableInvalidation&&this.isChanged(this._val,this._isNull)&&null!==this._form&&e.setCauseInvalidation(!0),this._prevValue=this._val,this._prevIsNull=this._isNull,this._invalidValue=!1),this._vectorType=null},i.prototype.getOriginalValue=function(){var e=this._dataview.getOriginalRec();return e.IsNull(this._id)?this.getMagicDefaultValue():e.GetFieldValue(this._id)},i.prototype.isOriginalValueNull=function(){return this._dataview.getOriginalRec().IsNull(this._id)},i.prototype.getValueByRecIdx=function(e){var t=this._dataview.getRecByIdx(e),r=t.GetFieldValue(this._id);return t.IsNull(this._id)?this.getValueForNull(!1):r},i.prototype.getModifiedAtLeastOnce=function(){return this.modifiedAtLeastOnce},i.prototype.isNullByRecIdx=function(e){return this._dataview.getRecByIdx(e).IsNull(this._id)},i.prototype.isEqual=function(e,t,r,n){var a=this._dataview.getRecByIdx(n),s=!1;if(null!=a){var i=a.GetFieldValue(this._id),o=a.IsNull(this._id);s=ct.mgValsEqual(i,o,this._type,e,t,r)}return s},i.prototype.getNewRecValue=function(e){return this._isVirtual&&null==this._initExp?this._val:e?null:this.getDefaultValue()},i.prototype.setValueAndStartRecompute=function(e,t,r,n,s,i){return T(this,void 0,void 0,(function(){return h(this,(function(o){switch(o.label){case 0:return a.isNullOrUndefined(i)&&(i=!1),[4,this.setValueAndStartRecompute_1(e,t,r,n,s,!1)];case 1:return o.sent(),[2]}}))}))},i.prototype.setValueAndStartRecompute_1=function(e,t,r,n,a,s){return T(this,void 0,void 0,(function(){var i,o;return h(this,(function(l){switch(l.label){case 0:return null!=(i=this.getTask())&&i.VewFirst++,[4,this.setValue(e,t,r,n,!this._isVirtual,a,s)];case 1:return o=l.sent(),null===i||1!==i.VewFirst||null===this._form||this.IsEventHandlerField?[3,3]:r&&o?[4,this._form.refreshOnExpressions()]:[3,3];case 2:l.sent(),l.label=3;case 3:return null!=i&&i.VewFirst--,[2]}}))}))},i.prototype.setValue=function(e,a,l,u,c,_,p){var g=Object.create(null,{getTask:{get:function(){return s.prototype.getTask}}});return T(this,void 0,void 0,(function(){var s,T,d,E,I,f,C,A,R,S,M,m,v,b,N,y,O,P,D,k;return h(this,(function(h){switch(h.label){case 0:if(d=!1,f=null,C=this.getCtrl(),S=!1,M=l||p,m=this.getTask(),null===this._form&&(this._form=m.getForm()),a&&!this.NullAllowed&&this._type!==r.StorageAttribute.BLOB_VECTOR&&(e=this.getDefaultValue(),a=!1),this._type!==r.StorageAttribute.NUMERIC||null==e||n.NUM_TYPE.numHexStrIsLong(e)||(v=new n.NUM_TYPE(e),b=new n.PIC(this._picture,this._type,g.getTask.call(this).getCompIdx()),N=b.getDec(),v.round(N),e=v.toXMLrecord()),null==(s=this._dataview.getCurrRec()))throw new t.ApplicationException(pe.Instance.getConstMessage(r.MsgInterface.RT_STR_NO_RECS_IN_RNG));if(!this.IsVirtual&&(m.getMode()===r.Constants.TASK_MODE_QUERY&&!et.Instance.allowUpdateInQueryMode(m.getCompIdx())||s.InForceUpdate&&s.InCompute))return[2,!d];M&&this.getHasChangeEvent()&&((y=new Array(2))[0]=new n.ExpVal(r.StorageAttribute.NUMERIC,!1,null!==C&&C.IsInteractiveUpdate?i.NUM0.toXMLrecord():i.NUM1.toXMLrecord()),y[1]=new n.ExpVal(this.getType(),this.isNull(),this.getValue(!1)),f=new L(y)),null!=C&&(C.IsInteractiveUpdate=!1),this._type!==r.StorageAttribute.UNICODE&&r.UtilStrByteMode.isLocaleDefLangDBCS()?(E=null!=e?this._size-r.UtilStrByteMode.lenB(e):0,null!=e&&this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BLOB_VECTOR&&E<0?this._val=r.UtilStrByteMode.leftB(e,this._size):this._type===r.StorageAttribute.ALPHA&&E>0?this._val=e+t.NString.FromChars(this._spaces,0,E):this._type===r.StorageAttribute.BLOB?this._val=n.BlobType.copyBlob(this._val,e):this._val=e):(E=null!=e?this._size-e.length:0,null!=e&&this._type!==r.StorageAttribute.BLOB&&this._type!==r.StorageAttribute.BLOB_VECTOR&&E<0?this._val=e.substr(0,this._size):(this._type===r.StorageAttribute.ALPHA||this._type===r.StorageAttribute.UNICODE)&&E>0?this._val=e+t.NString.FromChars(this._spaces,0,E):this._type===r.StorageAttribute.BLOB?(null===this._val&&(this._val=this.getMagicDefaultValue()),this._val=n.BlobType.copyBlob(this._val,e)):this._val=e),T=s.GetFieldValue(this._id),O=this._isNull,l||_||null!=this._initExp||(O=s.IsNull(this._id));try{d=ct.mgValsEqual(this._val,a,this._type,T,O,this._type)}catch(e){this._val=this.getMagicDefaultValue(),d=!1}if(this._clearVectorType&&(this._vectorType=null),this._invalidValue&&(this._invalidValue=!1,s.clearFlag(this._id,gt.FLAG_UPDATED),s.clearFlag(this._id,gt.FLAG_MODIFIED)),I=this._linkCreate&&s.InCompute&&!l&&(null==this._form||!this._form.InRestore)&&!o.eventsManager.GetStopExecutionFlag(),!this._isVirtual&&!I||s.isNewRec()||d||(S=!0),!(M||S||s.isNewRec()))return[3,9];if(this.UpdateNull(a,s),c&&s.setFlag(this._id,gt.FLAG_CRSR_MODIFIED),s.setFieldValue(this._id,this._val,u),R=i._variableChangeEvts,A=R.length,M&&this.getHasChangeEvent()&&!R.Contains(this)&&!d&&((P=new w(this)).setInternal(r.InternalInterface.MG_ACT_VARIABLE),P.setArgList(f),R.push(this),R.push(P)),null==this._recompute||!l&&!S||this._dataview.InLocalDataviewCommand)return[3,4];h.label=1;case 1:return h.trys.push([1,,3,4]),S&&(s.InForceUpdate=!0),[4,this._recompute.execute(s)];case 2:return h.sent(),[3,4];case 3:return S&&(s.InForceUpdate=!1),[7];case 4:return this._causeTableInvalidation&&this.isChanged(this._val,a)&&s.setCauseInvalidation(!0),!l&&!S||this._dataview.InLocalDataviewCommand||null==C?[3,6]:C.isChoiceControl()?[4,this.updateDisplay()]:[3,6];case 5:h.sent(),h.label=6;case 6:if(0!==A||!M||!this.getHasChangeEvent())return[3,9];h.label=7;case 7:return R.length>0?(D=R.get_Item(1),R.RemoveAt(0),R.RemoveAt(0),null==G.Instance.getLastFocusedTask()?D.setTask(this.getTask()):((k=G.Instance.getLastFocusedTask()).TaskSuffixExecuted&&(k=null!=k.PathParentTask?k.PathParentTask:k),D.setTask(k)),D.setCtrl(G.getLastFocusedControl()),[4,o.eventsManager.handleEvent(D,!1)]):[3,9];case 8:return h.sent(),[3,7];case 9:return l&&!d&&this.setModified(),[2,!d]}}))}))},i.prototype.UpdateNull=function(e,t){e?t.setFlag(this._id,gt.FLAG_NULL):t.clearFlag(this._id,gt.FLAG_NULL),this._isNull=e},i.prototype.setCellVecValue=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return s=!1,this._type!==r.StorageAttribute.BLOB_VECTOR?[3,2]:(null==this._vectorType&&(this._vectorType=this.isNull()?new n.VectorType(this._vecCellsType,this._vecCellsContentType,this.DefaultValue,this.isNullDefault(),this.NullAllowed,this._vecCellsSize):new n.VectorType(this._val)),this._vecCellsType===r.StorageAttribute.BLOB&&(i=this.getCellDefualtValue(),t=n.BlobType.copyBlob(i,t)),(s=this._vectorType.setVecCell(e,t,a))?(this._clearVectorType=!1,[4,this.setValueAndStartRecompute(this._vectorType.toString(),!1,!0,!1,!1)]):[3,2]);case 1:o.sent(),this._clearVectorType=!0,o.label=2;case 2:return[2,s]}}))}))},i.prototype.getVecCellValue=function(e){return this._type===r.StorageAttribute.BLOB_VECTOR?(null==this._vectorType&&(this._vectorType=new n.VectorType(this._val)),this._vectorType.getVecCell(e)):null},i.prototype.setRecomputed=function(){},i.prototype.invalidate=function(e,t){var r=this._dataview.getCurrRec();(!this._isVirtual||this._virAsReal||null!==this._initExp||e)&&(this._invalidValue=!0),t&&null!==r&&(r.clearFlag(this._id,gt.FLAG_UPDATED),r.clearFlag(this._id,gt.FLAG_MODIFIED))},i.prototype.getTableName=function(){return null==this._tableName?"":this._tableName},i.prototype.getName=function(){return this._isParam?"Parameter."+this.getVarName():this._isVirtual?"Virtual."+this.getVarName():this.getTableName()+"."+this.getVarName()},i.prototype.isNull=function(){return s.prototype.getTask.call(this).getEvalOldValues()?this.isOriginalValueNull():(this._invalidValue&&this.takeValFromRec(),this._isNull)},i.prototype.PrevIsNull=function(){return this._prevIsNull},i.prototype.isModified=function(){return this._dataview.getCurrRec().isFldModified(this._id)},i.prototype.setModified=function(){var e=this._dataview.getCurrRec();e.setFlag(this._id,gt.FLAG_MODIFIED),e.setFlag(this._id,gt.FLAG_MODIFIED_ATLEAST_ONCE),this.IsVirtual&&(this.modifiedAtLeastOnce=!0)},i.prototype.setUpdated=function(){var e=this._dataview.getCurrRec();e.setFlag(this._id,gt.FLAG_UPDATED),e.setUpdated()},i.prototype.isParam=function(){return this._isParam},i.prototype.isInEvalProcess=function(){return this._inEvalProcess},i.prototype.hasInitExp=function(){return null!==this._initExp},i.prototype.isServerRcmp=function(){return null!==this._recompute&&this._recompute.isServerRcmp()},i.prototype.getPicture=function(){return this._picture},i.prototype.getDataviewHeaderId=function(){return this._dataviewHeaderId},Object.defineProperty(i.prototype,"IsLinkField",{get:function(){return this._isLinkFld},enumerable:!1,configurable:!0}),i.prototype.getInitExpVal=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null==this._initExp?[3,2]:[4,this.EvaluateInitExpression(e,t)];case 1:return r.sent(),[3,3];case 2:e.value=this.getDefaultValue(),r.label=3;case 3:return[2]}}))}))},i.prototype.setHasChangeEvent=function(){this._hasChangeEvent=!0},i.prototype.getHasChangeEvent=function(){return this._hasChangeEvent},i.prototype.setHasZoomHandler=function(){this._hasZoomHandler=!0},i.prototype.getHasZoomHandler=function(){return this._hasZoomHandler},i.prototype.isCauseTableInvalidation=function(){return this._causeTableInvalidation},i.prototype.causeTableInvalidation=function(e){this._causeTableInvalidation=e},i.prototype.getValueForNull=function(e){var t;return this.NullAllowed?e&&s.prototype.getTask.call(this).getNullArithmetic()===r.Constants.NULL_ARITH_NULLIFY?t=null:(null===this._nullValue&&(this._nullValue=s.prototype.getMagicDefaultValue.call(this)),t=this._nullValue):t=s.prototype.getMagicDefaultValue.call(this),t},i.prototype.getCtrl=function(){var e;if(null!=this._controls)for(var t=0;t<this._controls.length;t++)if((e=this._controls.get_Item(t)).getForm().getTask()===this.getTask())return e;return null},i.prototype.updateDisplay=function(){var e=Object.create(null,{updateDisplayWithValue:{get:function(){return s.prototype.updateDisplayWithValue}}});return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.updateDisplayWithValue.call(this,this.getDispValue(),this.isNull())];case 1:return t.sent(),[2]}}))}))},i.prototype.getDispValue=function(){return this.isNull()?null!=this._nullDisplay?this.getNullDisplay():s.prototype.getMagicDefaultValue.call(this):this.getValue(!1)},Object.defineProperty(i.prototype,"ShouldCheckRangeInCompute",{get:function(){return this.IsLinkField||this.IsVirtual&&this._dataview.HasMainTable},enumerable:!1,configurable:!0}),i.prototype.IsForArgument=function(e){if(e){if(!this.isParam())return!1}else if(!this.IsVirtual)return!1;return!0},i}(M);Rt.LEAVE_FLAGS=!1,Rt.NUM0=null,Rt.NUM1=null,Rt._variableChangeEvts=new t.List;var St,Mt=function(e){function a(){var t=e.call(this)||this;return t._rmIdx=0,t._rmSize=-1,t._serverRcmpDone=!1,t}return u(a,e),a.prototype.fillData=function(t,r){if(2===arguments.length)e.prototype.fillData.call(this,t,r);else for(;this.initFields(t.getNextTag(),t););},a.prototype.initFields=function(e,t){if(null==e)return!1;if(e!==r.XMLConstants.MG_TAG_FLDH)return!1;var n=this.initField(t);return this._fields.push(n),!0},a.prototype.initField=function(e,t){return 2===arguments.length?this.initField_0(t,e):this.initField_1(e)},a.prototype.initField_0=function(e,t){var r=new Rt(e,this._fields.length);return r.fillData(t),r},a.prototype.initField_1=function(e){var t=new n.FieldDef(this._fields.length);return t.fillData(e),t},a.prototype.getRMSize=function(){return-1===this._rmSize?this._fields.length:this._rmSize},a.prototype.getRMIdx=function(){return this._rmIdx},a.prototype.setRMPos=function(e,t){e<0&&-1!==this._rmSize?r.Logger.Instance.WriteExceptionToLogWithMsg("in FieldsTable.setRMSize(): illegal record main size: "+e):this._rmSize>=0?r.Logger.Instance.WriteExceptionToLogWithMsg("in FieldsTable.setRMSize(): record main size already set !"):(this._rmSize=e,this._rmIdx=t)},a.prototype.getSizeOfField=function(t){var n=e.prototype.getField.call(this,t);return null!==n?n.getSize():(r.Logger.Instance.WriteExceptionToLogWithMsg("FieldTable.GetSizeOfField() field id: "+t),0)},a.prototype.getType=function(t){return e.prototype.getField.call(this,t).getType()},a.prototype.invalidate=function(e,t){for(var r=0;r<this._fields.length;r++){this._fields[r].invalidate(e,t)}},a.prototype.takeValsFromRec=function(){for(var e=0;e<this._fields.length;e++){this._fields[e].takeValFromRec()}},a.prototype.serverRcmpDone=function(){return this._serverRcmpDone},a.prototype.setServerRcmp=function(e){this._serverRcmpDone=e},a.prototype.getLinkFields=function(e){var r=new t.List;return this._fields.forEach((function(t){t.getDataviewHeaderId()===e&&r.push(t)})),r},a.prototype.resetRecomp=function(){this._fields.forEach((function(e){return e.setRecompute(null)}))},a}(n.FieldsTable);e.RecordOutOfDataViewException_ExceptionType=void 0,(St=e.RecordOutOfDataViewException_ExceptionType||(e.RecordOutOfDataViewException_ExceptionType={}))[St.TOP=0]="TOP",St[St.BOTTOM=1]="BOTTOM",St[St.REC_SUFFIX_FAILED=2]="REC_SUFFIX_FAILED",St[St.NONE=3]="NONE";var mt=function(t){function r(r){var n=t.call(this,r===e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED?"Record Suffix Failed":"Record out of the "+(r===e.RecordOutOfDataViewException_ExceptionType.TOP?"top":"bottom")+" bound of the Data View")||this;return n._type=e.RecordOutOfDataViewException_ExceptionType.NONE,n._type=r,n.name="RecordOutOfDataViewException",n}return u(r,t),r.prototype.getEnd=function(){return this._type},r.prototype.noRecord=function(){return this._type===e.RecordOutOfDataViewException_ExceptionType.TOP||this._type===e.RecordOutOfDataViewException_ExceptionType.BOTTOM},r}(t.ApplicationException),vt=function(e){function t(){var t=e.call(this)||this;return t.dcv=null,t.parser=null,t.parser=new r.XmlParser,t}return u(t,e),Object.defineProperty(t.prototype,"SerializedDCVals",{set:function(e){this.parser.setXMLdata(e),this.parser.setCurrIndex(0)},enumerable:!1,configurable:!0}),t.prototype.Build=function(){this.dcv=null;var e=this.parser.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,this.parser.getCurrIndex());if(-1!==e&&e<this.parser.getXMLdata().length){var t=this.parser.getXMLsubstring(e);this.parser.add2CurrIndex(t.indexOf(E.MG_TAG_DC_VALS)+E.MG_TAG_DC_VALS.length);var n=r.XmlParser.getTokens(this.parser.getXMLsubstring(e),r.XMLConstants.XML_ATTR_DELIM);this.dcv=this.CreateDcValues(!1),this.InitDCValues(this.dcv,n)}return this.dcv},t.prototype.InitDCValues=function(e,t){for(var n=r.StorageAttribute.NONE,a=null,s=null,i=0;i<t.length;i+=2){var o=t.get_Item(i),l=t.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:this.SetId(e,r.XmlParser.getInt(l));break;case r.XMLConstants.MG_ATTR_TYPE:n=l[0],this.SetType(e,n);break;case E.MG_ATTR_DISP:l=r.XmlParser.unescape(l),a=this.ParseValues(l,r.StorageAttribute.UNICODE);break;case E.MG_ATTR_LINKED:s=l=r.XmlParser.unescape(l);break;case E.MG_ATTR_NULL_FLAGS:this.SetNullFlags(e,l);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("in DcValues.initElements() unknown attribute: "+o)}}this.SetDisplayValues(e,a),null==s?this.SetLinkValues(e,a):this.SetLinkValues(e,this.ParseValues(s,n))},t.prototype.ParseValues=function(t,n){var a=!1;return(et.Instance.GetDebugLevel()>1||n===r.StorageAttribute.ALPHA||n===r.StorageAttribute.UNICODE||n===r.StorageAttribute.BOOLEAN)&&(a=!0),e.prototype.ParseValues.call(this,t,n,a)},t}(n.DcValuesBuilderBase),Lt=t.Int32.MinValue,bt="P",Nt="</"+E.MG_TAG_DATAVIEW+">",yt=function(s){function i(e){var r=s.call(this)||this;return r._cacheLruTimeStamp=0,r._changed=!1,r._chunkSize=30,r._chunkSizeExpression=0,r._computeBy="\0",r._currRecId=0,r._currRecIdx=0,r._dvPosValue=0,r._firstDv=!0,r._flushUpdates=!1,r._hasMainTable=!0,r._insertAt=" ",r.InLocalDataviewCommand=!1,r._lastCreatedRecId=0,r._lastSessionCounter=t.Int64.MinValue,r._locateFirstRec=-1,r._modifiedRecordsTab=null,r._oldTopRecIdx=t.Int32.MinValue,r._original=null,r._pendingRecovery="N",r._prevCurrRec=null,r._recordsTab=null,r._recovery=E.RECOVERY_NONE,r._rmIdx=0,r._rmSize=0,r._skipParsing=!1,r._topRecId=0,r._topRecIdx=t.Int32.MinValue,r._topRecIdxModified=!1,r._transCleared=!1,r._unknownRcmp="M",r.IsOneWayKey=!1,r._includesFirst=!1,r._includesLast=!1,r._serverTransCacheEmpty=!0,r._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER=null,r.DBViewSize=0,r.Dvcount=0,r.TotalRecordsCount=0,r.RecordsBeforeCurrentView=0,e instanceof b?(r._task=e,r._fieldsTab=new Mt,r._recordsTab=new Et(!0),r._modifiedRecordsTab=new Et(!1)):Object.assign(r,e),r}return u(i,s),Object.defineProperty(i.prototype,"InsertAt",{get:function(){return this._insertAt},set:function(e){this._insertAt=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"CurrRec",{get:function(){return this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER},set:function(e){null!==this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER&&null===e&&this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.resetDcValueId(),this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER=e,null!==this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER&&this._currRec_DO_NOT_USE_DIRECTLY_USE_SETTER_GETTER.SetDcValueId()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"FlushUpdates",{get:function(){return this._flushUpdates},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"HasMainTable",{get:function(){return this._hasMainTable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"CurrentRecId",{get:function(){return this._currRecId},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"FirstRecord",{get:function(){return this._recordsTab.getRecByIdx(0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"LastRecord",{get:function(){return this._recordsTab.getRecByIdx(this._recordsTab.getSize()-1)},enumerable:!1,configurable:!0}),i.prototype.Init=function(){this.init()},i.prototype.IncludesFirst=function(){return this._includesFirst},Object.defineProperty(i.prototype,"ServerTransactionCacheEmpty",{get:function(){return this._serverTransCacheEmpty},enumerable:!1,configurable:!0}),i.prototype.IncludesLast=function(){return this._includesLast},i.prototype.fillHeaderData=function(e){for(;this.initHeaderInnerObjects(e,e.getNextTag()););this.Dvcount=this._task.ctl_itm_4_parent_vee(0,1)},i.prototype.initHeaderInnerObjects=function(e,t){return null!==t&&(t!==r.XMLConstants.MG_TAG_DVHEADER?t==="/"+r.XMLConstants.MG_TAG_DVHEADER&&(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteDevToLog("dvheader found"),this.getHeaderAttributes(e),this._fieldsTab.fillData(e,this),this._fieldsTab.setRMPos(this._rmSize,this._rmIdx),!0))},i.prototype.getHeaderAttributes=function(e){var n,a,s,i,o=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==o&&o<e.getXMLdata().length){a=e.getXMLsubstring(o),e.add2CurrIndex(a.indexOf(r.XMLConstants.MG_TAG_DVHEADER)+r.XMLConstants.MG_TAG_DVHEADER.length),n=r.XmlParser.getTokens(e.getXMLsubstring(o),r.XMLConstants.XML_ATTR_DELIM);for(var l=0;l<n.length;l+=2)switch(s=n.get_Item(l),i=n.get_Item(l+1),s){case E.MG_ATTR_RMPOS:var u=i.indexOf(",");u>-1&&(this._rmSize=t.NNumber.Parse(i.substr(0,u)),this._rmIdx=t.NNumber.Parse(i.substr(u+1)));break;case E.MG_ATTR_COMPUTE_BY:this._computeBy=i[0],"H"===this._computeBy?(this._computeBy="S",this._flushUpdates=!0):this._flushUpdates=!1;break;case E.MG_ATTR_HAS_MAIN_TBL:this._hasMainTable=r.XmlParser.getBoolean(i);break;case E.MG_ATTR_CHUNK_SIZE:this._chunkSize=r.XmlParser.getInt(i);break;case E.MG_ATTR_CHUNK_SIZE_EXPRESSION:this._chunkSizeExpression=r.XmlParser.getInt(i);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("Unknown attribute for <"+r.XMLConstants.MG_TAG_DVHEADER+"> tag: "+s)}e.setCurrIndex(++o)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getHeaderAttributes(): out of bounds")},i.prototype.fillData=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:this._skipParsing=!1,t.label=1;case 1:return[4,this.initInnerObjects(e,e.getNextTag())];case 2:return t.sent()?[3,1]:[3,3];case 3:return this.ResetFirstDv(),[2]}}))}))},i.prototype.GetTransactionBegin=function(){var e="\0",t=this._task.getProp(n.PropInterface.PROP_TYPE_TRASACTION_BEGIN);return null!==t&&(e=t.GetComputedValue().charAt(0)),e},i.prototype.initInnerObjects=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return a=this._task.getForm(),null==n?[2,!1]:n!==E.MG_TAG_DATAVIEW?[3,19]:[4,this.getAttributes(e)];case 1:return s=h.sent(),this._skipParsing?(i=e.getXMLdata().indexOf(Nt,e.getCurrIndex()),e.setCurrIndex(i+Nt.length),[3,18]):[3,2];case 2:return this.fillExecStack(e),this.fillDataDc(e),s&&null!=a&&a.SetTableItemsCount(0,!0),l=this._recordsTab.fillData(this,this._insertAt,e),null!=a&&a.Opened&&("B"===this._insertAt&&(s||this._recordsTab.InsertedRecordsCount>0)?s||!this._task.getForm().isTableWithPagination()?(a.SetTableItemsCount(0,!0),a.setTableItemsCount(!1)):a.InsertTableItems(0,this._recordsTab.InsertedRecordsCount):a.setTableItemsCount(!1)),null!=this.CurrRec&&this.CurrRec.InRecompute&&l===r.Constants.TASK_REFRESH_NONE&&(l=r.Constants.TASK_REFRESH_CURR_REC),s&&(l=r.Constants.TASK_REFRESH_FORM,this._task.IsSubForm&&(this.getTask().DoSubformPrefixSuffix=!0)),this.getTask().SetRefreshType(l),this.UpdateDataviewAfterInsert(),(u=this._recordsTab.getInitialCurrRecId())===t.Int32.MinValue||this._recovery!==E.RECOVERY_NONE&&!this._firstDv?[3,6]:(!this._firstDv||this._recovery!==E.RECOVERY_NONE||0!==this._task.getLevel().charCodeAt(0)&&this._task.getLevel()!==r.Constants.TASK_LEVEL_TASK||this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._fieldsTab.invalidate(!0,Rt.LEAVE_FLAGS),u===this._currRecId?[3,4]:[4,this.setCurrRec(u,!this._firstDv)]);case 3:return h.sent(),this._original=this.CurrRec.replicate(),this._firstDv&&this.takeFldValsFromCurrRec(),null!=this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,5];case 4:this.takeFldValsFromCurrRec(),h.label=5;case 5:return[3,17];case 6:if(!(s&&this._recordsTab.getSize()>0))return[3,17];if(null!=a&&!a.isScreenMode())return[3,11];h.label=7;case 7:return h.trys.push([7,9,,10]),[4,this.setCurrRecByIdx(0,!1,!0,!1,0)];case 8:return h.sent(),[3,10];case 9:if(!((c=h.sent())instanceof mt))throw c;return[3,10];case 10:return[3,16];case 11:this._fieldsTab.invalidate(!0,Rt.LEAVE_FLAGS),this.setTopRecIdx(0),null!=this._task.getForm()&&this._task.getForm().SetTableTopIndex(),h.label=12;case 12:return h.trys.push([12,14,,15]),[4,this.setCurrRecByIdx(0,!1,!0,!0,0)];case 13:return h.sent(),null!=this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,15];case 14:if(!((_=h.sent())instanceof mt))throw _;return[3,15];case 15:this._task.getLevel()===r.Constants.TASK_LEVEL_CONTROL&&null!=this._task.getLastParkedCtrl()&&this._task.getLastParkedCtrl().resetPrevVal(),h.label=16;case 16:this.saveOriginal(),this._fieldsTab.invalidate(!0,M.CLEAR_FLAGS),h.label=17;case 17:if(this._firstDv&&this.setPrevCurrRec(),s&&this._task.IsSubForm&&(this._task.getForm().getSubFormCtrl().RefreshOnVisible=!1),this._recovery===E.RECOVERY_NONE)this.getTask().getAfterRetry(E.RECOVERY_RETRY)&&!this.getTask().IsAfterRetryBeforeBuildXML&&this._task.setLevel(r.Constants.TASK_LEVEL_RECORD);else{switch(T=this.GetTransactionBegin(),p=!0,this._recovery){case E.RECOVERY_ROLLBACK:T===E.TRANS_RECORD_PREFIX?this._task.getMode()!==r.Constants.TASK_MODE_DELETE&&this._task.IsInteractive?(this.getTask().setAfterRetry(E.RECOVERY_ROLLBACK),this.CurrRec.restart(this.CurrRec.getMode()),this.CurrRec.resetModified(),this._original=this.CurrRec.replicate(),this._pendingRecovery="C"):p=!1:T!==E.TRANS_NONE&&(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._pendingRecovery="T",this.getTask().setAfterRetry(E.RECOVERY_ROLLBACK));break;case E.RECOVERY_RETRY:this.RecoveryRetry(T)}p&&(o.eventsManager.setStopExecution(!0),this.getTask().TaskSuffixExecuted=!1)}h.label=18;case 18:return[3,20];case 19:return n==="/"+E.MG_TAG_DATAVIEW?(this._includesFirst&&this._includesLast&&this.isEmpty()&&(this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this.setTopRecIdx(t.Int32.MinValue)),e.setCurrIndex2EndOfTag(),[2,!1]):[2,!1];case 20:return[2,!0]}}))}))},i.prototype.RecoveryRetry=function(e){e===E.TRANS_RECORD_PREFIX?(this._task.setLevel(r.Constants.TASK_LEVEL_RECORD),this.getTask().setTransactionFailed(!0),this.getTask().setAfterRetry(E.RECOVERY_RETRY),this.CurrRec.restart(this.CurrRec.getMode()),this._firstDv||(this.takeFldValsFromCurrRec(),this._pendingRecovery="B")):e!==E.TRANS_NONE&&(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),this._pendingRecovery="S",this.getTask().setAfterRetry(E.RECOVERY_RETRY),this.getTask().setTransactionFailed(!0))},i.prototype.InsertSingleRecord=function(e){this._recordsTab.InsertedRecordsCount=0,this._recordsTab.InsertRecord(this._insertAt,e),this.UpdateDataviewAfterInsert()},i.prototype.UpdateDataviewAfterInsert=function(){if("B"===this._insertAt){var e=this._recordsTab.InsertedRecordsCount;this._currRecIdx!==t.Int32.MinValue&&(this._currRecIdx+=e),this._topRecIdx!==t.Int32.MinValue&&(this._topRecIdx+=e),this._oldTopRecIdx!==t.Int32.MinValue&&(this._oldTopRecIdx+=e)}},i.prototype.getAttributes=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:if(o=null,l=!1,this._recovery=E.RECOVERY_NONE,!(-1!==(u=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()))&&u<e.getXMLdata().length))return[3,31];s=e.getXMLsubstring(u),e.add2CurrIndex(s.indexOf(E.MG_TAG_DATAVIEW)+E.MG_TAG_DATAVIEW.length),a=r.XmlParser.getTokens(e.getXMLsubstring(u),r.XMLConstants.XML_ATTR_DELIM),this._insertAt=" ",c=this.peekInvalidate(a),this._locateFirstRec=0,_=0,h.label=1;case 1:if(!(_<a.length))return[3,30];switch(T=a.get_Item(_),p=a.get_Item(_+1),T){case E.MG_ATTR_INSERT_AT:return[3,2];case E.MG_ATTR_INCLUDE_FIRST:return[3,3];case E.MG_ATTR_INCLUDE_LAST:return[3,4];case E.MG_ATTR_IS_ONEWAY_KEY:return[3,5];case E.MG_ATTR_DBVIEWSIZE:return[3,6];case E.MG_ATTR_INVALIDATE:return[3,7];case E.MG_ATTR_TOP_REC_ID:return[3,8];case E.MG_ATTR_TASKMODE:return[3,9];case E.MG_ATTR_EMPTY_DATAVIEW:return[3,10];case r.XMLConstants.MG_ATTR_TASKID:return[3,11];case E.MG_ATTR_LOW_ID:return[3,12];case E.MG_ATTR_TRANS_STAT:return[3,13];case E.MG_ATTR_RECOVERY:return[3,20];case E.MG_ATTR_DVPOS_VALUE:return[3,21];case E.MG_ATTR_LOCATE_FIRST_ID:return[3,22];case E.MG_ATTR_OFFSET:return[3,23];case E.MG_ATTR_USER_SORT:return[3,24];case E.MG_ATTR_VAL_TOTAL_RECORDS_COUNT:return[3,25];case E.MG_ATTR_VAL_RECORDS_BEFORE_CURRENT_VIEW:return[3,26];case E.MG_ATTR_VAL_SERVER_TRANS_CACHE_EMPTY:return[3,27]}return[3,28];case 2:return this._insertAt=p[0],[3,29];case 3:return i=r.XmlParser.getBoolean(p),this.SetIncludesFirst(i),[3,29];case 4:return i=r.XmlParser.getBoolean(p),this.SetIncludesLast(i),[3,29];case 5:return i=r.XmlParser.getBoolean(p),this.SetOneWayKey(i),[3,29];case 6:return this.DBViewSize=r.XmlParser.getInt(p),[3,29];case 7:return[3,29];case 8:return this._topRecId=t.NNumber.Parse(p),[3,29];case 9:return(this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_NONE||c)&&this._task.setOriginalTaskMode(p),this._task.setProp(n.PropInterface.PROP_TYPE_TASK_MODE,p),[3,29];case 10:return l=!0,[3,29];case 11:return[3,29];case 12:return this._lastCreatedRecId=t.NNumber.Parse(p),[3,29];case 13:switch(g=p[0],g){case"O":return[3,14];case"C":return[3,16]}return[3,18];case 14:return o=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!0),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(o)];case 15:return h.sent(),[3,19];case 16:return o=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!1),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(o)];case 17:return h.sent(),this.getTask().setTransactionFailed(!1),[3,19];case 18:return[3,19];case 19:return[3,29];case 20:return this._task.IsTryingToStop&&this.getTask().setTryingToStop(!1),this.getTask().resetExecEndTask(),this._recovery=p[0],[3,29];case 21:return this._dvPosValue=t.NNumber.Parse(p),[3,29];case 22:return this._locateFirstRec=t.NNumber.Parse(p),[3,29];case 23:return[3,29];case 24:return this._task.getForm().clearTableColumnSortMark(r.XmlParser.getBoolean(p)),[3,29];case 25:return this.TotalRecordsCount=r.XmlParser.getInt(p),[3,29];case 26:return this.RecordsBeforeCurrentView=r.XmlParser.getInt(p),[3,29];case 27:return this._serverTransCacheEmpty=r.XmlParser.getBoolean(p),[3,29];case 28:return r.Logger.Instance.WriteExceptionToLogWithMsg("Unknown attribute for <"+E.MG_TAG_DATAVIEW+"> tag: "+T),[3,29];case 29:return _+=2,[3,1];case 30:return this.setEmptyDataview(l),e.setCurrIndex(++u),[2,c];case 31:return r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getAttributes(): out of bounds"),[2,!1]}}))}))},i.prototype.SetOneWayKey=function(e){this.IsOneWayKey=e},i.prototype.SetIncludesLast=function(e){this._includesLast=e},i.prototype.SetIncludesFirst=function(e){var t=this._includesFirst;if(this._includesFirst=e,this._includesFirst!==t){var r=this._task.getForm();null!==r&&r.SetTableItemsCount(0,!0)}},i.prototype.fillDataDc=function(e){for(var t=new vt,n=e.getNextTag();null!==n&&n===E.MG_TAG_DC_VALS;){var a=e.getCurrIndex();t.SerializedDCVals=e.ReadToEndOfCurrentElement();var s=t.Build();null!==s?this.AddDcValues(s):r.Logger.Instance.WriteExceptionToLogWithMsg("Error while parsing DC values at position "+a),n=e.getNextTag()}},i.prototype.AddDcValues=function(e){this._dcValsCollection.Add(e.getId().toString(),e)},i.prototype.fillExecStack=function(e){for(var t=e.getNextTag(),r=!1;null!==t&&t===E.MG_TAG_EXEC_STACK_ENTRY;)this.fillInnerExecStack(e),t=e.getNextTag(),r=!0;r&&o.eventsManager.reverseServerExecStack()},i.prototype.fillInnerExecStack=function(e){var t,n,a=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex()),s="",i="",l=0;if(-1!==a&&a<e.getXMLdata().length){var u=e.getXMLsubstring(a);e.add2CurrIndex(u.indexOf(E.MG_TAG_EXEC_STACK_ENTRY)+E.MG_TAG_EXEC_STACK_ENTRY.length),t=r.XmlParser.getTokens(e.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM);for(var c=0;c<t.length;c+=2){n=t.get_Item(c);var _=t.get_Item(c+1);switch(n){case r.XMLConstants.MG_ATTR_TASKID:s=_;break;case E.MG_ATTR_HANDLERID:i=_;break;case E.MG_ATTR_OPER_IDX:l=r.XmlParser.getInt(_)}}o.eventsManager.pushServerExecStack(s,i,l),e.setCurrIndex(a+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fillInnerExecStack() out of bounds")},i.prototype.peekInvalidate=function(e){for(var t=Te.GetCommandsProcessor().GetSessionCounter(),n=0;n<e.length;n+=2){if(e.get_Item(n)===E.MG_ATTR_INVALIDATE){var a=e.get_Item(n+1);if(r.XmlParser.getBoolean(a)){if(!(t<this._lastSessionCounter))return this._lastSessionCounter=t,this.clear(),!0;this._skipParsing=!0}return!1}}return!1},i.prototype.getFieldByName=function(e){return null!==this._fieldsTab?this._fieldsTab.getField(e):(r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.getField(String): There is no fieldsTab object"),null)},i.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){var a,s,i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M=this;return h(this,(function(h){switch(h.label){case 0:return s=this._task.getTaskTag(),i=this._task.getBrkLevelIndex(),l=!1,c=this.getTask().GetContextTask(),_=c.IsOffline?"-99999":c.getTaskTag(),e.Append("\n <"+E.MG_TAG_DATAVIEW+" "+r.XMLConstants.MG_ATTR_TASKID+'="'+s+'"'),e.Append(" "+E.MG_ATTR_TASKLEVEL+'="'+i+'"'),u="0",null!=(T=this.getTask().getTriggeringTask())&&(T.IsOffline?(p=T.getCtlIdx(),g=o.mgDataTable.GetMainProgByCtlIdx(-1,p),u=g.getTaskTag()):u=T.getTaskTag()),this._currRecId>t.Int32.MinValue?(null!=this.CurrRec&&e.Append(" "+E.MG_ATTR_CURR_REC+'="'+this._currRecId+'"'),e.Append(" "+E.MG_ATTR_TASKMODE+'="'+this._task.getMode()+'"'),!this._transCleared||oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI||(e.Append(" "+E.MG_ATTR_TRANS_CLEARED+'="1"'),this._transCleared=!1),e.Append(" "+E.MG_ATTR_INVOKER_ID+'="'+_+","+u+'"'),[4,this.getTask().isCached()]):[3,6];case 1:return h.sent()&&e.Append(" "+E.MG_ATTR_DVPOS_VALUE+'="'+this._dvPosValue+'"'),e.Append(" "+E.MG_ATTR_LOOP_COUNTER+'="'+this.getTask().getLoopCounter()+'"'),this._task.IsSubForm?(d=this._task.getForm().getSubFormCtrl(),(I=!d.isVisible())?[4,d.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,3]):[3,4];case 2:I=!h.sent(),h.label=3;case 3:I&&e.Append(" "+E.MG_ATTR_SUBFORM_VISIBLE+'="0"'),h.label=4;case 4:return this._task.IsInteractive||e.Append(" "+E.MG_ATTR_TASK_COUNTER+'="'+this.getTask().getCounter()+'"'),null!=this._task&&this._task.GetComputedProperty(n.PropInterface.PROP_TYPE_PRELOAD_VIEW).GetComputedValueBoolean()&&(e.Append(" "+E.MG_ATTR_LAST_REC_ID+'="'+this._recordsTab.getRecByIdx(this.getSize()-1).getId()+'"'),e.Append(" "+E.MG_ATTR_OLD_FIRST_REC_ID+'="'+this._recordsTab.getRecByIdx(0).getId()+'"')),this._task.IsInteractive&&null!=(f=this._task.getForm())&&this._recordsTab.getSize()>1&&e.Append(" "+E.MG_ATTR_CURR_REC_POS_IN_FORM+'="'+f.getCurrRecPosInForm()+'"'),e.Append(r.XMLConstants.TAG_CLOSE),(this.getTask().ResetRange||null!=this.getTask().UserRngs)&&(e.Append(r.XMLConstants.START_TAG+E.USER_RANGES),this.getTask().ResetRange&&(e.Append(" "+E.CLEAR_RANGE+'="1"'),this.getTask().ResetRange=!1),null!=this.getTask().UserRngs?(this.getTask().buildXMLForRngs(e,this.getTask().UserRngs,!1),this.getTask().UserRngs.Clear(),this.getTask().UserRngs=null):e.Append(r.XMLConstants.TAG_TERM)),(this.getTask().ResetLocate||null!=this.getTask().UserLocs)&&(e.Append(r.XMLConstants.START_TAG+E.USER_LOCATES),this.getTask().ResetLocate&&(e.Append(" "+E.CLEAR_LOCATES+'="1"'),this.getTask().ResetLocate=!1),null!=this.getTask().UserLocs?(this.getTask().buildXMLForRngs(e,this.getTask().UserLocs,!0),this.getTask().UserLocs.Clear(),this.getTask().UserLocs=null):e.Append(r.XMLConstants.TAG_TERM)),(this.getTask().ResetSort||null!=this.getTask().UserSorts)&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_SORTS),this.getTask().ResetSort&&(e.Append(" "+E.CLEAR_SORTS+'="1"'),this.getTask().ResetSort=!1),null!=this.getTask().UserSorts?this.getTask().buildXMLForSorts(e):e.Append(r.XMLConstants.TAG_TERM)),[4,this.getTask().isCached()];case 5:for(h.sent()&&""!==(C=this.getTask().getTaskCache().getDeletedListToXML())&&(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_DEL_LIST),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+this._task.getTaskTag()+'"'),e.Append(" "+E.MG_ATTR_REMOVE+'="'+C+'"'),e.Append(r.XMLConstants.TAG_TERM),this.getTask().getTaskCache().isDeleted(this._dvPosValue)&&this.setChanged(!0),this.getTask().getTaskCache().clearDeletedList()),this._dcValsCollection.Keys.forEach((function(t){(a=M._dcValsCollection.get_Item(t)).HasReferences||(e.Append(r.XMLConstants.START_TAG+E.MG_TAG_DC_VALS),e.Append(" "+r.XMLConstants.MG_ATTR_ID+'="'+a.getId()+'"'),e.Append(" "+E.MG_ATTR_REMOVE+'="1"'),e.Append(r.XMLConstants.TAG_TERM),M._dcValsCollection.Remove(t))})),null!=this.CurrRec&&(l=this.CurrRec.getMode()===n.DataModificationTypes.Delete&&null!=this._modifiedRecordsTab.getRecord(this.CurrRec.getId())&&this.CurrRec.SendToServer),A=!1,null!=this.CurrRec&&null!=this._modifiedRecordsTab.getRecord(this.CurrRec.getId())&&(A=o.eventsManager.isForceExitPreRecordUpdate(this.getTask())),this._modifiedRecordsTab.buildXML(this._fieldsTab,e,A,this.CurrRec.getId()),null!=this._original&&this._original.clearMode(),R=this._modifiedRecordsTab.getSize()-1;R>=0;R--)A&&this._modifiedRecordsTab.getRecByIdx(R).getId()===this.CurrRec.getId()||(this._modifiedRecordsTab.getRecByIdx(R).clearFlagsHistory(),this._modifiedRecordsTab.removeRecord(R));return null==this.CurrRec||l||(S=this._task.isMainProg()&&le.IsSessionReInitializing,this.CurrRec.buildXML(e,!0,S)),[3,7];case 6:e.Append(" "+E.MG_ATTR_INVOKER_ID+'="'+_+","+u+'"'+r.XMLConstants.TAG_CLOSE),h.label=7;case 7:return e.Append("\n </"+E.MG_TAG_DATAVIEW+r.XMLConstants.TAG_CLOSE),[2]}}))}))},i.prototype.getCurrRec=function(){return null===this.CurrRec&&this._currRecId>t.Int32.MinValue&&r.Logger.Instance.WriteExceptionToLogWithMsg("DataView.getCurrRec(): record "+this._currRecId+" not found"),this.CurrRec},i.prototype.getPrevCurrRec=function(){return this._prevCurrRec},i.prototype.getOriginalRec=function(){return null===this._original||this._original.getId()!==this.CurrRec.getId()?this.CurrRec:this._original},i.prototype.setCurrRec=function(e,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return n=this._currRecId,e>t.Int32.MinValue?-1!==(a=this._recordsTab.getRecIdx(e))?[3,1]:(this._original=null,[3,4]):[3,5];case 1:return o.trys.push([1,3,,4]),s=this._currRecId===t.Int32.MinValue,[4,this.setCurrRecByIdx(a,!s,s,r,t.Int32.MinValue)];case 2:return o.sent(),e!==n&&this.saveOriginal(),[2,!0];case 3:if(!((i=o.sent())instanceof mt))throw i;return[3,4];case 4:return[3,6];case 5:this.CurrRec=null,this._original=null,this._currRecId=t.Int32.MinValue,o.label=6;case 6:return[2,!1]}}))}))},i.prototype.setCurrRecByIdx=function(s,i,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,I,f,C,A,R,S;return h(this,(function(h){switch(h.label){case 0:if(_=this._recordsTab.getSize()-1,g=!1,s!==r.Constants.MG_DATAVIEW_FIRST_RECORD)return[3,5];if(this.getTask().isTableWithAbsolutesScrollbar()&&(this.RecordsBeforeCurrentView=0),!this._includesFirst)return[3,1];if(!(this._currRecIdx>=0||this._currRecIdx===t.Int32.MinValue))throw new mt(e.RecordOutOfDataViewException_ExceptionType.TOP);return s=0,g=!0,[3,4];case 1:return[4,this.fetchChunkFromServer("T",i)];case 2:return h.sent(),[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 3:return h.sent(),[2];case 4:return[3,24];case 5:if(s!==r.Constants.MG_DATAVIEW_LAST_RECORD)return[3,13];if(!this._includesLast)return[3,6];if(!(this._currRecIdx<=_))throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);return s=_,g=!0,[3,12];case 6:return this.getTask().isTableWithAbsolutesScrollbar()&&(this.RecordsBeforeCurrentView=this.TotalRecordsCount),[4,this.fetchChunkFromServer("B",i)];case 7:if(h.sent(),!this._includesLast)throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);if(null==(d=this._task.getForm()))return[3,10];h.label=8;case 8:return!this._includesFirst&&d.getRowsInPage()>=this.getSize()?[4,this.fetchChunkFromServer(bt,!1)]:[3,10];case 9:return h.sent(),[3,8];case 10:return[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 11:return h.sent(),[2];case 12:return[3,24];case 13:if(!(s<0))return[3,21];if(this._includesFirst)throw new mt(e.RecordOutOfDataViewException_ExceptionType.TOP);return T=this._recordsTab.getRecByIdx(0),this._recordsTab.getSize()>0||this.IncludesLast()?[4,this.fetchChunkFromServer(bt,i)]:[3,15];case 14:return h.sent(),[3,18];case 15:return 0===this._recordsTab.getSize()&&this.IncludesFirst()?[4,this.fetchChunkFromServer("T",i)]:[3,17];case 16:return h.sent(),[3,18];case 17:r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fetchChunkFromServer() wrong option"),h.label=18;case 18:return 0===(I=null!=T?this._recordsTab.getRecIdx(T.getId()):this._recordsTab.getSize())?[3,20]:[4,this.setCurrRecByIdx(I+s,!1,l,u,Lt)];case 19:h.sent(),h.label=20;case 20:return[2];case 21:if(!(s>_))return[3,24];if(this._includesLast)throw new mt(e.RecordOutOfDataViewException_ExceptionType.BOTTOM);return this.getForm().isRowCreated(s)&&this.getForm().markRowNOTCreated(s),[4,this.fetchChunkFromServer("N",i)];case 22:return h.sent(),[4,this.setCurrRecByIdx(s,!1,l,u,Lt)];case 23:return h.sent(),[2];case 24:return f=!1,C=a.isNullOrUndefined(o.eventsManager.getLastRtEvent())?0:o.eventsManager.getLastRtEvent().getInternalCode(),s>=0&&!this.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)&&C===r.InternalInterface.MG_ACT_CRELINE_ABOVE&&this.getTask().getInCreateLine()&&s==this._currRecIdx&&this._recordsTab.getRecByIdx(s).getMode()==n.DataModificationTypes.Insert&&(f=!0),g||f||s!==this._currRecIdx||l&&u?l||!i||null==this.CurrRec?[3,30]:(A=this._recordsTab.getSize(),(p=this._recordsTab.getRecByIdx(s)).isNewRec()?(R=this._task.getMode()!==r.Constants.TASK_MODE_CREATE)?[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)]:[3,26]:[3,27]):[3,32];case 25:R=!h.sent(),h.label=26;case 26:R&&o.eventsManager.setStopExecution(!0),h.label=27;case 27:return o.eventsManager.GetStopExecutionFlag()?[3,29]:(S=0,this._topRecIdxModified&&(S=this.getTopRecIdx(),this.restoreTopRecIdx()),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]);case 28:h.sent(),this._topRecIdxModified&&this.setTopRecIdx(S),h.label=29;case 29:if(o.eventsManager.GetStopExecutionFlag())throw new mt(e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);if(p!==this.CurrRec&&this.getTask().getAfterRetry()&&this._task.setLevel(r.Constants.TASK_LEVEL_TASK),A-1===this._recordsTab.getSize()&&this._currRecIdx<s&&s--,s===this._currRecIdx)return this._task.getMode()!==r.Constants.TASK_MODE_CREATE||this.CurrRec.isNewRec()||this._task.getForm().inRefreshDisplay()||this._task.setMode(r.Constants.TASK_MODE_MODIFY),[2];h.label=30;case 30:if(this.CurrRec=this._recordsTab.getRecByIdx(s),null==this.CurrRec)throw new t.ApplicationException("in DataView.setCurrRecByIdx() current record not found!");return this._currRecId=this.CurrRec.getId(),this._currRecIdx=s,null!=this._task.getForm()&&(c===Lt?this._task.getForm().updateDisplayLineByDV():this._task.getForm().DisplayLine=c),this._task.getMode()!==r.Constants.TASK_MODE_CREATE||this.CurrRec.isNewRec()||this._task.getForm().inRefreshDisplay()||this._task.setMode(r.Constants.TASK_MODE_MODIFY),u?[4,this.currRecCompute(!1)]:[3,32];case 31:h.sent(),h.label=32;case 32:return[2]}}))}))},i.prototype.currRecCompute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this._fieldsTab.invalidate(!1,!0),[4,this.compute(!1,e)];case 1:return t.sent(),[2]}}))}))},i.prototype.saveOriginal=function(){this.CurrRec.Modified||(this._original=this.CurrRec.replicate())},i.prototype.fetchChunkFromServer=function(t,n){return T(this,void 0,void 0,(function(){var a,s,i;return h(this,(function(l){switch(l.label){case 0:return this._task.getForm().FormRefreshed=!0,n&&null!=this.CurrRec?[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,2];case 1:if(l.sent(),o.eventsManager.GetStopExecutionFlag()||this._task.isAborting())throw new mt(e.RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED);this._task.getForm().setSuffixDone(),l.label=2;case 2:switch(s=this._currRecId,t){case"T":a=r.InternalInterface.MG_ACT_DATAVIEW_TOP;break;case"B":a=r.InternalInterface.MG_ACT_DATAVIEW_BOTTOM;break;case bt:s=null==this.FirstRecord?0:this.FirstRecord.getId(),a=r.InternalInterface.MG_ACT_CACHE_PREV;break;case"N":a=r.InternalInterface.MG_ACT_CACHE_NEXT,s=null==this.LastRecord?0:this.LastRecord.getId();break;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("in DataView.fetchChunkFromServer() unknown chunk id: "+t),[2]}return(i=Qe.CreateEventCommand(this._task.getTaskTag(),a)).ClientRecId=s,[4,this.getTask().DataviewManager.Execute(i)];case 3:return l.sent(),[2]}}))}))},i.prototype.FetchRecordsAheadFromServer=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._includesLast?[3,2]:[4,this.fetchChunkFromServer("N",!1)];case 1:return e.sent(),[3,4];case 2:return this._includesFirst?[3,4]:[4,this.fetchChunkFromServer(bt,!1)];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))},i.prototype.recExists=function(e){var t=this._recordsTab.getSize()-1;return e>=0&&e<=t},i.prototype.checkFirst=function(e){return null!==this._recordsTab.getRecord(e)},i.prototype.getCurrRecIdx=function(){return this._currRecIdx===t.Int32.MinValue&&(this.setCurrRec(this._currRecId,!0)||r.Logger.Instance.WriteWarningToLogWithMsg("DataView.getCurrRecIdx(): _task "+this.getTask().PreviouslyActiveTaskId+", record "+this._currRecId+" not found")),this._currRecIdx},i.prototype.getCurrDBViewRowIdx=function(){return this.CurrRec.getDBViewRowIdx()},i.prototype.setTopRecIdx=function(e){this._oldTopRecIdx=this.getTopRecIdx(),this._topRecIdx=e},i.prototype.getTopRecIdx=function(){return this._topRecIdx},i.prototype.setTopRecIdxModified=function(e){this._topRecIdxModified=e},i.prototype.getChunkSize=function(){return this._chunkSize},i.prototype.restoreTopRecIdx=function(){this._topRecIdx=this._oldTopRecIdx},i.prototype.clear=function(){this._recordsTab.removeAll(),this._original=null,null!==this._task.getForm()&&this._task.getForm().SetTableItemsCount(0,!0),this._modifiedRecordsTab.removeAll(),this.init()},i.prototype.init=function(){this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this._prevCurrRec=null,this._includesFirst=!1,this._includesLast=!1,this.IsOneWayKey=!1,this.setTopRecIdx(t.Int32.MinValue),this._fieldsTab.invalidate(!1,!0)},i.prototype.computeSubForms=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getTask().prepareCache(!0)];case 1:return e.sent()?[4,this.getTask().testAndSet(!0)]:[3,5];case 2:return e.sent()?[3,4]:[4,this.compute(!0,!1)];case 3:e.sent(),e.label=4;case 4:return[3,7];case 5:return[4,this.compute(!0,!1)];case 6:e.sent(),e.label=7;case 7:return[2]}}))}))},i.prototype.compute=function(e,t){var n=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}}});return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:a=null,s=!this.computeByClient(),i=this._computeBy,t&&(this._computeBy="C"),h.label=1;case 1:return h.trys.push([1,,8,9]),this.CurrRec.setInCompute(!0),e||(this.CurrRec.isNewRec()?this._task.getMode()===r.Constants.TASK_MODE_CREATE||n.isEmptyDataview.call(this)||this._task.setMode(r.Constants.TASK_MODE_CREATE):this._task.getMode()===r.Constants.TASK_MODE_CREATE&&this._task.setMode(r.Constants.TASK_MODE_MODIFY)),o=s,e||o&&!this.CurrRec.isComputed()&&!t?(l=Qe.CreateComputeEventCommand(this._task.getTaskTag(),e,this._currRecId),[4,this._task.DataviewManager.Execute(l)]):[3,3];case 2:return h.sent(),[3,7];case 3:o&&((a=new gt(this.CurrRec.getId(),this)).Initialize(),a.setInitialFldVals(!0,!0)),this._fieldsTab.setServerRcmp(!1),u=this._fieldsTab.getRMIdx(),c=this._fieldsTab.getRMSize(),_=u,h.label=4;case 4:if(!(_<u+c))return[3,7];if(T=this._fieldsTab.getField(_),o&&this._fieldsTab.serverRcmpDone()&&T.IsVirtual&&!T.VirAsReal&&!T.hasInitExp()){p=this.CurrRec,this.CurrRec=a;try{T.takeValFromRec()}finally{this.CurrRec=p}}return this._task.getForm().TransferringDataToGUI?[3,6]:[4,T.compute(!1)];case 5:h.sent(),h.label=6;case 6:return _+=1,[3,4];case 7:return[3,9];case 8:return this.CurrRec.setInCompute(!1),this.CurrRec.setLateCompute(!1),this._computeBy=i,[7];case 9:return[2]}}))}))},i.prototype.addRecord=function(e,t,r){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=--this._lastCreatedRecId,s=n.DataModificationTypes.Insert,[4,this.addRecord_1(e,t,!1,a,s,r)];case 1:return[2,i.sent()]}}))}))},i.prototype.addRecord_1=function(e,n,a,s,i,l){return T(this,void 0,void 0,(function(){var u,c,_,T;return h(this,(function(h){switch(h.label){case 0:(u=new gt(s,this)).Initialize(),u.setInitialFldVals(!1,!a),c=0,c=l?this._currRecIdx>=0?this._currRecIdx:0:this._currRecIdx!=t.Int32.MinValue?this._currRecIdx+1:0,this._recordsTab.insertRecord(u,c),u.setMode(i),h.label=1;case 1:return h.trys.push([1,3,,4]),_=!a,[4,this.setCurrRecByIdx(c,e,n,_,t.Int32.MinValue)];case 2:return h.sent(),a&&this.getTask().getMode()!==r.Constants.TASK_MODE_CREATE&&u.setOldRec(),[3,4];case 3:if(!((T=h.sent())instanceof mt))throw T;if(!o.eventsManager.GetStopExecutionFlag())throw new t.ApplicationException("in DataView.addRecord() invalid exception");return c=-1,[3,4];case 4:return[2,c]}}))}))},i.prototype.removeCurrRec=function(){var e=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}}});return T(this,void 0,void 0,(function(){var t,r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return t=this._task.getForm(),this.CurrRec.getMode()!==n.DataModificationTypes.Insert||this.getTask().transactionFailed(E.TRANS_RECORD_PREFIX)?(this.CurrRec.clearMode(),this.CurrRec.setMode(n.DataModificationTypes.Delete),r=!0):(this._modifiedRecordsTab.removeRecord(this.CurrRec),r=!1),this.CurrRec.removeRecFromDc(),this._recordsTab.removeRecord(this._currRecIdx),this.setChanged(!0),!this.isEmpty()||this._task.IsTryingToStop?[3,2]:[4,this.MoveToEmptyDataviewIfAllowed()];case 1:o.sent(),o.label=2;case 2:a=this.calcLineToMove(r),o.label=3;case 3:return o.trys.push([3,8,,18]),t.isScreenMode()?[4,this.setCurrRecByIdx(a,!1,!1,!0,Lt)]:[3,5];case 4:return o.sent(),[3,7];case 5:return[4,t.setCurrRowByDisplayLine(a,!1,!0)];case 6:o.sent(),o.label=7;case 7:return[3,18];case 8:if(!((s=o.sent())instanceof mt))return[3,16];o.label=9;case 9:return o.trys.push([9,14,,15]),e.isEmptyDataview.call(this)||(a=t.getPrevLine(a)),t.isScreenMode()?[4,this.setCurrRecByIdx(a,!1,!1,!0,Lt)]:[3,11];case 10:return o.sent(),[3,13];case 11:return[4,t.setCurrRowByDisplayLine(a,!1,!0)];case 12:o.sent(),o.label=13;case 13:return[3,15];case 14:if(!((i=o.sent())instanceof mt))throw i;return this.reset(),[3,15];case 15:return[3,17];case 16:throw s;case 17:return[3,18];case 18:return[2]}}))}))},i.prototype.RemoveRecord=function(e){var t=this._recordsTab.getRecIdx(e.getId());this._topRecIdx>t&&this._topRecIdx--,this._oldTopRecIdx>t&&this._oldTopRecIdx--,this._currRecIdx>t&&this._currRecIdx--,this._recordsTab.removeRecord(e)},i.prototype.MoveToEmptyDataviewIfAllowed=function(){var e=Object.create(null,{isEmptyDataview:{get:function(){return s.prototype.isEmptyDataview}},setEmptyDataview:{get:function(){return s.prototype.setEmptyDataview}}});return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return e.isEmptyDataview.call(this)||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,2]:[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW,!0)];case 1:return t.sent()&&e.setEmptyDataview.call(this,!0),[3,3];case 2:this._task.getMode()===r.Constants.TASK_MODE_CREATE&&e.isEmptyDataview.call(this)&&e.setEmptyDataview.call(this,!1),t.label=3;case 3:return[2]}}))}))},i.prototype.calcLineToMove=function(e){return e?this._currRecIdx:this._currRecIdx>0?this._currRecIdx-1:this._currRecIdx},i.prototype.reset=function(){this._currRecId=t.Int32.MinValue,this._currRecIdx=t.Int32.MinValue,this.CurrRec=null,this.setTopRecIdx(t.Int32.MinValue),this.SetIncludesFirst(!0),this.SetIncludesLast(!0)},i.prototype.cancelEdit=function(e,t){return T(this,void 0,void 0,(function(){var r,a,s;return h(this,(function(i){switch(i.label){case 0:return r=null,a=!1,this._task.InEndTask&&(e=!0),this.CurrRec.getMode()===n.DataModificationTypes.Insert&&this.CurrRec.isNewRec()?this._includesFirst&&this._includesLast&&(null===this._recordsTab||1===this._recordsTab.getSize())||!this.HasMainTable?(null!==this._original&&this.CurrRec.setSameAs(this._original,e),[3,3]):[3,1]:[3,4];case 1:return[4,this.removeCurrRec()];case 2:i.sent(),a=!0,this._original=this.CurrRec.replicate(),i.label=3;case 3:return[3,7];case 4:return this.CurrRec.Modified||null!==(s=this._task.getLastParkedCtrl())&&s.resetPrevVal(),t&&(r=this.CurrRec.replicate()),null!==this._original&&this.CurrRec.setSameAs(this._original,e),null===this._original||!t||this.CurrRec.isSameRecData(r,!1,!1)?[3,6]:[4,this.execUnknownRcmps(this._original)];case 5:i.sent(),i.label=6;case 6:this.takeFldValsFromCurrRec(),this._original=this.CurrRec.replicate(),i.label=7;case 7:return[2,a]}}))}))},i.prototype.isEmpty=function(){return this._includesFirst&&this._includesLast&&(null===this._recordsTab||0===this._recordsTab.getSize())},i.prototype.addCurrToModified=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return a.isNullOrUndefined(e)?[4,this.addCurrToModified_0()]:[3,2];case 1:case 3:return t.sent(),[2];case 2:return[4,this.addCurrToModified_1(e)]}}))}))},i.prototype.addCurrToModified_0=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.addCurrToModified(!0)];case 1:return e.sent(),[2]}}))}))},i.prototype.addCurrToModified_1=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return this._modifiedRecordsTab.addRecord(this.CurrRec),e&&this.CurrRec.setOldRec(),t=Qe.CreateSetTransactionStateDataviewCommand(this.getTask().getTaskTag(),!0),[4,this.getTask().DataviewManager.RemoteDataviewManager.Execute(t)];case 1:return r.sent(),[2]}}))}))},i.prototype.takeFldValsFromCurrRec=function(){this._fieldsTab.takeValsFromRec()},i.prototype.currEqualsPrev=function(e){if(null!==this.CurrRec&&null!==this._prevCurrRec){if(this.CurrRec===this._prevCurrRec)return!0;for(var t=0;t<e.length;t+=1)if(!this.CurrRec.fldValsEqual(this._prevCurrRec,e[t]))return!1}else if(this.CurrRec!==this._prevCurrRec)return!1;return!0},i.prototype.getTask=function(){return t.Debug.Assert(this._task instanceof b),this._task},i.prototype.getForm=function(){return this._task.getForm()},i.prototype.modifiedRecordsNumber=function(){return this._modifiedRecordsTab.getSize()},i.prototype.getSize=function(){return this._recordsTab.getSize()},i.prototype.computeByClient=function(){return"C"===this._computeBy},i.prototype.recExistsById=function(e){return null!==this._recordsTab.getRecord(e)},i.prototype.ParametersExist=function(e,t){return 2===arguments.length?this.ParametersExist_0(e,t):this.ParametersExist_1()},i.prototype.ParametersExist_0=function(e,t){for(var r=e;r<e+t;r+=1)if(s.prototype.getField.call(this,r).isParam())return!0;return!1},i.prototype.ParametersExist_1=function(){return this.ParametersExist(this._rmIdx,this._rmSize)},i.prototype.recInModifiedTab=function(e){return null!==this._modifiedRecordsTab.getRecord(e)},i.prototype.setPrevCurrRec=function(e){0!==arguments.length?this.setPrevCurrRec_1(e):this.setPrevCurrRec_0()},i.prototype.setPrevCurrRec_0=function(){this._prevCurrRec=this.CurrRec},i.prototype.setPrevCurrRec_1=function(e){this._prevCurrRec=e},i.prototype.isPrevCurrRecNull=function(){return null===this._prevCurrRec},i.prototype.execUnknownRcmps=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:if(r=this._fieldsTab.getRMIdx(),n=this._fieldsTab.getRMSize(),a=this.getCurrRec(),"M"===this._unknownRcmp)for(t=r;t<r+n&&"M"===this._unknownRcmp;t++)(s=this._fieldsTab.getField(t)).IsVirtual&&!s.hasInitExp()&&s.isServerRcmp()&&(this._unknownRcmp="Y");if("Y"!==this._unknownRcmp||null===a)return[3,4];t=r,l.label=1;case 1:return t<r+n?!(s=this._fieldsTab.getField(t)).IsVirtual||s.hasInitExp()||!s.isServerRcmp()||a.fldValsEqual(e,t)?[3,3]:(i=a.GetFieldValue(t),o=a.IsNull(t),a.setFieldValue(t,e.GetFieldValue(t),!1),[4,s.setValueAndStartRecompute(i,o,!1,!1,!1)]):[3,4];case 2:l.sent(),l.label=3;case 3:return t+=1,[3,1];case 4:return[2]}}))}))},i.prototype.setTransCleared=function(){this._transCleared=!0},i.prototype.processRecovery=function(){return T(this,void 0,void 0,(function(){var t,a,s,i;return h(this,(function(l){switch(l.label){case 0:if(this._task.isAborting())return[3,12];switch(t=this._pendingRecovery,a=o.eventsManager.GetStopExecutionFlag(),this._pendingRecovery="N",a&&o.eventsManager.setStopExecution(!1),(s=this._task.InCtrlPrefix)&&(this._task.InCtrlPrefix=!1),t){case"C":return[3,1];case"B":return[3,3];case"S":return[3,6];case"T":return[3,8]}return[3,10];case 1:return this._task.DataView.getCurrRec().resetUpdated(),this.getTask().getTaskCache().clearCache(),1===this.getSize()&&this._task.getMode()===r.Constants.TASK_MODE_CREATE&&(this.CurrRec.resetModified(),this.CurrRec.clearMode(),this.CurrRec.setMode(n.DataModificationTypes.Insert),this.CurrRec.setNewRec(),this._original.setSameAs(this.CurrRec,!1)),[4,o.eventsManager.handleInternalEventWithTaskAndEventSubtype(this.getTask(),r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelWithNoRollback)];case 2:return l.sent(),[3,11];case 3:return null===(i=this._task.getLastParkedCtrl())?[3,5]:[4,i.invoke()];case 4:l.sent(),l.label=5;case 5:return[3,11];case 6:return this.getTask().setPreventRecordSuffix(!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_TBL_BEGPAGE)];case 7:return l.sent(),this.getTask().setPreventRecordSuffix(!1),[3,11];case 8:return this._task.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_TBL_BEGTBL)];case 9:return l.sent(),this.getTask().getTaskCache().clearCache(),[3,11];case 10:return o.eventsManager.setStopExecution(a),[3,11];case 11:s&&(this._task.InCtrlPrefix=!0),"N"!==t&&o.eventsManager.setStopExecution(!0,"T"!==t),l.label=12;case 12:return[2]}}))}))},i.prototype.replicate=function(){var e=new i(this);return e._recordsTab=this._recordsTab.replicate(),e._currRecId=e._recordsTab.getRecByIdx(0).getId(),e._currRecIdx=0,e.CurrRec=e._recordsTab.getRecByIdx(0),e._prevCurrRec=e._recordsTab.getRecByIdx(0),e._original=e._recordsTab.getRecByIdx(0),e.setTopRecIdx(t.Int32.MinValue),e},i.prototype.getDvPosValue=function(){return this._dvPosValue},i.prototype.getFirstDv=function(){return this._firstDv},i.prototype.ResetFirstDv=function(){this._firstDv=!1},i.prototype.getCacheLRU=function(){return this._cacheLruTimeStamp},i.prototype.setCacheLRU=function(){this._cacheLruTimeStamp=r.Misc.getSystemMilliseconds()},i.prototype.setSameAs=function(e){var n=Object.create(null,{setEmptyDataview:{get:function(){return s.prototype.setEmptyDataview}}});return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:this._rmSize=e._rmSize,this._rmIdx=e._rmIdx,this._computeBy=e._computeBy,this._flushUpdates=e._flushUpdates,this._currRecId=e._currRecId,this._currRecIdx=e._currRecIdx,this._topRecId=e._topRecId,this.CurrRec=e.CurrRec,this._original=e._original,this._prevCurrRec=null,this._fieldsTab=e._fieldsTab,this._recordsTab=e._recordsTab,this._modifiedRecordsTab=e._modifiedRecordsTab,this._includesFirst=e._includesFirst,this._includesLast=e._includesLast,this._insertAt=e._insertAt,this._lastCreatedRecId=e._lastCreatedRecId,this._task=e._task,this._dcValsCollection=e._dcValsCollection,this._recovery=e._recovery,this._pendingRecovery=e._pendingRecovery,this._hasMainTable=e._hasMainTable,this._chunkSize=e._chunkSize,this._firstDv=e._firstDv,this._lastSessionCounter=e._lastSessionCounter,this._skipParsing=e._skipParsing,this._unknownRcmp=e._unknownRcmp,this._transCleared=e._transCleared,this._dvPosValue=e._dvPosValue,this._cacheLruTimeStamp=e._cacheLruTimeStamp,this._changed=e._changed,this._locateFirstRec=e._locateFirstRec,n.setEmptyDataview.call(this,e.isEmptyDataview()),this._task.setMode(e.taskModeFromCache),s.label=1;case 1:return s.trys.push([1,8,,9]),this.getTask().HasLoacte()?[4,this.setCurrRec(this._locateFirstRec,!0)]:[3,3];case 2:return s.sent(),this.setTopRecIdx(this._recordsTab.getRecIdx(this._locateFirstRec)),[3,5];case 3:return this.getTask().setPreventRecordSuffix(!0),[4,this.setCurrRecByIdx(t.Int32.MinValue,!0,!1,!0,t.Int32.MinValue)];case 4:s.sent(),this.getTask().setPreventRecordSuffix(!1),this.setTopRecIdx(0),s.label=5;case 5:return this._task.getForm().isScreenMode()?[3,7]:(this._task.getForm().isTableWithPagination()&&(this.TotalRecordsCount=e.TotalRecordsCount,this.RecordsBeforeCurrentView=e.RecordsBeforeCurrentView),[4,this.setCurrRecByIdx(this._topRecIdx,!0,!1,!0,t.Int32.MinValue)]);case 6:s.sent(),s.label=7;case 7:return null!==this._task.getForm()&&this._task.getForm().updateDisplayLineByDV(),[3,9];case 8:if(!((a=s.sent())instanceof mt))throw a;return r.Logger.Instance.WriteDevToLog("wrong top record idx in DataView.setSameAs"+a.Message),[3,9];case 9:return[2]}}))}))},i.prototype.setChanged=function(e){this._changed=e},i.prototype.getChanged=function(){return this._changed},i.prototype.getLocateFirstRec=function(){return this._locateFirstRec},i.prototype.setLocateFirstRec=function(e){this._locateFirstRec=e},i.prototype.getRecByIdx=function(e){return this._recordsTab.getRecByIdx(e)},i.prototype.getServerCurrRec=function(){return this._recordsTab.getServerCurrRec()},i.prototype.zeroServerCurrRec=function(){this._recordsTab.zeroServerCurrRec()},i.prototype.inRollback=function(){var e=!1;return this._recovery===E.RECOVERY_ROLLBACK&&this.getTask().isTransactionOwner()&&(e=!0),e},i.prototype.getRecIdx=function(e){return this._recordsTab.getRecIdx(e)},i.prototype.backupCurrent=function(){return this.CurrRec.replicate()},i.prototype.restoreCurrent=function(e){t.Debug.Assert(null!==e),this._currRecId=e.getId(),this._currRecIdx=this._recordsTab.getRecIdx(this._currRecId),this.CurrRec=this._recordsTab.getRecByIdx(this._currRecIdx),this.CurrRec.setSameAs(e,!1),this.takeFldValsFromCurrRec()},i.prototype.GetRecordById=function(e){return this._recordsTab.getRecord(e)},i.prototype.GetModifiedRecord=function(){var e=null;return this._modifiedRecordsTab.getSize()>0&&(t.Debug.Assert(1===this._modifiedRecordsTab.getSize()),e=this._modifiedRecordsTab.getRecByIdx(0)),e},i.prototype.GetCurrentRecId=function(){return this._currRecId},i.prototype.DataviewBoundriesAreChanged=function(e,t){return e!==this.IncludesFirst()||t!==this.IncludesLast()},i.prototype.GetRecordMainIdx=function(){return this._rmIdx},i.prototype.GetRecordMainSize=function(){return this._rmSize},i.prototype.GetRouteParams=function(){for(var e=new t.List,a=0;a<this._fieldsTab.getSize();a++){var s=this._fieldsTab.getField(a),i=void 0;if(s.IsExposedRouteParam&&!s.isNull())switch(s.getType()){case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:i=s.getDispValue(),s.isNull()&&(i=s.getNullDisplay()),i=i.trim(),e.push(0===i.length?" ":i);break;case r.StorageAttribute.BOOLEAN:s.isNull()?e.push(!1):e.push("1"===s.getDispValue().charAt(0));break;case r.StorageAttribute.NUMERIC:i=s.getDispValue(),s.isNull()&&(i=s.getNullDisplay());var o=new n.PIC(s.getPicture(),s.getType(),this.getTask().getCompIdx());i=n.DisplayConvertor.Instance.mg2disp(i,"",o,!0,0,!1),e.push(i)}}return e.length>0?e:null},i}(pt),Ot=function(){function e(e){this._cacheTable=null,this._deletedList=null,this._task=null,this._cacheSize=0,this._recordsBeforeCurrentView=0,this._totalRecordsCount=0,this._task=e,this._cacheTable=new t.Hashtable(100,.7),this._deletedList=new t.List,this._cacheSize=0}return e.prototype.putInCache=function(e){var t=e.getDvPosValue(),r=e.getSize()*e.getCurrRec().getRecSize();return null!==this._cacheTable.get_Item(t)&&this.removeDvFromCache(t,!1),e.setCacheLRU(),e.taskModeFromCache=this._task.getMode(),e.zeroServerCurrRec(),this._cacheTable.set_Item(t,e),this._deletedList.Remove(t),this._cacheSize+=r,this._recordsBeforeCurrentView=e.RecordsBeforeCurrentView,this._totalRecordsCount=e.TotalRecordsCount,!0},e.prototype.removeDvFromCache=function(e,t){var r=this._cacheTable.get_Item(e);return null!==r&&(this._cacheSize-=r.getSize()*r.getCurrRec().getRecSize(),t&&this._deletedList.push(e),this._cacheTable.Remove(e),!0)},e.prototype.getDeletedListToXML=function(){for(var e="",t=0;t<this._deletedList.length;t++)t>0&&(e+=","),e+=this._deletedList.get_Item(t).toString();return e},e.prototype.clearDeletedList=function(){this._deletedList.Clear()},e.prototype.getCachedDataView=function(e){var t=this._cacheTable.get_Item(e);return null!==t&&(t=t.replicate()),t},e.prototype.getLastUsedDv=function(){for(var e=r.Misc.getSystemMilliseconds(),t=-1,n=-1,a=this._cacheTable.Keys;a.MoveNext();){var s=this._cacheTable.get_Item(a.Current),i=e-s.getCacheLRU();i>t&&(t=i,n=s.getDvPosValue())}return n},e.prototype.clearCache=function(){for(var e=new t.List(this._cacheTable.Keys),r=0;r<e.length;r++){var n=e[r];this.removeDvFromCache(n,!0)}if(this._task.hasSubTasks())for(var a=this._task.getSubTasks(),s=0;s<a.getSize();s+=1)a.getTask(s).getTaskCache().clearCache();this._task.DataView.setChanged(!0)},e.prototype.isDeleted=function(e){return this._deletedList.Contains(e)},e}(),Gt=function(){function e(e){this.InnerResult=null,1===arguments.length?this.constructor_0(e):this.constructor_1()}return e.prototype.constructor_0=function(e){this.InnerResult=e},e.prototype.constructor_1=function(){},e.ErroNeedToBeHandled=function(){return!1},e}(),Pt=function(e){function t(t,r){var n=e.call(this)||this;return n.errorDescription=null,n.success=!1,n.ErrorId=null,1!==arguments.length||null!==t&&t.constructor!==String?0===arguments.length?n.constructor_01():2===arguments.length?n.constructor_02(t,r):n.constructor_03(t):n.constructor_00(t),n}return u(t,e),Object.defineProperty(t.prototype,"Success",{get:function(){return this.success},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ErrorDescription",{get:function(){return this.errorDescription},enumerable:!1,configurable:!0}),t.prototype.constructor_00=function(e){this.success=!1,this.ErrorId=e,this.errorDescription=pe.Instance.getConstMessage(e)},t.prototype.constructor_01=function(){this.success=!0,this.ErrorId=""},t.prototype.constructor_02=function(e,t){this.success=!1,this.errorDescription=e},t.prototype.constructor_03=function(e){this.success=e.Success,this.errorDescription=e.ErrorDescription},t.prototype.GetErrorId=function(){return this.ErrorId},t}(Gt);Pt.SuccessfulResult=new Pt;var Dt=function(){function e(){}return e.CreateFirstRecord=function(e){e.AfterFirstRecordPrefix=!0},e.prototype.PrepareTask=function(e){return Pt.SuccessfulResult},e.PreparePropOpenTaskWindow=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(a){switch(a.label){case 0:return t=e.getProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_OPEN_TASK_WINDOW),r=!1,e.isMainProg()&&0!==e.getCtlIdx()?[3,2]:[4,t.getValueBoolean()];case 1:r=a.sent(),a.label=2;case 2:return e.SetOpenWin(r),[2]}}))}))},e.Exit=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,e.Exit(t,r)];case 1:return n.sent(),[2]}}))}))},e.prototype.GetOwnerTransactionTask=function(e){return null},e}(),kt=function(){function e(e,t,r){this._transId=null,this._afterTransRetry=E.RECOVERY_NONE,this._transBegin="\0",this.Opened=!1,this.OwnerTask=null,this.LocalTransactionId=0,this.OwnerTask=e,this._transId=t,this._transBegin=E.TRANS_TASK_PREFIX}return e.prototype.isOwner=function(e){return e===this.OwnerTask},e.prototype.close=function(){this.Opened=!1},e.prototype.open=function(){this.Opened=!0},e.prototype.isOpened=function(){return this.Opened},e.prototype.setAfterRetry=function(e){this._afterTransRetry=e},e.prototype.getAfterRetry=function(e){return 0===arguments.length?this.getAfterRetry_0():this.getAfterRetry_1(e)},e.prototype.getAfterRetry_0=function(){return this._afterTransRetry!==E.RECOVERY_NONE},e.prototype.getAfterRetry_1=function(e){return this._afterTransRetry===e},e.prototype.getLevel=function(){return this._transBegin},e.prototype.setTransBegin=function(e){this._transBegin=e},e.prototype.getTransId=function(){return this._transId},e.prototype.setOwnerTask=function(e){this.OwnerTask=e},e}(),xt=function(){function r(e){this.task=null,this.task=e}return Object.defineProperty(r.prototype,"isClosingTopmostTask",{get:function(){return oe.Instance.StartupMgData.getFirstTask().InEndTask},enumerable:!1,configurable:!0}),r.prototype.AllowTransaction=function(e,t){return t?e===E.TRANS_TASK_PREFIX||e===E.TRANS_RECORD_PREFIX:e===E.TRANS_TASK_PREFIX||e===E.TRANS_RECORD_PREFIX||e===E.TRANS_NONE},r.prototype.PrepareTransactionProperties=function(e,t){var r=this.GetTransactionBeginValue(t);null!==e&&this.AllowTransaction(r,t)&&e.setTransBegin(r)},r.prototype.GetTransactionBeginValue=function(e){var t=E.TRANS_NONE,r=this.task.getProp(n.PropInterface.PROP_TYPE_TRASACTION_BEGIN);if(null!==r){var a=e?r.StudioValue:r.GetComputedValue();null!==a&&(t=a.charAt(0))}return t},r.prototype.checkAndCommit=function(r,n,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:return s=a?E.TRANS_ABORT:E.TRANS_COMMIT,[4,this.ExecuteLocalUpdatesCommand()];case 1:return(i=u.sent()).Success?(o=new t.RefParam(i),[4,this.checkAndCommitPerDataview(this.task.DataviewManager.RemoteDataviewManager,r,n,s,o)]):(this.task.IsInteractive||this.task.abort(),[2,!1]);case 2:if(l=u.sent(),i=o.value,l)return[3,6];if(!(n===E.TRANS_RECORD_PREFIX&&this.task.DataView.modifiedRecordsNumber()>0&&this.task.DataView.FlushUpdates))return[3,6];u.label=3;case 3:return u.trys.push([3,,5,6]),this.task.TryingToCommit=!0,[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 4:return u.sent(),[3,6];case 5:return this.task.TryingToCommit=!1,[7];case 6:return[2,!1]}}))}))},r.prototype.ExecuteLocalUpdatesCommand=function(){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=Qe.CreateDataViewCommand(this.task.getTaskTag(),e.DataViewCommandType.ExecuteLocalUpdates),[4,this.task.DataviewManager.Execute(t)];case 1:return[2,r.sent()]}}))}))},r.prototype.checkAndCommitPerDataview=function(e,t,r,n,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(a.value=new Pt,s=!1,null===(i=e.Transaction)||this.task.isAborting()||!i.isOpened()||!i.isOwner(this.task)||i.getLevel()!==r)return[3,6];o=Qe.CreateTransactionCommand(n,this.task.getTaskTag(),t,r),this.isClosingTopmostTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI&&this.task.getMGData().CmdsToServer.Add(o),u.label=1;case 1:return u.trys.push([1,,4,5]),this.task.TryingToCommit=!0,this.isClosingTopmostTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,3]:(l=a,[4,e.Execute(o)]);case 2:l.value=u.sent(),u.label=3;case 3:return[3,5];case 4:return this.task.TryingToCommit=!1,[7];case 5:s=!0,u.label=6;case 6:return[2,s]}}))}))},r.prototype.HandelTransactionErrorHandlingsRetry=function(e){var t=this.task;null===t.Transaction&&e[0]===E.TRANS_NONE&&(t.TransactionErrorHandlingsRetry=new kt(t,t.getTaskTag(),!1),t.TransactionErrorHandlingsRetry.setTransBegin(E.TRANS_RECORD_PREFIX),e[0]=E.TRANS_RECORD_PREFIX)},r}(),Ft=function(){function e(e){this.Task=null,this.Transaction=null,this.Task=e}return e.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,new Pt]}))}))},e.prototype.GetDbViewRowIdx=function(){return this.Task.DataView.getCurrDBViewRowIdx()},e}(),wt=function(){this.DataviewManager=null},Vt=function(t){function r(e){var r=t.call(this)||this;return r.Command=null,r.Task=null,r.Command=e,e instanceof C&&(r.Task=o.mgDataTable.GetTaskByID(e.TaskTag)),r}return u(r,t),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.Task.getMGData().CmdsToServer.Add(this.Command),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return t.sent(),[2,new Pt]}}))}))},r}(wt),Ut=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return[2,new Pt]}))}))},t}(Vt),Bt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),Object.defineProperty(t.prototype,"execOperCommand",{get:function(){return this.Command},enumerable:!1,configurable:!0}),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.execOperCommand.Operation.operServer(this.execOperCommand.MprgCreator)];case 1:return e.sent(),[2,new Pt(r.MsgInterface.RT_STR_NON_MODIFIABLE)]}}))}))},t}(Vt),Xt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),Object.defineProperty(t.prototype,"dataviewCommand",{get:function(){return this.Command},enumerable:!1,configurable:!0}),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){return null!==this.Task&&null!==(e=this.Task.DataviewManager.RemoteDataviewManager.Transaction)&&(e.Opened=this.dataviewCommand.TransactionIsOpen),[2,new Pt]}))}))},t}(Vt),Ht=function(e){function r(t){var r=e.call(this,t)||this;return r.userRange=null,r.userRange=t.Range,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserRngs&&(this.Task.UserRngs=new t.List),this.Task.UserRngs.push(this.userRange),[2,new Pt]}))}))},r}(Vt),Wt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return this.Task.UserRngs=null,this.Task.ResetRange=!0,[2,new Pt]}))}))},t}(Vt),Kt=function(e){function r(t){var r=e.call(this,t)||this;return r.userRange=null,r.userRange=t.Range,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserLocs&&(this.Task.UserLocs=new t.List),this.Task.UserLocs.push(this.userRange),[2,new Pt]}))}))},r}(Vt),Yt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null!==this.Task.UserLocs&&(this.Task.UserLocs.Clear(),this.Task.UserLocs=null),this.Task.ResetLocate=!0,[2,new Pt]}))}))},t}(Vt),zt=function(e){function r(t){var r=e.call(this,t)||this;return r.sort=null,r.sort=t.Sort,r}return u(r,e),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null===this.Task.UserSorts&&(this.Task.UserSorts=new t.List),this.Task.UserSorts.push(this.sort),[2,new Pt]}))}))},r}(Vt),qt=function(e){function t(t){return e.call(this,t)||this}return u(t,e),t.prototype.Execute=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){return null!==this.Task.UserSorts&&(this.Task.UserSorts.Clear(),this.Task.UserSorts=null),this.Task.ResetSort=!0,[2,new Pt]}))}))},t}(Vt),jt=function(){function e(){this.Value=null,this.Type=r.StorageAttribute.NONE}return e.prototype.SetResultValue=function(e,t){this.Value=e,this.Type=t},e}(),Qt=function(t){function r(e){var r=t.call(this,e)||this;return r.control=null,r.control=e.Control,r}return u(r,t),r.prototype.Execute=function(){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:return t=new jt,r=Qe.CreatecFetchDataControlValuesCommand(this.Task.getTaskTag(),this.control.getName()),this.Task.getMGData().CmdsToServer.Add(r),[4,le.GetInstance().Execute_1(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS,e.CommandsProcessorBase_SessionStage.NORMAL,t)];case 1:for(a.sent(),n=0;n<this.Task.DataView.getSize();n+=1)this.Task.DataView.getRecByIdx(n).AddDcValuesReference(this.control.getDitIdx(),this.control.getDcRef());return this.Task.DataView.getOriginalRec().AddDcValuesReference(this.control.getDitIdx(),this.control.getDcRef()),[2,new Pt]}}))}))},r}(Vt),Zt=function(){function t(){}return t.prototype.CreateDataViewCommand=function(t){var r=new Ut(t),n=t instanceof q?t:null;if(null!==n&&null!==n.Operation&&n.Operation.getType()===E.MG_OPER_UPDATE)r=new Bt(n);else if(t instanceof Ce){var a=t instanceof Ce?t:null;switch(a.CommandType){case e.DataViewCommandType.SetTransactionState:r=new Xt(a);break;case e.DataViewCommandType.AddUserRange:r=new Ht(t);break;case e.DataViewCommandType.ResetUserRange:r=new Wt(t);break;case e.DataViewCommandType.AddUserLocate:r=new Kt(t);break;case e.DataViewCommandType.ResetUserLocate:r=new Yt(t);break;case e.DataViewCommandType.AddUserSort:r=new zt(t);break;case e.DataViewCommandType.ResetUserSort:r=new qt(t);break;case e.DataViewCommandType.ControlItemsRefresh:r=new Qt(t)}}else r=new Vt(t);return r},t}(),Jt=function(e){function t(t){var r=e.call(this,t)||this;return r._remoteDataViewCommandFactory=null,r._remoteDataViewCommandFactory=new Zt,r}return u(t,e),t.prototype.Execute=function(t){var r=Object.create(null,{Execute:{get:function(){return e.prototype.Execute}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return[4,r.Execute.call(this,t)];case 1:return n.sent(),[4,this._remoteDataViewCommandFactory.CreateDataViewCommand(t).Execute()];case 2:return e=n.sent(),[2,new Pt(e)]}}))}))},t}(Ft),$t=function(e){function t(t){var r=e.call(this,t)||this;return r.RemoteDataviewManager=null,r.HasRemoteData=!0,r.RemoteDataviewManager=new Jt(t),r}return u(t,e),Object.defineProperty(t.prototype,"TaskService",{get:function(){return this.Task.TaskService},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CurrentDataviewManager",{get:function(){return this.HasRemoteData?this.RemoteDataviewManager:this.VirtualDataviewManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"VirtualDataviewManager",{get:function(){return this.TaskService.GetDataviewManagerForVirtuals(this.Task)},enumerable:!1,configurable:!0}),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.CurrentDataviewManager.Execute(e)];case 1:return[2,t.sent()]}}))}))},t}(Ft),er=function(){function e(){this._sortTab=null,this._sortTab=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,n,a){if(null===n)return!1;switch(n){case E.MG_TAG_SORTS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_SORT:var s=new Ze;this._sortTab.push(s);var i=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==i&&i<e.getXMLdata().length){var o=e.getXMLsubstring(i);e.add2CurrIndex(o.indexOf(E.MG_TAG_SORT)+E.MG_TAG_SORT.length);var l=new t.List(r.XmlParser.getTokens(e.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM).GetEnumerator());this.InitElements(l,s),e.setCurrIndex(i+r.XMLConstants.TAG_TERM.length)}break;case E.MG_TAG_SORTS_END:return e.setCurrIndex2EndOfTag(),!1}return!0},e.prototype.InitElements=function(e,n){for(var a=0;a<e.length;a+=2){var s=e.get_Item(a),i=e.get_Item(a+1);switch(s){case r.XMLConstants.MG_ATTR_ID:n.fldIdx=r.XmlParser.getInt(i);break;case E.MG_ATTR_DIR:n.dir="A"===i;break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",s))}}},e.prototype.getSort=function(e){return e<0||null===this._sortTab||e>=this._sortTab.length?null:this._sortTab.get_Item(e)},e.prototype.getSize=function(){return null===this._sortTab?0:this._sortTab.length},e.prototype.add=function(e){this._sortTab.push(e)},e}(),tr=function(){function e(){this._createdFormVec=null,this._createdFormVec=new t.List}return e.prototype.add=function(e){this._createdFormVec.push(e)},e.prototype.remove=function(e){this._createdFormVec.Remove(e)},e.prototype.Count=function(){return this._createdFormVec.length},e.prototype.Clear=function(){this._createdFormVec.Clear()},e.prototype.get=function(e){return this._createdFormVec.get_Item(e)},e}(),rr=function(e){function s(){var t=e.call(this)||this;return t.IsMovingInView=!1,t.PrevDisplayLine=0,t.RefreshAllRows=!1,t.IgnoreFirstRecordCycle=!1,t.MovedToFirstControl=!1,t._suffixDone=!1,t.hiddenControlsIsnsList=null,t._transferringDataToGUI=!1,t.isFetchingRecordsAhead=!1,t}return u(s,e),Object.defineProperty(s,"CreatedForms",{get:function(){return s._createdForms},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"InRestore",{get:function(){return this._inRestore},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"TransferringDataToGUI",{get:function(){return this._transferringDataToGUI},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"shouldFetchRecordsAheadFromServer",{get:function(){if(this.isTableWithPagination()){var e=this._tableMgControl.GetComputedProperty(n.PropInterface.PROP_TYPE_SERVER_READ_AHEAD);return null!=e&&e.GetComputedValueBoolean()}return!1},enumerable:!1,configurable:!0}),s.prototype.FetchRecordsAheadFromServer=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this.isFetchingRecordsAhead=!0,[4,this.GetDataview().FetchRecordsAheadFromServer()];case 1:return e.sent(),this.isFetchingRecordsAhead=!1,[2]}}))}))},s.prototype.GetDataview=function(){var e=null;return null!=this._task&&(e=this._task.DataView),e},s.prototype.moveInView=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return a.isNullOrUndefined(r)?[4,this.moveInView_0(e,t)]:[3,2];case 1:return n.sent(),[3,4];case 2:return[4,this.moveInView_1(e,t,r)];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},s.prototype.moveInView_0=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.moveInView(e,t,!0)];case 1:return r.sent(),[2]}}))}))},s.prototype.moveInView_1=function(e,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d,E,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:i=t.Int32.MinValue,u=this.GetDataview().getCurrRec(),c=" ",_=!1,T=!1,p=0,h.label=1;case 1:if(h.trys.push([1,96,97,98]),this.IsMovingInView=!0,g=this.DisplayLine,e!==r.Constants.MOVE_UNIT_TABLE)return[3,15];h.label=2;case 2:return h.trys.push([2,13,,14]),a!==r.Constants.MOVE_DIRECTION_BEGIN?[3,6]:[4,this.GetDataview().setCurrRecByIdx(r.Constants.MG_DATAVIEW_FIRST_RECORD,!0,!1,!0,Lt)];case 3:return h.sent(),this.isLineMode()?(this.GetDataview().setTopRecIdx(0),[4,this.setCurrRowByDisplayLine(0,!1,!1)]):[3,5];case 4:h.sent(),h.label=5;case 5:return[3,11];case 6:return[4,this.GetDataview().setCurrRecByIdx(r.Constants.MG_DATAVIEW_LAST_RECORD,!0,!1,!0,Lt)];case 7:return h.sent(),this.isLineMode()?(this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()-this._rowsInPage+1),this.GetDataview().getTopRecIdx()>=0?[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(),!1,!1)]:[3,9]):[3,11];case 8:return h.sent(),[3,11];case 9:return this.GetDataview().setTopRecIdx(0),[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx(),!1,!1)];case 10:h.sent(),h.label=11;case 11:return this.updateDisplayLineByDV(),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 12:return h.sent(),[3,14];case 13:return(d=h.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(d.Message),[3,14];case 14:return[3,86];case 15:if(this.getTopIndexFromGUI(),E=void 0,e===r.Constants.MOVE_UNIT_PAGE&&this.isLineMode())switch(a){case r.Constants.MOVE_DIRECTION_BEGIN:E=this.GetDataview().getCurrRecIdx()-this.GetDataview().getTopRecIdx();break;case r.Constants.MOVE_DIRECTION_END:I=this.GetDataview().getTopRecIdx()+this._rowsInPage-1,I=Math.min(I,this.GetDataview().getSize()-1),E=I-this.GetDataview().getCurrRecIdx();break;default:_=!0,E=this._rowsInPage}else E=1;if(E=a===r.Constants.MOVE_DIRECTION_PREV||a===r.Constants.MOVE_DIRECTION_BEGIN?-E:E,!this.isLineMode())return[3,72];if((p=this.getVisibleLine())<0&&(p=0,T=!0),p>this._rowsInPage+1&&(p=this._rowsInPage,T=!0),!(e===r.Constants.MOVE_UNIT_PAGE&&(a===r.Constants.MOVE_DIRECTION_NEXT||a===r.Constants.MOVE_DIRECTION_PREV)||e===r.Constants.MOVE_UNIT_ROW&&(a===r.Constants.MOVE_DIRECTION_NEXT&&p===this._rowsInPage-1||a===r.Constants.MOVE_DIRECTION_PREV&&0===p)))return[3,45];if(a===r.Constants.MOVE_DIRECTION_PREV&&(e===r.Constants.MOVE_UNIT_ROW||e===r.Constants.MOVE_UNIT_PAGE)&&0===p&&0===this.GetDataview().getCurrRecIdx()&&this.GetDataview().IncludesFirst())return[2];if(a===r.Constants.MOVE_DIRECTION_NEXT&&e===r.Constants.MOVE_UNIT_PAGE&&p===this.getLastValidRow()&&this.GetDataview().getCurrRecIdx()===this.GetDataview().getSize()-1&&this.GetDataview().IncludesLast())return[2];i=this.GetDataview().getCurrRec().getId(),this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx()+E),this.GetDataview().setTopRecIdxModified(!0),h.label=16;case 16:return h.trys.push([16,19,,44]),this._suffixDone=!1,[4,this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx()+E,!0,!1)];case 17:return h.sent(),this.GetDataview().setTopRecIdxModified(!1),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 18:return h.sent(),[3,44];case 19:return(f=h.sent())instanceof mt?(this.GetDataview().setTopRecIdxModified(!1),o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,21]):[3,43];case 20:return h.sent(),[2];case 21:if(!(this.GetDataview().getTopRecIdx()<0))return[3,29];this.GetDataview().setTopRecIdx(0),h.label=22;case 22:return h.trys.push([22,24,,27]),[4,this.setCurrRowByDisplayLine(0,!0,!1)];case 23:return h.sent(),[3,27];case 24:return h.sent()instanceof t.Exception&&o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,26];case 25:return h.sent(),[2];case 26:return[3,27];case 27:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 28:return h.sent(),[3,42];case 29:return e!==r.Constants.MOVE_UNIT_ROW&&this.GetDataview().recExists(this.GetDataview().getTopRecIdx())?this.GetDataview().getCurrRec().getId()!==i||this._suffixDone?[3,36]:[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,37];case 30:return h.sent(),o.eventsManager.GetStopExecutionFlag()?(this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)]):[3,32];case 31:return h.sent(),[2];case 32:return h.trys.push([32,35,,36]),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 33:return h.sent(),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+this.getLastValidRow(),!1,!0)];case 34:return h.sent(),[3,36];case 35:return h.sent(),[3,36];case 36:return[3,42];case 37:return this.GetDataview().restoreTopRecIdx(),[4,this.restoreOldDisplayLine(g)];case 38:return h.sent(),e!==r.Constants.MOVE_UNIT_ROW||a!==r.Constants.MOVE_DIRECTION_NEXT?[3,41]:this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,39]:(this._task.setExecEndTask(),[3,41]);case 39:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)];case 40:h.sent(),h.label=41;case 41:return[2];case 42:r.Logger.Instance.WriteDevToLog(f.Message),h.label=43;case 43:return[3,44];case 44:return[3,71];case 45:return h.trys.push([45,54,,71]),c=this._task.getMode(),i=this.GetDataview().getCurrRec().getId(),[4,this.setCurrRowByDisplayLine(g+E,!0,!1)];case 46:return h.sent(),this.GetDataview().recExistsById(i)?[3,51]:E>0||c!==r.Constants.TASK_MODE_CREATE?-1!==E||this.GetDataview().recExists(g)?[4,this.setCurrRowByDisplayLine(g,!1,!1)]:[3,48]:[3,49];case 47:return h.sent(),[3,49];case 48:r.Logger.Instance.WriteDevToLog(t.NString.Format("skipped setcurrRow for row {0}",g)),h.label=49;case 49:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 50:return h.sent(),[3,53];case 51:return o.eventsManager.GetStopExecutionFlag()?[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]:[3,53];case 52:h.sent(),h.label=53;case 53:return[3,71];case 54:return(C=h.sent())instanceof mt?this.GetDataview().recExistsById(i)?[4,this.restoreOldDisplayLine(g)]:[3,57]:[3,70];case 55:return h.sent(),u.Synced||c!==r.Constants.TASK_MODE_CREATE||(this._task.setMode(r.Constants.TASK_MODE_CREATE),u.clearMode(),u.setMode(n.DataModificationTypes.Insert),u.setNewRec()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 56:return h.sent(),[3,61];case 57:return c===r.Constants.TASK_MODE_CREATE&&g>0?[4,this.restoreOldDisplayLine(g-1)]:[3,59];case 58:h.sent(),h.label=59;case 59:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 60:h.sent(),h.label=61;case 61:return E<=0||o.eventsManager.GetStopExecutionFlag()?(r.Logger.Instance.WriteDevToLog(C.Message),[3,69]):[3,62];case 62:return this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,63]:(this._task.setExecEndTask(),[2]);case 63:return this._task.ActionManager.isEnabled(r.InternalInterface.MG_ACT_CRELINE)?[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]:[3,65];case 64:return h.sent(),[3,69];case 65:return A=!0,R=new t.RefParam(A),[4,o.eventsManager.DoTaskLevelRecordSuffix(this._task,R)];case 66:return h.sent()?[3,68]:[4,o.eventsManager.DoTaskLevelRecordPrefix(this._task,this)];case 67:h.sent(),h.label=68;case 68:A=R.value,h.label=69;case 69:return[2];case 70:return[3,71];case 71:return[3,86];case 72:return h.trys.push([72,75,,86]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx()+E,!0,!1,!0,Lt)];case 73:return h.sent(),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 74:return h.sent(),[3,86];case 75:return(S=h.sent())instanceof mt?E>0?this._task.IsInteractive||this._task.getMode()===r.Constants.TASK_MODE_CREATE?[3,76]:(this._task.setExecEndTask(),[3,78]):[3,79]:[3,81];case 76:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)];case 77:h.sent(),h.label=78;case 78:return[3,80];case 79:r.Logger.Instance.WriteDevToLog(S.Message),h.label=80;case 80:return[2];case 81:return S instanceof ae?[4,this._task.stop()]:[3,84];case 82:return h.sent(),this._task.abort(),[4,o.eventsManager.ProcessAbortingError(S)];case 83:return h.sent(),[3,85];case 84:if(S instanceof t.Exception)return r.Logger.Instance.WriteDevToLog(S.Message),[2];h.label=85;case 85:return[3,86];case 86:return _?T?(0===p?this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()):this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()-this._rowsInPage),this.SetTableTopIndex(),[3,89]):[3,87]:[3,90];case 87:return this.SetTableTopIndex(),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+p,!1,!0)];case 88:h.sent(),h.label=89;case 89:return[3,91];case 90:this.SetTableTopIndex(),h.label=91;case 91:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_PREFIX)];case 92:return h.sent(),s?null==(l=this._task.getLastParkedCtrl())?[3,95]:[4,l.invoke()]:[3,95];case 93:return h.sent()?[3,95]:[4,o.eventsManager.HandleNonParkableControls(this._task)];case 94:h.sent(),h.label=95;case 95:return[3,98];case 96:return(M=h.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(M.Message),[3,98];case 97:return this.SelectRow(),this.IsMovingInView=!1,[7];case 98:return[2]}}))}))},s.prototype.addRec=function(e,n,a,s){return T(this,void 0,void 0,(function(){var n,a,i,o;return h(this,(function(l){switch(l.label){case 0:return n=1,a=-1,this._task.DataView.isEmptyDataview()||(a=this.getVisibleLine()),this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount+=1,this.RefreshAllRows=!0),[4,this.GetDataview().addRecord(e,!1,s)];case 1:if(!(l.sent()>-1))return[3,8];if(!this.isLineMode())return[3,7];i=void 0,0===this.GetDataview().getSize()||this.GetDataview().getTopRecIdx()===t.Int32.MinValue?(this.GetDataview().setTopRecIdx(0),i=0):a===this._rowsInPage-1?(this.GetDataview().setTopRecIdx(this.GetDataview().getTopRecIdx()+1),i=this.getVisibleLine()):i=s?a>0?a:0:a+1,n=this.GetDataview().getTopRecIdx()+i,this.removeRecordsAfterIdx(this.GetDataview().getTopRecIdx()+i),l.label=2;case 2:return l.trys.push([2,4,,5]),this._task.DataView.isEmptyDataview()||this._task.setMode(r.Constants.TASK_MODE_CREATE),[4,this.setCurrRowByDisplayLine(n,!1,!1)];case 3:return l.sent(),[3,5];case 4:return(o=l.sent())instanceof mt&&r.Logger.Instance.WriteDevToLog(t.NString.Format("in Form.addRec() {0}",o.Message)),[3,5];case 5:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_TABLE)];case 6:l.sent(),l.label=7;case 7:return[3,9];case 8:this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount-=1,this.RefreshAllRows=!1),l.label=9;case 9:return[2]}}))}))},s.prototype.delCurrRec=function(){var t=Object.create(null,{isLineMode:{get:function(){return e.prototype.isLineMode}},HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e,a;return h(this,(function(s){switch(s.label){case 0:return e=t.isLineMode.call(this)&&this.GetDataview().getTopRecIdx()===this.GetDataview().getCurrRecIdx(),[4,this.GetDataview().removeCurrRec()];case 1:return s.sent(),!this.GetDataview().isEmpty()||this._task.IsTryingToStop?[3,8]:this._task.DataView.isEmptyDataview()?[4,this.addRec(!1,0,0,!1)]:[3,3];case 2:return s.sent(),[3,8];case 3:return[4,this._task.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 4:return s.sent()?(this._task.getMode()!==r.Constants.TASK_MODE_CREATE&&this._task.setMode(r.Constants.TASK_MODE_CREATE),this._task.enableCreateActs(!0),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]):[3,6];case 5:return s.sent(),[3,8];case 6:return[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_EXIT)];case 7:s.sent(),s.label=8;case 8:return this.GetDataview().isEmpty()?[3,18]:(e&&this.GetDataview().setTopRecIdx(this.GetDataview().getCurrRecIdx()),t.isLineMode.call(this)?t.HasTable.call(this)?(this.isTableWithAbsoluteScrollbar()&&(this.GetDataview().TotalRecordsCount--,this.RefreshAllRows=!0),this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)]):[3,10]:[3,13]);case 9:return s.sent(),[3,12];case 10:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 11:s.sent(),s.label=12;case 12:return[3,18];case 13:return s.trys.push([13,15,,16]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(),!0,!0,!0,Lt)];case 14:return s.sent(),[3,16];case 15:if(!((a=s.sent())instanceof mt))throw a;return[3,16];case 16:return[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 17:s.sent(),s.label=18;case 18:return[2]}}))}))},s.prototype.cancelEdit=function(a,s){var i=Object.create(null,{isLineMode:{get:function(){return e.prototype.isLineMode}},HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e,l,u,c,_,T,p,g,d,E,I,f;return h(this,(function(h){switch(h.label){case 0:return e=this._task.getMode(),u=0,c=!1,l=1===this.GetDataview().getSize()&&e===r.Constants.TASK_MODE_CREATE?r.Constants.TASK_MODE_CREATE:r.Constants.TASK_MODE_MODIFY,[4,this.GetDataview().cancelEdit(!1,!1)];case 1:return _=h.sent(),this.GetDataview().setPrevCurrRec(null),!(this.GetDataview().isEmpty()||a&&_&&!n.GuiEnvironment.Environment.GetSpecialCancelOnCreate()&&this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_CREATE)||this._task.IsTryingToStop?[3,3]:(T=this._task.cancelWasRaised(),this._task.setCancelWasRaised(a),[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_CRELINE)]);case 2:return h.sent(),this._task.setCancelWasRaised(T),[3,4];case 3:a&&(c=!0),h.label=4;case 4:if(this.GetDataview().isEmpty())return[3,17];if(!i.isLineMode.call(this))return[3,10];h.label=5;case 5:return h.trys.push([5,8,,9]),i.HasTable.call(this)?(((u=this.getVisibleLine())<0||u>=this._rowsInPage)&&(p=this.GetDataview().getTopRecIdx(),g=this.GetDataview().getCurrRecIdx(),p>g&&this.GetDataview().setTopRecIdx(g),u=0),[4,this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx()+u,!1,!0)]):[3,7];case 6:h.sent(),h.label=7;case 7:return[3,9];case 8:if(!((d=h.sent())instanceof mt))throw d;return 0!==u&&r.Logger.Instance.WriteDevToLog(t.NString.Format("in Form.cancelEdit() {0}",d.Message)),[3,9];case 9:return i.HasTable.call(this)&&(this.isTableWithAbsoluteScrollbar()&&_&&(this.GetDataview().TotalRecordsCount--,this.RefreshAllRows=!0),this.removeRecordsAfterIdx(this.GetDataview().getCurrRecIdx())),[3,13];case 10:return h.trys.push([10,12,,13]),[4,this.GetDataview().setCurrRecByIdx(this.GetDataview().getCurrRecIdx(),!1,!0,!0,Lt)];case 11:return h.sent(),[3,13];case 12:if(!((E=h.sent())instanceof mt))throw E;return r.Logger.Instance.WriteDevToLog("in Form.cancelEdit() error in Screen mode for Current Record"),[3,13];case 13:return this._task.setMode(l),this._task.InEndTask?[3,15]:[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 14:h.sent(),h.label=15;case 15:return this._task.InEndTask?[3,17]:[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 16:h.sent(),h.label=17;case 17:if(!c)return[3,20];if(this._task.setLevel(r.Constants.TASK_LEVEL_TASK),null!==(I=G.getLastFocusedControl()))if(I.getForm().getTask().pathContains(this._task))for(f=I.getForm().getTask();null!==f&&f!==this._task;f=f.getParent())f.setLevel(r.Constants.TASK_LEVEL_TASK),f.DataView.getCurrRec().resetModified();else I.getForm().getTask().setLevel(r.Constants.TASK_LEVEL_TASK);return s?[3,20]:[4,o.eventsManager.handleInternalEventWithTask(this._task,r.InternalInterface.MG_ACT_REC_PREFIX)];case 18:return h.sent(),[4,o.eventsManager.HandleParkabilityOnRowChange(this._task)];case 19:h.sent(),h.label=20;case 20:return[2]}}))}))},s.prototype.refreshOnExpressions=function(){var r=Object.create(null,{refreshPropsOnExpression:{get:function(){return e.prototype.refreshPropsOnExpression}}});return T(this,void 0,void 0,(function(){var e,n;return h(this,(function(a){switch(a.label){case 0:e=0,a.label=1;case 1:return e<this.CtrlTab.getSize()?null==(n=this.CtrlTab.getCtrl(e)instanceof P?this.CtrlTab.getCtrl(e):null)?[3,3]:[4,n.refreshOnExpression()]:[3,5];case 2:return a.sent(),[3,4];case 3:t.Debug.Assert(!1),a.label=4;case 4:return e+=1,[3,1];case 5:return[4,r.refreshPropsOnExpression.call(this)];case 6:return a.sent(),[2]}}))}))},s.prototype.removeRefsToCtrls=function(){var t=G.getLastFocusedControl();null!==t&&t.getForm()===this&&G.setLastFocusedControl(this._task,null),e.prototype.removeRefsToCtrls.call(this)},s.prototype.getCtrlByCtrlName=function(e){return this.CtrlTab.getCtrl(e)},s.prototype.getSubFormCtrlByName=function(e){var n,a=null;for(n=this._task;null===a&&null!==n&&null!==n.getForm()&&(null!=(a=n.getForm().getCtrlByName(e,r.MgControlType.CTRL_TYPE_SUBFORM))||n.IsSubForm&&!t.NString.Equals(n.getForm().getSubFormCtrl().Name,e,!0));n=n.getParent());return a},s.prototype.setSuffixDone=function(){this._suffixDone=!0},s.prototype.getDestinationRow=function(){return this._destTblRow},s.prototype.setSubFormCtrl=function(e){t.Debug.Assert(null===this._subFormCtrl&&null!==e),this._subFormCtrl=e},s.prototype.getSubFormCtrlForTask=function(e){var t,r=null,n=null,a=null;for(n=this;null!=n;n=n.ParentForm){t=n.CtrlTab;for(var s=0;s<t.getSize();s++)if(null!=(r=t.getCtrl(s)instanceof P?t.getCtrl(s):null)&&r.isSubform()&&null!=r.getSubformTaskId()&&r.getSubformTaskId()===e){a=r;break}if(null!=a)break}return a},s.prototype.removeRecordsAfterIdx=function(t){var r=!1;this.isTableWithPagination()||(t<=this._rowsInPage+1&&this.GetDataview().getSize()>this._rowsInPage&&(t=0),0===t&&(r=!0),e.prototype.SetTableItemsCount.call(this,t,r)),this.setTableItemsCount(!1)},s.prototype.isRowValidated=function(e){if(this.Rows.length<=e||e<0)return!1;var t=this.Rows.get_Item(e);return null!=t&&(t.Created&&t.Validated)},s.prototype.transferDataToGui=function(){var t=Object.create(null,{getTask:{get:function(){return e.prototype.getTask}},checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}}});return T(this,void 0,void 0,(function(){var e,n,a,i,o,l;return h(this,(function(u){switch(u.label){case 0:e=this.GetDataview().getCurrRecIdx(),n=r.Misc.getSystemMilliseconds()+s.TIME_LIMIT,a=!1,i=t.getTask.call(this).CurrentEditingControl,u.label=1;case 1:u.trys.push([1,10,,11]),o=this.GetDataview().backupCurrent(),u.label=2;case 2:return r.Misc.getSystemMilliseconds()<n&&this.RefreshRepeatableAllowed?this._lastRowSent+1>=this.GetDataview().getSize()||this.isTableWithPagination()&&this._lastRowSent+1>=this.getMaxRowsInPaginatedTable()?(this.RefreshUI(),[3,6]):(this._lastRowSent++,this._transferringDataToGUI=!0,this.AllowedSubformRecompute=!1,this.isRowValidated(this._lastRowSent)?[3,5]:(t.checkAndCreateRow.call(this,this._lastRowSent),this._lastRowSent===e?[3,5]:(t.getTask.call(this).CurrentEditingControl=null,[4,this.setCurrRowByDisplayLine(this._lastRowSent,!1,!0)]))):[3,6];case 3:return u.sent(),[4,t.refreshControls.call(this,!0)];case 4:u.sent(),a=!0,u.label=5;case 5:return this.AllowedSubformRecompute=!0,this._transferringDataToGUI=!1,[3,2];case 6:return a?[4,this.restoreBackup(e,o)]:[3,9];case 7:return u.sent(),[4,t.refreshControls.call(this,!0)];case 8:u.sent(),t.getTask.call(this).CurrentEditingControl=i,u.label=9;case 9:return[3,11];case 10:if(!((l=u.sent())instanceof mt))throw l;return r.Logger.Instance.WriteDevToLog(l.Message),[3,11];case 11:return this._transferingData=!1,this.checkAndCreateRowsEvent(),[2]}}))}))},s.prototype.checkAndCreateRowsEvent=function(){if(null!==this._tableMgControl&&this.Opened&&this.RefreshRepeatableAllowed){var e=this.GetDataview().getSize();this._lastRowSent>=this.Rows.length&&(this._lastRowSent=this.Rows.length-1);var t=this._lastRowSent<e-1;this.isTableWithPagination()&&this._lastRowSent+1>=this.getMaxRowsInPaginatedTable()&&(t=!1),t&&!this._transferingData?(o.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl,r.InternalInterface.MG_ACT_DV_TO_GUI,r.Priority.LOWEST),this._transferingData=!0):!this.shouldFetchRecordsAheadFromServer||t||this.GetDataview().IncludesLast()&&this.GetDataview().IncludesFirst()||o.eventsManager.addInternalEventWithCtrlAndCodeAndPriority(this._tableMgControl,r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER,r.Priority.LOWEST)}},s.prototype.setRowData=function(r,n,a){var s=Object.create(null,{refreshControls:{get:function(){return e.prototype.refreshControls}},SelectRow:{get:function(){return e.prototype.SelectRow}}});return T(this,void 0,void 0,(function(){var e,a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return e=this.GetDataview().getCurrRecIdx(),a=0,i=!1,o=!1,l=!1,r!==t.Int32.MinValue?r<0?(i=!0,this.GetDataview().setTopRecIdx(0)):r+this._rowsInPage+1>=this.GetDataview().getSize()&&(o=!0):r=this.GetDataview().getTopRecIdx(),u=this.GetDataview().backupCurrent(),this._transferringDataToGUI=!0,this.AllowedSubformRecompute=!1,c=new t.RefParam(a),[4,this.refreshRows(r,n,e,c)];case 1:return l=T.sent(),a=c.value,(i&&0!==a||o)&&(this.GetDataview().setTopRecIdx(r+a),this.SetTableTopIndex(),this._topIndexUpdated&&(this._topIndexUpdated=!1)),this.AllowedSubformRecompute=!0,this._transferringDataToGUI=!1,l?[4,this.restoreBackup(e+a,u)]:[3,4];case 2:return T.sent(),[4,s.refreshControls.call(this,!0)];case 3:T.sent(),T.label=4;case 4:return s.SelectRow.call(this),i&&null!==(_=G.getLastFocusedControl())&&(_.getParentTable(),this._tableMgControl),[2]}}))}))},s.prototype.refreshRows=function(t,r,n,a){var s=Object.create(null,{checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}},isRowCreated:{get:function(){return e.prototype.isRowCreated}},markRowNOTCreated:{get:function(){return e.prototype.markRowNOTCreated}}});return T(this,void 0,void 0,(function(){var e,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:e=0,i=!1,a.value=0,o=this.GetDataview().IncludesFirst(),l=this.GetDataview().IncludesLast(),u=0,h.label=1;case 1:if(!(u<this._rowsInPage))return[3,10];c=t+u,_=this.GetDataview().getTopRecIdx(),h.label=2;case 2:return h.trys.push([2,7,8,9]),e=c+a.value,!this.isRowValidated(c)||r||this.RefreshAllRows?(e>=0&&s.checkAndCreateRow.call(this,e),n+a.value===e?[3,5]:[4,this.setCurrRowByDisplayLine(e,!1,!0)]):[3,6];case 3:return h.sent(),[4,s.refreshControls.call(this,!0)];case 4:h.sent(),h.label=5;case 5:i=!0,h.label=6;case 6:return[3,9];case 7:if((T=h.sent())instanceof mt)return s.isRowCreated.call(this,e)&&s.markRowNOTCreated.call(this,e),[3,10];throw T;case 8:return a.value=a.value+(this.GetDataview().getTopRecIdx()-_),_=this.GetDataview().getTopRecIdx(),!i&&this.GetDataview().DataviewBoundriesAreChanged(o,l)&&(i=!0),[7];case 9:return u++,[3,1];case 10:return this.RefreshUI(),this.RefreshAllRows=!1,[2,i]}}))}))},s.prototype.getVisibleLine=function(){var e=0;return this.GetDataview().getCurrRecIdx()!==t.Int32.MinValue&&(e=this.GetDataview().getCurrRecIdx()),e-Math.max(this.GetDataview().getTopRecIdx(),0)},s.prototype.bringRecordToPage=function(){return T(this,void 0,void 0,(function(){var e,r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return null===this._tableMgControl||this._task.DataView.isEmptyDataview()?[3,2]:(e=n.Commands.getTopIndex(this._tableMgControl),r=this.GetDataview().getCurrRecIdx(),a=e,this.isTableWithPagination()?(s=this.getGuiRowidx(r),i=s-s%this._rowsInPage,((a=this.getDvRowIdx(i))!==this._prevGuiTopIndex||this.IsMovingInView)&&(this._topIndexUpdated=!0)):e>r?(this._topIndexUpdated=!0,a=r):e+this._rowsInPage-1<r&&(this._topIndexUpdated=!0,a=this._rowsInPage>0?r-this._rowsInPage+1:r),this.GetDataview().getTopRecIdx()!==a||this._topIndexUpdated?(this.GetDataview().setTopRecIdx(a),this.SetTableTopIndex(),[4,this.setRowData(t.Int32.MinValue,!1,null)]):[3,2]);case 1:o.sent(),this._topIndexUpdated=!1,o.label=2;case 2:return[2]}}))}))},s.prototype.invalidateTable=function(){for(var e=0;e<this.Rows.length;e++){var t=this.Rows.get_Item(e);null!==t&&(t.Validated=!1)}this._lastRowSent=-1,this.checkAndCreateRowsEvent()},s.prototype.getPrevLine=function(e){return e-1},s.prototype.clearTableColumnSortMark=function(e){},s.prototype.stopRowEditing=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.getIsRowEditingFromGui(e)?(n.Commands.addValueWithLine(n.CommandType.SET_NOT_IS_ROW_EDITING,this,this.isLineMode()?e:0,this.isLineMode()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]):[3,2];case 1:t.sent(),n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),t.label=2;case 2:return[2]}}))}))},s.prototype.startRowEditing=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.getIsRowEditingFromGui(e)?[3,2]:(n.Commands.addValueWithLine(n.CommandType.SET_IS_ROW_EDITING,this,this.isLineMode()?e:0,this.isLineMode()),[4,this.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)]);case 1:t.sent(),n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm()),t.label=2;case 2:return[2]}}))}))},s.prototype.getIsRowEditingFromGui=function(e){return n.Commands.getIsRowEditing(this,this.isLineMode()?e:0,this.isLineMode())},s.prototype.RefreshDisplay=function(n){var a=Object.create(null,{HasTable:{get:function(){return e.prototype.HasTable}},hasTable:{get:function(){return e.prototype.hasTable}},SelectRow:{get:function(){return e.prototype.SelectRow}},refreshProps:{get:function(){return e.prototype.refreshProps}},refreshControls:{get:function(){return e.prototype.refreshControls}},getTask:{get:function(){return e.prototype.getTask}},isLineMode:{get:function(){return e.prototype.isLineMode}}});return T(this,void 0,void 0,(function(){var e,s,i;return h(this,(function(o){switch(o.label){case 0:if(e=this._task,this.isFetchingRecordsAhead)return[2,!1];if(e.isAborting())return[2,!1];if(null!==(s=this.GetDataview().getCurrRec())&&s.InCompute&&!s.isNewRec())return[2,!1];if(this._inRefreshDisp)return[2,!1];this._inRefreshDisp=!0,o.label=1;case 1:return o.trys.push([1,9,10,11]),n!==r.Constants.TASK_REFRESH_FORM&&n!==r.Constants.TASK_REFRESH_TABLE?[3,3]:a.HasTable.call(this)&&this.Opened?[4,this.refreshTable()]:[3,3];case 2:o.sent(),o.label=3;case 3:return n!==r.Constants.TASK_REFRESH_FORM&&n!==r.Constants.TASK_REFRESH_CURR_REC?[3,8]:n===r.Constants.TASK_REFRESH_CURR_REC&&a.hasTable.call(this)?(this.SetTableTopIndex(),a.SelectRow.call(this),[4,this.fetchPrevChunkForCurrentPage()]):[3,5];case 4:o.sent(),o.label=5;case 5:return[4,a.refreshProps.call(this)];case 6:return o.sent(),[4,a.refreshControls.call(this,!1)];case 7:o.sent(),o.label=8;case 8:return[3,11];case 9:if(!((i=o.sent())instanceof t.Exception))throw i;return r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("{0} : {1} in task {2}",i.GetType(),i.Message,a.getTask.call(this).PreviouslyActiveTaskId)),[3,11];case 10:return this._inRefreshDisp=!1,[7];case 11:return n!==r.Constants.TASK_REFRESH_CURR_REC||a.isLineMode.call(this)&&!this._tableRefreshed||(this.FormRefreshed=!0),[2,!0]}}))}))},s.prototype.RefreshUI=function(){this.getTask().isMainProg()||n.Commands.addNoParameters(n.CommandType.REFRESH_TASK,this.getForm())},s.prototype.refreshTable=function(){var n=Object.create(null,{checkAndCreateRow:{get:function(){return e.prototype.checkAndCreateRow}},refreshControls:{get:function(){return e.prototype.refreshControls}},isRowCreated:{get:function(){return e.prototype.isRowCreated}},markRowNOTCreated:{get:function(){return e.prototype.markRowNOTCreated}}});return T(this,void 0,void 0,(function(){var e,a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:if(this.isFetchingRecordsAhead)return[2];if(r.Logger.Instance.WriteGuiToLog("Start form.refreshTable()"),this.updateDisplayLineByDV(),e=this.DisplayLine,a=this.GetDataview().getCurrRecIdx(),!this._tableRefreshed&&a>=0?(e=this.GetDataview().getCurrRecIdx())+1>this._rowsInPage?this.GetDataview().setTopRecIdx(e-Math.floor(this._rowsInPage/2)+1):this.GetDataview().setTopRecIdx(0):(e===t.Int32.MinValue&&(e=0),this.GetDataview().getTopRecIdx()===t.Int32.MinValue&&this.GetDataview().setTopRecIdx(a)),this.GetDataview().getTopRecIdx()<0)return[2];e-=this.GetDataview().getTopRecIdx(),s=this.GetDataview().backupCurrent(),this._tableRefreshed=!0,(i=this._transferringDataToGUI)||(this._transferringDataToGUI=!0),this.AllowedSubformRecompute=!1,o=0,_.label=1;case 1:if(!(o<this._rowsInPage))return[3,8];(l=this.GetDataview().getTopRecIdx())<0&&(this.GetDataview().setTopRecIdx(0),l=0),u=l+o,_.label=2;case 2:return _.trys.push([2,6,,7]),n.checkAndCreateRow.call(this,u),o===e?[3,5]:[4,this.setCurrRowByDisplayLine(u,!1,!0)];case 3:return _.sent(),[4,n.refreshControls.call(this,!0)];case 4:_.sent(),_.label=5;case 5:return[3,7];case 6:if("RecordOutOfDataViewException"==(c=_.sent()).name)return n.isRowCreated.call(this,u)&&n.markRowNOTCreated.call(this,u),[3,8];throw c;case 7:return o++,[3,1];case 8:return this.AllowedSubformRecompute=!0,i||(this._transferringDataToGUI=!1),[4,this.restoreBackup(e+this.GetDataview().getTopRecIdx(),s)];case 9:return _.sent(),[4,n.refreshControls.call(this,!0)];case 10:return _.sent(),this.RefreshUI(),r.Logger.Instance.WriteGuiToLog("End form.refreshTable()"),[2]}}))}))},s.prototype.updateDisplayLineByDV=function(){this.DisplayLine=this.recordIdx2DisplayLine(this.GetDataview().getCurrRecIdx())},s.prototype.setCurrRowByDisplayLine=function(t,r,n){var a=Object.create(null,{HasTable:{get:function(){return e.prototype.HasTable}}});return T(this,void 0,void 0,(function(){var e;return h(this,(function(s){switch(s.label){case 0:return e=this.displayLine2RecordIdx(t),[4,this.setCurrRowByRecIdx(e,r,n,t)];case 1:return s.sent(),a.HasTable.call(this)?this.updateDisplayLineByDV():this.DisplayLine=t,[2]}}))}))},s.prototype.setCurrRowByRecIdx=function(r,n,a,s){var i=Object.create(null,{hasTable:{get:function(){return e.prototype.hasTable}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:if(null===this.GetDataview()||!i.hasTable.call(this)&&0!==r)throw new t.ApplicationException("in Form.setCurrRow() no table ");e.label=1;case 1:return e.trys.push([1,,3,4]),this._destTblRow=r,[4,this.GetDataview().setCurrRecByIdx(r,n,a,!0,s)];case 2:return e.sent(),[3,4];case 3:return this._destTblRow=r-this.GetDataview().getTopRecIdx(),[7];case 4:return[2]}}))}))},s.prototype.getLastValidRow=function(){return Math.min(this._rowsInPage-1,this.GetDataview().getSize()-1-this.GetDataview().getTopRecIdx())},s.prototype.recordIdx2DisplayLine=function(e){return e},s.prototype.displayLine2RecordIdx=function(e){return e},s.prototype.restoreOldDisplayLine=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),this._inRestore=!0,[4,this.setCurrRowByDisplayLine(e,!1,!0)];case 1:return r.sent(),[3,4];case 2:if(!((t=r.sent())instanceof mt))throw t;return[3,4];case 3:return this._inRestore=!1,[7];case 4:return[2]}}))}))},s.prototype.getTopIndexFromGUI=function(){var t=e.prototype.getTopIndexFromGUI.call(this);return e.prototype.hasTable.call(this)&&this.GetDataview().setTopRecIdx(this.displayLine2RecordIdx(t)),t},s.prototype.getCurrRecPosInForm=function(){var t=e.prototype.getTopIndexFromGUI.call(this);return this.DisplayLine-t+1},s.prototype.restoreBackup=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return t.getId()>=0&&this.GetDataview().getRecIdx(t.getId())>=0&&e>=0&&e<this.GetDataview().getSize()&&this.GetDataview().getCurrRecIdx()>=0&&t.getMode()===n.DataModificationTypes.None?(this.GetDataview().restoreCurrent(t),this.updateDisplayLineByDV(),[3,3]):[3,1];case 1:return[4,this.restoreOldDisplayLine(e)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},s.prototype.ConstructMgControl=function(e,t,r){return 0===arguments.length?this.ConstructMgControl_0():3!==arguments.length||null!==e&&e.constructor!==Number||!(null===t||t instanceof b)||null!==r&&r.constructor!==Number?this.ConstructMgControl_2(e,t,r):this.ConstructMgControl_1(e,t,r)},s.prototype.ConstructMgControl_0=function(){return new P},s.prototype.ConstructMgControl_1=function(e,t,r){return new P(e,t,r)},s.prototype.ConstructMgControl_2=function(e,t,r){return new P(e,t,r)},s.prototype.alreadyMovedToFirstControl=function(){return this._task.getMGData().AlreadyMovedToFirstControl()},s.prototype.firstTableRefresh=function(){var t=Object.create(null,{firstTableRefresh:{get:function(){return e.prototype.firstTableRefresh}},SelectRow:{get:function(){return e.prototype.SelectRow}}});return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return null===this._tableMgControl?[3,2]:(t.firstTableRefresh.call(this),this.setTableItemsCount(!1),[4,this.refreshTable()]);case 1:e.sent(),t.SelectRow.call(this),e.label=2;case 2:return[2]}}))}))},s.prototype.InsertTableItems=function(e,t){null!=this._tableMgControl&&(this.Rows.InsertRange(e,new Array(t)),this.InsertTableChildrenArrays(e,t),this._lastRowSent=-1),this.setTableItemsCount(!1)},s.prototype.setTableItemsCount=function(t){var n;this.isTableWithAbsoluteScrollbar()?this._task.getOriginalTaskMode()===r.Constants.TASK_MODE_CREATE&&this._task.getMode()==r.Constants.TASK_MODE_CREATE?(n=this.GetDataview().getSize(),this.GetDataview().RecordsBeforeCurrentView>0&&(this.GetDataview().RecordsBeforeCurrentView=0,this.SetRecordsBeforeCurrentView(0),this.RefreshUI())):(n=this.GetDataview().TotalRecordsCount>0?this.GetDataview().TotalRecordsCount:1,this.SetRecordsBeforeCurrentView(this.GetDataview().RecordsBeforeCurrentView)):n=this.GetDataview().getSize(),e.prototype.SetTableItemsCount.call(this,this.GetDataview().getSize(),n,t)},s.prototype.InitTableControl=function(e,t,r){0!==arguments.length?this.InitTableControl_01(e,t,r):this.InitTableControl_00()},s.prototype.InitTableControl_00=function(){var e=1;if(this.isTableWithAbsoluteScrollbar()&&this.GetDataview().TotalRecordsCount>0){var t=this.GetDataview().RecordsBeforeCurrentView;e=this.GetDataview().TotalRecordsCount,n.Commands.addWithNumber(n.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW,this._tableMgControl,t)}this.InitTableControl(1,e,!1),this.SetTableTopIndex()},s.prototype.InitTableControl_01=function(t,r,a){null!==this._tableMgControl&&(a?(n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_FIRST,this._tableMgControl,0,!0),n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_LAST,this._tableMgControl,0,!0)):(n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_FIRST,this._tableMgControl,0,this.GetDataview().IncludesFirst()||this.GetDataview().IsOneWayKey),n.Commands.addBoolWithLine(n.CommandType.SET_TABLE_INCLUDES_LAST,this._tableMgControl,0,this.GetDataview().IncludesLast()),n.Commands.addBoolWithLine(n.CommandType.SET_EMPTY_DATAVIEW,this._tableMgControl,0,this.GetDataview().isEmptyDataview())),e.prototype.InitTableControl.call(this,t,r,a),this.checkAndCreateRowsEvent())},s.prototype.SetTableTopIndex=function(){if(null!==this._tableMgControl){var e=this.GetDataview().getTopRecIdx();e===t.Int32.MinValue&&(e=0),this.isTableWithPagination()||this.GetDataview().IncludesLast()&&e+this._rowsInPage>this.GetDataview().getSize()&&(this.GetDataview().IncludesFirst()||this.GetDataview().getSize()>this._rowsInPage+1)&&(e=Math.max(this.GetDataview().getSize()-this._rowsInPage,0),this.GetDataview().setTopRecIdx(e),this._topIndexUpdated=!0),(e!==this._prevGuiTopIndex||this.IsMovingInView)&&(n.Commands.addWithNumber(n.CommandType.SET_TABLE_TOP_INDEX,this._tableMgControl,e),this._prevGuiTopIndex=this.getGuiRowidx(e))}},s.prototype.createForm=function(){e.prototype.createForm.call(this),s.CreatedForms.add(this)},s.prototype.UpdateStatusBar=function(e,t,r){},s.prototype.initInnerObjects=function(t){if(null===t)return!1;var a=n.Manager.GetCurrentRuntimeContext().Parser;return t===r.XMLConstants.MG_TAG_RECOMPUTE?(r.Logger.Instance.WriteDevToLog("goes to recompute form"),this._task.RecomputeFillData(a),!0):e.prototype.initInnerObjects.call(this,t)},s.prototype.toString=function(){return"{"+this.constructor.name+": task="+this._task+", Id="+this._userStateId+"}"},s.prototype.GetHiddenControlListXML=function(){var e=new t.StringBuilder;return null!==this.hiddenControlsIsnsList&&this.hiddenControlsIsnsList.length>0&&(e.Append("<"+E.MG_TAG_HIDDEN_CONTOLS+" "+E.MG_ATTR_ISNS+'="'),this.hiddenControlsIsnsList.forEach((function(t){e.Append(t+",")})),e.Remove(e.Length-1,1),e.Append('"/>'),this.hiddenControlsIsnsList=null),e.ToString()},s.prototype.ShouldBehaveAsModal=function(){var e=!1;if(this._task.IsInteractive||this._task.isMainProg()){var t=this._task.ParentTask;null===t||t.IsInteractive||t.isMainProg()||(e=t.ShouldNonInteractiveChildBeModal())}else e=b.ShouldNonInteractiveBeModal();return e},s.prototype.isTableWithPagination=function(){return this.isTableWithAbsoluteScrollbar()},s.prototype.isTableWithAbsoluteScrollbar=function(){var e=!1;return null!==this._tableMgControl&&(e=this._tableMgControl.IsTableWithAbsoluteScrollbar()),e},s.prototype.SetRecordsBeforeCurrentView=function(e){null!==this._tableMgControl&&n.Commands.addWithNumber(n.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW,this._tableMgControl,e)},s.prototype.buildFormName=function(){var e=this.UniqueName,t=this.getTask();for(e=t.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"_"+e;t.IsSubtask;)e=(t=t.StudioParentTask).getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"_"+e;return e=(e=e.replace(/ /g,"_")).replace(/-/g,"_")},s.prototype.fetchPrevChunkForCurrentPage=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(r){switch(r.label){case 0:return this.isTableWithAbsoluteScrollbar()&&this.GetDataview().TotalRecordsCount>0&&((e=this.GetDataview().RecordsBeforeCurrentView%this._rowsInPage)>0&&0===this.DisplayLine)?(t={guiMgControl:this.getTableCtrl(),Line:e,Val:""},[4,this.setRowData(-e,!1,t)]):[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},s.prototype.getGuiRowidx=function(e){return e+this.GetDataview().RecordsBeforeCurrentView},s.prototype.getDvRowIdx=function(e){return e-this.GetDataview().RecordsBeforeCurrentView},s}(n.MgFormBase);rr.TIME_LIMIT=50,rr._createdForms=new tr;var nr=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.GetTaskTag=function(e){return e},t.prototype.GetDataviewManagerForVirtuals=function(e){return e.DataviewManager.RemoteDataviewManager},t.prototype.PrepareTask=function(t){t.DataViewWasRetrieved=!0;var n=e.prototype.PrepareTask.call(this,t);return t.getMGData().IsModal&&null!==t.getForm()&&(t.getForm().ConcreteWindowType=r.WindowType.Overlay),n},t.prototype.GetEventTaskId=function(e,t,r){return t},t.prototype.ShouldEvaluatePropertyLocally=function(e){return!1},t.prototype.InitTaskPrefixExecutedFlag=function(e){e.TaskPrefixExecuted=!0},t.prototype.RemoveRecomputes=function(e,t){e.DataView.GetFieldsTab().resetRecomp()},t.prototype.GetOwnerTransactionTask=function(e){var t=e;return null!==e.DataviewManager.RemoteDataviewManager.Transaction&&(t=e.DataviewManager.RemoteDataviewManager.Transaction.OwnerTask),t},t.PreparePropMainDisplay=function(e){return e.ComputeMainDisplay(),e.FormIsLegal()?Pt.SuccessfulResult:new Pt(r.MsgInterface.BRKTAB_STR_ERR_FORM)},t}(Dt),ar=function(){function e(e){this.Columns=null,this._table=null,this._id=0,this._table=e,this.Columns=new t.List}return e.prototype.FillData=function(e){for(this.FillAttributes(e);this.InitInnerObjects(e,e.getNextTag()););},e.prototype.FillAttributes=function(e){var n,a,s,i=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==i&&i<e.getXMLdata().length){a=e.getXMLsubstring(i),e.add2CurrIndex(a.indexOf(E.MG_ATTR_KEY)+E.MG_ATTR_KEY.length),n=r.XmlParser.getTokens(e.getXMLsubstring(i),r.XMLConstants.XML_ATTR_DELIM);for(var o=0;o<n.length;o+=2){s=n.get_Item(o);var l=n.get_Item(o+1);s===r.XMLConstants.MG_ATTR_ID?this._id=r.XmlParser.getInt(l):s===r.XMLConstants.MG_ATTR_TYPE?r.Logger.Instance.WriteDevToLog("in Key.fillAttributes() obsolete attribute (TODO: remove from server)"+s):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",s))}e.setCurrIndex(++i)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Key.fillAttributes() out of string bounds")},e.prototype.InitElements=function(e){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case r.XMLConstants.MG_ATTR_ID:this.Columns.push(this._table.FldsTab.getField(r.XmlParser.getInt(s)));break;case r.XMLConstants.MG_ATTR_SIZE:case E.MG_ATTR_DIR:break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",a))}}},e.prototype.InitInnerObjects=function(e,t){if(null===t)return!1;if(t!==E.MG_TAG_COLUMN)return t==="/"+E.MG_ATTR_KEY?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LinksTable.initInnerObjects(): "+t),!1);var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_COLUMN)+E.MG_TAG_COLUMN.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);this.InitElements(s),e.setCurrIndex(n+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Key.initInnerObjects() out of string bounds");return!0},e.prototype.GetKeyId=function(){return this._id},e}(),sr=function(){function e(){}return e.left=function(e){return 2*e+1},e.right=function(e){return 2*e+2},e.sort=function(t){var r,n,a,s,i,o=t.length;if(!(o<=1)){var l=o-1,u=Math.floor(o/2);do{n=u-=1;do{a=n,s=e.left(n),i=e.right(n),s<=l&&t[s].CompareTo(t[a])>0&&(n=s),i<=l&&t[i].CompareTo(t[n])>0&&(n=i),n!==a&&(r=t[n],t[n]=t[a],t[a]=r)}while(n!==a)}while(u>0);u=o;do{l-=1;var c=u-=1;r=t[c],t[c]=t[0],t[0]=r,n=0;do{a=n,s=e.left(n),i=e.right(n),s<=l&&t[s].CompareTo(t[a])>0&&(n=s),i<=l&&t[i].CompareTo(t[n])>0&&(n=i),n!==a&&(r=t[n],t[n]=t[a],t[a]=r)}while(n!==a)}while(u>1)}},e}(),ir=function(){function e(){this._tables=null,this._tables=new t.Hashtable}return e.prototype.GetTableById=function(e){return this._tables.get_Item(e)},e.prototype.TableExists=function(e){var t=!0;return null===this.GetTableById(e)&&(t=!1),t},e.prototype.InsertTable=function(e){var t=!1;return this.TableExists(e.GetTableUniqueId())||(this._tables.set_Item(e.GetTableUniqueId(),e),t=!0),t},e.prototype.LoadTable=function(e){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:if(a=le.GetInstance(),!this.TableExists(e))return[3,5];s=this._tables.get_Item(e),T.label=1;case 1:return T.trys.push([1,3,,4]),[4,a.GetContent(e,!0)];case 2:i=T.sent();try{n.RuntimeContextBase.Instance.Parser.loadTableCacheData(i)}catch(r){throw r instanceof t.Exception?new t.ApplicationException("Unable to parse resident table "+e+", due to unsupported encoding.",r):r}return[3,4];case 3:if(!((o=T.sent())instanceof t.Exception))throw o;return r.Misc.WriteStackTrace(o),[3,4];case 4:for(s.FillData(),l=new t.List,u=this._tables.Values;u.MoveNext();)c=u.Current,c.GetTableCommonIdentifier()===s.GetTableCommonIdentifier()&&c.GetTableUniqueId()!==e&&l.push(c.GetTableUniqueId());for(_=0;_<l.length;_+=1)this._tables.Remove(l.get_Item(_));T.label=5;case 5:return[2]}}))}))},e}();ir.Instance=new ir;var or=function(){function e(e){this._keys=null,this._records=null,this._currSortDir="\0",this._currSortKey=0,this.FldsTab=null,this._isLoaded=!1,this._tableIdent=null,this._tableUId=null,this._tableUId=e,this._keys=new t.List,this._records=new t.List,this._isLoaded=!1}return e.prototype.SetTableIdent=function(e){null===this._tableIdent?this._tableIdent=e:this._tableIdent!==e&&r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.setTableIdent() already set and table identifier does not match")},e.prototype.FillData=function(){var e=n.RuntimeContextBase.Instance.Parser;for(this.FillAttributes(e);this.InitInnerObjects(e,e.getNextTag()););},e.prototype.FillAttributes=function(e){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_CACHED_TABLE)+E.MG_TAG_CACHED_TABLE.length);for(var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM),i=0;i<s.length;i+=2){var o=s.get_Item(i),l=s.get_Item(i+1);switch(o){case r.XMLConstants.MG_ATTR_ID:-1===this._tableUId.indexOf(l)&&(this._tableUId=l,r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() table unique id does not match"));break;case r.XMLConstants.MG_ATTR_NAME:break;case E.MG_ATTR_IDENT:this._tableIdent!==l&&(this._tableIdent=l,r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() table identifier id does not match"));break;default:r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",o))}}e.setCurrIndex(++n)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in TableCache.fillAttributes() out of string bounds")},e.prototype.InitInnerObjects=function(e,t){if(null==t)return!1;switch(t){case r.XMLConstants.MG_TAG_FLDH:this.FldsTab=new Mt,this.FldsTab.fillData(e);break;case E.MG_ATTR_KEY:(n=new ar(this)).FillData(e),this._keys.push(n);break;case E.MG_TAG_RECORDS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_RECORDS_END:e.setCurrIndex2EndOfTag();break;case E.MG_TAG_CACHED_TABLE_END:return e.setCurrIndex2EndOfTag(),!1;case E.MG_TAG_REC:var n;(n=new gt(this)).Initialize(),n.fillData(e),this._records.push(n)}return!0},e.prototype.GetTableUniqueId=function(){return this._tableUId},e.prototype.GetTableCommonIdentifier=function(){return this._tableIdent},e.prototype.GetCurrSortKey=function(){return this._currSortKey},e.prototype.GetKeyById=function(e){for(var t=0;t<this._keys.length;t+=1)if(this._keys.get_Item(t).GetKeyId()===e)return this._keys.get_Item(t);return null},e.prototype.Load=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._isLoaded?[3,2]:[4,ir.Instance.LoadTable(this._tableUId)];case 1:e.sent(),this._isLoaded=!0,e.label=2;case 2:return[2]}}))}))},e.prototype.SortTable=function(e,t){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:return this._isLoaded?[3,2]:[4,this.Load()];case 1:a.sent(),a.label=2;case 2:if(e!==this._currSortKey||t!==this._currSortDir)for(this._currSortDir=t,this._currSortKey=e,r=this._records.ToArray(),sr.sort(r),"D"===this._currSortDir&&this.ReverseVector(r),n=0;n<this._records.length;n+=1)this._records.set_Item(n,r[n]);return[2]}}))}))},e.prototype.Fetch=function(t){var r=t.length>0;if(this._isLoaded){if(!r)return 0!==this._records.length?this._records.get_Item(0):null;for(var n=0;n<this._records.length;n+=1){var a=this._records.get_Item(n);if(e.validateRec(a,t))return a}}return null},e.validateRec=function(e,t){for(var r=!0,n=0;n<t.length;n+=1){var a=t.get_Item(n);if(!a.checkRange(e.GetFieldValue(a.getCacheTableFldId()),e.IsNull(a.getCacheTableFldId()))){r=!1;break}}return r},e.prototype.ReverseVector=function(e){for(var t=e.length-1,r=0;r<Math.floor((e.length-1)/2);r++,t--){var n=e[r];e[r]=e[t],e[t]=n}},e}(),lr=function(e){function a(t){var r=e.call(this,t)||this;return r._table=null,r._lastFetchRecPos=null,r}return u(a,e),a.prototype.setAttribute=function(t,r){switch(t){case E.MG_ATTR_CACHED_TABLE:ir.Instance.TableExists(r)?this._table=ir.Instance.GetTableById(r):(this._table=new or(r),ir.Instance.InsertTable(this._table));break;case E.MG_ATTR_IDENT:this._table.SetTableIdent(r);break;default:e.prototype.setAttribute.call(this,t,r)}},a.prototype.getLinkedRecord=function(e){return T(this,void 0,void 0,(function(){var r,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:if(r=this._task.DataView.GetFieldsTab().getLinkFields(this._id),n=!1,!this._cond.getVal())return[3,15];if(null!=this.Loc)return[3,5];this.Loc=new t.List,s=0,o.label=1;case 1:return s<r.length?null==(a=r.get_Item(s).Locate)?[3,3]:(this.Loc.push(a),[4,a.compute(!1)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:return[3,9];case 5:s=0,o.label=6;case 6:return s<this.Loc.length?[4,this.Loc.get_Item(s).compute(!1)]:[3,9];case 7:o.sent(),o.label=8;case 8:return s++,[3,6];case 9:return[4,this._table.SortTable(this._keyIdx,this._dir)];case 10:return o.sent(),null!=(i=this._table.Fetch(this.Loc))?[3,12]:[4,this.initRec(e,r,!1)];case 11:return o.sent(),[3,14];case 12:return n=!0,[4,this.copyLinkFldToRec(e,r,i,!0)];case 13:o.sent(),o.label=14;case 14:return[3,17];case 15:return[4,this.initRec(e,r,!1)];case 16:o.sent(),o.label=17;case 17:return[2,n]}}))}))},a.prototype.copyLinkFldToRec=function(e,t,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:for(this._lastFetchRecPos=r.getDbPosVal(),a=0;a<t.length;a++)s=t.get_Item(a),e.setFieldValue(s.getId(),r.GetFieldValue(s.CacheTableFldIdx),!1),e.clearFlag(s.getId(),gt.FLAG_INVALID),s.invalidate(!0,!1);return[4,this.SetReturnValue(e,n,!0)];case 1:return i.sent(),[2]}}))}))},a.prototype.initRec=function(e,t,r){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return this._lastFetchRecPos="#",[4,this.InitLinkFields(e)];case 1:return n.sent(),null!=(t=this.ReturnField)&&(e.setFieldValue(t.getId(),r?"1":"0",!1),t.invalidate(!0,!1)),[2]}}))}))},a.prototype.getLastFetchedDbPos=function(){return this._lastFetchRecPos},a.prototype.SetReturnValue=function(e,t,a){return T(this,void 0,void 0,(function(){var e,s,i;return h(this,(function(l){switch(l.label){case 0:return null===(e=this.ReturnField)?[3,3]:(s=e.getTask()!==this.Task,o.eventsManager.pushNewExecStacks(),i=t?"1":"0",e.getType()===r.StorageAttribute.NUMERIC&&(i=n.DisplayConvertor.Instance.toNum(i,new n.PIC(e.getPicture(),r.StorageAttribute.NUMERIC,0),0)),[4,e.setValueAndStartRecompute(i,!1,a,!1,!1,s)]);case 1:return l.sent(),o.eventsManager.popNewExecStacks(),a||e.setModified(),e.invalidate(!0,!1),e.getTask()===this.Task?[3,3]:[4,e.updateDisplay()];case 2:l.sent(),l.label=3;case 3:return[2]}}))}))},a}(ft),ur=function(){function e(){}return e.prototype.CreateDataviewHeaders=function(e,t){return new lr(e)},e}(),cr=function(){function e(e,t,n){this._dataviewHeaders=null,this._task=null,this._dataviewHeadersFactory=null,this._dataviewHeaders=t,this._task=e,this._dataviewHeadersFactory=new ur,r.JSON_Utils.JSONFromXML(n,this.FillFromJSON.bind(this))}return e.prototype.FillFromJSON=function(e,r){if(null!=e)throw e;var n=r[E.MG_TAG_LINKS][E.MG_TAG_LINK];if(!a.isNullOrUndefined(n)&&n.constructor===Array)for(var s=0;s<n.length;s++){var i=n[s].$;if(!a.isNullOrUndefined(i[E.MG_ATTR_TABLE_INDEX])){var o=+i[E.MG_ATTR_TABLE_INDEX],l=this._dataviewHeadersFactory.CreateDataviewHeaders(this._task,o),u=new t.Dictionary;for(var c in i)c!==E.MG_ATTR_TABLE_INDEX&&u.Add(c,i[c]);l.SetAttributes(u),this._dataviewHeaders.set_Item(l.Id,l)}}},e}(),_r=function(){function e(e){this._dataviewHeaders=null,this._task=null,this._task=e,this._dataviewHeaders=new t.Hashtable}return e.prototype.fillData=function(e){for(;this.initInnerObjects(e,e.getNextTag()););},e.prototype.initInnerObjects=function(e,t){if(null===t)return!1;if(t===E.MG_TAG_LINKS){var n=e.getXMLdata().indexOf(E.MG_TAG_LINKS_END,e.getCurrIndex())+E.MG_TAG_LINKS_END.length+1,a=e.getXMLsubstring(n);a=r.XmlParser.escapeUrl(a);new cr(this._task,this._dataviewHeaders,a);e.setCurrIndex(n+r.XMLConstants.TAG_CLOSE.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in LinksTable.initInnerObjects(): "+t)},e.prototype.getDataviewHeaderById=function(e){return this._dataviewHeaders.get_Item(e)},e.prototype.buildDbPosString=function(){if(0===this._dataviewHeaders.Count)return null;for(var e=new t.StringBuilder,r=this._dataviewHeaders.Values;r.MoveNext();){var n=r.Current instanceof lr?r.Current:null;if(null!==n){var a=n.getLastFetchedDbPos();e.Append("@"),null!==a&&e.Append(a)}}return e.Append("@"),e.ToString()},e.prototype.getDataiewHeadersCount=function(){return this._dataviewHeaders.Count},e}(),Tr=function(){function e(){this._operations=new t.List,this._firstBlockOperIdx=t.Int32.MaxValue}return e.prototype.fillData=function(e,t,r){for(;this.initInnerObjects(r.getNextTag(),e,t,r););for(var n=this._firstBlockOperIdx;n<this._operations.length;n+=1){var a=this._operations.get_Item(n),s=a.getType();if(s===E.MG_OPER_LOOP||s===E.MG_OPER_BLOCK||s===E.MG_OPER_ELSE){var i=this.serverId2operIdx(a.getBlockClose(),n+1);a.setBlockClose(i),i=this.serverId2operIdx(a.getBlockEnd(),i),a.setBlockEnd(i)}}},e.prototype.initInnerObjects=function(e,r,n,a){if(null!=e&&e===E.MG_TAG_OPER){var s=new it;return s.fillData(r,n,a),this._operations.push(s),this._firstBlockOperIdx!==t.Int32.MaxValue||s.getType()!==E.MG_OPER_LOOP&&s.getType()!==E.MG_OPER_BLOCK||(this._firstBlockOperIdx=this._operations.length-1),!0}return!1},e.prototype.getSize=function(){return this._operations.length},e.prototype.getOperation=function(e){if(e>=0&&e<this._operations.length)return this._operations.get_Item(e);throw new t.ApplicationException("in OperationTable.getOperation() index out of bounds: "+e)},e.prototype.serverId2operIdx=function(e,t){for(var r=-1,n=t;n<this._operations.length;n+=1){if(e===this._operations.get_Item(n).getServerId()){r=n;break}}return r},e.prototype.serverId2FollowingOperIdx=function(e,t){for(var r=-1,n=t;n<this._operations.length;n+=1){if(e<this._operations.get_Item(n).getServerId()){r=n;break}}return r},e}(),hr=function(){function e(){this._enabledExp=new st(!0),this._operationTab=null,this._propagateExp=new st(!0),this._isHandlerOnForm=!1,this._ctrl=null,this._ctrlName=null,this._dvLen=0,this._dvPos=0,this._evt=null,this._handledByClient=!1,this._handlerFld=null,this._hasParameters=!1,this._id=0,this._level="\0",this._scope=null,this._task=null,this._taskMgdID=-1,this._operationTab=new Tr}return e.prototype.getCtrlName=function(){return this._ctrlName},e.prototype.fillData=function(e,t){for(null===this._task&&(this._task=e,this._taskMgdID=this._task.getMgdID());this.initInnerObjects(t,t.getNextTag()););var r=this._task.DataView;this._hasParameters=r.ParametersExist(this._dvPos,this._dvLen)},e.prototype.initInnerObjects=function(e,t){if(null===t)return!1;if(t===E.MG_TAG_HANDLER)this.initInnerElements(e,this._task);else if(t===E.MG_TAG_OPER)this._operationTab.fillData(this._task,this,e);else{if(t!==E.MG_TAG_EVENT||null!==this._evt)return t==="/"+E.MG_TAG_HANDLER?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("there is no such tag in EventHandler.initInnerObjects() "+t),!1);this._evt=new k,this._evt.fillData(e,this._task),(this._evt.getType()===E.EVENT_TYPE_TIMER||this._evt.getType()===E.EVENT_TYPE_USER&&this._evt.getUserEventType()===E.EVENT_TYPE_TIMER)&&this._task.getMGData().addTimerHandler(this),(this._evt.getType()===E.EVENT_TYPE_INTERNAL&&this._evt.getInternalCode()===r.InternalInterface.MG_ACT_ZOOM||this._evt.getType()===E.EVENT_TYPE_USER&&null!==this._evt.getUserEvent()&&this._evt.getUserEventType()===E.EVENT_TYPE_INTERNAL&&this._evt.getUserEvent().getInternalCode()===r.InternalInterface.MG_ACT_ZOOM)&&!this._task.getEnableZoomHandler()&&(null!==this._handlerFld?this._handlerFld.setHasZoomHandler():null!==this._ctrl?this._ctrl.HasZoomHandler=!0:this._task.setEnableZoomHandler())}return!0},e.prototype.initInnerElements=function(e,t){var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());if(-1!==n&&n<e.getXMLdata().length){var a=e.getXMLsubstring(n);e.add2CurrIndex(a.indexOf(E.MG_TAG_HANDLER)+E.MG_TAG_HANDLER.length);var s=r.XmlParser.getTokens(e.getXMLsubstring(n),r.XMLConstants.XML_ATTR_DELIM);return this.initElements(s,t),void e.setCurrIndex(++n)}r.Logger.Instance.WriteExceptionToLogWithMsg("in Handler.FillData() out of string bounds")},e.prototype.initElements=function(e,t){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);switch(a){case E.MG_ATTR_HANDLEDBY:this._handledByClient=s.toUpperCase()==="C".toUpperCase();break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(s);break;case E.MG_ATTR_LEVEL:this._level=s[0];break;case E.MG_ATTR_OBJECT:var i=r.XmlParser.unescape(s);this._ctrlName=r.XmlParser.unescape(i).toUpperCase(),this.calculateCtrlFromControlName(t);break;case E.MG_ATTR_VARIABLE:this._handlerFld=this._task.DataView.getField(r.XmlParser.getInt(s)),this._handlerFld.setHasChangeEvent();break;case E.MG_ATTR_SCOPE:this._scope=s[0];break;case E.MG_ATTR_PROPAGATE:this._propagateExp.setVal(t,s);break;case E.MG_ATTR_ENABLED:this._enabledExp.setVal(t,s);break;case E.MG_ATTR_DVPOS:var o=s.indexOf(",");if(o>-1){this._dvLen=r.XmlParser.getInt(s.substr(0,o)),this._dvPos=r.XmlParser.getInt(s.substr(o+1));for(var l=this._dvPos;l<this._dvPos+this._dvLen;l++){this._task.DataView.getField(l).IsEventHandlerField=!0}}break;case E.MG_ATTR_HANDLER_ONFORM:this._isHandlerOnForm=r.XmlParser.getBoolean(s);break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventHandler class. Insert case to EventHandler.initElements for "+a)}}},e.prototype.calculateCtrlFromControlName=function(e){t.NString.IsNullOrEmpty(this._ctrlName)||(this._ctrl=null!==e.getForm()?e.getForm().getCtrlByCtrlName(this._ctrlName):null)},e.prototype.isSpecificHandlerOf=function(e){if(null===this._ctrl&&null===this._ctrlName&&null===this._handlerFld&&!this._isHandlerOnForm)return!1;if(this._scope===r.BrkScope.Task&&this._task!==e.getTask())return!1;if(this._evt.equals(e)){if(null!==this._handlerFld)return this._handlerFld===e.getFld();if(null===e.Control||this._isHandlerOnForm){if(null===e.Control&&this._isHandlerOnForm)return!0}else{var t=e.Control.getControlNameForHandlerSearch();if(null!==t&&this._ctrlName.toLowerCase()===t.toLowerCase())return!0}}return!1},e.prototype.isNonSpecificHandlerOf=function(e){if(null!==this._ctrl||null!==this._ctrlName||null!==this._handlerFld||this._isHandlerOnForm)return!1;if(this._scope===r.BrkScope.Task&&this._task!==e.getTask()&&e.getType()!==E.EVENT_TYPE_TIMER)return!1;if(this._scope===r.BrkScope.Global&&this._task!==e.getTask())return!1;if(this._evt.getType()===E.EVENT_TYPE_USER&&this._evt.getUserEventType()===E.EVENT_TYPE_NOTINITED)try{this._evt.findUserEvent()}catch(e){if(!(e instanceof t.ApplicationException))throw e}return this._evt.equals(e)},e.prototype.isGlobalHandlerOf=function(e){return this._scope===r.BrkScope.Global&&(null==this._ctrl&&null==this._ctrlName&&null==this._handlerFld&&!this._isHandlerOnForm&&this._evt.equals(e))},e.prototype.isGlobalSpecificHandlerOf=function(e){return this._scope===r.BrkScope.Global&&((null!=this._ctrl||null!=this._ctrlName||null!=this._handlerFld)&&(null!=this._ctrlName&&this._evt.equals(e)&&t.NString.Equals(this._ctrlName,e.Control.Name,!0)))},e.prototype.execute=function(e,n,a){return T(this,void 0,void 0,(function(){var s,i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L;return h(this,(function(h){switch(h.label){case 0:s=null,l=0,u=!1,c=this._task.getBrkLevel(),_=this._task.getBrkLevelIndex(),T=0,null!==u&&this._evt.getType()!==E.EVENT_TYPE_EXPRESSION&&(this._evt.getType()!==E.EVENT_TYPE_USER||this._evt.getUserEvent().getType()!==E.EVENT_TYPE_EXPRESSION&&this._evt.getUserEvent().getType()!==E.EVENT_TYPE_TIMER)?this._evt.getType()!==E.EVENT_TYPE_USER_FUNC&&this._task.setBrkLevel(e.getBrkLevel(),this._id):this._task.setBrkLevel(this._evt.getBrkLevel(),this._id),p=e.getArgList(),h.label=1;case 1:return h.trys.push([1,,18,19]),g=U.Instance,e.getType()!==E.EVENT_TYPE_INTERNAL||e.getInternalCode()!==r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE||this._task.IsRoute()||this._task===o.mgDataTable.StartupMgData.getFirstTask()?(d=-1,n&&(d=o.eventsManager.getNextOperIdx(this._operationTab.getOperation(0),!1)),(I=-1===d&&!a)?[4,this.isEnabled()]:[3,3]):[2,new pr(!0,!0)];case 2:I=!h.sent(),h.label=3;case 3:return I?[2,new pr(!0,!1)]:this._scope!==r.BrkScope.Task||e.getType()!==E.EVENT_TYPE_TIMER&&e.getType()!==E.EVENT_TYPE_EXPRESSION||(f=G.Instance.getLastFocusedTask(),this._task===f)?this._handledByClient?(C=e.getType()!==E.EVENT_TYPE_USER)?[4,this._evt.dataEventIsTrue()]:[3,5]:[2,new pr(!1,!0)]:[2,new pr(!0,!0)];case 4:C=!h.sent(),h.label=5;case 5:if(C)return[2,new pr(!1,!0)];if(e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_TASK_SUFFIX&&(u=!0),e.getType()===E.EVENT_TYPE_INTERNAL)switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_PREFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_REC_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_SUFFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_SUFFIX,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_PREFIX,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_VARIABLE:g.addTaskFlowFld(r.InternalInterface.MG_ACT_VARIABLE,e.getFld().getName(),V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_VERIFICATION,e.Control.Name,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_PREFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_SUFFIX,V.FLWMTR_START,this._task.GetTaskDetails());break;default:g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_START,this._task.GetTaskDetails())}else g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_START,this._task.GetTaskDetails());h.label=6;case 6:return h.trys.push([6,12,13,15]),null!==u&&(s=e.Control),A=o.mgDataTable.currMgdID,R=!1,S=new t.RefParam(R),this._evt.getType()===E.EVENT_TYPE_TIMER&&A!==e.getMgdID()&&(o.mgDataTable.currMgdID=e.getMgdID(),S.value=!0),[4,this.resetLocalVariables(p)];case 7:return h.sent(),T=this._task.getLoopStackSize(),M=null,this._operationTab.getSize()>0?[4,this.executeOperations(0,this._operationTab.getSize()-1,u,A,l,S,!1,!1,-1)]:[3,9];case 8:M=h.sent(),h.label=9;case 9:return R=S.value,null!==M?[2,M]:u?[3,11]:[4,this._task.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 10:h.sent(),h.label=11;case 11:return R&&(null===(m=o.mgDataTable.getMGData(A))||m.IsAborting||(o.mgDataTable.currMgdID=A)),[3,15];case 12:if((v=h.sent())instanceof ae)throw r.Logger.Instance.LogLevel!==r.Logger_LogLevels.Basic&&r.Logger.Instance.WriteExceptionToLog(v),v;if(v instanceof t.Exception)return r.Logger.Instance.WriteExceptionToLog(v),[2,new pr(!1,!0)];throw v;case 13:return[4,this._propagateExp.getVal()];case 14:for(i=h.sent(),L=this._task.getLoopStackSize();L>T;L=L--)this._task.popLoopCounter();return[7];case 15:return null===p?[3,17]:[4,this.getArgValsFromFlds(p)];case 16:h.sent(),h.label=17;case 17:if(e.getType()===E.EVENT_TYPE_INTERNAL)switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_PREFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_REC_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_REC_SUFFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_PREFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_PREFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_TASK_SUFFIX:g.addTaskFlowRec(r.InternalInterface.MG_ACT_TASK_SUFFIX,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_SUFFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_SUFFIX,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_PREFIX:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_PREFIX,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_VARIABLE:g.addTaskFlowFld(r.InternalInterface.MG_ACT_VARIABLE,e.getFld().getName(),V.FLWMTR_END,this._task.GetTaskDetails());break;case r.InternalInterface.MG_ACT_CTRL_VERIFICATION:g.addTaskFlowCtrl(r.InternalInterface.MG_ACT_CTRL_VERIFICATION,s.Name,V.FLWMTR_END,this._task.GetTaskDetails());break;default:g.addTaskFlowHandler(this._evt.getBrkLevel(!0),V.FLWMTR_END,this._task.GetTaskDetails())}else g.addTaskFlowHandler(this._evt.getBrkLevel(!0),1,this._task.GetTaskDetails());return[3,19];case 18:return this._task.setBrkLevel(c,_),[7];case 19:return[2,new pr(i,!0)]}}))}))},e.prototype.executeOperations=function(e,t,n,a,s,i,l,u,c){return T(this,void 0,void 0,(function(){var _,T,p,g,d,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:p=-1,g=!1,d=this._task.getMGData(),I=e,C=!1,S=U.Instance,M=!1,u?(g=u,p=c):(_=this._operationTab.getOperation(I),(p=o.eventsManager.getNextOperIdx(_,!0))>-1?(g=!0,l&&(C=!0)):g=!1),h.label=1;case 1:return!(I<=t)||o.eventsManager.GetStopExecutionFlag()||d.IsAborting||M||l&&C&&this._operationTab.getOperation(t).getServerId()<p?[3,35]:(_=this._operationTab.getOperation(I),T=_.getType(),C=!1,le.GetInstance().DelayCommandExecution?(this._task.setUseLoopStack(s>0),[4,_.operServer(null)]):[3,3]);case 2:return h.sent(),[3,35];case 3:if(g&&_.getServerId()<p){if(T!==E.MG_OPER_BLOCK)return[3,34];if(this._operationTab.getOperation(_.getBlockEnd()).getServerId()<p)return[3,34]}return n?[3,5]:[4,this._task.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 4:h.sent(),h.label=5;case 5:return this._taskMgdID!==a&&(i.value=!0),!this._task.isMainProg()&&this._task.isOpenWin()&&(o.mgDataTable.currMgdID=this._taskMgdID),[4,o.eventsManager.CheckAndShowSpinner(!0)];case 6:switch(h.sent(),T){case E.MG_OPER_VERIFY:return[3,7];case E.MG_OPER_LOOP:return[3,9];case E.MG_OPER_BLOCK:return[3,18];case E.MG_OPER_ENDBLOCK:return[3,27];case E.MG_OPER_CALL:return[3,29]}return[3,31];case 7:return[4,_.execute(g)];case 8:return h.sent()?("TS"!==this._task.getBrkLevel()&&o.eventsManager.setStopExecution(!0),this._task.getInRecordSuffix()&&this._task.getLevel()===r.Constants.TASK_LEVEL_TASK&&this._task.setLevel(r.Constants.TASK_LEVEL_RECORD),[2,new pr(!1,!0)]):[3,33];case 9:return this._task.enterLoop(),this._task.increaseLoopCounter(),this._task.setUseLoopStack(!0),[4,S.addFlowFieldOperation(_,!0,this._task.GetTaskDetails())];case 10:if(h.sent(),R=!1,_.getExecOnServer())return[3,15];h.label=11;case 11:return[4,_.execute(!1)];case 12:return h.sent()?[4,this.executeOperations(I+1,_.getBlockClose()-1,n,a,s+1,i,!1,!1,-1)]:[3,14];case 13:return null!==(f=h.sent())?[2,f]:d.IsAborting||o.eventsManager.GetStopExecutionFlag()?[3,14]:(this._task.increaseLoopCounter(),this._task.setUseLoopStack(!0),[3,11]);case 14:return[3,17];case 15:return[4,_.execute(!1)];case 16:h.sent()&&(R=!0),h.label=17;case 17:return R||(I=_.getBlockEnd()-1),this._task.leaveLoop(),[3,33];case 18:return I,!_.getExecOnServer()||g&&_.getServerId()<p?(this._task.setUseLoopStack(!0),!g||_.getServerId()>=p?[4,this.getSignificantBlock(I,_.getBlockEnd())]:[3,20]):[3,22];case 19:return I=h.sent(),[3,21];case 20:I=this.getStartBlockIfIdxByOper(I,p),h.label=21;case 21:return[3,24];case 22:return this._task.setUseLoopStack(s>0),[4,_.operServer(null)];case 23:if(h.sent(),(p=o.eventsManager.getNextOperIdx(_,!0))>-1){if(g=!0,l&&(C=!0),p<this._operationTab.getOperation(_.getBlockEnd()).getServerId())for(;this._operationTab.getOperation(_.getBlockClose()).getServerId()<p;)I=_.getBlockClose(),_=this._operationTab.getOperation(I)}else g=!1,I=-1;h.label=24;case 24:return-1===I?[3,26]:(A=!0,_=this._operationTab.getOperation(I),g&&this._operationTab.getOperation(_.getBlockClose()).getServerId()<=p&&(A=!1,C=!0),A?[4,this.executeOperations(I+1,_.getBlockClose()-1,n,a,s+1,i,!0,g,p)]:[3,26]);case 25:if(null!==(f=h.sent()))return f.ReturnedFromServer?(g=f.ReturnedFromServer,p=f.NextOperIdx,C=f.BlockIfReturnedFromServer,I=_.getBlockEnd()-1,[3,34]):[2,f];h.label=26;case 26:return I=_.getBlockEnd()-1,[3,33];case 27:return[4,S.addFlowFieldOperation(_,!0,this._task.GetTaskDetails())];case 28:return h.sent(),[3,33];case 29:return this._task.setUseLoopStack(s>0),[4,_.execute(g)];case 30:return M=h.sent(),[3,33];case 31:return this._task.setUseLoopStack(s>0),[4,_.execute(g)];case 32:return h.sent(),[3,33];case 33:C||((p=o.eventsManager.getNextOperIdx(_,!0))>-1?(g=!0,l&&(C=!0)):g=!1),h.label=34;case 34:return I+=1,[3,1];case 35:return[2,f=M?new pr(!1,!0):C?new pr(p,g,C):null]}}))}))},e.prototype.getSignificantBlock=function(e,t){return T(this,void 0,void 0,(function(){var r,n,a;return h(this,(function(s){switch(s.label){case 0:r=-1,s.label=1;case 1:return e<t?(n=this._operationTab.getOperation(e),(a=n.getType())!==E.MG_OPER_BLOCK&&a!==E.MG_OPER_ELSE&&a!==E.MG_OPER_SERVER?[3,3]:[4,n.execute(!1)]):[3,3];case 2:return s.sent()?(r=e,[3,3]):(e=n.getBlockClose(),[3,1]);case 3:return[2,r]}}))}))},e.prototype.getStartBlockIdxByEnd=function(e){var t,r=-1,n=!1;for(t=e-1;t>=0&&!n;t--){var a=this._operationTab.getOperation(t),s=a.getType();s!==E.MG_OPER_BLOCK&&s!==E.MG_OPER_LOOP||a.getBlockEnd()===e&&(r=t,n=!0)}return r},e.prototype.getStartBlockIdxByElse=function(e){var t,r=-1,n=!1,a=this._operationTab.getOperation(e).getBlockEnd();for(t=e-1;t>=0&&!n;t--){var s=this._operationTab.getOperation(t);s.getType()===E.MG_OPER_BLOCK&&s.getBlockEnd()===a&&(r=t,n=!0)}return r},e.prototype.getStartBlockIfIdxByOper=function(e,t){var r=-1,n=!1,a=this._operationTab.serverId2operIdx(t,e)-1;for(-2===a&&(a=this._operationTab.serverId2FollowingOperIdx(t,e)-1);a>=0&&!n;){var s=this._operationTab.getOperation(a).getType();if(s===E.MG_OPER_BLOCK)a===e?(r=a,n=!0):a--;else if(s===E.MG_OPER_ELSE){var i=this.getStartBlockIdxByElse(a);i===e?(r=a,n=!0):a=i-1}else s===E.MG_OPER_ENDBLOCK?a=this.getStartBlockIdxByEnd(a)-1:a--}return r},e.prototype.getLevel=function(){return this._level},e.prototype.getEvent=function(){return this._evt},e.prototype.getId=function(){return this._id},e.prototype.getStaticCtrl=function(){return this._ctrl},e.prototype.getRunTimeCtrl=function(){return o.eventsManager.getLastRtEvent().Control},e.prototype.isEnabled=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this._enabledExp.getVal()];case 1:return[2,e.sent()]}}))}))},e.prototype.resetLocalVariables=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s;return h(this,(function(i){switch(i.label){case 0:t=this._task.DataView,r=0,i.label=1;case 1:i.trys.push([1,13,,14]),n=this._dvPos,i.label=2;case 2:return n<this._dvPos+this._dvLen?(a=t.getField(n),s=!this._hasParameters||a.isParam(),null!==e&&r<e.getSize()&&s?e.getArg(r).skipArg()?[3,4]:[4,e.getArg(r).setValueToField(a)]:[3,7]):[3,12];case 3:return i.sent(),[3,6];case 4:return a.invalidate(!0,M.CLEAR_FLAGS),[4,a.compute(!1)];case 5:i.sent(),i.label=6;case 6:return r++,[3,9];case 7:return a.invalidate(!0,M.CLEAR_FLAGS),[4,a.compute(!1)];case 8:i.sent(),i.label=9;case 9:return[4,a.updateDisplay()];case 10:i.sent(),i.label=11;case 11:return n++,[3,2];case 12:return[3,14];case 13:throw i.sent();case 14:return[2]}}))}))},e.prototype.getArgValsFromFlds=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:t=this._task.DataView,r=0,n=this._dvPos,l.label=1;case 1:return n<this._dvPos+this._dvLen&&r<e.getSize()?(a=t.getField(n),this._hasParameters&&!a.isParam()?[3,5]:(s=e.getArg(r)).getType()!==E.ARG_TYPE_FIELD||null===(i=s.getField()).getTask()||i.getTask().isAborting()?[3,4]:(o=a.getValue(!1),[4,i.setValueAndStartRecompute(o,a.isNull(),!0,a.isModified(),!1)])):[3,6];case 2:return l.sent(),[4,i.updateDisplay()];case 3:l.sent(),l.label=4;case 4:r++,l.label=5;case 5:return n++,[3,1];case 6:return[2]}}))}))},e.prototype.getTask=function(){return this._task},e.prototype.argsMatch=function(e){for(var t=!0,n=this._task.DataView,a=0,s=0,i=this._dvPos;i<this._dvPos+this._dvLen;i++){var o=n.getField(i);if(o.isParam()&&(s++,a<e.length)){var l=o.getType(),u=e[a].Attr;if(!e[a].IsNull&&!r.StorageAttributeCheck.isTheSameType(l,u)&&!r.StorageAttributeCheck.StorageFldAlphaUnicodeOrBlob(l,u)){t=!1;break}a++}}return s!==e.length&&(t=!1),t},e.prototype.getOperationTab=function(){return this._operationTab},e.prototype.getControlNameForControlHeader=function(){return this.getEvent().getType()==E.EVENT_TYPE_INTERNAL&&this.getEvent().isControlHeader()&&!a.isNullOrUndefined(this._ctrl)?this.getCtrlName():t.NString.Empty},e.prototype.getVarNameForVariableHeader=function(){return this.getEvent().isVariableHeader()&&!a.isNullOrUndefined(this._handlerFld)?this._handlerFld.getVarName().toUpperCase():t.NString.Empty},e.prototype.getEventHandlerInfo=function(){var e=new t.StringBuilder;this.getEvent().AppendDescription(e);var r=this.getControlNameForControlHeader()+this.getVarNameForVariableHeader();return e.Append(r),t.NString.IsNullOrEmpty(e.toString())||(e=new t.StringBuilder(" "+e.toString(),e.toString().length+1)),t.NString.Format("Handler {0}{1}",this.getEvent().getEventType(),e)},e.prototype.checkTaskScope=function(e){return!(this._scope===r.BrkScope.Task&&!e)},e.prototype.toString=function(){return t.NString.Format("(Handler for {0} on task {1}, scope {2})",this._evt,this._task,this._scope)},e}(),pr=function(){function e(e,t,r){this.BlockIfReturnedFromServer=!1,this.Enabled=!1,this.NextOperIdx=0,this.Propagate=!1,this.ReturnedFromServer=!1,2===arguments.length?this.constructor_0(e,t):this.constructor_1(e,t,r)}return e.prototype.constructor_0=function(e,t){this.Propagate=e,this.Enabled=t,this.NextOperIdx=0,this.ReturnedFromServer=!1,this.BlockIfReturnedFromServer=!1},e.prototype.constructor_1=function(e,t,r){this.Propagate=!1,this.Enabled=!0,this.NextOperIdx=e,this.ReturnedFromServer=t,this.BlockIfReturnedFromServer=r},e}(),gr=function(){function e(){this._handlers=null,this._handlers=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EVENTHANDLERS)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==E.MG_TAG_HANDLER)return t==="/"+E.MG_TAG_EVENTHANDLERS?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in HandlersTable. Insert else if to HandlersTable.initInnerObjects for "+t),!1);var a=new hr;a.fillData(n,e),this._handlers.push(a)}return!0},e.prototype.add=function(e){this._handlers.push(e)},e.prototype.CalculateControlFormControlName=function(){this._handlers.forEach((function(e){e.calculateCtrlFromControlName(e.getTask())}))},e.prototype.remove=function(e){this._handlers.RemoveAt(e)},e.prototype.insertAfter=function(e,t){this._handlers.Insert(t,e)},e.prototype.getSize=function(){return this._handlers.length},e.prototype.getHandler=function(e){return e<0||e>=this._handlers.length?null:this._handlers.get_Item(e)},e.prototype.hasExpressionHandler=function(){for(var e=0;e<this._handlers.length;e++){var t=this.getHandler(e).getEvent();if(t.getType()===E.EVENT_TYPE_EXPRESSION||t.getType()===E.EVENT_TYPE_USER&&t.getUserEventType()===E.EVENT_TYPE_EXPRESSION)return!0}return!1},e.prototype.startTimers=function(e){var t=ge.Instance;if(null!==this._handlers)for(var r=this.getTimersVector(),n=0;n<r.length;n++)t.startTimer(e,r.get_Item(n),!1)},e.prototype.getTimersVector=function(){for(var e=new t.List,r=0;r<this._handlers.length;r++){var n=this.getHandler(r).getEvent(),a=void 0;a=n.getType()===E.EVENT_TYPE_TIMER?n.getSeconds():n.getSecondsOfUserEvent();for(var s=!1,i=0;i<e.length;i++)if(a===e.get_Item(i)){s=!0;break}s||e.push(a)}return e},e}(),dr=function(){function e(){}return e.prototype.fillAttributes=function(e){for(var n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),a=e.getXMLdata().indexOf(r.XMLConstants.MG_TAG_RECOMPUTE,e.getCurrIndex())+r.XMLConstants.MG_TAG_RECOMPUTE.length,s=null,i=r.XmlParser.getTokens(e.getXMLdata().substr(a,n-a),'"'),l=0;l<i.length;l+=2){var u=i.get_Item(l),c=i.get_Item(l+1);u===r.XMLConstants.MG_ATTR_TASKID?s=o.mgDataTable.GetTaskByID(c):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",u))}return e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),s},e.prototype.fillData=function(e){var n=this.fillAttributes(e);if(null===n)throw new t.ApplicationException("in RecomputeTable.fillData() invalid task id: ");r.Logger.Instance.WriteDevToLog("goes to refill recompute"),this.fillData_1(n.DataView,n,e)},e.prototype.fillData_1=function(e,t,r){for(;this.initInnerObjects(r,r.getNextTag(),e,t););},e.prototype.initInnerObjects=function(e,t,n,a){if(null===t)return!1;if(t===r.XMLConstants.MG_TAG_RECOMPUTE)e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);else{if(t!==r.XMLConstants.MG_TAG_FLD)return t==="/"+r.XMLConstants.MG_TAG_RECOMPUTE?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in <recompute>, add case to RecomputeTable.initInnerObjects for "+t),!1);(new Ct).fillData(n,a,e)}return!0},e}(),Er=function(){function e(){this._cmdToServer=null,this._cmdsToServer=null,this._computeBy="\0",this._expBytes=null,this._id=-1,this._prevResType=r.StorageAttribute.NONE,this._resultValue=null,this._task=null,this._type=r.StorageAttribute.NONE,this._clientStorageAttribute=r.StorageAttribute.NONE}return e.prototype.GetStorageAttribute=function(){return this._clientStorageAttribute},e.prototype.evaluateWithResultTypeAndLength=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,l,u;return h(this,(function(c){switch(c.label){case 0:return s=r.StorageAttribute.NONE,this.computedByClient()?[4,ct.eval(this._expBytes,e,this._task)]:[3,2];case 1:return i=c.sent(),a=i.IsNull?null:e===r.StorageAttribute.BLOB_VECTOR&&i.Attr===r.StorageAttribute.BLOB?n.VectorType.validateBlobContents(i.StrVal)?i.ToMgVal():null:i.Attr===r.StorageAttribute.BLOB_VECTOR&&e!==r.StorageAttribute.BLOB_VECTOR&&e!==r.StorageAttribute.BLOB?null:i.ToMgVal(),i.IsNull||(s=i.Attr),[3,4];case 2:return l=o.eventsManager.getLastRtEvent(),u=null,null!==l&&(u=l.getMainPrgCreator()),e!==this._prevResType&&(this._cmdToServer=Qe.CreateEvaluateCommand(this._task.getTaskTag(),e,this._id,t,u)),[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._cmdsToServer,this._cmdToServer,this)];case 3:c.sent(),a=e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR?this._resultValue:null!==this._resultValue&&" "===this._resultValue?"":n.RecordUtils.byteStreamToString(this._resultValue),c.label=4;case 4:return this._prevResType=e,e===r.StorageAttribute.NONE&&(this._clientStorageAttribute=s),[2,a]}}))}))},e.prototype.DiscardCndRangeResult=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,ct.DiscardCndRangeResult(this._expBytes,this._task)];case 1:return[2,e.sent()]}}))}))},e.prototype.evaluateWithResType=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,l;return h(this,(function(u){switch(u.label){case 0:return t=!1,this.computedByClient()?[4,ct.eval(this._expBytes,e,this._task)]:[3,2];case 1:return a=u.sent(),[3,4];case 2:return s=o.eventsManager.getLastRtEvent(),i=null,null!==s&&(i=s.getMainPrgCreator()),e!==this._prevResType&&(this._cmdToServer=Qe.CreateEvaluateCommand(this._task.getTaskTag(),e,this._id,0,i)),[4,o.mgDataTable.execRequestWithSubformRecordCycle(this._cmdsToServer,this._cmdToServer,this)];case 3:u.sent(),l=void 0,null===(l=e!==r.StorageAttribute.BLOB&&e!==r.StorageAttribute.BLOB_VECTOR?this._resultValue:null!==this._resultValue&&" "===this._resultValue?"":n.RecordUtils.byteStreamToString(this._resultValue))&&(t=!0),e===r.StorageAttribute.NONE&&(e=this._type),a=new n.ExpVal(e,t,l),u.label=4;case 4:return this._prevResType=e,[2,a]}}))}))},e.prototype.evaluateWithResLength=function(e){return T(this,void 0,void 0,(function(){var t,n,a;return h(this,(function(s){switch(s.label){case 0:return t=r.StorageAttribute.NONE,this.computedByClient()?[4,ct.eval(this._expBytes,t,this._task)]:[3,2];case 1:return a=s.sent(),n=a.IsNull?null:a.ToMgVal(),t=a.Attr,[3,4];case 2:return[4,this.evaluateWithResultTypeAndLength(t,e)];case 3:n=s.sent(),t=this._type,s.label=4;case 4:return[2,new Ir(n,t)]}}))}))},e.prototype.fillData=function(e,t){var n,a=t.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,t.getCurrIndex());if(null==this._task&&(this._task=e),-1!==a&&a<t.getXMLdata().length){var s=t.getXMLsubstring(a);t.add2CurrIndex(s.indexOf(E.MG_TAG_EXP)+E.MG_TAG_EXP.length),n=r.XmlParser.getTokens(t.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),this.initElements(n),t.setCurrIndex(a+r.XMLConstants.TAG_TERM.length)}else r.Logger.Instance.WriteExceptionToLogWithMsg("in Command.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var t,n,a,s=0;s<e.length;s+=2)switch(n=e.get_Item(s),a=e.get_Item(s+1),n){case r.XMLConstants.MG_ATTR_VALUE:et.Instance.GetDebugLevel()>1?(t=a,this.buildByteArray(t)):this._expBytes=r.Misc.ToSByteArray(r.Base64.decodeToByte(a));break;case r.XMLConstants.MG_ATTR_ID:this._id=r.XmlParser.getInt(a);break;case E.MG_ATTR_COMPUTE_BY:this._computeBy=a[0];break;default:r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in Expression.initElements class. Insert case to Expression.initElements for "+n)}this.computedByClient()||(this._cmdsToServer=this._task.getMGData().CmdsToServer)},e.prototype.buildByteArray=function(e){if(null===e||0===e.length||e.length%2>0)r.Logger.Instance.WriteExceptionToLogWithMsg("in Expression.buildByteArray() expStr cannot be changed "+e);else{this._expBytes=new Int8Array(e.length/2);for(var a=0;a<e.length;a+=2){var s=e.substr(a,2);this._expBytes[a/2]=n.NUM_TYPE.toSByte(t.NNumber.Parse(s,t.NumberStyles.HexNumber))}}},e.prototype.getId=function(){return this._id},e.prototype.computedByClient=function(){return"S"!==this._computeBy},e.prototype.computedByClientOnly=function(){return"C"===this._computeBy},e.prototype.computedByServerOnly=function(){return"S"===this._computeBy},e.prototype.getTask=function(){return this._task},e.prototype.SetResultValue=function(e,t){this._resultValue=e,this._type=t},e.prototype.toString=function(){return t.NString.Format("{{Expression #{0} of {1}}}",this._id,this._task)},e}(),Ir=function(e,t){this.mgVal=null,this.type=r.StorageAttribute.NONE,this.mgVal=e,this.type=t},fr=function(){function e(){this._exps=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;if(t===E.MG_TAG_EXP){var a=new Er;a.fillData(n,e),this._exps.push(a)}else{if(t!==E.MG_TAG_EXPTABLE)return t==="/"+E.MG_TAG_EXPTABLE?(e.setCurrIndex2EndOfTag(),!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in ExpTable.initInnerObjects(): "+t),!1);e.setCurrIndex(e.getXMLdata().indexOf(">",e.getCurrIndex())+1)}return!0},e.prototype.getExpById=function(e){var t;if(e<0)return null;for(var r=0;r<this._exps.length;r++){if((t=this._exps.get_Item(r)).getId()===e)return t;t=null}return t},e.prototype.getExp=function(e){var t=null;return e>=0&&e<this._exps.length&&(t=this._exps.get_Item(e)),t},e.prototype.getSize=function(){var e=0;return null!==this._exps&&(e=this._exps.length),e},e}(),Cr=function(){function e(){this._userEventsTab=null,this._userEventsTab=new t.List}return e.prototype.fillData=function(e,t){for(;this.initInnerObjects(t,t.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t,n){if(null===t)return!1;switch(t){case E.MG_TAG_EVENT:var a=new k;a.fillData(e,n),this._userEventsTab.push(a);break;case E.MG_TAG_USER_EVENTS:e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1);break;case E.MG_TAG_USER_EVENTS_END:return e.setCurrIndex2EndOfTag(),!1;default:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in UserEventsTable.initInnerObjects : "+t),!1}return!0},e.prototype.getEvent=function(e){return e<0||null===this._userEventsTab||e>=this._userEventsTab.length?null:this._userEventsTab.get_Item(e)},e.prototype.getIdxByEvent=function(e){return this._userEventsTab.indexOf(e)},e.prototype.getSize=function(){return null===this._userEventsTab?0:this._userEventsTab.length},e}(),Ar=function(){function e(e,t){this._task=null,this._parentForm=null,this._formsStringXml=null,this._task=e,this._parentForm=t}return Object.defineProperty(e.prototype,"Count",{get:function(){return this._formsStringXml.length},enumerable:!1,configurable:!0}),e.prototype.get_Item=function(e){return e>0&&e<=this._formsStringXml.length?this._formsStringXml.get_Item(e-1):null},e.prototype.fillData=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:this._formsStringXml=new t.List,e=n.Manager.GetCurrentRuntimeContext().Parser,r.label=1;case 1:return[4,this.initInnerObjects(e.getNextTag())];case 2:return r.sent()?[3,1]:[3,3];case 3:return[2]}}))}))},e.prototype.InitFormFromXmlString=function(e){var t=this.get_Item(1);e>0&&e<=this._formsStringXml.length&&(t=this.get_Item(e)),null!==t&&(n.RuntimeContextBase.Instance.Parser.push(),n.RuntimeContextBase.Instance.Parser.PrepareFormReadString(t),this._task.FormInitData(this._parentForm),n.RuntimeContextBase.Instance.Parser.pop())},e.prototype.initInnerObjects=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return null===e?[2,!1]:(t=n.Manager.GetCurrentRuntimeContext().Parser,e!==r.XMLConstants.MG_TAG_FORMS?[3,1]:(t.setCurrIndex(t.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t.getCurrIndex())+1),[3,5]));case 1:return e!==r.XMLConstants.MG_TAG_FORM?[3,2]:(a=n.RuntimeContextBase.Instance.Parser.ReadToEndOfCurrentElement(),this._formsStringXml.push(a),[2,!0]);case 2:return e!=="/"+r.XMLConstants.MG_TAG_FORM?[3,3]:(t.setCurrIndex2EndOfTag(),[2,!0]);case 3:return e!=="/"+r.XMLConstants.MG_TAG_FORMS?[3,5]:[4,this.PrepareMainDisplayForConnectedTask()];case 4:return s.sent(),t.setCurrIndex2EndOfTag(),[2,!1];case 5:return[2,!0]}}))}))},e.prototype.PrepareMainDisplayForConnectedTask=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return this._task.TaskService instanceof nr?[4,this._task.PrepareTaskForm()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}(),Rr=function(){function e(e){this._actCount=null,this._actState=null,this._parentTask=null,this._numerator=0,this._parentTask=e,this._numerator=0,this._actState=new Array(r.InternalInterface.MG_ACT_TOT_CNT);for(var t=0;t<this._actState.length;++t)this._actState[t]=!1;this._actCount=new Array(r.InternalInterface.MG_ACT_TOT_CNT);for(t=0;t<this._actCount.length;++t)this._actCount[t]=0}return e.prototype.enable=function(e,t){this._actState[e];this._actState[e]=t,t&&(this._numerator++,this._actCount[e]=this._numerator)},e.prototype.isEnabled=function(e){return this._actState[e]},e.prototype.getActCount=function(e){return this._actCount[e]},e.prototype.enableList=function(e,t,r){for(var n=0;n<e.length;n+=1){var a=e[n];(!r||this._actState[a]!==t)&&this.enable(a,t)}},e.prototype.enableNavigationActions=function(t){this.enableList(e.actNavigation,t,!1)},e}();Rr.actEnabled=[r.InternalInterface.MG_ACT_CLOSE,r.InternalInterface.MG_ACT_EXIT,r.InternalInterface.MG_ACT_RTO_MODIFY,r.InternalInterface.MG_ACT_RTO_CREATE,r.InternalInterface.MG_ACT_RTO_QUERY,r.InternalInterface.MG_ACT_OK,r.InternalInterface.MG_ACT_CANCEL,r.InternalInterface.MG_ACT_TBL_PRVFLD,r.InternalInterface.MG_ACT_TBL_NXTFLD,r.InternalInterface.MG_ACT_TBL_BEGLINE,r.InternalInterface.MG_ACT_TBL_ENDLINE,r.InternalInterface.MG_ACT_TBL_BEGPAGE,r.InternalInterface.MG_ACT_TAB_NEXT,r.InternalInterface.MG_ACT_TAB_PREV,r.InternalInterface.MG_ACT_TBL_ENDPAGE,r.InternalInterface.MG_ACT_USING_HELP,r.InternalInterface.MG_ACT_ABOUT,r.InternalInterface.MG_ACT_CTRL_HIT,r.InternalInterface.MG_ACT_HIT,r.InternalInterface.MG_ACT_WEB_ON_DBLICK,r.InternalInterface.MG_ACT_WEB_CLICK,r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW,r.InternalInterface.MG_ACT_RT_QUIT,r.InternalInterface.MG_ACT_SERVER_TERMINATION,r.InternalInterface.MG_ACT_SUBFORM_REFRESH,r.InternalInterface.MG_ACT_SUBFORM_CLOSE,r.InternalInterface.MG_ACT_EXIT_SYSTEM,r.InternalInterface.MG_ACT_SUBFORM_OPEN,r.InternalInterface.MG_ACT_COL_SORT,r.InternalInterface.MG_ACT_CTRL_MODIFY,r.InternalInterface.MG_ACT_ROLLBACK,r.InternalInterface.MG_ACT_EXT_EVENT,r.InternalInterface.MG_ACT_COL_CLICK,r.InternalInterface.MG_ACT_PRESS,r.InternalInterface.MG_ACT_ENABLE_EVENTS,r.InternalInterface.MG_ACT_COL_FILTER,r.InternalInterface.MG_ACT_INDEX_CHANGE,r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE,r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE,r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER,r.InternalInterface.MG_ACT_CONTEXT_REMOVE],Rr.actNavigation=[r.InternalInterface.MG_ACT_TBL_PRVLINE,r.InternalInterface.MG_ACT_TBL_PRVPAGE,r.InternalInterface.MG_ACT_TBL_BEGTBL,r.InternalInterface.MG_ACT_TBL_NXTLINE,r.InternalInterface.MG_ACT_TBL_NXTPAGE,r.InternalInterface.MG_ACT_TBL_ENDTBL];var Sr,Mr,mr,vr,Lr=function(){function e(){this._CommandsExecutedAfterTaskStarted=null,this._cmdFrame=0,this._unframedCmds=null,this._CommandsExecutedAfterTaskStarted=new t.List,this._cmdFrame=0,this._unframedCmds=new t.List}return e.prototype.getCommandsExecutedAfterTaskStarted=function(){return this._CommandsExecutedAfterTaskStarted},e.prototype.addCommandsExecutedAfterTaskStarted=function(e){this._CommandsExecutedAfterTaskStarted.push(e)},e.prototype.removeCommandsExecutedAfterTaskStarted=function(e){this._CommandsExecutedAfterTaskStarted.Remove(e)},e.prototype.add1toCmdFrame=function(){this._cmdFrame++},e.prototype.getCmdFrame=function(){return this._cmdFrame},e.prototype.addUnframedCmd=function(e){this._unframedCmds.push(e)},e.prototype.getUnframedCmds=function(){return this._unframedCmds},e}();Lr.Instance=new Lr,e.EventsAllowedType=void 0,(Sr=e.EventsAllowedType||(e.EventsAllowedType={}))[Sr.NONE=0]="NONE",Sr[Sr.NON_INTERACTIVE=1]="NON_INTERACTIVE",Sr[Sr.ALL=2]="ALL",e.Task_Flow=void 0,(Mr=e.Task_Flow||(e.Task_Flow={}))[Mr.NONE=0]="NONE",Mr[Mr.STEP=1]="STEP",Mr[Mr.FAST=2]="FAST",e.Task_Direction=void 0,(mr=e.Task_Direction||(e.Task_Direction={}))[mr.BACK=-1]="BACK",mr[mr.NONE=0]="NONE",mr[mr.FORE=1]="FORE",function(e){e.NONE=" ",e.FAST_BACKWARD="R",e.FAST_FORWARD="F",e.STEP_BACKWARD="P",e.STEP_FORWARD="N"}(vr||(vr={}));var br=function(s){function i(e){var t=s.call(this)||this;return t._dvCache=null,t._mgData=null,t._aborting=!1,t._bExecEndTask=!1,t._isStarted=!1,t._evalOldValues=!1,t._inRecordSuffix=!1,t._cancelWasRaised=!1,t._counter=0,t._currStartProgLevel=0,t._destinationSubform=!1,t._enableZoomHandler=!1,t._firstRecordCycle=!1,t._originalTaskMode=" ",t._inCreateLine=!1,t.InSelect=!1,t.InStartProcess=!1,t._isDestinationCall=!1,t._knownToServer=!0,t._loopStack=null,t.DelayCommandExecution=!1,t._parentTask=null,t.ContextTask=null,t._triggeringTask=null,t.PathParentTask=null,t._preventControlChange=!1,t._preventRecordSuffix=!1,t._taskPath=null,t._tryingToCommit=!1,t._useLoopStack=!1,t._inProcessingTopMostEndTaskSaved=!1,t.InHandleActCancel=!1,t.RuntimeSorts=null,t.VewFirst=0,t.dataViewContent=null,t.PerformParentRecordPrefix=!1,t.ModeAsParent=!1,t.TaskTransactionManager=null,t.ExecuteClientSubformRefresh=!1,t.InCommonHandlerBeforeRP=!1,t._taskService=null,t.hasLocate=!1,t.taskDefinitionId=null,t.ArgumentsList=null,t.ConfirmUpdateNo=!1,t.DataSynced=!1,t.UniqueSort=null,t.RefreshOnVars=null,t.DvPosDescriptor=null,t.SubTasks=null,t.ExpTab=null,t.UserEvtTab=null,t.DataviewHeadersTable=null,t.HandlersTab=null,t._forms=null,t.Name=null,t.PublicName=null,t.TaskSuffixExecuted=!1,t.RetrunValueExp=0,t.SubformControl=null,a.isNullOrUndefined(e)?(t.constructor_0(),t):(t.constructor_1(e),t)}return u(i,s),Object.defineProperty(i.prototype,"ParentTask",{get:function(){return this._parentTask},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TryingToCommit",{get:function(){return this._tryingToCommit},set:function(e){this._tryingToCommit=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskService",{get:function(){return null==this._taskService&&(this._taskService=new nr),this._taskService},enumerable:!1,configurable:!0}),Object.defineProperty(i,"CommandsProcessor",{get:function(){return Te.GetCommandsProcessor()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"LogicalStudioParentTask",{get:function(){return null!==this.StudioParentTask||s.prototype.isMainProg.call(this)?this.StudioParentTask:n.GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID,this._ctlIdx)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"KnownToServer",{get:function(){return this._knownToServer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Transaction",{get:function(){return this.DataviewManager.CurrentDataviewManager.Transaction},set:function(e){this.DataviewManager.CurrentDataviewManager.Transaction=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"TaskDefinitionId",{get:function(){return null===this.taskDefinitionId&&(this.taskDefinitionId=new n.TaskDefinitionId(this._ctlIdx,this.ProgramIsn,this.TaskIsn,this._isPrg)),this.taskDefinitionId},enumerable:!1,configurable:!0}),Object.defineProperty(i,"IsBlockingBatch",{get:function(){return!1},enumerable:!1,configurable:!0}),i.prototype.constructor_0=function(){this.ActionManager=new Rr(this),this.DataView=new yt(this),this._flowMonitor=U.Instance,this.ContextTask=this,this._dvCache=new Ot(this),this.PerformParentRecordPrefix=!0,this.DataviewManager=new $t(this),this.allowRemoteCmdExecution=!0,this.TaskTransactionManager=new xt(this)},i.prototype.Init=function(){this.DataView.Init()},i.prototype.constructor_1=function(e){this.constructor_0(),this.PathParentTask=e,this._parentTask=e,this._triggeringTask=null,this.buildTaskPath()},i.CreateTask=function(){var e=new i;return e.Init(),e},i.prototype.isAborting=function(){return this._aborting},i.prototype.buildTaskPath=function(){this._taskPath=new t.List,null!==this._parentTask._taskPath&&this._taskPath.AddRange(this._parentTask._taskPath.GetEnumerator()),this._taskPath.push(this)},i.prototype.fillData=function(e,t){var r=Object.create(null,{isMainProg:{get:function(){return s.prototype.isMainProg}}});return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:r.isMainProg.call(this)||(null===this._parentTask&&null!==t.CallingTask&&(this._parentTask=t.CallingTask,this.buildTaskPath(),t.CallingTask.addSubTask(this)),null===this.PathParentTask&&null!==t.PathParentTask&&(this.PathParentTask=t.PathParentTask)),null!==this._parentTask&&this._parentTask.getEnableZoomHandler()&&this.setEnableZoomHandler(),this._mgData=e,this.fillAttributes(),this._mgData.addTask(this),a=null!==this._parentTask?this._parentTask.getForm():null,i.label=1;case 1:return[4,this.initInnerObjects(n.RuntimeContextBase.Instance.Parser.getNextTag(),a)];case 2:return i.sent()?[3,1]:[3,3];case 3:return this.TaskTransactionManager.PrepareTransactionProperties(this.DataviewManager.RemoteDataviewManager.Transaction,!1),this.HandleTriggerTask(),this.HandlePreviouslyActiveTaskId(),this.CheckAndSetSubForm(),this.IsSubForm&&(null!==(s=this.getParent().getForm().getSubFormCtrlForTask(this._taskTag))&&s.setSubformTaskId(this._taskTag),null!==this.Form&&this.Form.setSubFormCtrl(s)),[2]}}))}))},i.prototype.HandlePreviouslyActiveTaskId=function(){null!==this._parentTask&&null!==this._parentTask.GetContextTask()&&this._mgData!==this._parentTask.getMGData()?this.PreviouslyActiveTaskId=this._parentTask.GetContextTask().getTaskTag():null!==this._parentTask&&(this.PreviouslyActiveTaskId=this._parentTask.getTaskTag())},i.prototype.HandleTriggerTask=function(){this._triggeringTask=this._parentTask},i.prototype.FillTaskTables=function(e){1!==arguments.length?this.FillTaskTables_1():this.FillTaskTables_0(e)},i.prototype.FillTaskTables_0=function(e){},i.prototype.fillAttributes=function(){var e=n.RuntimeContextBase.Instance.Parser,t=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex());-1!==t&&t<e.getXMLdata().length?(s.prototype.fillAttributes.call(this,e),s.prototype.isMainProg.call(this)&&(this._mgData=o.mgDataTable.getMGData(0))):r.Logger.Instance.WriteExceptionToLogWithMsg("in Task.fillAttributes() out of string bounds")},i.prototype.setAttribute=function(e,n){var a;if(!(a=s.prototype.setAttribute.call(this,e,n)))switch(a=!0,e){case E.MG_ATTR_REFRESHON:""!==n.trim()&&this.SetRefreshOnVars(n);break;case r.XMLConstants.MG_ATTR_NAME:this.Name=n;break;case E.MG_ATTR_DVPOS_DEC:""!==n.trim()&&this.setDescriptor(n);break;case E.MG_ATTR_HAS_LOCATE:this.hasLocate=!0;break;case E.MG_ATTR_AS_PARENT:this.ModeAsParent=!0;break;case E.MG_ATTR_TASK_UNIQUE_SORT:this.UniqueSort=n[0];break;case E.MG_ATTR_TRANS_ID:this.setRemoteTransaction(n);break;case E.MG_ATTR_PUBLIC:this.PublicName=r.XmlParser.unescape(n);break;case r.XMLConstants.MG_ATTR_IS_OFFLINE:this.IsOffline=r.XmlParser.getBoolean(n);break;case r.XMLConstants.MG_ATTR_RETURN_VALUE_EXP:this.RetrunValueExp=r.XmlParser.getInt(n);break;case r.XMLConstants.MG_ATTR_MENUS_FILE_NAME:break;default:a=!1}return a||r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("Unrecognized attribute: '{0}'",e)),!0},i.prototype.initInnerObjects=function(e,a){return T(this,void 0,void 0,(function(){var s,l,u,c;return h(this,(function(_){switch(_.label){case 0:if(null==e)return[2,!1];switch(s=n.RuntimeContextBase.Instance.Parser,e){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,3];case r.XMLConstants.MG_TAG_FORM:return[3,4];case r.XMLConstants.MG_ATTR_MENU_CONTENT:return[3,5];case"assemblies":return[3,6];case r.XMLConstants.MG_TAG_FORMS:return[3,7];case r.XMLConstants.MG_TAG_TASK:return[3,9];case E.MG_TAG_TASKURL:return[3,11];case E.MG_TAG_EXPTABLE:return[3,13];case E.MG_TAG_USER_EVENTS:return[3,14];case E.MG_TAG_LINKS:return[3,15];case E.MG_TAG_SORTS:return[3,16];case E.MG_TAG_TASK_TABLES:return[3,17];case r.XMLConstants.MG_TAG_RECOMPUTE:return[3,18];case E.MG_TAG_EVENTHANDLERS:return[3,19]}return[3,20];case 1:return null==this._helpTab&&(this._helpTab=new n.Helps),n.Events.ShouldLog(r.Logger_LogLevels.Development)&&n.Events.WriteDevToLog(t.NString.Format("{0} ...",e)),this._helpTab.fillData(s),[3,21];case 2:return n.Events.ShouldLog(r.Logger_LogLevels.Development)&&n.Events.WriteDevToLog(t.NString.Format("{0} ...",e)),this.DataView.fillHeaderData(s),[3,21];case 3:return this._propTab.fillData(this,"T",s),[3,21];case 4:return this.Form=this.FormInitData(a),[3,21];case 5:return[3,21];case 6:return s.getCurrIndex(),l=s.getXMLdata().indexOf("/assemblies",s.getCurrIndex()),s.setCurrIndex(l),s.setCurrIndex2EndOfTag(),[3,21];case 7:return this._forms=new Ar(this,a),r.Logger.Instance.WriteDevToLog(t.NString.Format("{0} ...",e)),[4,this._forms.fillData()];case 8:case 10:case 12:return _.sent(),[3,21];case 9:return null==this.SubTasks&&(this.SubTasks=new O),(u=new i(this)).Init(),this.SubTasks.addTask(u),c=this._mgData,this.isMainProg()&&(c=o.mgDataTable.GetMGDataForStartupProgram()),[4,u.fillData(c,new y)];case 11:return[4,i.ProcessTaskURL()];case 13:return null==this.ExpTab&&(this.ExpTab=new fr),r.Logger.Instance.WriteDevToLog("goes to exp"),this.ExpTab.fillData(this,s),[3,21];case 14:return null==this.UserEvtTab&&(this.UserEvtTab=new Cr),r.Logger.Instance.WriteDevToLog("goes to user event tab"),this.UserEvtTab.fillData(this,s),[3,21];case 15:return this.DataviewHeadersTable=new _r(this),this.DataviewHeadersTable.fillData(s),[3,21];case 16:return this.RuntimeSorts=new er,this.RuntimeSorts.fillData(this,s),[3,21];case 17:return this.FillTaskTables(),[3,21];case 18:return r.Logger.Instance.WriteDevToLog("goes to recompute"),this.RecomputeFillData(s),[3,21];case 19:return r.Logger.Instance.WriteDevToLog("goes to eventhandlers"),null==this.HandlersTab&&(this.HandlersTab=new gr),this.HandlersTab.fillData(this,s),this.addExpHandlersToMGData(),[3,21];case 20:return e==="/"+r.XMLConstants.MG_TAG_TASK?(n.RuntimeContextBase.Instance.Parser.setCurrIndex2EndOfTag(),[2,!1]):(r.Logger.Instance.WriteDevToLog("There is no such tag in Task.initInnerObjects . Enter case for "+e),[2,!1]);case 21:return[2,!0]}}))}))},i.prototype.RecomputeFillData=function(e){(new dr).fillData_1(this.DataView,this,e)},i.prototype.FillTaskTables_1=function(){var e=n.RuntimeContextBase.Instance.Parser,t=e.getXMLdata().indexOf(E.MG_TAG_TASK_TABLES_END,e.getCurrIndex());t=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,t)+r.XMLConstants.TAG_CLOSE.length;var a=e.getXMLsubstring(t);this.FillTaskTables(a),e.setCurrIndex(t)},i.prototype.addExpHandlersToMGData=function(){for(var e=0,t=this.HandlersTab.getSize()-1;t>=0;t--){var r=this.HandlersTab.getHandler(t),n=r.getEvent();(n.getType()===E.EVENT_TYPE_EXPRESSION||n.getType()===E.EVENT_TYPE_USER&&n.getUserEventType()===E.EVENT_TYPE_EXPRESSION)&&(this._mgData.addExpHandler(r,e),e++)}},i.prototype.SetRefreshOnVars=function(e){var n,a,s=r.StrUtil.tokenize(e,","),i=new t.List;for(a=0;a<s.length;a++)n=t.NNumber.Parse(s[a]),i.push(n);for(this.RefreshOnVars=new Array(i.length),a=0;a<i.length;a++)n=i.get_Item(a),this.RefreshOnVars[a]=n},i.prototype.setDataSynced=function(e){this.DataSynced=e},i.prototype.getField=function(e){return this.DataView.getFieldByName(e)},i.prototype.getExpById=function(e){return null!==this.ExpTab?this.ExpTab.getExpById(e):(r.Logger.Instance.WriteExceptionToLogWithMsg("in Task.GetExpById(): no expression table"),null)},i.prototype.getExpObjectById=function(e){return this.getExpById(e)},i.prototype.GetExpressionStorage=function(e){var r=null;if(e>0){var n=this.getExpById(e);t.Debug.Assert(null!==n),r=n.GetStorageAttribute()}return r},i.prototype.CalculateExpression=function(e,r,n,a,s){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=null,e>0?(s=this.getExpById(e),t.Debug.Assert(null!==s),[4,s.evaluateWithResultTypeAndLength(r,n)]):[3,2];case 1:a=i.sent(),i.label=2;case 2:return[2,a]}}))}))},i.prototype.insertRecordTable=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.isCached()];case 1:return r.sent()&&!this.DataView.getFirstDv()&&e&&(this.hasLocate?this.locatePutInCache():this.DataView.IncludesFirst()&&(this.DataView.getChanged()?this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0):this._dvCache.putInCache(this.DataView.replicate()))),[4,this.DataView.fillData(t)];case 2:return r.sent(),e&&this.DataView.setChanged(!1),[2]}}))}))},i.prototype.getHandlersTab=function(){return this.HandlersTab},i.prototype.buildXML=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.IsAfterRetryBeforeBuildXML=this.getAfterRetry(),!this.KnownToServer||this.IsOffline?[3,2]:(e.Append(r.XMLConstants.START_TAG+r.XMLConstants.MG_TAG_TASK),e.Append(" "+r.XMLConstants.MG_ATTR_TASKID+'="'+this.getTaskTag()+'"'),e.Append(" "+E.MG_ATTR_TASK_MAINLEVEL+'="'+this.getMainLevel()+'"'),e.Append(r.XMLConstants.TAG_CLOSE),[4,this.DataView.buildXML(e)]);case 1:t.sent(),null!=this.Form&&this.Form.Opened&&e.Append(this.Form.GetHiddenControlListXML()),e.Append("\n </"+r.XMLConstants.MG_TAG_TASK+r.XMLConstants.TAG_CLOSE),t.label=2;case 2:return[2]}}))}))},i.prototype.buildXMLForRngs=function(e,t,a){var s,i=r.StorageAttribute.SKIP,o=et.Instance.GetDebugLevel()<=1;for(e.Append(r.XMLConstants.TAG_CLOSE),s=0;s<t.length;s++){e.Append(r.XMLConstants.START_TAG+E.USER_RNG);var l=t.get_Item(s);e.Append(" "+r.XMLConstants.MG_TAG_FLD+'="'+l.veeIdx+'"');var u=this.DataView.getField(l.veeIdx-1).getType();if(l.nullMin&&e.Append(" "+E.NULL_MIN_RNG+'="1"'),!l.discardMin&&null!=l.min){var c=n.RecordUtils.itemValToXML(l.min,u,i,o);e.Append(" "+E.MIN_RNG+'="'+c+'"')}if(l.nullMax&&e.Append(" "+E.NULL_MAX_RNG+'="1"'),!l.discardMax&&null!=l.max){c=n.RecordUtils.itemValToXML(l.max,u,i,o);e.Append(" "+E.MAX_RNG+'="'+c+'"')}e.Append(r.XMLConstants.TAG_TERM)}a?e.Append(r.XMLConstants.END_TAG+E.USER_LOCATES+r.XMLConstants.TAG_CLOSE):e.Append(r.XMLConstants.END_TAG+E.USER_RANGES+r.XMLConstants.TAG_CLOSE)},i.prototype.buildXMLForSorts=function(e){if(null!=this.UserSorts&&this.UserSorts.length>0){var t=void 0;for(t=0;t<this.UserSorts.length;t++){e.Append(r.XMLConstants.TAG_CLOSE);var n=this.UserSorts.get_Item(t);e.Append(r.XMLConstants.START_TAG+E.SORT),e.Append(" "+r.XMLConstants.MG_TAG_FLD+'="'+n.fldIdx+'"'),n.dir&&e.Append(" "+E.MG_ATTR_DIR+'="1"'),e.Append(r.XMLConstants.TAG_TERM)}this.UserSorts.Clear(),this.UserSorts=null,e.Append(r.XMLConstants.END_TAG+E.MG_TAG_SORTS+r.XMLConstants.TAG_CLOSE)}},i.prototype.getUserEvent=function(e){t.Debug.Assert(null!==this.UserEvtTab);var r=null;return null!==this.UserEvtTab&&(r=this.UserEvtTab.getEvent(e)),r},i.prototype.SetMoveToFirstControl=function(e){!e&&this.IsSubForm||null!==this.Form&&(this.Form.alreadyMovedToFirstControl()||(this.Form.MovedToFirstControl=!0))},i.prototype.Start=function(t,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return n=null,this._isStarted?[3,5]:(this._isStarted=!0,this.InitializeExecution(),this.InStartProcess=!0,[4,this.Setup()]);case 1:return(a=l.sent()).Success?(this._inProcessingTopMostEndTaskSaved=o.eventsManager.getProcessingTopMostEndTask(),o.eventsManager.setProcessingTopMostEndTask(!1),[4,this.EnableActions()]):[2,null];case 2:return l.sent(),[4,this.InitializeForm(t)];case 3:return(a=l.sent()).Success?(this.IsInteractive||this._isMainPrg||(n=this),this.DataViewWasRetrieved=!0,s=this.SubTasks,this.isMainProg()&&(this.SubTasks=null),this.isMainProg()&&(this.SubTasks=s),a.Success?this._aborting?[2,null]:(i=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.FirstChunk),[4,this.DataviewManager.Execute(i)]):[2,null]):[2,null];case 4:if(!(a=l.sent()).Success)return[2,null];l.label=5;case 5:return[4,this.StartSubTasks(t,n,r)];case 6:return n=l.sent(),this.InStartProcess=!1,[2,n]}}))}))},i.prototype.InitializeExecution=function(){s.prototype.setBrkLevel.call(this,E.BRK_LEVEL_REC_MAIN,-1),this._firstRecordCycle=!0,this._currStartProgLevel=this.IsSubForm&&this.getParent().getForm().alreadyMovedToFirstControl()?this.getParent()._currStartProgLevel:i.StartProgLevel},i.prototype.InitializeForm=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return null===this.Form?[3,2]:(this.SetMoveToFirstControl(e),o.eventsManager.pushNewExecStacks(),this.routeParams=this.DataView.GetRouteParams(),[4,this.InitForm()]);case 1:t.sent(),o.eventsManager.popNewExecStacks(),this.getMGData().StartTimers(),n.Commands.beginInvoke(),t.label=2;case 2:return[2,new Pt]}}))}))},i.prototype.StartSubTasks=function(e,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:if(!this.hasSubTasks())return[3,4];a=0,i.label=1;case 1:return a<this.SubTasks.getSize()?[4,this.SubTasks.getTask(a).Start(e,n)]:[3,4];case 2:s=i.sent(),null===r?r=s:null!==s&&t.Debug.Assert(!1,"more than 1 non interactive in task.start"),i.label=3;case 3:return a+=1,[3,1];case 4:return[2,r]}}))}))},i.prototype.EnableActions=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(a){switch(a.label){case 0:return e=Rr.actEnabled,this.ActionManager.enableList(e,!0,!1),this.IsSubForm&&this.ActionManager.enable(r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT,!0),[4,this.enableModes()];case 1:return a.sent(),[4,this.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)];case 2:return a.sent()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_SELECT,!0),[4,this.checkProp(n.PropInterface.PROP_TYPE_PRINT_DATA,!1)];case 3:return t=a.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_PRINT_DATA,t),this.getEnableZoomHandler()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),[2]}}))}))},i.prototype.ShowError=function(e){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(a){switch(a.label){case 0:return t=pe.Instance.translate(e),r=pe.Instance.translate(E.ERROR_STRING),[4,ge.Instance.MessageBox(r,t,n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)];case 1:return a.sent(),[2]}}))}))},i.prototype.EndTaskOnError=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return e.Success||this.isAborting()?[3,8]:this.InStartProcess?[4,this.endTask(!1,!1,!1)]:[3,4];case 1:return n.sent(),t?[4,this.ShowError(e.ErrorDescription)]:[3,3];case 2:n.sent(),n.label=3;case 3:return this.InStartProcess=!1,[2,!0];case 4:return t?[4,this.ShowError(e.ErrorDescription)]:[3,6];case 5:n.sent(),n.label=6;case 6:return[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_EXIT)];case 7:n.sent(),n.label=8;case 8:return[2,!1]}}))}))},i.prototype.Setup=function(){return T(this,void 0,void 0,(function(){var t,r,n,a,s;return h(this,(function(i){switch(i.label){case 0:return this.TaskService.InitTaskPrefixExecutedFlag(this),this.TaskSuffixExecuted=!1,Dt.CreateFirstRecord(this),r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Init),[4,this.DataviewManager.Execute(r)];case 1:if(!(t=i.sent()).Success)return[2,t];if(!t.Success)return[3,7];n=Lr.Instance.getCommandsExecutedAfterTaskStarted(),a=0,i.label=2;case 2:return a<n.length?(s=n.get_Item(a)).TaskTag!==this.getTaskTag()?[3,4]:[4,s.Execute(null)]:[3,5];case 3:i.sent(),Lr.Instance.removeCommandsExecutedAfterTaskStarted(s),i.label=4;case 4:return a++,[3,2];case 5:return r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Prepare),[4,this.DataviewManager.Execute(r)];case 6:t=i.sent(),i.label=7;case 7:return t.Success?(t=this.TaskService.PrepareTask(this)).Success?[3,9]:[4,this.EndTaskOnError(t,!0)]:[3,9];case 8:i.sent(),i.label=9;case 9:return t.Success?(r=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.InitDataControlViews),[4,this.DataviewManager.Execute(r)]):[3,11];case 10:t=i.sent(),i.label=11;case 11:return[2,t]}}))}))},i.prototype.doFirstRecordCycle=function(){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:return this._isMainPrg?[3,8]:(o.eventsManager.pushNewExecStacks(),this.SubformExecMode=e.Task_SubformExecModeEnum.FIRST_TIME,[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(this,r.InternalInterface.MG_ACT_REC_PREFIX,this.IsSubForm)]);case 1:if(a.sent(),o.eventsManager.GetStopExecutionFlag())return[3,7];if(!this.IsSubForm)return[3,7];if(!this.hasSubTasks())return[3,5];t=0,a.label=2;case 2:return t<this.SubTasks.getSize()?(n=this.SubTasks.getTask(t)).IsSubForm?(n.getForm().IgnoreFirstRecordCycle=!0,[4,n.doFirstRecordCycle()]):[3,4]:[3,5];case 3:a.sent(),a.label=4;case 4:return t++,[3,2];case 5:return[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 6:a.sent(),a.label=7;case 7:this.SubformExecMode=e.Task_SubformExecModeEnum.SET_FOCUS,o.eventsManager.popNewExecStacks(),a.label=8;case 8:return[2]}}))}))},i.prototype.CheckAndSetSubForm=function(){this.IsSubForm=!s.prototype.isMainProg.call(this)&&this!==this._mgData.getFirstTask()},i.prototype.IsRoute=function(){return null!=this.RouterPath},i.prototype.stop=function(){return T(this,void 0,void 0,(function(){var r,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(this.getForm(),this._aborting)return[2];if(!this.hasSubTasks())return[3,3];u.label=1;case 1:return null==(r=this.SubTasks.getTask(0))?[3,3]:(r.setDestinationSubform(this._destinationSubform),[4,r.stop()]);case 2:return u.sent(),[3,1];case 3:return this._isMainPrg||(this._aborting=!0),null!=this._parentTask&&(this._parentTask.removeSubTask(this),this.IsSubForm&&(a=new t.List,s=new t.List,null!=(i=this.getMGData()).getTimerHandlers()&&(a=i.getTimerHandlers().getTimersVector()),i.removeTimerHandler(this),i.removeExpressionHandler(this),null!=i.getTimerHandlers()&&(s=i.getTimerHandlers().getTimersVector()),i.changeTimers(a,s),i.removeTask(this),ge.Instance.abort(this.getForm()))),this.AbortTransaction(),null!=this.getClickedControl()&&(n.RuntimeContextBase.Instance.CurrentClickedCtrl=null),null!=this.Form&&this.Form.removeRefsToCtrls(),this.IsSubForm?((o=this.Form.getSubFormCtrl()).setSubformTaskId(null),o.initSubformTask(),G.Instance.getLastFocusedTask()===this&&G.Instance.setLastFocusedTask(this._parentTask),o.SubformLoaded?[4,o.getProp(n.PropInterface.PROP_TYPE_VISIBLE).RefreshDisplay(!0)]:[3,5]):[3,5];case 4:u.sent(),u.label=5;case 5:return l=Qe.CreateDataViewCommand(this.getTaskTag(),e.DataViewCommandType.Clear),[4,this.DataviewManager.Execute(l)];case 6:return u.sent(),[2]}}))}))},i.prototype.abort=function(){this.getMGData().abort()},i.prototype.hasSubTasks=function(){return null!==this.SubTasks&&this.SubTasks.getSize()>0},i.prototype.getTaskDepth=function(e){if(e)return this.getTaskDepth_(e);var t=this.GetContextTask().getTaskDepth_(e);return this.isMainProg()&&this.getCtlIdx()!==E.TOP_LEVEL_CONTAINER&&(t+=1),t},i.prototype.getTaskDepth_=function(e){var t=this.getTriggeringTask();return null==t||e?null==this._parentTask?1:e&&this.getCtlIdx()!==this._parentTask.getCtlIdx()?2+this._parentTask.getTaskDepth_(e):1+this._parentTask.getTaskDepth_(e):1+t.getTaskDepth_(e)},i.prototype.GetTaskAncestor=function(e){return this.getTaskAncestor_(e)},i.prototype.getTaskAncestor_=function(e){var t=null;if(0===e)t=this;else{var r=this.getTriggeringTask();null===r&&(r=this._parentTask),null!==r&&(t=r.getTaskAncestor_(--e))}return t},i.prototype.GetTaskDepth=function(){return this.getTaskDepth(!1)},i.prototype.pathContains=function(e){return this._taskPath.Contains(e)},i.prototype.SetContextTask=function(e){this.ContextTask=e},i.prototype.GetContextTask=function(){var e=this.DataView.getCurrRec();return this.InStartProcess||null!==e&&(e.InCompute||e.InRecompute)||null!==this.Form&&this.Form.inRefreshDisplay()?this:this.ContextTask},i.prototype.getTriggeringTask=function(){return null!==this._triggeringTask&&this._triggeringTask.getMGData().IsAborting&&(this._triggeringTask=this._parentTask),this._triggeringTask},i.prototype.setLastParkedCtrl=function(e){s.prototype.setLastParkedCtrl.call(this,e),G.setLastFocusedControl(this,e)},i.prototype.queryTaskPath=function(){var e=0,r=new t.StringBuilder(7936),a=new Array(this.getTaskDepth(!1));this.pathToRoot(a,!1);for(var s=a.length-1;s>=0;s--){var i=a[s];if(!i.isMainProg()){var o=i.getProp(n.PropInterface.PROP_TYPE_NAME);if(null!=o){var l=o.GetComputedValue();t.NString.IsNullOrEmpty(l)||(0!=e++&&r.Append(";"),r.Append(l))}}}return r},i.prototype.ctl_itm_2_parent_vee=function(e){var t,r=0,n=0,a=new Array(this.getTaskDepth(!0));this.pathToRoot(a,!0);for(var s=a.length-1;s>=0;s--){if(e<(r+=(t=a[s]).DataView.GetFieldsTab().getSize()))return e-=n,t.DataView.getField(e);n=r}return null},i.prototype.GetControlIDFromVarItem=function(e){var t,r=0,n=0,a=0,s=new Array(this.getTaskDepth(!0));this.pathToRoot(s,!0);for(var i=s.length-1;i>=0;i--){if(e<(r+=(t=s[i]).DataView.GetFieldsTab().getSize())){e-=n;var o=t.DataView.getField(e);return null!=o.getCtrl()?a+t.Form.getControlIdx(o.getCtrl())+1:0}null!=t.Form&&(a+=t.Form.getCtrlCount()),n=r}return 0},i.prototype.GetControlFromControlID=function(e,t){var r=null;if(t.value=-1,e>=0){var n=null,a=null,s=0,i=0,o=0,l=new Array(this.getTaskDepth(!0));this.pathToRoot(l,!0);for(var u=l.length-1;u>=0;u--)if(null!=(n=l[u]).Form){if(e<i+(s=n.Form.getCtrlCount())){o=e-i,r=n.Form.CtrlTab.getCtrl(o),a=n;break}i+=s}if(null!=r){t.value=0;var c=l[0].TaskDefinitionId.CtlIndex;for(u=0;u<l.length-1&&(c!==(n=l[u]).TaskDefinitionId.CtlIndex&&t.value++,a.TaskDefinitionId.CtlIndex!==n.TaskDefinitionId.CtlIndex);u++)c=n.TaskDefinitionId.CtlIndex}}return r},i.prototype.ctl_itm_4_parent_vee=function(e,t){var r=this.getTaskDepth(!0);if(e!==b.MAIN_PRG_PARENT_ID&&r<=e)return t;var n=new Array(r);if(0!==t){this.pathToRoot(n,!0);var a=this.getIndOfParentInTaskTree(e,n),s=void 0;for(s=n.length-1;s>a;s--)t+=n[s].DataView.GetFieldsTab().getSize()}return t},i.prototype.getIndOfParentInTaskTree=function(e,t){var r=0;if(e===b.MAIN_PRG_PARENT_ID){for(var n=1;n<t.length;n+=1)if(t[n].isMainProg()&&this._ctlIdx===t[n].getCtlIdx()){r=n;break}}else r=e;return r},i.prototype.getFieldByName=function(e){return this.GetContextTask().getFieldByName_(e)},i.prototype.getFieldByName_=function(e){var t;if(null==e)return null;var r=this.getField(e);if(null==r&&null!=(t=null!=this.getTriggeringTask()?this.getTriggeringTask():this._parentTask)){if(!this.isMainProg()&&this.getCtlIdx()!==t.getCtlIdx())r=o.mgDataTable.GetMainProgByCtlIdx(-1,this.getCtlIdx()).getFieldByName_(e);null==r&&(r=t.getFieldByName_(e))}return r},i.prototype.getIndexOfFieldByName=function(e){var t=this.getTaskDepth(!0),r=0,n=this.getFieldByName(e);if(null==n)return 0;var a=new Array(t);this.pathToRoot(a,!0);for(var s=t-1;s>=0;s--){var i=a[s];if(i===n.getTask()){s=n.getId(),r+=++s;break}r+=i.DataView.GetFieldsTab().getSize()}return r},i.prototype.pathToRoot=function(e,t){for(var r=t?this:this.GetContextTask(),n=0;n<e.length;n++){e[n]=r;var a=r.getCtlIdx(),s=t?null:r.getTriggeringTask();if(null!=s)r=s;else{if(null==(r=r.getParent())){!t&&this.isMainProg()&&this.getCtlIdx()!==E.TOP_LEVEL_CONTAINER&&(e[n+1]=this);break}t&&a!==r.getCtlIdx()&&(e[++n]=o.mgDataTable.GetMainProgByCtlIdx(-1,a))}}},i.prototype.shouldBeRefreshed=function(){var e=this._parentTask.DataView,t=!1;return(null===this._parentTask||e.isPrevCurrRecNull()||null!==this.RefreshOnVars&&!e.currEqualsPrev(this.RefreshOnVars))&&(t=!0),t},i.prototype.CheckRefreshSubTasks=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return e=!1,this._enteredRecLevel?[4,this.GetSubformsToRefresh()]:[3,2];case 1:t.sent().length>0&&(e=!0),t.label=2;case 2:return[2,e]}}))}))},i.prototype.GetSubTasks=function(){var e=new t.List;if(this.hasSubTasks())for(var r=0;r<this.SubTasks.getSize();r+=1)e.push(this.SubTasks.getTask(r));return e},i.prototype.GetSubformsToRefresh=function(){return T(this,void 0,void 0,(function(){var e,r,n,a;return h(this,(function(s){switch(s.label){case 0:e=this.GetSubTasks(),r=new t.List,n=0,s.label=1;case 1:return n<e.length?(a=e.get_Item(n),[4,this.ShouldRefreshSubformTask(a)]):[3,4];case 2:s.sent()&&r.push(a),s.label=3;case 3:return n++,[3,1];case 4:return[2,r]}}))}))},i.prototype.ShouldRefreshSubformTask=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:return t=!1,a=e.getForm().getSubFormCtrl(),e.DoSubformPrefixSuffix=!1,null==a||e.InSelect||!e.AfterFirstRecordPrefix?[3,13]:(s=this.getMode(),i=s===r.Constants.TASK_MODE_QUERY?n.PropInterface.PROP_TYPE_ALLOW_QUERY:s===r.Constants.TASK_MODE_MODIFY?n.PropInterface.PROP_TYPE_ALLOW_MODIFY:n.PropInterface.PROP_TYPE_ALLOW_CREATE,(l=e.ModeAsParent&&s!==e.getMode()&&this.getLevel()===r.Constants.TASK_LEVEL_RECORD)?[4,e.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,2]);case 1:l=_.sent(),_.label=2;case 2:return(o=l)?[4,e.checkProp(i,!0)]:[3,4];case 3:o=_.sent(),_.label=4;case 4:return o?(u=!a.isVisible())?[4,a.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,6]:[3,8];case 5:u=!_.sent(),_.label=6;case 6:return u?(a.RefreshOnVisible=!0,t=!1):t=!0,[4,e.SetModeAsParent(s)];case 7:return _.sent(),[3,12];case 8:return[4,a.checkProp(n.PropInterface.PROP_TYPE_AUTO_REFRESH,!0)];case 9:return(t=_.sent()&&e.shouldBeRefreshed())?(c=!a.isVisible())?[4,a.checkProp(n.PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN,!1)]:[3,11]:[3,12];case 10:c=!_.sent(),_.label=11;case 11:c&&(a.RefreshOnVisible=!0,t=!1),_.label=12;case 12:t&&(e.DoSubformPrefixSuffix=!0),_.label=13;case 13:return[2,t]}}))}))},i.prototype.SetModeAsParent=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.enableModes()];case 1:return s.sent(),e!==r.Constants.TASK_MODE_CREATE?[3,3]:(t=Qe.CreateEventCommand(this.getTaskTag(),r.InternalInterface.MG_ACT_RTO_CREATE),[4,this.DataviewManager.Execute(t)]);case 2:return s.sent(),[3,7];case 3:return this.getMode()!==r.Constants.TASK_MODE_CREATE?[3,6]:(this.setPreventRecordSuffix(!0),this.setPreventControlChange(!0),[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)]);case 4:return s.sent(),this.setPreventRecordSuffix(!1),this.setPreventControlChange(!1),(a=this.DataView).isEmpty()||a.getCurrRec().getMode()===n.DataModificationTypes.Insert?this.setMode(r.Constants.TASK_MODE_CREATE):this.setMode(e),[4,this.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 5:return s.sent(),[3,7];case 6:this.setMode(e),s.label=7;case 7:return this.setOriginalTaskMode(e),[4,this.setCreateDeleteActsEnableState()];case 8:return s.sent(),[2]}}))}))},i.prototype.doSubformRecPrefixSuffix=function(){return T(this,void 0,void 0,(function(){var e,t,n;return h(this,(function(a){switch(a.label){case 0:e=this.GetSubTasks(),t=0,a.label=1;case 1:return t<e.length?(n=e.get_Item(t)).DoSubformPrefixSuffix?[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(n,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]:[3,4]:[3,5];case 2:return a.sent(),o.eventsManager.GetStopExecutionFlag()?[3,4]:[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:a.sent(),a.label=4;case 4:return t++,[3,1];case 5:return[2]}}))}))},i.prototype.CleanDoSubformPrefixSuffix=function(){for(var e=this.GetSubTasks(),t=0;t<e.length;t++){e.get_Item(t).DoSubformPrefixSuffix=!1}},i.prototype.mustConfirmInDeleteMode=function(){return!this.getProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE).isExpression()},i.prototype.addSubTask=function(e){null===this.SubTasks&&(this.SubTasks=new O),this.SubTasks.addTask(e)},i.prototype.removeSubTask=function(e){null!==this.SubTasks&&this.SubTasks.removeTask(e)},i.prototype.setTransactionFailed=function(e){this._transactionFailed=e,e||(this.TransactionErrorHandlingsRetry=null)},i.prototype.transactionFailed=function(e){return(e===E.TRANS_NONE||null!=this.Transaction&&this.Transaction.getLevel()===e||e===E.TRANS_NONE||null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getLevel()===e)&&this._transactionFailed},i.prototype.setAfterRetry=function(e){null!=this.Transaction?this.Transaction.setAfterRetry(e):null!=this.TransactionErrorHandlingsRetry&&(e===E.RECOVERY_NONE?this.TransactionErrorHandlingsRetry=null:this.TransactionErrorHandlingsRetry.setAfterRetry(e))},i.prototype.getAfterRetry=function(e){return 0===arguments.length?this.getAfterRetry_0():this.getAfterRetry_1(e)},i.prototype.getAfterRetry_0=function(){return null!=this.Transaction?this.Transaction.getAfterRetry():null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getAfterRetry()},i.prototype.getAfterRetry_1=function(e){return null!=this.Transaction?this.Transaction.getAfterRetry(e):null!=this.TransactionErrorHandlingsRetry&&this.TransactionErrorHandlingsRetry.getAfterRetry(e)},i.prototype.getExecEndTask=function(){return this._bExecEndTask},i.prototype.resetExecEndTask=function(){this._bExecEndTask=!1},i.prototype.setExecEndTask=function(){this._bExecEndTask=!0},i.prototype.evalEndCond=function(e){return T(this,void 0,void 0,(function(){var r,a,s,i,o,l,u;return h(this,(function(c){switch(c.label){case 0:return a=this.getProp(n.PropInterface.PROP_TYPE_EVAL_END_CONDITION),this.InEndTask?[2,!1]:this._bExecEndTask?[2,!0]:(s=null!=a)?(l=(o=t.NString).Compare,[4,a.getValue()]):[3,4];case 1:return(i=0===l.apply(o,[c.sent(),E.END_COND_EVAL_IMMIDIATE,!0]))?[3,3]:[4,a.getValue()];case 2:i=c.sent().toLowerCase()===e.toLowerCase(),c.label=3;case 3:s=i,c.label=4;case 4:return s?null==(r=this.getProp(n.PropInterface.PROP_TYPE_END_CONDITION))?[2,!1]:[4,r.getValue()]:[3,6];case 5:return u=c.sent(),n.DisplayConvertor.toBoolean(u)?(this._bExecEndTask=!0,[2,!0]):[2,!1];case 6:return[2,!1]}}))}))},i.prototype.setTryingToStop=function(e){if(this.hasSubTasks())for(var t=0;t<this.SubTasks.getSize();t+=1){this.SubTasks.getTask(t).setTryingToStop(e)}this.IsTryingToStop=e},i.prototype.getInRecordSuffix=function(){return this._inRecordSuffix},i.prototype.setInRecordSuffix=function(e){return e!==this._inRecordSuffix&&(this._inRecordSuffix=e,!0)},i.prototype.setEvalOldValues=function(e){return e!==this._evalOldValues&&(this._evalOldValues=e,!0)},i.prototype.getEvalOldValues=function(){return this._evalOldValues},i.prototype.endTask=function(e,t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(s){switch(s.label){case 0:return a.isNullOrUndefined(n)?[4,this.endTask_1(e,t,!1,r)]:[3,2];case 1:case 3:return[2,s.sent()];case 2:return[4,this.endTask_1(e,t,n,r)]}}))}))},i.prototype.endTask_1=function(t,a,s,i){return T(this,void 0,void 0,(function(){var l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m;return h(this,(function(h){switch(h.label){case 0:return l=!0,u=!1,_=o.mgDataTable,!this.IsSubForm||s||this._parentTask.InEndTask?[3,2]:[4,this._parentTask.endTask(t,a,i)];case 1:return l=h.sent(),[3,41];case 2:if(this.isAborting()||this.InEndTask)return[3,40];h.label=3;case 3:return h.trys.push([3,,38,39]),this.InEndTask=!0,oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI&&o.eventsManager.GetStopExecutionFlag()?(T=Qe.CreateUnloadCommand(),oe.Instance.getMGData(0).CmdsToServer.Add(T),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)]):[3,5];case 4:return h.sent(),[2];case 5:return this.IsTryingToStop||this.setTryingToStop(!0),p=void 0,t?this.hasSubTasks()?le.GetInstance().DelayCommandExecution?[3,9]:(g=!0,[4,this.CheckIfClientOperationExistsInSubformTasks(this,r.InternalInterface.MG_ACT_TASK_SUFFIX)]):[3,15]:[3,20];case 6:return(d=h.sent())?[3,8]:[4,this.CheckIfClientOperationExistsInSubformTasks(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 7:(d=h.sent())||(g=this.CheckIfPendingTransactions(this)),h.label=8;case 8:return d||g||(this.allowRemoteCmdExecution=!1,this.SetServerSideTaskSuffix(this),le.GetInstance().DelayCommandExecution=!0),[3,10];case 9:this.SetServerSideTaskSuffix(this),h.label=10;case 10:p=0,h.label=11;case 11:return p<this.SubTasks.getSize()&&l?(c=this.SubTasks.getTask(p),u=u||c.IsSubForm,[4,o.eventsManager.handleInternalEventWithTask(c,r.InternalInterface.MG_ACT_EXIT)]):[3,14];case 12:h.sent(),l=!o.eventsManager.GetStopExecutionFlag()||i,h.label=13;case 13:return p++,[3,11];case 14:return[3,16];case 15:le.GetInstance().DelayCommandExecution&&this.SetServerSideTaskSuffix(this),h.label=16;case 16:if(this!==_.StartupMgData.getFirstTask())return[3,20];p=_.getSize()-1,h.label=17;case 17:return p>0&&l?null==_.getMGData(p)?[3,19]:[4,o.eventsManager.handleInternalEventWithTask(_.getMGData(p).getFirstTask(),r.InternalInterface.MG_ACT_EXIT)]:[3,20];case 18:h.sent(),l=!o.eventsManager.GetStopExecutionFlag()||i,h.label=19;case 19:return p--,[3,17];case 20:return l?!t||i?[3,23]:[4,this.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]:[3,37];case 21:return I=h.sent(),this.IsInteractive||!0!==I||this.getMode()!==r.Constants.TASK_MODE_CREATE||this.setProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,"0"),[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 22:h.sent(),this.IsInteractive||!0!==I||this.getMode()!==r.Constants.TASK_MODE_CREATE||this.setProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,"1"),h.label=23;case 23:return(l=!o.eventsManager.GetStopExecutionFlag()||i)&&!a&&this.HandleTransactionInfo(),f=l,!l||a||!t||i||this.IsSubForm&&!s||!this.TaskPrefixExecuted||this.TaskSuffixExecuted?[3,25]:[4,this.handleTaskSuffix(!0)];case 24:l=h.sent(),h.label=25;case 25:if(!t||!this.hasSubTasks())return[3,29];p=0,h.label=26;case 26:return p<this.SubTasks.getSize()?(c=this.SubTasks.getTask(p)).IsSubForm?[3,28]:[4,o.eventsManager.handleNonReversibleEvent(c,r.InternalInterface.MG_ACT_EXIT)]:[3,29];case 27:h.sent(),h.label=28;case 28:return p++,[3,26];case 29:return t&&(l=!o.eventsManager.GetStopExecutionFlag()||i),f&&o.eventsManager.setStopExecution(!1),this.setAfterRetry(E.RECOVERY_NONE),this.isAborting()||!l||a?[3,37]:t?(this.setTransactionFailed(!1),[4,this.TaskTransactionManager.checkAndCommit(!1,E.TRANS_TASK_PREFIX,!1)]):[3,31];case 30:h.sent(),l=(!o.eventsManager.GetStopExecutionFlag()||i)&&!this.isAborting()&&!this.transactionFailed(E.TRANS_TASK_PREFIX),h.label=31;case 31:return this.setAfterRetry(E.RECOVERY_NONE),l?(this.allowRemoteCmdExecution?this.DelayCommandExecution&&(this.DelayCommandExecution=!1,le.GetInstance().DelayCommandExecution=!0):(this.allowRemoteCmdExecution=!0,le.GetInstance().DelayCommandExecution=!1),C=o.mgDataTable.StartupMgData,t&&C.getFirstTask().getTaskTag()===this.getTaskTag()?(o.eventsManager.setProcessingTopMostEndTask(!0),[4,o.eventsManager.handleEvents(C,0)]):[3,33]):[3,37];case 32:if(h.sent(),o.eventsManager.setProcessingTopMostEndTask(!1),this.isAborting())return le.GetInstance().DelayCommandExecution=!1,this.DelayCommandExecution=!1,this.allowRemoteCmdExecution=!0,[2,!0];h.label=33;case 33:return[4,Dt.Exit(this,t,s)];case 34:return h.sent(),null!=this._parentTask&&this._parentTask.isMainProg()?(A=o.mgDataTable.getMGData(0),R=A.getMainProg(0),S=o.mgDataTable.StartupMgData.getFirstTask(),[4,R.checkProp(n.PropInterface.PROP_TYPE_END_CONDITION,!1)]):[3,36];case 35:M=h.sent(),this!==S&&M&&((m=new w(S)).setInternal(r.InternalInterface.MG_ACT_CLOSE),m.setCtrl(null),m.setArgList(null),o.eventsManager.addToTail(m)),h.label=36;case 36:rr.CreatedForms.remove(this.Form),h.label=37;case 37:return[3,39];case 38:return this.IsSubForm&&!s||this.handleFinallyEndTask(l,t),[7];case 39:return[3,41];case 40:this.InEndTask&&(l=!1),h.label=41;case 41:return o.eventsManager.setProcessingTopMostEndTask(this._inProcessingTopMostEndTaskSaved),[2,l]}}))}))},i.prototype.SetServerSideTaskSuffix=function(e){var t=new w(e);t.setInternal(r.InternalInterface.MG_ACT_TASK_SUFFIX);var n=null,a=new Ae;if(a.init(t),null!=(n=a.getNext()))for(var s=0;s<n.getOperationTab().getSize();s++){n.getOperationTab().getOperation(s).setExecOnServer(!0)}if(e.hasSubTasks())for(s=0;s<e.GetSubTasks().length;s++){var i=e.SubTasks.getTask(s);this.SetServerSideTaskSuffix(i)}},i.prototype.CheckIfClientOperationExistsInSubformTasks=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=!1,(s=new w(e)).setInternal(t),i=null,(o=new Ae).init(s),i=o.getNext(),t!=r.InternalInterface.MG_ACT_REC_SUFFIX?[3,2]:(l=e.DataView.getCurrRec(),(e.DataView.modifiedRecordsNumber()>0||null!=l&&l.Modified)&&(a=!0),a?[3,2]:[4,e.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 1:!0===T.sent()&&(e.IsInteractive||e.getMode()!==r.Constants.TASK_MODE_CREATE)&&(a=!0),T.label=2;case 2:if(null!=i&&!a)for(u=i.getOperationTab().getSize(),c=0;c<u;c++)if(i.getOperationTab().getOperation(c).getExecOnClient()){a=!0;break}if(a||!e.hasSubTasks())return[3,6];c=0,T.label=3;case 3:return!a&&c<e.getSubTasks().getSize()?(_=e.SubTasks.getTask(c),[4,this.CheckIfClientOperationExistsInSubformTasks(_,t)]):[3,6];case 4:a=T.sent(),T.label=5;case 5:return c++,[3,3];case 6:return[2,a]}}))}))},i.prototype.CheckIfPendingTransactions=function(e){var t=!1,r=e.DataView.getCurrRec();if((e.DataView.modifiedRecordsNumber()>0||null!=r&&r.Modified)&&(t=!0),!t&&e.hasSubTasks())for(var n=0;!t&&n<e.getSubTasks().getSize();n++){var a=e.SubTasks.getTask(n);t=this.CheckIfPendingTransactions(a)}return t},i.prototype.HandleTransactionInfo=function(){var e=this.DataviewManager.RemoteDataviewManager.Transaction;null!==e&&e.isOwner(this)&&"P"===e.getLevel()&&(this.DataviewManager.RemoteDataviewManager.Transaction=null,this.DataView.setTransCleared())},i.prototype.Exit=function(t,r){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:if(n=t?Qe.CreateBrowserEscEventCommand(this.getTaskTag(),r):Qe.CreateNonReversibleExitCommand(this.getTaskTag(),r),this._mgData.CmdsToServer.Add(n),r)return[3,5];s.label=1;case 1:return s.trys.push([1,4,,5]),this.getTaskTag()!=oe.Instance.StartupMgData.getFirstTask().getTaskTag()&&oe.Instance.StartupMgData.getFirstTask().InEndTask&&oe.Instance.StartupMgData.getFirstTask().ClosingFormUI?[3,3]:[4,i.CommandsProcessor.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 2:s.sent(),s.label=3;case 3:return[3,5];case 4:if(a=s.sent(),!this.isMainProg())throw a;return this._mgData.CmdsToServer.Add(n),[3,5];case 5:return[2]}}))}))},i.prototype.handleFinallyEndTask=function(e,t){if(this.hasSubTasks())for(var r=0;r<this.SubTasks.getSize();r++)this.SubTasks.getTask(r).handleFinallyEndTask(e,t);this.InEndTask=!1,e&&(this._isStarted=!1),!e&&t&&this.IsTryingToStop&&this.setTryingToStop(!1)},i.prototype.handleTaskSuffix=function(e){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:if(t=!0,!e)return[3,4];if(!this.hasSubTasks())return[3,4];n=0,a.label=1;case 1:return n<this.SubTasks.getSize()&&t?[4,this.SubTasks.getTask(n).handleTaskSuffix(e)]:[3,4];case 2:t=a.sent(),a.label=3;case 3:return n++,[3,1];case 4:return t?[4,o.eventsManager.handleInternalEventWithTask(this,r.InternalInterface.MG_ACT_TASK_SUFFIX)]:[3,6];case 5:a.sent(),a.label=6;case 6:return t=!o.eventsManager.GetStopExecutionFlag(),this.TaskSuffixExecuted=!0,[2,t]}}))}))},i.prototype.setInCreateLine=function(e){this._inCreateLine=e},i.prototype.getInCreateLine=function(){return this._inCreateLine},i.prototype.handleEventOnSlaveTasks=function(e){return T(this,void 0,void 0,(function(){var n,a,s,i,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:if(a=null,s=null,i=o.mgDataTable,l=i.getTriggeredTasks(this),u=null,_=!1,T=null!=this.Transaction&&this.Transaction.isOwner(this))for(o.eventsManager.setEventScopeTrans(),u=new t.List,i.startTasksIteration();null!=(a=i.getNextTask());)c=null!=a.Transaction&&this.Transaction.getTransId()===a.Transaction.getTransId(),a!==this&&c&&null!=a.PreviouslyActiveTaskId&&null==i.GetTaskByID(a.PreviouslyActiveTaskId)&&u.push(a);p=o.eventsManager.isEventScopeTrans(),n=0,h.label=1;case 1:return n<l.length&&!o.eventsManager.GetStopExecutionFlag()?(a=l.get_Item(n),c=null!=this.Transaction&&null!=a.Transaction&&this.Transaction.getTransId()===a.Transaction.getTransId(),!a.IsSubForm&&p&&c&&a.isStarted()?a.getForm().FormRefreshed&&e===r.InternalInterface.MG_ACT_REC_PREFIX&&a.getLevel()===r.Constants.TASK_LEVEL_TASK?[4,a.DataView.currRecCompute(!1)]:[3,3]:[3,5]):[3,6];case 2:h.sent(),h.label=3;case 3:return[4,o.eventsManager.handleInternalEventWithTask(a,e)];case 4:h.sent(),_=!0,h.label=5;case 5:return n++,[3,1];case 6:return T&&n<u.length&&!o.eventsManager.GetStopExecutionFlag()?(a=u.get_Item(n)).getForm().FormRefreshed&&e===r.InternalInterface.MG_ACT_REC_PREFIX&&a.getLevel()===r.Constants.TASK_LEVEL_TASK?[4,a.DataView.currRecCompute(!1)]:[3,8]:[3,11];case 7:h.sent(),h.label=8;case 8:return[4,o.eventsManager.handleInternalEventWithTask(a,e)];case 9:h.sent(),_=!0,h.label=10;case 10:return n++,[3,6];case 11:return _&&o.eventsManager.GetStopExecutionFlag()&&(s=a),T&&o.eventsManager.clearEventScope(),[2,s]}}))}))},i.prototype.enableRecordActions=function(){return T(this,void 0,void 0,(function(){var e,t,a,s;return h(this,(function(i){switch(i.label){case 0:return e=this.DataView,[4,this.setCreateDeleteActsEnableState()];case 1:return i.sent(),e.IncludesFirst()||e.IsOneWayKey?(e.isEmptyDataview()||0===e.getCurrRecIdx()?(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!1),e.IsOneWayKey?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!1),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!1)):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0)),this.Form.isScreenMode()||(e.isEmptyDataview()||0===e.getCurrRecIdx()||0===e.getTopRecIdx()?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0))):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_BEGTBL,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVPAGE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_PRVLINE,!0)),e.IncludesLast()?(t=this.getMode()===r.Constants.TASK_MODE_QUERY||e.isEmptyDataview())?[3,5]:(a=this.getMode()===r.Constants.TASK_MODE_MODIFY)?(s=!et.Instance.allowCreateInModifyMode(this.getCompIdx()))?[3,3]:[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)]:[3,4]:[3,6];case 2:s=!i.sent(),i.label=3;case 3:a=s,i.label=4;case 4:t=a,i.label=5;case 5:return t&&e.getCurrRecIdx()+1===e.getSize()?(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!1),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!1),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!1)):(this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!0),this.Form.isScreenMode()&&this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0)),this.Form.isScreenMode()||(e.isEmptyDataview()||e.getSize()-e.getTopRecIdx()<=this.Form.getRowsInPage()?this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0)),[3,7];case 6:this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTLINE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_NXTPAGE,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_TBL_ENDTBL,!0),i.label=7;case 7:return e.isEmptyDataview()?this.ActionManager.enable(r.InternalInterface.MG_ACT_CANCEL,!1):this.ActionManager.enable(r.InternalInterface.MG_ACT_CANCEL,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_ENTER_ROW_EDITING,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_NO_PROG_EXE_RIGHTS,!0),[2]}}))}))},i.prototype.isStarted=function(){return this._isStarted},i.prototype.getSubTasks=function(){return this.SubTasks},i.prototype.refreshesOn=function(e){for(var t=!1,r=0;!t&&null!==this.RefreshOnVars&&r<this.RefreshOnVars.length;r++)t=this.RefreshOnVars[r]===e;return t},i.prototype.AbortTransaction=function(){this.DataviewManager.RemoteDataviewManager.Transaction=null},i.prototype.setPreventRecordSuffix=function(e){this._preventRecordSuffix=e},i.prototype.getPreventRecordSuffix=function(){return this._preventRecordSuffix},i.prototype.setPreventControlChange=function(e){this._preventControlChange=e},i.prototype.getPreventControlChange=function(){return this._preventControlChange},i.prototype.resetKnownToServer=function(){this._knownToServer=!1},i.prototype.evaluateDescriptor=function(){var e,a="";if(null==this.DvPosDescriptor)return t.HashUtils.GetHashCode(a);for(var s=!0,i=0;i<this.DvPosDescriptor.length;i++){s||(a+=";");var l=this.DvPosDescriptor.get_Item(i),u=l[0],c=t.NNumber.Parse(l[1]),_=o.mgDataTable.GetTaskByID(u).DataView.getField(c),T=_.getDispValue();_.isNull()&&(T="");var h=void 0;switch(_.getType()){case r.StorageAttribute.BOOLEAN:case r.StorageAttribute.ALPHA:case r.StorageAttribute.UNICODE:case r.StorageAttribute.BLOB:case r.StorageAttribute.BLOB_VECTOR:a+=T;break;case r.StorageAttribute.DATE:case r.StorageAttribute.TIME:if(""!==T)h=new n.PIC(_.getPicture(),_.getType(),0),a+=n.DisplayConvertor.Instance.mg2disp(T,"",h,!1,this.getCompIdx(),!1);break;case r.StorageAttribute.NUMERIC:""!==T&&(e=new n.NUM_TYPE(T),h=new n.PIC(_.getPicture(),_.getType(),0),a+=e.to_a(h))}s=!1}var p=r.StrUtil.stringToHexaDump(a,4);return t.HashUtils.GetHashCode(p)},i.prototype.setDescriptor=function(e){if(""!==e.trim()){var n=r.StrUtil.tokenize(e,";");this.DvPosDescriptor=new t.List;for(var a=0;a<n.length;a+=1){var s=new Array(2),i=r.StrUtil.tokenize(n[a],",");s[0]=i[0],s[1]=i[1],this.DvPosDescriptor.push(s)}}},i.prototype.getTaskCache=function(){return this._dvCache},i.prototype.prepareCache=function(e){return T(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(a){switch(a.label){case 0:return t=!0,e?[3,5]:[4,this.isCached()];case 1:return a.sent()?(this.DataView.getChanged()&&(this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0),t=!1),[3,5]):[3,2];case 2:return(r=this.IsSubForm)?[4,this.isCached()]:[3,4];case 3:r=!a.sent(),a.label=4;case 4:r&&(t=!1),a.label=5;case 5:if(!this.hasSubTasks())return[3,9];n=0,a.label=6;case 6:return n<this.SubTasks.getSize()?[4,this.SubTasks.getTask(n).prepareCache(!1)]:[3,9];case 7:a.sent()||(t=!1),a.label=8;case 8:return n+=1,[3,6];case 9:return[2,t]}}))}))},i.prototype.testAndSet=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a;return h(this,(function(s){switch(s.label){case 0:return(t=!e)?[4,this.isCached()]:[3,2];case 1:t=s.sent(),s.label=2;case 2:return t?(r=this.evaluateDescriptor())===this.DataView.getDvPosValue()?[3,4]:null==(n=this._dvCache.getCachedDataView(r))?[2,!1]:[4,this.changeDv(n)]:[3,5];case 3:s.sent(),s.label=4;case 4:this.DoSubformPrefixSuffix=!0,s.label=5;case 5:if(!this.hasSubTasks())return[3,9];a=0,s.label=6;case 6:return a<this.SubTasks.getSize()?[4,this.SubTasks.getTask(a).testAndSet(!1)]:[3,9];case 7:if(!s.sent())return[2,!1];s.label=8;case 8:return a++,[3,6];case 9:return[2,!0]}}))}))},i.prototype.changeDv=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t=this.DataView,this.hasLocate?this.locatePutInCache():!t.getChanged()&&t.IncludesFirst()&&this._dvCache.putInCache(t.replicate()),[4,t.setSameAs(e)];case 1:return n.sent(),t.takeFldValsFromCurrRec(),this.Form.SetTableItemsCount(0,!0),this.Form.setTableItemsCount(!1),[4,this.Form.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 2:return n.sent(),this.setOriginalTaskMode(this.getMode()),[2]}}))}))},i.prototype.setOriginalTaskMode=function(e){this._originalTaskMode=e.charAt(0)},i.prototype.getOriginalTaskMode=function(){return this._originalTaskMode},i.prototype.isCached=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return(e=this.IsSubForm)?[4,this.Form.getSubFormCtrl().checkProp(n.PropInterface.PROP_TYPE_IS_CACHED,!1)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,e]}}))}))},i.prototype.locatePutInCache=function(){var e=this._dvCache.getCachedDataView(this.DataView.getDvPosValue());null!=e?this.DataView.checkFirst(e.getLocateFirstRec())&&!this.DataView.getChanged()?(this.DataView.setLocateFirstRec(e.getLocateFirstRec()),this._dvCache.putInCache(this.DataView.replicate())):this._dvCache.removeDvFromCache(this.DataView.getDvPosValue(),!0):this.DataView.getChanged()||this._dvCache.putInCache(this.DataView.replicate())},i.prototype.HasLoacte=function(){return this.hasLocate},i.prototype.setRemoteTransaction=function(e){var t,r=o.mgDataTable,n=!1;for(r.startTasksIteration();null!=(t=r.getNextTask());)if(null!=t.DataviewManager.RemoteDataviewManager.Transaction&&t.DataviewManager.RemoteDataviewManager.Transaction.getTransId()===e){n=!0;break}this.DataviewManager.RemoteDataviewManager.Transaction=n?t.DataviewManager.RemoteDataviewManager.Transaction:new kt(this,e,!1)},i.prototype.setTransOwnerTask=function(){this.Transaction.setOwnerTask(this),this.Transaction.setTransBegin("T")},i.prototype.getLoopCounter=function(){var e=0;return this._useLoopStack&&null!==this._loopStack&&0!==this._loopStack.count()&&(e=this._loopStack.peek()),e},i.prototype.enterLoop=function(){null===this._loopStack&&(this._loopStack=new t.Stack),this._loopStack.push(0)},i.prototype.leaveLoop=function(){this.popLoopCounter()},i.prototype.popLoopCounter=function(){var e=0;return null!==this._loopStack&&0!==this._loopStack.count()&&(e=this._loopStack.pop()),e},i.prototype.increaseLoopCounter=function(){this._loopStack.push(this.popLoopCounter()+1)},i.prototype.getLoopStackSize=function(){return null!==this._loopStack?this._loopStack.count():0},i.prototype.setUseLoopStack=function(e){this._useLoopStack=e},i.prototype.getDataviewHeaders=function(){return this.DataviewHeadersTable},i.prototype.isFirstRecordCycle=function(e){return 0===arguments.length?this.isFirstRecordCycle_0():this.isFirstRecordCycle_1(e)},i.prototype.isFirstRecordCycle_0=function(){return this._firstRecordCycle},i.prototype.isFirstRecordCycle_1=function(e){this._firstRecordCycle=e},i.prototype.getPublicName=function(){return this.PublicName},i.prototype.isAllowEvents=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,this.getProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_EVENTS).getValueBoolean()];case 1:return[2,e.sent()]}}))}))},i.prototype.getExternalTaskId=function(){var e="",t=this.getProp(n.PropInterface.PROP_TYPE_TASK_ID);return null!=t&&(e=t.GetComputedValue()),e},i.prototype.isTransactionOwner=function(){var e=!1;return null!=this.Transaction&&this.Transaction.isOwner(this)&&(e=!0),e},i.prototype.isTransactionOnLevel=function(e){return this.isTransactionOwner()&&this.Transaction.getLevel()===e},i.prototype.isProgram=function(){return this._isPrg},i.prototype.enableModes=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)];case 1:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_MODIFY,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 2:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_CREATE,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_QUERY,!0)];case 3:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_QUERY,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_RANGE,!0)];case 4:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_RANGE,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_LOCATE,!0)];case 5:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_LOCATE,e),this.ActionManager.enable(r.InternalInterface.MG_ACT_RTO_SEARCH,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_SORT,!0)];case 6:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_SORT_RECORDS,e),[4,this.checkProp(n.PropInterface.PROP_TYPE_TASK_PROPERTIES_ALLOW_INDEX,!0)];case 7:return e=t.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_VIEW_BY_KEY,e),[2]}}))}))},i.prototype.setEnableZoomHandler=function(){this._enableZoomHandler=!0},i.prototype.getEnableZoomHandler=function(){return this._enableZoomHandler},i.prototype.isDestinationSubform=function(){return this._destinationSubform},i.prototype.setDestinationSubform=function(e){this._destinationSubform=e},i.prototype.getIsDestinationCall=function(){return this._isDestinationCall},i.prototype.setIsDestinationCall=function(e){this._isDestinationCall=e},i.prototype.setCancelWasRaised=function(e){this._cancelWasRaised=e},i.prototype.cancelWasRaised=function(){return this._cancelWasRaised},i.prototype.enableCreateActs=function(e){this.ActionManager.enable(r.InternalInterface.MG_ACT_CRELINE,e),this.ActionManager.enable(r.InternalInterface.MG_ACT_CRELINE_ABOVE,!!this.getForm().HasTable()&&e)},i.prototype.setCreateDeleteActsEnableState=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return(e=!this.DataView.isEmptyDataview())?[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_DELETE,!0)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return e&&this.getMode()===r.Constants.TASK_MODE_MODIFY&&this.DataView.HasMainTable?this.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!0):this.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!1),[4,this.checkProp(n.PropInterface.PROP_TYPE_ALLOW_CREATE,!0)];case 3:return t.sent()&&(this.DataView.HasMainTable&&this.getMode()===r.Constants.TASK_MODE_MODIFY&&et.Instance.allowCreateInModifyMode(this.getCompIdx())||this.getMode()===r.Constants.TASK_MODE_CREATE)?this.enableCreateActs(!0):this.enableCreateActs(!1),[2]}}))}))},i.prototype.setEmptyDataview=function(e){this.DataView.setEmptyDataview(e)},i.prototype.getName=function(){return this.Name},i.prototype.emptyDataviewOpen=function(t){return T(this,void 0,void 0,(function(){var n,a,s;return h(this,(function(i){switch(i.label){case 0:return this.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,11]:(this.ActionManager.enable(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW,!0),this.IsSubForm?null!=(n=o.eventsManager.getLastRtEvent())&&n.getInternalCode()==r.InternalInterface.MG_ACT_RT_REFRESH_VIEW||t?((a=new w(this)).setInternal(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW),a.SetEventSubType(e.EventSubType.Normal),[4,o.eventsManager.handleEvent(a,!1)]):[3,2]:[3,3]);case 1:i.sent(),i.label=2;case 2:return[3,4];case 3:o.eventsManager.addInternalEventWithItaskAndCode(this,r.InternalInterface.MG_ACT_EMPTY_DATAVIEW),i.label=4;case 4:return this.setLevel(r.Constants.TASK_LEVEL_RECORD),(s=this.SubformExecMode!==e.Task_SubformExecModeEnum.FIRST_TIME&&t)?[4,this.CheckRefreshSubTasks()]:[3,6];case 5:s=i.sent(),i.label=6;case 6:return s?[4,this.DataView.computeSubForms()]:[3,9];case 7:return i.sent(),[4,this.doSubformRecPrefixSuffix()];case 8:i.sent(),i.label=9;case 9:return[4,this.enableRecordActions()];case 10:i.sent(),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,!1),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,!1),i.label=11;case 11:return[2]}}))}))},i.prototype.emptyDataviewClose=function(){this.ActionManager.enable(r.InternalInterface.MG_ACT_EMPTY_DATAVIEW,!1),this.setLevel(r.Constants.TASK_LEVEL_TASK),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_RECORD,!0),this.ActionManager.enable(r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN,!0)},i.prototype.SubformRefresh=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return n=G.Instance.getLastFocusedTask(),[4,e.ExecuteNestedRS(n)];case 1:return a=l.sent(),o.eventsManager.GetStopExecutionFlag()?[2]:e.getLevel()===r.Constants.TASK_LEVEL_TASK||o.eventsManager.GetStopExecutionFlag()?[3,3]:(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(e,r.InternalInterface.MG_ACT_REC_SUFFIX,!0)]);case 2:if(l.sent(),o.eventsManager.popNewExecStacks(),a=!0,o.eventsManager.GetStopExecutionFlag())return[2];l.label=3;case 3:return s=Qe.CreateSubformRefreshCommand(this.getTaskTag(),e.getTaskTag(),t),[4,e.DataviewManager.Execute(s)];case 4:return l.sent(),e.isAborting()?[2]:t?(o.eventsManager.pushNewExecStacks(),i=e.PerformParentRecordPrefix,e.PerformParentRecordPrefix=!1,[4,o.eventsManager.handleInternalEventWithTaskAndSubformRefresh(e,r.InternalInterface.MG_ACT_REC_PREFIX,!0)]):[3,6];case 5:if(l.sent(),e.PerformParentRecordPrefix=i,o.eventsManager.popNewExecStacks(),o.eventsManager.GetStopExecutionFlag())return[2];l.label=6;case 6:return a?[3,9]:[3,7];case 7:return o.eventsManager.GetStopExecutionFlag()?[3,9]:t?[4,o.eventsManager.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,9];case 8:l.sent(),null!=n&&n.DataView.setPrevCurrRec(),e.DoSubformPrefixSuffix=!1,l.label=9;case 9:return[2]}}))}))},i.prototype.ExecuteNestedRS=function(e){return T(this,void 0,void 0,(function(){var t,n;return h(this,(function(a){switch(a.label){case 0:if(t=!1,null==e)return[2,t];if(this.getLevel()!==r.Constants.TASK_LEVEL_TASK&&e.getMgdID()!==this.getMgdID())return[2,t];n=e,a.label=1;case 1:return n!==this&&n.pathContains(this)&&n.getLevel()!==r.Constants.TASK_LEVEL_TASK?(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,4];case 2:a.sent(),o.eventsManager.popNewExecStacks(),t=!0,a.label=3;case 3:return n=n.getParent(),[3,1];case 4:return[2,t]}}))}))},i.prototype.execSubformRecSuffix=function(e){return T(this,void 0,void 0,(function(){var n,a,s;return h(this,(function(i){switch(i.label){case 0:s=0,a=this._taskPath.length,i.label=1;case 1:return a>0?(n=this._taskPath.get_Item(a-1),e._taskPath.Contains(n)?[3,3]:[4,o.eventsManager.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,5];case 2:return i.sent(),o.eventsManager.GetStopExecutionFlag()?[3,5]:(n.getMode()!==r.Constants.TASK_MODE_CREATE||n.DataView.getCurrRec().isNewRec()||n.setMode(r.Constants.TASK_MODE_MODIFY),[3,4]);case 3:return s=e._taskPath.indexOf(n),[3,5];case 4:return a--,[3,1];case 5:return t.Debug.Assert(a>0),[2,s]}}))}))},i.prototype.getCounter=function(){return this._counter},i.prototype.increaseCounter=function(){this._counter=this._counter+1},i.prototype.setCounter=function(e){this._counter=e},i.prototype.isCurrentStartProgLevel=function(){return this._currStartProgLevel===i.StartProgLevel},i.isMainProgramField=function(e){var n=r.XmlParser.getTokens(e,","),a=!1;2===n.length&&(t.NNumber.Parse(n.get_Item(0))===b.MAIN_PRG_PARENT_ID&&(a=!0));return a},i.prototype.getTaskInfo=function(){var e=this.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue();return t.NString.Format("{0} {1}",this.isProgram()?"Program":"Subtask",e)},i.prototype.toString=function(){return t.NString.Format('(task {0}-"{1}"{2})',this._taskTag,this.Name,s.prototype.isMainProg.call(this)?" ctl "+this._ctlIdx:"")},i.prototype.ConstructMgForm=function(e){for(var t=new rr,r=null!=this.ParentTask?this.ParentTask.getForm():null;null!=r&&!r.getTask().isOpenWin();)r=r.ParentForm;return t.ParentForm=r,e.value=!0,t},i.prototype.getMgdID=function(){return this._mgData.GetId()},i.prototype.getMGData=function(){return this._mgData},i.prototype.RefreshDisplay=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return null===this.Form||this.isAborting()||!this.isStarted()?[3,3]:(r.Logger.Instance.WriteDevToLog("Start task.RefreshDisplay()"),this._refreshType===r.Constants.TASK_REFRESH_NONE?[3,2]:[4,this.Form.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)]);case 1:e.sent()&&(this._refreshType=r.Constants.TASK_REFRESH_NONE),e.label=2;case 2:r.Logger.Instance.WriteDevToLog("End task.RefreshDisplay()"),e.label=3;case 3:return[2]}}))}))},i.prototype.getFieldDisplayValue=function(e,t,r){t.value=e.getDispValue(),r.value=e.isNull()},i.prototype.UpdateFieldValueAndStartRecompute=function(e,t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return this.TaskPrefixExecuted?[4,e.setValueAndStartRecompute(t,r,!0,!1,!1)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},i.prototype.ShouldNonInteractiveChildBeModal=function(){return this.ShouldChildBeModal()},i.prototype.ShouldChildBeModal=function(){var e=!1;return this.Form.ConcreteWindowType===r.WindowType.Overlay&&this.getForm().Opened?e=!0:this.IsInteractive||(e=!0),e},i.prototype.getParent=function(){return this._parentTask},i.prototype.isDescendentOf=function(e){return e===this||null!==e&&null!==this._parentTask&&this._parentTask.isDescendentOf(e)},i.prototype.GetSubformModalParentTask=function(){for(var e=this;null!=e._parentTask&&e._parentTask.getIsDestinationCall();){var t=e._parentTask.getForm().getSubFormCtrl();if(t.IsModal())return t;e=e._parentTask}return null},i.prototype.ShouldEvaluatePropertyLocally=function(e){return this.TaskService.ShouldEvaluatePropertyLocally(e)},i.prototype.EnsureValidForm=function(){this._isMainPrg&&null!==this.Form&&(this._openWin&&this.Form.isLegalForm||(this.Form=null))},i.prototype.ComputeMainDisplay=function(){var e=this.getProp(n.PropInterface.PROP_TYPE_MAIN_DISPLAY).GetComputedValueInteger();e=this.GetRealMainDisplayIndexOnCurrentTask(e),this._forms.InitFormFromXmlString(e),this.EnsureValidForm()},i.prototype.PrepareTaskForm=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,Dt.PreparePropOpenTaskWindow(this)];case 1:return e.sent(),[2,nr.PreparePropMainDisplay(this)]}}))}))},i.prototype.FormIsLegal=function(){return s.prototype.isMainProg.call(this)||s.prototype.getForm.call(this).isLegalForm},i.prototype.GetRealMainDisplayIndexOnDepth=function(e){for(var t=this.LogicalStudioParentTask;null!=t;)e+=t._forms.Count,t=t.LogicalStudioParentTask;return e},i.prototype.GetRealMainDisplayIndexOnCurrentTask=function(e){if(e>1)for(var t=this.LogicalStudioParentTask;null!=t;)e-=t._forms.Count,t=t.LogicalStudioParentTask;return e},i.prototype.GetAncestorTaskByTaskDefinitionId=function(e){var t=this;if(e.IsMainProgram())return n.GuiDataCollection.MGDataTable.GetMainProgByCtlIdx(this.ContextID,e.CtlIndex);for(;null!=t;){if(t.TaskDefinitionId.Equals(e))return t;t=t._parentTask}return null},i.prototype.SetDataControlValuesReference=function(e,t){s.prototype.getForm.call(this).getCtrl(e).setDcValId(t)},i.prototype.DisplayMessageToStatusBar=function(e){var t=this.GetContextTask();null==t.getForm()&&(t=G.Instance.getLastFocusedTask()),t.WriteToMessagePane(e,!0)},i.prototype.isTableWithAbsolutesScrollbar=function(){var e=!1;return null!=this.getForm()&&(e=this.getForm().isTableWithAbsoluteScrollbar()),e},i.prototype.GetTaskDetails=function(){for(var e=this.getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue(),t=this;null!==t.ParentTask&&!t.ParentTask.isMainProg();)e=(t=t.ParentTask).getProp(n.PropInterface.PROP_TYPE_NAME).GetComputedValue()+"."+e;return e},i.ProcessTaskURL=function(){return T(this,void 0,void 0,(function(){var e,a,s,o,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return e=n.RuntimeContextBase.Instance.Parser.getXMLdata(),a=e.indexOf(r.XMLConstants.TAG_CLOSE,n.RuntimeContextBase.Instance.Parser.getCurrIndex()),t.Debug.Assert(-1!==a&&a<e.length),s=n.RuntimeContextBase.Instance.Parser.getXMLsubstring(a),n.RuntimeContextBase.Instance.Parser.add2CurrIndex(s.indexOf(E.MG_TAG_TASKURL)+E.MG_TAG_TASKURL.length),o=r.XmlParser.getTokens(n.RuntimeContextBase.Instance.Parser.getXMLsubstring(a),r.XMLConstants.XML_ATTR_DELIM),l=o.get_Item(1),u=o.get_Item(3),[4,i.CommandsProcessor.GetContent(l,!0)];case 1:for(c=h.sent(),_=new t.StringBuilder(e.substr(0,n.RuntimeContextBase.Instance.Parser.getCurrIndex()-(E.MG_TAG_TASKURL.length+1)),c.length),T=this.getReflist(u,";",!0,-1),p=0,g=c.indexOf("[:"),d=0;-1!==g;)_.Append(c.substr(d,g-d)),_.Append(T.get_Item(p++)),d=g+=2,g=c.indexOf("[:",d);return _.Append(c.substr(d)),_.Append(e.substr(e.indexOf(r.XMLConstants.TAG_CLOSE,a+1)+1)),e=_.ToString(),r.Logger.Instance.WriteDevToLog(t.NString.Format("{0} -------\x3e {1}",l,e)),n.RuntimeContextBase.Instance.Parser.setXMLdata(e),n.RuntimeContextBase.Instance.Parser.setCurrIndex(n.RuntimeContextBase.Instance.Parser.getCurrIndex()-(E.MG_TAG_TASKURL.length+1)),[2]}}))}))},i.getReflist=function(e,r,n,a){for(var s=new t.StringBuilder,i=new t.List,o=0,l=1;l<e.length;l++){var u=e.charAt(l);if("\\"!==u&&u!==r)s.Append(u);else if(u===r){if(i.push(s.ToString()),s=new t.StringBuilder,++o===a)break}else"\\"===u&&(n||e.charAt(l+1)===r||s.Append(e.charAt(l)),l++,s.Append(e.charAt(l)))}return i.push(s.ToString()),i},i.StartProgram=function(n,a){return T(this,void 0,void 0,(function(){var s,l,u,c,_,T,p,g,d;return h(this,(function(h){switch(h.label){case 0:return s=o.eventsManager.GetStopExecutionFlag(),l=null,u=o.eventsManager.getAllowEvents(),o.eventsManager.setAllowEvents(e.EventsAllowedType.ALL),r.Logger.Instance.WriteDevToLog('Start "startProg"'),i.StartProgLevel++,o.eventsManager.setStopExecution(!1),[4,this.ExecuteComponentMainPrograms(n,a)];case 1:return l=h.sent(),c=new t.RefParam(l),_=new t.RefParam(null),[4,i.ExecuteMainProgram(0,n,a,c,_,o.mgDataTable)];case 2:return h.sent(),l=c.value,i._idleTimerStarted||(ge.Instance.startTimer(o.mgDataTable.getMGData(0),et.Instance.getIdleTime(0),!0),i._idleTimerStarted=!0),[4,this.OpenForms(n)];case 3:return h.sent(),[4,this.DoFirstRecordCycle()];case 4:return h.sent(),[4,this.MoveToFirstControls(n)];case 5:return h.sent(),1!==i.StartProgLevel?[3,11]:(T=!1,p=!0,null!==l&&l.isStarted()?(T=!0,d=(g=o.eventsManager).setNonInteractiveAllowEvents,[4,l.isAllowEvents()]):[3,8]);case 6:return d.apply(g,[h.sent(),l]),[4,l.isAllowEvents()];case 7:p=h.sent(),h.label=8;case 8:return null!==G.Instance.getLastFocusedTask()&&p?(o.eventsManager.pushNewExecStacks(),[4,o.eventsManager.handleEvents(o.mgDataTable.getCurrMGData(),0)]):[3,10];case 9:h.sent(),o.eventsManager.popNewExecStacks(),h.label=10;case 10:T&&o.eventsManager.setAllowEvents(u),h.label=11;case 11:return i.StartProgLevel--,r.Logger.Instance.WriteDevToLog('End "startProg"'),s&&!o.eventsManager.GetStopExecutionFlag()&&s&&!o.eventsManager.GetStopExecutionFlag()&&o.eventsManager.setStopExecution(s),[2,l]}}))}))},i.ExecuteComponentMainPrograms=function(e,r){return T(this,void 0,void 0,(function(){var n,a,s,l;return h(this,(function(u){switch(u.label){case 0:n=new t.RefParam(null),a=new t.RefParam(null),s=o.mgDataTable.getMGData(0).getMaxCtlIdx(),l=1,u.label=1;case 1:return l<=s?null===o.mgDataTable.GetMainProgByCtlIdx(-1,l)?[3,3]:[4,i.ExecuteMainProgram(l,e,r,n,a,o.mgDataTable)]:[3,4];case 2:u.sent(),u.label=3;case 3:return l+=1,[3,1];case 4:return[2,a.value]}}))}))},i.ExecuteMainProgram=function(e,n,a,s,i,o){return T(this,void 0,void 0,(function(){var l,u;return h(this,(function(c){switch(c.label){case 0:return l=o.GetMainProgByCtlIdx(-1,e),r.Logger.Instance.WriteDevToLog(t.NString.Format(" ClientManager.startProg: ctlIdx={0}, task={1}",e,l)),u=s,[4,l.Start(a,n)];case 1:return u.value=c.sent(),null===i.value?i.value=s.value:null!==s.value&&t.Debug.Assert(!1,"more than 1 non interactive tasks in startProg"),[2]}}))}))},i.OpenForms=function(e){return T(this,void 0,void 0,(function(){var t,r,a,s;return h(this,(function(i){switch(i.label){case 0:if(t=rr.CreatedForms,null,!(t.Count()>0))return[3,4];r=0,i.label=1;case 1:return r<t.Count()?(a=t.get(r),s=!1,a.isSubForm()?a.getSubFormCtrl().getForm().Opened&&(s=!0):a.getTask().isCurrentStartProgLevel()&&(s=!0),s?(n.Manager.OpenForm(a),[4,n.Manager.DoFirstRefreshTable(a)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return a.Opened?(e&&a.isSubForm()&&a.getTopMostForm(),t.remove(a)):r++,[3,1];case 4:return[2]}}))}))},i.DoFirstRecordCycle=function(){return T(this,void 0,void 0,(function(){var e,t,r,n,a;return h(this,(function(s){switch(s.label){case 0:e=0,s.label=1;case 1:if(!(e<o.mgDataTable.getSize()))return[3,6];if(null===(t=o.mgDataTable.getMGData(e))||t.IsAborting)return[3,5];r=0,s.label=2;case 2:return r<t.getTasksCount()?null===(n=t.getTask(r))||null===(a=n.getForm())||!n.isCurrentStartProgLevel()||a.IgnoreFirstRecordCycle?[3,4]:(a.IgnoreFirstRecordCycle=!0,[4,n.doFirstRecordCycle()]):[3,5];case 3:s.sent(),s.label=4;case 4:return r++,[3,2];case 5:return e++,[3,1];case 6:return[2]}}))}))},i.MoveToFirstControls=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i;return h(this,(function(l){switch(l.label){case 0:t=0,l.label=1;case 1:if(!(t<o.mgDataTable.getSize()))return[3,6];if(null===(r=o.mgDataTable.getMGData(t))||r.IsAborting)return[3,5];n=r.getTasksCount(),a=0,l.label=2;case 2:return a<n?(s=r.getTask(a),i=s.getForm(),s.isCurrentStartProgLevel()&&null!==i&&i.MovedToFirstControl?(i.MovedToFirstControl=!1,e?[3,4]:[4,o.eventsManager.HandleNonParkableControls(s)]):[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return a++,[3,2];case 5:return t++,[3,1];case 6:return[2]}}))}))},i}(b);br.StartProgLevel=0,br._idleTimerStarted=!1;var Nr,yr=function(){function e(){this._ctlIdxTab=null}return e.prototype.fillData=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_COMPMAINPRG)+E.MG_TAG_COMPMAINPRG.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM);return r.Logger.Instance.WriteDevToLog("in CompMainPrg.FillData: "+a.toString()),this.initElements(a),void e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length)}r.Logger.Instance.WriteExceptionToLogWithMsg("in CompMainPrg.FillData() out of string bounds")},e.prototype.initElements=function(e){for(var n=0;n<e.length;n+=2){var a=e.get_Item(n),s=e.get_Item(n+1);a===r.XMLConstants.MG_ATTR_VALUE?(s=r.StrUtil.DeleteStringsFromEnds(s,'"'),this.initCtlIdxTab(s)):r.Logger.Instance.WriteExceptionToLogWithMsg(t.NString.Format("There is no such index in CompMainPrg. Add case to CompMainPrg.initElements for {0}",a))}r.Logger.Instance.WriteDevToLog("End CompMainPrg ")},e.prototype.initCtlIdxTab=function(e){t.NString.IsNullOrEmpty(e)||(-1!==e.indexOf(",")?this._ctlIdxTab=r.StrUtil.tokenize(e,","):(this._ctlIdxTab=new Array(1),this._ctlIdxTab[0]=e))},e.prototype.getCtlIdx=function(e){if(e>=0&&e<this.getSize()){var r=this._ctlIdxTab[e];return t.NNumber.Parse(r)}return-1},e.prototype.getIndexOf=function(e){var t;for(t=0;t<this.getSize();t++)if(e===this.getCtlIdx(t))return t;return-1},e.prototype.getSize=function(){return null===this._ctlIdxTab?0:this._ctlIdxTab.length},e}(),Or=function(){function e(e,t,r,n,a,s){this._expHandlers=null,this._id=0,this._parent=null,this._mprgTab=null,this._tasksTab=null,this._timerHandlers=null,this._timersStarted=!1,this.forceModal=!1,this.CmdsToClient=null,this.CmdsToServer=null,this.IsModal=!1,this.IsAborting=!1,this.CmdsToServer=e,this.CmdsToClient=t,5===arguments.length?this.constructor_0(r,n,a):this.constructor_1(r,n,a,s)}return Object.defineProperty(e.prototype,"ForceModal",{get:function(){return this.forceModal},enumerable:!1,configurable:!0}),e.prototype.constructor_0=function(e,t,r){if(this._timerHandlers=new gr,this._expHandlers=new gr,this._mprgTab=new O,this._tasksTab=new O,this._id=e,this._parent=t,null===o.eventsManager.getCompMainPrgTab()){var n=new yr;o.eventsManager.setCompMainPrgTab(n)}this.IsModal=r},e.prototype.constructor_1=function(e,t,r,n){this.constructor_0(e,t,r),this.forceModal=n},e.prototype.GetId=function(){return this._id},e.prototype.AlreadyMovedToFirstControl=function(){for(var e=!1,t=this.getTasksCount(),r=0;r<t;r+=1){var n=this.getTask(r).getForm();if(null!==n&&n.MovedToFirstControl){e=!0;break}}return e},e.prototype.StartTimers=function(){null===this._timerHandlers||this._timersStarted||(this._timerHandlers.startTimers(this),this._timersStarted=!0)},e.prototype.fillData=function(e,t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:return a=t.getNextTag(),[4,this.initInnerObjects(t,a,e)];case 1:n=s.sent(),s.label=2;case 2:if(n)return[3,0];s.label=3;case 3:return r.Logger.Instance.WriteDevToLog("MGData.FillData(): THE END of the parsing "+t.getCurrIndex()+" characters"),[2]}}))}))},e.prototype.initInnerObjects=function(e,a,s){return T(this,void 0,void 0,(function(){var i,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b;return h(this,(function(h){switch(h.label){case 0:if(null==a)return[2,!1];switch(a){case r.XMLConstants.MG_TAG_XML:return[3,1];case E.MG_TAG_DATAVIEW:return[3,2];case E.MG_TAG_COMPLETE_DV:return[3,4];case E.MG_TAG_CONTEXT:return[3,5];case r.XMLConstants.MG_TAG_RECOMPUTE:return[3,6];case E.MG_TAG_COMMAND:return[3,7];case E.MG_TAG_LANGUAGE:return[3,8];case E.MG_TAG_KBDMAP_URL:return[3,10];case E.MG_TAG_KBDMAP:return[3,12];case E.MG_TAG_COMPMAINPRG:return[3,13];case E.MG_TAG_EVENTS_QUEUE:return[3,14];case E.MG_TAG_TASKURL:return[3,15];case r.XMLConstants.MG_TAG_TASK:return[3,17];case E.MG_TAG_ENV:return[3,19];case E.MG_TAG_FLWMTR_CONFIG:return[3,20];case r.XMLConstants.MG_TAG_XML_END:return[3,21];case E.MG_TAG_USER_DETAILS:return[3,22];case E.MG_TAG_DBH_REAL_IDXS:return[3,23];case E.MG_TAG_GLOBALPARAMSCHANGES:return[3,24];case E.MG_TAG_GLOBALPARAMS:return[3,25];case E.MG_TAG_ENV_PARAM_URL:return[3,26];case E.MG_TAG_ENV_PARAM:return[3,28];case E.MG_TAG_CONTEXT_ID:return[3,29];case E.MG_TAG_SESSION_ID:return[3,30];case E.MG_TAG_HTTP_COMMUNICATION_TIMEOUT:return[3,31];case E.MG_TAG_DATABASE_URL:case E.MG_TAG_DATABASES_HEADER:case E.MG_TAG_TASKDEFINITION_IDS_URL:case E.MG_TAG_DBH_DATA_IDS_URL:case E.MG_TAG_DBHS_END:case E.MG_TAG_OFFLINE_SNIPPETS_URL:return[3,32];case E.MG_TAG_DBHS:case E.MG_TAG_STARTUP_PROGRAM:return[3,33];case r.XMLConstants.MG_TAG_MENUS_OPEN:return[3,34]}return[3,35];case 1:return e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),[3,36];case 2:return[4,this.insertDataView(e)];case 3:return h.sent()||(d=e.getXMLdata().indexOf("/"+E.MG_TAG_DATAVIEW,e.getCurrIndex()),e.setCurrIndex(d),e.setCurrIndex2EndOfTag()),[3,36];case 4:return i=null,d=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),l=e.getXMLdata().indexOf(E.MG_TAG_COMPLETE_DV,e.getCurrIndex())+E.MG_TAG_COMPLETE_DV.length,u=r.XmlParser.getTokens(e.getXMLdata().substr(l,d-l),'"'),c=u.get_Item(0),_=void 0,c===r.XMLConstants.MG_ATTR_TASKID&&(_=u.get_Item(1),T=_,i=null===this.getTask(T)?o.mgDataTable.GetTaskByID(T):this.getTask(T)),p=d+1,d=e.getXMLdata().indexOf(r.XMLConstants.END_TAG+E.MG_TAG_COMPLETE_DV,e.getCurrIndex()),g=e.getXMLdata().substr(p,d-p),i.dataViewContent=g,e.setCurrIndex(d),e.setCurrIndex2EndOfTag(),[3,36];case 5:return-1!==(d=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex()))&&d<e.getXMLdata().length&&(I=e.getXMLsubstring(d),e.add2CurrIndex(I.indexOf(E.MG_TAG_CONTEXT)+E.MG_TAG_CONTEXT.length),e.setCurrIndex(d+r.XMLConstants.TAG_TERM.length)),[3,36];case 6:return(new dr).fillData(e),[3,36];case 7:return r.Logger.Instance.WriteDevToLog("goes to command"),this.CmdsToClient.fillData(e),[3,36];case 8:return r.Logger.Instance.WriteDevToLog("goes to language data"),[4,pe.Instance.fillData(e)];case 9:case 11:case 16:case 27:return h.sent(),[3,36];case 10:return r.Logger.Instance.WriteDevToLog("goes to keyBoard"),[4,et.Instance.fillFromUrl(a,e)];case 12:case 34:return[3,36];case 13:return r.Logger.Instance.WriteDevToLog("goes to compmainprg"),o.eventsManager.getCompMainPrgTab().fillData(e),[3,36];case 14:return r.Logger.Instance.WriteDevToLog("goes to eventsqueue"),this.fillEventsQueue(e),[3,36];case 15:return[4,br.ProcessTaskURL()];case 17:return r.Logger.Instance.WriteDevToLog("goes to task"),f=this._mprgTab.getSize(),[4,this._mprgTab.fillData(this,s,e)];case 18:if(h.sent(),0!==this._id)for(C=this._mprgTab.getSize(),A=o.mgDataTable.getMGData(0),R=f;R<C;R++)(S=this._mprgTab.getTask(R)).isMainProg()&&null==A._mprgTab.getTask(S.getTaskTag())&&(A._mprgTab.addTask(S),A.addTask(S));return[3,36];case 19:return r.Logger.Instance.WriteDevToLog("goes to environment"),et.Instance.fillData(e),[3,36];case 20:return U.Instance.fillData(e),[3,36];case 21:return e.setCurrIndex2EndOfTag(),[2,!1];case 22:return at.Instance.fillData(e),[3,36];case 23:case 32:return e.SkipXMLElement(),[3,36];case 24:return r.Logger.Instance.WriteDevToLog("applying global params changes from the server (Set/GetParams)"),nt.Instance.fillData(e),[3,36];case 25:return r.Logger.Instance.WriteDevToLog("processing base64 encoded image of all global params from the server"),this.fillGlobalParams(e),[3,36];case 26:return r.Logger.Instance.WriteDevToLog("goes to env params name "),[4,et.Instance.fillFromUrl(a,e)];case 28:return r.Logger.Instance.WriteDevToLog("goes to env params name "),lt.Instance.fillData(e),[3,36];case 29:return void 0,void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),m=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),M=e.getXMLsubstring(m).trim(),e.setCurrIndex(m),e.setCurrIndex2EndOfTag(),n.RuntimeContextBase.Instance.ContextID=M,[3,36];case 30:return void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),v=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),le.GetInstance().SessionId=e.getXMLsubstring(v).trim(),e.setCurrIndex(v),e.setCurrIndex2EndOfTag(),[3,36];case 31:return void 0,void 0,e.setCurrIndex(e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex())+1),b=e.getXMLdata().indexOf(r.XMLConstants.TAG_OPEN,e.getCurrIndex()),L=t.NNumber.Parse(e.getXMLsubstring(b)),e.setCurrIndex(b),e.setCurrIndex2EndOfTag(),re.GetInstance().HttpCommunicationTimeoutMS=1e3*L,[3,36];case 33:return e.ReadContentOfCurrentElement(),[3,36];case 35:return r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag name in MGData, add case to MGData.initInnerObjects and case to while of MGData.FillData "+a),[2,!1];case 36:return[2,!0]}}))}))},e.prototype.insertDataView=function(e){return T(this,void 0,void 0,(function(){var t,n,a,s,i,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:for(t=null,n=e.getXMLdata().indexOf(r.XMLConstants.TAG_CLOSE,e.getCurrIndex()),a=e.getXMLdata().indexOf(E.MG_TAG_DATAVIEW,e.getCurrIndex())+E.MG_TAG_DATAVIEW.length,s=r.XmlParser.getTokens(e.getXMLdata().substr(a,n-a),'"'),i=!1,l=0;l<s.length;l+=2)if((u=s.get_Item(l))===r.XMLConstants.MG_ATTR_TASKID&&(_=s.get_Item(l+1),c=_,t=this.getTask(c)||o.mgDataTable.GetTaskByID(c)),u===E.MG_ATTR_INVALIDATE){_=s.get_Item(l+1),i=r.XmlParser.getBoolean(_);break}return null===t?[3,2]:[4,t.insertRecordTable(i,e)];case 1:return h.sent(),T=!0,[3,3];case 2:T=!1,h.label=3;case 3:return[2,T]}}))}))},e.prototype.addTask=function(e){this._tasksTab.addTask(e)},e.prototype.removeTask=function(e){this._tasksTab.removeTask(e),this._mprgTab.removeTask(e)},e.prototype.getTasksCount=function(){return null!==this._tasksTab?this._tasksTab.getSize():0},e.prototype.getTask=function(e){return 1!==arguments.length||null!=e&&e.constructor!==String?this.getTask_1(e):this.getTask_0(e)},e.prototype.getTask_0=function(e){return null!==this._tasksTab&&void 0!==this._tasksTab?this._tasksTab.getTask(e):null},e.prototype.getTask_1=function(e){return this._tasksTab.getTask(e)},e.prototype.buildXML=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null!==this.CmdsToServer&&this.CmdsToServer.buildXML(e),t&&null!==this._tasksTab?[4,this._tasksTab.buildXML(e)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.getFirstTask=function(){for(var e=null,t=0;t<this._tasksTab.getSize()&&(e=this._tasksTab.getTask(t)).isMainProg();t+=1)e=null;return null===e&&0===this._id&&(e=null),e},e.prototype.getMainProg=function(e){for(var t=0;t<this._mprgTab.getSize();t+=1){var r=this._mprgTab.getTask(t);if(r.getCtlIdx()===e&&r.isMainProg())return r}return null},e.prototype.getNextMainProg=function(e){var t=o.eventsManager.getCompMainPrgTab(),r=t.getIndexOf(e),n=t.getCtlIdx(r+1);return-1===n?null:this.getMainProg(n)},e.prototype.clientTransactionCacheExists=function(){for(var e,t=0;t<this._tasksTab.getSize();t+=1)if(!(e=this._tasksTab.getTask(t)).isMainProg()&&e.DataView.modifiedRecordsNumber()>0)return!0;return!1},e.prototype.serverTransactionCacheExists=function(){for(var e,t=0;t<this._tasksTab.getSize();t+=1)if(!(e=this._tasksTab.getTask(t)).isMainProg()&&!e.DataView.ServerTransactionCacheEmpty)return!0;return!1},e.prototype.getTaskByTaskDefinitionID=function(e){for(var t,r=0;r<this._tasksTab.getSize();r+=1)if((t=this._tasksTab.getTask(r)).TaskDefinitionId.Equals(e))return t;return null},e.prototype.getTimerHandlers=function(){return this._timerHandlers},e.prototype.addTimerHandler=function(e){this._timerHandlers.add(e)},e.prototype.removeTimerHandler=function(e){for(var t=0;t<this._timerHandlers.getSize();){var r=this._timerHandlers.getHandler(t).getTask();r.isDescendentOf(e)&&r.getMGData()===this?this._timerHandlers.remove(t):t++}},e.prototype.removeExpressionHandler=function(e){for(var t=0;t<this._expHandlers.getSize();){var r=this._expHandlers.getHandler(t).getTask();r.isDescendentOf(e)&&r.getMGData()===this?this._expHandlers.remove(t):t++}},e.prototype.getExpHandlers=function(){return this._expHandlers},e.prototype.addExpHandler=function(e,t){this._expHandlers.insertAfter(e,t)},e.prototype.changeTimers=function(e,t){var r=0,n=0,a=ge.Instance;for(e.sort(),t.sort();r<e.length&&n<t.length;)e.get_Item(r)>t.get_Item(n)?(a.startTimer(this,t.get_Item(n),!1),n+=1):e.get_Item(r)<t.get_Item(n)?(a.stopTimer(this,e.get_Item(r),!1),r+=1):(r+=1,n+=1);for(;r<e.length;)a.stopTimer(this,e.get_Item(r),!1),r+=1;for(;n<t.length;)a.startTimer(this,t.get_Item(n),!1),n+=1},e.prototype.fillEventsQueue=function(e){for(;this.initEvents(e,e.getNextTag()););},e.prototype.initEvents=function(e,t){var n;if(null===t)n=!1;else{if(t===E.MG_TAG_EVENT){var a=new w(null);a.fillData(e,null),a.convertParamsToArgs(),a.setTask(null),a.setFromServer(),o.eventsManager.addToTail(a)}else{if(t!==E.MG_TAG_EVENTS_QUEUE)return t==="/"+E.MG_TAG_EVENTS_QUEUE?(e.setCurrIndex2EndOfTag(),n=!1):(r.Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventsQueue: "+t),n=!1);e.setCurrIndex(e.getXMLdata().indexOf(">",e.getCurrIndex())+1)}n=!0}return n},e.prototype.isMainWindow=function(){return null===this._parent},e.prototype.getParentMGdata=function(){return this._parent},e.prototype.abort=function(){this.IsAborting=!0},e.prototype.copyUnframedCmds=function(){for(var e=Lr.Instance.getUnframedCmds(),t=0;t<e.length;t+=1)this.CmdsToClient.Add(e.get_Item(t));e.SetSize(0)},e.prototype.getValidAncestor=function(){return this._parent},e.prototype.getMaxCtlIdx=function(){for(var e=0,t=0;t<this._tasksTab.getSize();t+=1){var r=this._tasksTab.getTask(t);null!==r&&(e=Math.max(e,r.getCtlIdx()))}return e},e.prototype.fillGlobalParams=function(e){var a=e.getXMLdata(),s=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==s&&s<a.length){var i=e.getXMLsubstring(s);e.add2CurrIndex(i.indexOf(E.MG_TAG_GLOBALPARAMS)+E.MG_TAG_GLOBALPARAMS.length);var o=r.XmlParser.getTokens(n.RuntimeContextBase.Instance.Parser.getXMLsubstring(s),r.XMLConstants.XML_ATTR_DELIM);t.Debug.Assert(o.get_Item(0)===r.XMLConstants.MG_ATTR_VALUE),ne.Instance.setGlobalParams(o.get_Item(1)),-1===(s=a.indexOf(r.XMLConstants.TAG_OPEN,s))&&(s=a.length),e.setCurrIndex(s)}},e}(),Gr=function(){function e(){}return Object.defineProperty(e.prototype,"ShouldExecute",{get:function(){return this.shouldExecute},enumerable:!1,configurable:!0}),e}(),Pr=function(e){function t(){var t=e.apply(this,d(arguments))||this;return t.Frame=0,t.TaskTag=null,t.Obj=null,t}return u(t,e),Object.defineProperty(t.prototype,"IsBlocking",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ShouldExecute",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.HandleAttribute=function(e,t){if(e===r.XMLConstants.MG_ATTR_TASKID)this.TaskTag=t},t}(Gr),Dr=function(e){function r(){return e.call(this)||this}return u(r,e),r.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),t.Debug.Assert(e.IsSubForm),r.ClientIsInRollbackCommand?[2]:!e.AfterFirstRecordPrefix||e.InEndTask?[3,3]:e.DataView.getCurrRec().InRecompute?(e.ExecuteClientSubformRefresh=!0,[3,3]):[3,1];case 1:return e.PerformParentRecordPrefix=!1,[4,e.getParent().SubformRefresh(e,!0)];case 2:n.sent(),e.PerformParentRecordPrefix=!0,n.label=3;case 3:return[2]}}))}))},r}(Pr);Dr.ClientIsInRollbackCommand=!1,function(e){e.NONE=" ",e.TRANS="T"}(Nr||(Nr={}));var kr=function(){function s(){this._eventsQueue=null,this._execStack=null,this._rtEvents=null,this._serverExecStack=null,this._allowEvents=e.EventsAllowedType.ALL,this._compMainPrgTab=null,this._currCtrl=null,this._currField=null,this._currKbdItem=null,this._endOfWork=!1,this._eventScope=Nr.NONE,this._forceExit=r.ForceExit.None,this._forceExitTask=null,this._ignoreUnknownAbort=!1,this._initialized=!1,this._isHandlingForceExit=!1,this._isNonReversibleExit=!1,this._isInRecordFlushEvent=!1,this.lastSavedRouteEvent=null,this._stopExecution=!1,this._processingTopMostEndTask=!1,this._stopExecutionCtrl=null,this._isSorting=!1,this._nextParkedCtrl=null,this.guiPendingEvent=null,this.KBI_DOWN=null,this.KBI_UP=null,this.confirmationDialogMsg="The server context serving this application is about to time out. Do you want to continue your work?",this.confirmationDialogTitle="Session is about to be terminated!",this._lastFailedFocusedControl=null,this.isSpinnerShown=!1,this.SpinnerStopped=new i.Subject,this._rtEvents=new t.Stack,this._eventsQueue=new F,this._execStack=new t.Stack,this._execStack.push(new z),this._serverExecStack=new t.Stack,this._serverExecStack.push(null),this._nextParkedCtrl=null,this.KBI_DOWN=new n.KeyboardItem(n.GuiConstants.KEY_DOWN,n.Modifiers.MODIFIER_NONE),this.KBI_UP=new n.KeyboardItem(n.GuiConstants.KEY_UP,n.Modifiers.MODIFIER_NONE)}return s.prototype.getPendingGuiEvent=function(){return this.guiPendingEvent},s.prototype.setPendingGuiEvent=function(e){this.guiPendingEvent=e},s.prototype.addToTail=function(e){e.isIdleTimer()?null!=this.getLastSavedRouteEvent()&&(this.addToTail(this.getLastSavedRouteEvent()),this.setLastSavedRouteEvent(null)):s.clientInactivityTimerON&&(s.clientContextInactivityTimerAborted=!0),this._eventsQueue.put(e)},s.prototype.AddKeyboardEvent=function(e,t,a,s,i,o,l,u,c,_){var T=null!==t?new w(t,!0,!1):new w(e.getTask(),!0);T.setInternal(_);var h=new n.KeyboardItem(s,a);u&&null!==t&&t.isTextControl()&&h.setAction(r.InternalInterface.MG_ACT_CHAR),T.setKeyboardItem(h),_===r.InternalInterface.MG_ACT_CTRL_KEYDOWN?T.setEditParms(i,o,l):T.setValue(c),this.addToTail(T)},s.prototype.checkParkability=function(){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(n){switch(n.label){case 0:return e=G.getLastFocusedControl(),(t=null!==e&&e.getForm().getTask().getLevel()===r.Constants.TASK_LEVEL_CONTROL)?[4,e.IsParkable()]:[3,2];case 1:t=!n.sent(),n.label=2;case 2:return t?[4,this.HandleNonParkableControls(e.getForm().getTask())]:[3,4];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},s.prototype.HandleParkabilityOnRowChange=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.HandleNonParkableControls(e)];case 1:return t.sent(),[2]}}))}))},s.prototype.HandleNonParkableControls=function(e){return T(this,void 0,void 0,(function(){var t,a;return h(this,(function(s){switch(s.label){case 0:return(t=e).getMode()===r.Constants.TASK_MODE_CREATE&&t.IsInteractive?[4,t.enableModes()]:[3,7];case 1:return s.sent(),a=t.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 2:return s.sent(),this.GetStopExecutionFlag()?[3,7]:a===r.Constants.TASK_MODE_CREATE?[3,7]:(t.setMode(a),[4,t.DataView.currRecCompute(!0)]);case 3:return s.sent(),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 4:return s.sent(),[4,t.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 5:return s.sent(),t.setLastParkedCtrl(null),[4,n.FocusManager.SetFocus(t,null,-1,!0)];case 6:return s.sent(),[2];case 7:return t.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,9]:[4,this.handleInternalEventWithMgControlBase(t.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 8:s.sent(),s.label=9;case 9:return t.setLastParkedCtrl(null),P.ReturnToCtrl=null,[4,n.FocusManager.SetFocus(t,null,-1,!0)];case 10:return s.sent(),[2]}}))}))},s.prototype.handleEvent=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M;return h(this,(function(h){switch(h.label){case 0:if(n=null,a=new Ae,s=e.getTask(),i=s.getLastParkedCtrl(),o=!1,l=!1,u=null,c=this.getForceExit(),_=this.getForceExitTask(),T=this._isHandlingForceExit,p=!1,g=null,d=null,e.getType()===E.EVENT_TYPE_INTERNAL){if(e.InternalEvent<r.InternalInterface.MG_ACT_TOT_CNT&&(!s.ActionManager.isEnabled(e.InternalEvent)||!e.isImmediate()&&this.NoEventsAllowed()))return[2]}else if(!e.isImmediate()&&this.NoEventsAllowed())return[2];g=this._currCtrl,this._currCtrl=i,I=e.getType()!==E.EVENT_TYPE_INTERNAL||e.getInternalCode()<1e3,h.label=1;case 1:return h.trys.push([1,,24,25]),this.pushRtEvent(e),[4,this.CheckAndShowSpinner(!0)];case 2:return h.sent(),[4,this.commonHandlerBefore(e)];case 3:if(f=h.sent(),d=this._currField,this._currField=s.getCurrField(),!f)return[3,19];a.init(e),null!==(n=a.getNext())&&null!==n.getEvent()&&null!==n.getEvent().UserEvt&&this.setForceExit(n.getEvent().UserEvt.ForceExit,s),h.label=4;case 4:if(null===n)return[3,17];C=null,A=void 0,h.label=5;case 5:return h.trys.push([5,,15,16]),R=!1,C=n.getTask().GetContextTask(),e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()>=1e3&&e.getInternalCode()!==r.InternalInterface.MG_ACT_VARIABLE?n.getTask().SetContextTask(n.getTask()):n.getTask().SetContextTask(e.getTask()),(S=n.getEvent().getType()===E.EVENT_TYPE_USER)?[4,n.isEnabled()]:[3,7];case 6:S=h.sent(),h.label=7;case 7:return S?(R=!0,this._isHandlingForceExit=!1,p=!0,[4,this.handleForceExitBefore(n.getEvent(),e)]):[3,9];case 8:h.sent()&&(o=!0),h.label=9;case 9:return e!==n.getEvent()?(u=e,e=new w(n.getEvent(),e),A=!0,this.popRtEvent(),this.pushRtEvent(e)):A=!1,e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getTask().setInRecordSuffix(!0),this.createEventArguments(e),[4,n.execute(e,t,R)];case 10:return M=h.sent(),e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()===r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getTask().setInRecordSuffix(!1),I=M.Propagate,!M.Enabled&&A&&(e=u,u=null,A=!1,this.popRtEvent(),this.pushRtEvent(e)),e.getInternalCode()!==r.InternalInterface.MG_ACT_TASK_PREFIX&&s.isStarted()&&s.getExecEndTask()?[4,s.endTask(!0,!1,!1)]:[3,12];case 11:if(l=h.sent())return[3,17];h.label=12;case 12:return this.GetStopExecutionFlag()?[4,this.handleStopExecution(e)]:[3,14];case 13:if(h.sent())return[3,17];h.label=14;case 14:return[3,16];case 15:return n.getTask().SetContextTask(C),[7];case 16:return I?(null!==(n=A?a.getNext(e):a.getNext())&&U.Instance.addTaskEvent(e.getBrkLevel(!0),V.FLWMTR_PROPAGATE,s.GetTaskDetails()),[3,4]):[3,17];case 17:return!I||l?[3,19]:[4,this.commonHandler(e)];case 18:h.sent(),h.label=19;case 19:return l?[3,21]:[4,this.commonHandlerAfter(e,f,I)];case 20:h.sent(),h.label=21;case 21:return o&&this._isHandlingForceExit?(this._isHandlingForceExit=!1,[4,this.handleForceExitAfter(e)]):[3,23];case 22:h.sent(),h.label=23;case 23:return this.setForceExit(c,_),p&&(this._isHandlingForceExit=T),[3,25];case 24:return this._currCtrl=g,this._currField=d,this.popRtEvent(),[7];case 25:return ge.Instance.execGuiCommandQueue(),[2]}}))}))},s.prototype.simulateSelection=function(e,t,a,s){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return o=(i=e).getForm().getTask(),l=o.cancelWasRaised(),i.Type!==r.MgControlType.CTRL_TYPE_BUTTON?[3,2]:(u=new w(i),[4,i.getProp(n.PropInterface.PROP_TYPE_RAISE_AT).getValueInt()]);case 1:c=h.sent(),u.getType()!==E.EVENT_TYPE_INTERNAL||u.InternalEvent!==r.InternalInterface.MG_ACT_CANCEL&&u.InternalEvent!==r.InternalInterface.MG_ACT_RT_QUIT||(c===r.RaiseAt.TaskInFocus&&(o=G.Instance.getLastFocusedTask()),l=o.cancelWasRaised(),o.setCancelWasRaised(!0)),c===r.RaiseAt.TaskInFocus&&i.setRtEvtTask(G.Instance.getLastFocusedTask()),h.label=2;case 2:return[4,this.handleFocus(i,a,s)];case 3:return h.sent(),o.setCancelWasRaised(l),this._stopExecution?[2]:[4,i.IsParkable()];case 4:return _=h.sent(),i.Type!==r.MgControlType.CTRL_TYPE_BUTTON||null===i.getField()||_?i.Type!==r.MgControlType.CTRL_TYPE_BUTTON||_?[3,8]:(T=i.getForm().getTask()).IsSubForm?(o=G.Instance.getLastFocusedTask(),T!==o&&T.pathContains(o)?T.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(T,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,8]):[3,8]:[3,10];case 5:h.sent(),h.label=6;case 6:return[4,this.HandleNonParkableControls(T)];case 7:h.sent(),h.label=8;case 8:return p=new w(i),n.RuntimeContextBase.Instance.CurrentClickedCtrl=i,p.setInternal(r.InternalInterface.MG_ACT_CTRL_HIT),[4,this.handleEvent(p,!1)];case 9:if(h.sent(),this._stopExecution)return[2];h.label=10;case 10:return i.Type===r.MgControlType.CTRL_TYPE_BUTTON?[3,12]:[4,this.handleSelection(i,a,t)];case 11:h.sent(),h.label=12;case 12:return this._stopExecution?[2]:[4,this.handleMouseUp(i,a,s)];case 13:return h.sent(),[2]}}))}))},s.prototype.handleInternalEventWithTask=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,this.handleInternalEventWithTaskAndSubformRefresh(e,t,!1)];case 1:return r.sent(),[2]}}))}))},s.prototype.handleInternalEventWithTaskAndSubformRefresh=function(t,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return s=t,n===r.InternalInterface.MG_ACT_REC_PREFIX&&s.IsSubForm&&s.SubformExecMode!==e.Task_SubformExecModeEnum.FIRST_TIME&&(s.SubformExecMode=a?e.Task_SubformExecModeEnum.REFRESH:e.Task_SubformExecModeEnum.SET_FOCUS),a?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT)]:[3,2];case 1:i.sent(),i.label=2;case 2:return s.DataView.isEmptyDataview()?n!==r.InternalInterface.MG_ACT_REC_PREFIX&&n!==r.InternalInterface.MG_ACT_REC_SUFFIX?[3,9]:n!==r.InternalInterface.MG_ACT_REC_PREFIX?[3,4]:[4,s.emptyDataviewOpen(a)]:[3,12];case 3:return i.sent(),[3,5];case 4:s.emptyDataviewClose(),i.label=5;case 5:return null===s.getForm()?[3,8]:n!==r.InternalInterface.MG_ACT_REC_PREFIX?[3,7]:[4,s.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 6:i.sent(),i.label=7;case 7:s.getForm().SelectRow(),i.label=8;case 8:return[3,11];case 9:return[4,this.handleInternalEventWithTaskAndEventSubtype(s,n,e.EventSubType.Normal)];case 10:i.sent(),i.label=11;case 11:return[3,14];case 12:return[4,this.handleInternalEventWithTaskAndEventSubtype(s,n,e.EventSubType.Normal)];case 13:i.sent(),i.label=14;case 14:return[2]}}))}))},s.prototype.handleInternalEventWithMgControlBase=function(t,r){return T(this,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,this.handleInternalEventWithMgControl(t,r,e.EventSubType.Normal)];case 1:return n.sent(),[2]}}))}))},s.prototype.GetStopExecutionFlag=function(){return this._stopExecution},s.prototype.getStopExecutionCtrl=function(){return this._stopExecutionCtrl},s.prototype.Init=function(){this._initialized&&(this._isHandlingForceExit=!1,this._forceExit=r.ForceExit.None,this._forceExitTask=null,this._currField=null,this.setEndOfWork(!0)),this._initialized=!0},s.prototype.addInternalEventWithItaskAndCode=function(e,t){this.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(e,t,!1)},s.prototype.addInternalEventWithCtrlAndCode=function(e,t){var r=new w(e);r.setInternal(t),this.addToTail(r)},s.prototype.addInternalEventWithCtrlAndDisplayLineAndCode=function(e,t,r){var n=new w(e,t,!1);n.setInternal(r),this.addToTail(n)},s.prototype.addInternalEventWithCtrlAndCodeAndPriority=function(e,t,r){var n=new w(e);n.setInternal(t),n.setPriority(r),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark=function(e,t,r){var n=new w(e);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndLineAndModifier=function(e,t,r,n){var a=new w(e,r,!1);a.setInternal(t),this.addToTail(a)},s.prototype.addGuiTriggeredEventWithTaskAndCodeAndLine=function(e,t,r){var n=null;null!==e&&(n=e);var a=new w(n);a.setInternal(t),a.DisplayLine=r,this.addToTail(a)},s.prototype.AddColumnClickEvent=function(e,t,a){var s=new w(e,t,0);s.setInternal(r.InternalInterface.MG_ACT_COL_CLICK);var i=new Array;i[0]=new n.ExpVal(r.StorageAttribute.UNICODE,!1,a);var o=new L(i);s.setArgList(o),this.addToTail(s)},s.prototype.AddRouteEvent=function(e,t,a,s,i){var o=new w(e,!0);o.setInternal(t);var l=new Array(2);l[0]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,a),null===s&&(s=""),l[1]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,s);var u=new L(l);o.setArgList(u),o.setRouteParamList(i),this.addToTail(o)},s.prototype.AddRouterClosedEvent=function(e){var t=e.getForm().getSubFormCtrl(),a=new w(t.getForm().getTask(),!0);a.setInternal(r.InternalInterface.MG_ACT_SUBFORM_CLOSE);var i=new Array(1);i[0]=new n.ExpVal(r.StorageAttribute.ALPHA,!1,t.getName());var o=new L(i);a.setArgList(o),s.Instance.addToTail(a)},s.prototype.AddLastSavedRouteEvent=function(e,t){var n=new w(G.Instance.getLastFocusedTask(),!0);n.setInternal(r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE),null!=e&&(n.setTask(e),null!=t&&n.setArgList(t),this.setLastSavedRouteEvent(n))},s.prototype.AddExternalValueEvent=function(e,t,a){var s=new w(e,0,!0);s.setInternal(r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE),s.setValue(t);var i=new Array(1);i[0]=new n.ExpVal(r.StorageAttribute.BOOLEAN,!1,a?"1":"0");var o=new L(i);s.setArgList(o),this.addToTail(s)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndLine=function(e,t,r){var n=new w(e,r,!0);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick=function(e,t,r,n){var a=new w(e,r,!0);a.setInternal(t),a.setProduceClick(n),this.addToTail(a)},s.prototype.addGuiTriggeredEventWithCtrlAndCodeAndList=function(e,t,r){var n=new w(e,r,!0);n.setInternal(t),this.addToTail(n)},s.prototype.addGuiTriggeredEventWithTaskAndCode=function(e,t){var r=new w(e,!0);r.setInternal(t),this.addToTail(r)},s.prototype.addGuiTriggeredEventTaskAndCodeAndRaisedBy=function(e,t,r){this.addGuiTriggeredEventWithTaskAndCode(e,t)},s.prototype.getEvent=function(){return this._eventsQueue.poll()},s.prototype.getForceExit=function(){return this._forceExit},s.prototype.setForceExit=function(e,t){this._forceExit=e,this.setForceExitTask(t)},s.prototype.getForceExitTask=function(){return this._forceExitTask},s.prototype.setForceExitTask=function(e){this._forceExitTask=e},s.prototype.isForceExitPreRecordUpdate=function(e){return this._isHandlingForceExit&&this.getForceExit()===r.ForceExit.PreRecordUpdate&&e===this.getForceExitTask()},s.prototype.ExecuteClientContextInactivityTimer=function(){return T(this,void 0,void 0,(function(){var e,n,a;return h(this,(function(i){switch(i.label){case 0:e=r.Misc.getSystemMilliseconds(),n=100*et.Instance.getClientContextInactivityTimeout(),s.clientInactivityTimerON=!0,i.label=1;case 1:return s.clientInactivityTimerON?[4,t.Thread.Sleep(1e3)]:[3,3];case 2:return i.sent(),a=r.Misc.getSystemMilliseconds()-e,(s.clientContextInactivityTimerAborted||a>=n)&&(s.clientInactivityTimerON=!1),[3,1];case 3:return[2]}}))}))},s.prototype.CheckAndShowSpinner=function(e){return T(this,void 0,void 0,(function(){var a,i;return h(this,(function(o){switch(o.label){case 0:return a=!1,null!==this.getLastRtEvent()&&this.getLastRtEvent().getPriority()===r.Priority.LOWEST&&(e=!1),e==this.isSpinnerShown?[3,2]:(e?r.Misc.getSystemMilliseconds()-this.GetEventTime()>1e3&&(a=!0,s.clientBusyTimeStart=r.Misc.getSystemMilliseconds()):a=!0,a?(n.Commands.addShowSpinner(e),n.Commands.beginInvoke(),[4,t.Thread.Sleep(50)]):[3,2]);case 1:o.sent(),this.isSpinnerShown=e,this.isSpinnerShown||(i=r.Misc.getSystemMilliseconds()-s.clientBusyTimeStart,this.SpinnerStopped.next(i),s.clientBusyTimeStart=0),o.label=2;case 2:return[2]}}))}))},s.prototype.EventsLoop=function(t){return T(this,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:r=this.getAllowEvents(),this.setAllowEvents(e.EventsAllowedType.ALL),this.pushNewExecStacks(),n.label=1;case 1:return t.IsAborting?[3,7]:[4,this.CheckAndShowSpinner(!1)];case 2:return n.sent(),[4,this._eventsQueue.waitForElement()];case 3:return n.sent(),[4,this.handleEvents(t,0)];case 4:return n.sent(),t.IsAborting?[3,6]:[4,this.checkParkability()];case 5:n.sent(),n.label=6;case 6:return[3,1];case 7:return this.popNewExecStacks(),this.setAllowEvents(r),[2]}}))}))},s.prototype.NonInteractiveEventsLoop=function(e,n){return T(this,void 0,void 0,(function(){var a,s,i,o;return h(this,(function(l){switch(l.label){case 0:return a=n,s=this.getAllowEvents(),i=this.setNonInteractiveAllowEvents,[4,a.isAllowEvents()];case 1:i.apply(this,[l.sent(),a]),this.pushNewExecStacks(),l.label=2;case 2:return e.IsAborting?[3,12]:a.getMode()!==r.Constants.TASK_MODE_DELETE?[3,4]:[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC)];case 3:return l.sent(),[3,6];case 4:return[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_CYCLE_NEXT_REC)];case 5:l.sent(),l.label=6;case 6:return[4,t.Thread.Sleep(10)];case 7:return l.sent(),(o=!e.IsAborting)?[4,a.isAllowEvents()]:[3,9];case 8:o=l.sent(),l.label=9;case 9:return o?[4,this.handleEvents(e,1)]:[3,11];case 10:l.sent(),l.label=11;case 11:return[3,2];case 12:return this.popNewExecStacks(),this.setAllowEvents(s),[2]}}))}))},s.prototype.handleEvents=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return!(null===e||e instanceof Or)||null!==t&&t.constructor!==Number?[3,2]:[4,this.handleEvents_0(e,t)];case 1:case 3:return r.sent(),[2];case 2:return[4,this.handleEvents_1(e,t)]}}))}))},s.prototype.handleEvents_0=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:n=null,a=0,s=0,this.setStopExecution(!1),u.label=1;case 1:if(this._eventsQueue.isEmpty()||this._stopExecution||!(0===t||s<t))return[3,8];if(null!==(i=this.getEvent())&&i.isGuiTriggeredEvent()){if(a=r.Misc.getSystemMilliseconds(),this._currKbdItem=null,(o=i.isBlockedByModalWindow(e))&&i.getInternalCode()!==r.InternalInterface.MG_ACT_TIMER)return[3,1];i.isIdleTimer()||o||i.getInternalCode()===r.InternalInterface.MG_ACT_ENABLE_EVENTS||i.getInternalCode()===r.InternalInterface.MG_ACT_DISABLE_EVENTS||null===i.getTask()||i.getTask().getMGData().IsAborting||(oe.Instance.currMgdID=i.getTask().getMGData().GetId())}if(null!==(l=oe.Instance.getCurrMGData()))for(;null!==l&&l.IsAborting;)null!==(l=l.getParentMGdata())&&(oe.Instance.currMgdID=oe.Instance.getMgDataIdx(l));else for(n=i.getTask();null===l&&null!==n&&null!==n.getParent();)n=n.getParent(),(l=n.getMGData()).IsAborting&&(l=null),null!==l&&(oe.Instance.currMgdID=oe.Instance.getMgDataIdx(l));if(null===l)return[3,8];if(null===i.getTask()){for(n=G.Instance.getLastFocusedTask();null!==n&&(n.isAborting()||n.InEndTask);)n=n.getParent();null!==n&&(i.setCtrl(n.getLastParkedCtrl()),i.setTask(n))}else n=i.getTask();return null===n?[3,3]:[4,this.handleEvent(i,!1)];case 2:u.sent(),u.label=3;case 3:return ge.Instance.execGuiCommandQueue(),this._currCtrl=null,null===n?[3,5]:[4,br.CommandsProcessor.SendMonitorOnly()];case 4:return u.sent(),[3,7];case 5:return oe.Instance.GetMainProgByCtlIdx(0),[4,br.CommandsProcessor.SendMonitorOnly()];case 6:u.sent(),u.label=7;case 7:return null!==i&&i.isGuiTriggeredEvent()&&a>0&&(a=r.Misc.getSystemMilliseconds()-a),t>0&&null!==i&&i.getType()===E.EVENT_TYPE_INTERNAL&&i.InternalEvent<r.InternalInterface.MG_ACT_TOT_CNT&&s++,[3,1];case 8:return[2]}}))}))},s.prototype.handleStopExecution=function(e){return T(this,void 0,void 0,(function(){var t,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:if(t=!1,!this.GetStopExecutionFlag())return[2,t];if(a=e.getTask(),s=e.Control,i=G.getLastFocusedControl(),o=!1,e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,12];switch(e.getInternalCode()){case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,1];case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,2];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,3];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,4];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,9]}return[3,10];case 1:case 2:return o=!0,[3,10];case 3:return this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(a.getLastParkedCtrl()),[3,10];case 4:return this.setStopExecution(!1),a.InCtrlPrefix=!1,null!==i?[3,6]:(a.setCurrField(null),this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(s),[4,this.HandleNonParkableControls(a)]);case 5:return l.sent(),[3,8];case 6:return a.setCurrField(i.getField()),[4,n.FocusManager.SetFocus(i,-1)];case 7:l.sent(),l.label=8;case 8:return this.setStopExecution(!0),[3,10];case 9:return s.setInControlSuffix(!1),[3,10];case 10:return o?[4,a.endTask(!0,!1,!0)]:[3,12];case 11:l.sent(),t=!0,l.label=12;case 12:return[2,t]}}))}))},s.prototype.handleForceExitBefore=function(e,t){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return a=e.UserEvt.ForceExit,s=!1,i=0,a===r.ForceExit.None||t.isImmediate()?[2,!1]:(this._isHandlingForceExit=!0,o=t.getTask(),null!==(l=o.DataView.getCurrRec())&&l.getMode()===n.DataModificationTypes.Insert&&l.isNewRec()&&(s=!0,i=l.getId()),a===r.ForceExit.Editing||o.getLevel()!==r.Constants.TASK_LEVEL_CONTROL||null===(u=o.getLastParkedCtrl())?[3,2]:[4,this.handleInternalEventWithMgControlBase(u,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]);case 1:h.sent(),h.label=2;case 2:return a!==r.ForceExit.PreRecordUpdate&&a!==r.ForceExit.PostRecordUpdate||o.getLevel()!==r.Constants.TASK_LEVEL_RECORD?[3,4]:[4,this.handleInternalEventWithTask(o,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:h.sent(),o.getMode()!==r.Constants.TASK_MODE_CREATE||this._stopExecution||o.setMode(r.Constants.TASK_MODE_MODIFY),null!==(c=o.DataView.getCurrRec())&&this._stopExecution&&s&&i===c.getId()&&o.getMode()===r.Constants.TASK_MODE_CREATE&&(c.clearMode(),c.restart(n.DataModificationTypes.Insert)),h.label=4;case 4:return a!==r.ForceExit.PostRecordUpdate||this._stopExecution||o.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(o,r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:h.sent(),h.label=6;case 6:return a!==r.ForceExit.Editing||(null===(_=t.Control)||null===_.getField())?[3,8]:(T=n.Manager.GetCtrlVal(_),_.Value,[4,_.validateAndSetValue(T,!0)]);case 7:h.sent(),h.label=8;case 8:return[2,!0]}}))}))},s.prototype.handleForceExitAfter=function(e){return T(this,void 0,void 0,(function(){var t,n,a,s;return h(this,(function(i){switch(i.label){case 0:return t=e.UserEvt.ForceExit,n=e.getTask(),t!==r.ForceExit.PreRecordUpdate?[3,4]:[4,this.commitRecord(n,!0)];case 1:return i.sent(),n.transactionFailed(E.TRANS_RECORD_PREFIX)||n.isAborting()?[3,4]:[4,n.evalEndCond(E.END_COND_EVAL_AFTER)];case 2:return i.sent()?[4,n.endTask(!0,!1,!1)]:[3,4];case 3:i.sent(),i.label=4;case 4:return t===r.ForceExit.PostRecordUpdate||(n=e.getTask()).getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,6]:[4,this.handleInternalEventWithTask(n,r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:i.sent(),i.label=6;case 6:return null===(a=G.getLastFocusedControl())||t===r.ForceExit.Editing?[3,8]:[4,this.handleInternalEventWithMgControlBase(a,r.InternalInterface.MG_ACT_CTRL_PREFIX)];case 7:i.sent(),i.label=8;case 8:return t!==r.ForceExit.Editing||(null===(s=e.Control)||null===s.getField())?[3,10]:[4,s.getField().updateDisplay()];case 9:i.sent(),i.label=10;case 10:return[2]}}))}))},s.prototype.handleEvents_1=function(e,t){return T(this,void 0,void 0,(function(){var r,n;return h(this,(function(a){switch(a.label){case 0:a.trys.push([0,,5,6]),this.pushRtEvent(t),r=0,a.label=1;case 1:return r<e.getSize()?(n=e.getHandler(r),t.getType()===E.EVENT_TYPE_EXPRESSION||n.isSpecificHandlerOf(t)||n.isNonSpecificHandlerOf(t)||n.isGlobalHandlerOf(t)?[4,n.execute(t,!1,!1)]:[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return[3,6];case 5:return this.popRtEvent(),[7];case 6:return[2]}}))}))},s.prototype.handleKeyDown=function(e,t,n){return T(this,void 0,void 0,(function(){var a,s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(a=n.getKbdItmAlways(),s=a.getKeyCode(),a.getModifier(),this._currKbdItem=a,n.IgnoreSpecifiedControl&&(t=this.getCurrCtrl(),e=t.getForm().getTask()instanceof br?t.getForm().getTask():null,t.Type!==r.MgControlType.CTRL_TYPE_TEXT))return[2];r.Logger.Instance.WriteDevToLog("Start handling KEYDOWN event. Key code: "+s),u.label=1;case 1:if(u.trys.push([1,,10,11]),(this._currKbdItem.equals(this.KBI_DOWN)||this._currKbdItem.equals(this.KBI_UP))&&null!==t&&(t.Type===r.MgControlType.CTRL_TYPE_LIST||t.Type===r.MgControlType.CTRL_TYPE_RADIO))return[2];(i=new w(e,t)).setSystem(this._currKbdItem),i.setEditParms(n.getStartSelection(),n.getEndSelection(),n.getValue()),u.label=2;case 2:return u.trys.push([2,,4,5]),[4,this.handleEvent(i,!1)];case 3:return u.sent(),[3,5];case 4:return this._stopExecution&&null!==(o=P.ReturnToCtrl)&&P.validReturnToCtrl()&&o.getForm().getTask().setLastParkedCtrl(o),[7];case 5:return null===(l=oe.Instance.getCurrMGData())||l.IsAborting?[3,7]:[4,this.handleExpressionHandlers()];case 6:u.sent(),u.label=7;case 7:return r.Logger.Instance.WriteDevToLog("End handling KEYDOWN event. Key code: "+s),null!==t&&t.IsRepeatable&&t===P.ReturnToCtrl?[4,t.getForm().bringRecordToPage()]:[3,9];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:return[7];case 11:return[2]}}))}))},s.prototype.handleSelection=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o;return h(this,(function(l){switch(l.label){case 0:return e.Type!==r.MgControlType.CTRL_TYPE_TAB&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&e.Type!==r.MgControlType.CTRL_TYPE_RADIO&&e.Type!==r.MgControlType.CTRL_TYPE_COMBO&&e.Type!==r.MgControlType.CTRL_TYPE_LIST?[3,8]:(s=e.Type!==r.MgControlType.CTRL_TYPE_TAB&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX,i=!s||e.getForm().getTask().getLastParkedCtrl()===e,(o=!i||!e.isModifiable())?[3,2]:[4,e.IsParkable()]);case 1:o=!l.sent(),l.label=2;case 2:return o?[4,e.restoreOldValue()]:[3,4];case 3:return l.sent(),[3,8];case 4:return e.isChoiceControl()&&n.Commands.setGetSuggestedValueOfChoiceControlOnTagData(e,e.IsRepeatable?t:0,!0),e.isDifferentValue(a,e.IsNull,!0)?(e.ModifiedByUser=!0,[4,this.handleCtrlModify(e,r.InternalInterface.MG_ACT_SELECTION)]):[3,6];case 5:l.sent(),l.label=6;case 6:return e.isChoiceControl()&&n.Commands.setGetSuggestedValueOfChoiceControlOnTagData(e,e.IsRepeatable?t:0,!1),e.IsMultipleSelectionListBox()?[3,8]:[4,e.validateAndSetValue(a,!0)];case 7:l.sent(),l.label=8;case 8:return[2]}}))}))},s.prototype.handleMouseUp=function(e,t,a){return T(this,void 0,void 0,(function(){var s,i,o,l;return h(this,(function(u){switch(u.label){case 0:if(null===e)return[2];e.Type===r.MgControlType.CTRL_TYPE_RADIO&&(n.RuntimeContextBase.Instance.CurrentClickedRadio=e),u.label=1;case 1:return u.trys.push([1,,8,9]),e.Type===r.MgControlType.CTRL_TYPE_TABLE?[3,7]:[4,e.checkPropWithLine(n.PropInterface.PROP_TYPE_ENABLED,!0,t)];case 2:return u.sent()?(s=this.canGoToControl(e,t,!0),i=e.isFocusedStopExecution(),o=P.ReturnToCtrl,s&&(!this._stopExecution&&!i||o===e)||null===o?[3,6]:(oe.Instance.currMgdID=o.getForm().getTask().getMgdID(),o.IsRepeatable?[4,o.getForm().bringRecordToPage()]:[3,4])):[2];case 3:u.sent(),u.label=4;case 4:return[4,n.FocusManager.SetFocus(o,-1)];case 5:u.sent(),o.getForm().getTask().setLastParkedCtrl(o),u.label=6;case 6:if(this._stopExecution||i)return[2];u.label=7;case 7:return!a||e.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&e.Type!==r.MgControlType.CTRL_TYPE_CHECKBOX&&e.Type!==r.MgControlType.CTRL_TYPE_LIST||((l=new w(e)).setInternal(r.InternalInterface.MG_ACT_WEB_CLICK),this.addToTail(l)),[3,9];case 8:return n.RuntimeContextBase.Instance.CurrentClickedRadio=null,[7];case 9:return[2]}}))}))},s.prototype.checkAndSaveRouteEventIfCtxRemovedFromSrvr=function(e){e.getType()==E.EVENT_TYPE_INTERNAL&&e.getInternalCode()==r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE&&n.RuntimeContextBase.Instance.RemovedContextFromServer&&this.setLastSavedRouteEvent(e)},s.prototype.handleFocus=function(e,a,s){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return h.trys.push([0,,19,22]),e!==this._lastFailedFocusedControl&&e.HasExpOrParentTaskField()&&(e.isListBox()||e.isCheckBox()||e.isComboBox()||e.isTextControl()||e.isRadio()||e.isTabControl())?(r.Logger.Instance.WriteErrorToLog(t.NString.Format("Control either has expression or has parent task variable attached to it. Failed to park on control with name: {0}",e.Name)),n.FocusManager.SetFocus(G.Instance.getLastFocusedTask(),G.getLastFocusedControl(),0,null===G.getLastFocusedControl()),this._lastFailedFocusedControl=e,[2]):(this._lastFailedFocusedControl=null,s&&(n.RuntimeContextBase.Instance.CurrentClickedCtrl=e),i=G.getLastFocusedControl(),e!==i||e.isRepeatable()?[3,2]:[4,e.getForm().bringRecordToPage()]);case 1:return h.sent(),[2];case 2:return o=G.Instance.getLastFocusedTask(),this._nextParkedCtrl=e,null!==e&&e.Type!==r.MgControlType.CTRL_TYPE_TABLE?[3,5]:null!==i?[3,4]:[4,this.HandleNonParkableControls(e.getForm().getTask())];case 3:h.sent(),h.label=4;case 4:return[2];case 5:return l=void 0,(u=e.Type===r.MgControlType.CTRL_TYPE_BUTTON)?[4,e.getProp(n.PropInterface.PROP_TYPE_RAISE_AT).getValueInt()]:[3,7];case 6:u=h.sent()===r.RaiseAt.TaskInFocus,h.label=7;case 7:return l=u?o:e.getForm().getTask(),this.canGoToControl(e,a,s)?null!=this.guiPendingEvent?[2]:[4,this.HandleSubformModality(e,o,l)]:[3,10];case 8:return h.sent()?[2]:(c=e.isRepeatable()||e.isRadio()?a:t.Int32.MinValue,(_=new w(e,c)).setInternal(r.InternalInterface.MG_ACT_CTRL_PREFIX),[4,this.handleEvent(_,!1)]);case 9:return h.sent(),[3,18];case 10:return null===i?[3,16]:i.isModifiable()?[3,13]:i.isChoiceControl()?[4,i.restoreOldValue()]:[3,12];case 11:h.sent(),h.label=12;case 12:return[3,15];case 13:return l.cancelWasRaised()?[3,15]:(T=n.Manager.GetCtrlVal(i),[4,i.validateAndSetValue(T,!0)]);case 14:h.sent()||this.setStopExecution(!0),h.label=15;case 15:return P.ReturnToCtrl=i,[3,18];case 16:return[4,this.HandleNonParkableControls(e.getForm().getTask())];case 17:h.sent(),h.label=18;case 18:return this._stopExecution||P.ReturnToCtrl!==e||G.setLastFocusedControl(e.getForm().getTask(),e),[2];case 19:return e.setFocusedStopExecution(this._stopExecution),this._stopExecution?null===(p=P.ReturnToCtrl)?[3,21]:(oe.Instance.currMgdID=p.getForm().getTask().getMgdID(),[4,n.FocusManager.SetFocus(p,-1)]):[3,21];case 20:h.sent(),p.getForm().getTask().setLastParkedCtrl(p),h.label=21;case 21:return[7];case 22:return[2]}}))}))},s.prototype.HandleSubformModality=function(e,t,r){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return n=!1,a=t.getMGData().getTasksCount(),s=t.getMGData().getTask(a-1),r!=t&&t==s||null!=s&&t!=s&&s.IsSubForm&&(i=s.getForm().getSubFormCtrl()).IsModal()&&(t=s),t!=e.getForm().getTask()&&t.getIsDestinationCall()?r.isDescendentOf(t)?[3,2]:((i=t.getForm().getSubFormCtrl()).IsModal()||r.getIsDestinationCall()||(i=t.GetSubformModalParentTask()),null!=i&&e!=i&&i.IsModal()?[4,this.performSubformClose(i)]:[3,2]):[3,2];case 1:o.sent(),this._stopExecution||(this.guiPendingEvent=this.getLastRtEvent()),n=!0,o.label=2;case 2:return[2,n]}}))}))},s.prototype.handleFocusOnNonMagicControl=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(a){switch(a.label){case 0:return a.trys.push([0,,2,5]),[4,s.Instance.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 1:return a.sent(),[3,5];case 2:return e.setFocusedStopExecution(this._stopExecution),this._stopExecution?null===(t=P.ReturnToCtrl)?[3,4]:(oe.Instance.currMgdID=t.getForm().getTask().getMgdID(),[4,n.FocusManager.SetFocus(t,-1)]):[3,4];case 3:a.sent(),t.getForm().getTask().setLastParkedCtrl(t),a.label=4;case 4:return[7];case 5:return[2]}}))}))},s.prototype.canGoToControl=function(e,t,n){if(n&&(e.Type===r.MgControlType.CTRL_TYPE_SUBFORM||e.Type===r.MgControlType.CTRL_TYPE_BROWSER))return!1;var a=!0;return!!e.getForm().getTask().IsInteractive&&(e.Type!==r.MgControlType.CTRL_TYPE_IMAGE||e.IsRepeatable||(a=!1),a)},s.prototype.handleTimer=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return e.setType(E.EVENT_TYPE_TIMER),e.isIdleTimer()?[4,this.handleExpressionHandlers()]:[3,3];case 1:return r.sent(),[4,this.handleContextInactivityAlert(e)];case 2:return r.sent(),[3,5];case 3:return t=oe.Instance.getMGData(e.getMgdID()),[4,this.handleEvents(t.getTimerHandlers(),e)];case 4:r.sent(),r.label=5;case 5:return[2]}}))}))},s.prototype.handleContextInactivityAlert=function(t){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=r.Misc.getSystemMilliseconds(),i=t.getTask().getMGData(),o=le.GetInstance().GetLastRequestTime,l=et.Instance.getContextInactivityTimeout()/10,u=et.Instance.getContextInactivityWarningTime()/10,c=(a-o)/1e3,0==l||0==u?[2]:s.userGrantedForContextActivity&&c>=l-u?[4,ge.Instance.MessageBox(this.confirmationDialogTitle,this.confirmationDialogMsg,n.Styles.MSGBOX_BUTTON_YES_NO)]:[3,4];case 1:return T.sent()!=n.Styles.MSGBOX_RESULT_YES?[3,3]:(_=Qe.CreateContextTimeoutResetEventCommand(),i.CmdsToServer.Add(_),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)]);case 2:return T.sent(),[3,4];case 3:s.userGrantedForContextActivity=!1,T.label=4;case 4:return[2]}}))}))},s.prototype.handleExpressionHandlers=function(){return T(this,void 0,void 0,(function(){var e,t,r;return h(this,(function(n){switch(n.label){case 0:(e=new w(G.Instance.getLastFocusedTask(),G.getLastFocusedControl())).setExpression(null),e.setMainPrgCreator(e.getTask()),t=0,n.label=1;case 1:return t<oe.Instance.getSize()?null===(r=oe.Instance.getMGData(t))||r.IsAborting?[3,3]:[4,this.handleEvents(r.getExpHandlers(),e)]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},s.prototype.handleResize=function(e,t){e.getForm().setRowsInPage(t)},s.prototype.handleRowDataCurPage=function(e,t,r,n){return T(this,void 0,void 0,(function(){return h(this,(function(a){switch(a.label){case 0:return[4,e.getForm().setRowData(t,r,n)];case 1:return a.sent(),[2]}}))}))},s.prototype.handleTransferDataToGui=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.getForm().transferDataToGui()];case 1:return t.sent(),[2]}}))}))},s.prototype.fetchRecordsAheadFromServer=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,e.getForm().FetchRecordsAheadFromServer()];case 1:return t.sent(),[2]}}))}))},s.prototype.handleEnableEvents=function(e,t){e.getTask().ActionManager.enableList(e.getActEnableList(),t,!0)},s.prototype.handleCtrlPrefix=function(a){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p,g,d,E,I,f,C;return h(this,(function(h){switch(h.label){case 0:return i=a.getTask(),o=n.RuntimeContextBase.Instance.CurrentClickedCtrl,l=i.getForm(),u=a.getDisplayLine(),c=a.Control,l.isLineMode()?(u===t.Int32.MinValue||c.isRadio())&&(u=l.DisplayLine):u=t.Int32.MinValue,null===(_=G.getLastFocusedControl())||_.getForm().getTask().getMGData().GetId()!==c.getForm().getTask().getMGData().GetId()||_.getForm().getTask().getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,6]:!(c!==_||c.isRepeatable()&&u!==c.getDisplayLine(!0))||_.isInControlSuffix()?[3,5]:[4,this.handleInternalEventWithMgControlBase(_,r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 1:return h.sent(),this._stopExecution?c.Type===r.MgControlType.CTRL_TYPE_LIST||c.Type===r.MgControlType.CTRL_TYPE_RADIO||c.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||c.isTabControl()?(c.resetPrevVal(),[4,c.RefreshDisplay()]):[3,3]:[3,4];case 2:h.sent(),h.label=3;case 3:return[2,!1];case 4:return[3,6];case 5:return[2,!1];case 6:return i.InCtrlPrefix?[2,!1]:(i.InCtrlPrefix=!0,T=_,null!==o&&o.getForm().getTask().getMgdID()===c.getForm().getTask().getMgdID()&&c.onDiffForm(o)&&(T=o),null!==T&&c.onDiffForm(T)?[4,T.getForm().getTask().execSubformRecSuffix(c.getForm().getTask())]:[3,12]);case 7:return h.sent(),this._stopExecution?c.Type===r.MgControlType.CTRL_TYPE_LIST||c.Type===r.MgControlType.CTRL_TYPE_RADIO||c.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||c.isTabControl()?(c.resetPrevVal(),[4,c.RefreshDisplay()]):[3,9]:[3,10];case 8:h.sent(),h.label=9;case 9:return i.InCtrlPrefix=!1,[2,!1];case 10:return c.getForm().getTask().isAborting()?(i.InCtrlPrefix=!1,[2,!1]):[4,s.doSyncForSubformParent(i)];case 11:h.sent(),h.label=12;case 12:return i.DataView.isEmptyDataview()?[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,14];case 13:return h.sent(),[3,16];case 14:return i.SubformExecMode=e.Task_SubformExecModeEnum.SET_FOCUS,(p=new w(c,u)).setInternal(r.InternalInterface.MG_ACT_REC_PREFIX),[4,this.handleEvent(p,!1)];case 15:h.sent(),h.label=16;case 16:return this.GetStopExecutionFlag()?(i.InCtrlPrefix=!1,[2,!1]):[4,c.IsParkable()];case 17:return h.sent()||c===_?[3,22]:(i.InCtrlPrefix=!1,(g=null===_)?[3,19]:[4,_.invoke()]);case 18:g=!h.sent(),h.label=19;case 19:return g?[4,this.HandleNonParkableControls(c.getForm().getTask())]:[3,21];case 20:h.sent(),h.label=21;case 21:return[2,!1];case 22:return r.Logger.Instance.WriteSupportToLog(t.NString.Format("{0} Entering control: control {1}, row {2}",i.GetTaskDetails(),c.Name,u<0?0:u),!0),i.setLevel(r.Constants.TASK_LEVEL_CONTROL),c.KeyStrokeOn=!1,c.ModifiedByUser=!1,i.setCurrField(c.getField()),c.IsRepeatable?[4,l.bringRecordToPage()]:[3,24];case 23:h.sent(),h.label=24;case 24:if(_===c)return[3,30];if(!(null===_&&c.getForm().isSubForm()||null!==_&&(c.getForm().isSubForm()||_.getForm().isSubForm())))return[3,30];if(d=null,null!==_&&(d=_.getForm().getTask()),d===i)return[3,30];if(E=!0,I=void 0,f=void 0,null!==d)for(I=d.IsSubForm,f=d;null!==f&&I;f=f.getParent())E?E=!1:(I=f.IsSubForm,f.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!1),f.ActionManager.enable(r.InternalInterface.MG_ACT_DELLINE,!1),f.enableCreateActs(!1));I=i.IsSubForm,f=i.getParent(),h.label=25;case 25:return null!==f&&I?(I=f.IsSubForm,f.getEnableZoomHandler()&&f.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),[4,f.setCreateDeleteActsEnableState()]):[3,28];case 26:h.sent(),h.label=27;case 27:return f=f.getParent(),[3,25];case 28:return[4,i.enableModes()];case 29:h.sent(),h.label=30;case 30:return(i.getEnableZoomHandler()||c.useZoomHandler())&&i.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),(c.isTextControl()||c.isChoiceControl())&&c.SetKeyboardLanguage(!1),c.Type===r.MgControlType.CTRL_TYPE_BUTTON&&i.ActionManager.enable(r.InternalInterface.MG_ACT_BUTTON,!0),[4,i.setCreateDeleteActsEnableState()];case 31:return h.sent(),null!==(C=c.getField())&&C.NullAllowed&&c.isModifiable()&&c.Type!==r.MgControlType.CTRL_TYPE_BUTTON&&i.ActionManager.enable(r.InternalInterface.MG_ACT_RT_EDT_NULL,!0),[2,!0]}}))}))},s.prototype.commonHandlerBefore=function(e){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N;return h(this,(function(h){switch(h.label){case 0:if(s=e,i=e.getTask(),o=null,l=null,c=t.Int32.MinValue,this._stopExecution)return[2,!1];if(i.isAborting())return[2,!1];if(e.getType()===E.EVENT_TYPE_SYSTEM&&0!==(_=this.getMatchingAction(i,e.getKbdItm()))&&null!==e.Control&&((e=new w(e,e)).setInternal(_),e.setArgList(null),T=e.Control,s.setCtrl(T),null===T))return[2,!1];if(e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,83];switch(p=i.getForm(),g=e.getDisplayLine(),d=i.DataView,o=d.getCurrRec(),I=e.Control,f=e.getInternalCode(),C=G.getLastFocusedControl(),f){case r.InternalInterface.MG_ACT_ZOOM:return[3,1];case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:return[3,3];case r.InternalInterface.MG_ACT_CTRL_FOCUS:return[3,4];case r.InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL:return[3,6];case r.InternalInterface.MG_ACT_CTRL_KEYDOWN:return[3,8];case r.InternalInterface.MG_ACT_CTRL_MOUSEUP:return[3,10];case r.InternalInterface.MG_ACT_SELECTION:return[3,12];case r.InternalInterface.MG_ACT_TIMER:return[3,14];case r.InternalInterface.MG_ACT_RESIZE:return[3,16];case r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:return[3,17];case r.InternalInterface.MG_ACT_DV_TO_GUI:return[3,19];case r.InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER:return[3,21];case r.InternalInterface.MG_ACT_ENABLE_EVENTS:return[3,23];case r.InternalInterface.MG_ACT_DISABLE_EVENTS:return[3,24];case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,25];case r.InternalInterface.MG_ACT_TASK_SUFFIX:return[3,26];case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,27];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,63];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,75];case r.InternalInterface.MG_ACT_CANCEL:return[3,77];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,78]}return[3,83];case 1:return[4,this.selectProg(I)];case 2:if(h.sent())return[2,!1];h.label=3;case 3:return[3,83];case 4:return[4,this.handleFocus(I,g,e.isProduceClick())];case 5:return h.sent(),[2,!1];case 6:return[4,this.handleFocusOnNonMagicControl(I)];case 7:return h.sent(),[2,!1];case 8:return[4,this.handleKeyDown(i,I,e)];case 9:return h.sent(),[2,!1];case 10:return[4,this.handleMouseUp(I,g,e.isProduceClick())];case 11:return h.sent(),[2,!1];case 12:return[4,this.onActSelection(I,p,e)];case 13:return h.sent(),[2,!1];case 14:return[4,this.handleTimer(e)];case 15:return h.sent(),[2,!1];case 16:return this.handleResize(I,g),[2,!1];case 17:return[4,this.handleRowDataCurPage(I,g,e.isSendAll(),e.LastFocusedVal)];case 18:return h.sent(),[2,!1];case 19:return[4,this.handleTransferDataToGui(I)];case 20:return h.sent(),[2,!1];case 21:return[4,this.fetchRecordsAheadFromServer(I)];case 22:return h.sent(),[3,83];case 23:return this.handleEnableEvents(e,!0),[2,!1];case 24:return this.handleEnableEvents(e,!1),[2,!1];case 25:case 26:return i.setLevel(r.Constants.TASK_LEVEL_TASK),[3,83];case 27:if(i.IsSubForm&&i.getParent().InCommonHandlerBeforeRP)return[2,!1];if(i.setAfterRetry(E.RECOVERY_NONE),i.DataSynced=!1,!i.isStarted())return[2,!1];if(!(p.getRowsInPage()>t.Int32.MinValue&&g>t.Int32.MinValue))return[3,47];for(;!d.recExists(g)&&g>0;)g--;if(!(g>=0))return[3,46];l=d.getCurrRec(),A=i.getMode(),R=l.getId(),h.label=28;case 28:return h.trys.push([28,33,,45]),c=p.DisplayLine,p.PrevDisplayLine=c,[4,p.setCurrRowByDisplayLine(g,!0,!1)];case 29:return h.sent(),null==l||d.recExistsById(l.getId())?[3,32]:[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_TABLE)];case 30:return h.sent(),[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 31:h.sent(),h.label=32;case 32:return o=d.getCurrRec(),[3,45];case 33:return(S=h.sent())instanceof mt?this._stopExecution?A===r.Constants.TASK_MODE_CREATE&&c>0&&!d.recExistsById(R)?(M=p.getPrevLine(c),[4,p.restoreOldDisplayLine(M)]):[3,35]:[3,41]:[3,43];case 34:return h.sent(),[3,37];case 35:return[4,p.restoreOldDisplayLine(c)];case 36:h.sent(),h.label=37;case 37:return[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_FORM)];case 38:return h.sent(),this.setStopExecution(!1),C=i.getLastParkedCtrl(),i.getLastParkedCtrl(),null==C?[3,40]:[4,C.invoke()];case 39:h.sent(),h.label=40;case 40:return this.setStopExecution(!0),[2,!1];case 41:r.Logger.Instance.WriteDevToLog(S.StackTrace),h.label=42;case 42:return[3,44];case 43:throw S;case 44:return[3,45];case 45:return[3,47];case 46:throw new t.ApplicationException("in EventsManager.commonHandlerBefore(): invalid line number: "+g);case 47:if(null==o)throw new t.ApplicationException("in EventsManager.commonHandlerBefore(): no current record available !");return i.IsInteractive||i.getLevel()!==r.Constants.TASK_LEVEL_TASK||i.increaseCounter(),[4,i.evalEndCond(E.END_COND_EVAL_BEFORE)];case 48:return h.sent()?[4,i.endTask(!0,!1,!1)]:[3,50];case 49:return h.sent(),[2,!1];case 50:return p.HasTable()?[4,p.bringRecordToPage()]:[3,52];case 51:h.sent(),h.label=52;case 52:return i.getLevel()!==r.Constants.TASK_LEVEL_TASK?[2,!1]:[4,p.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 53:if(h.sent(),r.Logger.Instance.WriteDevToLog("RECORD PREFIX: "+i.queryTaskPath()),d.getCurrRec().setForceSaveOrg(!1),d.getCurrRec().Synced=!1,d.saveOriginal(),!i.IsSubForm||!i.PerformParentRecordPrefix)return[3,58];m=i.getParent(),h.label=54;case 54:return m.IsSubForm?m.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,56]:[4,this.handleInternalEventWithTask(m,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,58];case 55:return h.sent(),m=m.getParent(),this.GetStopExecutionFlag()?[3,58]:[3,57];case 56:return[3,58];case 57:return[3,54];case 58:return i.InCommonHandlerBeforeRP=!0,[4,i.CheckRefreshSubTasks()];case 59:return h.sent()?[4,d.computeSubForms()]:[3,61];case 60:h.sent(),h.label=61;case 61:return i.InCommonHandlerBeforeRP=!1,i.setLevel(r.Constants.TASK_LEVEL_RECORD),[4,i.enableRecordActions()];case 62:return h.sent(),[3,83];case 63:return v=!1,L=void 0,i.ConfirmUpdateNo=!1,null==o?[2,!1]:[4,i.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 64:return v=h.sent(),(o.Modified||v)&&o.getMode()===n.DataModificationTypes.Delete&&i.getMode()===r.Constants.TASK_MODE_DELETE?[2,!0]:i.getLevel()===r.Constants.TASK_LEVEL_TASK?[2,!1]:i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,66]:(i.setInRecordSuffix(!0),[4,this.handleInternalEventWithMgControlBase(i.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)]);case 65:if(h.sent(),i.setInRecordSuffix(!1),this._stopExecution)return[2,!1];h.label=66;case 66:return[4,i.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_SUFFIX)];case 67:return h.sent(),this._stopExecution?[2,!1]:(r.Logger.Instance.WriteDevToLog("RECORD SUFFIX: "+i.queryTaskPath()),i.setLevel(r.Constants.TASK_LEVEL_TASK),[4,i.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)]);case 68:return L=h.sent(),i.getMode()!==r.Constants.TASK_MODE_QUERY||v||o.Modified||L?o.Modified||v||L&&i.InSelect?[3,71]:o.getMode()!==n.DataModificationTypes.Delete?[3,70]:[4,this.executeControlVerification(i)]:[2,!1];case 69:return[2,h.sent()];case 70:return[2,!1];case 71:return i.getMode()!==r.Constants.TASK_MODE_DELETE&&o.Modified?[4,this.updateConfirmed(i)]:[3,73];case 72:if(!h.sent())return[2,!1];h.label=73;case 73:return[4,this.executeControlVerification(i)];case 74:return!h.sent()?[2,!1]:[3,83];case 75:return[4,this.handleCtrlPrefix(e)];case 76:return h.sent()?[2,!0]:(e.Control.InControl=!1,[2,!1]);case 77:return n.Manager.CleanMessagePane(i),[3,83];case 78:return null==I||null!=this.getStopExecutionCtrl()||i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[2,!1]:I.isSubform()?[3,82]:(u=n.Manager.GetCtrlVal(I),i.CurrentEditingControl=null,(b=!i.cancelWasRaised())?(N=I.Type!==r.MgControlType.CTRL_TYPE_BROWSER&&(!a.isNullOrUndefined(I._field)&&I._field.getType()===r.StorageAttribute.DATE||null!==u)&&void 0!==u)?[4,I.validateAndSetValue(u,!0)]:[3,80]:[3,81]);case 79:N=!h.sent(),h.label=80;case 80:b=N,h.label=81;case 81:if(b)return this.setStopExecution(!0),[2,!1];h.label=82;case 82:return this._stopExecution||n.Manager.CleanMessagePane(i),I.InControl=!1,I.ClipBoardDataExists=!1,I.ValidateControl=!0,I.setInControlSuffix(!0),[3,83];case 83:return[2,!0]}}))}))},s.prototype.selectProg=function(r){return T(this,void 0,void 0,(function(){var a,s,i,o,l,u,c;return h(this,(function(_){switch(_.label){case 0:return o=!1,l=r.getForm().getTask(),r.HasSelectProgram()?r.IsParkable()?(s=n.Manager.GetCtrlVal(r),r.validateAndSetValue(s,!1)?[3,1]:(this.setStopExecution(!0),[3,4])):[3,4]:[3,4];case 1:return u=null,[4,r.getMgValue(s)];case 2:return i=_.sent(),c=l.DataView.getCurrRec(),u=c.getXMLForValue(r.getField().getId(),i),a=Qe.CreateSelectProgramCommand(l.getTaskTag(),null,t.Int32.MinValue,r.getDitIdx(),u),l.getMGData().CmdsToServer.Add(a),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 3:_.sent(),o=!0,_.label=4;case 4:return[2,o]}}))}))},s.prototype.executeControlVerification=function(e){return T(this,void 0,void 0,(function(){var t,n,s,i,o;return h(this,(function(l){switch(l.label){case 0:t=e.getHandlersTab(),n=0,l.label=1;case 1:return n<t.getSize()?(s=t.getHandler(n),s.getEvent().getInternalCode()!==r.InternalInterface.MG_ACT_CTRL_VERIFICATION?[3,3]:(i=null!==e.getForm()?e.getForm().getCtrlByCtrlName(s.getCtrlName()):null,a.isNullOrUndefined(i)?[3,3]:((o=new w(i)).setInternal(r.InternalInterface.MG_ACT_CTRL_VERIFICATION),[4,this.handleEvent(o,!1)]))):[3,4];case 2:if(l.sent(),this._stopExecution)return G.setLastFocusedControl(e,i),this.setStopExecutionCtrl(null),this.setStopExecutionCtrl(i),[2,!1];l.label=3;case 3:return n++,[3,1];case 4:return[2,!0]}}))}))},s.prototype.onActSelection=function(e,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return(s=a.getDisplayLine())===t.Int32.MinValue&&(s=n.DisplayLine),e.Type===r.MgControlType.CTRL_TYPE_CHECKBOX||e.Type===r.MgControlType.CTRL_TYPE_LIST||e.Type===r.MgControlType.CTRL_TYPE_RADIO||e.Type===r.MgControlType.CTRL_TYPE_BUTTON||e.Type===r.MgControlType.CTRL_TYPE_TAB&&!a.isProduceClick()?[4,this.simulateSelection(e,a.getValue(),s,a.isProduceClick())]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this.handleSelection(e,s,a.getValue())];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},s.prototype.onSubformClose=function(e,t){return T(this,void 0,void 0,(function(){var n,a,s,i;return h(this,(function(o){switch(o.label){case 0:return null==t.getArgList()||1!==t.getArgList().getSize()?[3,5]:(n=null,[4,t.getArgList().getArgValue(0,r.StorageAttribute.ALPHA,0)]);case 1:if(null==(a=o.sent()))return[2];s=e,o.label=2;case 2:return null==s.getForm()||s.getMgdID()!==e.getMgdID()?[3,5]:null==(n=s.getForm().getCtrlByName(a.trim(),r.MgControlType.CTRL_TYPE_SUBFORM))||null==(i=n.getSubformTask())||i.IsRoute()?[3,4]:[4,this.performSubformClose(n)];case 3:return o.sent(),[3,5];case 4:return s=s.getParent(),[3,2];case 5:return[2]}}))}))},s.prototype.performSubformClose=function(t){return T(this,void 0,void 0,(function(){var r,a,s;return h(this,(function(i){switch(i.label){case 0:return r=t.getSubformTask(),a=t.getForm().getTask(),s=r.getMGData(),this.pushNewExecStacks(),[4,r.endTask(!0,!1,!1,!0)];case 1:return i.sent(),this.popNewExecStacks(),this._stopExecution?[3,4]:(a.TaskService.RemoveRecomputes(a,r),[4,r.stop()]);case 2:return i.sent(),t.resetSubformTask(),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 3:i.sent(),n.Commands.addClosesubform(n.CommandType.CLOSE_SUB_FORM,t,r.getTaskTag(),t.getName(),r.getForm().buildFormName()),t.IsModal()&&s.abort(),i.label=4;case 4:return[2]}}))}))},s.prototype.moveToLine=function(e,t,n){return T(this,void 0,void 0,(function(){var a;return h(this,(function(s){switch(s.label){case 0:return(a=new w(n,t)).setInternal(r.InternalInterface.MG_ACT_REC_PREFIX),[4,this.handleEvent(a,!1)];case 1:return s.sent(),null===n?[3,3]:[4,n.invoke()];case 2:s.sent(),s.label=3;case 3:return e.SelectRow(!0),[2]}}))}))},s.prototype.createEventArguments=function(e){null===e.getArgList()&&e.getType()===E.EVENT_TYPE_INTERNAL&&e.getInternalCode()},s.prototype.DoTaskLevelRecordSuffix=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return n=!1,e.getLevel()!==r.Constants.TASK_LEVEL_RECORD?[3,2]:(t.value=!1,[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)]);case 1:a.sent(),this.GetStopExecutionFlag()&&(n=!0),a.label=2;case 2:return[2,n]}}))}))},s.prototype.DoTaskLevelRecordPrefix=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.GetStopExecutionFlag()?[3,2]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},s.prototype.commonHandler=function(a){return T(this,void 0,void 0,(function(){var i,o,l,u,c,_,T,p,g,d,I,f,C,A,R,S,M,m,v,L,b,N,y,O,P,D,k,x,F,V,U,B,X,H;return h(this,(function(h){switch(h.label){case 0:if(i=a.getTask(),o=i.getMGData(),l=i.getForm(),u=a.Control,_=!0,p=br.CommandsProcessor,this._stopExecution)return[2];a.getType()===E.EVENT_TYPE_USER&&(a=new w(a.getUserEvent(),a)),h.label=1;case 1:if(h.trys.push([1,,181,182]),this.pushRtEvent(a),a.getType()===E.EVENT_TYPE_SYSTEM&&0!==(g=this.getMatchingAction(i,a.getKbdItm()))&&((a=new w(a,a)).setInternal(g),a.setArgList(null)),d=void 0,a.getType()!==E.EVENT_TYPE_INTERNAL||a.isImmediate()||!this.ActAllowed(a.getInternalCode())||this._processingTopMostEndTask)return[3,180];switch(I=o.CmdsToServer,f=i.DataView,C=f.getCurrRec(),A=a.getInternalCode(),A){case r.InternalInterface.MG_ACT_SUBFORM_CLOSE:return[3,2];case r.InternalInterface.MG_ACT_BUTTON:case r.InternalInterface.MG_ACT_CTRL_HIT:return[3,4];case r.InternalInterface.MG_ACT_TOGGLE_INSERT:return[3,9];case r.InternalInterface.MG_ACT_CLOSE:return[3,10];case r.InternalInterface.MG_ACT_EXIT:return[3,11];case r.InternalInterface.MG_ACT_EXIT_SYSTEM:return[3,13];case r.InternalInterface.MG_ACT_TBL_NXTLINE:return[3,15];case r.InternalInterface.MG_ACT_TBL_PRVLINE:return[3,18];case r.InternalInterface.MG_ACT_TBL_NXTPAGE:return[3,21];case r.InternalInterface.MG_ACT_TBL_PRVPAGE:return[3,24];case r.InternalInterface.MG_ACT_TBL_BEGPAGE:return[3,27];case r.InternalInterface.MG_ACT_TBL_ENDPAGE:return[3,30];case r.InternalInterface.MG_ACT_TBL_BEGTBL:return[3,33];case r.InternalInterface.MG_ACT_TBL_ENDTBL:return[3,36];case r.InternalInterface.MG_ACT_WEB_ON_DBLICK:return[3,39];case r.InternalInterface.MG_ACT_DELLINE:return[3,40];case r.InternalInterface.MG_ACT_CRELINE:case r.InternalInterface.MG_ACT_CRELINE_ABOVE:return[3,42];case r.InternalInterface.MG_ACT_CANCEL:return[3,62];case r.InternalInterface.MG_ACT_ENTER_ROW_EDITING:return[3,64];case r.InternalInterface.MG_ACT_RT_QUIT:return[3,66];case r.InternalInterface.MG_ACT_RTO_CREATE:return[3,68];case r.InternalInterface.MG_ACT_RTO_QUERY:return[3,73];case r.InternalInterface.MG_ACT_RTO_MODIFY:return[3,91];case r.InternalInterface.MG_ACT_SELECT:return[3,108];case r.InternalInterface.MG_ACT_SUBFORM_REFRESH:return[3,114];case r.InternalInterface.MG_ACT_SUBFORM_OPEN:return[3,131];case r.InternalInterface.MG_ACT_RTO_SEARCH:return[3,133];case r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN:case r.InternalInterface.MG_ACT_RT_REFRESH_VIEW:case r.InternalInterface.MG_ACT_RT_REFRESH_RECORD:return[3,141];case r.InternalInterface.MG_ACT_ACT_CLOSE_APPL:return[3,143];case r.InternalInterface.MG_ACT_CONTEXT_REMOVE:return[3,145];case r.InternalInterface.MG_ACT_SERVER_TERMINATION:return[3,150];case r.InternalInterface.MG_ACT_RT_EDT_NULL:return[3,152];case r.InternalInterface.MG_ACT_ROLLBACK:return[3,156];case r.InternalInterface.MG_ACT_OK:case r.InternalInterface.MG_ACT_INDEX_CHANGE:case r.InternalInterface.MG_ACT_COL_SORT:return[3,158];case r.InternalInterface.MG_ACT_COL_CLICK:return[3,179]}return[3,180];case 2:return[4,this.onSubformClose(i,a)];case 3:return h.sent(),[3,180];case 4:return u.Type!==r.MgControlType.CTRL_TYPE_BUTTON||A!==r.InternalInterface.MG_ACT_BUTTON&&a.isGuiTriggeredEvent()&&!u.isParkable(!0)?[3,7]:(H=new w(u),null!=u.getRtEvtTask()&&H.setTask(u.getRtEvtTask()),E.EVENT_TYPE_NONE===H.getType()?[3,6]:(u.useZoomHandler()&&null!=(R=H.getTask())&&R.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!0),H.setArgList(u.ArgList),[4,H.setPublicName()]));case 5:h.sent(),this.addToTail(H),this.checkAndSaveRouteEventIfCtxRemovedFromSrvr(H),h.label=6;case 6:return[3,8];case 7:u.Type===r.MgControlType.CTRL_TYPE_TAB?this.addInternalEventWithCtrlAndCode(u,r.InternalInterface.MG_ACT_ZOOM):u.Type===r.MgControlType.CTRL_TYPE_RADIO&&u.setControlToFocus(),h.label=8;case 8:return[3,180];case 9:return n.RuntimeContextBase.Instance.ToggleInsertMode(),[3,180];case 10:return(S=new w(a,a)).setInternal(r.InternalInterface.MG_ACT_EXIT),this.addToTail(S),[3,180];case 11:return[4,(i.isMainProg()?oe.Instance.StartupMgData.getFirstTask():i).endTask(a.reversibleExit(),!1,a.ExitDueToError())];case 12:return h.sent(),[3,180];case 13:return[4,oe.Instance.StartupMgData.getFirstTask().endTask(a.reversibleExit(),!1,!1)];case 14:return h.sent(),[3,180];case 15:return null==l?[3,17]:[4,l.moveInView(r.Constants.MOVE_UNIT_ROW,r.Constants.MOVE_DIRECTION_NEXT)];case 16:h.sent(),h.label=17;case 17:return[3,180];case 18:return null==l?[3,20]:[4,l.moveInView(r.Constants.MOVE_UNIT_ROW,r.Constants.MOVE_DIRECTION_PREV)];case 19:h.sent(),h.label=20;case 20:return[3,180];case 21:return null==l?[3,23]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_NEXT)];case 22:h.sent(),h.label=23;case 23:return[3,180];case 24:return null==l?[3,26]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_PREV)];case 25:h.sent(),h.label=26;case 26:return[3,180];case 27:return null==l?[3,29]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_BEGIN)];case 28:h.sent(),h.label=29;case 29:return[3,180];case 30:return null==l?[3,32]:[4,l.moveInView(r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_END)];case 31:h.sent(),h.label=32;case 32:return[3,180];case 33:return null!=(c=i.getLastParkedCtrl())&&c.isListBox()||null==l?[3,35]:[4,l.moveInView(r.Constants.MOVE_UNIT_TABLE,r.Constants.MOVE_DIRECTION_BEGIN)];case 34:h.sent(),h.label=35;case 35:return[3,180];case 36:return null!==(c=i.getLastParkedCtrl())&&c.isListBox()||null==l?[3,38]:[4,l.moveInView(r.Constants.MOVE_UNIT_TABLE,r.Constants.MOVE_DIRECTION_END)];case 37:h.sent(),h.label=38;case 38:return[3,180];case 39:return M=u.Type,m=r.InternalInterface.MG_ACT_NONE,M!==r.MgControlType.CTRL_TYPE_TABLE&&M!==r.MgControlType.CTRL_TYPE_LABEL&&M!==r.MgControlType.CTRL_TYPE_IMAGE&&(u.getForm().getTask().ActionManager.isEnabled(r.InternalInterface.MG_ACT_SELECT)?m=r.InternalInterface.MG_ACT_SELECT:u.getForm().getTask().ActionManager.isEnabled(r.InternalInterface.MG_ACT_ZOOM)&&(m=r.InternalInterface.MG_ACT_ZOOM),m!==r.InternalInterface.MG_ACT_NONE&&this.addInternalEventWithCtrlAndCode(u,m)),[3,180];case 40:return[4,this.HandleActionDelline(a,i,f,C,!1)];case 41:return h.sent()?[2]:[3,180];case 42:return i.DataView.isEmptyDataview()?[4,this.gotoCreateMode(i,I)]:[3,44];case 43:return h.sent(),[3,180];case 44:if(i.getInCreateLine())return[3,180];i.setInCreateLine(!0),h.label=45;case 45:return h.trys.push([45,,60,61]),i.getLevel()!==r.Constants.TASK_LEVEL_CONTROL?[3,47]:[4,this.handleInternalEventWithMgControlBase(i.getLastParkedCtrl(),r.InternalInterface.MG_ACT_CTRL_SUFFIX)];case 46:if(h.sent(),this.GetStopExecutionFlag())return[2];h.label=47;case 47:return i.getMode()!==r.Constants.TASK_MODE_CREATE||null==C||C.Modified?[3,54]:[4,i.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 48:return h.sent()?(_=!1,[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,50];case 49:return h.sent(),this.GetStopExecutionFlag()||i.isAborting()?[2]:[3,54];case 50:return i.setLevel(r.Constants.TASK_LEVEL_TASK),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 51:return h.sent(),this.GetStopExecutionFlag()||null==l?[3,53]:null===(v=i.getLastParkedCtrl())?[3,53]:[4,v.invoke()];case 52:h.sent(),h.label=53;case 53:return[2];case 54:return L=new t.RefParam(_),[4,this.DoTaskLevelRecordSuffix(i,L)];case 55:return h.sent()?[2]:(_=L.value,null==l?[3,57]:(0,0,i.getMode()===r.Constants.TASK_MODE_CREATE&&i.ConfirmUpdateNo?[3,57]:[4,l.addRec(_,0,0,A==r.InternalInterface.MG_ACT_CRELINE_ABOVE)]));case 56:h.sent(),h.label=57;case 57:return[4,this.DoTaskLevelRecordPrefix(i,l)];case 58:return h.sent(),[4,this.HandleActEnterRowEditing(i)];case 59:return h.sent(),[3,61];case 60:return i.setInCreateLine(!1),[7];case 61:return[3,180];case 62:return[4,this.HandleActCancel(a,i,l,u,C,!0)];case 63:return h.sent(),[3,180];case 64:return[4,this.HandleActEnterRowEditing(i)];case 65:return h.sent(),[3,180];case 66:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_QUIT)];case 67:return h.sent(),[3,180];case 68:return(b=i.getMode()===r.Constants.TASK_MODE_CREATE)?[3,70]:[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()];case 69:b=h.sent(),h.label=70;case 70:return b?[4,this.gotoCreateMode(i,I)]:[3,72];case 71:h.sent(),h.label=72;case 72:return[3,180];case 73:return(N=i.getMode()!==r.Constants.TASK_MODE_QUERY)?[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,75];case 74:N=!1===h.sent(),h.label=75;case 75:return N?[3,180]:[4,i.enableModes()];case 76:return h.sent(),T=i.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 77:return h.sent(),this.GetStopExecutionFlag()?[3,90]:(i.setMode(r.Constants.TASK_MODE_QUERY),T===r.Constants.TASK_MODE_CREATE?[3,83]:[4,f.currRecCompute(!0)]);case 78:return h.sent(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 79:return h.sent(),null==u?[3,81]:[4,u.invoke()];case 80:h.sent(),h.label=81;case 81:return[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 82:return h.sent(),[3,88];case 83:return i.setPreventRecordSuffix(!0),i.setPreventControlChange(!0),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)];case 84:return h.sent(),null==u?[3,86]:[4,u.invoke()];case 85:h.sent(),h.label=86;case 86:return i.setPreventRecordSuffix(!1),i.setPreventControlChange(!1),f.isEmpty()||f.getCurrRec().getMode()===n.DataModificationTypes.Insert?i.setMode(r.Constants.TASK_MODE_CREATE):i.setMode(r.Constants.TASK_MODE_QUERY),[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 87:h.sent(),h.label=88;case 88:return i.setOriginalTaskMode(r.Constants.TASK_MODE_QUERY),[4,i.setCreateDeleteActsEnableState()];case 89:h.sent(),h.label=90;case 90:return[3,180];case 91:return(y=i.getMode()!==r.Constants.TASK_MODE_MODIFY)?[4,i.getProp(n.PropInterface.PROP_TYPE_ALLOW_OPTION).getValueBoolean()]:[3,93];case 92:y=!1===h.sent(),h.label=93;case 93:return y?[3,180]:[4,i.enableModes()];case 94:return h.sent(),T=i.getOriginalTaskMode(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 95:return h.sent(),this.GetStopExecutionFlag()?[3,107]:(i.setMode(r.Constants.TASK_MODE_MODIFY),T===r.Constants.TASK_MODE_CREATE?[3,100]:[4,f.currRecCompute(!0)]);case 96:return h.sent(),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 97:return h.sent(),null==u?[3,99]:[4,u.invoke()];case 98:h.sent(),h.label=99;case 99:return[3,105];case 100:return i.setPreventRecordSuffix(!0),i.setPreventControlChange(!0),[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_RT_REFRESH_VIEW)];case 101:return h.sent(),null==u?[3,103]:[4,u.invoke()];case 102:h.sent(),h.label=103;case 103:return i.setPreventRecordSuffix(!1),i.setPreventControlChange(!1),f.isEmpty()||f.getCurrRec().getMode()===n.DataModificationTypes.Insert?i.setMode(r.Constants.TASK_MODE_CREATE):i.setMode(r.Constants.TASK_MODE_MODIFY),[4,l.RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 104:h.sent(),h.label=105;case 105:return i.setOriginalTaskMode(r.Constants.TASK_MODE_MODIFY),[4,i.setCreateDeleteActsEnableState()];case 106:h.sent(),h.label=107;case 107:return[3,180];case 108:return h.trys.push([108,,110,111]),i.InSelect=!0,[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 109:return h.sent(),[3,111];case 110:return i.InSelect=!1,[7];case 111:return this._stopExecution?[3,113]:[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_EXIT)];case 112:h.sent(),h.label=113;case 113:return[3,180];case 114:return null==a.getArgList()||1!==a.getArgList().getSize()?[3,125]:(O=null,[4,a.getArgList().getArgValue(0,r.StorageAttribute.ALPHA,0)]);case 115:if(null==(P=h.sent()))return[3,180];k=i,h.label=116;case 116:return null==k.getForm()||k.getMgdID()!==i.getMgdID()?[3,124]:null==(O=k.getForm().getCtrlByName(P.trim(),r.MgControlType.CTRL_TYPE_SUBFORM))?[3,123]:null!=(D=O.getSubformTask())?[3,120]:[4,O.getProp(n.PropInterface.PROP_TYPE_SUBFORM_TYPE).getValueInt()];case 117:return h.sent()===r.SubformType.None?[3,119]:[4,this.OpenSubform(k,O)];case 118:h.sent(),h.label=119;case 119:return[3,122];case 120:return[4,k.SubformRefresh(D,!0)];case 121:h.sent(),h.label=122;case 122:return[3,124];case 123:return k=k.getParent(),[3,116];case 124:return[3,130];case 125:return null==a.getArgList()||2!==a.getArgList().getSize()?[3,130]:(D=i,k=void 0,[4,a.getArgList().getArgValue(1,r.StorageAttribute.NUMERIC,0)]);case 126:x=h.sent(),h.label=127;case 127:return D.IsSubForm?(k=D.getParent(),D.getTaskTag()!==x?[3,129]:[4,k.SubformRefresh(D,!0)]):[3,130];case 128:return h.sent(),[3,130];case 129:return D=k,[3,127];case 130:return[3,180];case 131:return[4,this.OpenSubform(i,a.Control)];case 132:return h.sent(),[3,180];case 133:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 134:return h.sent(),this.GetStopExecutionFlag()?[3,140]:(d=Qe.CreateEventCommand(i.getTaskTag(),A),i.getTaskCache().clearCache(),[4,i.DataviewManager.Execute(d)]);case 135:return h.sent(),l.isScreenMode()?[3,137]:(f.setTopRecIdx(0),l.HasTable()?[4,l.restoreOldDisplayLine(l.recordIdx2DisplayLine(f.getCurrRecIdx()))]:[3,137]);case 136:h.sent(),h.label=137;case 137:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 138:return h.sent(),null==u?[3,140]:[4,u.invoke()];case 139:h.sent(),h.label=140;case 140:return[3,180];case 141:return[4,this.handleRefreshEvents(a)];case 142:return h.sent(),[3,180];case 143:return d=Qe.CreateEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag(),r.InternalInterface.MG_ACT_BROWSER_ESC),I.Add(d),[4,p.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 144:return h.sent(),[3,180];case 145:return F=G.Instance.getLastFocusedTask().DataView.getCurrRec(),en.TransCacheExists()||null!=F&&F.Modified?(console.log("Pending transaction/record is modified, discarded 'Context Remove' event."),[3,149]):[3,146];case 146:return et.Instance.getClientContextInactivityTimeout()>0?[4,this.ExecuteClientContextInactivityTimer()]:[3,148];case 147:h.sent(),h.label=148;case 148:if(s.clientContextInactivityTimerAborted)return console.log("Discarded 'Context Remove' event as user event occurred."),s.clientContextInactivityTimerAborted=!1,[3,180];V=Qe.CreateContextTerminationEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag()),oe.Instance.getCurrMGData().CmdsToServer.Add(V),le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS),console.log("Removed context from server"),n.RuntimeContextBase.Instance.RemovingContextFromServer=!0,h.label=149;case 149:return[3,180];case 150:return d=Qe.CreateEventCommand(i.getTaskTag(),A),I.Add(d),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 151:return h.sent(),[3,180];case 152:return null!=this._currField&&this._currField.NullAllowed?[4,this._currField.setValueAndStartRecompute(this._currField.getMagicDefaultValue(),!0,!0,!0,!1)]:[3,155];case 153:return h.sent(),[4,this._currField.updateDisplay()];case 154:h.sent(),h.label=155;case 155:return[3,180];case 156:return[4,s.HandleRollbackAction(i,I,e.RollbackEventCommand_RollbackType.ROLLBACK)];case 157:return h.sent(),[3,180];case 158:return A===r.InternalInterface.MG_ACT_INDEX_CHANGE&&i.DataviewManager.HasRemoteData||A===r.InternalInterface.MG_ACT_COL_SORT&&null!=u.getField()?(U=G.Instance.getLastFocusedTask(),null==(B=G.getLastFocusedControl(G.LastFocusMgdID))?[3,160]:[4,this.handleInternalEventWithMgControlBase(B,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]):[3,178];case 159:h.sent(),h.label=160;case 160:return this.GetStopExecutionFlag()?[3,162]:[4,i.ExecuteNestedRS(U)];case 161:h.sent(),h.label=162;case 162:return this.GetStopExecutionFlag()||i.getLevel()===r.Constants.TASK_LEVEL_TASK?[3,164]:[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 163:h.sent(),h.label=164;case 164:return this.GetStopExecutionFlag()?[3,178]:(i.getTaskCache().clearCache(),A!==r.InternalInterface.MG_ACT_INDEX_CHANGE?[3,166]:(i.getForm().HasTable()&&l.clearTableColumnSortMark(!0),[4,Qe.CreateIndexChangeCommand(i.getTaskTag(),i.DataView.GetCurrentRecId(),a.getArgList())]));case 165:return d=h.sent(),[3,167];case 166:d=Qe.CreateColumnSortCommand(i.getTaskTag(),a.Direction,u.getDitIdx(),u.getField().getId(),i.DataView.GetCurrentRecId()),h.label=167;case 167:return[4,i.DataviewManager.Execute(d)];case 168:return h.sent(),f.setTopRecIdx(0),[4,l.restoreOldDisplayLine(0)];case 169:return h.sent(),this._isSorting=!0,i!==G.Instance.getLastFocusedTask()&&i.pathContains(G.Instance.getLastFocusedTask())?[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)]:[3,175];case 170:return h.sent(),this.GetStopExecutionFlag()||i.getPreventControlChange()?[3,172]:[4,U.ExecuteNestedRS(i)];case 171:h.sent(),h.label=172;case 172:return this.GetStopExecutionFlag()||null==B?[3,174]:[4,B.invoke()];case 173:h.sent(),h.label=174;case 174:return[3,177];case 175:return[4,this.handleInternalEventWithTask(i,r.InternalInterface.MG_ACT_REC_PREFIX)];case 176:h.sent(),h.label=177;case 177:this._isSorting=!1,h.label=178;case 178:return[3,180];case 179:return!this.GetStopExecutionFlag()&&a.isGuiTriggeredEvent()&&u.isColumnSortable()&&null!=(X=u.getColumnChildControl())&&((H=new w(X,a.Direction,0)).setInternal(r.InternalInterface.MG_ACT_COL_SORT),this.addToTail(H)),[3,180];case 180:return[3,182];case 181:return this.popRtEvent(),[7];case 182:return[2]}}))}))},s.prototype.HandleActEnterRowEditing=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return e.getMode()!==r.Constants.TASK_MODE_QUERY?[3,1]:(e.WriteToMessagePane("Cannot enter Row Editing when in Query Mode.",!1),[3,3]);case 1:return[4,(t=e.getForm()).startRowEditing(t.DisplayLine)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},s.prototype.HandleStopRowEditing=function(e){return T(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,(t=e.getForm()).stopRowEditing(t.DisplayLine)];case 1:return r.sent(),[2]}}))}))},s.prototype.OpenSubform=function(t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:return t.TaskService.RemoveRecomputes(t,null),n=Qe.CreateSubformOpenCommand(t.getTaskTag(),r.getDitIdx()),t.getMGData().CmdsToServer.Add(n),[4,br.CommandsProcessor.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return a.sent(),[2]}}))}))},s.HandleRollbackAction=function(t,r,n){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=br.CommandsProcessor,Dr.ClientIsInRollbackCommand=!0,t=t.TaskService.GetOwnerTransactionTask(t),s=Qe.CreateRollbackEventCommand(t.getTaskTag(),n),r.Add(s),[4,a.Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 1:return i.sent(),Dr.ClientIsInRollbackCommand=!1,[2]}}))}))},s.prototype.HandleActCancel=function(t,a,i,o,l,u){return T(this,void 0,void 0,(function(){var c,_,T,p,g;return h(this,(function(h){switch(h.label){case 0:return a.InHandleActCancel?[2]:(a.InHandleActCancel=!0,c=a.getMode(),_=a.getForm().DisplayLine,c===r.Constants.TASK_MODE_QUERY||l.Updated?[3,10]:u&&(l.Modified||null!==a.getLastParkedCtrl()&&a.getLastParkedCtrl().ModifiedByUser)?[4,a.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_CANCEL,!1)]:[3,3]);case 1:return h.sent()?[4,ge.Instance.confirm_bool(r.MsgInterface.CONFIRM_STR_CANCEL)]:[3,3];case 2:if(!h.sent())return a.InHandleActCancel=!1,[2];h.label=3;case 3:return T=l.getMode(),n.GuiEnvironment.Environment.GetSpecialCancelOnCreate()&&a.getMode()==r.Constants.TASK_MODE_CREATE&&a.getOriginalTaskMode()==r.Constants.TASK_MODE_CREATE?[4,a.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)]:[3,6];case 4:return h.sent()?[4,a.checkProp(n.PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW,!0)]:[3,6];case 5:p=h.sent(),1==a.DataView.getSize()&&p&&(a.setMode("M"),a.DataView.setEmptyDataview(!0)),h.label=6;case 6:return u&&(a.isTransactionOnLevel(E.TRANS_RECORD_PREFIX)&&t.RollbackInCancel())?[4,s.HandleRollbackAction(a,a.getMGData().CmdsToServer,e.RollbackEventCommand_RollbackType.CANCEL)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[4,s.HandleCancelEdit(t,a,i,l,T)];case 9:return h.sent(),[3,13];case 10:return a.setLevel(r.Constants.TASK_LEVEL_TASK),null!==(g=G.getLastFocusedControl())&&g.getForm().getTask().setLevel(r.Constants.TASK_LEVEL_TASK),t.isQuit()?[3,13]:[4,this.handleInternalEventWithTask(a,r.InternalInterface.MG_ACT_REC_PREFIX)];case 11:return h.sent(),[4,this.HandleParkabilityOnRowChange(a)];case 12:h.sent(),h.label=13;case 13:return t.isQuit()?[4,this.handleInternalEventWithMgControlBase(o,r.InternalInterface.MG_ACT_EXIT)]:[3,15];case 14:h.sent(),h.label=15;case 15:return[4,i.stopRowEditing(_)];case 16:return h.sent(),a.InHandleActCancel=!1,[2]}}))}))},s.HandleCancelEdit=function(e,t,r,a,s){return T(this,void 0,void 0,(function(){return h(this,(function(i){switch(i.label){case 0:return a.Synced&&s===n.DataModificationTypes.Insert&&a.setMode(s),null===r?[3,2]:(null!==t.getLastParkedCtrl()&&t.getLastParkedCtrl().resetPrevVal(),[4,r.cancelEdit(!0,e.isQuit())]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},s.prototype.HandleActionDelline=function(e,t,a,s,i){return T(this,void 0,void 0,(function(){var e,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return o=t.getForm(),l=o.getIsRowEditingFromGui(o.DisplayLine),[4,t.checkProp(n.PropInterface.PROP_TYPE_ALLOW_DELETE,!0)];case 1:return h.sent()?null===(e=t.getLastParkedCtrl())?[3,3]:[4,this.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_SUFFIX)]:[3,32];case 2:h.sent(),h.label=3;case 3:return this.GetStopExecutionFlag()?[3,32]:(u=s.getMode(),s.clearMode(),s.setMode(n.DataModificationTypes.Delete),u===n.DataModificationTypes.Insert&&s.setSendToServer(!1),(c=s.Modified)?[3,5]:[4,t.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 4:c=h.sent(),h.label=5;case 5:return c?(t.setMode(r.Constants.TASK_MODE_MODIFY),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]):[3,10];case 6:return h.sent(),this._stopExecution?s.SendToServer?[3,8]:[4,a.addCurrToModified()]:[3,10];case 7:h.sent(),s.setSendToServer(!0),h.label=8;case 8:return s.clearMode(),s.setMode(u),this.setStopExecution(!1),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 9:return h.sent(),this.setStopExecution(!0),[2,!0];case 10:return s.setInDeleteProcess(!0),t.setMode(r.Constants.TASK_MODE_DELETE),i?[3,18]:(_=t.mustConfirmInDeleteMode())?[3,12]:[4,t.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE,!1)];case 11:_=h.sent(),h.label=12;case 12:return _?[4,ge.Instance.confirm_bool(r.MsgInterface.CONFIRM_STR_DELETE)]:[3,18];case 13:return h.sent()?[3,18]:(s.clearMode(),s.setMode(u),t.setMode(r.Constants.TASK_MODE_MODIFY),null===e?[3,15]:[4,this.handleInternalEventWithMgControlBase(e,r.InternalInterface.MG_ACT_CTRL_PREFIX)]);case 14:h.sent(),h.label=15;case 15:return l?[4,(T=t.getForm()).startRowEditing(T.DisplayLine)]:[3,17];case 16:h.sent(),h.label=17;case 17:return[2,!0];case 18:return[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 19:return h.sent(),s.setInDeleteProcess(!1),this._stopExecution?s.SendToServer?[3,21]:[4,a.addCurrToModified()]:[3,23];case 20:h.sent(),s.setSendToServer(!0),h.label=21;case 21:return s.clearMode(),s.setMode(u),this.setStopExecution(!1),t.setMode(r.Constants.TASK_MODE_MODIFY),[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 22:return h.sent(),this.setStopExecution(!0),[2,!0];case 23:u===n.DataModificationTypes.Insert&&(s.clearMode(),s.setMode(u)),p=a.getCurrRec(),h.label=24;case 24:return h.trys.push([24,,29,32]),s===p?[3,26]:[4,a.setCurrRec(s.getId(),!1)];case 25:h.sent(),h.label=26;case 26:return t.isAborting()?[3,28]:[4,this.delCurrRec(t,!1)];case 27:h.sent(),h.label=28;case 28:return[3,32];case 29:return s===p?[3,31]:[4,a.setCurrRec(p.getId(),!1)];case 30:h.sent(),1===a.getSize()&&t.setMode(r.Constants.TASK_MODE_CREATE),h.label=31;case 31:return i&&t.setMode(r.Constants.TASK_MODE_DELETE),[7];case 32:return[2,!1]}}))}))},s.prototype.handleRefreshEvents=function(e){return T(this,void 0,void 0,(function(){var t,s,i,o,l,u,c,_,T,p;return h(this,(function(h){switch(h.label){case 0:return t=e.getTask(),s=t.getForm(),i=t.DataView,o=e.getInternalCode(),l=null,o===r.InternalInterface.MG_ACT_RT_REFRESH_RECORD&&(this._isInRecordFlushEvent=!0),(u=o===r.InternalInterface.MG_ACT_RT_REFRESH_VIEW&&t.getMode()===r.Constants.TASK_MODE_CREATE)?[4,t.checkProp(n.PropInterface.PROP_TYPE_ALLOW_MODIFY,!0)]:[3,2];case 1:u=!h.sent(),h.label=2;case 2:return u?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_EXIT)]:[3,4];case 3:return h.sent(),[3,25];case 4:return[4,t.ExecuteNestedRS(G.Instance.getLastFocusedTask())];case 5:return h.sent(),this.GetStopExecutionFlag()?[3,7]:[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 6:h.sent(),h.label=7;case 7:return this.GetStopExecutionFlag()||t.InEndTask||t.isAborting()?[3,25]:o===r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN?[3,13]:(c=0,e.getRefreshType()?[3,8]:(e.RtViewRefreshUseCurrentRow()&&t.IsInteractive&&(c=s.getCurrRecPosInForm()),l=Qe.CreateInternalRefreshCommand(t.getTaskTag(),o,i.CurrentRecId,c),[3,12]));case 8:return t.IsInteractive&&(c=s.getCurrRecPosInForm()),_=!0,o!==r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||null===e.getArgList()||0===e.getArgList().getSize()?[3,10]:(T=void 0,[4,e.getArgList().getArgValue(0,r.StorageAttribute.BOOLEAN,0)]);case 9:T=h.sent(),_=a.isNullOrUndefined(T)||"1"===T,h.label=10;case 10:return _?[4,Qe.CreateRealRefreshCommand(t.getTaskTag(),o,c,e.getArgList(),i.CurrentRecId)]:[3,12];case 11:l=h.sent(),h.label=12;case 12:return[3,14];case 13:p=void 0,p=null===t.getForm()?0:t.getForm().isScreenMode()?t.DataView.getCurrRec().getId():t.DataView.getRecByIdx(t.DataView.getTopRecIdx()).getId(),l=Qe.CreateScreenRefreshCommand(t.getTaskTag(),p,i.CurrentRecId),h.label=14;case 14:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN&&t.getTaskCache().clearCache(),null===l?[3,16]:[4,t.DataviewManager.Execute(l)];case 15:h.sent(),h.label=16;case 16:return this._isInRecordFlushEvent=!1,this.GetStopExecutionFlag()||t.InEndTask||t.isAborting()?[3,25]:o!==r.InternalInterface.MG_ACT_RT_REFRESH_VIEW||s.isScreenMode()?[3,18]:(i.setTopRecIdx(0),s.HasTable()?(s.clearTableColumnSortMark(!0),[4,s.restoreOldDisplayLine(s.recordIdx2DisplayLine(i.getCurrRecIdx()))]):[3,18]);case 17:h.sent(),h.label=18;case 18:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_RECORD||t.getMode()===r.Constants.TASK_MODE_QUERY||t.getAfterRetry()?[3,20]:(t.getMode()===r.Constants.TASK_MODE_CREATE&&(t.setMode(r.Constants.TASK_MODE_MODIFY),t.DataView.getCurrRec().setOldRec()),[4,i.currRecCompute(!0)]);case 19:return h.sent(),[3,22];case 20:return o!==r.InternalInterface.MG_ACT_RT_REFRESH_SCREEN||t.getMode()===r.Constants.TASK_MODE_QUERY||t.getAfterRetry()?[3,22]:[4,i.currRecCompute(!0)];case 21:h.sent(),h.label=22;case 22:return[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_PREFIX)];case 23:return h.sent(),this.GetStopExecutionFlag()||t.getPreventControlChange()?[3,25]:t!==G.Instance.getLastFocusedTask()&&t.pathContains(G.Instance.getLastFocusedTask())?[4,this.handleInternalEventWithTask(t,r.InternalInterface.MG_ACT_REC_SUFFIX)]:[3,25];case 24:h.sent(),h.label=25;case 25:return[2]}}))}))},s.prototype.gotoCreateMode=function(e,t){return T(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return[4,e.enableModes()];case 1:return n.sent(),[4,e.ExecuteNestedRS(G.Instance.getLastFocusedTask())];case 2:return n.sent(),this.GetStopExecutionFlag()?[3,4]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_SUFFIX)];case 3:n.sent(),n.label=4;case 4:return this.GetStopExecutionFlag()?[3,11]:(t=Qe.CreateEventCommand(e.getTaskTag(),r.InternalInterface.MG_ACT_RTO_CREATE),[4,e.DataviewManager.Execute(t)]);case 5:return n.sent(),e.getLevel()!==r.Constants.TASK_LEVEL_TASK?[3,7]:[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 6:n.sent(),n.label=7;case 7:return[4,this.HandleNonParkableControls(e)];case 8:return n.sent(),[4,e.setCreateDeleteActsEnableState()];case 9:return n.sent(),e.setOriginalTaskMode(r.Constants.TASK_MODE_CREATE),[4,this.HandleActEnterRowEditing(e)];case 10:n.sent(),n.label=11;case 11:return[2]}}))}))},s.prototype.commonHandlerAfter=function(e,t,a){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_,T,p,g,d,I;return h(this,(function(h){switch(h.label){case 0:if(a=e.getTask(),o=null,u=!1,c=!1,this._stopExecution&&e.getInternalCode()!==r.InternalInterface.MG_ACT_REC_SUFFIX&&e.getInternalCode()!==r.InternalInterface.MG_ACT_CTRL_SUFFIX)return[2];if(e.getType()!==E.EVENT_TYPE_INTERNAL)return[3,56];switch(i=a.DataView,o=i.getCurrRec(),l=e.Control,e.getInternalCode()){case r.InternalInterface.MG_ACT_REC_PREFIX:return[3,1];case r.InternalInterface.MG_ACT_REC_SUFFIX:return[3,8];case r.InternalInterface.MG_ACT_CTRL_PREFIX:return[3,25];case r.InternalInterface.MG_ACT_CTRL_SUFFIX:return[3,33];case r.InternalInterface.MG_ACT_TASK_PREFIX:return[3,41];case r.InternalInterface.MG_ACT_TASK_SUFFIX:return[3,42];case r.InternalInterface.MG_ACT_CYCLE_NEXT_REC:return[3,43];case r.InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC:return[3,47];case r.InternalInterface.MG_ACT_SET_EXTERNAL_VALUE:return[3,53]}return[3,56];case 1:return t?[4,a.CheckRefreshSubTasks()]:[3,7];case 2:return h.sent()?[4,a.doSubformRecPrefixSuffix()]:[3,4];case 3:h.sent(),h.label=4;case 4:return[4,a.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:return h.sent(),[4,a.enableModes()];case 6:h.sent(),h.label=7;case 7:return[3,56];case 8:return a.isFirstRecordCycle(!1),a.getPreventRecordSuffix()?(a.setPreventRecordSuffix(!1),[2]):(a.DoSubformPrefixSuffix=!1,this._stopExecution?(o.getMode()===n.DataModificationTypes.Delete&&o.clearMode(),a.getLevel()===r.Constants.TASK_LEVEL_CONTROL?[3,11]:(null===(T=this.getStopExecutionCtrl())&&(T=a.getLastParkedCtrl()),this.setStopExecution(!1),this.setStopExecutionCtrl(null),null==T?[3,10]:(a.setLevel(r.Constants.TASK_LEVEL_RECORD),p=a.InCtrlPrefix,a.InCtrlPrefix=!1,[4,this.handleInternalEventWithMgControlBase(T,r.InternalInterface.MG_ACT_CTRL_PREFIX)]))):[3,12]);case 9:h.sent(),a.InCtrlPrefix=p,h.label=10;case 10:this.setStopExecution(!0),h.label=11;case 11:return[2];case 12:return[4,this.HandleStopRowEditing(a)];case 13:h.sent(),h.label=14;case 14:return null==o?[3,24]:(u=o.Modified,!this._stopExecution&&o.isCauseInvalidation()&&(a.getForm().invalidateTable(),o.setCauseInvalidation(!1)),c=o.getMode()===n.DataModificationTypes.Delete,[4,a.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)]);case 15:return _=h.sent(),c&&a.getMode()===r.Constants.TASK_MODE_DELETE||!c&&!o.inDeleteProcess()&&(u||_)?(o.setMode(n.DataModificationTypes.Update),[4,i.addCurrToModified()]):[3,19];case 16:return h.sent(),i.setChanged(!0),u&&a.getMode()===r.Constants.TASK_MODE_QUERY?!o.realModified()||et.Instance.allowUpdateInQueryMode(a.getCompIdx())?[3,19]:[4,i.cancelEdit(s.REAL_ONLY,!1)]:[3,19];case 17:return h.sent(),a.WriteToMessagePanebyMsgId(r.MsgInterface.RT_STR_UPDATE_IN_QUERY,!1),[4,a.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 18:h.sent(),h.label=19;case 19:return this.isForceExitPreRecordUpdate(a)||a.isAborting()&&null==oe.Instance.GetTaskByID(a.getTaskTag())||c&&a.getMode()!==r.Constants.TASK_MODE_DELETE?[3,21]:[4,this.commitRecord(a,e.reversibleExit())];case 20:h.sent(),h.label=21;case 21:return a.transactionFailed(E.TRANS_RECORD_PREFIX)||a.isAborting()?[3,24]:o.getMode()===n.DataModificationTypes.Delete&&a.getMode()===r.Constants.TASK_MODE_DELETE||o.getMode()!==n.DataModificationTypes.Delete?[4,a.evalEndCond(E.END_COND_EVAL_AFTER)]:[3,24];case 22:return h.sent()?[4,a.endTask(!0,!1,!1)]:[3,24];case 23:h.sent(),h.label=24;case 24:return[3,56];case 25:return t?[4,l.IsParkable()]:[3,32];case 26:return h.sent()||l===G.getLastFocusedControl()?(l.InControl=!0,l.ShouldRefreshOnControlEnter()?[4,l.getField().updateDisplay()]:[3,28]):[3,30];case 27:h.sent(),h.label=28;case 28:return a.setLastParkedCtrl(l),n.RuntimeContextBase.Instance.CurrentClickedCtrl=null,[4,l.SetFocus(l,l.getDisplayLine(!1),!0,!0)];case 29:return h.sent(),this.setStopExecutionCtrl(null),P.ReturnToCtrl=l,a.InCtrlPrefix=!1,[3,32];case 30:return a.InCtrlPrefix=!1,[4,this.HandleNonParkableControls(l.getForm().getTask())];case 31:h.sent(),h.label=32;case 32:return[3,56];case 33:return this.GetStopExecutionFlag()||(l.isChoiceControl()&&l.SetKeyboardLanguage(!0),l.Type===r.MgControlType.CTRL_TYPE_BUTTON&&a.ActionManager.enable(r.InternalInterface.MG_ACT_BUTTON,!1),(a.getEnableZoomHandler()||l.useZoomHandler())&&a.ActionManager.enable(r.InternalInterface.MG_ACT_ZOOM,!1),a.ActionManager.enable(r.InternalInterface.MG_ACT_RT_EDT_NULL,!1)),t?this.GetStopExecutionFlag()?(l.InControl=!0,[2]):(this._nextParkedCtrl=null,null==(g=l.getField())||l.Type!==r.MgControlType.CTRL_TYPE_TEXT?[3,35]:[4,g.updateDisplay()]):[3,40];case 34:h.sent(),h.label=35;case 35:return a.setLevel(r.Constants.TASK_LEVEL_RECORD),l.setInControlSuffix(!1),l.IsInteractiveUpdate=!1,l.PropertyExists(n.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS)?[4,l.getProp(n.PropInterface.PROP_TYPE_CUSTOM_VALIDATORS).RefreshDisplay(!0)]:[3,37];case 36:h.sent(),h.label=37;case 37:return l.ValidateControl=!1,G.setLastFocusedControl(a,null),[4,a.evalEndCond(E.END_COND_EVAL_IMMIDIATE)];case 38:return h.sent()?[4,a.endTask(!0,!1,!1)]:[3,40];case 39:h.sent(),h.label=40;case 40:return[3,56];case 41:return a.setLevel(r.Constants.TASK_LEVEL_TASK),[3,56];case 42:return a.setLevel(r.Constants.TASK_LEVEL_NONE),[3,56];case 43:return d=a.getForm(),a.isMainProg()||null==d?[3,46]:[4,d.moveInView(d.isLineMode()?r.Constants.MOVE_UNIT_ROW:r.Constants.MOVE_UNIT_PAGE,r.Constants.MOVE_DIRECTION_NEXT)];case 44:return h.sent(),a.getExecEndTask()?[4,a.endTask(!0,!1,!1)]:[3,46];case 45:h.sent(),h.label=46;case 46:return[3,56];case 47:return a.DataView.isEmptyDataview()?(a.setExecEndTask(),[3,50]):[3,48];case 48:return[4,this.HandleActionDelline(e,a,i,o,!0)];case 49:h.sent(),h.label=50;case 50:return a.getExecEndTask()?[4,a.endTask(!0,!1,!1)]:[3,52];case 51:h.sent(),h.label=52;case 52:return[3,56];case 53:return[4,e.getArgList().getArgValue(1,r.StorageAttribute.BOOLEAN,0)];case 54:return I="1"===h.sent(),[4,l.validateAndSetValueIfAllowed(e.getValue(),I)];case 55:return h.sent(),[3,56];case 56:return[2]}}))}))},s.prototype.handleNonReversibleEvent=function(e,t){return T(this,void 0,void 0,(function(){var n,a;return h(this,(function(s){switch(s.label){case 0:n=new w(e),a=t===r.InternalInterface.MG_ACT_EXIT||t===r.InternalInterface.MG_ACT_CLOSE,n.setInternal(t),a&&(this._isNonReversibleExit=!0),s.label=1;case 1:return s.trys.push([1,,3,4]),n.setNonReversibleExit(),n.setCtrl(e.getLastParkedCtrl()),n.setArgList(null),[4,this.handleEvent(n,!1)];case 2:return s.sent(),[3,4];case 3:return a&&(this._isNonReversibleExit=!1),[7];case 4:return[2]}}))}))},s.prototype.handleInternalEventWithTaskAndEventSubtype=function(t,n,a){return T(this,void 0,void 0,(function(){var s,i;return h(this,(function(o){switch(o.label){case 0:return s=t.getLastParkedCtrl(),n<r.InternalInterface.MG_ACT_TOT_CNT&&null!=t&&a!==e.EventSubType.CancelIsQuit&&!t.ActionManager.isEnabled(n)?[2]:null===s?[3,2]:[4,this.handleInternalEventWithMgControl(s,n,a)];case 1:return o.sent(),[3,8];case 2:return n!==r.InternalInterface.MG_ACT_RT_QUIT?[3,4]:[4,this.handleInternalEventWithTaskAndEventSubtype(t,r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelIsQuit)];case 3:return o.sent(),[3,8];case 4:return(i=new w(t)).setInternal(n),i.SetEventSubType(a),r.InternalInterface.BuiltinEvent(n)?[4,this.handleEvent(i,!1)]:[3,6];case 5:return o.sent(),[3,8];case 6:return[4,this.commonHandler(i)];case 7:o.sent(),o.label=8;case 8:return[2]}}))}))},s.prototype.handleInternalEventWithMgControl=function(t,n,a){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return n!==r.InternalInterface.MG_ACT_RT_QUIT?[3,2]:[4,this.handleInternalEventWithMgControl(t,r.InternalInterface.MG_ACT_CANCEL,e.EventSubType.CancelIsQuit)];case 1:return i.sent(),[3,6];case 2:return(s=new w(t)).setInternal(n),s.SetEventSubType(a),n===r.InternalInterface.MG_ACT_RT_REFRESH_VIEW&&s.setIsRealRefresh(!1),r.InternalInterface.BuiltinEvent(n)?[4,this.handleEvent(s,!1)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,this.commonHandler(s)];case 5:i.sent(),i.label=6;case 6:return[2]}}))}))},s.prototype.getCurrField=function(){return this._currField},s.prototype.getCurrCtrl=function(){return this._currCtrl},s.prototype.getCurrTask=function(){return null==this._currField?null:this._currField.getTask()},s.prototype.setStopExecution=function(e,t){1===arguments.length?this.setStopExecution_0(e):this.setStopExecution_1(e,t)},s.prototype.setStopExecution_0=function(e){this.setStopExecution(e,!0)},s.prototype.setStopExecution_1=function(e,r){if(e)if(r)this._eventsQueue.clear();else{for(var n=new t.List,a=void 0,s=void 0;!this._eventsQueue.isEmpty();)(a=this._eventsQueue.poll()).isFromServer()&&(a.resetFromServer(),n.push(a));for(s=0;s<n.length;s++)this._eventsQueue.put(n.get_Item(s))}this._stopExecution=e},s.prototype.setStopExecutionCtrl=function(e){null!==this._stopExecutionCtrl&&null!==e||(this._stopExecutionCtrl=e)},s.prototype.delCurrRec=function(e,t){return T(this,void 0,void 0,(function(){var a,s;return h(this,(function(i){switch(i.label){case 0:return a=e.DataView,e.setMode(r.Constants.TASK_MODE_MODIFY),[4,e.getForm().delCurrRec()];case 1:return i.sent(),e.DataView.isEmptyDataview()?[3,10]:a.getCurrRecIdx()>=0?a.getCurrRec().getMode()===n.DataModificationTypes.Delete||t?[3,6]:(s=e.getLastParkedCtrl(),[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)]):[3,7];case 2:return i.sent(),this.GetStopExecutionFlag()?[3,6]:null!==s?[3,4]:[4,this.HandleNonParkableControls(e)];case 3:return i.sent(),[3,6];case 4:return[4,this.handleInternalEventWithMgControlBase(s,r.InternalInterface.MG_ACT_CTRL_PREFIX)];case 5:i.sent(),i.label=6;case 6:return[3,9];case 7:return e.getInCreateLine()?[3,9]:[4,this.handleNonReversibleEvent(e,r.InternalInterface.MG_ACT_EXIT)];case 8:i.sent(),i.label=9;case 9:return[3,13];case 10:return[4,this.HandleNonParkableControls(e)];case 11:return i.sent(),[4,this.handleInternalEventWithTask(e,r.InternalInterface.MG_ACT_REC_PREFIX)];case 12:i.sent(),i.label=13;case 13:return[2]}}))}))},s.prototype.updateConfirmed=function(e){return T(this,void 0,void 0,(function(){var t,a,s;return h(this,(function(i){switch(i.label){case 0:return null==e?[2,!1]:[4,e.checkProp(n.PropInterface.PROP_TYPE_CONFIRM_UPDATE,!1)];case 1:return t=i.sent(),this._isInRecordFlushEvent||!t||e.DataSynced?[3,3]:[4,ge.Instance.confirm(r.MsgInterface.CRF_STR_CONF_UPD,n.Styles.MSGBOX_ICON_QUESTION|n.Styles.MSGBOX_BUTTON_YES_NO_CANCEL)];case 2:return s=i.sent(),a=s===n.Styles.MSGBOX_RESULT_YES?"Y":s===n.Styles.MSGBOX_RESULT_NO?"N":"C",[3,4];case 3:a="Y",i.label=4;case 4:switch(a){case"Y":return[3,5];case"N":return[3,6];case"C":return[3,9]}return[3,11];case 5:return[3,12];case 6:return[4,e.getForm().cancelEdit(!1,!1)];case 7:return i.sent(),[4,e.getForm().RefreshDisplay(r.Constants.TASK_REFRESH_CURR_REC)];case 8:return i.sent(),e.ConfirmUpdateNo=!0,[2,!1];case 9:return this.setStopExecution(!0),this.setStopExecutionCtrl(G.getLastFocusedControl()),[4,n.FocusManager.SetFocus(G.getLastFocusedControl(),-1)];case 10:return i.sent(),[2,!1];case 11:return r.Logger.Instance.WriteExceptionToLogWithMsg("in ClientManager.Instance.updateConfirmed() illegal confirmation code: "+t),[3,12];case 12:return[2,!0]}}))}))},s.prototype.setCompMainPrgTab=function(e){this._compMainPrgTab=e},s.prototype.setEndOfWork=function(e){this._endOfWork=e},s.prototype.getEndOfWork=function(){return this._endOfWork},s.prototype.getCompMainPrgTab=function(){return this._compMainPrgTab},s.prototype.inNonReversibleExit=function(){return this._isNonReversibleExit},s.prototype.pushRtEvent=function(e){this._rtEvents.push(e)},s.prototype.popRtEvent=function(){return 0===this._rtEvents.count()?null:this._rtEvents.pop()},s.prototype.storeLastSavedRouteEventOnLocalStorage=function(){var e=window.localStorage;if(null!=this.getLastSavedRouteEvent()){var r=this.getLastSavedRouteEvent();if(e.setItem(E.LAST_ROUTE_EVENT,"1"),e.setItem(E.LAST_ROUTE_EVENT_SRC_TSK,JSON.stringify(r.getTask().TaskDefinitionId)),r.getArgList().getSize()>0){var n=new t.StringBuilder;r.getArgList().buildXML(n),e.setItem(E.LAST_ROUTE_EVENT_ARG_LIST,n.toString())}}},s.prototype.restoreLastSavedRouteEventFromLocalStorage=function(){var e=window.localStorage;if("1"===e.getItem(E.LAST_ROUTE_EVENT)){var t=e.getItem(E.LAST_ROUTE_EVENT_SRC_TSK),r=e.getItem(E.LAST_ROUTE_EVENT_ARG_LIST),a=new n.TaskDefinitionId;a.fromJSON(t);var i=oe.Instance.getCurrMGData().getTaskByTaskDefinitionID(a),o=null;null!=r&&(o=new L).fillList(r,i),s.Instance.AddLastSavedRouteEvent(i,o)}},s.prototype.getLastSavedRouteEvent=function(){return this.lastSavedRouteEvent},s.prototype.setLastSavedRouteEvent=function(e){this.lastSavedRouteEvent=null==e?null:e.replicate()},s.prototype.getLastRtEvent=function(){return 0===this._rtEvents.count()?null:this._rtEvents.peek()},s.prototype.setIgnoreUnknownAbort=function(e){this._ignoreUnknownAbort=e},s.prototype.ignoreUnknownAbort=function(){return this._ignoreUnknownAbort},s.prototype.failTaskOverlay=function(t,r){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:if(null===t)return[3,4];this.setIgnoreUnknownAbort(!0),a.label=1;case 1:return a.trys.push([1,,3,4]),n=Qe.CreateNonReversibleExitCommand(t,!1),r.CmdsToServer.Add(n),[4,le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 2:return a.sent(),[3,4];case 3:return this.setIgnoreUnknownAbort(!1),[7];case 4:return[2]}}))}))},s.prototype.isEventScopeTrans=function(){return this._eventScope===Nr.TRANS},s.prototype.setEventScopeTrans=function(){this._eventScope=Nr.TRANS},s.prototype.clearEventScope=function(){this._eventScope=Nr.NONE},s.prototype.GetEventTime=function(){return this._eventsQueue.GetTime()},s.prototype.getMatchingAction=function(e,t){var a=0;return null==t||0===a&&(0!==t.getAction()?a=t.getAction():45===t.getKeyCode()&&t.getModifier()===n.Modifiers.MODIFIER_NONE&&0===t.getStates()&&(a=r.InternalInterface.MG_ACT_TOGGLE_INSERT)),a},s.prototype.getExecStack=function(){return this._execStack.peek()},s.prototype.pushExecStack=function(e,t,r){this._execStack.peek().push(oe.Instance.getTaskIdById(e),t,r)},s.prototype.popExecStack=function(){return this._execStack.peek().pop()},s.prototype.pushNewExecStacks=function(){this._serverExecStack.push(null),this._execStack.push(new z)},s.prototype.popNewExecStacks=function(){this._serverExecStack.pop(),this._execStack.pop()},s.prototype.pushServerExecStack=function(e,t,r){null===this._serverExecStack.peek()&&(this._serverExecStack.pop(),this._serverExecStack.push(new z)),this._serverExecStack.peek().push(e,t,r)},s.prototype.clearServerExecStack=function(){null!==this._serverExecStack.peek()&&this._serverExecStack.peek().clear()},s.prototype.reverseServerExecStack=function(){null!==this._serverExecStack.peek()&&this._serverExecStack.peek().reverse()},s.prototype.getNextOperIdx=function(e,t){var r=null,n=-1;if(0!==this._serverExecStack.count()&&null!==this._serverExecStack.peek()&&!this._serverExecStack.peek().empty())if(this._serverExecStack.peek().size()>this._execStack.peek().size()){for(var a=new z(this._serverExecStack.peek());a.size()>this._execStack.peek().size();)r=a.pop();this._execStack.peek().Equals(a)&&r.TaskId===e.getTaskTag()&&r.HandlerId===e.getHandlerId()&&r.OperIdx>=e.getServerId()?(n=r.OperIdx,t&&this._serverExecStack.peek().size()===this._execStack.peek().size()+1&&this._serverExecStack.peek().clear()):n=s.MAX_OPER}else n=s.MAX_OPER;return n},s.prototype.setProcessingTopMostEndTask=function(e){this._processingTopMostEndTask=e},s.prototype.getProcessingTopMostEndTask=function(){return this._processingTopMostEndTask},s.prototype.setAllowEvents=function(e){this._allowEvents=e},s.prototype.setNonInteractiveAllowEvents=function(t,r){this._allowEvents=t?e.EventsAllowedType.NON_INTERACTIVE:e.EventsAllowedType.NONE},s.prototype.getAllowEvents=function(){return this._allowEvents},s.prototype.NoEventsAllowed=function(){return this._allowEvents===e.EventsAllowedType.NONE},s.prototype.handleCtrlModify=function(e,t){return T(this,void 0,void 0,(function(){var n;return h(this,(function(a){switch(a.label){case 0:if(null==e||!e.isModifiable())return[2];switch(t){case r.InternalInterface.MG_ACT_RT_EDT_NULL:case r.InternalInterface.MG_ACT_CTRL_MODIFY:case r.InternalInterface.MG_ACT_SELECTION:break;default:return[2]}return(n=new w(e)).setInternal(r.InternalInterface.MG_ACT_CTRL_MODIFY),[4,this.handleEvent(n,!1)];case 1:return a.sent(),[2]}}))}))},s.prototype.ActAllowed=function(t){var n=!0;switch(this.getAllowEvents()){case e.EventsAllowedType.ALL:n=!0;break;case e.EventsAllowedType.NONE:n=t===r.InternalInterface.MG_ACT_CRELINE;break;case e.EventsAllowedType.NON_INTERACTIVE:switch(t){case r.InternalInterface.MG_ACT_EXIT_SYSTEM:case r.InternalInterface.MG_ACT_EXIT:case r.InternalInterface.MG_ACT_CLOSE:case r.InternalInterface.MG_ACT_CRELINE:case r.InternalInterface.MG_ACT_CRELINE_ABOVE:case r.InternalInterface.MG_ACT_ROLLBACK:n=!0;break;default:n=!1}}return n},s.prototype.commitRecord=function(e,t){return T(this,void 0,void 0,(function(){var a,i,o,l,u,c,_;return h(this,(function(T){switch(T.label){case 0:return a=e.DataView,i=a.getCurrRec(),[4,e.checkProp(n.PropInterface.PROP_TYPE_FORCE_SUFFIX,!1)];case 1:return o=T.sent(),[4,e.checkProp(n.PropInterface.PROP_TYPE_SELECTION,!1)];case 2:return l=T.sent(),u=i.isNewRec(),c=!0,_=i.Modified,a.recInModifiedTab(i.getId())||i.clearFlagsHistory(),[4,e.TaskTransactionManager.checkAndCommit(t,E.TRANS_RECORD_PREFIX,e.ConfirmUpdateNo)];case 3:if(T.sent(),!e.transactionFailed(E.TRANS_RECORD_PREFIX))return[3,8];T.label=4;case 4:return T.trys.push([4,,6,7]),e.DataSynced=!0,this.setStopExecution(!1),[4,e.handleEventOnSlaveTasks(r.InternalInterface.MG_ACT_REC_PREFIX)];case 5:return T.sent(),[3,7];case 6:return this.setStopExecution(!0),[7];case 7:return[3,17];case 8:return e.isAborting()?(this.setStopExecution(!0),[3,17]):[3,9];case 9:return _&&i.setLateCompute(!0),this._stopExecution||e.setLevel(r.Constants.TASK_LEVEL_TASK),i.resetUpdated(),i.resetModified(),_||o||l&&e.InSelect?[3,16]:u?(a.setPrevCurrRec(),c=!1,i.setNewRec(),[4,e.getForm().cancelEdit(!1,!1)]):[3,12];case 10:return T.sent(),[4,this.HandleStopRowEditing(e)];case 11:return T.sent(),[3,15];case 12:return i.getForceSaveOrg()?[3,14]:[4,a.cancelEdit(s.REAL_ONLY,!0)];case 13:return T.sent(),[3,15];case 14:a.saveOriginal(),T.label=15;case 15:return[3,17];case 16:a.saveOriginal(),T.label=17;case 17:return c&&a.setPrevCurrRec(),[2]}}))}))},s.prototype.incLocateTimerCB=function(e){var t=e,n=new w(t,!0);n.setInternal(r.InternalInterface.MG_ACT_INCREMENTAL_LOCATE),n.setMainPrgCreator(t),n.setCtrl(t.getLastParkedCtrl()),this.addToTail(n)},s.doSyncForSubformParent=function(t){return T(this,void 0,void 0,(function(){var r,a,s,i;return h(this,(function(o){switch(o.label){case 0:return r=t.getParent(),a=r.DataView,s=a.getCurrRec(),t.IsSubForm&&null!=s&&s.Modified&&!a.isEmptyDataview()?(s.setMode(n.DataModificationTypes.Update),[4,a.addCurrToModified(!1)]):[3,3];case 1:return o.sent(),a.getCurrRec().Synced=!0,a.setChanged(!0),i=Qe.CreateDataViewCommand(r.getTaskTag(),e.DataViewCommandType.ExecuteLocalUpdates),[4,r.DataviewManager.Execute(i)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))},s.prototype.ProcessAbortingError=function(a){return T(this,void 0,void 0,(function(){var s,i,o,l,u,c,_,T;return h(this,(function(h){switch(h.label){case 0:return s=a instanceof ae?a.GetMessage():null!==a.Message?a.Message:a.GetType(),i=r.StrUtil.getConsoleErorString(s),o=r.StrUtil.getMsgBoxErorString(s),null!==a.InnerException?r.Logger.Instance.WriteExceptionToLog(a.InnerException,i):a instanceof ae&&r.Logger.Instance.LogLevel===r.Logger_LogLevels.Basic||r.Logger.Instance.WriteExceptionToLogWithMsg(i),l=n.RuntimeContextBase.Instance.ContextID!==n.RuntimeContextBase.noContextId,oe.Instance.currMgdID=0,u=pe.Instance.getConstMessage(r.MsgInterface.BRKTAB_STR_ERROR),c=16,a.Message.startsWith("<HTML")?(this.processHTMLContent(a.Message),[3,4]):[3,1];case 1:return this.ShowErrorInMessageBox(a)?[4,ge.Instance.MessageBox(u,o,c)]:[3,3];case 2:h.sent(),h.label=3;case 3:a instanceof ae&&(a.GetCode()!=ae.ERR_WEBCLIENT_PROGRAM_RELOADED&&a.GetCode()!=ae.ERR_EXECUTED_PROGRAM_CHANGED||(n.Commands.addGlobalCommand(n.CommandType.RELOAD_PAGE),n.Commands.beginInvoke())),h.label=4;case 4:if(a instanceof ae&&(a.GetCode()!==ae.ERR_CTX_NOT_FOUND&&a.GetCode()!==ae.ERR_WEBCLIENT_PROGRAM_RELOADED&&a.GetCode()!==ae.ERR_EXECUTED_PROGRAM_CHANGED||(l=!1)),!l)return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),_=Qe.CreateUnloadCommand(),oe.Instance.getMGData(0).CmdsToServer.Add(_),[4,Te.GetCommandsProcessor().Execute(e.CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS)];case 6:return h.sent(),[3,8];case 7:if(!((T=h.sent())instanceof t.ApplicationException))throw T;return r.Logger.Instance.WriteExceptionToLog(T),[3,8];case 8:return ge.Instance.abort(),[2]}}))}))},s.prototype.processHTMLContent=function(e){n.Commands.addShowHTMLError(n.CommandType.SHOW_HTML_ERROR,e),n.Commands.beginInvoke()},s.prototype.ShowErrorInMessageBox=function(e){return!(e instanceof ae)||(e.GetCode()!=ae.ERR_EXECUTED_PROGRAM_CHANGED&&e.GetCode()!=ae.ERR_WEBCLIENT_PROGRAM_RELOADED||n.RuntimeContextBase.Instance.ContextID!==n.RuntimeContextBase.noContextId)},s}();kr.Timer_Timeout_Infinite=-1,kr.REAL_ONLY=!0,kr.MAX_OPER=9999,kr.userGrantedForContextActivity=!0,kr.clientInactivityTimerON=!1,kr.clientContextInactivityTimerAborted=!1,kr.Instance=new kr,kr.clientBusyTimeStart=0;var xr=function(e){function t(){return e.call(this)||this}return u(t,e),t.prototype.RegisterSubclassHandlers=function(){n.Events.FocusEvent=t.processFocus,n.Events.FocusOnNonMagicControlEvent=t.processFocusOnNonMagicControl,n.Events.MouseUpEvent=t.processMouseUp,n.Events.SelectionEvent=t.processSelection,n.Events.DisposeEvent=t.processDispose,n.Events.TimerEvent=t.ProcessTimer,n.Events.TableResizeEvent=t.processTableResize,n.Events.GetRowsDataEvent=t.processGetRowsData,n.Events.NonParkableLastParkedCtrlEvent=t.OnNonParkableLastParkedCtrl,n.Events.ShowSessionStatisticsEvent=t.ShowSessionStatistics,n.Events.WriteExceptionToLogEvent=r.Logger.Instance.WriteExceptionToLogWithMsg.bind(r.Logger.Instance),n.Events.WriteErrorToLogEvent=r.Logger.Instance.WriteErrorToLog.bind(r.Logger.Instance),n.Events.WriteWarningToLogEvent=r.Logger.Instance.WriteWarningToLogWithMsg.bind(r.Logger.Instance),n.Events.ShouldLogEvent=r.Logger.Instance.ShouldLog.bind(r.Logger.Instance),n.Events.WriteGuiToLogEvent=r.Logger.Instance.WriteGuiToLog.bind(r.Logger.Instance),n.Events.WriteDevToLogEvent=r.Logger.Instance.WriteDevToLog.bind(r.Logger.Instance),n.Events.TranslateEvent=pe.Instance.translate.bind(pe.Instance),n.Events.PeekEndOfWorkEvent=t.peekEndOfWork,n.Events.TranslateLogicalNameEvent=lt.Instance.translate.bind(lt.Instance),n.Events.GetMainProgramEvent=t.getMainProgram,n.Events.GetMessageStringEvent=pe.Instance.getConstMessage.bind(pe.Instance),n.Events.CtrlFocusEvent=t.processCtrlFocus,n.Events.GetRuntimeContextEvent=t.GetRuntimeContext,n.Events.SaveLastClickedCtrlEvent=t.SaveLastClickedControlName,n.Events.SaveLastClickInfoEvent=t.SaveLastClickInfo,n.Events.OnIsLogonRTLEvent=t.IsLogonRTL,n.Events.ShouldAddEnterAsKeyEvent=t.ShouldAddEnterAsKeyEvent},t.processCtrlFocus=function(e,t){G.setLastFocusedControl(e,t)},t.processFocus=function(e,t,n,a){var s=e;kr.Instance.addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick(s,r.InternalInterface.MG_ACT_CTRL_FOCUS,t,n)},t.processFocusOnNonMagicControl=function(e){var t=e;kr.Instance.addGuiTriggeredEventWithCtrlAndCodeAndLine(t,r.InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL,t.getDisplayLine(!0))},t.processMouseUp=function(e,t){var n=e,a=new w(n,t,!0),s=!0;n.Type===r.MgControlType.CTRL_TYPE_BUTTON&&e.ButtonStyle===r.CtrlButtonTypeGui.Hypertext&&(s=!1),a.setProduceClick(s),a.setInternal(r.InternalInterface.MG_ACT_CTRL_MOUSEUP),kr.Instance.addToTail(a)},t.processDispose=function(e){var t=e.getTask().getMGData();K.StopAll(t),t.IsAborting&&oe.Instance.deleteMGDataTree(t.GetId())},t.ProcessTimer=function(e){var t=e.GetMgdata(),n=t.getFirstTask(),a=Math.floor(e.TimerIntervalMiliSeconds/1e3),s=e.IsIdleTimer;if(!t.IsAborting){var i=new w(n,!0);i.setTimer(a,t.GetId(),s),i.setMainPrgCreator(i.getTask()),s||i.setCtrl(n.getLastParkedCtrl()),i.setInternal(r.InternalInterface.MG_ACT_TIMER),kr.Instance.addToTail(i)}},t.processTableResize=function(e,t){if(null!=e){var n=new w(e,t,!0);n.setInternal(r.InternalInterface.MG_ACT_RESIZE),kr.Instance.addToTail(n)}},t.processGetRowsData=function(e,t,n,a){var s=e;if(null!=s&&s.Type===r.MgControlType.CTRL_TYPE_TABLE){var i=new w(s,t,!0);i.setInternal(r.InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE),i.setSendAll(n),i.LastFocusedVal=a,kr.Instance.addToTail(i)}},t.processEnableActs=function(e,t,n){var a=new w(e,!0);a.setInternal(n?r.InternalInterface.MG_ACT_ENABLE_EVENTS:r.InternalInterface.MG_ACT_DISABLE_EVENTS),a.setActEnableList(t),kr.Instance.addToTail(a)},t.OnNonParkableLastParkedCtrl=function(e){},t.processSelection=function(e,t,n,a){var s,i=t;(i.Type===r.MgControlType.CTRL_TYPE_BUTTON&&i.getForm().getTask().getLastParkedCtrl()!==i&&(a=!0),t.ConnectedControl)?((s=new w(i,+n,!0)).setInternal(r.InternalInterface.MG_ACT_ZOOM),s.setProduceClick(a),kr.Instance.addToTail(s)):((s=new w(i,+n,!0)).setInternal(r.InternalInterface.MG_ACT_SELECTION),s.setValue(e),s.setProduceClick(a),kr.Instance.addToTail(s))},t.prototype.processKeyDown=function(t,n,a,s,i,o,l,u,c,_,T){return G.Instance.LastActionTime=r.Misc.getSystemMilliseconds(),e.prototype.processKeyDown.call(this,t,n,a,s,i,o,l,u,c,_,T)},t.peekEndOfWork=function(){return kr.Instance.getEndOfWork()},t.getMainProgram=function(e,t){return oe.Instance.GetMainProgByCtlIdx(e,t)},t.GetRuntimeContext=function(e){return n.RuntimeContextBase.Instance},t.SaveLastClickedControlName=function(e,t){n.RuntimeContextBase.Instance.LastClickedCtrlName=t},t.SaveLastClickInfo=function(e,t,r,a,s,i,o){n.RuntimeContextBase.Instance.SaveLastClickInfo(t,r,a,s,i,o)},t.ProcessPress=function(e,t,a){var s=t;null==s?n.Manager.EventsManager.addGuiTriggeredEventWithTaskAndCode(e.getTask(),r.InternalInterface.MG_ACT_HIT):s.isSubform()?s.OnSubformClick():n.Manager.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(s,r.InternalInterface.MG_ACT_CTRL_HIT,a),n.Manager.EventsManager.addGuiTriggeredEventWithCtrlAndCodeAndLine(s,r.InternalInterface.MG_ACT_PRESS,a)},t.IsLogonRTL=function(){return ne.Instance.IsLogonRTL()},t.ShowSessionStatistics=function(){},t.ShouldAddEnterAsKeyEvent=function(){return!1},t}(n.EventsProcessor),Fr=function(){function e(){}return e.GetUniqueMachineID=function(){if(!e.id){var r=new Date,n=r.toDateString()+r.toTimeString()+r.getMilliseconds();e.id=t.HashUtils.GetHashCode(n).toString()+"_"}return e.id},e}(),wr=function(e){function n(){var r=e.call(this)||this;return r._callingTaskTag=null,r._pathParentTaskTag=null,r._subformCtrlName=null,r._ditIdx=t.Int32.MinValue,r._isModal=!0,r._transOwner=null,r._newId=null,r._forceModal=!1,r._key=null,r._varList=null,r._isRoute=!1,r.NewTaskXML=null,r}return u(n,e),Object.defineProperty(n.prototype,"IsBlocking",{get:function(){return this._isModal&&null===this._subformCtrlName},enumerable:!1,configurable:!0}),n.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,a,s,i,l,u,c,_,T,p,g,d,E,I,f,C,A,R,S,M,m,v,L;return h(this,(function(h){switch(h.label){case 0:if(e=null,a=!1,s=!0,i=0,l=null,u=new t.List,c=new t.List,_=!0,p=null,g=null!=this._callingTaskTag?o.mgDataTable.GetTaskByID(this._callingTaskTag):null,d=null!=this._pathParentTaskTag?o.mgDataTable.GetTaskByID(this._pathParentTaskTag):null,G.Instance.getLastFocusedTask(),T=g=o.mgDataTable.GetTaskByID(this._callingTaskTag),!t.NString.IsNullOrEmpty(this._subformCtrlName)||this._ditIdx!==t.Int32.MinValue||this._isRoute)if(this._isRoute&&t.NString.IsNullOrEmpty(this._subformCtrlName.trim()))l=g.getForm().DefaultRouterOutlet;else if(g.IsInteractive)l=this._ditIdx!==t.Int32.MinValue?g.getForm().getCtrl(this._ditIdx):g.getForm().getSubFormCtrlByName(this._subformCtrlName);else for(E=g;null!=E.getForm();E=E.getParent())if(null!=(l=E.getForm().getCtrlByName(this._subformCtrlName,r.MgControlType.CTRL_TYPE_SUBFORM))){g=T=E;break}return null!=g&&(e=g.getMGData()),null==l?[3,5]:(C=l.getSubformTask(),T=l.getForm().getTask(),i=T.getMgdID(),null!=(p=T.getMGData()).getTimerHandlers()&&(u=p.getTimerHandlers().getTimersVector()),this._ditIdx===t.Int32.MinValue?[3,1]:(s=!1,_=!1,[3,4]));case 1:return a=!0,null!=this._transOwner&&null!=(I=o.mgDataTable.GetTaskByID(this._transOwner))&&I.setTransOwnerTask(),null==C?[3,3]:(C.setDestinationSubform(!0),[4,C.stop()]);case 2:h.sent(),h.label=3;case 3:P.validReturnToCtrl()||(P.ReturnToCtrl=G.getLastFocusedControl()),h.label=4;case 4:l.setSubformTaskId(this._newId),h.label=5;case 5:return f=null==g?o.mgDataTable.getMGData(0):g.getMGData(),a||!s?[3,7]:(i=o.mgDataTable.getAvailableIdx(),t.Debug.Assert(i>0),(e=new Or(n.createNewCommandsTable(),n.createNewCommandsTable(),i,f,this._isModal,this._forceModal)).copyUnframedCmds(),[4,o.mgDataTable.addMGData(e,i,!1)]);case 6:h.sent(),o.mgDataTable.currMgdID=i,h.label=7;case 7:this.Obj=this._key,this._key=null,h.label=8;case 8:return h.trys.push([8,,10,11]),[4,le.GetInstance().ProcessResponse(this.NewTaskXML,i,new y(g,d),null)];case 9:return h.sent(),[3,11];case 10:return o.eventsManager.setIgnoreUnknownAbort(!1),[7];case 11:return!a&&s||(l.initSubformTask(),a&&(C=l.getSubformTask(),_=!g.RetainFocus,C.setIsDestinationCall(!0))),A=!1,R=e.IsModal,null!=l&&(null!=p.getTimerHandlers()&&(c=p.getTimerHandlers().getTimersVector()),p.changeTimers(u,c),l.IsModal()&&(this._isModal=A=e.IsModal=!0)),[4,br.StartProgram(a,_)];case 12:if(S=h.sent(),A||(this._isModal=e.IsModal),null!=S)return[3,19];if(null==g||(!this._isModal||!A&&a||!s)&&(g.IsInteractive||g.isMainProg()&&null!=g.getForm()))return[3,18];if(!this._isModal)return[3,16];o.mgDataTable.startTasksIteration(),M=void 0,h.label=13;case 13:return null===(M=o.mgDataTable.getNextTask())?[3,16]:M.DataViewWasRetrieved?[4,M.RefreshDisplay()]:[3,15];case 14:h.sent(),h.label=15;case 15:return[3,13];case 16:return[4,o.eventsManager.EventsLoop(e)];case 17:h.sent(),A&&(e.IsAborting=!1,e.IsModal=R),h.label=18;case 18:return[3,21];case 19:return[4,o.eventsManager.NonInteractiveEventsLoop(e,S)];case 20:h.sent(),h.label=21;case 21:return null==o.eventsManager.getPendingGuiEvent()||!A&&null==S?[3,26]:(m=o.eventsManager.getPendingGuiEvent()).getTask()==g&&this._callingTaskTag===g.getTaskTag()?[3,25]:(g=o.mgDataTable.GetTaskByID(this._callingTaskTag)).getIsDestinationCall()?(v=g.getForm().getSubFormCtrl(),[4,o.eventsManager.performSubformClose(v)]):[3,23];case 22:return h.sent(),[3,24];case 23:(L=new w(g)).setInternal(r.InternalInterface.MG_ACT_CLOSE),L.setCtrl(null),L.setArgList(null),o.eventsManager.addToTail(L),h.label=24;case 24:return[3,26];case 25:o.eventsManager.addToTail(m),o.eventsManager.setPendingGuiEvent(null),h.label=26;case 26:return[2]}}))}))},n.prototype.HandleAttribute=function(n,a){switch(n){case E.MG_ATTR_CALLINGTASK:this._callingTaskTag=a;break;case E.MG_ATTR_PATH_PARENT_TASK:this._pathParentTaskTag=a;break;case E.MG_ATTR_SUBFORM_CTRL:this._subformCtrlName=a;break;case r.XMLConstants.MG_ATTR_DITIDX:this._ditIdx=r.XmlParser.getInt(a);break;case E.MG_ATTR_MODAL:this._isModal="1"===a[0];break;case E.MG_ATTR_TRANS_OWNER:this._transOwner=a;break;case E.MG_ATTR_NEWID:this._newId=t.NString.TrimEnd(a);break;case E.MG_ATTR_KEY:this._key=a;break;case E.MG_ATTR_ARGLIST:this._varList=new L,this._varList.fillList(a,o.mgDataTable.GetTaskByID(this.TaskTag));break;case E.MG_ATTR_OBJECT:this.Obj=a;break;case E.MG_ATTR_IS_ROUTE:this._isRoute="1"===a[0];break;default:e.prototype.HandleAttribute.call(this,n,a)}},n}(Pr);wr.createNewCommandsTable=null;var Vr=function(e){function n(t){var r=e.call(this)||this;return r._transOwner=null,0===arguments.length?(r.constructor_0(),r):(r.constructor_1(t),r)}return u(n,e),n.prototype.constructor_0=function(){},n.prototype.constructor_1=function(e){this.TaskTag=e},n.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,n,a,s,i;return h(this,(function(l){switch(l.label){case 0:return e=o.mgDataTable.currMgdID,r=o.mgDataTable.GetTaskByID(this.TaskTag),null!==this._transOwner&&null!==(n=o.mgDataTable.GetTaskByID(this._transOwner))&&n.setTransOwnerTask(),null===r&&o.eventsManager.ignoreUnknownAbort()?[2]:(t.Debug.Assert(null!==r),a=r.getMGData(),[4,r.stop()]);case 1:return l.sent(),a.abort(),o.mgDataTable.currMgdID=a.GetId(),s=r.getForm(),ge.Instance.abort(s),o.mgDataTable.currMgdID=a.GetId()!==e||null===a.getParentMGdata()?e:a.getParentMGdata().GetId(),P.validReturnToCtrl()||(i=G.getLastFocusedControl(),P.ReturnToCtrl=i),[2]}}))}))},n.prototype.HandleAttribute=function(t,n){if(t===E.MG_ATTR_TRANS_OWNER)this._transOwner=n;else e.prototype.HandleAttribute.call(this,t,n);if(t===r.XMLConstants.MG_ATTR_TASKID){var a=o.mgDataTable.GetTaskByID(this.TaskTag);null!=a&&a.resetKnownToServer()}},n}(Pr),Ur=function(){function e(){}return e.getStringOfOption=function(e,t,r){var n="",a=t.indexOf(r);if(a>-1){var s=e.split(",");a<s.length&&(n=s[a])}return n},e}(),Br=function(e){function a(){var t=e.call(this)||this;return t._callingTaskTag=null,t._title=null,t._errLogAppend=!1,t._text=null,t._display="\0",t._mode="\0",t._sendAck=!0,t}return u(a,e),a.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,n,a,s,i,l,u;return h(this,(function(c){switch(c.label){case 0:return e=r.StrUtil.getConsoleErorString(this._text),null===(n=o.mgDataTable.GetTaskByID(this.TaskTag)||o.mgDataTable.GetTaskByID(this._callingTaskTag))&&(n=G.Instance.getLastFocusedTask()),this._errLogAppend&&r.Logger.Instance.WriteExceptionToLogWithMsg(e),t.NString.IsNullOrEmpty(this._text)?[3,4]:this._display!==E.DISPLAY_BOX?[3,3]:(a=new t.RefParam(0),s=r.StrUtil.getMsgBoxErorString(this._text),i=pe.Instance.translate(s),l=new t.RefParam(t.NString.Empty),this.PrepareMessageBoxForDisplay(n,l,a),[4,ge.Instance.MessageBox(l.value,i,a.value)]);case 1:return u=c.sent(),[4,this.ProcessMessageBoxResponse(n,u)];case 2:return c.sent(),[3,4];case 3:this._display===E.DISPLAY_STATUS&&null!=n&&n.DisplayMessageToStatusBar(e),c.label=4;case 4:return[2]}}))}))},a.prototype.PrepareMessageBoxForDisplay=function(e,t,a){var s=pe.Instance.getConstMessage(r.MsgInterface.BRKTAB_STOP_MODE_TITLE);this._title=Ur.getStringOfOption(s,"EW",this._mode),t.value=pe.Instance.translate(this._title),a.value=n.Styles.MSGBOX_BUTTON_OK|("E"===this._mode?n.Styles.MSGBOX_ICON_ERROR:n.Styles.MSGBOX_ICON_WARNING)},a.prototype.ProcessMessageBoxResponse=function(e,t){},a.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_TITLE:this._title=n;break;case E.MG_ATTR_CALLINGTASK:this._callingTaskTag=n;break;case E.MG_ATTR_ERR_LOG_APPEND:this._errLogAppend=r.XmlParser.getBoolean(n);break;case E.MG_ATTR_TEXT:this._text=r.XmlParser.unescape(n);break;case E.MG_ATTR_DISPLAY:this._display=n[0];break;case E.MG_ATTR_MODE:this._mode=n[0];break;case E.MG_ATTR_ACK:this._sendAck=0!==r.XmlParser.getInt(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},a}(Pr),Xr=function(e){function t(){var t=e.call(this)||this;return t._buttonsID="\0",t._image="\0",t._returnValStr=null,t._returnVal=null,t}return u(t,e),t.prototype.ProcessMessageBoxResponse=function(e,t){return T(this,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return null===e?[3,2]:[4,it.setoperVerifyReturnValue(t,this._returnVal)];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.PrepareMessageBoxForDisplay=function(e,t,r){t.value=pe.Instance.translate(this._title),r.value=it.getButtons(this._buttonsID),r.value|=it.getImage(this._image),null!==e&&br.isMainProgramField(this._returnValStr)&&(this._returnVal=it.InitField(this._returnValStr,e))},t.prototype.HandleAttribute=function(t,r){switch(t){case E.MG_ATTR_IMAGE:this._image=r[0];break;case E.MG_ATTR_BUTTONS:this._buttonsID=r[0];break;case E.MG_ATTR_RETURN_VAL:this._returnValStr=r;break;default:e.prototype.HandleAttribute.call(this,t,r)}},t}(Br),Hr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserRange),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),Wr=function(e){function a(){var t=e.call(this)||this;return t.UserRange=null,t}return u(a,e),Object.defineProperty(a.prototype,"ShouldExecute",{get:function(){return o.mgDataTable.GetTaskByID(this.TaskTag).isStarted()},enumerable:!1,configurable:!0}),a.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,a,s;return h(this,(function(i){switch(i.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),r=e.DataView.getField(this.UserRange.veeIdx-1),a=new t.RefParam(0),s=Qe.CreateAddUserRangeDataviewCommand(this.TaskTag,this.UserRange),this.UserRange.nullMin||(s.Range.min=n.RecordUtils.deSerializeItemVal(this.UserRange.min,r.getType(),r.getSize(),!0,r.getType(),a)),this.UserRange.nullMax||(s.Range.max=n.RecordUtils.deSerializeItemVal(this.UserRange.max,r.getType(),r.getSize(),!0,r.getType(),a)),[4,e.DataviewManager.Execute(s)];case 1:return i.sent(),[2]}}))}))},a.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_FIELD_INDEX:null==this.UserRange&&(this.UserRange=new N,this.UserRange.nullMin=this.UserRange.nullMax=this.UserRange.discardMin=this.UserRange.discardMax=!0),this.UserRange.veeIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_MIN_VALUE:this.UserRange.min=n,this.UserRange.nullMin=!1,this.UserRange.discardMin=!1;break;case E.MG_ATTR_NULL_MIN_VALUE:this.UserRange.nullMin=!0,this.UserRange.discardMin=!1;break;case E.MG_ATTR_NULL_MAX_VALUE:this.UserRange.nullMax=!0,this.UserRange.discardMax=!1;break;case E.MG_ATTR_MAX_VALUE:this.UserRange.max=n,this.UserRange.discardMax=!1,this.UserRange.nullMax=!1;break;default:e.prototype.HandleAttribute.call(this,t,n)}},a}(Pr),Kr=function(e){function r(){return e.call(this)||this}return u(r,e),r.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,r,a,s;return h(this,(function(i){switch(i.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),r=e.DataView.getField(this.UserRange.veeIdx-1),a=new t.RefParam(0),s=Qe.CreateAddUserLocateDataviewCommand(this.TaskTag,this.UserRange),this.UserRange.nullMin||(s.Range.min=n.RecordUtils.deSerializeItemVal(this.UserRange.min,r.getType(),r.getSize(),!0,r.getType(),a)),this.UserRange.nullMax||(s.Range.max=n.RecordUtils.deSerializeItemVal(this.UserRange.max,r.getType(),r.getSize(),!0,r.getType(),a)),[4,e.DataviewManager.Execute(s)];case 1:return i.sent(),[2]}}))}))},r}(Wr),Yr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserLocate),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),zr=function(e){function t(){var t=e.call(this)||this;return t._isNull=!1,t._attr=r.StorageAttribute.NONE,t._val=null,t}return u(t,e),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){return h(this,(function(t){return this._isNull?e.SetResultValue(null,r.StorageAttribute.NONE):(null==this._val&&(this._val=""),e.SetResultValue(this._val,this._attr)),[2]}))}))},t.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_NULL:this._isNull=1===r.XmlParser.getInt(n);break;case E.MG_ATTR_PAR_ATTRS:this._attr=n[0];break;case r.XMLConstants.MG_ATTR_VALUE:this._val=r.XmlParser.unescape(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},t}(Pr),qr=function(e){function t(){var t=e.call(this)||this;return t.UserSort=null,t}return u(t,e),t.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var e,t;return h(this,(function(r){switch(r.label){case 0:return e=o.mgDataTable.GetTaskByID(this.TaskTag),t=Qe.CreateAddUserSortDataviewCommand(this.TaskTag,this.UserSort),[4,e.DataviewManager.Execute(t)];case 1:return r.sent(),[2]}}))}))},t.prototype.HandleAttribute=function(t,n){switch(t){case E.MG_ATTR_FIELD_INDEX:null==this.UserSort&&(this.UserSort=new Ze),this.UserSort.fldIdx=r.XmlParser.getInt(n);break;case E.MG_ATTR_DIR:this.UserSort.dir=1===r.XmlParser.getInt(n);break;default:e.prototype.HandleAttribute.call(this,t,n)}},t}(Pr),jr=function(t){function r(){return t.call(this)||this}return u(r,t),r.prototype.Execute=function(t){return T(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return t=o.mgDataTable.GetTaskByID(this.TaskTag),r=Qe.CreateDataViewCommand(this.TaskTag,e.DataViewCommandType.ResetUserSort),[4,t.DataviewManager.Execute(r)];case 1:return n.sent(),[2]}}))}))},r}(Pr),Qr=function(){function n(){this.newTaskXML=null}return n.prototype.fillData=function(e){var t=e.getXMLdata().indexOf(r.XMLConstants.TAG_TERM,e.getCurrIndex());if(-1!==t&&t<e.getXMLdata().length){var n=e.getXMLsubstring(t);e.add2CurrIndex(n.indexOf(E.MG_TAG_COMMAND)+E.MG_TAG_COMMAND.length);var a=r.XmlParser.getTokens(e.getXMLsubstring(t),r.XMLConstants.XML_ATTR_DELIM),s=this.initElements(a);e.setCurrIndex(t+r.XMLConstants.TAG_TERM.length);var i=s instanceof wr?s:null;return null!=i&&(this.getTaskXML(e),i.NewTaskXML=this.newTaskXML),s}return r.Logger.Instance.WriteDevToLog("in Command.FillData() out of string bounds"),null},n.prototype.initElements=function(e){t.Debug.Assert(e.get_Item(0)===r.XMLConstants.MG_ATTR_TYPE,"The first attribute of a <command> element must be the command type.");for(var n=this.getType(e.get_Item(1).toLowerCase()),a=this.CreateCommand(n),s=2;s<e.length;s+=2){var i=e.get_Item(s),o=e.get_Item(s+1);a.HandleAttribute(i,o)}return a},n.prototype.CreateCommand=function(r){switch(r){case e.ClientTargetedCommandType.Abort:return new Vr;case e.ClientTargetedCommandType.Verify:return new Br;case e.ClientTargetedCommandType.EnhancedVerify:return new Xr;case e.ClientTargetedCommandType.OpenURL:return new wr;case e.ClientTargetedCommandType.Result:return new zr;case e.ClientTargetedCommandType.AddRange:return new Wr;case e.ClientTargetedCommandType.AddLocate:return new Kr;case e.ClientTargetedCommandType.AddSort:return new qr;case e.ClientTargetedCommandType.ResetRange:return new Hr;case e.ClientTargetedCommandType.ResetLocate:return new Yr;case e.ClientTargetedCommandType.ResetSort:return new jr;case e.ClientTargetedCommandType.ClientRefresh:return new Dr;default:throw new t.ApplicationException("Unknown client targeted command type "+r)}},n.prototype.getTaskXML=function(e){if(e.getNextTag()!==E.MG_TAG_TASK_XML)throw new t.ApplicationException("Task's XML is missing");this.newTaskXML=e.ReadContentOfCurrentElement()},n.prototype.getType=function(t){var n;switch(t){case E.MG_ATTR_VAL_ABORT:n=e.ClientTargetedCommandType.Abort;break;case E.MG_ATTR_VAL_VERIFY:n=e.ClientTargetedCommandType.Verify;break;case E.MG_ATTR_VAL_ENHANCED_VERIFY:n=e.ClientTargetedCommandType.EnhancedVerify;break;case E.MG_ATTR_VAL_RESULT:n=e.ClientTargetedCommandType.Result;break;case E.MG_ATTR_VAL_OPENURL:n=e.ClientTargetedCommandType.OpenURL;break;case E.MG_ATTR_VAL_ADD_RANGE:n=e.ClientTargetedCommandType.AddRange;break;case E.MG_ATTR_VAL_ADD_LOCATE:n=e.ClientTargetedCommandType.AddLocate;break;case E.MG_ATTR_VAL_ADD_SORT:n=e.ClientTargetedCommandType.AddSort;break;case E.MG_ATTR_VAL_RESET_RANGE:n=e.ClientTargetedCommandType.ResetRange;break;case E.MG_ATTR_VAL_RESET_LOCATE:n=e.ClientTargetedCommandType.ResetLocate;break;case E.MG_ATTR_VAL_RESET_SORT:n=e.ClientTargetedCommandType.ResetSort;break;case E.MG_ATTR_VAL_CLIENT_REFRESH:n=e.ClientTargetedCommandType.ClientRefresh;break;default:n=t[0],r.Logger.Instance.WriteExceptionToLogWithMsg("Command.getType there is no such SERVER to CLIENT command : "+t)}return n},n}(),Zr=function(){function e(){}return e.Serialize=function(n,a){if(!n.ShouldSerialize)return null;var s=new t.StringBuilder,i=!1;s.Append(r.XMLConstants.START_TAG+E.MG_TAG_COMMAND),s.Append(" "+r.XMLConstants.MG_ATTR_TYPE+'="'+n.CommandTypeAttribute+'"');var o=new t.RefParam(i);return s.Append(n.SerializeCommandData(o)),i=o.value,n.ShouldSerializeRecords&&s.Append(e.SerializeRecords(a)),i?s.Append(r.XMLConstants.TAG_CLOSE):s.Append(r.XMLConstants.TAG_TERM),s.Append(n.SerializeDataAfterCommand()),s.ToString()},e.SerializeRecords=function(e){var n=new t.StringBuilder;try{for(var a=e.getTasksCount(),s=!1,i=G.Instance.getLastFocusedTask(),o=0;o<a;o++){var l=e.getTask(o);null!==l.getLastParkedCtrl()&&(s?n.Append("$"):(n.Append(" "+E.MG_ATTR_FOCUSLIST+'="'),s=!0),n.Append(l.getTaskTag()+","),n.Append(l.getLastParkedCtrl().getDitIdx()))}s&&n.Append('"'),null!==i&&n.Append(" "+E.MG_ATTR_FOCUSTASK+'="'+i.getTaskTag()+'"')}catch(e){if(!(e instanceof t.Exception))throw e;r.Logger.Instance.WriteExceptionToLog(e)}return n.ToString()},e}(),Jr=function(){function e(){this._cmds=null,this._iterationIdx=0,this._cmds=new t.List}return e.createCommandsTable=function(){return new e},e.prototype.fillData=function(e){for(;this.initInnerObjects(e.getNextTag(),e););},e.prototype.initInnerObjects=function(e,t){if(null==e)return!1;if(e!==E.MG_TAG_COMMAND)return!1;var r=(new Qr).fillData(t);return this._cmds.push(r),!0},e.prototype.Execute=function(e){return T(this,void 0,void 0,(function(){var t,r,n,a,s,i;return h(this,(function(o){switch(o.label){case 0:for(t=Lr.Instance.getCmdFrame(),Lr.Instance.add1toCmdFrame(),r=-1,n=0;n<this.getSize();n+=1)(s=this.getCmd(n)).IsBlocking&&-1===r?r=n:s instanceof zr&&-1!==r&&(this._cmds.Insert(r,s),this._cmds.RemoveAt(n+1));for(n=0;n<this.getSize();n+=1)if((s=this.getCmd(n)).Frame=t,s.IsBlocking){for(a=n+1;a<this.getSize();a+=1)Lr.Instance.addUnframedCmd(this.getCmd(a));this._cmds.SetSize(n+1);break}o.label=1;case 1:return this.getSize()>0?((i=this.extractCmd(t))instanceof Gr&&(s=i),null==s?[3,5]:s.ShouldExecute?[4,s.Execute(e)]:[3,3]):[3,7];case 2:return o.sent(),[3,4];case 3:Lr.Instance.addCommandsExecutedAfterTaskStarted(s),o.label=4;case 4:return[3,6];case 5:return[3,7];case 6:return[3,1];case 7:return[2]}}))}))},e.prototype.extractCmd=function(e){var t,r,n,a=this.getSize(),s=null,i=null,l=null,u=null;if(0===a)return null;for(this._iterationIdx>=a&&(this._iterationIdx=0),r=this._iterationIdx;this._iterationIdx<a;this._iterationIdx++)if(null!=(s=this.getCmd(this._iterationIdx)instanceof Vr?this.getCmd(this._iterationIdx):null)&&!s.TaskTag.startsWith("-")&&s.Frame===e){for(t=0;t<this._iterationIdx;t++)if(null!=(i=this.getCmd(t)instanceof Br?this.getCmd(t):null)&&i.Frame===e&&(l=o.mgDataTable.GetTaskByID(i.TaskTag),u=o.mgDataTable.GetTaskByID(s.TaskTag),null!=l&&l.isDescendentOf(u)))return this._cmds.RemoveAt(t),this._iterationIdx--,i;for(this._cmds.RemoveAt(this._iterationIdx),a=this.getSize(),r=0;r<a;r++)if(null!=(n=this.getCmd(r).TaskTag)&&n.substr(1)===s.TaskTag){this._cmds.RemoveAt(r);break}return s}for(t=0;t<a;t++)if(null!=(i=this.getCmd(t)instanceof Br?this.getCmd(t):null)&&i.Frame===e&&null!=o.mgDataTable.GetTaskByID(i.TaskTag))return this._cmds.RemoveAt(t),i;for(this._iterationIdx=0;this._iterationIdx<a;this._iterationIdx++)if((s=this.getCmd(this._iterationIdx)).Frame===e)return this._cmds.RemoveAt(this._iterationIdx),s;return null},e.prototype.getCmd=function(e){return this._cmds.get_Item(e)},e.prototype.buildXML=function(e){for(var r=0;r<this._cmds.length;r+=1){var n=this._cmds.get_Item(r);new t.RefParam(!1);e.Append(Zr.Serialize(n,o.mgDataTable.getCurrMGData()))}this.clear()},e.prototype.Add=function(e){this._cmds.push(e)},e.prototype.Clear=function(){this._cmds.Clear()},e.prototype.ExtractCommand=function(e){var t=this.getCmd(e);return this._cmds.RemoveAt(e),t},e.prototype.clear=function(){this._cmds.Clear()},e.prototype.getSize=function(){return this._cmds.length},e}(),$r="4.800.2",en=function(){function a(){this._guiEventsProcessor=null,this._tableCacheManager=null,this._delayInProgress=!1,this._debugClient=null,this._globalUniqueSessionId=null,this._buttonIsClicked=!1,n.RuntimeContextBase.Instance.Init(le.RC_NO_CONTEXT_ID),G.Instance.Init(oe.Instance),G.Instance.LastActionTime=r.Misc.getSystemMilliseconds(),le.ShouldScrambleAndUnscrambleMessages=!0,this._globalUniqueSessionId=Fr.GetUniqueMachineID()+"_",this.RegisterDelegates()}return Object.defineProperty(a,"Instance",{get:function(){return null===a._instance&&(a._instance=new a),a._instance},enumerable:!1,configurable:!0}),a.prototype.AddEvent=function(e){var a=oe.Instance.GetTaskByID(e.TaskID),s=+e.Line,i=0;if(null!=a){var o=null;if(null!==e.ControlName&&(o=a.getForm().GetCtrl(e.ControlName)),null!=o){var l=a.DataView;switch(o.IsTableChild&&(s-=l.RecordsBeforeCurrentView),e.EventType){case"columnSort":o.isColumnSortable()&&n.Events.OnColumnClick(o,e.Line,e.ControlName);break;case"mousedown":o.isButton()?this._buttonIsClicked=!0:o.isSubform()||(n.Events.GetRuntimeContext(n.Manager.GetCurrentContextID()).LastClickedCtrlName=o.getName());break;case"click":if(o.isButton()||o.ConnectedControl&&e.fromButton)n.Events.OnSelection("",o,s,!0),n.Events.GetRuntimeContext(n.Manager.GetCurrentContextID()).LastClickedCtrlName=o.getName(),this._buttonIsClicked=!1;else{n.Events.OnFocus(o,s,!0,!1);var u=o.isButton()||o.isTextControl()||o.isLabel()||o.isTabControl()||o.isTableControl()||o.isComboBox()||o.isImageControl();n.Events.OnMouseDown(o.getForm(),o,null,!0,s,!1,u)}break;case"focus":if(this._buttonIsClicked)return;n.Events.OnFocus(o,s,!0,!1);break;case"dblclick":n.Events.OnDblClick(o,s);break;case"selectionchanged":n.Events.OnSelection(e.Value,o,s,!0);break;case"keydown":n.Events.OnKeyDown(a.getForm(),o,e.modifiers,e.keyCode,0,0,"",!1,"",!0);break;case"setexternalvalue":kr.Instance.AddExternalValueEvent(o,e.externalValue,e.param)}}else switch(e.EventType){case"focusOnNonMagicControl":null!==(o=G.getLastFocusedControl())&&n.Events.OnFocusOnNonMagicControl(o);break;case"click":"magicRow"===e.ControlName&&(i=e.Line-a.DataView.RecordsBeforeCurrentView,kr.Instance.addGuiTriggeredEventWithTaskAndCodeAndLine(a,r.InternalInterface.MG_ACT_REC_PREFIX,i));break;case"close":a.IsRoute()?kr.Instance.AddRouterClosedEvent(a):n.Events.CloseFormEvent(a.getForm());break;case"dispose":oe.Instance.deleteMGDataTree(a.getMgdID());break;case"resize":n.Events.TableResizeEvent(a.getForm().getTableCtrl(),e.PageSize);case"getRows":i=s-a.DataView.RecordsBeforeCurrentView;var c={guiMgControl:a.getForm().getTableCtrl(),Line:i,Val:""};n.Events.OnGetRowsData(a.getForm().getTableCtrl(),i,!0,c);break;case"RouterNavigate":kr.Instance.AddRouteEvent(a,r.InternalInterface.MG_ACT_WEBCLIENT_ROUTE,e.RouterPath,e.RouterOutletName,e.RouterParams);break;case"setexternalvalue":r.Logger.Instance.WriteErrorToLog(t.NString.Format("Unable to find {0}: Trying to set value for a non-existing control.",e.ControlName))}}else if("confirmationClosed"===e.EventType)this.ConfirmationClosed(e.keyCode)},a.prototype.ConfirmationClosed=function(e){n.Commands.ResolvePromise(e)},a.prototype.WorkThreadExecution=function(){return T(this,void 0,void 0,(function(){var e,a,s,i,o;return h(this,(function(l){switch(l.label){case 0:r.Logger.Instance.ShouldLog()&&(r.Logger.Instance.WriteToLog("",!0),r.Logger.Instance.WriteToLog("Started on "+r.DateTimeUtils.ToString(t.DateTime.Now,r.XMLConstants.ERROR_LOG_DATE_FORMAT,r.Logger.Instance),!0),this.WriteExecutionPropertiesToLog()),l.label=1;case 1:return l.trys.push([1,10,15,17]),[4,Te.StartSession()];case 2:return l.sent()?(e=oe.Instance,a=e.StartupMgData,e.currMgdID=a.GetId(),s=null,a.IsAborting?[3,4]:[4,br.StartProgram(!1,!1)]):[3,9];case 3:s=l.sent(),l.label=4;case 4:return null!==s?[3,6]:[4,kr.Instance.EventsLoop(a)];case 5:return l.sent(),[3,8];case 6:return[4,kr.Instance.NonInteractiveEventsLoop(a,s)];case 7:l.sent(),l.label=8;case 8:kr.Instance.setEndOfWork(!0),l.label=9;case 9:return[3,17];case 10:return(i=l.sent())instanceof t.ApplicationException?(o=!1,i instanceof ae&&i.GetCode()===ae.INF_NO_RESULT&&(o=!0),o?[3,12]:[4,kr.Instance.ProcessAbortingError(i)]):[3,13];case 11:l.sent(),l.label=12;case 12:return kr.Instance.setEndOfWork(!0),[3,14];case 13:throw i;case 14:return[3,17];case 15:return[4,kr.Instance.CheckAndShowSpinner(!1)];case 16:return l.sent(),n.Commands.addGlobalCommand(n.CommandType.EXIT_MAGIC),n.Commands.beginInvoke(),[7];case 17:return[2]}}))}))},a.prototype.WriteExecutionPropertiesToLog=function(){if(r.Logger.Instance.ShouldLogServerRelatedMessages()){r.Logger.Instance.WriteToLog("-----------------------------------------------------------------------------",!0),r.Logger.Instance.WriteToLog("Execution Properties:",!0);var e=JSON.stringify(ne.Instance);r.Logger.Instance.WriteToLog(e,!0),r.Logger.Instance.WriteToLog("-----------------------------------------------------------------------------",!0)}},a.prototype.InitGuiManager=function(){n.Manager.EventsManager=kr.Instance,n.Manager.DefaultServerName=ne.Instance.getServer(),n.Manager.DefaultProtocol=ne.Instance.getProtocol(),n.GuiEnvironment.Environment=et.Instance,n.GuiDataCollection.MGDataTable=oe.Instance,n.RuntimeContextBase.noContextId=le.RC_NO_CONTEXT_ID},a.prototype.InitCircularReferencesBypasses=function(){O.createNewtask=br.CreateTask,wr.createNewCommandsTable=Jr.createCommandsTable,o.eventsManager=kr.Instance,o.mgDataTable=oe.Instance,o.envParamsTable=lt.Instance,o.globalParams=nt.Instance,o.languageData=pe.Instance,o.environment=et.Instance},a.Main=function(e){a.StartExecution(e),r.Logger.Instance.Flush()},a.StopExecution=function(){return T(this,void 0,void 0,(function(){var e;return h(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),re.GetInstance().IsAbortingMagicEngine=!0,oe.Instance.StartupMgData.getFirstTask().ClosingFormUI=!0,[4,oe.Instance.StartupMgData.getFirstTask().endTask(!0,!1,!1)];case 1:return n.sent(),[3,3];case 2:if(!((e=n.sent())instanceof t.ApplicationException))throw e;return r.Logger.Instance.WriteExceptionToLog(e),[3,3];case 3:return[2]}}))}))},a.StartExecution=function(e){return T(this,void 0,void 0,(function(){var s;return h(this,(function(i){switch(i.label){case 0:return re.setNativeHttpClient(e),[4,a.Instance.LoadExecutionProps()];case 1:return i.sent()?(a.Instance._guiEventsProcessor=new xr,a.Instance.InitGuiManager(),a.Instance.InitCircularReferencesBypasses(),"Version : 4.800.2",console.log("Magic Web Client. Version : 4.800.2"),re.GetInstance().HttpCommunicationTimeoutMS=ne.Instance.GetFirstHttpRequestTimeout(),kr.Instance.Init(),r.Logger.Instance.Initialize(le.GetInstance().parseLogLevel(ne.Instance.getInternalLogLevel()),ne.Instance.getInternalLogSync(),!1),s=new Or(new Jr,new Jr,0,null,!1),[4,oe.Instance.addMGData(s,0,!0)]):[3,4];case 2:return i.sent(),[4,a.Instance.WorkThreadExecution()];case 3:return i.sent(),r.Logger.Instance.ShouldLog()&&r.Logger.Instance.WriteToLog(r.OSEnvironment.EolSeq+"Ended on "+r.DateTimeUtils.ToString(t.DateTime.Now,"dd/MM/yyyy",r.Logger.Instance)+r.OSEnvironment.EolSeq+r.OSEnvironment.EolSeq,!1),[3,6];case 4:return[4,ge.Instance.MessageBox("Error","Failed to load server configuration file ("+this._executionPropertiesFileName+")",n.Styles.MSGBOX_ICON_ERROR|n.Styles.MSGBOX_BUTTON_OK)];case 5:i.sent(),i.label=6;case 6:return[2]}}))}))},a.prototype.LoadExecutionProps=function(){return T(this,void 0,void 0,(function(){var e,r,n;return h(this,(function(s){switch(s.label){case 0:e="",r=!0,s.label=1;case 1:return s.trys.push([1,3,,4]),n=new t.RefParam(!1),[4,re.GetInstance().GetContent(a._executionPropertiesFileName,null,!1,n)];case 2:return e=s.sent(),ne.Instance.Init(JSON.parse(e)),[3,4];case 3:return s.sent(),r=!1,[3,4];case 4:return[2,r]}}))}))},a.prototype.copyExecutionProps=function(){throw new t.Exception("copyExecutionProps not implemented")},a.prototype.getDebugClient=function(){return this._debugClient},a.prototype.getURLFromExecutionProperties=function(e){var n=null,a=ne.Instance.GetExecutionProperty[e];if(null!=a){a.startsWith("/")&&(a=ne.Instance.getProtocol()+"://"+ne.Instance.getServer()+a);try{n=new URL(a),t.Debug.Assert("http:"===n.protocol||"https:"===n.protocol)}catch(e){r.Logger.Instance.WriteExceptionToLog(e)}}return n},a.prototype.getLogonWindowIconURL=function(){return this.getURLFromExecutionProperties(n.GuiConstants.STR_LOGO_WIN_ICON_URL)},a.prototype.getLogonWindowImageURL=function(){return this.getURLFromExecutionProperties(n.GuiConstants.STR_LOGON_IMAGE_URL)},a.prototype.isDelayInProgress=function(){return this._delayInProgress},a.prototype.setDelayInProgress=function(e){this._delayInProgress=e},a.prototype.GetGlobalUniqueSessionID=function(){return this._globalUniqueSessionId},a.getExecutionPropertiesFileName=function(){var e=null,r=e.lastIndexOf("\\");return t.NString.Remove(e,r+1,e.length-r-1)+E.EXECUTION_PROPERTIES_FILE_NAME},a.GetControlPictureMask=function(e,t){var r=null,n=oe.Instance.GetTaskByID(e);return null!==t&&(r=n.getForm().GetCtrl(t).getPIC()),r},a.GetFormattedValue=function(e,t,a){var s=null,i=oe.Instance.GetTaskByID(e),o=null,l=a;if(null!==t&&(o=i.getForm().GetCtrl(t)),null!=o&&o.DataType==r.StorageAttribute.NUMERIC){s=o.getPIC();var u=String(a),c=s.getUnformattedNumericPic(),_=n.DisplayConvertor.Instance.toNum(u,c,0);l=n.DisplayConvertor.Instance.fromNum(_,s)}return l},a.GetRangedValue=function(e,t,r){var n=oe.Instance.GetTaskByID(e);return null!==t?n.getForm().GetCtrl(t).getRangedValue(r):null},a.ValidateControlValue=function(e,t,r){var n=oe.Instance.GetTaskByID(e);return null!==t?n.getForm().GetCtrl(t).validate(r):null},a.GetFldRanges=function(e,t){var r=oe.Instance.GetTaskByID(e);return null!==t?r.getForm().GetCtrl(t).getRanges():null},a.TransCacheExists=function(){var e=o.mgDataTable.getCurrMGData().clientTransactionCacheExists(),t=o.mgDataTable.getCurrMGData().serverTransactionCacheExists();return e||t},a.prototype.RegisterDelegates=function(){Z.GetExecutionProperty_Event=ne.Instance.GetExecutionProperty.bind(ne.Instance),Z.GetRuntimeCtxID_Event=this.GetRuntimeCtxID.bind(this),Z.GetGlobalUniqueSessionID_Event=this.GetGlobalUniqueSessionID.bind(this),Z.ShouldDisplayGenericError_Event=ne.Instance.ShouldDisplayGenericError.bind(ne.Instance)},a.prototype.GetRuntimeCtxID=function(){return n.RuntimeContextBase.Instance.ContextID},a.TerminateContextUsingFetchAPI=function(){if(!le.IsSessionReInitializing){re.GetInstance().IsAbortingMagicEngine=!0,oe.Instance.getCurrMGData().CmdsToServer.Clear();var t=Qe.CreateContextTerminationEventCommand(oe.Instance.StartupMgData.getFirstTask().getTaskTag());oe.Instance.getCurrMGData().CmdsToServer.Add(t),le.GetInstance().Execute(e.CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS)}},a}();en._instance=null,en._executionPropertiesFileName="./assets/server-config.json";var tn=function(){function e(){}return e.Initialize=function(e){en.Main(e)},e.TerminateMagic=function(){return T(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,en.StopExecution()];case 1:return e.sent(),[2]}}))}))},e.registerExecuteCommandsCallback=function(e){n.UIBridge.getInstance().registerExecuteCommandsCallback(e)},e.registerInteractiveCallback=function(e){n.UIBridge.getInstance().registerInteractiveCallback(e)},e.insertEvent=function(e){en.Instance.AddEvent(e)},e.GetControlPictureMask=function(e,t){return en.GetControlPictureMask(e,t)},e.GetFormattedValue=function(e,t,r){return en.GetFormattedValue(e,t,r)},e.GetRangedValue=function(e,t,r){return en.GetRangedValue(e,t,r)},e.ValidateControlValue=function(e,t,r){return en.ValidateControlValue(e,t,r)},e.GetFldRanges=function(e,t){return en.GetFldRanges(e,t)},e.TransCacheExists=function(){return en.TransCacheExists()},e.TerminateContextUsingFetchAPI=function(){en.TerminateContextUsingFetchAPI()},e}(),rn=function(e,t){this.taskCtlIdx=0,this.realIdx=0,this.taskCtlIdx=e,this.realIdx=t};rn.PRIME_NUMBER=37,rn.SEED=23;var nn=function(){},an=function(){function e(){}return e.StartCurrentExecutable=function(e){throw new t.NotImplementedException},e}();e.AbortCommand=Vr,e.AccessHelper=o,e.ActionManager=Rr,e.AddLocateCommand=Kr,e.AddRangeCommand=Wr,e.AddSortCommand=qr,e.AddUserLocateDataViewCommand=me,e.AddUserLocateRemoteDataViewCommand=Kt,e.AddUserRangeDataviewCommand=Se,e.AddUserRangeRemoteDataViewCommand=Ht,e.AddUserSortDataViewCommand=Me,e.AddUserSortRemoteDataViewCommand=zt,e.Argument=v,e.ArgumentsList=L,e.Boundary=At,e.BrowserEscEventCommand=Pe,e.ClientManager=en,e.ClientOriginatedCommand=f,e.ClientOriginatedCommandSerializer=Zr,e.ClientOriginatedCommandTaskTag=C,e.ClientRefreshCommand=Dr,e.ClientTargetedCommandBase=Pr,e.ColumnSortEventCommand=ke,e.CommandFactory=Qe,e.CommandSerializationHelper=A,e.CommandsProcessorBase=Q,e.CommandsProcessorManager=Te,e.CommandsTable=Jr,e.CompMainPrgTable=yr,e.ComputeEventCommand=we,e.ConstInterface=E,e.ConstUtils=Ur,e.ContextTerminationEventCommand=ze,e.ContextTimeoutResetCommand=qe,e.ControlItemsRefreshCommand=Le,e.CookieService=ut,e.CreatedFormVector=tr,e.CurrentClientVersion=$r,e.DataSourceIdKey=rn,e.DataView=yt,e.DataViewBase=pt,e.DataViewCommandBase=wt,e.DataViewOutputCommand=Ne,e.DataviewCommand=Ce,e.DataviewHeaderBase=ft,e.DataviewHeaderFactory=ur,e.DataviewHeaders=_r,e.DataviewHeadersSaxHandler=cr,e.DataviewManager=$t,e.DataviewManagerBase=Ft,e.DcValuesReference=dt,e.DummyDataViewCommand=Ut,e.DvCache=Ot,e.EnhancedVerifyCommand=Xr,e.EnvParamsTable=lt,e.Environment=et,e.EnvironmentDetails=tt,e.EvaluateCommand=He,e.Event=k,e.EventCommand=R,e.EventHandler=hr,e.EventHandlerPosition=Ae,e.EventsManager=kr,e.ExecOperCommand=q,e.ExecutionStack=z,e.ExecutionStackEntry=Y,e.ExpDesc=Ie,e.ExpStrTracker=Tt,e.ExpTable=fr,e.Expression=Er,e.ExpressionDict=fe,e.ExpressionEvaluator=ct,e.ExpressionLocalJpn=de,e.Expression_ReturnValue=Ir,e.FetchDataControlValuesEventCommand=ye,e.Field=Rt,e.FieldBase=M,e.FieldsTableExt=Mt,e.FlowMonitorInterface=V,e.FlowMonitorQueue=U,e.FormsTable=Ar,e.GUIManager=ge,e.GlobalCommandsManager=Lr,e.GlobalParams=nt,e.GlobalParamsQueryCommand=Ke,e.GuiEventsProcessor=xr,e.HandlersTable=gr,e.HeapSort=sr,e.HttpClientAsync=te,e.HttpClientBase=$,e.HttpClientEvents=Z,e.HttpClientSync=ee,e.HttpManager=re,e.HttpUtility=se,e.IClientTargetedCommand=Gr,e.IndexChangeEventCommand=De,e.IniputForceWriteCommand=Ye,e.InteractiveCommunicationsFailureHandler=_e,e.Key=ar,e.LanguageData=pe,e.LastFocusedManager=G,e.MGData=Or,e.MGDataCollection=oe,e.MagicBridge=tn,e.MenusDeserializer=nn,e.MgControl=P,e.MgForm=rr,e.MgPriorityBlockingQueue=F,e.MgPriorityQueue=D,e.MirrorExpVal=rt,e.MirrorPrmMap=$e,e.MirrorString=ot,e.NonReversibleExitEventCommand=Ve,e.NullValueException=_t,e.OpenURLCommand=wr,e.OpeningTaskDetails=y,e.Operation=it,e.OperationTable=Tr,e.PrmMap=Je,e.Process=an,e.QueryCommand=We,e.RCTimer=K,e.Recompute=Ct,e.RecomputeCommand=Ue,e.RecomputeTable=dr,e.Record=gt,e.RecordOutOfDataViewException=mt,e.RecordsTable=Et,e.RefreshEventCommand=be,e.RefreshScreenEventCommand=xe,e.RemoteCommandsProcessor=le,e.RemoteControlItemsRefreshCommand=Qt,e.RemoteDataViewCommandBase=Vt,e.RemoteDataViewCommandFactory=Zt,e.RemoteDataViewCommandUpdateNonModifiable=Bt,e.RemoteDataviewHeader=lr,e.RemoteDataviewManager=Jt,e.RemoteTaskService=nr,e.ResetLocateCommand=Yr,e.ResetRangeCommand=Hr,e.ResetSortCommand=jr,e.ResetUserLocateRemoteDataviewCommand=Yt,e.ResetUserRangeRemoteDataviewCommand=Wt,e.ResetUserSortRemoteDataviewCommand=qt,e.ResultCommand=zr,e.ResultValue=jt,e.RetVals=pr,e.ReturnResult=Pt,e.ReturnResultBase=Gt,e.RollbackEventCommand=S,e.RunTimeEvent=w,e.RunTimeEventBase=x,e.SET_DISPLAYLINE_BY_DV=Lt,e.Scrambler=j,e.SelectProgramCommand=je,e.ServerConfig=ne,e.ServerError=ae,e.SetTransactionStateDataviewCommand=ve,e.SetTransactionStateRemoteDataViewCommand=Xt,e.Sort=Ze,e.SortCollection=er,e.SubformOpenEventCommand=Fe,e.SubformRefreshEventCommand=Ge,e.TableCache=or,e.TableCacheManager=ir,e.Task=br,e.TaskBase=b,e.TaskServiceBase=Dt,e.TaskTransactionManager=xt,e.TasksTable=O,e.Transaction=kt,e.TransactionCommand=Be,e.UniqueIDUtils=Fr,e.UnloadCommand=Xe,e.UserDetails=at,e.UserEventsTable=Cr,e.UserRange=N,e.VerifyCommand=Br,e.WriteMessageToServerLogCommand=Oe,e.XMLBasedCommandBuilder=Qr,e.XMLBasedDcValuesBuilder=vt,e.YesNoExp=st,e.getGuiEventObj=function(e,t,r,a){return void 0===a&&(a=!1),{EventType:e,TaskID:null,ControlName:t,Line:r,PageSize:0,Value:null,RouterPath:null,RouterOutletName:null,RouterParams:null,modifiers:n.Modifiers.MODIFIER_NONE,keyCode:0,externalValue:null,param:null,fromButton:a}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=magic-xpa-engine.umd.min.js.map
|