@firestitch/app-message 13.1.1 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/app/helpers/index-name-value.d.ts +1 -1
  2. package/app/helpers/index.d.ts +1 -1
  3. package/app/modules/app-message/app-message.module.d.ts +8 -8
  4. package/app/modules/app-message/injectors/app-message-config.injector.d.ts +3 -3
  5. package/app/modules/app-message/injectors/index.d.ts +1 -1
  6. package/app/modules/app-message/interfaces/app-message-config.d.ts +30 -30
  7. package/app/modules/app-message/interfaces/index.d.ts +1 -1
  8. package/app/modules/app-message/types/index.d.ts +1 -1
  9. package/app/modules/app-message/types/types.type.d.ts +49 -49
  10. package/app/modules/message-preview/components/index.d.ts +1 -1
  11. package/app/modules/message-preview/components/preview/index.d.ts +1 -1
  12. package/app/modules/message-preview/components/preview/preview.component.d.ts +11 -11
  13. package/app/modules/message-preview/message-preview.module.d.ts +11 -11
  14. package/app/modules/message-queues/components/queue/queue.component.d.ts +44 -44
  15. package/app/modules/message-queues/components/queues/queues.component.d.ts +31 -31
  16. package/app/modules/message-queues/components/recipient/recipient.component.d.ts +10 -10
  17. package/app/modules/message-queues/consts/index.d.ts +1 -1
  18. package/app/modules/message-queues/consts/message-queue-event-type.const.d.ts +5 -5
  19. package/app/modules/message-queues/consts/message-queue-states.const.d.ts +5 -5
  20. package/app/modules/message-queues/enums/email-message-queue-format.enum.d.ts +5 -5
  21. package/app/modules/message-queues/enums/index.d.ts +3 -3
  22. package/app/modules/message-queues/enums/message-queue-event-type.enum.d.ts +4 -4
  23. package/app/modules/message-queues/enums/message-queue-state.enum.d.ts +9 -9
  24. package/app/modules/message-queues/enums/message-queue-type.enum.d.ts +4 -4
  25. package/app/modules/message-queues/message-queues.module.d.ts +29 -29
  26. package/app/modules/message-queues/pipes/linkify.pipe.d.ts +7 -7
  27. package/app/modules/message-queues/pipes/truncate.pipe.d.ts +7 -7
  28. package/app/modules/message-queues/services/message-queue.service.d.ts +10 -10
  29. package/app/modules/message-templates/components/index.d.ts +2 -2
  30. package/app/modules/message-templates/components/template/index.d.ts +1 -1
  31. package/app/modules/message-templates/components/template/template.component.d.ts +23 -23
  32. package/app/modules/message-templates/components/templates/index.d.ts +1 -1
  33. package/app/modules/message-templates/components/templates/templates.component.d.ts +19 -19
  34. package/app/modules/message-templates/message-templates.module.d.ts +24 -24
  35. package/app/modules/messages/components/attachments/attachments.component.d.ts +18 -18
  36. package/app/modules/messages/components/attachments/index.d.ts +1 -1
  37. package/app/modules/messages/components/index.d.ts +3 -3
  38. package/app/modules/messages/components/message/index.d.ts +1 -1
  39. package/app/modules/messages/components/message/message.component.d.ts +30 -30
  40. package/app/modules/messages/components/messages/index.d.ts +1 -1
  41. package/app/modules/messages/components/messages/messages.component.d.ts +19 -19
  42. package/app/modules/messages/consts/email-message-formats.const.d.ts +5 -5
  43. package/app/modules/messages/consts/index.d.ts +1 -1
  44. package/app/modules/messages/enums/email-message-format.enum.d.ts +5 -5
  45. package/app/modules/messages/enums/index.d.ts +1 -1
  46. package/app/modules/messages/messages.module.d.ts +31 -31
  47. package/app/modules/webhooks/components/webhooks/webhooks.component.d.ts +15 -15
  48. package/app/modules/webhooks/webhooks.module.d.ts +9 -9
  49. package/esm2020/app/helpers/index-name-value.mjs +7 -7
  50. package/esm2020/app/helpers/index.mjs +1 -1
  51. package/esm2020/app/modules/app-message/app-message.module.mjs +16 -16
  52. package/esm2020/app/modules/app-message/injectors/app-message-config.injector.mjs +3 -3
  53. package/esm2020/app/modules/app-message/injectors/index.mjs +1 -1
  54. package/esm2020/app/modules/app-message/interfaces/app-message-config.mjs +1 -1
  55. package/esm2020/app/modules/app-message/interfaces/index.mjs +1 -1
  56. package/esm2020/app/modules/app-message/types/index.mjs +1 -1
  57. package/esm2020/app/modules/app-message/types/types.type.mjs +1 -1
  58. package/esm2020/app/modules/message-preview/components/index.mjs +1 -1
  59. package/esm2020/app/modules/message-preview/components/preview/index.mjs +1 -1
  60. package/esm2020/app/modules/message-preview/components/preview/preview.component.mjs +25 -25
  61. package/esm2020/app/modules/message-preview/message-preview.module.mjs +36 -38
  62. package/esm2020/app/modules/message-queues/components/queue/queue.component.mjs +209 -209
  63. package/esm2020/app/modules/message-queues/components/queues/queues.component.mjs +197 -197
  64. package/esm2020/app/modules/message-queues/components/recipient/recipient.component.mjs +25 -25
  65. package/esm2020/app/modules/message-queues/consts/index.mjs +1 -1
  66. package/esm2020/app/modules/message-queues/consts/message-queue-event-type.const.mjs +5 -5
  67. package/esm2020/app/modules/message-queues/consts/message-queue-states.const.mjs +10 -10
  68. package/esm2020/app/modules/message-queues/enums/email-message-queue-format.enum.mjs +6 -6
  69. package/esm2020/app/modules/message-queues/enums/index.mjs +3 -3
  70. package/esm2020/app/modules/message-queues/enums/message-queue-event-type.enum.mjs +5 -5
  71. package/esm2020/app/modules/message-queues/enums/message-queue-state.enum.mjs +10 -10
  72. package/esm2020/app/modules/message-queues/enums/message-queue-type.enum.mjs +5 -5
  73. package/esm2020/app/modules/message-queues/message-queues.module.mjs +112 -114
  74. package/esm2020/app/modules/message-queues/pipes/linkify.pipe.mjs +21 -21
  75. package/esm2020/app/modules/message-queues/pipes/truncate.pipe.mjs +21 -21
  76. package/esm2020/app/modules/message-queues/services/message-queue.service.mjs +28 -28
  77. package/esm2020/app/modules/message-templates/components/index.mjs +2 -2
  78. package/esm2020/app/modules/message-templates/components/template/index.mjs +1 -1
  79. package/esm2020/app/modules/message-templates/components/template/template.component.mjs +81 -81
  80. package/esm2020/app/modules/message-templates/components/templates/index.mjs +1 -1
  81. package/esm2020/app/modules/message-templates/components/templates/templates.component.mjs +80 -80
  82. package/esm2020/app/modules/message-templates/message-templates.module.mjs +92 -94
  83. package/esm2020/app/modules/messages/components/attachments/attachments.component.mjs +80 -80
  84. package/esm2020/app/modules/messages/components/attachments/index.mjs +1 -1
  85. package/esm2020/app/modules/messages/components/index.mjs +3 -3
  86. package/esm2020/app/modules/messages/components/message/index.mjs +1 -1
  87. package/esm2020/app/modules/messages/components/message/message.component.mjs +128 -128
  88. package/esm2020/app/modules/messages/components/messages/index.mjs +1 -1
  89. package/esm2020/app/modules/messages/components/messages/messages.component.mjs +71 -71
  90. package/esm2020/app/modules/messages/consts/email-message-formats.const.mjs +6 -6
  91. package/esm2020/app/modules/messages/consts/index.mjs +1 -1
  92. package/esm2020/app/modules/messages/enums/email-message-format.enum.mjs +6 -6
  93. package/esm2020/app/modules/messages/enums/index.mjs +1 -1
  94. package/esm2020/app/modules/messages/messages.module.mjs +119 -121
  95. package/esm2020/app/modules/webhooks/components/webhooks/webhooks.component.mjs +62 -62
  96. package/esm2020/app/modules/webhooks/webhooks.module.mjs +28 -30
  97. package/esm2020/firestitch-app-message.mjs +4 -4
  98. package/esm2020/public_api.mjs +15 -15
  99. package/fesm2015/firestitch-app-message.mjs +1213 -1223
  100. package/fesm2015/firestitch-app-message.mjs.map +1 -1
  101. package/fesm2020/firestitch-app-message.mjs +1217 -1227
  102. package/fesm2020/firestitch-app-message.mjs.map +1 -1
  103. package/{firestitch-app-message.d.ts → index.d.ts} +5 -5
  104. package/package.json +3 -3
  105. package/public_api.d.ts +16 -16
@@ -1,54 +1,54 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgModule, Component, Inject, InjectionToken, ChangeDetectionStrategy, ViewChild, Input, Injectable, Pipe } from '@angular/core';
3
- import * as i17 from '@angular/common';
3
+ import * as i4$1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
- import * as i15 from '@angular/forms';
5
+ import * as i5$1 from '@angular/forms';
6
6
  import { FormsModule } from '@angular/forms';
7
7
  import { RouterModule } from '@angular/router';
8
- import * as i3 from '@angular/material/button';
8
+ import * as i5 from '@angular/material/button';
9
9
  import { MatButtonModule } from '@angular/material/button';
10
10
  import * as i1 from '@angular/material/dialog';
11
11
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
12
- import * as i1$3 from '@angular/material/icon';
12
+ import * as i3$2 from '@angular/material/icon';
13
13
  import { MatIconModule } from '@angular/material/icon';
14
- import * as i5 from '@angular/material/tabs';
14
+ import * as i6 from '@angular/material/tabs';
15
15
  import { MatTabsModule } from '@angular/material/tabs';
16
- import * as i3$2 from '@angular/material/tooltip';
16
+ import * as i2$1 from '@angular/material/tooltip';
17
17
  import { MatTooltipModule } from '@angular/material/tooltip';
18
18
  import * as i10$1 from '@firestitch/date';
19
19
  import { FsDateModule } from '@firestitch/date';
20
- import * as i4 from '@firestitch/dialog';
20
+ import * as i3 from '@firestitch/dialog';
21
21
  import { FsDialogModule } from '@firestitch/dialog';
22
- import * as i16 from '@firestitch/form';
22
+ import * as i12 from '@firestitch/form';
23
23
  import { FsFormModule } from '@firestitch/form';
24
- import * as i2 from '@firestitch/iframe';
24
+ import * as i4 from '@firestitch/iframe';
25
25
  import { FsIFrameModule } from '@firestitch/iframe';
26
- import * as i6$1 from '@firestitch/label';
26
+ import * as i13 from '@firestitch/label';
27
27
  import { FsLabelModule } from '@firestitch/label';
28
- import * as i2$1 from '@firestitch/list';
28
+ import * as i2 from '@firestitch/list';
29
29
  import { FsListComponent, FsListModule } from '@firestitch/list';
30
30
  import * as i1$1 from '@firestitch/message';
31
31
  import { FsMessageModule } from '@firestitch/message';
32
32
  import * as i1$2 from '@firestitch/prompt';
33
33
  import { FsPromptInputModule } from '@firestitch/prompt';
34
- import * as i14 from '@firestitch/skeleton';
34
+ import * as i11$1 from '@firestitch/skeleton';
35
35
  import { FsSkeletonModule } from '@firestitch/skeleton';
36
36
  import { MatCheckboxModule } from '@angular/material/checkbox';
37
- import * as i9 from '@angular/material/core';
37
+ import * as i10 from '@angular/material/core';
38
38
  import { MatOptionModule } from '@angular/material/core';
39
- import * as i6 from '@angular/material/form-field';
39
+ import * as i8 from '@angular/material/form-field';
40
40
  import { MatFormFieldModule } from '@angular/material/form-field';
41
- import * as i19 from '@angular/material/input';
41
+ import * as i9 from '@angular/material/input';
42
42
  import { MatInputModule } from '@angular/material/input';
43
- import * as i8 from '@angular/material/select';
43
+ import * as i11 from '@angular/material/select';
44
44
  import { MatSelectModule } from '@angular/material/select';
45
45
  import * as i3$1 from '@firestitch/common';
46
46
  import { FsCommonModule } from '@firestitch/common';
47
- import * as i11 from '@firestitch/html-editor';
47
+ import * as i17 from '@firestitch/html-editor';
48
48
  import { FsHtmlEditorModule, FsHtmlRendererModule } from '@firestitch/html-editor';
49
49
  import * as i18 from '@firestitch/tabs';
50
50
  import { FsTabsModule } from '@firestitch/tabs';
51
- import * as i10 from '@firestitch/text-editor';
51
+ import * as i16 from '@firestitch/text-editor';
52
52
  import { FsTextEditorModule } from '@firestitch/text-editor';
53
53
  import { tap, switchMap, map, takeUntil, filter } from 'rxjs/operators';
54
54
  import { Subject, of } from 'rxjs';
@@ -58,1273 +58,1263 @@ import { SelectionActionType } from '@firestitch/selection';
58
58
  import * as i2$2 from '@firestitch/store';
59
59
  import { isAfter } from 'date-fns';
60
60
 
61
- class FsAppMessageModule {
62
- static forRoot() {
63
- return {
64
- ngModule: FsAppMessageModule,
65
- };
66
- }
67
- }
68
- FsAppMessageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
69
- FsAppMessageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageModule });
70
- FsAppMessageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageModule });
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageModule, decorators: [{
72
- type: NgModule,
73
- args: [{}]
61
+ class FsAppMessageModule {
62
+ static forRoot() {
63
+ return {
64
+ ngModule: FsAppMessageModule,
65
+ };
66
+ }
67
+ }
68
+ FsAppMessageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
69
+ FsAppMessageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageModule });
70
+ FsAppMessageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageModule });
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageModule, decorators: [{
72
+ type: NgModule,
73
+ args: [{}]
74
74
  }] });
75
75
 
76
- class PreviewComponent {
77
- constructor(_data) {
78
- this._data = _data;
79
- this.html = _data.html;
80
- this.styles = _data.styles;
81
- }
82
- ngOnInit() {
83
- }
84
- }
85
- PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreviewComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
86
- PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: PreviewComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\n [styles]=\"styles\">\n </fs-iframe>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"null\" color=\"primary\" type=\"button\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i2.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
87
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: PreviewComponent, decorators: [{
88
- type: Component,
89
- args: [{ template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\n [styles]=\"styles\">\n </fs-iframe>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"null\" color=\"primary\" type=\"button\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""] }]
90
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
91
- type: Inject,
92
- args: [MAT_DIALOG_DATA]
76
+ class PreviewComponent {
77
+ constructor(_data) {
78
+ this._data = _data;
79
+ this.html = _data.html;
80
+ this.styles = _data.styles;
81
+ }
82
+ ngOnInit() {
83
+ }
84
+ }
85
+ PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreviewComponent, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
86
+ PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: PreviewComponent, selector: "ng-component", ngImport: i0, template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\n [styles]=\"styles\">\n </fs-iframe>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"null\" color=\"primary\" type=\"button\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "component", type: i4.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"] }] });
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: PreviewComponent, decorators: [{
88
+ type: Component,
89
+ args: [{ template: "<fs-dialog>\n <div mat-dialog-title>Preview</div>\n <mat-dialog-content>\n <fs-iframe\n [html]=\"html\"\n [width]=\"'100%'\"\n [styles]=\"styles\">\n </fs-iframe>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button [mat-dialog-close]=\"null\" color=\"primary\" type=\"button\">Done</button>\n </mat-dialog-actions>\n</fs-dialog>\n" }]
90
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
91
+ type: Inject,
92
+ args: [MAT_DIALOG_DATA]
93
93
  }] }]; } });
94
94
 
95
- class FsAppMessagePreviewModule {
96
- }
97
- FsAppMessagePreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagePreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
98
- FsAppMessagePreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagePreviewModule, declarations: [PreviewComponent], imports: [MatDialogModule,
99
- MatButtonModule,
100
- FsDialogModule,
101
- FsIFrameModule], exports: [PreviewComponent] });
102
- FsAppMessagePreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagePreviewModule, imports: [[
103
- MatDialogModule,
104
- MatButtonModule,
105
- FsDialogModule,
106
- FsIFrameModule,
107
- ]] });
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagePreviewModule, decorators: [{
109
- type: NgModule,
110
- args: [{
111
- imports: [
112
- MatDialogModule,
113
- MatButtonModule,
114
- FsDialogModule,
115
- FsIFrameModule,
116
- ],
117
- declarations: [
118
- PreviewComponent,
119
- ],
120
- exports: [
121
- PreviewComponent,
122
- ]
123
- }]
95
+ class FsAppMessagePreviewModule {
96
+ }
97
+ FsAppMessagePreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagePreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
98
+ FsAppMessagePreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagePreviewModule, declarations: [PreviewComponent], imports: [MatDialogModule,
99
+ MatButtonModule,
100
+ FsDialogModule,
101
+ FsIFrameModule], exports: [PreviewComponent] });
102
+ FsAppMessagePreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagePreviewModule, imports: [MatDialogModule,
103
+ MatButtonModule,
104
+ FsDialogModule,
105
+ FsIFrameModule] });
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagePreviewModule, decorators: [{
107
+ type: NgModule,
108
+ args: [{
109
+ imports: [
110
+ MatDialogModule,
111
+ MatButtonModule,
112
+ FsDialogModule,
113
+ FsIFrameModule,
114
+ ],
115
+ declarations: [
116
+ PreviewComponent,
117
+ ],
118
+ exports: [
119
+ PreviewComponent,
120
+ ]
121
+ }]
124
122
  }] });
125
123
 
126
- const FS_APP_MESSAGE_ROOT_CONFIG = new InjectionToken('fs-app-message-root-config');
124
+ const FS_APP_MESSAGE_ROOT_CONFIG = new InjectionToken('fs-app-message-root-config');
127
125
  const FS_APP_MESSAGE_CONFIG = new InjectionToken('fs-app-message-config');
128
126
 
