(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["scenario-ssl-settings-scenario-ssl-settings-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.html":
/*!***********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.html ***!
  \***********************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div  class=\"my-24 pt-24 pb-8 px-24 borderTabClass border-3 mr-5\" >\r\n    <div class=\"font-16 font-weight-600 w-100-p mb-24\">CLIENT AUTHENTICATION</div>\r\n\r\n    <div class=\"w-100-p my-16 p-grid p-align-center\">\r\n        <div class=\"w-100-p\">\r\n            <p-checkbox  label=\"Client Authentication is used in the server\" binary=\"true\" [(ngModel)]=\"chkClientCertificate\"></p-checkbox>\r\n        </div>\r\n\r\n    <div *ngIf=\"chkClientCertificate\" class=\"p-grid w-100-p pl-30 p-align-center\">\r\n            <div class=\"p-col-fixed\">Client Certificate File</div>\r\n            <div class=\"p-col-3 ml-33\">\r\n                <p-dropdown placeholder=\"--Select Client Certificate File--\"  filter=\"true\"  [pTooltip]=\"sslCertFilePath == '-' ? '' : sslCertFilePath\" dropdownIcon=\"icons8 icons8-expand-arrow\" [options]=\"lstOptSslCertFilePath\" [(ngModel)]=\"sslCertFilePath\" [disabled]=\"enableDisKeywordList.G_SSL_CERT_FILE_PATH\" [style]=\"{'min-width':'100%'}\">\r\n                    <ng-template let-group pTemplate=\"item\">\r\n                        <div *ngIf=\"group.label != 'Add new certificate/key'\" class=\" w-100-p p-align-center p-justify-between p-grid \">\r\n                            <span >{{group.label}}</span>\r\n                        </div>\r\n                    </ng-template>\r\n                </p-dropdown>\r\n            </div>\r\n        \r\n        <div class=\"p-col-fixed p-grid p-align-center\">\r\n            <button type=\"button\" pButton class=\"ui-button-secondary\" pTooltip=\"Supported formats are .pem, .cer, .crt, .p7b, .p7r, .p12, .pfx\" (click)=\"sslFileChangeHandler($event,0)\" label=\"Upload\"\r\n                tooltipPosition=\"right\" icon=\"las-cloud-upload-alt-solid\"></button>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"w-100-p pl-30 p-grid p-align-center  my-8\" *ngIf=\"chkClientCertificate\">\r\n        <div class=\"p-col-fixed\">\r\n            <p-checkbox  label=\"Use Separate Key file\" [disabled]=\"!chkClientCertificate\" binary=\"true\" [(ngModel)]=\"chkClientKey\"></p-checkbox>\r\n        </div>\r\n        <ng-container *ngIf=\"chkClientKey && chkClientCertificate\">\r\n            <div class=\"p-col-3\">\r\n                <p-dropdown filter=\"true\" dropdownIcon=\"icons8 icons8-expand-arrow\" [pTooltip]=\"sslKeyFilePath == '-' ? '' : sslKeyFilePath\"  [options]=\"lstSslKeyFilePath\" [(ngModel)]=\"sslKeyFilePath\" [disabled]=\"enableDisKeywordList.G_SSL_KEY_FILE_PATH\" [style]=\"{'min-width':'100%'}\"></p-dropdown>\r\n            </div> \r\n            \r\n        <div class=\"p-col-fixed p-grid p-align-center\">\r\n            <button type=\"button\" pButton class=\"ui-button-secondary\" pTooltip=\"Supported formats are .pem, .cer, .crt, .p7b, .p7r, .p12, .pfx\" (click)=\"sslFileChangeHandler($event,1)\" label=\"Upload\"\r\n                tooltipPosition=\"right\" icon=\"las-cloud-upload-alt-solid\"></button>\r\n        </div>\r\n        </ng-container>\r\n    </div>\r\n    </div>\r\n   \r\n</div>\r\n\r\n<div class=\"my-24 pt-24 pb-8 px-24 borderTabClass border-3 mr-5\" >\r\n    <!--   ssl certificate start  -->\r\n    <div class=\"font-16 font-weight-600 w-100-p mb-24\">SERVER CERTIFICATE VERIFICATION</div>\r\n\r\n    <div class=\"p-grid p-col-12 p-align-center p-col-nogutter\">\r\n        <div class=\"p-col-12\" *ngFor=\"let option of sslCARadioButtonoptions\">\r\n                <p-radioButton name=\"sslCACertFile\" [value]=\"option.value\" [(ngModel)]=\"sslCACertSelectedValue\"\r\n                    inputId=\"{{ option.value }}\">\r\n                </p-radioButton>\r\n                <label class=\"mx-5\" [for]=\"option.value\">{{ option.label }}</label>\r\n            </div>\r\n    </div>\r\n    <div class=\"p-grid w-100-p p-align-center\" *ngIf=\"sslCACertSelectedValue != '0 0'\">\r\n            <div class=\"p-col-fixed\">Trust Root CA Certificates</div>\r\n            <div class=\"p-col-fixed min-width-300\">\r\n            <p-multiSelect *ngIf=\"!reloadForm\" styleClass=\"w-100-p\" class=\"w-100-p\" defaultLabel=\"--Select Server CA Certificate File--\" [options]=\"ssllstOptSslCertFilePath\"\r\n                [(ngModel)]=\"sslCACertFilePath\" optionLabel=\"label\" filter=\"true\">\r\n            </p-multiSelect>\r\n\r\n            </div>\r\n        \r\n        <div class=\"p-col-fixed\">\r\n            <button type=\"button\" pButton class=\"ui-button-secondary\" pTooltip=\"Supported formats are .pem, .cer, .crt, .p7b, .p7r, .p12, .pfx\" (click)=\"sslCAFileChangeHandler($event)\" label=\"Upload\"\r\n                tooltipPosition=\"right\" icon=\"las-cloud-upload-alt-solid\"></button>\r\n        </div>\r\n    </div>\r\n\r\n    <!--   ssl certificate end  -->\r\n</div>\r\n\r\n<div class=\"mt-32 \">\r\n    <button type=\"button\" (click)=\"showAdvBtn =!showAdvBtn\" class=\"btn-icon p-grid p-align-center mr-10\">\r\n        <span class=\"mx-2\">Advanced Settings</span>\r\n        <i [ngClass]=\" showAdvBtn ? 'icons8 icons8 icons8-collapse-arrow' : 'icons8 icons8-expand-arrow' \"></i>\r\n    </button>\r\n</div>\r\n\r\n<div *ngIf=\"showAdvBtn\"  class=\"w-100-p\">\r\n    <div class=\"w-100-p my-16 p-grid p-align-center\">\r\n            <div class=\"p-col-fixed width-130 p-grid p-align-center\">\r\n                <span>\r\n                    SSL Version\r\n                </span>\r\n                <i tooltipZIndex=\"12000\" pTooltip=\"All versions include, SSLV3, TLS 1.0, TLS 1.1, TLS 1.2 and TLS 1.3. The server may select any one of these versions. HTTP/3 will use TLS 1.3 version.\" type=\"button\" class=\"btn-icon mx-5 not-clickable icons8 icons8-info point\"></i>\r\n            </div>\r\n            <div class=\"p-col-2\">\r\n                <p-dropdown appendTo=\"body\"  dropdownIcon=\"icons8 icons8-expand-arrow\" [options]=\"lstTLSVersion\" [disabled]=\"enableDisKeywordList.G_TLS_VERSION\" [(ngModel)]=\"valTLSVersion\"></p-dropdown>\r\n            </div>\r\n    </div>\r\n\r\n    <div class=\"pl-0 my-16 p-grid p-align-center\">\r\n        <div class=\"p-col-fixed width-130\">SSL Sessions Reuse </div>\r\n        <div class=\"p-col-fixed width-100\">\r\n            <div class=\"ui-inputgroup w-100-p\">\r\n                <p-spinner inputStyleClass=\"w-100-p\" min=0 max=100 [disabled]=\"enableDisKeywordList.G_AVG_SSL_REUSE\" [(ngModel)]=\"txtAvgSsl\" (keypress)=\"validateQty($event)\"></p-spinner>\r\n                <span class=\"ui-inputgroup-addon px-5\">%</span>  \r\n            </div>\r\n        </div>\r\n        <div class=\"p-col\">\r\n            (Percentage of session which will reuse the SSL connection)\r\n        </div>\r\n    </div>\r\n    \r\n    <div class=\"w-100-p my-16 p-grid p-align-center\">\r\n        <div class=\"mr-24\">\r\n            <p-checkbox  label=\"SSL Clean Close\" binary=\"true\" [disabled]=\"enableDisKeywordList.G_SSL_CLEAN_CLOSE_ONLY\" [(ngModel)]=\"chkCleanClose\"></p-checkbox>\r\n        </div>\r\n        <div class=\"mr-24\">\r\n            <p-checkbox  label=\"Set TLS SNI (Server Name Indication) extension in the ClientHello message\" binary=\"true\" [disabled]=\"enableDisKeywordList.G_SSL_SETTINGS\" [(ngModel)]=\"chkSslSetting\"></p-checkbox>\r\n        </div>\r\n        <div class=\"\">\r\n            <p-checkbox  label=\"SSL Renegotiation\" binary=\"true\" [disabled]=\"enableDisKeywordList.G_SSL_RENEGOTIATION\" [(ngModel)]=\"chkSSLR\"></p-checkbox>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<div>\r\n    <input type=\"file\" #fileUpload accept=\".pem,.cer,.crt,.p7b,.p7r,.p12,.pfx\" class=\"upload\"\r\n        (click)=\"$event.target.value=null\" (change)=\"uploadFileMsg($event.target.files)\">\r\n</div>\r\n\r\n<div>\r\n    <input type=\"file\" #CAfileUpload accept=\".pem,.cer,.crt,.p7b,.p7r,.p12,.pfx\" class=\"upload\"\r\n        (click)=\"$event.target.value=null\" (change)=\"uploadFileMsg($event.target.files)\">\r\n</div>");

/***/ }),

