"use strict";
;
;
const oOAuth2 = new TOAuth2;
const domHtmlErr = document.getElementById("html_err");
const domLeftImgMenu = document.getElementById("left_img_menu");
const domRightWindow = document.getElementById("right_window");
const domLeftWindow = document.getElementById("left_window");
domLeftWindow.offsetX = 400;
const domLeftTreeWindow = document.getElementById("left_tree_window");
const domRightTableWindow = document.getElementById("right_table_window");
const domRightLeftImgMenu = document.getElementById("right_left_img_menu");
const domGroupName = document.getElementById("group_name");
const domGroupTopMenu = document.getElementById("group_top_menu");
const domGroupBigButtons = document.getElementById("group_big_buttons");
const domLeftUrl = document.getElementById("left_url");
const domLeftCryptoInfo = document.getElementById("left_crypto_info");
const domLeftDiagram = document.getElementById("left_diagram1");
const domLeftDiagramOccup = document.getElementById("left_diagram_occup1");
const domLeftDiagramRequir = document.getElementById("left_diagram_recuir1");
const domLeftSpace = document.getElementById("left_space");
const domLeftSrcImg = document.getElementById("left_src_img");
const domRightUrl = document.getElementById("right_url");
const domRightCryptoInfo = document.getElementById("right_crypto_info");
const domRightDiagram = document.getElementById("right_diagram1");
const domRightDiagramOccup = document.getElementById("right_diagram_occup1");
const domRightDiagramRequir = document.getElementById("right_diagram_recuir1");
const domRightSpace = document.getElementById("right_space");
const domRightSrcImg = document.getElementById("right_src_img");
const domRightImgMenu = document.getElementById("right_img_menu");
const domRightRightImgMenu = document.getElementById("right_right_img_menu");
const domCurrJobInfo = document.getElementById("curr_job_info");
const domUpperBox = document.getElementById("upper_job_detale_box");
const domLowBox = document.getElementById("low_job_detale_box");
const domRightBottomWindow = document.getElementById("right_bottom_window");
const domErr = document.getElementById("right_top_err_line");
const domMainMenu = document.getElementById("main_menu_window");
const domUserAndCompInfo = document.getElementById("user_and_comp_info");
const mapRequests = new TRetrayRequest(10);
const root = getComputedStyle(document.documentElement);
const oJobDetaleImgSize = splitValue(root.getPropertyValue('--job-detale-img-size'));
const oAutoDeploy = { "JobTreeAutoDeploy": true };
const domJobDirect = document.getElementById("job_direct");
if (domJobDirect) {
    domJobDirect.onclick = function (e) {
        e.stopPropagation();
        ChangeJobDirect();
    };
}
const domCurrJobName = document.getElementById("curr_job_name");
if (domCurrJobName) {
    domCurrJobName.onclick = (e) => {
        DeleteAllDropMenu();
        e.stopPropagation();
        OpenJobMenu(domCurrJobName);
    };
    domCurrJobName.oncontextmenu = (e) => {
        DeleteAllDropMenu();
        e.preventDefault();
        OpenJobMenu(domCurrJobName);
    };
}
const setNeedResetJob = new Set;
const debug_info = document.getElementById("debug_info");
const table_create = document.getElementById("table_create");
const state_processing = document.getElementById("state_processing");
const tree_change_processing = document.getElementById("tree_change_processing");
const cycle_time = document.getElementById("cycle_time");
let jsCurrJobOptions = {};
let jsProgramOptions = {};
let jsJobsTables = {};
const aGlobJobArray = [];
let aGlobGroup = null;
let sAllJobsGroupName = "All Jobs";
let aOpenFoldersInJobListTable = [];
let sNewJob = "";
let sDeletedJob = "";
let sHintIfNoTree = "Hint_No_Changes";
let bAutoAccSyncOn = false;
let pRightTableBody = null;
let pLeftTableBody = null;
let pJobListTable = null;
let pBigSignInDialog = null;
let pGlobalWaitinBox = null;
let bExtraJobsDetected = false;
let bFollowTheSync = true;
let bStopListJobStatusesResponseProcessing = false;
let bStopUpdateJobTable = false;
let bLastPrevSessionJobWasOpend = false;
let bJobTreeNarrowMode = false;
domLeftTreeWindow.onmouseenter = function () {
    isMouseIntoLeftWindow = true;
};
domLeftTreeWindow.onmouseleave = function () {
    isMouseIntoLeftWindow = false;
};
domLeftTreeWindow.fUserResize = () => {
    const domMoreBtn = document.getElementById("more_info");
    if (domMoreBtn && domMoreBtn.onclick && domMoreBtn.onclick.name) {
        SetLeftWindowWidth(domMoreBtn.onclick.name == "CreateLeftJobTree" ? "sLeftTableWidth" : "sJobListWidth");
    }
    MoveJobDetaleBox();
};
domRightTableWindow.onmouseenter = function () {
    isMouseIntoRightTableWindow = true;
};
domRightTableWindow.onmouseleave = function () {
    isMouseIntoRightTableWindow = false;
};
domRightTableWindow.fUserResize = function () {
    const nBottomLim = domRightWindow.getBoundingClientRect().bottom;
    const rect = domRightTableWindow.getBoundingClientRect();
    if (nBottomLim - rect.bottom < MIN_LOG_WIN_HEIGHT) {
        CloseLog();
        return;
    }
    oWebGuSettings.oJobTableParams.nRightWinH = rect.height;
    localStorage.setItem("oWebGuSettings", JSON.stringify(oWebGuSettings));
};
SetLayoutWitLangPage();
