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

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.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=\"mt-32 p-24 mb-16 border-3 borderTabClass\">\n    <div class=\"w-100-p font-weight-500 font-14\">\n        PAGES AS TRANSACTION\n    </div>\n    <div class=\"my-16\">\n        <p-radioButton value=\"0\"  label=\"Do not Consider page as  a transaction(default)\" [disabled]=\"enableDisKeywordList.PAGE_AS_TRANSACTION\" [(ngModel)]=\"radPageAsTrans\"></p-radioButton>\n    </div>\n    <div class=\"my-16\">\n        <p-radioButton value=\"1\"  label=\"Consider each page as a transaction\" [disabled]=\"enableDisKeywordList.PAGE_AS_TRANSACTION\" [(ngModel)]=\"radPageAsTrans\"></p-radioButton>\n    </div>\n    <div class=\"my-16\">\n        <p-radioButton value=\"2\"  label=\"Consider each page's success or failure as distinct transaction\" [disabled]=\"enableDisKeywordList.PAGE_AS_TRANSACTION\" [(ngModel)]=\"radPageAsTrans\"></p-radioButton>\n    </div>\n    <div class=\"my-16\">\n        <p-radioButton value=\"3\"  label=\"Consider each page status as different transactions\" [disabled]=\"enableDisKeywordList.PAGE_AS_TRANSACTION\" [(ngModel)]=\"radPageAsTrans\"></p-radioButton>\n    </div>\n    <div class=\"mt-16\">\n        <p-checkbox label=\"Do not add 'tx_' prefix in transaction name \"  value=\"0\" binary=\"true\" [disabled]=\"radPageAsTrans == 0 || enableDisKeywordList.PAGE_AS_TRANSACTION\" [(ngModel)]=\"chkPageAsTrans\"></p-checkbox>\n    </div>\n</div>\n\n<div class=\"mt-32 p-24 mb-16 border-3 borderTabClass\">\n    <div class=\"w-100-p font-weight-500 font-14\">\n        ADVANCE TRANSACTION\n    </div>\n    <div class=\" w-100-p p-grid p-align-center\">\n        <div class=\"p-col-3 pl-0\">Select transaction grouping in transaction detail</div>\n        <div class=\"p-col-2 p-col-nogutter mr-15\">\n            <p-dropdown placeholder=\"Select Transaction Group\"  [options]=\"lstTxGroup\" [disabled]=\"enableDisKeywordList.TX_GROUPING\"  [(ngModel)]=\"valTxGroup\"[style]=\"{ 'min-width' : '100%' }\"  dropdownIcon=\"icons8 icons8-expand-arrow\"></p-dropdown>\n        </div>\n        <div class=\"p-col-2 p-col-nogutter mr-15\">\n            <p-fileUpload name=\"files[]\" styleClass=\"ui-button-secondary uploadUpArrow\" pTooltip=\"Upload file with .tgp extension\" tooltipPosition=\"top\"\n            (onError)=\"errorInImportingFile($event)\" [url]=\"uploadUrl\"\n            mode=\"basic\" auto=\"true\" [showUploadButton]=\"false\" [showCancelButton]=\"false\" accept=\".tgp\"\n            chooseLabel=\"Upload File\"  (onUpload)=\"onBasicUpload($event)\" (onBeforeUpload)=\"onBeforeUpload($event)\">\n        </p-fileUpload>\n        </div>\n    </div>\n</div>\n ");

/***/ }),

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("@charset \"UTF-8\";\napp-scenario-transactions .borderTabClass {\n  border-style: solid;\n  border-width: 1px;\n  border-radius: 3px;\n}\napp-scenario-transactions .big-btn.ui-button {\n  height: calc(3.5em + 0.35rem + 2px);\n  font-size: 14px;\n}\napp-scenario-transactions .big-btn.ui-button .pi-folder {\n  font-size: 28px;\n  left: 0.25em;\n}\napp-scenario-transactions .upLoadBtn .ui-fileupload .ui-fileupload-buttonbar {\n  padding: 30px 50px 30px 50px;\n}\napp-scenario-transactions .upLoadBtn .ui-fileupload-content {\n  padding: 30px 50px 30px 50px;\n}\napp-scenario-transactions .uploadUpArrow.ui-fileupload-choose .ui-button-icon-left.pi-plus::before {\n  content: \"\";\n  font-family: primeicons;\n}");

/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: ScenarioTransactionsComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScenarioTransactionsComponent", function() { return ScenarioTransactionsComponent; });
/* 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 _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../interface/scenario-state */ "./src/app/pages/scenario/interface/scenario-state.ts");
/* harmony import */ var _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../service/additional-setting-data-service */ "./src/app/pages/scenario/service/additional-setting-data-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 _constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../constants/scen-keyword-constants */ "./src/app/pages/scenario/constants/scen-keyword-constants.ts");
/* harmony import */ var src_app_pages_home_load_test_services_load_test_utils_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/pages/home/load-test/services/load-test-utils.service */ "./src/app/pages/home/load-test/services/load-test-utils.service.ts");
/* harmony import */ var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! src/app/core/session/session.service */ "./src/app/core/session/session.service.ts");