129
- var EmailMessageFormat;
130
- (function (EmailMessageFormat) {
131
- EmailMessageFormat["Text"] = "T";
132
- EmailMessageFormat["HTML"] = "H";
133
- EmailMessageFormat["RichText"] = "R";
127
+ var EmailMessageFormat;
128
+ (function (EmailMessageFormat) {
129
+ EmailMessageFormat["Text"] = "T";
130
+ EmailMessageFormat["HTML"] = "H";
131
+ EmailMessageFormat["RichText"] = "R";
134
132
  })(EmailMessageFormat || (EmailMessageFormat = {}));
135
133
 
136
- const EmailMessageFormats = [
137
- { name: 'Text', value: EmailMessageFormat.Text },
138
- { name: 'HTML', value: EmailMessageFormat.HTML },
139
- { name: 'Rich Text', value: EmailMessageFormat.RichText }
134
+ const EmailMessageFormats = [
135
+ { name: 'Text', value: EmailMessageFormat.Text },
136
+ { name: 'HTML', value: EmailMessageFormat.HTML },
137
+ { name: 'Rich Text', value: EmailMessageFormat.RichText }
140
138
  ];
141
139
 
142
- class AttachmentsComponent {
143
- constructor(_config, _message) {
144
- this._config = _config;
145
- this._message = _message;
146
- this.list = null;
147
- this.config = null;
148
- this._destroy$ = new Subject();
149
- }
150
- ngOnInit() {
151
- this.config = {
152
- rowActions: [],
153
- actions: [
154
- {
155
- label: 'Upload',
156
- mode: ActionMode.File,
157
- select: (fsFile) => {
158
- this._config.uploadMessageAttachment(this.message, fsFile)
159
- .subscribe(() => {
160
- this._message.success('Saved attachment');
161
- this.list.reload();
162
- });
163
- }
164
- }
165
- ],
166
- fetch: query => {
167
- return this._config.loadMessageAttachments(this.message, query);
168
- }
169
- };
170
- if (this._config.downloadMessageAttachment) {
171
- this.config.rowActions
172
- .push({
173
- click: data => {
174
- return this._config.downloadMessageAttachment(data);
175
- },
176
- label: 'Download',
177
- });
178
- }
179
- if (this._config.deleteMessageAttachment) {
180
- this.config.rowActions
181
- .push({
182
- click: data => {
183
- return this._config.deleteMessageAttachment(data);
184
- },
185
- remove: {
186
- title: 'Confirm',
187
- template: 'Are you sure you would like to delete this template?',
188
- },
189
- label: 'Delete',
190
- });
191
- }
192
- }
193
- ngOnDestroy() {
194
- this._destroy$.next();
195
- this._destroy$.complete();
196
- }
197
- }
198
- AttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AttachmentsComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
199
- AttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: { message: "message" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>", components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsFormatBytes": i3$1.FsFormatBytesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: AttachmentsComponent, decorators: [{
201
- type: Component,
202
- args: [{ selector: 'fs-app-message-attachments', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
203
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
204
- type: Inject,
205
- args: [FS_APP_MESSAGE_CONFIG]
206
- }] }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
207
- type: ViewChild,
208
- args: [FsListComponent, { static: true }]
209
- }], message: [{
210
- type: Input
140
+ class AttachmentsComponent {
141
+ constructor(_config, _message) {
142
+ this._config = _config;
143
+ this._message = _message;
144
+ this.list = null;
145
+ this.config = null;
146
+ this._destroy$ = new Subject();
147
+ }
148
+ ngOnInit() {
149
+ this.config = {
150
+ rowActions: [],
151
+ actions: [
152
+ {
153
+ label: 'Upload',
154
+ mode: ActionMode.File,
155
+ select: (fsFile) => {
156
+ this._config.uploadMessageAttachment(this.message, fsFile)
157
+ .subscribe(() => {
158
+ this._message.success('Saved attachment');
159
+ this.list.reload();
160
+ });
161
+ }
162
+ }
163
+ ],
164
+ fetch: query => {
165
+ return this._config.loadMessageAttachments(this.message, query);
166
+ }
167
+ };
168
+ if (this._config.downloadMessageAttachment) {
169
+ this.config.rowActions
170
+ .push({
171
+ click: data => {
172
+ return this._config.downloadMessageAttachment(data);
173
+ },
174
+ label: 'Download',
175
+ });
176
+ }
177
+ if (this._config.deleteMessageAttachment) {
178
+ this.config.rowActions
179
+ .push({
180
+ click: data => {
181
+ return this._config.deleteMessageAttachment(data);
182
+ },
183
+ remove: {
184
+ title: 'Confirm',
185
+ template: 'Are you sure you would like to delete this template?',
186
+ },
187
+ label: 'Delete',
188
+ });
189
+ }
190
+ }
191
+ ngOnDestroy() {
192
+ this._destroy$.next();
193
+ this._destroy$.complete();
194
+ }
195
+ }
196
+ AttachmentsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachmentsComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
197
+ AttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: { message: "message" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i3$1.FsFormatBytesPipe, name: "fsFormatBytes" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AttachmentsComponent, decorators: [{
199
+ type: Component,
200
+ args: [{ selector: 'fs-app-message-attachments', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.size | fsFormatBytes}}\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
201
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
202
+ type: Inject,
203
+ args: [FS_APP_MESSAGE_CONFIG]
204
+ }] }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
205
+ type: ViewChild,
206
+ args: [FsListComponent, { static: true }]
207
+ }], message: [{
208
+ type: Input
211
209
  }] } });
212
210
 
213
- class MessageComponent {
214
- constructor(_config, _data, _prompt, _message, _dialog, _cdRef) {
215
- this._config = _config;
216
- this._data = _data;
217
- this._prompt = _prompt;
218
- this._message = _message;
219
- this._dialog = _dialog;
220
- this._cdRef = _cdRef;
221
- this.tab = 'general';
222
- this.messageTemplates = [];
223
- this.emailMessageFormats = EmailMessageFormats;
224
- this.emailMessageFormat = EmailMessageFormat;
225
- this.save = () => {
226
- return this._config.saveMessage(this.message)
227
- .pipe(tap(() => {
228
- this._message.success('Saved Changes');
229
- }));
230
- };
231
- }
232
- ngOnInit() {
233
- this._config.loadMessage(this._data.message)
234
- .subscribe((message) => {
235
- this.message = message;
236
- if (this.message.emailMessage && this.message.emailMessage.customize === undefined) {
237
- this.message.emailMessage.customize = true;
238
- }
239
- if (this.message.smsMessage && this.message.smsMessage.customize === undefined) {
240
- this.message.smsMessage.customize = true;
241
- }
242
- this.message.reference = String(message.tag)
243
- .toLocaleLowerCase()
244
- .split('_')
245
- .map((item) => item.charAt(0).toUpperCase() + item.slice(1))
246
- .join('');
247
- this._cdRef.markForCheck();
248
- });
249
- this._config.loadMessageTemplates()
250
- .subscribe((data) => {
251
- this.messageTemplates = data.data;
252
- this._cdRef.markForCheck();
253
- });
254
- }
255
- openPreview() {
256
- const emailMessage = this.message.emailMessage;
257
- let html = emailMessage.customize ? emailMessage.body : this.message.defaultEmailBody;
258
- let styles = emailMessage.styles || '';
259
- if (emailMessage.messageTemplateId) {
260
- const messageTemplate = this.messageTemplates
261
- .find((item) => {
262
- return emailMessage.messageTemplateId === item.id;
263
- });
264
- if (messageTemplate) {
265
- html = messageTemplate.content.replace('{$content}', html);
266
- styles = `${messageTemplate.styles || ''}\n\n${styles}`;
267
- }
268
- }
269
- this._dialog.open(PreviewComponent, {
270
- data: {
271
- styles,
272
- html,
273
- },
274
- width: '95%'
275
- });
276
- }
277
- sendTest(type) {
278
- of(true)
279
- .pipe(switchMap(() => {
280
- return type === 'email' ? this._config.getTestEmail() : of('');
281
- }), switchMap((default_) => {
282
- const typeName = type === 'email' ? 'an email' : 'phone number';
283
- return this._prompt.input({
284
- label: `Please enter ${typeName} to send test to`,
285
- title: 'Send Test',
286
- commitLabel: 'Send',
287
- default: default_,
288
- required: true
289
- });
290
- }))
291
- .subscribe((value) => {
292
- this._config.testMessage(this.message, value, type)
293
- .subscribe(() => {
294
- this._message.success('Test Sent');
295
- });
296
- });
297
- }
298
- }
299
- MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MessageComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$2.FsPrompt }, { token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
300
- MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: MessageComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.bccRecipients\"\n name=\"bcc\">\n </mat-form-field>\n </div>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Email Message\" *ngIf=\"message.emailMessage\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.customize\"\n name=\"customizeEmail\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Format</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.format\"\n name=\"format\">\n <mat-option *ngFor=\"let item of emailMessageFormats\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Template</mat-label>\n <mat-select\n [(ngModel)]=\"message.emailMessage.messageTemplateId\"\n name=\"template\">\n <mat-option [value]=\"null\">None</mat-option>\n <mat-option *ngFor=\"let item of messageTemplates\" [value]=\"item.id\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <ng-container *ngIf=\"message.emailMessage.customize\">\n <mat-form-field>\n <mat-label>Subject</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.subject\"\n name=\"name\"\n required>\n </mat-form-field>\n\n <div [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\n label=\"Styles\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.styles\"\n name=\"styles\"\n [config]=\"{ language: 'scss' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!message.emailMessage.customize\">\n <fs-label-field>\n <fs-label>Subject</fs-label>\n {{message.defaultEmailSubject}}\n </fs-label-field>\n <div>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\n </div>\n <div\n class=\"email-body-text-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n {{message.defaultEmailBody}}\n </div>\n </fs-label-field>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </mat-tab>\n\n <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.smsMessage.customize\"\n name=\"customizeSms\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <div\n *ngIf=\"message.smsMessage.customize\"\n [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.smsMessage.message\"\n name=\"smsMessageMessage\"\n [config]=\"{ language: 'text '}\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n <fs-label-field *ngIf=\"!message.smsMessage.customize\">\n <fs-label>Message</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Variables\" *ngIf=\"message.variables\">\n <ng-template matTabContent>\n <div *ngFor=\"let variable of message.variables\" class=\"variable\">\n {{variable.name}}\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Defaults\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">Email</h2>\n <fs-label-field>\n <fs-label>Subject</fs-label>\n <div class=\"content\">{{message.defaultEmailSubject}}</div>\n </fs-label-field>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultEmailBody}}</div>\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"message.smsMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">SMS</h2>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div>\n </fs-label-field>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i5.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i5.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i6$1.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6$1.FsLabelComponent, selector: "fs-label" }, { type: i8.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i9.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i10.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }, { type: i11.FsHtmlEditorComponent, selector: "fs-html-editor", inputs: ["config", "hint", "disabled"] }, { type: i11.FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }, { type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: ["message"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i15.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i15.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i15.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i18.FsTabsHeaderTabGroupDirective, selector: "mat-tab-group, matTabGroup, [matTabGroup]", inputs: ["orientation", "selected", "selectedData"], outputs: ["selectedChange", "selectedDataChange"], exportAs: ["fsTabsHeaderTabGroup"] }, { type: i18.FsTabsTabDirective, selector: "mat-tab,matTab", inputs: ["name", "data"], exportAs: ["fsTabsTab"] }, { type: i5.MatTabContent, selector: "[matTabContent]" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i19.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"] }, { type: i15.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i15.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i15.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i15.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { type: i16.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MessageComponent, decorators: [{
302
- type: Component,
303
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.bccRecipients\"\n name=\"bcc\">\n </mat-form-field>\n </div>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Email Message\" *ngIf=\"message.emailMessage\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.customize\"\n name=\"customizeEmail\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Format</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.format\"\n name=\"format\">\n <mat-option *ngFor=\"let item of emailMessageFormats\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Template</mat-label>\n <mat-select\n [(ngModel)]=\"message.emailMessage.messageTemplateId\"\n name=\"template\">\n <mat-option [value]=\"null\">None</mat-option>\n <mat-option *ngFor=\"let item of messageTemplates\" [value]=\"item.id\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <ng-container *ngIf=\"message.emailMessage.customize\">\n <mat-form-field>\n <mat-label>Subject</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.subject\"\n name=\"name\"\n required>\n </mat-form-field>\n\n <div [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\n label=\"Styles\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.styles\"\n name=\"styles\"\n [config]=\"{ language: 'scss' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!message.emailMessage.customize\">\n <fs-label-field>\n <fs-label>Subject</fs-label>\n {{message.defaultEmailSubject}}\n </fs-label-field>\n <div>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\n </div>\n <div\n class=\"email-body-text-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n {{message.defaultEmailBody}}\n </div>\n </fs-label-field>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </mat-tab>\n\n <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.smsMessage.customize\"\n name=\"customizeSms\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <div\n *ngIf=\"message.smsMessage.customize\"\n [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.smsMessage.message\"\n name=\"smsMessageMessage\"\n [config]=\"{ language: 'text '}\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n <fs-label-field *ngIf=\"!message.smsMessage.customize\">\n <fs-label>Message</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Variables\" *ngIf=\"message.variables\">\n <ng-template matTabContent>\n <div *ngFor=\"let variable of message.variables\" class=\"variable\">\n {{variable.name}}\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Defaults\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">Email</h2>\n <fs-label-field>\n <fs-label>Subject</fs-label>\n <div class=\"content\">{{message.defaultEmailSubject}}</div>\n </fs-label-field>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultEmailBody}}</div>\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"message.smsMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">SMS</h2>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div>\n </fs-label-field>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"] }]
304
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
305
- type: Inject,
306
- args: [FS_APP_MESSAGE_CONFIG]
307
- }] }, { type: undefined, decorators: [{
308
- type: Inject,
309
- args: [MAT_DIALOG_DATA]
211
+ class MessageComponent {
212
+ constructor(_config, _data, _prompt, _message, _dialog, _cdRef) {
213
+ this._config = _config;
214
+ this._data = _data;
215
+ this._prompt = _prompt;
216
+ this._message = _message;
217
+ this._dialog = _dialog;
218
+ this._cdRef = _cdRef;
219
+ this.tab = 'general';
220
+ this.messageTemplates = [];
221
+ this.emailMessageFormats = EmailMessageFormats;
222
+ this.emailMessageFormat = EmailMessageFormat;
223
+ this.save = () => {
224
+ return this._config.saveMessage(this.message)
225
+ .pipe(tap(() => {
226
+ this._message.success('Saved Changes');
227
+ }));
228
+ };
229
+ }
230
+ ngOnInit() {
231
+ this._config.loadMessage(this._data.message)
232
+ .subscribe((message) => {
233
+ this.message = message;
234
+ if (this.message.emailMessage && this.message.emailMessage.customize === undefined) {
235
+ this.message.emailMessage.customize = true;
236
+ }
237
+ if (this.message.smsMessage && this.message.smsMessage.customize === undefined) {
238
+ this.message.smsMessage.customize = true;
239
+ }
240
+ this.message.reference = String(message.tag)
241
+ .toLocaleLowerCase()
242
+ .split('_')
243
+ .map((item) => item.charAt(0).toUpperCase() + item.slice(1))
244
+ .join('');
245
+ this._cdRef.markForCheck();
246
+ });
247
+ this._config.loadMessageTemplates()
248
+ .subscribe((data) => {
249
+ this.messageTemplates = data.data;
250
+ this._cdRef.markForCheck();
251
+ });
252
+ }
253
+ openPreview() {
254
+ const emailMessage = this.message.emailMessage;
255
+ let html = emailMessage.customize ? emailMessage.body : this.message.defaultEmailBody;
256
+ let styles = emailMessage.styles || '';
257
+ if (emailMessage.messageTemplateId) {
258
+ const messageTemplate = this.messageTemplates
259
+ .find((item) => {
260
+ return emailMessage.messageTemplateId === item.id;
261
+ });
262
+ if (messageTemplate) {
263
+ html = messageTemplate.content.replace('{$content}', html);
264
+ styles = `${messageTemplate.styles || ''}\n\n${styles}`;
265
+ }
266
+ }
267
+ this._dialog.open(PreviewComponent, {
268
+ data: {
269
+ styles,
270
+ html,
271
+ },
272
+ width: '95%'
273
+ });
274
+ }
275
+ sendTest(type) {
276
+ of(true)
277
+ .pipe(switchMap(() => {
278
+ return type === 'email' ? this._config.getTestEmail() : of('');
279
+ }), switchMap((default_) => {
280
+ const typeName = type === 'email' ? 'an email' : 'phone number';
281
+ return this._prompt.input({
282
+ label: `Please enter ${typeName} to send test to`,
283
+ title: 'Send Test',
284
+ commitLabel: 'Send',
285
+ default: default_,
286
+ required: true
287
+ });
288
+ }))
289
+ .subscribe((value) => {
290
+ this._config.testMessage(this.message, value, type)
291
+ .subscribe(() => {
292
+ this._message.success('Test Sent');
293
+ });
294
+ });
295
+ }
296
+ }
297
+ MessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$2.FsPrompt }, { token: i1$1.FsMessage }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
298
+ MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MessageComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.bccRecipients\"\n name=\"bcc\">\n </mat-form-field>\n </div>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Email Message\" *ngIf=\"message.emailMessage\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.customize\"\n name=\"customizeEmail\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Format</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.format\"\n name=\"format\">\n <mat-option *ngFor=\"let item of emailMessageFormats\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Template</mat-label>\n <mat-select\n [(ngModel)]=\"message.emailMessage.messageTemplateId\"\n name=\"template\">\n <mat-option [value]=\"null\">None</mat-option>\n <mat-option *ngFor=\"let item of messageTemplates\" [value]=\"item.id\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <ng-container *ngIf=\"message.emailMessage.customize\">\n <mat-form-field>\n <mat-label>Subject</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.subject\"\n name=\"name\"\n required>\n </mat-form-field>\n\n <div [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\n label=\"Styles\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.styles\"\n name=\"styles\"\n [config]=\"{ language: 'scss' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!message.emailMessage.customize\">\n <fs-label-field>\n <fs-label>Subject</fs-label>\n {{message.defaultEmailSubject}}\n </fs-label-field>\n <div>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\n </div>\n <div\n class=\"email-body-text-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n {{message.defaultEmailBody}}\n </div>\n </fs-label-field>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </mat-tab>\n\n <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.smsMessage.customize\"\n name=\"customizeSms\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <div\n *ngIf=\"message.smsMessage.customize\"\n [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.smsMessage.message\"\n name=\"smsMessageMessage\"\n [config]=\"{ language: 'text '}\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n <fs-label-field *ngIf=\"!message.smsMessage.customize\">\n <fs-label>Message</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Variables\" *ngIf=\"message.variables\">\n <ng-template matTabContent>\n <div *ngFor=\"let variable of message.variables\" class=\"variable\">\n {{variable.name}}\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Defaults\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">Email</h2>\n <fs-label-field>\n <fs-label>Subject</fs-label>\n <div class=\"content\">{{message.defaultEmailSubject}}</div>\n </fs-label-field>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultEmailBody}}</div>\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"message.smsMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">SMS</h2>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div>\n </fs-label-field>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.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: i10.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "component", type: i13.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i12.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i12.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }, { kind: "component", type: i17.FsHtmlEditorComponent, selector: "fs-html-editor", inputs: ["config", "hint", "disabled"] }, { kind: "component", type: i17.FsHtmlRendererComponent, selector: "fs-html-renderer", inputs: ["html"] }, { kind: "directive", type: i18.FsTabsHeaderTabGroupDirective, selector: "mat-tab-group, matTabGroup, [matTabGroup]", inputs: ["orientation", "selected", "selectedData"], outputs: ["selectedChange", "selectedDataChange"], exportAs: ["fsTabsHeaderTabGroup"] }, { kind: "directive", type: i18.FsTabsTabDirective, selector: "mat-tab,matTab", inputs: ["name", "data"], exportAs: ["fsTabsTab"] }, { kind: "component", type: AttachmentsComponent, selector: "fs-app-message-attachments", inputs: ["message"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
299
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessageComponent, decorators: [{
300
+ type: Component,
301
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"message\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"message\">\n <div mat-dialog-title>Edit Message</div>\n <mat-dialog-content>\n <mat-tab-group\n fsTabs\n [(selected)]=\"tab\">\n <mat-tab label=\"General\" name=\"general\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <mat-form-field>\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.name\"\n name=\"Name\"\n required>\n </mat-form-field>\n <fs-label-field>\n <fs-label>Reference</fs-label>\n {{message.reference}}\n </fs-label-field>\n <mat-form-field>\n <mat-label>Description</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.description\"\n name=\"description\">\n </mat-form-field>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>From Email</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromEmail\"\n name=\"from_email\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>From Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.fromName\"\n name=\"from_name\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>Reply To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.replyEmail\"\n name=\"reply_to\">\n </mat-form-field>\n </div>\n\n <div class=\"fs-row.gap-small.wrap\">\n <mat-form-field>\n <mat-label>To</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.toRecipients\"\n name=\"to\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>CC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.ccRecipients\"\n name=\"cc\">\n </mat-form-field>\n <mat-form-field>\n <mat-label>BCC</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.bccRecipients\"\n name=\"bcc\">\n </mat-form-field>\n </div>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Email Message\" *ngIf=\"message.emailMessage\" name=\"email\">\n <ng-template matTabContent>\n <div class=\"fs-column\">\n <div class=\"fs-row.gap-small\">\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.customize\"\n name=\"customizeEmail\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Format</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.emailMessage.format\"\n name=\"format\">\n <mat-option *ngFor=\"let item of emailMessageFormats\" [value]=\"item.value\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <mat-form-field>\n <mat-label>Template</mat-label>\n <mat-select\n [(ngModel)]=\"message.emailMessage.messageTemplateId\"\n name=\"template\">\n <mat-option [value]=\"null\">None</mat-option>\n <mat-option *ngFor=\"let item of messageTemplates\" [value]=\"item.id\">\n {{item.name}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </div>\n <ng-container *ngIf=\"message.emailMessage.customize\">\n <mat-form-field>\n <mat-label>Subject</mat-label>\n <input\n matInput\n [(ngModel)]=\"message.emailMessage.subject\"\n name=\"name\"\n required>\n </mat-form-field>\n\n <div [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\"\n [config]=\"{ language: 'html '}\">\n </fs-text-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText\">\n <fs-html-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"body\">\n </fs-html-editor>\n </ng-container>\n\n <ng-container *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.body\"\n name=\"emailMessageBody\"\n [config]=\"{ language: 'text' }\">\n </fs-text-editor>\n </ng-container>\n </ng-template>\n </mat-tab>\n <mat-tab\n *ngIf=\"message.emailMessage.format===emailMessageFormat.HTML || message.emailMessage.format===emailMessageFormat.RichText\"\n label=\"Styles\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.emailMessage.styles\"\n name=\"styles\"\n [config]=\"{ language: 'scss' }\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!message.emailMessage.customize\">\n <fs-label-field>\n <fs-label>Subject</fs-label>\n {{message.defaultEmailSubject}}\n </fs-label-field>\n <div>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"email-body-html-default\">\n <fs-html-renderer\n *ngIf=\"message.emailMessage.format===emailMessageFormat.RichText || message.emailMessage.format===emailMessageFormat.HTML\"\n [html]=\"message.defaultEmailBody\">\n </fs-html-renderer>\n </div>\n <div\n class=\"email-body-text-default\"\n *ngIf=\"message.emailMessage.format===emailMessageFormat.Text\">\n {{message.defaultEmailBody}}\n </div>\n </fs-label-field>\n </div>\n </ng-container>\n </div>\n </ng-template>\n </mat-tab>\n\n <ng-container *ngIf=\"!!message.smsMessage\">\n <mat-tab label=\"SMS Message\" name=\"sms\">\n <ng-template matTabContent>\n <mat-form-field>\n <mat-label>Customize Message</mat-label>\n <mat-select\n required\n [(ngModel)]=\"message.smsMessage.customize\"\n name=\"customizeSms\">\n <mat-option [value]=\"true\">Yes</mat-option>\n <mat-option [value]=\"false\">No</mat-option>\n </mat-select>\n </mat-form-field>\n <div\n *ngIf=\"message.smsMessage.customize\"\n [@.disabled]=\"true\">\n <mat-tab-group [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <fs-text-editor\n [(ngModel)]=\"message.smsMessage.message\"\n name=\"smsMessageMessage\"\n [config]=\"{ language: 'text '}\">\n </fs-text-editor>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n <fs-label-field *ngIf=\"!message.smsMessage.customize\">\n <fs-label>Message</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div> \n </fs-label-field>\n </ng-template>\n </mat-tab>\n </ng-container>\n\n <mat-tab label=\"Attachments\" *ngIf=\"message.emailMessage\" name=\"attachments\">\n <ng-template matTabContent>\n <fs-app-message-attachments\n [message]=\"message\">\n </fs-app-message-attachments>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Variables\" *ngIf=\"message.variables\">\n <ng-template matTabContent>\n <div *ngFor=\"let variable of message.variables\" class=\"variable\">\n {{variable.name}}\n </div>\n </ng-template>\n </mat-tab>\n\n <mat-tab label=\"Defaults\">\n <ng-template matTabContent>\n <ng-container *ngIf=\"message.emailMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">Email</h2>\n <fs-label-field>\n <fs-label>Subject</fs-label>\n <div class=\"content\">{{message.defaultEmailSubject}}</div>\n </fs-label-field>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultEmailBody}}</div>\n </fs-label-field>\n </ng-container>\n <ng-container *ngIf=\"message.smsMessage\">\n <h2 *ngIf=\"message.emailMessage && message.smsMessage\">SMS</h2>\n <fs-label-field>\n <fs-label>Content</fs-label>\n <div class=\"content\">{{message.defaultSmsMessage}}</div>\n </fs-label-field>\n </ng-container>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n\n </mat-dialog-content>\n <mat-dialog-actions>\n <ng-container *ngIf=\"tab==='email' || tab==='sms' || tab==='general'; else done\">\n <button\n mat-button\n color=\"primary\">\n Save\n </button>\n <ng-container *ngIf=\"tab==='email'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"openPreview()\"\n type=\"button\">\n Preview\n </button>\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('email')\"\n type=\"button\">\n Send Test Email\n </button>\n </ng-container>\n <ng-container *ngIf=\"tab==='sms'\">\n <button\n mat-button\n type=\"button\"\n (click)=\"sendTest('sms')\"\n type=\"button\">\n Send Test SMS\n </button>\n </ng-container>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Cancel\n </button>\n </ng-container>\n <ng-template #done>\n <button\n mat-button\n color=\"primary\"\n [mat-dialog-close]=\"null\"\n type=\"button\">\n Close\n </button>\n </ng-template>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: ["fs-label-field .content{white-space:pre-wrap}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}:host ::ng-deep .sms-message{width:100%}:host ::ng-deep .email-body-text-default{white-space:pre-line}.fs-column .mat-form-field{flex:1}.email-body-text{width:100%}.variable{margin-bottom:4px}\n"] }]
302
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
303
+ type: Inject,
304
+ args: [FS_APP_MESSAGE_CONFIG]
305
+ }] }, { type: undefined, decorators: [{
306
+ type: Inject,
307
+ args: [MAT_DIALOG_DATA]
310
308
  }] }, { type: i1$2.FsPrompt }, { type: i1$1.FsMessage }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }]; } });
