@pumpkin-tech/pumpkin-tech-ng 0.1.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 (218) hide show
  1. package/README.md +63 -0
  2. package/esm2022/lib/components/action-dialog/action-dialog-config.mjs +2 -0
  3. package/esm2022/lib/components/action-dialog/action-dialog.component.mjs +70 -0
  4. package/esm2022/lib/components/action-dialog/index.mjs +3 -0
  5. package/esm2022/lib/components/action-result-dialog/action-result-dialog-data.mjs +2 -0
  6. package/esm2022/lib/components/action-result-dialog/action-result-dialog.component.mjs +70 -0
  7. package/esm2022/lib/components/action-result-dialog/index.mjs +3 -0
  8. package/esm2022/lib/components/action-row/action-row.component.mjs +19 -0
  9. package/esm2022/lib/components/action-row/index.mjs +2 -0
  10. package/esm2022/lib/components/alert/alert-data.mjs +2 -0
  11. package/esm2022/lib/components/alert/alert.component.mjs +59 -0
  12. package/esm2022/lib/components/alert/index.mjs +3 -0
  13. package/esm2022/lib/components/breadcrumb/breadcrumb.component.mjs +62 -0
  14. package/esm2022/lib/components/breadcrumb/index.mjs +2 -0
  15. package/esm2022/lib/components/button/button.component.mjs +355 -0
  16. package/esm2022/lib/components/button/index.mjs +2 -0
  17. package/esm2022/lib/components/check-box/check-box.component.mjs +108 -0
  18. package/esm2022/lib/components/check-box/index.mjs +2 -0
  19. package/esm2022/lib/components/confirmation-dialog/confirmation-dialog-data.mjs +2 -0
  20. package/esm2022/lib/components/confirmation-dialog/confirmation-dialog.component.mjs +66 -0
  21. package/esm2022/lib/components/confirmation-dialog/index.mjs +3 -0
  22. package/esm2022/lib/components/footer/footer.component.mjs +29 -0
  23. package/esm2022/lib/components/footer/index.mjs +2 -0
  24. package/esm2022/lib/components/header/header.component.mjs +85 -0
  25. package/esm2022/lib/components/header/index.mjs +2 -0
  26. package/esm2022/lib/components/icon/icon.component.mjs +53 -0
  27. package/esm2022/lib/components/icon/index.mjs +2 -0
  28. package/esm2022/lib/components/info-detail/index.mjs +3 -0
  29. package/esm2022/lib/components/info-detail/info-detail-dialog.component.mjs +96 -0
  30. package/esm2022/lib/components/info-detail/info-detail.component.mjs +43 -0
  31. package/esm2022/lib/components/input/index.mjs +2 -0
  32. package/esm2022/lib/components/input/input.component.mjs +316 -0
  33. package/esm2022/lib/components/input-date-picker-range/index.mjs +2 -0
  34. package/esm2022/lib/components/input-date-picker-range/input-date-picker-range.component.mjs +120 -0
  35. package/esm2022/lib/components/loading-overlay/index.mjs +2 -0
  36. package/esm2022/lib/components/loading-overlay/loading-overlay.component.mjs +29 -0
  37. package/esm2022/lib/components/nav/index.mjs +2 -0
  38. package/esm2022/lib/components/nav/nav.component.mjs +172 -0
  39. package/esm2022/lib/components/profile-menu/index.mjs +2 -0
  40. package/esm2022/lib/components/profile-menu/profile-menu.component.mjs +68 -0
  41. package/esm2022/lib/components/progress-bar/index.mjs +2 -0
  42. package/esm2022/lib/components/progress-bar/progress-bar.component.mjs +59 -0
  43. package/esm2022/lib/components/progress-bar-multiple/index.mjs +2 -0
  44. package/esm2022/lib/components/progress-bar-multiple/progress-bar-multiple.component.mjs +69 -0
  45. package/esm2022/lib/components/quantity-items/index.mjs +2 -0
  46. package/esm2022/lib/components/quantity-items/quantity-items.component.mjs +68 -0
  47. package/esm2022/lib/components/radio-group/index.mjs +2 -0
  48. package/esm2022/lib/components/radio-group/radio-group.component.mjs +74 -0
  49. package/esm2022/lib/components/radio-group-entity/index.mjs +2 -0
  50. package/esm2022/lib/components/radio-group-entity/radio-group-entity.component.mjs +101 -0
  51. package/esm2022/lib/components/select-entity/index.mjs +2 -0
  52. package/esm2022/lib/components/select-entity/select-entity.component.mjs +342 -0
  53. package/esm2022/lib/components/select-enum/index.mjs +2 -0
  54. package/esm2022/lib/components/select-enum/select-enum.component.mjs +93 -0
  55. package/esm2022/lib/components/slide-toggle/index.mjs +2 -0
  56. package/esm2022/lib/components/slide-toggle/slide-toggle.component.mjs +94 -0
  57. package/esm2022/lib/components/title/index.mjs +2 -0
  58. package/esm2022/lib/components/title/title.component.mjs +27 -0
  59. package/esm2022/lib/directives/click-catcher.directive.mjs +20 -0
  60. package/esm2022/lib/directives/date-mask.directive.mjs +58 -0
  61. package/esm2022/lib/directives/dynamic-tab.directive.mjs +18 -0
  62. package/esm2022/lib/directives/for.directive.mjs +35 -0
  63. package/esm2022/lib/directives/index.mjs +11 -0
  64. package/esm2022/lib/directives/lower-case.directive.mjs +48 -0
  65. package/esm2022/lib/directives/phone-mask-brazil.directive.mjs +64 -0
  66. package/esm2022/lib/directives/phone-mask-spain.directive.mjs +66 -0
  67. package/esm2022/lib/directives/red.directive.mjs +21 -0
  68. package/esm2022/lib/directives/space-drop.directive.mjs +48 -0
  69. package/esm2022/lib/directives/upper-case.directive.mjs +48 -0
  70. package/esm2022/lib/mock/fake-data.service.mjs +69 -0
  71. package/esm2022/lib/mock/index.mjs +2 -0
  72. package/esm2022/lib/modules/core.material.module.mjs +166 -0
  73. package/esm2022/lib/modules/directives.module.mjs +64 -0
  74. package/esm2022/lib/modules/pipes.module.mjs +56 -0
  75. package/esm2022/lib/modules/pumpkin-tech.module.mjs +193 -0
  76. package/esm2022/lib/modules/shared/portuguese.matpaginatorintl.mjs +28 -0
  77. package/esm2022/lib/pipes/currency-brl.pipe.mjs +27 -0
  78. package/esm2022/lib/pipes/date-ago.pipe.mjs +59 -0
  79. package/esm2022/lib/pipes/get-first-string-before-space.pipe.mjs +21 -0
  80. package/esm2022/lib/pipes/index.mjs +11 -0
  81. package/esm2022/lib/pipes/line-break-after-period.pipe.mjs +20 -0
  82. package/esm2022/lib/pipes/line-break-after.pipe.mjs +29 -0
  83. package/esm2022/lib/pipes/memory-format.pipe.mjs +35 -0
  84. package/esm2022/lib/pipes/phone-brazil.pipe.mjs +43 -0
  85. package/esm2022/lib/pipes/phone-spain.pipe.mjs +37 -0
  86. package/esm2022/lib/pipes/time.durantion.pipe.mjs +36 -0
  87. package/esm2022/lib/pipes/uptime-format.pipe.mjs +36 -0
  88. package/esm2022/lib/services/breadcrumb.service.mjs +51 -0
  89. package/esm2022/lib/services/breadcrumb.tokens.mjs +10 -0
  90. package/esm2022/lib/services/currency-preference.service.mjs +98 -0
  91. package/esm2022/lib/services/dialog.service.mjs +89 -0
  92. package/esm2022/lib/services/index.mjs +10 -0
  93. package/esm2022/lib/services/loading.service.mjs +27 -0
  94. package/esm2022/lib/services/message-token.mjs +16 -0
  95. package/esm2022/lib/services/module.change.service.mjs +19 -0
  96. package/esm2022/lib/services/nav.service.mjs +31 -0
  97. package/esm2022/lib/services/snackbar-message.service.mjs +59 -0
  98. package/esm2022/lib/utils/array.util.mjs +19 -0
  99. package/esm2022/lib/utils/currency.util.mjs +18 -0
  100. package/esm2022/lib/utils/date.util.mjs +80 -0
  101. package/esm2022/lib/utils/document.util.mjs +92 -0
  102. package/esm2022/lib/utils/index.mjs +9 -0
  103. package/esm2022/lib/utils/number.util.mjs +19 -0
  104. package/esm2022/lib/utils/object.util.mjs +28 -0
  105. package/esm2022/lib/utils/string.util.mjs +40 -0
  106. package/esm2022/lib/utils/uuid.util.mjs +18 -0
  107. package/esm2022/public-api.mjs +42 -0
  108. package/esm2022/pumpkin-tech-pumpkin-tech-ng.mjs +5 -0
  109. package/fesm2022/pumpkin-tech-pumpkin-tech-ng.mjs +4471 -0
  110. package/fesm2022/pumpkin-tech-pumpkin-tech-ng.mjs.map +1 -0
  111. package/index.d.ts +5 -0
  112. package/lib/components/action-dialog/action-dialog-config.d.ts +15 -0
  113. package/lib/components/action-dialog/action-dialog.component.d.ts +17 -0
  114. package/lib/components/action-dialog/index.d.ts +2 -0
  115. package/lib/components/action-result-dialog/action-result-dialog-data.d.ts +6 -0
  116. package/lib/components/action-result-dialog/action-result-dialog.component.d.ts +21 -0
  117. package/lib/components/action-result-dialog/index.d.ts +2 -0
  118. package/lib/components/action-row/action-row.component.d.ts +5 -0
  119. package/lib/components/action-row/index.d.ts +1 -0
  120. package/lib/components/alert/alert-data.d.ts +9 -0
  121. package/lib/components/alert/alert.component.d.ts +13 -0
  122. package/lib/components/alert/index.d.ts +2 -0
  123. package/lib/components/breadcrumb/breadcrumb.component.d.ts +11 -0
  124. package/lib/components/breadcrumb/index.d.ts +1 -0
  125. package/lib/components/button/button.component.d.ts +36 -0
  126. package/lib/components/button/index.d.ts +1 -0
  127. package/lib/components/check-box/check-box.component.d.ts +24 -0
  128. package/lib/components/check-box/index.d.ts +1 -0
  129. package/lib/components/confirmation-dialog/confirmation-dialog-data.d.ts +7 -0
  130. package/lib/components/confirmation-dialog/confirmation-dialog.component.d.ts +12 -0
  131. package/lib/components/confirmation-dialog/index.d.ts +2 -0
  132. package/lib/components/footer/footer.component.d.ts +6 -0
  133. package/lib/components/footer/index.d.ts +1 -0
  134. package/lib/components/header/header.component.d.ts +14 -0
  135. package/lib/components/header/index.d.ts +1 -0
  136. package/lib/components/icon/icon.component.d.ts +10 -0
  137. package/lib/components/icon/index.d.ts +1 -0
  138. package/lib/components/info-detail/index.d.ts +2 -0
  139. package/lib/components/info-detail/info-detail-dialog.component.d.ts +19 -0
  140. package/lib/components/info-detail/info-detail.component.d.ts +13 -0
  141. package/lib/components/input/index.d.ts +1 -0
  142. package/lib/components/input/input.component.d.ts +58 -0
  143. package/lib/components/input-date-picker-range/index.d.ts +1 -0
  144. package/lib/components/input-date-picker-range/input-date-picker-range.component.d.ts +37 -0
  145. package/lib/components/loading-overlay/index.d.ts +1 -0
  146. package/lib/components/loading-overlay/loading-overlay.component.d.ts +10 -0
  147. package/lib/components/nav/index.d.ts +1 -0
  148. package/lib/components/nav/nav.component.d.ts +31 -0
  149. package/lib/components/profile-menu/index.d.ts +1 -0
  150. package/lib/components/profile-menu/profile-menu.component.d.ts +16 -0
  151. package/lib/components/progress-bar/index.d.ts +1 -0
  152. package/lib/components/progress-bar/progress-bar.component.d.ts +12 -0
  153. package/lib/components/progress-bar-multiple/index.d.ts +1 -0
  154. package/lib/components/progress-bar-multiple/progress-bar-multiple.component.d.ts +19 -0
  155. package/lib/components/quantity-items/index.d.ts +1 -0
  156. package/lib/components/quantity-items/quantity-items.component.d.ts +10 -0
  157. package/lib/components/radio-group/index.d.ts +1 -0
  158. package/lib/components/radio-group/radio-group.component.d.ts +20 -0
  159. package/lib/components/radio-group-entity/index.d.ts +1 -0
  160. package/lib/components/radio-group-entity/radio-group-entity.component.d.ts +21 -0
  161. package/lib/components/select-entity/index.d.ts +1 -0
  162. package/lib/components/select-entity/select-entity.component.d.ts +60 -0
  163. package/lib/components/select-enum/index.d.ts +1 -0
  164. package/lib/components/select-enum/select-enum.component.d.ts +28 -0
  165. package/lib/components/slide-toggle/index.d.ts +1 -0
  166. package/lib/components/slide-toggle/slide-toggle.component.d.ts +46 -0
  167. package/lib/components/title/index.d.ts +1 -0
  168. package/lib/components/title/title.component.d.ts +11 -0
  169. package/lib/directives/click-catcher.directive.d.ts +6 -0
  170. package/lib/directives/date-mask.directive.d.ts +8 -0
  171. package/lib/directives/dynamic-tab.directive.d.ts +8 -0
  172. package/lib/directives/for.directive.d.ts +12 -0
  173. package/lib/directives/index.d.ts +10 -0
  174. package/lib/directives/lower-case.directive.d.ts +12 -0
  175. package/lib/directives/phone-mask-brazil.directive.d.ts +11 -0
  176. package/lib/directives/phone-mask-spain.directive.d.ts +11 -0
  177. package/lib/directives/red.directive.d.ts +9 -0
  178. package/lib/directives/space-drop.directive.d.ts +12 -0
  179. package/lib/directives/upper-case.directive.d.ts +12 -0
  180. package/lib/mock/fake-data.service.d.ts +34 -0
  181. package/lib/mock/index.d.ts +1 -0
  182. package/lib/modules/core.material.module.d.ts +43 -0
  183. package/lib/modules/directives.module.d.ts +16 -0
  184. package/lib/modules/pipes.module.d.ts +16 -0
  185. package/lib/modules/pumpkin-tech.module.d.ts +33 -0
  186. package/lib/modules/shared/portuguese.matpaginatorintl.d.ts +12 -0
  187. package/lib/pipes/currency-brl.pipe.d.ts +8 -0
  188. package/lib/pipes/date-ago.pipe.d.ts +8 -0
  189. package/lib/pipes/get-first-string-before-space.pipe.d.ts +7 -0
  190. package/lib/pipes/index.d.ts +10 -0
  191. package/lib/pipes/line-break-after-period.pipe.d.ts +7 -0
  192. package/lib/pipes/line-break-after.pipe.d.ts +7 -0
  193. package/lib/pipes/memory-format.pipe.d.ts +7 -0
  194. package/lib/pipes/phone-brazil.pipe.d.ts +7 -0
  195. package/lib/pipes/phone-spain.pipe.d.ts +7 -0
  196. package/lib/pipes/time.durantion.pipe.d.ts +7 -0
  197. package/lib/pipes/uptime-format.pipe.d.ts +7 -0
  198. package/lib/services/breadcrumb.service.d.ts +14 -0
  199. package/lib/services/breadcrumb.tokens.d.ts +9 -0
  200. package/lib/services/currency-preference.service.d.ts +24 -0
  201. package/lib/services/dialog.service.d.ts +41 -0
  202. package/lib/services/index.d.ts +9 -0
  203. package/lib/services/loading.service.d.ts +9 -0
  204. package/lib/services/message-token.d.ts +9 -0
  205. package/lib/services/module.change.service.d.ts +8 -0
  206. package/lib/services/nav.service.d.ts +11 -0
  207. package/lib/services/snackbar-message.service.d.ts +13 -0
  208. package/lib/utils/array.util.d.ts +9 -0
  209. package/lib/utils/currency.util.d.ts +8 -0
  210. package/lib/utils/date.util.d.ts +18 -0
  211. package/lib/utils/document.util.d.ts +4 -0
  212. package/lib/utils/index.d.ts +8 -0
  213. package/lib/utils/number.util.d.ts +5 -0
  214. package/lib/utils/object.util.d.ts +9 -0
  215. package/lib/utils/string.util.d.ts +10 -0
  216. package/lib/utils/uuid.util.d.ts +5 -0
  217. package/package.json +49 -0
  218. package/public-api.d.ts +37 -0
