(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-portal-ptl-janela-operacional-ptl-janela-operacional-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.component.html":
/*!******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.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=\"modal fade\" id=\"ptl-janela-operacional-edit\" tabindex=\"-1\" role=\"dialog\" data-backdrop='static'>\r\n    <div class=\"modal-dialog\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'labels.edicao' | translate }} {{ 'titles.janelaOperacional' | translate }}\r\n                </h6>\r\n            </div>\r\n\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12\">\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"dtJanelaI\">{{\"labels.dataHoraInicio\" | translate }}</label>\r\n                                        <input id=\"dtJanelaI\" name=\"dtJanelaI\"\r\n                                            value=\"{{data.dtJanelaI | date: 'dd/MM/yyyy HH:mm' }}\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled=\"true\" />\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"dtJanelaF\">{{\"labels.dataHoraFim\" | translate }}</label>\r\n                                        <input id=\"dtJanelaF\" name=\"dtJanelaF\"\r\n                                            value=\"{{data.dtJanelaF | date: 'dd/MM/yyyy HH:mm' }}\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled=\"true\" />\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-md-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"materialId\">{{\"labels.produto\" | translate }}</label>\r\n                                        <input id=\"materialId\" type=\"text\"\r\n                                            class=\"form-control form-control-sm disableKeyPress material-input\"\r\n                                            value=\"{{service.janelaNavega.material}} - {{service.janelaNavega.fantasia}}\"\r\n                                            disabled=\"true\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-4\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"tipoFreteDescr\">{{'labels.tipoFrete' | translate}}</label>\r\n                                        <input id=\"tipoFreteDescr\" name=\"tipoFreteDescr\"\r\n                                            value=\"{{service.janelaNavega.tipoFreteDescr}}\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled=\"true\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-4\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"tipoMovDescr\">{{'labels.tipoMovimento' | translate}}</label>\r\n                                        <input id=\"tipoMovDescr\" name=\"tipoMovDescr\"\r\n                                            value=\"{{service.janelaNavega.tipoMovDescr}}\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\" disabled=\"true\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-4\" *ngIf=\"!solicitaQtdeGeral\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"qtCarga\" [class.required]=\"service.filtro.tipoMov == 'C'\">{{'labels.carga' | translate}}</label>\r\n                                        <input id=\"qtCarga\" name=\"qtCarga\" [(ngModel)]=\"data.qtCarga\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\"\r\n                                            [disabled]=\"service.filtro.tipoMov == 'D'\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-4\" *ngIf=\"!solicitaQtdeGeral\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"qtDescarga\" [class.required]=\"service.filtro.tipoMov == 'D'\">{{'labels.descarga' |\r\n                                            translate}}</label>\r\n                                        <input id=\"qtDescarga\" name=\"qtDescarga\" [(ngModel)]=\"data.qtDescarga\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\"\r\n                                            [disabled]=\"service.filtro.tipoMov == 'C'\">\r\n                                    </div>\r\n                                </div>\r\n                                <div class=\"col-lg-4 col-md-4\" *ngIf=\"solicitaQtdeGeral\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"qtGeral\" class=\"required\">{{'labels.geral' | translate}}</label>\r\n                                        <input id=\"qtGeral\" name=\"qtGeral\" [(ngModel)]=\"data.qtGeral\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.ok' | translate }}</button>\r\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{{ 'buttons.cancelar' | translate\r\n                        }}</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.component.html":
/*!**********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.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=\"modal fade\" id=\"ptl-janela-operacional-filter\" tabindex=\"-1\" role=\"dialog\" data-backdrop='static'>\r\n    <div class=\"uni-modal-dialog-md-45\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h6 class=\"modal-title\">{{ 'titles.janelaOperacional' | translate }}</h6>\r\n            </div>\r\n            <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\r\n                <app-validacoes></app-validacoes>\r\n                <div class=\"modal-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-12 col-md-12\">\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"mesAno\" class=\"required\">{{\"labels.mesAno\" | translate }}</label>\r\n                                        <input id=\"mesAno\"\r\n                                               name=\"mesAno\"\r\n                                               [dropSpecialCharacters]=\"false\"\r\n                                               [(ngModel)]=\"service.filtro.mes\"\r\n                                               class=\"form-control form-control-sm\"\r\n                                               type=\"text\"\r\n                                               required=\"true\"\r\n                                               mask=\"00/0000\">\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-md-12\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <app-pesquisa-material id=\"materialId\" name=\"materialIds\"\r\n                                                               label=\"produto\" modalTitle=\"pesquisaDeProduto\"\r\n                                                               [(ngModel)]=\"service.filtro.material\"\r\n                                                               (inpMaterial)=\"service.filtro.produto\"\r\n                                                               (outModel)=\"service.filtro.produto = $event\">\r\n                                        </app-pesquisa-material>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-4\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"tipoFrete\">{{'labels.tipoFrete' | translate}}</label>\r\n                                        <select class=\"form-control form-control-sm\" id=\"tipoFrete\"\r\n                                                name=\"tipoFrete\"\r\n                                                [disabled]=\"!service.agUtilizarTipofrete\"\r\n                                                [(ngModel)]=\"service.filtro.tipoFrete\">\r\n                                            <option *ngFor=\"let item of tipoFreteEnum.get()\"\r\n                                                    value=\"{{ item.id }}\">{{ item.descricao }}</option>\r\n                                        </select>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"row\">\r\n                                <div class=\"col-lg-4 col-md-4\">\r\n                                    <div class=\"form-group form-group-sm\">\r\n                                        <label for=\"tipoMov\">{{'labels.tipoMovimento' | translate}}</label>\r\n                                        <select class=\"form-control form-control-sm\" id=\"tipoMov\"\r\n                                                name=\"tipoMov\"\r\n                                                [disabled]=\"!service.janOpeTipMov\"\r\n                                                [(ngModel)]=\"service.filtro.tipoMov\">\r\n                                            <option *ngFor=\"let item of tipoMovEnum.get()\"\r\n                                                    value=\"{{ item.id }}\">{{ item.descricao }}</option>\r\n                                        </select>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"modal-footer\">\r\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}\r\n                    </button>\r\n                    <button type=\"button\" class=\"btn btn-default\"\r\n                            data-dismiss=\"modal\">{{ 'buttons.sair' | translate }}</button>\r\n                </div>\r\n            </form>\r\n        </div>\r\n    </div>\r\n</div>\r\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.html":
/*!******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.html ***!
  \******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar\r\n        [botoesComando]=\"constantes.listaForm\"\r\n        [formAction]=\"actionForm\"\r\n        [itemData]=\"data.ptlJanelaOperacionalId\"\r\n        [sisFormularioId]=\"constantes.sisFormularioId\"\r\n>\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <table id=\"dtJanelaOperacional\" class=\"table table-striped table-bordered table-hover nowrap table-sm\">\r\n    </table>\r\n\r\n    <!-- Dados da Grade -->\r\n    <div class=\"row\">\r\n        <div class=\"col-md-2\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"mes\">{{\"labels.mesAno\" | translate }}</label>\r\n                <input id=\"mes\"\r\n                       name=\"mes\"\r\n                       value=\"{{service.janelaNavega.mes}}\"\r\n                       class=\"form-control form-control-sm\"\r\n                       type=\"text\"\r\n                       mask=\"00/0000\"\r\n                       disabled=\"true\">\r\n            </div>\r\n        </div>\r\n        <div class=\"col-md-5\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"material\">{{\"labels.produto\" | translate }}</label>\r\n                <input id=\"material\"\r\n                       type=\"text\"\r\n                       class=\"form-control form-control-sm disableKeyPress material-input\"\r\n                       value=\"{{service.janelaNavega.material}} - {{service.janelaNavega.fantasia}}\"\r\n                       disabled=\"true\">\r\n            </div>\r\n        </div>\r\n        <div class=\"col-md-2\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"tipoFrete\">{{'labels.tipoFrete' | translate}}</label>\r\n                <input id=\"tipoFrete\"\r\n                       name=\"tipoFrete\"\r\n                       value=\"{{service.janelaNavega.tipoFreteDescr}}\"\r\n                       class=\"form-control form-control-sm\"\r\n                       type=\"text\"\r\n                       disabled=\"true\">\r\n            </div>\r\n        </div>\r\n        <div class=\"col-md-2\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"tipoMov\">{{'labels.tipoMovimento' | translate}}</label>\r\n                <input id=\"tipoMov\"\r\n                       name=\"tipoMov\"\r\n                       value=\"{{service.janelaNavega.tipoMovDescr}}\"\r\n                       class=\"form-control form-control-sm\"\r\n                       type=\"text\"\r\n                       disabled=\"true\">\r\n            </div>\r\n        </div>\r\n        <div class=\"col-1\">\r\n            <div class=\"form-group\">\r\n                <label></label>\r\n                <button class=\"btn btn-success mr-2\" (click)=\"save()\" type=\"button\"\r\n                        [disabled]=\"funcoes.isDetail(actionForm)\">\r\n                    {{ 'buttons.salvar' | translate }}\r\n                </button>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\r\n    <!-- Navegação -->\r\n    <div class=\"row\">\r\n        <div class=\"col-md-12 container-periodo\">\r\n            <button type=\"button\" class=\"btn uni-btn btn-sm\" (click)=\"PriorWeek();\"\r\n                    [disabled]=\"periodo.dtIniSemana <= periodo.dtIniMes\">\r\n                <i class=\"fa fa-chevron-left\"></i>\r\n            </button>\r\n            <label class=\"label-periodo\">{{periodo.dtIniSemana | date:'dd/MM/yyyy'}}\r\n                - {{periodo.dtFimSemana | date:'dd/MM/yyyy'}}</label>\r\n            <button type=\"button\" class=\"btn uni-btn btn-sm\" (click)=\"NextWeek();\"\r\n                    [disabled]=\"periodo.dtFimSemana >= periodo.dtFimMes\">\r\n                <i class=\"fa fa-chevron-right\"></i>\r\n            </button>\r\n        </div>\r\n    </div>\r\n\r\n    <!-- Grade -->\r\n    <div class=\"row\" style=\"margin-top: 10px;\">\r\n        <div class=\"col-md-12\">\r\n            <table id=\"tabela-grade\" border=\"1\" style=\"width: 100%;\" class=\"text-center\">\r\n                <tr>\r\n                    <td></td>\r\n                    <td data-header-id=\"1\"><b>{{diaSemana1}}</b></td>\r\n                    <td data-header-id=\"2\"><b>{{diaSemana2}}</b></td>\r\n                    <td data-header-id=\"3\"><b>{{diaSemana3}}</b></td>\r\n                    <td data-header-id=\"4\"><b>{{diaSemana4}}</b></td>\r\n                    <td data-header-id=\"5\"><b>{{diaSemana5}}</b></td>\r\n                    <td data-header-id=\"6\" style=\"color: red\">{{diaSemana6}}</td>\r\n                    <td data-header-id=\"7\" style=\"color: red\">{{diaSemana7}}</td>\r\n                </tr>\r\n                <tr *ngFor=\"let g of grade\">\r\n                    <td data-icon=\"1\"><b>{{g.horario}}</b></td>\r\n                    <td [id]=\"['td_' + item.id]\" *ngFor=\"let item of g.items; let i = index\"\r\n                        [attr.data-message-id]=\"i + 1\"\r\n                        [attr.rowspan]=\"g.intervalo\"\r\n                        [class.item-janela]=\"item.linkId > 0\"\r\n                        [class.item-janela-disabled]=\"item.linkId == 0\"\r\n                        [class.item-janela-cursor]=\"!funcoes.isDetail(actionForm) && item.linkId > 0\"\r\n                        [class.selected-by]=\"item.selected === true\"\r\n                        (dblclick)=\"editJanela(item);\"\r\n                        (click)=\"selectJanela(item, i);\">\r\n                        <div *ngIf=\"item.linkId > 0\">\r\n                            <ng-template [ngIf]=\"g.tipoAgCargaDescarga && g.tipoAgCargaDescarga !== 'C'\">\r\n                                {{'labels.geral' | translate}} = {{item.qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"g.tipoAgCargaDescarga && g.tipoAgCargaDescarga === 'C'\">\r\n                                {{'labels.carga' | translate}} = {{item.qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{item.qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                </tr>\r\n                <tr *ngIf=\"total && total.length > 0\">\r\n                    <td><b>{{'labels.total' | translate}}</b></td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template\r\n                                    [ngIf]=\"total[0].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[0].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template\r\n                                    [ngIf]=\"total[0].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[0].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[0].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[1].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[1].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[1].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[1].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[1].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[2].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[2].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[2].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[2].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[2].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[3].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[3].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[3].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[3].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[3].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[4].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[4].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[4].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[4].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[4].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[5].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[5].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[5].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[5].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[5].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                    <td>\r\n                        <div>\r\n                            <ng-template [ngIf]=\"total[6].tipoAgCargaDescarga == 'G'\">\r\n                                {{'labels.geral' | translate}} = {{total[6].qtGeral}}\r\n                            </ng-template>\r\n                            <ng-template [ngIf]=\"total[6].tipoAgCargaDescarga == 'C'\">\r\n                                {{'labels.carga' | translate}} = {{total[6].qtCarga}}<br/>\r\n                                {{'labels.descarga' | translate}} = {{total[6].qtDescarga}}\r\n                            </ng-template>\r\n                        </div>\r\n                    </td>\r\n                </tr>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<app-ptl-janela-operacional-edit [data]=\"janelaDados\"\r\n                                 (outData)=\"trataEditJanela($event)\"></app-ptl-janela-operacional-edit>\r\n");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.html":
/*!********************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.html ***!
  \********************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar\r\n        [botoesComando]=\"constantes.listaIndex\"\r\n        [formAction]=\"actionForm\"\r\n        [itemData]=\"data.mes\"\r\n        [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <table id=\"dtJanelaOperacional\" class=\"table table-striped table-bordered table-hover nowrap table-sm\">\r\n    </table>\r\n</div>\r\n\r\n<app-propriedades></app-propriedades>\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-ptl-janela-operacional-filter (filtrar)=\"executaFiltro()\" (create)=\"trataCreate()\"></app-ptl-janela-operacional-filter>\r\n");

/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.component.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.component.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: PtlJanelaOperacionalEditComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalEditComponent", function() { return PtlJanelaOperacionalEditComponent; });
/* harmony import */ var _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../ptl-janela-operacional.model */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ptl-janela-operacional.service */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var PtlJanelaOperacionalEditComponent = /** @class */ (function () {
    function PtlJanelaOperacionalEditComponent(service, message, funcoes) {
        this.service = service;
        this.message = message;
        this.funcoes = funcoes;
        this.outData = new _angular_core__WEBPACK_IMPORTED_MODULE_1__["EventEmitter"]();
    }
    PtlJanelaOperacionalEditComponent.prototype.ngOnInit = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.service.getConfig();
                return [2 /*return*/];
            });
        });
    };
    PtlJanelaOperacionalEditComponent.prototype.onSubmit = function (form) {
        if (!form.invalid) {
            this.outData.emit(this.data);
            jQuery("#ptl-janela-operacional-edit").modal("hide");
        }
    };
    Object.defineProperty(PtlJanelaOperacionalEditComponent.prototype, "solicitaQtdeGeral", {
        get: function () {
            return this.service.tipoAgCargaDescarga === 'G';
        },
        enumerable: true,
        configurable: true
    });
    PtlJanelaOperacionalEditComponent.ctorParameters = function () { return [
        { type: _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Input"])(),
        __metadata("design:type", _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_0__["PtlJanelaOperacional"])
    ], PtlJanelaOperacionalEditComponent.prototype, "data", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Output"])(),
        __metadata("design:type", Object)
    ], PtlJanelaOperacionalEditComponent.prototype, "outData", void 0);
    PtlJanelaOperacionalEditComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
            selector: 'app-ptl-janela-operacional-edit',
            template: __importDefault(__webpack_require__(/*! raw-loader!./ptl-janela-operacional-edit.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"]])
    ], PtlJanelaOperacionalEditComponent);
    return PtlJanelaOperacionalEditComponent;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.component.ts":
/*!******************************************************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.component.ts ***!
  \******************************************************************************************************************************/
/*! exports provided: PtlJanelaOperacionalFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalFilterComponent", function() { return PtlJanelaOperacionalFilterComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ptl-janela-operacional.service */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var PtlJanelaOperacionalFilterComponent = /** @class */ (function () {
    function PtlJanelaOperacionalFilterComponent(service, message, funcoes) {
        this.service = service;
        this.message = message;
        this.funcoes = funcoes;
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.create = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["Mascaras"]();
        this.tipoFreteEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["TipoFreteEnum"]();
        this.tipoMovEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["TipoMovEnum"]();
    }
    PtlJanelaOperacionalFilterComponent.prototype.ngOnInit = function () {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.service.getConfig();
                return [2 /*return*/];
            });
        });
    };
    PtlJanelaOperacionalFilterComponent.prototype.onSubmit = function (form) {
        if (!form.invalid) {
            var per = this.funcoes.dateTimeUtils.getPeriodo(this.service.filtro.mes);
            if (per.error) {
                this.message.warning('titles.janelaOperacional', 'messages.periodoInformadoInvalido');
                return;
            }
            this.service.filtro.dtIni = per.dataI;
            this.service.filtro.dtFim = per.dataF;
            // if (this.service.agUtilizarTipofrete) {
            //     this.service.filtro.tipoFrete = 'C';
            // } else {
            //     this.service.filtro.tipoFrete = '';
            // }
            console.log(this.service.filtro.tipoMov);
            jQuery("#ptl-janela-operacional-filter").modal("hide");
            if (this.service.filtro.tipoBusca === 'F') {
                this.filtrar.emit();
            }
            else {
                this.create.emit();
            }
        }
        else {
            _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_5__["EventEmitterService"].get("formError").emit(form);
            return;
        }
    };
    PtlJanelaOperacionalFilterComponent.ctorParameters = function () { return [
        { type: _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_1__["PtlJanelaOperacionalService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], PtlJanelaOperacionalFilterComponent.prototype, "filtrar", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], PtlJanelaOperacionalFilterComponent.prototype, "create", void 0);
    PtlJanelaOperacionalFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-ptl-janela-operacional-filter',
            template: __importDefault(__webpack_require__(/*! raw-loader!./ptl-janela-operacional-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_1__["PtlJanelaOperacionalService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"]])
    ], PtlJanelaOperacionalFilterComponent);
    return PtlJanelaOperacionalFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.scss":
/*!****************************************************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.scss ***!
  \****************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (".material-input {\n  margin-right: 5px;\n}\n\n.container-periodo {\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n}\n\n.label-periodo {\n  margin-right: 12px;\n  margin-bottom: 0 !important;\n}\n\n.item-janela {\n  width: 140px;\n  background-color: #4caf50;\n  color: #fff;\n}\n\n.item-janela-cursor {\n  cursor: pointer;\n}\n\n.item-janela-disabled {\n  width: 140px;\n  background-color: #bdbdbd;\n  color: #fff;\n}\n\n.item-selecionado {\n  background-color: #cddc39;\n}\n\n.selected-by {\n  background-color: #8fff7d;\n}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvcGFnZXMvcG9ydGFsL3B0bC1qYW5lbGEtb3BlcmFjaW9uYWwvcHRsLWphbmVsYS1vcGVyYWNpb25hbC1mb3JtL0M6XFxDb3Jwb3JhdGVcXENvcnBvcmF0ZVdlYkRlc2VudlxcX3VuaXNvbHV0aW9uL3NyY1xcYXBwXFxwYWdlc1xccG9ydGFsXFxwdGwtamFuZWxhLW9wZXJhY2lvbmFsXFxwdGwtamFuZWxhLW9wZXJhY2lvbmFsLWZvcm1cXHB0bC1qYW5lbGEtb3BlcmFjaW9uYWwtZm9ybS5jb21wb25lbnQuc2NzcyIsInNyYy9hcHAvcGFnZXMvcG9ydGFsL3B0bC1qYW5lbGEtb3BlcmFjaW9uYWwvcHRsLWphbmVsYS1vcGVyYWNpb25hbC1mb3JtL3B0bC1qYW5lbGEtb3BlcmFjaW9uYWwtZm9ybS5jb21wb25lbnQuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtFQUNJLGlCQUFBO0FDQ0o7O0FERUE7RUFDSSxhQUFBO0VBQ0EsbUJBQUE7RUFDQSx1QkFBQTtFQUNBLG1CQUFBO0FDQ0o7O0FERUE7RUFDSSxrQkFBQTtFQUNBLDJCQUFBO0FDQ0o7O0FERUE7RUFDSSxZQUFBO0VBQ0EseUJBQUE7RUFDQSxXQUFBO0FDQ0o7O0FERUE7RUFDSSxlQUFBO0FDQ0o7O0FERUE7RUFDSSxZQUFBO0VBQ0EseUJBQUE7RUFDQSxXQUFBO0FDQ0o7O0FERUE7RUFDSSx5QkFBQTtBQ0NKOztBREVBO0VBQ0kseUJBQUE7QUNDSiIsImZpbGUiOiJzcmMvYXBwL3BhZ2VzL3BvcnRhbC9wdGwtamFuZWxhLW9wZXJhY2lvbmFsL3B0bC1qYW5lbGEtb3BlcmFjaW9uYWwtZm9ybS9wdGwtamFuZWxhLW9wZXJhY2lvbmFsLWZvcm0uY29tcG9uZW50LnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIubWF0ZXJpYWwtaW5wdXQge1xyXG4gICAgbWFyZ2luLXJpZ2h0OiA1cHg7XHJcbn1cclxuXHJcbi5jb250YWluZXItcGVyaW9kbyB7XHJcbiAgICBkaXNwbGF5OiBmbGV4O1xyXG4gICAgZmxleC1kaXJlY3Rpb246IHJvdztcclxuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xyXG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcclxufVxyXG5cclxuLmxhYmVsLXBlcmlvZG8ge1xyXG4gICAgbWFyZ2luLXJpZ2h0OiAxMnB4O1xyXG4gICAgbWFyZ2luLWJvdHRvbTogMCAhaW1wb3J0YW50O1xyXG59XHJcblxyXG4uaXRlbS1qYW5lbGEge1xyXG4gICAgd2lkdGg6IDE0MHB4O1xyXG4gICAgYmFja2dyb3VuZC1jb2xvcjogIzRjYWY1MDtcclxuICAgIGNvbG9yOiAjZmZmO1xyXG59XHJcblxyXG4uaXRlbS1qYW5lbGEtY3Vyc29yIHtcclxuICAgIGN1cnNvcjogcG9pbnRlcjtcclxufVxyXG5cclxuLml0ZW0tamFuZWxhLWRpc2FibGVkIHtcclxuICAgIHdpZHRoOiAxNDBweDtcclxuICAgIGJhY2tncm91bmQtY29sb3I6ICNiZGJkYmQ7XHJcbiAgICBjb2xvcjogI2ZmZjtcclxufVxyXG5cclxuLml0ZW0tc2VsZWNpb25hZG8ge1xyXG4gICAgYmFja2dyb3VuZC1jb2xvcjogI2NkZGMzOTtcclxufVxyXG5cclxuLnNlbGVjdGVkLWJ5IHtcclxuICAgIGJhY2tncm91bmQtY29sb3I6ICM4ZmZmN2Q7XHJcbn1cclxuIiwiLm1hdGVyaWFsLWlucHV0IHtcbiAgbWFyZ2luLXJpZ2h0OiA1cHg7XG59XG5cbi5jb250YWluZXItcGVyaW9kbyB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiByb3c7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xufVxuXG4ubGFiZWwtcGVyaW9kbyB7XG4gIG1hcmdpbi1yaWdodDogMTJweDtcbiAgbWFyZ2luLWJvdHRvbTogMCAhaW1wb3J0YW50O1xufVxuXG4uaXRlbS1qYW5lbGEge1xuICB3aWR0aDogMTQwcHg7XG4gIGJhY2tncm91bmQtY29sb3I6ICM0Y2FmNTA7XG4gIGNvbG9yOiAjZmZmO1xufVxuXG4uaXRlbS1qYW5lbGEtY3Vyc29yIHtcbiAgY3Vyc29yOiBwb2ludGVyO1xufVxuXG4uaXRlbS1qYW5lbGEtZGlzYWJsZWQge1xuICB3aWR0aDogMTQwcHg7XG4gIGJhY2tncm91bmQtY29sb3I6ICNiZGJkYmQ7XG4gIGNvbG9yOiAjZmZmO1xufVxuXG4uaXRlbS1zZWxlY2lvbmFkbyB7XG4gIGJhY2tncm91bmQtY29sb3I6ICNjZGRjMzk7XG59XG5cbi5zZWxlY3RlZC1ieSB7XG4gIGJhY2tncm91bmQtY29sb3I6ICM4ZmZmN2Q7XG59Il19 */");

/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: PtlJanelaOperacionalFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalFormComponent", function() { return PtlJanelaOperacionalFormComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.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 _config_enumerables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _shared_services_funcoes_date_time_utils_date_time_utils_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/services/funcoes/date-time-utils/date-time-utils.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.service.ts");
/* harmony import */ var _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../ptl-janela-operacional.constants */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.constants.ts");
/* harmony import */ var _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../ptl-janela-operacional.model */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts");
/* harmony import */ var _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../ptl-janela-operacional.service */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};















var PtlJanelaOperacionalFormComponent = /** @class */ (function (_super) {
    __extends(PtlJanelaOperacionalFormComponent, _super);
    function PtlJanelaOperacionalFormComponent(router, service, message, configuracao, dateTimeUtils, activatedRoute, funcoes, permissoesUtils) {
        var _this = _super.call(this, new _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_8__["PtlJanelaOperacionalConstants"](), funcoes) || this;
        _this.router = router;
        _this.service = service;
        _this.message = message;
        _this.configuracao = configuracao;
        _this.dateTimeUtils = dateTimeUtils;
        _this.activatedRoute = activatedRoute;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.target = _this.funcoes.getTargetLocation();
        _this.constantes = new _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_8__["PtlJanelaOperacionalConstants"]();
        _this.mensagens = [];
        _this.data = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacional"]();
        _this.tipoFreteEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["TipoFreteEnum"]();
        _this.tipoMovEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_3__["TipoMovEnum"]();
        _this.total = [];
        _this.grade = [];
        _this.linkId = 0;
        _this.janelaDados = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacional"]();
        _this.periodo = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalPeriodo"](new Date());
        _this.init = function () {
            if (!_this.configuracao.isLoadConfig()) {
                return;
            }
            _this.service.tipoAgCargaDescarga = _this.configuracao.lerConfig('PTL', 'TipoAgCargaDescarga');
            /*this.service.tipoAgCargaDescarga = "C";*/
            _this.service.agUtilizarTipofrete = _this.funcoes.isBoolean(_this.configuracao.lerConfig('PTL', 'AgUtilizarTipofrete'));
            _this.service.qtPeriodosAg = _this.funcoes.getValue(_this.configuracao.lerConfig('PTL', 'QtPeriodosAg'), 'I');
            _this.service.qtPeriodosAgD = _this.funcoes.getValue(_this.configuracao.lerConfig('PTL', 'QtPeriodosAgD'), 'I');
            _this.service.janOpeTipMov = _this.funcoes.isBoolean(_this.configuracao.lerConfig('UNI', 'JanOpeTipMov'));
            if (_this.funcoes.isEdit(_this.actionForm) || _this.funcoes.isDetail(_this.actionForm)) {
                var filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalFilter"]();
                filtro.dtIni = _this.periodo.dtIniMes;
                filtro.dtFim = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(_this.periodo.dtFimMes).add(23, 'hours')).add(59, 'minutes');
                filtro.material = _this.service.janelaNavega.material;
                filtro.tipoFrete = _this.service.janelaNavega.tipoFrete;
                filtro.tipoMov = _this.service.janelaNavega.tipoMov;
                _this.service.getDados(filtro).subscribe(function (resp) {
                    _this.janelaList = resp;
                    _this.createGrade();
                    if (_this.funcoes.isDetail(_this.actionForm)) {
                        _this.data = resp[0];
                    }
                });
            }
            else {
                _this.createGrade();
            }
        };
        _this.copiarDiaselecionadoParaMesmoDiaDasDemaisSemanas = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.executeCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas(); });
        };
        _this.executeCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas = function () {
            _this.clean();
            var indexI;
            var indexJ;
            var obj;
            for (var i = 0; i < _this.grade.length; i++) {
                var j = _this.grade[i].items.findIndex(function (x) { return x.linkId === _this.janelaDados.linkId; });
                if (j >= 0) {
                    indexI = i;
                    indexJ = j;
                    obj = _this.grade[i].items[j];
                    obj.qtCarga = _this.grade[i].items[j].qtCarga;
                    obj.qtDescarga = _this.grade[i].items[j].qtDescarga;
                    obj.qtGeral = _this.grade[i].items[j].qtGeral;
                    _this.grade[i].items[j].selected = true;
                }
            }
            sessionStorage.setItem("grade", JSON.stringify(_this.grade));
            _this.constantes.listaForm[2].disabled = true;
            _this.constantes.listaForm[3].disabled = true;
            _this.constantes.listaForm[4].disabled = true;
            _this.constantes.listaForm[5].disabled = true;
            obj.alterado = true;
            _this.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas([obj], indexI, indexJ, _this.janelaDados);
            return;
        };
        _this.copiarDiaselecionadoParaTodosOsDias = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.constructCopiarDiaselecionadoParaTodosOsDias(); });
        };
        _this.constructCopiarDiaselecionadoParaTodosOsDias = function () {
            _this.clean();
            sessionStorage.setItem("grade", JSON.stringify(_this.grade));
            var indexI;
            var indexJ;
            for (var i = 0; i < _this.grade.length; i++) {
                for (var j = 0; j < _this.grade[i].items.length; j++) {
                    if (_this.grade[i].items[j].linkId === _this.janelaDados.linkId) {
                        indexI = i;
                        indexJ = j;
                        break;
                    }
                }
            }
            sessionStorage.setItem("indexI", "" + indexI);
            sessionStorage.setItem("indexJ", "" + indexJ);
            _this.clean();
            _this.executeCopiarDiaselecionadoParaTodosOsDias();
            _this.constantes.listaForm[2].disabled = true;
            _this.constantes.listaForm[3].disabled = true;
            _this.constantes.listaForm[4].disabled = true;
            _this.constantes.listaForm[5].disabled = true;
        };
        // 4
        _this.copiarSemanaAtualParaTodasAsSemanas = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.constructCopiarSemanaAtualParaTodasAsSemanas(); });
        };
        _this.constructCopiarSemanaAtualParaTodasAsSemanas = function () {
            _this.clean();
            sessionStorage.setItem("grade", JSON.stringify(_this.grade));
            _this.executeCopiarSemanaAtualParaTodasAsSemanas();
            _this.constantes.listaForm[2].disabled = true;
            _this.constantes.listaForm[3].disabled = true;
            _this.constantes.listaForm[4].disabled = true;
            _this.constantes.listaForm[5].disabled = true;
        };
        // 5
        _this.replicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaAprovacao", null, function () { return _this.executeReplicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia(); });
        };
        _this.executeReplicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia = function () {
            _this.clean();
            var indexI;
            var indexJ;
            for (var i = 0; i < _this.grade.length; i++) {
                for (var j = 0; j < _this.grade[i].items.length; j++) {
                    if (_this.grade[i].items[j].linkId === _this.janelaDados.linkId) {
                        indexI = i;
                        indexJ = j;
                        break;
                    }
                }
            }
            var obj = [];
            for (var i = 0; i < _this.grade.length; i++) {
                if (_this.grade[i] && _this.grade[i].items && _this.grade[i].items[indexJ]) {
                    _this.grade[i].items[indexJ].qtCarga = _this.janelaDados.qtCarga;
                    _this.grade[i].items[indexJ].qtDescarga = _this.janelaDados.qtDescarga;
                    _this.grade[i].items[indexJ].qtGeral = _this.janelaDados.qtGeral;
                    _this.grade[i].items[indexJ].alterado = true;
                    if (_this.grade[i].items[indexJ].linkId !== 0) {
                        _this.grade[i].items[indexJ].selected = true;
                    }
                    obj.push(_this.grade[i].items[indexJ]);
                }
            }
            _this.constantes.listaForm[2].disabled = true;
            _this.constantes.listaForm[3].disabled = true;
            _this.constantes.listaForm[4].disabled = true;
            _this.constantes.listaForm[5].disabled = true;
        };
        // 6
        _this.copiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.executeCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte(); });
        };
        _this.executeCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte = function () {
            var self = _this;
            var indexI;
            var indexJ;
            for (var i = 0; i < self.grade.length; i++) {
                for (var j = 0; j < self.grade[i].items.length; j++) {
                    if (self.grade[i].items[j].linkId === self.janelaDados.linkId) {
                        indexI = i;
                        indexJ = j;
                        break;
                    }
                }
            }
            sessionStorage.setItem("grade", JSON.stringify(self.grade));
            var _scheduled = self.service.filtro.mes;
            _scheduled = _scheduled.split("/");
            var date = new Date(_scheduled[0] + "/01/" + _scheduled[1]);
            date.setMonth(date.getMonth() + 1);
            self.service.filtro.mes = date;
            if (self.service.agUtilizarTipofrete) {
                self.service.filtro.tipoFrete = 'C';
            }
            else {
                self.service.filtro.tipoFrete = '';
            }
            if (self.service.janOpeTipMov) {
                self.service.filtro.tipoMov = 'C';
            }
            else {
                self.service.filtro.tipoMov = 'A';
            }
            self.service.getByFiltro(self.service.filtro).subscribe(function (resp) {
                var month = date.getMonth() + 1;
                if (month < 10) {
                    _this.service.filtro.mes = '0' + month + '/' + date.getFullYear();
                }
                else {
                    _this.service.filtro.mes = month + '/' + date.getFullYear();
                }
                self.service.janelaNavega.mes = self.service.filtro.mes.substr(0, 2) + '/' + self.service.filtro.mes.substr(3, 6);
                self.service.janelaNavega.material = self.service.filtro.material;
                self.service.janelaNavega.fantasia = self.service.filtro.produto && self.service.filtro.produto.fantasia ? self.service.filtro.produto.fantasia : "";
                self.service.janelaNavega.tipoFrete = self.service.filtro.tipoFrete;
                self.service.janelaNavega.tipoFreteDescr = self.tipoFreteEnum.get(self.service.filtro.tipoFrete);
                self.service.janelaNavega.tipoMov = self.service.filtro.tipoMov;
                self.service.janelaNavega.tipoMovDescr = self.tipoMovEnum.get(self.service.filtro.tipoMov);
                self.service.janelaNavega.scheduled = month + '/' + date.getFullYear();
                var per = _this.funcoes.dateTimeUtils.getPeriodo(self.service.janelaNavega.mes);
                var dtRef = per.dataI;
                _this.periodo = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalPeriodo"](dtRef);
                _this.janelaList = [];
                var filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalFilter"]();
                filtro.dtIni = _this.periodo.dtIniMes;
                filtro.dtFim = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(_this.periodo.dtFimMes).add(23, 'hours')).add(59, 'minutes');
                filtro.material = _this.service.janelaNavega.material;
                filtro.tipoFrete = _this.service.janelaNavega.tipoFrete;
                filtro.tipoMov = _this.service.janelaNavega.tipoMov;
                _this.service.getDados(filtro).subscribe(function (_resp) {
                    _this.janelaList = _resp;
                    var grade = JSON.parse(sessionStorage.getItem("grade"));
                    _this.createGrade();
                    setTimeout(function () {
                        _this.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte(grade, indexJ);
                        _this.constantes.listaForm[6].disabled = true;
                        _this.constantes.listaForm[7].disabled = true;
                        _this.constantes.listaForm[8].disabled = true;
                        sessionStorage.removeItem('grade');
                    }, 1000);
                });
            });
        };
        // 7
        _this.copiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.executeCopiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte(); });
        };
        _this.executeCopiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte = function () {
            var self = _this;
            var indexI;
            var indexJ;
            for (var i = 0; i < self.grade.length; i++) {
                for (var j = 0; j < self.grade[i].items.length; j++) {
                    if (self.grade[i].items[j].linkId === self.janelaDados.linkId) {
                        indexI = i;
                        indexJ = j;
                        break;
                    }
                }
            }
            sessionStorage.setItem("grade", JSON.stringify(self.grade));
            var _scheduled = self.service.filtro.mes;
            _scheduled = _scheduled.split("/");
            var date = new Date(_scheduled[0] + "/01/" + _scheduled[1]);
            date.setMonth(date.getMonth() + 1);
            self.service.filtro.mes = date;
            if (self.service.agUtilizarTipofrete) {
                self.service.filtro.tipoFrete = 'C';
            }
            else {
                self.service.filtro.tipoFrete = '';
            }
            if (self.service.janOpeTipMov) {
                self.service.filtro.tipoMov = 'C';
            }
            else {
                self.service.filtro.tipoMov = 'A';
            }
            self.service.getByFiltro(self.service.filtro).subscribe(function (resp) {
                var month = date.getMonth() + 1;
                if (month < 10) {
                    _this.service.filtro.mes = '0' + month + '/' + date.getFullYear();
                }
                else {
                    _this.service.filtro.mes = month + '/' + date.getFullYear();
                }
                self.service.janelaNavega.mes = self.service.filtro.mes.substr(0, 2) + '/' + self.service.filtro.mes.substr(3, 6);
                self.service.janelaNavega.material = self.service.filtro.material;
                self.service.janelaNavega.fantasia = self.service.filtro.produto && self.service.filtro.produto.fantasia ? self.service.filtro.produto.fantasia : "";
                self.service.janelaNavega.tipoFrete = self.service.filtro.tipoFrete;
                self.service.janelaNavega.tipoFreteDescr = self.tipoFreteEnum.get(self.service.filtro.tipoFrete);
                self.service.janelaNavega.tipoMov = self.service.filtro.tipoMov;
                self.service.janelaNavega.tipoMovDescr = self.tipoMovEnum.get(self.service.filtro.tipoMov);
                self.service.janelaNavega.scheduled = month + '/' + date.getFullYear();
                var data = btoa(JSON.stringify(self.service.janelaNavega));
                var per = _this.funcoes.dateTimeUtils.getPeriodo(self.service.janelaNavega.mes);
                var dtRef = per.dataI;
                _this.periodo = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalPeriodo"](dtRef);
                _this.janelaList = [];
                var filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalFilter"]();
                filtro.dtIni = _this.periodo.dtIniMes;
                filtro.dtFim = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(_this.periodo.dtFimMes).add(23, 'hours')).add(59, 'minutes');
                filtro.material = _this.service.janelaNavega.material;
                filtro.tipoFrete = _this.service.janelaNavega.tipoFrete;
                filtro.tipoMov = _this.service.janelaNavega.tipoMov;
                _this.service.getDados(filtro).subscribe(function (_resp) {
                    _this.janelaList = _resp;
                    var grade = JSON.parse(sessionStorage.getItem("grade"));
                    _this.createGrade();
                    setTimeout(function () {
                        _this.updateCopiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte(grade, indexJ);
                        _this.constantes.listaForm[6].disabled = true;
                        _this.constantes.listaForm[7].disabled = true;
                        _this.constantes.listaForm[8].disabled = true;
                        sessionStorage.removeItem('grade');
                        sessionStorage.removeItem('grade');
                    }, 1000);
                });
            });
        };
        // 8
        _this.copiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte = function () {
            _this.message.confirm("titles.janelaOperacional", "messages.confirmaEstaAcao", null, function () { return _this.executeCopiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte(); });
        };
        _this.executeCopiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte = function () {
            var self = _this;
            var indexI;
            var indexJ;
            for (var i = 0; i < self.grade.length; i++) {
                for (var j = 0; j < self.grade[i].items.length; j++) {
                    if (self.grade[i].items[j].linkId === self.janelaDados.linkId) {
                        indexI = i;
                        indexJ = j;
                        break;
                    }
                }
            }
            sessionStorage.setItem("grade", JSON.stringify(self.grade));
            var _scheduled = self.service.filtro.mes;
            _scheduled = _scheduled.split("/");
            var date = new Date(_scheduled[0] + "/01/" + _scheduled[1]);
            date.setMonth(date.getMonth() + 1);
            self.service.filtro.mes = date;
            if (self.service.agUtilizarTipofrete) {
                self.service.filtro.tipoFrete = 'C';
            }
            else {
                self.service.filtro.tipoFrete = '';
            }
            if (self.service.janOpeTipMov) {
                self.service.filtro.tipoMov = 'C';
            }
            else {
                self.service.filtro.tipoMov = 'A';
            }
            self.service.getByFiltro(self.service.filtro).subscribe(function (resp) {
                var month = date.getMonth() + 1;
                if (month < 10) {
                    _this.service.filtro.mes = '0' + month + '/' + date.getFullYear();
                }
                else {
                    _this.service.filtro.mes = month + '/' + date.getFullYear();
                }
                if (resp.length > 0) {
                    /**/
                }
                self.service.janelaNavega.mes = self.service.filtro.mes.substr(0, 2) + '/' + self.service.filtro.mes.substr(3, 6);
                self.service.janelaNavega.material = self.service.filtro.material;
                self.service.janelaNavega.fantasia = self.service.filtro.produto && self.service.filtro.produto.fantasia ? self.service.filtro.produto.fantasia : "";
                self.service.janelaNavega.tipoFrete = self.service.filtro.tipoFrete;
                self.service.janelaNavega.tipoFreteDescr = self.tipoFreteEnum.get(self.service.filtro.tipoFrete);
                self.service.janelaNavega.tipoMov = self.service.filtro.tipoMov;
                self.service.janelaNavega.tipoMovDescr = self.tipoMovEnum.get(self.service.filtro.tipoMov);
                self.service.janelaNavega.scheduled = month + '/' + date.getFullYear();
                var data = btoa(JSON.stringify(self.service.janelaNavega));
                var per = _this.funcoes.dateTimeUtils.getPeriodo(self.service.janelaNavega.mes);
                var dtRef = per.dataI;
                _this.periodo = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalPeriodo"](dtRef);
                _this.janelaList = [];
                var filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalFilter"]();
                filtro.dtIni = _this.periodo.dtIniMes;
                filtro.dtFim = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(_this.periodo.dtFimMes).add(23, 'hours')).add(59, 'minutes');
                filtro.material = _this.service.janelaNavega.material;
                filtro.tipoFrete = _this.service.janelaNavega.tipoFrete;
                filtro.tipoMov = _this.service.janelaNavega.tipoMov;
                _this.service.getDados(filtro).subscribe(function (_resp) {
                    _this.janelaList = _resp;
                    var grade = JSON.parse(sessionStorage.getItem("grade"));
                    _this.createGrade();
                    setTimeout(function () {
                        _this.updateCopiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte(grade);
                        _this.constantes.listaForm[6].disabled = true;
                        _this.constantes.listaForm[7].disabled = true;
                        _this.constantes.listaForm[8].disabled = true;
                        sessionStorage.removeItem('grade');
                        sessionStorage.removeItem('grade');
                    }, 1000);
                });
            });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    PtlJanelaOperacionalFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        var self = this;
        self.permissoesUtils.verificaRotina(self.constantes.sisFormularioId, 3, function () {
            var data = self.activatedRoute.snapshot.paramMap.get("data");
            if (!data) {
                self.back();
            }
            _super.prototype.addFuncoes.call(_this, [
                { action: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanas', func: function () { return self.copiarDiaselecionadoParaMesmoDiaDasDemaisSemanas; } },
                { action: 'copiarDiaselecionadoParaTodosOsDias', func: function () { return self.copiarDiaselecionadoParaTodosOsDias; } },
                { action: 'copiarSemanaAtualParaTodasAsSemanas', func: function () { return self.copiarSemanaAtualParaTodasAsSemanas; } },
                { action: 'replicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia', func: function () { return self.replicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia; } },
                { action: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte', func: function () { return self.copiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte; } },
                { action: 'copiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte', func: function () { return self.copiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte; } },
                { action: 'copiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte', func: function () { return self.copiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte; } },
            ]);
            var ddata = JSON.parse(atob(data));
            if (ddata.scheduled) {
                self.service.janelaNavega.mes = ddata.scheduled;
            }
            else {
                self.service.janelaNavega.mes = ddata.mes;
            }
            self.service.janelaNavega.material = ddata.material;
            self.service.janelaNavega.fantasia = ddata.fantasia;
            self.service.janelaNavega.tipoFrete = ddata.tipoFrete;
            self.service.janelaNavega.tipoFreteDescr = ddata.tipoFreteDescr;
            self.service.janelaNavega.tipoMov = ddata.tipoMov;
            self.service.janelaNavega.tipoMovDescr = ddata.tipoMovDescr;
            var rd = self.service.janelaNavega.mes.split('/');
            var d = new Date(+rd[1], (+rd[0]) - 1, new Date().getDate());
            if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].menorOuIgualA(new Date(), d))
                d = new Date(+rd[1], (+rd[0]) - 1, 1);
            _this.periodo = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalPeriodo"](d);
            self.janelaList = [];
            self.getConfig();
        }, function () {
            self.permissoesUtils.back();
        }, true);
    };
    PtlJanelaOperacionalFormComponent.prototype.getConfig = function () {
        this.configuracao.getConfig(this.constantes.parametrosConfig, this.init);
    };
    PtlJanelaOperacionalFormComponent.prototype.createGrade = function () {
        return __awaiter(this, void 0, void 0, function () {
            var horaIni, id, i, items, horario, intervalo, tipoAgCargaDescarga, _loop_1, this_1, j, itemGrade;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (this.service.janOpeTipMov && this.service.janelaNavega.tipoMov === 'D') {
                            this.qtdePeriodos = this.service.qtPeriodosAgD;
                        }
                        else {
                            this.qtdePeriodos = this.service.qtPeriodosAg;
                        }
                        this.intervaloHoras = 24 / this.qtdePeriodos;
                        this.createWeek();
                        this.grade = [];
                        horaIni = 0;
                        id = 1;
                        for (i = 0; i < 24; i++) {
                            items = [];
                            horario = _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].completeCharLeft(i.toString(), "0", 2) + ":00";
                            intervalo = this.intervaloHoras;
                            tipoAgCargaDescarga = this.service.tipoAgCargaDescarga;
                            if (i === horaIni) {
                                _loop_1 = function (j) {
                                    var dtRef = this_1.dateTimeUtils.addDays(this_1.periodo.dtIniSemana, j);
                                    var dtIni = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(dtRef).add(horaIni, 'hours')).add(0, 'minutes');
                                    var dtFim = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(dtRef).add(i + (this_1.intervaloHoras - 1), 'hours')).add(59, 'minutes');
                                    this_1.janelaDados = this_1.janelaList.find(function (janela) { return moment__WEBPACK_IMPORTED_MODULE_2__(janela.dtJanelaI).isSame(moment__WEBPACK_IMPORTED_MODULE_2__(dtIni)) && moment__WEBPACK_IMPORTED_MODULE_2__(janela.dtJanelaF).isSame(moment__WEBPACK_IMPORTED_MODULE_2__(dtFim)); });
                                    if (this_1.funcoes.isUndefinedOrNull(this_1.janelaDados)) {
                                        this_1.janelaDados = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacional"]();
                                        this_1.janelaDados.itemGrade = i;
                                        this_1.janelaDados.ptlJanelaOperacionalId = 0;
                                        this_1.janelaDados.dtJanelaI = dtIni;
                                        this_1.janelaDados.dtJanelaF = dtFim;
                                        this_1.janelaDados.materialId = this_1.service.janelaNavega.material;
                                        this_1.janelaDados.tipoFrete = this_1.service.janelaNavega.tipoFrete;
                                        this_1.janelaDados.tipoMov = this_1.service.janelaNavega.tipoMov;
                                        this_1.janelaDados.qtCarga = 0;
                                        this_1.janelaDados.qtDescarga = 0;
                                        this_1.janelaDados.qtGeral = 0;
                                        if (dtRef >= this_1.periodo.dtIniMes && dtRef <= this_1.periodo.dtFimMes) {
                                            this_1.linkId++;
                                            this_1.janelaDados.linkId = this_1.linkId;
                                            this_1.janelaList.push(this_1.janelaDados);
                                        }
                                    }
                                    else if (this_1.funcoes.isUndefinedOrNull(this_1.janelaDados['linkId'])) {
                                        this_1.linkId++;
                                        this_1.janelaDados.linkId = this_1.linkId;
                                        this_1.janelaDados.itemGrade = i;
                                    }
                                    this_1.janelaDados.id = id++;
                                    items.push(this_1.janelaDados);
                                };
                                this_1 = this;
                                for (j = 0; j < 7; j++) {
                                    _loop_1(j);
                                }
                                horaIni = horaIni + this.intervaloHoras;
                            }
                            itemGrade = {
                                horario: horario,
                                intervalo: intervalo,
                                tipoAgCargaDescarga: tipoAgCargaDescarga,
                                items: items
                            };
                            this.grade.push(itemGrade);
                        }
                        this.getTotal();
                        return [4 /*yield*/, this.obterDia([this.diaSemana1, this.diaSemana2, this.diaSemana3, this.diaSemana4, this.diaSemana5, this.diaSemana6, this.diaSemana7])];
                    case 1:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    PtlJanelaOperacionalFormComponent.prototype.obterDia = function (array) {
        var _this = this;
        var promise = new Promise(function (resolve, reject) {
            if (array.length === 0) {
                resolve([]);
                return;
            }
            var diaSemana = array[array.length - 1];
            var dayWeek = diaSemana.split(" ");
            setTimeout(function () {
                var td = jQuery('td:contains(' + diaSemana + ')').eq(0);
                var id = td.attr('data-header-id');
                jQuery('td[data-message-id=' + id + ']').attr('data-day', dayWeek[1]);
            }, 1000);
            array.splice(array.length - 1, 1);
            resolve(_this.obterDia(array));
            return;
        });
        return promise;
    };
    PtlJanelaOperacionalFormComponent.prototype.getTotal = function () {
        var array = [];
        array[0] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[1] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[2] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[3] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[4] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[5] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        array[6] = { qtCarga: 0, qtDescarga: 0, qtGeral: 0, tipoAgCargaDescarga: "" };
        for (var i = 0; i < this.grade.length; i++) {
            for (var j = 0; j < this.grade[i].items.length; j++) {
                if (this.grade[i].items[j].linkId > 0) {
                    array[j].qtCarga = +array[j].qtCarga + (+this.grade[i].items[j].qtCarga);
                    array[j].qtDescarga = +array[j].qtDescarga + (+this.grade[i].items[j].qtDescarga);
                    array[j].qtGeral = +array[j].qtGeral + (+this.grade[i].items[j].qtGeral);
                    array[j].tipoAgCargaDescarga = this.service.tipoAgCargaDescarga;
                }
            }
        }
        this.total = array;
    };
    PtlJanelaOperacionalFormComponent.prototype.NextWeek = function () {
        this.periodo.dtIniSemana = this.dateTimeUtils.addDays(this.periodo.dtFimSemana, 1);
        this.periodo.dtFimSemana = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(this.periodo.dtIniSemana).endOf('week')).startOf('day')).add(1, 'days');
        this.periodo.semana = moment__WEBPACK_IMPORTED_MODULE_2__(this.periodo.dtIniSemana).week();
        this.createGrade();
    };
    PtlJanelaOperacionalFormComponent.prototype.PriorWeek = function () {
        this.periodo.dtIniSemana = this.dateTimeUtils.addDays(this.periodo.dtIniSemana, -7);
        this.periodo.dtFimSemana = moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(moment__WEBPACK_IMPORTED_MODULE_2__(this.periodo.dtIniSemana).endOf('week')).startOf('day')).add(1, 'days');
        this.periodo.semana = moment__WEBPACK_IMPORTED_MODULE_2__(this.periodo.dtIniSemana).week();
        this.createGrade();
    };
    PtlJanelaOperacionalFormComponent.prototype.trataEditJanela = function (data) {
        data.alterado = true;
        var idxJanela = this.janelaList.findIndex(function (c) { return c.linkId === data.linkId; });
        this.janelaList[idxJanela] = data;
        var idxItem = this.grade[data.itemGrade].items.findIndex(function (c) { return c.linkId === data.linkId; });
        this.grade[data.itemGrade].items[idxItem] = data;
        this.getTotal();
    };
    PtlJanelaOperacionalFormComponent.prototype.selectJanela = function (item, index) {
        jQuery("#tabela-grade td").removeClass("item-selecionado");
        if (item.linkId === 0) {
            return;
        }
        jQuery("#td_" + item.id).addClass("item-selecionado");
        switch (index) {
            case 0:
                this.currentDiaSemana = this.diaSemana1;
                break;
            case 1:
                this.currentDiaSemana = this.diaSemana2;
                break;
            case 2:
                this.currentDiaSemana = this.diaSemana3;
                break;
            case 3:
                this.currentDiaSemana = this.diaSemana4;
                break;
            case 4:
                this.currentDiaSemana = this.diaSemana5;
                break;
            case 5:
                this.currentDiaSemana = this.diaSemana6;
                break;
            case 6:
                this.currentDiaSemana = this.diaSemana7;
                break;
            default:
                return;
        }
        var day = jQuery('td[id=td_' + item.id + ']').attr('data-day');
        if (day) {
            sessionStorage.setItem("identifier", day);
        }
        this.janelaDados = Object.assign({}, item);
        if (this.funcoes.isEdit(this.actionForm) || this.funcoes.isCreate(this.actionForm)) {
            this.constantes.listaForm[2].disabled = false;
            this.constantes.listaForm[3].disabled = false;
            this.constantes.listaForm[4].disabled = false;
            this.constantes.listaForm[5].disabled = false;
        }
        if (this.funcoes.isDetail(this.actionForm)) {
            this.constantes.listaForm[6].disabled = false;
            this.constantes.listaForm[7].disabled = false;
            this.constantes.listaForm[8].disabled = false;
        }
        var data = new Date(this.janelaDados.dtJanelaI);
        this.daySelected = new Date(data).getDate();
        this.monthSelected = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].getWeekOfYear(new Date(data));
    };
    PtlJanelaOperacionalFormComponent.prototype.editJanela = function (item) {
        var currentDate = new Date();
        currentDate.setDate(currentDate.getDate() - 1);
        if (item.linkId === 0 || this.funcoes.isDetail(this.actionForm)) {
            return;
        }
        if (this.janelaDados.dtJanelaF < currentDate) {
            this.message.warning("titles.janelaOperacional", "messages.naoEPossivelEditarDiasAnteriores");
            return;
        }
        jQuery("#ptl-janela-operacional-edit").modal("show");
    };
    PtlJanelaOperacionalFormComponent.prototype.save = function () {
        var _this = this;
        var data = this.janelaList.filter(function (c) { return c.alterado; });
        if (data.length === 0) {
            this.message.warning('titles.janelaOperacional', 'messages.nenhumaJanelaAlterada');
            return;
        }
        this.service.saveData(data).subscribe(function (result) {
            var hasErrors = false;
            result.forEach(function (e) {
                if (!e.validationResult.isValid) {
                    hasErrors = true;
                    var mensagens = _this.message.validationResult(e.validationResult);
                    mensagens.forEach(function (m) { return _this.message.warning("titles.janelaOperacional", m); });
                }
            });
            if (!hasErrors) {
                _this.message.saveSuccess("titles.janelaOperacional");
                _this.back();
            }
        });
    };
    PtlJanelaOperacionalFormComponent.prototype.back = function () {
        this.router.navigate([this.target + "/portal/janelaOperacional"]);
    };
    PtlJanelaOperacionalFormComponent.prototype.edit = function () {
        var data = btoa(JSON.stringify(this.service.janelaNavega));
        this.router.navigate([this.target + "/portal/janelaOperacional/edit/" + data]);
    };
    PtlJanelaOperacionalFormComponent.prototype.getDayOfWeek = function (date) {
        var week = [
            this.message.getTranslates("labels", "domingo"),
            this.message.getTranslates("labels", "segunda"),
            this.message.getTranslates("labels", "terca"),
            this.message.getTranslates("labels", "quarta"),
            this.message.getTranslates("labels", "quinta"),
            this.message.getTranslates("labels", "sexta"),
            this.message.getTranslates("labels", "sabado"),
        ];
        return week[date.day()] + " " + moment__WEBPACK_IMPORTED_MODULE_2__(date).date();
    };
    PtlJanelaOperacionalFormComponent.prototype.createWeek = function () {
        this.diaSemana1 = this.getDayOfWeek(this.periodo.dtIniSemana);
        this.diaSemana2 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 1));
        this.diaSemana3 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 2));
        this.diaSemana4 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 3));
        this.diaSemana5 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 4));
        this.diaSemana6 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 5));
        this.diaSemana7 = this.getDayOfWeek(this.dateTimeUtils.addDays(this.periodo.dtIniSemana, 6));
    };
    PtlJanelaOperacionalFormComponent.prototype.clean = function () {
        for (var i = 0; i < this.grade.length; i++) {
            for (var j = 0; j < this.grade[i].items.length; j++) {
                this.grade[i].items[j].selected = false;
            }
        }
    };
    PtlJanelaOperacionalFormComponent.prototype.executeCopiarDiaselecionadoParaTodosOsDias = function (banda) {
        if (banda === void 0) { banda = 1; }
        var grade = JSON.parse(sessionStorage.getItem("grade"));
        var indexI = +sessionStorage.getItem("indexI");
        var indexJ = +sessionStorage.getItem("indexJ");
        if (this.periodo.dtFimSemana < this.periodo.dtFimMes && banda === 1) {
            this.NextWeek();
            var obj = [];
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = new Date(this.grade[i].items[j].dtJanelaI).getDate();
                    if (date > this.daySelected) {
                        this.grade[i].items[j].qtCarga = grade[i].items[indexJ].qtCarga;
                        this.grade[i].items[j].qtDescarga = grade[i].items[indexJ].qtDescarga;
                        this.grade[i].items[j].qtGeral = grade[i].items[indexJ].qtGeral;
                        this.grade[i].items[j].alterado = true;
                        if (this.grade[i].items[j].linkId !== 0) {
                            this.grade[i].items[j].selected = true;
                        }
                        obj.push(this.grade[i].items[j]);
                    }
                }
            }
            this.executeCopiarDiaselecionadoParaTodosOsDias(banda);
        }
        else {
            banda = 2;
        }
        if (this.periodo.dtIniSemana > this.periodo.dtIniMes && banda === 2) {
            this.PriorWeek();
            var obj = [];
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = new Date(this.grade[i].items[j].dtJanelaI).getDate();
                    if (date > this.daySelected) {
                        this.grade[i].items[j].qtCarga = grade[i].items[indexJ].qtCarga;
                        this.grade[i].items[j].qtDescarga = grade[i].items[indexJ].qtDescarga;
                        this.grade[i].items[j].qtGeral = grade[i].items[indexJ].qtGeral;
                        this.grade[i].items[j].alterado = true;
                        if (this.grade[i].items[j].linkId !== 0) {
                            this.grade[i].items[j].selected = true;
                        }
                        obj.push(this.grade[i].items[j]);
                    }
                }
            }
            this.executeCopiarDiaselecionadoParaTodosOsDias(banda);
        }
        sessionStorage.removeItem("grade");
        sessionStorage.removeItem("indexI");
        sessionStorage.removeItem("indexJ");
        return;
    };
    PtlJanelaOperacionalFormComponent.prototype.executeCopiarSemanaAtualParaTodasAsSemanas = function (banda) {
        if (banda === void 0) { banda = 1; }
        var grade = JSON.parse(sessionStorage.getItem("grade"));
        if (this.periodo.dtFimSemana < this.periodo.dtFimMes && banda === 1) {
            this.NextWeek();
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = new Date(this.grade[i].items[j].dtJanelaI);
                    var month = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].getWeekOfYear(date);
                    if (month > this.monthSelected) {
                        this.grade[i].items[j].qtCarga = grade[i].items[j].qtCarga;
                        this.grade[i].items[j].qtDescarga = grade[i].items[j].qtDescarga;
                        this.grade[i].items[j].qtGeral = grade[i].items[j].qtGeral;
                        this.grade[i].items[j].alterado = true;
                        if (this.grade[i].items[j].linkId !== 0) {
                            this.grade[i].items[j].selected = true;
                        }
                    }
                }
            }
            return this.executeCopiarSemanaAtualParaTodasAsSemanas(banda);
        }
        else {
            banda = 2;
        }
        if (this.periodo.dtIniSemana > this.periodo.dtIniMes && banda === 2) {
            this.PriorWeek();
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = new Date(this.grade[i].items[j].dtJanelaI);
                    var month = app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_14__["DateTimeUtilsStaticService"].getWeekOfYear(date);
                    if (month > this.monthSelected) {
                        this.grade[i].items[j].qtCarga = grade[i].items[j].qtCarga;
                        this.grade[i].items[j].qtDescarga = grade[i].items[j].qtDescarga;
                        this.grade[i].items[j].qtGeral = grade[i].items[j].qtGeral;
                        this.grade[i].items[j].alterado = true;
                        if (this.grade[i].items[j].linkId !== 0) {
                            this.grade[i].items[j].selected = true;
                        }
                    }
                }
            }
            return this.executeCopiarSemanaAtualParaTodasAsSemanas(banda);
        }
        sessionStorage.removeItem("grade");
        return;
    };
    PtlJanelaOperacionalFormComponent.prototype.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas = function (arrayObj, indexI, indexJ, janelaDados, banda) {
        if (banda === void 0) { banda = 1; }
        var grade = JSON.parse(sessionStorage.getItem("grade"));
        if (this.periodo.dtFimSemana < this.periodo.dtFimMes && banda === 1) {
            this.NextWeek();
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = (new Date(this.grade[i].items[indexJ].dtJanelaI)).getDate();
                    if (date > this.daySelected) {
                        this.grade[i].items[indexJ].alterado = true;
                        this.grade[i].items[indexJ].qtCarga = grade[i].items[indexJ].qtCarga;
                        this.grade[i].items[indexJ].qtDescarga = grade[i].items[indexJ].qtDescarga;
                        this.grade[i].items[indexJ].qtGeral = grade[i].items[indexJ].qtGeral;
                        this.grade[i].items[indexJ].selected = true;
                        arrayObj[0] = this.grade[i].items[indexJ];
                        break;
                    }
                }
            }
            return this.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas(arrayObj, indexI, indexJ, janelaDados);
        }
        else {
            banda = 2;
        }
        if (this.periodo.dtIniSemana > this.periodo.dtIniMes && banda === 2) {
            this.PriorWeek();
            for (var i = 0; i < this.grade.length; i++) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    var date = (new Date(this.grade[i].items[indexJ].dtJanelaI)).getDate();
                    if (date > this.daySelected) {
                        this.grade[i].items[indexJ].alterado = true;
                        this.grade[i].items[indexJ].qtCarga = grade[i].items[indexJ].qtCarga;
                        this.grade[i].items[indexJ].qtDescarga = grade[i].items[indexJ].qtDescarga;
                        this.grade[i].items[indexJ].qtGeral = grade[i].items[indexJ].qtGeral;
                        this.grade[i].items[indexJ].selected = true;
                        arrayObj[0] = this.grade[i].items[indexJ];
                        break;
                    }
                }
            }
            return this.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanas(arrayObj, indexI, indexJ, janelaDados, banda);
        }
        else {
            sessionStorage.removeItem('grade');
        }
    };
    PtlJanelaOperacionalFormComponent.prototype.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte = function (grade, indexJ) {
        var isset = false;
        for (var i = 0; i < this.grade.length; i++) {
            if (this.grade[i].items) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    if (this.grade[i].items[j].linkId > 0) {
                        var id = void 0;
                        id = jQuery('td[data-day=' + sessionStorage.getItem("identifier") + ']').eq(0).attr('id');
                        if (id !== undefined) {
                            isset = true;
                            var tds = jQuery('td[data-day=' + sessionStorage.getItem("identifier") + ']');
                            for (var x = 0; x < tds.length; x++) {
                                if (tds.eq(x).attr('id') === 'td_' + this.grade[i].items[j].id) {
                                    this.grade[i].items[j].selected = true;
                                    this.grade[i].items[j].alterado = true;
                                    this.grade[i].items[j].qtCarga = grade[i].items[indexJ].qtCarga;
                                    this.grade[i].items[j].qtDescarga = grade[i].items[indexJ].qtDescarga;
                                    this.grade[i].items[j].qtGeral = grade[i].items[indexJ].qtGeral;
                                }
                            }
                        }
                    }
                }
            }
        }
        if (isset === false) {
            this.updateCopiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte(grade, indexJ);
        }
        return isset;
    };
    PtlJanelaOperacionalFormComponent.prototype.updateCopiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte = function (grade, indexJ) {
        for (var i = 0; i < this.grade.length; i++) {
            if (this.grade[i].items) {
                for (var j = 0; j < this.grade[i].items.length; j++) {
                    if (this.grade[i].items[j].linkId > 0) {
                        this.grade[i].items[j].selected = true;
                        this.grade[i].items[j].alterado = true;
                        this.grade[i].items[j].qtCarga = grade[i].items[indexJ].qtCarga;
                        this.grade[i].items[j].qtDescarga = grade[i].items[indexJ].qtDescarga;
                        this.grade[i].items[j].qtGeral = grade[i].items[indexJ].qtGeral;
                    }
                }
            }
        }
        if (this.periodo.dtFimSemana < this.periodo.dtFimMes) {
            this.NextWeek();
            this.updateCopiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte(grade, indexJ);
            return;
        }
        return;
    };
    PtlJanelaOperacionalFormComponent.prototype.updateCopiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte = function (grade) {
        for (var i = 0; i < this.grade.length; i++) {
            for (var j = 0; j < this.grade[i].items.length; j++) {
                if (this.grade[i] && this.grade[i].items[j]) {
                    this.grade[i].items[j].qtCarga = grade[i].items[j].qtCarga;
                    this.grade[i].items[j].qtDescarga = grade[i].items[j].qtDescarga;
                    this.grade[i].items[j].qtGeral = grade[i].items[j].qtGeral;
                    this.grade[i].items[j].alterado = true;
                    if (this.grade[i].items[j].linkId !== 0) {
                        this.grade[i].items[j].selected = true;
                    }
                }
            }
        }
        if (this.periodo.dtFimSemana < this.periodo.dtFimMes) {
            this.NextWeek();
            this.updateCopiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte(grade);
            return;
        }
        return;
    };
    PtlJanelaOperacionalFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_10__["PtlJanelaOperacionalService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__["ConfiguracaoFacade"] },
        { type: _shared_services_funcoes_date_time_utils_date_time_utils_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__["PermissoesUtilsService"] }
    ]; };
    PtlJanelaOperacionalFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-ptl-janela-operacional-form',
            template: __importDefault(__webpack_require__(/*! raw-loader!./ptl-janela-operacional-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None,
            styles: [__importDefault(__webpack_require__(/*! ./ptl-janela-operacional-form.component.scss */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.scss")).default]
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_10__["PtlJanelaOperacionalService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_4__["ConfiguracaoFacade"],
            _shared_services_funcoes_date_time_utils_date_time_utils_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_12__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_13__["PermissoesUtilsService"]])
    ], PtlJanelaOperacionalFormComponent);
    return PtlJanelaOperacionalFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_11__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.ts":