311
309
 
312
- function indexNameValue(arry) {
313
- const obj = {};
314
- arry.forEach(item => {
315
- obj[item.value] = item.name;
316
- });
317
- return obj;
310
+ function indexNameValue(arry) {
311
+ const obj = {};
312
+ arry.forEach(item => {
313
+ obj[item.value] = item.name;
314
+ });
315
+ return obj;
318
316
  }
319
317
 
320
- class MessagesComponent {
321
- constructor(_config, _dialog) {
322
- this._config = _config;
323
- this._dialog = _dialog;
324
- this.list = null;
325
- this.config = null;
326
- this.emailMessageFormats = {};
327
- this._destroy$ = new Subject();
328
- }
329
- ngOnInit() {
330
- this.emailMessageFormats = indexNameValue(EmailMessageFormats);
331
- this.config = {
332
- filters: [
333
- {
334
- name: 'keyword',
335
- type: ItemType.Keyword,
336
- label: 'Search'
337
- }
338
- ],
339
- fetch: query => {
340
- return this._config.loadMessages(query)
341
- .pipe(map(response => {
342
- return ({ data: response.data, paging: response.paging });
343
- }));
344
- }
345
- };
346
- }
347
- open(message) {
348
- const dialogRef = this._dialog.open(MessageComponent, {
349
- data: {
350
- message: message,
351
- },
352
- width: '85%'
353
- });
354
- dialogRef.afterClosed()
355
- .pipe(takeUntil(this._destroy$))
356
- .subscribe(() => {
357
- this.list.reload();
358
- });
359
- }
360
- ngOnDestroy() {
361
- this._destroy$.next();
362
- this._destroy$.complete();
363
- }
364
- }
365
- MessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MessagesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
366
- MessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: MessagesComponent, selector: "fs-app-messages", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Format\">\n <ng-template fs-list-cell let-row=\"row\">\n {{emailMessageFormats[row.emailMessage.format]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: MessagesComponent, decorators: [{
368
- type: Component,
369
- args: [{ selector: 'fs-app-messages', template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Format\">\n <ng-template fs-list-cell let-row=\"row\">\n {{emailMessageFormats[row.emailMessage.format]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
370
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
371
- type: Inject,
372
- args: [FS_APP_MESSAGE_CONFIG]
373
- }] }, { type: i1.MatDialog }]; }, propDecorators: { list: [{
374
- type: ViewChild,
375
- args: [FsListComponent, { static: true }]
318
+ class MessagesComponent {
319
+ constructor(_config, _dialog) {
320
+ this._config = _config;
321
+ this._dialog = _dialog;
322
+ this.list = null;
323
+ this.config = null;
324
+ this.emailMessageFormats = {};
325
+ this._destroy$ = new Subject();
326
+ }
327
+ ngOnInit() {
328
+ this.emailMessageFormats = indexNameValue(EmailMessageFormats);
329
+ this.config = {
330
+ filters: [
331
+ {
332
+ name: 'keyword',
333
+ type: ItemType.Keyword,
334
+ label: 'Search'
335
+ }
336
+ ],
337
+ fetch: query => {
338
+ return this._config.loadMessages(query)
339
+ .pipe(map(response => {
340
+ return ({ data: response.data, paging: response.paging });
341
+ }));
342
+ }
343
+ };
344
+ }
345
+ open(message) {
346
+ const dialogRef = this._dialog.open(MessageComponent, {
347
+ data: {
348
+ message: message,
349
+ },
350
+ width: '85%'
351
+ });
352
+ dialogRef.afterClosed()
353
+ .pipe(takeUntil(this._destroy$))
354
+ .subscribe(() => {
355
+ this.list.reload();
356
+ });
357
+ }
358
+ ngOnDestroy() {
359
+ this._destroy$.next();
360
+ this._destroy$.complete();
361
+ }
362
+ }
363
+ MessagesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessagesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
364
+ MessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: MessagesComponent, selector: "fs-app-messages", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Format\">\n <ng-template fs-list-cell let-row=\"row\">\n {{emailMessageFormats[row.emailMessage.format]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n", dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: MessagesComponent, decorators: [{
366
+ type: Component,
367
+ args: [{ selector: 'fs-app-messages', template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\" name=\"name\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Format\">\n <ng-template fs-list-cell let-row=\"row\">\n {{emailMessageFormats[row.emailMessage.format]}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Email Message Template\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.emailMessage.messageTemplate?.name || 'None'}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Customized Message\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessage?.customize || row.smsMessage?.customize; else noCustomize\">\n <ng-container *ngIf=\"row.emailMessage?.customize\">\n {{row.emailMessage.customize ? 'Email' : ''}}\n </ng-container> \n <ng-container *ngIf=\"row.smsMessage?.customize\">\n {{row.smsMessage.customize ? 'SMS' : ''}}\n </ng-container> \n </ng-container>\n <ng-template #noCustomize>\n None\n </ng-template>\n </ng-template>\n </fs-list-column>\n</fs-list>\n" }]
368
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
369
+ type: Inject,
370
+ args: [FS_APP_MESSAGE_CONFIG]
371
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { list: [{
372
+ type: ViewChild,
373
+ args: [FsListComponent, { static: true }]
376
374
  }] } });
377
375
 
378
- class FsAppMessagesModule {
379
- }
380
- FsAppMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
381
- FsAppMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagesModule, declarations: [MessagesComponent,
382
- MessageComponent,
383
- AttachmentsComponent], imports: [RouterModule,
384
- CommonModule,
385
- FormsModule,
386
- MatDialogModule,
387
- MatButtonModule,
388
- MatTabsModule,
389
- MatFormFieldModule,
390
- MatInputModule,
391
- MatOptionModule,
392
- MatSelectModule,
393
- MatTooltipModule,
394
- MatCheckboxModule,
395
- FsDialogModule,
396
- FsListModule,
397
- FsLabelModule,
398
- FsSkeletonModule,
399
- FsFormModule,
400
- FsTextEditorModule,
401
- FsHtmlEditorModule,
402
- FsHtmlRendererModule,
403
- FsCommonModule,
404
- FsTabsModule,
405
- FsAppMessagePreviewModule], exports: [MessagesComponent,
406
- MessageComponent] });
407
- FsAppMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagesModule, imports: [[
408
- RouterModule,
409
- CommonModule,
410
- FormsModule,
411
- MatDialogModule,
412
- MatButtonModule,
413
- MatTabsModule,
414
- MatFormFieldModule,
415
- MatInputModule,
416
- MatOptionModule,
417
- MatSelectModule,
418
- MatTooltipModule,
419
- MatCheckboxModule,
420
- FsDialogModule,
421
- FsListModule,
422
- FsLabelModule,
423
- FsSkeletonModule,
424
- FsFormModule,
425
- FsTextEditorModule,
426
- FsHtmlEditorModule,
427
- FsHtmlRendererModule,
428
- FsCommonModule,
429
- FsTabsModule,
430
- FsAppMessagePreviewModule,
431
- ]] });
432
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessagesModule, decorators: [{
433
- type: NgModule,
434
- args: [{
435
- imports: [
436
- RouterModule,
437
- CommonModule,
438
- FormsModule,
439
- MatDialogModule,
440
- MatButtonModule,
441
- MatTabsModule,
442
- MatFormFieldModule,
443
- MatInputModule,
444
- MatOptionModule,
445
- MatSelectModule,
446
- MatTooltipModule,
447
- MatCheckboxModule,
448
- FsDialogModule,
449
- FsListModule,
450
- FsLabelModule,
451
- FsSkeletonModule,
452
- FsFormModule,
453
- FsTextEditorModule,
454
- FsHtmlEditorModule,
455
- FsHtmlRendererModule,
456
- FsCommonModule,
457
- FsTabsModule,
458
- FsAppMessagePreviewModule,
459
- ],
460
- declarations: [
461
- MessagesComponent,
462
- MessageComponent,
463
- AttachmentsComponent,
464
- ],
465
- exports: [
466
- MessagesComponent,
467
- MessageComponent,
468
- ],
469
- }]
376
+ class FsAppMessagesModule {
377
+ }
378
+ FsAppMessagesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
379
+ FsAppMessagesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagesModule, declarations: [MessagesComponent,
380
+ MessageComponent,
381
+ AttachmentsComponent], imports: [RouterModule,
382
+ CommonModule,
383
+ FormsModule,
384
+ MatDialogModule,
385
+ MatButtonModule,
386
+ MatTabsModule,
387
+ MatFormFieldModule,
388
+ MatInputModule,
389
+ MatOptionModule,
390
+ MatSelectModule,
391
+ MatTooltipModule,
392
+ MatCheckboxModule,
393
+ FsDialogModule,
394
+ FsListModule,
395
+ FsLabelModule,
396
+ FsSkeletonModule,
397
+ FsFormModule,
398
+ FsTextEditorModule,
399
+ FsHtmlEditorModule,
400
+ FsHtmlRendererModule,
401
+ FsCommonModule,
402
+ FsTabsModule,
403
+ FsAppMessagePreviewModule], exports: [MessagesComponent,
404
+ MessageComponent] });
405
+ FsAppMessagesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagesModule, imports: [RouterModule,
406
+ CommonModule,
407
+ FormsModule,
408
+ MatDialogModule,
409
+ MatButtonModule,
410
+ MatTabsModule,
411
+ MatFormFieldModule,
412
+ MatInputModule,
413
+ MatOptionModule,
414
+ MatSelectModule,
415
+ MatTooltipModule,
416
+ MatCheckboxModule,
417
+ FsDialogModule,
418
+ FsListModule,
419
+ FsLabelModule,
420
+ FsSkeletonModule,
421
+ FsFormModule,
422
+ FsTextEditorModule,
423
+ FsHtmlEditorModule,
424
+ FsHtmlRendererModule,
425
+ FsCommonModule,
426
+ FsTabsModule,
427
+ FsAppMessagePreviewModule] });
428
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessagesModule, decorators: [{
429
+ type: NgModule,
430
+ args: [{
431
+ imports: [
432
+ RouterModule,
433
+ CommonModule,
434
+ FormsModule,
435
+ MatDialogModule,
436
+ MatButtonModule,
437
+ MatTabsModule,
438
+ MatFormFieldModule,
439
+ MatInputModule,
440
+ MatOptionModule,
441
+ MatSelectModule,
442
+ MatTooltipModule,
443
+ MatCheckboxModule,
444
+ FsDialogModule,
445
+ FsListModule,
446
+ FsLabelModule,
447
+ FsSkeletonModule,
448
+ FsFormModule,
449
+ FsTextEditorModule,
450
+ FsHtmlEditorModule,
451
+ FsHtmlRendererModule,
452
+ FsCommonModule,
453
+ FsTabsModule,
454
+ FsAppMessagePreviewModule,
455
+ ],
456
+ declarations: [
457
+ MessagesComponent,
458
+ MessageComponent,
459
+ AttachmentsComponent,
460
+ ],
461
+ exports: [
462
+ MessagesComponent,
463
+ MessageComponent,
464
+ ],
465
+ }]
470
466
  }] });
471
467
 