/***/ "./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.scss":
/*!*********************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.scss ***!
  \*********************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("app-scenario-ssl-settings .borderTabClass {\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 3px;\n}\napp-scenario-ssl-settings .invisible {\n  opacity: 0;\n}\napp-scenario-ssl-settings .upload {\n  opacity: 0;\n}");

/***/ }),

/***/ "./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: ScenarioSslSettingsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScenarioSslSettingsComponent", function() { return ScenarioSslSettingsComponent; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var src_app_shared_file_manager_service_file_manager_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! src/app/shared/file-manager/service/file-manager.service */ "./src/app/shared/file-manager/service/file-manager.service.ts");
/* harmony import */ var _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../service/scen-keyword-definition.service */ "./src/app/pages/scenario/service/scen-keyword-definition.service.ts");
/* harmony import */ var _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../service/scenario-http.service */ "./src/app/pages/scenario/service/scenario-http.service.ts");
/* harmony import */ var _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../service/scenario-utils.service */ "./src/app/pages/scenario/service/scenario-utils.service.ts");
/* harmony import */ var _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../service/sch-schedule-data.service */ "./src/app/pages/scenario/service/sch-schedule-data.service.ts");
/* harmony import */ var _service_group_based_settings_data_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../service/group-based-settings-data.service */ "./src/app/pages/scenario/group-based-settings-main/service/group-based-settings-data.service.ts");
/* harmony import */ var _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../constants/scen-schedule-constants */ "./src/app/pages/scenario/constants/scen-schedule-constants.ts");
/* harmony import */ var _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../interface/scenario-state */ "./src/app/pages/scenario/interface/scenario-state.ts");
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/http.js");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");
/* harmony import */ var src_app_shared_header_work_profile_services_work_profile_active_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! src/app/shared/header/work-profile/services/work-profile-active.service */ "./src/app/shared/header/work-profile/services/work-profile-active.service.ts");