/*!****************************************************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.ts ***!
  \****************************************************************************************************************************/
/*! exports provided: PtlJanelaOperacionalIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalIndexComponent", function() { return PtlJanelaOperacionalIndexComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ptl-janela-operacional.constants */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.constants.ts");
/* harmony import */ var _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ptl-janela-operacional.model */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts");
/* harmony import */ var _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ptl-janela-operacional.service */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./../../../../shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};











var PtlJanelaOperacionalIndexComponent = /** @class */ (function (_super) {
    __extends(PtlJanelaOperacionalIndexComponent, _super);
    function PtlJanelaOperacionalIndexComponent(router, service, activatedRoute, datatablesService, message, funcoes, permissoesUtils) {
        var _this = _super.call(this, new _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_2__["PtlJanelaOperacionalConstants"](), funcoes) || this;
        _this.router = router;
        _this.service = service;
        _this.activatedRoute = activatedRoute;
        _this.datatablesService = datatablesService;
        _this.message = message;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.data = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalNavega"]();
        _this.constantes = new _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_2__["PtlJanelaOperacionalConstants"]();
        _this.target = _this.funcoes.getTargetLocation();
        _this.tipoFreteEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_10__["TipoFreteEnum"]();
        _this.tipoMovEnum = new _config_enumerables__WEBPACK_IMPORTED_MODULE_10__["TipoMovEnum"]();
        _this.mensagens = [];
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    PtlJanelaOperacionalIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.service.getConfig();
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            if (_this.service.agUtilizarTipofrete) {
                _this.service.filtro.tipoFrete = 'C';
                _this.tipoFreteEnum.get().splice(0);
            }
            else {
                _this.service.filtro.tipoFrete = '';
            }
            if (_this.service.janOpeTipMov) {
                _this.service.filtro.tipoMov = 'C';
                _this.tipoMovEnum.get().splice(0);
            }
            else {
                _this.service.filtro.tipoMov = 'A';
            }
            _this.filtrar();
        }, function () {
            _this.permissoesUtils.back();
        }, true);
        if (this.funcoes.isUndefinedOrNull(this.service.filtro)) {
            this.service.filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalFilter"]();
        }
    };
    PtlJanelaOperacionalIndexComponent.prototype.refresh = function () {
        var _this = this;
        var scheduled = this.service.filtro.mes;
        scheduled = scheduled.split("/");
        this.service.filtro.mes = new Date(scheduled[0] + "/01/" + scheduled[1]);
        this.service.getByFiltro(this.service.filtro).subscribe(function (resp) {
            var columns = [
                _this.datatablesService.getDataString("mes", "mesAno", "10%"),
                _this.datatablesService.getDataString("material", "produto", "10%"),
                _this.datatablesService.getDataString("fantasia", "fantasia")
            ];
            if (_this.service.agUtilizarTipofrete) {
                columns.push(_this.datatablesService.getDataSelect("tipoFrete", "tipoFrete", _this.tipoFreteEnum.get(), "10%"));
            }
            if (_this.service.janOpeTipMov) {
                columns.push(_this.datatablesService.getDataSelect("tipoMov", "tipoMov", _this.tipoMovEnum.get(), "10%"));
            }
            _this.service.filtro.mes = scheduled[0] + "/" + scheduled[1];
            _this.datatablesService.datatable("dtJanelaOperacional", columns, resp, function (aData) {
                _this.data = aData;
            });
        });
    };
    PtlJanelaOperacionalIndexComponent.prototype.filtrar = function () {
        this.service.filtro.tipoBusca = 'F';
        jQuery("#ptl-janela-operacional-filter").modal("show");
    };
    PtlJanelaOperacionalIndexComponent.prototype.executaFiltro = function () {
        jQuery("#ptl-janela-operacional-filter").modal("hide");
        this.refresh();
    };
    PtlJanelaOperacionalIndexComponent.prototype.create = function () {
        this.service.filtro.tipoBusca = 'V';
        jQuery("#ptl-janela-operacional-filter").modal("show");
    };
    PtlJanelaOperacionalIndexComponent.prototype.trataCreate = function () {
        var _this = this;
        jQuery("#ptl-janela-operacional-filter").modal("hide");
        var self = this;
        var _scheduled = self.service.filtro.mes;
        _scheduled = _scheduled.split("/");
        this.service.filtro.mes = new Date(_scheduled[0] + "/01/" + _scheduled[1]);
        self.service.getByFiltro(self.service.filtro).subscribe(function (resp) {
            _this.service.filtro.mes = _scheduled[0] + "/" + _scheduled[1];
            if (resp.length > 0) {
                self.message.warning('titles.janelaOperacional', 'messages.janelaOperacionaJaCadastrada');
                return;
            }
            var scheduled = _this.service.filtro.mes;
            scheduled = scheduled.split("/");
            self.service.janelaNavega.mes = self.service.filtro.mes.substr(0, 2) + '/' + self.service.filtro.mes.substr(2, 4);
            self.service.janelaNavega.material = self.service.filtro.material;
            self.service.janelaNavega.fantasia = self.service.filtro.produto && self.service.filtro.produto.fantasia ? self.service.filtro.produto.fantasia : "";
            self.service.janelaNavega.tipoFrete = self.service.filtro.tipoFrete;
            self.service.janelaNavega.tipoFreteDescr = self.tipoFreteEnum.get(self.service.filtro.tipoFrete);
            self.service.janelaNavega.tipoMov = self.service.filtro.tipoMov;
            self.service.janelaNavega.tipoMovDescr = self.tipoMovEnum.get(self.service.filtro.tipoMov);
            self.service.janelaNavega.scheduled = scheduled[0] + "/" + scheduled[1];
            var data = btoa(JSON.stringify(self.service.janelaNavega));
            self.router.navigate([self.target + "/portal/janelaOperacional/create/" + data]);
        });
    };
    PtlJanelaOperacionalIndexComponent.prototype.edit = function () {
        if (!!(this.data.mes)) {
            this.service.janelaNavega = this.data;
            this.service.janelaNavega.tipoFreteDescr = this.tipoFreteEnum.get(this.data.tipoFrete);
            this.service.janelaNavega.tipoMovDescr = this.tipoMovEnum.get(this.data.tipoMov);
            var data = btoa(JSON.stringify(this.service.janelaNavega));
            this.router.navigate([this.target + "/portal/janelaOperacional/edit/" + data]);
        }
    };
    PtlJanelaOperacionalIndexComponent.prototype.detail = function () {
        if (!!(this.data.mes)) {
            this.service.janelaNavega = this.data;
            this.service.janelaNavega.tipoFreteDescr = this.tipoFreteEnum.get(this.data.tipoFrete);
            this.service.janelaNavega.tipoMovDescr = this.tipoMovEnum.get(this.data.tipoMov);
            var data = btoa(JSON.stringify(this.service.janelaNavega));
            this.router.navigate([this.target + "/portal/janelaOperacional/detail/" + data]);
        }
    };
    PtlJanelaOperacionalIndexComponent.prototype.remove = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () { return __awaiter(_this, void 0, void 0, function () {
                    var _this = this;
                    return __generator(this, function (_a) {
                        if (!this.data) {
                            this.message.info("titles.janelaOperacional", "messages.nenhumRegistroSelecionado");
                            return [2 /*return*/];
                        }
                        this.message.removeConfirm(function () {
                            _this.service.deleteDados(_this.data).subscribe(function (result) {
                                _this.mensagens = _this.message.validationResult(result);
                                if (!result.isValid) {
                                    _this.mensagens.forEach(function (m) { return _this.message.warning("titles.janelaOperacional", m); });
                                    _this.funcoesService.backToTop();
                                }
                                else {
                                    _this.message.removeSuccess();
                                    _this.refresh();
                                    _this.data = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalNavega"]();
                                }
                            });
                        });
                        return [2 /*return*/];
                    });
                }); });
                return [2 /*return*/];
            });
        });
    };
    PtlJanelaOperacionalIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    PtlJanelaOperacionalIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_8__["DatatablesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__["PermissoesUtilsService"] }
    ]; };
    PtlJanelaOperacionalIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            template: __importDefault(__webpack_require__(/*! raw-loader!./ptl-janela-operacional-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _ptl_janela_operacional_service__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_8__["DatatablesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_7__["MessageService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_6__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_9__["PermissoesUtilsService"]])
    ], PtlJanelaOperacionalIndexComponent);
    return PtlJanelaOperacionalIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.constants.ts":
/*!*****************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.constants.ts ***!
  \*****************************************************************************************/
/*! exports provided: PtlJanelaOperacionalConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalConstants", function() { return PtlJanelaOperacionalConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var PtlJanelaOperacionalConstants = /** @class */ (function () {
    function PtlJanelaOperacionalConstants() {
        this.sisFormularioId = 340018;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.permissoes" }
        ];
        this.nomeForm = "titles.janelaOperacional";
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Visualizar', action: 'detail', icon: "icon-eye", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Excluir', action: 'remove', icon: "icon-close", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanas', action: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanas', icon: "fa fa-copy", exibeButton: true, eximeMenu: true, menuName: 'Arquivo', disabled: true },
            { title: 'copiarDiaselecionadoParaTodosOsDias', action: 'copiarDiaselecionadoParaTodosOsDias', icon: "fa fa-adjust", exibeButton: true, eximeMenu: true, menuName: 'Arquivo', disabled: true },
            { title: 'copiarSemanaAtualParaTodasAsSemanas', action: 'copiarSemanaAtualParaTodasAsSemanas', icon: "fa fa-bars", exibeButton: true, eximeMenu: true, menuName: 'Arquivo', disabled: true },
            { title: 'replicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia', action: 'replicarHorarioSelecionadoParaOsDemaisHorariosDoMesmoDia', icon: "fa fa-sort", exibeButton: true, eximeMenu: true, menuName: 'Arquivo', disabled: true },
            {
                title: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte',
                action: 'copiarDiaselecionadoParaMesmoDiaDasDemaisSemanasDoMesSeguinte',
                icon: "fa fa-tasks",
                exibeButton: false,
                eximeMenu: false,
                menuName: 'Arquivo',
                disabled: true
            },
            {
                title: 'copiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte',
                action: 'copiarDiaSelecionadoParaTodosOsDemaisDiasDoMesSeguinte',
                icon: "fa fa-table",
                exibeButton: false,
                eximeMenu: false,
                menuName: 'Arquivo',
                disabled: true
            },
            {
                title: 'copiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte',
                action: 'copiarOsDadosDaSemanaVisualizadaParaTodaSasDemaisSemanasDoMesSeguinte',
                icon: "fa fa-square",
                exibeButton: false,
                eximeMenu: false,
                menuName: 'Arquivo',
                disabled: true
            },
        ];
        this.parametrosConfig = [
            {
                sistema: 'PTL', parametros: [
                    'TipoAgCargaDescarga',
                    'AgUtilizarTipofrete',
                    'QtPeriodosAg',
                    'QtPeriodosAgD'
                ]
            },
            {
                sistema: 'UNI', parametros: [
                    'JanOpeTipMov'
                ]
            }
        ];
    }
    return PtlJanelaOperacionalConstants;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts":
/*!*************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts ***!
  \*************************************************************************************/
/*! exports provided: PtlJanelaOperacional, PtlJanelaOperacionalNavega, PtlJanelaOperacionalFilter, PtlJanelaOperacionalPeriodo */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacional", function() { return PtlJanelaOperacional; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalNavega", function() { return PtlJanelaOperacionalNavega; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalFilter", function() { return PtlJanelaOperacionalFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalPeriodo", function() { return PtlJanelaOperacionalPeriodo; });
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};