472
- var MessageQueueState;
473
- (function (MessageQueueState) {
474
- MessageQueueState["Sent"] = "S";
475
- MessageQueueState["PartiallySent"] = "P";
476
- MessageQueueState["Sending"] = "E";
477
- MessageQueueState["Queued"] = "Q";
478
- MessageQueueState["Canceled"] = "C";
479
- MessageQueueState["InvalidRecipients"] = "I";
480
- MessageQueueState["Failed"] = "F";
468
+ var MessageQueueState;
469
+ (function (MessageQueueState) {
470
+ MessageQueueState["Sent"] = "S";
471
+ MessageQueueState["PartiallySent"] = "P";
472
+ MessageQueueState["Sending"] = "E";
473
+ MessageQueueState["Queued"] = "Q";
474
+ MessageQueueState["Canceled"] = "C";
475
+ MessageQueueState["InvalidRecipients"] = "I";
476
+ MessageQueueState["Failed"] = "F";
481
477
  })(MessageQueueState || (MessageQueueState = {}));
482
478
 
483
- const MessageQueueStates = [
484
- { name: 'Sent', value: MessageQueueState.Sent },
485
- { name: 'Partially Sent', value: MessageQueueState.PartiallySent },
486
- { name: 'Sending', value: MessageQueueState.Sending },
487
- { name: 'Queued', value: MessageQueueState.Queued },
488
- { name: 'Canceled', value: MessageQueueState.Canceled },
489
- { name: 'Invalid Recipients', value: MessageQueueState.InvalidRecipients },
490
- { name: 'Failed', value: MessageQueueState.Failed }
479
+ const MessageQueueStates = [
480
+ { name: 'Sent', value: MessageQueueState.Sent },
481
+ { name: 'Partially Sent', value: MessageQueueState.PartiallySent },
482
+ { name: 'Sending', value: MessageQueueState.Sending },
483
+ { name: 'Queued', value: MessageQueueState.Queued },
484
+ { name: 'Canceled', value: MessageQueueState.Canceled },
485
+ { name: 'Invalid Recipients', value: MessageQueueState.InvalidRecipients },
486
+ { name: 'Failed', value: MessageQueueState.Failed }
491
487
  ];
492
488
 
493
- var EmailMessageQueueFormat;
494
- (function (EmailMessageQueueFormat) {
495
- EmailMessageQueueFormat["Text"] = "T";
496
- EmailMessageQueueFormat["HTML"] = "H";
497
- EmailMessageQueueFormat["RichText"] = "R";
489
+ var EmailMessageQueueFormat;
490
+ (function (EmailMessageQueueFormat) {
491
+ EmailMessageQueueFormat["Text"] = "T";
492
+ EmailMessageQueueFormat["HTML"] = "H";
493
+ EmailMessageQueueFormat["RichText"] = "R";
498
494
  })(EmailMessageQueueFormat || (EmailMessageQueueFormat = {}));
499
495
 
500
- var MessageQueueType;
501
- (function (MessageQueueType) {
502
- MessageQueueType["Sms"] = "S";
503
- MessageQueueType["Email"] = "E";
496
+ var MessageQueueType;
497
+ (function (MessageQueueType) {
498
+ MessageQueueType["Sms"] = "S";
499
+ MessageQueueType["Email"] = "E";
504
500
  })(MessageQueueType || (MessageQueueType = {}));
505
501
 
506
- var MessageQueueEventType;
507
- (function (MessageQueueEventType) {
508
- MessageQueueEventType["Click"] = "click";
509
- MessageQueueEventType["Open"] = "open";
502
+ var MessageQueueEventType;
503
+ (function (MessageQueueEventType) {
504
+ MessageQueueEventType["Click"] = "click";
505
+ MessageQueueEventType["Open"] = "open";
510
506
  })(MessageQueueEventType || (MessageQueueEventType = {}));
511
507
 
512
- const MessageQueueEventTypes = [
513
- { name: 'Open', value: MessageQueueEventType.Open },
514
- { name: 'Click', value: MessageQueueEventType.Click },
508
+ const MessageQueueEventTypes = [
509
+ { name: 'Open', value: MessageQueueEventType.Open },
510
+ { name: 'Click', value: MessageQueueEventType.Click },
515
511
  ];
516
512
 
517
- class RecipientComponent {
518
- ngOnInit() {
519
- const icons = {
520
- 'S': { name: 'check_circle', tooltip: 'Sent' },
521
- 'E': { name: 'offline_bolt', tooltip: 'Sending' },
522
- 'F': { name: 'info', tooltip: 'Failed' },
523
- };
524
- this.icon = icons[this.state];
525
- }
526
- }
527
- RecipientComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RecipientComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
528
- RecipientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: RecipientComponent, selector: "app-recipient", inputs: { name: "name", state: "state" }, ngImport: i0, template: "<span class=\"recipient\">\n <span class=\"name\">{{name}}</span>\n <mat-icon *ngIf=\"icon\" [class]=\"'state-' + state\" [matTooltip]=\"icon.tooltip\">{{icon.name}}</mat-icon>\n</span>", styles: ["mat-icon{font-size:14px;width:14px;height:14px;line-height:normal;margin-left:2px}mat-icon.state-S{color:#5fa099}mat-icon.state-E{color:#fbbc04}mat-icon.state-F{color:#d8524e}.recipient{display:inline-flex;align-items:center}\n"], components: [{ type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$2.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: RecipientComponent, decorators: [{
530
- type: Component,
531
- args: [{ selector: 'app-recipient', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"recipient\">\n <span class=\"name\">{{name}}</span>\n <mat-icon *ngIf=\"icon\" [class]=\"'state-' + state\" [matTooltip]=\"icon.tooltip\">{{icon.name}}</mat-icon>\n</span>", styles: ["mat-icon{font-size:14px;width:14px;height:14px;line-height:normal;margin-left:2px}mat-icon.state-S{color:#5fa099}mat-icon.state-E{color:#fbbc04}mat-icon.state-F{color:#d8524e}.recipient{display:inline-flex;align-items:center}\n"] }]
532
- }], propDecorators: { name: [{
533
- type: Input
534
- }], state: [{
535
- type: Input
513
+ class RecipientComponent {
514
+ ngOnInit() {
515
+ const icons = {
516
+ 'S': { name: 'check_circle', tooltip: 'Sent' },
517
+ 'E': { name: 'offline_bolt', tooltip: 'Sending' },
518
+ 'F': { name: 'info', tooltip: 'Failed' },
519
+ };
520
+ this.icon = icons[this.state];
521
+ }
522
+ }
523
+ RecipientComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecipientComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
524
+ RecipientComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: RecipientComponent, selector: "app-recipient", inputs: { name: "name", state: "state" }, ngImport: i0, template: "<span class=\"recipient\">\n <span class=\"name\">{{name}}</span>\n <mat-icon *ngIf=\"icon\" [class]=\"'state-' + state\" [matTooltip]=\"icon.tooltip\">{{icon.name}}</mat-icon>\n</span>", styles: ["mat-icon{font-size:14px;width:14px;height:14px;line-height:normal;margin-left:2px}mat-icon.state-S{color:#5fa099}mat-icon.state-E{color:#fbbc04}mat-icon.state-F{color:#d8524e}.recipient{display:inline-flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: RecipientComponent, decorators: [{
526
+ type: Component,
527
+ args: [{ selector: 'app-recipient', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"recipient\">\n <span class=\"name\">{{name}}</span>\n <mat-icon *ngIf=\"icon\" [class]=\"'state-' + state\" [matTooltip]=\"icon.tooltip\">{{icon.name}}</mat-icon>\n</span>", styles: ["mat-icon{font-size:14px;width:14px;height:14px;line-height:normal;margin-left:2px}mat-icon.state-S{color:#5fa099}mat-icon.state-E{color:#fbbc04}mat-icon.state-F{color:#d8524e}.recipient{display:inline-flex;align-items:center}\n"] }]
528
+ }], propDecorators: { name: [{
529
+ type: Input
530
+ }], state: [{
531
+ type: Input
536
532
  }] } });
537
533
 
538
- class QueueComponent {
539
- constructor(_config, _data, _message, _prompt, _dialog, _cdRef) {
540
- this._config = _config;
541
- this._data = _data;
542
- this._message = _message;
543
- this._prompt = _prompt;
544
- this._dialog = _dialog;
545
- this._cdRef = _cdRef;
546
- this.messageQueueRecipients = {};
547
- this.emailMessageQueueFormat = EmailMessageQueueFormat;
548
- this.MessageQueueEventTypes = indexNameValue(MessageQueueEventTypes);
549
- this.MessageQueueEventType = MessageQueueEventType;
550
- this._destroy$ = new Subject();
551
- }
552
- ngOnInit() {
553
- this.messageQueueStates = indexNameValue(MessageQueueStates);
554
- this.resendMessageQueue = this._config.resendMessageQueue;
555
- this.forwardMessageQueue = this._config.forwardMessageQueue;
556
- this._config.loadMessageQueue(this._data.messageQueueId)
557
- .subscribe((messageQueue) => {
558
- this.messageQueue = messageQueue;
559
- if (this.messageQueue.emailMessageQueue) {
560
- let body = this.messageQueue.emailMessageQueue.body;
561
- if (this.messageQueue.emailMessageQueue.format === EmailMessageQueueFormat.HTML) {
562
- try {
563
- const doc = new DOMParser().parseFromString(body, 'text/html');
564
- doc.querySelectorAll('a').forEach((el) => {
565
- el.setAttribute('target', '_blank');
566
- });
567
- body = doc.documentElement.innerHTML;
568
- }
569
- catch (e) {
570
- }
571
- }
572
- else {
573
- body = this.anchorMe(body);
574
- }
575
- this.messageQueue.emailMessageQueue.body = body;
576
- }
577
- if (this.messageQueue.smsMessageQueue) {
578
- this.messageQueue.smsMessageQueue.body = this.anchorMe(this.messageQueue.smsMessageQueue.body);
579
- }
580
- this.messageQueueRecipients = this.messageQueue.messageQueueRecipients
581
- .reduce((accum, messageQueueRecipient) => {
582
- accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
583
- return accum;
584
- }, {});
585
- this._setLogsConfig(messageQueue);
586
- this._setAttachmentsConfig(messageQueue);
587
- this._setEventsConfig(messageQueue);
588
- this._cdRef.markForCheck();
589
- });
590
- }
591
- anchorMe(input) {
592
- return anchorme({
593
- input,
594
- options: {
595
- attributes: {
596
- target: "_blank",
597
- }
598
- }
599
- });
600
- }
601
- openMessage(message) {
602
- this._dialog.open(MessageComponent, {
603
- data: {
604
- message: message,
605
- },
606
- width: '85%'
607
- });
608
- }
609
- resend() {
610
- this._prompt.confirm({
611
- title: 'Confirm',
612
- template: 'Are you sure you would like to resend this message?'
613
- }).subscribe(() => {
614
- this.resendMessageQueue(this.messageQueue)
615
- .subscribe(messageQueue => {
616
- Object.assign(this.messageQueue, messageQueue);
617
- this._cdRef.markForCheck();
618
- this._message.success('Successfully resent');
619
- if (this.logList) {
620
- this.logList.reload();
621
- }
622
- });
623
- });
624
- }
625
- forward() {
626
- const typeName = this.messageQueue.type === MessageQueueType.Email ? 'an email' : 'a phone number';
627
- this._prompt.input({
628
- label: `Please enter ${typeName} to forward to`,
629
- title: 'Forward Message',
630
- commitLabel: 'Forward',
631
- required: true
632
- }).subscribe((value) => {
633
- if (value) {
634
- this.forwardMessageQueue(this.messageQueue, value)
635
- .subscribe(messageQueue => {
636
- this.messageQueue = {
637
- ...this.messageQueue,
638
- messageQueue,
639
- };
640
- this._message.success('Successfully forwarded');
641
- this._cdRef.markForCheck();
642
- if (this.logList) {
643
- this.logList.reload();
644
- }
645
- });
646
- }
647
- });
648
- }
649
- ngOnDestroy() {
650
- this._destroy$.next();
651
- this._destroy$.complete();
652
- }
653
- _setLogsConfig(messageQueue) {
654
- this.logConfig = {
655
- loadMore: true,
656
- queryParam: false,
657
- fetch: query => {
658
- return this._config.loadLogs(messageQueue, query);
659
- }
660
- };
661
- }
662
- _setEventsConfig(messageQueue) {
663
- this.eventConfig = {
664
- loadMore: true,
665
- queryParam: false,
666
- fetch: (query) => {
667
- return this._config.loadMessageQueueEvents(messageQueue, query);
668
- }
669
- };
670
- }
671
- _setAttachmentsConfig(messageQueue) {
672
- this.attachmentConfig = {
673
- queryParam: false,
674
- fetch: query => {
675
- return this._config.loadMessageQueueAttachments(messageQueue, query)
676
- .pipe(map(response => ({
677
- data: response.data.map(value => {
678
- value.prettyFilesize = this._prettyFilesize(value.filesize);
679
- return value;
680
- }), paging: response.paging
681
- })));
682
- }
683
- };
684
- if (this._config.downloadMessageQueueAttachment) {
685
- this.attachmentConfig.rowActions = [
686
- {
687
- click: (messageAttachment) => {
688
- this._config.downloadMessageQueueAttachment(messageAttachment, this.messageQueue);
689
- },
690
- label: 'Download',
691
- }
692
- ];
693
- }
694
- }
695
- _prettyFilesize(bytes) {
696
- if (bytes === 0) {
697
- return '0.00 B';
698
- }
699
- const e = Math.floor(Math.log(bytes) / Math.log(1024));
700
- return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
701
- }
702
- }
703
- QueueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueueComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i1$2.FsPrompt }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
704
- QueueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: QueueComponent, selector: "ng-component", viewQueries: [{ propertyName: "logList", first: true, predicate: ["logList"], descendants: true }], ngImport: i0, template: "<fs-dialog *fsSkeleton=\"messageQueue\">\n <div mat-dialog-title>Message Queue</div>\n <mat-dialog-content>\n <mat-tab-group>\n <mat-tab label=\"Overview\">\n <ng-template matTabContent>\n <div class=\"fs-row.gap-large.wrap\">\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Recipients\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.toRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.ccRecipients.length\">\n <fs-label>\n CC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.ccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.bccRecipients.length\">\n <fs-label>\n BCC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.bccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.fromName || messageQueue.emailMessageQueue.fromEmail\">\n <fs-label>\n From\n </fs-label>\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromName === messageQueue.emailMessageQueue.fromEmail; else fromEmailName\">\n {{messageQueue.emailMessageQueue.fromName}}\n </ng-container>\n\n <ng-template #fromEmailName>\n {{messageQueue.emailMessageQueue.fromName}}\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromEmail\">\n ({{messageQueue.emailMessageQueue.fromEmail}})\n </ng-container>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.replyEmail && messageQueue.emailMessageQueue.replyEmail.length\">\n <fs-label>\n Reply To\n </fs-label>\n {{messageQueue.emailMessageQueue.replyEmail.join(', ')}}\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Number\n </fs-label>\n <app-recipient \n [state]=\"messageQueue.state\"\n [name]=\"messageQueue.smsMessageQueue.toNumber\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.smsMessageQueue.fromNumber\">\n <fs-label>\n From Number\n </fs-label>\n {{messageQueue.smsMessageQueue.fromNumber}}\n </fs-label-field>\n </ng-container>\n \n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{messageQueue.scheduledDate | fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{messageQueueStates[messageQueue.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.message\">\n <fs-label>\n Message Type\n </fs-label>\n <a\n (click)=\"openMessage(messageQueue.message)\"\n *ngIf=\"loadMessage; else elseMessage\">\n {{messageQueue.message.name}}\n </a>\n <ng-template #elseMessage>\n {{messageQueue.message.name}}\n </ng-template>\n </fs-label-field>\n </div>\n\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field class=\"subject\">\n <fs-label>\n Subject\n </fs-label>\n {{messageQueue.emailMessageQueue.subject}}\n </fs-label-field>\n\n <fs-label-field class=\"body\">\n <fs-label>\n Body\n </fs-label>\n <div\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.Text\"\n class=\"format-text\"\n [innerHTML]=\"messageQueue.emailMessageQueue.body\">\n </div>\n <fs-iframe\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.HTML || messageQueue.emailMessageQueue.format===emailMessageQueueFormat.RichText\"\n [html]=\"messageQueue.emailMessageQueue.body\"\n [width]=\"'100%'\">\n </fs-iframe>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n <div\n class=\"format-text\"\n [innerHTML]=\"messageQueue.smsMessageQueue.body\">\n </div>\n </fs-label-field>\n </ng-container>\n\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Logs\">\n <ng-template matTabContent>\n <fs-list [config]=\"logConfig\" #logList>\n <fs-list-column title=\"Message\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createdDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Attachments\">\n <ng-template matTabContent>\n <fs-list [config]=\"attachmentConfig\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.prettyFilesize}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Events\">\n <ng-template matTabContent>\n <fs-list [config]=\"eventConfig\">\n <fs-list-column title=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Event\">\n <ng-template fs-list-cell let-row=\"row\">\n {{MessageQueueEventTypes[row.type]}}\n <div class=\"small\" *ngIf=\"row.type === MessageQueueEventType.Click\">\n <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.createDate | fsDateFormat: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n color=\"primary\">\n Done\n </button>\n <button\n mat-button\n *ngIf=\"resendMessageQueue\"\n type=\"button\"\n (click)=\"resend()\"\n type=\"button\">\n Resend\n </button>\n <button\n mat-button\n *ngIf=\"forwardMessageQueue\"\n type=\"button\"\n (click)=\"forward()\"\n type=\"button\">\n Forward\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i5.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i5.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i6$1.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i6$1.FsLabelComponent, selector: "fs-label" }, { type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }, { type: i2.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"] }, { type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i10$1.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i5.MatTabContent, selector: "[matTabContent]" }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }], pipes: { "fsDateFormat": i10$1.FsDateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
705
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueueComponent, decorators: [{
706
- type: Component,
707
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"messageQueue\">\n <div mat-dialog-title>Message Queue</div>\n <mat-dialog-content>\n <mat-tab-group>\n <mat-tab label=\"Overview\">\n <ng-template matTabContent>\n <div class=\"fs-row.gap-large.wrap\">\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Recipients\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.toRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.ccRecipients.length\">\n <fs-label>\n CC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.ccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.bccRecipients.length\">\n <fs-label>\n BCC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.bccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.fromName || messageQueue.emailMessageQueue.fromEmail\">\n <fs-label>\n From\n </fs-label>\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromName === messageQueue.emailMessageQueue.fromEmail; else fromEmailName\">\n {{messageQueue.emailMessageQueue.fromName}}\n </ng-container>\n\n <ng-template #fromEmailName>\n {{messageQueue.emailMessageQueue.fromName}}\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromEmail\">\n ({{messageQueue.emailMessageQueue.fromEmail}})\n </ng-container>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.replyEmail && messageQueue.emailMessageQueue.replyEmail.length\">\n <fs-label>\n Reply To\n </fs-label>\n {{messageQueue.emailMessageQueue.replyEmail.join(', ')}}\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Number\n </fs-label>\n <app-recipient \n [state]=\"messageQueue.state\"\n [name]=\"messageQueue.smsMessageQueue.toNumber\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.smsMessageQueue.fromNumber\">\n <fs-label>\n From Number\n </fs-label>\n {{messageQueue.smsMessageQueue.fromNumber}}\n </fs-label-field>\n </ng-container>\n \n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{messageQueue.scheduledDate | fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{messageQueueStates[messageQueue.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.message\">\n <fs-label>\n Message Type\n </fs-label>\n <a\n (click)=\"openMessage(messageQueue.message)\"\n *ngIf=\"loadMessage; else elseMessage\">\n {{messageQueue.message.name}}\n </a>\n <ng-template #elseMessage>\n {{messageQueue.message.name}}\n </ng-template>\n </fs-label-field>\n </div>\n\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field class=\"subject\">\n <fs-label>\n Subject\n </fs-label>\n {{messageQueue.emailMessageQueue.subject}}\n </fs-label-field>\n\n <fs-label-field class=\"body\">\n <fs-label>\n Body\n </fs-label>\n <div\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.Text\"\n class=\"format-text\"\n [innerHTML]=\"messageQueue.emailMessageQueue.body\">\n </div>\n <fs-iframe\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.HTML || messageQueue.emailMessageQueue.format===emailMessageQueueFormat.RichText\"\n [html]=\"messageQueue.emailMessageQueue.body\"\n [width]=\"'100%'\">\n </fs-iframe>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n <div\n class=\"format-text\"\n [innerHTML]=\"messageQueue.smsMessageQueue.body\">\n </div>\n </fs-label-field>\n </ng-container>\n\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Logs\">\n <ng-template matTabContent>\n <fs-list [config]=\"logConfig\" #logList>\n <fs-list-column title=\"Message\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createdDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Attachments\">\n <ng-template matTabContent>\n <fs-list [config]=\"attachmentConfig\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.prettyFilesize}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Events\">\n <ng-template matTabContent>\n <fs-list [config]=\"eventConfig\">\n <fs-list-column title=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Event\">\n <ng-template fs-list-cell let-row=\"row\">\n {{MessageQueueEventTypes[row.type]}}\n <div class=\"small\" *ngIf=\"row.type === MessageQueueEventType.Click\">\n <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.createDate | fsDateFormat: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n color=\"primary\">\n Done\n </button>\n <button\n mat-button\n *ngIf=\"resendMessageQueue\"\n type=\"button\"\n (click)=\"resend()\"\n type=\"button\">\n Resend\n </button>\n <button\n mat-button\n *ngIf=\"forwardMessageQueue\"\n type=\"button\"\n (click)=\"forward()\"\n type=\"button\">\n Forward\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"] }]
708
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
709
- type: Inject,
710
- args: [FS_APP_MESSAGE_CONFIG]
711
- }] }, { type: undefined, decorators: [{
712
- type: Inject,
713
- args: [MAT_DIALOG_DATA]
714
- }] }, { type: i1$1.FsMessage }, { type: i1$2.FsPrompt }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { logList: [{
715
- type: ViewChild,
716
- args: ['logList']
534
+ class QueueComponent {
535
+ constructor(_config, _data, _message, _prompt, _dialog, _cdRef) {
536
+ this._config = _config;
537
+ this._data = _data;
538
+ this._message = _message;
539
+ this._prompt = _prompt;
540
+ this._dialog = _dialog;
541
+ this._cdRef = _cdRef;
542
+ this.messageQueueRecipients = {};
543
+ this.emailMessageQueueFormat = EmailMessageQueueFormat;
544
+ this.MessageQueueEventTypes = indexNameValue(MessageQueueEventTypes);
545
+ this.MessageQueueEventType = MessageQueueEventType;
546
+ this._destroy$ = new Subject();
547
+ }
548
+ ngOnInit() {
549
+ this.messageQueueStates = indexNameValue(MessageQueueStates);
550
+ this.resendMessageQueue = this._config.resendMessageQueue;
551
+ this.forwardMessageQueue = this._config.forwardMessageQueue;
552
+ this._config.loadMessageQueue(this._data.messageQueueId)
553
+ .subscribe((messageQueue) => {
554
+ this.messageQueue = messageQueue;
555
+ if (this.messageQueue.emailMessageQueue) {
556
+ let body = this.messageQueue.emailMessageQueue.body;
557
+ if (this.messageQueue.emailMessageQueue.format === EmailMessageQueueFormat.HTML) {
558
+ try {
559
+ const doc = new DOMParser().parseFromString(body, 'text/html');
560
+ doc.querySelectorAll('a').forEach((el) => {
561
+ el.setAttribute('target', '_blank');
562
+ });
563
+ body = doc.documentElement.innerHTML;
564
+ }
565
+ catch (e) {
566
+ }
567
+ }
568
+ else {
569
+ body = this.anchorMe(body);
570
+ }
571
+ this.messageQueue.emailMessageQueue.body = body;
572
+ }
573
+ if (this.messageQueue.smsMessageQueue) {
574
+ this.messageQueue.smsMessageQueue.body = this.anchorMe(this.messageQueue.smsMessageQueue.body);
575
+ }
576
+ this.messageQueueRecipients = this.messageQueue.messageQueueRecipients
577
+ .reduce((accum, messageQueueRecipient) => {
578
+ accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
579
+ return accum;
580
+ }, {});
581
+ this._setLogsConfig(messageQueue);
582
+ this._setAttachmentsConfig(messageQueue);
583
+ this._setEventsConfig(messageQueue);
584
+ this._cdRef.markForCheck();
585
+ });
586
+ }
587
+ anchorMe(input) {
588
+ return anchorme({
589
+ input,
590
+ options: {
591
+ attributes: {
592
+ target: "_blank",
593
+ }
594
+ }
595
+ });
596
+ }
597
+ openMessage(message) {
598
+ this._dialog.open(MessageComponent, {
599
+ data: {
600
+ message: message,
601
+ },
602
+ width: '85%'
603
+ });
604
+ }
605
+ resend() {
606
+ this._prompt.confirm({
607
+ title: 'Confirm',
608
+ template: 'Are you sure you would like to resend this message?'
609
+ }).subscribe(() => {
610
+ this.resendMessageQueue(this.messageQueue)
611
+ .subscribe(messageQueue => {
612
+ Object.assign(this.messageQueue, messageQueue);
613
+ this._cdRef.markForCheck();
614
+ this._message.success('Successfully resent');
615
+ if (this.logList) {
616
+ this.logList.reload();
617
+ }
618
+ });
619
+ });
620
+ }
621
+ forward() {
622
+ const typeName = this.messageQueue.type === MessageQueueType.Email ? 'an email' : 'a phone number';
623
+ this._prompt.input({
624
+ label: `Please enter ${typeName} to forward to`,
625
+ title: 'Forward Message',
626
+ commitLabel: 'Forward',
627
+ required: true
628
+ }).subscribe((value) => {
629
+ if (value) {
630
+ this.forwardMessageQueue(this.messageQueue, value)
631
+ .subscribe(messageQueue => {
632
+ this.messageQueue = {
633
+ ...this.messageQueue,
634
+ messageQueue,
635
+ };
636
+ this._message.success('Successfully forwarded');
637
+ this._cdRef.markForCheck();
638
+ if (this.logList) {
639
+ this.logList.reload();
640
+ }
641
+ });
642
+ }
643
+ });
644
+ }
645
+ ngOnDestroy() {
646
+ this._destroy$.next();
647
+ this._destroy$.complete();
648
+ }
649
+ _setLogsConfig(messageQueue) {
650
+ this.logConfig = {
651
+ loadMore: true,
652
+ queryParam: false,
653
+ fetch: query => {
654
+ return this._config.loadLogs(messageQueue, query);
655
+ }
656
+ };
657
+ }
658
+ _setEventsConfig(messageQueue) {
659
+ this.eventConfig = {
660
+ loadMore: true,
661
+ queryParam: false,
662
+ fetch: (query) => {
663
+ return this._config.loadMessageQueueEvents(messageQueue, query);
664
+ }
665
+ };
666
+ }
667
+ _setAttachmentsConfig(messageQueue) {
668
+ this.attachmentConfig = {
669
+ queryParam: false,
670
+ fetch: query => {
671
+ return this._config.loadMessageQueueAttachments(messageQueue, query)
672
+ .pipe(map(response => ({
673
+ data: response.data.map(value => {
674
+ value.prettyFilesize = this._prettyFilesize(value.filesize);
675
+ return value;
676
+ }), paging: response.paging
677
+ })));
678
+ }
679
+ };
680
+ if (this._config.downloadMessageQueueAttachment) {
681
+ this.attachmentConfig.rowActions = [
682
+ {
683
+ click: (messageAttachment) => {
684
+ this._config.downloadMessageQueueAttachment(messageAttachment, this.messageQueue);
685
+ },
686
+ label: 'Download',
687
+ }
688
+ ];
689
+ }
690
+ }
691
+ _prettyFilesize(bytes) {
692
+ if (bytes === 0) {
693
+ return '0.00 B';
694
+ }
695
+ const e = Math.floor(Math.log(bytes) / Math.log(1024));
696
+ return (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + ' KMGTP'.charAt(e) + 'B';
697
+ }
698
+ }
699
+ QueueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: QueueComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: MAT_DIALOG_DATA }, { token: i1$1.FsMessage }, { token: i1$2.FsPrompt }, { token: i1.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
700
+ QueueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: QueueComponent, selector: "ng-component", viewQueries: [{ propertyName: "logList", first: true, predicate: ["logList"], descendants: true }], ngImport: i0, template: "<fs-dialog *fsSkeleton=\"messageQueue\">\n <div mat-dialog-title>Message Queue</div>\n <mat-dialog-content>\n <mat-tab-group>\n <mat-tab label=\"Overview\">\n <ng-template matTabContent>\n <div class=\"fs-row.gap-large.wrap\">\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Recipients\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.toRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.ccRecipients.length\">\n <fs-label>\n CC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.ccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.bccRecipients.length\">\n <fs-label>\n BCC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.bccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.fromName || messageQueue.emailMessageQueue.fromEmail\">\n <fs-label>\n From\n </fs-label>\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromName === messageQueue.emailMessageQueue.fromEmail; else fromEmailName\">\n {{messageQueue.emailMessageQueue.fromName}}\n </ng-container>\n\n <ng-template #fromEmailName>\n {{messageQueue.emailMessageQueue.fromName}}\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromEmail\">\n ({{messageQueue.emailMessageQueue.fromEmail}})\n </ng-container>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.replyEmail && messageQueue.emailMessageQueue.replyEmail.length\">\n <fs-label>\n Reply To\n </fs-label>\n {{messageQueue.emailMessageQueue.replyEmail.join(', ')}}\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Number\n </fs-label>\n <app-recipient \n [state]=\"messageQueue.state\"\n [name]=\"messageQueue.smsMessageQueue.toNumber\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.smsMessageQueue.fromNumber\">\n <fs-label>\n From Number\n </fs-label>\n {{messageQueue.smsMessageQueue.fromNumber}}\n </fs-label-field>\n </ng-container>\n \n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{messageQueue.scheduledDate | fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{messageQueueStates[messageQueue.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.message\">\n <fs-label>\n Message Type\n </fs-label>\n <a\n (click)=\"openMessage(messageQueue.message)\"\n *ngIf=\"loadMessage; else elseMessage\">\n {{messageQueue.message.name}}\n </a>\n <ng-template #elseMessage>\n {{messageQueue.message.name}}\n </ng-template>\n </fs-label-field>\n </div>\n\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field class=\"subject\">\n <fs-label>\n Subject\n </fs-label>\n {{messageQueue.emailMessageQueue.subject}}\n </fs-label-field>\n\n <fs-label-field class=\"body\">\n <fs-label>\n Body\n </fs-label>\n <div\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.Text\"\n class=\"format-text\"\n [innerHTML]=\"messageQueue.emailMessageQueue.body\">\n </div>\n <fs-iframe\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.HTML || messageQueue.emailMessageQueue.format===emailMessageQueueFormat.RichText\"\n [html]=\"messageQueue.emailMessageQueue.body\"\n [width]=\"'100%'\">\n </fs-iframe>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n <div\n class=\"format-text\"\n [innerHTML]=\"messageQueue.smsMessageQueue.body\">\n </div>\n </fs-label-field>\n </ng-container>\n\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Logs\">\n <ng-template matTabContent>\n <fs-list [config]=\"logConfig\" #logList>\n <fs-list-column title=\"Message\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createdDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Attachments\">\n <ng-template matTabContent>\n <fs-list [config]=\"attachmentConfig\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.prettyFilesize}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Events\">\n <ng-template matTabContent>\n <fs-list [config]=\"eventConfig\">\n <fs-list-column title=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Event\">\n <ng-template fs-list-cell let-row=\"row\">\n {{MessageQueueEventTypes[row.type]}}\n <div class=\"small\" *ngIf=\"row.type === MessageQueueEventType.Click\">\n <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.createDate | fsDateFormat: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n color=\"primary\">\n Done\n </button>\n <button\n mat-button\n *ngIf=\"resendMessageQueue\"\n type=\"button\"\n (click)=\"resend()\"\n type=\"button\">\n Resend\n </button>\n <button\n mat-button\n *ngIf=\"forwardMessageQueue\"\n type=\"button\"\n (click)=\"forward()\"\n type=\"button\">\n Forward\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: i3.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "component", type: i13.FsLabelComponent, selector: "fs-label" }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i10$1.FsDateAgoComponent, selector: "fs-date-ago", inputs: ["date", "showTime", "format", "showTooltip", "tooltipDateFormat"] }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i4.FsIFrameComponent, selector: "fs-iframe", inputs: ["html", "src", "styles", "width", "height"] }, { kind: "component", type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }, { kind: "pipe", type: i10$1.FsDateFormatPipe, name: "fsDateFormat" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
701
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: QueueComponent, decorators: [{
702
+ type: Component,
703
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-dialog *fsSkeleton=\"messageQueue\">\n <div mat-dialog-title>Message Queue</div>\n <mat-dialog-content>\n <mat-tab-group>\n <mat-tab label=\"Overview\">\n <ng-template matTabContent>\n <div class=\"fs-row.gap-large.wrap\">\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Recipients\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.toRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.ccRecipients.length\">\n <fs-label>\n CC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.ccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.bccRecipients.length\">\n <fs-label>\n BCC\n </fs-label>\n <app-recipient \n *ngFor=\"let recipient of messageQueue.emailMessageQueue.bccRecipients\"\n [state]=\"messageQueueRecipients[recipient]\"\n [name]=\"recipient\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.fromName || messageQueue.emailMessageQueue.fromEmail\">\n <fs-label>\n From\n </fs-label>\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromName === messageQueue.emailMessageQueue.fromEmail; else fromEmailName\">\n {{messageQueue.emailMessageQueue.fromName}}\n </ng-container>\n\n <ng-template #fromEmailName>\n {{messageQueue.emailMessageQueue.fromName}}\n <ng-container *ngIf=\"messageQueue.emailMessageQueue.fromEmail\">\n ({{messageQueue.emailMessageQueue.fromEmail}})\n </ng-container>\n </ng-template>\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.emailMessageQueue.replyEmail && messageQueue.emailMessageQueue.replyEmail.length\">\n <fs-label>\n Reply To\n </fs-label>\n {{messageQueue.emailMessageQueue.replyEmail.join(', ')}}\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n To Number\n </fs-label>\n <app-recipient \n [state]=\"messageQueue.state\"\n [name]=\"messageQueue.smsMessageQueue.toNumber\">\n </app-recipient> \n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.smsMessageQueue.fromNumber\">\n <fs-label>\n From Number\n </fs-label>\n {{messageQueue.smsMessageQueue.fromNumber}}\n </fs-label-field>\n </ng-container>\n \n <fs-label-field>\n <fs-label>\n Date\n </fs-label>\n {{messageQueue.scheduledDate | fsDateFormat: 'full-date-time'}}\n </fs-label-field>\n\n <fs-label-field>\n <fs-label>\n Status\n </fs-label>\n {{messageQueueStates[messageQueue.state]}}\n </fs-label-field>\n\n <fs-label-field *ngIf=\"messageQueue.message\">\n <fs-label>\n Message Type\n </fs-label>\n <a\n (click)=\"openMessage(messageQueue.message)\"\n *ngIf=\"loadMessage; else elseMessage\">\n {{messageQueue.message.name}}\n </a>\n <ng-template #elseMessage>\n {{messageQueue.message.name}}\n </ng-template>\n </fs-label-field>\n </div>\n\n <ng-container *ngIf=\"messageQueue.emailMessageQueue\">\n <fs-label-field class=\"subject\">\n <fs-label>\n Subject\n </fs-label>\n {{messageQueue.emailMessageQueue.subject}}\n </fs-label-field>\n\n <fs-label-field class=\"body\">\n <fs-label>\n Body\n </fs-label>\n <div\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.Text\"\n class=\"format-text\"\n [innerHTML]=\"messageQueue.emailMessageQueue.body\">\n </div>\n <fs-iframe\n *ngIf=\"messageQueue.emailMessageQueue.format===emailMessageQueueFormat.HTML || messageQueue.emailMessageQueue.format===emailMessageQueueFormat.RichText\"\n [html]=\"messageQueue.emailMessageQueue.body\"\n [width]=\"'100%'\">\n </fs-iframe>\n </fs-label-field>\n </ng-container>\n\n <ng-container *ngIf=\"messageQueue.smsMessageQueue\">\n <fs-label-field>\n <fs-label>\n Message\n </fs-label>\n <div\n class=\"format-text\"\n [innerHTML]=\"messageQueue.smsMessageQueue.body\">\n </div>\n </fs-label-field>\n </ng-container>\n\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Logs\">\n <ng-template matTabContent>\n <fs-list [config]=\"logConfig\" #logList>\n <fs-list-column title=\"Message\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.message}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n <fs-date-ago [date]=\"row.createdDate\"></fs-date-ago>\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Attachments\">\n <ng-template matTabContent>\n <fs-list [config]=\"attachmentConfig\">\n <fs-list-column title=\"File Name\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.filename}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"File Size\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.prettyFilesize}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Events\">\n <ng-template matTabContent>\n <fs-list [config]=\"eventConfig\">\n <fs-list-column title=\"Recipient\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.messageQueueRecipient.recipient}}\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Event\">\n <ng-template fs-list-cell let-row=\"row\">\n {{MessageQueueEventTypes[row.type]}}\n <div class=\"small\" *ngIf=\"row.type === MessageQueueEventType.Click\">\n <a [href]=\"row.meta?.url\" target=\"_blank\">{{row.meta?.url}}</a>\n </div>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Date\">\n <ng-template fs-list-cell let-row=\"row\">\n {{row.createDate | fsDateFormat: 'date-time-yearless'}}\n </ng-template>\n </fs-list-column>\n </fs-list>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button\n mat-button\n [mat-dialog-close]=\"null\"\n color=\"primary\">\n Done\n </button>\n <button\n mat-button\n *ngIf=\"resendMessageQueue\"\n type=\"button\"\n (click)=\"resend()\"\n type=\"button\">\n Resend\n </button>\n <button\n mat-button\n *ngIf=\"forwardMessageQueue\"\n type=\"button\"\n (click)=\"forward()\"\n type=\"button\">\n Forward\n </button>\n </mat-dialog-actions>\n</fs-dialog>\n", styles: [".subject,.body{display:block;margin-top:15px}.format-text{white-space:pre-wrap}app-recipient{display:block}\n"] }]
704
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
705
+ type: Inject,
706
+ args: [FS_APP_MESSAGE_CONFIG]
707
+ }] }, { type: undefined, decorators: [{
708
+ type: Inject,
709
+ args: [MAT_DIALOG_DATA]
710
+ }] }, { type: i1$1.FsMessage }, { type: i1$2.FsPrompt }, { type: i1.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { logList: [{
711
+ type: ViewChild,
712
+ args: ['logList']
717
713
  }] } });
718
714
 
719
- class FsMessageQueueService {
720
- constructor(_dialog) {
721
- this._dialog = _dialog;
722
- }
723
- openMessageQueue(messageQueueId, options = {}) {
724
- return this._dialog.open(QueueComponent, {
725
- ...options,
726
- data: {
727
- messageQueueId,
728
- },
729
- width: options.width || '85%',
730
- })
731
- .afterClosed();
732
- }
733
- }
734
- FsMessageQueueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMessageQueueService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
735
- FsMessageQueueService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMessageQueueService, providedIn: 'root' });
736
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMessageQueueService, decorators: [{
737
- type: Injectable,
738
- args: [{
739
- providedIn: 'root',
740
- }]
715
+ class FsMessageQueueService {
716
+ constructor(_dialog) {
717
+ this._dialog = _dialog;
718
+ }
719
+ openMessageQueue(messageQueueId, options = {}) {
720
+ return this._dialog.open(QueueComponent, {
721
+ ...options,
722
+ data: {
723
+ messageQueueId,
724
+ },
725
+ width: options.width || '85%',
726
+ })
727
+ .afterClosed();
728
+ }
729
+ }
730
+ FsMessageQueueService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsMessageQueueService, deps: [{ token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
731
+ FsMessageQueueService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsMessageQueueService, providedIn: 'root' });
732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsMessageQueueService, decorators: [{
733
+ type: Injectable,
734
+ args: [{
735
+ providedIn: 'root',
736
+ }]
741
737
  }], ctorParameters: function () { return [{ type: i1.MatDialog }]; } });
742
738
 
743
- class TruncatePipe {
744
- transform(value, limit = 25, completeWords = false, ellipsis = '...') {
745
- if (value.length < limit) {
746
- return `${value.substr(0, limit)}`;
747
- }
748
- if (completeWords) {
749
- limit = value.substr(0, limit).lastIndexOf(' ');
750
- }
751
- return `${value.substr(0, limit)}${ellipsis}`;
752
- }
753
- }
754
- TruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
755
- TruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TruncatePipe, name: "truncate" });
756
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TruncatePipe, decorators: [{
757
- type: Pipe,
758
- args: [{
759
- name: 'truncate'
760
- }]
739
+ class TruncatePipe {
740
+ transform(value, limit = 25, completeWords = false, ellipsis = '...') {
741
+ if (value.length < limit) {
742
+ return `${value.substr(0, limit)}`;
743
+ }
744
+ if (completeWords) {
745
+ limit = value.substr(0, limit).lastIndexOf(' ');
746
+ }
747
+ return `${value.substr(0, limit)}${ellipsis}`;
748
+ }
749
+ }
750
+ TruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
751
+ TruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TruncatePipe, name: "truncate" });
752
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TruncatePipe, decorators: [{
753
+ type: Pipe,
754
+ args: [{
755
+ name: 'truncate'
756
+ }]
761
757
  }] });
