dts-backoffice-util 2.8.2 → 3.0.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.
Files changed (55) hide show
  1. package/bundles/dts-backoffice-util.umd.js +464 -1125
  2. package/bundles/dts-backoffice-util.umd.js.map +1 -1
  3. package/bundles/dts-backoffice-util.umd.min.js +1 -1
  4. package/bundles/dts-backoffice-util.umd.min.js.map +1 -1
  5. package/esm2015/dts-backoffice-util.js +3 -2
  6. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +3 -2
  7. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +3 -2
  8. package/esm2015/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +3 -2
  9. package/esm2015/lib/dts-backoffice-util.module.js +3 -2
  10. package/esm2015/lib/interfaces/filter-range.interface.js +3 -2
  11. package/esm2015/lib/interfaces/totvs-response.interface.js +3 -2
  12. package/esm2015/lib/model/session-info.model.js +3 -2
  13. package/esm2015/lib/pipes/dts-date-format.pipe.js +3 -2
  14. package/esm2015/lib/services/breadcrumb-control.service.js +3 -2
  15. package/esm2015/lib/services/cache-params.service.js +3 -2
  16. package/esm2015/lib/services/menu-datasul.service.js +3 -2
  17. package/esm2015/lib/services/profile.service.js +3 -2
  18. package/esm2015/lib/services/report.service.js +7 -6
  19. package/esm2015/lib/services/session-info.service.js +3 -2
  20. package/esm2015/lib/services/translate.service.js +3 -2
  21. package/esm2015/lib/utils/date.util.js +3 -2
  22. package/esm2015/lib/utils/disclaimer.util.js +3 -2
  23. package/esm2015/lib/utils/field-validation.util.js +3 -2
  24. package/esm2015/lib/utils/file.util.js +3 -2
  25. package/esm2015/lib/utils/filter-range.util.js +3 -2
  26. package/esm2015/lib/utils/generic-functions.utils.js +3 -2
  27. package/esm2015/public-api.js +3 -2
  28. package/fesm2015/dts-backoffice-util.js +48 -26
  29. package/fesm2015/dts-backoffice-util.js.map +1 -1
  30. package/package.json +8 -7
  31. package/esm5/dts-backoffice-util.js +0 -9
  32. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.component.js +0 -448
  33. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.model.js +0 -143
  34. package/esm5/lib/components/totvs-schedule-execution/totvs-schedule-execution.service.js +0 -434
  35. package/esm5/lib/dts-backoffice-util.module.js +0 -53
  36. package/esm5/lib/interfaces/filter-range.interface.js +0 -47
  37. package/esm5/lib/interfaces/totvs-response.interface.js +0 -16
  38. package/esm5/lib/model/session-info.model.js +0 -239
  39. package/esm5/lib/pipes/dts-date-format.pipe.js +0 -36
  40. package/esm5/lib/services/breadcrumb-control.service.js +0 -157
  41. package/esm5/lib/services/cache-params.service.js +0 -61
  42. package/esm5/lib/services/menu-datasul.service.js +0 -92
  43. package/esm5/lib/services/profile.service.js +0 -146
  44. package/esm5/lib/services/report.service.js +0 -137
  45. package/esm5/lib/services/session-info.service.js +0 -64
  46. package/esm5/lib/services/translate.service.js +0 -47
  47. package/esm5/lib/utils/date.util.js +0 -135
  48. package/esm5/lib/utils/disclaimer.util.js +0 -930
  49. package/esm5/lib/utils/field-validation.util.js +0 -358
  50. package/esm5/lib/utils/file.util.js +0 -262
  51. package/esm5/lib/utils/filter-range.util.js +0 -69
  52. package/esm5/lib/utils/generic-functions.utils.js +0 -358
  53. package/esm5/public-api.js +0 -37
  54. package/fesm5/dts-backoffice-util.js +0 -3944
  55. package/fesm5/dts-backoffice-util.js.map +0 -1
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@po-ui/ng-components"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("dts-backoffice-util",["exports","@angular/core","@angular/common/http","rxjs","rxjs/operators","@po-ui/ng-components","@angular/forms","@angular/common"],t):t((e=e||self)["dts-backoffice-util"]={},e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ngComponents,e.ng.forms,e.ng.common)}(this,(function(e,t,r,n,o,i,a,l){"use strict";var s=function(){function e(e){this.http=e,this.apiUrl="/totvs-menu/rest/getSessionInfo",this.userLogin=void 0}return e.prototype.getUserLogin=function(){var e=this;return localStorage.getItem("username")?n.of(localStorage.getItem("username")):this.userLogin?n.of(this.userLogin):this.http.get(""+this.apiUrl).pipe(o.map((function(t){return e.userLogin=t.userName,t.userName})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r.HttpClient))},token:e,providedIn:"root"}),e}();var p={STRING:1,JSON:2};p[p.STRING]="STRING",p[p.JSON]="JSON";var u=function(){function e(e){this.http=e,this.apiURL="/dts/datasul-rest/resources/api/btb/btapi930za"}return e.prototype.setProfile=function(e){var t=e.pageId,r=e.userCode;return this.http.post(this.apiURL+"/setProfile?userCode="+r+"&pageId="+t,e,{headers:{"X-PO-Screen-Lock":"true"}})},e.prototype.getProfileAsString=function(e,t){return this.getProfile(e,p.STRING,t?"true":"false")},e.prototype.getProfileAsJSON=function(e,t){return this.getProfile(e,p.JSON,t?"true":"false")},e.prototype.getProfile=function(e,t,r){var n={"X-PO-Screen-Lock":r},i=e.pageId,a=e.dataCode,l=e.userCode;return this.http.get(this.apiURL+"/getProfile?userCode="+l+"&pageId="+i+"&dataCode="+a,{headers:n}).pipe(o.map((function(e){if(e.data[0])return t===p.STRING?e.data[0].dataValue:t===p.JSON?JSON.parse(e.data[0].dataValue):void 0})))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(r.HttpClient))},token:e,providedIn:"root"}),e}();var c=function(){function e(e){this.httpClient=e,this.URL=window.location.href.indexOf("totvs-menu")>0?"/totvs-menu/rest/report/run/":"/dts/datasul-report/resources/run/"}return e.prototype.generate=function(e,t){var r=this;void 0===t&&(t=!0);var n={"X-PO-Screen-Lock":t?"true":"false"},i=""+this.URL+e.reportName;return e.properties.length>0&&(i+="?",e.properties.forEach((function(e,t){t>0&&(i+="&"),i+="c_properties="+e.name+"&c_values="+e.value}))),i+="&dialect="+e.dialect+"&format="+e.format,i+="&program="+e.programName+"&resultFileName="+e.downloadName,this.httpClient.post(i,{},{headers:n,responseType:"blob"}).pipe(o.map((function(t){return e.download&&r.download(t,e.downloadName+"."+e.format),t})))},e.prototype.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove()},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e}();var d=function(){function e(){}return e.prototype.newBreadcrumb=function(){this.breadcrumb={items:[]}},e.prototype.addBreadcrumb=function(e,t){this.addBreadcrumbURL(e,decodeURIComponent(t.snapshot._routerState.url))},e.prototype.addBreadcrumbURL=function(e,t){if(e&&""!==e){this.breadcrumb||this.newBreadcrumb();var r={items:[]},n=0;for(n=0;n<this.breadcrumb.items.length&&this.breadcrumb.items[n].label!==e;n++)r.items.push(this.breadcrumb.items[n]);r.items.push({label:e,link:t}),this.breadcrumb=r}},e.prototype.updBreadcrumbURL=function(e,t,r){var n=this.getCurrentRouter();n&&t&&r&&(n=n.replace(t,r),this.addBreadcrumbURL(e,n))},e.prototype.getBreadcrumb=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb},e.prototype.getCurrentRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=0?"":this.breadcrumb.items[this.breadcrumb.items.length-1].link},e.prototype.getPrevRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=1?"":this.breadcrumb.items[this.breadcrumb.items.length-2].link},e.prototype.hasPreviousRouter=function(){return this.breadcrumb.items.length>1},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}();var m=function(){function e(){}return e.prototype.callProgress=function(e){parent.postMessage({program:e},"*")},e.prototype.sendNotification=function(e){parent.postMessage({notification:e},"*")},e.prototype.openPath=function(e,t,r){void 0===r&&(r=!0);var n=document.referrer.indexOf("totvs-menu")>0?"totvs-menu":"menu-html",o="/"+n+"/#/"+n+"/program-html/"+e+"/#";t&&(o=o+"/"+t),r?window.open(o,"_parent"):window.open(o)},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[]},e}(),h=function(){function e(){this.values={}}return e.prototype.setValue=function(e,t){this.values[e]=t},e.prototype.getValue=function(e){return this.values[e]},e.prototype.removeValue=function(e){delete this.values[e]},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();var f=function(){function e(){}return e.getSuportLanguage=function(){return["pt-BR","pt","en-US","en","es"]},e.getDefaultCurrencyCode=function(){return"$"},e.getCurrentLanguage=function(){var e=localStorage.getItem("user.language")||navigator.language;return e&&this.getSuportLanguage().includes(e)?e:"en-US"},e.decorators=[{type:t.Injectable}],e}(),v=function(){function e(){}return e.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.ajustDateToModel=function(e,t){if(void 0===e&&(e={}),e.hasOwnProperty(t)&&e[t]){if(e[t].indexOf("T")>=0)return new Date(e[t]);var r=+e[t].split("-")[2],n=+e[t].split("-")[1],o=+e[t].split("-")[0];return new Date(o,n-1,r)}return null},e.pad=function(e){return e<10?"0"+e:e},e}(),g=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r}return e.prototype.makeDisclaimer=function(e,t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),null==t||o&&""===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(n?this.literals[t]:t),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),null==t||n&&0===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+t,property:""+e,value:""+t}},e.prototype.makeDisclaimerFromBoolean=function(e,t,r){return void 0===r&&(r=!1),null==t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(t?this.literals.yes:this.literals.no),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromDate=function(e,t,r){void 0===r&&(r=!1);var n=this.ajustDate(t);return this.isValidDate(n)?{hideClose:r,label:this.literals[e]+": "+n.toLocaleDateString(),property:""+e,value:""+this.dateToQueryParam(n)}:{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelect=function(e,t,r,n,o){var i=this;void 0===r&&(r=0),void 0===n&&(n=!1),void 0===o&&(o=!1);var a="",l="";return t?(0===t.length||r>0&&t.length===r?(a=this.literals.all,l="all"):t.map((function(e){""!==a&&(a+=", "),""!==l&&(l+=","),a=""+a+(o?i.literals[e]:e),l=""+l+e})),{hideClose:n,label:this.literals[e]+": "+a,property:""+e,value:""+l}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelectNumber=function(e,t,r,n,o){void 0===n&&(n=0),void 0===o&&(o=!1);var i="",a="",l=null;return t&&r?(0===t.length||n>0&&t.length===n?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),l=r.find((function(t){return t.value===e})),i=""+i+(l?l.label:e),a=""+a+e})),{hideClose:o,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromCheckboxGroup=function(e,t,r,n){var o=this;void 0===r&&(r=0),void 0===n&&(n=!1);var i="",a="";return t?(0===t.length?(i=this.literals.none,a="none"):r>0&&t.length===r?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),i=""+i+o.literals[e],a=""+a+e})),{hideClose:n,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromRangeCharacter=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],"'"+t.valInitial+"'","'"+t.valFinal+"'"]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],t.valInitial,t.valFinal]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeDate=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!0);var o=this.ajustDate(t.valInitial),i=this.ajustDate(t.valFinal);return this.isValidDate(o)||(o=t.iniInitial,t.valInitial=t.iniInitial),this.isValidDate(i)||(i=t.iniFinal,t.valFinal=t.iniFinal),n&&this.dateToQueryParam(t.iniInitial)===this.dateToQueryParam(o)&&this.dateToQueryParam(t.iniFinal)===this.dateToQueryParam(i)?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],o.toLocaleDateString(),i.toLocaleDateString()]),property:""+e,value:this.dateToQueryParam(o)+";"+this.dateToQueryParam(i)}},e.prototype.atzCharFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzNumberFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzBooleanFromDisclamer=function(e,t,r){var n=r;if(e&&e.length>0){var o=e.find((function(e){return e.property===t}));if(o&&null!==o.value&&void 0!==o.value)return"true"===o.value}return n},e.prototype.atzDateFromDisclamer=function(e,t,r){var n=this,o=this.ajustDate(r);return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(o=n.ajustDate(e.value),!0))})),o},e.prototype.atzMultiSelectCharFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("char",e,t,r)},e.prototype.atzMultiSelectNumberFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("number",e,t,r)},e.prototype.atzMultiSelectFromDisclamer=function(e,t,r,n){var o=[];return n.map((function(e){o.push(e.value)})),t&&t.length>0&&t.find((function(t){return t.property===r&&(null!==t.value&&"all"!==t.value&&"none"!==t.value&&(o=[],t.value.split(",").forEach((function(t){"char"===e&&o.push(t),"number"===e&&o.push(+t)})),!0))})),o},e.prototype.atzCheckboxFromDisclamer=function(e,t,r){var n=[];return r.map((function(e){n.push(e.value)})),e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&"all"!==e.value&&"none"!==e.value&&(n=[],e.value.split(",").forEach((function(e){n.push(e)})),!0))})),n},e.prototype.atzRangeCharFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeCharFromQueryParam(n,r)},e.prototype.atzRangeNumFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeNumFromQueryParam(n,r)},e.prototype.atzRangeDateFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeDateFromQueryParam(n,r)},e.prototype.atzRangeCharFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=e.split(";")[0],t.valFinal=e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeNumFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=+e.split(";")[0],t.valFinal=+e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeDateFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=this.queryParamToDate(e.split(";")[0]),t.valFinal=this.queryParamToDate(e.split(";")[1]),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.prototype.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.prototype.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.prototype.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.prototype.pad=function(e){return e<10?"0"+e:e},e}();var y=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r,this.disclaimerUtil=new g(this.poNotification,this.poI18nPipe,this.literals)}return e.prototype.vldFieldCharacter=function(e,t){return!(!t||""===t.trim())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)},e.prototype.vldRangeCharacter=function(e,t,r,n){return!r||!n||(!(r.trim().toUpperCase()>n.trim().toUpperCase())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),!(r&&!this.vldValueOfNumber(e,t))&&(!(!t||t<=0)||(0===t&&!0===n||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)))},e.prototype.vldValueOfNumber=function(e,t){return!(t&&t<0)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldFieldPercent=function(e,t,r){return void 0===r&&(r=!1),!(r&&!this.vldValueOfPercent(e,t))&&!!this.vldFieldNumber(e,t)},e.prototype.vldValueOfPercent=function(e,t){return t&&t<0?(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1):!(t&&t>100)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldRangeNumber=function(e,t,r,n){return r||(r=0),n||(n=0),!(r>n)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1)},e.prototype.vldFieldDate=function(e,t){var r=this.disclaimerUtil.ajustDate(t);return!!this.disclaimerUtil.isValidDate(r)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldDate,[this.literals[e]])}),!1)},e.prototype.vldRangeDate=function(e,t,r,n){return!r||!n||(!(this.disclaimerUtil.ajustDate(r).getTime()>this.disclaimerUtil.ajustDate(n).getTime())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldMultiSelect=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldCheckbox=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldFormat=function(e,t,r,n){void 0===n&&(n=!1);var o,i=!0;if(!t)return i;if(n&&(o=r,r=r.replace(/\./g,"")),t.length!==r.length)i=!1;else for(var a=0;a<r.length;a++){if("9"===r[a]&&"9"!==t[a].replace(/[0-9]/,"9")){i=!1;break}if("!"===r[a]&&"A"!==t[a].replace(/[A-Z]/,"A")){i=!1;break}}return n&&(r=o),i||this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldFormat,[this.literals[e],r])}),i},e}();var b=function(){function e(){}return e.makeFilterRangeCharacter=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeNumber=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeDate=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e}();var x=function(){function e(e){this.literals={},this.literals=e}return e.listToArrayCharacter=function(e){var t=new Array;return e&&""!==e&&(t=e.split(",")),t},e.ArrayToListCharacter=function(e){var t="";return e&&e.length>0&&(t=e.join(",")),t},e.isEmpty=function(e){var t=!0;for(var r in e)e.hasOwnProperty(r)&&(t=!1);return t},e.getChartValues=function(e){var t,r,n;(r=void 0,n=void 0,e.map((function(e){void 0===r&&void 0===n?(r=e.data[0],n=e.data[0]):(e.data<n&&(n=e.data[0]),e.data>r&&(r=e.data[0]))})),r>0&&n>0&&(t={maxValue:r,minValue:0}),r>0&&n<0&&(t={maxValue:r,minValue:n}),r<0&&n<0)&&(t={maxValue:n/3*-1,minValue:n});(r>0&&0===n&&(t={maxValue:r,minValue:0}),0===r&&n<0)&&(t={maxValue:n/3*-1,minValue:n});return 0===r&&0===n&&(t={maxValue:void 0,minValue:void 0}),t.maxValue=Math.round(t.maxValue),t.minValue=Math.round(t.minValue),t},e.atzMultiSelectListByOptions=function(e,t){var r;return t?(r=new Array,t.map((function(t){t&&e.findIndex((function(e){return e.value===t}))>=0&&r.push(t)})),r):t},e.prototype.loadOptionsMultiSelect=function(e,t){var r=this;t&&t.map((function(t){t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:"all"===t?r.literals.all:t,value:t})}))},e.prototype.loadOptionsSelect=function(e,t,r){void 0===r&&(r=!1),t&&t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:r?this.literals[t]:t,value:t})},e.prototype.compareObjects=function(e,t){if(!e||!t)return!1;if(Object.getOwnPropertyNames(e).length!==Object.getOwnPropertyNames(t).length)return!1;for(var r in e)if("$"!==r.substr(0,1)&&"_"!==r.substr(0,1)&&e[r]!==t[r])return!1;return!0},e.prototype.referenceGeneration=function(e,t){var r,n=t.getDate(),o=t.getMonth()+1,i=t.getFullYear();return""+(""+this.pad(i)+this.pad(o)+this.pad(n)+e)+(r=(r=(r=btoa(""+(new Date).getTime())).replace(/[=]/g,"")).slice(r.length-3,r.length))},e.prototype.pad=function(e){return e<10?"0"+e:e>99?(e+"").slice(2,4):e},e.prototype.focusInternalInput=function(e){document.getElementById(e).getElementsByClassName("po-input")[0].focus()},e}();var I=function(){function e(){}return e.downloadFile=function(e,t,r,n){var o=(n=!1!==n)?this.b64toBlob(e,r):e;this.download(o,t)},e.downloadData=function(e,t){if(void 0===t&&(t=null),e){t||(t=new F),t.fileName||(t.fileName="data.csv"),t.literals||(t.literals={}),t.columnDelimiter||(t.columnDelimiter=";"),t.columnList||(t.columnList=[]),t.columnExclude||(t.columnExclude=[]);var r=btoa(this.jsonToString(e,t));this.downloadFile(r,t.fileName,"text/csv")}},e.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));navigator.userAgent.toUpperCase().indexOf(".NET")>0||navigator.userAgent.toUpperCase().indexOf("EDGE")>0?window.navigator.msSaveOrOpenBlob(e,t):(n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove())},e.b64toBlob=function(e,t,r){t=t||"",r=r||512;for(var n=atob(e),o=[],i=0;i<n.length;i+=r){for(var a=n.slice(i,i+r),l=new Array(a.length),s=0;s<a.length;s++)l[s]=a.charCodeAt(s);var p=new Uint8Array(l);o.push(p)}return new Blob(o,{type:t})},e.jsonToString=function(e,t){if(!e||0===e.length)return"";var r,n=null,o=[];return(t.columnList&&t.columnList.length>0?t.columnList:Object.keys(e[0])).forEach((function(e){r=!0,t.columnExclude&&t.columnExclude.length>0&&-1!==t.columnExclude.indexOf(e)&&(r=!1),r&&(o.push(e),n=n?n+t.columnDelimiter:"",n+=t.literals[e]?t.literals[e]:e)})),e.reduce((function(e,r){var n=!0,i=null;return o.forEach((function(o){switch(n||(e+=t.columnDelimiter),null==(i=r[o])&&(i=""),typeof i){case"number":i=i.toLocaleString();break;case"boolean":i=t.literals[""+i]?t.literals[""+i]:i;break;case"object":i=JSON.stringify(i)}e+=i,n=!1})),e+"\n"}),n+"\n")},e}();var F=function(){};var S=function(){};var D=function(){};var P=function(){};var E=function(){function e(e){this.http=e,this.headers={headers:{"X-PO-Screen-Lock":"true"}},this.urlCadServidor="/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao",this.urlJobScheduler="/dts/datasul-rest/resources/prg/framework/v1/jobScheduler",this.urlJobExecution="/dts/datasul-rest/resources/prg/framework/v1/jobExecution"}return e.prototype.getFilteredItems=function(e){var t=new Array;return t.push("pageSize="+e.pageSize.toString()),t.push("page="+e.page.toString()),e.filter&&e.filter.length>0&&t.push("quickSearch="+e.filter),this.http.get(this.urlCadServidor+"?"+t.join("&"))},e.prototype.getObjectByValue=function(e){return this.http.get(this.urlCadServidor+"/"+e,this.headers)},e.prototype.createExecution=function(e,t){var r=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.createExecutionForNow=function(e,t){var r,n=new Date,o=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return o.businessParams&&0!==o.businessParams.length||(o.businessParams=[{chave:"",valor:""}]),(r={}).status="active",r.processID=o.programName,r.firstExecution=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()+"T"+this.addZero(n.getHours())+":"+this.addZero(n.getMinutes())+":00.000Z",r.recurrent=!1,r.executionParameter={parametros:[{chave:"rpwServer",valor:o.executionServer},{chave:"RPW_PROGRAM",valor:o.externalName},{chave:"RPW_PRG_EMS5",valor:o.programEMS5?"yes":"no"},{chave:"RPW_PRG_VERS",valor:o.programVersion},{parametros_negocio:o.businessParams}]},t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.getExecutionByJobScheduleID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"?jobScheduleID="+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("jobScheduleID",e)})))},e.prototype.getExecutionByExecutionID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"/"+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("executionID",e)})))},e.prototype.getExecution=function(e,t){return t?this.http.get(e,this.headers):this.http.get(e)},e.prototype.transformExecution=function(e,t){if(t&&t.items&&0!==t.items.length){t=t.items[0];var r=new D;return r.jobScheduleID=t.jobScheduleID,r.executionID=t.executionID,r.startedDate=t.startedDate,r.error=t.error,r.status=t.status,r}},e.prototype.followUpExcByJobScheduleID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("jobScheduleID",e,t,r,n)},e.prototype.followUpExcByExecutionID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("executionID",e,t,r,n)},e.prototype.followUpExecution=function(e,t,r,n,o){var i=this;this.jobExecutionSubscription$=null;var a=setInterval((function(){var r=new D;r.jobScheduleID="jobScheduleID"===e?t:"",r.executionID="executionID"===e?t:"",r.startedDate=null,r.error="",r.status="PENDING",i.jobExecutionSubscription$||("jobScheduleID"===e&&(i.jobExecutionSubscription$=i.getExecutionByJobScheduleID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))),"executionID"===e&&(i.jobExecutionSubscription$=i.getExecutionByExecutionID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))))}),r)},e.prototype.followUpExecReturnOk=function(e,t,r,n,o){r?t=r:(t.error="Agendamento não encontrado com ID: "+e,t.status="FAILURE"),o(t)&&"SUCCESS"!==t.status&&"FAILURE"!==t.status||clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.followUpExecReturnError=function(e,t,n,o){var i="";e instanceof r.HttpErrorResponse?(i=e.message,e.error&&(i="",e.error.code&&(i=e.error.code),e.error.message&&(i=i+" - "+e.error.message),e.error.detailedMessage&&(i=i+" - "+e.error.detailedMessage))):i=e,t.error=i,t.status="FAILURE",o(t),clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e.decorators=[{type:t.Injectable}],e.ctorParameters=function(){return[{type:r.HttpClient}]},e}();var j=function(){function e(e,r,n){this.poI18nService=e,this.rpwService=r,this.poNotification=n,this.programEMS5=!1,this.programVersion="",this.disabledParams=!1,this.loading=!1,this.endExecution=new t.EventEmitter,this.jsonObject={},this.literals={}}return e.prototype.ngOnInit=function(){this.setupComponents()},e.prototype.setupComponents=function(){this.executionTypeOptions=[{label:"Executar Hoje",value:1},{label:"Agendar Execução",value:2}],this.frequencyOptions=[{label:"Uma vez no dia",value:"no"},{label:"Várias vezes no dia",value:"yes"}],this.frequencyTypeOptions=[{label:"Hora(s)",value:"hour"},{label:"Minuto(s)",value:"minute"}],this.weeklyOptions=[{label:"Domingo",value:"Sunday"},{label:"Segunda",value:"Monday"},{label:"Terça",value:"Tuesday"},{label:"Quarta",value:"Wednesday"},{label:"Quinta",value:"Thursday"},{label:"Sexta",value:"Friday"},{label:"Sábado",value:"Saturday"}],this.zoomRpwServiceColumns=[{property:"code",label:"Servidor",type:"string",width:"20%"},{property:"name",label:"Descrição",type:"string",width:"80%"}],this.model=new S,this.model.executionType=1,this.model.repeatType=1,this.model.repeatExecution=!1},e.prototype.setScheduleParameters=function(e){e&&(this.model=e)},e.prototype.fieldRpwServiceFormat=function(e){return e.code+" - "+e.name},e.prototype.isExecutionSchedule=function(){return 2===this.model.executionType},e.prototype.isRepeatExecution=function(){return this.model.repeatExecution},e.prototype.isFrenquency=function(){return"yes"===this.model.frequency},e.prototype.changeRepeatExecution=function(){var e=new Date;this.model.execAppointHourInit||(this.model.execAppointHourInit=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.execAppointHourFinal||(this.model.execAppointHourFinal=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.selectWeeklys=[],this.model.dayOfMonth=0,this.model.frequency="no",this.model.frequencyType="hour",this.model.frequencyValue=0},e.prototype.changeExecutionType=function(){var e=new Date;this.model.execAppointDate=e,this.model.execAppointHour=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())},e.prototype.changeTypeFrequency=function(){},e.prototype.getActiveTab=function(e){return this.model.repeatType===e},e.prototype.setActiveTab=function(e){this.model.repeatType=e},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e.prototype.executeSchedule=function(){var e=this;if(!this.disabledParams&&this.validate()){if(this.jsonObject={},this.jsonObject.status="active",this.jsonObject.processID=this.programName,this.jsonObject.recurrent=this.model.repeatExecution,this.jsonObject.executionParameter={},1===this.model.executionType){var t=new Date;this.jsonObject.firstExecution=t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+"T"+this.addZero(t.getHours())+":"+this.addZero(t.getMinutes())+":00.000Z"}2===this.model.executionType&&(this.jsonObject.firstExecution=this.model.execAppointDate+"T"+this.model.execAppointHour+":00.000Z"),this.jsonObject.executionParameter.parametros=[],this.jsonObject.executionParameter.parametros[0]={chave:"rpwServer",valor:this.model.executionServer},this.jsonObject.executionParameter.parametros[1]={chave:"RPW_PROGRAM",valor:this.externalName},this.jsonObject.executionParameter.parametros[2]={chave:"RPW_PRG_EMS5",valor:this.programEMS5?"yes":"no"},this.jsonObject.executionParameter.parametros[3]={chave:"RPW_PRG_VERS",valor:this.programVersion},this.jsonObject.executionParameter.parametros[4]={},this.jsonObject.executionParameter.parametros[4].parametros_negocio=this.parameters,this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){e.poNotification.success("Agendamento realizado com sucesso !")})),this.model.repeatExecution&&(1===this.model.repeatType&&(this.jsonObject.daily={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m")}),2===this.model.repeatType&&(this.jsonObject.weekly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),daysOfWeek:this.model.selectWeeklys}),3===this.model.repeatType&&(this.jsonObject.monthly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),day:this.model.dayOfMonth}),this.isFrenquency()&&(this.jsonObject.rangeExecutions={frequency:{type:this.model.frequencyType,value:this.model.frequencyValue},rangeLimit:{hour:this.getHourOrMinute(this.model.execAppointHourFinal,"h"),minute:this.getHourOrMinute(this.model.execAppointHourFinal,"m")}}),this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){}))),this.endExecution.emit(this.model)}},e.prototype.getHourOrMinute=function(e,t){return"h"===t?+e.substring(0,2):"m"===t?+e.substring(3,6):void 0},e.prototype.compareHour=function(e,t){return e!==t&&(this.getHourOrMinute(e,"h")<this.getHourOrMinute(t,"h")||!(this.getHourOrMinute(e,"m")>this.getHourOrMinute(t,"m")))},e.prototype.validate=function(){if(!this.scheduleExecutionForm.valid)return this.poNotification.error("Verifique as inconsistências em tela."),!1;if(!this.model.executionServer)return this.poNotification.error("Servidor de Execução não foi informado."),!1;if(this.isExecutionSchedule()&&(!this.model.execAppointDate||!this.model.execAppointHour))return this.poNotification.error("Informar a data e a hora para agendamento da execução."),!1;if(this.model.repeatExecution){if(!this.model.execAppointHourInit)return this.poNotification.error("Informar a hora de início para a execução."),!1;if(2===this.model.repeatType&&0===this.model.selectWeeklys.length)return this.poNotification.error("Informar os dias da semana para a execução."),!1;if(3===this.model.repeatType&&!this.model.dayOfMonth)return this.poNotification.error("Informar o dia para a execução."),!1;if(this.isFrenquency()){if(!this.compareHour(this.model.execAppointHourInit,this.model.execAppointHourFinal))return this.poNotification.error("Hora Fim deve ser maior que Hora Início."),!1;if(0===this.model.frequencyValue)return this.poNotification.error("Informar a frequência de execução (A cada hora/minuto)."),!1}}return!0},e.decorators=[{type:t.Component,args:[{selector:"app-totvs-schedule-execution",template:'<form #scheduleExecutionForm="ngForm">\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="executionType"\r\n p-label="Data de Execução"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.executionType"\r\n [p-options]="executionTypeOptions"\r\n (p-change)="changeExecutionType()">\r\n </po-radio-group>\r\n\r\n <po-datepicker *ngIf=isExecutionSchedule()\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="model.execAppointDate"\r\n p-label="Agendar para"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointDate">\r\n </po-datepicker>\r\n\r\n <po-input *ngIf=isExecutionSchedule()\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHour"\r\n p-label="Hora"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHour">\r\n </po-input>\r\n </div>\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-lookup\r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="executionServer"\r\n p-label="Servidor de Execução"\r\n p-placeholder="Servidor de Execução"\r\n [p-columns]="zoomRpwServiceColumns"\r\n [p-field-format]="fieldRpwServiceFormat"\r\n [p-filter-service]="rpwService"\r\n p-field-label="name"\r\n p-field-value="code"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.executionServer">\r\n </po-lookup>\r\n </div>\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-switch\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="repeatExecution"\r\n p-label="Repetir ocorrência ?"\r\n p-label-off="Não"\r\n p-label-on="Sim"\r\n [(ngModel)]="model.repeatExecution"\r\n [p-disabled]="disabledParams"\r\n (click)="changeRepeatExecution()">\r\n </po-switch>\r\n </div>\r\n\r\n <div class="po-row" *ngIf="isRepeatExecution()">\r\n \r\n <po-tabs>\r\n\r\n <po-tab \r\n p-label="Diária" \r\n [p-active]="getActiveTab(1)" \r\n (p-click)="setActiveTab(1)">\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyDaily"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n \r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6"> \r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitDaily"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n \r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalDaily"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n \r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueDaily"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n \r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeDaily"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label="Semanal"\r\n [p-active]="getActiveTab(2)"\r\n (p-click)="setActiveTab(2)">\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-multiselect\r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="selectWeeklys"\r\n p-label="Dias da Semana"\r\n p-placeholder="Escolha os dias da semana"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.selectWeeklys"\r\n [p-options]="weeklyOptions">\r\n </po-multiselect>\r\n </div>\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyWeekly"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitWeekly"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n\r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalWeekly"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n\r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueWeekly"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n\r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeWeekly"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label="Mensal" \r\n [p-active]="getActiveTab(3)" \r\n (p-click)="setActiveTab(3)">\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-number\r\n class="po-sm-3 po-md-3 po-lg-3 po-xl-3"\r\n name="dayOfMonth"\r\n p-label="Dia do mês"\r\n p-minlength="1"\r\n p-maxlength="2"\r\n p-min="0"\r\n p-max="31"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.dayOfMonth">\r\n </po-number>\r\n </div>\r\n\r\n <div class="po-row po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyMonthly"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class="po-row po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitMonthly"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n\r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalWeekly"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n\r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueWeekly"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n\r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeWeekly"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n </po-tabs>\r\n </div>\r\n\r\n <div class="po-sm-12 po-md-12 po-lg-12 po-xl-12" style="padding-top: 15px;">\r\n <po-button\r\n style="float: right;"\r\n p-label="Gerar Agendamento RPW"\r\n [p-disabled]="disabledParams"\r\n (click)="executeSchedule()">\r\n </po-button>\r\n </div>\r\n</form>\r\n',styles:[""]}]}],e.ctorParameters=function(){return[{type:i.PoI18nService},{type:E},{type:i.PoNotificationService}]},e.propDecorators={scheduleExecutionForm:[{type:t.ViewChild,args:["scheduleExecutionForm",{static:!0}]}],programName:[{type:t.Input}],externalName:[{type:t.Input}],programEMS5:[{type:t.Input}],programVersion:[{type:t.Input}],parameters:[{type:t.Input}],disabledParams:[{type:t.Input}],loading:[{type:t.Input}],endExecution:[{type:t.Output}]},e}();var w=function(){function e(){}return e.prototype.transform=function(e,t){void 0===t&&(t="dd/MM/yyyy");var r=e.split("-"),n=r[0],o=r[1],i=r[2];return t.replace("dd",i).replace("MM",o).replace("yyyy",n)},e.decorators=[{type:t.Pipe,args:[{name:"dtsDateFormat"}]}],e}(),O=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[E]}},e.decorators=[{type:t.NgModule,args:[{declarations:[j,w],imports:[l.CommonModule,i.PoModule,a.FormsModule,r.HttpClientModule],exports:[j,w],providers:[E]}]}],e}();e.BreadcrumbControlService=d,e.CacheParamsService=h,e.DateUtil=v,e.DisclaimerUtil=g,e.DownloadDataParams=F,e.DtsBackofficeUtilsModule=O,e.DtsDateFormatPipe=w,e.ExecutionParameters=P,e.ExecutionStatus=D,e.FieldValidationUtil=y,e.FileUtil=I,e.FilterRangeUtil=b,e.GenericFunctionsUtils=x,e.MenuDatasulService=m,e.ProfileService=u,e.ReportFormats={XLSX:"xlsx",PDF:"pdf",DOCX:"docx",HTML:"html"},e.ReportService=c,e.ScheduleParameters=S,e.TotvsScheduleExecutionComponent=j,e.TotvsScheduleExecutionService=E,e.TranslateService=f,e.UserLoginService=s,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("@po-ui/ng-components"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("dts-backoffice-util",["exports","@angular/core","@angular/common/http","rxjs","rxjs/operators","@po-ui/ng-components","@angular/forms","@angular/common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["dts-backoffice-util"]={},e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.ngComponents,e.ng.forms,e.ng.common)}(this,(function(e,t,r,n,o,i,a,l){"use strict";var s=function(){function e(e){this.http=e,this.apiUrl="/totvs-menu/rest/getSessionInfo",this.userLogin=void 0}return e.prototype.getUserLogin=function(){var e=this;return localStorage.getItem("username")?n.of(localStorage.getItem("username")):this.userLogin?n.of(this.userLogin):this.http.get(""+this.apiUrl).pipe(o.map((function(t){return e.userLogin=t.userName,t.userName})))},e}();s.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],s.ctorParameters=function(){return[{type:r.HttpClient}]},s.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new s(t.ɵɵinject(r.HttpClient))},token:s,providedIn:"root"});var p={STRING:1,JSON:2};p[p.STRING]="STRING",p[p.JSON]="JSON";var u=function(){function e(e){this.http=e,this.apiURL="/dts/datasul-rest/resources/api/btb/btapi930za"}return e.prototype.setProfile=function(e){var t=e.pageId,r=e.userCode;return this.http.post(this.apiURL+"/setProfile?userCode="+r+"&pageId="+t,e,{headers:{"X-PO-Screen-Lock":"true"}})},e.prototype.getProfileAsString=function(e,t){return this.getProfile(e,p.STRING,t?"true":"false")},e.prototype.getProfileAsJSON=function(e,t){return this.getProfile(e,p.JSON,t?"true":"false")},e.prototype.getProfile=function(e,t,r){var n={"X-PO-Screen-Lock":r},i=e.pageId,a=e.dataCode,l=e.userCode;return this.http.get(this.apiURL+"/getProfile?userCode="+l+"&pageId="+i+"&dataCode="+a,{headers:n}).pipe(o.map((function(e){if(e.data[0])return t===p.STRING?e.data[0].dataValue:t===p.JSON?JSON.parse(e.data[0].dataValue):void 0})))},e}();u.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],u.ctorParameters=function(){return[{type:r.HttpClient}]},u.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new u(t.ɵɵinject(r.HttpClient))},token:u,providedIn:"root"});var c=function(){function e(e){this.httpClient=e,this.URL=window.location.href.indexOf("totvs-menu")>0?"/totvs-menu/rest/report/run/":"/dts/datasul-report/resources/run/"}return e.prototype.generate=function(e,t){var r=this;void 0===t&&(t=!0);var n={"X-PO-Screen-Lock":t?"true":"false"},i=""+this.URL+e.reportName;return e.properties.length>0&&(i+="?",e.properties.forEach((function(e,t){t>0&&(i+="&"),i+="c_properties="+e.name+"&c_values="+e.value}))),i+="&dialect="+e.dialect+"&format="+e.format,i+="&program="+e.programName+"&resultFileName="+e.downloadName,this.httpClient.post(i,{},{headers:n,responseType:"blob"}).pipe(o.map((function(t){return e.download&&r.download(t,e.downloadName+"."+e.format),t})))},e.prototype.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove()},e}();c.decorators=[{type:t.Injectable}],c.ctorParameters=function(){return[{type:r.HttpClient}]};var d=function(){function e(){}return e.prototype.newBreadcrumb=function(){this.breadcrumb={items:[]}},e.prototype.addBreadcrumb=function(e,t){this.addBreadcrumbURL(e,decodeURIComponent(t.snapshot._routerState.url))},e.prototype.addBreadcrumbURL=function(e,t){if(e&&""!==e){this.breadcrumb||this.newBreadcrumb();var r={items:[]},n=0;for(n=0;n<this.breadcrumb.items.length&&this.breadcrumb.items[n].label!==e;n++)r.items.push(this.breadcrumb.items[n]);r.items.push({label:e,link:t}),this.breadcrumb=r}},e.prototype.updBreadcrumbURL=function(e,t,r){var n=this.getCurrentRouter();n&&t&&r&&(n=n.replace(t,r),this.addBreadcrumbURL(e,n))},e.prototype.getBreadcrumb=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb},e.prototype.getCurrentRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=0?"":this.breadcrumb.items[this.breadcrumb.items.length-1].link},e.prototype.getPrevRouter=function(){return this.breadcrumb||this.newBreadcrumb(),this.breadcrumb.items.length<=1?"":this.breadcrumb.items[this.breadcrumb.items.length-2].link},e.prototype.hasPreviousRouter=function(){return this.breadcrumb.items.length>1},e}();d.decorators=[{type:t.Injectable}],d.ctorParameters=function(){return[]};var m=function(){function e(){}return e.prototype.callProgress=function(e){parent.postMessage({program:e},"*")},e.prototype.sendNotification=function(e){parent.postMessage({notification:e},"*")},e.prototype.openPath=function(e,t,r){void 0===r&&(r=!0);var n=document.referrer.indexOf("totvs-menu")>0?"totvs-menu":"menu-html",o="/"+n+"/#/"+n+"/program-html/"+e+"/#";t&&(o=o+"/"+t),r?window.open(o,"_parent"):window.open(o)},e}();m.decorators=[{type:t.Injectable}],m.ctorParameters=function(){return[]};var h=function(){function e(){this.values={}}return e.prototype.setValue=function(e,t){this.values[e]=t},e.prototype.getValue=function(e){return this.values[e]},e.prototype.removeValue=function(e){delete this.values[e]},e}();h.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],h.ctorParameters=function(){return[]},h.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new h},token:h,providedIn:"root"});var f=function(){function e(){}return e.getSuportLanguage=function(){return["pt-BR","pt","en-US","en","es"]},e.getDefaultCurrencyCode=function(){return"$"},e.getCurrentLanguage=function(){var e=localStorage.getItem("user.language")||navigator.language;return e&&this.getSuportLanguage().includes(e)?e:"en-US"},e}();f.decorators=[{type:t.Injectable}];var v=function(){function e(){}return e.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.ajustDateToModel=function(e,t){if(void 0===e&&(e={}),e.hasOwnProperty(t)&&e[t]){if(e[t].indexOf("T")>=0)return new Date(e[t]);var r=+e[t].split("-")[2],n=+e[t].split("-")[1],o=+e[t].split("-")[0];return new Date(o,n-1,r)}return null},e.pad=function(e){return e<10?"0"+e:e},e}(),g=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r}return e.prototype.makeDisclaimer=function(e,t,r,n,o){return void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===o&&(o=!1),null==t||o&&""===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(n?this.literals[t]:t),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),null==t||n&&0===t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+t,property:""+e,value:""+t}},e.prototype.makeDisclaimerFromBoolean=function(e,t,r){return void 0===r&&(r=!1),null==t?{label:"",property:"",value:""}:{hideClose:r,label:this.literals[e]+": "+(t?this.literals.yes:this.literals.no),property:""+e,value:""+t}},e.prototype.makeDisclaimerFromDate=function(e,t,r){void 0===r&&(r=!1);var n=this.ajustDate(t);return this.isValidDate(n)?{hideClose:r,label:this.literals[e]+": "+n.toLocaleDateString(),property:""+e,value:""+this.dateToQueryParam(n)}:{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelect=function(e,t,r,n,o){var i=this;void 0===r&&(r=0),void 0===n&&(n=!1),void 0===o&&(o=!1);var a="",l="";return t?(0===t.length||r>0&&t.length===r?(a=this.literals.all,l="all"):t.map((function(e){""!==a&&(a+=", "),""!==l&&(l+=","),a=""+a+(o?i.literals[e]:e),l=""+l+e})),{hideClose:n,label:this.literals[e]+": "+a,property:""+e,value:""+l}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromMultiSelectNumber=function(e,t,r,n,o){void 0===n&&(n=0),void 0===o&&(o=!1);var i="",a="",l=null;return t&&r?(0===t.length||n>0&&t.length===n?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),l=r.find((function(t){return t.value===e})),i=""+i+(l?l.label:e),a=""+a+e})),{hideClose:o,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromCheckboxGroup=function(e,t,r,n){var o=this;void 0===r&&(r=0),void 0===n&&(n=!1);var i="",a="";return t?(0===t.length?(i=this.literals.none,a="none"):r>0&&t.length===r?(i=this.literals.all,a="all"):t.map((function(e){""!==i&&(i+=", "),""!==a&&(a+=","),i=""+i+o.literals[e],a=""+a+e})),{hideClose:n,label:this.literals[e]+": "+i,property:""+e,value:""+a}):{label:"",property:"",value:""}},e.prototype.makeDisclaimerFromRangeCharacter=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],"'"+t.valInitial+"'","'"+t.valFinal+"'"]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!0),null!==t.valInitial&&void 0!==t.valInitial||(t.valInitial=t.iniInitial),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),n&&t.iniInitial===t.valInitial&&t.iniFinal===t.valFinal?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],t.valInitial,t.valFinal]),property:""+e,value:t.valInitial+";"+t.valFinal}},e.prototype.makeDisclaimerFromRangeDate=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!0);var o=this.ajustDate(t.valInitial),i=this.ajustDate(t.valFinal);return this.isValidDate(o)||(o=t.iniInitial,t.valInitial=t.iniInitial),this.isValidDate(i)||(i=t.iniFinal,t.valFinal=t.iniFinal),n&&this.dateToQueryParam(t.iniInitial)===this.dateToQueryParam(o)&&this.dateToQueryParam(t.iniFinal)===this.dateToQueryParam(i)?{label:"",property:"",value:""}:{hideClose:r,label:this.poI18nPipe.transform(this.literals.filterRange,[this.literals[e],o.toLocaleDateString(),i.toLocaleDateString()]),property:""+e,value:this.dateToQueryParam(o)+";"+this.dateToQueryParam(i)}},e.prototype.atzCharFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzNumberFromDisclamer=function(e,t,r){var n=r;return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),n},e.prototype.atzBooleanFromDisclamer=function(e,t,r){var n=r;if(e&&e.length>0){var o=e.find((function(e){return e.property===t}));if(o&&null!==o.value&&void 0!==o.value)return"true"===o.value}return n},e.prototype.atzDateFromDisclamer=function(e,t,r){var n=this,o=this.ajustDate(r);return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(o=n.ajustDate(e.value),!0))})),o},e.prototype.atzMultiSelectCharFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("char",e,t,r)},e.prototype.atzMultiSelectNumberFromDisclamer=function(e,t,r){return this.atzMultiSelectFromDisclamer("number",e,t,r)},e.prototype.atzMultiSelectFromDisclamer=function(e,t,r,n){var o=[];return n.map((function(e){o.push(e.value)})),t&&t.length>0&&t.find((function(t){return t.property===r&&(null!==t.value&&"all"!==t.value&&"none"!==t.value&&(o=[],t.value.split(",").forEach((function(t){"char"===e&&o.push(t),"number"===e&&o.push(+t)})),!0))})),o},e.prototype.atzCheckboxFromDisclamer=function(e,t,r){var n=[];return r.map((function(e){n.push(e.value)})),e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&"all"!==e.value&&"none"!==e.value&&(n=[],e.value.split(",").forEach((function(e){n.push(e)})),!0))})),n},e.prototype.atzRangeCharFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeCharFromQueryParam(n,r)},e.prototype.atzRangeNumFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeNumFromQueryParam(n,r)},e.prototype.atzRangeDateFromDisclamer=function(e,t,r){var n="";return e&&e.length>0&&e.find((function(e){return e.property===t&&(null!==e.value&&(n=e.value,!0))})),this.atzRangeDateFromQueryParam(n,r)},e.prototype.atzRangeCharFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=e.split(";")[0],t.valFinal=e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeNumFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=+e.split(";")[0],t.valFinal=+e.split(";")[1],null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.atzRangeDateFromQueryParam=function(e,t){return t.valInitial=t.iniInitial,t.valFinal=t.iniFinal,e&&""!==e?(t.valInitial=this.queryParamToDate(e.split(";")[0]),t.valFinal=this.queryParamToDate(e.split(";")[1]),null!==t.valFinal&&void 0!==t.valFinal||(t.valFinal=t.iniFinal),t):t},e.prototype.dateToQueryParam=function(e){var t=e.getDate(),r=e.getMonth()+1;return e.getFullYear()+"-"+this.pad(r)+"-"+this.pad(t)},e.prototype.queryParamToDate=function(e){var t=+e.split("-")[2],r=+e.split("-")[1],n=+e.split("-")[0];return new Date(n,r-1,t)},e.prototype.isValidDate=function(e){return e instanceof Date&&!isNaN(e.getTime())},e.prototype.ajustDate=function(e){return e instanceof Date?e:e?this.queryParamToDate(e.split("T")[0]):e},e.prototype.pad=function(e){return e<10?"0"+e:e},e}();var y=function(){function e(e,t,r){this.literals={},this.poNotification=e,this.poI18nPipe=t,this.literals=r,this.disclaimerUtil=new g(this.poNotification,this.poI18nPipe,this.literals)}return e.prototype.vldFieldCharacter=function(e,t){return!(!t||""===t.trim())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)},e.prototype.vldRangeCharacter=function(e,t,r,n){return!r||!n||(!(r.trim().toUpperCase()>n.trim().toUpperCase())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldNumber=function(e,t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),!(r&&!this.vldValueOfNumber(e,t))&&(!(!t||t<=0)||(0===t&&!0===n||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRequered,[this.literals[e]])}),!1)))},e.prototype.vldValueOfNumber=function(e,t){return!(t&&t<0)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldFieldPercent=function(e,t,r){return void 0===r&&(r=!1),!(r&&!this.vldValueOfPercent(e,t))&&!!this.vldFieldNumber(e,t)},e.prototype.vldValueOfPercent=function(e,t){return t&&t<0?(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1):!(t&&t>100)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldNumber,[t.toString(),this.literals[e]])}),!1)},e.prototype.vldRangeNumber=function(e,t,r,n){return r||(r=0),n||(n=0),!(r>n)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1)},e.prototype.vldFieldDate=function(e,t){var r=this.disclaimerUtil.ajustDate(t);return!!this.disclaimerUtil.isValidDate(r)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldDate,[this.literals[e]])}),!1)},e.prototype.vldRangeDate=function(e,t,r,n){return!r||!n||(!(this.disclaimerUtil.ajustDate(r).getTime()>this.disclaimerUtil.ajustDate(n).getTime())||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldRange,[this.literals[e],this.literals[t]])}),!1))},e.prototype.vldFieldMultiSelect=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldCheckbox=function(e,t){return!(!t||0===t.length)||(this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldSelected,[this.literals[e]])}),!1)},e.prototype.vldFieldFormat=function(e,t,r,n){void 0===n&&(n=!1);var o,i=!0;if(!t)return i;if(n&&(o=r,r=r.replace(/\./g,"")),t.length!==r.length)i=!1;else for(var a=0;a<r.length;a++){if("9"===r[a]&&"9"!==t[a].replace(/[0-9]/,"9")){i=!1;break}if("!"===r[a]&&"A"!==t[a].replace(/[A-Z]/,"A")){i=!1;break}}return n&&(r=o),i||this.poNotification.error({message:this.poI18nPipe.transform(this.literals.fieldVldFormat,[this.literals[e],r])}),i},e}();var b=function(){function e(){}return e.makeFilterRangeCharacter=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeNumber=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e.makeFilterRangeDate=function(e,t){return{iniInitial:e,iniFinal:t,valInitial:e,valFinal:t}},e}();var x=function(){function e(e){this.literals={},this.literals=e}return e.listToArrayCharacter=function(e){var t=new Array;return e&&""!==e&&(t=e.split(",")),t},e.ArrayToListCharacter=function(e){var t="";return e&&e.length>0&&(t=e.join(",")),t},e.isEmpty=function(e){var t=!0;for(var r in e)e.hasOwnProperty(r)&&(t=!1);return t},e.getChartValues=function(e){var t,r,n;(r=void 0,n=void 0,e.map((function(e){void 0===r&&void 0===n?(r=e.data[0],n=e.data[0]):(e.data<n&&(n=e.data[0]),e.data>r&&(r=e.data[0]))})),r>0&&n>0&&(t={maxValue:r,minValue:0}),r>0&&n<0&&(t={maxValue:r,minValue:n}),r<0&&n<0)&&(t={maxValue:n/3*-1,minValue:n});(r>0&&0===n&&(t={maxValue:r,minValue:0}),0===r&&n<0)&&(t={maxValue:n/3*-1,minValue:n});return 0===r&&0===n&&(t={maxValue:void 0,minValue:void 0}),t.maxValue=Math.round(t.maxValue),t.minValue=Math.round(t.minValue),t},e.atzMultiSelectListByOptions=function(e,t){var r;return t?(r=new Array,t.map((function(t){t&&e.findIndex((function(e){return e.value===t}))>=0&&r.push(t)})),r):t},e.prototype.loadOptionsMultiSelect=function(e,t){var r=this;t&&t.map((function(t){t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:"all"===t?r.literals.all:t,value:t})}))},e.prototype.loadOptionsSelect=function(e,t,r){void 0===r&&(r=!1),t&&t&&-1===e.findIndex((function(e){return e.value===t}))&&e.push({label:r?this.literals[t]:t,value:t})},e.prototype.compareObjects=function(e,t){if(!e||!t)return!1;if(Object.getOwnPropertyNames(e).length!==Object.getOwnPropertyNames(t).length)return!1;for(var r in e)if("$"!==r.substr(0,1)&&"_"!==r.substr(0,1)&&e[r]!==t[r])return!1;return!0},e.prototype.referenceGeneration=function(e,t){var r,n=t.getDate(),o=t.getMonth()+1,i=t.getFullYear();return""+(""+this.pad(i)+this.pad(o)+this.pad(n)+e)+(r=(r=(r=btoa(""+(new Date).getTime())).replace(/[=]/g,"")).slice(r.length-3,r.length))},e.prototype.pad=function(e){return e<10?"0"+e:e>99?(e+"").slice(2,4):e},e.prototype.focusInternalInput=function(e){document.getElementById(e).getElementsByClassName("po-input")[0].focus()},e}();var I=function(){function e(){}return e.downloadFile=function(e,t,r,n){var o=(n=!1!==n)?this.b64toBlob(e,r):e;this.download(o,t)},e.downloadData=function(e,t){if(void 0===t&&(t=null),e){t||(t=new F),t.fileName||(t.fileName="data.csv"),t.literals||(t.literals={}),t.columnDelimiter||(t.columnDelimiter=";"),t.columnList||(t.columnList=[]),t.columnExclude||(t.columnExclude=[]);var r=btoa(this.jsonToString(e,t));this.downloadFile(r,t.fileName,"text/csv")}},e.download=function(e,t){var r=[e],n=document.createElement("a"),o=window.URL.createObjectURL(new Blob(r,{type:e.type}));navigator.userAgent.toUpperCase().indexOf(".NET")>0||navigator.userAgent.toUpperCase().indexOf("EDGE")>0?window.navigator.msSaveOrOpenBlob(e,t):(n.href=o,n.setAttribute("download",t),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(o),n.remove())},e.b64toBlob=function(e,t,r){t=t||"",r=r||512;for(var n=atob(e),o=[],i=0;i<n.length;i+=r){for(var a=n.slice(i,i+r),l=new Array(a.length),s=0;s<a.length;s++)l[s]=a.charCodeAt(s);var p=new Uint8Array(l);o.push(p)}return new Blob(o,{type:t})},e.jsonToString=function(e,t){if(!e||0===e.length)return"";var r,n=null,o=[];return(t.columnList&&t.columnList.length>0?t.columnList:Object.keys(e[0])).forEach((function(e){r=!0,t.columnExclude&&t.columnExclude.length>0&&-1!==t.columnExclude.indexOf(e)&&(r=!1),r&&(o.push(e),n=n?n+t.columnDelimiter:"",n+=t.literals[e]?t.literals[e]:e)})),e.reduce((function(e,r){var n=!0,i=null;return o.forEach((function(o){switch(n||(e+=t.columnDelimiter),null==(i=r[o])&&(i=""),typeof i){case"number":i=i.toLocaleString();break;case"boolean":i=t.literals[""+i]?t.literals[""+i]:i;break;case"object":i=JSON.stringify(i)}e+=i,n=!1})),e+"\n"}),n+"\n")},e}();var F=function(){};var S=function(){};var D=function(){};var P=function(){};var E=function(){function e(e){this.http=e,this.headers={headers:{"X-PO-Screen-Lock":"true"}},this.urlCadServidor="/dts/datasul-rest/resources/prg/btb/v1/servidoresExecucao",this.urlJobScheduler="/dts/datasul-rest/resources/prg/framework/v1/jobScheduler",this.urlJobExecution="/dts/datasul-rest/resources/prg/framework/v1/jobExecution"}return e.prototype.getFilteredItems=function(e){var t=new Array;return t.push("pageSize="+e.pageSize.toString()),t.push("page="+e.page.toString()),e.filter&&e.filter.length>0&&t.push("quickSearch="+e.filter),this.http.get(this.urlCadServidor+"?"+t.join("&"))},e.prototype.getObjectByValue=function(e){return this.http.get(this.urlCadServidor+"/"+e,this.headers)},e.prototype.createExecution=function(e,t){var r=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.createExecutionForNow=function(e,t){var r,n=new Date,o=JSON.parse(JSON.stringify(e).replace(/\\\\/g,"*|"));return o.businessParams&&0!==o.businessParams.length||(o.businessParams=[{chave:"",valor:""}]),(r={}).status="active",r.processID=o.programName,r.firstExecution=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()+"T"+this.addZero(n.getHours())+":"+this.addZero(n.getMinutes())+":00.000Z",r.recurrent=!1,r.executionParameter={parametros:[{chave:"rpwServer",valor:o.executionServer},{chave:"RPW_PROGRAM",valor:o.externalName},{chave:"RPW_PRG_EMS5",valor:o.programEMS5?"yes":"no"},{chave:"RPW_PRG_VERS",valor:o.programVersion},{parametros_negocio:o.businessParams}]},t?this.http.post(""+this.urlJobScheduler,r,this.headers):this.http.post(""+this.urlJobScheduler,r)},e.prototype.getExecutionByJobScheduleID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"?jobScheduleID="+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("jobScheduleID",e)})))},e.prototype.getExecutionByExecutionID=function(e,t){var r=this;void 0===t&&(t=!1);var n=this.urlJobExecution+"/"+e;return this.getExecution(n,t).pipe(o.map((function(e){return r.transformExecution("executionID",e)})))},e.prototype.getExecution=function(e,t){return t?this.http.get(e,this.headers):this.http.get(e)},e.prototype.transformExecution=function(e,t){if(t&&t.items&&0!==t.items.length){t=t.items[0];var r=new D;return r.jobScheduleID=t.jobScheduleID,r.executionID=t.executionID,r.startedDate=t.startedDate,r.error=t.error,r.status=t.status,r}},e.prototype.followUpExcByJobScheduleID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("jobScheduleID",e,t,r,n)},e.prototype.followUpExcByExecutionID=function(e,t,r,n){void 0===n&&(n=!1),this.followUpExecution("executionID",e,t,r,n)},e.prototype.followUpExecution=function(e,t,r,n,o){var i=this;this.jobExecutionSubscription$=null;var a=setInterval((function(){var r=new D;r.jobScheduleID="jobScheduleID"===e?t:"",r.executionID="executionID"===e?t:"",r.startedDate=null,r.error="",r.status="PENDING",i.jobExecutionSubscription$||("jobScheduleID"===e&&(i.jobExecutionSubscription$=i.getExecutionByJobScheduleID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))),"executionID"===e&&(i.jobExecutionSubscription$=i.getExecutionByExecutionID(t,o).subscribe((function(e){i.followUpExecReturnOk(t,r,e,a,n)}),(function(e){i.followUpExecReturnError(e,r,a,n)}))))}),r)},e.prototype.followUpExecReturnOk=function(e,t,r,n,o){r?t=r:(t.error="Agendamento não encontrado com ID: "+e,t.status="FAILURE"),o(t)&&"SUCCESS"!==t.status&&"FAILURE"!==t.status||clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.followUpExecReturnError=function(e,t,n,o){var i="";e instanceof r.HttpErrorResponse?(i=e.message,e.error&&(i="",e.error.code&&(i=e.error.code),e.error.message&&(i=i+" - "+e.error.message),e.error.detailedMessage&&(i=i+" - "+e.error.detailedMessage))):i=e,t.error=i,t.status="FAILURE",o(t),clearInterval(n),this.jobExecutionSubscription$=null},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e}();E.decorators=[{type:t.Injectable}],E.ctorParameters=function(){return[{type:r.HttpClient}]};var j=function(){function e(e,r,n){this.poI18nService=e,this.rpwService=r,this.poNotification=n,this.programEMS5=!1,this.programVersion="",this.disabledParams=!1,this.loading=!1,this.endExecution=new t.EventEmitter,this.jsonObject={},this.literals={}}return e.prototype.ngOnInit=function(){this.setupComponents()},e.prototype.setupComponents=function(){this.executionTypeOptions=[{label:"Executar Hoje",value:1},{label:"Agendar Execução",value:2}],this.frequencyOptions=[{label:"Uma vez no dia",value:"no"},{label:"Várias vezes no dia",value:"yes"}],this.frequencyTypeOptions=[{label:"Hora(s)",value:"hour"},{label:"Minuto(s)",value:"minute"}],this.weeklyOptions=[{label:"Domingo",value:"Sunday"},{label:"Segunda",value:"Monday"},{label:"Terça",value:"Tuesday"},{label:"Quarta",value:"Wednesday"},{label:"Quinta",value:"Thursday"},{label:"Sexta",value:"Friday"},{label:"Sábado",value:"Saturday"}],this.zoomRpwServiceColumns=[{property:"code",label:"Servidor",type:"string",width:"20%"},{property:"name",label:"Descrição",type:"string",width:"80%"}],this.model=new S,this.model.executionType=1,this.model.repeatType=1,this.model.repeatExecution=!1},e.prototype.setScheduleParameters=function(e){e&&(this.model=e)},e.prototype.fieldRpwServiceFormat=function(e){return e.code+" - "+e.name},e.prototype.isExecutionSchedule=function(){return 2===this.model.executionType},e.prototype.isRepeatExecution=function(){return this.model.repeatExecution},e.prototype.isFrenquency=function(){return"yes"===this.model.frequency},e.prototype.changeRepeatExecution=function(){var e=new Date;this.model.execAppointHourInit||(this.model.execAppointHourInit=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.execAppointHourFinal||(this.model.execAppointHourFinal=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())),this.model.selectWeeklys=[],this.model.dayOfMonth=0,this.model.frequency="no",this.model.frequencyType="hour",this.model.frequencyValue=0},e.prototype.changeExecutionType=function(){var e=new Date;this.model.execAppointDate=e,this.model.execAppointHour=this.addZero(e.getHours())+":"+this.addZero(e.getMinutes())},e.prototype.changeTypeFrequency=function(){},e.prototype.getActiveTab=function(e){return this.model.repeatType===e},e.prototype.setActiveTab=function(e){this.model.repeatType=e},e.prototype.addZero=function(e){var t=""+e;return e<10&&(t="0"+e),t},e.prototype.executeSchedule=function(){var e=this;if(!this.disabledParams&&this.validate()){if(this.jsonObject={},this.jsonObject.status="active",this.jsonObject.processID=this.programName,this.jsonObject.recurrent=this.model.repeatExecution,this.jsonObject.executionParameter={},1===this.model.executionType){var t=new Date;this.jsonObject.firstExecution=t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+"T"+this.addZero(t.getHours())+":"+this.addZero(t.getMinutes())+":00.000Z"}2===this.model.executionType&&(this.jsonObject.firstExecution=this.model.execAppointDate+"T"+this.model.execAppointHour+":00.000Z"),this.jsonObject.executionParameter.parametros=[],this.jsonObject.executionParameter.parametros[0]={chave:"rpwServer",valor:this.model.executionServer},this.jsonObject.executionParameter.parametros[1]={chave:"RPW_PROGRAM",valor:this.externalName},this.jsonObject.executionParameter.parametros[2]={chave:"RPW_PRG_EMS5",valor:this.programEMS5?"yes":"no"},this.jsonObject.executionParameter.parametros[3]={chave:"RPW_PRG_VERS",valor:this.programVersion},this.jsonObject.executionParameter.parametros[4]={},this.jsonObject.executionParameter.parametros[4].parametros_negocio=this.parameters,this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){e.poNotification.success("Agendamento realizado com sucesso !")})),this.model.repeatExecution&&(1===this.model.repeatType&&(this.jsonObject.daily={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m")}),2===this.model.repeatType&&(this.jsonObject.weekly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),daysOfWeek:this.model.selectWeeklys}),3===this.model.repeatType&&(this.jsonObject.monthly={hour:this.getHourOrMinute(this.model.execAppointHourInit,"h"),minute:this.getHourOrMinute(this.model.execAppointHourInit,"m"),day:this.model.dayOfMonth}),this.isFrenquency()&&(this.jsonObject.rangeExecutions={frequency:{type:this.model.frequencyType,value:this.model.frequencyValue},rangeLimit:{hour:this.getHourOrMinute(this.model.execAppointHourFinal,"h"),minute:this.getHourOrMinute(this.model.execAppointHourFinal,"m")}}),this.rpwService.createExecution(this.jsonObject,this.loading).subscribe((function(){}))),this.endExecution.emit(this.model)}},e.prototype.getHourOrMinute=function(e,t){return"h"===t?+e.substring(0,2):"m"===t?+e.substring(3,6):void 0},e.prototype.compareHour=function(e,t){return e!==t&&(this.getHourOrMinute(e,"h")<this.getHourOrMinute(t,"h")||!(this.getHourOrMinute(e,"m")>this.getHourOrMinute(t,"m")))},e.prototype.validate=function(){if(!this.scheduleExecutionForm.valid)return this.poNotification.error("Verifique as inconsistências em tela."),!1;if(!this.model.executionServer)return this.poNotification.error("Servidor de Execução não foi informado."),!1;if(this.isExecutionSchedule()&&(!this.model.execAppointDate||!this.model.execAppointHour))return this.poNotification.error("Informar a data e a hora para agendamento da execução."),!1;if(this.model.repeatExecution){if(!this.model.execAppointHourInit)return this.poNotification.error("Informar a hora de início para a execução."),!1;if(2===this.model.repeatType&&0===this.model.selectWeeklys.length)return this.poNotification.error("Informar os dias da semana para a execução."),!1;if(3===this.model.repeatType&&!this.model.dayOfMonth)return this.poNotification.error("Informar o dia para a execução."),!1;if(this.isFrenquency()){if(!this.compareHour(this.model.execAppointHourInit,this.model.execAppointHourFinal))return this.poNotification.error("Hora Fim deve ser maior que Hora Início."),!1;if(0===this.model.frequencyValue)return this.poNotification.error("Informar a frequência de execução (A cada hora/minuto)."),!1}}return!0},e}();j.decorators=[{type:t.Component,args:[{selector:"app-totvs-schedule-execution",template:'<form #scheduleExecutionForm="ngForm">\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="executionType"\r\n p-label="Data de Execução"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.executionType"\r\n [p-options]="executionTypeOptions"\r\n (p-change)="changeExecutionType()">\r\n </po-radio-group>\r\n\r\n <po-datepicker *ngIf=isExecutionSchedule()\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="model.execAppointDate"\r\n p-label="Agendar para"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointDate">\r\n </po-datepicker>\r\n\r\n <po-input *ngIf=isExecutionSchedule()\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHour"\r\n p-label="Hora"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHour">\r\n </po-input>\r\n </div>\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-lookup\r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="executionServer"\r\n p-label="Servidor de Execução"\r\n p-placeholder="Servidor de Execução"\r\n [p-columns]="zoomRpwServiceColumns"\r\n [p-field-format]="fieldRpwServiceFormat"\r\n [p-filter-service]="rpwService"\r\n p-field-label="name"\r\n p-field-value="code"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.executionServer">\r\n </po-lookup>\r\n </div>\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-switch\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="repeatExecution"\r\n p-label="Repetir ocorrência ?"\r\n p-label-off="Não"\r\n p-label-on="Sim"\r\n [(ngModel)]="model.repeatExecution"\r\n [p-disabled]="disabledParams"\r\n (click)="changeRepeatExecution()">\r\n </po-switch>\r\n </div>\r\n\r\n <div class="po-row" *ngIf="isRepeatExecution()">\r\n \r\n <po-tabs>\r\n\r\n <po-tab \r\n p-label="Diária" \r\n [p-active]="getActiveTab(1)" \r\n (p-click)="setActiveTab(1)">\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyDaily"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n \r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6"> \r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitDaily"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n \r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalDaily"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n \r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueDaily"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n \r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeDaily"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label="Semanal"\r\n [p-active]="getActiveTab(2)"\r\n (p-click)="setActiveTab(2)">\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-multiselect\r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="selectWeeklys"\r\n p-label="Dias da Semana"\r\n p-placeholder="Escolha os dias da semana"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.selectWeeklys"\r\n [p-options]="weeklyOptions">\r\n </po-multiselect>\r\n </div>\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyWeekly"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class="po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitWeekly"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n\r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalWeekly"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n\r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueWeekly"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n\r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeWeekly"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n\r\n <po-tab \r\n p-label="Mensal" \r\n [p-active]="getActiveTab(3)" \r\n (p-click)="setActiveTab(3)">\r\n\r\n <div class="po-row po-sm-12 po-md-12 po-lg-12 po-xl-12">\r\n <po-number\r\n class="po-sm-3 po-md-3 po-lg-3 po-xl-3"\r\n name="dayOfMonth"\r\n p-label="Dia do mês"\r\n p-minlength="1"\r\n p-maxlength="2"\r\n p-min="0"\r\n p-max="31"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.dayOfMonth">\r\n </po-number>\r\n </div>\r\n\r\n <div class="po-row po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-radio-group \r\n class="po-sm-12 po-md-12 po-lg-12 po-xl-12"\r\n name="frequencyMonthly"\r\n p-label="Frequência"\r\n p-columns=1\r\n [(ngModel)]="model.frequency"\r\n [p-disabled]="disabledParams"\r\n [p-options]="frequencyOptions"\r\n (p-change)="changeTypeFrequency()">\r\n </po-radio-group>\r\n </div>\r\n\r\n <div class="po-row po-sm-6 po-md-6 po-lg-6 po-xl-6">\r\n <po-input\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourInitMonthly"\r\n p-label="Hora Início"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourInit">\r\n </po-input>\r\n\r\n <po-input *ngIf="isFrenquency()"\r\n class="po-sm-6 po-md-6 po-lg-6 po-xl-6"\r\n name="execAppointHourFinalWeekly"\r\n p-label="Hora Fim"\r\n p-mask="99:99"\r\n p-mask-format-model="true"\r\n p-pattern="^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"\r\n p-error-pattern="Hora inválida"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.execAppointHourFinal">\r\n </po-input>\r\n\r\n <po-number *ngIf="isFrenquency()"\r\n class="po-sm-5 po-md-5 po-lg-5 po-xl-5"\r\n name="frequencyValueWeekly"\r\n p-label="A cada"\r\n p-minlength="1"\r\n p-maxlength="3"\r\n p-min="0"\r\n p-max="999"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyValue">\r\n </po-number>\r\n\r\n <po-select *ngIf="isFrenquency()"\r\n class="po-mt-3 po-sm-7 po-md-7 po-lg-7 po-xl-7"\r\n name="frequencyTypeWeekly"\r\n p-label=""\r\n [p-options]="frequencyTypeOptions"\r\n [p-disabled]="disabledParams"\r\n [(ngModel)]="model.frequencyType">\r\n </po-select>\r\n </div>\r\n </po-tab>\r\n </po-tabs>\r\n </div>\r\n\r\n <div class="po-sm-12 po-md-12 po-lg-12 po-xl-12" style="padding-top: 15px;">\r\n <po-button\r\n style="float: right;"\r\n p-label="Gerar Agendamento RPW"\r\n [p-disabled]="disabledParams"\r\n (click)="executeSchedule()">\r\n </po-button>\r\n </div>\r\n</form>\r\n',styles:[""]}]}],j.ctorParameters=function(){return[{type:i.PoI18nService},{type:E},{type:i.PoNotificationService}]},j.propDecorators={scheduleExecutionForm:[{type:t.ViewChild,args:["scheduleExecutionForm",{static:!0}]}],programName:[{type:t.Input}],externalName:[{type:t.Input}],programEMS5:[{type:t.Input}],programVersion:[{type:t.Input}],parameters:[{type:t.Input}],disabledParams:[{type:t.Input}],loading:[{type:t.Input}],endExecution:[{type:t.Output}]};var w=function(){function e(){}return e.prototype.transform=function(e,t){void 0===t&&(t="dd/MM/yyyy");var r=e.split("-"),n=r[0],o=r[1],i=r[2];return t.replace("dd",i).replace("MM",o).replace("yyyy",n)},e}();w.decorators=[{type:t.Pipe,args:[{name:"dtsDateFormat"}]}];var O=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[E]}},e}();O.decorators=[{type:t.NgModule,args:[{declarations:[j,w],imports:[l.CommonModule,i.PoModule,a.FormsModule,r.HttpClientModule],exports:[j,w],providers:[E]}]}],e.BreadcrumbControlService=d,e.CacheParamsService=h,e.DateUtil=v,e.DisclaimerUtil=g,e.DownloadDataParams=F,e.DtsBackofficeUtilsModule=O,e.DtsDateFormatPipe=w,e.ExecutionParameters=P,e.ExecutionStatus=D,e.FieldValidationUtil=y,e.FileUtil=I,e.FilterRangeUtil=b,e.GenericFunctionsUtils=x,e.MenuDatasulService=m,e.ProfileService=u,e.ReportFormats={XLSX:"xlsx",PDF:"pdf",DOCX:"docx",HTML:"html"},e.ReportService=c,e.ScheduleParameters=S,e.TotvsScheduleExecutionComponent=j,e.TotvsScheduleExecutionService=E,e.TranslateService=f,e.UserLoginService=s,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=dts-backoffice-util.umd.min.js.map