function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }

function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }

function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }

function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }

function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }

(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["netocean-timeout-netocean-timeout-module"], {
  /***/
  "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.html":
  /*!***************************************************************************************************************************************!*\
    !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.html ***!
    \***************************************************************************************************************************************/

  /*! exports provided: default */

  /***/
  function _node_modules_rawLoader_dist_cjsJs_src_app_pages_home_netocean_components_netoceanTimeout_netoceanTimeoutComponentHtml(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony default export */


    __webpack_exports__["default"] = "<div class=\"w-100-p\">\n    <div class=\"w-100-p headerSection\">\n        <div class=\"w-100-p mt-5 p-grid py-5 pl-16 p-align-center p-justify-between\">\n        <div class=\"p-grid p-align-center py-5\">\n            <span pTooltip=\"No need to restart Service Virtualization server after add Timeout Configuration\" class=\"font-16 text-uppercase font-weight-700\">Connection Fault Configuration</span>\n            <span class=\"mx-5\">\n                <app-help  [helpFileName]=\"'connectionFaultSettings'\"  [helpTitle]=\"'Connection Fault Settings'\" [helpFolder]=\"'netOcean'\"></app-help>\n            </span>\n        </div>\n        </div>\n    </div>\n    <div class=\"w-100-p  border-all border-5 border-radius-3 p-grid p-align-center my-24 px-16 pb-16\">\n        <h3 class=\"text-uppercase w-100-p\" >connection blocking configurations</h3>\n        \n        <div class=\"p-grid w-100-p p-align-center\">\n            <div class=\"width-110\">Service Port</div>\n            <div class=\"ui-g-2\"> \n                <p-multiSelect [options]=\"portList\" [(ngModel)]=\"selectedPort\" dropdownIcon=\"icons8 icons8-expand-arrow\" [style]=\"{'min-width':'100%'}\"></p-multiSelect>    \n            </div>\n        </div>\n        <div class=\"p-grid p-align-center\">\n            <div class=\"width-110\">Start Date-Time</div>\n            <div class=\"ui-g-2\">\n                <p-calendar inputStyleClass=\"w-100-p\" [(ngModel)]=\"startDate\" [showIcon]=\"true\" placeholder='Start Date/Time' mode='portrait' format=\"MM/dd/yyyy\" name=\"dated\" [disabled] = \"currentTime\"></p-calendar>\n            </div>\n            <div class=\"ui-g-1\">\n            <input pInputText type=\"text\" class=\"w-100-p\" [(ngModel)]=\"startTime\" [disabled] = \"currentTime\">\n            </div>\n            <div class=\"ui-g-2\">\n                <p-checkbox label=\"Immediate\" [(ngModel)]=\"currentTime\" [binary]=\"true\"></p-checkbox>\n            </div>\n            <div class=\"width-110\">End Date-Time</div>\n            <div class=\"ui-g-2\">\n            <p-calendar class=\"iptable\" inputStyleClass=\"w-100-p\" [showIcon]=\"true\" [(ngModel)]=\"endDate\" placeholder='End Date/Time' mode='portrait' format=\"MM/dd/yyyy\" name=\"dated\"></p-calendar>\n            </div>\n            <div class=\"ui-g-1\">\n            <input pInputText type=\"text\" class=\"w-100-p\"[(ngModel)]=\"endTime\">\n            </div>\n            <button pButton [disabled]=\"!_commonService.$globalConfigPermission\" type=\"button\" (click)=\"addRow()\" label=\"Add\" class=\"ui-button-rounded mx-3\"></button>\n        </div>\n    </div>\n</div>\n\n\n\n\n\n   \n    <div>\n      <cav-table [value]=\"serviceTimeout\" [headerRelativePath]=\"headerRelativePath\" [scrollable]=\"true\" [responsive] =\"true\"  \n      scrollHeight=\"320px\" [selection]=\"selectedRows\" (clickButtonEvent)=\"clickButtonEvent($event)\"></cav-table>\n    </div> \n\n    <p-confirmDialog class=\"confirmdialog\" header=\"Confirmation\" acceptButtonStyleClass=\"ui-button-rounded px-10\"\n    rejectButtonStyleClass=\"ui-button-rounded ui-button-secondary px-10 mx-6\" acceptIcon=\"null\" rejectIcon=\"null\"\n    acceptLabel=\"Yes\" rejectLabel=\"No\"></p-confirmDialog>\n<p-toast></p-toast>\n";
    /***/
  },

  /***/
  "./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.scss":
  /*!*************************************************************************************************!*\
    !*** ./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.scss ***!
    \*************************************************************************************************/

  /*! exports provided: default */

  /***/
  function _src_app_pages_home_netocean_components_netoceanTimeout_netoceanTimeoutComponentScss(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony default export */


    __webpack_exports__["default"] = "app-netocean-timeout .newTableCaption .ui-table .ui-table-caption {\n  background-color: #fff !important;\n}";
    /***/
  },

  /***/
  "./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.ts":
  /*!***********************************************************************************************!*\
    !*** ./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.ts ***!
    \***********************************************************************************************/

  /*! exports provided: NetoceanTimeoutComponent */

  /***/
  function _src_app_pages_home_netocean_components_netoceanTimeout_netoceanTimeoutComponentTs(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "NetoceanTimeoutComponent", function () {
      return NetoceanTimeoutComponent;
    });
    /* 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 moment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
    /*! moment */
    "./node_modules/moment/moment.js");
    /* harmony import */


    var moment__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_2__);
    /* harmony import */


    var _services_netocean_common_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ../../services/netocean-common.service */
    "./src/app/pages/home/netocean/services/netocean-common.service.ts");
    /* harmony import */


    var _services_netocean_config_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
    /*! ../../services/netocean-config-service */
    "./src/app/pages/home/netocean/services/netocean-config-service.ts");
    /* harmony import */


    var _services_netocean_rest_api_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! ../../services/netocean-rest-api.service */
    "./src/app/pages/home/netocean/services/netocean-rest-api.service.ts");
    /* harmony import */


    var src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! src/app/core/session/session.service */
    "./src/app/core/session/session.service.ts");
    /* harmony import */


    var primeng_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! primeng/api */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng-api.js");

    var NetoceanTimeoutComponent = /*#__PURE__*/function () {
      function NetoceanTimeoutComponent(sessionService, _netoceanConfig, NetoceanRestApi, _commonService, messageService) {
        _classCallCheck(this, NetoceanTimeoutComponent);

        this.sessionService = sessionService;
        this._netoceanConfig = _netoceanConfig;
        this.NetoceanRestApi = NetoceanRestApi;
        this._commonService = _commonService;
        this.messageService = messageService;
        this.hpdPort = [];
        this.serviceTimeout = [];
        this.selectedRows = [];
        this.currentTime = false;
        this.msgs = [];
        this.headerRelativePath = "netocean/configuration/connection-fault.json";
      }

      return _createClass(NetoceanTimeoutComponent, [{
        key: "ngOnInit",
        value: function ngOnInit() {
          this.getTableData();
          this.getCurrentDate(); // Method to refresh port list in dropdown

          this.updatePortList();
        }
      }, {
        key: "getCurrentDate",
        value: function getCurrentDate() {
          try {
            // let timeZoneId = sessionStorage.getItem('timeZoneId');
            var timeZoneId = sessionStorage.getItem('_nvtimezone');
            var date = moment__WEBPACK_IMPORTED_MODULE_2__["tz"](Date.now(), timeZoneId).format('HH:mm_MM/DD/YYYY');
            var curDate = date.split('_');
            this.startTime = curDate[0];
            this.startDate = curDate[1];
            var durationTime = this.convertTime();
            var sethours = durationTime.getHours().toString();
            var setMinutes = durationTime.getMinutes().toString();

            if (durationTime.getHours() < 10) {
              sethours = '0' + sethours.toString();
            }

            if (durationTime.getMinutes() < 10) {
              setMinutes = '0' + setMinutes;
            }

            this.endDate = moment__WEBPACK_IMPORTED_MODULE_2__(new Date(durationTime)).format('MM/DD/YYYY');
            this.endTime = sethours + ':' + setMinutes;
          } catch (error) {
            console.error(error);
          }
        }
      }, {
        key: "getCurrentTimestamp",
        value: function getCurrentTimestamp() {
          var timeZoneId = sessionStorage.getItem('_nvtimezone');
          var date = moment__WEBPACK_IMPORTED_MODULE_2__["tz"](Date.now(), timeZoneId).format('HH:mm MM/DD/YYYY');
          return date.toString();
        }
      }, {
        key: "convertTime",
        value: function convertTime() {
          try {
            var startDateObj = new Date(this.startDate + ' ' + this.startTime);
            var runTime = startDateObj.getTime();
            var date = new Date(runTime);
            return date;
          } catch (error) {
            console.error(error);
          }
        } // Refresh port list on dropdown

      }, {
        key: "updatePortList",
        value: function updatePortList() {
          var _this = this;

          var url = 'getGlobalHttpSettings?isRtc=false';
          this.hpdPort = [];
          this.NetoceanRestApi.getDataByRESTAPI(url, '', '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
            // Getting list of all hpd ports
            if (result['HPD_PORT'].includes(',')) {
              var HPDPORT = result['HPD_PORT'].split(',');

              for (var i = 0; i < HPDPORT.length; i++) {
                _this.hpdPort.push(HPDPORT[i]);
              }
            } else {
              _this.hpdPort.push(result['HPD_PORT']);
            }

            if (result['HPD_SPORT'].includes(',')) {
              var HPDSPORT = result['HPD_SPORT'].split(',');

              for (var _i = 0; _i < HPDSPORT.length; _i++) {
                _this.hpdPort.push(HPDSPORT[_i]);
              }
            } else {
              _this.hpdPort.push(result['HPD_SPORT']);
            } // Iterating through the current status of jobs to find out stopped and completed jobs


            for (var _i2 = 0; _i2 < _this.serviceTimeout.length; _i2++) {
              // Finding status of current job
              var currentStatus = parseInt(_this.serviceTimeout[_i2]['status']);
              ; // Removing the jobs with status 3 and 4

              if (currentStatus != 3 && currentStatus != 4) {
                var currentPort = _this.serviceTimeout[_i2]['port'];

                if (currentPort.indexOf(",") != -1) {
                  var usedPorts = _this.serviceTimeout[_i2]['port'].split(",");

                  for (var j = 0; j < usedPorts.length; j++) {
                    for (var k = 0; k < _this.hpdPort.length; k++) {
                      if (usedPorts[j] == _this.hpdPort[k]) {
                        _this.hpdPort.splice(k, 1);

                        break;
                      }
                    }
                  }
                } else {
                  for (var _i3 = 0; _i3 < _this.hpdPort.length; _i3++) {
                    if (_this.hpdPort[_i3] == currentPort) {
                      _this.hpdPort.splice(_i3, 1);

                      break;
                    }
                  }
                }
              }
            }

            setTimeout(function () {
              _this.selectedPort = [];
              _this.portList = [];

              for (var _i4 = 0; _i4 < _this.hpdPort.length; _i4++) {
                _this.portList.push({
                  label: _this.hpdPort[_i4],
                  value: _this.hpdPort[_i4]
                });
              }

              if (_this.portList.length > 0) _this.selectedPort.push(_this.portList[0]['value']);
            }, 100);
          });
        }
        /*Method is used to get the table data when we load the component */

      }, {
        key: "getTableData",
        value: function getTableData() {
          var _this2 = this;

          try {
            this.NetoceanRestApi.getDataByRESTAPI('getTimeoutInfo', '', '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
              _this2.serviceTimeout = result;
              _this2.selectedRows = [];
            });
          } catch (e) {
            console.error(e);
          }
        }
        /*Method is used to add the values in the data table */

      }, {
        key: "addRow",
        value: function addRow() {
          var _this3 = this;

          try {
            var port;
            port = this.selectedPort[0];
            /*validation for selecting port */

            if (this.selectedPort == null || this.selectedPort == undefined || this.selectedPort.length == 0) {
              alert('Please select at least one port.');
              return;
            }
            /**check a time i hh:mm */


            var pattern = '^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$';

            if (!this.startTime.match(pattern)) {
              alert('Please enter time in HH:MM');
              return;
            }

            if (!this.endTime.match(pattern)) {
              alert('Please enter time in HH:MM');
              return;
            }

            if ((this.startDate == null || this.startDate == undefined) && this.currentTime == false) {
              alert('Please enter start date.');
              return;
            } else if ((this.startTime == null || this.startTime == undefined) && this.currentTime == false) {
              alert('Please enter start time.');
              return;
            } else if (this.endDate == null || this.endDate == undefined) {
              alert('Please enter end date.');
              return;
            } else if (this.endTime == null || this.endTime == undefined) {
              alert('Please enter end time.');
              return;
            }
            /*converting date to format */


            var startDate = moment__WEBPACK_IMPORTED_MODULE_2__(new Date(this.startDate)).format('MM/DD/YYYY');
            var endDate = moment__WEBPACK_IMPORTED_MODULE_2__(new Date(this.endDate)).format('MM/DD/YYYY');
            var var1 = startDate;
            var var2 = this.startTime;

            for (var j = 0; j < this.selectedPort.length; j++) {
              if (j > 0) {
                port = port + ',' + this.selectedPort[j];
              }
            }

            var url = this._netoceanConfig.getHostURL() + '/ProductUI/productSummary/NetOceanWebService/addTimeoutString';
            var number = this.generateRandomNum();
            /**checking a start and end date/time objects */

            var date = moment__WEBPACK_IMPORTED_MODULE_2__["tz"](Date.now(), this.sessionService.serverTimeInfo.zoneId).format('HH:mm_MM/DD/YY');
            var curDate = date.split('_');
            var sdate = curDate[0];
            var stime = curDate[1];
            var stString = startDate + ' ' + this.startTime;
            var endString = endDate + ' ' + this.endTime;
            var checkCurrDate = sdate + ' ' + stime;

            if (this.currentTime == true) {
              var1 = 'Current';
              var2 = 'Current';

              if (new Date(stString) >= new Date(endString)) {
                alert('Start date/time must be less than End date/time');
                return;
              }

              if (new Date(endString) < new Date(checkCurrDate)) {
                alert('End date/time can not be less than Current date/time.');
                return;
              }
            } else {
              /**check a start and end date */
              if (new Date(stString) >= new Date(endString)) {
                alert('Start date/time must be less than End date/time');
                return;
              }

              if (new Date(stString) < new Date(checkCurrDate)) {
                alert('Start date/time can not be less than Current date/time.');
                return;
              }
            }

            var jsonData = 'HPD_TIMEOUT' + ' ' + number + ' ' + port + ' ' + var2 + ' ' + var1 + ' ' + this.endTime + ' ' + endDate + ' ' + '-1' + ' ' + this.getCurrentTimestamp() + ' ' + this.getCurrentTimestamp() + ' - -';
            var data = {
              'info': jsonData
            };
            this.NetoceanRestApi.getDataFromRESTUsingPOSTReq('addTimeoutString', '', data, '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
              _this3.messageService.add({
                severity: 'info',
                summary: 'Confirmed',
                detail: 'Process added Successfully.'
              });

              _this3.serviceTimeout = result;
              _this3.selectedRows = []; // Refresh the list of ports in dropdown

              _this3.updatePortList();
            });
          } catch (e) {
            console.error(e);
          }
        }
        /*Method is used to generate the random number. */

      }, {
        key: "generateRandomNum",
        value: function generateRandomNum() {
          try {
            return Math.floor(Math.random() * 1000 + 1);
          } catch (e) {
            console.error(e);
          }
        }
        /*Method is used to delete the values of row in the data table. */

      }, {
        key: "deleteRow",
        value: function deleteRow(selectedRows) {
          var _this4 = this;

          try {
            if (this.checkPermission()) {
              return;
            }

            if (selectedRows == undefined || selectedRows.length != 1) {
              alert('Please select only one row.');
              return;
            }

            if (selectedRows[0]['status'] == -1 || selectedRows[0]['status'] == 3 || selectedRows[0]['status'] == 4) {
              var url = this._netoceanConfig.getHostURL() + '/ProductUI/productSummary/NetOceanWebService/deleteTimeoutString';
              var data = {
                'id': selectedRows[0]['id']
              };
              this.NetoceanRestApi.getDataFromRESTUsingPOSTReq('deleteTimeoutString', '', data, '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
                _this4.messageService.add({
                  severity: 'info',
                  summary: 'Confirmed',
                  detail: 'Process Deleted Successfully.'
                });

                _this4.serviceTimeout = result;
                _this4.selectedRows = [];

                _this4.updatePortList();
              });
            } else {
              alert('Process can not be deleted for the selected status.');
              return;
            }
          } catch (e) {
            console.error(e);
          }
        }
        /*Method is used to update the values of row in the data table */

      }, {
        key: "updateRow",
        value: function updateRow(selectedRows) {
          var _this5 = this;

          try {
            if (this.checkPermission()) {
              return;
            }

            if (selectedRows == undefined || selectedRows.length !== 1) {
              alert('Please select only one row.');
              return;
            }

            if (selectedRows[0]['status'] == -1) {
              var number = this.generateRandomNum();
              var data = {
                'id': selectedRows[0]['id'],
                'info': "HPD_TIMEOUT" + ' ' + number + ' ' + selectedRows[0]['port'] + ' ' + selectedRows[0]['startTime'] + ' ' + selectedRows[0]['startDate'] + ' ' + selectedRows[0]['endTime'] + ' ' + selectedRows[0]['enddate'] + " -1 " + selectedRows[0]['configuredTime'] + ' ' + selectedRows[0]['configuredDate'] + ' ' + this.getCurrentTimestamp() + ' - -'
              };
              this.NetoceanRestApi.getDataFromRESTUsingPOSTReq('updateTimeoutInfo', '', data, '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
                _this5.messageService.add({
                  severity: 'info',
                  summary: 'Confirmed',
                  detail: 'Process Updated Successfully.'
                });

                _this5.serviceTimeout = result;
                _this5.selectedRows = [];
              });
            } else {
              alert('Process can not be updated for the selected status.');
              return;
            }
          } catch (e) {
            console.error(e);
          }
        }
      }, {
        key: "stop",
        value: function stop(selectedRows) {
          var _this6 = this;

          try {
            if (this.checkPermission()) {
              return;
            }

            if (selectedRows == undefined || selectedRows.length !== 1) {
              alert('Please select only one row.');
              return;
            }

            if (selectedRows[0]['status'] == 1 || selectedRows[0]['status'] == 2) {
              var data = {
                'id': selectedRows[0]['id'],
                'modificationTimestamp': this.getCurrentTimestamp()
              };
              this.NetoceanRestApi.getDataFromRESTUsingPOSTReq('stopTimeout', '', data, '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
                _this6.serviceTimeout = result;
                _this6.selectedRows = []; // Refreshing port list on dropdown after a job is stopped

                _this6.updatePortList();
              });
            } else {
              alert('Process can not be stop for the selected status.'); // console.log("Status code ====== " , this.selectedRows[0]['status'] == 1)

              return;
            }
          } catch (e) {
            console.error(e);
          }
        }
      }, {
        key: "checkPermission",
        value: function checkPermission() {
          try {
            if (!this._commonService.$globalConfigPermission) {
              this.messageService.add({
                key: 'msgs',
                severity: 'warn',
                summary: 'Warn Message',
                detail: 'User does not have global permission to perform action.'
              });
              return true;
            } else {
              return false;
            }
          } catch (error) {
            console.error("Error in checkPermission", error);
          }
        }
      }, {
        key: "apply",
        value: function apply(selectedRows) {
          var _this7 = this;

          try {
            if (this.checkPermission()) {
              return;
            }

            if (selectedRows == undefined || selectedRows.length == 0) {
              alert('Please select atleast one row.');
              return;
            }
            /**validation on apply if time is passed */

            /**checking a start and end date/time objects */


            var date = moment__WEBPACK_IMPORTED_MODULE_2__["tz"](Date.now(), this.sessionService.serverTimeInfo.zoneId).format('HH:mm_MM/DD/YY');
            var curDate = date.split('_');
            var sdate = curDate[0];
            var stime = curDate[1];
            var checkCurrDate = sdate + ' ' + stime;

            for (var i = 0; i < selectedRows.length; i++) {
              if (selectedRows[i]['status'] != -1) {
                alert('Process can not applied for the selected status.');
                return;
              }

              var endString = selectedRows[i]['enddate'] + ' ' + selectedRows[i]['endTime'];
              var startString = selectedRows[i]['startDate'] + ' ' + selectedRows[i]['startTime'];

              if (new Date(endString) < new Date(checkCurrDate) || new Date(startString) < new Date(checkCurrDate)) {
                alert('Job can not scheduled due to startDateTime or endDateTime is passed.');
                return;
              }
            }

            var id = selectedRows[0]['id'];

            for (var j = 1; j < selectedRows.length; j++) {
              id = id + '@@' + selectedRows[j]['id'];
            }

            var data = {
              'id': id,
              'activationTimestamp': this.getCurrentTimestamp()
            };
            this.NetoceanRestApi.getDataFromRESTUsingPOSTReq('applyTImeoutShell', '', data, '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
              _this7.serviceTimeout = result;
              _this7.selectedRows = [];
            });
          } catch (e) {
            console.error(e);
          }
        }
      }, {
        key: "refresh",
        value: function refresh() {
          var _this8 = this;

          try {
            if (this.checkPermission()) {
              return;
            } // Refresh port list in dropdown


            this.updatePortList();
            this.getCurrentDate();
            this.NetoceanRestApi.getDataByRESTAPI('getTimeoutInfo', '', '/ProductUI/productSummary/NetOceanWebService/').subscribe(function (result) {
              _this8.serviceTimeout = result;
              _this8.selectedRows = [];

              _this8.messageService.add({
                severity: 'info',
                summary: 'Confirmed',
                detail: 'Process refresh Successfully.'
              });
            });
          } catch (e) {
            console.error(e);
          }
        }
      }, {
        key: "clickButtonEvent",
        value: function clickButtonEvent(event) {
          var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;

          try {
            if (((_b = (_a = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _a === void 0 ? void 0 : _a.actionConfig) === null || _b === void 0 ? void 0 : _b.action) == "apply") {
              this.apply((_c = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _c === void 0 ? void 0 : _c.rowData);
            } else if (((_e = (_d = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _d === void 0 ? void 0 : _d.actionConfig) === null || _e === void 0 ? void 0 : _e.action) == "update") {
              this.updateRow((_f = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _f === void 0 ? void 0 : _f.rowData);
            } else if (((_h = (_g = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _g === void 0 ? void 0 : _g.actionConfig) === null || _h === void 0 ? void 0 : _h.action) == "stop") {
              this.stop((_j = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _j === void 0 ? void 0 : _j.rowData);
            } else if (((_l = (_k = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _k === void 0 ? void 0 : _k.actionConfig) === null || _l === void 0 ? void 0 : _l.action) == "refresh") {
              this.refresh();
            } else if (((_o = (_m = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _m === void 0 ? void 0 : _m.actionConfig) === null || _o === void 0 ? void 0 : _o.action) == "deleteRow") {
              this.deleteRow((_p = event === null || event === void 0 ? void 0 : event.cavEventExt) === null || _p === void 0 ? void 0 : _p.rowData);
            }
          } catch (error) {
            console.error("Error in clickButtonEvent", error);
          }
        }
      }]);
    }();

    NetoceanTimeoutComponent.ctorParameters = function () {
      return [{
        type: src_app_core_session_session_service__WEBPACK_IMPORTED_MODULE_6__["SessionService"]
      }, {
        type: _services_netocean_config_service__WEBPACK_IMPORTED_MODULE_4__["NetoceanConfig"]
      }, {
        type: _services_netocean_rest_api_service__WEBPACK_IMPORTED_MODULE_5__["NetoceanRestApi"]
      }, {
        type: _services_netocean_common_service__WEBPACK_IMPORTED_MODULE_3__["NetoceanCommonService"]
      }, {
        type: primeng_api__WEBPACK_IMPORTED_MODULE_7__["MessageService"]
      }];
    };

    NetoceanTimeoutComponent = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
      selector: 'app-netocean-timeout',
      template: Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! raw-loader!./netocean-timeout.component.html */
      "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.html"))["default"],
      encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None,
      styles: [Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__importDefault"])(__webpack_require__(
      /*! ./netocean-timeout.component.scss */
      "./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.component.scss"))["default"]]
    })], NetoceanTimeoutComponent);
    /***/
  },

  /***/
  "./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.module.ts":
  /*!********************************************************************************************!*\
    !*** ./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.module.ts ***!
    \********************************************************************************************/

  /*! exports provided: onMonacoLoad, NetoceanTimeoutModule */

  /***/
  function _src_app_pages_home_netocean_components_netoceanTimeout_netoceanTimeoutModuleTs(module, __webpack_exports__, __webpack_require__) {
    "use strict";

    __webpack_require__.r(__webpack_exports__);
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "onMonacoLoad", function () {
      return onMonacoLoad;
    });
    /* harmony export (binding) */


    __webpack_require__.d(__webpack_exports__, "NetoceanTimeoutModule", function () {
      return NetoceanTimeoutModule;
    });
    /* 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 _netocean_timeout_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
    /*! ./netocean-timeout.component */
    "./src/app/pages/home/netocean/components/netocean-timeout/netocean-timeout.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_material_checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
    /*! @angular/material/checkbox */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/checkbox.js");
    /* harmony import */


    var _angular_material_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
    /*! @angular/material/menu */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/menu.js");
    /* harmony import */


    var _angular_material_radio__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
    /*! @angular/material/radio */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/radio.js");
    /* harmony import */


    var _angular_material_select__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
    /*! @angular/material/select */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/select.js");
    /* harmony import */


    var _angular_material_tabs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
    /*! @angular/material/tabs */
    "./node_modules/@angular/material/__ivy_ngcc__/fesm2015/tabs.js");
    /* harmony import */


    var primeng__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
    /*! primeng */
    "./node_modules/primeng/__ivy_ngcc__/fesm2015/primeng.js");
    /* harmony import */


    var src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
    /*! src/app/shared/help/help.module */
    "./src/app/shared/help/help.module.ts");
    /* harmony import */


    var _angular_router__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
    /*! @angular/router */
    "./node_modules/@angular/router/__ivy_ngcc__/fesm2015/router.js");
    /* harmony import */


    var ngx_monaco_editor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(
    /*! ngx-monaco-editor */
    "./node_modules/ngx-monaco-editor/__ivy_ngcc__/fesm2015/ngx-monaco-editor.js");
    /* harmony import */


    var src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(
    /*! src/app/shared/cav-table/cav-table.module */
    "./src/app/shared/cav-table/cav-table.module.ts");

    function onMonacoLoad() {
      console.log(window.monaco);
      return window.monaco;
    }

    var monacoConfig = {
      baseUrl: './assets',
      defaultOptions: {
        scrollBeyondLastLine: false
      },
      onMonacoLoad: onMonacoLoad // here monaco object will be available as window.monaco use this function to extend monaco editor functionalities.

    };
    var routes = [{
      path: '',
      component: _netocean_timeout_component__WEBPACK_IMPORTED_MODULE_3__["NetoceanTimeoutComponent"]
    }];

    var NetoceanTimeoutModule = /*#__PURE__*/_createClass(function NetoceanTimeoutModule() {
      _classCallCheck(this, NetoceanTimeoutModule);
    });

    NetoceanTimeoutModule = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["NgModule"])({
      declarations: [_netocean_timeout_component__WEBPACK_IMPORTED_MODULE_3__["NetoceanTimeoutComponent"]],
      imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__["CommonModule"], _angular_router__WEBPACK_IMPORTED_MODULE_12__["RouterModule"].forChild(routes), _angular_forms__WEBPACK_IMPORTED_MODULE_4__["FormsModule"], src_app_shared_help_help_module__WEBPACK_IMPORTED_MODULE_11__["HelpModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DynamicDialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TabMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TreeModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TieredMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["CalendarModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["InputTextareaModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["AccordionModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["SidebarModule"], ngx_monaco_editor__WEBPACK_IMPORTED_MODULE_13__["MonacoEditorModule"].forRoot(monacoConfig), primeng__WEBPACK_IMPORTED_MODULE_10__["SplitButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TooltipModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["MenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToolbarModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TableModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ScrollPanelModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["TabViewModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["CheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["DropdownModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ConfirmDialogModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["FieldsetModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["PanelModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["FileUploadModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToastModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["MultiSelectModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["RadioButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["OverlayPanelModule"], _angular_material_menu__WEBPACK_IMPORTED_MODULE_6__["MatMenuModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["SpinnerModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ToggleButtonModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["OrderListModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ChipsModule"], _angular_material_radio__WEBPACK_IMPORTED_MODULE_7__["MatRadioModule"], _angular_material_select__WEBPACK_IMPORTED_MODULE_8__["MatSelectModule"], _angular_material_tabs__WEBPACK_IMPORTED_MODULE_9__["MatTabsModule"], _angular_material_checkbox__WEBPACK_IMPORTED_MODULE_5__["MatCheckboxModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["BreadcrumbModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["ProgressBarModule"], primeng__WEBPACK_IMPORTED_MODULE_10__["CardModule"], src_app_shared_cav_table_cav_table_module__WEBPACK_IMPORTED_MODULE_14__["CavTableModule"]],
      providers: [],
      schemas: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["CUSTOM_ELEMENTS_SCHEMA"]]
    })], NetoceanTimeoutModule);
    /***/
  }
}]);