762
758
 
763
- class QueuesComponent {
764
- constructor(_config, _messageQueueService, _cdRef, _store) {
765
- this._config = _config;
766
- this._messageQueueService = _messageQueueService;
767
- this._cdRef = _cdRef;
768
- this._store = _store;
769
- this.list = null;
770
- this.query = {};
771
- this.type = null;
772
- this.config = null;
773
- this.messageQueueStates = {};
774
- this.MessageQueueState = MessageQueueState;
775
- this._destroy$ = new Subject();
776
- }
777
- ngOnInit() {
778
- this.messageQueueStates = indexNameValue(MessageQueueStates);
779
- this.initList();
780
- this.initWebhook();
781
- }
782
- enableWebhook() {
783
- this._config.createWebhook()
784
- .subscribe(() => {
785
- this.initWebhook();
786
- });
787
- }
788
- initWebhook() {
789
- const domain = document.location.hostname;
790
- if (domain === 'localhost' || domain === '[::1]') {
791
- return;
792
- }
793
- this._config.loadWebhooks({ domain })
794
- .pipe(filter(() => {
795
- return !this._store.get('messagesWebhookEnabled');
796
- }))
797
- .subscribe((webhooks) => {
798
- this._cdRef.markForCheck();
799
- this.webHookEnabled = webhooks
800
- .some((webhook) => {
801
- const url = new URL(webhook.url);
802
- return url.host === domain;
803
- });
804
- this._store.set('messagesWebhookEnabled', this.webHookEnabled);
805
- });
806
- }
807
- initList() {
808
- this.config = {
809
- filters: [
810
- {
811
- name: 'keyword',
812
- type: ItemType.Keyword,
813
- label: 'Search',
814
- },
815
- {
816
- name: 'state',
817
- type: ItemType.Select,
818
- label: 'Status',
819
- values: () => {
820
- return MessageQueueStates;
821
- },
822
- },
823
- {
824
- name: 'date',
825
- type: ItemType.DateRange,
826
- label: ['From Date', 'To Date'],
827
- },
828
- ],
829
- sort: { value: 'created_date', direction: 'desc' },
830
- fetch: (query) => {
831
- query = {
832
- ...query,
833
- ...this.query,
834
- type: this.type,
835
- messageQueueAttachmentCounts: true,
836
- emailMessageQueues: true,
837
- emailMessageQueueBodies: false,
838
- smsMessageQueues: true,
839
- };
840
- return this._config.loadMessageQueues(query)
841
- .pipe(map((response) => ({
842
- data: response.data
843
- .map((messageQueue) => {
844
- return {
845
- ...messageQueue,
846
- scheduled: messageQueue.state === MessageQueueState.Queued && isAfter(messageQueue.scheduledDate, new Date()),
847
- messageQueueRecipients: messageQueue.messageQueueRecipients
848
- .reduce((accum, messageQueueRecipient) => {
849
- accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
850
- return accum;
851
- }, {}),
852
- };
853
- }), paging: response.paging,
854
- })));
855
- },
856
- };
857
- if (this._config.bulkMessageQueues) {
858
- this.config.selection = {
859
- selectAll: false,
860
- actions: [
861
- {
862
- type: SelectionActionType.Action,
863
- name: 'queue',
864
- label: 'Queue',
865
- },
866
- {
867
- type: SelectionActionType.Action,
868
- name: 'resend',
869
- label: 'Resend',
870
- },
871
- {
872
- type: SelectionActionType.Action,
873
- name: 'cancel',
874
- label: 'Cancel',
875
- },
876
- ],
877
- actionSelected: (actionSelected) => {
878
- return this._config.bulkMessageQueues(actionSelected.action.name, actionSelected.selected)
879
- .pipe(tap(() => {
880
- this.list.reload();
881
- }));
882
- },
883
- };
884
- }
885
- this.config.filters.push({
886
- name: 'messageId',
887
- type: ItemType.Select,
888
- label: 'Message Type',
889
- values: (query) => {
890
- query = {
891
- ...query,
892
- limit: 50,
893
- };
894
- return this._config.loadMessages(query)
895
- .pipe(map((response) => {
896
- return [
897
- { value: null, name: 'All' },
898
- ...response.data
899
- .map((item) => ({ name: item.name, value: item.id })),
900
- ];
901
- }));
902
- },
903
- });
904
- }
905
- open(messageQueue) {
906
- this._messageQueueService.openMessageQueue(messageQueue.id)
907
- .pipe(takeUntil(this._destroy$))
908
- .subscribe(() => {
909
- this.list.reload();
910
- });
911
- }
912
- ngOnDestroy() {
913
- this._destroy$.next();
914
- this._destroy$.complete();
915
- }
916
- }
917
- QueuesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueuesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: FsMessageQueueService }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsStore }], target: i0.ɵɵFactoryTarget.Component });
918
- QueuesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: QueuesComponent, selector: "fs-app-message-queues", inputs: { query: "query", type: "type" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<fs-list [config]=\"config\" #list>\n <fs-list-column title=\"Message\" name=\"subject\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <a (click)=\"open(row)\">{{row.smsMessageQueue.body|truncate:100}}</a>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Recipients\" class=\"col-recipients\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <ng-container *ngIf=\"row.emailMessageQueue.toRecipients.length; else unspecified\">\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.toRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.ccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.bccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <ng-container *ngIf=\"row.smsMessageQueue.toNumber; else unspecified\">\n <app-recipient \n class=\"small\"\n [state]=\"row.state\"\n [name]=\"row.smsMessageQueue.toNumber\">\n </app-recipient>\n </ng-container>\n </ng-container>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Status\" class=\"col-state\">\n <ng-template fs-list-cell let-row=\"row\"> \n <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Date\" name=\"created_date\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createdDate | fsDateFormat: 'date-time-yeardiff' }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n\n<ng-template #unspecified>\n <app-recipient \n class=\"small\"\n [state]=\"MessageQueueState.Failed\"\n name=\"Unspecified\">\n </app-recipient>\n</ng-template>", styles: [":host ::ng-deep .col-recipients small+small:before{content:\", \"}:host ::ng-deep .col-state .state-F,:host ::ng-deep .col-state .state-P{color:#d8524e}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"], components: [{ type: i1$1.FsMessageInfoComponent, selector: "fs-message-info" }, { type: i3.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }], directives: [{ type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { type: i3$2.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i17.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "truncate": TruncatePipe, "fsDateFormat": i10$1.FsDateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
919
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: QueuesComponent, decorators: [{
920
- type: Component,
921
- args: [{ selector: 'fs-app-message-queues', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<fs-list [config]=\"config\" #list>\n <fs-list-column title=\"Message\" name=\"subject\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <a (click)=\"open(row)\">{{row.smsMessageQueue.body|truncate:100}}</a>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Recipients\" class=\"col-recipients\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <ng-container *ngIf=\"row.emailMessageQueue.toRecipients.length; else unspecified\">\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.toRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.ccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.bccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <ng-container *ngIf=\"row.smsMessageQueue.toNumber; else unspecified\">\n <app-recipient \n class=\"small\"\n [state]=\"row.state\"\n [name]=\"row.smsMessageQueue.toNumber\">\n </app-recipient>\n </ng-container>\n </ng-container>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Status\" class=\"col-state\">\n <ng-template fs-list-cell let-row=\"row\"> \n <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Date\" name=\"created_date\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createdDate | fsDateFormat: 'date-time-yeardiff' }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n\n<ng-template #unspecified>\n <app-recipient \n class=\"small\"\n [state]=\"MessageQueueState.Failed\"\n name=\"Unspecified\">\n </app-recipient>\n</ng-template>", styles: [":host ::ng-deep .col-recipients small+small:before{content:\", \"}:host ::ng-deep .col-state .state-F,:host ::ng-deep .col-state .state-P{color:#d8524e}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"] }]
922
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
923
- type: Inject,
924
- args: [FS_APP_MESSAGE_CONFIG]
925
- }] }, { type: FsMessageQueueService }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsStore }]; }, propDecorators: { list: [{
926
- type: ViewChild,
927
- args: [FsListComponent, { static: true }]
928
- }], query: [{
929
- type: Input
930
- }], type: [{
931
- type: Input
759
+ class QueuesComponent {
760
+ constructor(_config, _messageQueueService, _cdRef, _store) {
761
+ this._config = _config;
762
+ this._messageQueueService = _messageQueueService;
763
+ this._cdRef = _cdRef;
764
+ this._store = _store;
765
+ this.list = null;
766
+ this.query = {};
767
+ this.type = null;
768
+ this.config = null;
769
+ this.messageQueueStates = {};
770
+ this.MessageQueueState = MessageQueueState;
771
+ this._destroy$ = new Subject();
772
+ }
773
+ ngOnInit() {
774
+ this.messageQueueStates = indexNameValue(MessageQueueStates);
775
+ this.initList();
776
+ this.initWebhook();
777
+ }
778
+ enableWebhook() {
779
+ this._config.createWebhook()
780
+ .subscribe(() => {
781
+ this.initWebhook();
782
+ });
783
+ }
784
+ initWebhook() {
785
+ const domain = document.location.hostname;
786
+ if (domain === 'localhost' || domain === '[::1]') {
787
+ return;
788
+ }
789
+ this._config.loadWebhooks({ domain })
790
+ .pipe(filter(() => {
791
+ return !this._store.get('messagesWebhookEnabled');
792
+ }))
793
+ .subscribe((webhooks) => {
794
+ this._cdRef.markForCheck();
795
+ this.webHookEnabled = webhooks
796
+ .some((webhook) => {
797
+ const url = new URL(webhook.url);
798
+ return url.host === domain;
799
+ });
800
+ this._store.set('messagesWebhookEnabled', this.webHookEnabled);
801
+ });
802
+ }
803
+ initList() {
804
+ this.config = {
805
+ filters: [
806
+ {
807
+ name: 'keyword',
808
+ type: ItemType.Keyword,
809
+ label: 'Search',
810
+ },
811
+ {
812
+ name: 'state',
813
+ type: ItemType.Select,
814
+ label: 'Status',
815
+ values: () => {
816
+ return MessageQueueStates;
817
+ },
818
+ },
819
+ {
820
+ name: 'date',
821
+ type: ItemType.DateRange,
822
+ label: ['From Date', 'To Date'],
823
+ },
824
+ ],
825
+ sort: { value: 'created_date', direction: 'desc' },
826
+ fetch: (query) => {
827
+ query = {
828
+ ...query,
829
+ ...this.query,
830
+ type: this.type,
831
+ messageQueueAttachmentCounts: true,
832
+ emailMessageQueues: true,
833
+ emailMessageQueueBodies: false,
834
+ smsMessageQueues: true,
835
+ };
836
+ return this._config.loadMessageQueues(query)
837
+ .pipe(map((response) => ({
838
+ data: response.data
839
+ .map((messageQueue) => {
840
+ return {
841
+ ...messageQueue,
842
+ scheduled: messageQueue.state === MessageQueueState.Queued && isAfter(messageQueue.scheduledDate, new Date()),
843
+ messageQueueRecipients: messageQueue.messageQueueRecipients
844
+ .reduce((accum, messageQueueRecipient) => {
845
+ accum[messageQueueRecipient.recipient] = messageQueueRecipient.state;
846
+ return accum;
847
+ }, {}),
848
+ };
849
+ }), paging: response.paging,
850
+ })));
851
+ },
852
+ };
853
+ if (this._config.bulkMessageQueues) {
854
+ this.config.selection = {
855
+ selectAll: false,
856
+ actions: [
857
+ {
858
+ type: SelectionActionType.Action,
859
+ name: 'queue',
860
+ label: 'Queue',
861
+ },
862
+ {
863
+ type: SelectionActionType.Action,
864
+ name: 'resend',
865
+ label: 'Resend',
866
+ },
867
+ {
868
+ type: SelectionActionType.Action,
869
+ name: 'cancel',
870
+ label: 'Cancel',
871
+ },
872
+ ],
873
+ actionSelected: (actionSelected) => {
874
+ return this._config.bulkMessageQueues(actionSelected.action.name, actionSelected.selected)
875
+ .pipe(tap(() => {
876
+ this.list.reload();
877
+ }));
878
+ },
879
+ };
880
+ }
881
+ this.config.filters.push({
882
+ name: 'messageId',
883
+ type: ItemType.Select,
884
+ label: 'Message Type',
885
+ values: (query) => {
886
+ query = {
887
+ ...query,
888
+ limit: 50,
889
+ };
890
+ return this._config.loadMessages(query)
891
+ .pipe(map((response) => {
892
+ return [
893
+ { value: null, name: 'All' },
894
+ ...response.data
895
+ .map((item) => ({ name: item.name, value: item.id })),
896
+ ];
897
+ }));
898
+ },
899
+ });
900
+ }
901
+ open(messageQueue) {
902
+ this._messageQueueService.openMessageQueue(messageQueue.id)
903
+ .pipe(takeUntil(this._destroy$))
904
+ .subscribe(() => {
905
+ this.list.reload();
906
+ });
907
+ }
908
+ ngOnDestroy() {
909
+ this._destroy$.next();
910
+ this._destroy$.complete();
911
+ }
912
+ }
913
+ QueuesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: QueuesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: FsMessageQueueService }, { token: i0.ChangeDetectorRef }, { token: i2$2.FsStore }], target: i0.ɵɵFactoryTarget.Component });
914
+ QueuesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: QueuesComponent, selector: "fs-app-message-queues", inputs: { query: "query", type: "type" }, viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<fs-list [config]=\"config\" #list>\n <fs-list-column title=\"Message\" name=\"subject\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <a (click)=\"open(row)\">{{row.smsMessageQueue.body|truncate:100}}</a>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Recipients\" class=\"col-recipients\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <ng-container *ngIf=\"row.emailMessageQueue.toRecipients.length; else unspecified\">\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.toRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.ccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.bccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <ng-container *ngIf=\"row.smsMessageQueue.toNumber; else unspecified\">\n <app-recipient \n class=\"small\"\n [state]=\"row.state\"\n [name]=\"row.smsMessageQueue.toNumber\">\n </app-recipient>\n </ng-container>\n </ng-container>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Status\" class=\"col-state\">\n <ng-template fs-list-cell let-row=\"row\"> \n <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Date\" name=\"created_date\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createdDate | fsDateFormat: 'date-time-yeardiff' }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n\n<ng-template #unspecified>\n <app-recipient \n class=\"small\"\n [state]=\"MessageQueueState.Failed\"\n name=\"Unspecified\">\n </app-recipient>\n</ng-template>", styles: [":host ::ng-deep .col-recipients small+small:before{content:\", \"}:host ::ng-deep .col-state .state-F,:host ::ng-deep .col-state .state-P{color:#d8524e}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"], dependencies: [{ kind: "directive", type: i4$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i5.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i1$1.FsMessageInfoComponent, selector: "fs-message-info" }, { kind: "component", type: RecipientComponent, selector: "app-recipient", inputs: ["name", "state"] }, { kind: "pipe", type: i10$1.FsDateFormatPipe, name: "fsDateFormat" }, { kind: "pipe", type: TruncatePipe, name: "truncate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
915
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: QueuesComponent, decorators: [{
916
+ type: Component,
917
+ args: [{ selector: 'fs-app-message-queues', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"webHookEnabled === false\">\n <fs-message-info>\n <div class=\"fs-row\">\n <span class=\"fs-flex\">The webhook which provides email delivery confirmations is not enabled.</span>\n <a \n (click)=\"enableWebhook()\"\n mat-raised-button>\n Enable\n </a>\n </div>\n\n </fs-message-info>\n</ng-container>\n\n<fs-list [config]=\"config\" #list>\n <fs-list-column title=\"Message\" name=\"subject\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <a (click)=\"open(row)\">{{row.emailMessageQueue.subject|truncate:100}}</a>\n <ng-container *ngIf=\"row.messageQueueAttachmentCount\">\n <mat-icon \n class=\"attachment-icon\"\n [matTooltip]=\"row.messageQueueAttachmentCount + ' Attachment(s)'\">\n attach_file\n </mat-icon>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <a (click)=\"open(row)\">{{row.smsMessageQueue.body|truncate:100}}</a>\n </ng-container>\n </ng-template>\n </fs-list-column>\n <fs-list-column title=\"Recipients\" class=\"col-recipients\">\n <ng-template fs-list-cell let-row=\"row\">\n <ng-container *ngIf=\"row.emailMessageQueue\">\n <ng-container *ngIf=\"row.emailMessageQueue.toRecipients.length; else unspecified\">\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.toRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.ccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n <div class=\"small\" *ngFor=\"let recipient of row.emailMessageQueue.bccRecipients\">\n <app-recipient \n [state]=\"row.messageQueueRecipients[recipient] || row.state\"\n [name]=\"recipient\">\n </app-recipient>\n </div>\n </ng-container>\n <ng-container *ngIf=\"row.smsMessageQueue\">\n <ng-container *ngIf=\"row.smsMessageQueue.toNumber; else unspecified\">\n <app-recipient \n class=\"small\"\n [state]=\"row.state\"\n [name]=\"row.smsMessageQueue.toNumber\">\n </app-recipient>\n </ng-container>\n </ng-container>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Status\" class=\"col-state\">\n <ng-template fs-list-cell let-row=\"row\"> \n <ng-container *ngIf=\"row.scheduled; else state\">\n Scheduled\n <div class=\"small\">\n {{row.scheduledDate | fsDateFormat: 'date-time' }}\n </div>\n </ng-container>\n <ng-template #state>\n <span [class]=\"'state-' + row.state\">{{messageQueueStates[row.state]}}</span>\n </ng-template>\n </ng-template>\n </fs-list-column> \n <fs-list-column title=\"Date\" name=\"created_date\" [sortable]=\"true\">\n <ng-template fs-list-cell let-row=\"row\">\n {{ row.createdDate | fsDateFormat: 'date-time-yeardiff' }}\n </ng-template>\n </fs-list-column>\n</fs-list>\n\n<ng-template #unspecified>\n <app-recipient \n class=\"small\"\n [state]=\"MessageQueueState.Failed\"\n name=\"Unspecified\">\n </app-recipient>\n</ng-template>", styles: [":host ::ng-deep .col-recipients small+small:before{content:\", \"}:host ::ng-deep .col-state .state-F,:host ::ng-deep .col-state .state-P{color:#d8524e}.attachment-icon{vertical-align:bottom}fs-message-info{margin-bottom:10px;display:block}\n"] }]
918
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
919
+ type: Inject,
920
+ args: [FS_APP_MESSAGE_CONFIG]
921
+ }] }, { type: FsMessageQueueService }, { type: i0.ChangeDetectorRef }, { type: i2$2.FsStore }]; }, propDecorators: { list: [{
922
+ type: ViewChild,
923
+ args: [FsListComponent, { static: true }]
924
+ }], query: [{
925
+ type: Input
926
+ }], type: [{
927
+ type: Input
932
928
  }] } });