var PtlJanelaOperacional = /** @class */ (function (_super) {
    __extends(PtlJanelaOperacional, _super);
    function PtlJanelaOperacional() {
        var _this = _super.call(this) || this;
        _this.linkId = 0;
        _this.logRotina = "Janela Operacional";
        return _this;
    }
    return PtlJanelaOperacional;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_1__["BaseModel"]));

var PtlJanelaOperacionalNavega = /** @class */ (function () {
    function PtlJanelaOperacionalNavega() {
    }
    return PtlJanelaOperacionalNavega;
}());

var PtlJanelaOperacionalFilter = /** @class */ (function () {
    function PtlJanelaOperacionalFilter() {
        this.mes = moment__WEBPACK_IMPORTED_MODULE_0__().format('MM/YYYY');
    }
    return PtlJanelaOperacionalFilter;
}());

var PtlJanelaOperacionalPeriodo = /** @class */ (function () {
    function PtlJanelaOperacionalPeriodo(dtRef) {
        this.dtRef = dtRef;
        this.semana = moment__WEBPACK_IMPORTED_MODULE_0__(dtRef).week();
        this.dtIniMes = moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(dtRef).startOf('month')).startOf('day');
        this.dtFimMes = moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(dtRef).endOf('month')).startOf('day');
        this.dtIniSemana = moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(dtRef).startOf('week')).startOf('day')).add(1, 'days');
        this.dtFimSemana = moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(moment__WEBPACK_IMPORTED_MODULE_0__(dtRef).endOf('week')).startOf('day')).add(1, 'days');
    }
    return PtlJanelaOperacionalPeriodo;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.module.ts":
