@senior-gestao-pessoas/payroll-core 8.6.1 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js +9 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js +1 -1
- package/bundles/senior-gestao-pessoas-payroll-core.umd.min.js.map +1 -1
- package/esm2015/lib/components/data-list-rest/data-list-rest.component.js +10 -2
- package/esm5/lib/components/data-list-rest/data-list-rest.component.js +10 -2
- package/fesm2015/senior-gestao-pessoas-payroll-core.js +9 -1
- package/fesm2015/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js +9 -1
- package/fesm5/senior-gestao-pessoas-payroll-core.js.map +1 -1
- package/lib/components/data-list-rest/data-list-rest.component.d.ts +2 -0
- package/package.json +1 -1
- package/senior-gestao-pessoas-payroll-core.metadata.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("primeng/blockui"),require("primeng/progressspinner"),require("@angular/router"),require("@ngx-translate/core"),require("rxjs/operators"),require("primeng/breadcrumb"),require("@angular/common"),require("primeng/dropdown"),require("primeng/inputmask"),require("primeng/inputtext"),require("primeng/shared"),require("@seniorsistemas/angular-components"),require("moment"),require("rxjs"),require("primeng/tooltip"),require("primeng/table"),require("@angular/common/http"),require("primeng/api"),require("@senior-gestao-pessoas/angular-components"),require("ng2-img-cropper"),require("primeng/button"),require("primeng/dialog"),require("primeng/fileupload"),require("chance"),require("moment-business"),require("primeng/autocomplete"),require("primeng/splitbutton"),require("primeng/components/common/messageservice"),require("@seniorsistemas/senior-platform-data"),require("primeng/toast"),require("ng2-currency-mask"),require("primeng/fieldset"),require("primeng/panel"),require("primeng/confirmdialog")):"function"==typeof define&&define.amd?define("@senior-gestao-pessoas/payroll-core",["exports","@angular/core","@angular/forms","primeng/blockui","primeng/progressspinner","@angular/router","@ngx-translate/core","rxjs/operators","primeng/breadcrumb","@angular/common","primeng/dropdown","primeng/inputmask","primeng/inputtext","primeng/shared","@seniorsistemas/angular-components","moment","rxjs","primeng/tooltip","primeng/table","@angular/common/http","primeng/api","@senior-gestao-pessoas/angular-components","ng2-img-cropper","primeng/button","primeng/dialog","primeng/fileupload","chance","moment-business","primeng/autocomplete","primeng/splitbutton","primeng/components/common/messageservice","@seniorsistemas/senior-platform-data","primeng/toast","ng2-currency-mask","primeng/fieldset","primeng/panel","primeng/confirmdialog"],t):t(((e=e||self)["senior-gestao-pessoas"]=e["senior-gestao-pessoas"]||{},e["senior-gestao-pessoas"]["payroll-core"]={}),e.ng.core,e.ng.forms,e.blockui,e.progressspinner,e.ng.router,e.core$1,e.rxjs.operators,e.breadcrumb,e.ng.common,e.dropdown,e.inputmask,e.inputtext,e.shared,e.angularComponents,e.moment_,e.rxjs,e.tooltip,e.table,e.ng.common.http,e.api,e.angularComponents$1,e.ng2ImgCropper,e.button,e.dialog,e.fileupload,e.chance,e.business,e.autocomplete,e.splitbutton,e.messageservice,e.seniorPlatformData,e.toast,e.ng2CurrencyMask,e.fieldset,e.panel,e.confirmdialog)}(this,(function(e,t,n,o,r,a,i,s,l,c,p,u,d,m,h,y,f,g,b,v,I,k,S,_,w,D,C,E,T,F,P,M,A,L,O,R,x){"use strict";E=E&&E.hasOwnProperty("default")?E.default:E;var B=function(){return(B=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function N(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{l(o.next(e))}catch(e){a(e)}}function s(e){try{l(o.throw(e))}catch(e){a(e)}}function l(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(i,s)}l((o=o.apply(e,t||[])).next())}))}function j(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function q(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function V(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function U(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(V(arguments[t]));return e}var Y=function(){function e(){}return e.prototype.calcChecker1=function(e){for(var t=null,n=0;n<9;++n)t+=e.toString().charAt(n)*(10-n);var o=t%11;return o<2?0:11-o},e.prototype.calcChecker2=function(e){for(var t=null,n=0;n<10;++n)t+=e.toString().charAt(n)*(11-n);var o=t%11;return o<2?0:11-o},e.prototype.checkCPF=function(e){var t=e.replace(/\.|\-|\s/g,""),n=t.substring(0,9),o=t.substring(9,11);if(11!==t.length)return!1;for(var r=0;r<10;r++)if(""+n+o===Array(12).join(r.toString()))return!1;var a=this.calcChecker1(n),i=this.calcChecker2(n+""+a);return o.toString()===a.toString()+i.toString()},e}(),G=new Y,H=function(){function e(){}return e.prototype.checkCNPJ=function(e){var t=e;if(t){var n=void 0,o=void 0,r=void 0,a=void 0,i=void 0;if(14!==(t=t.replace(/[^\d]+/g,"")).length)return!0;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;n=t.length-2,o=t.substring(0,n),r=t.substring(n),a=0,i=n-7;for(var s=n;s>=1;s--)a+=o.charAt(n-s)*i--,i<2&&(i=9);if((a%11<2?0:11-a%11)!==Number(r.charAt(0)))return!1;n+=1,o=t.substring(0,n),a=0,i=n-7;for(s=n;s>=1;s--)a+=o.charAt(n-s)*i--,i<2&&(i=9);return(a%11<2?0:11-a%11)===Number(r.charAt(1))}return!0},e}(),W=new H,z=function(){function e(){this.addStringFormat()}return e.prototype.addStringFormat=function(){if(!String.prototype.hasOwnProperty("format")){var e={format:function(){for(var e=this,t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e}};Object.assign(String.prototype,e)}},e}(),$=new z,Q=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"block-ui",template:'<p-blockUI [blocked]="blocked">\n <p-progressSpinner [strokeWidth]="5"></p-progressSpinner>\n</p-blockUI>\n',styles:[".ui-widget-overlay{background:#ccc!important;opacity:.5!important}@-webkit-keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}@keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}p-progressspinner{position:absolute!important;top:50%!important;left:50%!important}"]}]}],e.propDecorators={blocked:[{type:t.Input}],target:[{type:t.Input}]},e}();var K=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,o.BlockUIModule,r.ProgressSpinnerModule],declarations:[Q],exports:[Q]}]}],e}(),J=function(){function e(e,t,n){this.activatedRoute=e,this.router=t,this.translate=n,this.items=[]}return e.prototype.ngOnInit=function(){var e=this;this.router.events.pipe(s.filter((function(e){return e instanceof a.NavigationEnd}))).subscribe((function(){var t=e.activatedRoute.root;e.items=e.getBreadcrumbs(t,[])}))},e.prototype.getBreadcrumbs=function(e,t){var n=e.children;if(0===n.length)return t;this.generateBreadcrumb(n,t);var o=t.length&&t.length-1||0;return this.title=t[o]&&t[o].label,t},e.prototype.generateBreadcrumb=function(e,t){var n=this;e.forEach((function(e,o){e.snapshot.data.hasOwnProperty("breadcrumb")&&e.snapshot.data.breadcrumb.map((function(o){var r={label:n.translate.instant(o.name),queryParams:e.snapshot.queryParams,routerLink:n.getFormattedUrl(e,o.routerLink),url:n.getFormattedUrl(e,o.url)};o.routerLink&&(r.disabled=!0,r.routerLinkActiveOptions={exact:!0}),t.push(r)})),e.children&&e.children.length&&n.generateBreadcrumb(e.children,t)}))},e.prototype.getFormattedUrl=function(e,t){return t&&(Object.keys(e.snapshot.params).forEach((function(n){t=t.replace(":"+n,e.snapshot.params[n])})),t.includes(":")&&e.parent)?this.getFormattedUrl(e.parent,t):t},e.decorators=[{type:t.Component,args:[{selector:"c-breadcrumb",template:'<h1 class="sds-page-title">{{title}}</h1>\n<p-breadcrumb [model]="items" ></p-breadcrumb>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:a.Router},{type:i.TranslateService}]},e}();var X=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],exports:[c.CommonModule,i.TranslateModule]}]}],e.ctorParameters=function(){return[]},e}(),Z=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,l.BreadcrumbModule,X],declarations:[J],exports:[J]}]}],e}(),ee=function(){function e(){}return Object.defineProperty(e.prototype,"errorMessage",{get:function(){for(var e in this.control.errors)if(this.control.errors.hasOwnProperty(e)&&(this.control.touched||this.control.dirty))return this.errorList[e];return null},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"control-messages-error",template:'<div class="error-message" *ngIf="errorMessage">\n {{ errorMessage | translate }}\n</div>\n',styles:[".error-message{color:#c13018;margin-top:5px;font-size:13px}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={control:[{type:t.Input}],errorList:[{type:t.Input}]},e}();var te=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,n.ReactiveFormsModule],declarations:[ee],exports:[ee]}]}],e}();var ne=function(){function e(){this.optionsBoolean=[{label:"Selecione",value:""},{label:"Sim",value:"true"},{label:"Não",value:"false"}]}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"custom-fields",template:'<div [ngSwitch]="params.type" [formGroup]="form" *ngIf="form" >\n <div *ngSwitchCase="\'date\'" >\n <input-date-calendar [form]="form" [name]="params.field" ></input-date-calendar>\n </div>\n <div *ngSwitchCase="\'boolean\'" >\n <p-dropdown [options]="optionsBoolean" [name]="params.field"\n [(ngModel)]="params.value" [formControlName]="params.field" [required]="required" [readonly]="readonly"\n [style]="{\'width\': \'100%\'}"\n ></p-dropdown>\n </div>\n <div *ngSwitchDefault >\n <input type="text" *ngIf="!params.mask" pInputText [formControlName]="params.field" />\n <p-inputMask *ngIf="params.mask" [(ngModel)]="params.value" [formControlName]="params.field" [mask]="params.mask" [required]="required" [name]="params.field" [readonly]="readonly" ></p-inputMask>\n </div>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={params:[{type:t.Input}],disabled:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],form:[{type:t.Input}]},e}();var oe=y,re=function(){function e(e){this.localeService=e,this.unmask=!0,this.onBlurGetMoment=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.mask=null}return e.prototype.ngOnInit=function(){var e=this;this.localeService.get().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){if(e.mask=e.formatMask(t),e.format=e.setFormat(),e.form.get(e.name).value){var n=e.form.get(e.name).value.toString(),o=oe(n,e.format||"YYYY-MM-DD");e.form.get(e.name).setValue(o.format(e.format||"L")),e._date=o}}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.formatMask=function(e){this.locale=e;var t=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),(t=t.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},e.prototype.setFormat=function(){var e=this.locale.calendar.dateFormat.toString();return e=e.replace(/[y]/g,"YY"),this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),e.toUpperCase()},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),e.prototype.onBlur=function(e){if(e&&e.target&&e.target.value){var t=this.form.get(this.name).value;this._date=oe(t,this.format),this.onBlurGetMoment.emit(this._date)}else this._date={},this.form.get(this.name).setValue(null),this.onBlurGetMoment.emit(null)},Object.defineProperty(e.prototype,"model",{get:function(){var e=this.form.get(this.name).value;return oe(e,this.format)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputDateElement",{get:function(){return this._inputDateElement},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-date-calendar",template:'<div [formGroup]="form" >\n <p-inputMask *ngIf="mask" [formControlName]="name"\n [mask]="mask"\n (onBlur)="onBlur($event)"\n [placeholder]="placeholder"\n [attr.disabled]="disabled"\n [unmask]="unmask"\n [inputId]="inputId"\n [readonly]="readonly"\n #inputDateElement\n ></p-inputMask>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:h.LocaleService}]},e.propDecorators={_inputDateElement:[{type:t.ViewChild,args:["inputDateElement",{static:!1}]}],form:[{type:t.Input}],name:[{type:t.Input}],disabled:[{type:t.Input}],unmask:[{type:t.Input}],inputId:[{type:t.Input}],withoutDay:[{type:t.Input}],readonly:[{type:t.Input}],onBlurGetMoment:[{type:t.Output}],model:[{type:t.Input}]},e}();var ae=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[u.InputMaskModule,n.FormsModule,n.ReactiveFormsModule,c.CommonModule],declarations:[re],exports:[re]}]}],e}(),ie=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,n.ReactiveFormsModule,m.SharedModule,d.InputTextModule,ae,p.DropdownModule,u.InputMaskModule],declarations:[ne],providers:[],exports:[ne]}]}],e}(),se=function(){function e(e){this.elementRef=e,this.el=this.elementRef.nativeElement}return e.prototype.onBlur=function(e){this.cleanVar(e)},e.prototype.cleanVar=function(e){var t=e.trim().replace(/^\s+|\s+$|\s+(?=\s)/g,"");return e!==t&&(this.el.value=t),t},e.decorators=[{type:t.Directive,args:[{selector:"[name-not-spaces]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={onBlur:[{type:t.HostListener,args:["blur",["$event.target.value"]]}]},e}();var le=function(){function e(e){this.el=e}return e.prototype.onKeyDown=function(e){var t=e;-1!==[46,8,9,27,13,110,190].indexOf(t.keyCode)||65===t.keyCode&&(t.ctrlKey||t.metaKey)||67===t.keyCode&&(t.ctrlKey||t.metaKey)||86===t.keyCode&&(t.ctrlKey||t.metaKey)||88===t.keyCode&&(t.ctrlKey||t.metaKey)||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()},e.decorators=[{type:t.Directive,args:[{selector:"[only-number]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();var ce=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[],declarations:[le,se],exports:[le,se],providers:[],schemas:[]}]}],e}(),pe={searchValue:"searchValue"},ue={ASC:"ASC",DESC:"DESC"},de={EQUAL:"eq",DIFFERENT:"ne",LESS_THAN:"it",GREATER_THAN:"gt",LESS__EQUAL_THAN:"le",GREATER_EQUAL_THAN:"ge",CONTAINING:"containing",LOWER:"lower",AND:"and",OR:"or"},me={isBefore:"isBefore",isAfter:"isAfter",isSame:"isSame",isSameOrAfter:"isSameOrAfter",isSameOrBefore:"isSameOrBefore",isNotSame:"isNotSame"},he={ENTRY:"entry",GENERAL_REGISTER:"general_register",ORGANIZATION_REGISTER:"organization_register",PAYROLL:"payroll",DEPENDENT:"dependent"},ye=function(){function e(e){this.http=e}return e.prototype.getList=function(e,t){return this.http.post(""+e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var fe=function(){function e(e){this.dataListService=e,this.rows=10,this.paginator=!0,this.first=1,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.lazyLoad=new t.EventEmitter,this.loadingChange=new t.EventEmitter,this.listDataChange=new t.EventEmitter,this.selectedDataChange=new t.EventEmitter,this.headerCheckboxToggle=new t.EventEmitter,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.lazy||this.getlistData()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getActions=function(e,t){return this.actions(e,t)},e.prototype.pagination=function(e){this.lazy||this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onLazyLoad=function(e){var t=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){t.orderBy.push({field:e.field,direction:1===e.order?ue.ASC:ue.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows)+1)},e.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),e.prototype.getlistData=function(e,t){var n=this;void 0===e&&(e=this.rows),void 0===t&&(t=this.first),this.endpoint?this.dataListService.getList(this.endpoint,B({page:{current:t,size:e,orderBy:this.orderBy}},this.initParameters,this._searchParameters)).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){n.listData=e[n.keyPayload],n.totalRecords=e.countResult,n.lazy&&n.lazyLoad.emit(n.listData)})):this.lazy&&this.lazyLoad.emit(this.listData)},e.prototype.onHeaderCheckboxToggle=function(e){this.headerCheckboxToggle.emit(e)},e.prototype.getFieldValue=function(e,t){return t.field&&t.field.includes(".")?(t.field.split(".").map((function(t){return e=e&&e[t]})),e):e[t.field]},Object.defineProperty(e.prototype,"parameters",{set:function(e){e&&(this._searchParameters=B({},e),this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{get:function(){return this._loading},set:function(e){this._loading=e,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listData",{get:function(){return this._listData},set:function(e){this._listData=e,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedData",{get:function(){return this._selectedData},set:function(e){this._selectedData=e,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-data-list-rest",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows" [first]="first"\n (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator" (onPage)="pagination($event)"\n [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey" [sortMode]="sortMode" [responsive]="true"\n pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)" [selectionMode]="selectionMode">\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.field" [pSortableColumnDisabled]="!isSortable || !!col.icon"\n [style.width]="col.width" [pTooltip]="col.tooltip || col.label" tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style" aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default" [model]="getActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label" priority="default"\n (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:t.ViewEncapsulation.None,providers:[ye],styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]}]}],e.ctorParameters=function(){return[{type:ye}]},e.propDecorators={dataListTable:[{type:t.ViewChild,args:["dataListTable",{static:!1}]}],id:[{type:t.Input}],dataKey:[{type:t.Input}],rows:[{type:t.Input}],emptyMessage:[{type:t.Input}],columns:[{type:t.Input}],paginator:[{type:t.Input}],first:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],actions:[{type:t.Input}],actionLabel:[{type:t.Input}],selectionMode:[{type:t.Input}],lazy:[{type:t.Input}],isMultipleSelection:[{type:t.Input}],isSortable:[{type:t.Input}],showHeaderCheckBox:[{type:t.Input}],sortMode:[{type:t.Input}],endpoint:[{type:t.Input}],totalRecords:[{type:t.Input}],orderBy:[{type:t.Input}],singularMessageRecords:[{type:t.Input}],pluralMessageRecords:[{type:t.Input}],keyPayload:[{type:t.Input}],initParameters:[{type:t.Input}],lazyLoad:[{type:t.Output}],loadingChange:[{type:t.Output}],listDataChange:[{type:t.Output}],selectedDataChange:[{type:t.Output}],headerCheckboxToggle:[{type:t.Output}],parameters:[{type:t.Input}],loading:[{type:t.Input}],listData:[{type:t.Input}],selectedData:[{type:t.Input}]},e}();var ge=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[fe],exports:[fe]}]}],e}(),be=function(){function e(e){this.http=e,this.employeeBasicInformations=new f.Subject}return e.prototype.findEmployee=function(e,t){return this.http.post("hcm/payroll/queries/"+e,{employeeId:t})},e.prototype.findEmployeeAutoComplete=function(e,t){return this.http.post("hcm/payroll/queries/"+e,{valueSearch:t})},e.prototype.blobServiceRequestAccess=function(e,t){return this.http.post("hcm/payroll/actions/"+e,t)},e.prototype.setEmployeeBasicInformations=function(e){this.employeeBasicInformations.next(e)},e.prototype.getEmployeeBasicInformations=function(){return this.employeeBasicInformations.asObservable()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var ve=y,Ie=function(){function e(e,t){this.activatedRoute=e,this.employeeService=t,this.timetrackingLabel="Status",this.hireLabel="Admissão",this.registerNumberLabel="Matrícula",this.ageLabel="Idade",this.loadingLabel="...",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.emploayeeData={name:this.loadingLabel,jobPosition:this.loadingDescription},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.employeeId&&e.getInformation(t.employeeId)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getInformation=function(e){var t=this;this.isLoading=!0,this.employeeService.findEmployee("employeeContractualInformations",e).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result})),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){t.employeeService.setEmployeeBasicInformations(e),t.emploayeeData=B({},e,{timeTrackingResumeType:e.timeTrackingResumeType&&e.timeTrackingResumeType.value});var n=[];if(e.city&&n.push(e.city),e.stateAbbreviation&&n.push(e.stateAbbreviation),t.emploayeeData.location=n.join(" - "),e.hireDate&&(t.emploayeeData.hireDate=t.hireDate?t.hireDate:ve(e.hireDate).format("L")),e.idPicture){var o={fileId:e.idPicture,ttl:2,thumbnail:!1};t.employeeService.blobServiceRequestAccess("blobServiceRequestAccess",o).pipe(s.takeUntil(t.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){e&&(t.emploayeeData.photoSource=e.locationURI)}))}}))},e.decorators=[{type:t.Component,args:[{selector:"c-employee-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="emploayeeData?.name" [description]="emploayeeData?.jobPosition" [imageSource]="emploayeeData?.photoSource"></s-object-card-main>\n <s-object-card-field [label]="emploayeeData?.employer" [description]="emploayeeData?.location"></s-object-card-field>\n <s-object-card-field [label]="timetrackingLabel" [description]="emploayeeData?.timeTrackingResumeType"></s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="emploayeeData?.hireDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="registerNumberLabel" [description]="emploayeeData?.registernumber" iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field [label]="ageLabel" [description]="emploayeeData?.age" iconClass="fa fa-birthday-cake"></s-object-card-field>\n</s-object-card>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:be}]},e.propDecorators={timetrackingLabel:[{type:t.Input}],hireDate:[{type:t.Input}],hireLabel:[{type:t.Input}],registerNumberLabel:[{type:t.Input}],ageLabel:[{type:t.Input}],loadingLabel:[{type:t.Input}],loadingDescription:[{type:t.Input}]},e}();var ke=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Ie],exports:[Ie],providers:[be]}]}],e}(),Se=function(){function e(e){this.http=e,this.admissionDraftBasicInformations=new f.Subject}return e.prototype.findAdmissionDraft=function(e){return this.http.post("hcm/payroll/queries/admissionDraftQuery",{id:e})},e.prototype.blobServiceRequestAccess=function(e,t){return this.http.post("hcm/payroll/actions/"+e,t)},e.prototype.setAdmissionDraftBasicInformations=function(e){this.admissionDraftBasicInformations.next(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var _e=function(){function e(e,t,n){this.activatedRoute=e,this.admissionDraftSummaryService=t,this.translateService=n,this.hireLabel="Admissão",this.hireDate="...",this.badgeText="Rascunho",this.loadingLabel="...",this.documentNumberLabel="Documento",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.draftData={name:this.loadingLabel,hiringDate:this.hireDate,documentNumber:this.loadingLabel,companyName:this.loadingLabel,localeOfCompany:this.loadingLabel,originDraftType:this.loadingLabel},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.draftId&&e.getInformation(t.draftId)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getInformation=function(e){var t=this;this.isLoading=!0,this.admissionDraftSummaryService.findAdmissionDraft(e).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result})),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){if(t.admissionDraftSummaryService.setAdmissionDraftBasicInformations(e),e.hiringDate=t.hireDate,t.draftData=B({},e),t.draftData.originDraftType=t.originType,e.attachment&&e.attachment.fileId){var n={fileId:t.draftData.attachment.fileId,ttl:2,thumbnail:!1};t.admissionDraftSummaryService.blobServiceRequestAccess("blobServiceRequestAccess",n).pipe(s.takeUntil(t.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){e&&(t.draftData.photoSource=e.locationURI)}))}}))},e.decorators=[{type:t.Component,args:[{selector:"c-admission-draft-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="draftData?.name"\n [imageSource]="draftData?.photoSource">\n </s-object-card-main>\n <s-object-card-field [label]="draftData.companyName" [description]="draftData.localeOfCompany"></s-object-card-field>\n <s-object-card-field [label]="draftData.originDraftType">\n <span descriptionTemplate class="sds-badge sds-semantic-orange">{{badgeText}}</span>\n </s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="draftData?.hiringDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="documentNumberLabel" [description]="draftData?.documentNumber" iconClass="fa fa-id-card"></s-object-card-field>\n</s-object-card>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:Se},{type:i.TranslateService}]},e.propDecorators={originType:[{type:t.Input}],hireLabel:[{type:t.Input}],hireDate:[{type:t.Input}],badgeText:[{type:t.Input}],loadingLabel:[{type:t.Input}],documentNumberLabel:[{type:t.Input}],loadingDescription:[{type:t.Input}]},e}();var we=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[_e],exports:[_e],providers:[Se]}]}],e}(),De=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"error-page",template:'<div class="ui-g">\n <div class="ui-sm-6 error-code">\n <span>403</span>\n </div>\n <div class="col-sm-6">\n <h4 class="error-title">{{\'hcm.payroll.permission_error_page\'|translate}}</h4>\n <h5 class="error-description">{{\'hcm.payroll.permission_error_page_description\'|translate}}</h5>\n </div>\n</div>\n',styles:["@media (max-width:767px){.error-code{text-align:center}.error-code>span{color:#697882;font-size:80px;font-weight:300}}@media (min-width:768px){.error-code>span{color:#697882;font-size:128px;font-weight:300;float:right}}.error-title{padding-top:30px}.error-description{color:#999;margin-top:10px}"]}]}],e.ctorParameters=function(){return[]},e}(),Ce=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[X],declarations:[De],exports:[De],providers:[]}]}],e}(),Ee=function(){function e(){this.errorMessage=""}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){var t=this,n=e.inputErrors.currentValue;this.errorMessage="",n&&Object.keys(this.errorDefs).some((function(e){if(n[e])return t.errorMessage=t.errorDefs[e],!0}))},e.decorators=[{type:t.Component,args:[{selector:"field-validator",template:'<ng-content></ng-content>\n<div style="color:#a94442;font-size: 13px"\n *ngIf="(onlyShowAfterTouched&&!field.valid&&(field.dirty || field.touched)&&errorMessage) || (!onlyShowAfterTouched&&errorMessage)">\n {{errorMessage | translate}}\n</div>\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={inputErrors:[{type:t.Input}],errorDefs:[{type:t.Input}],field:[{type:t.Input}],onlyShowAfterTouched:[{type:t.Input}]},e}();var Te=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,n.ReactiveFormsModule],declarations:[Ee],exports:[Ee],providers:[]}]}],e}(),Fe=function(){function e(){this.messagesSubjectError=new f.Subject,this.messagesSubjectSuccess=new f.Subject,this.messagesSubjectWarning=new f.Subject}return e.prototype.showError=function(e,t){void 0===t&&(t=!1),this.messagesSubjectError.next({message:e,breakLine:t})},e.prototype.showSuccess=function(e,t){void 0===t&&(t=!1),this.messagesSubjectSuccess.next({message:e,breakLine:t})},e.prototype.showWarning=function(e,t){void 0===t&&(t=!1),this.messagesSubjectWarning.next({message:e,breakLine:t})},e.prototype.loadErrorMessages=function(){return this.messagesSubjectError.asObservable()},e.prototype.loadSuccessMessages=function(){return this.messagesSubjectSuccess.asObservable()},e.prototype.loadWarningMessages=function(){return this.messagesSubjectWarning.asObservable()},e}();var Pe=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.query=function(e,t,n){var o=this;void 0===n&&(n=he.PAYROLL);var r="hcm/"+n+"/queries/"+e;return this.http.post(r,t).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.enumQuery=function(e,t,n){var o=this;void 0===n&&(n="payroll");var r="hcm/"+n+"/queries/"+e;return this.http.post(r,t).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.action=function(e,t){var n=this,o="hcm/payroll/actions/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.recruitmentAction=function(e,t){var n=this,o="hcm/recruitment/actions/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.get=function(e){var t=this,n="hcm/payroll/entities/"+e;return this.http.get(n).pipe(s.catchError((function(e){return 403===e.status&&t.messageService.add({severity:"error",summary:t.translateService.instant("hcm.payroll.error"),detail:t.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.getAutoComplete=function(e,t,n){var o=this;void 0===n&&(n=he.PAYROLL);var r="hcm/"+n+"/entities/"+e+"?filter="+t+"&size=10&orderby=code+asc";return this.http.get(r).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.patch=function(e,t){var n=this,o="hcm/payroll/entities/"+e;return this.http.patch(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.post=function(e,t){var n=this,o="hcm/payroll/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.put=function(e,t){var n=this,o="hcm/payroll/entities/"+e;return this.http.put(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.delete=function(e,t){var n=this,o=t?"hcm/payroll/entities/"+e+"/"+t:"hcm/payroll/entities/"+e;return this.http.delete(o).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var Me=function(){function e(e){this.http=e}return e.prototype.blobServiceRequestUpload=function(e){var t={fileName:e.name,thumbnail:this.isImage(e)};return this.http.action("blobServiceRequestUpload",t)},e.prototype.blobServiceRequestAccess=function(e){var t={fileId:e,tll:2,thumbnail:!1};return this.http.action("blobServiceRequestAccess",t)},e.prototype.blobServiceFileDelete=function(e){var t={fileId:e,thumbnail:!1};return this.http.action("blobServiceDelete",t)},e.prototype.isImage=function(e){return/^image\//.test(e.type)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Ae=function(){function e(e,n,o){this.service=e,this.toastService=n,this.translate=o,this.files=[],this.onUploadFile=new t.EventEmitter,this.onRemoveFile=new t.EventEmitter}return e.prototype.uploadHandler=function(e){var t=this,n=[];if(e&&e.files.length){e.files.sort(),e.files.length>10&&e.files[10]&&delete e.files[10];for(var o=this.getFilesCountAndValidate(e.files),r=0;r<o;r++){var a=this.validateFileSize(e.files[r]);r<=9&&a.isUploaded&&!a.complete&&n.push(this.saveFile(a))}f.forkJoin.apply(void 0,U(n)).subscribe((function(){t.onUploadFile.emit(t.files)}))}},e.prototype.validateFileSize=function(e){return e.isUploaded&&!e.complete&&e.size>5e7&&(e.complete=!0,e.error=this.translate.instant("hcm.payroll.attachments_max_mb"),this.toastService.showError(this.translate.instant("hcm.payroll.attachments_alert_error"))),e},e.prototype.getFilesCountAndValidate=function(e){var t=0;return e.length&&(e.length>10?(t=10,this.toastService.showError(this.translate.instant("hcm.payroll.attachments_max_length"))):t=e.length),t},e.prototype.saveFile=function(e){var t=this;return new f.Observable((function(n){return t.service.blobServiceRequestUpload(e).pipe(s.map((function(e){return e&&e.result}))).subscribe((function(o){return t.doUpload(o,e,n)}),(function(t){e.complete=!0,e.error=t.message,e.objectURL=void 0}))}))},e.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.id=e.fileId,t.objectURL=e.locationURI,t.version=e.version,t.progress=0,o.upload.addEventListener("progress",(function(e){t.progress=Math.round(100*e.loaded/e.total)}),!1),o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},e.prototype.onCancelUpload=function(e){this.files.splice(e,1)},e.prototype.removeFile=function(){this.onRemoveFile.emit(this.files)},e.decorators=[{type:t.Component,args:[{selector:"c-file-upload",template:'<s-file-upload-deprecated chooseLabel="{{\'hcm.payroll.file_upload_choose_label\'|translate}}"\n cancelLabel="{{\'hcm.payroll.file_upload_cancel_label\'|translate}}"\n removeLabel="{{\'hcm.payroll.file_upload_remove_label\'|translate}}"\n successTooltip="{{\'hcm.payroll.file_upload_success_tooltip\'|translate}}"\n [errorTooltip]="errorTooltip"\n [customUpload]="true" [accept]="\'*/*\'" [multiple]="true"\n (uploadHandler)="uploadHandler($event)" (onCancelUpload)="onCancelUpload($event)"\n (onRemoveFile)="removeFile()" [files]="files"\n></s-file-upload-deprecated>\n'}]}],e.ctorParameters=function(){return[{type:Me},{type:Fe},{type:i.TranslateService}]},e.propDecorators={errorTooltip:[{type:t.Input}],files:[{type:t.Input}],onUploadFile:[{type:t.Output}],onRemoveFile:[{type:t.Output}]},e}();var Le=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,k.FileUploadModuleDeprecated,X],declarations:[Ae],providers:[Me],exports:[Ae]}]}],e}(),Oe=function(){function e(e){this.http=e}return e.prototype.saveImage=function(e,t,n){return N(this,void 0,void 0,(function(){var o,r,a;return j(this,(function(i){switch(i.label){case 0:return e?(o=null,e?o={fileName:e.name}:t&&(o={fileName:t.split("/")[1]}),o?[4,this.blobServiceRequestUpload(n,o).toPromise()]:[3,2]):[2];case 1:return r=i.sent(),(a=new XMLHttpRequest).open("PUT",r.result.locationURI,!0),a.setRequestHeader("Translate","f"),a.send(e),[2,r.result];case 2:return[2]}}))}))},e.prototype.urltoFile=function(e,t,n){return void 0===n&&(n=null),n=n||(e.match(/^data:([^;]+);/)||"")[1],this.http.request("GET",e,{responseType:"arraybuffer"}).pipe(s.map((function(e){var o=new Blob([e],{type:n});return o.name=t,o})))},e.prototype.getImage=function(e,t,n){return N(this,void 0,void 0,(function(){return j(this,(function(o){switch(o.label){case 0:return e&&e.fileId?[4,this.blobServiceRequestAccess(t,e.fileId,n).toPromise()]:[3,2];case 1:return[2,o.sent().result.locationURI];case 2:return[2]}}))}))},e.prototype.buildUrl=function(e,t){return"hcm/"+e+"/"+t},e.prototype.query=function(e,t,n){var o="queries/"+t;return this.http.post(this.buildUrl(e,o),n)},e.prototype.blobServiceRequestUpload=function(e,t){var n={fileName:t.fileName,thumbnail:!0};return this.http.post(this.buildUrl(e,"actions/blobServiceRequestUpload"),n)},e.prototype.blobServiceRequestAccess=function(e,t,n){var o={fileId:t,tll:2,thumbnail:n};return this.http.post(this.buildUrl(e,"actions/blobServiceRequestAccess"),o)},e.prototype.blobServiceFileDelete=function(e,t){var n={fileId:t,thumbnail:!0};return this.http.post(this.buildUrl(e,"actions/blobServiceDelete"),n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var Re=function(){function e(e,n){this.imageCropService=e,this.toastService=n,this.service="payroll",this.onClickSave=new t.EventEmitter,this.defaulPerson="assets/default-person.png",this.display=!1,this.imageCrop=[],this.data={},this.cropperSettings=new S.CropperSettings,this.cropperSettings.width=100,this.cropperSettings.height=100,this.cropperSettings.keepAspect=!1,this.cropperSettings.preserveSize=!0,this.cropperSettings.canvasWidth=600,this.cropperSettings.canvasHeight=450,this.cropperSettings.rounded=!0,this.cropperSettings.minWithRelativeToResolution=!1,this.cropperSettings.noFileInput=!0,this.cropperSettings.cropperDrawSettings.strokeColor="rgba(255,255,255,1)",this.cropperSettings.cropperDrawSettings.strokeWidth=1}return Object.defineProperty(e.prototype,"image",{set:function(e){var t=this;e&&e.fileId&&!this.personPhotoLink&&this.imageCropService.blobServiceRequestAccess(this.service,e.fileId,!0).subscribe((function(e){t.personPhotoLink=e.result.locationURI}))},enumerable:!0,configurable:!0}),e.prototype.onUploadHandler=function(e){var t=this;if(this.file=e.files[0],this.file&&this.file.size>5e6)return this.file=null,this.imageCrop=[],void this.toastService.showError("O tamanho máximo permitido para a imagem é de 5MB");this.display=!1;var n=new Image,o=new FileReader;o.onloadend=function(e){n.src=e.target.result,t.cropper.setImage(n)},o.readAsDataURL(this.file),this.display=!0},e.prototype.ngOnInit=function(){this.data.image=null,this.personPhotoLink=null,this.personFirstName="",this.display=!1},e.prototype.showDialog=function(){this.display=!0},e.prototype.onHide=function(){this.display=!1},e.prototype.reset=function(){this.file=null,this.data={},this.imageCrop=[],this.cropper.reset(),this.data.image=null,this.personPhotoLink=null,this.personFirstName=""},e.prototype.saveImage=function(){return N(this,void 0,void 0,(function(){var e,t,n,o=this;return j(this,(function(r){switch(r.label){case 0:return this.file?(e=this.file.name,this.cropper&&this.cropper.image?[4,this.urltoFile(this.cropper.image.image,e)]:[3,2]):(this.onClickSave.emit(null),this.onHide(),[2]);case 1:t=r.sent(),this.personPhotoLink=this.data.image,n=null,this.file?n={fileName:this.file.name}:this.data&&(n={fileName:this.data.fileId.split("/")[1]}),n&&(this,this.imageCropService.blobServiceRequestUpload(this.service,n).subscribe((function(e){var n=new XMLHttpRequest;n.open("PUT",e.result.locationURI,!0),n.setRequestHeader("Translate","f"),n.send(t),o.onClickSave.emit(e.result),o.onHide()}))),r.label=2;case 2:return[2]}}))}))},e.prototype.urltoFile=function(e,t,n){return void 0===n&&(n=null),n=n||(e.match(/^data:([^;]+);/)||"")[1],fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],t,{type:n})}))},e.prototype.deleteImage=function(){this.imageCropService.blobServiceFileDelete(this.service,this.data&&this.data.image&&this.data.image.fileId),this.reset()},e.decorators=[{type:t.Component,args:[{selector:"image-crop",template:'<a (click)="showDialog()">\n <span class="result rounded">\n <img class="center-block" style="max-width: 100%; height: auto"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson" [alt]="personFirstName"\n width="auto" height="140">\n </span>\n</a>\n\n<p-dialog [(visible)]="display" modal="true" [minWidth]="450" (onHide)="onHide()">\n <p-header>\n {{\'hcm.payroll.employees_image_cropper_edit\' | translate}}\n </p-header>\n\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-12 img-user-modal" *ngIf="!personPhotoLink">\n <i class="fa fa-user-circle fa-5x"></i>\n <div id="txt-select-image">{{\'hcm.payroll.employees_image_cropper_viewing\' | translate}}</div>\n <div class="ui-md-4 btn-center">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n </div>\n </div>\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\' | translate}}"></button>\n </div>\n <div class="ui-g-12 ui-md-12" *ngIf="personPhotoLink">\n <span class="result rounded">\n <img class="center-block default-image"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson"\n [alt]="personFirstName"\n width="auto"\n height="140">\n </span>\n </div>\n </div>\n <div class="ui-g" [style.display]="data.image ? \'block\' : \'none\'">\n <div class="ui-md-4 btn-left">\n <p-fileUpload chooseLabel="Selecionar foto"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\'|translate}}"></button>\n </div>\n <div class="ui-md-12">\n <img-cropper #cropper [image]="data" [settings]="cropperSettings"></img-cropper>\n </div>\n </div>\n\n <p-footer>\n <button pButton type="button" class="btn-link ui-button-link" (click)="display=false"\n label="{{\'hcm.payroll.employees_image_cropper_cancel\' | translate}}"></button>\n <button pButton type="button" (click)="saveImage()" label="{{\'hcm.payroll.employees_image_cropper_save\'|translate}}"></button>\n </p-footer>\n</p-dialog>\n',styles:[".center{float:left;position:relative;left:30%}.btn-center{float:left;position:relative;left:33%}.btn-left{float:left;position:relative}.rounded{cursor:pointer}.result.rounded>img{border-radius:50%}div.cropper{height:400px}.center-block{display:block;margin-right:auto;margin-left:auto}.ui-fileupload-choose{width:300px!important}.fa-user-circle{color:#ccc}.img-user-modal{text-align:center!important}#txt-select-image{margin:20px 0;font-weight:700;font-size:16px}"]}]}],e.ctorParameters=function(){return[{type:Oe},{type:Fe}]},e.propDecorators={service:[{type:t.Input}],onClickSave:[{type:t.Output}],cropper:[{type:t.ViewChild,args:["cropper",{static:!1}]}],image:[{type:t.Input}]},e}();var xe=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,w.DialogModule,_.ButtonModule,D.FileUploadModule,S.ImageCropperModule,S.ImageCropperModule,h.ThumbnailModule],declarations:[Re],providers:[Oe,h.ImageCropperService],exports:[Re]}]}],e}(),Be=y,Ne=function(){function e(e){this.localeService=e,this.onBlurGetMoment=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.mask=null}return e.prototype.ngOnInit=function(){var e=this;this.localeService.get().subscribe((function(t){if(e.mask=e.formatMask(t),e.format=e.getFormat(),e.model){var n=e.model,o=Be(n,e.format||"YYYY-MM-DD");o.isValid()?(e.model=o.format(e.format||"L"),e._date=o):e._date=null}}))},e.prototype.formatMask=function(e){this.locale=e;var t=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),(t=t.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},e.prototype.getFormat=function(){var e=this.locale.calendar.dateFormat.toString();return e=e.replace(/[y]/g,"YY"),this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),e.toUpperCase()},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),e.prototype.onBlur=function(){var e=this.model;this._date=Be(e,this.format),this.onBlurGetMoment.emit(this._date)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-date-calendar-model",template:'<p-inputMask *ngIf="mask"\n [mask]="mask"\n (onBlur)="onBlur()"\n [unmask]="unmask"\n [placeholder]="placeholder"\n [disabled]="disabled"\n [(ngModel)]="model"\n [style]="style"\n [styleClass]="styleClass"\n></p-inputMask>\n'}]}],e.ctorParameters=function(){return[{type:h.LocaleService}]},e.propDecorators={name:[{type:t.Input}],disabled:[{type:t.Input}],withoutDay:[{type:t.Input}],unmask:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],onBlurGetMoment:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var je=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[u.InputMaskModule,n.FormsModule,n.ReactiveFormsModule,c.CommonModule],declarations:[Ne],exports:[Ne]}]}],e}(),qe=y;function Ve(e){return e&&"object"==typeof e&&!Array.isArray(e)}function Ue(e){return!Array.isArray(e)||!e.find((function(e){return"object"==typeof e}))}function Ye(e){return 0===e||"boolean"==typeof e||null!=e&&""!==e}function Ge(e,t){return void 0===t&&(t=!0),!e||!He(e,t)||(t?qe(e.replace(/[^\d]+/g,""),"DDMMYYYY").isValid():qe(e.replace(/[^\d]+/g,""),"MMYYYY").isValid())}function He(e,t){if(void 0===t&&(t=!0),e){var n=void 0;return n=t?8:6,e.replace(/[^\d]+/g,"").length===n}return!0}function We(e,t){return-1!==e.search("Date")?ze(t):t}function ze(e,t,n){if(void 0===t&&(t="DDMMYYYY"),void 0===n&&(n="YYYY-MM-DD"),Ye(e)){var o=$e(e,t);return qe(e.replace(/[^\d]+/g,""),o).format(n)}}function $e(e,t){return-1!==e.search("/")?"DDMMYYYY":-1!==e.search("-")?"YYYYMMDD":t}function Qe(e){return void 0===e&&(e="YYYY-MM-DD"),qe().format(e)}function Ke(e,t){void 0===t&&(t="DDMMYYYY");var n=$e(e,t);return qe(e.replace(/[^\d]+/g,""),n)}function Je(e,t){return t?qe(e,t):qe(e)}function Xe(e){var t=[];return Object.entries(e).forEach((function(e){var n=V(e,2),o=n[0],r=n[1];t.push({field:o,value:r})})),t}function Ze(e){var t={};return e&&e.length&&e.forEach((function(e){"date"===e.type&&e.value&&(e.value=Je(e.value).format("L")),t[e.field]=e.value})),t}function et(){var e=this;Object.keys(this.controls).map((function(t){var o=e.get(t);o.markAsDirty(),(o instanceof n.FormGroup||o instanceof n.FormArray)&&et.call(o)}))}function tt(e,t,o,r){o?(e.controls[t].setValidators(n.Validators.compose(r&&r.length?r:[n.Validators.required])),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function nt(e,t,n,o){t?n.forEach((function(t){return e.get(t).enable()})):(n.forEach((function(t){return e.get(t).disable()})),it(e,o||n))}function ot(e,t,o){o&&o.length?(e.controls[t].setValidators(n.Validators.compose(o)),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function rt(e,t,n,o){void 0===o&&(o=!0),t?(e.get(n).disable(),o&&e.get(n).reset()):e.get(n).enable()}function at(e,t){return void 0===t&&(t="ASC"),function(n,o){if(!n.hasOwnProperty(e)||!o.hasOwnProperty(e))return 0;var r="string"==typeof n[e]?n[e].toUpperCase():n[e],a="string"==typeof o[e]?o[e].toUpperCase():o[e],i=0;return r>a?i=1:r<a&&(i=-1),"DESC"===t?-1*i:i}}function it(e,t){t.forEach((function(t){return e.get(t).reset()}))}function st(e){if(e){var t=e.calendar.dateFormat.toString();return(t=(t=t.replace(/[y]/g,"YY")).replace(/[/]/g,"")).toUpperCase()}}function lt(e){return e?e.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null}var ct=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var pt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.keyToExclude=[],this.usingType=[],this.minCharactersToSearch=3,this.multiple=!1,this.serviceType=he.PAYROLL,this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{if(this.isTimetrackingSituation)return this.service.query("autocompleteTimetrackingSituation",{valueSearch:n,referenceDate:this.referenceDate}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isDismissalReason){var o={valueSearch:n};return this.referenceDate&&(o.referenceDate=this.referenceDate),this.service.query("autocompleteDismissalReason",o,he.GENERAL_REGISTER).subscribe((function(e){return t.formaterResponce(e.result)}))}if(this.usingType&&this.usingType.length)return this.service.query("autocompleteOtherCompanyFilterUsingType",{searchText:n,usingType:this.usingType}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isDepartmentFromCompany)return this.service.query("autocompleteDepartmentQuery",{searchText:n,companyId:this.companyId,referenceDate:this.referenceDate}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isWagetype){o={searchText:n,companyId:this.companyId};return this.service.query("autocompleteWagetypeQuery",o,he.ENTRY).subscribe((function(e){return t.formaterResponce(e.result)}))}this.service.query("autocomplete",this.getParamsRest(n),this.serviceType).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log(e)}},e.prototype.formaterResponce=function(e){var t=this;this.suggestions=[];var n=[];return e.map((function(e){var o={tableId:e.tableId,name:""};if(t.isTimetrackingSituation||t.isDismissalReason||t.usingType&&t.usingType.length){if(t.keyToExclude.includes(e.fields&&e.fields[2]&&e.fields[2].value))return;var r="";e.fields.map((function(e){o[e.name]=e.value})),r+=e.fields.filter((function(e){return"code"===e.name.toLowerCase()})).map((function(e){return e?e.value+=" - ":""}))[0],!t.usingType||!t.usingType.length||r&&"undefined"!==r||(r=""),r+=e.fields.filter((function(e){return"name"===e.name.toLowerCase()})).map((function(e){return e?e.value:""}))[0],o.name=r,n.push(o)}else{e.fields.map((function(e){o[e.name]=e.value}));var a="";t.concatFieldsForName?(t.concatFieldsForName.map((function(e){(e.includes("date")||e.includes("Birthday"))&&(o[e]=Je(o[e]).format("DD/MM/YYYY")),a+=o[e]+" - "})),a=a.slice(0,-3)):(t.keyCode&&(a+=o[t.keyCode]+" - "),t.keyName&&(a+=o[t.keyName])),o.name=a,n.push(o)}})),this.suggestions=U(n),n},e.prototype.getParamsRest=function(e){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(e),enableEntityFilters:this.enableEntityFilters}},e.prototype.getConditionsRest=function(e){var t=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+e}];return this.conditions&&this.conditions.map((function(e){(["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(e.expression)||Ye(e.value))&&t.push(e)})),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},Object.defineProperty(e.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObject},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:ct}]},e.propDecorators={_autoCompleteObject:[{type:t.ViewChild,args:["autoCompleteObject",{static:!0}]}],name:[{type:t.Input}],table:[{type:t.Input}],order:[{type:t.Input}],enableEntityFilters:[{type:t.Input}],fields:[{type:t.Input}],conditionsFields:[{type:t.Input}],conditions:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],concatFieldsForName:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],isTimetrackingSituation:[{type:t.Input}],isDepartmentFromCompany:[{type:t.Input}],companyId:[{type:t.Input}],referenceDate:[{type:t.Input}],isDismissalReason:[{type:t.Input}],keyToExclude:[{type:t.Input}],usingType:[{type:t.Input}],minCharactersToSearch:[{type:t.Input}],isWagetype:[{type:t.Input}],multiple:[{type:t.Input}],serviceType:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var ut=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[pt],providers:[ct],exports:[pt]}]}],e}(),dt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var mt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,code:"",name:"",fullname:"",admission:"",document:""};e.fields&&e.fields.length&&(n.fullname=e.fields[0].value,n.admission=e.fields[1].value,n.document=e.fields[2].value,n.code=4===e.fields.length&&e.fields[3].value,n.code?n.name=n.code.concat(" - ").concat(n.fullname).concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")):n.name=n.fullname.concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")),t.push(n))})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){var t={valueSearch:e,enableEntityFilters:this.enableEntityFilters};return this.company&&(t.company=this.company),this.branch&&(t.companyBranch=this.branch),this.employeeType&&(t.employeeType=this.employeeType),this.otherContractType&&(t.otherContractType=this.otherContractType),!1===this.filterEmployeeType&&(t.filterEmployeeType=this.filterEmployeeType),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-employee",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:dt}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],company:[{type:t.Input}],branch:[{type:t.Input}],employeeType:[{type:t.Input}],otherContractType:[{type:t.Input}],filterEmployeeType:[{type:t.Input}],enableEntityFilters:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var ht=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[mt],providers:[dt],exports:[mt]}]}],e}(),yt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var ft=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,code:"",name:"",fullname:"",admission:"",document:""};e.fields&&e.fields.length&&(n.fullname=e.fields[0].value,n.admission=e.fields[1].value,n.document=e.fields[2].value,n.code=4===e.fields.length&&e.fields[3].value,n.code?n.name=n.code.concat(" - ").concat(n.fullname).concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")):n.name=n.fullname.concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")),t.push(n))})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){var t={valueSearch:e};return this.company&&(t.company=this.company),this.branch&&(t.companyBranch=this.branch),this.employeeType&&(t.employeeType=this.employeeType),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-employee-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:yt}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],company:[{type:t.Input}],branch:[{type:t.Input}],employeeType:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var gt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,X,v.HttpClientModule,T.AutoCompleteModule,n.ReactiveFormsModule],declarations:[ft],providers:[yt],exports:[ft]}]}],e}(),bt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n={names:[t]};return this.http.enumQuery("enumQuery",n,e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var vt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyToExclude=[],this.keyToKeep=[],this.multiple=!1,this.onSelect=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){var e=this;try{this.service.query(this.server,this.enumeration).subscribe((function(t){return e.payload=t.results[0].items}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(this.suggestions=[],!(isNaN(n)&&n.toString().length<3)){this.keyToExclude&&this.keyToExclude.length?this.payload=this.payload&&this.payload.filter((function(e){return!t.keyToExclude.includes(e.key)})):this.keyToKeep&&this.keyToKeep.length&&(this.payload=this.payload&&this.payload.filter((function(e){return t.keyToKeep.includes(e.key)})));for(var o=0;o<this.payload.length;o++){var r=this.payload[o];-1!==r.value.toLowerCase().indexOf(n.toLowerCase())&&this.suggestions.push(r)}}},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},Object.defineProperty(e.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObjectEl},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-enum",template:'<div [formGroup]="form">\n <p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:bt}]},e.propDecorators={_autoCompleteObjectEl:[{type:t.ViewChild,args:["autoCompleteObject",{static:!0}]}],name:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],inputId:[{type:t.Input}],keyToExclude:[{type:t.Input}],keyToKeep:[{type:t.Input}],server:[{type:t.Input}],enumeration:[{type:t.Input}],form:[{type:t.Input}],multiple:[{type:t.Input}],onSelect:[{type:t.Output}],onBlur:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var It=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[vt],providers:[bt],exports:[vt]}]}],e}(),kt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var St=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.keysToExclude=[],this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onFocus=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{if(this.isWagetype){var o=B({searchText:n,companyId:this.companyId},this.wagetypeReferenceDates);return this.service.query("autocompleteWagetypeQuery",o,he.ENTRY).subscribe((function(e){return t.formaterResponce(e.result)}))}this.service.query("autocomplete",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){var t=this;this.suggestions=[];var n=[];return e.map((function(e){var o={tableId:e.tableId,name:""};if(e.fields.map((function(e){o[e.name]=e.value})),!t.keysToExclude.includes(e&&e.tableId)){var r="";t.concatFieldsForName?(t.concatFieldsForName.map((function(e){e.includes("date")&&(o[e]=Je(o[e]).format("L")),r+=o[e]+" - "})),r=r.slice(0,-3)):(t.keyCode&&(r+=o[t.keyCode]+" - "),t.keyName&&(r+=o[t.keyName])),o.name=r,n.push(o)}})),this.suggestions=n,n},e.prototype.getParamsRest=function(e){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(e)}},e.prototype.getConditionsRest=function(e){var t=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+e}];return this.conditions&&this.conditions.map((function(e){!["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(e.expression)&&Ye(e.value)&&t.push(e)})),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},e.prototype.onFocusItem=function(e){this.onFocus.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onFocus)="onFocusItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:kt}]},e.propDecorators={name:[{type:t.Input}],table:[{type:t.Input}],order:[{type:t.Input}],fields:[{type:t.Input}],conditionsFields:[{type:t.Input}],conditions:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],concatFieldsForName:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],keysToExclude:[{type:t.Input}],isWagetype:[{type:t.Input}],companyId:[{type:t.Input}],wagetypeReferenceDates:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onFocus:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var _t=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[St],providers:[kt],exports:[St]}]}],e}(),wt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n={names:[t]};return this.http.enumQuery("enumQuery",n,e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Dt=function(){function e(e){this.service=e,this.forceSelection=!0,this.onSelect=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){var e=this;try{this.service.query(this.server,this.enumeration).subscribe((function(t){return e.payload=t.results}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.filterQuery=function(e){var t=e.query;if(this.suggestions=[],!(isNaN(t)&&t.toString().length<3))for(var n=0;n<this.payload[0].items.length;n++){var o=this.payload[0].items[n];-1!==o.value.toLowerCase().indexOf(t.toLowerCase())&&this.suggestions.push(o)}},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-model-enum",template:'<p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:wt}]},e.propDecorators={name:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],server:[{type:t.Input}],enumeration:[{type:t.Input}],onSelect:[{type:t.Output}],onBlur:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[Dt],providers:[wt],exports:[Dt]}]}],e}(),Et=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Tt=function(){function e(e){this.service=e,this.forceSelection=!0,this.minCharactersToSearch=3,this.multiple=!1,this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onFocus=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{this.service.query("autocompleteJobpositionQuery",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponse(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponse=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,name:""};e.fields.map((function(e){n[e.name]=e.value})),n.name=n.Code+" - "+n.Name,t.push(n)})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){return{searchText:e,companyId:this.companyId?this.replace(this.companyId):null,creationDate:this.creationDate?this.replace(this.creationDate):null,expirationDate:this.expirationDate?this.replace(this.expirationDate):null,jobpositionsFilter:this.jobpositionsFilter?this.replaceArray(this.jobpositionsFilter):null,ignoredJobpositions:this.ignoredJobpositions?this.replaceArray(this.ignoredJobpositions):null,order:this.order}},e.prototype.replace=function(e){return e.replace(new RegExp("'","g"),"")},e.prototype.replaceArray=function(e){var t=this;return e.map((function(e){return t.replace(e)}))},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-jobposition",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:Et}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],companyId:[{type:t.Input}],creationDate:[{type:t.Input}],expirationDate:[{type:t.Input}],jobpositionsFilter:[{type:t.Input}],ignoredJobpositions:[{type:t.Input}],order:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],minCharactersToSearch:[{type:t.Input}],multiple:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onFocus:[{type:t.Output}]},e}();var Ft=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[Tt],providers:[Et],exports:[Tt]}]}],e}(),Pt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.prototype.queryEntity=function(e,t){return this.http.get(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Mt=function(){function e(e,n){this.translateService=e,this.service=n,this.arguments={page:{current:1,size:"10"}},this.alwaysShowPaginator=!1,this.onLoadPayload=new t.EventEmitter,this.loadedList=new t.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){e.hasOwnProperty("arguments")&&(this.arguments=Object.assign({},e.arguments.currentValue),this.getList(1)),e.hasOwnProperty("reload")&&!0===e.reload.currentValue&&this.getList(1)},e.prototype.getList=function(e){var t=this;this.loadedList.emit(!0);try{var n=Object.assign({},this.arguments);n.page.current=e,this.isEntity?this.service.queryEntity(this.urlRest,n).subscribe((function(n){t.onResponseQuery(n,e),t.loadedList.emit(!1)})):this.service.query(this.urlRest,n).subscribe((function(n){t.onResponseQuery(n.result,e),t.loadedList.emit(!1)}))}catch(e){console.log("Erro ao tentar buscar lista no back")}},e.prototype.onResponseQuery=function(e,t){this.payload=this.filterValues?this.filterValues.bind(this.scope)(e[this.keyPayload]):e[this.keyPayload],this.onLoadPayload.emit({result:e[this.keyPayload],page:t}),this.totalRecords=this.isEntity?e.totalElements:e.countResult},e.prototype.onHandlePage=function(e){var t=e.first/e.rows+1;this.getList(t)},e.prototype.getRowActions=function(e){return this.getRowActionsFun.call(this.scope,e)},e.prototype.handleClickActions=function(e){e.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},e.decorators=[{type:t.Component,args:[{selector:"list-rest",template:'<p-table [value]="payload" reorderableColumns="true" [rows]="10" [totalRecords]="totalRecords" [paginator]="true" [pageLinks]="8"\n [alwaysShowPaginator]="alwaysShowPaginator" [responsive]="true" [lazy]="true" (onPage)="onHandlePage($event)">\n <p-column *ngFor="let col of columns;" [field]="col[\'field\']" [header]="col[\'label\']|translate" [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <span>{{data[col[\'field\']]}}</span>\n </ng-template>\n </p-column>\n\n <p-column [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\', \'overflow\': \'inherit\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <p-splitButton *ngIf="getRowActions(data).length > 1" label="{{\'hcm.payroll.action\' | translate}} ▼" [model]="getRowActions(data)"\n (onClick)="handleClickActions(button)" #button></p-splitButton>\n <button *ngIf="getRowActions(data).length <= 1" type="button" class="sds-button-aux aux-secondary" (click)="getRowActions(data)[0].command()">\n {{getRowActions(data)[0].label}}\n </button>\n </ng-template>\n </p-column>\n\n <ng-template pTemplate="emptymessage">\n {{ emptyMessage }}\n </ng-template>\n</p-table>\n',styles:["tr{border:1px solid #ddd!important}"]}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:Pt}]},e.propDecorators={emptyMessage:[{type:t.Input}],urlRest:[{type:t.Input}],keyPayload:[{type:t.Input}],columns:[{type:t.Input}],arguments:[{type:t.Input}],filterValues:[{type:t.Input}],getRowActionsFun:[{type:t.Input}],scope:[{type:t.Input}],reload:[{type:t.Input}],isEntity:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],onLoadPayload:[{type:t.Output}],loadedList:[{type:t.Output}]},e}();var At=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,X,v.HttpClientModule,b.TableModule,d.InputTextModule,_.ButtonModule,F.SplitButtonModule],declarations:[Mt],providers:[Pt],exports:[Mt]}]}],e}(),Lt=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"spinner-loader",template:"<p-progressSpinner></p-progressSpinner>\n"}]}],e}(),Ot=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,r.ProgressSpinnerModule],declarations:[Lt],exports:[Lt]}]}],e}(),Rt=function(){function e(){this.company={},this.contractNationality={},this.contractType={}}return e.prototype.setCompany=function(e){this.company=e},e.prototype.getCompanyId=function(){return this.company.companyId},e.prototype.setContractNationality=function(e){this.contractNationality=e},e.prototype.isBrazilianAdmission=function(){return"BR"===this.company.abbreviation&&"National"===this.contractNationality.key},e.prototype.isBrazilAndforeignContract=function(){return"BR"===this.company.abbreviation&&"National"!==this.contractNationality.key},e.prototype.isForeignAdmission=function(){return"BR"!==this.company.abbreviation&&"National"===this.contractNationality.key},e.prototype.isForeignAndforeignContract=function(){return"BR"!==this.company.abbreviation&&"National"!==this.contractNationality.key},e.prototype.isBrazilianCompany=function(){return"BR"===this.company.abbreviation},e.prototype.isNationalContract=function(){return"National"===this.contractNationality.key},e.prototype.getCountryID=function(){return this.company.id},Object.defineProperty(e.prototype,"contractNationalityKey",{get:function(){return this.contractNationality.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"abbreviation",{get:function(){return this.company.abbreviation},enumerable:!0,configurable:!0}),e.prototype.getCurrency=function(){return this.company.currency},e.prototype.getStructureID=function(){return this.company.structure},e.prototype.setContractType=function(e){this.contractType=e},Object.defineProperty(e.prototype,"contractTypeKey",{get:function(){return this.contractType?this.contractType.key:this.contractType},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],providers:[Rt]}]}],e}(),Bt=y;function Nt(e){return/^\d*$/.test(e)}function jt(e){return e||!1}function qt(e){return Nt(jt(e))?Number.parseInt(e):0}var Vt=function(){function e(e){this.http=e,this.companyUseWorkstationGroupSubject=new f.Subject}return e.prototype.getCompanyIndications=function(e,t){return this.http.query("companyIndicationQuery",{companyId:e,companyIndicationType:t}).pipe(s.map((function(e){return e.result})))},e.prototype.setCompanyUseWorkstationGroup=function(e){this.companyUseWorkstationGroupSubject.next(e)},e.prototype.setStructure=function(e){this.structure=e},e.prototype.getStructure=function(){return this.structure},e.prototype.getCompanyUseWorkstationGroup=function(){return this.companyUseWorkstationGroupSubject.asObservable()},e.prototype.setUseWorkstationGroup=function(e){this.useWorkstationGroup=e},e.prototype.getUseWorkstationGroup=function(){return this.useWorkstationGroup},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Ut=function(){function e(e){this.http=e}return e.prototype.hasModule=function(e){return this.http.query("hasModule",{module:e})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Yt=y,Gt=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n,this._httpParams=new v.HttpParams}return e.prototype.lookupRequestPost=function(e,t,n,o){return void 0===n&&(n=null),this.httpPostParams=e,this.postConfigPageSize(e),this.lookupDisplayField=o,this.concatFields=n,this.postDataLookup(t)},e.prototype.postConfigPageSize=function(e){e&&(this.httpPostParams.page.size=e.page&&e.page.size?e.page.size:10,this.httpPostParams.page.current=e.page&&e.page.current?e.page.current:0)},e.prototype.lookupRequest=function(e,t,n,o,r,a,i,s){return void 0===i&&(i=[]),void 0===s&&(s=[]),this.searchLookupFields=n,this.endpoint=t,this.parameters=s,this.concatFields=r,this.concatOtherFields=i,this.lookupDisplayField=a,this.searchFields=o,this.generateLookupParameters(e),this.configHttpParamsPagination("10","0"),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup()},e.prototype.searchRequest=function(e,t,n,o,r,a,i){return void 0===a&&(a=[]),void 0===i&&(i=[]),this.endpoint=t,this.parameters=i,this.concatFields=o,this.concatOtherFields=a,this.lookupDisplayField=r,this.searchFields=n,this.generateGridParameters(e.filterData),this.configHttpParamsPagination(e.rows.toString(),Math.floor(e.first/e.rows).toString()),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup()},e.prototype.getDataLookup=function(){var e=this;return this.getUrlDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(t){var n=t.contents;return e.concatFields&&e.concatFields.length&&n.map((function(t){e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(B({},t))})),t})))},e.prototype.postDataLookup=function(e){var t=this;return this.postUrlDataLookup(e,this.httpPostParams).pipe(s.map((function(e){var n=e.contents;return t.concatFields&&t.concatFields.length&&n.map((function(e){t.concatOtherFields&&t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=Yt(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.concatOtherFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.generateLookupParameters=function(e){var t=this,n="";this.searchLookupFields.forEach((function(o){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n?n+=" or "+t.getParameterByType(r.type,o,e):n=""+t.getParameterByType(r.type,o,e)})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.generateGridParameters=function(e){var t=this,n="";Object.keys(e).forEach((function(o){if(e[o]){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n+=n?" and "+t.getParameterByType(r.type,o,e[o]):t.getParameterByType(r.type,o,e[o])}})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.getParameterByType=function(e,t,n){switch(e){case h.FieldType.Date:return t+" eq '"+Yt(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";default:return"containing(lower("+t+"), lower('"+n+"'))"}},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(e){if(e&&e.length){var t="";e.map((function(e){t+=t?","+e.field+"+"+(1===e.order?"asc":"desc"):e.field+"+"+(1===e.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",t)}},Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),e.prototype.getUrlDataLookup=function(e,t){var n=this;return t?this.http.get(""+e,{params:t}).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)}))):this.http.get(""+e).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.postUrlDataLookup=function(e,t){var n=this;return t?this.http.post(""+e,B({},t)).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.post(""+e,{}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(v.HttpClient),t.ɵɵinject(P.MessageService),t.ɵɵinject(i.TranslateService))},token:e,providedIn:"root"}),e}();var Ht=y,Wt=function(){function e(e){this.httpClienteService=e}return e.prototype.getAutoComplete=function(e,t,n,o,r){var a=this.generateGridParameters(t,n,o);return this.httpClienteService.getAutoComplete(e,a,r).pipe(s.map((function(e){return e&&e.contents})))},e.prototype.getAutoCompleteQuery=function(e,t){return this.httpClienteService.query(e,t).pipe(s.map((function(e){return e&&e.result})))},e.prototype.generateGridParameters=function(e,t,n){var o=this,r="";return Object.keys(e).forEach((function(a){var i,s=t&&t.filter((function(e){return a===e.name}))[0],l="",c=s&&s.type;s||a==pe.searchValue||(c=h.FieldType.String),s||a!==pe.searchValue||(c=pe.searchValue),r&&(l=" and "),(i=o.getParameterByType(c,a,e[a],n))&&(r+=" "+l+" "+i)})),r},e.prototype.getParameterByType=function(e,t,n,o){if(!n&&e!=pe.searchValue)return t+" is null";if(n&&"not null"===n&&e!=pe.searchValue)return t+" is not null";switch(e){case h.FieldType.Date:return t+" eq '"+Ht(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";case pe.searchValue:return""+this.getParameterBySearchType(n,o);default:return this.getSearchFilterString(t,n)}},e.prototype.getParameterBySearchType=function(e,t){var n,o,r="";if(e){try{for(var a=q(Object.entries(e)),i=a.next();!i.done;i=a.next()){var s=V(i.value,2),l=s[0],c=s[1];if("code"===l&&Number(c)){var p=t?"'":"";r+=r?" or "+l+" eq "+p+c+p:l+" eq "+p+c+p}else"code"!=l&&(r+=r?" or "+this.getSearchFilterString(l,c):this.getSearchFilterString(l,c))}}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}r=r?"("+r+")":""}return r},e.prototype.getSearchFilterString=function(e,t){return"containing(lower("+e+"), lower('"+t+"'))"},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Pe}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Pe))},token:e,providedIn:"root"}),e}();var zt="platform/report/queries/getParameters",$t="platform/report/queries/getReportUri",Qt="platform/report/queries/getReportStatus",Kt="platform/report/queries/findReportsByName",Jt="platform/report/queries/getRunningReports",Xt="platform/report/actions/generateReport",Zt=function(){function e(e){this.http=e}return e.prototype.findReportsByName=function(e){return this.http.post(""+Kt,{name:e}).pipe(s.map((function(e){return e.reports?e.reports:[]})))},e.prototype.findReportByName=function(e){return e=e||"",this.findReportsByName(e).pipe(s.map((function(t){var n=t&&t.filter((function(t){return t.name&&t.name===e}));return n&&1==n.length?n[0]:null})))},e.prototype.getParameters=function(e,t){return this.http.post(""+zt,{id:e,reportFileId:t}).pipe(s.map((function(e){return e||null})))},e.prototype.getReportUri=function(e){return this.http.post(""+$t,{reportTicket:e}).pipe(s.map((function(e){return e&&e.reportUri})))},e.prototype.getReportStatus=function(e){return this.http.post(""+Qt,{reportTicket:e}).pipe(s.map((function(e){return e&&e.reportStatus})))},e.prototype.generateReport=function(e){return this.http.post(""+Xt,e).pipe(s.map((function(e){return e||null})))},e.prototype.getRunningReports=function(e,t){return this.http.post(""+Jt,{offset:e,limit:t,orderByDesc:!0,filterCancelled:!0})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(v.HttpClient))},token:e,providedIn:"root"}),e}();var en=function(){function e(){this.useWorkflowValueChange=new f.Subject,this._draftJSON=new f.BehaviorSubject(null)}return e.prototype.setUseWorkflow=function(e){this.useWorkflowValueChange.next(e)},e.prototype.getUseWorkflow=function(){return this.useWorkflowValueChange.asObservable()},e.prototype.setDraftJSON=function(e){this._draftJSON.next(e)},e.prototype.getDraftJSON=function(){return this._draftJSON.asObservable()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var tn=function(){function e(){this.resetDivergentFormData()}return e.prototype.resetDivergentFormData=function(){this._divergentFormData={}},e.prototype.checkFormDisagreements=function(e){var t=this;void 0===e&&(e=!1),this.resetDivergentFormData(),this._sanitizeEmptyStrings(),e&&this._removeIdsFromFormDatas(),this._oldFormData===this._newFormData?this._throwIdenticalMessage():(Object.keys(this._oldFormData).forEach((function(e){t._oldFormData[e]!==t._newFormData[e]&&(t._divergentFormData[e]=t._createDivergencePair(e))})),Object.keys(this._newFormData).forEach((function(e){t._newFormData[e]!==t._oldFormData[e]&&(t._divergentFormData[e]=t._createDivergencePair(e))})),this._isDivergentFormDataEmpty&&this._throwIdenticalMessage())},e.prototype._removeIdsFromFormDatas=function(){[this._oldFormData,this._newFormData].forEach((function(e){delete e.id}))},e.prototype._sanitizeEmptyStrings=function(){[this._oldFormData,this._newFormData].forEach((function(e){Object.keys(e).map((function(t){""===e[t]&&(e[t]=null)}))}))},e.prototype._createDivergencePair=function(e){var t={oldValue:null,newValue:null};return t.oldValue=this._oldFormData[e],t.newValue=this._newFormData[e],t},e.prototype._throwIdenticalMessage=function(){throw new Error("The objects oldFormData and newFormData are identical")},Object.defineProperty(e.prototype,"oldFormData",{get:function(){return this._oldFormData},set:function(e){this._oldFormData=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"newFormData",{get:function(){return this._newFormData},set:function(e){this._newFormData=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"divergentFormArray",{get:function(){var e=[];return Object.entries(this._divergentFormData).map((function(t){var n=V(t,2),o=n[0],r=n[1],a={key:null,oldValue:null,newValue:null};a.key=o,a.oldValue=r.oldValue,a.newValue=r.newValue,e.push(a)})),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isDivergentFormDataEmpty",{get:function(){return 0===Object.entries(this._divergentFormData).length},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var nn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],providers:[Vt,Ut,Gt,Wt,Zt,en,tn]}]}],e}(),on=function(){function e(e){var t=this;this.http=e,this.actionUrl="platform/authorization/queries/checkAccess",this.resourceAddress="res://senior.com.br/hcm/payroll/",this.defaultActions=["Visualizar","Incluir","Editar","Excluir"],this._resources=[],this._attributes=[],M.user.getAuthHeader().then((function(e){t.httpOptions={headers:new v.HttpHeaders({"Content-Type":"application/json",Accept:"application/json",Authorization:e})}})),M.service.getRestUrl().then((function(e){return t.restUrl=e}))}return e.prototype.get=function(e){var t=this;return void 0===e&&(e=""),this.permissions?this.observable=f.Observable.of(this.permissions):this.observable||(this.observable=this.getPermissions().pipe(s.map((function(e){return t.permissions=e})))),this.observable.pipe(s.map((function(t){return e?t[e]:t})))},e.prototype.getAbac=function(e,t){return this.attributes=t,this.getAbacPermission(e)},e.prototype.getAbacPermission=function(e){return this.http.post(this.actionUrl,{includeFilters:!1,permissions:[{resource:""+this.resourceAddress+e,action:"Visualizar",attributes:this._attributes.map((function(e){return{attribute:e.name,value:e.value}}))}]},this.httpOptions)},e.prototype.getPermissions=function(){var e=this,t=[];return this._resources.forEach((function(n){return e.defaultActions.forEach((function(o){return t.push({action:o,resource:""+e.resourceAddress+n})}))})),this.http.post(this.actionUrl,{includeFilters:!1,permissions:U(t)},this.httpOptions).pipe(s.map((function(t){var n=t.permissions,o={};return n.forEach((function(t){var n=t.resource.replace(e.resourceAddress,"");o[n]=o[n]||{},o[n][t.action.toLowerCase()]=t.authorized})),o})))},Object.defineProperty(e.prototype,"attributes",{set:function(e){this._attributes=e},enumerable:!0,configurable:!0}),e.prototype.setResources=function(e){this._resources=e},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var rn=function(){function e(e,t,n){this.toastService=e,this.messageService=t,this.translateService=n,this.key="TOAST",this.breakLine=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.toastService.loadErrorMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createErrorMessage(t&&t.message),e.breakLine=t&&t.breakLine})),this.toastService.loadSuccessMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createSuccessMessage(t&&t.message),e.breakLine=t&&t.breakLine})),this.toastService.loadWarningMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createWarningMessage(t&&t.message),e.breakLine=t&&t.breakLine}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.createErrorMessage=function(e,t){this.messageService.clear(),this.messageService.add({severity:"error",summary:t||this.translateService.instant("hcm.payroll.error"),detail:e,sticky:!0,key:this.key})},e.prototype.createSuccessMessage=function(e,t){this.messageService.add({severity:"success",summary:t||this.translateService.instant("hcm.payroll.success"),detail:e,key:this.key})},e.prototype.createWarningMessage=function(e,t){this.messageService.add({severity:"warn",summary:t||this.translateService.instant("hcm.payroll.warn"),detail:e,sticky:!0,key:this.key})},e.decorators=[{type:t.Component,args:[{selector:"c-toast",template:"\n <p-toast [ngClass]=\"breakLine ? 'ui-toast-break-line' : ''\" [key]=\"key\"></p-toast>\n "}]}],e.ctorParameters=function(){return[{type:Fe},{type:I.MessageService},{type:i.TranslateService}]},e}();var an=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,A.ToastModule],declarations:[rn],providers:[Fe,I.MessageService],exports:[rn]}]}],e}(),sn=function(){function e(e){this.http=e}return e.prototype.getList=function(e,t){return this.http.get(""+e,{params:t})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var ln=function(){function e(e){this.dataListService=e,this.rows=10,this.paginator=!0,this.first=0,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.lazyLoad=new t.EventEmitter,this.loadingChange=new t.EventEmitter,this.totalRecordsChange=new t.EventEmitter,this.listDataChange=new t.EventEmitter,this.selectedDataChange=new t.EventEmitter,this.headerCheckboxToggle=new t.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.lazy||this.getlistData()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getActions=function(e,t){return this.actions(e,t)},e.prototype.handleClickActions=function(e){e.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},e.prototype.pagination=function(e){this.lazy||this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onLazyLoad=function(e){var t=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){t.orderBy.push({field:e.field,direction:1===e.order?ue.ASC:ue.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),e.prototype.getlistData=function(e,t){var n=this;void 0===e&&(e=this.rows),void 0===t&&(t=this.first),this.endpoint?(this.configParameters(this.initParameters),this.configHttpParamsDisplayFields(),this.configHttpParamsPagination(e.toString(),t.toString()),this.configHttpParamsOrderBy(),this.dataListService.getList(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){n.listData=e.contents,n.totalRecords=e.totalElements,n.lazy&&n.lazyLoad.emit(n.listData)}))):this.lazy&&this.lazyLoad.emit(this.listData)},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(){if(this.orderBy&&this.orderBy.length){var e="";this.orderBy.map((function(t){e+=e?","+t.field+"+"+t.direction:t.field+"+"+t.direction})),this.httpParams=this.httpParams.set("orderby",e)}},e.prototype.configHttpParamsDisplayFields=function(){this.displayFields&&this.displayFields.length&&(this.httpParams=this.httpParams.set("displayfields",this.displayFields.toString()))},e.prototype.onHeaderCheckboxToggle=function(e){this.headerCheckboxToggle.emit(e)},e.prototype.getFieldValue=function(e,t){return t.field&&t.field.includes(".")?(t.field.split(".").map((function(t){return e=e&&e[t]})),e):e[t.field]},e.prototype.configParameters=function(e){var t="";e&&(e.forEach((function(e){t?t+=" and "+e.toString():t=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",t))},Object.defineProperty(e.prototype,"parameters",{set:function(e){this.configParameters(e),e&&(this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{get:function(){return this._loading},set:function(e){this._loading=e,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listData",{get:function(){return this._listData},set:function(e){this._listData=e,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedData",{get:function(){return this._selectedData},set:function(e){this._selectedData=e,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(e){this._totalRecords=e,this.totalRecordsChange.emit(this.totalRecords)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-data-list",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows"\n [first]="first" (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator"\n (onPage)="pagination($event)" [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey"\n [sortMode]="sortMode" [responsive]="true" pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)"\n [selectionMode]="selectionMode">\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.orderBy || col.field"\n [pSortableColumnDisabled]="!isSortable || !!col.icon" [style.width]="col.width" [pTooltip]="col.tooltip || col.label"\n tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="{{id}}-col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style"\n aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="{{id}}-col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default"\n [model]="getActions(rowData, key)" [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label"\n priority="default" (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:t.ViewEncapsulation.None,styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]}]}],e.ctorParameters=function(){return[{type:sn}]},e.propDecorators={dataListTable:[{type:t.ViewChild,args:["dataListTable",{static:!1}]}],id:[{type:t.Input}],dataKey:[{type:t.Input}],rows:[{type:t.Input}],emptyMessage:[{type:t.Input}],columns:[{type:t.Input}],paginator:[{type:t.Input}],first:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],actions:[{type:t.Input}],actionLabel:[{type:t.Input}],selectionMode:[{type:t.Input}],lazy:[{type:t.Input}],isMultipleSelection:[{type:t.Input}],isSortable:[{type:t.Input}],showHeaderCheckBox:[{type:t.Input}],sortMode:[{type:t.Input}],endpoint:[{type:t.Input}],displayFields:[{type:t.Input}],orderBy:[{type:t.Input}],singularMessageRecords:[{type:t.Input}],pluralMessageRecords:[{type:t.Input}],initParameters:[{type:t.Input}],lazyLoad:[{type:t.Output}],loadingChange:[{type:t.Output}],totalRecordsChange:[{type:t.Output}],listDataChange:[{type:t.Output}],selectedDataChange:[{type:t.Output}],headerCheckboxToggle:[{type:t.Output}],parameters:[{type:t.Input}],loading:[{type:t.Input}],listData:[{type:t.Input}],selectedData:[{type:t.Input}],totalRecords:[{type:t.Input}]},e}();var cn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[ln],exports:[ln],providers:[sn]}]}],e}(),pn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.getDataLookup=function(e,t){var n=this;return t?this.http.get(""+e,{params:t}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.get(""+e).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var un=y,dn=function(){function e(e){this.lookupService=e,this.searchTotalRecordsLabel="hcm.payroll.lookup_search_total_records_label",this.filterLabel="hcm.payroll.lookup_generic_filter_label",this.clearLabel="hcm.payroll.lookup_generic_clean_filter_label",this.cancelLabel="hcm.payroll.lookup_generic_btn_cancel_label",this.selectLabel="hcm.payroll.lookup_btn_select_label",this.lookupEmptyMessage="hcm.payroll.lookup_auto_complete_empty_message",this.lookupSuggestions=[],this.searchGridFields=[],this.searchLookupFields=[],this.searchGridData=[],this.searchFields=[],this.parameters=[],this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.lookupRequest=function(e){var t=this;this.generateLookupParameters(e),this.configHttpParamsPagination("10","0"),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return t.lookupSuggestions=e&&U(e.contents)}))},e.prototype.searchRequest=function(e){var t=this;this.generateGridParameters(e.filterData),this.configHttpParamsPagination(e.rows.toString(),Math.floor(e.first/e.rows).toString()),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return t.searchGridData=e&&U(e.contents)}))},e.prototype.getDataLookup=function(e,t){var n=this;return this.lookupService.getDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(e){var t=e.totalElements,o=e.contents;return n.searchTotalRecords=t,n.concatFields&&n.concatFields.length&&o.map((function(e){n.convertGridFieldValue(e),e[n.lookupDisplayField]=n.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=un(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.searchGridFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.generateLookupParameters=function(e){var t=this,n="";this.searchLookupFields.forEach((function(o){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n?n+=" or "+t.getParameterByType(r.type,o,e):n=""+t.getParameterByType(r.type,o,e)})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.generateGridParameters=function(e){var t=this,n="";Object.keys(e).forEach((function(o){if(e[o]){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n+=n?" and "+t.getParameterByType(r.type,o,e[o]):t.getParameterByType(r.type,o,e[o])}})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.getParameterByType=function(e,t,n){switch(e){case h.FieldType.Date:return t+" eq '"+un(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq "+n.id;default:return"containing(lower("+t+"), lower('"+n+"'))"}},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(e){if(e&&e.length){var t="";e.map((function(e){t+=t?","+e.field+"+"+(1===e.order?"asc":"desc"):e.field+"+"+(1===e.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",t)}},Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-lookup",template:'<div *ngIf="formGroup;else noForm" [formGroup]="formGroup">\n <s-lookup [id]="id" [dataKey]="dataKey" [formControlName]="controlName" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</div>\n\n<ng-template #noForm>\n <s-lookup [id]="id" [dataKey]="dataKey" [(ngModel)]="model" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</ng-template>\n'}]}],e.ctorParameters=function(){return[{type:pn}]},e.propDecorators={id:[{type:t.Input}],dataKey:[{type:t.Input}],concatFields:[{type:t.Input}],searchTitle:[{type:t.Input}],formGroup:[{type:t.Input}],controlName:[{type:t.Input}],multiple:[{type:t.Input}],endpoint:[{type:t.Input}],lookupDisplayField:[{type:t.Input}],searchTotalRecordsLabel:[{type:t.Input}],filterLabel:[{type:t.Input}],clearLabel:[{type:t.Input}],cancelLabel:[{type:t.Input}],selectLabel:[{type:t.Input}],lookupEmptyMessage:[{type:t.Input}],searchTotalRecords:[{type:t.Input}],lookupSuggestions:[{type:t.Input}],searchGridFields:[{type:t.Input}],searchLookupFields:[{type:t.Input}],searchGridData:[{type:t.Input}],searchFields:[{type:t.Input}],parameters:[{type:t.Input}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var mn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,h.DynamicFormModule,n.ReactiveFormsModule,i.TranslateModule],declarations:[dn],exports:[dn],providers:[pn]}]}],e}(),hn=y,yn=function(){function e(e){this.httpClienteService=e}return e.prototype.getAutoComplete=function(e,t,n,o,r){var a=this.generateGridParameters(t,n,o);return this.httpClienteService.getAutoComplete(e,a,r).pipe(s.map((function(e){return e&&e.contents})))},e.prototype.getAutoCompleteQuery=function(e,t){return this.httpClienteService.query(e,t).pipe(s.map((function(e){return e&&e.result})))},e.prototype.generateGridParameters=function(e,t,n){var o=this,r="";return Object.keys(e).forEach((function(a){var i,s=t&&t.filter((function(e){return a===e.name}))[0],l="",c=s&&s.type;s||a==pe.searchValue||(c=h.FieldType.String),s||a!==pe.searchValue||(c=pe.searchValue),r&&(l=" and "),(i=o.getParameterByType(c,a,e[a],n))&&(r+=" "+l+" "+i)})),r},e.prototype.getParameterByType=function(e,t,n,o){if(!n&&e!=pe.searchValue)return t+" is null";if(n&&"not null"===n&&e!=pe.searchValue)return t+" is not null";switch(e){case h.FieldType.Date:return t+" eq '"+hn(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";case pe.searchValue:return""+this.getParameterBySearchType(n,o);default:return this.getSearchFilterString(t,n)}},e.prototype.getParameterBySearchType=function(e,t){var n,o,r="";if(e){try{for(var a=q(Object.entries(e)),i=a.next();!i.done;i=a.next()){var s=V(i.value,2),l=s[0],c=s[1];if("code"===l&&Number(c)){var p=t?"'":"";r+=r?" or "+l+" eq "+p+c+p:l+" eq "+p+c+p}else"code"!=l&&(r+=r?" or "+this.getSearchFilterString(l,c):this.getSearchFilterString(l,c))}}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}r=r?"("+r+")":""}return r},e.prototype.getSearchFilterString=function(e,t){return"containing(lower("+e+"), lower('"+t+"'))"},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var fn=y,gn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.lookupRequestPost=function(e,t,n,o){return void 0===n&&(n=null),this.httpPostParams=e,this.postConfigPageSize(e),this.lookupDisplayField=o,this.concatFields=n,this.postDataLookup(t)},e.prototype.postConfigPageSize=function(e){e&&(this.httpPostParams.page.size=e.page&&e.page.size?e.page.size:10,this.httpPostParams.page.current=e.page&&e.page.current?e.page.current:0)},e.prototype.postDataLookup=function(e){var t=this;return this.postUrlDataLookup(e,this.httpPostParams).pipe(s.map((function(e){var n=e.contents;return t.concatFields&&t.concatFields.length&&n.map((function(e){t.concatOtherFields&&t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=fn(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.concatOtherFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.postUrlDataLookup=function(e,t){var n=this;return t?this.http.post(""+e,B({},t)).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.post(""+e,{}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var bn=function(){function e(e,t){var n=e.filterData;this.name=n.name||null,this.code=n.code||null,this.searchText=n.searchText||null,this.companyId=n.headoffice||null,this.companyBranchId=n.branchoffice&&n.branchoffice.id||null,this.departmentId=n.department&&n.department.tableId||null,this.costcenterId=n.costcenter&&n.costcenter.id||null,this.jobpositionIds=n.jobposition||null,this.syndicateId=n.syndicate&&n.syndicate.id||null,this.shiftId=n.workshiftScale||null,this.workshiftId=n.workshiftId&&n.workshiftId.id||null,this.workshiftGroupId=n.workshiftGroupId&&n.workshiftGroupId.id||null,this.intervalGroupId=n.intervalGroupId&&n.intervalGroupId.is||null,this.scaleTeamId=n.scaleTeamId&&n.scaleTeamId.id||null,this.scaleCategoryId=n.scaleCategoryId&&n.scaleCategoryId.id||null,this.employmentRelationshipId=n.employmentRelationshipId&&n.employmentRelationshipId.id||null,this.contractType=n.contractType||null,this.expenseNatureId=n.expenseNatureId&&n.expenseNatureId.id||null,this.allowDeficient=n.allowDeficient||null,this.disabilityIds=n.disabilityIds||null,this.listExpired=!!n.hasOwnProperty("listExpired")&&n.listExpired,this.manager=n.manager?n.manager.tableId:null,this.referenceDate=t||null,this.page={current:e.first?e.first:0,size:e.rows?e.rows:10}||null}return e.prototype.getToFilter=function(){return this.jobpositionIds=this.convertListIds(this.jobpositionIds),this.disabilityIds=this.convertListIds(this.disabilityIds),this},e.prototype.convertListIds=function(e){if(e)return e.map((function(e){return e.tableId?e.tableId:e.id}))},e}();var vn=y,In=function(){function e(e,n,o,r){var a=this;this.translate=e,this.cd=n,this.autocompleteParametersService=o,this.lookupParametersService=r,this.currentCompanyId=null,this.currentCompanyName=null,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.companyBranchId=null,this.lookupSuggestions=[],this.searchGridData=[],this.suggestionsObservable=new f.BehaviorSubject([]),this.totalRecords=0,this.valueEnumShift=[{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FIRST_SHIFT"),value:"0",enum:"FIRST_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_SECOND_SHIFT"),value:"1",enum:"SECOND_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_THIRD_SHIFT"),value:"2",enum:"THIRD_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FOURTH_SHIFT"),value:"3",enum:"FOURTH_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_MIXED"),value:"4",enum:"MIXED"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_GENERAL"),value:"5",enum:"GENERAL"}],this.concatFieldsName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String}),new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String})],this.concatName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String})],this.gridFields=[new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String}),new h.FormField({name:"manager",label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),type:h.FieldType.String})],this.searchFields=U(this.concatName,[{name:"name",label:this.translate.instant("hcm.payroll.movimentation_name"),type:h.FieldType.String},{name:"headoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_company"),dataKey:"id",appendTo:"body",fullWidth:!0,suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"branchoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_branch"),dataKey:"id",appendTo:"body",fullWidth:!0,onRemove:function(){return a.companyBranchId=null},onSelect:function(e){var t=e.id;return a.companyBranchId=t},onSearch:function(e){a.getAutocomplete("company",e?{companyname:e,code:e}:null,"code","companyname",{headquarter:a.currentCompanyId?a.currentCompanyId:"not null"})},suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"manager",type:h.FieldType.Autocomplete,multiple:!1,label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteManager",{valueSearch:e||"",companyId:{tableId:a.currentCompanyId},companyBranchId:{tableId:a.companyBranchId?a.companyBranchId:""}})},suggestionsObservable:this.suggestionsObservable,displayField:"manager"},{name:"department",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.movimentation_historical_department_tab"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteDepartmentQuery",{searchText:e||"",companyId:a.currentCompanyId,referenceDate:vn(y.now()).format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"costcenter",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_cost_center"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("costcenter",e?{name:e,code:e}:null,"code","name",a.currentCompanyId?{company:a.currentCompanyId}:null,!0,he.ORGANIZATION_REGISTER)},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"jobposition",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.movimentation_historical_job_position_tab"),dataKey:"tableId",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteJobpositionQuery",{searchText:e||"",companyId:a.currentCompanyId,creationDate:vn().format("YYYY-MM-DD"),expirationDate:vn().format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"syndicate",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_syndicate"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("syndicate",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"workshiftScale",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.SHIFT"),showClear:!0,size:{md:12},onChange:function(){a.resetDependenciesOfShift(!0)},options:this.valueEnumShift},{name:"workshiftId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("workshift",e?{description:e,code:e}:null,"code","description",a.workstationFilterForm.get("workshiftScale").value?{workshiftScale:a.valueEnumShift[a.workstationFilterForm.get("workshiftScale").value].enum}:null)},onSelect:function(){a.resetDependenciesOfShift()},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"workshiftGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_workshift-group"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("workshiftGroup",e?{code:e}:null,"code","baseDate",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"baseDate"},{name:"intervalGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_class_interval"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("intervalGroup",e?{description:e,code:e}:null,"code","description",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"scaleTeamId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_team"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("scaleTeam",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"scaleCategoryId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_category"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("scaleCategory",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"employmentRelationshipId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_employment_relationship"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("employmentRelationship",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"contractType",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.employees_temporary_contract_temporary_contract_type"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Employee"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Manager"),value:1},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FarmWorker"),value:2},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Retired"),value:3},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Trainee"),value:4},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Apprentice"),value:5},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FixedDueDate"),value:6},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_RetiredManager"),value:7},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_PublicAgent"),value:8},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Teacher"),value:9},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_CooperativeWorker"),value:10},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_DomesticWorker"),value:11},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_TeacherFixedDueDate"),value:12}]},{name:"expenseNatureId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_expense_nature"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("expenseNature",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"allowDeficient",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.allow_deficient"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_No"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Also"),value:1},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Only"),value:2}]},{name:"disabilityIds",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.employees_addition_disability"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("disability",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"}]),this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var e=this.workstationFilterForm.get("headoffice");e.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),e.disable()},Object.defineProperty(e.prototype,"workstationFilterForm",{get:function(){return this.workstationgroupEl&&this.workstationgroupEl.formGroupDialog},enumerable:!0,configurable:!0}),e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},e.prototype.resetDependenciesOfShift=function(e){void 0===e&&(e=!1),e&&this.workstationFilterForm.get("workshiftId").reset(),this.workstationFilterForm.get("workshiftGroupId").reset(),this.workstationFilterForm.get("intervalGroupId").reset()},e.prototype.searchRequest=function(e){var t=this,n=this.workstationFilterForm.get("headoffice"),o=e&&e.filterData;n.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),e=B({},this.getValueEvent(e,o));var r=this.getHireDate().replace(/\'/g,""),a=new bn(e,r);this.lookupParametersService.lookupRequestPost(a.getToFilter(),"hcm/payroll/queries/workstationgroupFilterQuery",U(this.concatFieldsName),"name").pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){o?t.searchGridData=e&&U(e.contents):t.lookupSuggestions=e&&U(e.contents),t.totalRecords=e&&e.totalPages}))},e.prototype.getValueEvent=function(e,t){return t?e.filterData.headoffice=this.currentCompanyId:e={filterData:{headoffice:this.currentCompanyId,searchText:e}},e},e.prototype.getAutocompleteQuery=function(e,t){var n=this;this.autocompleteParametersService.getAutoCompleteQuery(e,t).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"autocompleteDepartmentQuery"===e?t.filter((function(e){e.fields&&e.fields[0]&&(e.name=e.fields[1].value+" - "+e.fields[0].value)})):"autocompleteJobpositionQuery"===e?t.filter((function(e){e.fields&&e.fields[0]&&e.fields[1]&&(e.name=e.fields[0].value+" - "+e.fields[1].value)})):"autocompleteManager"===e&&t.map((function(e){e.manager=e.fields[0].value?e.fields[0].value:e.fields[3].value})),n.suggestionsObservable.next(t)}))},e.prototype.getAutocomplete=function(e,t,n,o,r,a,i){var l=this;void 0===r&&(r=null),void 0===a&&(a=!1),void 0===i&&(i=he.PAYROLL),this.autocompleteParametersService.getAutoComplete(e,B({},r,{searchValue:B({},t)}),this.searchFields,a,i).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"workshiftGroup"===e&&t.filter((function(e){if(e.baseDate){var t=vn(e.baseDate,"YYYY-MM-DD");if(t.isValid())return e.baseDate=t.format(l.dateFormat)}})),l.suggestionsObservable.next(l.getConcatFields(t,n,o))}))},e.prototype.getConcatFields=function(e,t,n){return n&&t&&e.filter((function(e){e[n]=e[t]+" - "+e[n]})),e},e.prototype.getHireDate=function(){var e=vn(this.hireDate).format(this.dateFormat);return e?"'"+ze(e,this.dateFormat)+"'":"'"+Qe()+"'"},e.decorators=[{type:t.Component,args:[{selector:"c-workstationgroup-lookup",template:'<div [formGroup]="form">\n <s-lookup\n #workstationgroupEl\n id="workstationGroup"\n dataKey="code"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n [formControlName]="name"\n (onLookupRequest)="searchRequest($event)"\n (onSearchRequest)="searchRequest($event)"\n filterTitle="{{ \'hcm.payroll.filters\' | translate }}"\n filterLabel="{{ \'hcm.payroll.filter\' | translate }}"\n clearLabel="{{ \'hcm.payroll.lookup_generic_clean_filter_label\' | translate }}"\n cancelLabel="{{ \'hcm.payroll.cancel\' | translate }}"\n selectLabel="{{ \'hcm.payroll.lookup_btn_select_label\' | translate }}"\n [disabled]="disabled"\n [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{ \'hcm.payroll.lookup_auto_complete_empty_message\' | translate }}"\n [searchGridData]="searchGridData"\n [searchFields]="searchFields"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n [searchTotalRecords]="totalRecords"\n searchTotalRecordsLabel="{{ totalRecords }} {{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [searchGridFields]="gridFields"\n searchTitle="{{ \'hcm.payroll.employees_addition_workstation\' | translate }}"\n lookupDisplayField="name"\n ></s-lookup>\n\n</div>\n'}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:t.ChangeDetectorRef},{type:yn},{type:gn}]},e.propDecorators={workstationgroupEl:[{type:t.ViewChild,args:["workstationgroupEl",{static:!1}]}],currentCompanyId:[{type:t.Input}],currentCompanyName:[{type:t.Input}],hireDate:[{type:t.Input}],dateFormat:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],form:[{type:t.Input}],name:[{type:t.Input}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onBlur:[{type:t.Output}]},e}();var kn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,h.DynamicFormModule,n.ReactiveFormsModule,c.CommonModule,i.TranslateModule],declarations:[In],exports:[In],providers:[yn,gn]}]}],e}(),Sn=function(){function e(e,n,o,r,a){var i=this;this.confirmationService=e,this.translateService=n,this.activatedRoute=o,this.cd=r,this.formBuilder=a,this.recordByRow=1,this.showDateWhen=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.visibleChange=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"displayDateWhen",direction:ue.DESC},this.bankAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.cols=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"displayDateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account_type"),field:"accountType"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_digit"),field:"digit"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"}],this.actions=function(e,t){return void 0===e&&(e={}),[{visible:i.isEditMode,label:i.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){e.index=t,i.bankAccountItemInput={currentItem:e,listData:i.listDataNoPage,isEditMode:!1},i.visible=!0}},{visible:!(i.isEditMode||!i.withSideBar),label:i.translateService.instant("hcm.payroll.edit"),command:function(){e.index=t,i.bankAccountItemInput={currentItem:e,listData:i.listDataNoPage,isEditMode:!0},i.visible=!0}},{visible:!i.isEditMode,label:i.translateService.instant("hcm.payroll.delete"),command:function(){i.loading=!0,i.deleteAnnuityItem(t)}}]},this.createFormGroup()}return e.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalBankAccountList)},e.prototype.createFormGroup=function(){this.historicalBankAccountList=this.formBuilder.group({historicalBankAccountList:this.formBuilder.control(null)})},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.onLazyLoad=function(e){var t=this,n=e&&e.first?e.first:0,o=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalBankAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){t.orderBy.field=e.field,t.orderBy.direction=1===e.order?ue.ASC:ue.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=U(r),this.listData.sort(at(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+o)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},e.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var e=document.getElementsByClassName("row0");e&&e[0]&&(e[0].className="refresh")}),1)},e.prototype.add=function(){this.bankAccountItemInput={},this.visible=!0},e.prototype.deleteAnnuityItem=function(e){var t=U(this.getHistoricalBankAccountList());t.sort(at(this.orderBy.field,this.orderBy.direction)),delete t[e],t=t.filter((function(e){return e})),this.historicalBankAccountList.get("historicalBankAccountList").setValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},e.prototype.getHistoricalBankAccountList=function(){return this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value&&this.historicalBankAccountList.get("historicalBankAccountList").value.length?this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value:[]},e.prototype.addItemInList=function(e){var t=e&&e.index>=0?e.index:null,n=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[];if(null!=t)n[t]=e,delete e.index;else{if(Ye(e.customFields)&&Object.keys(e.customFields).length){var o=Xe(e.customFields);e.customFields=U(o)}e.dateWhen=this.dateWhen,n.push(e)}this.historicalBankAccountList.get("historicalBankAccountList").setValue(n),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(t,n)})},e.prototype.getNumberPageByIndex=function(e,t){if(e){var n=t.length,o=this.recordByRow-1;return Math.ceil(n/this.recordByRow)*this.recordByRow-o-1}return null},e.prototype.verifyTotalPercentage=function(){var e=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[],t=[];if(!e.length)return this.msgTotalLimitByPercentage=null;e.filter((function(e){return t.push(e&&e.percentage)}));var n=t.reduce((function(e,t){return e+t}),0);this.msgTotalLimitByPercentage=100===n?this.translateService.instant("hcm.payroll.historical_bank_account_msg_limit_total_by_percentage"):null},Object.defineProperty(e.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateWhen?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dateWhen",{get:function(){return this._dateWhen},set:function(e){var t=this;this._dateWhen=e,this._dateWhen&&this.listData.filter((function(e){return e.dateWhen=t._dateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayDateWhen",{get:function(){return this._displayDateWhen},set:function(e){var t=this;this._displayDateWhen=e,this._displayDateWhen&&this.listData.filter((function(e){return e.displayDateWhen=t._displayDateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addListData",{set:function(e){this.loading=!0,this.historicalBankAccountList.get("historicalBankAccountList").patchValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.visible=!1},e.decorators=[{type:t.Component,args:[{selector:"c-historical-bank-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_bank_account_title_form\'|translate}}">\n<bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar">\n <bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_bank_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-s\'" *ngIf="showDateWhen">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-m\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n *ngIf="showDateWhen"\n [pSortableColumn]="\'displayDateWhen\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.historical_bank_account_label_date_when\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bank\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankBranch\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank_branch\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'accountType\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankAccount\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'digit\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_digit\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td *ngIf="showDateWhen" [pTooltip]="rowData?.displayDateWhen" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.displayDateWhen }}</span>\n </td>\n <td [pTooltip]="rowData?.bank?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bank?.name }}</span>\n </td>\n <td [pTooltip]="rowData?.bankBranch?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankBranch?.name }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.accountType?.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.accountType?.value }}</span>\n </td>\n <td [pTooltip]="rowData?.bankAccount" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankAccount }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.digit" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.digit }}</span>\n </td>\n <td [pTooltip]="rowData?.percentage" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.percentage }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]}]}],e.ctorParameters=function(){return[{type:I.ConfirmationService},{type:i.TranslateService},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef},{type:n.FormBuilder}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!1}]}],formGroup:[{type:t.Input}],fieldFormGroup:[{type:t.Input}],_dateWhen:[{type:t.Input}],_displayDateWhen:[{type:t.Input}],recordByRow:[{type:t.Input}],showDateWhen:[{type:t.Input}],msgTooltipAdd:[{type:t.Input}],isEditMode:[{type:t.Input}],isViewMode:[{type:t.Input}],currency:[{type:t.Input}],customEntity:[{type:t.Input}],customService:[{type:t.Input}],withSideBar:[{type:t.Input}],dateWhen:[{type:t.Input}],displayDateWhen:[{type:t.Input}],addListData:[{type:t.Input}],visible:[{type:t.Input}]},e}();var _n=function(){function e(e,o,r,a){this.translate=e,this.formBuilder=o,this.route=r,this.cd=a,this.withSideBar=!0,this.isEditMode=!1,this.visibleChange=new t.EventEmitter,this.bankAccountItemToList=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[n.Validators.required,n.Validators.min(.01)],this.initialValidatorOfBankAccount=[n.Validators.required,n.Validators.maxLength(12)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.createFormGroup(),this.registerSubjects()}return e.prototype.validateDuplicateBankAccount=function(e,t,n,o){return function(r){var a=r&&r.value,i=!1;return e.filter((function(e,r){if(r!=e.index&&a&&e.bank&&e.bank.tableId===n&&e.bankBranch&&e.bankBranch.tableId===o&&e.accountType&&e.accountType.key===t&&Number(e.bankAccount)===Number(a))return i=!0})),i?{bankAccountDuplicate:!0}:null}},e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},e.prototype.registerSubjects=function(){},e.prototype.createFormGroup=function(){this.bankAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateWhen:this.formBuilder.control(null),displayDateWhen:this.formBuilder.control(null),bank:this.formBuilder.control(null,n.Validators.required),bankBranch:this.formBuilder.control(null,n.Validators.required),accountType:this.formBuilder.control(null,n.Validators.required),bankAccount:this.formBuilder.control(null,n.Validators.compose(U(this.initialValidatorOfBankAccount))),digit:this.formBuilder.control(null,n.Validators.maxLength(3)),percentage:this.formBuilder.control(null,n.Validators.compose(U(this.initialValidatorOfPercentage,[n.Validators.max(this.maxValuePercentage)]))),customFields:this.formBuilder.control(null)})},e.prototype.onSelectBank=function(){this.cleanBankInformation(),this.beforeSetBankAccountValidator()},e.prototype.onClearBank=function(){this.bankAccountFormGroup.get("bank").reset(),this.cleanBankInformation(),this.beforeSetBankAccountValidator()},e.prototype.cleanBankInformation=function(){it(this.bankAccountFormGroup,["bankBranch"])},e.prototype.onClearBankBranch=function(){this.bankAccountFormGroup.get("bankBranch").reset(),this.beforeSetBankAccountValidator()},e.prototype.onClearAccountType=function(){this.bankAccountFormGroup.get("accountType").reset(),this.beforeSetBankAccountValidator()},Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEditAndViewValue",{set:function(e){this.resetForm(),this.visibleBtnSave=!0,e&&e.currentItem&&Object.keys(e.currentItem).length?(this.bankAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(B({},e.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(e.listData,e.currentItem.index),this.isView||this.configEnableFields(e&&e.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),e.prototype.convertDTOToShowWithCustomFields=function(e){var t=B({},e);return t.customFields=Ze(t.customFields),t},e.prototype.configEnableFields=function(e){this.visibleBtnSave=e,nt(this.bankAccountFormGroup,e,["bank","bankBranch","accountType","bankAccount","digit","percentage","customFields"],[])},e.prototype.close=function(){this.resetForm(),this.visible=!1},e.prototype.addItem=function(){this.bankAccountFormGroup.updateValueAndValidity(),et.call(this.bankAccountFormGroup),this.bankAccountFormGroup.valid&&(this.employeeId&&this.bankAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.bankAccountItemToList.emit(this.bankAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},e.prototype.resetForm=function(){this.bankAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},e.prototype.getBankTableId=function(){return this.bankAccountFormGroup.controls.bank.value?"'"+this.bankAccountFormGroup.controls.bank.value.tableId+"'":null},Object.defineProperty(e.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsPercentage",{get:function(){return B({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),e.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(e.prototype,"getListBankAccount",{set:function(e){e?this.setValidatorsAccordingList(e):this.resetForm()},enumerable:!0,configurable:!0}),e.prototype.setValidatorsAccordingList=function(e,t){void 0===t&&(t=null),this.bankAccountList=e&&e.length?U(e):[];var n=[];this.bankAccountList&&this.bankAccountList.length&&this.bankAccountList.filter((function(e,o){e.percentage&&o!=t&&n.push(e.percentage)})),this.beforeSetBankAccountValidator(),this.validatePercentageValid(n)},e.prototype.beforeSetBankAccountValidator=function(){var e=this.bankAccountFormGroup.get("bankAccount"),t=this.bankAccountFormGroup.get("accountType")&&this.bankAccountFormGroup.get("accountType").value&&this.bankAccountFormGroup.get("accountType").value.key,o=this.bankAccountFormGroup.get("bank")&&this.bankAccountFormGroup.get("bank").value&&this.bankAccountFormGroup.get("bank").value.tableId,r=this.bankAccountFormGroup.get("bankBranch")&&this.bankAccountFormGroup.get("bankBranch").value&&this.bankAccountFormGroup.get("bankBranch").value.tableId;o&&r&&t&&this.bankAccountList&&this.bankAccountList.length?(e.setValidators(n.Validators.compose(U(this.initialValidatorOfBankAccount,[this.validateDuplicateBankAccount(this.bankAccountList,t,o,r)]))),e.updateValueAndValidity()):e.setValidators(n.Validators.compose(U(this.initialValidatorOfBankAccount)))},e.prototype.validatePercentageValid=function(e){var t=this.bankAccountFormGroup.get("percentage");this.maxValuePercentage=e.reduce((function(e,t){return e-t}),100),t.setValidators(n.Validators.compose(U(this.initialValidatorOfPercentage,[n.Validators.max(this.maxValuePercentage)]))),t.updateValueAndValidity()},Object.defineProperty(e.prototype,"isViewMode",{set:function(e){this.isView=!(!e||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"bank-account",template:'<div id="main">\n <form [formGroup]="bankAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Banco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank\' | translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="Bank"\n [order]="[\'BankCode\',\'BankNameI18n\']"\n [fields]="[\'BankCode\',\'BankNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankCode" keyName="BankNameI18n"\n itemSelect="bank" name="bank"\n [form]="bankAccountFormGroup"\n (onSelect)="onSelectBank()"\n (onClear)="onClearBank()"\n id="ta-bankName"></input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bank\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Agência--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank_branch\'|translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="BankBranch"\n [order]="[\'BankBranchCode\']"\n [fields]="[\'BankBranchCode\',\'BankBranchNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankBranchCode" keyName="BankBranchNameI18n"\n itemSelect="bankBranch" name="bankBranch"\n [conditions]="[{ \'fields\': [\'BankBranchBank\'], \'expression\' : \'EQUAL\', \'value\': getBankTableId() }]"\n [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-bankBranch">\n </input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankBranch\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!-- Tipo conta --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_account_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="AccountType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="accountType" [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-accountType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="bankAccountFormGroup.get(\'accountType\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Número conta--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_account_form\' |\n translate}}</label>\n <input pInputText id="ta-bankAccount" name="bankAccount" only-number\n formControlName="bankAccount"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankAccount\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n bankAccountDuplicate: \'hcm.payroll.historical_bank_account_label_bank_account_duplicate\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'12\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12">\n <label>{{\'hcm.payroll.historical_bank_account_label_digit\'|translate}}</label>\n \x3c!--Dígito--\x3e\n <input pInputText id="ta-digit" name="digit" only-number formControlName="digit"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'digit\')"\n [errorMessages]="{ maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'3\' } }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="bankAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:n.FormBuilder},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!0}]}],currency:[{type:t.Input}],customEntity:[{type:t.Input}],customService:[{type:t.Input}],withSideBar:[{type:t.Input}],isEditMode:[{type:t.Input}],visibleChange:[{type:t.Output}],bankAccountItemToList:[{type:t.Output}],visible:[{type:t.Input}],isEditAndViewValue:[{type:t.Input}],getListBankAccount:[{type:t.Input}],isViewMode:[{type:t.Input}]},e}();var wn=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Dn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,ae,h.ControlErrorsModule,It,L.CurrencyMaskModule,ut,d.InputTextModule,ce,O.FieldsetModule,h.CustomFieldsModule,R.PanelModule],declarations:[Sn,_n],providers:[wn,I.ConfirmationService],exports:[Sn]}]}],e}(),Cn=function(){function e(e,t){this.http=e,this.httpClient=t}return e.prototype.remove=function(e,t,n,o){return void 0===n&&(n=he.PAYROLL),n===he.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalJudicialPensionBankAccountDelete",{dependentId:o,dateWhen:t}):this.http.post("actions/historicalEmployeeBankAccountDelete",{employeeId:e,dateWhen:t})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe},{type:v.HttpClient}]},e}();var En=y,Tn=function(){function e(e,n,o,r,a,i,s){this.confirmationService=e,this.translateService=n,this.activatedRoute=o,this.cd=r,this.router=a,this.messageService=i,this.historicalBankAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeeBankAccountQuery",this.keyPayload="historicalEmployeeBankAccount",this.withSidebar=!0,this.enableView=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"dateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_qtd_account"),field:"numberOfBankAccount"}]}return e.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.onLazyLoad=function(e){var t=this;e.forEach((function(e){e.dateWhen=En(e.dateWhen).format(t.dateFormat)})),this.onGridLoad(e),this.loading=!1},e.prototype.getMenuActions=function(e){var t=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){var n=e&&e.dateWhen&&En(e.dateWhen,t.dateFormat).format("YYYY-MM-DD");t.withSidebar?t.router.navigate(["historical-bank-account/"+n],{relativeTo:t.activatedRoute}):t.enableView.emit(n)}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){t.isAllowToDeleteHistorical&&e?t.delete(e.id,e.dateWhen):t.messageService.add({severity:"error",summary:t.translateService.instant("hcm.payroll.error"),detail:t.translateService.instant("hcm.payroll.permission_error_not_allowed")})}}]},e.prototype.delete=function(e,t){var n=this;if(e===this.lastRecord.id){var o=En(t,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?he.PAYROLL:he.DEPENDENT;n.historicalBankAccountListService.remove(n.employeeId,o,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_remove")}),n.parameters=n.parameters&&B({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},e.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-irrf-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},e.prototype.onGridLoad=function(e){e&&e.length&&(this.lastRecord=e[0])},Object.defineProperty(e.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reloadList",{set:function(e){e&&(this.loading=!0,this.parameters=this.parameters&&B({},this.parameters)||{})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-historical-bank-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-irrf"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:I.ConfirmationService},{type:i.TranslateService},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef},{type:a.Router},{type:I.MessageService},{type:Cn}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!1}]}],permission:[{type:t.Input}],employeeId:[{type:t.Input}],dependentId:[{type:t.Input}],dateFormat:[{type:t.Input}],endPoint:[{type:t.Input}],keyPayload:[{type:t.Input}],withSidebar:[{type:t.Input}],enableView:[{type:t.Output}],reloadList:[{type:t.Input}]},e}();var Fn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,ge,x.ConfirmDialogModule],declarations:[Tn],providers:[Cn],exports:[Tn]}]}],e}(),Pn=function(){function e(e){this.field=e.field,this.value=e.value,this.operation=e.operation}return Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){return this._operation},set:function(e){this._operation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.operation===de.CONTAINING?this.operation+"(lower("+this.field+"), lower("+this.value+"))":this.field+" "+(this.operation||"")+" "+this.value},e}();var Mn=y,An=Mn("31/12/1900","DD/MM/YYYY"),Ln=Mn("04/06/2080","DD/MM/YYYY"),On=function(){function e(){}return e.isValidDate=function(e,t){return function(n){var o=!t||!t.hasOwnProperty("useG5DateRange")||t.useG5DateRange,r=lt(n.value);if(e=lt(e),r&&e&&r.length===e.length&&!n.value.includes("_")){var a=Mn(r,e),i=a.isValid(),s=!o||a.isBetween(An,Ln,null,"[]");return i&&s?null:{invalidDate:!0}}return null}},e.isDateLower=function(e,t,n){void 0===n&&(n="day");var o={compareName:"lowerDate",granularity:n};return this.isValidDateCompare(e,t,me.isBefore,o)},e.isValidDateCompare=function(e,t,n,o){var r=this;return function(a){var i=lt(a.value);if(t=lt(t),i&&t&&i.length===t.length&&!a.value.includes("_")){var s=Mn(i,t),l=Mn(e,t);return r.dateCompare(s,l,n,o)}return null}},e.getDateFormatFromLocale=function(e,t){var n=e&&e.dateFormat;if(n){var o=n.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return t&&(o=o.replace("DD","")),o}return null},e.getDateTimeFormatFromLocale=function(e){if(e){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase(),t+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,t,n,o){var r=n===me.isNotSame?me.isSame:n,a=o&&o.granularity?o.granularity:"day",i=e[r](t,a);if(i=n===me.isNotSame?!i:i){var s={};return s[o&&o.compareName?o.compareName:n]=!0,s}return null},e.getFormatDateWithBar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}();var Rn=function(){function e(){this._processVariables={},this._workflowPayload={},this.processInstanceId=new f.BehaviorSubject(null),this.resetActions()}return e.prototype.init=function(){var e=this;this.workflowCockpit=workflowCockpit({init:function(t,n){return N(e,void 0,void 0,(function(){var e,o,r;return j(this,(function(a){switch(a.label){case 0:return this._isRequestNew=n&&n.isRequestNew(),e=this,(o=n)?[4,n.getTaskData()]:[3,2];case 1:o=a.sent(),a.label=2;case 2:return e._taskData=o,this._isRequestNew?[3,4]:[4,n.getInfoFromProcessVariables()];case 3:r=a.sent(),this.addProcessVariable("processVariablesFromWorkflow",r),a.label=4;case 4:return this.processInstanceId.next(t.processInstanceId),[4,this._onLoadWorkflow(t,n)];case 5:return[2,a.sent()]}}))}))},onSubmit:function(t,n){return N(e,void 0,void 0,(function(){var e,o;return j(this,(function(r){switch(r.label){case 0:return e=this,(o=t)?[4,t.nextAction]:[3,2];case 1:o=r.sent(),r.label=2;case 2:return e._nextAction=o,this._isFinishing=this._nextAction.finish,this._nextActionName=this._nextAction.name,[4,this._onSubmitWorkflow(t,n)];case 3:return r.sent(),[2,this._workflowPayload]}}))}))},onError:function(t,n){return N(e,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._onRollbackWorkflow(t,n)];case 1:return e.sent(),[2]}}))}))}})},e.prototype._onLoadWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onLoadActions)];case 1:return[2,e.sent()]}}))}))},e.prototype._onSubmitWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onSubmitActions)];case 1:return[2,e.sent()]}}))}))},e.prototype._onRollbackWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onRollbackActions)];case 1:return[2,e.sent()]}}))}))},e.prototype.resetActions=function(){this.onLoadActions={},this.onSubmitActions={},this.onRollbackActions={}},e.prototype._runActions=function(e){return N(this,void 0,void 0,(function(){var t,n=this;return j(this,(function(o){switch(o.label){case 0:return t={},[4,Promise.all(Object.entries(e).map((function(e){var o=V(e,2),r=o[0],a=o[1];return N(n,void 0,void 0,(function(){var e,n,o;return j(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=t,n=r,[4,a()];case 1:return e[n]=i.sent(),[2];case 2:throw o=i.sent(),Error(o);case 3:return[2]}}))}))})))];case 1:return o.sent(),[2,t]}}))}))},e.prototype.addOnLoadAction=function(e,t){this.onLoadActions[e]=t},e.prototype.addOnSubmitAction=function(e,t){this.onSubmitActions[e]=t},e.prototype.addOnRollbackAction=function(e,t){this.onRollbackActions[e]=t},e.prototype.addProcessVariable=function(e,t){try{this._processVariables[e]=t}catch(t){throw{erro:t,message:"Não foi possível adicionar a variável "+e+" às variáveis do processo."}}},e.prototype.setWorkflowPayload=function(e){this._workflowPayload=e},Object.defineProperty(e.prototype,"loadActions",{get:function(){return this.onLoadActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"submitActions",{get:function(){return this.onSubmitActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rollbackActions",{get:function(){return this.onRollbackActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRequestNew",{get:function(){return this._isRequestNew},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFinishing",{get:function(){return this._isFinishing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextActionName",{get:function(){return this._nextActionName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"taskData",{get:function(){return this._taskData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processVariables",{get:function(){var e=this;return new Promise((function(t,n){e._processVariables?t(e._processVariables):n("Não foram encontradas variáveis para o processo")})).then((function(t){e._processVariables=t})).catch((function(e){throw e})),this._processVariables},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var xn=function(){function e(e,t,n){this.router=e,this.activatedRoute=t,this.workflowDataService=n,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.registerSubscribers()},e.prototype.registerSubscribers=function(){var e=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.useWorkflow=!(!t||!t.useWorkflow),e.routeEndpoint=t&&t.routeEndpoint,e.useWorkflow&&e.workflowDataService.setUseWorkflow(e.useWorkflow)}))},e.prototype.onSelectEmployee=function(){var e=this.employeeSelected.tableId;e&&this.navigate(e)},e.prototype.navigate=function(e){this.router.navigate(["workflow/"+e+"/"+this._routeEndpoint])},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},Object.defineProperty(e.prototype,"useWorkflow",{get:function(){return this._useWorkflow},set:function(e){this._useWorkflow=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"routeEndpoint",{get:function(){return this._routeEndpoint},set:function(e){this._routeEndpoint=e},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"lib-employee-selector",template:'<p-panel header="{{ \'hcm.payroll.employee_selector_panel_header\' | translate }}">\n <div class="ui-g ui-fluid">\n <div class="ui-md-6 ui-g-6">\n <label for="ff-employee" id="lb-employee">{{\n "hcm.payroll.employee" | translate\n }}</label>\n <input-rest-auto-complete-employee-model\n id="ff-employee"\n [dropdown]="true"\n placeholder="{{\n \'hcm.payroll.employees_company_placeholder\' | translate\n }}"\n name="employee"\n emptyMessage="{{ \'hcm.payroll.not_suggestions\'|translate }}"\n [(model)]="employeeSelected"\n (onSelect)="onSelectEmployee()"\n >\n </input-rest-auto-complete-employee-model>\n </div>\n </div>\n</p-panel>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:a.Router},{type:a.ActivatedRoute},{type:en}]},e}();var Bn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[X,R.PanelModule,gt],declarations:[xn],exports:[xn]}]}],e}(),Nn=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"from-to",template:'<div id="from-to" class="ui-g ui-fluid" *ngIf="divergentFormData">\n <div class="ui-g-12">\n \x3c!-- Painel Collapsable --\x3e\n <p-panel\n class="ui-g-12 ui-fluid form-group"\n header="{{ \'hcm.payroll.disagreements\' | translate }}"\n [toggleable]="true"\n [collapsed]="false"\n >\n <section id="from-to-content" class="ui-g ui-fluid form-group">\n \x3c!-- INICIO DE SEÇÃO: DE (ANTES): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.from\' | translate }}">\n <section id="from-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-from">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-from"\n id="{{divergence.key}}-from"\n value="{{ divergence.oldValue }}"\n />\n\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: DE (ANTES): --\x3e\n\n \x3c!-- INICIO DE SEÇÃO: PARA (DEPOIS): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.to\' | translate }}">\n <section id="to-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-to">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-to"\n id="{{divergence.key}}-to"\n value="{{ divergence.newValue }}"\n />\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: PARA (DEPOIS): --\x3e\n </section>\n </p-panel>\n </div>\n</div>\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={divergentFormData:[{type:t.Input}]},e}();var jn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,R.PanelModule,i.TranslateModule,n.ReactiveFormsModule,d.InputTextModule],declarations:[Nn],exports:[Nn]}]}],e}();e.AdmissionDraftSummaryComponent=_e,e.AdmissionDraftSummaryModule=we,e.AdmissionDraftSummaryService=Se,e.AutocompleteParametersService=Wt,e.BlockUiComponent=Q,e.BlockUiModule=K,e.BreadcrumbComponent=J,e.BreadcrumbSDSModule=Z,e.CNPJValidator=H,e.CPFValidator=Y,e.CompanyIndicationType={USE_DEPENDENTS:"USE_DEPENDENTS",VACCINATION_FREQUENCY:"VACCINATION_FREQUENCY",APPORTIONMENT_CALCULATION:"APPORTIONMENT_CALCULATION",USE_WORKSTATION_GROUP_EMPLOYEE:"USE_WORKSTATION_GROUP_EMPLOYEE",STRUCTURE:"STRUCTURE",PAY_ANNUITY:"PAY_ANNUITY",USE_HISTORICAL_BANK_ACCOUNT:"USE_HISTORICAL_BANK_ACCOUNT"},e.CompanyIndicationsService=Vt,e.CompareType=me,e.ControlMessagesErrorComponent=ee,e.ControlMessagesErrorModule=te,e.CoreDirectives=ce,e.CoreFieldType=pe,e.CustomFieldsComponent=ne,e.CustomFieldsModule=ie,e.DataListModule=cn,e.DataListRestModule=ge,e.DateValidator=On,e.DirectionEnumeration=ue,e.EmployeeSelectorComponent=xn,e.EmployeeSelectorModule=Bn,e.EmployeeSummaryComponent=Ie,e.EmployeeSummaryModule=ke,e.EmployeeSummaryService=be,e.EntityODataParameter=Pn,e.ErrorPageComponent=De,e.ErrorPageModule=Ce,e.FieldValidatorComponent=Ee,e.FieldValidatorModule=Te,e.FileUploadComponent=Ae,e.FileUploadCoreModule=Le,e.FormComparatorService=tn,e.FromToComponent=Nn,e.FromToModule=jn,e.HistoricalBankAccountComponent=Sn,e.HistoricalBankAccountListComponent=Tn,e.HistoricalBankAccountListModule=Fn,e.HistoricalBankAccountListService=Cn,e.HistoricalBankAccountModule=Dn,e.HistoricalBankAccountService=wn,e.HttpClientService=Pe,e.HttpRequestType={POST:"post",GET:"get"},e.ImageCropComponent=Re,e.ImageCropModule=xe,e.ImageCropService=Oe,e.InputDateComponent=re,e.InputDateModelComponent=Ne,e.InputDateModelModule=je,e.InputDateModule=ae,e.InputRestAutoCompleteComponent=pt,e.InputRestAutoCompleteEmployeeModelModule=gt,e.InputRestAutoCompleteEmployeeModelService=yt,e.InputRestAutoCompleteEmployeeModule=ht,e.InputRestAutoCompleteEmployeeService=dt,e.InputRestAutoCompleteEnumComponent=vt,e.InputRestAutoCompleteEnumModule=It,e.InputRestAutoCompleteEnumService=bt,e.InputRestAutoCompleteJobpositionComponent=Tt,e.InputRestAutoCompleteJobpositionModule=Ft,e.InputRestAutoCompleteJobpositionService=Et,e.InputRestAutoCompleteModelEnumModule=Ct,e.InputRestAutoCompleteModelEnumService=wt,e.InputRestAutoCompleteModelModule=_t,e.InputRestAutoCompleteModelService=kt,e.InputRestAutoCompleteModule=ut,e.InputRestAutoCompleteService=ct,e.IntegrationService=Ut,e.ListRestComponent=Mt,e.ListRestModule=At,e.LookupModule=mn,e.LookupParametersService=Gt,e.MenuType={DEFAULT:"DEFAULT",ACTION:"ACTION"},e.ModuleType={MANAGEMENT_PANEL:"MANAGEMENT_PANEL",PERFORMANCE_MANAGEMENT:"PERFORMANCE_MANAGEMENT",CAREER_SUCCESSION:"CAREER_SUCCESSION",RECRUIT_MANAGEMENT:"RECRUIT_MANAGEMENT",REMUNERATION_MANAGEMENT:"REMUNERATION_MANAGEMENT",DEVELOPMENT_MANAGEMENT:"DEVELOPMENT_MANAGEMENT",PAYROLL:"PAYROLL",APP:"APP",MOODS:"MOODS"},e.NameNotSpacesDirective=se,e.OnlyNumberDirective=le,e.Operators=de,e.ParameterType={STRING:"String",INTEGER:"Integer",DOUBLE:"Double",BOOLEAN:"Boolean",DATE:"Date",DATETIME:"DateTime",TIME:"Time",OBJECT:"Object"},e.PermissionService=on,e.ReportFormat={PDF:"Pdf",CSV:"Csv",HTML:"Html",XLS:"Xls",XLSX:"Xlsx",XML:"Xml",ODT:"Odt",RTF:"Rtf"},e.ReportService=Zt,e.ReportStage={STARTING:"Starting",COMPILING:"Compiling",FILLING:"Filling",EXPORTING:"Exporting",DONE:"Done",CANCELLED:"Cancelled",GENERATED:"Generated",ERROR:"Error"},e.ServiceType=he,e.ServicesModule=nn,e.SpinnerLoaderComponent=Lt,e.SpinnerLoaderModule=Ot,e.StringMethods=z,e.ToastComponent=rn,e.ToastModule=an,e.ToastService=Fe,e.TypeAdmissionModule=xt,e.TypeAdmissionServices=Rt,e.UsingType={TYPE_1:"TYPE_1",TYPE_2:"TYPE_2",TYPE_3:"TYPE_3",TYPE_4:"TYPE_4",TYPE_6:"TYPE_6",TYPE_7:"TYPE_7",TYPE_8:"TYPE_8",TYPE_9:"TYPE_9",TYPE_10:"TYPE_10",TYPE_11:"TYPE_11",TYPE_12:"TYPE_12",TYPE_14:"TYPE_14",TYPE_15:"TYPE_15",TYPE_16:"TYPE_16",TYPE_17:"TYPE_17",TYPE_18:"TYPE_18",TYPE_19:"TYPE_19",TYPE_20:"TYPE_20",TYPE_21:"TYPE_21"},e.WorkflowDataService=en,e.WorkflowIntegrator=Rn,e.WorkstationgroupLookupDto=bn,e.WorkstationgroupLookupModule=kn,e._moment=Je,e.assign=function e(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(!n.length)return t;var r=n.shift();if(Ve(t)&&Ve(r)){var a=function(n){var o,a,i,s;Ve(r[n])?(t[n]||Object.assign(t,((o={})[n]={},o)),e(t[n],r[n])):Ue(r[n])?Object.assign(t,((a={})[n]=r[n],a)):(t[n]||Object.assign(t,((i={})[n]=[],i)),Object.assign(t,((s={})[n]=r[n].map((function(o,r){return e(t[n][r]||{},o)})),s)))};for(var i in r)a(i)}return e.apply(void 0,U([t],n))},e.autoCompleteObjectForIdObject=function(e){return Ve(e)?(e.hasOwnProperty("tableId")&&console.error("Paramentro não é um objeto Auto Complete válido, falta tableId"),Ye(e.tableId)||console.error("tableId esta vazio"),{id:e.tableId}):(console.error("Paramentro não é um objeto"),!1)},e.clearValues=it,e.cnpjValidator=W,e.compareValues=at,e.configEnabledFields=nt,e.containsMoreThanOneConsecutiveAbbreviation=function(e){return!/(\b.\s)(.\s)(.\b)\1?/g.test(e)},e.containsMoreThanOneConsecutiveBlankSpace=function(e){return!/(\w[ ]{2,}\w)/.test(e)},e.containsMoreThanTwoRepeatedCharacters=function(e){return!/([a-zA-Z])\1{2}/g.test(e)},e.containsSpecialCharacters=function(e){return!/[[\]!@#$%&*_+=`´{}^~<>.,:;?|()\/\\-]/.test(e)},e.convertBooleanString=function(e){return"boolean"==typeof e?!0===e?"true":"false":e},e.convertStringToBoolean=function(e){return!0===e||"true"===e.toLowerCase()},e.cpfValidator=G,e.firstNameIsValid=function(e){var t=e.split(" ");return t.length>=2&&t[1].length>=1},e.firstNameLengthIsValid=function(e){var t=e.split(" ");return!(t[0].trim().length>0)||t[0].trim().length>=2},e.formatMoney=function(e,t){switch(void 0===t&&(t="EN"),t){case"EN":return Ye(e)?e.toString().replace(".","").replace(",","."):"";case"BR":return Ye(e)?e.toString().replace(".",",").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1."):"";default:return Ye(e)?e.toString().replace(".","").replace(",","."):""}},e.fullNameLengthIsValid=function(e){return e.length<=70},e.getAddWeekDaysBusiness=function(e,t){return E.addWeekDays(Ke(e),t).format("DD/MM/YYYY")},e.getFormat=st,e.getFormatDate=$e,e.getMoment=Ke,e.getNowDate=Qe,e.getObjValids=function(e){var t=Object.assign({},e),n={};return Object.keys(t).map((function(e){Ye(t[e])&&(n[e]=We(e,t[e]))})),n},e.getQueryParams=function(e){e=e.split("+").join(" ");for(var t,n={},o=/[?&]?([^=]+)=([^&]*)/g;t=o.exec(e);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},e.getWeekDaysBusiness=function(e,t){var n=t?Ke(t):Ke(e).endOf("month");return E.weekDays(Ke(e),n)},e.getYears=function(e){return qe().diff(e,"years",!1)},e.invertFieldDate=ze,e.isBirthDayValid=function(e,t){if(e&&t)return t.isSameOrAfter(e)},e.isDateCompare=function(e,t,n){return!(e&&e.isValid()&&t&&n)||e[n](t)},e.isDateExpirationBeforeExpeditionDate=function(e,t){if(e&&t)return t.isSameOrAfter(e)},e.isDateField=We,e.isDateSameOrAfterCurrentDate=function(e){if(e){var t=Bt();return e.isSameOrAfter(t)}},e.isFullDate=He,e.isMax=function(e,t){return e.length<=t},e.isNumber=Nt,e.isObject=Ve,e.isRequired=function(e){return null!=e&&e.length>0},e.isShallow=Ue,e.isValid=Ye,e.isValidDate=Ge,e.isValidPIS=function(e){var t=0,n=0,o=e.replace(/[^\d]+/g,"");if(11!==o.length||"00000000000"===o||"11111111111"===o||"22222222222"===o||"33333333333"===o||"44444444444"===o||"55555555555"===o||"66666666666"===o||"77777777777"===o||"88888888888"===o||"99999999999"===o)return!1;for(var r=0;r<10;r++)t+=parseInt(o.substring(r,r+1))*parseInt("3298765432".substring(r,r+1));return(n=10===(n=11-t%11)||11===n?0:n)===parseInt(""+o.charAt(10))},e.mountCustomForSave=function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=null);var o=[];return t&&e.length&&t.map((function(t,r){var a=Object.keys(e[r]).toString(),i=Ye(e[r][a])?e[r][a]:null,s="date"===t.type&&n&&Ye(i)?qe(i,st(n)).format("YYYY-MM-DD"):i;o.push({field:a,value:s})})),o.length?o:null},e.mountCustomForShow=function(e){var t=[];return Object.keys(e||{}).forEach((function(n){"date"===e[n].type&&e[n].value&&(e[n].value=Je(e[n].value).format("L")),t.push(e[n])})),t},e.mountCustomToSave=Xe,e.mountCustomToShow=Ze,e.mountGeneratedCustomToSave=function(e){return Object.entries(e).forEach((function(t){var n=V(t,2),o=n[0];n[1]||delete e[o]})),e},e.ngCalendarFormat=function(e,t){if(void 0===t&&(t="DD/MM/YYYY"),Ge(e))return"string"==typeof e?e:Je(e).format(t)},e.notEmpty=jt,e.numberOrZero=qt,e.removeCharacteresSpecials=lt,e.removeEmpty=function e(t){return Object.keys(t).forEach((function(n){return t[n]&&"object"==typeof t[n]&&e(t[n])||!t[n]&&void 0!==t[n]&&delete t[n]})),t},e.removeWhiteSpaces=function(e){return e&&String(e)?String(e).replace(/\s/g,""):String(e)},e.setCustonFields=function(e){var t=this;return e.map((function(e){var o={},r=e.value||null;"boolean"==typeof r&&(r=r?"true":"false"),o[e.field]=new n.FormControl(r),t.push(new n.FormGroup(o))})),e},e.setDisableField=rt,e.setErrors=function(e,t,n){var o=this;setTimeout((function(){var r;n?((r=Object.assign({},o.get(e).errors))[t]=n,o.get(e).setErrors(r)):(r=o.get(e).errors)&&Object.keys(r).length&&(delete r[t],Object.keys(r).length||o.get(e).setErrors(null))}),0)},e.setRequired=tt,e.setRequiredFields=function(e,t,o){t?o.forEach((function(t){return tt(e,t,!0,[n.Validators.required])})):o.forEach((function(t){return tt(e,t,!1)}))},e.setValidator=ot,e.setValidatorsAndDisableFields=function(e,t){t.forEach((function(t){ot(e,t.field,t.validators),rt(e,t.disabled,t.field,t.clearValue)}))},e.setValueCustom=function(e,t){var n=t?Object.keys(t).length:0;return e.map((function(e){e.value=n>0?t[e.field]:null})),e},e.stringMethods=$,e.sun=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return qt(t)+e}),0)},e.uiid=function(){return(new C).guid().replace(/[^a-zA-Z0-9.]/g,"").toUpperCase()},e.validateBirthDate=function(e,t){if(e&&t){var n=Bt("string"==typeof e?e.replace(/[^\d]+/g,""):e,"DDMMYYYY").format("YYYY-MM-DD").toString(),o=Bt(t.replace(/[^\d]+/g,""),"DDMMYYYY").format("YYYY-MM-DD").toString();return Bt(o).isSameOrAfter(n)}},e.verifyValidationsForm=et,e.ɵa=X,e.ɵb=fe,e.ɵc=ye,e.ɵd=Me,e.ɵe=mt,e.ɵf=ft,e.ɵg=St,e.ɵh=Dt,e.ɵi=Pt,e.ɵj=ln,e.ɵk=sn,e.ɵl=dn,e.ɵm=pn,e.ɵn=In,e.ɵo=yn,e.ɵp=gn,e.ɵq=_n,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("primeng/blockui"),require("primeng/progressspinner"),require("@angular/router"),require("@ngx-translate/core"),require("rxjs/operators"),require("primeng/breadcrumb"),require("@angular/common"),require("primeng/dropdown"),require("primeng/inputmask"),require("primeng/inputtext"),require("primeng/shared"),require("@seniorsistemas/angular-components"),require("moment"),require("rxjs"),require("primeng/tooltip"),require("primeng/table"),require("@angular/common/http"),require("primeng/api"),require("@senior-gestao-pessoas/angular-components"),require("ng2-img-cropper"),require("primeng/button"),require("primeng/dialog"),require("primeng/fileupload"),require("chance"),require("moment-business"),require("primeng/autocomplete"),require("primeng/splitbutton"),require("primeng/components/common/messageservice"),require("@seniorsistemas/senior-platform-data"),require("primeng/toast"),require("ng2-currency-mask"),require("primeng/fieldset"),require("primeng/panel"),require("primeng/confirmdialog")):"function"==typeof define&&define.amd?define("@senior-gestao-pessoas/payroll-core",["exports","@angular/core","@angular/forms","primeng/blockui","primeng/progressspinner","@angular/router","@ngx-translate/core","rxjs/operators","primeng/breadcrumb","@angular/common","primeng/dropdown","primeng/inputmask","primeng/inputtext","primeng/shared","@seniorsistemas/angular-components","moment","rxjs","primeng/tooltip","primeng/table","@angular/common/http","primeng/api","@senior-gestao-pessoas/angular-components","ng2-img-cropper","primeng/button","primeng/dialog","primeng/fileupload","chance","moment-business","primeng/autocomplete","primeng/splitbutton","primeng/components/common/messageservice","@seniorsistemas/senior-platform-data","primeng/toast","ng2-currency-mask","primeng/fieldset","primeng/panel","primeng/confirmdialog"],t):t(((e=e||self)["senior-gestao-pessoas"]=e["senior-gestao-pessoas"]||{},e["senior-gestao-pessoas"]["payroll-core"]={}),e.ng.core,e.ng.forms,e.blockui,e.progressspinner,e.ng.router,e.core$1,e.rxjs.operators,e.breadcrumb,e.ng.common,e.dropdown,e.inputmask,e.inputtext,e.shared,e.angularComponents,e.moment_,e.rxjs,e.tooltip,e.table,e.ng.common.http,e.api,e.angularComponents$1,e.ng2ImgCropper,e.button,e.dialog,e.fileupload,e.chance,e.business,e.autocomplete,e.splitbutton,e.messageservice,e.seniorPlatformData,e.toast,e.ng2CurrencyMask,e.fieldset,e.panel,e.confirmdialog)}(this,(function(e,t,n,o,r,a,i,s,l,c,p,u,d,m,h,y,f,g,b,v,I,k,S,_,w,D,C,E,T,F,P,M,A,L,O,R,x){"use strict";E=E&&E.hasOwnProperty("default")?E.default:E;var B=function(){return(B=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function N(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{l(o.next(e))}catch(e){a(e)}}function s(e){try{l(o.throw(e))}catch(e){a(e)}}function l(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(i,s)}l((o=o.apply(e,t||[])).next())}))}function j(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=(r=i.trys).length>0&&r[r.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],o=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function q(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function V(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function U(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(V(arguments[t]));return e}var Y=function(){function e(){}return e.prototype.calcChecker1=function(e){for(var t=null,n=0;n<9;++n)t+=e.toString().charAt(n)*(10-n);var o=t%11;return o<2?0:11-o},e.prototype.calcChecker2=function(e){for(var t=null,n=0;n<10;++n)t+=e.toString().charAt(n)*(11-n);var o=t%11;return o<2?0:11-o},e.prototype.checkCPF=function(e){var t=e.replace(/\.|\-|\s/g,""),n=t.substring(0,9),o=t.substring(9,11);if(11!==t.length)return!1;for(var r=0;r<10;r++)if(""+n+o===Array(12).join(r.toString()))return!1;var a=this.calcChecker1(n),i=this.calcChecker2(n+""+a);return o.toString()===a.toString()+i.toString()},e}(),G=new Y,H=function(){function e(){}return e.prototype.checkCNPJ=function(e){var t=e;if(t){var n=void 0,o=void 0,r=void 0,a=void 0,i=void 0;if(14!==(t=t.replace(/[^\d]+/g,"")).length)return!0;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;n=t.length-2,o=t.substring(0,n),r=t.substring(n),a=0,i=n-7;for(var s=n;s>=1;s--)a+=o.charAt(n-s)*i--,i<2&&(i=9);if((a%11<2?0:11-a%11)!==Number(r.charAt(0)))return!1;n+=1,o=t.substring(0,n),a=0,i=n-7;for(s=n;s>=1;s--)a+=o.charAt(n-s)*i--,i<2&&(i=9);return(a%11<2?0:11-a%11)===Number(r.charAt(1))}return!0},e}(),W=new H,z=function(){function e(){this.addStringFormat()}return e.prototype.addStringFormat=function(){if(!String.prototype.hasOwnProperty("format")){var e={format:function(){for(var e=this,t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e}};Object.assign(String.prototype,e)}},e}(),$=new z,Q=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"block-ui",template:'<p-blockUI [blocked]="blocked">\n <p-progressSpinner [strokeWidth]="5"></p-progressSpinner>\n</p-blockUI>\n',styles:[".ui-widget-overlay{background:#ccc!important;opacity:.5!important}@-webkit-keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}@keyframes ui-progress-spinner-color{0%,100%,40%,66%,80%,90%{stroke:#428bca}}p-progressspinner{position:absolute!important;top:50%!important;left:50%!important}"]}]}],e.propDecorators={blocked:[{type:t.Input}],target:[{type:t.Input}]},e}();var K=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,o.BlockUIModule,r.ProgressSpinnerModule],declarations:[Q],exports:[Q]}]}],e}(),J=function(){function e(e,t,n){this.activatedRoute=e,this.router=t,this.translate=n,this.items=[]}return e.prototype.ngOnInit=function(){var e=this;this.router.events.pipe(s.filter((function(e){return e instanceof a.NavigationEnd}))).subscribe((function(){var t=e.activatedRoute.root;e.items=e.getBreadcrumbs(t,[])}))},e.prototype.getBreadcrumbs=function(e,t){var n=e.children;if(0===n.length)return t;this.generateBreadcrumb(n,t);var o=t.length&&t.length-1||0;return this.title=t[o]&&t[o].label,t},e.prototype.generateBreadcrumb=function(e,t){var n=this;e.forEach((function(e,o){e.snapshot.data.hasOwnProperty("breadcrumb")&&e.snapshot.data.breadcrumb.map((function(o){var r={label:n.translate.instant(o.name),queryParams:e.snapshot.queryParams,routerLink:n.getFormattedUrl(e,o.routerLink),url:n.getFormattedUrl(e,o.url)};o.routerLink&&(r.disabled=!0,r.routerLinkActiveOptions={exact:!0}),t.push(r)})),e.children&&e.children.length&&n.generateBreadcrumb(e.children,t)}))},e.prototype.getFormattedUrl=function(e,t){return t&&(Object.keys(e.snapshot.params).forEach((function(n){t=t.replace(":"+n,e.snapshot.params[n])})),t.includes(":")&&e.parent)?this.getFormattedUrl(e.parent,t):t},e.decorators=[{type:t.Component,args:[{selector:"c-breadcrumb",template:'<h1 class="sds-page-title">{{title}}</h1>\n<p-breadcrumb [model]="items" ></p-breadcrumb>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:a.Router},{type:i.TranslateService}]},e}();var X=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],exports:[c.CommonModule,i.TranslateModule]}]}],e.ctorParameters=function(){return[]},e}(),Z=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,l.BreadcrumbModule,X],declarations:[J],exports:[J]}]}],e}(),ee=function(){function e(){}return Object.defineProperty(e.prototype,"errorMessage",{get:function(){for(var e in this.control.errors)if(this.control.errors.hasOwnProperty(e)&&(this.control.touched||this.control.dirty))return this.errorList[e];return null},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"control-messages-error",template:'<div class="error-message" *ngIf="errorMessage">\n {{ errorMessage | translate }}\n</div>\n',styles:[".error-message{color:#c13018;margin-top:5px;font-size:13px}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={control:[{type:t.Input}],errorList:[{type:t.Input}]},e}();var te=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,n.ReactiveFormsModule],declarations:[ee],exports:[ee]}]}],e}();var ne=function(){function e(){this.optionsBoolean=[{label:"Selecione",value:""},{label:"Sim",value:"true"},{label:"Não",value:"false"}]}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"custom-fields",template:'<div [ngSwitch]="params.type" [formGroup]="form" *ngIf="form" >\n <div *ngSwitchCase="\'date\'" >\n <input-date-calendar [form]="form" [name]="params.field" ></input-date-calendar>\n </div>\n <div *ngSwitchCase="\'boolean\'" >\n <p-dropdown [options]="optionsBoolean" [name]="params.field"\n [(ngModel)]="params.value" [formControlName]="params.field" [required]="required" [readonly]="readonly"\n [style]="{\'width\': \'100%\'}"\n ></p-dropdown>\n </div>\n <div *ngSwitchDefault >\n <input type="text" *ngIf="!params.mask" pInputText [formControlName]="params.field" />\n <p-inputMask *ngIf="params.mask" [(ngModel)]="params.value" [formControlName]="params.field" [mask]="params.mask" [required]="required" [name]="params.field" [readonly]="readonly" ></p-inputMask>\n </div>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[]},e.propDecorators={params:[{type:t.Input}],disabled:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],form:[{type:t.Input}]},e}();var oe=y,re=function(){function e(e){this.localeService=e,this.unmask=!0,this.onBlurGetMoment=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.mask=null}return e.prototype.ngOnInit=function(){var e=this;this.localeService.get().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){if(e.mask=e.formatMask(t),e.format=e.setFormat(),e.form.get(e.name).value){var n=e.form.get(e.name).value.toString(),o=oe(n,e.format||"YYYY-MM-DD");e.form.get(e.name).setValue(o.format(e.format||"L")),e._date=o}}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.formatMask=function(e){this.locale=e;var t=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),(t=t.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},e.prototype.setFormat=function(){var e=this.locale.calendar.dateFormat.toString();return e=e.replace(/[y]/g,"YY"),this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),e.toUpperCase()},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),e.prototype.onBlur=function(e){if(e&&e.target&&e.target.value){var t=this.form.get(this.name).value;this._date=oe(t,this.format),this.onBlurGetMoment.emit(this._date)}else this._date={},this.form.get(this.name).setValue(null),this.onBlurGetMoment.emit(null)},Object.defineProperty(e.prototype,"model",{get:function(){var e=this.form.get(this.name).value;return oe(e,this.format)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputDateElement",{get:function(){return this._inputDateElement},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-date-calendar",template:'<div [formGroup]="form" >\n <p-inputMask *ngIf="mask" [formControlName]="name"\n [mask]="mask"\n (onBlur)="onBlur($event)"\n [placeholder]="placeholder"\n [attr.disabled]="disabled"\n [unmask]="unmask"\n [inputId]="inputId"\n [readonly]="readonly"\n #inputDateElement\n ></p-inputMask>\n</div>\n'}]}],e.ctorParameters=function(){return[{type:h.LocaleService}]},e.propDecorators={_inputDateElement:[{type:t.ViewChild,args:["inputDateElement",{static:!1}]}],form:[{type:t.Input}],name:[{type:t.Input}],disabled:[{type:t.Input}],unmask:[{type:t.Input}],inputId:[{type:t.Input}],withoutDay:[{type:t.Input}],readonly:[{type:t.Input}],onBlurGetMoment:[{type:t.Output}],model:[{type:t.Input}]},e}();var ae=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[u.InputMaskModule,n.FormsModule,n.ReactiveFormsModule,c.CommonModule],declarations:[re],exports:[re]}]}],e}(),ie=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,n.ReactiveFormsModule,m.SharedModule,d.InputTextModule,ae,p.DropdownModule,u.InputMaskModule],declarations:[ne],providers:[],exports:[ne]}]}],e}(),se=function(){function e(e){this.elementRef=e,this.el=this.elementRef.nativeElement}return e.prototype.onBlur=function(e){this.cleanVar(e)},e.prototype.cleanVar=function(e){var t=e.trim().replace(/^\s+|\s+$|\s+(?=\s)/g,"");return e!==t&&(this.el.value=t),t},e.decorators=[{type:t.Directive,args:[{selector:"[name-not-spaces]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={onBlur:[{type:t.HostListener,args:["blur",["$event.target.value"]]}]},e}();var le=function(){function e(e){this.el=e}return e.prototype.onKeyDown=function(e){var t=e;-1!==[46,8,9,27,13,110,190].indexOf(t.keyCode)||65===t.keyCode&&(t.ctrlKey||t.metaKey)||67===t.keyCode&&(t.ctrlKey||t.metaKey)||86===t.keyCode&&(t.ctrlKey||t.metaKey)||88===t.keyCode&&(t.ctrlKey||t.metaKey)||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()},e.decorators=[{type:t.Directive,args:[{selector:"[only-number]"}]}],e.ctorParameters=function(){return[{type:t.ElementRef}]},e.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown",["$event"]]}]},e}();var ce=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[],declarations:[le,se],exports:[le,se],providers:[],schemas:[]}]}],e}(),pe={searchValue:"searchValue"},ue={ASC:"ASC",DESC:"DESC"},de={EQUAL:"eq",DIFFERENT:"ne",LESS_THAN:"it",GREATER_THAN:"gt",LESS__EQUAL_THAN:"le",GREATER_EQUAL_THAN:"ge",CONTAINING:"containing",LOWER:"lower",AND:"and",OR:"or"},me={isBefore:"isBefore",isAfter:"isAfter",isSame:"isSame",isSameOrAfter:"isSameOrAfter",isSameOrBefore:"isSameOrBefore",isNotSame:"isNotSame"},he={ENTRY:"entry",GENERAL_REGISTER:"general_register",ORGANIZATION_REGISTER:"organization_register",PAYROLL:"payroll",DEPENDENT:"dependent"},ye=function(){function e(e){this.http=e}return e.prototype.getList=function(e,t){return this.http.post(""+e,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var fe=function(){function e(e){this.dataListService=e,this.rows=10,this.paginator=!0,this.first=1,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.responsive=!0,this.scrollable=!1,this.lazyLoad=new t.EventEmitter,this.loadingChange=new t.EventEmitter,this.listDataChange=new t.EventEmitter,this.selectedDataChange=new t.EventEmitter,this.headerCheckboxToggle=new t.EventEmitter,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.lazy||this.getlistData()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getActions=function(e,t){return this.actions(e,t)},e.prototype.pagination=function(e){this.lazy||this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onLazyLoad=function(e){var t=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){t.orderBy.push({field:e.field,direction:1===e.order?ue.ASC:ue.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows)+1)},e.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),e.prototype.getlistData=function(e,t){var n=this;void 0===e&&(e=this.rows),void 0===t&&(t=this.first),this.endpoint?this.dataListService.getList(this.endpoint,B({page:{current:t,size:e,orderBy:this.orderBy}},this.initParameters,this._searchParameters)).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){n.listData=e[n.keyPayload],n.totalRecords=e.countResult,n.lazy&&n.lazyLoad.emit(n.listData)})):this.lazy&&this.lazyLoad.emit(this.listData)},e.prototype.onHeaderCheckboxToggle=function(e){this.headerCheckboxToggle.emit(e)},e.prototype.getFieldValue=function(e,t){return t.field&&t.field.includes(".")?(t.field.split(".").map((function(t){return e=e&&e[t]})),e):e[t.field]},Object.defineProperty(e.prototype,"parameters",{set:function(e){e&&(this._searchParameters=B({},e),this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{get:function(){return this._loading},set:function(e){this._loading=e,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listData",{get:function(){return this._listData},set:function(e){this._listData=e,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedData",{get:function(){return this._selectedData},set:function(e){this._selectedData=e,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-data-list-rest",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows" [first]="first"\n (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator" (onPage)="pagination($event)"\n [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey" [sortMode]="sortMode" [responsive]="responsive" [scrollable]="scrollable"\n pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)" [selectionMode]="selectionMode">\n \x3c!-- Colgroup --\x3e\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col *ngFor="let col of columns; let i = index"\n [ngClass]="\'col-\'+i+\' col-scroll-resize\'"/>\n <col [ngClass]="\'col-\'+ (columns?.length || 0) +\' col-scroll-resize\'"/>\n </colgroup>\n </ng-template>\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.field" [pSortableColumnDisabled]="!isSortable || !!col.icon"\n [style.width]="col.width" [pTooltip]="col.tooltip || col.label" tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style" aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default" [model]="getActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label" priority="default"\n (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:t.ViewEncapsulation.None,providers:[ye],styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]}]}],e.ctorParameters=function(){return[{type:ye}]},e.propDecorators={dataListTable:[{type:t.ViewChild,args:["dataListTable",{static:!1}]}],id:[{type:t.Input}],dataKey:[{type:t.Input}],rows:[{type:t.Input}],emptyMessage:[{type:t.Input}],columns:[{type:t.Input}],paginator:[{type:t.Input}],first:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],actions:[{type:t.Input}],actionLabel:[{type:t.Input}],selectionMode:[{type:t.Input}],lazy:[{type:t.Input}],isMultipleSelection:[{type:t.Input}],isSortable:[{type:t.Input}],showHeaderCheckBox:[{type:t.Input}],sortMode:[{type:t.Input}],endpoint:[{type:t.Input}],totalRecords:[{type:t.Input}],orderBy:[{type:t.Input}],singularMessageRecords:[{type:t.Input}],pluralMessageRecords:[{type:t.Input}],keyPayload:[{type:t.Input}],initParameters:[{type:t.Input}],responsive:[{type:t.Input}],scrollable:[{type:t.Input}],lazyLoad:[{type:t.Output}],loadingChange:[{type:t.Output}],listDataChange:[{type:t.Output}],selectedDataChange:[{type:t.Output}],headerCheckboxToggle:[{type:t.Output}],parameters:[{type:t.Input}],loading:[{type:t.Input}],listData:[{type:t.Input}],selectedData:[{type:t.Input}]},e}();var ge=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[fe],exports:[fe]}]}],e}(),be=function(){function e(e){this.http=e,this.employeeBasicInformations=new f.Subject}return e.prototype.findEmployee=function(e,t){return this.http.post("hcm/payroll/queries/"+e,{employeeId:t})},e.prototype.findEmployeeAutoComplete=function(e,t){return this.http.post("hcm/payroll/queries/"+e,{valueSearch:t})},e.prototype.blobServiceRequestAccess=function(e,t){return this.http.post("hcm/payroll/actions/"+e,t)},e.prototype.setEmployeeBasicInformations=function(e){this.employeeBasicInformations.next(e)},e.prototype.getEmployeeBasicInformations=function(){return this.employeeBasicInformations.asObservable()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var ve=y,Ie=function(){function e(e,t){this.activatedRoute=e,this.employeeService=t,this.timetrackingLabel="Status",this.hireLabel="Admissão",this.registerNumberLabel="Matrícula",this.ageLabel="Idade",this.loadingLabel="...",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.emploayeeData={name:this.loadingLabel,jobPosition:this.loadingDescription},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.employeeId&&e.getInformation(t.employeeId)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getInformation=function(e){var t=this;this.isLoading=!0,this.employeeService.findEmployee("employeeContractualInformations",e).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result})),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){t.employeeService.setEmployeeBasicInformations(e),t.emploayeeData=B({},e,{timeTrackingResumeType:e.timeTrackingResumeType&&e.timeTrackingResumeType.value});var n=[];if(e.city&&n.push(e.city),e.stateAbbreviation&&n.push(e.stateAbbreviation),t.emploayeeData.location=n.join(" - "),e.hireDate&&(t.emploayeeData.hireDate=t.hireDate?t.hireDate:ve(e.hireDate).format("L")),e.idPicture){var o={fileId:e.idPicture,ttl:2,thumbnail:!1};t.employeeService.blobServiceRequestAccess("blobServiceRequestAccess",o).pipe(s.takeUntil(t.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){e&&(t.emploayeeData.photoSource=e.locationURI)}))}}))},e.decorators=[{type:t.Component,args:[{selector:"c-employee-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="emploayeeData?.name" [description]="emploayeeData?.jobPosition" [imageSource]="emploayeeData?.photoSource"></s-object-card-main>\n <s-object-card-field [label]="emploayeeData?.employer" [description]="emploayeeData?.location"></s-object-card-field>\n <s-object-card-field [label]="timetrackingLabel" [description]="emploayeeData?.timeTrackingResumeType"></s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="emploayeeData?.hireDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="registerNumberLabel" [description]="emploayeeData?.registernumber" iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field [label]="ageLabel" [description]="emploayeeData?.age" iconClass="fa fa-birthday-cake"></s-object-card-field>\n</s-object-card>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:be}]},e.propDecorators={timetrackingLabel:[{type:t.Input}],hireDate:[{type:t.Input}],hireLabel:[{type:t.Input}],registerNumberLabel:[{type:t.Input}],ageLabel:[{type:t.Input}],loadingLabel:[{type:t.Input}],loadingDescription:[{type:t.Input}]},e}();var ke=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[Ie],exports:[Ie],providers:[be]}]}],e}(),Se=function(){function e(e){this.http=e,this.admissionDraftBasicInformations=new f.Subject}return e.prototype.findAdmissionDraft=function(e){return this.http.post("hcm/payroll/queries/admissionDraftQuery",{id:e})},e.prototype.blobServiceRequestAccess=function(e,t){return this.http.post("hcm/payroll/actions/"+e,t)},e.prototype.setAdmissionDraftBasicInformations=function(e){this.admissionDraftBasicInformations.next(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var _e=function(){function e(e,t,n){this.activatedRoute=e,this.admissionDraftSummaryService=t,this.translateService=n,this.hireLabel="Admissão",this.hireDate="...",this.badgeText="Rascunho",this.loadingLabel="...",this.documentNumberLabel="Documento",this.loadingDescription="Carregando...",this.isLoading=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.draftData={name:this.loadingLabel,hiringDate:this.hireDate,documentNumber:this.loadingLabel,companyName:this.loadingLabel,localeOfCompany:this.loadingLabel,originDraftType:this.loadingLabel},this.activatedRoute.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.draftId&&e.getInformation(t.draftId)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getInformation=function(e){var t=this;this.isLoading=!0,this.admissionDraftSummaryService.findAdmissionDraft(e).pipe(s.takeUntil(this.ngUnsubscribe),s.map((function(e){return e&&e.result})),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){if(t.admissionDraftSummaryService.setAdmissionDraftBasicInformations(e),e.hiringDate=t.hireDate,t.draftData=B({},e),t.draftData.originDraftType=t.originType,e.attachment&&e.attachment.fileId){var n={fileId:t.draftData.attachment.fileId,ttl:2,thumbnail:!1};t.admissionDraftSummaryService.blobServiceRequestAccess("blobServiceRequestAccess",n).pipe(s.takeUntil(t.ngUnsubscribe),s.map((function(e){return e&&e.result}))).subscribe((function(e){e&&(t.draftData.photoSource=e.locationURI)}))}}))},e.decorators=[{type:t.Component,args:[{selector:"c-admission-draft-summary",template:'<s-object-card *sLoadingState="isLoading">\n <s-object-card-main [label]="draftData?.name"\n [imageSource]="draftData?.photoSource">\n </s-object-card-main>\n <s-object-card-field [label]="draftData.companyName" [description]="draftData.localeOfCompany"></s-object-card-field>\n <s-object-card-field [label]="draftData.originDraftType">\n <span descriptionTemplate class="sds-badge sds-semantic-orange">{{badgeText}}</span>\n </s-object-card-field>\n <s-object-card-field [label]="hireLabel" [description]="draftData?.hiringDate" iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field [label]="documentNumberLabel" [description]="draftData?.documentNumber" iconClass="fa fa-id-card"></s-object-card-field>\n</s-object-card>\n'}]}],e.ctorParameters=function(){return[{type:a.ActivatedRoute},{type:Se},{type:i.TranslateService}]},e.propDecorators={originType:[{type:t.Input}],hireLabel:[{type:t.Input}],hireDate:[{type:t.Input}],badgeText:[{type:t.Input}],loadingLabel:[{type:t.Input}],documentNumberLabel:[{type:t.Input}],loadingDescription:[{type:t.Input}]},e}();var we=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[h.ObjectCardModule,h.LoadingStateModule],declarations:[_e],exports:[_e],providers:[Se]}]}],e}(),De=function(){function e(){}return e.prototype.ngOnInit=function(){},e.decorators=[{type:t.Component,args:[{selector:"error-page",template:'<div class="ui-g">\n <div class="ui-sm-6 error-code">\n <span>403</span>\n </div>\n <div class="col-sm-6">\n <h4 class="error-title">{{\'hcm.payroll.permission_error_page\'|translate}}</h4>\n <h5 class="error-description">{{\'hcm.payroll.permission_error_page_description\'|translate}}</h5>\n </div>\n</div>\n',styles:["@media (max-width:767px){.error-code{text-align:center}.error-code>span{color:#697882;font-size:80px;font-weight:300}}@media (min-width:768px){.error-code>span{color:#697882;font-size:128px;font-weight:300;float:right}}.error-title{padding-top:30px}.error-description{color:#999;margin-top:10px}"]}]}],e.ctorParameters=function(){return[]},e}(),Ce=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[X],declarations:[De],exports:[De],providers:[]}]}],e}(),Ee=function(){function e(){this.errorMessage=""}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){var t=this,n=e.inputErrors.currentValue;this.errorMessage="",n&&Object.keys(this.errorDefs).some((function(e){if(n[e])return t.errorMessage=t.errorDefs[e],!0}))},e.decorators=[{type:t.Component,args:[{selector:"field-validator",template:'<ng-content></ng-content>\n<div style="color:#a94442;font-size: 13px"\n *ngIf="(onlyShowAfterTouched&&!field.valid&&(field.dirty || field.touched)&&errorMessage) || (!onlyShowAfterTouched&&errorMessage)">\n {{errorMessage | translate}}\n</div>\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={inputErrors:[{type:t.Input}],errorDefs:[{type:t.Input}],field:[{type:t.Input}],onlyShowAfterTouched:[{type:t.Input}]},e}();var Te=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,n.ReactiveFormsModule],declarations:[Ee],exports:[Ee],providers:[]}]}],e}(),Fe=function(){function e(){this.messagesSubjectError=new f.Subject,this.messagesSubjectSuccess=new f.Subject,this.messagesSubjectWarning=new f.Subject}return e.prototype.showError=function(e,t){void 0===t&&(t=!1),this.messagesSubjectError.next({message:e,breakLine:t})},e.prototype.showSuccess=function(e,t){void 0===t&&(t=!1),this.messagesSubjectSuccess.next({message:e,breakLine:t})},e.prototype.showWarning=function(e,t){void 0===t&&(t=!1),this.messagesSubjectWarning.next({message:e,breakLine:t})},e.prototype.loadErrorMessages=function(){return this.messagesSubjectError.asObservable()},e.prototype.loadSuccessMessages=function(){return this.messagesSubjectSuccess.asObservable()},e.prototype.loadWarningMessages=function(){return this.messagesSubjectWarning.asObservable()},e}();var Pe=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.query=function(e,t,n){var o=this;void 0===n&&(n=he.PAYROLL);var r="hcm/"+n+"/queries/"+e;return this.http.post(r,t).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.enumQuery=function(e,t,n){var o=this;void 0===n&&(n="payroll");var r="hcm/"+n+"/queries/"+e;return this.http.post(r,t).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.action=function(e,t){var n=this,o="hcm/payroll/actions/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.recruitmentAction=function(e,t){var n=this,o="hcm/recruitment/actions/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.get=function(e){var t=this,n="hcm/payroll/entities/"+e;return this.http.get(n).pipe(s.catchError((function(e){return 403===e.status&&t.messageService.add({severity:"error",summary:t.translateService.instant("hcm.payroll.error"),detail:t.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.getAutoComplete=function(e,t,n){var o=this;void 0===n&&(n=he.PAYROLL);var r="hcm/"+n+"/entities/"+e+"?filter="+t+"&size=10&orderby=code+asc";return this.http.get(r).pipe(s.catchError((function(e){return e&&403===e.status&&o.messageService.add({severity:"error",summary:o.translateService.instant("hcm.payroll.error"),detail:o.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.patch=function(e,t){var n=this,o="hcm/payroll/entities/"+e;return this.http.patch(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.post=function(e,t){var n=this,o="hcm/payroll/"+e;return this.http.post(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.put=function(e,t){var n=this,o="hcm/payroll/entities/"+e;return this.http.put(o,t).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.prototype.delete=function(e,t){var n=this,o=t?"hcm/payroll/entities/"+e+"/"+t:"hcm/payroll/entities/"+e;return this.http.delete(o).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var Me=function(){function e(e){this.http=e}return e.prototype.blobServiceRequestUpload=function(e){var t={fileName:e.name,thumbnail:this.isImage(e)};return this.http.action("blobServiceRequestUpload",t)},e.prototype.blobServiceRequestAccess=function(e){var t={fileId:e,tll:2,thumbnail:!1};return this.http.action("blobServiceRequestAccess",t)},e.prototype.blobServiceFileDelete=function(e){var t={fileId:e,thumbnail:!1};return this.http.action("blobServiceDelete",t)},e.prototype.isImage=function(e){return/^image\//.test(e.type)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Ae=function(){function e(e,n,o){this.service=e,this.toastService=n,this.translate=o,this.files=[],this.onUploadFile=new t.EventEmitter,this.onRemoveFile=new t.EventEmitter}return e.prototype.uploadHandler=function(e){var t=this,n=[];if(e&&e.files.length){e.files.sort(),e.files.length>10&&e.files[10]&&delete e.files[10];for(var o=this.getFilesCountAndValidate(e.files),r=0;r<o;r++){var a=this.validateFileSize(e.files[r]);r<=9&&a.isUploaded&&!a.complete&&n.push(this.saveFile(a))}f.forkJoin.apply(void 0,U(n)).subscribe((function(){t.onUploadFile.emit(t.files)}))}},e.prototype.validateFileSize=function(e){return e.isUploaded&&!e.complete&&e.size>5e7&&(e.complete=!0,e.error=this.translate.instant("hcm.payroll.attachments_max_mb"),this.toastService.showError(this.translate.instant("hcm.payroll.attachments_alert_error"))),e},e.prototype.getFilesCountAndValidate=function(e){var t=0;return e.length&&(e.length>10?(t=10,this.toastService.showError(this.translate.instant("hcm.payroll.attachments_max_length"))):t=e.length),t},e.prototype.saveFile=function(e){var t=this;return new f.Observable((function(n){return t.service.blobServiceRequestUpload(e).pipe(s.map((function(e){return e&&e.result}))).subscribe((function(o){return t.doUpload(o,e,n)}),(function(t){e.complete=!0,e.error=t.message,e.objectURL=void 0}))}))},e.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.id=e.fileId,t.objectURL=e.locationURI,t.version=e.version,t.progress=0,o.upload.addEventListener("progress",(function(e){t.progress=Math.round(100*e.loaded/e.total)}),!1),o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},e.prototype.onCancelUpload=function(e){this.files.splice(e,1)},e.prototype.removeFile=function(){this.onRemoveFile.emit(this.files)},e.decorators=[{type:t.Component,args:[{selector:"c-file-upload",template:'<s-file-upload-deprecated chooseLabel="{{\'hcm.payroll.file_upload_choose_label\'|translate}}"\n cancelLabel="{{\'hcm.payroll.file_upload_cancel_label\'|translate}}"\n removeLabel="{{\'hcm.payroll.file_upload_remove_label\'|translate}}"\n successTooltip="{{\'hcm.payroll.file_upload_success_tooltip\'|translate}}"\n [errorTooltip]="errorTooltip"\n [customUpload]="true" [accept]="\'*/*\'" [multiple]="true"\n (uploadHandler)="uploadHandler($event)" (onCancelUpload)="onCancelUpload($event)"\n (onRemoveFile)="removeFile()" [files]="files"\n></s-file-upload-deprecated>\n'}]}],e.ctorParameters=function(){return[{type:Me},{type:Fe},{type:i.TranslateService}]},e.propDecorators={errorTooltip:[{type:t.Input}],files:[{type:t.Input}],onUploadFile:[{type:t.Output}],onRemoveFile:[{type:t.Output}]},e}();var Le=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,k.FileUploadModuleDeprecated,X],declarations:[Ae],providers:[Me],exports:[Ae]}]}],e}(),Oe=function(){function e(e){this.http=e}return e.prototype.saveImage=function(e,t,n){return N(this,void 0,void 0,(function(){var o,r,a;return j(this,(function(i){switch(i.label){case 0:return e?(o=null,e?o={fileName:e.name}:t&&(o={fileName:t.split("/")[1]}),o?[4,this.blobServiceRequestUpload(n,o).toPromise()]:[3,2]):[2];case 1:return r=i.sent(),(a=new XMLHttpRequest).open("PUT",r.result.locationURI,!0),a.setRequestHeader("Translate","f"),a.send(e),[2,r.result];case 2:return[2]}}))}))},e.prototype.urltoFile=function(e,t,n){return void 0===n&&(n=null),n=n||(e.match(/^data:([^;]+);/)||"")[1],this.http.request("GET",e,{responseType:"arraybuffer"}).pipe(s.map((function(e){var o=new Blob([e],{type:n});return o.name=t,o})))},e.prototype.getImage=function(e,t,n){return N(this,void 0,void 0,(function(){return j(this,(function(o){switch(o.label){case 0:return e&&e.fileId?[4,this.blobServiceRequestAccess(t,e.fileId,n).toPromise()]:[3,2];case 1:return[2,o.sent().result.locationURI];case 2:return[2]}}))}))},e.prototype.buildUrl=function(e,t){return"hcm/"+e+"/"+t},e.prototype.query=function(e,t,n){var o="queries/"+t;return this.http.post(this.buildUrl(e,o),n)},e.prototype.blobServiceRequestUpload=function(e,t){var n={fileName:t.fileName,thumbnail:!0};return this.http.post(this.buildUrl(e,"actions/blobServiceRequestUpload"),n)},e.prototype.blobServiceRequestAccess=function(e,t,n){var o={fileId:t,tll:2,thumbnail:n};return this.http.post(this.buildUrl(e,"actions/blobServiceRequestAccess"),o)},e.prototype.blobServiceFileDelete=function(e,t){var n={fileId:t,thumbnail:!0};return this.http.post(this.buildUrl(e,"actions/blobServiceDelete"),n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var Re=function(){function e(e,n){this.imageCropService=e,this.toastService=n,this.service="payroll",this.onClickSave=new t.EventEmitter,this.defaulPerson="assets/default-person.png",this.display=!1,this.imageCrop=[],this.data={},this.cropperSettings=new S.CropperSettings,this.cropperSettings.width=100,this.cropperSettings.height=100,this.cropperSettings.keepAspect=!1,this.cropperSettings.preserveSize=!0,this.cropperSettings.canvasWidth=600,this.cropperSettings.canvasHeight=450,this.cropperSettings.rounded=!0,this.cropperSettings.minWithRelativeToResolution=!1,this.cropperSettings.noFileInput=!0,this.cropperSettings.cropperDrawSettings.strokeColor="rgba(255,255,255,1)",this.cropperSettings.cropperDrawSettings.strokeWidth=1}return Object.defineProperty(e.prototype,"image",{set:function(e){var t=this;e&&e.fileId&&!this.personPhotoLink&&this.imageCropService.blobServiceRequestAccess(this.service,e.fileId,!0).subscribe((function(e){t.personPhotoLink=e.result.locationURI}))},enumerable:!0,configurable:!0}),e.prototype.onUploadHandler=function(e){var t=this;if(this.file=e.files[0],this.file&&this.file.size>5e6)return this.file=null,this.imageCrop=[],void this.toastService.showError("O tamanho máximo permitido para a imagem é de 5MB");this.display=!1;var n=new Image,o=new FileReader;o.onloadend=function(e){n.src=e.target.result,t.cropper.setImage(n)},o.readAsDataURL(this.file),this.display=!0},e.prototype.ngOnInit=function(){this.data.image=null,this.personPhotoLink=null,this.personFirstName="",this.display=!1},e.prototype.showDialog=function(){this.display=!0},e.prototype.onHide=function(){this.display=!1},e.prototype.reset=function(){this.file=null,this.data={},this.imageCrop=[],this.cropper.reset(),this.data.image=null,this.personPhotoLink=null,this.personFirstName=""},e.prototype.saveImage=function(){return N(this,void 0,void 0,(function(){var e,t,n,o=this;return j(this,(function(r){switch(r.label){case 0:return this.file?(e=this.file.name,this.cropper&&this.cropper.image?[4,this.urltoFile(this.cropper.image.image,e)]:[3,2]):(this.onClickSave.emit(null),this.onHide(),[2]);case 1:t=r.sent(),this.personPhotoLink=this.data.image,n=null,this.file?n={fileName:this.file.name}:this.data&&(n={fileName:this.data.fileId.split("/")[1]}),n&&(this,this.imageCropService.blobServiceRequestUpload(this.service,n).subscribe((function(e){var n=new XMLHttpRequest;n.open("PUT",e.result.locationURI,!0),n.setRequestHeader("Translate","f"),n.send(t),o.onClickSave.emit(e.result),o.onHide()}))),r.label=2;case 2:return[2]}}))}))},e.prototype.urltoFile=function(e,t,n){return void 0===n&&(n=null),n=n||(e.match(/^data:([^;]+);/)||"")[1],fetch(e).then((function(e){return e.arrayBuffer()})).then((function(e){return new File([e],t,{type:n})}))},e.prototype.deleteImage=function(){this.imageCropService.blobServiceFileDelete(this.service,this.data&&this.data.image&&this.data.image.fileId),this.reset()},e.decorators=[{type:t.Component,args:[{selector:"image-crop",template:'<a (click)="showDialog()">\n <span class="result rounded">\n <img class="center-block" style="max-width: 100%; height: auto"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson" [alt]="personFirstName"\n width="auto" height="140">\n </span>\n</a>\n\n<p-dialog [(visible)]="display" modal="true" [minWidth]="450" (onHide)="onHide()">\n <p-header>\n {{\'hcm.payroll.employees_image_cropper_edit\' | translate}}\n </p-header>\n\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-12 img-user-modal" *ngIf="!personPhotoLink">\n <i class="fa fa-user-circle fa-5x"></i>\n <div id="txt-select-image">{{\'hcm.payroll.employees_image_cropper_viewing\' | translate}}</div>\n <div class="ui-md-4 btn-center">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n </div>\n </div>\n <div class="ui-g" *ngIf="!data.image">\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <p-fileUpload [chooseLabel]="\'hcm.payroll.employees_image_cropper_select\'|translate"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left" *ngIf="personPhotoLink">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\' | translate}}"></button>\n </div>\n <div class="ui-g-12 ui-md-12" *ngIf="personPhotoLink">\n <span class="result rounded">\n <img class="center-block default-image"\n [src]="personPhotoLink ? personPhotoLink : defaulPerson"\n [alt]="personFirstName"\n width="auto"\n height="140">\n </span>\n </div>\n </div>\n <div class="ui-g" [style.display]="data.image ? \'block\' : \'none\'">\n <div class="ui-md-4 btn-left">\n <p-fileUpload chooseLabel="Selecionar foto"\n mode="basic"\n name="imageCrop[]"\n accept="image/*"\n customUpload="true"\n auto="true"\n [files]="imageCrop"\n (uploadHandler)="onUploadHandler($event)"\n >\n </p-fileUpload>\n </div>\n <div class="ui-md-4 btn-left">\n <button pButton class="ui-button-secondary" type="button" (click)="deleteImage()"\n label="{{\'hcm.payroll.employees_image_cropper_delete\'|translate}}"></button>\n </div>\n <div class="ui-md-12">\n <img-cropper #cropper [image]="data" [settings]="cropperSettings"></img-cropper>\n </div>\n </div>\n\n <p-footer>\n <button pButton type="button" class="btn-link ui-button-link" (click)="display=false"\n label="{{\'hcm.payroll.employees_image_cropper_cancel\' | translate}}"></button>\n <button pButton type="button" (click)="saveImage()" label="{{\'hcm.payroll.employees_image_cropper_save\'|translate}}"></button>\n </p-footer>\n</p-dialog>\n',styles:[".center{float:left;position:relative;left:30%}.btn-center{float:left;position:relative;left:33%}.btn-left{float:left;position:relative}.rounded{cursor:pointer}.result.rounded>img{border-radius:50%}div.cropper{height:400px}.center-block{display:block;margin-right:auto;margin-left:auto}.ui-fileupload-choose{width:300px!important}.fa-user-circle{color:#ccc}.img-user-modal{text-align:center!important}#txt-select-image{margin:20px 0;font-weight:700;font-size:16px}"]}]}],e.ctorParameters=function(){return[{type:Oe},{type:Fe}]},e.propDecorators={service:[{type:t.Input}],onClickSave:[{type:t.Output}],cropper:[{type:t.ViewChild,args:["cropper",{static:!1}]}],image:[{type:t.Input}]},e}();var xe=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,w.DialogModule,_.ButtonModule,D.FileUploadModule,S.ImageCropperModule,S.ImageCropperModule,h.ThumbnailModule],declarations:[Re],providers:[Oe,h.ImageCropperService],exports:[Re]}]}],e}(),Be=y,Ne=function(){function e(e){this.localeService=e,this.onBlurGetMoment=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.mask=null}return e.prototype.ngOnInit=function(){var e=this;this.localeService.get().subscribe((function(t){if(e.mask=e.formatMask(t),e.format=e.getFormat(),e.model){var n=e.model,o=Be(n,e.format||"YYYY-MM-DD");o.isValid()?(e.model=o.format(e.format||"L"),e._date=o):e._date=null}}))},e.prototype.formatMask=function(e){this.locale=e;var t=this.locale.calendar.dateFormat.toString();return this.withoutDay&&(t=t.replace("dd/","").replace("-dd","")),(t=t.replace(/[d]|[m]/g,"9")).replace(/[y]/g,"99")},e.prototype.getFormat=function(){var e=this.locale.calendar.dateFormat.toString();return e=e.replace(/[y]/g,"YY"),this.withoutDay&&(e=e.replace("dd/","").replace("-dd","")),e.toUpperCase()},Object.defineProperty(e.prototype,"placeholder",{get:function(){return this.mask?this.mask.toString().replace(/[9]/g,"_"):""},enumerable:!0,configurable:!0}),e.prototype.onBlur=function(){var e=this.model;this._date=Be(e,this.format),this.onBlurGetMoment.emit(this._date)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-date-calendar-model",template:'<p-inputMask *ngIf="mask"\n [mask]="mask"\n (onBlur)="onBlur()"\n [unmask]="unmask"\n [placeholder]="placeholder"\n [disabled]="disabled"\n [(ngModel)]="model"\n [style]="style"\n [styleClass]="styleClass"\n></p-inputMask>\n'}]}],e.ctorParameters=function(){return[{type:h.LocaleService}]},e.propDecorators={name:[{type:t.Input}],disabled:[{type:t.Input}],withoutDay:[{type:t.Input}],unmask:[{type:t.Input}],style:[{type:t.Input}],styleClass:[{type:t.Input}],onBlurGetMoment:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var je=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[u.InputMaskModule,n.FormsModule,n.ReactiveFormsModule,c.CommonModule],declarations:[Ne],exports:[Ne]}]}],e}(),qe=y;function Ve(e){return e&&"object"==typeof e&&!Array.isArray(e)}function Ue(e){return!Array.isArray(e)||!e.find((function(e){return"object"==typeof e}))}function Ye(e){return 0===e||"boolean"==typeof e||null!=e&&""!==e}function Ge(e,t){return void 0===t&&(t=!0),!e||!He(e,t)||(t?qe(e.replace(/[^\d]+/g,""),"DDMMYYYY").isValid():qe(e.replace(/[^\d]+/g,""),"MMYYYY").isValid())}function He(e,t){if(void 0===t&&(t=!0),e){var n=void 0;return n=t?8:6,e.replace(/[^\d]+/g,"").length===n}return!0}function We(e,t){return-1!==e.search("Date")?ze(t):t}function ze(e,t,n){if(void 0===t&&(t="DDMMYYYY"),void 0===n&&(n="YYYY-MM-DD"),Ye(e)){var o=$e(e,t);return qe(e.replace(/[^\d]+/g,""),o).format(n)}}function $e(e,t){return-1!==e.search("/")?"DDMMYYYY":-1!==e.search("-")?"YYYYMMDD":t}function Qe(e){return void 0===e&&(e="YYYY-MM-DD"),qe().format(e)}function Ke(e,t){void 0===t&&(t="DDMMYYYY");var n=$e(e,t);return qe(e.replace(/[^\d]+/g,""),n)}function Je(e,t){return t?qe(e,t):qe(e)}function Xe(e){var t=[];return Object.entries(e).forEach((function(e){var n=V(e,2),o=n[0],r=n[1];t.push({field:o,value:r})})),t}function Ze(e){var t={};return e&&e.length&&e.forEach((function(e){"date"===e.type&&e.value&&(e.value=Je(e.value).format("L")),t[e.field]=e.value})),t}function et(){var e=this;Object.keys(this.controls).map((function(t){var o=e.get(t);o.markAsDirty(),(o instanceof n.FormGroup||o instanceof n.FormArray)&&et.call(o)}))}function tt(e,t,o,r){o?(e.controls[t].setValidators(n.Validators.compose(r&&r.length?r:[n.Validators.required])),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function nt(e,t,n,o){t?n.forEach((function(t){return e.get(t).enable()})):(n.forEach((function(t){return e.get(t).disable()})),it(e,o||n))}function ot(e,t,o){o&&o.length?(e.controls[t].setValidators(n.Validators.compose(o)),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function rt(e,t,n,o){void 0===o&&(o=!0),t?(e.get(n).disable(),o&&e.get(n).reset()):e.get(n).enable()}function at(e,t){return void 0===t&&(t="ASC"),function(n,o){if(!n.hasOwnProperty(e)||!o.hasOwnProperty(e))return 0;var r="string"==typeof n[e]?n[e].toUpperCase():n[e],a="string"==typeof o[e]?o[e].toUpperCase():o[e],i=0;return r>a?i=1:r<a&&(i=-1),"DESC"===t?-1*i:i}}function it(e,t){t.forEach((function(t){return e.get(t).reset()}))}function st(e){if(e){var t=e.calendar.dateFormat.toString();return(t=(t=t.replace(/[y]/g,"YY")).replace(/[/]/g,"")).toUpperCase()}}function lt(e){return e?e.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null}var ct=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var pt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.keyToExclude=[],this.usingType=[],this.minCharactersToSearch=3,this.multiple=!1,this.serviceType=he.PAYROLL,this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{if(this.isTimetrackingSituation)return this.service.query("autocompleteTimetrackingSituation",{valueSearch:n,referenceDate:this.referenceDate}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isDismissalReason){var o={valueSearch:n};return this.referenceDate&&(o.referenceDate=this.referenceDate),this.service.query("autocompleteDismissalReason",o,he.GENERAL_REGISTER).subscribe((function(e){return t.formaterResponce(e.result)}))}if(this.usingType&&this.usingType.length)return this.service.query("autocompleteOtherCompanyFilterUsingType",{searchText:n,usingType:this.usingType}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isDepartmentFromCompany)return this.service.query("autocompleteDepartmentQuery",{searchText:n,companyId:this.companyId,referenceDate:this.referenceDate}).subscribe((function(e){return t.formaterResponce(e.result)}));if(this.isWagetype){o={searchText:n,companyId:this.companyId};return this.service.query("autocompleteWagetypeQuery",o,he.ENTRY).subscribe((function(e){return t.formaterResponce(e.result)}))}this.service.query("autocomplete",this.getParamsRest(n),this.serviceType).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log(e)}},e.prototype.formaterResponce=function(e){var t=this;this.suggestions=[];var n=[];return e.map((function(e){var o={tableId:e.tableId,name:""};if(t.isTimetrackingSituation||t.isDismissalReason||t.usingType&&t.usingType.length){if(t.keyToExclude.includes(e.fields&&e.fields[2]&&e.fields[2].value))return;var r="";e.fields.map((function(e){o[e.name]=e.value})),r+=e.fields.filter((function(e){return"code"===e.name.toLowerCase()})).map((function(e){return e?e.value+=" - ":""}))[0],!t.usingType||!t.usingType.length||r&&"undefined"!==r||(r=""),r+=e.fields.filter((function(e){return"name"===e.name.toLowerCase()})).map((function(e){return e?e.value:""}))[0],o.name=r,n.push(o)}else{e.fields.map((function(e){o[e.name]=e.value}));var a="";t.concatFieldsForName?(t.concatFieldsForName.map((function(e){(e.includes("date")||e.includes("Birthday"))&&(o[e]=Je(o[e]).format("DD/MM/YYYY")),a+=o[e]+" - "})),a=a.slice(0,-3)):(t.keyCode&&(a+=o[t.keyCode]+" - "),t.keyName&&(a+=o[t.keyName])),o.name=a,n.push(o)}})),this.suggestions=U(n),n},e.prototype.getParamsRest=function(e){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(e),enableEntityFilters:this.enableEntityFilters}},e.prototype.getConditionsRest=function(e){var t=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+e}];return this.conditions&&this.conditions.map((function(e){(["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(e.expression)||Ye(e.value))&&t.push(e)})),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},Object.defineProperty(e.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObject},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:ct}]},e.propDecorators={_autoCompleteObject:[{type:t.ViewChild,args:["autoCompleteObject",{static:!0}]}],name:[{type:t.Input}],table:[{type:t.Input}],order:[{type:t.Input}],enableEntityFilters:[{type:t.Input}],fields:[{type:t.Input}],conditionsFields:[{type:t.Input}],conditions:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],concatFieldsForName:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],isTimetrackingSituation:[{type:t.Input}],isDepartmentFromCompany:[{type:t.Input}],companyId:[{type:t.Input}],referenceDate:[{type:t.Input}],isDismissalReason:[{type:t.Input}],keyToExclude:[{type:t.Input}],usingType:[{type:t.Input}],minCharactersToSearch:[{type:t.Input}],isWagetype:[{type:t.Input}],multiple:[{type:t.Input}],serviceType:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var ut=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[pt],providers:[ct],exports:[pt]}]}],e}(),dt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var mt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,code:"",name:"",fullname:"",admission:"",document:""};e.fields&&e.fields.length&&(n.fullname=e.fields[0].value,n.admission=e.fields[1].value,n.document=e.fields[2].value,n.code=4===e.fields.length&&e.fields[3].value,n.code?n.name=n.code.concat(" - ").concat(n.fullname).concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")):n.name=n.fullname.concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")),t.push(n))})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){var t={valueSearch:e,enableEntityFilters:this.enableEntityFilters};return this.company&&(t.company=this.company),this.branch&&(t.companyBranch=this.branch),this.employeeType&&(t.employeeType=this.employeeType),this.otherContractType&&(t.otherContractType=this.otherContractType),!1===this.filterEmployeeType&&(t.filterEmployeeType=this.filterEmployeeType),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-employee",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:dt}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],company:[{type:t.Input}],branch:[{type:t.Input}],employeeType:[{type:t.Input}],otherContractType:[{type:t.Input}],filterEmployeeType:[{type:t.Input}],enableEntityFilters:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var ht=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[mt],providers:[dt],exports:[mt]}]}],e}(),yt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var ft=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{this.service.query("autocompleteEmployee",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,code:"",name:"",fullname:"",admission:"",document:""};e.fields&&e.fields.length&&(n.fullname=e.fields[0].value,n.admission=e.fields[1].value,n.document=e.fields[2].value,n.code=4===e.fields.length&&e.fields[3].value,n.code?n.name=n.code.concat(" - ").concat(n.fullname).concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")):n.name=n.fullname.concat(" - ").concat(Ke(n.admission).format("DD/MM/YYYY")),t.push(n))})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){var t={valueSearch:e};return this.company&&(t.company=this.company),this.branch&&(t.companyBranch=this.branch),this.employeeType&&(t.employeeType=this.employeeType),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-employee-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:yt}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],company:[{type:t.Input}],branch:[{type:t.Input}],employeeType:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var gt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,X,v.HttpClientModule,T.AutoCompleteModule,n.ReactiveFormsModule],declarations:[ft],providers:[yt],exports:[ft]}]}],e}(),bt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n={names:[t]};return this.http.enumQuery("enumQuery",n,e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var vt=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyToExclude=[],this.keyToKeep=[],this.multiple=!1,this.onSelect=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onClear=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){var e=this;try{this.service.query(this.server,this.enumeration).subscribe((function(t){return e.payload=t.results[0].items}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(this.suggestions=[],!(isNaN(n)&&n.toString().length<3)){this.keyToExclude&&this.keyToExclude.length?this.payload=this.payload&&this.payload.filter((function(e){return!t.keyToExclude.includes(e.key)})):this.keyToKeep&&this.keyToKeep.length&&(this.payload=this.payload&&this.payload.filter((function(e){return t.keyToKeep.includes(e.key)})));for(var o=0;o<this.payload.length;o++){var r=this.payload[o];-1!==r.value.toLowerCase().indexOf(n.toLowerCase())&&this.suggestions.push(r)}}},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},Object.defineProperty(e.prototype,"autoCompleteObject",{get:function(){return this._autoCompleteObjectEl},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-enum",template:'<div [formGroup]="form">\n <p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n #autoCompleteObject\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:bt}]},e.propDecorators={_autoCompleteObjectEl:[{type:t.ViewChild,args:["autoCompleteObject",{static:!0}]}],name:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],inputId:[{type:t.Input}],keyToExclude:[{type:t.Input}],keyToKeep:[{type:t.Input}],server:[{type:t.Input}],enumeration:[{type:t.Input}],form:[{type:t.Input}],multiple:[{type:t.Input}],onSelect:[{type:t.Output}],onBlur:[{type:t.Output}],onClear:[{type:t.Output}]},e}();var It=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[vt],providers:[bt],exports:[vt]}]}],e}(),kt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var St=function(){function e(e){this.service=e,this.forceSelection=!0,this.keyName="name",this.keysToExclude=[],this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onFocus=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<3))try{if(this.isWagetype){var o=B({searchText:n,companyId:this.companyId},this.wagetypeReferenceDates);return this.service.query("autocompleteWagetypeQuery",o,he.ENTRY).subscribe((function(e){return t.formaterResponce(e.result)}))}this.service.query("autocomplete",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponce(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponce=function(e){var t=this;this.suggestions=[];var n=[];return e.map((function(e){var o={tableId:e.tableId,name:""};if(e.fields.map((function(e){o[e.name]=e.value})),!t.keysToExclude.includes(e&&e.tableId)){var r="";t.concatFieldsForName?(t.concatFieldsForName.map((function(e){e.includes("date")&&(o[e]=Je(o[e]).format("L")),r+=o[e]+" - "})),r=r.slice(0,-3)):(t.keyCode&&(r+=o[t.keyCode]+" - "),t.keyName&&(r+=o[t.keyName])),o.name=r,n.push(o)}})),this.suggestions=n,n},e.prototype.getParamsRest=function(e){return{table:this.table,fields:this.fields,order:this.order,conditions:this.getConditionsRest(e)}},e.prototype.getConditionsRest=function(e){var t=[{fields:this.conditionsFields||this.fields,expression:"LIKE",value:""+e}];return this.conditions&&this.conditions.map((function(e){!["IS_NULL","IS_NOT_NULL","IS_TRUE"].includes(e.expression)&&Ye(e.value)&&t.push(e)})),t},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},e.prototype.onFocusItem=function(e){this.onFocus.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-model",template:'<p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onFocus)="onFocusItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:kt}]},e.propDecorators={name:[{type:t.Input}],table:[{type:t.Input}],order:[{type:t.Input}],fields:[{type:t.Input}],conditionsFields:[{type:t.Input}],conditions:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],keyCode:[{type:t.Input}],keyName:[{type:t.Input}],concatFieldsForName:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],keysToExclude:[{type:t.Input}],isWagetype:[{type:t.Input}],companyId:[{type:t.Input}],wagetypeReferenceDates:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onFocus:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var _t=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[St],providers:[kt],exports:[St]}]}],e}(),wt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n={names:[t]};return this.http.enumQuery("enumQuery",n,e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Dt=function(){function e(e){this.service=e,this.forceSelection=!0,this.onSelect=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){var e=this;try{this.service.query(this.server,this.enumeration).subscribe((function(t){return e.payload=t.results}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.filterQuery=function(e){var t=e.query;if(this.suggestions=[],!(isNaN(t)&&t.toString().length<3))for(var n=0;n<this.payload[0].items.length;n++){var o=this.payload[0].items[n];-1!==o.value.toLowerCase().indexOf(t.toLowerCase())&&this.suggestions.push(o)}},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onBlurItem=function(e){this.onBlur.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(this._model)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-model-enum",template:'<p-autoComplete\n [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="value" size="50"\n [emptyMessage]="emptyMessage | translate"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n (onBlur)="onBlurItem($event)"\n (onClear)="onClearItem($event)"\n [(ngModel)]="model"\n [autoHighlight]="true"\n [style]="style"\n [inputStyle]="inputStyle"\n appendTo="body"\n>\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.value | translate}}\n </div>\n </ng-template>\n</p-autoComplete>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:wt}]},e.propDecorators={name:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],style:[{type:t.Input}],inputStyle:[{type:t.Input}],server:[{type:t.Input}],enumeration:[{type:t.Input}],onSelect:[{type:t.Output}],onBlur:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var Ct=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[Dt],providers:[wt],exports:[Dt]}]}],e}(),Et=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Tt=function(){function e(e){this.service=e,this.forceSelection=!0,this.minCharactersToSearch=3,this.multiple=!1,this.onBlur=new t.EventEmitter,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onFocus=new t.EventEmitter,this.suggestions=[]}return e.prototype.ngOnInit=function(){},e.prototype.filterQuery=function(e){var t=this,n=e.query;if(!(isNaN(n)&&n.toString().length<this.minCharactersToSearch))try{this.service.query("autocompleteJobpositionQuery",this.getParamsRest(n)).subscribe((function(e){return t.formaterResponse(e.result)}))}catch(e){console.log("Erro ao buscar no back")}},e.prototype.formaterResponse=function(e){this.suggestions=[];var t=[];return e.map((function(e){var n={tableId:e.tableId,name:""};e.fields.map((function(e){n[e.name]=e.value})),n.name=n.Code+" - "+n.Name,t.push(n)})),this.suggestions=t,t},e.prototype.getParamsRest=function(e){return{searchText:e,companyId:this.companyId?this.replace(this.companyId):null,creationDate:this.creationDate?this.replace(this.creationDate):null,expirationDate:this.expirationDate?this.replace(this.expirationDate):null,jobpositionsFilter:this.jobpositionsFilter?this.replaceArray(this.jobpositionsFilter):null,ignoredJobpositions:this.ignoredJobpositions?this.replaceArray(this.ignoredJobpositions):null,order:this.order}},e.prototype.replace=function(e){return e.replace(new RegExp("'","g"),"")},e.prototype.replaceArray=function(e){var t=this;return e.map((function(e){return t.replace(e)}))},e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){this.onClear.emit(e)},e.prototype.onBlurItem=function(e){this.isDropdown?this.isDropdown=!1:(this.form.controls[this.name].markAsDirty(),this.onBlur.emit(e))},e.prototype.onDropdownClick=function(){this.isDropdown=!0},e.decorators=[{type:t.Component,args:[{selector:"input-rest-auto-complete-jobposition",template:'<div [formGroup]="form" >\n <p-autoComplete [suggestions]="suggestions"\n (completeMethod)="filterQuery($event)"\n [placeholder]="placeholder"\n [minLength]="1" [dropdown]="dropdown"\n field="name" size="50"\n [emptyMessage]="emptyMessage"\n [readonly]="readonly"\n [disabled]="disabled"\n [required]="required"\n [forceSelection]="forceSelection"\n (onSelect)="selectOption($event)"\n [formControlName]="name"\n (onClear)="onClearItem($event)"\n (onBlur)="onBlurItem($event)"\n (onDropdownClick)="onDropdownClick()"\n [inputId]="inputId"\n [autoHighlight]="true"\n [multiple]="multiple"\n >\n <ng-template let-info pTemplate="item">\n <div class="ui-helper-clearfix">\n {{info.name}}\n </div>\n </ng-template>\n\n </p-autoComplete>\n</div>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:Et}]},e.propDecorators={name:[{type:t.Input}],value:[{type:t.Input}],companyId:[{type:t.Input}],creationDate:[{type:t.Input}],expirationDate:[{type:t.Input}],jobpositionsFilter:[{type:t.Input}],ignoredJobpositions:[{type:t.Input}],order:[{type:t.Input}],placeholder:[{type:t.Input}],readonly:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],dropdown:[{type:t.Input}],forceSelection:[{type:t.Input}],error:[{type:t.Input}],emptyMessage:[{type:t.Input}],itemSelect:[{type:t.Input}],form:[{type:t.Input}],inputId:[{type:t.Input}],minCharactersToSearch:[{type:t.Input}],multiple:[{type:t.Input}],onBlur:[{type:t.Output}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onFocus:[{type:t.Output}]},e}();var Ft=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule],declarations:[Tt],providers:[Et],exports:[Tt]}]}],e}(),Pt=function(){function e(e){this.http=e}return e.prototype.query=function(e,t){var n="queries/"+e;return this.http.post(n,t)},e.prototype.queryEntity=function(e,t){return this.http.get(e)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Mt=function(){function e(e,n){this.translateService=e,this.service=n,this.arguments={page:{current:1,size:"10"}},this.alwaysShowPaginator=!1,this.onLoadPayload=new t.EventEmitter,this.loadedList=new t.EventEmitter}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(e){e.hasOwnProperty("arguments")&&(this.arguments=Object.assign({},e.arguments.currentValue),this.getList(1)),e.hasOwnProperty("reload")&&!0===e.reload.currentValue&&this.getList(1)},e.prototype.getList=function(e){var t=this;this.loadedList.emit(!0);try{var n=Object.assign({},this.arguments);n.page.current=e,this.isEntity?this.service.queryEntity(this.urlRest,n).subscribe((function(n){t.onResponseQuery(n,e),t.loadedList.emit(!1)})):this.service.query(this.urlRest,n).subscribe((function(n){t.onResponseQuery(n.result,e),t.loadedList.emit(!1)}))}catch(e){console.log("Erro ao tentar buscar lista no back")}},e.prototype.onResponseQuery=function(e,t){this.payload=this.filterValues?this.filterValues.bind(this.scope)(e[this.keyPayload]):e[this.keyPayload],this.onLoadPayload.emit({result:e[this.keyPayload],page:t}),this.totalRecords=this.isEntity?e.totalElements:e.countResult},e.prototype.onHandlePage=function(e){var t=e.first/e.rows+1;this.getList(t)},e.prototype.getRowActions=function(e){return this.getRowActionsFun.call(this.scope,e)},e.prototype.handleClickActions=function(e){e.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},e.decorators=[{type:t.Component,args:[{selector:"list-rest",template:'<p-table [value]="payload" reorderableColumns="true" [rows]="10" [totalRecords]="totalRecords" [paginator]="true" [pageLinks]="8"\n [alwaysShowPaginator]="alwaysShowPaginator" [responsive]="true" [lazy]="true" (onPage)="onHandlePage($event)">\n <p-column *ngFor="let col of columns;" [field]="col[\'field\']" [header]="col[\'label\']|translate" [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <span>{{data[col[\'field\']]}}</span>\n </ng-template>\n </p-column>\n\n <p-column [style]="{\'border\':\'none\',\'height\':\'60px\',\'text-align\':\'left\',\'background-color\':\'#FFFFFF\', \'overflow\': \'inherit\'}">\n <ng-template let-data="rowData" pTemplate="body">\n <p-splitButton *ngIf="getRowActions(data).length > 1" label="{{\'hcm.payroll.action\' | translate}} ▼" [model]="getRowActions(data)"\n (onClick)="handleClickActions(button)" #button></p-splitButton>\n <button *ngIf="getRowActions(data).length <= 1" type="button" class="sds-button-aux aux-secondary" (click)="getRowActions(data)[0].command()">\n {{getRowActions(data)[0].label}}\n </button>\n </ng-template>\n </p-column>\n\n <ng-template pTemplate="emptymessage">\n {{ emptyMessage }}\n </ng-template>\n</p-table>\n',styles:["tr{border:1px solid #ddd!important}"]}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:Pt}]},e.propDecorators={emptyMessage:[{type:t.Input}],urlRest:[{type:t.Input}],keyPayload:[{type:t.Input}],columns:[{type:t.Input}],arguments:[{type:t.Input}],filterValues:[{type:t.Input}],getRowActionsFun:[{type:t.Input}],scope:[{type:t.Input}],reload:[{type:t.Input}],isEntity:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],onLoadPayload:[{type:t.Output}],loadedList:[{type:t.Output}]},e}();var At=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,X,v.HttpClientModule,b.TableModule,d.InputTextModule,_.ButtonModule,F.SplitButtonModule],declarations:[Mt],providers:[Pt],exports:[Mt]}]}],e}(),Lt=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"spinner-loader",template:"<p-progressSpinner></p-progressSpinner>\n"}]}],e}(),Ot=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,r.ProgressSpinnerModule],declarations:[Lt],exports:[Lt]}]}],e}(),Rt=function(){function e(){this.company={},this.contractNationality={},this.contractType={}}return e.prototype.setCompany=function(e){this.company=e},e.prototype.getCompanyId=function(){return this.company.companyId},e.prototype.setContractNationality=function(e){this.contractNationality=e},e.prototype.isBrazilianAdmission=function(){return"BR"===this.company.abbreviation&&"National"===this.contractNationality.key},e.prototype.isBrazilAndforeignContract=function(){return"BR"===this.company.abbreviation&&"National"!==this.contractNationality.key},e.prototype.isForeignAdmission=function(){return"BR"!==this.company.abbreviation&&"National"===this.contractNationality.key},e.prototype.isForeignAndforeignContract=function(){return"BR"!==this.company.abbreviation&&"National"!==this.contractNationality.key},e.prototype.isBrazilianCompany=function(){return"BR"===this.company.abbreviation},e.prototype.isNationalContract=function(){return"National"===this.contractNationality.key},e.prototype.getCountryID=function(){return this.company.id},Object.defineProperty(e.prototype,"contractNationalityKey",{get:function(){return this.contractNationality.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"abbreviation",{get:function(){return this.company.abbreviation},enumerable:!0,configurable:!0}),e.prototype.getCurrency=function(){return this.company.currency},e.prototype.getStructureID=function(){return this.company.structure},e.prototype.setContractType=function(e){this.contractType=e},Object.defineProperty(e.prototype,"contractTypeKey",{get:function(){return this.contractType?this.contractType.key:this.contractType},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var xt=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],providers:[Rt]}]}],e}(),Bt=y;function Nt(e){return/^\d*$/.test(e)}function jt(e){return e||!1}function qt(e){return Nt(jt(e))?Number.parseInt(e):0}var Vt=function(){function e(e){this.http=e,this.companyUseWorkstationGroupSubject=new f.Subject}return e.prototype.getCompanyIndications=function(e,t){return this.http.query("companyIndicationQuery",{companyId:e,companyIndicationType:t}).pipe(s.map((function(e){return e.result})))},e.prototype.setCompanyUseWorkstationGroup=function(e){this.companyUseWorkstationGroupSubject.next(e)},e.prototype.setStructure=function(e){this.structure=e},e.prototype.getStructure=function(){return this.structure},e.prototype.getCompanyUseWorkstationGroup=function(){return this.companyUseWorkstationGroupSubject.asObservable()},e.prototype.setUseWorkstationGroup=function(e){this.useWorkstationGroup=e},e.prototype.getUseWorkstationGroup=function(){return this.useWorkstationGroup},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Ut=function(){function e(e){this.http=e}return e.prototype.hasModule=function(e){return this.http.query("hasModule",{module:e})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Yt=y,Gt=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n,this._httpParams=new v.HttpParams}return e.prototype.lookupRequestPost=function(e,t,n,o){return void 0===n&&(n=null),this.httpPostParams=e,this.postConfigPageSize(e),this.lookupDisplayField=o,this.concatFields=n,this.postDataLookup(t)},e.prototype.postConfigPageSize=function(e){e&&(this.httpPostParams.page.size=e.page&&e.page.size?e.page.size:10,this.httpPostParams.page.current=e.page&&e.page.current?e.page.current:0)},e.prototype.lookupRequest=function(e,t,n,o,r,a,i,s){return void 0===i&&(i=[]),void 0===s&&(s=[]),this.searchLookupFields=n,this.endpoint=t,this.parameters=s,this.concatFields=r,this.concatOtherFields=i,this.lookupDisplayField=a,this.searchFields=o,this.generateLookupParameters(e),this.configHttpParamsPagination("10","0"),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup()},e.prototype.searchRequest=function(e,t,n,o,r,a,i){return void 0===a&&(a=[]),void 0===i&&(i=[]),this.endpoint=t,this.parameters=i,this.concatFields=o,this.concatOtherFields=a,this.lookupDisplayField=r,this.searchFields=n,this.generateGridParameters(e.filterData),this.configHttpParamsPagination(e.rows.toString(),Math.floor(e.first/e.rows).toString()),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup()},e.prototype.getDataLookup=function(){var e=this;return this.getUrlDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(t){var n=t.contents;return e.concatFields&&e.concatFields.length&&n.map((function(t){e.convertGridFieldValue(t),t[e.lookupDisplayField]=e.generateDisplayFieldValue(B({},t))})),t})))},e.prototype.postDataLookup=function(e){var t=this;return this.postUrlDataLookup(e,this.httpPostParams).pipe(s.map((function(e){var n=e.contents;return t.concatFields&&t.concatFields.length&&n.map((function(e){t.concatOtherFields&&t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=Yt(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.concatOtherFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.generateLookupParameters=function(e){var t=this,n="";this.searchLookupFields.forEach((function(o){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n?n+=" or "+t.getParameterByType(r.type,o,e):n=""+t.getParameterByType(r.type,o,e)})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.generateGridParameters=function(e){var t=this,n="";Object.keys(e).forEach((function(o){if(e[o]){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n+=n?" and "+t.getParameterByType(r.type,o,e[o]):t.getParameterByType(r.type,o,e[o])}})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.getParameterByType=function(e,t,n){switch(e){case h.FieldType.Date:return t+" eq '"+Yt(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";default:return"containing(lower("+t+"), lower('"+n+"'))"}},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(e){if(e&&e.length){var t="";e.map((function(e){t+=t?","+e.field+"+"+(1===e.order?"asc":"desc"):e.field+"+"+(1===e.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",t)}},Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),e.prototype.getUrlDataLookup=function(e,t){var n=this;return t?this.http.get(""+e,{params:t}).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)}))):this.http.get(""+e).pipe(s.catchError((function(e){return e&&403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed_search"),sticky:!0}),f.throwError(e)})))},e.prototype.postUrlDataLookup=function(e,t){var n=this;return t?this.http.post(""+e,B({},t)).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.post(""+e,{}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(v.HttpClient),t.ɵɵinject(P.MessageService),t.ɵɵinject(i.TranslateService))},token:e,providedIn:"root"}),e}();var Ht=y,Wt=function(){function e(e){this.httpClienteService=e}return e.prototype.getAutoComplete=function(e,t,n,o,r){var a=this.generateGridParameters(t,n,o);return this.httpClienteService.getAutoComplete(e,a,r).pipe(s.map((function(e){return e&&e.contents})))},e.prototype.getAutoCompleteQuery=function(e,t){return this.httpClienteService.query(e,t).pipe(s.map((function(e){return e&&e.result})))},e.prototype.generateGridParameters=function(e,t,n){var o=this,r="";return Object.keys(e).forEach((function(a){var i,s=t&&t.filter((function(e){return a===e.name}))[0],l="",c=s&&s.type;s||a==pe.searchValue||(c=h.FieldType.String),s||a!==pe.searchValue||(c=pe.searchValue),r&&(l=" and "),(i=o.getParameterByType(c,a,e[a],n))&&(r+=" "+l+" "+i)})),r},e.prototype.getParameterByType=function(e,t,n,o){if(!n&&e!=pe.searchValue)return t+" is null";if(n&&"not null"===n&&e!=pe.searchValue)return t+" is not null";switch(e){case h.FieldType.Date:return t+" eq '"+Ht(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";case pe.searchValue:return""+this.getParameterBySearchType(n,o);default:return this.getSearchFilterString(t,n)}},e.prototype.getParameterBySearchType=function(e,t){var n,o,r="";if(e){try{for(var a=q(Object.entries(e)),i=a.next();!i.done;i=a.next()){var s=V(i.value,2),l=s[0],c=s[1];if("code"===l&&Number(c)){var p=t?"'":"";r+=r?" or "+l+" eq "+p+c+p:l+" eq "+p+c+p}else"code"!=l&&(r+=r?" or "+this.getSearchFilterString(l,c):this.getSearchFilterString(l,c))}}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}r=r?"("+r+")":""}return r},e.prototype.getSearchFilterString=function(e,t){return"containing(lower("+e+"), lower('"+t+"'))"},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:Pe}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(Pe))},token:e,providedIn:"root"}),e}();var zt="platform/report/queries/getParameters",$t="platform/report/queries/getReportUri",Qt="platform/report/queries/getReportStatus",Kt="platform/report/queries/findReportsByName",Jt="platform/report/queries/getRunningReports",Xt="platform/report/actions/generateReport",Zt=function(){function e(e){this.http=e}return e.prototype.findReportsByName=function(e){return this.http.post(""+Kt,{name:e}).pipe(s.map((function(e){return e.reports?e.reports:[]})))},e.prototype.findReportByName=function(e){return e=e||"",this.findReportsByName(e).pipe(s.map((function(t){var n=t&&t.filter((function(t){return t.name&&t.name===e}));return n&&1==n.length?n[0]:null})))},e.prototype.getParameters=function(e,t){return this.http.post(""+zt,{id:e,reportFileId:t}).pipe(s.map((function(e){return e||null})))},e.prototype.getReportUri=function(e){return this.http.post(""+$t,{reportTicket:e}).pipe(s.map((function(e){return e&&e.reportUri})))},e.prototype.getReportStatus=function(e){return this.http.post(""+Qt,{reportTicket:e}).pipe(s.map((function(e){return e&&e.reportStatus})))},e.prototype.generateReport=function(e){return this.http.post(""+Xt,e).pipe(s.map((function(e){return e||null})))},e.prototype.getRunningReports=function(e,t){return this.http.post(""+Jt,{offset:e,limit:t,orderByDesc:!0,filterCancelled:!0})},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e.ngInjectableDef=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(v.HttpClient))},token:e,providedIn:"root"}),e}();var en=function(){function e(){this.useWorkflowValueChange=new f.Subject,this._draftJSON=new f.BehaviorSubject(null)}return e.prototype.setUseWorkflow=function(e){this.useWorkflowValueChange.next(e)},e.prototype.getUseWorkflow=function(){return this.useWorkflowValueChange.asObservable()},e.prototype.setDraftJSON=function(e){this._draftJSON.next(e)},e.prototype.getDraftJSON=function(){return this._draftJSON.asObservable()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var tn=function(){function e(){this.resetDivergentFormData()}return e.prototype.resetDivergentFormData=function(){this._divergentFormData={}},e.prototype.checkFormDisagreements=function(e){var t=this;void 0===e&&(e=!1),this.resetDivergentFormData(),this._sanitizeEmptyStrings(),e&&this._removeIdsFromFormDatas(),this._oldFormData===this._newFormData?this._throwIdenticalMessage():(Object.keys(this._oldFormData).forEach((function(e){t._oldFormData[e]!==t._newFormData[e]&&(t._divergentFormData[e]=t._createDivergencePair(e))})),Object.keys(this._newFormData).forEach((function(e){t._newFormData[e]!==t._oldFormData[e]&&(t._divergentFormData[e]=t._createDivergencePair(e))})),this._isDivergentFormDataEmpty&&this._throwIdenticalMessage())},e.prototype._removeIdsFromFormDatas=function(){[this._oldFormData,this._newFormData].forEach((function(e){delete e.id}))},e.prototype._sanitizeEmptyStrings=function(){[this._oldFormData,this._newFormData].forEach((function(e){Object.keys(e).map((function(t){""===e[t]&&(e[t]=null)}))}))},e.prototype._createDivergencePair=function(e){var t={oldValue:null,newValue:null};return t.oldValue=this._oldFormData[e],t.newValue=this._newFormData[e],t},e.prototype._throwIdenticalMessage=function(){throw new Error("The objects oldFormData and newFormData are identical")},Object.defineProperty(e.prototype,"oldFormData",{get:function(){return this._oldFormData},set:function(e){this._oldFormData=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"newFormData",{get:function(){return this._newFormData},set:function(e){this._newFormData=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"divergentFormArray",{get:function(){var e=[];return Object.entries(this._divergentFormData).map((function(t){var n=V(t,2),o=n[0],r=n[1],a={key:null,oldValue:null,newValue:null};a.key=o,a.oldValue=r.oldValue,a.newValue=r.newValue,e.push(a)})),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_isDivergentFormDataEmpty",{get:function(){return 0===Object.entries(this._divergentFormData).length},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var nn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule],providers:[Vt,Ut,Gt,Wt,Zt,en,tn]}]}],e}(),on=function(){function e(e){var t=this;this.http=e,this.actionUrl="platform/authorization/queries/checkAccess",this.resourceAddress="res://senior.com.br/hcm/payroll/",this.defaultActions=["Visualizar","Incluir","Editar","Excluir"],this._resources=[],this._attributes=[],M.user.getAuthHeader().then((function(e){t.httpOptions={headers:new v.HttpHeaders({"Content-Type":"application/json",Accept:"application/json",Authorization:e})}})),M.service.getRestUrl().then((function(e){return t.restUrl=e}))}return e.prototype.get=function(e){var t=this;return void 0===e&&(e=""),this.permissions?this.observable=f.Observable.of(this.permissions):this.observable||(this.observable=this.getPermissions().pipe(s.map((function(e){return t.permissions=e})))),this.observable.pipe(s.map((function(t){return e?t[e]:t})))},e.prototype.getAbac=function(e,t){return this.attributes=t,this.getAbacPermission(e)},e.prototype.getAbacPermission=function(e){return this.http.post(this.actionUrl,{includeFilters:!1,permissions:[{resource:""+this.resourceAddress+e,action:"Visualizar",attributes:this._attributes.map((function(e){return{attribute:e.name,value:e.value}}))}]},this.httpOptions)},e.prototype.getPermissions=function(){var e=this,t=[];return this._resources.forEach((function(n){return e.defaultActions.forEach((function(o){return t.push({action:o,resource:""+e.resourceAddress+n})}))})),this.http.post(this.actionUrl,{includeFilters:!1,permissions:U(t)},this.httpOptions).pipe(s.map((function(t){var n=t.permissions,o={};return n.forEach((function(t){var n=t.resource.replace(e.resourceAddress,"");o[n]=o[n]||{},o[n][t.action.toLowerCase()]=t.authorized})),o})))},Object.defineProperty(e.prototype,"attributes",{set:function(e){this._attributes=e},enumerable:!0,configurable:!0}),e.prototype.setResources=function(e){this._resources=e},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var rn=function(){function e(e,t,n){this.toastService=e,this.messageService=t,this.translateService=n,this.key="TOAST",this.breakLine=!1,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){var e=this;this.toastService.loadErrorMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createErrorMessage(t&&t.message),e.breakLine=t&&t.breakLine})),this.toastService.loadSuccessMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createSuccessMessage(t&&t.message),e.breakLine=t&&t.breakLine})),this.toastService.loadWarningMessages().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.createWarningMessage(t&&t.message),e.breakLine=t&&t.breakLine}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.createErrorMessage=function(e,t){this.messageService.clear(),this.messageService.add({severity:"error",summary:t||this.translateService.instant("hcm.payroll.error"),detail:e,sticky:!0,key:this.key})},e.prototype.createSuccessMessage=function(e,t){this.messageService.add({severity:"success",summary:t||this.translateService.instant("hcm.payroll.success"),detail:e,key:this.key})},e.prototype.createWarningMessage=function(e,t){this.messageService.add({severity:"warn",summary:t||this.translateService.instant("hcm.payroll.warn"),detail:e,sticky:!0,key:this.key})},e.decorators=[{type:t.Component,args:[{selector:"c-toast",template:"\n <p-toast [ngClass]=\"breakLine ? 'ui-toast-break-line' : ''\" [key]=\"key\"></p-toast>\n "}]}],e.ctorParameters=function(){return[{type:Fe},{type:I.MessageService},{type:i.TranslateService}]},e}();var an=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,X,A.ToastModule],declarations:[rn],providers:[Fe,I.MessageService],exports:[rn]}]}],e}(),sn=function(){function e(e){this.http=e}return e.prototype.getList=function(e,t){return this.http.get(""+e,{params:t})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient}]},e}();var ln=function(){function e(e){this.dataListService=e,this.rows=10,this.paginator=!0,this.first=0,this.alwaysShowPaginator=!0,this.sortMode="multiple",this.lazyLoad=new t.EventEmitter,this.loadingChange=new t.EventEmitter,this.totalRecordsChange=new t.EventEmitter,this.listDataChange=new t.EventEmitter,this.selectedDataChange=new t.EventEmitter,this.headerCheckboxToggle=new t.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.lazy||this.getlistData()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.getActions=function(e,t){return this.actions(e,t)},e.prototype.handleClickActions=function(e){e.containerViewChild.nativeElement.getElementsByClassName("ui-splitbutton-menubutton")[0].click()},e.prototype.pagination=function(e){this.lazy||this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onLazyLoad=function(e){var t=this;this.loading=!0,e.multiSortMeta&&e.multiSortMeta.length&&(this.orderBy=[],e.multiSortMeta.map((function(e){t.orderBy.push({field:e.field,direction:1===e.order?ue.ASC:ue.DESC})}))),this.getlistData(e.rows,Math.floor(e.first/e.rows))},e.prototype.onFilter=function(){this.lazy&&(this.loading=!0),this.getlistData()},Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.singularMessageRecords:this.pluralMessageRecords)},enumerable:!0,configurable:!0}),e.prototype.getlistData=function(e,t){var n=this;void 0===e&&(e=this.rows),void 0===t&&(t=this.first),this.endpoint?(this.configParameters(this.initParameters),this.configHttpParamsDisplayFields(),this.configHttpParamsPagination(e.toString(),t.toString()),this.configHttpParamsOrderBy(),this.dataListService.getList(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){n.listData=e.contents,n.totalRecords=e.totalElements,n.lazy&&n.lazyLoad.emit(n.listData)}))):this.lazy&&this.lazyLoad.emit(this.listData)},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(){if(this.orderBy&&this.orderBy.length){var e="";this.orderBy.map((function(t){e+=e?","+t.field+"+"+t.direction:t.field+"+"+t.direction})),this.httpParams=this.httpParams.set("orderby",e)}},e.prototype.configHttpParamsDisplayFields=function(){this.displayFields&&this.displayFields.length&&(this.httpParams=this.httpParams.set("displayfields",this.displayFields.toString()))},e.prototype.onHeaderCheckboxToggle=function(e){this.headerCheckboxToggle.emit(e)},e.prototype.getFieldValue=function(e,t){return t.field&&t.field.includes(".")?(t.field.split(".").map((function(t){return e=e&&e[t]})),e):e[t.field]},e.prototype.configParameters=function(e){var t="";e&&(e.forEach((function(e){t?t+=" and "+e.toString():t=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",t))},Object.defineProperty(e.prototype,"parameters",{set:function(e){this.configParameters(e),e&&(this.dataListTable&&(this.dataListTable.first=0),this.onFilter())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loading",{get:function(){return this._loading},set:function(e){this._loading=e,this.loadingChange.emit(this._loading)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listData",{get:function(){return this._listData},set:function(e){this._listData=e,this.listDataChange.emit(this._listData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedData",{get:function(){return this._selectedData},set:function(e){this._selectedData=e,this.selectedDataChange.emit(this._selectedData)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"totalRecords",{get:function(){return this._totalRecords},set:function(e){this._totalRecords=e,this.totalRecordsChange.emit(this.totalRecords)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-data-list",template:'<div *sLoadingState="loading">\n <p-table #dataListTable [id]="id" class="sds-list" [value]="listData" [columns]="columns" [paginator]="paginator" [rows]="rows"\n [first]="first" (onLazyLoad)="onLazyLoad($event)" [lazy]="lazy" [alwaysShowPaginator]="alwaysShowPaginator"\n (onPage)="pagination($event)" [totalRecords]="totalRecords" [(selection)]="selectedData" [dataKey]="dataKey"\n [sortMode]="sortMode" [responsive]="true" pageLinks="3" (onHeaderCheckboxToggle)="onHeaderCheckboxToggle($event)"\n [selectionMode]="selectionMode">\n \x3c!-- Header --\x3e\n <ng-template pTemplate="header">\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Checkbox quando há seleção de linhas --\x3e\n <th id="{{id}}-checkbox-header" *ngIf="isMultipleSelection" style="width: 2.25em">\n <p-tableHeaderCheckbox *ngIf="showHeaderCheckBox"></p-tableHeaderCheckbox>\n </th>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th id="{{id}}-col-header-{{i}}" *ngFor="let col of columns; let i = index" [pSortableColumn]="col.orderBy || col.field"\n [pSortableColumnDisabled]="!isSortable || !!col.icon" [style.width]="col.width" [pTooltip]="col.tooltip || col.label"\n tooltipPosition="top" showDelay="500">\n {{col[\'label\']}}\n \x3c!-- Quando a coluna é um ícone não exibe o ícone de ordenação da mesma --\x3e\n <p-sortIcon *ngIf="isSortable && !col.icon" [field]="col.field"></p-sortIcon>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="{{id}}-col-actions" *ngIf="actions && actions()?.length" [ngClass]="{ actionsSize: actions().length > 1, actionSize: actions().length === 1 }"></th>\n </tr>\n </ng-template>\n \x3c!-- Body --\x3e\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n <tr [pSelectableRow]="rowData">\n <td id="{{id}}-checkbox-body-{{key}}" *ngIf="isMultipleSelection">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td id="{{id}}-col-body-{{i}}-{{key}}" *ngFor="let col of columns;let i = index" [pTooltip]="col.icon ? \'\' : getFieldValue(rowData, col)"\n tooltipPosition="top" showDelay="500">\n \x3c!-- Exibe o ícone caso exista. Para isso o valor da coluna deve ser { value: string, style: object } --\x3e\n <i *ngIf="col.icon" class="{{rowData[col[\'field\']]?.value}}" [ngStyle]="rowData[col[\'field\']]?.style"\n aria-hidden="true"></i>\n \x3c!-- Quando não há ícone exibe o valor normal da coluna --\x3e\n <span>{{getFieldValue(rowData, col)}}</span>\n </td>\n\n \x3c!-- Coluna das ações --\x3e\n <td id="{{id}}-col-actions-{{key}}" class="col-actions" *ngIf="actions && actions(rowData)?.length">\n <s-button id="{{id}}-btn-actions-{{key}}" *ngIf="actions(rowData).length > 1" [label]="actionLabel" priority="default"\n [model]="getActions(rowData, key)" [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="{{id}}-btn-action-{{key}}" *ngIf="actions(rowData).length <= 1" [label]="actions(rowData, key)[0].label"\n priority="default" (click)="actions(rowData, key)[0].command()" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n\n <ng-template pTemplate="paginatorright">\n <span>{{recordsMessage}}</span>\n </ng-template>\n\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td id="{{id}}-empty-message" [attr.colspan]="columns?.length + (isMultipleSelection ? 2 : 1)">{{emptyMessage}}</td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n',encapsulation:t.ViewEncapsulation.None,styles:["app-data-list p-table .ui-table .ui-table-tbody>tr>td,app-data-list p-table .ui-table .ui-table-thead>tr>th{text-overflow:ellipsis;white-space:nowrap!important}app-data-list p-table .ui-paginator .ui-paginator-right-content{margin-left:auto}.actionsSize{width:11rem}.actionSize{width:18rem}body .ui-tooltip{max-width:22.3em!important}@media screen and (max-width:478px){.ui-paginator-right-content{display:none}}"]}]}],e.ctorParameters=function(){return[{type:sn}]},e.propDecorators={dataListTable:[{type:t.ViewChild,args:["dataListTable",{static:!1}]}],id:[{type:t.Input}],dataKey:[{type:t.Input}],rows:[{type:t.Input}],emptyMessage:[{type:t.Input}],columns:[{type:t.Input}],paginator:[{type:t.Input}],first:[{type:t.Input}],alwaysShowPaginator:[{type:t.Input}],actions:[{type:t.Input}],actionLabel:[{type:t.Input}],selectionMode:[{type:t.Input}],lazy:[{type:t.Input}],isMultipleSelection:[{type:t.Input}],isSortable:[{type:t.Input}],showHeaderCheckBox:[{type:t.Input}],sortMode:[{type:t.Input}],endpoint:[{type:t.Input}],displayFields:[{type:t.Input}],orderBy:[{type:t.Input}],singularMessageRecords:[{type:t.Input}],pluralMessageRecords:[{type:t.Input}],initParameters:[{type:t.Input}],lazyLoad:[{type:t.Output}],loadingChange:[{type:t.Output}],totalRecordsChange:[{type:t.Output}],listDataChange:[{type:t.Output}],selectedDataChange:[{type:t.Output}],headerCheckboxToggle:[{type:t.Output}],parameters:[{type:t.Input}],loading:[{type:t.Input}],listData:[{type:t.Input}],selectedData:[{type:t.Input}],totalRecords:[{type:t.Input}]},e}();var cn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,h.ButtonModule,h.LoadingStateModule,b.TableModule,g.TooltipModule],declarations:[ln],exports:[ln],providers:[sn]}]}],e}(),pn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.getDataLookup=function(e,t){var n=this;return t?this.http.get(""+e,{params:t}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.get(""+e).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var un=y,dn=function(){function e(e){this.lookupService=e,this.searchTotalRecordsLabel="hcm.payroll.lookup_search_total_records_label",this.filterLabel="hcm.payroll.lookup_generic_filter_label",this.clearLabel="hcm.payroll.lookup_generic_clean_filter_label",this.cancelLabel="hcm.payroll.lookup_generic_btn_cancel_label",this.selectLabel="hcm.payroll.lookup_btn_select_label",this.lookupEmptyMessage="hcm.payroll.lookup_auto_complete_empty_message",this.lookupSuggestions=[],this.searchGridFields=[],this.searchLookupFields=[],this.searchGridData=[],this.searchFields=[],this.parameters=[],this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.modelChange=new t.EventEmitter,this._httpParams=new v.HttpParams,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.lookupRequest=function(e){var t=this;this.generateLookupParameters(e),this.configHttpParamsPagination("10","0"),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return t.lookupSuggestions=e&&U(e.contents)}))},e.prototype.searchRequest=function(e){var t=this;this.generateGridParameters(e.filterData),this.configHttpParamsPagination(e.rows.toString(),Math.floor(e.first/e.rows).toString()),this.configHttpParamsOrderBy(e.multiSortMeta),this.getDataLookup(this.endpoint,this.httpParams).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return t.searchGridData=e&&U(e.contents)}))},e.prototype.getDataLookup=function(e,t){var n=this;return this.lookupService.getDataLookup(this.endpoint,this.httpParams).pipe(s.map((function(e){var t=e.totalElements,o=e.contents;return n.searchTotalRecords=t,n.concatFields&&n.concatFields.length&&o.map((function(e){n.convertGridFieldValue(e),e[n.lookupDisplayField]=n.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=un(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.searchGridFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.generateLookupParameters=function(e){var t=this,n="";this.searchLookupFields.forEach((function(o){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n?n+=" or "+t.getParameterByType(r.type,o,e):n=""+t.getParameterByType(r.type,o,e)})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.generateGridParameters=function(e){var t=this,n="";Object.keys(e).forEach((function(o){if(e[o]){var r=t.searchFields.filter((function(e){return o===e.name}))[0];n+=n?" and "+t.getParameterByType(r.type,o,e[o]):t.getParameterByType(r.type,o,e[o])}})),this.parameters.forEach((function(e){n?n+=" and "+e.toString():n=""+e.toString()})),this.httpParams=(new v.HttpParams).set("filter",n)},e.prototype.getParameterByType=function(e,t,n){switch(e){case h.FieldType.Date:return t+" eq '"+un(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq "+n.id;default:return"containing(lower("+t+"), lower('"+n+"'))"}},e.prototype.configHttpParamsPagination=function(e,t){this.httpParams=this.httpParams.set("size",e),this.httpParams=this.httpParams.set("offset",t)},e.prototype.configHttpParamsOrderBy=function(e){if(e&&e.length){var t="";e.map((function(e){t+=t?","+e.field+"+"+(1===e.order?"asc":"desc"):e.field+"+"+(1===e.order?"asc":"desc")})),this.httpParams=this.httpParams.set("orderby",t)}},Object.defineProperty(e.prototype,"httpParams",{get:function(){return this._httpParams},set:function(e){this._httpParams=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e,this.modelChange.emit(e)},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-lookup",template:'<div *ngIf="formGroup;else noForm" [formGroup]="formGroup">\n <s-lookup [id]="id" [dataKey]="dataKey" [formControlName]="controlName" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</div>\n\n<ng-template #noForm>\n <s-lookup [id]="id" [dataKey]="dataKey" [(ngModel)]="model" (onLookupRequest)="lookupRequest($event)"\n (onSearchRequest)="searchRequest($event)" filterLabel="{{filterLabel|translate}}" clearLabel="{{clearLabel|translate}}"\n cancelLabel="{{cancelLabel|translate}}" selectLabel="{{selectLabel|translate}}" [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{lookupEmptyMessage|translate}}" [searchGridData]="searchGridData" [searchFields]="searchFields"\n [searchTotalRecords]="searchTotalRecords" searchTotalRecordsLabel="{{searchTotalRecords}} {{searchTotalRecordsLabel|translate}}"\n [searchGridFields]="searchGridFields" [searchTitle]="searchTitle" [lookupDisplayField]="lookupDisplayField"\n [multiple]="multiple" (onSelect)="onSelect.next($event)" appendTo="body" (onClear)="onClear.next($event)"></s-lookup>\n</ng-template>\n'}]}],e.ctorParameters=function(){return[{type:pn}]},e.propDecorators={id:[{type:t.Input}],dataKey:[{type:t.Input}],concatFields:[{type:t.Input}],searchTitle:[{type:t.Input}],formGroup:[{type:t.Input}],controlName:[{type:t.Input}],multiple:[{type:t.Input}],endpoint:[{type:t.Input}],lookupDisplayField:[{type:t.Input}],searchTotalRecordsLabel:[{type:t.Input}],filterLabel:[{type:t.Input}],clearLabel:[{type:t.Input}],cancelLabel:[{type:t.Input}],selectLabel:[{type:t.Input}],lookupEmptyMessage:[{type:t.Input}],searchTotalRecords:[{type:t.Input}],lookupSuggestions:[{type:t.Input}],searchGridFields:[{type:t.Input}],searchLookupFields:[{type:t.Input}],searchGridData:[{type:t.Input}],searchFields:[{type:t.Input}],parameters:[{type:t.Input}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],modelChange:[{type:t.Output}],model:[{type:t.Input}]},e}();var mn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,h.DynamicFormModule,n.ReactiveFormsModule,i.TranslateModule],declarations:[dn],exports:[dn],providers:[pn]}]}],e}(),hn=y,yn=function(){function e(e){this.httpClienteService=e}return e.prototype.getAutoComplete=function(e,t,n,o,r){var a=this.generateGridParameters(t,n,o);return this.httpClienteService.getAutoComplete(e,a,r).pipe(s.map((function(e){return e&&e.contents})))},e.prototype.getAutoCompleteQuery=function(e,t){return this.httpClienteService.query(e,t).pipe(s.map((function(e){return e&&e.result})))},e.prototype.generateGridParameters=function(e,t,n){var o=this,r="";return Object.keys(e).forEach((function(a){var i,s=t&&t.filter((function(e){return a===e.name}))[0],l="",c=s&&s.type;s||a==pe.searchValue||(c=h.FieldType.String),s||a!==pe.searchValue||(c=pe.searchValue),r&&(l=" and "),(i=o.getParameterByType(c,a,e[a],n))&&(r+=" "+l+" "+i)})),r},e.prototype.getParameterByType=function(e,t,n,o){if(!n&&e!=pe.searchValue)return t+" is null";if(n&&"not null"===n&&e!=pe.searchValue)return t+" is not null";switch(e){case h.FieldType.Date:return t+" eq '"+hn(n).format("YYYY-MM-DD")+"'";case h.FieldType.Enum:return t+" eq '"+n+"'";case h.FieldType.Integer:return t+" eq "+n;case h.FieldType.Autocomplete:return t+" eq '"+n.id+"'";case pe.searchValue:return""+this.getParameterBySearchType(n,o);default:return this.getSearchFilterString(t,n)}},e.prototype.getParameterBySearchType=function(e,t){var n,o,r="";if(e){try{for(var a=q(Object.entries(e)),i=a.next();!i.done;i=a.next()){var s=V(i.value,2),l=s[0],c=s[1];if("code"===l&&Number(c)){var p=t?"'":"";r+=r?" or "+l+" eq "+p+c+p:l+" eq "+p+c+p}else"code"!=l&&(r+=r?" or "+this.getSearchFilterString(l,c):this.getSearchFilterString(l,c))}}catch(e){n={error:e}}finally{try{i&&!i.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}r=r?"("+r+")":""}return r},e.prototype.getSearchFilterString=function(e,t){return"containing(lower("+e+"), lower('"+t+"'))"},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var fn=y,gn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translateService=n}return e.prototype.lookupRequestPost=function(e,t,n,o){return void 0===n&&(n=null),this.httpPostParams=e,this.postConfigPageSize(e),this.lookupDisplayField=o,this.concatFields=n,this.postDataLookup(t)},e.prototype.postConfigPageSize=function(e){e&&(this.httpPostParams.page.size=e.page&&e.page.size?e.page.size:10,this.httpPostParams.page.current=e.page&&e.page.current?e.page.current:0)},e.prototype.postDataLookup=function(e){var t=this;return this.postUrlDataLookup(e,this.httpPostParams).pipe(s.map((function(e){var n=e.contents;return t.concatFields&&t.concatFields.length&&n.map((function(e){t.concatOtherFields&&t.convertGridFieldValue(e),e[t.lookupDisplayField]=t.generateDisplayFieldValue(B({},e))})),e})))},e.prototype.convertLookupFieldValue=function(e,t){if(e)switch(t.type){case h.FieldType.Date:e=fn(e).format("L");break;case h.FieldType.Enum:var n=t.options.filter((function(t){return t.value===e}))[0];e=n?n.label:e}return e},e.prototype.convertGridFieldValue=function(e){e&&this.concatOtherFields.forEach((function(t){switch(t.type){case h.FieldType.Enum:var n=t.options.filter((function(n){return n.value===e[t.name]}))[0];e[t.name]=n?n.label:e[t.name]}}))},e.prototype.generateDisplayFieldValue=function(e){var t=this,n="";return this.concatFields.forEach((function(o){var r=t.convertLookupFieldValue(e[o.name],o);r&&(n?n+=" - "+r:n=r)})),n},e.prototype.postUrlDataLookup=function(e,t){var n=this;return t?this.http.post(""+e,B({},t)).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)}))):this.http.post(""+e,{}).pipe(s.catchError((function(e){return 403===e.status&&n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.permission_error_not_allowed"),sticky:!0}),f.throwError(e)})))},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:v.HttpClient},{type:I.MessageService},{type:i.TranslateService}]},e}();var bn=function(){function e(e,t){var n=e.filterData;this.name=n.name||null,this.code=n.code||null,this.searchText=n.searchText||null,this.companyId=n.headoffice||null,this.companyBranchId=n.branchoffice&&n.branchoffice.id||null,this.departmentId=n.department&&n.department.tableId||null,this.costcenterId=n.costcenter&&n.costcenter.id||null,this.jobpositionIds=n.jobposition||null,this.syndicateId=n.syndicate&&n.syndicate.id||null,this.shiftId=n.workshiftScale||null,this.workshiftId=n.workshiftId&&n.workshiftId.id||null,this.workshiftGroupId=n.workshiftGroupId&&n.workshiftGroupId.id||null,this.intervalGroupId=n.intervalGroupId&&n.intervalGroupId.is||null,this.scaleTeamId=n.scaleTeamId&&n.scaleTeamId.id||null,this.scaleCategoryId=n.scaleCategoryId&&n.scaleCategoryId.id||null,this.employmentRelationshipId=n.employmentRelationshipId&&n.employmentRelationshipId.id||null,this.contractType=n.contractType||null,this.expenseNatureId=n.expenseNatureId&&n.expenseNatureId.id||null,this.allowDeficient=n.allowDeficient||null,this.disabilityIds=n.disabilityIds||null,this.listExpired=!!n.hasOwnProperty("listExpired")&&n.listExpired,this.manager=n.manager?n.manager.tableId:null,this.referenceDate=t||null,this.page={current:e.first?e.first:0,size:e.rows?e.rows:10}||null}return e.prototype.getToFilter=function(){return this.jobpositionIds=this.convertListIds(this.jobpositionIds),this.disabilityIds=this.convertListIds(this.disabilityIds),this},e.prototype.convertListIds=function(e){if(e)return e.map((function(e){return e.tableId?e.tableId:e.id}))},e}();var vn=y,In=function(){function e(e,n,o,r){var a=this;this.translate=e,this.cd=n,this.autocompleteParametersService=o,this.lookupParametersService=r,this.currentCompanyId=null,this.currentCompanyName=null,this.onSelect=new t.EventEmitter,this.onClear=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.companyBranchId=null,this.lookupSuggestions=[],this.searchGridData=[],this.suggestionsObservable=new f.BehaviorSubject([]),this.totalRecords=0,this.valueEnumShift=[{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FIRST_SHIFT"),value:"0",enum:"FIRST_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_SECOND_SHIFT"),value:"1",enum:"SECOND_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_THIRD_SHIFT"),value:"2",enum:"THIRD_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_FOURTH_SHIFT"),value:"3",enum:"FOURTH_SHIFT"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_MIXED"),value:"4",enum:"MIXED"},{label:this.translate.instant("hcm.payroll.enum_WorkshiftScale_GENERAL"),value:"5",enum:"GENERAL"}],this.concatFieldsName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String}),new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String})],this.concatName=[new h.FormField({name:"code",label:this.translate.instant("hcm.payroll.code"),type:h.FieldType.String})],this.gridFields=[new h.FormField({name:"name",label:this.translate.instant("hcm.payroll.employees_addition_workstation"),type:h.FieldType.String}),new h.FormField({name:"manager",label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),type:h.FieldType.String})],this.searchFields=U(this.concatName,[{name:"name",label:this.translate.instant("hcm.payroll.movimentation_name"),type:h.FieldType.String},{name:"headoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_company"),dataKey:"id",appendTo:"body",fullWidth:!0,suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"branchoffice",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_branch"),dataKey:"id",appendTo:"body",fullWidth:!0,onRemove:function(){return a.companyBranchId=null},onSelect:function(e){var t=e.id;return a.companyBranchId=t},onSearch:function(e){a.getAutocomplete("company",e?{companyname:e,code:e}:null,"code","companyname",{headquarter:a.currentCompanyId?a.currentCompanyId:"not null"})},suggestionsObservable:this.suggestionsObservable,displayField:"companyname"},{name:"manager",type:h.FieldType.Autocomplete,multiple:!1,label:this.translate.instant("hcm.payroll.workstation_form_lookup_search_manager_label"),appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteManager",{valueSearch:e||"",companyId:{tableId:a.currentCompanyId},companyBranchId:{tableId:a.companyBranchId?a.companyBranchId:""}})},suggestionsObservable:this.suggestionsObservable,displayField:"manager"},{name:"department",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.movimentation_historical_department_tab"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteDepartmentQuery",{searchText:e||"",companyId:a.currentCompanyId,referenceDate:vn(y.now()).format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"costcenter",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_cost_center"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("costcenter",e?{name:e,code:e}:null,"code","name",a.currentCompanyId?{company:a.currentCompanyId}:null,!0,he.ORGANIZATION_REGISTER)},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"jobposition",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.movimentation_historical_job_position_tab"),dataKey:"tableId",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocompleteQuery("autocompleteJobpositionQuery",{searchText:e||"",companyId:a.currentCompanyId,creationDate:vn().format("YYYY-MM-DD"),expirationDate:vn().format("YYYY-MM-DD")})},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"syndicate",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_syndicate"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("syndicate",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"workshiftScale",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.SHIFT"),showClear:!0,size:{md:12},onChange:function(){a.resetDependenciesOfShift(!0)},options:this.valueEnumShift},{name:"workshiftId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("workshift",e?{description:e,code:e}:null,"code","description",a.workstationFilterForm.get("workshiftScale").value?{workshiftScale:a.valueEnumShift[a.workstationFilterForm.get("workshiftScale").value].enum}:null)},onSelect:function(){a.resetDependenciesOfShift()},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"workshiftGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_workshift-group"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("workshiftGroup",e?{code:e}:null,"code","baseDate",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"baseDate"},{name:"intervalGroupId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_class_interval"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("intervalGroup",e?{description:e,code:e}:null,"code","description",a.workstationFilterForm.get("workshiftId").value?{workshift:a.workstationFilterForm.get("workshiftId").value.id}:null)},suggestionsObservable:this.suggestionsObservable,displayField:"description"},{name:"scaleTeamId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_team"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("scaleTeam",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"scaleCategoryId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_scale_category"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("scaleCategory",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"employmentRelationshipId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_employment_relationship"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("employmentRelationship",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"contractType",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.employees_temporary_contract_temporary_contract_type"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Employee"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Manager"),value:1},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FarmWorker"),value:2},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Retired"),value:3},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Trainee"),value:4},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Apprentice"),value:5},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_FixedDueDate"),value:6},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_RetiredManager"),value:7},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_PublicAgent"),value:8},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_Teacher"),value:9},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_CooperativeWorker"),value:10},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_DomesticWorker"),value:11},{label:this.translate.instant("hcm.payroll.enum_EmployeeContractType_TeacherFixedDueDate"),value:12}]},{name:"expenseNatureId",type:h.FieldType.Autocomplete,label:this.translate.instant("hcm.payroll.employees_addition_expense_nature"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("expenseNature",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"},{name:"allowDeficient",type:h.FieldType.Enum,label:this.translate.instant("hcm.payroll.allow_deficient"),showClear:!0,size:{md:12},options:[{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_No"),value:"0"},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Also"),value:1},{label:this.translate.instant("hcm.payroll.enum_DecisionPcD_Only"),value:2}]},{name:"disabilityIds",type:h.FieldType.Autocomplete,multiple:!0,label:this.translate.instant("hcm.payroll.employees_addition_disability"),dataKey:"id",appendTo:"body",fullWidth:!0,onSearch:function(e){a.getAutocomplete("disability",e?{name:e,code:e}:null,"code","name")},suggestionsObservable:this.suggestionsObservable,displayField:"name"}]),this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var e=this.workstationFilterForm.get("headoffice");e.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),e.disable()},Object.defineProperty(e.prototype,"workstationFilterForm",{get:function(){return this.workstationgroupEl&&this.workstationgroupEl.formGroupDialog},enumerable:!0,configurable:!0}),e.prototype.selectOption=function(e){this.onSelect.emit(e)},e.prototype.onClearItem=function(e){return N(this,void 0,void 0,(function(){return j(this,(function(t){switch(t.label){case 0:return[4,this.onClear.emit(e)];case 1:return t.sent(),this.form.get(this.name).reset(),[2]}}))}))},e.prototype.resetDependenciesOfShift=function(e){void 0===e&&(e=!1),e&&this.workstationFilterForm.get("workshiftId").reset(),this.workstationFilterForm.get("workshiftGroupId").reset(),this.workstationFilterForm.get("intervalGroupId").reset()},e.prototype.searchRequest=function(e){var t=this,n=this.workstationFilterForm.get("headoffice"),o=e&&e.filterData;n.setValue({id:this.currentCompanyId,companyname:this.currentCompanyName}),e=B({},this.getValueEvent(e,o));var r=this.getHireDate().replace(/\'/g,""),a=new bn(e,r);this.lookupParametersService.lookupRequestPost(a.getToFilter(),"hcm/payroll/queries/workstationgroupFilterQuery",U(this.concatFieldsName),"name").pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){o?t.searchGridData=e&&U(e.contents):t.lookupSuggestions=e&&U(e.contents),t.totalRecords=e&&e.totalPages}))},e.prototype.getValueEvent=function(e,t){return t?e.filterData.headoffice=this.currentCompanyId:e={filterData:{headoffice:this.currentCompanyId,searchText:e}},e},e.prototype.getAutocompleteQuery=function(e,t){var n=this;this.autocompleteParametersService.getAutoCompleteQuery(e,t).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"autocompleteDepartmentQuery"===e?t.filter((function(e){e.fields&&e.fields[0]&&(e.name=e.fields[1].value+" - "+e.fields[0].value)})):"autocompleteJobpositionQuery"===e?t.filter((function(e){e.fields&&e.fields[0]&&e.fields[1]&&(e.name=e.fields[0].value+" - "+e.fields[1].value)})):"autocompleteManager"===e&&t.map((function(e){e.manager=e.fields[0].value?e.fields[0].value:e.fields[3].value})),n.suggestionsObservable.next(t)}))},e.prototype.getAutocomplete=function(e,t,n,o,r,a,i){var l=this;void 0===r&&(r=null),void 0===a&&(a=!1),void 0===i&&(i=he.PAYROLL),this.autocompleteParametersService.getAutoComplete(e,B({},r,{searchValue:B({},t)}),this.searchFields,a,i).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){"workshiftGroup"===e&&t.filter((function(e){if(e.baseDate){var t=vn(e.baseDate,"YYYY-MM-DD");if(t.isValid())return e.baseDate=t.format(l.dateFormat)}})),l.suggestionsObservable.next(l.getConcatFields(t,n,o))}))},e.prototype.getConcatFields=function(e,t,n){return n&&t&&e.filter((function(e){e[n]=e[t]+" - "+e[n]})),e},e.prototype.getHireDate=function(){var e=vn(this.hireDate).format(this.dateFormat);return e?"'"+ze(e,this.dateFormat)+"'":"'"+Qe()+"'"},e.decorators=[{type:t.Component,args:[{selector:"c-workstationgroup-lookup",template:'<div [formGroup]="form">\n <s-lookup\n #workstationgroupEl\n id="workstationGroup"\n dataKey="code"\n (onSelect)="selectOption($event)"\n (onClear)="onClearItem($event)"\n [formControlName]="name"\n (onLookupRequest)="searchRequest($event)"\n (onSearchRequest)="searchRequest($event)"\n filterTitle="{{ \'hcm.payroll.filters\' | translate }}"\n filterLabel="{{ \'hcm.payroll.filter\' | translate }}"\n clearLabel="{{ \'hcm.payroll.lookup_generic_clean_filter_label\' | translate }}"\n cancelLabel="{{ \'hcm.payroll.cancel\' | translate }}"\n selectLabel="{{ \'hcm.payroll.lookup_btn_select_label\' | translate }}"\n [disabled]="disabled"\n [lookupSuggestions]="lookupSuggestions"\n lookupEmptyMessage="{{ \'hcm.payroll.lookup_auto_complete_empty_message\' | translate }}"\n [searchGridData]="searchGridData"\n [searchFields]="searchFields"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n [searchTotalRecords]="totalRecords"\n searchTotalRecordsLabel="{{ totalRecords }} {{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [searchGridFields]="gridFields"\n searchTitle="{{ \'hcm.payroll.employees_addition_workstation\' | translate }}"\n lookupDisplayField="name"\n ></s-lookup>\n\n</div>\n'}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:t.ChangeDetectorRef},{type:yn},{type:gn}]},e.propDecorators={workstationgroupEl:[{type:t.ViewChild,args:["workstationgroupEl",{static:!1}]}],currentCompanyId:[{type:t.Input}],currentCompanyName:[{type:t.Input}],hireDate:[{type:t.Input}],dateFormat:[{type:t.Input}],required:[{type:t.Input}],disabled:[{type:t.Input}],form:[{type:t.Input}],name:[{type:t.Input}],onSelect:[{type:t.Output}],onClear:[{type:t.Output}],onBlur:[{type:t.Output}]},e}();var kn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[n.FormsModule,h.DynamicFormModule,n.ReactiveFormsModule,c.CommonModule,i.TranslateModule],declarations:[In],exports:[In],providers:[yn,gn]}]}],e}(),Sn=function(){function e(e,n,o,r,a){var i=this;this.confirmationService=e,this.translateService=n,this.activatedRoute=o,this.cd=r,this.formBuilder=a,this.recordByRow=1,this.showDateWhen=!1,this.isEditMode=!1,this.isViewMode=!1,this.withSideBar=!0,this.visibleChange=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.orderBy={field:"displayDateWhen",direction:ue.DESC},this.bankAccountItemInput={},this.totalRecords=0,this.actionLabel=this.translateService.instant("hcm.payroll.entries_query_actions_total_title"),this.loading=!0,this.listData=[],this.listDataNoPage=[],this.cols=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"displayDateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account_type"),field:"accountType"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_digit"),field:"digit"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"}],this.actions=function(e,t){return void 0===e&&(e={}),[{visible:i.isEditMode,label:i.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){e.index=t,i.bankAccountItemInput={currentItem:e,listData:i.listDataNoPage,isEditMode:!1},i.visible=!0}},{visible:!(i.isEditMode||!i.withSideBar),label:i.translateService.instant("hcm.payroll.edit"),command:function(){e.index=t,i.bankAccountItemInput={currentItem:e,listData:i.listDataNoPage,isEditMode:!0},i.visible=!0}},{visible:!i.isEditMode,label:i.translateService.instant("hcm.payroll.delete"),command:function(){i.loading=!0,i.deleteAnnuityItem(t)}}]},this.createFormGroup()}return e.prototype.ngOnInit=function(){this.formGroup.setControl(this.fieldFormGroup,this.historicalBankAccountList)},e.prototype.createFormGroup=function(){this.historicalBankAccountList=this.formBuilder.group({historicalBankAccountList:this.formBuilder.control(null)})},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.onLazyLoad=function(e){var t=this,n=e&&e.first?e.first:0,o=e&&e.rows?e.rows:this.recordByRow,r=this.getHistoricalBankAccountList();this.listData=[],this.totalRecords=null,e&&e.multiSortMeta&&e.multiSortMeta.length&&e.multiSortMeta.map((function(e){t.orderBy.field=e.field,t.orderBy.direction=1===e.order?ue.ASC:ue.DESC})),r&&r.length?(this.totalRecords=r.length,this.listData=r,this.listDataNoPage=U(r),this.listData.sort(at(this.orderBy.field,this.orderBy.direction)),this.listData=this.listData.slice(n,n+o)):this.listDataNoPage=[],(this.isEditMode||r&&1===r.length)&&this.refreshCssInIE11(),this.loading=!1},e.prototype.refreshCssInIE11=function(){/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&setTimeout((function(){var e=document.getElementsByClassName("row0");e&&e[0]&&(e[0].className="refresh")}),1)},e.prototype.add=function(){this.bankAccountItemInput={},this.visible=!0},e.prototype.deleteAnnuityItem=function(e){var t=U(this.getHistoricalBankAccountList());t.sort(at(this.orderBy.field,this.orderBy.direction)),delete t[e],t=t.filter((function(e){return e})),this.historicalBankAccountList.get("historicalBankAccountList").setValue(t),this.verifyTotalPercentage(),this.onLazyLoad()},e.prototype.getHistoricalBankAccountList=function(){return this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value&&this.historicalBankAccountList.get("historicalBankAccountList").value.length?this.historicalBankAccountList.get("historicalBankAccountList")&&this.historicalBankAccountList.get("historicalBankAccountList").value:[]},e.prototype.addItemInList=function(e){var t=e&&e.index>=0?e.index:null,n=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[];if(null!=t)n[t]=e,delete e.index;else{if(Ye(e.customFields)&&Object.keys(e.customFields).length){var o=Xe(e.customFields);e.customFields=U(o)}e.dateWhen=this.dateWhen,n.push(e)}this.historicalBankAccountList.get("historicalBankAccountList").setValue(n),this.verifyTotalPercentage(),this.onLazyLoad({first:this.getNumberPageByIndex(t,n)})},e.prototype.getNumberPageByIndex=function(e,t){if(e){var n=t.length,o=this.recordByRow-1;return Math.ceil(n/this.recordByRow)*this.recordByRow-o-1}return null},e.prototype.verifyTotalPercentage=function(){var e=this.getHistoricalBankAccountList()?this.getHistoricalBankAccountList():[],t=[];if(!e.length)return this.msgTotalLimitByPercentage=null;e.filter((function(e){return t.push(e&&e.percentage)}));var n=t.reduce((function(e,t){return e+t}),0);this.msgTotalLimitByPercentage=100===n?this.translateService.instant("hcm.payroll.historical_bank_account_msg_limit_total_by_percentage"):null},Object.defineProperty(e.prototype,"scopedActions",{get:function(){return this.actions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"recordsMessage",{get:function(){return(this.totalRecords||0)+" "+(1===this.totalRecords?this.translateService.instant("hcm.payroll.admission_register"):this.translateService.instant("hcm.payroll.admission_registers"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getTooltipAndDisableButtonAdd",{get:function(){return this.dateWhen?null:this.msgTooltipAdd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dateWhen",{get:function(){return this._dateWhen},set:function(e){var t=this;this._dateWhen=e,this._dateWhen&&this.listData.filter((function(e){return e.dateWhen=t._dateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayDateWhen",{get:function(){return this._displayDateWhen},set:function(e){var t=this;this._displayDateWhen=e,this._displayDateWhen&&this.listData.filter((function(e){return e.displayDateWhen=t._displayDateWhen}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addListData",{set:function(e){this.loading=!0,this.historicalBankAccountList.get("historicalBankAccountList").patchValue(e),this.verifyTotalPercentage(),this.onLazyLoad()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.visible=!1},e.decorators=[{type:t.Component,args:[{selector:"c-historical-bank-account",template:'<s-sidebar *ngIf="withSideBar" [visible]="visible" (visibleChange)="close()"\n header="{{\'hcm.payroll.historical_bank_account_title_form\'|translate}}">\n<bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</s-sidebar>\n\n<div *ngIf="!withSideBar">\n <bank-account [(visible)]="visible"\n [isEditAndViewValue]="bankAccountItemInput"\n [currency]="currency"\n [customEntity]="customEntity"\n [customService]="customService"\n [getListBankAccount]="listDataNoPage"\n [withSideBar]="false"\n [isViewMode]="isViewMode"\n (bankAccountItemToList)="addItemInList($event)"></bank-account>\n</div>\n\n<div class="ui-g-1" *ngIf="withSideBar && !isEditMode">\n <div class="form-group ">\n <s-button id="ta-addPayAnnuity"\n [disabled]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n (onClick)="add()"\n [pTooltip]="getTooltipAndDisableButtonAdd || msgTotalLimitByPercentage"\n tooltipPosition="top"\n label="{{\'hcm.payroll.historical_bank_account_add\'|translate}}"></s-button>\n </div>\n</div>\n<div class="ui-g-12">\n <p-table\n id="table-annuity"\n [value]="listData"\n [columns]="cols"\n (onLazyLoad)="onLazyLoad($event)"\n [lazy]="true"\n [scrollable]="true"\n [paginator]="true"\n [totalRecords]="totalRecords"\n [sortMode]="\'multiple\'"\n *sLoadingState="loading"\n [rows]="recordByRow"\n dataKey="id">\n <ng-template pTemplate="colgroup" let-coumns>\n <colgroup>\n <col [ngClass]="\'col-default-s\'" *ngIf="showDateWhen">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-l\'">\n <col [ngClass]="\'col-default-m\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-default-s\'" *ngIf="withSideBar">\n <col [ngClass]="\'col-default-m\'">\n <col [ngClass]="\'col-action\'">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n \x3c!-- Cabeçalhos quando da table é permitido ordenar as colunas --\x3e\n <tr>\n \x3c!-- Cabeçalhos das colunas da tabela --\x3e\n <th\n *ngIf="showDateWhen"\n [pSortableColumn]="\'displayDateWhen\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header" id="table-0">\n <span\n id="table-annuity-s-0">{{ \'hcm.payroll.historical_bank_account_label_date_when\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_date_when\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bank\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankBranch\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_bank_branch\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_bank_branch\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'accountType\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account_type\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account_type\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'bankAccount\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_account\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_account\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_account\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th *ngIf="withSideBar"\n [pSortableColumn]="\'digit\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_digit\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_digit\' | translate"></p-sortIcon>\n </div>\n </th>\n\n <th\n [pSortableColumn]="\'percentage\'"\n [pTooltip]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"\n tooltipPosition="top"\n showDelay="500"\n >\n <div class="senior-header">\n <span>{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</span>\n <p-sortIcon class="p-sorticon-status"\n [field]="\'hcm.payroll.historical_bank_account_label_percentage\' | translate"></p-sortIcon>\n </div>\n </th>\n \x3c!-- Cabeçalho da coluna de ações --\x3e\n <th id="col-actions"></th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-key="rowIndex">\n\n <tr [ngClass]="\'row\'+key" [pSelectableRow]="rowData">\n <td *ngIf="showDateWhen" [pTooltip]="rowData?.displayDateWhen" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.displayDateWhen }}</span>\n </td>\n <td [pTooltip]="rowData?.bank?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bank?.name }}</span>\n </td>\n <td [pTooltip]="rowData?.bankBranch?.name" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankBranch?.name }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.accountType?.value" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.accountType?.value }}</span>\n </td>\n <td [pTooltip]="rowData?.bankAccount" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.bankAccount }}</span>\n </td>\n <td *ngIf="withSideBar" [pTooltip]="rowData?.digit" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.digit }}</span>\n </td>\n <td [pTooltip]="rowData?.percentage" tooltipPosition="top"\n showDelay="500">\n <span>{{ rowData?.percentage }}</span>\n </td>\n <td id="col-actions-{{key}}" class="col-actions "\n *ngIf="actions && actions(rowData, key)?.length">\n <s-button id="table-admission-btn-actions-{{key}}"\n *ngIf="actions(rowData, key).length > 1" [label]="actionLabel"\n priority="default" [model]="scopedActions(rowData, key)"\n [disabled]="false" [auxiliary]="true"></s-button>\n\n <s-button id="table-admission-btn-action-{{key}}"\n *ngIf="actions(rowData, key).length <= 1"\n [label]="scopedActions(rowData, key)[0].label"\n priority="default"\n (click)="scopedActions(rowData, key)[0].command()"\n [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="emptymessage" let-columns>\n <tr>\n <td [attr.colspan]="columns.length +2">\n {{\'hcm.payroll.admission_empty_message\'|translate}}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span *ngIf="totalRecords">{{recordsMessage}}</span>\n </ng-template>\n </p-table>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]}]}],e.ctorParameters=function(){return[{type:I.ConfirmationService},{type:i.TranslateService},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef},{type:n.FormBuilder}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!1}]}],formGroup:[{type:t.Input}],fieldFormGroup:[{type:t.Input}],_dateWhen:[{type:t.Input}],_displayDateWhen:[{type:t.Input}],recordByRow:[{type:t.Input}],showDateWhen:[{type:t.Input}],msgTooltipAdd:[{type:t.Input}],isEditMode:[{type:t.Input}],isViewMode:[{type:t.Input}],currency:[{type:t.Input}],customEntity:[{type:t.Input}],customService:[{type:t.Input}],withSideBar:[{type:t.Input}],dateWhen:[{type:t.Input}],displayDateWhen:[{type:t.Input}],addListData:[{type:t.Input}],visible:[{type:t.Input}]},e}();var _n=function(){function e(e,o,r,a){this.translate=e,this.formBuilder=o,this.route=r,this.cd=a,this.withSideBar=!0,this.isEditMode=!1,this.visibleChange=new t.EventEmitter,this.bankAccountItemToList=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.initialValidatorOfPercentage=[n.Validators.required,n.Validators.min(.01)],this.initialValidatorOfBankAccount=[n.Validators.required,n.Validators.maxLength(12)],this.labelBtnAdd="hcm.payroll.employees_add",this.maxValuePercentage=100,this.visibleBtnSave=!0,this.isView=!1,this.createFormGroup(),this.registerSubjects()}return e.prototype.validateDuplicateBankAccount=function(e,t,n,o){return function(r){var a=r&&r.value,i=!1;return e.filter((function(e,r){if(r!=e.index&&a&&e.bank&&e.bank.tableId===n&&e.bankBranch&&e.bankBranch.tableId===o&&e.accountType&&e.accountType.key===t&&Number(e.bankAccount)===Number(a))return i=!0})),i?{bankAccountDuplicate:!0}:null}},e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.unsubscribe()},e.prototype.registerSubjects=function(){},e.prototype.createFormGroup=function(){this.bankAccountFormGroup=this.formBuilder.group({id:this.formBuilder.control(null),index:this.formBuilder.control(null),employee:this.formBuilder.control({value:{tableId:null},disabled:!0}),dateWhen:this.formBuilder.control(null),displayDateWhen:this.formBuilder.control(null),bank:this.formBuilder.control(null,n.Validators.required),bankBranch:this.formBuilder.control(null,n.Validators.required),accountType:this.formBuilder.control(null,n.Validators.required),bankAccount:this.formBuilder.control(null,n.Validators.compose(U(this.initialValidatorOfBankAccount))),digit:this.formBuilder.control(null,n.Validators.maxLength(3)),percentage:this.formBuilder.control(null,n.Validators.compose(U(this.initialValidatorOfPercentage,[n.Validators.max(this.maxValuePercentage)]))),customFields:this.formBuilder.control(null)})},e.prototype.onSelectBank=function(){this.cleanBankInformation(),this.beforeSetBankAccountValidator()},e.prototype.onClearBank=function(){this.bankAccountFormGroup.get("bank").reset(),this.cleanBankInformation(),this.beforeSetBankAccountValidator()},e.prototype.cleanBankInformation=function(){it(this.bankAccountFormGroup,["bankBranch"])},e.prototype.onClearBankBranch=function(){this.bankAccountFormGroup.get("bankBranch").reset(),this.beforeSetBankAccountValidator()},e.prototype.onClearAccountType=function(){this.bankAccountFormGroup.get("accountType").reset(),this.beforeSetBankAccountValidator()},Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){this._visible=e,this.visibleChange.emit(this.visible)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEditAndViewValue",{set:function(e){this.resetForm(),this.visibleBtnSave=!0,e&&e.currentItem&&Object.keys(e.currentItem).length?(this.bankAccountFormGroup.patchValue(this.convertDTOToShowWithCustomFields(B({},e.currentItem))),this.labelBtnAdd="hcm.payroll.employees_update",this.setValidatorsAccordingList(e.listData,e.currentItem.index),this.isView||this.configEnableFields(e&&e.isEditMode)):this.labelBtnAdd="hcm.payroll.employees_add"},enumerable:!0,configurable:!0}),e.prototype.convertDTOToShowWithCustomFields=function(e){var t=B({},e);return t.customFields=Ze(t.customFields),t},e.prototype.configEnableFields=function(e){this.visibleBtnSave=e,nt(this.bankAccountFormGroup,e,["bank","bankBranch","accountType","bankAccount","digit","percentage","customFields"],[])},e.prototype.close=function(){this.resetForm(),this.visible=!1},e.prototype.addItem=function(){this.bankAccountFormGroup.updateValueAndValidity(),et.call(this.bankAccountFormGroup),this.bankAccountFormGroup.valid&&(this.employeeId&&this.bankAccountFormGroup.get("employee").setValue({tableId:this.employeeId,name:""}),this.bankAccountItemToList.emit(this.bankAccountFormGroup.getRawValue()),this.visible=!1,this.resetForm())},e.prototype.resetForm=function(){this.bankAccountFormGroup.reset(),this.labelBtnAdd="hcm.payroll.employees_add",this.customFields&&this.customFields.formGroup&&this.customFields.formGroup.reset()},e.prototype.getBankTableId=function(){return this.bankAccountFormGroup.controls.bank.value?"'"+this.bankAccountFormGroup.controls.bank.value.tableId+"'":null},Object.defineProperty(e.prototype,"percentagePlaceholder",{get:function(){return"0"+(this.currency&&this.currency.decimalSeparator)+"00"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionsPercentage",{get:function(){return B({},this.getOptions(),{precision:2})},enumerable:!0,configurable:!0}),e.prototype.getOptions=function(){return{prefix:"",thousands:this.currency.thousandsSeparator,decimal:this.currency.decimalSeparator}},Object.defineProperty(e.prototype,"getListBankAccount",{set:function(e){e?this.setValidatorsAccordingList(e):this.resetForm()},enumerable:!0,configurable:!0}),e.prototype.setValidatorsAccordingList=function(e,t){void 0===t&&(t=null),this.bankAccountList=e&&e.length?U(e):[];var n=[];this.bankAccountList&&this.bankAccountList.length&&this.bankAccountList.filter((function(e,o){e.percentage&&o!=t&&n.push(e.percentage)})),this.beforeSetBankAccountValidator(),this.validatePercentageValid(n)},e.prototype.beforeSetBankAccountValidator=function(){var e=this.bankAccountFormGroup.get("bankAccount"),t=this.bankAccountFormGroup.get("accountType")&&this.bankAccountFormGroup.get("accountType").value&&this.bankAccountFormGroup.get("accountType").value.key,o=this.bankAccountFormGroup.get("bank")&&this.bankAccountFormGroup.get("bank").value&&this.bankAccountFormGroup.get("bank").value.tableId,r=this.bankAccountFormGroup.get("bankBranch")&&this.bankAccountFormGroup.get("bankBranch").value&&this.bankAccountFormGroup.get("bankBranch").value.tableId;o&&r&&t&&this.bankAccountList&&this.bankAccountList.length?(e.setValidators(n.Validators.compose(U(this.initialValidatorOfBankAccount,[this.validateDuplicateBankAccount(this.bankAccountList,t,o,r)]))),e.updateValueAndValidity()):e.setValidators(n.Validators.compose(U(this.initialValidatorOfBankAccount)))},e.prototype.validatePercentageValid=function(e){var t=this.bankAccountFormGroup.get("percentage");this.maxValuePercentage=e.reduce((function(e,t){return e-t}),100),t.setValidators(n.Validators.compose(U(this.initialValidatorOfPercentage,[n.Validators.max(this.maxValuePercentage)]))),t.updateValueAndValidity()},Object.defineProperty(e.prototype,"isViewMode",{set:function(e){this.isView=!(!e||this.withSideBar),this.configEnableFields(!this.isView),this.isView||this.resetForm()},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"bank-account",template:'<div id="main">\n <form [formGroup]="bankAccountFormGroup" autocomplete="off">\n <div class="ui-fluid">\n <div class="ui-g">\n \x3c!-- Banco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank\' | translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="Bank"\n [order]="[\'BankCode\',\'BankNameI18n\']"\n [fields]="[\'BankCode\',\'BankNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankCode" keyName="BankNameI18n"\n itemSelect="bank" name="bank"\n [form]="bankAccountFormGroup"\n (onSelect)="onSelectBank()"\n (onClear)="onClearBank()"\n id="ta-bankName"></input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bank\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Agência--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_bank_branch\'|translate}}</label>\n <input-rest-auto-complete [dropdown]="true" table="BankBranch"\n [order]="[\'BankBranchCode\']"\n [fields]="[\'BankBranchCode\',\'BankBranchNameI18n\']"\n placeholder="{{\'hcm.payroll.suggestions\' | translate}}"\n emptyMessage="{{\'hcm.payroll.not_suggestions\' | translate}}"\n keyCode="BankBranchCode" keyName="BankBranchNameI18n"\n itemSelect="bankBranch" name="bankBranch"\n [conditions]="[{ \'fields\': [\'BankBranchBank\'], \'expression\' : \'EQUAL\', \'value\': getBankTableId() }]"\n [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-bankBranch">\n </input-rest-auto-complete>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankBranch\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!-- Tipo conta --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.employees_addition_account_type\'|translate}}</label>\n <input-rest-auto-complete-enum [dropdown]="true" server="payroll"\n enumeration="AccountType"\n placeholder="{{\'hcm.payroll.select\' | translate}}"\n name="accountType" [form]="bankAccountFormGroup"\n (onSelect)="beforeSetBankAccountValidator()"\n (onClear)="onClearBankBranch()"\n id="ta-accountType"></input-rest-auto-complete-enum>\n <s-control-errors [control]="bankAccountFormGroup.get(\'accountType\')"\n [errorMessages]="{ required: \'hcm.payroll.required\' | translate }">\n </s-control-errors>\n </div>\n \x3c!--Número conta--\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label>{{\'hcm.payroll.historical_bank_account_label_account_form\' |\n translate}}</label>\n <input pInputText id="ta-bankAccount" name="bankAccount" only-number\n formControlName="bankAccount"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'bankAccount\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n bankAccountDuplicate: \'hcm.payroll.historical_bank_account_label_bank_account_duplicate\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'12\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12">\n <label>{{\'hcm.payroll.historical_bank_account_label_digit\'|translate}}</label>\n \x3c!--Dígito--\x3e\n <input pInputText id="ta-digit" name="digit" only-number formControlName="digit"/>\n <s-control-errors [control]="bankAccountFormGroup.get(\'digit\')"\n [errorMessages]="{ maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'3\' } }">\n </s-control-errors>\n </div>\n <div class="ui-md-6 ui-sm-12 required">\n <label id="lb-percentage"\n for="ff-percentage">{{ \'hcm.payroll.historical_bank_account_label_percentage\' | translate }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input pInputText id="ff-percentage" name="percentage"\n formControlName="percentage"\n currencyMask\n [options]="optionsPercentage"\n [placeholder]="percentagePlaceholder"/>\n </div>\n <s-control-errors [control]="bankAccountFormGroup.get(\'percentage\')"\n [errorMessages]="{\n required: \'hcm.payroll.required\' | translate,\n maxlength: \'hcm.payroll.error_max_length\' | translate: { value: \'6\' },\n max: \'hcm.payroll.error_max_value_number\' | translate: { value: maxValuePercentage },\n min: \'hcm.payroll.error_min_value_number\' | translate: { value: \'0,01\' }\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12">\n <p-fieldset\n legend="{{ \'hcm.payroll.custom_fields\' | translate }}"\n [attr.data-hidden]="!customFields || !customFields.fields.length"\n >\n <s-custom-fields\n domain="hcm"\n service="{{customService}}"\n entity="{{customEntity}}"\n formControlName="customFields"\n [invalidErrorLabel]="\'hcm.payroll.employees_invalid_field\' | translate"\n >\n </s-custom-fields>\n </p-fieldset>\n </div>\n </div>\n </div>\n </form>\n\n <div [ngClass]="withSideBar ? \'footer\' : \'footer-s-border\'">\n <div class="form-group">\n <s-button id="btn-save" label="{{ labelBtnAdd | translate}}" priority="primary"\n (onClick)="addItem()" *ngIf="visibleBtnSave && !this.isView"></s-button>\n <s-button *ngIf="withSideBar" id="btn-close" label="{{\'hcm.payroll.cancel\'|translate}}" priority="secondary"\n priority="link" (onClick)="close()"></s-button>\n </div>\n </div>\n</div>\n',styles:[".refresh{width:100%!important}#table-annuity .col-default-s{width:10%}#table-annuity .col-default-m{width:12%}#table-annuity .col-default-l{width:16%}#table-annuity .col-action{width:10%}#table-annuity .icon-warning{text-align:center!important;color:#ff6d00c7!important}@media screen and (max-width:612px){#table-annuity .col-default-1,#table-annuity .col-default-2{width:16%}#table-annuity .col-default-3{width:26%}#table-annuity .col-icon{width:10%}#table-annuity .col-action{width:27%}}#main{display:-webkit-box;display:flex;height:100%;width:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#main form{height:100%}#main .footer{border-top:1px solid #ccc;padding-top:15px;margin-top:15px;flex-shrink:0;margin-bottom:-18px}#main .footer-s-border{padding-left:7px;flex-shrink:0;margin-bottom:-18px}"]}]}],e.ctorParameters=function(){return[{type:i.TranslateService},{type:n.FormBuilder},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!0}]}],currency:[{type:t.Input}],customEntity:[{type:t.Input}],customService:[{type:t.Input}],withSideBar:[{type:t.Input}],isEditMode:[{type:t.Input}],visibleChange:[{type:t.Output}],bankAccountItemToList:[{type:t.Output}],visible:[{type:t.Input}],isEditAndViewValue:[{type:t.Input}],getListBankAccount:[{type:t.Input}],isViewMode:[{type:t.Input}]},e}();var wn=function(){function e(e){this.http=e}return e.prototype.query=function(e,t,n){return void 0===n&&(n=he.PAYROLL),this.http.query(e,t,n)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe}]},e}();var Dn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,h.SidebarModule,ae,h.ControlErrorsModule,It,L.CurrencyMaskModule,ut,d.InputTextModule,ce,O.FieldsetModule,h.CustomFieldsModule,R.PanelModule],declarations:[Sn,_n],providers:[wn,I.ConfirmationService],exports:[Sn]}]}],e}(),Cn=function(){function e(e,t){this.http=e,this.httpClient=t}return e.prototype.remove=function(e,t,n,o){return void 0===n&&(n=he.PAYROLL),n===he.DEPENDENT?this.httpClient.post("hcm/dependent/queries/historicalJudicialPensionBankAccountDelete",{dependentId:o,dateWhen:t}):this.http.post("actions/historicalEmployeeBankAccountDelete",{employeeId:e,dateWhen:t})},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:Pe},{type:v.HttpClient}]},e}();var En=y,Tn=function(){function e(e,n,o,r,a,i,s){this.confirmationService=e,this.translateService=n,this.activatedRoute=o,this.cd=r,this.router=a,this.messageService=i,this.historicalBankAccountListService=s,this.endPoint="hcm/payroll/queries/historicalEmployeeBankAccountQuery",this.keyPayload="historicalEmployeeBankAccount",this.withSidebar=!0,this.enableView=new t.EventEmitter,this.ngUnsubscribe=new f.Subject,this.loading=!0,this.columns=[{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_date_when"),field:"dateWhen"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank"),field:"bank.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_bank_branch"),field:"bankBranch.name"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_account"),field:"bankAccount"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_percentage"),field:"percentage"},{label:this.translateService.instant("hcm.payroll.historical_bank_account_label_qtd_account"),field:"numberOfBankAccount"}]}return e.prototype.ngOnInit=function(){this.initParameters={employeeId:this.employeeId,dependentId:this.dependentId}},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.ngAfterViewInit=function(){this.cd.detectChanges()},e.prototype.onLazyLoad=function(e){var t=this;e.forEach((function(e){e.dateWhen=En(e.dateWhen).format(t.dateFormat)})),this.onGridLoad(e),this.loading=!1},e.prototype.getMenuActions=function(e){var t=this;return[{label:this.translateService.instant("hcm.payroll.employees_image_cropper_view"),command:function(){var n=e&&e.dateWhen&&En(e.dateWhen,t.dateFormat).format("YYYY-MM-DD");t.withSidebar?t.router.navigate(["historical-bank-account/"+n],{relativeTo:t.activatedRoute}):t.enableView.emit(n)}},{label:this.translateService.instant("hcm.payroll.delete"),command:function(){t.isAllowToDeleteHistorical&&e?t.delete(e.id,e.dateWhen):t.messageService.add({severity:"error",summary:t.translateService.instant("hcm.payroll.error"),detail:t.translateService.instant("hcm.payroll.permission_error_not_allowed")})}}]},e.prototype.delete=function(e,t){var n=this;if(e===this.lastRecord.id){var o=En(t,this.dateFormat).format("YYYY-MM-DD");this.confirmationService.confirm({message:this.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_question_confirm_delete")+"?",accept:function(){n.loading=!0;var e=n.withSidebar?he.PAYROLL:he.DEPENDENT;n.historicalBankAccountListService.remove(n.employeeId,o,e,n.dependentId).pipe(s.takeUntil(n.ngUnsubscribe)).subscribe((function(){n.messageService.add({severity:"success",summary:n.translateService.instant("hcm.payroll.success"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_remove")}),n.parameters=n.parameters&&B({},n.parameters)||{}}),(function(){n.messageService.add({severity:"error",summary:n.translateService.instant("hcm.payroll.error"),detail:n.translateService.instant("hcm.payroll.employees_movimentation_historical_bank_account_error_remove")}),n.loading=!1}))}})}else this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.not_allowed_delete_last")})},e.prototype.add=function(){this.isAllowToAddHistorical?this.router.navigate(["historical-irrf-new"],{relativeTo:this.activatedRoute}):this.messageService.add({severity:"error",summary:this.translateService.instant("hcm.payroll.error"),detail:this.translateService.instant("hcm.payroll.permission_error_not_allowed")})},e.prototype.onGridLoad=function(e){e&&e.length&&(this.lastRecord=e[0])},Object.defineProperty(e.prototype,"isAllowToAddHistorical",{get:function(){return this.permission.incluir},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAllowToDeleteHistorical",{get:function(){return this.permission.excluir},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scopedActions",{get:function(){return this.getMenuActions.bind(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reloadList",{set:function(e){e&&(this.loading=!0,this.parameters=this.parameters&&B({},this.parameters)||{})},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"c-historical-bank-account-list",template:'<div class="ui-g">\n <div class="ui-g-12">\n <c-data-list-rest\n id="ta-irrf"\n [columns]="columns"\n actionLabel="{{ \'hcm.payroll.movimentation_generic_action\' | translate }}"\n emptyMessage="{{ \'hcm.payroll.admission_empty_message\' | translate }}"\n [endpoint]="endPoint"\n singularMessageRecords="{{\n \'hcm.payroll.admission_register\' | translate\n }}"\n [actions]="scopedActions"\n pluralMessageRecords="{{\n \'hcm.payroll.admission_registers\' | translate\n }}"\n [keyPayload]="keyPayload"\n [lazy]="true"\n (lazyLoad)="onLazyLoad($event)"\n [(loading)]="loading"\n [initParameters]="initParameters"\n [parameters]="parameters"\n [isSortable]="false"\n ></c-data-list-rest>\n </div>\n</div>\n\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:I.ConfirmationService},{type:i.TranslateService},{type:a.ActivatedRoute},{type:t.ChangeDetectorRef},{type:a.Router},{type:I.MessageService},{type:Cn}]},e.propDecorators={customFields:[{type:t.ViewChild,args:[h.CustomFieldsComponent,{static:!1}]}],permission:[{type:t.Input}],employeeId:[{type:t.Input}],dependentId:[{type:t.Input}],dateFormat:[{type:t.Input}],endPoint:[{type:t.Input}],keyPayload:[{type:t.Input}],withSidebar:[{type:t.Input}],enableView:[{type:t.Output}],reloadList:[{type:t.Input}]},e}();var Fn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,n.FormsModule,v.HttpClientModule,T.AutoCompleteModule,X,n.ReactiveFormsModule,b.TableModule,h.ButtonModule,g.TooltipModule,h.LoadingStateModule,ge,x.ConfirmDialogModule],declarations:[Tn],providers:[Cn],exports:[Tn]}]}],e}(),Pn=function(){function e(e){this.field=e.field,this.value=e.value,this.operation=e.operation}return Object.defineProperty(e.prototype,"field",{get:function(){return this._field},set:function(e){this._field=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"operation",{get:function(){return this._operation},set:function(e){this._operation=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.operation===de.CONTAINING?this.operation+"(lower("+this.field+"), lower("+this.value+"))":this.field+" "+(this.operation||"")+" "+this.value},e}();var Mn=y,An=Mn("31/12/1900","DD/MM/YYYY"),Ln=Mn("04/06/2080","DD/MM/YYYY"),On=function(){function e(){}return e.isValidDate=function(e,t){return function(n){var o=!t||!t.hasOwnProperty("useG5DateRange")||t.useG5DateRange,r=lt(n.value);if(e=lt(e),r&&e&&r.length===e.length&&!n.value.includes("_")){var a=Mn(r,e),i=a.isValid(),s=!o||a.isBetween(An,Ln,null,"[]");return i&&s?null:{invalidDate:!0}}return null}},e.isDateLower=function(e,t,n){void 0===n&&(n="day");var o={compareName:"lowerDate",granularity:n};return this.isValidDateCompare(e,t,me.isBefore,o)},e.isValidDateCompare=function(e,t,n,o){var r=this;return function(a){var i=lt(a.value);if(t=lt(t),i&&t&&i.length===t.length&&!a.value.includes("_")){var s=Mn(i,t),l=Mn(e,t);return r.dateCompare(s,l,n,o)}return null}},e.getDateFormatFromLocale=function(e,t){var n=e&&e.dateFormat;if(n){var o=n.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return t&&(o=o.replace("DD","")),o}return null},e.getDateTimeFormatFromLocale=function(e){if(e){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase(),t+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,t,n,o){var r=n===me.isNotSame?me.isSame:n,a=o&&o.granularity?o.granularity:"day",i=e[r](t,a);if(i=n===me.isNotSame?!i:i){var s={};return s[o&&o.compareName?o.compareName:n]=!0,s}return null},e.getFormatDateWithBar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}();var Rn=function(){function e(){this._processVariables={},this._workflowPayload={},this.processInstanceId=new f.BehaviorSubject(null),this.resetActions()}return e.prototype.init=function(){var e=this;this.workflowCockpit=workflowCockpit({init:function(t,n){return N(e,void 0,void 0,(function(){var e,o,r;return j(this,(function(a){switch(a.label){case 0:return this._isRequestNew=n&&n.isRequestNew(),e=this,(o=n)?[4,n.getTaskData()]:[3,2];case 1:o=a.sent(),a.label=2;case 2:return e._taskData=o,this._isRequestNew?[3,4]:[4,n.getInfoFromProcessVariables()];case 3:r=a.sent(),this.addProcessVariable("processVariablesFromWorkflow",r),a.label=4;case 4:return this.processInstanceId.next(t.processInstanceId),[4,this._onLoadWorkflow(t,n)];case 5:return[2,a.sent()]}}))}))},onSubmit:function(t,n){return N(e,void 0,void 0,(function(){var e,o;return j(this,(function(r){switch(r.label){case 0:return e=this,(o=t)?[4,t.nextAction]:[3,2];case 1:o=r.sent(),r.label=2;case 2:return e._nextAction=o,this._isFinishing=this._nextAction.finish,this._nextActionName=this._nextAction.name,[4,this._onSubmitWorkflow(t,n)];case 3:return r.sent(),[2,this._workflowPayload]}}))}))},onError:function(t,n){return N(e,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._onRollbackWorkflow(t,n)];case 1:return e.sent(),[2]}}))}))}})},e.prototype._onLoadWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onLoadActions)];case 1:return[2,e.sent()]}}))}))},e.prototype._onSubmitWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onSubmitActions)];case 1:return[2,e.sent()]}}))}))},e.prototype._onRollbackWorkflow=function(e,t){return N(this,void 0,void 0,(function(){return j(this,(function(e){switch(e.label){case 0:return[4,this._runActions(this.onRollbackActions)];case 1:return[2,e.sent()]}}))}))},e.prototype.resetActions=function(){this.onLoadActions={},this.onSubmitActions={},this.onRollbackActions={}},e.prototype._runActions=function(e){return N(this,void 0,void 0,(function(){var t,n=this;return j(this,(function(o){switch(o.label){case 0:return t={},[4,Promise.all(Object.entries(e).map((function(e){var o=V(e,2),r=o[0],a=o[1];return N(n,void 0,void 0,(function(){var e,n,o;return j(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=t,n=r,[4,a()];case 1:return e[n]=i.sent(),[2];case 2:throw o=i.sent(),Error(o);case 3:return[2]}}))}))})))];case 1:return o.sent(),[2,t]}}))}))},e.prototype.addOnLoadAction=function(e,t){this.onLoadActions[e]=t},e.prototype.addOnSubmitAction=function(e,t){this.onSubmitActions[e]=t},e.prototype.addOnRollbackAction=function(e,t){this.onRollbackActions[e]=t},e.prototype.addProcessVariable=function(e,t){try{this._processVariables[e]=t}catch(t){throw{erro:t,message:"Não foi possível adicionar a variável "+e+" às variáveis do processo."}}},e.prototype.setWorkflowPayload=function(e){this._workflowPayload=e},Object.defineProperty(e.prototype,"loadActions",{get:function(){return this.onLoadActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"submitActions",{get:function(){return this.onSubmitActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rollbackActions",{get:function(){return this.onRollbackActions},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRequestNew",{get:function(){return this._isRequestNew},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFinishing",{get:function(){return this._isFinishing},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextActionName",{get:function(){return this._nextActionName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"taskData",{get:function(){return this._taskData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"processVariables",{get:function(){var e=this;return new Promise((function(t,n){e._processVariables?t(e._processVariables):n("Não foram encontradas variáveis para o processo")})).then((function(t){e._processVariables=t})).catch((function(e){throw e})),this._processVariables},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var xn=function(){function e(e,t,n){this.router=e,this.activatedRoute=t,this.workflowDataService=n,this.ngUnsubscribe=new f.Subject}return e.prototype.ngOnInit=function(){this.registerSubscribers()},e.prototype.registerSubscribers=function(){var e=this;this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.useWorkflow=!(!t||!t.useWorkflow),e.routeEndpoint=t&&t.routeEndpoint,e.useWorkflow&&e.workflowDataService.setUseWorkflow(e.useWorkflow)}))},e.prototype.onSelectEmployee=function(){var e=this.employeeSelected.tableId;e&&this.navigate(e)},e.prototype.navigate=function(e){this.router.navigate(["workflow/"+e+"/"+this._routeEndpoint])},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},Object.defineProperty(e.prototype,"useWorkflow",{get:function(){return this._useWorkflow},set:function(e){this._useWorkflow=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"routeEndpoint",{get:function(){return this._routeEndpoint},set:function(e){this._routeEndpoint=e},enumerable:!0,configurable:!0}),e.decorators=[{type:t.Component,args:[{selector:"lib-employee-selector",template:'<p-panel header="{{ \'hcm.payroll.employee_selector_panel_header\' | translate }}">\n <div class="ui-g ui-fluid">\n <div class="ui-md-6 ui-g-6">\n <label for="ff-employee" id="lb-employee">{{\n "hcm.payroll.employee" | translate\n }}</label>\n <input-rest-auto-complete-employee-model\n id="ff-employee"\n [dropdown]="true"\n placeholder="{{\n \'hcm.payroll.employees_company_placeholder\' | translate\n }}"\n name="employee"\n emptyMessage="{{ \'hcm.payroll.not_suggestions\'|translate }}"\n [(model)]="employeeSelected"\n (onSelect)="onSelectEmployee()"\n >\n </input-rest-auto-complete-employee-model>\n </div>\n </div>\n</p-panel>\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:a.Router},{type:a.ActivatedRoute},{type:en}]},e}();var Bn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[X,R.PanelModule,gt],declarations:[xn],exports:[xn]}]}],e}(),Nn=function(){function e(){}return e.decorators=[{type:t.Component,args:[{selector:"from-to",template:'<div id="from-to" class="ui-g ui-fluid" *ngIf="divergentFormData">\n <div class="ui-g-12">\n \x3c!-- Painel Collapsable --\x3e\n <p-panel\n class="ui-g-12 ui-fluid form-group"\n header="{{ \'hcm.payroll.disagreements\' | translate }}"\n [toggleable]="true"\n [collapsed]="false"\n >\n <section id="from-to-content" class="ui-g ui-fluid form-group">\n \x3c!-- INICIO DE SEÇÃO: DE (ANTES): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.from\' | translate }}">\n <section id="from-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-from">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-from"\n id="{{divergence.key}}-from"\n value="{{ divergence.oldValue }}"\n />\n\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: DE (ANTES): --\x3e\n\n \x3c!-- INICIO DE SEÇÃO: PARA (DEPOIS): --\x3e\n <p-panel class="ui-g-6 ui-fluid form-group" header="{{ \'hcm.payroll.to\' | translate }}">\n <section id="to-content" class="ui-g ui-fluid">\n <ng-container *ngFor="let divergence of divergentFormData">\n <div class="ui-g-6">\n <label for="{{divergence.key}}-to">{{ divergence.key }}</label>\n <input\n pInputText\n type="text"\n name="{{divergence.key}}-to"\n id="{{divergence.key}}-to"\n value="{{ divergence.newValue }}"\n />\n </div>\n </ng-container>\n </section>\n </p-panel>\n \x3c!-- FINAL DE SEÇÃO: PARA (DEPOIS): --\x3e\n </section>\n </p-panel>\n </div>\n</div>\n'}]}],e.ctorParameters=function(){return[]},e.propDecorators={divergentFormData:[{type:t.Input}]},e}();var jn=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[c.CommonModule,R.PanelModule,i.TranslateModule,n.ReactiveFormsModule,d.InputTextModule],declarations:[Nn],exports:[Nn]}]}],e}();e.AdmissionDraftSummaryComponent=_e,e.AdmissionDraftSummaryModule=we,e.AdmissionDraftSummaryService=Se,e.AutocompleteParametersService=Wt,e.BlockUiComponent=Q,e.BlockUiModule=K,e.BreadcrumbComponent=J,e.BreadcrumbSDSModule=Z,e.CNPJValidator=H,e.CPFValidator=Y,e.CompanyIndicationType={USE_DEPENDENTS:"USE_DEPENDENTS",VACCINATION_FREQUENCY:"VACCINATION_FREQUENCY",APPORTIONMENT_CALCULATION:"APPORTIONMENT_CALCULATION",USE_WORKSTATION_GROUP_EMPLOYEE:"USE_WORKSTATION_GROUP_EMPLOYEE",STRUCTURE:"STRUCTURE",PAY_ANNUITY:"PAY_ANNUITY",USE_HISTORICAL_BANK_ACCOUNT:"USE_HISTORICAL_BANK_ACCOUNT"},e.CompanyIndicationsService=Vt,e.CompareType=me,e.ControlMessagesErrorComponent=ee,e.ControlMessagesErrorModule=te,e.CoreDirectives=ce,e.CoreFieldType=pe,e.CustomFieldsComponent=ne,e.CustomFieldsModule=ie,e.DataListModule=cn,e.DataListRestModule=ge,e.DateValidator=On,e.DirectionEnumeration=ue,e.EmployeeSelectorComponent=xn,e.EmployeeSelectorModule=Bn,e.EmployeeSummaryComponent=Ie,e.EmployeeSummaryModule=ke,e.EmployeeSummaryService=be,e.EntityODataParameter=Pn,e.ErrorPageComponent=De,e.ErrorPageModule=Ce,e.FieldValidatorComponent=Ee,e.FieldValidatorModule=Te,e.FileUploadComponent=Ae,e.FileUploadCoreModule=Le,e.FormComparatorService=tn,e.FromToComponent=Nn,e.FromToModule=jn,e.HistoricalBankAccountComponent=Sn,e.HistoricalBankAccountListComponent=Tn,e.HistoricalBankAccountListModule=Fn,e.HistoricalBankAccountListService=Cn,e.HistoricalBankAccountModule=Dn,e.HistoricalBankAccountService=wn,e.HttpClientService=Pe,e.HttpRequestType={POST:"post",GET:"get"},e.ImageCropComponent=Re,e.ImageCropModule=xe,e.ImageCropService=Oe,e.InputDateComponent=re,e.InputDateModelComponent=Ne,e.InputDateModelModule=je,e.InputDateModule=ae,e.InputRestAutoCompleteComponent=pt,e.InputRestAutoCompleteEmployeeModelModule=gt,e.InputRestAutoCompleteEmployeeModelService=yt,e.InputRestAutoCompleteEmployeeModule=ht,e.InputRestAutoCompleteEmployeeService=dt,e.InputRestAutoCompleteEnumComponent=vt,e.InputRestAutoCompleteEnumModule=It,e.InputRestAutoCompleteEnumService=bt,e.InputRestAutoCompleteJobpositionComponent=Tt,e.InputRestAutoCompleteJobpositionModule=Ft,e.InputRestAutoCompleteJobpositionService=Et,e.InputRestAutoCompleteModelEnumModule=Ct,e.InputRestAutoCompleteModelEnumService=wt,e.InputRestAutoCompleteModelModule=_t,e.InputRestAutoCompleteModelService=kt,e.InputRestAutoCompleteModule=ut,e.InputRestAutoCompleteService=ct,e.IntegrationService=Ut,e.ListRestComponent=Mt,e.ListRestModule=At,e.LookupModule=mn,e.LookupParametersService=Gt,e.MenuType={DEFAULT:"DEFAULT",ACTION:"ACTION"},e.ModuleType={MANAGEMENT_PANEL:"MANAGEMENT_PANEL",PERFORMANCE_MANAGEMENT:"PERFORMANCE_MANAGEMENT",CAREER_SUCCESSION:"CAREER_SUCCESSION",RECRUIT_MANAGEMENT:"RECRUIT_MANAGEMENT",REMUNERATION_MANAGEMENT:"REMUNERATION_MANAGEMENT",DEVELOPMENT_MANAGEMENT:"DEVELOPMENT_MANAGEMENT",PAYROLL:"PAYROLL",APP:"APP",MOODS:"MOODS"},e.NameNotSpacesDirective=se,e.OnlyNumberDirective=le,e.Operators=de,e.ParameterType={STRING:"String",INTEGER:"Integer",DOUBLE:"Double",BOOLEAN:"Boolean",DATE:"Date",DATETIME:"DateTime",TIME:"Time",OBJECT:"Object"},e.PermissionService=on,e.ReportFormat={PDF:"Pdf",CSV:"Csv",HTML:"Html",XLS:"Xls",XLSX:"Xlsx",XML:"Xml",ODT:"Odt",RTF:"Rtf"},e.ReportService=Zt,e.ReportStage={STARTING:"Starting",COMPILING:"Compiling",FILLING:"Filling",EXPORTING:"Exporting",DONE:"Done",CANCELLED:"Cancelled",GENERATED:"Generated",ERROR:"Error"},e.ServiceType=he,e.ServicesModule=nn,e.SpinnerLoaderComponent=Lt,e.SpinnerLoaderModule=Ot,e.StringMethods=z,e.ToastComponent=rn,e.ToastModule=an,e.ToastService=Fe,e.TypeAdmissionModule=xt,e.TypeAdmissionServices=Rt,e.UsingType={TYPE_1:"TYPE_1",TYPE_2:"TYPE_2",TYPE_3:"TYPE_3",TYPE_4:"TYPE_4",TYPE_6:"TYPE_6",TYPE_7:"TYPE_7",TYPE_8:"TYPE_8",TYPE_9:"TYPE_9",TYPE_10:"TYPE_10",TYPE_11:"TYPE_11",TYPE_12:"TYPE_12",TYPE_14:"TYPE_14",TYPE_15:"TYPE_15",TYPE_16:"TYPE_16",TYPE_17:"TYPE_17",TYPE_18:"TYPE_18",TYPE_19:"TYPE_19",TYPE_20:"TYPE_20",TYPE_21:"TYPE_21"},e.WorkflowDataService=en,e.WorkflowIntegrator=Rn,e.WorkstationgroupLookupDto=bn,e.WorkstationgroupLookupModule=kn,e._moment=Je,e.assign=function e(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];if(!n.length)return t;var r=n.shift();if(Ve(t)&&Ve(r)){var a=function(n){var o,a,i,s;Ve(r[n])?(t[n]||Object.assign(t,((o={})[n]={},o)),e(t[n],r[n])):Ue(r[n])?Object.assign(t,((a={})[n]=r[n],a)):(t[n]||Object.assign(t,((i={})[n]=[],i)),Object.assign(t,((s={})[n]=r[n].map((function(o,r){return e(t[n][r]||{},o)})),s)))};for(var i in r)a(i)}return e.apply(void 0,U([t],n))},e.autoCompleteObjectForIdObject=function(e){return Ve(e)?(e.hasOwnProperty("tableId")&&console.error("Paramentro não é um objeto Auto Complete válido, falta tableId"),Ye(e.tableId)||console.error("tableId esta vazio"),{id:e.tableId}):(console.error("Paramentro não é um objeto"),!1)},e.clearValues=it,e.cnpjValidator=W,e.compareValues=at,e.configEnabledFields=nt,e.containsMoreThanOneConsecutiveAbbreviation=function(e){return!/(\b.\s)(.\s)(.\b)\1?/g.test(e)},e.containsMoreThanOneConsecutiveBlankSpace=function(e){return!/(\w[ ]{2,}\w)/.test(e)},e.containsMoreThanTwoRepeatedCharacters=function(e){return!/([a-zA-Z])\1{2}/g.test(e)},e.containsSpecialCharacters=function(e){return!/[[\]!@#$%&*_+=`´{}^~<>.,:;?|()\/\\-]/.test(e)},e.convertBooleanString=function(e){return"boolean"==typeof e?!0===e?"true":"false":e},e.convertStringToBoolean=function(e){return!0===e||"true"===e.toLowerCase()},e.cpfValidator=G,e.firstNameIsValid=function(e){var t=e.split(" ");return t.length>=2&&t[1].length>=1},e.firstNameLengthIsValid=function(e){var t=e.split(" ");return!(t[0].trim().length>0)||t[0].trim().length>=2},e.formatMoney=function(e,t){switch(void 0===t&&(t="EN"),t){case"EN":return Ye(e)?e.toString().replace(".","").replace(",","."):"";case"BR":return Ye(e)?e.toString().replace(".",",").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1."):"";default:return Ye(e)?e.toString().replace(".","").replace(",","."):""}},e.fullNameLengthIsValid=function(e){return e.length<=70},e.getAddWeekDaysBusiness=function(e,t){return E.addWeekDays(Ke(e),t).format("DD/MM/YYYY")},e.getFormat=st,e.getFormatDate=$e,e.getMoment=Ke,e.getNowDate=Qe,e.getObjValids=function(e){var t=Object.assign({},e),n={};return Object.keys(t).map((function(e){Ye(t[e])&&(n[e]=We(e,t[e]))})),n},e.getQueryParams=function(e){e=e.split("+").join(" ");for(var t,n={},o=/[?&]?([^=]+)=([^&]*)/g;t=o.exec(e);)n[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return n},e.getWeekDaysBusiness=function(e,t){var n=t?Ke(t):Ke(e).endOf("month");return E.weekDays(Ke(e),n)},e.getYears=function(e){return qe().diff(e,"years",!1)},e.invertFieldDate=ze,e.isBirthDayValid=function(e,t){if(e&&t)return t.isSameOrAfter(e)},e.isDateCompare=function(e,t,n){return!(e&&e.isValid()&&t&&n)||e[n](t)},e.isDateExpirationBeforeExpeditionDate=function(e,t){if(e&&t)return t.isSameOrAfter(e)},e.isDateField=We,e.isDateSameOrAfterCurrentDate=function(e){if(e){var t=Bt();return e.isSameOrAfter(t)}},e.isFullDate=He,e.isMax=function(e,t){return e.length<=t},e.isNumber=Nt,e.isObject=Ve,e.isRequired=function(e){return null!=e&&e.length>0},e.isShallow=Ue,e.isValid=Ye,e.isValidDate=Ge,e.isValidPIS=function(e){var t=0,n=0,o=e.replace(/[^\d]+/g,"");if(11!==o.length||"00000000000"===o||"11111111111"===o||"22222222222"===o||"33333333333"===o||"44444444444"===o||"55555555555"===o||"66666666666"===o||"77777777777"===o||"88888888888"===o||"99999999999"===o)return!1;for(var r=0;r<10;r++)t+=parseInt(o.substring(r,r+1))*parseInt("3298765432".substring(r,r+1));return(n=10===(n=11-t%11)||11===n?0:n)===parseInt(""+o.charAt(10))},e.mountCustomForSave=function(e,t,n){void 0===t&&(t=null),void 0===n&&(n=null);var o=[];return t&&e.length&&t.map((function(t,r){var a=Object.keys(e[r]).toString(),i=Ye(e[r][a])?e[r][a]:null,s="date"===t.type&&n&&Ye(i)?qe(i,st(n)).format("YYYY-MM-DD"):i;o.push({field:a,value:s})})),o.length?o:null},e.mountCustomForShow=function(e){var t=[];return Object.keys(e||{}).forEach((function(n){"date"===e[n].type&&e[n].value&&(e[n].value=Je(e[n].value).format("L")),t.push(e[n])})),t},e.mountCustomToSave=Xe,e.mountCustomToShow=Ze,e.mountGeneratedCustomToSave=function(e){return Object.entries(e).forEach((function(t){var n=V(t,2),o=n[0];n[1]||delete e[o]})),e},e.ngCalendarFormat=function(e,t){if(void 0===t&&(t="DD/MM/YYYY"),Ge(e))return"string"==typeof e?e:Je(e).format(t)},e.notEmpty=jt,e.numberOrZero=qt,e.removeCharacteresSpecials=lt,e.removeEmpty=function e(t){return Object.keys(t).forEach((function(n){return t[n]&&"object"==typeof t[n]&&e(t[n])||!t[n]&&void 0!==t[n]&&delete t[n]})),t},e.removeWhiteSpaces=function(e){return e&&String(e)?String(e).replace(/\s/g,""):String(e)},e.setCustonFields=function(e){var t=this;return e.map((function(e){var o={},r=e.value||null;"boolean"==typeof r&&(r=r?"true":"false"),o[e.field]=new n.FormControl(r),t.push(new n.FormGroup(o))})),e},e.setDisableField=rt,e.setErrors=function(e,t,n){var o=this;setTimeout((function(){var r;n?((r=Object.assign({},o.get(e).errors))[t]=n,o.get(e).setErrors(r)):(r=o.get(e).errors)&&Object.keys(r).length&&(delete r[t],Object.keys(r).length||o.get(e).setErrors(null))}),0)},e.setRequired=tt,e.setRequiredFields=function(e,t,o){t?o.forEach((function(t){return tt(e,t,!0,[n.Validators.required])})):o.forEach((function(t){return tt(e,t,!1)}))},e.setValidator=ot,e.setValidatorsAndDisableFields=function(e,t){t.forEach((function(t){ot(e,t.field,t.validators),rt(e,t.disabled,t.field,t.clearValue)}))},e.setValueCustom=function(e,t){var n=t?Object.keys(t).length:0;return e.map((function(e){e.value=n>0?t[e.field]:null})),e},e.stringMethods=$,e.sun=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce((function(e,t){return qt(t)+e}),0)},e.uiid=function(){return(new C).guid().replace(/[^a-zA-Z0-9.]/g,"").toUpperCase()},e.validateBirthDate=function(e,t){if(e&&t){var n=Bt("string"==typeof e?e.replace(/[^\d]+/g,""):e,"DDMMYYYY").format("YYYY-MM-DD").toString(),o=Bt(t.replace(/[^\d]+/g,""),"DDMMYYYY").format("YYYY-MM-DD").toString();return Bt(o).isSameOrAfter(n)}},e.verifyValidationsForm=et,e.ɵa=X,e.ɵb=fe,e.ɵc=ye,e.ɵd=Me,e.ɵe=mt,e.ɵf=ft,e.ɵg=St,e.ɵh=Dt,e.ɵi=Pt,e.ɵj=ln,e.ɵk=sn,e.ɵl=dn,e.ɵm=pn,e.ɵn=In,e.ɵo=yn,e.ɵp=gn,e.ɵq=_n,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=senior-gestao-pessoas-payroll-core.umd.min.js.map
|