933
929
 
934
- class LinkifyPipe {
935
- transform(input) {
936
- return anchorme({
937
- input,
938
- options: {
939
- attributes: {
940
- target: "_blank",
941
- }
942
- }
943
- });
944
- }
945
- }
946
- LinkifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LinkifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
947
- LinkifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LinkifyPipe, name: "linkify" });
948
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: LinkifyPipe, decorators: [{
949
- type: Pipe,
950
- args: [{ name: 'linkify' }]
930
+ class LinkifyPipe {
931
+ transform(input) {
932
+ return anchorme({
933
+ input,
934
+ options: {
935
+ attributes: {
936
+ target: "_blank",
937
+ }
938
+ }
939
+ });
940
+ }
941
+ }
942
+ LinkifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
943
+ LinkifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: LinkifyPipe, name: "linkify" });
944
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: LinkifyPipe, decorators: [{
945
+ type: Pipe,
946
+ args: [{ name: 'linkify' }]
951
947
  }] });
952
948
 
953
- class FsAppMessageQueuesModule {
954
- }
955
- FsAppMessageQueuesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageQueuesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
956
- FsAppMessageQueuesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageQueuesModule, declarations: [QueuesComponent,
957
- QueueComponent,
958
- LinkifyPipe,
959
- TruncatePipe,
960
- RecipientComponent], imports: [RouterModule,
961
- FormsModule,
962
- CommonModule,
963
- MatTooltipModule,
964
- MatDialogModule,
965
- MatButtonModule,
966
- MatIconModule,
967
- MatTabsModule,
968
- FsListModule,
969
- FsDialogModule,
970
- FsLabelModule,
971
- FsDateModule,
972
- FsSkeletonModule,
973
- FsAppMessagesModule,
974
- FsFormModule,
975
- FsPromptInputModule,
976
- FsIFrameModule,
977
- FsMessageModule], exports: [QueuesComponent,
978
- QueueComponent] });
979
- FsAppMessageQueuesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageQueuesModule, providers: [
980
- FsMessageQueueService,
981
- ], imports: [[
982
- RouterModule,
983
- FormsModule,
984
- CommonModule,
985
- MatTooltipModule,
986
- MatDialogModule,
987
- MatButtonModule,
988
- MatIconModule,
989
- MatTabsModule,
990
- FsListModule,
991
- FsDialogModule,
992
- FsLabelModule,
993
- FsDateModule,
994
- FsSkeletonModule,
995
- FsAppMessagesModule,
996
- FsFormModule,
997
- FsPromptInputModule,
998
- FsIFrameModule,
999
- FsMessageModule,
1000
- ]] });
1001
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageQueuesModule, decorators: [{
1002
- type: NgModule,
1003
- args: [{
1004
- imports: [
1005
- RouterModule,
1006
- FormsModule,
1007
- CommonModule,
1008
- MatTooltipModule,
1009
- MatDialogModule,
1010
- MatButtonModule,
1011
- MatIconModule,
1012
- MatTabsModule,
1013
- FsListModule,
1014
- FsDialogModule,
1015
- FsLabelModule,
1016
- FsDateModule,
1017
- FsSkeletonModule,
1018
- FsAppMessagesModule,
1019
- FsFormModule,
1020
- FsPromptInputModule,
1021
- FsIFrameModule,
1022
- FsMessageModule,
1023
- ],
1024
- declarations: [
1025
- QueuesComponent,
1026
- QueueComponent,
1027
- LinkifyPipe,
1028
- TruncatePipe,
1029
- RecipientComponent,
1030
- ],
1031
- exports: [
1032
- QueuesComponent,
1033
- QueueComponent,
1034
- ],
1035
- providers: [
1036
- FsMessageQueueService,
1037
- ],
1038
- }]
949
+ class FsAppMessageQueuesModule {
950
+ }
951
+ FsAppMessageQueuesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageQueuesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
952
+ FsAppMessageQueuesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageQueuesModule, declarations: [QueuesComponent,
953
+ QueueComponent,
954
+ LinkifyPipe,
955
+ TruncatePipe,
956
+ RecipientComponent], imports: [RouterModule,
957
+ FormsModule,
958
+ CommonModule,
959
+ MatTooltipModule,
960
+ MatDialogModule,
961
+ MatButtonModule,
962
+ MatIconModule,
963
+ MatTabsModule,
964
+ FsListModule,
965
+ FsDialogModule,
966
+ FsLabelModule,
967
+ FsDateModule,
968
+ FsSkeletonModule,
969
+ FsAppMessagesModule,
970
+ FsFormModule,
971
+ FsPromptInputModule,
972
+ FsIFrameModule,
973
+ FsMessageModule], exports: [QueuesComponent,
974
+ QueueComponent] });
975
+ FsAppMessageQueuesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageQueuesModule, providers: [
976
+ FsMessageQueueService,
977
+ ], imports: [RouterModule,
978
+ FormsModule,
979
+ CommonModule,
980
+ MatTooltipModule,
981
+ MatDialogModule,
982
+ MatButtonModule,
983
+ MatIconModule,
984
+ MatTabsModule,
985
+ FsListModule,
986
+ FsDialogModule,
987
+ FsLabelModule,
988
+ FsDateModule,
989
+ FsSkeletonModule,
990
+ FsAppMessagesModule,
991
+ FsFormModule,
992
+ FsPromptInputModule,
993
+ FsIFrameModule,
994
+ FsMessageModule] });
995
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageQueuesModule, decorators: [{
996
+ type: NgModule,
997
+ args: [{
998
+ imports: [
999
+ RouterModule,
1000
+ FormsModule,
1001
+ CommonModule,
1002
+ MatTooltipModule,
1003
+ MatDialogModule,
1004
+ MatButtonModule,
1005
+ MatIconModule,
1006
+ MatTabsModule,
1007
+ FsListModule,
1008
+ FsDialogModule,
1009
+ FsLabelModule,
1010
+ FsDateModule,
1011
+ FsSkeletonModule,
1012
+ FsAppMessagesModule,
1013
+ FsFormModule,
1014
+ FsPromptInputModule,
1015
+ FsIFrameModule,
1016
+ FsMessageModule,
1017
+ ],
1018
+ declarations: [
1019
+ QueuesComponent,
1020
+ QueueComponent,
1021
+ LinkifyPipe,
1022
+ TruncatePipe,
1023
+ RecipientComponent,
1024
+ ],
1025
+ exports: [
1026
+ QueuesComponent,
1027
+ QueueComponent,
1028
+ ],
1029
+ providers: [
1030
+ FsMessageQueueService,
1031
+ ],
1032
+ }]
1039
1033
  }] });
