"use strict";
;
;
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 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) {
        DeleteAllDropMenu();
        e.stopPropagation();
        ChangeJobDirect();
    };
    domJobDirect.oncontextmenu = function (e) {
        DeleteAllDropMenu();
        e.preventDefault();
        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;
let jsCurrJobOptions = {};
let jsProgramOptions = {};
let jsJobsTables = {};
glob = new CGlobData;
let aGlobGroup = null;
let sAllJobsGroupName = "All Jobs";
let aOpenFoldersInJobListTable = [];
let sNewJob = "";
let sDeletedJob = "";
let sHintIfNoTree = "Hint_No_Changes";
let bAutoAccSyncOn = false;
let pBigSignInDialog = null;
let pGlobalWaitinBox = null;
let bExtraJobsDetected = false;
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) {
        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;
    }
    oSavedData.oJobTableParams.nRightWinH = rect.height;
    localStorage.setItem("oSavedData", JSON.stringify(oSavedData));
};
document.addEventListener('DOMContentLoaded', async function () {
    await AsyncPreauthByCookieProcess();
    await LanguagePageDownload();
    document.getElementById("more_info").onclick = () => { LeftJobTableCreating(); };
    document.getElementById("open_log_window").onclick = () => { OpenLog(); };
    document.getElementById("log_close_X").onclick = () => { CloseLog(); };
    SetLayout();
});
class GsFolderOptionsFS {
    constructor() {
        this.nCompressType = 0;
        this.nCipherType = 0;
        this.bEncryptBodies = false;
        this.bEncryptPaths = false;
        this.sEncryptionPasswdGarbledA = "";
        this.sEncryptionPasswdEncMasterA = "";
        this.bPreferCompressed = false;
        this.bPreferEncrypted = false;
        this.bFatLike = false;
        this.bUnMountOnDisconnect = false;
        this.nFilePerms = 0;
        this.nFolderPerms = 0;
        this.bNoGsData = false;
    }
}