let ScenarioTransactionsComponent = class ScenarioTransactionsComponent {
    constructor(keywordDefinition, dataService, scenUtilsService, schData, scenarioHttpService, loadTestUtility, sessionService) {
        this.keywordDefinition = keywordDefinition;
        this.dataService = dataService;
        this.scenUtilsService = scenUtilsService;
        this.schData = schData;
        this.scenarioHttpService = scenarioHttpService;
        this.loadTestUtility = loadTestUtility;
        this.sessionService = sessionService;
        this.enableDisKeywordList = {
            "TX_GROUPING": false,
            "PAGE_AS_TRANSACTION": false
        };
        this.screenKeywordList = Object.keys(this.enableDisKeywordList);
        //ENABLE_TRANSACTION_CUMULATIVE_GRAPHS
        // chkEnTransCumGrp: boolean = false;
        //PAGE_AS_TRANSACTION
        this.radPageAsTrans = 0;
        //TX_GROUPING
        this.lstTxGroup = [];
        this.arrKeywordData = {};
        this.uploadUrl = "";
    }
    /**
   * 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
   */
    canDeactivate() {
        try {
            if (this.validateAndSetKeywordArray() == false) {
                return false;
            }
        }
        catch (e) {
        }
        return true;
    }
    setDataInConf() {
        return true;
    }
    ngOnInit() {
        this.subscription = this.scenUtilsService.$saveGroupbasedSetting.subscribe((res) => {
            if (this.validateAndSetKeywordArray()) {
                this.scenUtilsService.saveComponentData(0, {});
            }
        });
        this.getListAndfillDataInDropDown();
        this.arrKeywordData = this.keywordDefinition.chkAndGetKeywrdDataWithAdditionalKeys(this.screenKeywordList);
        if (this.keywordDefinition.isArrKeywordDataEmpty(this.arrKeywordData, this.screenKeywordList)) {
            this.keywordDefinition.setRequestKeywordListInBody(this.screenKeywordList, "");
            let obj = this.keywordDefinition.getRequestJsonParm();
            this.getKeywordData(obj);
            //error case
            if (this.arrKeywordData == null)
                this.arrKeywordData = {};
        }
        else
            this.fillDataInComp();
        this.uploadUrl = this.loadTestUtility.$serverIP + "DashboardServer/v2/scenario/data/upload?for=uploadFile&destination=/home/cavisson/" + this.sessionService.preSession.controllerName + "/webapps/sys/tx_grouping" + "&userName=" + this.sessionService.session.cctx.u + "&productKey=" + this.sessionService.session.cctx.pk;
    }
    getKeywordData(obj) {
        this.scenarioHttpService.getDefaultKeywordData(obj).subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["GetDefaultKeywordDataLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["GetDefaultKeywordDataLoadedState"]) {
                this.keywordDefinition.setArrKeywordData(this.arrKeywordData, state.data, this.keywordDefinition.mergeKeywordData);
                this.fillDataInComp();
                return;
            }
        }, (state) => {
            console.log(state.error);
            return;
        });
    }
    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 = keyObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["KEYWORD_DATA_KEY"].DATA];
            this.enableDisKeywordList[strKeyword] = this.dataService.isCompEnable(this.dataService.getScenMode(), keyObj, strKeyword);
            if (dataObj == undefined)
                continue;
            if (dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]] == undefined)
                continue;
            let arrVal = dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]][0];
            if (arrVal == undefined)
                continue;
            if (strKeyword == 'TX_GROUPING') //TX_GROUPING
             {
                this.valTxGroup = arrVal[0] == undefined ? "" : arrVal[0];
            }
            else if (strKeyword == 'PAGE_AS_TRANSACTION') //PAGE_AS_TRANSACTION
             {
                this.radPageAsTrans = arrVal[0];
                if (arrVal[1] == '0')
                    this.chkPageAsTrans = false;
                else
                    this.chkPageAsTrans = true;
            }
        }
    }
    getListAndfillDataInDropDown() {
        this.scenarioHttpService.getTransGroupList().subscribe((state) => {
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadingState"]) {
                return;
            }
            if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["ScenarioRestLoadedState"]) {
                this.GetTransGroupListOnLoaded(state);
                return;
            }
        }, (state) => {
        });
    }
    GetTransGroupListOnLoaded(state) {
        this.lstTxGroup = [];
        this.lstTxGroup.push({ label: '--Select Transaction Group--', value: '' });
        let res = state.data;
        for (let i = 0; i < res.length; i++) {
            this.lstTxGroup.push({ label: res[i], value: res[i] });
        }
    }
    validateAndSetKeywordArray() {
        if (this.valTxGrpAndSet('TX_GROUPING', this.valTxGroup) == false)
            return false;
        let tempEvtLog = [];
        tempEvtLog.push(this.radPageAsTrans);
        if (this.radPageAsTrans > 0) {
            if (this.chkPageAsTrans)
                tempEvtLog.push(1);
            else
                tempEvtLog.push(0);
        }
        this.setArrayWithKeyWord('PAGE_AS_TRANSACTION', tempEvtLog);
        //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;
    }
    setArrayWithKeyWord(keyword, temObj) {
        let dataObj = this.arrKeywordData[keyword].data;
        if (dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]] != undefined) {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]] = [];
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]].push(temObj);
        }
        else {
            dataObj[_constants_scen_keyword_constants__WEBPACK_IMPORTED_MODULE_8__["GLOBAL_KEY"]] = [temObj];
        }
    }
    valTxGrpAndSet(keyword, data) {
        let temObj = [];
        if (data != null && data != undefined)
            temObj.push(data);
        this.setArrayWithKeyWord(keyword, temObj);
        return true;
    }
    onBeforeUpload(event) {
        return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
            yield this.createNewFolder().then((res => res));
        });
    }
    createNewFolder() {
        return new Promise((onFulfill, onReject) => {
            this.scenarioHttpService.newFolder({
                "testName": `webapps/sys/tx_grouping`,
                "userName": this.sessionService.session.cctx.u,
                "isForScen": "false"
            }).subscribe((state) => {
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["NewFolderLoadingState"]) {
                    return;
                }
                if (state instanceof _interface_scenario_state__WEBPACK_IMPORTED_MODULE_2__["NewFolderLoadedState"]) {
                    let res = state.data;
                    if (res.success == "false") {
                        this.scenUtilsService.errorMessage("Error in uploading file.");
                        onReject(false);
                    }
                    onFulfill(true);
                    return;
                }
            }, (state) => {
                onReject(false);
            });
        });
    }
    onBasicUpload(event) {
        let str = "";
        for (let file of event.files) {
            str += file.name;
        }
        this.scenUtilsService.successMessage(`${str} file imported successfully.`);
        this.getListAndfillDataInDropDown();
    }
    errorInImportingFile(event) {
        if (event.error)
            this.scenUtilsService.errorMessage(event.error.message);
    }
    ngOnDestroy() {
        if (this.subscription)
            this.subscription.unsubscribe();
    }
};
ScenarioTransactionsComponent.ctorParameters = () => [
    { type: _service_scen_keyword_definition_service__WEBPACK_IMPORTED_MODULE_4__["ScenKeywordDefinitionService"] },
    { type: _service_additional_setting_data_service__WEBPACK_IMPORTED_MODULE_3__["AdditionalSettingsDataService"] },
    { type: _service_scenario_utils_service__WEBPACK_IMPORTED_MODULE_6__["ScenarioUtilsService"] },
    { type: _service_sch_schedule_data_service__WEBPACK_IMPORTED_MODULE_7__["SchScheduleDataService"] },
    { type: _service_scenario_http_service__WEBPACK_IMPORTED_MODULE_5__["ScenarioHttpService"] },
    { type: src_app_pages_home_load_test_services_load_test_utils_service__WEBPACK_IMPORTED_MODULE_9__["LoadTestUtilsService"] },
    { type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_10__["SessionService"] }
];
ScenarioTransactionsComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
        selector: 'app-scenario-transactions',
        template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! raw-loader!./scenario-transactions.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.html")).default,
        encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
        styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(/*! ./scenario-transactions.component.scss */ "./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.scss")).default]
    })
], ScenarioTransactionsComponent);