1040
1034
 
1041
- class TemplateComponent {
1042
- constructor(_data, _config, _dialogRef, _message, _dialog) {
1043
- this._data = _data;
1044
- this._config = _config;
1045
- this._dialogRef = _dialogRef;
1046
- this._message = _message;
1047
- this._dialog = _dialog;
1048
- this.htmlEditorconfig = {
1049
- language: 'html',
1050
- insertSpaces: true,
1051
- tabSize: 2,
1052
- };
1053
- this.cssEditorconfig = {
1054
- language: 'scss',
1055
- insertSpaces: true,
1056
- tabSize: 2,
1057
- };
1058
- this.save = (event) => {
1059
- return this._config.saveMessageTemplate(this.messageTemplate)
1060
- .pipe(tap((messageTemplate) => {
1061
- this._message.success('Saved Changes');
1062
- if (event.submitter === 'save-close') {
1063
- this._dialogRef.close(messageTemplate);
1064
- }
1065
- }));
1066
- };
1067
- }
1068
- ngOnInit() {
1069
- if (this._data.messageTemplate.id) {
1070
- this._config.loadMessageTemplate(this._data.messageTemplate)
1071
- .subscribe(messageTemplate => {
1072
- this.messageTemplate = messageTemplate;
1073
- });
1074
- }
1075
- else {
1076
- this.messageTemplate = {};
1077
- }
1078
- }
1079
- openPreview() {
1080
- this._dialog.open(PreviewComponent, {
1081
- data: {
1082
- styles: this.messageTemplate.styles,
1083
- html: this.messageTemplate.content,
1084
- },
1085
- width: '95%',
1086
- });
1087
- }
1088
- }
1089
- TemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TemplateComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialogRef }, { token: i1$1.FsMessage }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1090
- TemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: TemplateComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"messageTemplate\">\n <div mat-dialog-title>Message Template</div>\n <mat-dialog-content>\n <mat-form-field class=\"name\">\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n name=\"name\"\n >\n </mat-form-field>\n <div [@.disabled]=\"true\">\n <mat-tab-group\n mat-align-tabs=\"start\"\n [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <div class=\"content\">\n <fs-label-field>\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.content\"\n name=\"body\"\n [config]=\"htmlEditorconfig\">\n </fs-text-editor>\n <fs-label-message>\n &#123;$content&#125; will be replaced with the message content.\n </fs-label-message>\n </fs-label-field>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Styles\">\n <ng-template matTabContent>\n <div class=\"styles\">\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.styles\"\n name=\"styles\"\n [config]=\"cssEditorconfig\">\n </fs-text-editor>\n </div>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" name=\"save-close\">Save & Close</button>\n <button mat-button (click)=\"openPreview()\" type=\"button\">Preview</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"], components: [{ type: i4.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i5.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { type: i6$1.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { type: i10.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }, { type: i6$1.FsLabelMessageComponent, selector: "fs-label-message" }, { type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i14.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { type: i15.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i15.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i15.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i16.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { type: i17.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i6.MatLabel, selector: "mat-label" }, { type: i19.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"] }, { type: i15.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i15.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i15.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i16.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { type: i5.MatTabContent, selector: "[matTabContent]" }, { type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: i16.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }] });
1091
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TemplateComponent, decorators: [{
1092
- type: Component,
1093
- args: [{ template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"messageTemplate\">\n <div mat-dialog-title>Message Template</div>\n <mat-dialog-content>\n <mat-form-field class=\"name\">\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n name=\"name\"\n >\n </mat-form-field>\n <div [@.disabled]=\"true\">\n <mat-tab-group\n mat-align-tabs=\"start\"\n [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <div class=\"content\">\n <fs-label-field>\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.content\"\n name=\"body\"\n [config]=\"htmlEditorconfig\">\n </fs-text-editor>\n <fs-label-message>\n &#123;$content&#125; will be replaced with the message content.\n </fs-label-message>\n </fs-label-field>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Styles\">\n <ng-template matTabContent>\n <div class=\"styles\">\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.styles\"\n name=\"styles\"\n [config]=\"cssEditorconfig\">\n </fs-text-editor>\n </div>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" name=\"save-close\">Save & Close</button>\n <button mat-button (click)=\"openPreview()\" type=\"button\">Preview</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"] }]
1094
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1095
- type: Inject,
1096
- args: [MAT_DIALOG_DATA]
1097
- }] }, { type: undefined, decorators: [{
1098
- type: Inject,
1099
- args: [FS_APP_MESSAGE_CONFIG]
1035
+ class TemplateComponent {
1036
+ constructor(_data, _config, _dialogRef, _message, _dialog) {
1037
+ this._data = _data;
1038
+ this._config = _config;
1039
+ this._dialogRef = _dialogRef;
1040
+ this._message = _message;
1041
+ this._dialog = _dialog;
1042
+ this.htmlEditorconfig = {
1043
+ language: 'html',
1044
+ insertSpaces: true,
1045
+ tabSize: 2,
1046
+ };
1047
+ this.cssEditorconfig = {
1048
+ language: 'scss',
1049
+ insertSpaces: true,
1050
+ tabSize: 2,
1051
+ };
1052
+ this.save = (event) => {
1053
+ return this._config.saveMessageTemplate(this.messageTemplate)
1054
+ .pipe(tap((messageTemplate) => {
1055
+ this._message.success('Saved Changes');
1056
+ if (event.submitter === 'save-close') {
1057
+ this._dialogRef.close(messageTemplate);
1058
+ }
1059
+ }));
1060
+ };
1061
+ }
1062
+ ngOnInit() {
1063
+ if (this._data.messageTemplate.id) {
1064
+ this._config.loadMessageTemplate(this._data.messageTemplate)
1065
+ .subscribe(messageTemplate => {
1066
+ this.messageTemplate = messageTemplate;
1067
+ });
1068
+ }
1069
+ else {
1070
+ this.messageTemplate = {};
1071
+ }
1072
+ }
1073
+ openPreview() {
1074
+ this._dialog.open(PreviewComponent, {
1075
+ data: {
1076
+ styles: this.messageTemplate.styles,
1077
+ html: this.messageTemplate.content,
1078
+ },
1079
+ width: '95%',
1080
+ });
1081
+ }
1082
+ }
1083
+ TemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TemplateComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialogRef }, { token: i1$1.FsMessage }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1084
+ TemplateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TemplateComponent, selector: "ng-component", ngImport: i0, template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"messageTemplate\">\n <div mat-dialog-title>Message Template</div>\n <mat-dialog-content>\n <mat-form-field class=\"name\">\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n required\n name=\"name\">\n </mat-form-field>\n <div [@.disabled]=\"true\">\n <mat-tab-group\n mat-align-tabs=\"start\"\n [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <div class=\"content\">\n <fs-label-field>\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.content\"\n name=\"body\"\n [config]=\"htmlEditorconfig\">\n </fs-text-editor>\n <fs-label-message>\n &#123;$content&#125; will be replaced with the message content.\n </fs-label-message>\n </fs-label-field>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Styles\">\n <ng-template matTabContent>\n <div class=\"styles\">\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.styles\"\n name=\"styles\"\n [config]=\"cssEditorconfig\">\n </fs-text-editor>\n </div>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" name=\"save-close\">Save & Close</button>\n <button mat-button (click)=\"openPreview()\" type=\"button\">Preview</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i5$1.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: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i5$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i5$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i6.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "directive", type: i6.MatTabContent, selector: "[matTabContent]" }, { kind: "component", type: i8.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i8.MatLabel, selector: "mat-label" }, { kind: "directive", type: i9.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.FsDialogComponent, selector: "fs-dialog", inputs: ["mobileMode", "mobileButtonPlacement", "mobileWidth", "mode", "buttonLayout"] }, { kind: "component", type: i13.FsLabelFieldComponent, selector: "fs-label-field", inputs: ["bottomMargin", "topMargin", "labelMargin"] }, { kind: "component", type: i13.FsLabelMessageComponent, selector: "fs-label-message" }, { kind: "directive", type: i11$1.FsSkeletonContentDirective, selector: "[fsSkeleton]", inputs: ["fsSkeleton", "fsSkeletonPattern"] }, { kind: "directive", type: i12.FsFormDirective, selector: "[fsForm]", inputs: ["wrapperSelector", "messageSelector", "hintSelector", "labelSelector", "autocomplete", "shortcuts", "confirm", "confirmDialog", "confirmDrawer", "confirmBrowser", "confirmTabs", "dirtySubmitButton", "submit", "successDelay", "errorDelay", "tabGroup", "deactivationGuard"], outputs: ["fsForm", "invalid", "valid", "submitted", "reseted", "cleared"], exportAs: ["fsForm"] }, { kind: "directive", type: i12.FsFormRequiredDirective, selector: "[fsFormRequired],[ngModel][required]", inputs: ["fsFormRequired", "required", "fsFormRequiredMessage"] }, { kind: "directive", type: i12.FsFormNoFsValidatorsDirective, selector: "[ngModel]:not([required]):not([fsFormRequired]):not([fsFormCompare]):not([fsFormDateRange]):not([fsFormEmail]):not([fsFormEmails]):not([fsFormFunction]):not([fsFormGreater]):not([fsFormInteger]):not([fsFormLesser]):not([fsFormMax]):not([fsFormMaxLength]):not([fsFormMin]):not([fsFormMinLength]):not([fsFormNumeric]):not([fsFormPattern]):not([fsFormPhone]):not([fsFormUrl]):not([validate])" }, { kind: "directive", type: i12.FsButtonDirective, selector: "[mat-raised-button],[mat-button],[mat-flat-button],[mat-stroked-button]", inputs: ["name", "dirtySubmit", "form"] }, { kind: "component", type: i16.FsTextEditorComponent, selector: "fs-text-editor", inputs: ["config", "scrollable"], outputs: ["ready", "blur"] }] });
1085
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TemplateComponent, decorators: [{
1086
+ type: Component,
1087
+ args: [{ template: "<form\n fsForm\n [submit]=\"save\"\n #form=\"ngForm\"\n *fsSkeleton=\"messageTemplate\"\n [confirmTabs]=\"false\">\n <fs-dialog *ngIf=\"messageTemplate\">\n <div mat-dialog-title>Message Template</div>\n <mat-dialog-content>\n <mat-form-field class=\"name\">\n <mat-label>Name</mat-label>\n <input\n matInput\n [(ngModel)]=\"messageTemplate.name\"\n required\n name=\"name\">\n </mat-form-field>\n <div [@.disabled]=\"true\">\n <mat-tab-group\n mat-align-tabs=\"start\"\n [dynamicHeight]=\"false\">\n <mat-tab label=\"Content\">\n <ng-template matTabContent>\n <div class=\"content\">\n <fs-label-field>\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.content\"\n name=\"body\"\n [config]=\"htmlEditorconfig\">\n </fs-text-editor>\n <fs-label-message>\n &#123;$content&#125; will be replaced with the message content.\n </fs-label-message>\n </fs-label-field>\n </div>\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Styles\">\n <ng-template matTabContent>\n <div class=\"styles\">\n <fs-text-editor\n [(ngModel)]=\"messageTemplate.styles\"\n name=\"styles\"\n [config]=\"cssEditorconfig\">\n </fs-text-editor>\n </div>\n </ng-template>\n </mat-tab>\n </mat-tab-group>\n </div>\n </mat-dialog-content>\n <mat-dialog-actions>\n <button mat-button type=\"submit\" color=\"primary\" name=\"close\">Save</button>\n <button mat-button type=\"submit\" name=\"save-close\">Save & Close</button>\n <button mat-button (click)=\"openPreview()\" type=\"button\">Preview</button>\n <button mat-button [mat-dialog-close]=\"null\" type=\"button\">Cancel</button>\n </mat-dialog-actions>\n </fs-dialog>\n</form>\n", styles: [".name{width:100%}:host ::ng-deep .mat-tab-body-content,:host ::ng-deep .mat-tab-body{overflow:visible}\n"] }]
1088
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1089
+ type: Inject,
1090
+ args: [MAT_DIALOG_DATA]
1091
+ }] }, { type: undefined, decorators: [{
1092
+ type: Inject,
1093
+ args: [FS_APP_MESSAGE_CONFIG]
1100
1094
  }] }, { type: i1.MatDialogRef }, { type: i1$1.FsMessage }, { type: i1.MatDialog }]; } });
1101
1095
 
1102
- class TemplatesComponent {
1103
- constructor(_config, _dialog) {
1104
- this._config = _config;
1105
- this._dialog = _dialog;
1106
- this.list = null;
1107
- this.config = null;
1108
- this.messageQueueStates = [];
1109
- this._destroy$ = new Subject();
1110
- }
1111
- ngOnInit() {
1112
- this.config = {
1113
- actions: [
1114
- {
1115
- label: 'Create',
1116
- click: () => {
1117
- this.open({});
1118
- }
1119
- }
1120
- ],
1121
- status: false,
1122
- fetch: query => {
1123
- return this._config.loadMessageTemplates(query);
1124
- }
1125
- };
1126
- if (this._config.deleteMessageTemplate) {
1127
- this.config.rowActions = [
1128
- {
1129
- click: data => {
1130
- return this._config.deleteMessageTemplate(data);
1131
- },
1132
- remove: {
1133
- title: 'Confirm',
1134
- template: 'Are you sure you would like to delete this template?',
1135
- },
1136
- menu: true,
1137
- label: 'Delete',
1138
- },
1139
- ];
1140
- }
1141
- }
1142
- open(messageTemplate) {
1143
- const dialogRef = this._dialog.open(TemplateComponent, {
1144
- data: {
1145
- messageTemplate,
1146
- },
1147
- width: '85%',
1148
- });
1149
- dialogRef.afterClosed()
1150
- .pipe(takeUntil(this._destroy$))
1151
- .subscribe(() => {
1152
- this.list.reload();
1153
- });
1154
- }
1155
- ngOnDestroy() {
1156
- this._destroy$.next();
1157
- this._destroy$.complete();
1158
- }
1159
- }
1160
- TemplatesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TemplatesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1161
- TemplatesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: TemplatesComponent, selector: "fs-app-message-templates", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n</fs-list>", components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
1162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: TemplatesComponent, decorators: [{
1163
- type: Component,
1164
- args: [{ selector: 'fs-app-message-templates', template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
1165
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1166
- type: Inject,
1167
- args: [FS_APP_MESSAGE_CONFIG]
1168
- }] }, { type: i1.MatDialog }]; }, propDecorators: { list: [{
1169
- type: ViewChild,
1170
- args: [FsListComponent, { static: true }]
1096
+ class TemplatesComponent {
1097
+ constructor(_config, _dialog) {
1098
+ this._config = _config;
1099
+ this._dialog = _dialog;
1100
+ this.list = null;
1101
+ this.config = null;
1102
+ this.messageQueueStates = [];
1103
+ this._destroy$ = new Subject();
1104
+ }
1105
+ ngOnInit() {
1106
+ this.config = {
1107
+ actions: [
1108
+ {
1109
+ label: 'Create',
1110
+ click: () => {
1111
+ this.open({});
1112
+ }
1113
+ }
1114
+ ],
1115
+ status: false,
1116
+ fetch: query => {
1117
+ return this._config.loadMessageTemplates(query);
1118
+ }
1119
+ };
1120
+ if (this._config.deleteMessageTemplate) {
1121
+ this.config.rowActions = [
1122
+ {
1123
+ click: data => {
1124
+ return this._config.deleteMessageTemplate(data);
1125
+ },
1126
+ remove: {
1127
+ title: 'Confirm',
1128
+ template: 'Are you sure you would like to delete this template?',
1129
+ },
1130
+ menu: true,
1131
+ label: 'Delete',
1132
+ },
1133
+ ];
1134
+ }
1135
+ }
1136
+ open(messageTemplate) {
1137
+ const dialogRef = this._dialog.open(TemplateComponent, {
1138
+ data: {
1139
+ messageTemplate,
1140
+ },
1141
+ width: '85%',
1142
+ });
1143
+ dialogRef.afterClosed()
1144
+ .pipe(takeUntil(this._destroy$))
1145
+ .subscribe(() => {
1146
+ this.list.reload();
1147
+ });
1148
+ }
1149
+ ngOnDestroy() {
1150
+ this._destroy$.next();
1151
+ this._destroy$.complete();
1152
+ }
1153
+ }
1154
+ TemplatesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TemplatesComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
1155
+ TemplatesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TemplatesComponent, selector: "fs-app-message-templates", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true, static: true }], ngImport: i0, template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n</fs-list>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }] });
1156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TemplatesComponent, decorators: [{
1157
+ type: Component,
1158
+ args: [{ selector: 'fs-app-message-templates', template: "<fs-list [config]=\"config\">\n <fs-list-column title=\"Name\">\n <ng-template fs-list-cell let-row=\"row\">\n <a (click)=\"open(row)\">{{row.name}}</a>\n </ng-template>\n </fs-list-column>\n</fs-list>" }]
1159
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1160
+ type: Inject,
1161
+ args: [FS_APP_MESSAGE_CONFIG]
1162
+ }] }, { type: i1.MatDialog }]; }, propDecorators: { list: [{
1163
+ type: ViewChild,
1164
+ args: [FsListComponent, { static: true }]
1171
1165
  }] } });