/*!**************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.module.ts ***!
  \**************************************************************************************/
/*! exports provided: PtlJanelaOperacionalModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalModule", function() { return PtlJanelaOperacionalModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _ptl_janela_operacional_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ptl-janela-operacional.routing.module */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.routing.module.ts");
/* harmony import */ var _ptl_janela_operacional_index_ptl_janela_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ptl-janela-operacional-index/ptl-janela-operacional-index.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.ts");
/* harmony import */ var _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ptl-janela-operacional-form/ptl-janela-operacional-form.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.ts");
/* harmony import */ var _ptl_janela_operacional_filter_ptl_janela_operacional_filter_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ptl-janela-operacional-filter/ptl-janela-operacional-filter.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-filter/ptl-janela-operacional-filter.component.ts");
/* harmony import */ var _ptl_janela_operacional_edit_ptl_janela_operacional_edit_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ptl-janela-operacional-edit/ptl-janela-operacional-edit.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-edit/ptl-janela-operacional-edit.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var PtlJanelaOperacionalModule = /** @class */ (function () {
    function PtlJanelaOperacionalModule() {
    }
    PtlJanelaOperacionalModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            declarations: [
                _ptl_janela_operacional_index_ptl_janela_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalIndexComponent"],
                _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalFormComponent"],
                _ptl_janela_operacional_filter_ptl_janela_operacional_filter_component__WEBPACK_IMPORTED_MODULE_5__["PtlJanelaOperacionalFilterComponent"],
                _ptl_janela_operacional_edit_ptl_janela_operacional_edit_component__WEBPACK_IMPORTED_MODULE_6__["PtlJanelaOperacionalEditComponent"]
            ],
            imports: [
                _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"],
                _ptl_janela_operacional_routing_module__WEBPACK_IMPORTED_MODULE_2__["PtlJanelaOperacionalRoutingModule"]
            ]
        })
    ], PtlJanelaOperacionalModule);
    return PtlJanelaOperacionalModule;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.routing.module.ts":