/***/ }),

/***/ "./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.module.ts":
/*!***************************************************************************************************************!*\
  !*** ./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.module.ts ***!
  \***************************************************************************************************************/
/*! exports provided: ScenarioTransactionsModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScenarioTransactionsModule", function() { return ScenarioTransactionsModule; });
/* 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 _scenario_transactions_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scenario-transactions.component */ "./src/app/pages/scenario/additional-settings-main/scenario-transactions/scenario-transactions.component.ts");
/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/forms */ "./node_modules/@angular/forms/__ivy_ngcc__/fesm2015/forms.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
/* harmony import */ var primeng__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! primeng */ "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
/* 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");








const route = [
    { path: '', component: _scenario_transactions_component__WEBPACK_IMPORTED_MODULE_3__["ScenarioTransactionsComponent"], canDeactivate: [_interface_scenario_routing_guard__WEBPACK_IMPORTED_MODULE_7__["ScenRoutingGuard"]] }
];
let ScenarioTransactionsModule = class ScenarioTransactionsModule {
};
ScenarioTransactionsModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
    Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
        declarations: [_scenario_transactions_component__WEBPACK_IMPORTED_MODULE_3__["ScenarioTransactionsComponent"]],
        imports: [
            _angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["FileUploadModule"],
            _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["DropdownModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["ButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["BreadcrumbModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SelectButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["InputTextModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MultiSelectModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TableModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CardModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["CheckboxModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["MessageModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["RadioButtonModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["SpinnerModule"],
            primeng__WEBPACK_IMPORTED_MODULE_6__["TooltipModule"],
            _angular_router__WEBPACK_IMPORTED_MODULE_5__["RouterModule"].forChild(route),
        ],
        exports: [_scenario_transactions_component__WEBPACK_IMPORTED_MODULE_3__["ScenarioTransactionsComponent"]]
    })
], ScenarioTransactionsModule);



/***/ })

}]);