1172
1166
 
1173
- class FsAppMessageTemplatesModule {
1174
- }
1175
- FsAppMessageTemplatesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageTemplatesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1176
- FsAppMessageTemplatesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageTemplatesModule, declarations: [TemplatesComponent,
1177
- TemplateComponent], imports: [RouterModule,
1178
- CommonModule,
1179
- FormsModule,
1180
- MatTooltipModule,
1181
- MatDialogModule,
1182
- MatButtonModule,
1183
- MatTabsModule,
1184
- MatFormFieldModule,
1185
- MatFormFieldModule,
1186
- MatInputModule,
1187
- FsListModule,
1188
- FsDialogModule,
1189
- FsLabelModule,
1190
- FsSkeletonModule,
1191
- FsFormModule,
1192
- FsTextEditorModule,
1193
- FsAppMessagePreviewModule], exports: [TemplatesComponent,
1194
- TemplateComponent] });
1195
- FsAppMessageTemplatesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageTemplatesModule, imports: [[
1196
- RouterModule,
1197
- CommonModule,
1198
- FormsModule,
1199
- MatTooltipModule,
1200
- MatDialogModule,
1201
- MatButtonModule,
1202
- MatTabsModule,
1203
- MatFormFieldModule,
1204
- MatFormFieldModule,
1205
- MatInputModule,
1206
- FsListModule,
1207
- FsDialogModule,
1208
- FsLabelModule,
1209
- FsSkeletonModule,
1210
- FsFormModule,
1211
- FsTextEditorModule,
1212
- FsAppMessagePreviewModule,
1213
- ]] });
1214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageTemplatesModule, decorators: [{
1215
- type: NgModule,
1216
- args: [{
1217
- imports: [
1218
- RouterModule,
1219
- CommonModule,
1220
- FormsModule,
1221
- MatTooltipModule,
1222
- MatDialogModule,
1223
- MatButtonModule,
1224
- MatTabsModule,
1225
- MatFormFieldModule,
1226
- MatFormFieldModule,
1227
- MatInputModule,
1228
- FsListModule,
1229
- FsDialogModule,
1230
- FsLabelModule,
1231
- FsSkeletonModule,
1232
- FsFormModule,
1233
- FsTextEditorModule,
1234
- FsAppMessagePreviewModule,
1235
- ],
1236
- declarations: [
1237
- TemplatesComponent,
1238
- TemplateComponent,
1239
- ],
1240
- exports: [
1241
- TemplatesComponent,
1242
- TemplateComponent,
1243
- ],
1244
- }]
1167
+ class FsAppMessageTemplatesModule {
1168
+ }
1169
+ FsAppMessageTemplatesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageTemplatesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1170
+ FsAppMessageTemplatesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageTemplatesModule, declarations: [TemplatesComponent,
1171
+ TemplateComponent], imports: [RouterModule,
1172
+ CommonModule,
1173
+ FormsModule,
1174
+ MatTooltipModule,
1175
+ MatDialogModule,
1176
+ MatButtonModule,
1177
+ MatTabsModule,
1178
+ MatFormFieldModule,
1179
+ MatFormFieldModule,
1180
+ MatInputModule,
1181
+ FsListModule,
1182
+ FsDialogModule,
1183
+ FsLabelModule,
1184
+ FsSkeletonModule,
1185
+ FsFormModule,
1186
+ FsTextEditorModule,
1187
+ FsAppMessagePreviewModule], exports: [TemplatesComponent,
1188
+ TemplateComponent] });
1189
+ FsAppMessageTemplatesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageTemplatesModule, imports: [RouterModule,
1190
+ CommonModule,
1191
+ FormsModule,
1192
+ MatTooltipModule,
1193
+ MatDialogModule,
1194
+ MatButtonModule,
1195
+ MatTabsModule,
1196
+ MatFormFieldModule,
1197
+ MatFormFieldModule,
1198
+ MatInputModule,
1199
+ FsListModule,
1200
+ FsDialogModule,
1201
+ FsLabelModule,
1202
+ FsSkeletonModule,
1203
+ FsFormModule,
1204
+ FsTextEditorModule,
1205
+ FsAppMessagePreviewModule] });
1206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageTemplatesModule, decorators: [{
1207
+ type: NgModule,
1208
+ args: [{
1209
+ imports: [
1210
+ RouterModule,
1211
+ CommonModule,
1212
+ FormsModule,
1213
+ MatTooltipModule,
1214
+ MatDialogModule,
1215
+ MatButtonModule,
1216
+ MatTabsModule,
1217
+ MatFormFieldModule,
1218
+ MatFormFieldModule,
1219
+ MatInputModule,
1220
+ FsListModule,
1221
+ FsDialogModule,
1222
+ FsLabelModule,
1223
+ FsSkeletonModule,
1224
+ FsFormModule,
1225
+ FsTextEditorModule,
1226
+ FsAppMessagePreviewModule,
1227
+ ],
1228
+ declarations: [
1229
+ TemplatesComponent,
1230
+ TemplateComponent,
1231
+ ],
1232
+ exports: [
1233
+ TemplatesComponent,
1234
+ TemplateComponent,
1235
+ ],
1236
+ }]
1245
1237
  }] });
1246
1238
 
1247
- class WebhooksComponent {
1248
- constructor(_config, _message) {
1249
- this._config = _config;
1250
- this._message = _message;
1251
- }
1252
- ngOnInit() {
1253
- this.listConfig = {
1254
- paging: false,
1255
- actions: [
1256
- {
1257
- click: () => {
1258
- this._config.createWebhook()
1259
- .subscribe(() => {
1260
- this._message.success('Created webhook');
1261
- this.list.reload();
1262
- });
1263
- },
1264
- label: 'Create',
1265
- },
1266
- ],
1267
- rowActions: [
1268
- {
1269
- click: (webhook) => {
1270
- this._config.deleteWebhook(webhook)
1271
- .subscribe(() => {
1272
- this._message.success('Deleted webhook');
1273
- this.list.reload();
1274
- });
1275
- },
1276
- label: 'Delete',
1277
- },
1278
- ],
1279
- fetch: () => {
1280
- return this._config.loadWebhooks({
1281
- domain: window.location.hostname,
1282
- })
1283
- .pipe(map((webhooks) => ({ data: webhooks })));
1284
- },
1285
- };
1286
- }
1287
- }
1288
- WebhooksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: WebhooksComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1289
- WebhooksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: WebhooksComponent, selector: "fs-app-message-webhooks", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\r\n <fs-list-column title=\"URL\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.url}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column title=\"Created\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.createDate | fsDate}}\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>", components: [{ type: i2$1.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }], directives: [{ type: i2$1.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { type: i2$1.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }], pipes: { "fsDate": i10$1.FsDatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1290
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: WebhooksComponent, decorators: [{
1291
- type: Component,
1292
- args: [{ selector: 'fs-app-message-webhooks', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\">\r\n <fs-list-column title=\"URL\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.url}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column title=\"Created\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.createDate | fsDate}}\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>" }]
1293
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1294
- type: Inject,
1295
- args: [FS_APP_MESSAGE_CONFIG]
1296
- }] }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
1297
- type: ViewChild,
1298
- args: [FsListComponent]
1239
+ class WebhooksComponent {
1240
+ constructor(_config, _message) {
1241
+ this._config = _config;
1242
+ this._message = _message;
1243
+ }
1244
+ ngOnInit() {
1245
+ this.listConfig = {
1246
+ paging: false,
1247
+ actions: [
1248
+ {
1249
+ click: () => {
1250
+ this._config.createWebhook()
1251
+ .subscribe(() => {
1252
+ this._message.success('Created webhook');
1253
+ this.list.reload();
1254
+ });
1255
+ },
1256
+ label: 'Create',
1257
+ },
1258
+ ],
1259
+ rowActions: [
1260
+ {
1261
+ click: (webhook) => {
1262
+ this._config.deleteWebhook(webhook)
1263
+ .subscribe(() => {
1264
+ this._message.success('Deleted webhook');
1265
+ this.list.reload();
1266
+ });
1267
+ },
1268
+ label: 'Delete',
1269
+ },
1270
+ ],
1271
+ fetch: () => {
1272
+ return this._config.loadWebhooks({
1273
+ domain: window.location.hostname,
1274
+ })
1275
+ .pipe(map((webhooks) => ({ data: webhooks })));
1276
+ },
1277
+ };
1278
+ }
1279
+ }
1280
+ WebhooksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebhooksComponent, deps: [{ token: FS_APP_MESSAGE_CONFIG }, { token: i1$1.FsMessage }], target: i0.ɵɵFactoryTarget.Component });
1281
+ WebhooksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: WebhooksComponent, selector: "fs-app-message-webhooks", viewQueries: [{ propertyName: "list", first: true, predicate: FsListComponent, descendants: true }], ngImport: i0, template: "<fs-list [config]=\"listConfig\">\r\n <fs-list-column title=\"URL\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.url}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column title=\"Created\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.createDate | fsDate}}\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>", dependencies: [{ kind: "component", type: i2.FsListComponent, selector: "fs-list", inputs: ["config", "loaderLines"], outputs: ["filtersReady"] }, { kind: "directive", type: i2.FsListColumnDirective, selector: "fs-list-column", inputs: ["show", "title", "name", "customize", "sortable", "sortableDefault", "direction", "align", "width", "class"] }, { kind: "directive", type: i2.FsListCellDirective, selector: "[fs-list-cell]", inputs: ["colspan", "align", "class"] }, { kind: "pipe", type: i10$1.FsDatePipe, name: "fsDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: WebhooksComponent, decorators: [{
1283
+ type: Component,
1284
+ args: [{ selector: 'fs-app-message-webhooks', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fs-list [config]=\"listConfig\">\r\n <fs-list-column title=\"URL\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.url}}\r\n </ng-template>\r\n </fs-list-column>\r\n <fs-list-column title=\"Created\">\r\n <ng-template fs-list-cell let-row=\"row\">\r\n {{row.createDate | fsDate}}\r\n </ng-template>\r\n </fs-list-column>\r\n</fs-list>" }]
1285
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1286
+ type: Inject,
1287
+ args: [FS_APP_MESSAGE_CONFIG]
1288
+ }] }, { type: i1$1.FsMessage }]; }, propDecorators: { list: [{
1289
+ type: ViewChild,
1290
+ args: [FsListComponent]
1299
1291
  }] } });
1300
1292
 
1301
- class FsAppMessageWebhooksModule {
1302
- }
1303
- FsAppMessageWebhooksModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageWebhooksModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1304
- FsAppMessageWebhooksModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageWebhooksModule, declarations: [WebhooksComponent], imports: [FsListModule,
1305
- FsDateModule], exports: [WebhooksComponent] });
1306
- FsAppMessageWebhooksModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageWebhooksModule, imports: [[
1307
- FsListModule,
1308
- FsDateModule,
1309
- ]] });
1310
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAppMessageWebhooksModule, decorators: [{
1311
- type: NgModule,
1312
- args: [{
1313
- imports: [
1314
- FsListModule,
1315
- FsDateModule,
1316
- ],
1317
- declarations: [
1318
- WebhooksComponent,
1319
- ],
1320
- exports: [
1321
- WebhooksComponent,
1322
- ],
1323
- }]
1293
+ class FsAppMessageWebhooksModule {
1294
+ }
1295
+ FsAppMessageWebhooksModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageWebhooksModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1296
+ FsAppMessageWebhooksModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageWebhooksModule, declarations: [WebhooksComponent], imports: [FsListModule,
1297
+ FsDateModule], exports: [WebhooksComponent] });
1298
+ FsAppMessageWebhooksModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageWebhooksModule, imports: [FsListModule,
1299
+ FsDateModule] });
1300
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FsAppMessageWebhooksModule, decorators: [{
1301
+ type: NgModule,
1302
+ args: [{
1303
+ imports: [
1304
+ FsListModule,
1305
+ FsDateModule,
1306
+ ],
1307
+ declarations: [
1308
+ WebhooksComponent,
1309
+ ],
1310
+ exports: [
1311
+ WebhooksComponent,
1312
+ ],
1313
+ }]
1324
1314
  }] });
1325
1315
 
1326
- /**
1327
- * Generated bundle index. Do not edit.
1316
+ /**
1317
+ * Generated bundle index. Do not edit.
1328
1318
  */
1329
1319
 
1330
1320
  export { FS_APP_MESSAGE_CONFIG, FsAppMessageModule, FsAppMessageQueuesModule, FsAppMessageTemplatesModule, FsAppMessageWebhooksModule, FsAppMessagesModule, FsMessageQueueService, MessageComponent, MessageQueueType, MessagesComponent, QueueComponent, QueuesComponent, TemplateComponent, TemplatesComponent, WebhooksComponent };