let ScenarioSslSettingsComponent = class ScenarioSslSettingsComponent {
    constructor(keywordDefinition, scenarioHttpService, dataService, schData, scenarioUtilsService, _apiService, confirmationService, session, activeWPService) {
        this.keywordDefinition = keywordDefinition;
        this.scenarioHttpService = scenarioHttpService;
        this.dataService = dataService;
        this.schData = schData;
        this.scenarioUtilsService = scenarioUtilsService;
        this._apiService = _apiService;
        this.confirmationService = confirmationService;
        this.session = session;
        this.activeWPService = activeWPService;
        this.showAdvBtn = false;
        this.chkClientCertificate = false;
        this.chkClientKey = false;
        this.sslCACertFilePath = [];
        this.sslCARadioButtonoptions = [
            { label: 'Accept all certificate', value: '0 0' },
            { label: 'Verify certificate only', value: '1 0' },
            { label: 'Verify certificate and host name', value: '1 1' }
        ];
        this.reloadForm = false;
        this.sslCACertSelectedValue = '0 0';
        this.enableDisKeywordList = {
            "G_SSL_CLEAN_CLOSE_ONLY": false,
            "G_SSL_SETTINGS": false,
            "G_AVG_SSL_REUSE": false,
            "G_SSL_RENEGOTIATION": false,
            "G_TLS_VERSION": false,
            "G_SSL_CERT_FILE_PATH": false,
            "G_SSL_KEY_FILE_PATH": false,
            "G_SSL_VERIFY_PEER": false,
            "G_SSL_CA_FILE_PATH": false
        };
        this.screenKeywordList = Object.keys(this.enableDisKeywordList);
        this.arrKeywordData = {}; //main obj of screen Keyword data.
        this.isGroupEnabled = ''; //set none if want to disable in that case where there is no groups
        this.flag = false;
        this.arrGrpList = [];
        this.selectedGrpInfo = _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"];
        this.lstTLSVersion = [];
        this.chkCleanClose = false;
        this.chkSslSetting = false;
        this.txtAvgSsl = 100;
        this.chkSSLR = false;
        this.lstOptSslCertFilePath = [];
        this.ssllstOptSslCertFilePath = [];
        this.sslCertFilePath = "";
        this.lstSslKeyFilePath = [];
        this.sslKeyFilePath = "";
        this.sslCertList = [];
        this.sslKeyList = [];
        this.showIcon = false;
        this.isFromCertficate = false;
        this.isCAFromCertficate = false;
        this.isFromkey = false;
        this.saveData = this.scenarioUtilsService.$saveGroupbasedSetting.subscribe((res) => {
            this.validateAndSaveData();
        });
        /**
     * Subscribing to events like add group, delete group or switch group from group based top menu.
     */
        this.grpAddDelSub = this.dataService.addGrpObservable$.subscribe((res) => {
            let validation = true;
            if (res['from'] == 'addGrp') {
                validation = this.addGroup(res['grpName']);
                this.dataService.emitOnAddedGrpObservable({ validation, grpName: this.selectedGrpInfo, from: res['from'] });
            }
            if (res['from'] == 'deleteGrp') {
                validation = this.deleteSelectedGroup(res['grpName']);
                this.dataService.emitOnAddedGrpObservable({ validation, grpName: this.selectedGrpInfo, from: res['from'] });
            }
            if (res['from'] == 'grpInfo') {
                validation = this.openGroupInfo(res['grpName']);
                this.dataService.emitOnAddedGrpObservable({ validation, grpName: this.selectedGrpInfo, from: res['from'] });
            }
        });
        this.lstTLSVersion = [];
        this.lstTLSVersion.push({ label: 'All Version(s)', value: 'ssl2_3' }); //ssl2_3
        this.lstTLSVersion.push({ label: 'SSL V3', value: 'ssl3' }); //ssl3
        this.lstTLSVersion.push({ label: 'TLS 1.0', value: 'tls1' }); //tls1
        this.lstTLSVersion.push({ label: 'TLS 1.1', value: 'tls1_1' }); //tls1_1
        this.lstTLSVersion.push({ label: 'TLS 1.2', value: 'tls1_2' }); //tls1_2
        this.lstTLSVersion.push({ label: 'TLS 1.3', value: 'tls1_3' });
        if (this.sslCertFilePath == 'addnew') {
            this.showIcon = true;
        }
    }
    canDeactivate() {
        //insert logic to check if there are pending changes here;
        //returning true will navigate without confirmation
        //returning false will show a confirm alert before navigating away
        try {
            if (this.validateAndSetKeywordArray() == false) {
                return false;
            }
        }
        catch (e) {
            console.log("can Deactivate in compponents", e);
        }
        return true;
    }
    setDataInConf() {
        return true;
    }
    ngAfterViewInit() {
        this.fileUploadElement = this.fileUploadRef.nativeElement;
        this.CAfileUploadElement = this.CAfileUploadRef.nativeElement;
    }
    ngOnInit() {
        this.fillSsCertlList();
        this.fileUpload = this.keywordDefinition.serverHost + '/DashboardServer/web/ImportAccessLogService/upload?for=scenSsl&productKey=' + this.session.session.cctx.pk;
        this.addGroupTab();
        this.arrKeywordData = this.keywordDefinition.chkAndGetKeywrdDataWithAdditionalKeys(this.screenKeywordList);
        if (this.keywordDefinition.isArrKeywordDataEmpty(this.arrKeywordData, this.screenKeywordList)) {
            this.keywordDefinition.setRequestKeywordListInBody(this.screenKeywordList, "ALL");
            let obj = this.keywordDefinition.getRequestJsonParm();
            this.getKeywordData(obj);
            //error case
            if (this.arrKeywordData == null)
                this.arrKeywordData = {};
        }
        else
            this.fillDataInComp();
    }
    getKeywordData(obj) {
        this.scenarioHttpService.getDefaultKeywordData(obj).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetDefaultKeywordDataLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetDefaultKeywordDataLoadedState"]) {
                this.keywordDefinition.setArrKeywordData(this.arrKeywordData, state.data, this.keywordDefinition.mergeKeywordData);
                this.fillDataInComp();
                return;
            }
        }, (state) => {
            console.log(state.error);
            return;
        });
    }
    addGroupTab() {
        this.arrGrpList = this.dataService.getGroupNameList();
        if (this.arrGrpList.length == 0) {
            this.isGroupEnabled = 'none';
        }
        else {
            this.isGroupEnabled = '';
        }
    }
    deleteSelectedGroup(groupName) {
        if (confirm("Clear SSL for group '" + groupName + "' ? \n It will use default settings.")) {
            if (groupName != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                for (let i = 0; i < this.dataService.groupList.length; i++) {
                    if (this.dataService.groupList[i].label == groupName) {
                        this.dataService.groupList.splice(i, 1);
                        i = i - 1;
                    }
                }
                if (this.validateAndSetKeywordArray() == false)
                    return false;
                let sslCleanCloseData = this.arrKeywordData["G_SSL_CLEAN_CLOSE_ONLY"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslCleanCloseData != undefined) {
                    delete this.arrKeywordData["G_SSL_CLEAN_CLOSE_ONLY"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                }
                let sslRene = this.arrKeywordData["G_SSL_RENEGOTIATION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslRene != undefined) {
                    delete this.arrKeywordData["G_SSL_RENEGOTIATION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                }
                let sslSetting = this.arrKeywordData["G_SSL_SETTINGS"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslSetting != undefined)
                    delete this.arrKeywordData["G_SSL_SETTINGS"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let sslReuse = this.arrKeywordData["G_AVG_SSL_REUSE"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslReuse != undefined)
                    delete this.arrKeywordData["G_AVG_SSL_REUSE"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let tlsVersion = this.arrKeywordData["G_TLS_VERSION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (tlsVersion != undefined)
                    delete this.arrKeywordData["G_TLS_VERSION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let sslKeyCertFilePath = this.arrKeywordData["G_SSL_CERT_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslKeyCertFilePath != undefined)
                    delete this.arrKeywordData["G_SSL_CERT_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let sslVerifyPeer = this.arrKeywordData["G_SSL_VERIFY_PEER"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslVerifyPeer != undefined)
                    delete this.arrKeywordData["G_SSL_VERIFY_PEER"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let sslCAFilePath = this.arrKeywordData["G_SSL_CA_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslCAFilePath != undefined)
                    delete this.arrKeywordData["G_SSL_CA_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                let sslKeyFilePath = this.arrKeywordData["G_SSL_KEY_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (sslKeyFilePath != undefined)
                    delete this.arrKeywordData["G_SSL_KEY_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][groupName];
                if (groupName == this.selectedGrpInfo)
                    this.openGroupInfo(_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"], true);
                else
                    this.openGroupInfo(this.selectedGrpInfo, true);
            }
        }
        return true;
    }
    /**
  * this function is called, when user clicks on any group tab
  */
    openGroupInfo(groupName, isValidate) {
        if (isValidate == undefined) {
            if (this.validateAndSetKeywordArray() == false)
                return;
        }
        this.selectedGrpInfo = groupName;
        let avgSslObj = this.arrKeywordData["G_AVG_SSL_REUSE"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let avgSslArr = avgSslObj[groupName];
        this.setAvgSslData(avgSslArr);
        let sslSettingObj = this.arrKeywordData["G_SSL_SETTINGS"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslSettingArr = sslSettingObj[groupName];
        this.setSslSettingData(sslSettingArr);
        let cleanSslObj = this.arrKeywordData["G_SSL_CLEAN_CLOSE_ONLY"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let cleanSslArr = cleanSslObj[groupName];
        this.setCleanSslData(cleanSslArr);
        let sslReneObj = this.arrKeywordData["G_SSL_RENEGOTIATION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslReneArr = sslReneObj[groupName];
        this.setSslRenegotiation(sslReneArr);
        let tlsVerObj = this.arrKeywordData["G_TLS_VERSION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let tlsVerArr = tlsVerObj[groupName];
        this.setTlsVersion(tlsVerArr);
        let sslCertFilePathObj = this.arrKeywordData["G_SSL_CERT_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslCertFilePathArr = sslCertFilePathObj[groupName];
        this.setSslCertFilePath(sslCertFilePathArr);
        let sslKeyFilePathObj = this.arrKeywordData["G_SSL_KEY_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslKeyFilePathArr = sslKeyFilePathObj[groupName];
        this.setSslKeyFilePath(sslKeyFilePathArr);
        let sslVerifyPeerObj = this.arrKeywordData["G_SSL_VERIFY_PEER"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslVerifyPeerArr = sslVerifyPeerObj[groupName];
        this.setSslVerifyPeer(sslVerifyPeerArr);
        let sslCAFilePathObj = this.arrKeywordData["G_SSL_CA_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        let sslCAFilePathArr = sslCAFilePathObj[groupName];
        this.setSslCAFilePath(sslCAFilePathArr);
        return true;
    }
    addGroup(grpName) {
        if (this.validateAndSetKeywordArray() == false)
            return false;
        this.selectedGrpInfo = this.dataService.selectedGrp = grpName;
        this.flag = false;
        this.showGrpTab(grpName);
        this.copyKeywordFromDefault();
        return true;
    }
    uploadFileMsg(files) {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            this.customFile = "custom/" + files[0].name;
            if (this.isFromCertficate) {
                this.lstOptSslCertFilePath.push({ 'label': this.customFile, 'value': this.customFile });
                this.sslCertList.push(this.customFile);
            }
            else if (this.isFromkey) {
                this.lstSslKeyFilePath.push({ 'label': this.customFile, 'value': this.customFile });
                this.sslKeyList.push(this.customFile);
            }
            if (this.isCAFromCertficate) {
                this.ssllstOptSslCertFilePath.push({ 'label': this.customFile, 'value': this.customFile });
                this.sslCertList.push(this.customFile);
            }
            let queryParam = `for=fileExplorer&destination=/home/cavisson/${this.session.preSession.controllerName}/cert/custom`;
            let formData = new FormData();
            formData.append(files[0].name, files[0]);
            this.scenarioHttpService.uploadFile(queryParam, formData).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["ScenarioRestLoadedState"]) {
                    let res = state.data;
                    if (res.success == "false")
                        this.scenarioUtilsService.errorMessage(res.msg);
                    else
                        this.scenarioUtilsService.successMessage("File uploaded sucessfully.");
                    if (this.isFromkey)
                        this.sslKeyFilePath = this.customFile;
                    else if (this.isFromCertficate)
                        this.sslCertFilePath = this.customFile;
                    if (this.isCAFromCertficate) {
                        this.reloadForm = true;
                        setTimeout(() => {
                            this.sslCACertFilePath = this.ssllstOptSslCertFilePath.filter(opt => opt.value === this.customFile);
                            this.reloadForm = false;
                        }, 0);
                    }
                    return Promise.resolve();
                }
            }, (state) => {
                return Promise.resolve();
            });
            this.dataService.successMessage("File Uploaded Successfully");
        });
    }
    validateAndSetKeywordArray() {
        if (this.chkClientCertificate) {
            if (this.sslCertFilePath == "-" || this.sslCertFilePath == "" || this.sslCertFilePath == null) {
                this.scenarioUtilsService.errorMessage("Please select Client Certificate File.");
                return false;
            }
        }
        if (this.chkClientKey) {
            if (this.sslKeyFilePath == "-" || this.sslKeyFilePath == "" || this.sslCertFilePath == null) {
                this.scenarioUtilsService.errorMessage("Please select Client Key File.");
                return false;
            }
        }
        if (this.txtAvgSsl > 100) {
            this.scenarioUtilsService.errorMessage("Average ssl reuse should be less than equal to 100%");
            return false;
        }
        if (this.txtAvgSsl == null) {
            this.scenarioUtilsService.errorMessage("Average ssl reuse cannot be empty");
            return false;
        }
        if (this.validateAndSetData("G_AVG_SSL_REUSE", this.txtAvgSsl) == false)
            return false;
        if (this.validateAndSetData("G_TLS_VERSION", this.valTLSVersion) == false)
            return false;
        let sslVal = 0;
        if (this.chkSslSetting)
            sslVal = 1;
        if (this.validateAndSetData("G_SSL_SETTINGS", sslVal) == false)
            return false;
        let cleanVal = 0;
        if (this.chkCleanClose)
            cleanVal = 1;
        if (this.validateAndSetData("G_SSL_CLEAN_CLOSE_ONLY", cleanVal) == false)
            return false;
        let sslValue = 0;
        if (this.chkSSLR)
            sslValue = 1;
        if (this.validateAndSetData("G_SSL_RENEGOTIATION", sslValue) == false)
            return false;
        if (this.validateAndSetCertFilePath() == false)
            return false;
        if (this.validateAndSetKeyFilePath() == false)
            return false;
        if (this.validateAndSetSslVerifyPeer() == false)
            return false;
        if (this.validateAndSetSslCaFilePath() == false)
            return false;
        //All validation success
        for (let i = 0; i < this.screenKeywordList.length; i++) {
            this.schData.saveKeywordData[this.screenKeywordList[i]] = this.arrKeywordData[this.screenKeywordList[i]].data;
        }
        return true;
    }
    validateAndSetCertFilePath() {
        let temObj = [];
        if (this.chkClientCertificate)
            temObj.push(this.sslCertFilePath == null ? '' : this.sslCertFilePath);
        this.setArrayWithKeyWordForScaler("G_SSL_CERT_FILE_PATH", temObj);
        return true;
    }
    validateAndSetKeyFilePath() {
        let temObj = [];
        if (this.chkClientCertificate && !this.chkClientKey)
            temObj.push(this.sslCertFilePath == null ? '' : this.sslCertFilePath);
        else if (this.chkClientCertificate && this.chkClientKey)
            temObj.push(this.sslKeyFilePath);
        this.setArrayWithKeyWordForScaler("G_SSL_KEY_FILE_PATH", temObj);
        return true;
    }
    validateAndSetSslVerifyPeer() {
        let temObj = [];
        temObj.push(this.sslCACertSelectedValue == null ? '0 0' : this.sslCACertSelectedValue);
        this.setArrayWithKeyWordForScaler("G_SSL_VERIFY_PEER", temObj);
        return true;
    }
    validateAndSetSslCaFilePath() {
        let temObj = [];
        if (this.sslCACertSelectedValue != null)
            temObj.push(!this.sslCACertFilePath || this.sslCACertFilePath.length == 0 || this.sslCACertSelectedValue == '0 0'
                ? ''
                : this.sslCACertFilePath.map(item => item.value).join(', '));
        this.setArrayWithKeyWordForScaler("G_SSL_CA_FILE_PATH", temObj);
        return true;
    }
    validateAndSetData(keyword, value) {
        let tempObj = [];
        tempObj.push(value);
        this.setArrayWithKeyWordForScaler(keyword, tempObj);
        return true;
    }
    copyKeywordFromDefault() {
        for (let i = 0; i < this.screenKeywordList.length; i++) {
            let grpArr = this.arrKeywordData[this.screenKeywordList[i]][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
            if (this.screenKeywordList[i] == "G_AVG_SSL_REUSE")
                this.setAvgSslData(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_SETTINGS")
                this.setSslSettingData(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_CLEAN_CLOSE_ONLY")
                this.setCleanSslData(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_RENEGOTIATION")
                this.setSslRenegotiation(grpArr);
            else if (this.screenKeywordList[i] == "G_TLS_VERSION")
                this.setTlsVersion(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_CERT_FILE_PATH")
                this.setSslCertFilePath(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_KEY_FILE_PATH")
                this.setSslKeyFilePath(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_VERIFY_PEER")
                this.setSslVerifyPeer(grpArr);
            else if (this.screenKeywordList[i] == "G_SSL_CA_FILE_PATH")
                this.setSslCAFilePath(grpArr);
        }
    }
    setAvgSslData(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_AVG_SSL_REUSE"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.txtAvgSsl = (grpArr[0] == undefined) ? 100 : grpArr[0];
    }
    setSslCertFilePath(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_CERT_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.sslCertFilePath = (grpArr[0] == undefined) ? "" : grpArr[0];
        this.chkClientCertificate = (this.sslCertFilePath == "-" || this.sslCertFilePath == "") ? false : true;
    }
    setSslKeyFilePath(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_KEY_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.sslKeyFilePath = (grpArr[0] == undefined) ? "" : grpArr[0];
        this.chkClientKey = (this.sslKeyFilePath == "-" || this.sslKeyFilePath == "") ? false : true;
    }
    setSslVerifyPeer(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_VERIFY_PEER"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        if (grpArr[0] === undefined || grpArr[0] === '-') {
            this.sslCACertSelectedValue = '0 0';
        }
        else if ((grpArr[0] === '0' || grpArr[0] === '1') &&
            (grpArr[1] === '0' || grpArr[1] === '1')) {
            this.sslCACertSelectedValue = `${grpArr[0]} ${grpArr[1]}`;
        }
        else {
            this.sslCACertSelectedValue = grpArr[0];
        }
    }
    setSslCAFilePath(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_CA_FILE_PATH"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        if (grpArr[0] == undefined || grpArr[0] == '-')
            grpArr[0] = "";
        const firstValue = grpArr[0] || '';
        const selectedValues = firstValue.includes(',')
            ? firstValue.split(',').map(s => s.trim())
            : [firstValue.trim()];
        this.sslCACertFilePath = this.ssllstOptSslCertFilePath.filter(opt => selectedValues.includes(opt.value));
    }
    setTlsVersion(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_TLS_VERSION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.valTLSVersion = (grpArr[0] == undefined) ? "ssl2_3" : grpArr[0];
    }
    setSslSettingData(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_SETTINGS"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.chkSslSetting = (grpArr[0] == undefined || grpArr[0] == "0") ? false : true;
    }
    setCleanSslData(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_CLEAN_CLOSE_ONLY"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.chkCleanClose = (grpArr[0] == undefined || grpArr[0] == "0") ? false : true;
    }
    setSslRenegotiation(grpArr) {
        if (grpArr == undefined)
            grpArr = this.arrKeywordData["G_SSL_RENEGOTIATION"][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]][0];
        else
            grpArr = grpArr[0];
        this.chkSSLR = (grpArr[0] == undefined || grpArr[0] == "0") ? false : true;
    }
    /** this method will set data for 'G_OVERRIDE_RECORDED_THINK_TIME' */
    setArrayWithKeyWordForScaler(keyword, temObj) {
        let dataObj = this.arrKeywordData[keyword][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
        if (dataObj[this.selectedGrpInfo] != undefined) {
            dataObj[this.selectedGrpInfo] = [];
            dataObj[this.selectedGrpInfo].push(temObj);
        }
        else {
            dataObj[this.selectedGrpInfo] = [temObj];
        }
    }
    /**this function is used to add the Group Tab, selected by user */
    showGrpTab(groupLabel) {
        try {
            if (this.arrGrpList.indexOf(groupLabel) == -1)
                return;
            if (this.dataService.groupList.length != 0) {
                for (let i = 0; i < this.dataService.groupList.length; i++) {
                    if (this.dataService.groupList[i].label == groupLabel)
                        this.flag = true;
                }
                if (!this.flag) {
                    this.dataService.groupList.push({ label: groupLabel, value: groupLabel });
                    for (let j = 0; j < this.groupList.length; j++) {
                        if (this.groupList[j].label == groupLabel)
                            this.groupList.splice(j, 1);
                    }
                    this.flag = false;
                }
            }
            else {
                this.dataService.groupList.push({ label: groupLabel, value: groupLabel });
                for (let j = 0; j < this.groupList.length; j++) {
                    if (this.groupList[j].label == groupLabel)
                        this.groupList.splice(j, 1);
                }
            }
        }
        catch (e) {
            console.log("Exception in showGrpTab method = ", e);
        }
    }
    fillDataInComp() {
        let keys = Object.keys(this.arrKeywordData);
        for (let i = 0; i < keys.length; i++) //keyword iteration
         {
            let strKeyword = keys[i];
            let keyObj = this.arrKeywordData[strKeyword];
            let dataObj = this.arrKeywordData[strKeyword][_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["KEYWORD_DATA_KEY"].DATA];
            this.enableDisKeywordList[strKeyword] = this.dataService.isCompEnable(this.dataService.getScenMode(), keyObj, strKeyword);
            if (dataObj == undefined) {
                continue;
            }
            let grpKeys = Object.keys(dataObj);
            //no group present
            if (grpKeys.length == 0)
                continue;
            if (strKeyword == 'G_AVG_SSL_REUSE') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setAvgSslData(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_SETTINGS') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslSettingData(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_CLEAN_CLOSE_ONLY') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setCleanSslData(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_RENEGOTIATION') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslRenegotiation(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_TLS_VERSION') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setTlsVersion(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_CERT_FILE_PATH') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslCertFilePath(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_KEY_FILE_PATH') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslKeyFilePath(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_VERIFY_PEER') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslVerifyPeer(grpArr);
                    }
                }
            }
            else if (strKeyword == 'G_SSL_CA_FILE_PATH') {
                for (let ii = 0; ii < grpKeys.length; ii++) {
                    if (grpKeys[ii] != _constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]) {
                        this.showGrpTab(grpKeys[ii]);
                    }
                    else //this is the default tab case at the time when user click from left tree 
                     {
                        let grpArr = dataObj[_constants_scen_schedule_constants__WEBPACK_IMPORTED_MODULE_9__["DEFAULT_GROUP"]];
                        this.setSslCAFilePath(grpArr);
                    }
                }
            }
        }
        //Updating group options (group dropdown) icon in group based settings top menu.
        this.dataService.upDateGroupMenuIcon();
    }
    fillSsCertlList() {
        let params = new _angular_common_http__WEBPACK_IMPORTED_MODULE_11__["HttpParams"]();
        params = params.set('productKey', this.session.session.cctx.pk);
        if (this.sslCertList.length > 0) {
            this.appendCertificateData();
        }
        else {
            this.scenarioHttpService.getSslCertData(params).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetSslCertDataLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetSslCertDataLoadedState"]) {
                    let data = state.data;
                    this.sslCertList = data;
                    this.appendCertificateData();
                    return;
                }
            }, (state) => {
                return;
            });
        }
        if (this.sslKeyList.length > 0) {
            this.appendKeyData();
        }
        else {
            this.scenarioHttpService.getSslCertData(params).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetSslCertDataLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_10__["GetSslCertDataLoadedState"]) {
                    let data = state.data;
                    this.sslKeyList = data;
                    this.appendKeyData();
                    return;
                }
            }, (state) => {
                return;
            });
        }
    }
    appendCertificateData() {
        let arr = [];
        for (var i = 0; i < this.sslCertList.length; i++) {
            arr.push({ label: this.sslCertList[i], value: this.sslCertList[i] });
        }
        this.ssllstOptSslCertFilePath = JSON.parse(JSON.stringify(arr));
        arr.unshift({ label: '--Select SSL Certificate File --', value: null });
        this.lstOptSslCertFilePath = arr;
    }
    appendKeyData() {
        let arr = [];
        for (var i = 0; i < this.sslKeyList.length; i++) {
            arr.push(this.sslKeyList[i]);
        }
        arr.unshift('--Select Client Key File --');
        this.lstSslKeyFilePath = this.dataService.createSelectItem(arr);
    }
    sslFileChangeHandler(e, isCertificate) {
        if (isCertificate == 0) {
            this.isFromCertficate = true;
            this.isFromkey = false;
        }
        else {
            this.isFromkey = true;
            this.isFromCertficate = false;
        }
        this.showIcon = true;
        this.fileUploadElement.click();
        if (this.isFromCertficate)
            this.sslCertFilePath = null;
        else
            this.sslKeyFilePath = null;
    }
    sslCAFileChangeHandler(e) {
        this.isCAFromCertficate = true;
        this.showIcon = true;
        this.CAfileUploadElement.click();
        if (this.isCAFromCertficate)
            this.sslCACertFilePath = [];
    }
    validateAndSaveData() {
        if (this.validateAndSetKeywordArray()) {
            this.scenarioUtilsService.saveComponentData(0, {});
        }
    }
    validateQty(event) {
        if (event.charCode > 31 && (event.charCode < 48 || event.charCode > 57))
            return false;
        return true;
    }
    ngOnDestroy() {
        if (this.grpAddDelSub)
            this.grpAddDelSub.unsubscribe();
        if (this.saveData)
            this.saveData.unsubscribe();
        this.dataService.resetGrpBasedTopMenuData();
    }
};
ScenarioSslSettingsComponent.ctorParameters = () => [
    { type: _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_4__["ScenKeywordDefinitionService"] },
    { type: _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_5__["ScenarioHttpService"] },
    { type: _service_group_based_settings_data_service__WEBPACK_IMPORTED_MODULE_8__["GroupBasedSettingDataService"] },
    { type: _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_7__["SchScheduleDataService"] },
    { type: _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_6__["ScenarioUtilsService"] },
    { type: src_app_shared_file_manager_service_file_manager_service__WEBPACK_IMPORTED_MODULE_3__["FileManagerService"] },
    { type: primeng__WEBPACK_IMPORTED_MODULE_2__["ConfirmationService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_12__["SessionService"] },
    { type: src_app_shared_header_work_profile_services_work_profile_active_service__WEBPACK_IMPORTED_MODULE_13__["WorkProfileActiveService"] }
];
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('fileUpload')
], ScenarioSslSettingsComponent.prototype, "fileUploadRef", void 0);
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewChild"])('CAfileUpload')
], ScenarioSslSettingsComponent.prototype, "CAfileUploadRef", void 0);
ScenarioSslSettingsComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-scenario-ssl-settings',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./scenario-ssl-settings.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./scenario-ssl-settings.component.scss */ "./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.scss")).default]
    })
], ScenarioSslSettingsComponent);



/***/ }),

/***/ "./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.module.ts":
/*!****************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.module.ts ***!
  \****************************************************************************************************************/
/*! exports provided: ScenarioSslSettingsModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScenarioSslSettingsModule", function() { return ScenarioSslSettingsModule; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/__ivy_ngcc__/fesm2015/core.js");
/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ "./node_modules/@angular/common/__ivy_ngcc__/fesm2015/common.js");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* harmony import */ var _scenario_ssl_settings_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./scenario-ssl-settings.component */ "./src/app/pages/scenario/group-based-settings-main/scenario-ssl-settings/scenario-ssl-settings.component.ts");
/* harmony import */ var _interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../interface/scenario-routing-guard */ "./src/app/pages/scenario/interface/scenario-routing-guard.ts");
/* harmony import */ var primeng_toast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! primeng/toast */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-toast.js");









const route = [
    { path: '', component: _scenario_ssl_settings_component__WEBPACK_IMPORTED_MODULE_6__["ScenarioSslSettingsComponent"], canDeactivate: [_interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_7__["ScenRoutingGuard"]] }
];
let ScenarioSslSettingsModule = class ScenarioSslSettingsModule {
};
ScenarioSslSettingsModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_scenario_ssl_settings_component__WEBPACK_IMPORTED_MODULE_6__["ScenarioSslSettingsComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MultiSelectModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_3__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["MessageModule"],
            primeng_toast__WEBPACK_IMPORTED_MODULE_8__["ToastModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["RadioButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["TooltipModule"],
            primeng__WEBPACK_IMPORTED_MODULE_5__["FileUploadModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_4__["RouterModule"].forChild(route),
        ],
        exports: [_scenario_ssl_settings_component__WEBPACK_IMPORTED_MODULE_6__["ScenarioSslSettingsComponent"]]
    })
], ScenarioSslSettingsModule);



/***/ })

}]);