/*!**********************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.routing.module.ts ***!
  \**********************************************************************************************/
/*! exports provided: PtlJanelaOperacionalRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalRoutingModule", function() { return PtlJanelaOperacionalRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _ptl_janela_operacional_ptl_janela_operacional_index_ptl_janela_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-index/ptl-janela-operacional-index.component.ts");
/* harmony import */ var _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ptl-janela-operacional-form/ptl-janela-operacional-form.component */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional-form/ptl-janela-operacional-form.component.ts");
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var PtlJanelaOperacionalRoutes = [
    {
        path: "",
        component: _ptl_janela_operacional_ptl_janela_operacional_index_ptl_janela_operacional_index_component__WEBPACK_IMPORTED_MODULE_3__["PtlJanelaOperacionalIndexComponent"],
        data: {
            breadcrumb: "janelaOperacional",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index }
        }
    },
    {
        path: "create/:data",
        component: _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalFormComponent"],
        data: {
            breadcrumb: "janelaOperacional",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "edit/:data",
        component: _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalFormComponent"],
        data: {
            breadcrumb: "janelaOperacional",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    },
    {
        path: "detail/:data",
        component: _ptl_janela_operacional_form_ptl_janela_operacional_form_component__WEBPACK_IMPORTED_MODULE_4__["PtlJanelaOperacionalFormComponent"],
        data: {
            breadcrumb: "janelaOperacional",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    }
];
var PtlJanelaOperacionalRoutingModule = /** @class */ (function () {
    function PtlJanelaOperacionalRoutingModule() {
    }
    PtlJanelaOperacionalRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(PtlJanelaOperacionalRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
        })
    ], PtlJanelaOperacionalRoutingModule);
    return PtlJanelaOperacionalRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts":
/*!***************************************************************************************!*\
  !*** ./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.service.ts ***!
  \***************************************************************************************/
/*! exports provided: PtlJanelaOperacionalService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PtlJanelaOperacionalService", function() { return PtlJanelaOperacionalService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
/* harmony import */ var _environments_environment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var _app_error_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ptl-janela-operacional.constants */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.constants.ts");
/* harmony import */ var _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ptl-janela-operacional.model */ "./src/app/pages/portal/ptl-janela-operacional/ptl-janela-operacional.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};










var PtlJanelaOperacionalService = /** @class */ (function (_super) {
    __extends(PtlJanelaOperacionalService, _super);
    function PtlJanelaOperacionalService(http, configuracao, funcoes) {
        var _this = _super.call(this, http, "portal/ptlJanelaOperacional") || this;
        _this.http = http;
        _this.configuracao = configuracao;
        _this.funcoes = funcoes;
        _this.filtro = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalFilter"]();
        _this.janelaNavega = new _ptl_janela_operacional_model__WEBPACK_IMPORTED_MODULE_9__["PtlJanelaOperacionalNavega"]();
        _this.constantes = new _ptl_janela_operacional_constants__WEBPACK_IMPORTED_MODULE_8__["PtlJanelaOperacionalConstants"]();
        _this.setConfig = function () {
            if (!_this.configuracao.isLoadConfig()) {
                return;
            }
            _this.tipoAgCargaDescarga = _this.configuracao.lerConfig('PTL', 'TipoAgCargaDescarga');
            _this.agUtilizarTipofrete = _this.funcoes.isBoolean(_this.configuracao.lerConfig('PTL', 'AgUtilizarTipofrete'));
            _this.qtPeriodosAg = _this.funcoes.getValue(_this.configuracao.lerConfig('PTL', 'QtPeriodosAg'), 'I');
            _this.qtPeriodosAgD = _this.funcoes.getValue(_this.configuracao.lerConfig('PTL', 'QtPeriodosAgD'), 'I');
            _this.janOpeTipMov = _this.funcoes.isBoolean(_this.configuracao.lerConfig('UNI', 'JanOpeTipMov'));
        };
        return _this;
    }
    PtlJanelaOperacionalService.prototype.getConfig = function () {
        this.configuracao.getConfig(this.constantes.parametrosConfig, this.setConfig);
    };
    PtlJanelaOperacionalService.prototype.getByFiltro = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/portal/ptlJanelaOperacional/getByFiltro", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    PtlJanelaOperacionalService.prototype.getDados = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/portal/ptlJanelaOperacional/getDados", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    PtlJanelaOperacionalService.prototype.saveData = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/portal/ptlJanelaOperacional/", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    PtlJanelaOperacionalService.prototype.deleteDados = function (data) {
        return this.http
            .post(_environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].service_url + "/api/v1/portal/ptlJanelaOperacional/deleteDados", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__["catchError"])(_app_error_handler__WEBPACK_IMPORTED_MODULE_5__["ErrorHandler"].handleError));
    };
    PtlJanelaOperacionalService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__["ConfiguracaoFacade"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"] }
    ]; };
    PtlJanelaOperacionalService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_6__["ConfiguracaoFacade"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_7__["FuncoesService"]])
    ], PtlJanelaOperacionalService);
    return PtlJanelaOperacionalService;
}(app_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_2__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-portal-ptl-janela-operacional-ptl-janela-operacional-module.js.map