@@ -0,0 +1,4471 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, NgModule, EventEmitter, forwardRef, ElementRef, Component, ChangeDetectionStrategy, ViewChild, ContentChild, Output, Input, Inject, InjectionToken, Optional, Pipe, Directive, HostListener, inject } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
+ import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
+ import { coerceBooleanProperty } from '@angular/cdk/coercion';
6
+ import * as i1 from '@angular/common';
7
+ import { CommonModule, CurrencyPipe, formatNumber, formatDate, formatCurrency } from '@angular/common';
8
+ import * as i3$2 from '@angular/material/toolbar';
9
+ import { MatToolbarModule } from '@angular/material/toolbar';
10
+ import * as i4 from '@angular/material/sidenav';
11
+ import { MatSidenavModule } from '@angular/material/sidenav';
12
+ import * as i4$2 from '@angular/material/card';
13
+ import { MatCardModule } from '@angular/material/card';
14
+ import * as i5$2 from '@angular/material/list';
15
+ import { MatListModule } from '@angular/material/list';
16
+ import * as i2$1 from '@angular/material/button';
17
+ import { MatButtonModule } from '@angular/material/button';
18
+ import * as i1$4 from '@angular/material/snack-bar';
19
+ import { MatSnackBarModule, MAT_SNACK_BAR_DATA } from '@angular/material/snack-bar';
20
+ import * as i3 from '@angular/material/form-field';
21
+ import { MatFormFieldModule } from '@angular/material/form-field';
22
+ import * as i5 from '@angular/material/input';
23
+ import { MatInputModule } from '@angular/material/input';
24
+ import { MatTableModule } from '@angular/material/table';
25
+ import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginator';
26
+ import { MatSortModule } from '@angular/material/sort';
27
+ import * as i3$1 from '@angular/material/icon';
28
+ import { MatIconModule } from '@angular/material/icon';
29
+ import * as i6$1 from '@angular/material/divider';
30
+ import { MatDividerModule } from '@angular/material/divider';
31
+ import * as i7 from '@angular/material/tooltip';
32
+ import { MatTooltipModule } from '@angular/material/tooltip';
33
+ import * as i4$3 from '@angular/material/menu';
34
+ import { MatMenuModule } from '@angular/material/menu';
35
+ import * as i3$3 from '@angular/material/datepicker';
36
+ import { MatDatepickerModule } from '@angular/material/datepicker';
37
+ import * as i1$1 from '@angular/material/progress-bar';
38
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
39
+ import * as i1$2 from '@angular/material/slide-toggle';
40
+ import { MatSlideToggleModule } from '@angular/material/slide-toggle';
41
+ import * as i4$1 from '@angular/material/radio';
42
+ import { MatRadioModule } from '@angular/material/radio';
43
+ import * as i5$1 from '@angular/material/select';
44
+ import { MatSelectModule } from '@angular/material/select';
45
+ import * as i1$3 from '@angular/material/dialog';
46
+ import { MatDialogModule, MAT_DIALOG_DATA } from '@angular/material/dialog';
47
+ import * as i7$1 from '@angular/material/checkbox';
48
+ import { MatCheckboxModule } from '@angular/material/checkbox';
49
+ import * as i8 from '@angular/material/progress-spinner';
50
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
51
+ import * as i6 from '@angular/material/core';
52
+ import { MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
53
+ import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
54
+ import 'moment/locale/pt-br';
55
+ import * as i2$2 from '@angular/router';
56
+ import { RouterModule, NavigationEnd } from '@angular/router';
57
+ import * as i2$4 from 'rxjs';
58
+ import { BehaviorSubject, delay, tap, map, filter, of } from 'rxjs';
59
+ import * as i2$3 from '@angular/platform-browser';
60
+ import * as moment from 'moment';
61
+ import { filter as filter$1, switchMap } from 'rxjs/operators';
62
+ import { faker } from '@faker-js/faker';
63
+
64
+ class PortugueseMatPaginatorIntl extends MatPaginatorIntl {
65
+ itemsPerPageLabel = 'Itens por página';
66
+ nextPageLabel = 'Próxima página';
67
+ previousPageLabel = 'Página anterior';
68
+ firstPageLabel = 'Primeira página';
69
+ lastPageLabel = 'Última página';
70
+ // This part is optional, it adds the range label (1 – 5 of 30)
71
+ getRangeLabel = function (page, pageSize, length) {
72
+ if (length == 0 || pageSize == 0) {
73
+ return `0 de ${length}`;
74
+ }
75
+ length = Math.max(length, 0);
76
+ const startIndex = page * pageSize;
77
+ const endIndex = startIndex < length ?
78
+ Math.min(startIndex + pageSize, length) :
79
+ startIndex + pageSize;
80
+ return `${startIndex + 1} – ${endIndex} de ${length}`;
81
+ };
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PortugueseMatPaginatorIntl, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
83
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PortugueseMatPaginatorIntl });
84
+ }
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PortugueseMatPaginatorIntl, decorators: [{
86
+ type: Injectable
87
+ }] });
88
+
89
+ // src/lib/modules/material.module.ts
90
+ const MY_DATE_FORMATS = {
91
+ parse: {
92
+ dateInput: 'DD/MM/YYYY',
93
+ },
94
+ display: {
95
+ dateInput: 'DD/MM/YYYY',
96
+ monthYearLabel: 'MMM YYYY',
97
+ dateA11yLabel: 'LL',
98
+ monthYearA11yLabel: 'MMMM YYYY',
99
+ },
100
+ };
101
+ const MATERIAL = [
102
+ MatToolbarModule,
103
+ MatSidenavModule,
104
+ MatListModule,
105
+ MatButtonModule,
106
+ MatSnackBarModule,
107
+ MatCardModule,
108
+ MatFormFieldModule,
109
+ MatInputModule,
110
+ MatSelectModule,
111
+ MatTableModule,
112
+ MatPaginatorModule,
113
+ MatSortModule,
114
+ MatIconModule,
115
+ MatDividerModule,
116
+ MatTooltipModule,
117
+ MatMenuModule,
118
+ MatDatepickerModule,
119
+ MatProgressBarModule,
120
+ MatSlideToggleModule,
121
+ MatDialogModule,
122
+ MatRadioModule,
123
+ MatCheckboxModule,
124
+ MatProgressSpinnerModule
125
+ ];
126
+ class CoreMaterialModule {
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CoreMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
128
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: CoreMaterialModule, imports: [CommonModule, FormsModule, ReactiveFormsModule, MatToolbarModule,
129
+ MatSidenavModule,
130
+ MatListModule,
131
+ MatButtonModule,
132
+ MatSnackBarModule,
133
+ MatCardModule,
134
+ MatFormFieldModule,
135
+ MatInputModule,
136
+ MatSelectModule,
137
+ MatTableModule,
138
+ MatPaginatorModule,
139
+ MatSortModule,
140
+ MatIconModule,
141
+ MatDividerModule,
142
+ MatTooltipModule,
143
+ MatMenuModule,
144
+ MatDatepickerModule,
145
+ MatProgressBarModule,
146
+ MatSlideToggleModule,
147
+ MatDialogModule,
148
+ MatRadioModule,
149
+ MatCheckboxModule,
150
+ MatProgressSpinnerModule], exports: [CommonModule, FormsModule, ReactiveFormsModule, MatToolbarModule,
151
+ MatSidenavModule,
152
+ MatListModule,
153
+ MatButtonModule,
154
+ MatSnackBarModule,
155
+ MatCardModule,
156
+ MatFormFieldModule,
157
+ MatInputModule,
158
+ MatSelectModule,
159
+ MatTableModule,
160
+ MatPaginatorModule,
161
+ MatSortModule,
162
+ MatIconModule,
163
+ MatDividerModule,
164
+ MatTooltipModule,
165
+ MatMenuModule,
166
+ MatDatepickerModule,
167
+ MatProgressBarModule,
168
+ MatSlideToggleModule,
169
+ MatDialogModule,
170
+ MatRadioModule,
171
+ MatCheckboxModule,
172
+ MatProgressSpinnerModule] });
173
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CoreMaterialModule, providers: [
174
+ { provide: MatPaginatorIntl, useClass: PortugueseMatPaginatorIntl },
175
+ { provide: MAT_DATE_LOCALE, useValue: 'pt-BR' },
176
+ {
177
+ provide: DateAdapter,
178
+ useClass: MomentDateAdapter,
179
+ deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
180
+ },
181
+ { provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMATS },
182
+ ], imports: [CommonModule, FormsModule, ReactiveFormsModule, MATERIAL, CommonModule, FormsModule, ReactiveFormsModule, MatToolbarModule,
183
+ MatSidenavModule,
184
+ MatListModule,
185
+ MatButtonModule,
186
+ MatSnackBarModule,
187
+ MatCardModule,
188
+ MatFormFieldModule,
189
+ MatInputModule,
190
+ MatSelectModule,
191
+ MatTableModule,
192
+ MatPaginatorModule,
193
+ MatSortModule,
194
+ MatIconModule,
195
+ MatDividerModule,
196
+ MatTooltipModule,
197
+ MatMenuModule,
198
+ MatDatepickerModule,
199
+ MatProgressBarModule,
200
+ MatSlideToggleModule,
201
+ MatDialogModule,
202
+ MatRadioModule,
203
+ MatCheckboxModule,
204
+ MatProgressSpinnerModule] });
205
+ }
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CoreMaterialModule, decorators: [{
207
+ type: NgModule,
208
+ args: [{
209
+ imports: [CommonModule, FormsModule, ReactiveFormsModule, ...MATERIAL],
210
+ exports: [CommonModule, FormsModule, ReactiveFormsModule, ...MATERIAL],
211
+ providers: [
212
+ { provide: MatPaginatorIntl, useClass: PortugueseMatPaginatorIntl },
213
+ { provide: MAT_DATE_LOCALE, useValue: 'pt-BR' },
214
+ {
215
+ provide: DateAdapter,
216
+ useClass: MomentDateAdapter,
217
+ deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
218
+ },
219
+ { provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMATS },
220
+ ],
221
+ }]
222
+ }] });
223
+
224
+ class InputComponent {
225
+ _elementRef;
226
+ suffixRef;
227
+ buttonClick = new EventEmitter();
228
+ // Bool coerced (aceita "true"/"false" como string)
229
+ static ngAcceptInputType_required;
230
+ _required = false;
231
+ get required() { return this._required; }
232
+ set required(value) { this._required = coerceBooleanProperty(value); }
233
+ label = '';
234
+ placeholder = '';
235
+ disabled = false;
236
+ readonly = false;
237
+ maxlength = 250;
238
+ min;
239
+ max;
240
+ type = 'text';
241
+ name = '';
242
+ appearance = 'outline';
243
+ loading = false;
244
+ /** Ícone no suffix */
245
+ icon = '';
246
+ /** Pode ser 'primary' | 'accent' | 'warn' | '#hex' | 'rgb()' etc */
247
+ iconColor = 'primary';
248
+ /** Tamanhos opcionais */
249
+ iconWidth = '';
250
+ iconHeight = '';
251
+ /** Tamanho “real” do glifo */
252
+ iconSize = '';
253
+ /** Tooltip (no field quando sem ícone; no ícone quando há ícone) */
254
+ tooltip = '';
255
+ /** Acessibilidade */
256
+ ariaLabel;
257
+ /** Extras úteis */
258
+ autocomplete = 'off';
259
+ inputmode; // ex.: "numeric", "decimal"
260
+ pattern; // regex do HTML
261
+ fullWidth = true;
262
+ _val;
263
+ ngOnInit() { }
264
+ get value() { return this._val; }
265
+ set value(val) {
266
+ if (val !== this._val) {
267
+ this._val = val;
268
+ this.onChange(val);
269
+ this.onTouch();
270
+ }
271
+ }
272
+ // CVA
273
+ onChange = () => { };
274
+ onTouch = () => { };
275
+ writeValue(value) {
276
+ this._val = value;
277
+ // mantém o input visualmente sincronizado quando writeValue é chamado diretamente
278
+ if (this._elementRef?.nativeElement) {
279
+ this._elementRef.nativeElement.value = value ?? '';
280
+ }
281
+ }
282
+ registerOnChange(fn) { this.onChange = fn; }
283
+ registerOnTouched(fn) { this.onTouch = fn; }
284
+ setDisabledState(isDisabled) { this.disabled = isDisabled; }
285
+ onButtonClick() { this.buttonClick.emit(); }
286
+ // Helpers
287
+ isThemeColor(c, theme) {
288
+ return (c ?? '') === theme;
289
+ // Se quiser deixar mais esperto: return (c ?? '').toLowerCase() === theme;
290
+ }
291
+ get customIconColor() {
292
+ const c = this.iconColor ?? '';
293
+ return (c === 'primary' || c === 'accent' || c === 'warn') ? null : c;
294
+ }
295
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
296
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InputComponent, isStandalone: true, selector: "ptech-input", inputs: { required: "required", label: "label", placeholder: "placeholder", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", min: "min", max: "max", type: "type", name: "name", appearance: "appearance", loading: "loading", icon: "icon", iconColor: "iconColor", iconWidth: "iconWidth", iconHeight: "iconHeight", iconSize: "iconSize", tooltip: "tooltip", ariaLabel: "ariaLabel", autocomplete: "autocomplete", inputmode: "inputmode", pattern: "pattern", fullWidth: "fullWidth" }, outputs: { buttonClick: "buttonClick" }, providers: [{
297
+ provide: NG_VALUE_ACCESSOR,
298
+ useExisting: forwardRef(() => InputComponent),
299
+ multi: true
300
+ }], queries: [{ propertyName: "suffixRef", first: true, predicate: ["suffix"], descendants: true }], viewQueries: [{ propertyName: "_elementRef", first: true, predicate: ["inputElem"], descendants: true, read: ElementRef }], ngImport: i0, template: `
301
+ <div class="ptech-input-container" [class.full-width]="fullWidth">
302
+ <mat-form-field
303
+ [appearance]="appearance"
304
+ class="ptech-form-field"
305
+ [matTooltip]="!icon ? tooltip : null"
306
+ [matTooltipDisabled]="!tooltip || !!icon"
307
+ >
308
+ <mat-label>
309
+ {{ label }}
310
+ <span *ngIf="required" aria-hidden="true">*</span>
311
+ </mat-label>
312
+
313
+ <!-- prefix projetado -->
314
+ <ng-content select="[matPrefix]"></ng-content>
315
+
316
+ <!-- spinner no prefix quando loading -->
317
+ <mat-spinner
318
+ *ngIf="loading"
319
+ matPrefix
320
+ mode="indeterminate"
321
+ diameter="17">
322
+ </mat-spinner>
323
+
324
+ <input
325
+ #inputElem
326
+ matInput
327
+ [placeholder]="placeholder"
328
+ [required]="required"
329
+ [disabled]="disabled || loading"
330
+ [(ngModel)]="value"
331
+ [type]="type"
332
+ [attr.name]="name"
333
+ [attr.min]="min"
334
+ [attr.max]="max"
335
+ [attr.maxlength]="maxlength"
336
+ [readonly]="readonly"
337
+ [attr.inputmode]="inputmode || null"
338
+ [attr.pattern]="pattern || null"
339
+ [attr.autocomplete]="autocomplete || 'off'"
340
+ />
341
+
342
+ <!-- Suffix: preferimos o ícone local; se não houver, renderiza template 'suffix' ou qualquer [matSuffix] projetado -->
343
+ <ng-container *ngIf="icon; else projectedSuffix">
344
+ <button
345
+ mat-icon-button
346
+ matSuffix
347
+ type="button"
348
+ (click)="onButtonClick()"
349
+ [matTooltip]="tooltip"
350
+ [matTooltipDisabled]="!tooltip"
351
+ [attr.aria-label]="ariaLabel || label || icon"
352
+ >
353
+ <mat-icon
354
+ [ngClass]="{
355
+ 'mat-primary': isThemeColor(iconColor, 'primary'),
356
+ 'mat-accent': isThemeColor(iconColor, 'accent'),
357
+ 'mat-warn': isThemeColor(iconColor, 'warn')
358
+ }"
359
+ [style.color]="customIconColor"
360
+ [style.fontSize]="iconSize || null"
361
+ [style.width]="iconWidth || null"
362
+ [style.height]="iconHeight || null"
363
+ >
364
+ {{ icon }}
365
+ </mat-icon>
366
+ </button>
367
+ </ng-container>
368
+
369
+ <ng-template #projectedSuffix>
370
+ <ng-container *ngIf="suffixRef">
371
+ <ng-container [ngTemplateOutlet]="suffixRef"></ng-container>
372
+ </ng-container>
373
+ <ng-content select="[matSuffix]"></ng-content>
374
+ </ng-template>
375
+
376
+ <!-- Hints/Errors projetáveis -->
377
+ <ng-content select="mat-hint, [mat-hint]"></ng-content>
378
+ <ng-content select="mat-error, [mat-error]"></ng-content>
379
+ </mat-form-field>
380
+ </div>
381
+ `, isInline: true, styles: [".ptech-input-container{display:flex;flex-direction:column;width:100%}.ptech-input-container.full-width .ptech-form-field,.ptech-form-field{width:100%}@media (max-width: 768px){.ptech-input-container{width:100%!important}}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
382
+ }
383
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputComponent, decorators: [{
384
+ type: Component,
385
+ args: [{ selector: 'ptech-input', standalone: true, imports: [CoreMaterialModule], template: `
386
+ <div class="ptech-input-container" [class.full-width]="fullWidth">
387
+ <mat-form-field
388
+ [appearance]="appearance"
389
+ class="ptech-form-field"
390
+ [matTooltip]="!icon ? tooltip : null"
391
+ [matTooltipDisabled]="!tooltip || !!icon"
392
+ >
393
+ <mat-label>
394
+ {{ label }}
395
+ <span *ngIf="required" aria-hidden="true">*</span>
396
+ </mat-label>
397
+
398
+ <!-- prefix projetado -->
399
+ <ng-content select="[matPrefix]"></ng-content>
400
+
401
+ <!-- spinner no prefix quando loading -->
402
+ <mat-spinner
403
+ *ngIf="loading"
404
+ matPrefix
405
+ mode="indeterminate"
406
+ diameter="17">
407
+ </mat-spinner>
408
+
409
+ <input
410
+ #inputElem
411
+ matInput
412
+ [placeholder]="placeholder"
413
+ [required]="required"
414
+ [disabled]="disabled || loading"
415
+ [(ngModel)]="value"
416
+ [type]="type"
417
+ [attr.name]="name"
418
+ [attr.min]="min"
419
+ [attr.max]="max"
420
+ [attr.maxlength]="maxlength"
421
+ [readonly]="readonly"
422
+ [attr.inputmode]="inputmode || null"
423
+ [attr.pattern]="pattern || null"
424
+ [attr.autocomplete]="autocomplete || 'off'"
425
+ />
426
+
427
+ <!-- Suffix: preferimos o ícone local; se não houver, renderiza template 'suffix' ou qualquer [matSuffix] projetado -->
428
+ <ng-container *ngIf="icon; else projectedSuffix">
429
+ <button
430
+ mat-icon-button
431
+ matSuffix
432
+ type="button"
433
+ (click)="onButtonClick()"
434
+ [matTooltip]="tooltip"
435
+ [matTooltipDisabled]="!tooltip"
436
+ [attr.aria-label]="ariaLabel || label || icon"
437
+ >
438
+ <mat-icon
439
+ [ngClass]="{
440
+ 'mat-primary': isThemeColor(iconColor, 'primary'),
441
+ 'mat-accent': isThemeColor(iconColor, 'accent'),
442
+ 'mat-warn': isThemeColor(iconColor, 'warn')
443
+ }"
444
+ [style.color]="customIconColor"
445
+ [style.fontSize]="iconSize || null"
446
+ [style.width]="iconWidth || null"
447
+ [style.height]="iconHeight || null"
448
+ >
449
+ {{ icon }}
450
+ </mat-icon>
451
+ </button>
452
+ </ng-container>
453
+
454
+ <ng-template #projectedSuffix>
455
+ <ng-container *ngIf="suffixRef">
456
+ <ng-container [ngTemplateOutlet]="suffixRef"></ng-container>
457
+ </ng-container>
458
+ <ng-content select="[matSuffix]"></ng-content>
459
+ </ng-template>
460
+
461
+ <!-- Hints/Errors projetáveis -->
462
+ <ng-content select="mat-hint, [mat-hint]"></ng-content>
463
+ <ng-content select="mat-error, [mat-error]"></ng-content>
464
+ </mat-form-field>
465
+ </div>
466
+ `, providers: [{
467
+ provide: NG_VALUE_ACCESSOR,
468
+ useExisting: forwardRef(() => InputComponent),
469
+ multi: true
470
+ }], changeDetection: ChangeDetectionStrategy.OnPush, styles: [".ptech-input-container{display:flex;flex-direction:column;width:100%}.ptech-input-container.full-width .ptech-form-field,.ptech-form-field{width:100%}@media (max-width: 768px){.ptech-input-container{width:100%!important}}\n"] }]
471
+ }], propDecorators: { _elementRef: [{
472
+ type: ViewChild,
473
+ args: ['inputElem', { static: false, read: ElementRef }]
474
+ }], suffixRef: [{
475
+ type: ContentChild,
476
+ args: ['suffix', { static: false }]
477
+ }], buttonClick: [{
478
+ type: Output
479
+ }], required: [{
480
+ type: Input
481
+ }], label: [{
482
+ type: Input
483
+ }], placeholder: [{
484
+ type: Input
485
+ }], disabled: [{
486
+ type: Input
487
+ }], readonly: [{
488
+ type: Input
489
+ }], maxlength: [{
490
+ type: Input
491
+ }], min: [{
492
+ type: Input
493
+ }], max: [{
494
+ type: Input
495
+ }], type: [{
496
+ type: Input
497
+ }], name: [{
498
+ type: Input
499
+ }], appearance: [{
500
+ type: Input
501
+ }], loading: [{
502
+ type: Input
503
+ }], icon: [{
504
+ type: Input
505
+ }], iconColor: [{
506
+ type: Input
507
+ }], iconWidth: [{
508
+ type: Input
509
+ }], iconHeight: [{
510
+ type: Input
511
+ }], iconSize: [{
512
+ type: Input
513
+ }], tooltip: [{
514
+ type: Input
515
+ }], ariaLabel: [{
516
+ type: Input
517
+ }], autocomplete: [{
518
+ type: Input
519
+ }], inputmode: [{
520
+ type: Input
521
+ }], pattern: [{
522
+ type: Input
523
+ }], fullWidth: [{
524
+ type: Input
525
+ }] } });
526
+
527
+ class ButtonComponent {
528
+ static ngAcceptInputType_required;
529
+ _required = false;
530
+ get required() { return this._required; }
531
+ set required(value) { this._required = coerceBooleanProperty(value); }
532
+ type = 'basic';
533
+ tooltip = '';
534
+ disabled = false;
535
+ loading = false;
536
+ icon = '';
537
+ iconColor = '';
538
+ iconWidth = ''; // ex: '20px'
539
+ iconHeight = ''; // ex: '20px'
540
+ label = '';
541
+ textColor = '#ffffff';
542
+ link = '';
543
+ target = '_self';
544
+ shape = 'default';
545
+ ariaLabel;
546
+ color = 'primary';
547
+ fullWidth = true;
548
+ get isThemeColor() {
549
+ const c = (this.color ?? '').toString();
550
+ return c === 'primary' || c === 'accent' || c === 'warn';
551
+ }
552
+ /** Para [color] do Angular Material (ou undefined quando custom) */
553
+ get themeColor() {
554
+ return this.isThemeColor ? this.color : undefined;
555
+ }
556
+ /** Para aplicar bg custom somente quando não for primary/accent/warn */
557
+ get customBackground() {
558
+ return this.isThemeColor ? null : this.color;
559
+ }
560
+ /** MatIcon não respeita width/height do glifo: use font-size */
561
+ get iconStyle() {
562
+ const size = this.iconWidth || this.iconHeight || '';
563
+ return {
564
+ color: this.iconColor || null,
565
+ width: this.iconWidth || null,
566
+ height: this.iconHeight || null,
567
+ 'font-size': size || null,
568
+ 'line-height': this.iconHeight || null,
569
+ };
570
+ }
571
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
572
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ButtonComponent, isStandalone: true, selector: "ptech-button", inputs: { required: "required", type: "type", tooltip: "tooltip", disabled: "disabled", loading: "loading", icon: "icon", iconColor: "iconColor", iconWidth: "iconWidth", iconHeight: "iconHeight", label: "label", textColor: "textColor", link: "link", target: "target", shape: "shape", ariaLabel: "ariaLabel", color: "color", fullWidth: "fullWidth" }, ngImport: i0, template: `
573
+ <ng-container [ngSwitch]="type">
574
+
575
+ <!-- BASIC -->
576
+ <button
577
+ *ngSwitchCase="'basic'"
578
+ mat-button
579
+ [color]="themeColor"
580
+ [disabled]="disabled || loading"
581
+ [matTooltip]="tooltip"
582
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
583
+ [class.pill-style]="shape === 'pill'">
584
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
585
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
586
+ <span class="btn-label">{{ label }}</span>
587
+ </button>
588
+
589
+ <!-- RAISED -->
590
+ <button
591
+ *ngSwitchCase="'raised'"
592
+ mat-raised-button
593
+ [color]="themeColor"
594
+ [disabled]="disabled || loading"
595
+ [matTooltip]="tooltip"
596
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
597
+ [class.pill-style]="shape === 'pill'">
598
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
599
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
600
+ <span class="btn-label">{{ label }}</span>
601
+ </button>
602
+
603
+ <!-- STROKED -->
604
+ <button
605
+ *ngSwitchCase="'stroked'"
606
+ mat-stroked-button
607
+ [color]="themeColor"
608
+ [disabled]="disabled || loading"
609
+ [matTooltip]="tooltip"
610
+ [ngStyle]="{ color: textColor, width: fullWidth ? '100%' : null }"
611
+ [class.pill-style]="shape === 'pill'">
612
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
613
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
614
+ <span class="btn-label">{{ label }}</span>
615
+ </button>
616
+
617
+ <!-- FLAT -->
618
+ <button
619
+ *ngSwitchCase="'flat'"
620
+ mat-flat-button
621
+ [color]="themeColor"
622
+ [disabled]="disabled || loading"
623
+ [matTooltip]="tooltip"
624
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
625
+ [class.pill-style]="shape === 'pill'">
626
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
627
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
628
+ <span class="btn-label">{{ label }}</span>
629
+ </button>
630
+
631
+ <!-- ICON -->
632
+ <button
633
+ *ngSwitchCase="'icon'"
634
+ mat-icon-button
635
+ [color]="themeColor"
636
+ [disabled]="disabled || loading"
637
+ [matTooltip]="tooltip"
638
+ [class.pill-style]="shape === 'pill'"
639
+ [ngStyle]="{ width: fullWidth ? '100%' : null }"
640
+ [attr.aria-label]="ariaLabel || label || icon">
641
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
642
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
643
+ </button>
644
+
645
+ <!-- FAB -->
646
+ <button
647
+ *ngSwitchCase="'fab'"
648
+ mat-fab
649
+ [disabled]="disabled || loading"
650
+ [color]="themeColor"
651
+ [matTooltip]="tooltip"
652
+ [ngStyle]="{ 'background-color': customBackground }"
653
+ [attr.aria-label]="ariaLabel || label || icon">
654
+ <mat-icon *ngIf="!loading" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
655
+ <mat-progress-spinner *ngIf="loading" diameter="24" mode="indeterminate"></mat-progress-spinner>
656
+ </button>
657
+
658
+ <!-- MINI-FAB -->
659
+ <button
660
+ *ngSwitchCase="'mini-fab'"
661
+ mat-mini-fab
662
+ [disabled]="disabled || loading"
663
+ [color]="themeColor"
664
+ [matTooltip]="tooltip"
665
+ [ngStyle]="{ 'background-color': customBackground }"
666
+ [attr.aria-label]="ariaLabel || label || icon">
667
+ <mat-icon *ngIf="!loading" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
668
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
669
+ </button>
670
+
671
+ <!-- EXTENDED FAB (MDC) -->
672
+ <button
673
+ *ngSwitchCase="'extended'"
674
+ mat-fab
675
+ class="mat-mdc-extended-fab"
676
+ [disabled]="disabled || loading"
677
+ [color]="themeColor"
678
+ [matTooltip]="tooltip"
679
+ [ngStyle]="{ 'background-color': customBackground }"
680
+ [attr.aria-label]="ariaLabel || label || icon">
681
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
682
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
683
+ <span class="btn-label">{{ label }}</span>
684
+ </button>
685
+
686
+ <!-- LINK -->
687
+ <a
688
+ *ngSwitchCase="'link'"
689
+ mat-button
690
+ [href]="disabled || loading ? null : link"
691
+ [target]="target"
692
+ [matTooltip]="tooltip"
693
+ [ngStyle]="{ color: textColor }"
694
+ [class.pill-style]="shape === 'pill'"
695
+ [attr.aria-disabled]="(disabled || loading) ? 'true' : null"
696
+ (click)="$event && (disabled || loading) ? $event.preventDefault() : null">
697
+ <mat-icon *ngIf="icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
698
+ {{ label }}
699
+ </a>
700
+
701
+ </ng-container>
702
+ `, isInline: true, styles: [".pill-style{border-radius:20px}button,a[mat-button]{cursor:pointer;transition:box-shadow .3s,transform .2s;display:inline-flex;align-items:center;justify-content:center;gap:6px}.btn-label{margin-left:2px}button:hover{box-shadow:0 4px 8px #0003;transform:translateY(-2px)}button:active{box-shadow:0 2px 4px #0003;transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.5;transform:none;box-shadow:none}button.mat-mdc-icon-button{display:inline-flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatMiniFabButton, selector: "button[mat-mini-fab]", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatFabButton, selector: "button[mat-fab]", inputs: ["extended"], exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
703
+ }
704
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ButtonComponent, decorators: [{
705
+ type: Component,
706
+ args: [{ selector: 'ptech-button', standalone: true, imports: [CoreMaterialModule], template: `
707
+ <ng-container [ngSwitch]="type">
708
+
709
+ <!-- BASIC -->
710
+ <button
711
+ *ngSwitchCase="'basic'"
712
+ mat-button
713
+ [color]="themeColor"
714
+ [disabled]="disabled || loading"
715
+ [matTooltip]="tooltip"
716
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
717
+ [class.pill-style]="shape === 'pill'">
718
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
719
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
720
+ <span class="btn-label">{{ label }}</span>
721
+ </button>
722
+
723
+ <!-- RAISED -->
724
+ <button
725
+ *ngSwitchCase="'raised'"
726
+ mat-raised-button
727
+ [color]="themeColor"
728
+ [disabled]="disabled || loading"
729
+ [matTooltip]="tooltip"
730
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
731
+ [class.pill-style]="shape === 'pill'">
732
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
733
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
734
+ <span class="btn-label">{{ label }}</span>
735
+ </button>
736
+
737
+ <!-- STROKED -->
738
+ <button
739
+ *ngSwitchCase="'stroked'"
740
+ mat-stroked-button
741
+ [color]="themeColor"
742
+ [disabled]="disabled || loading"
743
+ [matTooltip]="tooltip"
744
+ [ngStyle]="{ color: textColor, width: fullWidth ? '100%' : null }"
745
+ [class.pill-style]="shape === 'pill'">
746
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
747
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
748
+ <span class="btn-label">{{ label }}</span>
749
+ </button>
750
+
751
+ <!-- FLAT -->
752
+ <button
753
+ *ngSwitchCase="'flat'"
754
+ mat-flat-button
755
+ [color]="themeColor"
756
+ [disabled]="disabled || loading"
757
+ [matTooltip]="tooltip"
758
+ [ngStyle]="{ color: textColor, 'background-color': customBackground, width: fullWidth ? '100%' : null }"
759
+ [class.pill-style]="shape === 'pill'">
760
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
761
+ <mat-progress-spinner *ngIf="loading" diameter="18" mode="indeterminate"></mat-progress-spinner>
762
+ <span class="btn-label">{{ label }}</span>
763
+ </button>
764
+
765
+ <!-- ICON -->
766
+ <button
767
+ *ngSwitchCase="'icon'"
768
+ mat-icon-button
769
+ [color]="themeColor"
770
+ [disabled]="disabled || loading"
771
+ [matTooltip]="tooltip"
772
+ [class.pill-style]="shape === 'pill'"
773
+ [ngStyle]="{ width: fullWidth ? '100%' : null }"
774
+ [attr.aria-label]="ariaLabel || label || icon">
775
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
776
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
777
+ </button>
778
+
779
+ <!-- FAB -->
780
+ <button
781
+ *ngSwitchCase="'fab'"
782
+ mat-fab
783
+ [disabled]="disabled || loading"
784
+ [color]="themeColor"
785
+ [matTooltip]="tooltip"
786
+ [ngStyle]="{ 'background-color': customBackground }"
787
+ [attr.aria-label]="ariaLabel || label || icon">
788
+ <mat-icon *ngIf="!loading" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
789
+ <mat-progress-spinner *ngIf="loading" diameter="24" mode="indeterminate"></mat-progress-spinner>
790
+ </button>
791
+
792
+ <!-- MINI-FAB -->
793
+ <button
794
+ *ngSwitchCase="'mini-fab'"
795
+ mat-mini-fab
796
+ [disabled]="disabled || loading"
797
+ [color]="themeColor"
798
+ [matTooltip]="tooltip"
799
+ [ngStyle]="{ 'background-color': customBackground }"
800
+ [attr.aria-label]="ariaLabel || label || icon">
801
+ <mat-icon *ngIf="!loading" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
802
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
803
+ </button>
804
+
805
+ <!-- EXTENDED FAB (MDC) -->
806
+ <button
807
+ *ngSwitchCase="'extended'"
808
+ mat-fab
809
+ class="mat-mdc-extended-fab"
810
+ [disabled]="disabled || loading"
811
+ [color]="themeColor"
812
+ [matTooltip]="tooltip"
813
+ [ngStyle]="{ 'background-color': customBackground }"
814
+ [attr.aria-label]="ariaLabel || label || icon">
815
+ <mat-icon *ngIf="!loading && icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
816
+ <mat-progress-spinner *ngIf="loading" diameter="20" mode="indeterminate"></mat-progress-spinner>
817
+ <span class="btn-label">{{ label }}</span>
818
+ </button>
819
+
820
+ <!-- LINK -->
821
+ <a
822
+ *ngSwitchCase="'link'"
823
+ mat-button
824
+ [href]="disabled || loading ? null : link"
825
+ [target]="target"
826
+ [matTooltip]="tooltip"
827
+ [ngStyle]="{ color: textColor }"
828
+ [class.pill-style]="shape === 'pill'"
829
+ [attr.aria-disabled]="(disabled || loading) ? 'true' : null"
830
+ (click)="$event && (disabled || loading) ? $event.preventDefault() : null">
831
+ <mat-icon *ngIf="icon" [ngStyle]="iconStyle">{{ icon }}</mat-icon>
832
+ {{ label }}
833
+ </a>
834
+
835
+ </ng-container>
836
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".pill-style{border-radius:20px}button,a[mat-button]{cursor:pointer;transition:box-shadow .3s,transform .2s;display:inline-flex;align-items:center;justify-content:center;gap:6px}.btn-label{margin-left:2px}button:hover{box-shadow:0 4px 8px #0003;transform:translateY(-2px)}button:active{box-shadow:0 2px 4px #0003;transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.5;transform:none;box-shadow:none}button.mat-mdc-icon-button{display:inline-flex;align-items:center;justify-content:center}\n"] }]
837
+ }], propDecorators: { required: [{
838
+ type: Input
839
+ }], type: [{
840
+ type: Input
841
+ }], tooltip: [{
842
+ type: Input
843
+ }], disabled: [{
844
+ type: Input
845
+ }], loading: [{
846
+ type: Input
847
+ }], icon: [{
848
+ type: Input
849
+ }], iconColor: [{
850
+ type: Input
851
+ }], iconWidth: [{
852
+ type: Input
853
+ }], iconHeight: [{
854
+ type: Input
855
+ }], label: [{
856
+ type: Input
857
+ }], textColor: [{
858
+ type: Input
859
+ }], link: [{
860
+ type: Input
861
+ }], target: [{
862
+ type: Input
863
+ }], shape: [{
864
+ type: Input
865
+ }], ariaLabel: [{
866
+ type: Input
867
+ }], color: [{
868
+ type: Input
869
+ }], fullWidth: [{
870
+ type: Input
871
+ }] } });
872
+
873
+ class IconComponent {
874
+ color = '';
875
+ icon = '';
876
+ size = 24; // número em pixels ou string válida
877
+ ariaHidden = 'true';
878
+ computeSize() {
879
+ const s = String(this.size);
880
+ // If purely numeric, append 'px'; otherwise assume valid CSS size string
881
+ return /^\d+$/.test(s) ? `${s}px` : s;
882
+ }
883
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
884
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: IconComponent, isStandalone: true, selector: "ptech-icon", inputs: { color: "color", icon: "icon", size: "size", ariaHidden: "ariaHidden" }, ngImport: i0, template: `
885
+ <mat-icon
886
+ [attr.aria-hidden]="ariaHidden"
887
+ [style.color]="color"
888
+ [style.fontSize]="computeSize()"
889
+ [style.width]="computeSize()"
890
+ [style.height]="computeSize()"
891
+ [style.lineHeight]="computeSize()"
892
+ [style.lineHeight]="computeSize()">
893
+ {{ icon }}
894
+ </mat-icon>
895
+ `, isInline: true, styles: [".material-icons{overflow:visible!important;padding:0!important;margin:0!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
896
+ }
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: IconComponent, decorators: [{
898
+ type: Component,
899
+ args: [{ selector: 'ptech-icon', standalone: true, imports: [CommonModule, CoreMaterialModule], template: `
900
+ <mat-icon
901
+ [attr.aria-hidden]="ariaHidden"
902
+ [style.color]="color"
903
+ [style.fontSize]="computeSize()"
904
+ [style.width]="computeSize()"
905
+ [style.height]="computeSize()"
906
+ [style.lineHeight]="computeSize()"
907
+ [style.lineHeight]="computeSize()">
908
+ {{ icon }}
909
+ </mat-icon>
910
+ `, styles: [".material-icons{overflow:visible!important;padding:0!important;margin:0!important}\n"] }]
911
+ }], propDecorators: { color: [{
912
+ type: Input
913
+ }], icon: [{
914
+ type: Input
915
+ }], size: [{
916
+ type: Input
917
+ }], ariaHidden: [{
918
+ type: Input
919
+ }] } });
920
+
921
+ class ActionRowComponent {
922
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
923
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ActionRowComponent, isStandalone: true, selector: "ptech-action-row", ngImport: i0, template: `
924
+ <div class="action-row">
925
+ <ng-content></ng-content>
926
+ </div>
927
+ `, isInline: true, styles: [".action-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:16px}@media (max-width: 767px){.action-row{flex-direction:column;align-items:stretch}}\n"] });
928
+ }
929
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionRowComponent, decorators: [{
930
+ type: Component,
931
+ args: [{ selector: 'ptech-action-row', standalone: true, template: `
932
+ <div class="action-row">
933
+ <ng-content></ng-content>
934
+ </div>
935
+ `, styles: [".action-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:16px}@media (max-width: 767px){.action-row{flex-direction:column;align-items:stretch}}\n"] }]
936
+ }] });
937
+
938
+ // ptech-quantity-items.component.ts
939
+ class QuantityItemsComponent {
940
+ quantity = 0;
941
+ quantityChange = new EventEmitter();
942
+ decrement() {
943
+ if (this.quantity > 0) {
944
+ this.quantity--;
945
+ this.quantityChange.emit(this.quantity);
946
+ }
947
+ }
948
+ increment() {
949
+ this.quantity++;
950
+ this.quantityChange.emit(this.quantity);
951
+ }
952
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: QuantityItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
953
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: QuantityItemsComponent, isStandalone: true, selector: "ptech-quantity-items", inputs: { quantity: "quantity" }, outputs: { quantityChange: "quantityChange" }, ngImport: i0, template: `
954
+ <div class="quantity-items-container" role="group" aria-label="Quantity selector">
955
+ <button
956
+ mat-icon-button
957
+ aria-label="Decrement"
958
+ [disabled]="quantity <= 0"
959
+ (click)="decrement()"
960
+ class="pill"
961
+ >
962
+ <mat-icon>remove</mat-icon>
963
+ </button>
964
+
965
+ <span class="quantity-value" aria-live="polite">{{ quantity }}</span>
966
+
967
+ <button mat-icon-button aria-label="Increment" (click)="increment()" class="pill">
968
+ <mat-icon>add</mat-icon>
969
+ </button>
970
+ </div>
971
+ `, isInline: true, styles: [".quantity-items-container{display:flex;align-items:center;gap:8px;margin-bottom:10px}.quantity-value{font-size:1.2em;width:36px;text-align:center}.pill{border-radius:50%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
972
+ }
973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: QuantityItemsComponent, decorators: [{
974
+ type: Component,
975
+ args: [{ selector: 'ptech-quantity-items', standalone: true, imports: [CommonModule, CoreMaterialModule], template: `
976
+ <div class="quantity-items-container" role="group" aria-label="Quantity selector">
977
+ <button
978
+ mat-icon-button
979
+ aria-label="Decrement"
980
+ [disabled]="quantity <= 0"
981
+ (click)="decrement()"
982
+ class="pill"
983
+ >
984
+ <mat-icon>remove</mat-icon>
985
+ </button>
986
+
987
+ <span class="quantity-value" aria-live="polite">{{ quantity }}</span>
988
+
989
+ <button mat-icon-button aria-label="Increment" (click)="increment()" class="pill">
990
+ <mat-icon>add</mat-icon>
991
+ </button>
992
+ </div>
993
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".quantity-items-container{display:flex;align-items:center;gap:8px;margin-bottom:10px}.quantity-value{font-size:1.2em;width:36px;text-align:center}.pill{border-radius:50%}\n"] }]
994
+ }], propDecorators: { quantity: [{
995
+ type: Input
996
+ }], quantityChange: [{
997
+ type: Output
998
+ }] } });
999
+
1000
+ // src/lib/utils/object.util.ts
1001
+ class ObjectUtil {
1002
+ static isNull(value) {
1003
+ return value === undefined || value === null;
1004
+ }
1005
+ static isEmptyObject(obj) {
1006
+ return Object.keys(obj).length === 0;
1007
+ }
1008
+ /**
1009
+ * Considera “novo” um modelo sem id ou com id não positivo.
1010
+ */
1011
+ static isNewModel(value) {
1012
+ if (ObjectUtil.isNull(value))
1013
+ return true;
1014
+ const id = value && typeof value === 'object' && 'id' in value ? value.id : undefined;
1015
+ if (id === undefined || id === null)
1016
+ return true;
1017
+ const numericId = Number(id);
1018
+ return isNaN(numericId) || numericId <= 0;
1019
+ }
1020
+ static clone(value) {
1021
+ if (ObjectUtil.isNull(value)) {
1022
+ return {};
1023
+ }
1024
+ return { ...value };
1025
+ }
1026
+ }
1027
+
1028
+ // src/lib/utils/string.util.ts
1029
+ class StringUtil {
1030
+ static EMPTY = '';
1031
+ static replaceAccents(value) {
1032
+ return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
1033
+ }
1034
+ static removeAccents(value) {
1035
+ return value.replace(/[^\w\s]/gi, '');
1036
+ }
1037
+ static isEmpty(value) {
1038
+ return ObjectUtil.isNull(value) || (typeof value === 'string' && value.trim().length === 0);
1039
+ }
1040
+ /**
1041
+ * Aplica máscara simples onde '9' é placeholder numérico.
1042
+ */
1043
+ static format(value, mask) {
1044
+ if (value === null || value === undefined)
1045
+ return StringUtil.EMPTY;
1046
+ let numeric = value.replace(/\D/g, '');
1047
+ const pad = mask.replace(/\D/g, '').replace(/9/g, '_');
1048
+ const valueMask = numeric + pad.substring(0, Math.max(0, pad.length - numeric.length));
1049
+ let valorMaskPos = 0;
1050
+ let formatted = '';
1051
+ for (let i = 0; i < mask.length; i++) {
1052
+ const m = mask.charAt(i);
1053
+ if (isNaN(parseInt(m, 10))) {
1054
+ formatted += m;
1055
+ }
1056
+ else {
1057
+ formatted += valueMask[valorMaskPos++] ?? '';
1058
+ }
1059
+ }
1060
+ if (formatted.indexOf('_') > -1) {
1061
+ formatted = formatted.substring(0, formatted.indexOf('_'));
1062
+ }
1063
+ return formatted;
1064
+ }
1065
+ }
1066
+
1067
+ // projects/pumpkin-tech-ng/src/lib/components/select-entity/select-entity.component.ts
1068
+ class SelectEntityComponent {
1069
+ // ===== Inputs =====
1070
+ appearance = 'outline';
1071
+ label = '';
1072
+ placeholder = '';
1073
+ disabled = false;
1074
+ multiple = false;
1075
+ static ngAcceptInputType_required;
1076
+ _required = false;
1077
+ get required() { return this._required; }
1078
+ set required(v) { this._required = coerceBooleanProperty(v); }
1079
+ /** propriedade a exibir (ex.: "description" ou "customer.name") */
1080
+ property = 'description';
1081
+ /** mapa para enums: { KEY: 'Rótulo' } — aplica se value final existir neste mapa */
1082
+ propertyEnum;
1083
+ /** função alternativa para extrair o texto a exibir do item */
1084
+ propertyFn;
1085
+ /** Id prop usada no compare/trackBy (default "id") */
1086
+ idProp = 'id';
1087
+ /** placeholder do campo de busca no painel */
1088
+ searchPlaceholder = 'Pesquise...';
1089
+ /** ex: mostrar 1º e um contador em múltipla seleção */
1090
+ multipleTriggerMax = 1;
1091
+ /** dados */
1092
+ entities = [];
1093
+ /** loading do combo */
1094
+ loading = false;
1095
+ // ===== Outputs =====
1096
+ selectionChange = new EventEmitter();
1097
+ loadingChange = new EventEmitter();
1098
+ // ===== Estado interno =====
1099
+ filteredEntities = [];
1100
+ model;
1101
+ searchText = '';
1102
+ // CVA
1103
+ onTouched = () => { };
1104
+ onChange = (_) => { };
1105
+ // ===== Lifecycle =====
1106
+ ngOnChanges(changes) {
1107
+ if (changes['entities']) {
1108
+ this.filteredEntities = [...(this.entities || [])];
1109
+ // auto-seleciona único item quando required & single
1110
+ if (!this.multiple && this.required && this.filteredEntities.length === 1) {
1111
+ this.setValue(this.filteredEntities[0]);
1112
+ }
1113
+ else {
1114
+ this.filterModel();
1115
+ }
1116
+ }
1117
+ if (changes['model'] && !this.multiple) {
1118
+ this.filterModel();
1119
+ }
1120
+ }
1121
+ // ===== CVA =====
1122
+ writeValue(value) {
1123
+ this.model = value;
1124
+ this.filterModel();
1125
+ }
1126
+ registerOnChange(fn) { this.onChange = fn; }
1127
+ registerOnTouched(fn) { this.onTouched = fn; }
1128
+ setDisabledState(isDisabled) { this.disabled = isDisabled; }
1129
+ // ===== API =====
1130
+ setValue(v) {
1131
+ this.model = v;
1132
+ this.onChange(v);
1133
+ this.onTouched();
1134
+ this.selectionChange.emit(v);
1135
+ }
1136
+ compareFn = (a, b) => {
1137
+ if (a == null && b == null)
1138
+ return true;
1139
+ if (a == null || b == null)
1140
+ return false;
1141
+ return this.resolveId(a) === this.resolveId(b);
1142
+ };
1143
+ trackById = (_, item) => this.resolveId(item);
1144
+ get triggerText() {
1145
+ if (this.multiple)
1146
+ return '';
1147
+ if (this.model == null)
1148
+ return this.placeholder || 'Selecione';
1149
+ return this.displayOf(this.model);
1150
+ }
1151
+ displayMultipleTrigger(items) {
1152
+ if (!items?.length)
1153
+ return this.placeholder || 'Selecione';
1154
+ const primary = this.displayOf(items[0]);
1155
+ const rest = items.length - 1;
1156
+ return rest > 0 ? `${primary} (+${rest})` : primary;
1157
+ }
1158
+ onSearch(value) {
1159
+ this.searchText = (value || '').trim().toLowerCase();
1160
+ if (!this.searchText) {
1161
+ this.filteredEntities = [...(this.entities || [])];
1162
+ return;
1163
+ }
1164
+ const parts = this.searchText
1165
+ .split(' ')
1166
+ .filter(Boolean)
1167
+ .map(p => StringUtil.replaceAccents(p));
1168
+ this.filteredEntities = (this.entities || []).filter(e => {
1169
+ const txt = StringUtil.replaceAccents(this.displayOf(e)).toLowerCase();
1170
+ return parts.every(p => txt.includes(p));
1171
+ });
1172
+ }
1173
+ // ===== Helpers =====
1174
+ // dentro do SelectEntityComponent
1175
+ isArray(v) {
1176
+ return Array.isArray(v);
1177
+ }
1178
+ filterModel() {
1179
+ if (this.multiple || !this.model || !this.entities?.length)
1180
+ return;
1181
+ const match = this.entities.find(e => this.compareFn(e, this.model));
1182
+ if (match && match !== this.model) {
1183
+ this.model = match;
1184
+ this.onChange(this.model);
1185
+ }
1186
+ }
1187
+ displayOf(entity) {
1188
+ if (!entity)
1189
+ return '';
1190
+ if (this.propertyFn)
1191
+ return this.propertyFn(entity) ?? '';
1192
+ const value = this.getDeep(entity, this.property);
1193
+ if (value != null && this.propertyEnum) {
1194
+ return this.propertyEnum[value] ?? `${value}`;
1195
+ }
1196
+ return value ?? '';
1197
+ }
1198
+ getPropertyValue(entity) {
1199
+ return this.displayOf(entity);
1200
+ }
1201
+ getDeep(obj, path) {
1202
+ return path.split('.').reduce((acc, key) => (acc == null ? acc : acc[key]), obj);
1203
+ }
1204
+ resolveId(obj) {
1205
+ return obj && typeof obj === 'object' ? obj[this.idProp] : obj;
1206
+ }
1207
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectEntityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1208
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SelectEntityComponent, isStandalone: true, selector: "ptech-select-entity", inputs: { appearance: "appearance", label: "label", placeholder: "placeholder", disabled: "disabled", multiple: "multiple", required: "required", property: "property", propertyEnum: "propertyEnum", propertyFn: "propertyFn", idProp: "idProp", searchPlaceholder: "searchPlaceholder", multipleTriggerMax: "multipleTriggerMax", entities: "entities", loading: "loading" }, outputs: { selectionChange: "selectionChange", loadingChange: "loadingChange" }, providers: [{
1209
+ provide: NG_VALUE_ACCESSOR,
1210
+ useExisting: forwardRef(() => SelectEntityComponent),
1211
+ multi: true,
1212
+ }], usesOnChanges: true, ngImport: i0, template: `
1213
+ <div class="select-entity-container">
1214
+ <mat-form-field class="select-entity-field"
1215
+ [appearance]="appearance">
1216
+ <mat-label>
1217
+ {{ label }}
1218
+ <span *ngIf="required">*</span>
1219
+ </mat-label>
1220
+
1221
+ <mat-select
1222
+ [multiple]="multiple"
1223
+ [compareWith]="compareFn"
1224
+ [placeholder]="placeholder"
1225
+ [required]="required"
1226
+ [disabled]="disabled || loading || entities.length === 0"
1227
+ [ngModel]="model"
1228
+ (ngModelChange)="setValue($event)"
1229
+ >
1230
+
1231
+ <!-- Valor exibido no trigger -->
1232
+ <mat-select-trigger *ngIf="multiple">
1233
+ <ng-container *ngIf="isArray(model) && model.length; else noneSel">
1234
+ {{ displayMultipleTrigger(model) }}
1235
+ </ng-container>
1236
+ <ng-template #noneSel>{{ placeholder || 'Selecione' }}</ng-template>
1237
+ </mat-select-trigger>
1238
+
1239
+ <!-- Campo de busca no painel -->
1240
+ <div class="search-container">
1241
+ <mat-icon>search</mat-icon>
1242
+ <input
1243
+ matInput
1244
+ [placeholder]="searchPlaceholder"
1245
+ type="text"
1246
+ autocomplete="off"
1247
+ (keyup)="onSearch($any($event.target).value)"
1248
+ (focus)="onSearch($any($event.target).value)"
1249
+ />
1250
+ </div>
1251
+
1252
+ <!-- Opção nula quando permitido (apenas single) -->
1253
+ <mat-option
1254
+ *ngIf="!required && !multiple && !searchText"
1255
+ [value]="null"
1256
+ >
1257
+ Selecione
1258
+ </mat-option>
1259
+
1260
+ <!-- Opções filtradas -->
1261
+ <mat-option
1262
+ *ngFor="let entity of filteredEntities; trackBy: trackById"
1263
+ [value]="entity"
1264
+ >
1265
+ {{ getPropertyValue(entity) }}
1266
+ </mat-option>
1267
+
1268
+ <!-- Sem resultados -->
1269
+ <mat-option *ngIf="!filteredEntities.length" disabled>
1270
+ Nenhum resultado
1271
+ </mat-option>
1272
+ </mat-select>
1273
+
1274
+ <mat-spinner
1275
+ matPrefix
1276
+ *ngIf="loading"
1277
+ mode="indeterminate"
1278
+ diameter="17"
1279
+ ></mat-spinner>
1280
+ </mat-form-field>
1281
+ </div>
1282
+ `, isInline: true, styles: [".select-entity-container{display:flex;flex-direction:column}.select-entity-field{width:100%}::ng-deep .mat-mdc-select-value{padding-left:10px!important}.search-container{display:flex;align-items:center;padding:8px 12px 0;gap:8px}.search-container input[matInput]{width:100%}mat-label span{color:#f44336!important}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i5$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1283
+ }
1284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectEntityComponent, decorators: [{
1285
+ type: Component,
1286
+ args: [{ selector: 'ptech-select-entity', standalone: true, imports: [CoreMaterialModule], template: `
1287
+ <div class="select-entity-container">
1288
+ <mat-form-field class="select-entity-field"
1289
+ [appearance]="appearance">
1290
+ <mat-label>
1291
+ {{ label }}
1292
+ <span *ngIf="required">*</span>
1293
+ </mat-label>
1294
+
1295
+ <mat-select
1296
+ [multiple]="multiple"
1297
+ [compareWith]="compareFn"
1298
+ [placeholder]="placeholder"
1299
+ [required]="required"
1300
+ [disabled]="disabled || loading || entities.length === 0"
1301
+ [ngModel]="model"
1302
+ (ngModelChange)="setValue($event)"
1303
+ >
1304
+
1305
+ <!-- Valor exibido no trigger -->
1306
+ <mat-select-trigger *ngIf="multiple">
1307
+ <ng-container *ngIf="isArray(model) && model.length; else noneSel">
1308
+ {{ displayMultipleTrigger(model) }}
1309
+ </ng-container>
1310
+ <ng-template #noneSel>{{ placeholder || 'Selecione' }}</ng-template>
1311
+ </mat-select-trigger>
1312
+
1313
+ <!-- Campo de busca no painel -->
1314
+ <div class="search-container">
1315
+ <mat-icon>search</mat-icon>
1316
+ <input
1317
+ matInput
1318
+ [placeholder]="searchPlaceholder"
1319
+ type="text"
1320
+ autocomplete="off"
1321
+ (keyup)="onSearch($any($event.target).value)"
1322
+ (focus)="onSearch($any($event.target).value)"
1323
+ />
1324
+ </div>
1325
+
1326
+ <!-- Opção nula quando permitido (apenas single) -->
1327
+ <mat-option
1328
+ *ngIf="!required && !multiple && !searchText"
1329
+ [value]="null"
1330
+ >
1331
+ Selecione
1332
+ </mat-option>
1333
+
1334
+ <!-- Opções filtradas -->
1335
+ <mat-option
1336
+ *ngFor="let entity of filteredEntities; trackBy: trackById"
1337
+ [value]="entity"
1338
+ >
1339
+ {{ getPropertyValue(entity) }}
1340
+ </mat-option>
1341
+
1342
+ <!-- Sem resultados -->
1343
+ <mat-option *ngIf="!filteredEntities.length" disabled>
1344
+ Nenhum resultado
1345
+ </mat-option>
1346
+ </mat-select>
1347
+
1348
+ <mat-spinner
1349
+ matPrefix
1350
+ *ngIf="loading"
1351
+ mode="indeterminate"
1352
+ diameter="17"
1353
+ ></mat-spinner>
1354
+ </mat-form-field>
1355
+ </div>
1356
+ `, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{
1357
+ provide: NG_VALUE_ACCESSOR,
1358
+ useExisting: forwardRef(() => SelectEntityComponent),
1359
+ multi: true,
1360
+ }], styles: [".select-entity-container{display:flex;flex-direction:column}.select-entity-field{width:100%}::ng-deep .mat-mdc-select-value{padding-left:10px!important}.search-container{display:flex;align-items:center;padding:8px 12px 0;gap:8px}.search-container input[matInput]{width:100%}mat-label span{color:#f44336!important}\n"] }]
1361
+ }], propDecorators: { appearance: [{
1362
+ type: Input
1363
+ }], label: [{
1364
+ type: Input
1365
+ }], placeholder: [{
1366
+ type: Input
1367
+ }], disabled: [{
1368
+ type: Input
1369
+ }], multiple: [{
1370
+ type: Input
1371
+ }], required: [{
1372
+ type: Input
1373
+ }], property: [{
1374
+ type: Input
1375
+ }], propertyEnum: [{
1376
+ type: Input
1377
+ }], propertyFn: [{
1378
+ type: Input
1379
+ }], idProp: [{
1380
+ type: Input
1381
+ }], searchPlaceholder: [{
1382
+ type: Input
1383
+ }], multipleTriggerMax: [{
1384
+ type: Input
1385
+ }], entities: [{
1386
+ type: Input
1387
+ }], loading: [{
1388
+ type: Input
1389
+ }], selectionChange: [{
1390
+ type: Output
1391
+ }], loadingChange: [{
1392
+ type: Output
1393
+ }] } });
1394
+
1395
+ class BreadcrumbComponent {
1396
+ routes = [];
1397
+ isLast(route) {
1398
+ return this.routes.indexOf(route) === this.routes.length - 1;
1399
+ }
1400
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1401
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: BreadcrumbComponent, isStandalone: true, selector: "ptech-breadcrumb", inputs: { routes: "routes" }, ngImport: i0, template: `
1402
+ <nav class="breadcrumb" aria-label="Breadcrumb">
1403
+ <div class="box">
1404
+ <ul class="breadcrumbs-list">
1405
+ <li class="breadcrumb-item">
1406
+ <div class="start-icon">
1407
+ <ng-content select="[start-icon]" ></ng-content>
1408
+ </div>
1409
+ </li>
1410
+
1411
+ <li *ngFor="let route of routes" class="breadcrumb-item">
1412
+ <a *ngIf="route.route" [routerLink]="route.route" class="page-location">
1413
+ {{ route.description }}
1414
+ </a>
1415
+ <span *ngIf="!route.route">{{ route.description }}</span>
1416
+ <span *ngIf="!isLast(route)" class="separator">/</span>
1417
+ </li>
1418
+ </ul>
1419
+ </div>
1420
+ </nav>
1421
+ `, isInline: true, styles: [".breadcrumb{display:flex;padding:10px 20px;background-color:#323a46}.box{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%}.breadcrumbs-list{display:flex;gap:10px;list-style:none;margin:0;padding:0;align-items:center}.breadcrumb-item{font-family:ProximaNova-Regular,Roboto,Nunito,Helvetica Neue,sans-serif;font-size:13px;color:#c3c3c3;gap:4px;font-weight:400;display:flex;align-items:center}.breadcrumb-item a{color:#c3c3c3;text-decoration:none;padding-right:4px}.breadcrumb-item a:hover{color:#b1b1b1;text-decoration:underline}.breadcrumb-item .start-icon{padding-top:4px!important}.separator{margin:0 4px;color:#b1b1b1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CoreMaterialModule }] });
1422
+ }
1423
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbComponent, decorators: [{
1424
+ type: Component,
1425
+ args: [{ selector: 'ptech-breadcrumb', standalone: true, imports: [CommonModule, RouterModule, CoreMaterialModule], template: `
1426
+ <nav class="breadcrumb" aria-label="Breadcrumb">
1427
+ <div class="box">
1428
+ <ul class="breadcrumbs-list">
1429
+ <li class="breadcrumb-item">
1430
+ <div class="start-icon">
1431
+ <ng-content select="[start-icon]" ></ng-content>
1432
+ </div>
1433
+ </li>
1434
+
1435
+ <li *ngFor="let route of routes" class="breadcrumb-item">
1436
+ <a *ngIf="route.route" [routerLink]="route.route" class="page-location">
1437
+ {{ route.description }}
1438
+ </a>
1439
+ <span *ngIf="!route.route">{{ route.description }}</span>
1440
+ <span *ngIf="!isLast(route)" class="separator">/</span>
1441
+ </li>
1442
+ </ul>
1443
+ </div>
1444
+ </nav>
1445
+ `, styles: [".breadcrumb{display:flex;padding:10px 20px;background-color:#323a46}.box{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%}.breadcrumbs-list{display:flex;gap:10px;list-style:none;margin:0;padding:0;align-items:center}.breadcrumb-item{font-family:ProximaNova-Regular,Roboto,Nunito,Helvetica Neue,sans-serif;font-size:13px;color:#c3c3c3;gap:4px;font-weight:400;display:flex;align-items:center}.breadcrumb-item a{color:#c3c3c3;text-decoration:none;padding-right:4px}.breadcrumb-item a:hover{color:#b1b1b1;text-decoration:underline}.breadcrumb-item .start-icon{padding-top:4px!important}.separator{margin:0 4px;color:#b1b1b1}\n"] }]
1446
+ }], propDecorators: { routes: [{
1447
+ type: Input
1448
+ }] } });
1449
+
1450
+ class HeaderComponent {
1451
+ data = { title: 'Aplicação' };
1452
+ toggleNav = new EventEmitter();
1453
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1454
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: HeaderComponent, isStandalone: true, selector: "ptech-header", inputs: { data: "data" }, outputs: { toggleNav: "toggleNav" }, ngImport: i0, template: `
1455
+ <mat-toolbar class="header mat-elevation-z4">
1456
+ <button (click)="toggleNav.emit()" mat-icon-button aria-label="menu">
1457
+ <mat-icon aria-hidden="true" style="color: #fff">menu</mat-icon>
1458
+ </button>
1459
+
1460
+ <!-- se imageHeader estiver definido, mostra a imagem CENTRALIZADA -->
1461
+ <ng-container *ngIf="data.imageHeader; else textBlock">
1462
+ <span class="spacer"></span>
1463
+ <img class="header-logo" [src]="data.imageHeader" alt="logo" />
1464
+ <span class="spacer"></span>
1465
+ </ng-container>
1466
+
1467
+ <!-- caso contrário, título + ícone -->
1468
+ <ng-template #textBlock>
1469
+ <span class="logo-title">
1470
+ <a *ngIf="data.routeUrl" [routerLink]="data.routeUrl" class="title-link">
1471
+ <mat-icon *ngIf="data.icon">{{ data.icon }}</mat-icon>
1472
+ {{ data.title }}
1473
+ </a>
1474
+ <ng-container *ngIf="!data.routeUrl">
1475
+ <mat-icon *ngIf="data.icon">{{ data.icon }}</mat-icon>
1476
+ {{ data.title }}
1477
+ </ng-container>
1478
+ </span>
1479
+ <span class="spacer"></span>
1480
+ </ng-template>
1481
+
1482
+ <ng-content select="[user-profile]"></ng-content>
1483
+ </mat-toolbar>
1484
+ `, isInline: true, styles: [".header{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(315deg,#003373,#348e9f);animation:gradient 10s ease infinite}.spacer{flex:1}.header-logo{height:35px;object-fit:contain}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
1485
+ }
1486
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderComponent, decorators: [{
1487
+ type: Component,
1488
+ args: [{ selector: 'ptech-header', standalone: true, imports: [CommonModule, RouterModule, CoreMaterialModule], template: `
1489
+ <mat-toolbar class="header mat-elevation-z4">
1490
+ <button (click)="toggleNav.emit()" mat-icon-button aria-label="menu">
1491
+ <mat-icon aria-hidden="true" style="color: #fff">menu</mat-icon>
1492
+ </button>
1493
+
1494
+ <!-- se imageHeader estiver definido, mostra a imagem CENTRALIZADA -->
1495
+ <ng-container *ngIf="data.imageHeader; else textBlock">
1496
+ <span class="spacer"></span>
1497
+ <img class="header-logo" [src]="data.imageHeader" alt="logo" />
1498
+ <span class="spacer"></span>
1499
+ </ng-container>
1500
+
1501
+ <!-- caso contrário, título + ícone -->
1502
+ <ng-template #textBlock>
1503
+ <span class="logo-title">
1504
+ <a *ngIf="data.routeUrl" [routerLink]="data.routeUrl" class="title-link">
1505
+ <mat-icon *ngIf="data.icon">{{ data.icon }}</mat-icon>
1506
+ {{ data.title }}
1507
+ </a>
1508
+ <ng-container *ngIf="!data.routeUrl">
1509
+ <mat-icon *ngIf="data.icon">{{ data.icon }}</mat-icon>
1510
+ {{ data.title }}
1511
+ </ng-container>
1512
+ </span>
1513
+ <span class="spacer"></span>
1514
+ </ng-template>
1515
+
1516
+ <ng-content select="[user-profile]"></ng-content>
1517
+ </mat-toolbar>
1518
+ `, styles: [".header{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(315deg,#003373,#348e9f);animation:gradient 10s ease infinite}.spacer{flex:1}.header-logo{height:35px;object-fit:contain}\n"] }]
1519
+ }], propDecorators: { data: [{
1520
+ type: Input
1521
+ }], toggleNav: [{
1522
+ type: Output
1523
+ }] } });
1524
+
1525
+ // nav.service.ts
1526
+ class NavService {
1527
+ navVisible = new BehaviorSubject(true);
1528
+ get navState$() {
1529
+ return this.navVisible.asObservable();
1530
+ }
1531
+ get isNavOpen() {
1532
+ return this.navVisible.value;
1533
+ }
1534
+ toggleNav() {
1535
+ this.navVisible.next(!this.navVisible.value);
1536
+ }
1537
+ open() {
1538
+ this.navVisible.next(true);
1539
+ }
1540
+ close() {
1541
+ this.navVisible.next(false);
1542
+ }
1543
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1544
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, providedIn: 'root' });
1545
+ }
1546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavService, decorators: [{
1547
+ type: Injectable,
1548
+ args: [{
1549
+ providedIn: 'root'
1550
+ }]
1551
+ }] });
1552
+
1553
+ // ptech-nav.component.ts
1554
+ class NavComponent {
1555
+ navService;
1556
+ links = [];
1557
+ currentModuleName = 'Menu';
1558
+ fixedTopGap = 134;
1559
+ fixedBottomGap = 70;
1560
+ footerItems = [];
1561
+ navigate = new EventEmitter();
1562
+ logout = new EventEmitter();
1563
+ stack = [];
1564
+ constructor(navService) {
1565
+ this.navService = navService;
1566
+ }
1567
+ get currentLevel() {
1568
+ return this.stack.length ? this.stack[this.stack.length - 1].children || [] : this.links;
1569
+ }
1570
+ get currentTitle() {
1571
+ if (this.stack.length) {
1572
+ return this.stack[this.stack.length - 1].name;
1573
+ }
1574
+ return this.currentModuleName || 'Menu';
1575
+ }
1576
+ clickItem(item, ev) {
1577
+ if (item.children) {
1578
+ ev.preventDefault();
1579
+ this.stack.push(item);
1580
+ }
1581
+ else {
1582
+ this.navigate.emit(item);
1583
+ // opcional: fechar nav
1584
+ this.navService.toggleNav();
1585
+ }
1586
+ }
1587
+ onHeaderClick() {
1588
+ if (this.stack.length) {
1589
+ this.stack.pop();
1590
+ }
1591
+ }
1592
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavComponent, deps: [{ token: NavService }], target: i0.ɵɵFactoryTarget.Component });
1593
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NavComponent, isStandalone: true, selector: "ptech-nav", inputs: { links: "links", currentModuleName: "currentModuleName", fixedTopGap: "fixedTopGap", fixedBottomGap: "fixedBottomGap", footerItems: "footerItems" }, outputs: { navigate: "navigate", logout: "logout" }, ngImport: i0, template: `
1594
+ <mat-sidenav-container class="sidenav-container">
1595
+ <mat-sidenav
1596
+ class="sidenav"
1597
+ mode="side"
1598
+ [opened]="(navService.navState$ | async)!!"
1599
+ fixedInViewport
1600
+ [fixedTopGap]="fixedTopGap"
1601
+ [fixedBottomGap]="fixedBottomGap"
1602
+ >
1603
+ <div class="nav-content">
1604
+ <mat-nav-list class="nav-list">
1605
+ <mat-list-item class="list-item-header" (click)="onHeaderClick()">
1606
+ <mat-icon matListIcon>{{ stack.length ? 'chevron_left' : 'widgets' }}</mat-icon>
1607
+ <span matLine>{{ currentTitle }}</span>
1608
+ </mat-list-item>
1609
+ <mat-divider></mat-divider>
1610
+
1611
+ <ng-container *ngFor="let link of currentLevel">
1612
+ <mat-list-item
1613
+ class="list-item-level1"
1614
+ [routerLink]="link.path"
1615
+ (click)="clickItem(link, $event)"
1616
+ >
1617
+ <mat-icon matListIcon>{{ link.icon }}</mat-icon>
1618
+ <span matLine>{{ link.name }}</span>
1619
+ <mat-icon *ngIf="link.children" class="arrow-right-icon">
1620
+ chevron_right
1621
+ </mat-icon>
1622
+ </mat-list-item>
1623
+ </ng-container>
1624
+
1625
+ <mat-list-item class="list-item-level1" (click)="logout.emit()">
1626
+ <mat-icon matListIcon>exit_to_app</mat-icon>
1627
+ <span matLine> Sair </span>
1628
+ </mat-list-item>
1629
+ </mat-nav-list>
1630
+
1631
+ <div class="nav-footer" *ngIf="footerItems?.length">
1632
+ <div class="footer-item" *ngFor="let f of footerItems">
1633
+ <mat-icon class="footer-icon">{{ f.icon }}</mat-icon>
1634
+ <span class="footer-text">{{ f.text }}</span>
1635
+ </div>
1636
+ </div>
1637
+ </div>
1638
+ </mat-sidenav>
1639
+ </mat-sidenav-container>
1640
+ `, isInline: true, styles: [".mat-icon{margin-bottom:-2px!important;height:22px!important;width:22px!important}mat-sidenav.sidenav{display:flex;flex-direction:column;width:220px;background-color:#3d454e;border-top-right-radius:12px;border-bottom-right-radius:12px;box-shadow:0 4px 6px #0000004d;padding:0;overflow:hidden}.nav-content{display:flex;flex-direction:column;height:100%;overflow:hidden}.nav-list{flex:1 1 auto!important;overflow-y:auto!important;padding:0!important;margin:0!important}:host ::ng-deep .mat-list-item,:host ::ng-deep .mat-mdc-list-item{display:flex!important;align-items:center!important;border-radius:unset!important}:host ::ng-deep .mat-list-item mat-icon[matListIcon],:host ::ng-deep .mdc-list-item__graphic{margin:0!important;padding:0!important;vertical-align:middle!important;line-height:1!important}:host ::ng-deep .mat-list-item .mat-line,:host ::ng-deep .mdc-list-item__primary-text{color:#fff!important;letter-spacing:unset!important}.list-item-header{display:flex;align-items:center;height:66px!important;padding:0 16px;background-color:#35404a!important;color:#cfd8dc!important;font-size:1.1rem;font-weight:600;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-header mat-icon[matListIcon]{color:#90a4ae;font-size:25px;margin-right:12px}.list-item-header:hover{background-color:#ffffff1a}.list-item-level1{display:flex;align-items:center;justify-content:space-between;height:48px;color:#cfd8dc!important;font-size:1rem;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-level1 mat-icon[matListIcon]{color:#90a4ae;font-size:22px;margin-right:12px}.list-item-level1 span[matLine]{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0!important}.arrow-right-icon{color:#90a4ae;font-size:25px;margin-left:46px}.list-item-level1:hover{background-color:#ffffff14}.list-item-level2{display:flex;align-items:center;height:44px;padding:0 24px;color:#cfd8dc;font-size:.95rem;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-level2 mat-icon[matListIcon]{color:#90a4ae;font-size:22px;margin-right:12px}.list-item-level2:hover{background-color:#ffffff0f}.mat-divider{margin-top:0!important;margin-bottom:0!important}.nav-footer{display:flex;flex-direction:column;flex-shrink:0;margin-top:auto;padding:12px 16px;background-color:#35404a}.footer-item{display:flex;align-items:center;margin-bottom:6px}.footer-icon{color:#90a4ae;font-size:18px;margin-right:8px}.footer-text{color:#cfd8dc;font-size:.85rem}.footer-item:last-child{margin-bottom:0!important}:host ::ng-deep mat-sidenav.sidenav .nav-list{flex:1 1 auto!important}:host ::ng-deep mat-sidenav.sidenav .nav-footer{margin-top:auto!important;flex-shrink:0!important}@media screen and (max-width: 599px){mat-sidenav.sidenav{width:180px}.list-item-header{height:50px;font-size:1rem;padding:0 12px}.list-item-header mat-icon[matListIcon]{font-size:18px;margin-right:8px}.list-item-level1{height:44px;font-size:.9rem;padding:0 12px}.list-item-level1 mat-icon[matListIcon]{font-size:18px;margin-right:10px}.arrow-right-icon{font-size:18px}.list-item-level2{height:40px;font-size:.85rem;padding:0 20px}.list-item-level2 mat-icon[matListIcon]{font-size:16px;margin-right:10px}.footer-item{margin-bottom:4px}.footer-icon{font-size:16px;margin-right:6px}.footer-text{font-size:.8rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i4.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i4.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i5$2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i5$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: i6$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1641
+ }
1642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavComponent, decorators: [{
1643
+ type: Component,
1644
+ args: [{ selector: 'ptech-nav', standalone: true, imports: [
1645
+ CommonModule,
1646
+ RouterModule,
1647
+ CoreMaterialModule
1648
+ ], template: `
1649
+ <mat-sidenav-container class="sidenav-container">
1650
+ <mat-sidenav
1651
+ class="sidenav"
1652
+ mode="side"
1653
+ [opened]="(navService.navState$ | async)!!"
1654
+ fixedInViewport
1655
+ [fixedTopGap]="fixedTopGap"
1656
+ [fixedBottomGap]="fixedBottomGap"
1657
+ >
1658
+ <div class="nav-content">
1659
+ <mat-nav-list class="nav-list">
1660
+ <mat-list-item class="list-item-header" (click)="onHeaderClick()">
1661
+ <mat-icon matListIcon>{{ stack.length ? 'chevron_left' : 'widgets' }}</mat-icon>
1662
+ <span matLine>{{ currentTitle }}</span>
1663
+ </mat-list-item>
1664
+ <mat-divider></mat-divider>
1665
+
1666
+ <ng-container *ngFor="let link of currentLevel">
1667
+ <mat-list-item
1668
+ class="list-item-level1"
1669
+ [routerLink]="link.path"
1670
+ (click)="clickItem(link, $event)"
1671
+ >
1672
+ <mat-icon matListIcon>{{ link.icon }}</mat-icon>
1673
+ <span matLine>{{ link.name }}</span>
1674
+ <mat-icon *ngIf="link.children" class="arrow-right-icon">
1675
+ chevron_right
1676
+ </mat-icon>
1677
+ </mat-list-item>
1678
+ </ng-container>
1679
+
1680
+ <mat-list-item class="list-item-level1" (click)="logout.emit()">
1681
+ <mat-icon matListIcon>exit_to_app</mat-icon>
1682
+ <span matLine> Sair </span>
1683
+ </mat-list-item>
1684
+ </mat-nav-list>
1685
+
1686
+ <div class="nav-footer" *ngIf="footerItems?.length">
1687
+ <div class="footer-item" *ngFor="let f of footerItems">
1688
+ <mat-icon class="footer-icon">{{ f.icon }}</mat-icon>
1689
+ <span class="footer-text">{{ f.text }}</span>
1690
+ </div>
1691
+ </div>
1692
+ </div>
1693
+ </mat-sidenav>
1694
+ </mat-sidenav-container>
1695
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".mat-icon{margin-bottom:-2px!important;height:22px!important;width:22px!important}mat-sidenav.sidenav{display:flex;flex-direction:column;width:220px;background-color:#3d454e;border-top-right-radius:12px;border-bottom-right-radius:12px;box-shadow:0 4px 6px #0000004d;padding:0;overflow:hidden}.nav-content{display:flex;flex-direction:column;height:100%;overflow:hidden}.nav-list{flex:1 1 auto!important;overflow-y:auto!important;padding:0!important;margin:0!important}:host ::ng-deep .mat-list-item,:host ::ng-deep .mat-mdc-list-item{display:flex!important;align-items:center!important;border-radius:unset!important}:host ::ng-deep .mat-list-item mat-icon[matListIcon],:host ::ng-deep .mdc-list-item__graphic{margin:0!important;padding:0!important;vertical-align:middle!important;line-height:1!important}:host ::ng-deep .mat-list-item .mat-line,:host ::ng-deep .mdc-list-item__primary-text{color:#fff!important;letter-spacing:unset!important}.list-item-header{display:flex;align-items:center;height:66px!important;padding:0 16px;background-color:#35404a!important;color:#cfd8dc!important;font-size:1.1rem;font-weight:600;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-header mat-icon[matListIcon]{color:#90a4ae;font-size:25px;margin-right:12px}.list-item-header:hover{background-color:#ffffff1a}.list-item-level1{display:flex;align-items:center;justify-content:space-between;height:48px;color:#cfd8dc!important;font-size:1rem;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-level1 mat-icon[matListIcon]{color:#90a4ae;font-size:22px;margin-right:12px}.list-item-level1 span[matLine]{flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0!important}.arrow-right-icon{color:#90a4ae;font-size:25px;margin-left:46px}.list-item-level1:hover{background-color:#ffffff14}.list-item-level2{display:flex;align-items:center;height:44px;padding:0 24px;color:#cfd8dc;font-size:.95rem;text-decoration:none;cursor:pointer;border-bottom:1px solid #c9cbcf}.list-item-level2 mat-icon[matListIcon]{color:#90a4ae;font-size:22px;margin-right:12px}.list-item-level2:hover{background-color:#ffffff0f}.mat-divider{margin-top:0!important;margin-bottom:0!important}.nav-footer{display:flex;flex-direction:column;flex-shrink:0;margin-top:auto;padding:12px 16px;background-color:#35404a}.footer-item{display:flex;align-items:center;margin-bottom:6px}.footer-icon{color:#90a4ae;font-size:18px;margin-right:8px}.footer-text{color:#cfd8dc;font-size:.85rem}.footer-item:last-child{margin-bottom:0!important}:host ::ng-deep mat-sidenav.sidenav .nav-list{flex:1 1 auto!important}:host ::ng-deep mat-sidenav.sidenav .nav-footer{margin-top:auto!important;flex-shrink:0!important}@media screen and (max-width: 599px){mat-sidenav.sidenav{width:180px}.list-item-header{height:50px;font-size:1rem;padding:0 12px}.list-item-header mat-icon[matListIcon]{font-size:18px;margin-right:8px}.list-item-level1{height:44px;font-size:.9rem;padding:0 12px}.list-item-level1 mat-icon[matListIcon]{font-size:18px;margin-right:10px}.arrow-right-icon{font-size:18px}.list-item-level2{height:40px;font-size:.85rem;padding:0 20px}.list-item-level2 mat-icon[matListIcon]{font-size:16px;margin-right:10px}.footer-item{margin-bottom:4px}.footer-icon{font-size:16px;margin-right:6px}.footer-text{font-size:.8rem}}\n"] }]
1696
+ }], ctorParameters: () => [{ type: NavService }], propDecorators: { links: [{
1697
+ type: Input
1698
+ }], currentModuleName: [{
1699
+ type: Input
1700
+ }], fixedTopGap: [{
1701
+ type: Input
1702
+ }], fixedBottomGap: [{
1703
+ type: Input
1704
+ }], footerItems: [{
1705
+ type: Input
1706
+ }], navigate: [{
1707
+ type: Output
1708
+ }], logout: [{
1709
+ type: Output
1710
+ }] } });
1711
+
1712
+ class FooterComponent {
1713
+ version = '';
1714
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1715
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FooterComponent, isStandalone: true, selector: "ptech-footer", inputs: { version: "version" }, ngImport: i0, template: `
1716
+ <mat-toolbar class="footer">
1717
+ <span>
1718
+ Version: <strong>{{ version }}</strong>
1719
+ </span>
1720
+ </mat-toolbar>
1721
+ `, isInline: true, styles: [".footer{position:relative;bottom:0;display:flex;justify-content:flex-end;background:linear-gradient(315deg,#3d454e,#5a6573);animation:ftgradient 10s ease infinite;color:#fff}.footer>span{font-size:1.1rem;font-weight:300}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i3$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }] });
1722
+ }
1723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FooterComponent, decorators: [{
1724
+ type: Component,
1725
+ args: [{ selector: 'ptech-footer', standalone: true, imports: [CommonModule, CoreMaterialModule], template: `
1726
+ <mat-toolbar class="footer">
1727
+ <span>
1728
+ Version: <strong>{{ version }}</strong>
1729
+ </span>
1730
+ </mat-toolbar>
1731
+ `, styles: [".footer{position:relative;bottom:0;display:flex;justify-content:flex-end;background:linear-gradient(315deg,#3d454e,#5a6573);animation:ftgradient 10s ease infinite;color:#fff}.footer>span{font-size:1.1rem;font-weight:300}\n"] }]
1732
+ }], propDecorators: { version: [{
1733
+ type: Input
1734
+ }] } });
1735
+
1736
+ class LoadingService {
1737
+ _isLoading = new BehaviorSubject(false);
1738
+ // isLoading$ = this._isLoading.asObservable();
1739
+ isLoading$ = this._isLoading.asObservable().pipe(delay(0));
1740
+ // Método para ativar o overlay
1741
+ showLoading() {
1742
+ this._isLoading.next(true);
1743
+ // console.log('Loading ativado');
1744
+ }
1745
+ // Método para desativar o overlay
1746
+ hideLoading() {
1747
+ this._isLoading.next(false);
1748
+ // console.log('Loading desativado');
1749
+ }
1750
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1751
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingService, providedIn: 'root' });
1752
+ }
1753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingService, decorators: [{
1754
+ type: Injectable,
1755
+ args: [{
1756
+ providedIn: 'root',
1757
+ }]
1758
+ }] });
1759
+
1760
+ class LoadingOverlayComponent {
1761
+ loadingService;
1762
+ isLoading;
1763
+ constructor(loadingService) {
1764
+ this.loadingService = loadingService;
1765
+ this.isLoading = this.loadingService.isLoading$;
1766
+ }
1767
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingOverlayComponent, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Component });
1768
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LoadingOverlayComponent, isStandalone: true, selector: "ptech-loading-overlay", ngImport: i0, template: `
1769
+ <div *ngIf="isLoading | async" class="overlay">
1770
+ <div class="spinner"></div>
1771
+ </div>
1772
+ `, isInline: true, styles: [".overlay{display:none}.overlay{display:flex;position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000080;align-items:center;justify-content:center;z-index:9999;pointer-events:all}.spinner{width:50px;height:50px;border:6px solid #ccc;border-top-color:#333;border-radius:50%;animation:spin .6s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
1773
+ }
1774
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingOverlayComponent, decorators: [{
1775
+ type: Component,
1776
+ args: [{ selector: 'ptech-loading-overlay', standalone: true, imports: [CommonModule], template: `
1777
+ <div *ngIf="isLoading | async" class="overlay">
1778
+ <div class="spinner"></div>
1779
+ </div>
1780
+ `, styles: [".overlay{display:none}.overlay{display:flex;position:fixed;top:0;left:0;width:100vw;height:100vh;background:#00000080;align-items:center;justify-content:center;z-index:9999;pointer-events:all}.spinner{width:50px;height:50px;border:6px solid #ccc;border-top-color:#333;border-radius:50%;animation:spin .6s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
1781
+ }], ctorParameters: () => [{ type: LoadingService }] });
1782
+
1783
+ class ProgressBarComponent {
1784
+ progressStart = 0;
1785
+ progressEnd = 100;
1786
+ progressPercentage = 0;
1787
+ ngOnChanges(changes) {
1788
+ this.calculateProgress();
1789
+ }
1790
+ calculateProgress() {
1791
+ if (this.progressEnd <= 0 || isNaN(this.progressStart) || isNaN(this.progressEnd)) {
1792
+ this.progressPercentage = 0;
1793
+ }
1794
+ else {
1795
+ this.progressPercentage = Math.min(parseFloat(((this.progressStart / this.progressEnd) * 100).toFixed(2)), 100);
1796
+ }
1797
+ }
1798
+ get dynamicColorPrimary() {
1799
+ if (this.progressPercentage >= 80)
1800
+ return 'primary';
1801
+ if (this.progressPercentage >= 50)
1802
+ return 'accent';
1803
+ return 'warn';
1804
+ }
1805
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1806
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProgressBarComponent, isStandalone: true, selector: "ptech-progress-bar", inputs: { progressStart: "progressStart", progressEnd: "progressEnd" }, usesOnChanges: true, ngImport: i0, template: `
1807
+ <p class="progress-bar-container">
1808
+ <span class="progress-values">{{ progressPercentage }} %</span>
1809
+ <mat-progress-bar
1810
+ class="custom-progress-bar"
1811
+ mode="determinate"
1812
+ [value]="progressPercentage"
1813
+ [color]="dynamicColorPrimary"
1814
+ ></mat-progress-bar>
1815
+ </p>
1816
+ `, isInline: true, styles: [".progress-values{position:absolute;width:100%;text-align:center;bottom:0;transform:translateY(-50%);z-index:1;font-size:1.2rem}.progress-bar-container{position:relative}.custom-progress-bar{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
1817
+ }
1818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProgressBarComponent, decorators: [{
1819
+ type: Component,
1820
+ args: [{ selector: 'ptech-progress-bar', standalone: true, imports: [CommonModule, MatProgressBarModule], template: `
1821
+ <p class="progress-bar-container">
1822
+ <span class="progress-values">{{ progressPercentage }} %</span>
1823
+ <mat-progress-bar
1824
+ class="custom-progress-bar"
1825
+ mode="determinate"
1826
+ [value]="progressPercentage"
1827
+ [color]="dynamicColorPrimary"
1828
+ ></mat-progress-bar>
1829
+ </p>
1830
+ `, styles: [".progress-values{position:absolute;width:100%;text-align:center;bottom:0;transform:translateY(-50%);z-index:1;font-size:1.2rem}.progress-bar-container{position:relative}.custom-progress-bar{width:100%}\n"] }]
1831
+ }], propDecorators: { progressStart: [{
1832
+ type: Input
1833
+ }], progressEnd: [{
1834
+ type: Input
1835
+ }] } });
1836
+
1837
+ class ProgressBarMultipleComponent {
1838
+ progressStartPrimary = 0;
1839
+ progressEndPrimary = 100;
1840
+ labelPrimary = '';
1841
+ progressStartSecondary;
1842
+ progressEndSecondary;
1843
+ labelSecondary;
1844
+ progressPercentagePrimary = 0;
1845
+ progressPercentageSecondary;
1846
+ ngOnChanges(changes) {
1847
+ this.calculateProgress();
1848
+ }
1849
+ calculateProgress() {
1850
+ this.progressPercentagePrimary = this.compute(this.progressStartPrimary, this.progressEndPrimary);
1851
+ if (typeof this.progressStartSecondary === 'number' &&
1852
+ typeof this.progressEndSecondary === 'number') {
1853
+ this.progressPercentageSecondary = this.compute(this.progressStartSecondary, this.progressEndSecondary);
1854
+ }
1855
+ else {
1856
+ this.progressPercentageSecondary = undefined;
1857
+ }
1858
+ }
1859
+ compute(start, end) {
1860
+ if (end <= 0 || isNaN(start) || isNaN(end))
1861
+ return 0;
1862
+ return Math.min(parseFloat(((start / end) * 100).toFixed(2)), 100);
1863
+ }
1864
+ get dynamicColorPrimary() {
1865
+ if (this.progressPercentagePrimary >= 80)
1866
+ return 'primary';
1867
+ if (this.progressPercentagePrimary >= 50)
1868
+ return 'accent';
1869
+ return 'warn';
1870
+ }
1871
+ get dynamicColorSecondary() {
1872
+ if (this.progressPercentageSecondary === undefined)
1873
+ return undefined;
1874
+ if (this.progressPercentageSecondary >= 80)
1875
+ return 'primary';
1876
+ if (this.progressPercentageSecondary >= 50)
1877
+ return 'accent';
1878
+ return 'warn';
1879
+ }
1880
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProgressBarMultipleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1881
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProgressBarMultipleComponent, isStandalone: true, selector: "ptech-progress-bar-multiple", inputs: { progressStartPrimary: "progressStartPrimary", progressEndPrimary: "progressEndPrimary", labelPrimary: "labelPrimary", progressStartSecondary: "progressStartSecondary", progressEndSecondary: "progressEndSecondary", labelSecondary: "labelSecondary" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"progress-bar-vertical\">\n <!-- Progresso prim\u00E1rio -->\n <div class=\"progress-section\">\n <div class=\"progress-overlay\" *ngIf=\"labelPrimary\">\n {{ labelPrimary }}: {{ progressPercentagePrimary }}%\n </div>\n <div class=\"progress-overlay\" *ngIf=\"!labelPrimary\">\n {{ progressPercentagePrimary }}%\n </div>\n\n <mat-progress-bar\n class=\"custom-progress-bar\"\n mode=\"determinate\"\n [value]=\"progressPercentagePrimary\"\n [color]=\"dynamicColorPrimary\"\n ></mat-progress-bar>\n </div>\n\n <!-- Progresso secund\u00E1rio -->\n <div\n *ngIf=\"progressPercentageSecondary !== undefined\"\n class=\"progress-section\"\n >\n <div class=\"progress-overlay\">\n {{ labelSecondary }}: {{ progressPercentageSecondary }}%\n </div>\n <mat-progress-bar\n class=\"custom-progress-bar\"\n mode=\"determinate\"\n [value]=\"progressPercentageSecondary\"\n [color]=\"dynamicColorSecondary\"\n ></mat-progress-bar>\n </div>\n</div>\n", styles: [".progress-bar-vertical{display:flex;flex-direction:column;gap:16px}.progress-section{position:relative;height:30px}.custom-progress-bar{height:20px;border-radius:6px}.progress-overlay{position:absolute;width:100%;height:100%;top:-18px;left:0;display:flex;align-items:center;justify-content:center;font-size:1.2rem;z-index:1;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
1882
+ }
1883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProgressBarMultipleComponent, decorators: [{
1884
+ type: Component,
1885
+ args: [{ selector: 'ptech-progress-bar-multiple', standalone: true, imports: [CommonModule, MatProgressBarModule], template: "<div class=\"progress-bar-vertical\">\n <!-- Progresso prim\u00E1rio -->\n <div class=\"progress-section\">\n <div class=\"progress-overlay\" *ngIf=\"labelPrimary\">\n {{ labelPrimary }}: {{ progressPercentagePrimary }}%\n </div>\n <div class=\"progress-overlay\" *ngIf=\"!labelPrimary\">\n {{ progressPercentagePrimary }}%\n </div>\n\n <mat-progress-bar\n class=\"custom-progress-bar\"\n mode=\"determinate\"\n [value]=\"progressPercentagePrimary\"\n [color]=\"dynamicColorPrimary\"\n ></mat-progress-bar>\n </div>\n\n <!-- Progresso secund\u00E1rio -->\n <div\n *ngIf=\"progressPercentageSecondary !== undefined\"\n class=\"progress-section\"\n >\n <div class=\"progress-overlay\">\n {{ labelSecondary }}: {{ progressPercentageSecondary }}%\n </div>\n <mat-progress-bar\n class=\"custom-progress-bar\"\n mode=\"determinate\"\n [value]=\"progressPercentageSecondary\"\n [color]=\"dynamicColorSecondary\"\n ></mat-progress-bar>\n </div>\n</div>\n", styles: [".progress-bar-vertical{display:flex;flex-direction:column;gap:16px}.progress-section{position:relative;height:30px}.custom-progress-bar{height:20px;border-radius:6px}.progress-overlay{position:absolute;width:100%;height:100%;top:-18px;left:0;display:flex;align-items:center;justify-content:center;font-size:1.2rem;z-index:1;pointer-events:none}\n"] }]
1886
+ }], propDecorators: { progressStartPrimary: [{
1887
+ type: Input
1888
+ }], progressEndPrimary: [{
1889
+ type: Input
1890
+ }], labelPrimary: [{
1891
+ type: Input
1892
+ }], progressStartSecondary: [{
1893
+ type: Input
1894
+ }], progressEndSecondary: [{
1895
+ type: Input
1896
+ }], labelSecondary: [{
1897
+ type: Input
1898
+ }] } });
1899
+
1900
+ class RadioGroupComponent {
1901
+ label = '';
1902
+ disabled = false;
1903
+ required = false;
1904
+ property = 'description';
1905
+ entities = [];
1906
+ _value;
1907
+ get value() {
1908
+ return this._value;
1909
+ }
1910
+ set value(val) {
1911
+ this._value = val;
1912
+ this.onChange(val);
1913
+ this.onTouch();
1914
+ }
1915
+ onChange = () => { };
1916
+ onTouch = () => { };
1917
+ writeValue(value) {
1918
+ this.value = value;
1919
+ }
1920
+ registerOnChange(fn) {
1921
+ this.onChange = fn;
1922
+ }
1923
+ registerOnTouched(fn) {
1924
+ this.onTouch = fn;
1925
+ }
1926
+ getPropertyValue(entity) {
1927
+ if (!entity)
1928
+ return '';
1929
+ if (typeof entity === 'string')
1930
+ return entity;
1931
+ return entity[this.property];
1932
+ }
1933
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1934
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RadioGroupComponent, isStandalone: true, selector: "ptech-radio-group", inputs: { label: "label", disabled: "disabled", required: "required", property: "property", entities: "entities", value: "value" }, providers: [
1935
+ {
1936
+ provide: NG_VALUE_ACCESSOR,
1937
+ useExisting: forwardRef(() => RadioGroupComponent),
1938
+ multi: true,
1939
+ },
1940
+ ], ngImport: i0, template: "<div class=\"radio-group-column\">\n <mat-label>{{ label }} <span *ngIf=\"required\">*</span></mat-label>\n <mat-radio-group\n [(ngModel)]=\"value\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n >\n <mat-radio-button *ngFor=\"let entity of entities\" [value]=\"entity\">\n {{ getPropertyValue(entity) }}\n </mat-radio-button>\n </mat-radio-group>\n</div>\n", styles: [".radio-group-column{display:flex;flex-direction:column}mat-label span{color:#f44336!important}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$1.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$1.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }] });
1941
+ }
1942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioGroupComponent, decorators: [{
1943
+ type: Component,
1944
+ args: [{ selector: 'ptech-radio-group', standalone: true, imports: [CoreMaterialModule], providers: [
1945
+ {
1946
+ provide: NG_VALUE_ACCESSOR,
1947
+ useExisting: forwardRef(() => RadioGroupComponent),
1948
+ multi: true,
1949
+ },
1950
+ ], template: "<div class=\"radio-group-column\">\n <mat-label>{{ label }} <span *ngIf=\"required\">*</span></mat-label>\n <mat-radio-group\n [(ngModel)]=\"value\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n >\n <mat-radio-button *ngFor=\"let entity of entities\" [value]=\"entity\">\n {{ getPropertyValue(entity) }}\n </mat-radio-button>\n </mat-radio-group>\n</div>\n", styles: [".radio-group-column{display:flex;flex-direction:column}mat-label span{color:#f44336!important}\n"] }]
1951
+ }], propDecorators: { label: [{
1952
+ type: Input
1953
+ }], disabled: [{
1954
+ type: Input
1955
+ }], required: [{
1956
+ type: Input
1957
+ }], property: [{
1958
+ type: Input
1959
+ }], entities: [{
1960
+ type: Input
1961
+ }], value: [{
1962
+ type: Input,
1963
+ args: ['value']
1964
+ }] } });
1965
+
1966
+ class RadioGroupEntityComponent {
1967
+ label = '';
1968
+ disabled = false;
1969
+ required = false;
1970
+ property = 'description';
1971
+ entities = [];
1972
+ _value;
1973
+ get value() {
1974
+ return this._value;
1975
+ }
1976
+ set value(val) {
1977
+ this._value = val;
1978
+ this.onChange(val);
1979
+ this.onTouch();
1980
+ }
1981
+ getPropertyValue(entity) {
1982
+ return entity && typeof entity === 'object' && this.property in entity
1983
+ ? entity[this.property]
1984
+ : `${entity}`;
1985
+ }
1986
+ onChange = () => { };
1987
+ onTouch = () => { };
1988
+ writeValue(value) {
1989
+ this._value = value;
1990
+ }
1991
+ registerOnChange(fn) {
1992
+ this.onChange = fn;
1993
+ }
1994
+ registerOnTouched(fn) {
1995
+ this.onTouch = fn;
1996
+ }
1997
+ setDisabledState(isDisabled) {
1998
+ this.disabled = isDisabled;
1999
+ }
2000
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioGroupEntityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2001
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RadioGroupEntityComponent, isStandalone: true, selector: "ptech-radio-group-entity", inputs: { label: "label", disabled: "disabled", required: "required", property: "property", entities: "entities" }, providers: [
2002
+ {
2003
+ provide: NG_VALUE_ACCESSOR,
2004
+ useExisting: forwardRef(() => RadioGroupEntityComponent),
2005
+ multi: true
2006
+ }
2007
+ ], ngImport: i0, template: `
2008
+ <div class="radio-group-column">
2009
+ <label class="radio-group-label">
2010
+ {{ label }} <span *ngIf="required" class="required">*</span>
2011
+ </label>
2012
+ <mat-radio-group
2013
+ [(ngModel)]="value"
2014
+ [required]="required"
2015
+ [disabled]="disabled"
2016
+ >
2017
+ <mat-radio-button *ngFor="let entity of entities" [value]="entity">
2018
+ {{ getPropertyValue(entity) }}
2019
+ </mat-radio-button>
2020
+ </mat-radio-group>
2021
+ </div>
2022
+ `, isInline: true, styles: [".radio-group-column{display:flex;flex-direction:column}.radio-group-label{font-weight:500;margin-bottom:4px}.required{color:#f44336}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4$1.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color", "disabledInteractive"], outputs: ["change"], exportAs: ["matRadioButton"] }] });
2023
+ }
2024
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RadioGroupEntityComponent, decorators: [{
2025
+ type: Component,
2026
+ args: [{ selector: 'ptech-radio-group-entity', standalone: true, imports: [CoreMaterialModule], template: `
2027
+ <div class="radio-group-column">
2028
+ <label class="radio-group-label">
2029
+ {{ label }} <span *ngIf="required" class="required">*</span>
2030
+ </label>
2031
+ <mat-radio-group
2032
+ [(ngModel)]="value"
2033
+ [required]="required"
2034
+ [disabled]="disabled"
2035
+ >
2036
+ <mat-radio-button *ngFor="let entity of entities" [value]="entity">
2037
+ {{ getPropertyValue(entity) }}
2038
+ </mat-radio-button>
2039
+ </mat-radio-group>
2040
+ </div>
2041
+ `, providers: [
2042
+ {
2043
+ provide: NG_VALUE_ACCESSOR,
2044
+ useExisting: forwardRef(() => RadioGroupEntityComponent),
2045
+ multi: true
2046
+ }
2047
+ ], styles: [".radio-group-column{display:flex;flex-direction:column}.radio-group-label{font-weight:500;margin-bottom:4px}.required{color:#f44336}\n"] }]
2048
+ }], propDecorators: { label: [{
2049
+ type: Input
2050
+ }], disabled: [{
2051
+ type: Input
2052
+ }], required: [{
2053
+ type: Input
2054
+ }], property: [{
2055
+ type: Input
2056
+ }], entities: [{
2057
+ type: Input
2058
+ }] } });
2059
+
2060
+ class SelectEnumComponent {
2061
+ label;
2062
+ placeholder;
2063
+ disabled = false;
2064
+ required = false;
2065
+ multiple = false;
2066
+ enum = {};
2067
+ disabledOptions = [];
2068
+ sort = () => 0;
2069
+ loading = false;
2070
+ val;
2071
+ selectionChange = new EventEmitter();
2072
+ enumList = [];
2073
+ ngOnInit() {
2074
+ this.enumList = Object.keys(this.enum)
2075
+ .map(key => ({ key, value: this.enum[key] }))
2076
+ .sort(this.sort);
2077
+ }
2078
+ get value() {
2079
+ return this.val;
2080
+ }
2081
+ set value(v) {
2082
+ this.val = v;
2083
+ this.onChange(v);
2084
+ this.onTouch();
2085
+ }
2086
+ onSelectionChange(entity) {
2087
+ this.selectionChange.emit(entity);
2088
+ }
2089
+ onChange = () => { };
2090
+ onTouch = () => { };
2091
+ writeValue(value) {
2092
+ this.value = value;
2093
+ }
2094
+ registerOnChange(fn) {
2095
+ this.onChange = fn;
2096
+ }
2097
+ registerOnTouched(fn) {
2098
+ this.onTouch = fn;
2099
+ }
2100
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectEnumComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2101
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SelectEnumComponent, isStandalone: true, selector: "ptech-select-enum", inputs: { label: "label", placeholder: "placeholder", disabled: "disabled", required: "required", multiple: "multiple", enum: "enum", disabledOptions: "disabledOptions", sort: "sort", loading: "loading", val: ["value", "val"] }, outputs: { selectionChange: "selectionChange" }, providers: [
2102
+ {
2103
+ provide: NG_VALUE_ACCESSOR,
2104
+ useExisting: forwardRef(() => SelectEnumComponent),
2105
+ multi: true,
2106
+ },
2107
+ ], ngImport: i0, template: "<div class=\"select-enum-container\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ label }} </mat-label>\n <mat-select\n [placeholder]=\"placeholder\"\n [multiple]=\"multiple\"\n [(ngModel)]=\"value\"\n [required]=\"required\"\n [disabled]=\"disabled || loading\"\n (selectionChange)=\"onSelectionChange($event.value)\"\n >\n <mat-option *ngIf=\"!required && !multiple\" [value]=\"null\"\n >Selecione</mat-option\n >\n <mat-option\n *ngFor=\"let e of enumList\"\n [value]=\"e.key\"\n [disabled]=\"disabledOptions?.includes(e.key)\"\n >{{ e.value }}\n <span *ngIf=\"disabledOptions?.includes(e.key)\"> (indispon\u00EDvel)</span>\n </mat-option>\n </mat-select>\n <mat-spinner\n matPrefix\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n diameter=\"17\"\n ></mat-spinner>\n </mat-form-field>\n</div>\n", styles: [".select-enum-container{display:flex;flex-direction:column}.select-enum-container mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "component", type: i5$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
2108
+ }
2109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SelectEnumComponent, decorators: [{
2110
+ type: Component,
2111
+ args: [{ selector: 'ptech-select-enum', standalone: true, imports: [CoreMaterialModule], providers: [
2112
+ {
2113
+ provide: NG_VALUE_ACCESSOR,
2114
+ useExisting: forwardRef(() => SelectEnumComponent),
2115
+ multi: true,
2116
+ },
2117
+ ], template: "<div class=\"select-enum-container\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{ label }} </mat-label>\n <mat-select\n [placeholder]=\"placeholder\"\n [multiple]=\"multiple\"\n [(ngModel)]=\"value\"\n [required]=\"required\"\n [disabled]=\"disabled || loading\"\n (selectionChange)=\"onSelectionChange($event.value)\"\n >\n <mat-option *ngIf=\"!required && !multiple\" [value]=\"null\"\n >Selecione</mat-option\n >\n <mat-option\n *ngFor=\"let e of enumList\"\n [value]=\"e.key\"\n [disabled]=\"disabledOptions?.includes(e.key)\"\n >{{ e.value }}\n <span *ngIf=\"disabledOptions?.includes(e.key)\"> (indispon\u00EDvel)</span>\n </mat-option>\n </mat-select>\n <mat-spinner\n matPrefix\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n diameter=\"17\"\n ></mat-spinner>\n </mat-form-field>\n</div>\n", styles: [".select-enum-container{display:flex;flex-direction:column}.select-enum-container mat-form-field{width:100%}\n"] }]
2118
+ }], propDecorators: { label: [{
2119
+ type: Input
2120
+ }], placeholder: [{
2121
+ type: Input
2122
+ }], disabled: [{
2123
+ type: Input
2124
+ }], required: [{
2125
+ type: Input
2126
+ }], multiple: [{
2127
+ type: Input
2128
+ }], enum: [{
2129
+ type: Input
2130
+ }], disabledOptions: [{
2131
+ type: Input
2132
+ }], sort: [{
2133
+ type: Input
2134
+ }], loading: [{
2135
+ type: Input
2136
+ }], val: [{
2137
+ type: Input,
2138
+ args: ['value']
2139
+ }], selectionChange: [{
2140
+ type: Output
2141
+ }] } });
2142
+
2143
+ class SlideToggleComponent {
2144
+ /** Texto do rótulo (aparece ao lado do toggle) */
2145
+ label = '';
2146
+ /** 'primary' | 'accent' | 'warn' */
2147
+ color = 'primary';
2148
+ /** Posição do rótulo: 'before' | 'after' */
2149
+ labelPosition = 'after';
2150
+ /** Acessibilidade */
2151
+ ariaLabel;
2152
+ ariaLabelledby;
2153
+ /** Controle de estados (coerção de boolean) */
2154
+ static ngAcceptInputType_disabled;
2155
+ static ngAcceptInputType_required;
2156
+ static ngAcceptInputType_disableRipple;
2157
+ _disabled = false;
2158
+ get disabled() { return this._disabled; }
2159
+ set disabled(v) { this._disabled = coerceBooleanProperty(v); }
2160
+ _required = false;
2161
+ get required() { return this._required; }
2162
+ set required(v) { this._required = coerceBooleanProperty(v); }
2163
+ _disableRipple = false;
2164
+ get disableRipple() { return this._disableRipple; }
2165
+ set disableRipple(v) { this._disableRipple = coerceBooleanProperty(v); }
2166
+ /** name para forms nativos, se precisar */
2167
+ name = '';
2168
+ /** Saída de mudança (boolean) – compatível com (change) que você usava */
2169
+ change = new EventEmitter();
2170
+ /** Model interno (CVA) */
2171
+ _value = false;
2172
+ get value() { return this._value; }
2173
+ set value(v) {
2174
+ if (v !== this._value) {
2175
+ this._value = v;
2176
+ this.onChange(v);
2177
+ this.onTouch();
2178
+ this.change.emit(v);
2179
+ }
2180
+ }
2181
+ // ===== CVA =====
2182
+ onChange = () => { };
2183
+ onTouch = () => { };
2184
+ writeValue(v) {
2185
+ // atualiza sem disparar change novamente
2186
+ this._value = !!v;
2187
+ }
2188
+ registerOnChange(fn) { this.onChange = fn; }
2189
+ registerOnTouched(fn) { this.onTouch = fn; }
2190
+ setDisabledState(isDisabled) { this.disabled = isDisabled; }
2191
+ // Evento vindo do mat-slide-toggle
2192
+ onMatChange(checked) {
2193
+ this.value = checked;
2194
+ }
2195
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SlideToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2196
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: SlideToggleComponent, isStandalone: true, selector: "ptech-slide-toggle", inputs: { label: "label", color: "color", labelPosition: "labelPosition", ariaLabel: "ariaLabel", ariaLabelledby: "ariaLabelledby", disabled: "disabled", required: "required", disableRipple: "disableRipple", name: "name" }, outputs: { change: "change" }, providers: [{
2197
+ provide: NG_VALUE_ACCESSOR,
2198
+ useExisting: forwardRef(() => SlideToggleComponent),
2199
+ multi: true,
2200
+ }], ngImport: i0, template: "<div class=\"ptech-slide-toggle-container\">\n <mat-slide-toggle\n [color]=\"color\"\n [checked]=\"value\"\n [labelPosition]=\"labelPosition\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n [attr.name]=\"name || null\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n (change)=\"onMatChange($event.checked)\"\n (blur)=\"onTouch()\"\n >\n {{ label }}\n </mat-slide-toggle>\n</div>\n", styles: [".slide-toggle-container{display:flex;flex-direction:column}mat-slide-toggle{margin-bottom:15px}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i1$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2201
+ }
2202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SlideToggleComponent, decorators: [{
2203
+ type: Component,
2204
+ args: [{ selector: 'ptech-slide-toggle', standalone: true, imports: [CoreMaterialModule], providers: [{
2205
+ provide: NG_VALUE_ACCESSOR,
2206
+ useExisting: forwardRef(() => SlideToggleComponent),
2207
+ multi: true,
2208
+ }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ptech-slide-toggle-container\">\n <mat-slide-toggle\n [color]=\"color\"\n [checked]=\"value\"\n [labelPosition]=\"labelPosition\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [disableRipple]=\"disableRipple\"\n [attr.name]=\"name || null\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby || null\"\n (change)=\"onMatChange($event.checked)\"\n (blur)=\"onTouch()\"\n >\n {{ label }}\n </mat-slide-toggle>\n</div>\n", styles: [".slide-toggle-container{display:flex;flex-direction:column}mat-slide-toggle{margin-bottom:15px}\n"] }]
2209
+ }], propDecorators: { label: [{
2210
+ type: Input
2211
+ }], color: [{
2212
+ type: Input
2213
+ }], labelPosition: [{
2214
+ type: Input
2215
+ }], ariaLabel: [{
2216
+ type: Input
2217
+ }], ariaLabelledby: [{
2218
+ type: Input
2219
+ }], disabled: [{
2220
+ type: Input
2221
+ }], required: [{
2222
+ type: Input
2223
+ }], disableRipple: [{
2224
+ type: Input
2225
+ }], name: [{
2226
+ type: Input
2227
+ }], change: [{
2228
+ type: Output
2229
+ }] } });
2230
+
2231
+ class TitleComponent {
2232
+ cd;
2233
+ title;
2234
+ subtitle;
2235
+ constructor(cd) {
2236
+ this.cd = cd;
2237
+ }
2238
+ ngOnChanges(changes) {
2239
+ if (changes['title'] || changes['subtitle']) {
2240
+ this.cd.detectChanges();
2241
+ }
2242
+ }
2243
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TitleComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2244
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: TitleComponent, isStandalone: true, selector: "ptech-title", inputs: { title: "title", subtitle: "subtitle" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"events-header\">\n <div class=\"text-container\">\n <h1>{{ title }}</h1>\n <p>{{ subtitle }}</p>\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".events-header{display:flex;justify-content:space-between;align-items:center;height:143px;padding:0 40px;background:linear-gradient(90deg,#00aae0,#6687e7,#c467ed);color:#fff;font-family:Arial,sans-serif}.text-container{display:flex;flex-direction:column;align-items:flex-start}.events-header h1{margin:0 0 10px;font-size:24px}.events-header p{margin:0;font-size:14px}@media (max-width: 599px){.events-header{justify-content:space-around;padding-top:10px;flex-direction:column;align-items:center;text-align:center}.text-container{align-items:center}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] });
2245
+ }
2246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TitleComponent, decorators: [{
2247
+ type: Component,
2248
+ args: [{ selector: 'ptech-title', standalone: true, imports: [CommonModule], template: "<div class=\"events-header\">\n <div class=\"text-container\">\n <h1>{{ title }}</h1>\n <p>{{ subtitle }}</p>\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".events-header{display:flex;justify-content:space-between;align-items:center;height:143px;padding:0 40px;background:linear-gradient(90deg,#00aae0,#6687e7,#c467ed);color:#fff;font-family:Arial,sans-serif}.text-container{display:flex;flex-direction:column;align-items:flex-start}.events-header h1{margin:0 0 10px;font-size:24px}.events-header p{margin:0;font-size:14px}@media (max-width: 599px){.events-header{justify-content:space-around;padding-top:10px;flex-direction:column;align-items:center;text-align:center}.text-container{align-items:center}}\n"] }]
2249
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { title: [{
2250
+ type: Input
2251
+ }], subtitle: [{
2252
+ type: Input
2253
+ }] } });
2254
+
2255
+ class ConfirmationDialogComponent {
2256
+ dialogRef;
2257
+ confirmation;
2258
+ constructor(dialogRef, confirmation) {
2259
+ this.dialogRef = dialogRef;
2260
+ this.confirmation = confirmation;
2261
+ }
2262
+ confirm() {
2263
+ this.confirmation.accept();
2264
+ this.dialogRef.close(true);
2265
+ }
2266
+ cancel() {
2267
+ this.dialogRef.close(false);
2268
+ }
2269
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ConfirmationDialogComponent, deps: [{ token: i1$3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2270
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ConfirmationDialogComponent, isStandalone: true, selector: "ptech-confirmation-dialog", ngImport: i0, template: `
2271
+ <div class="dialog">
2272
+ <h1 mat-dialog-title class="dialog-title">{{ confirmation.title }}</h1>
2273
+
2274
+ <div mat-dialog-content class="dialog-content">
2275
+ <p>{{ confirmation.message }}</p>
2276
+ </div>
2277
+
2278
+ <div class="dialog-actions">
2279
+ <button mat-flat-button color="primary" (click)="confirm()">
2280
+ {{ confirmation.confirmText || 'OK' }}
2281
+ </button>
2282
+ <button mat-flat-button color="warn" (click)="cancel()">
2283
+ {{ confirmation.cancelText || 'Cancelar' }}
2284
+ </button>
2285
+ </div>
2286
+ </div>
2287
+ `, isInline: true, styles: [".dialog{padding:10px;background-color:#f7f7f7;border-radius:8px}.dialog-title{font-size:20px;font-weight:500;margin-bottom:12px;text-align:center}.dialog-content{font-size:16px;margin-bottom:20px;text-align:center}.dialog-actions{display:flex;justify-content:center;gap:20px}button{padding:8px 24px;font-size:14px;font-weight:500;text-transform:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
2288
+ }
2289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
2290
+ type: Component,
2291
+ args: [{ selector: 'ptech-confirmation-dialog', standalone: true, imports: [CommonModule, CoreMaterialModule], template: `
2292
+ <div class="dialog">
2293
+ <h1 mat-dialog-title class="dialog-title">{{ confirmation.title }}</h1>
2294
+
2295
+ <div mat-dialog-content class="dialog-content">
2296
+ <p>{{ confirmation.message }}</p>
2297
+ </div>
2298
+
2299
+ <div class="dialog-actions">
2300
+ <button mat-flat-button color="primary" (click)="confirm()">
2301
+ {{ confirmation.confirmText || 'OK' }}
2302
+ </button>
2303
+ <button mat-flat-button color="warn" (click)="cancel()">
2304
+ {{ confirmation.cancelText || 'Cancelar' }}
2305
+ </button>
2306
+ </div>
2307
+ </div>
2308
+ `, styles: [".dialog{padding:10px;background-color:#f7f7f7;border-radius:8px}.dialog-title{font-size:20px;font-weight:500;margin-bottom:12px;text-align:center}.dialog-content{font-size:16px;margin-bottom:20px;text-align:center}.dialog-actions{display:flex;justify-content:center;gap:20px}button{padding:8px 24px;font-size:14px;font-weight:500;text-transform:none}\n"] }]
2309
+ }], ctorParameters: () => [{ type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
2310
+ type: Inject,
2311
+ args: [MAT_DIALOG_DATA]
2312
+ }] }] });
2313
+
2314
+ // src/lib/services/message-token.ts
2315
+ const MESSAGE_SERVICE = new InjectionToken('MESSAGE_SERVICE');
2316
+ const DefaultConsoleMessageService = {
2317
+ successMessage: (title, message) => {
2318
+ console.log(`[Success] ${title}: ${message}`);
2319
+ },
2320
+ errorMessage: (title, message) => {
2321
+ console.error(`[Error] ${title}: ${message}`);
2322
+ },
2323
+ warnMessage: (title, message) => {
2324
+ console.warn(`[Warn] ${title}: ${message}`);
2325
+ },
2326
+ };
2327
+ const DefaultMessageService = DefaultConsoleMessageService;
2328
+
2329
+ class ActionDialogComponent {
2330
+ data;
2331
+ dialogRef;
2332
+ messageService;
2333
+ constructor(data, dialogRef, messageService) {
2334
+ this.data = data;
2335
+ this.dialogRef = dialogRef;
2336
+ this.messageService = messageService;
2337
+ }
2338
+ get msg() {
2339
+ return this.messageService ?? DefaultConsoleMessageService;
2340
+ }
2341
+ onConfirm() {
2342
+ const result = (this.data.fields || []).reduce((acc, field) => {
2343
+ acc[field.label] = field.value;
2344
+ return acc;
2345
+ }, {});
2346
+ this.dialogRef.close(result);
2347
+ }
2348
+ onCancel() {
2349
+ this.dialogRef.close();
2350
+ }
2351
+ changeQuantity($event) {
2352
+ if ($event !== 0)
2353
+ return;
2354
+ this.msg.errorMessage('Número inválido', 'Deve haver no mínimo 1 conexão.');
2355
+ }
2356
+ onSelectionChange($event) {
2357
+ console.log('selection changed', $event);
2358
+ }
2359
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$3.MatDialogRef }, { token: MESSAGE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2360
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ActionDialogComponent, isStandalone: true, selector: "ptech-action-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{ data.title }}</h2>\n\n<mat-dialog-content>\n <div *ngFor=\"let field of data.fields\">\n <!-- Select -->\n <ng-container *ngIf=\"field.type === 'select'\">\n <ptech-select-entity\n [label]=\"field.label\"\n [entities]=\"field.options ?? []\"\n [(ngModel)]=\"field.value\"\n property=\"label\"\n placeholder=\"Selecione\"\n (selectionChange)=\"onSelectionChange($event)\"\n ></ptech-select-entity>\n </ng-container>\n\n <!-- Number -->\n <ng-container *ngIf=\"field.type === 'number'\">\n <mat-label>{{ field.label }}</mat-label>\n <ptech-quantity-items\n [quantity]=\"field.value\"\n (quantityChange)=\"changeQuantity($event)\"\n ></ptech-quantity-items>\n </ng-container>\n\n <!-- Text -->\n <ng-container *ngIf=\"field.type === 'text'\">\n <mat-form-field appearance=\"fill\">\n <mat-label>{{ field.label }}</mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"field.value\" />\n </mat-form-field>\n </ng-container>\n\n <!-- Checkbox -->\n <ng-container *ngIf=\"field.type === 'checkbox'\">\n <mat-checkbox [(ngModel)]=\"field.value\">{{ field.label }}</mat-checkbox>\n </ng-container>\n </div>\n\n <mat-card *ngIf=\"data.infoBox\">\n <pre>{{ data.infoBox }}</pre>\n </mat-card>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <ptech-button\n class=\"action-btn\"\n type=\"raised\"\n [label]=\"data.confirmText || 'Confirmar'\"\n icon=\"assignment_turned_in\"\n color=\"primary\"\n (click)=\"onConfirm()\"\n ></ptech-button>\n\n <ptech-button\n class=\"action-btn\"\n type=\"raised\"\n [label]=\"data.cancelText || 'Fechar'\"\n icon=\"close\"\n color=\"#dc3545\"\n (click)=\"onCancel()\"\n ></ptech-button>\n</mat-dialog-actions>\n", styles: [".action-btn{margin-right:5px!important}mat-dialog-content{max-height:calc(90vh - 120px);overflow-y:auto;overflow-x:hidden;padding:16px;box-sizing:border-box;white-space:normal!important;word-break:break-word!important;overflow-wrap:break-word!important}mat-card{background:#2b2e34!important;color:#fff!important;padding:12px 16px!important;border-radius:6px;font-size:13px;line-height:18px;margin-bottom:24px;white-space:normal!important;word-break:break-word!important;overflow-wrap:break-word!important}mat-card pre{margin:0;white-space:pre-wrap!important;word-break:break-word!important;overflow-wrap:break-word!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i4$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i7$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: ButtonComponent, selector: "ptech-button", inputs: ["required", "type", "tooltip", "disabled", "loading", "icon", "iconColor", "iconWidth", "iconHeight", "label", "textColor", "link", "target", "shape", "ariaLabel", "color", "fullWidth"] }, { kind: "component", type: SelectEntityComponent, selector: "ptech-select-entity", inputs: ["appearance", "label", "placeholder", "disabled", "multiple", "required", "property", "propertyEnum", "propertyFn", "idProp", "searchPlaceholder", "multipleTriggerMax", "entities", "loading"], outputs: ["selectionChange", "loadingChange"] }, { kind: "component", type: QuantityItemsComponent, selector: "ptech-quantity-items", inputs: ["quantity"], outputs: ["quantityChange"] }] });
2361
+ }
2362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionDialogComponent, decorators: [{
2363
+ type: Component,
2364
+ args: [{ selector: 'ptech-action-dialog', standalone: true, imports: [
2365
+ CommonModule,
2366
+ FormsModule,
2367
+ CoreMaterialModule,
2368
+ ButtonComponent,
2369
+ SelectEntityComponent,
2370
+ QuantityItemsComponent,
2371
+ ], template: "<h2 mat-dialog-title>{{ data.title }}</h2>\n\n<mat-dialog-content>\n <div *ngFor=\"let field of data.fields\">\n <!-- Select -->\n <ng-container *ngIf=\"field.type === 'select'\">\n <ptech-select-entity\n [label]=\"field.label\"\n [entities]=\"field.options ?? []\"\n [(ngModel)]=\"field.value\"\n property=\"label\"\n placeholder=\"Selecione\"\n (selectionChange)=\"onSelectionChange($event)\"\n ></ptech-select-entity>\n </ng-container>\n\n <!-- Number -->\n <ng-container *ngIf=\"field.type === 'number'\">\n <mat-label>{{ field.label }}</mat-label>\n <ptech-quantity-items\n [quantity]=\"field.value\"\n (quantityChange)=\"changeQuantity($event)\"\n ></ptech-quantity-items>\n </ng-container>\n\n <!-- Text -->\n <ng-container *ngIf=\"field.type === 'text'\">\n <mat-form-field appearance=\"fill\">\n <mat-label>{{ field.label }}</mat-label>\n <input matInput type=\"text\" [(ngModel)]=\"field.value\" />\n </mat-form-field>\n </ng-container>\n\n <!-- Checkbox -->\n <ng-container *ngIf=\"field.type === 'checkbox'\">\n <mat-checkbox [(ngModel)]=\"field.value\">{{ field.label }}</mat-checkbox>\n </ng-container>\n </div>\n\n <mat-card *ngIf=\"data.infoBox\">\n <pre>{{ data.infoBox }}</pre>\n </mat-card>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <ptech-button\n class=\"action-btn\"\n type=\"raised\"\n [label]=\"data.confirmText || 'Confirmar'\"\n icon=\"assignment_turned_in\"\n color=\"primary\"\n (click)=\"onConfirm()\"\n ></ptech-button>\n\n <ptech-button\n class=\"action-btn\"\n type=\"raised\"\n [label]=\"data.cancelText || 'Fechar'\"\n icon=\"close\"\n color=\"#dc3545\"\n (click)=\"onCancel()\"\n ></ptech-button>\n</mat-dialog-actions>\n", styles: [".action-btn{margin-right:5px!important}mat-dialog-content{max-height:calc(90vh - 120px);overflow-y:auto;overflow-x:hidden;padding:16px;box-sizing:border-box;white-space:normal!important;word-break:break-word!important;overflow-wrap:break-word!important}mat-card{background:#2b2e34!important;color:#fff!important;padding:12px 16px!important;border-radius:6px;font-size:13px;line-height:18px;margin-bottom:24px;white-space:normal!important;word-break:break-word!important;overflow-wrap:break-word!important}mat-card pre{margin:0;white-space:pre-wrap!important;word-break:break-word!important;overflow-wrap:break-word!important}\n"] }]
2372
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2373
+ type: Inject,
2374
+ args: [MAT_DIALOG_DATA]
2375
+ }] }, { type: i1$3.MatDialogRef }, { type: undefined, decorators: [{
2376
+ type: Optional
2377
+ }, {
2378
+ type: Inject,
2379
+ args: [MESSAGE_SERVICE]
2380
+ }] }] });
2381
+
2382
+ class InfoDetailDialogComponent {
2383
+ data;
2384
+ whatsappUrl;
2385
+ msgService;
2386
+ constructor(data, messageService) {
2387
+ this.data = data;
2388
+ this.msgService = messageService ?? DefaultConsoleMessageService;
2389
+ const text = encodeURIComponent(data.rawContent || '');
2390
+ this.whatsappUrl = `https://api.whatsapp.com/send?phone=&text=${text}`;
2391
+ }
2392
+ copyToClipboard() {
2393
+ const txt = this.data.rawContent || '';
2394
+ navigator.clipboard
2395
+ .writeText(txt)
2396
+ .then(() => {
2397
+ this.msgService.successMessage('Dados copiados', 'Conteúdo copiado para a área de transferência.');
2398
+ })
2399
+ .catch((err) => {
2400
+ console.error('Erro ao copiar:', err);
2401
+ this.msgService.errorMessage('Erro ao copiar', 'Não foi possível copiar. Tente novamente.');
2402
+ });
2403
+ }
2404
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InfoDetailDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: MESSAGE_SERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2405
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InfoDetailDialogComponent, isStandalone: true, selector: "ptech-info-detail-dialog", ngImport: i0, template: `
2406
+ <h2 mat-dialog-title>{{ data.title }}</h2>
2407
+ <mat-dialog-content>
2408
+ <div [innerHTML]="data.content"></div>
2409
+ </mat-dialog-content>
2410
+ <mat-dialog-actions align="end">
2411
+ <a
2412
+ *ngIf="data.rawContent"
2413
+ mat-flat-button
2414
+ color="primary"
2415
+ [href]="whatsappUrl"
2416
+ target="_blank"
2417
+ >
2418
+ WhatsApp
2419
+ </a>
2420
+
2421
+ <button *ngIf="data.rawContent" mat-flat-button (click)="copyToClipboard()">
2422
+ Copiar
2423
+ </button>
2424
+
2425
+ <button mat-button mat-dialog-close>Fechar</button>
2426
+ </mat-dialog-actions>
2427
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i2$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$3.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
2428
+ }
2429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InfoDetailDialogComponent, decorators: [{
2430
+ type: Component,
2431
+ args: [{
2432
+ selector: 'ptech-info-detail-dialog',
2433
+ standalone: true,
2434
+ imports: [CommonModule, CoreMaterialModule],
2435
+ template: `
2436
+ <h2 mat-dialog-title>{{ data.title }}</h2>
2437
+ <mat-dialog-content>
2438
+ <div [innerHTML]="data.content"></div>
2439
+ </mat-dialog-content>
2440
+ <mat-dialog-actions align="end">
2441
+ <a
2442
+ *ngIf="data.rawContent"
2443
+ mat-flat-button
2444
+ color="primary"
2445
+ [href]="whatsappUrl"
2446
+ target="_blank"
2447
+ >
2448
+ WhatsApp
2449
+ </a>
2450
+
2451
+ <button *ngIf="data.rawContent" mat-flat-button (click)="copyToClipboard()">
2452
+ Copiar
2453
+ </button>
2454
+
2455
+ <button mat-button mat-dialog-close>Fechar</button>
2456
+ </mat-dialog-actions>
2457
+ `,
2458
+ }]
2459
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2460
+ type: Inject,
2461
+ args: [MAT_DIALOG_DATA]
2462
+ }] }, { type: undefined, decorators: [{
2463
+ type: Optional
2464
+ }, {
2465
+ type: Inject,
2466
+ args: [MESSAGE_SERVICE]
2467
+ }] }] });
2468
+
2469
+ class InfoDetailComponent {
2470
+ dialog;
2471
+ infoTitle = '';
2472
+ infoContent = '';
2473
+ infoRawContent = '';
2474
+ iconColor = '#2196f3';
2475
+ constructor(dialog) {
2476
+ this.dialog = dialog;
2477
+ }
2478
+ openInfo() {
2479
+ this.dialog.open(InfoDetailDialogComponent, {
2480
+ data: {
2481
+ title: this.infoTitle,
2482
+ content: this.infoContent,
2483
+ rawContent: this.infoRawContent,
2484
+ },
2485
+ });
2486
+ }
2487
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InfoDetailComponent, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2488
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InfoDetailComponent, isStandalone: true, selector: "ptech-info-detail", inputs: { infoTitle: "infoTitle", infoContent: "infoContent", infoRawContent: "infoRawContent", iconColor: "iconColor" }, ngImport: i0, template: "<div class=\"info-trigger\" (click)=\"openInfo()\" [style.color]=\"iconColor\">\n <button mat-icon-button>\n <mat-icon [style.color]=\"iconColor\">info</mat-icon>\n </button>\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:inline-block;font-family:Inter,sans-serif;color:var(--text-color, #ffffff)}.info-trigger{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;transition:opacity .2s ease,transform .15s ease}.info-trigger:hover{opacity:.85;transform:translateY(-1px)}.info-trigger button.mat-mdc-icon-button{display:inline-flex;align-items:center;justify-content:center;padding:0;margin:0;min-width:0;width:2rem;height:2rem;border-radius:50%;background:transparent!important;transition:background-color .2s ease}.info-trigger button.mat-mdc-icon-button:hover{background-color:#ffffff14}.info-trigger mat-icon{font-size:1.5rem;line-height:1;color:inherit}.info-trigger .detail-link{margin:0;line-height:1.2;font-size:.85rem;text-decoration:underline;color:inherit;transition:color .2s ease}.info-trigger .detail-link:hover{color:var(--link-hover-color, #00bfff)}@media (max-width: 600px){.info-trigger{gap:.625rem}.info-trigger button.mat-mdc-icon-button{width:2.25rem;height:2.25rem}.info-trigger mat-icon{font-size:1.75rem}.info-trigger .detail-link{font-size:.95rem}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
2489
+ }
2490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InfoDetailComponent, decorators: [{
2491
+ type: Component,
2492
+ args: [{ selector: 'ptech-info-detail', standalone: true, imports: [CommonModule, CoreMaterialModule], template: "<div class=\"info-trigger\" (click)=\"openInfo()\" [style.color]=\"iconColor\">\n <button mat-icon-button>\n <mat-icon [style.color]=\"iconColor\">info</mat-icon>\n </button>\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:inline-block;font-family:Inter,sans-serif;color:var(--text-color, #ffffff)}.info-trigger{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;transition:opacity .2s ease,transform .15s ease}.info-trigger:hover{opacity:.85;transform:translateY(-1px)}.info-trigger button.mat-mdc-icon-button{display:inline-flex;align-items:center;justify-content:center;padding:0;margin:0;min-width:0;width:2rem;height:2rem;border-radius:50%;background:transparent!important;transition:background-color .2s ease}.info-trigger button.mat-mdc-icon-button:hover{background-color:#ffffff14}.info-trigger mat-icon{font-size:1.5rem;line-height:1;color:inherit}.info-trigger .detail-link{margin:0;line-height:1.2;font-size:.85rem;text-decoration:underline;color:inherit;transition:color .2s ease}.info-trigger .detail-link:hover{color:var(--link-hover-color, #00bfff)}@media (max-width: 600px){.info-trigger{gap:.625rem}.info-trigger button.mat-mdc-icon-button{width:2.25rem;height:2.25rem}.info-trigger mat-icon{font-size:1.75rem}.info-trigger .detail-link{font-size:.95rem}}\n"] }]
2493
+ }], ctorParameters: () => [{ type: i1$3.MatDialog }], propDecorators: { infoTitle: [{
2494
+ type: Input
2495
+ }], infoContent: [{
2496
+ type: Input
2497
+ }], infoRawContent: [{
2498
+ type: Input
2499
+ }], iconColor: [{
2500
+ type: Input
2501
+ }] } });
2502
+
2503
+ class ActionResultDialogComponent {
2504
+ data;
2505
+ dialogRef;
2506
+ sanitizer;
2507
+ messageService;
2508
+ whatsappUrl = '';
2509
+ sanitizedContent = '';
2510
+ constructor(data, dialogRef, sanitizer, messageService) {
2511
+ this.data = data;
2512
+ this.dialogRef = dialogRef;
2513
+ this.sanitizer = sanitizer;
2514
+ this.messageService = messageService;
2515
+ }
2516
+ ngOnInit() {
2517
+ if (this.data.rawContent) {
2518
+ const text = encodeURIComponent(this.data.rawContent);
2519
+ this.whatsappUrl = `https://api.whatsapp.com/send?phone=&text=${text}`;
2520
+ }
2521
+ if (this.data.content) {
2522
+ // Sanitiza o HTML para evitar XSS. Aqui estamos confiando no conteúdo; se vier externo, considere limpeza adicional.
2523
+ this.sanitizedContent = this.sanitizer.bypassSecurityTrustHtml(this.data.content);
2524
+ }
2525
+ }
2526
+ close() {
2527
+ this.dialogRef.close();
2528
+ }
2529
+ copyToClipboard() {
2530
+ if (!this.data.rawContent)
2531
+ return;
2532
+ navigator.clipboard
2533
+ .writeText(this.data.rawContent)
2534
+ .then(() => {
2535
+ this.messageService.successMessage('Dados copiados', 'Conteúdo copiado para a área de transferência.');
2536
+ })
2537
+ .catch((err) => {
2538
+ console.error('Erro ao copiar:', err);
2539
+ this.messageService.errorMessage('Erro ao copiar', 'Não foi possível copiar. Tente novamente.');
2540
+ });
2541
+ }
2542
+ openWhatsApp() {
2543
+ if (!this.whatsappUrl)
2544
+ return;
2545
+ window.open(this.whatsappUrl, '_blank');
2546
+ }
2547
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionResultDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1$3.MatDialogRef }, { token: i2$3.DomSanitizer }, { token: MESSAGE_SERVICE }], target: i0.ɵɵFactoryTarget.Component });
2548
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ActionResultDialogComponent, isStandalone: true, selector: "ptech-action-result-dialog", ngImport: i0, template: "<h2 mat-dialog-title>{{ data.title }}</h2>\n\n<mat-dialog-content>\n <!-- Conte\u00FAdo HTML (sanitizado) -->\n <div *ngIf=\"data.content\" [innerHTML]=\"sanitizedContent\"></div>\n\n <!-- Detalhes estruturados (JSON etc.) -->\n <div *ngIf=\"data.details\" class=\"details\">\n <mat-card>\n <pre>{{ data.details | json }}</pre>\n </mat-card>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <ptech-button\n *ngIf=\"data.rawContent\"\n class=\"action-btn\"\n label=\"WhatsApp\"\n icon=\"share\"\n type=\"raised\"\n color=\"#00c853\"\n (click)=\"openWhatsApp()\"\n ></ptech-button>\n\n <ptech-button\n *ngIf=\"data.rawContent\"\n class=\"action-btn\"\n label=\"Copiar\"\n icon=\"file_copy\"\n type=\"raised\"\n color=\"primary\"\n (click)=\"copyToClipboard()\"\n ></ptech-button>\n\n <ptech-button\n class=\"action-btn\"\n label=\"Fechar\"\n icon=\"close\"\n type=\"raised\"\n color=\"#dc3545\"\n (click)=\"close()\"\n ></ptech-button>\n</mat-dialog-actions>\n", styles: [":host{display:block;color:#fff;padding:24px;border-radius:10px;min-width:420px;font-family:Inter,sans-serif;background:transparent}h2[mat-dialog-title]{font-size:20px;font-weight:600;margin-bottom:24px}mat-dialog-content{display:flex;flex-direction:column;gap:20px}mat-dialog-content div[innerHTML]{color:#fff;font-size:14px;line-height:20px}.details{background:#2b2e34!important;color:#fff!important;padding:14px 18px!important;border-radius:8px;font-size:14px;line-height:20px;font-family:monospace;white-space:pre-wrap;word-break:break-word;box-shadow:none;width:100%}.details mat-card{background:transparent;box-shadow:none;padding:0;margin:0}.details pre{margin:0;color:#fff}mat-dialog-actions{display:flex;justify-content:flex-end;gap:12px}mat-dialog-actions button,mat-dialog-actions a[mat-flat-button]{border-radius:6px!important;font-weight:500;padding:8px 18px;text-transform:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.JsonPipe, name: "json" }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i4$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$3.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$3.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$3.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: ButtonComponent, selector: "ptech-button", inputs: ["required", "type", "tooltip", "disabled", "loading", "icon", "iconColor", "iconWidth", "iconHeight", "label", "textColor", "link", "target", "shape", "ariaLabel", "color", "fullWidth"] }] });
2549
+ }
2550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ActionResultDialogComponent, decorators: [{
2551
+ type: Component,
2552
+ args: [{ selector: 'ptech-action-result-dialog', standalone: true, imports: [CommonModule, CoreMaterialModule, ButtonComponent], template: "<h2 mat-dialog-title>{{ data.title }}</h2>\n\n<mat-dialog-content>\n <!-- Conte\u00FAdo HTML (sanitizado) -->\n <div *ngIf=\"data.content\" [innerHTML]=\"sanitizedContent\"></div>\n\n <!-- Detalhes estruturados (JSON etc.) -->\n <div *ngIf=\"data.details\" class=\"details\">\n <mat-card>\n <pre>{{ data.details | json }}</pre>\n </mat-card>\n </div>\n</mat-dialog-content>\n\n<mat-dialog-actions align=\"end\">\n <ptech-button\n *ngIf=\"data.rawContent\"\n class=\"action-btn\"\n label=\"WhatsApp\"\n icon=\"share\"\n type=\"raised\"\n color=\"#00c853\"\n (click)=\"openWhatsApp()\"\n ></ptech-button>\n\n <ptech-button\n *ngIf=\"data.rawContent\"\n class=\"action-btn\"\n label=\"Copiar\"\n icon=\"file_copy\"\n type=\"raised\"\n color=\"primary\"\n (click)=\"copyToClipboard()\"\n ></ptech-button>\n\n <ptech-button\n class=\"action-btn\"\n label=\"Fechar\"\n icon=\"close\"\n type=\"raised\"\n color=\"#dc3545\"\n (click)=\"close()\"\n ></ptech-button>\n</mat-dialog-actions>\n", styles: [":host{display:block;color:#fff;padding:24px;border-radius:10px;min-width:420px;font-family:Inter,sans-serif;background:transparent}h2[mat-dialog-title]{font-size:20px;font-weight:600;margin-bottom:24px}mat-dialog-content{display:flex;flex-direction:column;gap:20px}mat-dialog-content div[innerHTML]{color:#fff;font-size:14px;line-height:20px}.details{background:#2b2e34!important;color:#fff!important;padding:14px 18px!important;border-radius:8px;font-size:14px;line-height:20px;font-family:monospace;white-space:pre-wrap;word-break:break-word;box-shadow:none;width:100%}.details mat-card{background:transparent;box-shadow:none;padding:0;margin:0}.details pre{margin:0;color:#fff}mat-dialog-actions{display:flex;justify-content:flex-end;gap:12px}mat-dialog-actions button,mat-dialog-actions a[mat-flat-button]{border-radius:6px!important;font-weight:500;padding:8px 18px;text-transform:none}\n"] }]
2553
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2554
+ type: Inject,
2555
+ args: [MAT_DIALOG_DATA]
2556
+ }] }, { type: i1$3.MatDialogRef }, { type: i2$3.DomSanitizer }, { type: undefined, decorators: [{
2557
+ type: Inject,
2558
+ args: [MESSAGE_SERVICE]
2559
+ }] }] });
2560
+
2561
+ class AlertComponent {
2562
+ data;
2563
+ snackBarRef;
2564
+ constructor(data, snackBarRef) {
2565
+ this.data = data;
2566
+ this.snackBarRef = snackBarRef;
2567
+ }
2568
+ getIconColor(type) {
2569
+ switch (type) {
2570
+ case 'success':
2571
+ return '#7fcb78';
2572
+ case 'error':
2573
+ return '#f25158';
2574
+ case 'warn':
2575
+ return '#f0c943';
2576
+ case 'info':
2577
+ return '#2c80d2';
2578
+ default:
2579
+ return '#000';
2580
+ }
2581
+ }
2582
+ closeSnackbar() {
2583
+ this.snackBarRef.dismiss();
2584
+ }
2585
+ formattedTimestamp() {
2586
+ if (!this.data.timestamp)
2587
+ return '';
2588
+ const d = this.data.timestamp instanceof Date ? this.data.timestamp : new Date(this.data.timestamp);
2589
+ // Você pode refinar com DatePipe se preferir injeção
2590
+ return d.toLocaleString('pt-BR', {
2591
+ day: '2-digit',
2592
+ month: '2-digit',
2593
+ year: 'numeric',
2594
+ hour: '2-digit',
2595
+ minute: '2-digit',
2596
+ second: '2-digit',
2597
+ });
2598
+ }
2599
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlertComponent, deps: [{ token: MAT_SNACK_BAR_DATA }, { token: i1$4.MatSnackBarRef }], target: i0.ɵɵFactoryTarget.Component });
2600
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AlertComponent, isStandalone: true, selector: "ptech-alert", ngImport: i0, template: "<div class=\"alert\" [ngClass]=\"data.type\" role=\"alert\">\n <mat-icon\n *ngIf=\"data.icon\"\n class=\"icon\"\n [ngStyle]=\"{ color: getIconColor(data.type) }\"\n >{{ data.icon }}</mat-icon\n >\n <div class=\"text-content\">\n <div class=\"title\">\n {{ data.title }}\n </div>\n <span class=\"text-content-date-hour\">{{\n data.timestamp | date : \"dd/MM/yyyy HH:mm:ss\"\n }}</span>\n <span>{{ data.message }}</span>\n <span *ngFor=\"let detail of data.details\">{{ detail }}</span>\n </div>\n\n <button mat-icon-button class=\"close-button\" (click)=\"closeSnackbar()\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n", styles: [".alert{position:relative;display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:3px;padding:30px;border-left:5px solid #ddd;box-shadow:-1px 2px 7px -1px #00000045;max-width:350px}.close-button{position:relative;bottom:30px;left:15px;margin:0;padding:0;color:#aaa;border:none;background:none;cursor:pointer}.close-button mat-icon{font-size:26px!important;margin-top:10px!important;margin-left:-3px!important}.alert mat-icon{height:35px;width:55px;font-size:35px;display:contents}.text-content{margin-left:10px!important;display:flex;flex-direction:column}.text-content-date-hour{margin-left:0!important;margin-bottom:10px}.title{font-family:Roboto,Nunito,Helvetica Neue,sans-serif;font-size:16px;color:#606267;font-weight:600;margin-bottom:3px}span{font-family:Roboto,Nunito,Helvetica Neue,sans-serif;font-size:14px;color:#9ea0a9;font-weight:400}.success{border-left-color:#7fcb78}.error{border-left-color:#f25158}.warn{border-left-color:#f0c943}.info{border-left-color:#2c80d2}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2601
+ }
2602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlertComponent, decorators: [{
2603
+ type: Component,
2604
+ args: [{ selector: 'ptech-alert', standalone: true, imports: [CommonModule, MatIconModule, MatButtonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"alert\" [ngClass]=\"data.type\" role=\"alert\">\n <mat-icon\n *ngIf=\"data.icon\"\n class=\"icon\"\n [ngStyle]=\"{ color: getIconColor(data.type) }\"\n >{{ data.icon }}</mat-icon\n >\n <div class=\"text-content\">\n <div class=\"title\">\n {{ data.title }}\n </div>\n <span class=\"text-content-date-hour\">{{\n data.timestamp | date : \"dd/MM/yyyy HH:mm:ss\"\n }}</span>\n <span>{{ data.message }}</span>\n <span *ngFor=\"let detail of data.details\">{{ detail }}</span>\n </div>\n\n <button mat-icon-button class=\"close-button\" (click)=\"closeSnackbar()\">\n <mat-icon>close</mat-icon>\n </button>\n</div>\n", styles: [".alert{position:relative;display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:3px;padding:30px;border-left:5px solid #ddd;box-shadow:-1px 2px 7px -1px #00000045;max-width:350px}.close-button{position:relative;bottom:30px;left:15px;margin:0;padding:0;color:#aaa;border:none;background:none;cursor:pointer}.close-button mat-icon{font-size:26px!important;margin-top:10px!important;margin-left:-3px!important}.alert mat-icon{height:35px;width:55px;font-size:35px;display:contents}.text-content{margin-left:10px!important;display:flex;flex-direction:column}.text-content-date-hour{margin-left:0!important;margin-bottom:10px}.title{font-family:Roboto,Nunito,Helvetica Neue,sans-serif;font-size:16px;color:#606267;font-weight:600;margin-bottom:3px}span{font-family:Roboto,Nunito,Helvetica Neue,sans-serif;font-size:14px;color:#9ea0a9;font-weight:400}.success{border-left-color:#7fcb78}.error{border-left-color:#f25158}.warn{border-left-color:#f0c943}.info{border-left-color:#2c80d2}\n"] }]
2605
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2606
+ type: Inject,
2607
+ args: [MAT_SNACK_BAR_DATA]
2608
+ }] }, { type: i1$4.MatSnackBarRef }] });
2609
+
2610
+ class GetFirstStringBeforeSpacePipe {
2611
+ transform(value) {
2612
+ if (!value)
2613
+ return '';
2614
+ const idx = value.indexOf(' ');
2615
+ return idx === -1 ? value : value.substring(0, idx);
2616
+ }
2617
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFirstStringBeforeSpacePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2618
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: GetFirstStringBeforeSpacePipe, isStandalone: true, name: "getFirstStringBeforeSpace" });
2619
+ }
2620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GetFirstStringBeforeSpacePipe, decorators: [{
2621
+ type: Pipe,
2622
+ args: [{
2623
+ name: 'getFirstStringBeforeSpace',
2624
+ standalone: true,
2625
+ pure: true
2626
+ }]
2627
+ }] });
2628
+
2629
+ // profile-menu.component.ts
2630
+ class ProfileMenuComponent {
2631
+ /** Nome a ser exibido (pode ser “João Silva”, o pipe corta para “João”) */
2632
+ displayName = '';
2633
+ /** Itens do menu */
2634
+ items = [];
2635
+ handle(item) {
2636
+ item.action();
2637
+ }
2638
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProfileMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2639
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ProfileMenuComponent, isStandalone: true, selector: "ptech-profile-menu", inputs: { displayName: "displayName", items: "items" }, ngImport: i0, template: `
2640
+ <div class="profile-menu" [matMenuTriggerFor]="menu" aria-label="Profile menu">
2641
+ <mat-icon aria-hidden="true">account_circle</mat-icon>
2642
+ <span class="hide-on-mobile">{{ displayName | getFirstStringBeforeSpace }}</span>
2643
+ <mat-icon>arrow_drop_down</mat-icon>
2644
+ </div>
2645
+
2646
+ <mat-menu #menu="matMenu">
2647
+ <ng-container *ngFor="let item of items">
2648
+ <mat-divider *ngIf="item.dividerBefore"></mat-divider>
2649
+ <button mat-menu-item (click)="handle(item)">
2650
+ <mat-icon *ngIf="item.icon">{{ item.icon }}</mat-icon>
2651
+ <span>{{ item.label }}</span>
2652
+ </button>
2653
+ </ng-container>
2654
+
2655
+ <!-- extensibilidade por projection -->
2656
+ <ng-content select="[extra-items]"></ng-content>
2657
+ </mat-menu>
2658
+ `, isInline: true, styles: [".profile-menu{display:flex;align-items:center;cursor:pointer;position:relative}.profile-menu mat-icon{margin-right:8px;color:#fff}.profile-menu span{color:#fff;font-weight:700;margin-right:4px}.profile-menu mat-icon:last-child{margin-right:0}.mat-divider{margin:0!important}@media (max-width: 599px){.hide-on-mobile{display:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i6$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$3.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4$3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: GetFirstStringBeforeSpacePipe, name: "getFirstStringBeforeSpace" }] });
2659
+ }
2660
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ProfileMenuComponent, decorators: [{
2661
+ type: Component,
2662
+ args: [{ selector: 'ptech-profile-menu', standalone: true, imports: [CommonModule, CoreMaterialModule, GetFirstStringBeforeSpacePipe], template: `
2663
+ <div class="profile-menu" [matMenuTriggerFor]="menu" aria-label="Profile menu">
2664
+ <mat-icon aria-hidden="true">account_circle</mat-icon>
2665
+ <span class="hide-on-mobile">{{ displayName | getFirstStringBeforeSpace }}</span>
2666
+ <mat-icon>arrow_drop_down</mat-icon>
2667
+ </div>
2668
+
2669
+ <mat-menu #menu="matMenu">
2670
+ <ng-container *ngFor="let item of items">
2671
+ <mat-divider *ngIf="item.dividerBefore"></mat-divider>
2672
+ <button mat-menu-item (click)="handle(item)">
2673
+ <mat-icon *ngIf="item.icon">{{ item.icon }}</mat-icon>
2674
+ <span>{{ item.label }}</span>
2675
+ </button>
2676
+ </ng-container>
2677
+
2678
+ <!-- extensibilidade por projection -->
2679
+ <ng-content select="[extra-items]"></ng-content>
2680
+ </mat-menu>
2681
+ `, styles: [".profile-menu{display:flex;align-items:center;cursor:pointer;position:relative}.profile-menu mat-icon{margin-right:8px;color:#fff}.profile-menu span{color:#fff;font-weight:700;margin-right:4px}.profile-menu mat-icon:last-child{margin-right:0}.mat-divider{margin:0!important}@media (max-width: 599px){.hide-on-mobile{display:none}}\n"] }]
2682
+ }], propDecorators: { displayName: [{
2683
+ type: Input
2684
+ }], items: [{
2685
+ type: Input
2686
+ }] } });
2687
+
2688
+ class CheckBoxComponent {
2689
+ label = '';
2690
+ disabled = false;
2691
+ required = false;
2692
+ color = 'primary';
2693
+ indeterminate = false;
2694
+ indeterminateChange = new EventEmitter();
2695
+ change = new EventEmitter();
2696
+ _value = false;
2697
+ get value() {
2698
+ return this._value;
2699
+ }
2700
+ set value(v) {
2701
+ v = !!v;
2702
+ if (v !== this._value) {
2703
+ this._value = v;
2704
+ this.onChange(v);
2705
+ this.onTouch();
2706
+ this.change.emit(v);
2707
+ }
2708
+ }
2709
+ onChange = () => { };
2710
+ onTouch = () => { };
2711
+ writeValue(value) {
2712
+ this._value = !!value;
2713
+ }
2714
+ registerOnChange(fn) {
2715
+ this.onChange = fn;
2716
+ }
2717
+ registerOnTouched(fn) {
2718
+ this.onTouch = fn;
2719
+ }
2720
+ setDisabledState(isDisabled) {
2721
+ this.disabled = isDisabled;
2722
+ }
2723
+ onCheckboxChange(checked) {
2724
+ this.value = checked;
2725
+ }
2726
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CheckBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2727
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: CheckBoxComponent, isStandalone: true, selector: "ptech-check-box", inputs: { label: "label", disabled: "disabled", required: "required", color: "color", indeterminate: "indeterminate", value: "value" }, outputs: { indeterminateChange: "indeterminateChange", change: "change" }, providers: [
2728
+ {
2729
+ provide: NG_VALUE_ACCESSOR,
2730
+ useExisting: forwardRef(() => CheckBoxComponent),
2731
+ multi: true
2732
+ }
2733
+ ], ngImport: i0, template: `
2734
+ <div class="checkbox-column">
2735
+ <mat-checkbox
2736
+ [checked]="value"
2737
+ [required]="required"
2738
+ [disabled]="disabled"
2739
+ [color]="color"
2740
+ [indeterminate]="indeterminate"
2741
+ (indeterminateChange)="indeterminateChange.emit($event)"
2742
+ (change)="onCheckboxChange($event.checked)"
2743
+ >
2744
+ {{ label }}
2745
+ </mat-checkbox>
2746
+ </div>
2747
+ `, isInline: true, styles: [".checkbox-column{display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: CoreMaterialModule }, { kind: "component", type: i7$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }] });
2748
+ }
2749
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CheckBoxComponent, decorators: [{
2750
+ type: Component,
2751
+ args: [{ selector: 'ptech-check-box', standalone: true, imports: [CommonModule, CoreMaterialModule], template: `
2752
+ <div class="checkbox-column">
2753
+ <mat-checkbox
2754
+ [checked]="value"
2755
+ [required]="required"
2756
+ [disabled]="disabled"
2757
+ [color]="color"
2758
+ [indeterminate]="indeterminate"
2759
+ (indeterminateChange)="indeterminateChange.emit($event)"
2760
+ (change)="onCheckboxChange($event.checked)"
2761
+ >
2762
+ {{ label }}
2763
+ </mat-checkbox>
2764
+ </div>
2765
+ `, providers: [
2766
+ {
2767
+ provide: NG_VALUE_ACCESSOR,
2768
+ useExisting: forwardRef(() => CheckBoxComponent),
2769
+ multi: true
2770
+ }
2771
+ ], styles: [".checkbox-column{display:flex;flex-direction:column}\n"] }]
2772
+ }], propDecorators: { label: [{
2773
+ type: Input
2774
+ }], disabled: [{
2775
+ type: Input
2776
+ }], required: [{
2777
+ type: Input
2778
+ }], color: [{
2779
+ type: Input
2780
+ }], indeterminate: [{
2781
+ type: Input
2782
+ }], indeterminateChange: [{
2783
+ type: Output
2784
+ }], change: [{
2785
+ type: Output
2786
+ }], value: [{
2787
+ type: Input
2788
+ }] } });
2789
+
2790
+ // src/lib/components/input-date-picker-range/input-date-picker-range.component.ts
2791
+ class InputDatePickerRangeComponent {
2792
+ disabled = false;
2793
+ label;
2794
+ required = false;
2795
+ loading = false;
2796
+ firstPlaceholder = '';
2797
+ secondPlaceholder = '';
2798
+ hint;
2799
+ appearance = 'outline';
2800
+ dateChange = new EventEmitter();
2801
+ start = null;
2802
+ end = null;
2803
+ onChange = () => { };
2804
+ onTouch = () => { };
2805
+ writeValue(obj) {
2806
+ if (obj) {
2807
+ const startDate = obj.start ? new Date(obj.start) : null;
2808
+ const endDate = obj.end ? new Date(obj.end) : null;
2809
+ this.start = this.convertToLocalDateString(startDate, true);
2810
+ this.end = this.convertToLocalDateString(endDate, false);
2811
+ }
2812
+ }
2813
+ registerOnChange(fn) {
2814
+ this.onChange = fn;
2815
+ }
2816
+ registerOnTouched(fn) {
2817
+ this.onTouch = fn;
2818
+ }
2819
+ setDisabledState(isDisabled) {
2820
+ this.disabled = isDisabled;
2821
+ }
2822
+ onStartDateChange(event) {
2823
+ if (event.value) {
2824
+ this.start = this.convertToLocalDateString(event.value, true); // true for start date
2825
+ }
2826
+ else {
2827
+ this.start = null;
2828
+ }
2829
+ this.emitDateChange();
2830
+ }
2831
+ onEndDateChange(event) {
2832
+ if (event.value) {
2833
+ this.end = this.convertToLocalDateString(event.value, false); // false for end date
2834
+ }
2835
+ else {
2836
+ this.end = null;
2837
+ }
2838
+ this.emitDateChange();
2839
+ }
2840
+ emitDateChange() {
2841
+ this.dateChange.emit({ start: this.start, end: this.end });
2842
+ this.onChange({ start: this.start, end: this.end });
2843
+ }
2844
+ //OFFSETDATE
2845
+ convertToLocalDateString(date, isStartDate) {
2846
+ if (!date) {
2847
+ return '';
2848
+ }
2849
+ // Use moment to handle both Moment and Date objects
2850
+ let momentDate = moment.isMoment(date) ? date : moment(date);
2851
+ // Set time to the start or end of the day based on the isStartDate flag
2852
+ if (isStartDate) {
2853
+ momentDate = momentDate.startOf('day');
2854
+ }
2855
+ else {
2856
+ momentDate = momentDate.endOf('day');
2857
+ }
2858
+ // Format date with timezone offset
2859
+ return momentDate.format('YYYY-MM-DDTHH:mm:ssZ'); // This will include the offset
2860
+ }
2861
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputDatePickerRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2862
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: InputDatePickerRangeComponent, isStandalone: true, selector: "ptech-input-date-picker-range", inputs: { disabled: "disabled", label: "label", required: "required", loading: "loading", firstPlaceholder: "firstPlaceholder", secondPlaceholder: "secondPlaceholder", hint: "hint", appearance: "appearance" }, outputs: { dateChange: "dateChange" }, providers: [
2863
+ {
2864
+ provide: NG_VALUE_ACCESSOR,
2865
+ useExisting: forwardRef(() => InputDatePickerRangeComponent),
2866
+ multi: true
2867
+ }
2868
+ ], ngImport: i0, template: "<mat-form-field [appearance]=\"appearance\" class=\"input-date-container\">\n <mat-label>{{ label }}</mat-label>\n <mat-date-range-input [rangePicker]=\"picker\" [disabled]=\"disabled\">\n <input\n matStartDate\n [placeholder]=\"firstPlaceholder\"\n [required]=\"required\"\n (dateChange)=\"onStartDateChange($event)\"\n />\n <input\n matEndDate\n [placeholder]=\"secondPlaceholder\"\n [required]=\"required\"\n (dateChange)=\"onEndDateChange($event)\"\n />\n </mat-date-range-input>\n <mat-hint *ngIf=\"hint\">{{ hint }}</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n <mat-spinner\n matPrefix\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n diameter=\"17\"\n ></mat-spinner>\n</mat-form-field>\n", styles: [".input-date-container{display:flex;flex-direction:column;width:100%}.mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: CoreMaterialModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i3$3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i3$3.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3$3.MatStartDate, selector: "input[matStartDate]", outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3$3.MatEndDate, selector: "input[matEndDate]", outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3$3.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i8.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
2869
+ }
2870
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: InputDatePickerRangeComponent, decorators: [{
2871
+ type: Component,
2872
+ args: [{ selector: 'ptech-input-date-picker-range', standalone: true, imports: [
2873
+ CoreMaterialModule
2874
+ ], providers: [
2875
+ {
2876
+ provide: NG_VALUE_ACCESSOR,
2877
+ useExisting: forwardRef(() => InputDatePickerRangeComponent),
2878
+ multi: true
2879
+ }
2880
+ ], template: "<mat-form-field [appearance]=\"appearance\" class=\"input-date-container\">\n <mat-label>{{ label }}</mat-label>\n <mat-date-range-input [rangePicker]=\"picker\" [disabled]=\"disabled\">\n <input\n matStartDate\n [placeholder]=\"firstPlaceholder\"\n [required]=\"required\"\n (dateChange)=\"onStartDateChange($event)\"\n />\n <input\n matEndDate\n [placeholder]=\"secondPlaceholder\"\n [required]=\"required\"\n (dateChange)=\"onEndDateChange($event)\"\n />\n </mat-date-range-input>\n <mat-hint *ngIf=\"hint\">{{ hint }}</mat-hint>\n <mat-datepicker-toggle matIconSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n <mat-spinner\n matPrefix\n *ngIf=\"loading\"\n mode=\"indeterminate\"\n diameter=\"17\"\n ></mat-spinner>\n</mat-form-field>\n", styles: [".input-date-container{display:flex;flex-direction:column;width:100%}.mat-form-field{width:100%}\n"] }]
2881
+ }], propDecorators: { disabled: [{
2882
+ type: Input
2883
+ }], label: [{
2884
+ type: Input
2885
+ }], required: [{
2886
+ type: Input
2887
+ }], loading: [{
2888
+ type: Input
2889
+ }], firstPlaceholder: [{
2890
+ type: Input
2891
+ }], secondPlaceholder: [{
2892
+ type: Input
2893
+ }], hint: [{
2894
+ type: Input
2895
+ }], appearance: [{
2896
+ type: Input
2897
+ }], dateChange: [{
2898
+ type: Output
2899
+ }] } });
2900
+
2901
+ class SnackbarMessageService {
2902
+ snackBar;
2903
+ constructor(snackBar) {
2904
+ this.snackBar = snackBar;
2905
+ }
2906
+ openSnackBar(data) {
2907
+ this.snackBar.openFromComponent(AlertComponent, {
2908
+ data,
2909
+ duration: data.duration ?? 3000,
2910
+ horizontalPosition: 'end',
2911
+ verticalPosition: 'top',
2912
+ panelClass: [data.type],
2913
+ });
2914
+ }
2915
+ successMessage(title, message, details, timestamp, duration) {
2916
+ this.openSnackBar({
2917
+ title,
2918
+ message,
2919
+ details,
2920
+ icon: 'check_circle',
2921
+ type: 'success',
2922
+ timestamp,
2923
+ duration,
2924
+ });
2925
+ }
2926
+ errorMessage(title, message, details, timestamp, duration) {
2927
+ this.openSnackBar({
2928
+ title,
2929
+ message,
2930
+ details,
2931
+ icon: 'error_outline',
2932
+ type: 'error',
2933
+ timestamp,
2934
+ duration,
2935
+ });
2936
+ }
2937
+ warnMessage(title, message, details, timestamp, duration) {
2938
+ this.openSnackBar({
2939
+ title,
2940
+ message,
2941
+ details,
2942
+ icon: 'warning',
2943
+ type: 'warn',
2944
+ timestamp,
2945
+ duration,
2946
+ });
2947
+ }
2948
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SnackbarMessageService, deps: [{ token: i1$4.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
2949
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SnackbarMessageService });
2950
+ }
2951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SnackbarMessageService, decorators: [{
2952
+ type: Injectable
2953
+ }], ctorParameters: () => [{ type: i1$4.MatSnackBar }] });
2954
+
2955
+ // src/lib/modules/pumpkin-tech.module.ts
2956
+ class PumpkinTechModule {
2957
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PumpkinTechModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2958
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PumpkinTechModule, imports: [CommonModule,
2959
+ CoreMaterialModule,
2960
+ // standalone components para reexportar
2961
+ InputComponent,
2962
+ InputDatePickerRangeComponent,
2963
+ InfoDetailComponent,
2964
+ InfoDetailDialogComponent,
2965
+ ActionDialogComponent,
2966
+ ActionResultDialogComponent,
2967
+ ButtonComponent,
2968
+ BreadcrumbComponent,
2969
+ TitleComponent,
2970
+ ActionRowComponent,
2971
+ HeaderComponent,
2972
+ NavComponent,
2973
+ FooterComponent,
2974
+ IconComponent,
2975
+ SelectEntityComponent,
2976
+ SelectEnumComponent,
2977
+ RadioGroupComponent,
2978
+ RadioGroupEntityComponent,
2979
+ SlideToggleComponent,
2980
+ QuantityItemsComponent,
2981
+ LoadingOverlayComponent,
2982
+ ProfileMenuComponent,
2983
+ CheckBoxComponent,
2984
+ ProgressBarComponent,
2985
+ ProgressBarMultipleComponent], exports: [
2986
+ // reexporta tudo junto
2987
+ InputComponent,
2988
+ InputDatePickerRangeComponent,
2989
+ InfoDetailComponent,
2990
+ InfoDetailDialogComponent,
2991
+ ActionDialogComponent,
2992
+ ActionResultDialogComponent,
2993
+ ButtonComponent,
2994
+ BreadcrumbComponent,
2995
+ TitleComponent,
2996
+ ActionRowComponent,
2997
+ HeaderComponent,
2998
+ NavComponent,
2999
+ FooterComponent,
3000
+ IconComponent,
3001
+ SelectEntityComponent,
3002
+ SelectEnumComponent,
3003
+ RadioGroupComponent,
3004
+ RadioGroupEntityComponent,
3005
+ SlideToggleComponent,
3006
+ QuantityItemsComponent,
3007
+ LoadingOverlayComponent,
3008
+ ProfileMenuComponent,
3009
+ CheckBoxComponent,
3010
+ ProgressBarComponent,
3011
+ ProgressBarMultipleComponent,
3012
+ CoreMaterialModule] });
3013
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PumpkinTechModule, providers: [
3014
+ {
3015
+ provide: MESSAGE_SERVICE,
3016
+ useValue: SnackbarMessageService,
3017
+ },
3018
+ ], imports: [CommonModule,
3019
+ CoreMaterialModule,
3020
+ // standalone components para reexportar
3021
+ InputComponent,
3022
+ InputDatePickerRangeComponent,
3023
+ InfoDetailComponent,
3024
+ InfoDetailDialogComponent,
3025
+ ActionDialogComponent,
3026
+ ActionResultDialogComponent,
3027
+ ButtonComponent,
3028
+ BreadcrumbComponent,
3029
+ TitleComponent,
3030
+ HeaderComponent,
3031
+ NavComponent,
3032
+ FooterComponent,
3033
+ IconComponent,
3034
+ SelectEntityComponent,
3035
+ SelectEnumComponent,
3036
+ RadioGroupComponent,
3037
+ RadioGroupEntityComponent,
3038
+ SlideToggleComponent,
3039
+ QuantityItemsComponent,
3040
+ LoadingOverlayComponent,
3041
+ ProfileMenuComponent,
3042
+ CheckBoxComponent,
3043
+ ProgressBarComponent,
3044
+ ProgressBarMultipleComponent, CoreMaterialModule] });
3045
+ }
3046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PumpkinTechModule, decorators: [{
3047
+ type: NgModule,
3048
+ args: [{
3049
+ imports: [
3050
+ CommonModule,
3051
+ CoreMaterialModule,
3052
+ // standalone components para reexportar
3053
+ InputComponent,
3054
+ InputDatePickerRangeComponent,
3055
+ InfoDetailComponent,
3056
+ InfoDetailDialogComponent,
3057
+ ActionDialogComponent,
3058
+ ActionResultDialogComponent,
3059
+ ButtonComponent,
3060
+ BreadcrumbComponent,
3061
+ TitleComponent,
3062
+ ActionRowComponent,
3063
+ HeaderComponent,
3064
+ NavComponent,
3065
+ FooterComponent,
3066
+ IconComponent,
3067
+ SelectEntityComponent,
3068
+ SelectEnumComponent,
3069
+ RadioGroupComponent,
3070
+ RadioGroupEntityComponent,
3071
+ SlideToggleComponent,
3072
+ QuantityItemsComponent,
3073
+ LoadingOverlayComponent,
3074
+ ProfileMenuComponent,
3075
+ CheckBoxComponent,
3076
+ ProgressBarComponent,
3077
+ ProgressBarMultipleComponent
3078
+ ],
3079
+ exports: [
3080
+ // reexporta tudo junto
3081
+ InputComponent,
3082
+ InputDatePickerRangeComponent,
3083
+ InfoDetailComponent,
3084
+ InfoDetailDialogComponent,
3085
+ ActionDialogComponent,
3086
+ ActionResultDialogComponent,
3087
+ ButtonComponent,
3088
+ BreadcrumbComponent,
3089
+ TitleComponent,
3090
+ ActionRowComponent,
3091
+ HeaderComponent,
3092
+ NavComponent,
3093
+ FooterComponent,
3094
+ IconComponent,
3095
+ SelectEntityComponent,
3096
+ SelectEnumComponent,
3097
+ RadioGroupComponent,
3098
+ RadioGroupEntityComponent,
3099
+ SlideToggleComponent,
3100
+ QuantityItemsComponent,
3101
+ LoadingOverlayComponent,
3102
+ ProfileMenuComponent,
3103
+ CheckBoxComponent,
3104
+ ProgressBarComponent,
3105
+ ProgressBarMultipleComponent,
3106
+ CoreMaterialModule,
3107
+ ],
3108
+ providers: [
3109
+ {
3110
+ provide: MESSAGE_SERVICE,
3111
+ useValue: SnackbarMessageService,
3112
+ },
3113
+ ],
3114
+ }]
3115
+ }] });
3116
+
3117
+ class UpperCaseDirective {
3118
+ ngControl;
3119
+ enabledUpperCase = false;
3120
+ constructor(ngControl) {
3121
+ this.ngControl = ngControl;
3122
+ }
3123
+ onModelChange(event) {
3124
+ this.apply(event);
3125
+ }
3126
+ onInput(event) {
3127
+ const target = event.target;
3128
+ this.apply(target.value);
3129
+ }
3130
+ apply(value) {
3131
+ if (this.enabledUpperCase && this.ngControl?.valueAccessor) {
3132
+ const transformed = (value ?? '').toUpperCase();
3133
+ this.ngControl.valueAccessor.writeValue(transformed);
3134
+ if (this.ngControl.control) {
3135
+ this.ngControl.control.setValue(transformed, { emitEvent: false });
3136
+ }
3137
+ }
3138
+ }
3139
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpperCaseDirective, deps: [{ token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3140
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: UpperCaseDirective, isStandalone: true, selector: "[ptechUpperCase]", inputs: { enabledUpperCase: ["ptechUpperCase", "enabledUpperCase"] }, host: { listeners: { "ngModelChange": "onModelChange($event)", "input": "onInput($event)" } }, ngImport: i0 });
3141
+ }
3142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UpperCaseDirective, decorators: [{
3143
+ type: Directive,
3144
+ args: [{
3145
+ selector: '[ptechUpperCase]',
3146
+ standalone: true,
3147
+ }]
3148
+ }], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
3149
+ type: Optional
3150
+ }] }], propDecorators: { enabledUpperCase: [{
3151
+ type: Input,
3152
+ args: ['ptechUpperCase']
3153
+ }], onModelChange: [{
3154
+ type: HostListener,
3155
+ args: ['ngModelChange', ['$event']]
3156
+ }], onInput: [{
3157
+ type: HostListener,
3158
+ args: ['input', ['$event']]
3159
+ }] } });
3160
+
3161
+ class LowerCaseDirective {
3162
+ ngControl;
3163
+ enabledLowerCase = false;
3164
+ constructor(ngControl) {
3165
+ this.ngControl = ngControl;
3166
+ }
3167
+ onModelChange(event) {
3168
+ this.apply(event);
3169
+ }
3170
+ onInput(event) {
3171
+ const target = event.target;
3172
+ this.apply(target.value);
3173
+ }
3174
+ apply(value) {
3175
+ if (this.enabledLowerCase && this.ngControl?.valueAccessor) {
3176
+ const transformed = (value ?? '').toLowerCase();
3177
+ this.ngControl.valueAccessor.writeValue(transformed);
3178
+ if (this.ngControl.control) {
3179
+ this.ngControl.control.setValue(transformed, { emitEvent: false });
3180
+ }
3181
+ }
3182
+ }
3183
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowerCaseDirective, deps: [{ token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3184
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: LowerCaseDirective, isStandalone: true, selector: "[ptechLowerCase]", inputs: { enabledLowerCase: ["ptechLowerCase", "enabledLowerCase"] }, host: { listeners: { "ngModelChange": "onModelChange($event)", "input": "onInput($event)" } }, ngImport: i0 });
3185
+ }
3186
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LowerCaseDirective, decorators: [{
3187
+ type: Directive,
3188
+ args: [{
3189
+ selector: '[ptechLowerCase]',
3190
+ standalone: true,
3191
+ }]
3192
+ }], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
3193
+ type: Optional
3194
+ }] }], propDecorators: { enabledLowerCase: [{
3195
+ type: Input,
3196
+ args: ['ptechLowerCase']
3197
+ }], onModelChange: [{
3198
+ type: HostListener,
3199
+ args: ['ngModelChange', ['$event']]
3200
+ }], onInput: [{
3201
+ type: HostListener,
3202
+ args: ['input', ['$event']]
3203
+ }] } });
3204
+
3205
+ class RedDirective {
3206
+ el;
3207
+ renderer;
3208
+ constructor(el, renderer) {
3209
+ this.el = el;
3210
+ this.renderer = renderer;
3211
+ this.renderer.setStyle(this.el.nativeElement, 'color', '#e35e6b');
3212
+ }
3213
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
3214
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: RedDirective, isStandalone: true, selector: "[ptechRed]", ngImport: i0 });
3215
+ }
3216
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RedDirective, decorators: [{
3217
+ type: Directive,
3218
+ args: [{
3219
+ selector: '[ptechRed]',
3220
+ standalone: true,
3221
+ }]
3222
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
3223
+
3224
+ class ClickCatcherDirective {
3225
+ onClick(id) {
3226
+ alert(`You clicked on ${id}`);
3227
+ }
3228
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClickCatcherDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3229
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ClickCatcherDirective, isStandalone: true, selector: "[ptechClickCatcher]", host: { listeners: { "click": "onClick($event.target.id)" } }, ngImport: i0 });
3230
+ }
3231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ClickCatcherDirective, decorators: [{
3232
+ type: Directive,
3233
+ args: [{
3234
+ selector: '[ptechClickCatcher]',
3235
+ standalone: true,
3236
+ }]
3237
+ }], propDecorators: { onClick: [{
3238
+ type: HostListener,
3239
+ args: ['click', ['$event.target.id']]
3240
+ }] } });
3241
+
3242
+ class ForDirective {
3243
+ container;
3244
+ template;
3245
+ numbers = [];
3246
+ constructor(container, template) {
3247
+ this.container = container;
3248
+ this.template = template;
3249
+ }
3250
+ ngOnChanges(changes) {
3251
+ if (changes['numbers']) {
3252
+ this.render();
3253
+ }
3254
+ }
3255
+ render() {
3256
+ this.container.clear();
3257
+ for (const item of this.numbers) {
3258
+ this.container.createEmbeddedView(this.template, { $implicit: item });
3259
+ }
3260
+ }
3261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ForDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
3262
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: ForDirective, isStandalone: true, selector: "[ptechFor]", inputs: { numbers: ["ptechForEm", "numbers"] }, usesOnChanges: true, ngImport: i0 });
3263
+ }
3264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ForDirective, decorators: [{
3265
+ type: Directive,
3266
+ args: [{
3267
+ selector: '[ptechFor]',
3268
+ standalone: true,
3269
+ }]
3270
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { numbers: [{
3271
+ type: Input,
3272
+ args: ['ptechForEm']
3273
+ }] } });
3274
+
3275
+ class SpaceDropDirective {
3276
+ ngControl;
3277
+ enabled = false;
3278
+ constructor(ngControl) {
3279
+ this.ngControl = ngControl;
3280
+ }
3281
+ onModelChange(value) {
3282
+ this.apply(value);
3283
+ }
3284
+ onInput(event) {
3285
+ const target = event.target;
3286
+ this.apply(target.value);
3287
+ }
3288
+ apply(value) {
3289
+ if (!this.enabled || !this.ngControl?.valueAccessor)
3290
+ return;
3291
+ const transformed = (value ?? '').replace(/\s/g, '');
3292
+ this.ngControl.valueAccessor.writeValue(transformed);
3293
+ if (this.ngControl.control) {
3294
+ this.ngControl.control.setValue(transformed, { emitEvent: false });
3295
+ }
3296
+ }
3297
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpaceDropDirective, deps: [{ token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3298
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: SpaceDropDirective, isStandalone: true, selector: "[ptechSpaceDrop]", inputs: { enabled: ["ptechSpaceDrop", "enabled"] }, host: { listeners: { "ngModelChange": "onModelChange($event)", "input": "onInput($event)" } }, ngImport: i0 });
3299
+ }
3300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: SpaceDropDirective, decorators: [{
3301
+ type: Directive,
3302
+ args: [{
3303
+ selector: '[ptechSpaceDrop]',
3304
+ standalone: true,
3305
+ }]
3306
+ }], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
3307
+ type: Optional
3308
+ }] }], propDecorators: { enabled: [{
3309
+ type: Input,
3310
+ args: ['ptechSpaceDrop']
3311
+ }], onModelChange: [{
3312
+ type: HostListener,
3313
+ args: ['ngModelChange', ['$event']]
3314
+ }], onInput: [{
3315
+ type: HostListener,
3316
+ args: ['input', ['$event']]
3317
+ }] } });
3318
+
3319
+ class DateMaskDirective {
3320
+ onInputChange(event) {
3321
+ const input = event.target;
3322
+ const maskedValue = this.applyMask(input.value);
3323
+ if (input.value !== maskedValue) {
3324
+ input.value = maskedValue;
3325
+ event.stopImmediatePropagation();
3326
+ }
3327
+ }
3328
+ onKeyDown(event) {
3329
+ const input = event.target;
3330
+ let { value } = input;
3331
+ const selectionStart = input.selectionStart ?? 0;
3332
+ const selectionEnd = input.selectionEnd ?? 0;
3333
+ if (event.key === 'Backspace' || event.key === 'Delete') {
3334
+ event.preventDefault();
3335
+ let newSelectionStart = selectionStart - (event.key === 'Backspace' ? 1 : 0);
3336
+ if (newSelectionStart < 0)
3337
+ newSelectionStart = 0;
3338
+ const newValue = value.slice(0, newSelectionStart) + value.slice(selectionEnd);
3339
+ const masked = this.applyMask(newValue);
3340
+ input.value = masked;
3341
+ input.setSelectionRange(newSelectionStart, newSelectionStart);
3342
+ }
3343
+ }
3344
+ applyMask(value) {
3345
+ const nums = value.replace(/\D/g, '');
3346
+ const parts = nums.match(/(\d{0,2})(\d{0,2})(\d{0,4})/);
3347
+ let result = '';
3348
+ if (parts) {
3349
+ if (parts[1])
3350
+ result += parts[1];
3351
+ if (parts[2])
3352
+ result += '/' + parts[2];
3353
+ if (parts[3])
3354
+ result += '/' + parts[3];
3355
+ }
3356
+ return result;
3357
+ }
3358
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3359
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DateMaskDirective, isStandalone: true, selector: "[ptechDateMask]", host: { listeners: { "input": "onInputChange($event)", "keydown": "onKeyDown($event)" } }, ngImport: i0 });
3360
+ }
3361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateMaskDirective, decorators: [{
3362
+ type: Directive,
3363
+ args: [{
3364
+ selector: '[ptechDateMask]',
3365
+ standalone: true,
3366
+ }]
3367
+ }], propDecorators: { onInputChange: [{
3368
+ type: HostListener,
3369
+ args: ['input', ['$event']]
3370
+ }], onKeyDown: [{
3371
+ type: HostListener,
3372
+ args: ['keydown', ['$event']]
3373
+ }] } });
3374
+
3375
+ class PhoneMaskBrazilDirective {
3376
+ ngControl;
3377
+ constructor(ngControl) {
3378
+ this.ngControl = ngControl;
3379
+ }
3380
+ onModelChange(event) {
3381
+ this.apply(event, false);
3382
+ }
3383
+ onBackspace(event) {
3384
+ if (event.target instanceof HTMLInputElement) {
3385
+ this.apply(event.target.value, true);
3386
+ }
3387
+ }
3388
+ apply(value, backspace) {
3389
+ if (!this.ngControl?.valueAccessor)
3390
+ return;
3391
+ let newVal = (value || '').replace(/\D/g, '');
3392
+ if (backspace && newVal.length <= 6) {
3393
+ newVal = newVal.substring(0, newVal.length - 1);
3394
+ }
3395
+ if (newVal.length === 0) {
3396
+ newVal = '';
3397
+ }
3398
+ else if (newVal.length <= 3) {
3399
+ newVal = newVal.replace(/^(\d{0,2})/, '($1)');
3400
+ }
3401
+ else if (newVal.length <= 6) {
3402
+ newVal = newVal.replace(/^(\d{0,2})(\d{0,4})/, '($1) $2');
3403
+ }
3404
+ else if (newVal.length <= 10) {
3405
+ newVal = newVal.replace(/^(\d{0,2})(\d{0,4})(\d{0,4})/, '($1) $2-$3');
3406
+ }
3407
+ else {
3408
+ newVal = newVal.substring(0, 10);
3409
+ newVal = newVal.replace(/^(\d{0,2})(\d{0,4})(\d{0,4})/, '($1) $2-$3');
3410
+ }
3411
+ this.ngControl.valueAccessor.writeValue(newVal);
3412
+ if (this.ngControl.control) {
3413
+ this.ngControl.control.setValue(newVal, { emitEvent: false });
3414
+ }
3415
+ }
3416
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneMaskBrazilDirective, deps: [{ token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3417
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: PhoneMaskBrazilDirective, isStandalone: true, selector: "[ptechPhoneMaskBrazil]", host: { listeners: { "ngModelChange": "onModelChange($event)", "keydown.backspace": "onBackspace($event)" } }, ngImport: i0 });
3418
+ }
3419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneMaskBrazilDirective, decorators: [{
3420
+ type: Directive,
3421
+ args: [{
3422
+ selector: '[ptechPhoneMaskBrazil]',
3423
+ standalone: true,
3424
+ }]
3425
+ }], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
3426
+ type: Optional
3427
+ }] }], propDecorators: { onModelChange: [{
3428
+ type: HostListener,
3429
+ args: ['ngModelChange', ['$event']]
3430
+ }], onBackspace: [{
3431
+ type: HostListener,
3432
+ args: ['keydown.backspace', ['$event']]
3433
+ }] } });
3434
+
3435
+ class PhoneMaskSpainDirective {
3436
+ ngControl;
3437
+ constructor(ngControl) {
3438
+ this.ngControl = ngControl;
3439
+ }
3440
+ onModelChange(event) {
3441
+ this.apply(event, false);
3442
+ }
3443
+ onBackspace(event) {
3444
+ if (event.target instanceof HTMLInputElement) {
3445
+ this.apply(event.target.value, true);
3446
+ }
3447
+ }
3448
+ apply(value, backspace) {
3449
+ if (!this.ngControl?.valueAccessor)
3450
+ return;
3451
+ let newVal = (value || '').replace(/\D/g, '');
3452
+ if (backspace && newVal.length > 0) {
3453
+ newVal = newVal.substring(0, newVal.length - 1);
3454
+ }
3455
+ if (newVal.length === 0) {
3456
+ newVal = '';
3457
+ }
3458
+ else if (newVal.length <= 9) {
3459
+ newVal = newVal.replace(/(\d{3})(\d{3})(\d{3})?/, (match, g1, g2, g3) => {
3460
+ let out = `${g1} ${g2}`;
3461
+ if (g3)
3462
+ out += ` ${g3}`;
3463
+ return out.trim();
3464
+ });
3465
+ }
3466
+ else if (newVal.length <= 11) {
3467
+ newVal = newVal.replace(/(\d{2})(\d{3})(\d{3})(\d{3})/, '($1) $2 $3 $4');
3468
+ }
3469
+ else {
3470
+ newVal = newVal.substring(0, 11);
3471
+ newVal = newVal.replace(/(\d{2})(\d{3})(\d{3})(\d{3})/, '($1) $2 $3 $4');
3472
+ }
3473
+ this.ngControl.valueAccessor.writeValue(newVal);
3474
+ if (this.ngControl.control) {
3475
+ this.ngControl.control.setValue(newVal, { emitEvent: false });
3476
+ }
3477
+ }
3478
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneMaskSpainDirective, deps: [{ token: i2.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
3479
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: PhoneMaskSpainDirective, isStandalone: true, selector: "[ptechPhoneMaskSpain]", host: { listeners: { "ngModelChange": "onModelChange($event)", "keydown.backspace": "onBackspace($event)" } }, ngImport: i0 });
3480
+ }
3481
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneMaskSpainDirective, decorators: [{
3482
+ type: Directive,
3483
+ args: [{
3484
+ selector: '[ptechPhoneMaskSpain]',
3485
+ standalone: true,
3486
+ }]
3487
+ }], ctorParameters: () => [{ type: i2.NgControl, decorators: [{
3488
+ type: Optional
3489
+ }] }], propDecorators: { onModelChange: [{
3490
+ type: HostListener,
3491
+ args: ['ngModelChange', ['$event']]
3492
+ }], onBackspace: [{
3493
+ type: HostListener,
3494
+ args: ['keydown.backspace', ['$event']]
3495
+ }] } });
3496
+
3497
+ class DynamicTabDirective {
3498
+ viewContainer;
3499
+ constructor(viewContainer) {
3500
+ this.viewContainer = viewContainer;
3501
+ }
3502
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DynamicTabDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
3503
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: DynamicTabDirective, isStandalone: true, selector: "[ptechDynamicTab]", ngImport: i0 });
3504
+ }
3505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DynamicTabDirective, decorators: [{
3506
+ type: Directive,
3507
+ args: [{
3508
+ selector: '[ptechDynamicTab]',
3509
+ standalone: true,
3510
+ }]
3511
+ }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
3512
+
3513
+ class DirectivesModule {
3514
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3515
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: DirectivesModule, imports: [UpperCaseDirective,
3516
+ LowerCaseDirective,
3517
+ RedDirective,
3518
+ ClickCatcherDirective,
3519
+ ForDirective,
3520
+ PhoneMaskBrazilDirective,
3521
+ PhoneMaskSpainDirective,
3522
+ SpaceDropDirective,
3523
+ DateMaskDirective,
3524
+ DynamicTabDirective], exports: [UpperCaseDirective,
3525
+ LowerCaseDirective,
3526
+ RedDirective,
3527
+ ClickCatcherDirective,
3528
+ ForDirective,
3529
+ PhoneMaskBrazilDirective,
3530
+ PhoneMaskSpainDirective,
3531
+ SpaceDropDirective,
3532
+ DateMaskDirective,
3533
+ DynamicTabDirective] });
3534
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DirectivesModule });
3535
+ }
3536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DirectivesModule, decorators: [{
3537
+ type: NgModule,
3538
+ args: [{
3539
+ imports: [
3540
+ UpperCaseDirective,
3541
+ LowerCaseDirective,
3542
+ RedDirective,
3543
+ ClickCatcherDirective,
3544
+ ForDirective,
3545
+ PhoneMaskBrazilDirective,
3546
+ PhoneMaskSpainDirective,
3547
+ SpaceDropDirective,
3548
+ DateMaskDirective,
3549
+ DynamicTabDirective
3550
+ ],
3551
+ exports: [
3552
+ UpperCaseDirective,
3553
+ LowerCaseDirective,
3554
+ RedDirective,
3555
+ ClickCatcherDirective,
3556
+ ForDirective,
3557
+ PhoneMaskBrazilDirective,
3558
+ PhoneMaskSpainDirective,
3559
+ SpaceDropDirective,
3560
+ DateMaskDirective,
3561
+ DynamicTabDirective
3562
+ ]
3563
+ }]
3564
+ }] });
3565
+
3566
+ class CurrencyBrlPipe {
3567
+ currencyPipe = inject(CurrencyPipe);
3568
+ transform(value, symbolDisplay = true) {
3569
+ if (value === null || value === undefined || value === '') {
3570
+ return null;
3571
+ }
3572
+ const numeric = typeof value === 'number' ? value : parseFloat(String(value).replace(',', '.'));
3573
+ if (isNaN(numeric)) {
3574
+ return null;
3575
+ }
3576
+ return this.currencyPipe.transform(numeric, 'BRL', symbolDisplay ? 'symbol' : 'code', '1.2-2', 'pt-BR');
3577
+ }
3578
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrencyBrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3579
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: CurrencyBrlPipe, isStandalone: true, name: "currencybrl" });
3580
+ }
3581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrencyBrlPipe, decorators: [{
3582
+ type: Pipe,
3583
+ args: [{
3584
+ name: 'currencybrl',
3585
+ standalone: true,
3586
+ pure: true
3587
+ }]
3588
+ }] });
3589
+
3590
+ class DateAgoPipe {
3591
+ intervals = {
3592
+ ano: 31536000,
3593
+ mês: 2592000,
3594
+ semana: 604800,
3595
+ dia: 86400,
3596
+ hora: 3600,
3597
+ minuto: 60,
3598
+ segundo: 1,
3599
+ };
3600
+ transform(value) {
3601
+ if (!value)
3602
+ return '';
3603
+ const date = new Date(String(value));
3604
+ if (isNaN(date.getTime()))
3605
+ return '';
3606
+ const seconds = Math.floor((Date.now() - date.getTime()) / 1000);
3607
+ if (seconds < 0) {
3608
+ return 'agora mesmo';
3609
+ }
3610
+ if (seconds < 29) {
3611
+ return 'agora mesmo';
3612
+ }
3613
+ for (const key of Object.keys(this.intervals)) {
3614
+ const intervalSec = this.intervals[key];
3615
+ const counter = Math.floor(seconds / intervalSec);
3616
+ if (counter > 0) {
3617
+ if (counter === 1) {
3618
+ return `${counter} ${key} atrás`;
3619
+ }
3620
+ else {
3621
+ // pluralização simples (mês -> meses)
3622
+ let pluralKey = key;
3623
+ if (key === 'mês')
3624
+ pluralKey = 'meses';
3625
+ else if (key === 'ano')
3626
+ pluralKey = 'anos';
3627
+ else if (!pluralKey.endsWith('s'))
3628
+ pluralKey = `${pluralKey}s`;
3629
+ return `${counter} ${pluralKey} atrás`;
3630
+ }
3631
+ }
3632
+ }
3633
+ return 'agora mesmo';
3634
+ }
3635
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateAgoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3636
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: DateAgoPipe, isStandalone: true, name: "dateAgo" });
3637
+ }
3638
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DateAgoPipe, decorators: [{
3639
+ type: Pipe,
3640
+ args: [{
3641
+ name: 'dateAgo',
3642
+ standalone: true,
3643
+ pure: true
3644
+ }]
3645
+ }] });
3646
+
3647
+ class LineBreakAfterPeriodPipe {
3648
+ transform(value) {
3649
+ if (!value)
3650
+ return '';
3651
+ return value.replace(/\./g, '.<br>');
3652
+ }
3653
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPeriodPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3654
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPeriodPipe, isStandalone: true, name: "lineBreakAfterPeriod" });
3655
+ }
3656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPeriodPipe, decorators: [{
3657
+ type: Pipe,
3658
+ args: [{
3659
+ name: 'lineBreakAfterPeriod',
3660
+ standalone: true,
3661
+ pure: true
3662
+ }]
3663
+ }] });
3664
+
3665
+ class LineBreakAfterPipe {
3666
+ transform(value, lettersPerLine = 30) {
3667
+ if (!value)
3668
+ return '';
3669
+ if (lettersPerLine <= 0)
3670
+ return value;
3671
+ let result = '';
3672
+ for (let i = 0; i < value.length; i += lettersPerLine) {
3673
+ result += value.slice(i, i + lettersPerLine);
3674
+ if (i + lettersPerLine < value.length) {
3675
+ result += '<br>';
3676
+ }
3677
+ }
3678
+ return result;
3679
+ }
3680
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3681
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPipe, isStandalone: true, name: "lineBreakAfter" });
3682
+ }
3683
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LineBreakAfterPipe, decorators: [{
3684
+ type: Pipe,
3685
+ args: [{
3686
+ name: 'lineBreakAfter',
3687
+ standalone: true,
3688
+ pure: true
3689
+ }]
3690
+ }] });
3691
+
3692
+ class MemoryFormatPipe {
3693
+ transform(value, unit = 'MB') {
3694
+ if (value === null || value === undefined || value === '')
3695
+ return '';
3696
+ let numeric = typeof value === 'string' ? parseFloat(value.replace(',', '.')) : value;
3697
+ if (isNaN(Number(numeric)))
3698
+ return '';
3699
+ numeric = Number(numeric);
3700
+ if (unit === 'MB') {
3701
+ if (numeric >= 1024) {
3702
+ const gb = numeric / 1024;
3703
+ return `${gb.toFixed(2)} GB`;
3704
+ }
3705
+ else {
3706
+ return `${numeric.toFixed(2)} MB`;
3707
+ }
3708
+ }
3709
+ else {
3710
+ return `${numeric.toFixed(2)} GB`;
3711
+ }
3712
+ }
3713
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemoryFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3714
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: MemoryFormatPipe, isStandalone: true, name: "memoryFormat" });
3715
+ }
3716
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MemoryFormatPipe, decorators: [{
3717
+ type: Pipe,
3718
+ args: [{
3719
+ name: 'memoryFormat',
3720
+ standalone: true,
3721
+ pure: true
3722
+ }]
3723
+ }] });
3724
+
3725
+ class PhoneBrazilPipe {
3726
+ transform(tel) {
3727
+ if (tel === null || tel === undefined || tel === '')
3728
+ return '';
3729
+ const value = String(tel).replace(/\D/g, '');
3730
+ let formatted = '';
3731
+ if (value.length > 12) {
3732
+ formatted = value.replace(/(\d{2})?(\d{2})?(\d{5})?(\d{4})/, '+$1 ($2) $3-$4');
3733
+ }
3734
+ else if (value.length > 11) {
3735
+ formatted = value.replace(/(\d{2})?(\d{2})?(\d{4})?(\d{4})/, '+$1 ($2) $3-$4');
3736
+ }
3737
+ else if (value.length > 10) {
3738
+ formatted = value.replace(/(\d{2})?(\d{5})?(\d{4})/, '($1) $2-$3');
3739
+ }
3740
+ else if (value.length > 9) {
3741
+ formatted = value.replace(/(\d{2})?(\d{4})?(\d{4})/, '($1) $2-$3');
3742
+ }
3743
+ else if (value.length > 5) {
3744
+ formatted = value.replace(/^(\d{2})?(\d{4})?(\d{0,4})/, '($1) $2-$3');
3745
+ }
3746
+ else if (value.length > 1) {
3747
+ formatted = value.replace(/^(\d{2})?(\d{0,5})/, '($1) $2');
3748
+ }
3749
+ else {
3750
+ formatted = value ? value.replace(/^(\d*)/, '($1') : '';
3751
+ }
3752
+ return formatted;
3753
+ }
3754
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneBrazilPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3755
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PhoneBrazilPipe, isStandalone: true, name: "phoneBrazil" });
3756
+ }
3757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneBrazilPipe, decorators: [{
3758
+ type: Pipe,
3759
+ args: [{
3760
+ name: 'phoneBrazil',
3761
+ standalone: true,
3762
+ pure: true
3763
+ }]
3764
+ }] });
3765
+
3766
+ class PhoneSpainPipe {
3767
+ transform(tel) {
3768
+ if (tel === null || tel === undefined || tel === '')
3769
+ return '';
3770
+ const value = String(tel).replace(/\D/g, '');
3771
+ let formatted = '';
3772
+ if (value.length === 11) {
3773
+ formatted = value.replace(/(\d{2})(\d{3})(\d{3})(\d{3})/, '($1) $2 $3 $4');
3774
+ }
3775
+ else if (value.length === 9) {
3776
+ formatted = value.replace(/(\d{3})(\d{3})(\d{3})/, '$1 $2 $3');
3777
+ }
3778
+ else if (value.length > 6) {
3779
+ formatted = `${value.substring(0, 3)} ${value.substring(3, 6)} ${value.substring(6)}`;
3780
+ }
3781
+ else if (value.length > 3) {
3782
+ formatted = `${value.substring(0, 3)} ${value.substring(3)}`;
3783
+ }
3784
+ else {
3785
+ formatted = value;
3786
+ }
3787
+ return formatted;
3788
+ }
3789
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneSpainPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3790
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PhoneSpainPipe, isStandalone: true, name: "phoneSpain" });
3791
+ }
3792
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PhoneSpainPipe, decorators: [{
3793
+ type: Pipe,
3794
+ args: [{
3795
+ name: 'phoneSpain',
3796
+ standalone: true,
3797
+ pure: true
3798
+ }]
3799
+ }] });
3800
+
3801
+ class UptimeFormatPipe {
3802
+ transform(totalSeconds) {
3803
+ if (totalSeconds === null || totalSeconds === undefined || isNaN(Number(totalSeconds)) || Number(totalSeconds) < 0) {
3804
+ return '0 segundos';
3805
+ }
3806
+ let seconds = Math.floor(Number(totalSeconds));
3807
+ const days = Math.floor(seconds / 86400);
3808
+ seconds %= 86400;
3809
+ const hours = Math.floor(seconds / 3600);
3810
+ seconds %= 3600;
3811
+ const minutes = Math.floor(seconds / 60);
3812
+ const secs = seconds % 60;
3813
+ const parts = [];
3814
+ if (days)
3815
+ parts.push(`${days} dia${days > 1 ? 's' : ''}`);
3816
+ if (hours)
3817
+ parts.push(`${hours} hora${hours > 1 ? 's' : ''}`);
3818
+ if (minutes)
3819
+ parts.push(`${minutes} minuto${minutes > 1 ? 's' : ''}`);
3820
+ parts.push(`${secs} segundo${secs !== 1 ? 's' : ''}`);
3821
+ return parts.join(', ');
3822
+ }
3823
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UptimeFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3824
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: UptimeFormatPipe, isStandalone: true, name: "uptimeFormat" });
3825
+ }
3826
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: UptimeFormatPipe, decorators: [{
3827
+ type: Pipe,
3828
+ args: [{
3829
+ name: 'uptimeFormat',
3830
+ standalone: true,
3831
+ pure: true
3832
+ }]
3833
+ }] });
3834
+
3835
+ class TimeDurationPipe {
3836
+ transform(input) {
3837
+ if (input == null) {
3838
+ return '';
3839
+ }
3840
+ const creationDate = new Date(input);
3841
+ if (isNaN(creationDate.getTime())) {
3842
+ return 'Data inválida';
3843
+ }
3844
+ const now = new Date();
3845
+ let diffInSeconds = Math.floor((now.getTime() - creationDate.getTime()) / 1000);
3846
+ if (diffInSeconds < 0) {
3847
+ diffInSeconds = 0; // data no futuro: considera zero
3848
+ }
3849
+ const days = Math.floor(diffInSeconds / 86400);
3850
+ const hours = Math.floor((diffInSeconds % 86400) / 3600);
3851
+ const minutes = Math.floor((diffInSeconds % 3600) / 60);
3852
+ const pad = (n) => n.toString().padStart(2, '0');
3853
+ if (days > 0) {
3854
+ return `${days}d ${pad(hours)}:${pad(minutes)}`;
3855
+ }
3856
+ return `${pad(hours)}:${pad(minutes)}`;
3857
+ }
3858
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TimeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3859
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: TimeDurationPipe, name: "timeDuration" });
3860
+ }
3861
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TimeDurationPipe, decorators: [{
3862
+ type: Pipe,
3863
+ args: [{
3864
+ name: 'timeDuration',
3865
+ pure: true
3866
+ }]
3867
+ }] });
3868
+
3869
+ class PipesModule {
3870
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3871
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.13", ngImport: i0, type: PipesModule, imports: [CommonModule,
3872
+ CurrencyBrlPipe,
3873
+ DateAgoPipe,
3874
+ GetFirstStringBeforeSpacePipe,
3875
+ LineBreakAfterPeriodPipe,
3876
+ LineBreakAfterPipe,
3877
+ MemoryFormatPipe,
3878
+ PhoneBrazilPipe,
3879
+ PhoneSpainPipe,
3880
+ UptimeFormatPipe], exports: [CurrencyBrlPipe,
3881
+ DateAgoPipe,
3882
+ GetFirstStringBeforeSpacePipe,
3883
+ LineBreakAfterPeriodPipe,
3884
+ LineBreakAfterPipe,
3885
+ MemoryFormatPipe,
3886
+ PhoneBrazilPipe,
3887
+ PhoneSpainPipe,
3888
+ UptimeFormatPipe] });
3889
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PipesModule, providers: [CurrencyPipe], imports: [CommonModule] });
3890
+ }
3891
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PipesModule, decorators: [{
3892
+ type: NgModule,
3893
+ args: [{
3894
+ imports: [
3895
+ CommonModule,
3896
+ CurrencyBrlPipe,
3897
+ DateAgoPipe,
3898
+ GetFirstStringBeforeSpacePipe,
3899
+ LineBreakAfterPeriodPipe,
3900
+ LineBreakAfterPipe,
3901
+ MemoryFormatPipe,
3902
+ PhoneBrazilPipe,
3903
+ PhoneSpainPipe,
3904
+ UptimeFormatPipe,
3905
+ ],
3906
+ exports: [
3907
+ CurrencyBrlPipe,
3908
+ DateAgoPipe,
3909
+ GetFirstStringBeforeSpacePipe,
3910
+ LineBreakAfterPeriodPipe,
3911
+ LineBreakAfterPipe,
3912
+ MemoryFormatPipe,
3913
+ PhoneBrazilPipe,
3914
+ PhoneSpainPipe,
3915
+ UptimeFormatPipe,
3916
+ ],
3917
+ providers: [CurrencyPipe],
3918
+ }]
3919
+ }] });
3920
+
3921
+ // src/lib/services/dialog.service.ts
3922
+ class DialogService {
3923
+ dialog;
3924
+ constructor(dialog) {
3925
+ this.dialog = dialog;
3926
+ }
3927
+ open(model) {
3928
+ const config = {
3929
+ data: model.data,
3930
+ width: model.width,
3931
+ height: model.height,
3932
+ position: model.position,
3933
+ panelClass: model.panelClass,
3934
+ autoFocus: true,
3935
+ restoreFocus: false,
3936
+ disableClose: model.disableClose ?? false,
3937
+ };
3938
+ return this.dialog.open(model.component, config);
3939
+ }
3940
+ openInfo(arg, width = '800px') {
3941
+ return this.open({
3942
+ component: InfoDetailDialogComponent,
3943
+ data: {
3944
+ title: arg.title,
3945
+ content: arg.content,
3946
+ rawContent: arg.rawContent,
3947
+ },
3948
+ width,
3949
+ });
3950
+ }
3951
+ openActionDialog(config, width = '500px') {
3952
+ return this.open({
3953
+ component: ActionDialogComponent,
3954
+ data: config,
3955
+ width,
3956
+ });
3957
+ }
3958
+ openResultDialog(arg, width = '600px') {
3959
+ return this.open({
3960
+ component: ActionResultDialogComponent,
3961
+ data: arg,
3962
+ width,
3963
+ });
3964
+ }
3965
+ confirm(confirmation, width = '400px') {
3966
+ const ref = this.open({
3967
+ component: ConfirmationDialogComponent,
3968
+ data: confirmation,
3969
+ width,
3970
+ disableClose: true,
3971
+ });
3972
+ return ref.afterClosed().pipe(tap((isAccepted) => {
3973
+ if (isAccepted) {
3974
+ confirmation.accept();
3975
+ }
3976
+ }), map((isAccepted) => !!isAccepted));
3977
+ }
3978
+ /**
3979
+ * Abre um ActionDialog e, se houver resultado, usa o builder para criar
3980
+ * o ActionResultData e abre o resultado.
3981
+ * Retorna um observable que emite quando o fluxo completo terminou.
3982
+ */
3983
+ openActionThenResult(actionConfig, resultConfigBuilder) {
3984
+ return this.openActionDialog({ ...actionConfig, fields: actionConfig.fields ?? [] })
3985
+ .afterClosed()
3986
+ .pipe(filter((result) => !!result), tap((result) => {
3987
+ const resultData = resultConfigBuilder(result);
3988
+ this.openResultDialog(resultData);
3989
+ }), map(() => void 0));
3990
+ }
3991
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogService, deps: [{ token: i1$3.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
3992
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogService, providedIn: 'root' });
3993
+ }
3994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogService, decorators: [{
3995
+ type: Injectable,
3996
+ args: [{
3997
+ providedIn: 'root',
3998
+ }]
3999
+ }], ctorParameters: () => [{ type: i1$3.MatDialog }] });
4000
+
4001
+ class ModuleChangeService {
4002
+ moduleChangedSource = new BehaviorSubject('');
4003
+ moduleChanged$ = this.moduleChangedSource.asObservable();
4004
+ notifyModuleChange(lastModule) {
4005
+ this.moduleChangedSource.next(lastModule);
4006
+ }
4007
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModuleChangeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4008
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModuleChangeService, providedIn: 'root' });
4009
+ }
4010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ModuleChangeService, decorators: [{
4011
+ type: Injectable,
4012
+ args: [{
4013
+ providedIn: 'root',
4014
+ }]
4015
+ }] });
4016
+
4017
+ // currency-preference.service.ts
4018
+ const CURRENCY_KEY = 'currency_preference';
4019
+ const DEFAULT_CURRENCY = 'EUR';
4020
+ const CURRENCY_MAP = {
4021
+ EUR: {
4022
+ symbol: '€',
4023
+ thousandSeparator: '.',
4024
+ decimalMarker: ',',
4025
+ placeholder: '0,00',
4026
+ locale: 'de-DE', // uso de padrão europeu para vírgula decimal
4027
+ },
4028
+ USD: {
4029
+ symbol: '$',
4030
+ thousandSeparator: ',',
4031
+ decimalMarker: '.',
4032
+ placeholder: '0.00',
4033
+ locale: 'en-US',
4034
+ },
4035
+ BRL: {
4036
+ symbol: 'R$',
4037
+ thousandSeparator: '.',
4038
+ decimalMarker: ',',
4039
+ placeholder: '0,00',
4040
+ locale: 'pt-BR',
4041
+ },
4042
+ };
4043
+ class CurrencyPreferenceService {
4044
+ _currency = DEFAULT_CURRENCY;
4045
+ _subject = new BehaviorSubject(DEFAULT_CURRENCY);
4046
+ currency$ = this._subject.asObservable();
4047
+ constructor() {
4048
+ this.loadInitialCurrency();
4049
+ }
4050
+ loadInitialCurrency() {
4051
+ const stored = localStorage.getItem(CURRENCY_KEY);
4052
+ if (stored && this.isSupported(stored)) {
4053
+ this._setCurrencyInternal(stored);
4054
+ }
4055
+ else {
4056
+ // opcional: inferir da locale do navegador
4057
+ // const inferred = navigator.language.startsWith('pt') ? 'BRL' : 'EUR';
4058
+ this._setCurrencyInternal(this._currency);
4059
+ }
4060
+ }
4061
+ isSupported(code) {
4062
+ return code in CURRENCY_MAP;
4063
+ }
4064
+ _setCurrencyInternal(newCurrency) {
4065
+ this._currency = newCurrency;
4066
+ this._subject.next(newCurrency);
4067
+ }
4068
+ getCurrency() {
4069
+ return this._currency;
4070
+ }
4071
+ setCurrency(newCurrency) {
4072
+ if (!this.isSupported(newCurrency)) {
4073
+ console.warn(`Currency ${newCurrency} not supported. Falling back to default.`);
4074
+ newCurrency = DEFAULT_CURRENCY;
4075
+ }
4076
+ this._setCurrencyInternal(newCurrency);
4077
+ localStorage.setItem(CURRENCY_KEY, newCurrency);
4078
+ }
4079
+ getCurrencySymbol() {
4080
+ return CURRENCY_MAP[this._currency].symbol;
4081
+ }
4082
+ getThousandSeparator() {
4083
+ return CURRENCY_MAP[this._currency].thousandSeparator;
4084
+ }
4085
+ getDecimalMarker() {
4086
+ return CURRENCY_MAP[this._currency].decimalMarker;
4087
+ }
4088
+ getPlaceholder() {
4089
+ return CURRENCY_MAP[this._currency].placeholder;
4090
+ }
4091
+ formatAmount(value, options) {
4092
+ const meta = CURRENCY_MAP[this._currency];
4093
+ const formatter = new Intl.NumberFormat(meta.locale, {
4094
+ style: 'currency',
4095
+ currency: this._currency === 'BRL' ? 'BRL' : this._currency, // map if codes diferem
4096
+ minimumFractionDigits: options?.minimumFractionDigits ?? 2,
4097
+ maximumFractionDigits: options?.maximumFractionDigits ?? 2,
4098
+ currencyDisplay: options?.useSymbol === false ? 'code' : 'symbol',
4099
+ });
4100
+ return formatter.format(value);
4101
+ }
4102
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrencyPreferenceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4103
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrencyPreferenceService, providedIn: 'root' });
4104
+ }
4105
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: CurrencyPreferenceService, decorators: [{
4106
+ type: Injectable,
4107
+ args: [{
4108
+ providedIn: 'root',
4109
+ }]
4110
+ }], ctorParameters: () => [] });
4111
+
4112
+ /**
4113
+ * Se o app consumidor quiser inserir dinamicamente
4114
+ * o crumb de “módulo” (ou qualquer outro prefixo),
4115
+ * ele pode fornecer um Observable<BreadcrumbRoute[]> aqui.
4116
+ */
4117
+ const BREADCRUMB_PREFIX$ = new InjectionToken('BREADCRUMB_PREFIX$', { factory: () => of([]) } // default: nenhum prefixo
4118
+ );
4119
+
4120
+ class BreadcrumbService {
4121
+ router;
4122
+ prefix$;
4123
+ _crumbs = new BehaviorSubject([]);
4124
+ breadcrumbs$ = this._crumbs.asObservable();
4125
+ constructor(router, prefix$) {
4126
+ this.router = router;
4127
+ this.prefix$ = prefix$;
4128
+ this.router.events
4129
+ .pipe(filter$1(e => e instanceof NavigationEnd), switchMap(() => this.prefix$), switchMap(prefix => of(this.buildDynamicCrumbs(this.router.routerState.snapshot.root, prefix))))
4130
+ .subscribe(rawCrumbs => {
4131
+ // filtra duplicatas consecutivas
4132
+ const crumbs = rawCrumbs.filter((c, i, a) => i === 0 || c.description !== a[i - 1].description);
4133
+ this._crumbs.next(crumbs);
4134
+ });
4135
+ }
4136
+ buildDynamicCrumbs(node, acc) {
4137
+ const crumbs = [...acc];
4138
+ if (node.data['breadcrumb']) {
4139
+ const path = '/' + node.pathFromRoot
4140
+ .map(r => r.url.map(s => s.path).join('/'))
4141
+ .filter(p => p)
4142
+ .join('/');
4143
+ crumbs.push({ description: node.data['breadcrumb'], route: path });
4144
+ }
4145
+ for (const child of node.children) {
4146
+ return this.buildDynamicCrumbs(child, crumbs);
4147
+ }
4148
+ return crumbs;
4149
+ }
4150
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbService, deps: [{ token: i2$2.Router }, { token: BREADCRUMB_PREFIX$, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
4151
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
4152
+ }
4153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BreadcrumbService, decorators: [{
4154
+ type: Injectable,
4155
+ args: [{ providedIn: 'root' }]
4156
+ }], ctorParameters: () => [{ type: i2$2.Router }, { type: i2$4.Observable, decorators: [{
4157
+ type: Optional
4158
+ }, {
4159
+ type: Inject,
4160
+ args: [BREADCRUMB_PREFIX$]
4161
+ }] }] });
4162
+
4163
+ // src/lib/utils/array.util.ts
4164
+ class ArrayUtil {
4165
+ static isEmpty(value) {
4166
+ return ObjectUtil.isNull(value) || (Array.isArray(value) && value.length === 0);
4167
+ }
4168
+ static clone(value) {
4169
+ if (ObjectUtil.isNull(value)) {
4170
+ return [];
4171
+ }
4172
+ return Array.isArray(value) ? [...value] : [];
4173
+ }
4174
+ /**
4175
+ * Usar como predicate em filter para distinct por comparação de id
4176
+ * Ex: array.filter(ArrayUtil.distinctById)
4177
+ */
4178
+ static distinctById = (obj, index, self) => index === self.findIndex(el => el && obj && el.id === obj.id);
4179
+ }
4180
+
4181
+ // src/lib/utils/number.util.ts
4182
+ class NumberUtil {
4183
+ static isPositive(value) {
4184
+ return value != null && value > 0;
4185
+ }
4186
+ static format(value, digitsInfo) {
4187
+ if (!ObjectUtil.isNull(value)) {
4188
+ return formatNumber(value, 'pt-BR', digitsInfo);
4189
+ }
4190
+ return StringUtil.EMPTY;
4191
+ }
4192
+ static get(value) {
4193
+ return !ObjectUtil.isNull(value) ? value : 0;
4194
+ }
4195
+ }
4196
+
4197
+ // src/lib/utils/date.util.ts
4198
+ class DateUtil {
4199
+ static DATE_FORMAT = 'dd/MM/yyyy';
4200
+ static DATE_TIME_FORMAT = 'dd/MM/yyyy HH:mm';
4201
+ static DATE_TIME_FORMAT_SLICED = 'dd/MM/yy HH:mm';
4202
+ static DATE_TIME_FULL_FORMAT = 'dd/MM/yyyy HH:mm:ss';
4203
+ /**
4204
+ * Aceita Date | string | undefined. Retorna string formatada ou vazio.
4205
+ */
4206
+ static format(value, format) {
4207
+ if (!value)
4208
+ return StringUtil.EMPTY;
4209
+ const dateObj = typeof value === 'string' ? new Date(value) : value;
4210
+ if (dateObj instanceof Date && !isNaN(dateObj.getTime())) {
4211
+ return formatDate(dateObj, format, 'pt-BR');
4212
+ }
4213
+ return StringUtil.EMPTY;
4214
+ }
4215
+ static getTotalDaysInMonth(month, year) {
4216
+ const date = new Date(year, month - 1, 1);
4217
+ date.setMonth(date.getMonth() + 1);
4218
+ date.setDate(date.getDate() - 1);
4219
+ return date.getDate();
4220
+ }
4221
+ static addMonthsToDate(date, monthsToAdd) {
4222
+ const resultDate = new Date(date);
4223
+ resultDate.setMonth(resultDate.getMonth() + monthsToAdd);
4224
+ return resultDate;
4225
+ }
4226
+ static addDaysToDate(days, date) {
4227
+ const result = new Date(date);
4228
+ result.setDate(result.getDate() + days);
4229
+ return result;
4230
+ }
4231
+ static isValid(value) {
4232
+ if (value === null || value === undefined)
4233
+ return false;
4234
+ const date = typeof value === 'string' ? new Date(value) : value;
4235
+ return date instanceof Date && !isNaN(date.getTime());
4236
+ }
4237
+ static isGreaterThan(initial, final) {
4238
+ const i = new Date(initial);
4239
+ const f = new Date(final);
4240
+ return this.isValid(i) && this.isValid(f) && i > f;
4241
+ }
4242
+ static isLessThan(initial, final) {
4243
+ const i = new Date(initial);
4244
+ const f = new Date(final);
4245
+ return this.isValid(i) && this.isValid(f) && i < f;
4246
+ }
4247
+ static isBetween(date, initial, final) {
4248
+ const d = new Date(date);
4249
+ const i = new Date(initial);
4250
+ const f = new Date(final);
4251
+ return this.isValid(d) && this.isValid(i) && this.isValid(f) && d >= i && d <= f;
4252
+ }
4253
+ static getDayOfWeek(date) {
4254
+ // getDay returns 0=Sunday
4255
+ switch (date.getDay()) {
4256
+ case 0:
4257
+ return 'SUNDAY';
4258
+ case 1:
4259
+ return 'MONDAY';
4260
+ case 2:
4261
+ return 'TUESDAY';
4262
+ case 3:
4263
+ return 'WEDNESDAY';
4264
+ case 4:
4265
+ return 'THURSDAY';
4266
+ case 5:
4267
+ return 'FRIDAY';
4268
+ case 6:
4269
+ return 'SATURDAY';
4270
+ }
4271
+ return '';
4272
+ }
4273
+ }
4274
+
4275
+ // src/lib/utils/currency.util.ts
4276
+ class CurrencyUtil {
4277
+ /**
4278
+ * @param value número a formatar. Se nulo/indefinido retorna string vazia.
4279
+ * @param currency código ISO (ex: 'BRL') ou símbolo informal passado como terceiro arg se precisar.
4280
+ * @param digitsInfo formato, ex: '1.2-2'
4281
+ */
4282
+ static transform(value, currency = 'BRL', digitsInfo = '1.2-2') {
4283
+ if (ObjectUtil.isNull(value)) {
4284
+ return StringUtil.EMPTY;
4285
+ }
4286
+ return formatCurrency(value, 'pt-BR', currency === 'BRL' ? 'R$' : currency, digitsInfo);
4287
+ }
4288
+ }
4289
+
4290
+ // src/lib/utils/document.util.ts
4291
+ class DocumentUtil {
4292
+ static isValidCpf(cpf) {
4293
+ if (StringUtil.isEmpty(cpf)) {
4294
+ return false;
4295
+ }
4296
+ cpf = StringUtil.removeAccents(cpf);
4297
+ if (cpf.length !== 11 ||
4298
+ [
4299
+ '00000000000',
4300
+ '11111111111',
4301
+ '22222222222',
4302
+ '33333333333',
4303
+ '44444444444',
4304
+ '55555555555',
4305
+ '66666666666',
4306
+ '77777777777',
4307
+ '88888888888',
4308
+ '99999999999',
4309
+ ].includes(cpf)) {
4310
+ return false;
4311
+ }
4312
+ let add = 0;
4313
+ for (let i = 0; i < 9; i++) {
4314
+ add += +cpf.charAt(i) * (10 - i);
4315
+ }
4316
+ let rev = 11 - (add % 11);
4317
+ if (rev === 10 || rev === 11)
4318
+ rev = 0;
4319
+ if (rev !== +cpf.charAt(9))
4320
+ return false;
4321
+ add = 0;
4322
+ for (let i = 0; i < 10; i++) {
4323
+ add += +cpf.charAt(i) * (11 - i);
4324
+ }
4325
+ rev = 11 - (add % 11);
4326
+ if (rev === 10 || rev === 11)
4327
+ rev = 0;
4328
+ if (rev !== +cpf.charAt(10))
4329
+ return false;
4330
+ return true;
4331
+ }
4332
+ static isValidCnpj(cnpj) {
4333
+ if (StringUtil.isEmpty(cnpj)) {
4334
+ return false;
4335
+ }
4336
+ cnpj = StringUtil.removeAccents(cnpj);
4337
+ if (cnpj.length !== 14 ||
4338
+ [
4339
+ '00000000000000',
4340
+ '11111111111111',
4341
+ '22222222222222',
4342
+ '33333333333333',
4343
+ '44444444444444',
4344
+ '55555555555555',
4345
+ '66666666666666',
4346
+ '77777777777777',
4347
+ '88888888888888',
4348
+ '99999999999999',
4349
+ ].includes(cnpj)) {
4350
+ return false;
4351
+ }
4352
+ let length = cnpj.length - 2;
4353
+ let numbers = cnpj.substring(0, length);
4354
+ const digits = cnpj.substring(length);
4355
+ let sum = 0;
4356
+ let pos = length - 7;
4357
+ for (let i = length; i >= 1; i--) {
4358
+ sum += +numbers.charAt(length - i) * pos--;
4359
+ if (pos < 2)
4360
+ pos = 9;
4361
+ }
4362
+ let resultado = sum % 11 < 2 ? 0 : 11 - (sum % 11);
4363
+ if (resultado !== +digits.charAt(0))
4364
+ return false;
4365
+ length = length + 1;
4366
+ numbers = cnpj.substring(0, length);
4367
+ sum = 0;
4368
+ pos = length - 7;
4369
+ for (let i = length; i >= 1; i--) {
4370
+ sum += +numbers.charAt(length - i) * pos--;
4371
+ if (pos < 2)
4372
+ pos = 9;
4373
+ }
4374
+ resultado = sum % 11 < 2 ? 0 : 11 - (sum % 11);
4375
+ if (resultado !== +digits.charAt(1))
4376
+ return false;
4377
+ return true;
4378
+ }
4379
+ }
4380
+
4381
+ // src/lib/utils/uuid.util.ts
4382
+ class UuidUtil {
4383
+ static uuidPattern = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/;
4384
+ static isUUID(uuid) {
4385
+ if (ObjectUtil.isNull(uuid))
4386
+ return false;
4387
+ const match = uuid.match(this.uuidPattern);
4388
+ return !!(match && match.length > 0);
4389
+ }
4390
+ static extractUUID(uuid) {
4391
+ if (ObjectUtil.isNull(uuid))
4392
+ return null;
4393
+ const match = uuid.match(this.uuidPattern);
4394
+ return match && match.length > 0 ? match[0] : null;
4395
+ }
4396
+ }
4397
+
4398
+ // src/lib/mock/fake-data.service.ts
4399
+ class FakeDataService {
4400
+ DEFAULT_PASSWORD_OPTIONS = {
4401
+ length: 6,
4402
+ memorable: false,
4403
+ pattern: /[A-Z0-9]/i,
4404
+ prefix: '',
4405
+ };
4406
+ randomPassword(options) {
4407
+ const opts = {
4408
+ ...this.DEFAULT_PASSWORD_OPTIONS,
4409
+ ...(options || {}),
4410
+ };
4411
+ // nova API: recebe um único objeto
4412
+ return faker.internet.password({
4413
+ length: opts.length,
4414
+ memorable: opts.memorable,
4415
+ pattern: opts.pattern,
4416
+ prefix: opts.prefix,
4417
+ });
4418
+ }
4419
+ generateUsers(count) {
4420
+ const users = [];
4421
+ for (let i = 0; i < count; i++) {
4422
+ const birthDate = faker.date.birthdate({ min: 18, max: 65, mode: 'age' });
4423
+ const rawPhone = faker.phone.number(); // pode vir com formatos variados
4424
+ users.push({
4425
+ name: faker.person.fullName(),
4426
+ email: faker.internet.email(),
4427
+ phone: this.formatPhoneNumber(rawPhone),
4428
+ birthDate: birthDate,
4429
+ password: this.randomPassword(), // usa padrão
4430
+ });
4431
+ }
4432
+ return users;
4433
+ }
4434
+ formatPhoneNumber(phone) {
4435
+ let numericOnly = phone.replace(/\D/g, ''); // Remove non-digits
4436
+ if (numericOnly.length >= 11) {
4437
+ return numericOnly.slice(0, 11); // Retorna os primeiros 11 dígitos
4438
+ }
4439
+ else {
4440
+ // preenche com zeros à direita se menos que 11
4441
+ return numericOnly.padEnd(11, '0');
4442
+ }
4443
+ }
4444
+ /**
4445
+ * Retorna opções de senha padrão, permitindo sobreposição:
4446
+ * ex: passwordDefaults({ length: 10, prefix: 'Hi' })
4447
+ */
4448
+ passwordDefaults(overrides) {
4449
+ return {
4450
+ ...this.DEFAULT_PASSWORD_OPTIONS,
4451
+ ...(overrides || {}),
4452
+ };
4453
+ }
4454
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FakeDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
4455
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FakeDataService, providedIn: 'root' });
4456
+ }
4457
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FakeDataService, decorators: [{
4458
+ type: Injectable,
4459
+ args: [{
4460
+ providedIn: 'root',
4461
+ }]
4462
+ }] });
4463
+
4464
+ // componentes
4465
+
4466
+ /**
4467
+ * Generated bundle index. Do not edit.
4468
+ */
4469
+
4470
+ export { ActionDialogComponent, ActionResultDialogComponent, ActionRowComponent, AlertComponent, ArrayUtil, BREADCRUMB_PREFIX$, BreadcrumbComponent, BreadcrumbService, ButtonComponent, CheckBoxComponent, ClickCatcherDirective, ConfirmationDialogComponent, CoreMaterialModule, CurrencyBrlPipe, CurrencyPreferenceService, CurrencyUtil, DateAgoPipe, DateMaskDirective, DateUtil, DefaultConsoleMessageService, DefaultMessageService, DialogService, DirectivesModule, DocumentUtil, DynamicTabDirective, FakeDataService, FooterComponent, ForDirective, GetFirstStringBeforeSpacePipe, HeaderComponent, IconComponent, InfoDetailComponent, InfoDetailDialogComponent, InputComponent, InputDatePickerRangeComponent, LineBreakAfterPeriodPipe, LineBreakAfterPipe, LoadingOverlayComponent, LoadingService, LowerCaseDirective, MESSAGE_SERVICE, MY_DATE_FORMATS, MemoryFormatPipe, ModuleChangeService, NavComponent, NavService, NumberUtil, ObjectUtil, PhoneBrazilPipe, PhoneMaskBrazilDirective, PhoneMaskSpainDirective, PhoneSpainPipe, PipesModule, ProfileMenuComponent, ProgressBarComponent, ProgressBarMultipleComponent, PumpkinTechModule, QuantityItemsComponent, RadioGroupComponent, RadioGroupEntityComponent, RedDirective, SelectEntityComponent, SelectEnumComponent, SlideToggleComponent, SnackbarMessageService, SpaceDropDirective, StringUtil, TimeDurationPipe, TitleComponent, UpperCaseDirective, UptimeFormatPipe, UuidUtil };
4471
+ //# sourceMappingURL=pumpkin-tech-pumpkin-tech-ng.mjs.map